Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Juan BŠez  >  Simple Forms  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: index
Class: Simple Forms
Generate HTML forms grouped in tabs
Author: By
Last change:
Date: 2 years ago
Size: 1,941 bytes
 

Contents

Class file image Download

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

<?php

require 'class.sform.php';


///////FORM///////////////////////////////////////
$sform = new sform (); 
$sform->setmetodo("POST");
$sform->setname("formulario");
$sform->setfuncion("post_formulario.php");

////////CONTROLS FORM/////////////////////////////
$vals=array("1"=>'Huelva',"2"=>'Sevilla',"3"=>'Cadiz',"4"=>'Cordoba');
$sform->addcontrol("nombre","TEXT","Nombre",10,null,'');
$sform->addcontrol("telefono","TEXT","Telefono",8,null,'');
$sform->addcontrol("direccion","TEXT","Direccion",30,null,'');
$sform->addcontrol("seleccionar","CHECKBOX","Sel",5,null,'');
$sform->addcontrol("fecha","DATE","Fecha",7,null,date("d-m-Y"));
$sform->addcontrol("provincia","SELECT","Provincia",20,$vals,'Huelva');
$sform->addcontrol("observaciones","TEXTAREA","Observaciones",113,null,'');
$sform->addcontrol("codcliente","HIDDEN","codcliente",113,null,'');
$sform->setsubmit("guardar");

////////FORM2/////////////////////
$sform2 = new sform (); 
$sform2->setmetodo("POST");
$sform2->setname("formulario2");
$sform2->setfuncion("post_formulario2.php");

////CONTROLS FORM2///////////////
$vals=array("1"=>'Huelva',"2"=>'Sevilla',"3"=>'Cadiz',"4"=>'Cordoba');
$sform2->addcontrol("ccc","TEXT","ccc",10,null,'');
$sform2->addcontrol("banco","TEXT","Banco",10,null,'');
$sform2->addcontrol("entidad","TEXT","Entidad",10,null,'');
$sform2->addcontrol("pagado","CHECKBOX","Pagado",5,null,'');
$sform2->addcontrol("fechapago","DATE","Fpago",7,null,date("d-m-Y"));
$sform2->addcontrol("Descripcion","TEXTAREA","Descripcion",113,null,'');
$sform2->addcontrol("codcliente","HIDDEN","codcliente",113,null,'');
$sform2->setsubmit("guardar");

$tab1=new stab();
//TO SEND ALL FORMS TO POST
//$tab1->setpostall();
$tab1->addtab($sform,'Personales');
$tab1->addtab($sform2,'Facturacion');
$tab1->printtab();

?>

</body>
</html>