예제 #1
0
 function armarForm()
 {
     $form = new formBuilder($this->configuracion, "recuperarClave", $this->conexion, '1', 'filtrar');
     /*$form->setSubmitHandler('
     			valor=$("#search_nit").val();
     			$.ajax({
     				type: "GET",
     				url: "'.$this->indice.'formulario='.$this->cripto->codificar_url("no_pagina=recuperarClave&jxajax=consultarnit",$this->configuracion).'&nit="+valor,
     				success: function(respuesta){
     					alert(respuesta);
     				}
     			});
     		');*/
     $form->setInput(array("name" => "search_nit", "etiqueta" => "*Nit o C&eacute;dula <br/>(Sin digito de verificaci&oacute;n)", "tipo" => "text", "clase" => "required number", "complemento" => "maxlength='15'", "ayuda" => "Nit o número de documento del representante legal NO INCLUIR DIGITO DE VERIFICACION"));
     $form->setCSS("");
     return $form;
 }
 function pintarFormFiltro()
 {
     include_once $this->configuracion["raiz_documento"] . $this->configuracion["clases"] . "/ciiu.class.php";
     include_once $this->configuracion["raiz_documento"] . "/plugin/RUP/rup.php";
     $form = new formBuilder($this->configuracion, "consultaProveedores", $this->conexion_consulta, '1', 'filtrar');
     $form->setCaptcha(false);
     /* $form->setInput(array("name"=>"search_nit","etiqueta"=>"*Nit o cedula:","tipo"=>"text","clase"=>"required number","complemento"=>"maxlength='15'","ayuda"=>"Nit o número de documento del representante legal NO INCLUIR DIGITO DE VERIFICACION"));
         $form->setInput(array("name"=>"search_nomEmpresa","etiqueta"=>"*Nombre de la empresa:","tipo"=>"text","clase"=>"required","complemento"=>"size=50"));
         $form->setInput(array("name"=>"search_tipopersona","etiqueta"=>"Tipo de Persona","tipo"=>"radio","data"=>array("Natural"=>"N","Juridica"=>"J")));
         $form->setInput(array("name"=>"search_regimen","etiqueta"=>"Regimen Contributivo","tipo"=>"radio","data"=>array("Comun"=>"C","Simplificado"=>"S")));
         $form->setInput(array("name"=>"search_pyme","etiqueta"=>"Es usted PYME:","tipo"=>"radio","data"=>array("Si"=>"S","No"=>"N")));
         $form->setInput(array("name"=>"search_importacion","etiqueta"=>"Exclusividad Productode importaci&oacute;n","tipo"=>"radio","data"=>array("Si"=>"S","No"=>"N")));
         $form->setInput(array("name"=>"search_registro","etiqueta"=>"Registro Mercantil:","tipo"=>"radio","data"=>array("Si"=>"S","No"=>"N")));
         $form->setInput(array("name"=>"search_registroUnico","etiqueta"=>"Esta inscrito en el Registro &Uacute;nico<br> de proponentes?","tipo"=>"radio","data"=>array("Si"=>"S","No"=>"N"))); //,"complemento"=>array("S"=>"","N"=>"")
        */
     $rup = new rup($this->configuracion);
     $rup->setIdentificador('ACTRUP', 1);
     $rup->setPregunta('RUP');
     $form->setInput(array("name" => "compRUP", "etiqueta" => "DECRETO 1464 DE 2010 (RUP)", "input" => $rup->armar_rup()));
     $ciiu = new ciiu($this->configuracion);
     $ciiu->setIdentificador('ACTCIIU', 1);
     $ciiu->setPregunta('CIIU');
     $ciiu->setAction($this->configuracion["host"] . $this->configuracion["site"] . $this->configuracion["clases"] . "/ciiu.class.php");
     $ciiu->getNumActividades('ciiu_numactciiu');
     $form->setInput(array("name" => "compCIIU", "etiqueta" => "DECRETO 734 DE 2012 (CIIU)", "input" => $ciiu->armar_ciiu()));
     $form->setCSS($this->configuracion['host'] . $this->configuracion['site'] . "/estilo/consulta_proveedores/form.css");
     return $form->buildForm("", "filtrar");
     //	ACTIVIDAD ECONÓMICA SEGÚN RUP [1 o más actividades]
     //	ACTIVIDAD ECONÓMICA SEGÚN CIIU [1 o más actividades]
 }
 public function setupForm($id = null)
 {
     try {
         // call engine
         $engine = EngineAPI::singleton();
         $localvars = localvars::getInstance();
         $validate = new validate();
         // create customer form
         $form = formBuilder::createForm('TimeTracker');
         $form->linkToDatabase(array('table' => 'timeTracking'));
         if (!is_empty($_POST) || session::has('POST')) {
             $processor = formBuilder::createProcessor();
             $processor->processPost();
         }
         // form titles
         $form->insertTitle = "";
         $form->editTitle = "";
         $form->updateTitle = "";
         // if no valid id throw an exception
         if (!$validate->integer($id) && !isnull($id)) {
             throw new Exception(__METHOD__ . '() - Not a valid integer, please check the integer and try again.');
         }
         // form information
         $form->addField(array('name' => 'timeID', 'type' => 'hidden', 'value' => $id, 'primary' => TRUE, 'fieldClass' => 'id', 'showIn' => array(formBuilder::TYPE_INSERT, formBuilder::TYPE_UPDATE)));
         $form->addField(array('name' => 'projectIdLink', 'type' => 'hidden', 'label' => 'Project ID:', 'required' => TRUE, 'fieldClass' => 'projectID'));
         $form->addField(array('name' => 'customerIdLink', 'type' => 'hidden', 'label' => 'Customer ID:', 'fieldClass' => 'customerID', 'required' => TRUE));
         $form->addField(array('name' => 'startTime', 'type' => 'hidden', 'label' => 'start time:', 'fieldClass' => 'startTime', 'required' => TRUE));
         $form->addField(array('name' => 'endTime', 'type' => 'hidden', 'label' => 'end time:', 'fieldClass' => 'endTime', 'required' => TRUE));
         $form->addField(array('name' => 'totalHours', 'type' => 'hidden', 'label' => 'total time:', 'required' => TRUE, 'fieldClass' => 'totalHours'));
         $form->addField(array('name' => "completed", 'label' => "Has this project been completed?", 'showInEditStrip' => TRUE, 'type' => 'boolean', 'duplicates' => TRUE, 'options' => array("YES", "N0")));
         $form->addField(array('name' => "descriptionOfWork", 'label' => "Enter a description of the project:", 'type' => 'textarea'));
         // buttons and submissions
         $form->addField(array('showIn' => array(formBuilder::TYPE_UPDATE), 'name' => 'update', 'type' => 'submit', 'fieldClass' => 'submit', 'value' => 'Update'));
         $form->addField(array('showIn' => array(formBuilder::TYPE_UPDATE), 'name' => 'delete', 'type' => 'delete', 'fieldClass' => 'delete hidden', 'value' => 'Delete'));
         $form->addField(array('showIn' => array(formBuilder::TYPE_INSERT), 'name' => 'insert', 'type' => 'submit', 'fieldClass' => 'submit', 'value' => 'Submit'));
         return '{form name="TimeTracker" display="form"}';
     } catch (Exception $e) {
         errorHandle::errorMsg($e->getMessage());
     }
 }
 public function setupForm($id = null)
 {
     try {
         // call engine
         $engine = EngineAPI::singleton();
         $localvars = localvars::getInstance();
         $validate = new validate();
         // create customer form
         $form = formBuilder::createForm('Projects');
         $form->linkToDatabase(array('table' => 'projects'));
         if (!is_empty($_POST) || session::has('POST')) {
             $processor = formBuilder::createProcessor();
             $processor->processPost();
         }
         // form titles
         $form->insertTitle = "Add Project";
         $form->editTitle = "Edit Project";
         $form->updateTitle = "Edit Project";
         // if no valid id throw an exception
         if (!$validate->integer($id) && !isnull($id)) {
             throw new Exception(__METHOD__ . '() - Not a valid integer, please check the integer and try again.');
         }
         // form information
         $form->addField(array('name' => 'projectID', 'type' => 'hidden', 'value' => $id, 'primary' => TRUE, 'fieldClass' => 'id', 'showIn' => array(formBuilder::TYPE_INSERT, formBuilder::TYPE_UPDATE)));
         $form->addField(array('name' => 'customerID', 'label' => 'What customer owns this project?', 'type' => 'select', 'blankOption' => 'Select a Customer', 'linkedTo' => array('foreignTable' => 'customers', 'foreignField' => 'id', 'foreignLabel' => 'companyName')));
         $form->addField(array('name' => 'projectName', 'label' => 'Project Name:', 'required' => TRUE));
         $form->addField(array('name' => 'scope', 'label' => 'A simple statement of the scope of work being done:', 'required' => TRUE));
         $form->addField(array('name' => 'type', 'label' => 'Project Type:', 'required' => TRUE, 'type' => 'select', 'options' => array('design' => 'Design', 'development' => 'Programming or Development', 'consult' => 'Meeting or Consultation', 'other' => 'other')));
         $form->addField(array('name' => "completed", 'label' => "Has this project been completed?", 'showInEditStrip' => TRUE, 'type' => 'boolean', 'duplicates' => TRUE, 'options' => array("YES", "N0")));
         $form->addField(array('name' => "description", 'label' => "Enter a description of the project:", 'type' => 'textarea'));
         // buttons and submissions
         $form->addField(array('showIn' => array(formBuilder::TYPE_UPDATE), 'name' => 'update', 'type' => 'submit', 'fieldClass' => 'submit', 'value' => 'Update'));
         $form->addField(array('showIn' => array(formBuilder::TYPE_UPDATE), 'name' => 'delete', 'type' => 'delete', 'fieldClass' => 'delete hidden', 'value' => 'Delete'));
         $form->addField(array('showIn' => array(formBuilder::TYPE_INSERT), 'name' => 'insert', 'type' => 'submit', 'fieldClass' => 'submit', 'value' => 'Submit'));
         return '{form name="Projects" display="form"}';
     } catch (Exception $e) {
         errorHandle::errorMsg($e->getMessage());
     }
 }
 public function setupForm($id = null)
 {
     try {
         // call engine
         $engine = EngineAPI::singleton();
         $localvars = localvars::getInstance();
         $validate = new validate();
         // create customer form
         $form = formBuilder::createForm('Customers');
         $form->linkToDatabase(array('table' => 'customers'));
         if (!is_empty($_POST) || session::has('POST')) {
             $processor = formBuilder::createProcessor();
             $processor->processPost();
         }
         // form titles
         $form->insertTitle = "Add Customer";
         $form->editTitle = "Edit Customer";
         $form->updateTitle = "Edit Customer";
         // if no valid id throw an exception
         if (!$validate->integer($id) && !isnull($id)) {
             throw new Exception(__METHOD__ . '() - Not a valid integer, please check the integer and try again.');
         }
         // form information
         $form->addField(array('name' => 'ID', 'type' => 'hidden', 'value' => $id, 'primary' => TRUE, 'fieldClass' => 'id', 'showIn' => array(formBuilder::TYPE_INSERT, formBuilder::TYPE_UPDATE)));
         $form->addField(array('name' => 'firstName', 'label' => 'First Name:', 'required' => TRUE));
         $form->addField(array('name' => 'lastName', 'label' => 'Last Name:', 'required' => TRUE));
         $form->addField(array('name' => 'companyName', 'label' => 'Company Name:', 'required' => TRUE));
         $form->addField(array('name' => 'email', 'label' => 'Customer Email:', 'required' => TRUE));
         $form->addField(array('name' => 'phone', 'label' => 'Customer Phone Number:', 'required' => TRUE));
         $form->addField(array('name' => "website", 'label' => "Customers Website:", 'type' => 'URL'));
         // buttons and submissions
         $form->addField(array('showIn' => array(formBuilder::TYPE_UPDATE), 'name' => 'update', 'type' => 'submit', 'fieldClass' => 'submit', 'value' => 'Update'));
         $form->addField(array('showIn' => array(formBuilder::TYPE_UPDATE), 'name' => 'delete', 'type' => 'delete', 'fieldClass' => 'delete hidden', 'value' => 'Delete'));
         $form->addField(array('showIn' => array(formBuilder::TYPE_INSERT), 'name' => 'insert', 'type' => 'submit', 'fieldClass' => 'submit', 'value' => 'Submit'));
         return '{form name="Customers" display="form"}';
     } catch (Exception $e) {
         errorHandle::errorMsg($e->getMessage());
     }
 }
