本文整理汇总了PHP中DataForm::on_show方法的典型用法代码示例。如果您正苦于以下问题:PHP DataForm::on_show方法的具体用法?PHP DataForm::on_show怎么用?PHP DataForm::on_show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataForm
的用法示例。
在下文中一共展示了DataForm::on_show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: masivo
//.........这里部分代码省略.........
$edit->m_vari3->insertValue = 'N';
$edit->m_vari3->in = 'vari3';
$edit->m_vari3->append("Modificar");
$edit->vari4 = new inputField($this->datasis->traevalor("VARI4") . "XVARI4", "vari4");
$edit->vari4->group = "Variables";
$edit->vari4->size = 12;
$edit->vari4->maxlength = 11;
$edit->vari4->rule = "trim";
$edit->vari4->css_class = 'inputnum';
$edit->m_vari4 = new checkboxField('', 'm_vari4', 'Y', 'N');
$edit->m_vari4->insertValue = 'N';
$edit->m_vari4->in = 'vari4';
$edit->m_vari4->append("Modificar");
$edit->vari5 = new inputField($this->datasis->traevalor("VARI5") . "XVARI5", "vari5");
$edit->vari5->group = "Variables";
$edit->vari5->size = 12;
$edit->vari5->maxlength = 12;
$edit->vari5->rule = "trim";
$edit->m_vari5 = new checkboxField('', 'm_vari5', 'Y', 'N');
$edit->m_vari5->insertValue = 'N';
$edit->m_vari5->in = 'vari5';
$edit->m_vari5->append("Modificar");
$edit->vari6 = new inputField($this->datasis->traevalor("VARI6") . "XVARI6", "vari6");
$edit->vari6->group = "Variables";
$edit->vari6->size = 16;
$edit->vari6->maxlength = 14;
$edit->vari6->rule = "trim";
$edit->vari6->css_class = 'inputnum';
$edit->m_vari6 = new checkboxField('', 'm_vari6', 'Y', 'N');
$edit->m_vari6->insertValue = 'N';
$edit->m_vari6->in = 'vari6';
$edit->m_vari6->append("Modificar");
$edit->vari7 = new inputField($this->datasis->traevalor("VARI7") . "XVARI7", "vari7");
$edit->vari7->group = "Variables";
$edit->vari7->size = 16;
$edit->vari7->maxlength = 14;
$edit->vari7->rule = "trim";
$edit->m_vari7 = new checkboxField('', 'm_vari7', 'Y', 'N');
$edit->m_vari7->insertValue = 'N';
$edit->m_vari7->in = 'vari7';
$edit->m_vari7->append("Modificar");
$edit->vari8 = new inputField($this->datasis->traevalor("VARI8") . "XVARI8", "vari8");
$edit->vari8->group = "Variables";
$edit->vari8->size = 16;
$edit->vari8->maxlength = 14;
$edit->vari8->rule = "trim";
$edit->m_vari8 = new checkboxField('', 'm_vari8', 'Y', 'N');
$edit->m_vari8->insertValue = 'N';
$edit->m_vari8->in = 'vari8';
$edit->m_vari8->append("Modificar");
$edit->sueldo = new inputField("Sueldo ", "sueldo");
$edit->sueldo->group = "Relación Laboral";
$edit->sueldo->size = 15;
$edit->sueldo->maxlength = 10;
$edit->sueldo->css_class = '.inputnum';
$edit->m_sueldo = new checkboxField('', 'm_sueldo', 'Y', 'N');
$edit->m_sueldo->insertValue = 'N';
$edit->m_sueldo->in = 'sueldo';
$edit->m_sueldo->append("Modificar");
$edit->submit("btnsubmit", "Guardar");
$edit->build_form();
if ($edit->on_show()) {
//do something
}
if ($edit->on_success()) {
$data = array();
$sql = $this->input->post('sql');
$campos = array('m_contrato', 'm_codigoadm', 'm_fondo', 'm_divi', 'm_status', 'm_sueldo', 'm_vari1', 'm_vari2', 'm_vari3', 'm_vari4', 'm_vari5', 'm_vari6', 'm_vari7', 'm_vari8', 'm_codigopres', 'm_tipemp');
foreach ($campos as $campo) {
if ($this->input->post($campo) == 'Y') {
$data[substr($campo, 2)] = $this->input->post(substr($campo, 2));
}
}
$sql = substr($sql, 0, strpos($sql, 'LIMIT'));
$query = $this->db->query($sql);
$query = $query->result_array();
$codigos = array();
foreach ($query as $row) {
//echo $row['codigo'].br();
$codigos[] = $this->db->escape($row['codigo']);
}
$codigos = implode($codigos, ',');
if (count($data) > 0) {
$where = "codigo IN ({$codigos})";
$query = $this->db->update_string('pers', $data, $where);
if ($this->db->query($query)) {
$msj .= "</br>Usted ha modificado satisfacrotiamente {$cantidad} de registros";
}
}
}
if ($edit->on_error()) {
//do something else (display suggestions.. etc)
//note: validation messages are integrated, so you don't have to do anything (just make fields rules).
}
$atras = anchor($this->url . 'filteredgrid', 'Ir al Filtro');
$data['content'] = $atras . $msj . $edit->output;
$data['title'] = "Modificar Personal Masivo";
$data["head"] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例2: dataform
function dataform()
{
//dataform//
$this->rapyd->load("dataform");
$form = new DataForm("rapyd/datam/dataform/process", null);
$form->title = new inputField("Title", "title");
$form->title->rule = "trim|required|max_length[20]";
$form->body = new editorField("Body", "body");
$form->body->rule = "required";
$form->body->rows = 10;
$form->checkbox = new checkboxField("Public", "public", "y", "n");
$form->submit("btnsubmit", "SUBMIT");
$form->build_form();
if ($form->on_show()) {
$data["form_status"] = "Form displayed correctly";
}
if ($form->on_success()) {
$posted_data = nl2br(var_export($_POST, true));
$data["form_status"] = "Successful post:<br/>" . $posted_data;
}
if ($form->on_error()) {
$data["form_status"] = "There are errors";
}
$data["form"] = $form->output;
//enddataform//
$content["content"] = $this->load->view('rapyd/dataform', $data, true);
$content["rapyd_head"] = $this->rapyd->get_head();
$content["code"] = highlight_code_file(THISFILE, "//dataform//", "//enddataform//");
$this->load->view('rapyd/template', $content);
}
示例3: cobrorep
function cobrorep($id)
{
$id = intval($id);
if ($id <= 0) {
return false;
}
$tipo = $this->datasis->dameval("SELECT tipo FROM reparto WHERE id={$id}");
if ($tipo != 'F' && $tipo != 'C' && $tipo != 'E') {
echo 'Reparto no se puede cobrar con tipo ' . $tipo;
return false;
}
$this->rapyd->load('dataform');
$edit = new DataForm($this->url . 'cobrorep/' . $id . '/insert');
$edit->monto = new inputField('Monto total recibido', 'monto');
$edit->monto->rule = 'required|numeric';
$edit->monto->type = 'inputhidden';
$edit->monto->insertValue = '0.0';
$edit->monto->css_class = 'inputnum';
$edit->build_form();
if ($edit->on_success()) {
$errno = '';
$itpago = $this->input->post('itpago');
if (is_array($itpago)) {
$error = 0;
foreach ($itpago as $itid => $repcob) {
$itid = intval($itid);
if ($repcob == 'EF' || $repcob == 'CH' || $repcob == 'MI' || $repcob == 'FP') {
$dbrepcob = $this->db->escape($repcob);
if ($itid > 0) {
$sql = "SELECT a.repcob, c.id AS idcli,a.cod_cli,b.numero,b.tipo_doc,b.fecha,b.monto-b.abonos AS saldo,b.monto\n\t\t\t\t\t\t\t\tFROM sfac AS a\n\t\t\t\t\t\t\t\tJOIN smov AS b ON a.transac=b.transac AND a.numero=b.numero\n\t\t\t\t\t\t\t\tJOIN scli AS c ON a.cod_cli=c.cliente\n\t\t\t\t\t\t\t\tWHERE a.id={$itid}";
$row = $this->datasis->damerow($sql);
if (empty($row)) {
continue;
}
if ($row['repcob'] != $repcob) {
$mSQL = "UPDATE sfac SET repcob={$dbrepcob}, entregado = NOW() WHERE id={$itid}";
$ban = $this->db->simple_query($mSQL);
if (!$ban) {
$error++;
}
}
if ($repcob == 'EF') {
$chofer = trim($this->datasis->dameval("SELECT b.nombre FROM reparto AS a JOIN chofer AS b ON b.codigo=a.chofer WHERE a.id={$id}"));
$_POST = array('cod_cli' => $row['cod_cli'], 'tipo_doc' => 'AB', 'codigo' => '', 'vd' => '', 'fecdoc' => dbdate_to_human(date('y-m-d')), 'tipo_doc_0' => $row['tipo_doc'], 'numero_0' => $row['numero'], 'fecha_0' => dbdate_to_human(date($row['fecha'])), 'monto_0' => $row['monto'], 'abono_0' => $row['saldo'], 'ppago_0' => '', 'monto' => $row['saldo'], 'nroex' => '', 'tipo_0' => 'EF', 'sfpafecha_0' => '', 'num_ref_0' => '', 'banco_0' => '', 'itmonto_0' => $row['saldo'], 'observa1' => 'PAGA ' . $row['tipo_doc'] . $row['numero'] . ' DESDE REPARTO ' . $id . ' ', 'observa2' => 'CHOFER ' . $chofer);
$this->genesal = false;
ob_start();
$this->ccli($row['idcli']);
$rt = ob_get_contents();
@ob_end_clean();
$rt = json_decode($rt);
if ($rt->status == 'B') {
$error++;
$errno = br() . $rt->mensaje;
}
}
}
}
}
if ($error > 0) {
$rt = array('status' => 'B', 'mensaje' => 'Problemas guardado ' . $errno, 'pk' => null);
} else {
$rt = array('status' => 'A', 'mensaje' => 'Cambio exitoso', 'pk' => null);
}
} else {
$rt = array('status' => 'B', 'mensaje' => 'No hubo cambios', 'pk' => null);
}
echo json_encode($rt);
}
if ($edit->on_error()) {
$rt = array('status' => 'B', 'mensaje' => preg_replace('/<[^>]*>/', '', $edit->error_string), 'pk' => null);
echo json_encode($rt);
$act = false;
return true;
}
if ($edit->on_show()) {
$conten['id'] = $id;
$conten['form'] =& $edit;
$this->load->view('view_repartocobro', $conten);
}
}
示例4: tablas
function tablas()
{
$this->datasis->modulo_id('900', 1);
$this->rapyd->load("dataform", "datatable");
$tables = $this->db->list_tables();
$form = new DataForm("supervisor/mantenimiento/tablas/process");
$form->free = new freeField("Lista de Tablas", "free", "Chequear|Reparar|Optimizar");
foreach ($tables as $tabla) {
$che = "chequea_" . $tabla;
$re = "repara_" . $tabla;
$op = "optimi_" . $tabla;
$ob1 = "con_" . $tabla;
$ob2 = "con2_" . $tabla;
$form->{$che} = new checkboxField("{$tabla}", "{$che}", "CHECK TABLE {$tabla}", "no");
$form->{$ob1} = new containerField("", " ");
$form->{$ob1}->in = "{$che}";
$form->{$re} = new checkboxField("", "{$re}", "REPAIR TABLE {$tabla}", "no");
$form->{$re}->in = "{$che}";
$form->{$ob2} = new containerField("", " ");
$form->{$ob2}->in = "{$che}";
$form->{$op} = new checkboxField("", "{$op}", "OPTIMIZE TABLE {$tabla}", "no");
$form->{$op}->in = "{$che}";
}
$form->submit("btnsubmit", "Aceptar");
$form->build_form();
if ($form->on_show() || $form->on_error()) {
$data["content"] = $form->output;
}
if ($form->on_success()) {
$data["content"] = "<h1>Procesos y Consultas generadas</h1><br>";
$atras = anchor('supervisor/mantenimiento/tablas', 'Atras');
//print_R($_POST);
foreach ($_POST as $nom => $val) {
if ($this->db->simple_query($val)) {
$data["content"] .= "Se Proceso:" . $nom . " Con la consulta:(" . $val . ")<br>";
} else {
if ($val == "Aceptar") {
break;
}
$data["content"] .= "Error en consulta:" . $val . "<br>";
}
}
$data["content"] .= $atras;
}
$data['title'] = "Mantenimiento de tablas";
$data["rapyd_head"] = $this->rapyd->get_head();
$this->load->view("view_ventanas", $data);
}