Ver Mensaje Individual
  #5 (permalink)  
Antiguo 24/06/2004, 11:00
CesarWeb
 
Fecha de Ingreso: junio-2004
Mensajes: 7
Antigüedad: 19 años, 9 meses
Puntos: 0
Información Aca va el código

Cluster,
aca te envio el codigo que estoy usando, a ver si le encuntras la vuelta tu..!!

Gracias de antemano







class PageFirst extends HTML_QuickForm_Page
{
function buildForm()
{

$this->_formBuilt = true;
$personas = new Personas;
//$persona_id = $_POST['persona_id'];
$persona_id = @$_GET['persona_id'];


$row = $personas->GetDatosPersona($persona_id, 'persona_id');
$nombre = $row[1];
// echo $nombre;

$tabular = '      ';
// Comienzo del Formulario
$html = '';
$html .= '<link href="../css/admin.css" rel="stylesheet" type="text/css">';
$html .= '<BR>';
$html .= '<H3 class="titulo">'.$tabular.'Modificacion o Eliminacion</H3>';
//$html .= '<H3 class="subtitulo">'.$tabular.'Ingrese sus datos personales para modificar los existentes en la DB</H3>';
//$html .= '<H6 class="subtitulo">Usted debe ingresar sus datos personales. Debe llenar de forma obligatoria ciertos campos.</H5><BR>';

$this->addElement('html', $html);

$this->addElement('hidden','id', $persona_id);

$id[] =& HTML_QuickForm::createElement('text', 'id', 'Id:', @array('size' => 20, 'maxlength' => 20, 'value' => $persona_id, disabled));

$this->addGroup( $id, 'idper', 'ID:');//formExpediente


$nombres[] =& HTML_QuickForm::createElement('text','nombre',NULL , array('size' => 20, 'maxlength' => 20, 'value' => $row[1]));
$nombres[] =& HTML_QuickForm::createElement('text', 'apellido',NULL, array('size' => 20, 'maxlength' => 20, 'value' => $row[1]));

$this->addGroup( $nombres, 'formnom', 'Nombre/s:', '/ Apellido');//formExpediente


$doc[] =& HTML_QuickForm::createElement('select','tdoc','Tip o de Documento:',$personas->GetTDocs());
$doc[] =& HTML_QuickForm::createElement('text', 'ndoc', NULL, array('size' => 8, 'maxlength' => 8, 'value' => $row[3]));

$this->addGroup( $doc, 'formdoc', 'Documento:', '/ Nro');//formExpediente

$i=0;
while ($i<=40)
{
$edad[20 + $i] = 20 + $i;
$i++;
}

$this->addElement('select','edad','Edad:',$edad);




$sexo[0] = "M";
$sexo[1] = "F";
$this->addElement('select','sexo','Sexo:',$sexo);



$domicilio[] =& HTML_QuickForm::createElement('text','domicilio',' Domicilio:', array('value' => $row[6]));
$this->addGroup( $domicilio, 'formdomi', 'Domicilio:', '/ Nro');//formExpediente



$this->addElement('select','localidad','Localidad:',$per sonas->GetLocalidades());





$telefonofijo[] =& HTML_QuickForm::createElement('text', 'ctele', NULL, array('size' => 4, 'maxlength' => 4, 'value' => $row[8]));
$telefonofijo[] =& HTML_QuickForm::createElement('text', 'ntele', NULL, array('size' => 7, 'maxlength' => 7, 'value' => $row[9]));

$this->addGroup( $telefonofijo, 'formTelefFijo', 'Caract.:', '/ Nro Telefono');//formExpediente

$telefonomovil[] =& HTML_QuickForm::createElement('text', 'ccelu', NULL, array('size' => 4, 'maxlength' => 4, 'value' => $row[10]));
$telefonomovil[] =& HTML_QuickForm::createElement('text', 'ncelu', NULL, array('size' => 9, 'maxlength' => 9, 'value' => $row[11]));

$this->addGroup( $telefonomovil, 'formTelefMovil', 'Caract.:', '/ Nro Celular');//formExpediente

// register with 'callback' type

$mail[] =& HTML_QuickForm::createElement('text', 'mail', 'Mail:', array('size' => 20, 'maxlength' => 20, 'value' => $row[12]));

$this->addGroup( $mail, 'formMail', 'E - Mail:');//formExpediente

$hs =& $this->addElement('hierselect', 'nestudios', 'Estudios:', array('style' => 'width: 12em;'), '&nbsp;&nbsp;Carrera&nbsp;');
$hs->setOptions($personas->SelectorProfesiones());



$curso[0] = 'Finalizados';
$i=1;
while ($i<=15)
{
$curso[$i] = $i;
$i++;
}



$this->addElement('select','acursado','Curso:',$curso) ;


$this->addElement('text', 'titulo', 'Titulo:', array('size' => 30, 'maxlength' => 30, 'value' => $row[16]));
$this->addRule('titulo', 'Solo las iniciales llevan letras mayusculas', 'callback', 'countUpper');


$this->addElement('text', 'observ', 'Observaciones:', array('size' => 80, 'maxlength' => 100,'value' => $row[17]));
$this->addRule('nota', 'Solo las iniciales llevan letras mayusculas', 'callback', 'countUpper');

// Note how we set the name of the submit button

// Define filters and validation rules

$this->registerRule ( 'validarNroDoc', 'callback', 'nroDNIValido' );
//$this->registerRule ( 'validarAnioExpediente', 'callback', 'anioExpedienteValido' );

//$this->applyFilter('formExpediente[nroExpediente]', 'trim');
//email
$this->addGroupRule('formnom',
array('nombre' => array(
array('El nombre es obligatoriio', 'required'),
array('El nombre sólo puede contener letras', 'lettersonly'),
),
'apellido' => array(
array('El apellido es obligatoriio', 'required'),
array('El apellido sólo puede contener letras', 'lettersonly'),
)
));

$this->addGroupRule('formdoc',
array('ndoc' => array(
array('El nro de documento es obligatoriio', 'required'),
array('El nro de documento sólo puede contener números', 'numeric'),
array('El nº de documento no es valido', 'validarNroDoc'),
)
));


$this->addElement('submit', $this->getButtonName('next'), 'Seguir >>');

$this->addElement('reset', $this->getButtonName('reset'), 'Corregir >>');
$this->addRule('iradYesNo', 'Modificar o Eliminar', 'required');

$this->setDefaultAction('next');
}
}