예제 #6
0
$localvars = localvars::getInstance();
// username
$username = dbSanitize(session::get('username'));
// rating sys
$starHTML = '<div class="rating-system">
                    <span class="star" data-star="1"></span>
                    <span class="star" data-star="2"></span>
                    <span class="star" data-star="3"></span>
                    <span class="star" data-star="4"></span>
                    <span class="star" data-star="5"></span>
                  </div>';
// create customer form
$form = formBuilder::createForm('setup');
$form->linkToDatabase(array('table' => 'setupSurvey'));
if (!is_empty($_POST) || session::has('POST')) {
    $processor = formBuilder::createProcessor();
    $processor->setCallback('beforeInsert', 'feedbackCheck');
    $processor->processPost();
}
// form titles
$form->insertTitle = "Setup Survey";
$form->editTitle = "";
$form->updateTitle = "";
$form->template = "learningAppTemp";
// form information
$form->addField(array('name' => 'ssID', 'type' => 'hidden', 'primary' => TRUE, 'fieldClass' => 'id', 'showIn' => array(formBuilder::TYPE_INSERT, formBuilder::TYPE_UPDATE)));
$form->addField(array('name' => 'ipAddr', 'type' => 'hidden', 'fieldClass' => 'ip', 'value' => $_SERVER['REMOTE_ADDR'], 'showIn' => array(formBuilder::TYPE_INSERT, formBuilder::TYPE_UPDATE)));
$form->addField(array('name' => 'username', 'type' => 'hidden', 'label' => 'Username:'******'value' => $username, 'required' => TRUE, 'fieldClass' => 'username'));
$form->addField(array('name' => 'starRating', 'type' => 'plaintext', 'label' => 'How easy would you consider your choice, based on this lesson, would be to setup?', 'fieldClass' => 'starRating', 'value' => $starHTML));
$form->addField(array('name' => 'rating', 'type' => 'hidden', 'label' => '--', 'fieldClass' => 'rating'));
$form->addField(array('name' => "framework", 'label' => "Select a framework that you would use", 'type' => 'select', 'blankOption' => 'Select a Framework', 'options' => array('engineAPI' => "EngineAPI", 'meteorJS' => "Meteor JS"), 'fieldClass' => 'framework-select', 'required' => TRUE));
예제 #7
0
 function armarForm3($configuracion)
 {
     $form = new formBuilder($configuracion, $this->formulario, $this->conexion, '1', 'ftab3');
     $form->setInput(array("name" => "descripcion", "etiqueta" => "*Realice una descripci&oacute;n detallada del producto<br/> (max. 200 car&aacute;teres)", "tipo" => "textarea", "clase" => "required number", "complemento" => "maxlength='200' cols='94' rows='8'"));
     $form->setInput(array("name" => "filerup", "etiqueta" => "Adjuntar PDF Registro Único de Proponentes:", "clase" => "required", "tipo" => "file"));
     $form->setInput(array("name" => "tab", "value" => "tab3", "tipo" => "hidden"));
     $form->setInput(array("name" => "form3", "value" => "1", "tipo" => "data"));
     return $form;
 }
