function createFieldForm($pDB) { $pCampaniaDerivada = new paloSantoCampaniaDerivada($pDB); $arrCampanias = $pCampaniaDerivada->getCampanias(); $arrOptions = array(); $arrFields = array("nombre_campania" => array("LABEL" => _tr("Nombre:"), "REQUIRED" => "no", "INPUT_TYPE" => "TEXT", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "EDITABLE" => "si"), "campania" => array("LABEL" => _tr("Campaña"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrCampanias, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "EDITABLE" => "si"), "active_bases" => array("LABEL" => _tr("Activas"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrOptions, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "MULTIPLE" => true, "EDITABLE" => "si"), "inactive_bases" => array("LABEL" => _tr("Inactivas"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrOptions, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "MULTIPLE" => true, "EDITABLE" => "si"), "active_calltypes" => array("LABEL" => _tr("Activos"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrOptions, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "MULTIPLE" => true, "EDITABLE" => "si"), "inactive_calltypes" => array("LABEL" => _tr("Inactivos"), "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrOptions, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "MULTIPLE" => true, "EDITABLE" => "si")); return $arrFields; }
<?php include_once "/var/www/html/libs/paloSantoDB.class.php"; include_once "/var/www/html/modules/hispana_campania_derivada/configs/default.conf.php"; include_once "/var/www/html/modules/hispana_campania_derivada/libs/paloSantoCampaniaDerivada.class.php"; include_once "/var/www/html/modules/hispana_campania_derivada/libs/AppLogger.class.php"; $_log = new AppLogger(); $_log->open("/var/www/html/modules/hispana_campania_derivada/_log.log"); $_log->prefijo("ajax_process"); $_log->output("POST:" . print_r($_POST, true)); if (isset($_POST['action'])) { $pDB = new paloDB($arrConfModule['dsn_conn_database']); $pCampaniaDerivada = new paloSantoCampaniaDerivada($pDB); switch ($_POST['action']) { case 'getBases': $arrBases = $pCampaniaDerivada->getBases($_POST['campania']); // $_log->output("Bases:\n" . print_r($arrBases,true)); if (sizeof($arrBases) > 0) { $content = crearOption($arrBases); $_log->output("Content: " . $content); } else { $content = '<option id=0>No hay bases</option>.'; } break; case 'getCalltypes': $arrCalltypes = $pCampaniaDerivada->getCalltypes($_POST['campania']); if (sizeof($arrCalltypes) > 0) { $content = crearOption($arrCalltypes); // $_log->output("Content: " . $content); } else { $content = '<option id=0>No hay calltypes</option>.';