예제 #8
0
    function armarForm($configuracion)
    {
        $form = new formBuilder($configuracion, $this->formulario, $this->conexion, '1', 'ftab1');
        $form->setSubmitHandler('
			if($("#filerup").val()==""){
					if($("#check_filerup").val()==""){
						alert("Porfavor adjunte el PDF del registro unico de proponentes ");
						return false;
					}
			}
			if($("#text_captcha").val()==""){
				alert("Digite el codigo de verificacion");
				return false;
			}
			document.submit();
			');
        $form->setTabs(array("tab1" => "informaci&oacute;n B&aacute;sica", "tab2" => "Actividad Comercial", "tab3" => "Descripci&oacute;n Servicio o Producto"));
        $form->setInput(array("tab" => "tab1", "name" => "cont1", "etiqueta" => "Informaci&oacute;n de la empresa", "tipo" => "label"));
        $form->setInput(array("tab" => "tab1", "name" => "nit", "etiqueta" => "*Nit o cedula:", "tipo" => "text", "clase" => "required number", "complemento" => "maxlength='10'", "ayuda" => "Nit o número de documento del representante legal"));
        $form->setInput(array("tab" => "tab1", "name" => "digitoVerificacion", "etiqueta" => "*DV:", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='1'", "ayuda" => "Digito de Verificacion"));
        $form->setInput(array("tab" => "tab1", "name" => "nomEmpresa", "etiqueta" => "*Nombre de la empresa:", "tipo" => "text", "clase" => "required", "complemento" => "size=50"));
        $form->setInput(array("tab" => "tab1", "name" => "cont2", "etiqueta" => "Informaci&oacute;n del Contacto", "tipo" => "label"));
        $form->setInput(array("tab" => "tab1", "name" => "municipio", "etiqueta" => "*Ciudad", "tipo" => "text", "clase" => "required", "complemento" => "maxlength='30'"));
        $form->setInput(array("tab" => "tab1", "name" => "direccion", "etiqueta" => "*Direcci&oacute;n:", "tipo" => "text", "clase" => "required", "complemento" => "size=50"));
        $form->setInput(array("tab" => "tab1", "name" => "correo", "etiqueta" => "*Correo:", "tipo" => "text", "clase" => "required email", "complemento" => "maxlength='60'"));
        $form->setInput(array("tab" => "tab1", "name" => "web", "etiqueta" => "Sitio Web:", "tipo" => "text", "complemento" => "maxlength='60'"));
        $form->setInput(array("tab" => "tab1", "name" => "telefono1", "etiqueta" => "*Tel&eacute;fono 1:", "tipo" => "text", "clase" => "required number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "ext1", "etiqueta" => "Extensi&oacute;n (tel1):", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "telefono2", "etiqueta" => "Tel&eacute;fono 2:", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "ext2", "etiqueta" => "Extensi&oacute;n (tel2):", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "movil", "etiqueta" => "Movil:", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "fax", "etiqueta" => "Fax:", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "nomAsesor", "etiqueta" => "Asesor Comercial", "tipo" => "text", "complemento" => "maxlength='50'"));
        $form->setInput(array("tab" => "tab1", "name" => "telAsesor", "etiqueta" => "Tel&eacute;fono del Asesor:", "tipo" => "text", "clase" => "number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "cont3", "etiqueta" => "Informaci&oacute;n del Representante Legal", "tipo" => "label"));
        $form->setInput(array("tab" => "tab1", "name" => "tipdocRep", "etiqueta" => "*Tipo de documento:", "tipo" => "radio", "data" => array("CC" => "CC", "CE" => "CE", "OT" => "OT"), "ayuda" => "CC: Cédula de ciudadania CE: Cédula de Extranería OT: Otro"));
        $form->setInput(array("tab" => "tab1", "name" => "numdocRep", "etiqueta" => "*Documento:", "tipo" => "text", "clase" => "required number", "complemento" => "maxlength='15'"));
        $form->setInput(array("tab" => "tab1", "name" => "ape1Rep", "etiqueta" => "*Primer Apellido:", "tipo" => "text", "clase" => "required", "complemento" => "maxlength='30'"));
        $form->setInput(array("tab" => "tab1", "name" => "ape2Rep", "etiqueta" => "Segundo Apellido:", "tipo" => "text", "complemento" => "maxlength='30'"));
        $form->setInput(array("tab" => "tab1", "name" => "nom1Rep", "etiqueta" => "*Primer Nombre:", "tipo" => "text", "clase" => "required", "complemento" => "maxlength='30'"));
        $form->setInput(array("tab" => "tab1", "name" => "nom2Rep", "etiqueta" => "Segundo Nombre:", "tipo" => "text", "complemento" => "maxlength='30'"));
        $form->setInput(array("tab" => "tab1", "name" => "cont4", "etiqueta" => "Informaci&oacute;n Adicional", "tipo" => "label"));
        $form->setInput(array("tab" => "tab1", "name" => "tipopersona", "etiqueta" => "Tipo de Persona", "tipo" => "radio", "data" => array("Natural" => "N", "Juridica" => "J"), "ayuda" => "N: Natural J: Juridica"));
        $form->setInput(array("tab" => "tab1", "name" => "regimen", "etiqueta" => "Regimen Contributivo", "tipo" => "radio", "data" => array("Comun" => "C", "Simplificado" => "S"), "ayuda" => "C: Comun S: Simplificado"));
        $form->setInput(array("tab" => "tab1", "name" => "importacion", "etiqueta" => "Exclusividad Producto de importaci&oacute;n", "tipo" => "radio", "data" => array("Si" => "S", "No" => "N"), "ayuda" => "S: Si N: No"));
        $form->setInput(array("tab" => "tab1", "name" => "pyme", "etiqueta" => "Es usted PYME:", "tipo" => "radio", "data" => array("Si" => "S", "No" => "N"), "ayuda" => "S: Si N: No"));
        $form->setInput(array("tab" => "tab1", "name" => "registro", "etiqueta" => "Registro Mercantil:", "tipo" => "radio", "data" => array("Si" => "S", "No" => "N"), "ayuda" => "S: Si N: No"));
        $form->setInput(array("tab" => "tab1", "name" => "form1", "value" => "1", "tipo" => "data"));
        $form->setInput(array("tab" => "tab1", "name" => "identificador", "value" => $this->tiempo, "tipo" => "data"));
        $form->setInput(array("tab" => "tab1", "name" => "tab", "value" => "tab1", "tipo" => "hidden"));
        $form->setCSS($configuracion['host'] . $configuracion['site'] . "/bloque/registro_proveedor/form.css");
        // tab2
        include_once $configuracion["raiz_documento"] . $configuracion["clases"] . "/ciiu.class.php";
        include_once $configuracion["raiz_documento"] . "/plugin/RUP/rup.php";
        $form->setInput(array("tab" => "tab2", "name" => "registroUnico", "etiqueta" => "Esta inscrito en el Registro &Uacute;nico<br> de proponentes?", "tipo" => "radio", "data" => array("Si" => "S", "No" => "N"), "ayuda" => "S: Si N: No"));
        //,"complemento"=>array("S"=>"","N"=>"")
        $rup = new rup($configuracion);
        $rup->setIdentificador('ACTRUP', 1);
        $rup->setPregunta('RUP');
        $form->setInput(array("tab" => "tab2", "name" => "compRUP", "etiqueta" => "DECRETO 1464 DE 2010 (RUP)", "input" => $rup->armar_rup()));
        $ciiu = new ciiu($configuracion);
        $ciiu->setIdentificador('ACTCIIU', 1);
        //$ciiu->usuario=$this->tiempo;
        $ciiu->setPregunta('CIIU');
        $ciiu->setAction($configuracion["host"] . $configuracion["site"] . $configuracion["clases"] . "/ciiu.class.php");
        $ciiu->getNumActividades('ciiu_numactciiu');
        $form->setInput(array("tab" => "tab2", "name" => "compCIIU", "etiqueta" => "DECRETO 734 DE 2012 (CIIU)", "input" => $ciiu->armar_ciiu()));
        //tab3
        $form->setInput(array("tab" => "tab3", "name" => "descripcion", "etiqueta" => "* Realice una descripci&oacute;n detallada del producto<br/> (max. 200 car&aacute;teres)", "tipo" => "textarea", "clase" => "required", "complemento" => "maxlength='200' cols='94' rows='8'"));
        $form->setInput(array("tab" => "tab3", "name" => "filerup", "etiqueta" => "* Adjuntar PDF Registro Único de Proponentes:", "clase" => "", "tipo" => "file"));
        return $form;
    }