本文整理汇总了PHP中DataEdit::button方法的典型用法代码示例。如果您正苦于以下问题:PHP DataEdit::button方法的具体用法?PHP DataEdit::button怎么用?PHP DataEdit::button使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataEdit
的用法示例。
在下文中一共展示了DataEdit::button方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dataedit
//.........这里部分代码省略.........
for ($u = 1; $u < 4; $u++) {
$nom = "escala{$u}";
$obj = "{$nom}_{$i}";
$edit->{$obj} = new hiddenField('', $obj);
$edit->{$obj}->insertValue = $row->{$nom};
$edit->{$obj}->rel_id = 'itpfac';
$edit->{$obj}->db_name = 'sinv' . $nom;
$edit->{$obj}->ind = $i;
$edit->{$obj}->pointer = true;
$nom = "pescala{$u}";
$obj = "{$nom}_{$i}";
$edit->{$obj} = new hiddenField('', $obj);
$edit->{$obj}->insertValue = $row->{$nom};
$edit->{$obj}->rel_id = 'itpfac';
$edit->{$obj}->db_name = 'sinv' . $nom;
$edit->{$obj}->ind = $i;
$edit->{$obj}->pointer = true;
$p_es += $row->{$nom};
}
$gdxe = $edit->get_from_dataobjetct_rel('itpfac', 'dxe', $i);
$obj = 'dxe_' . $i;
if ($p_es > 0) {
$gdxe = $edit->get_from_dataobjetct_rel('itpfac', 'dxe', $i);
$edit->{$obj} = new checkboxField('dxe', $obj, $gdxe == false ? '0' : $gdxe, '0');
$edit->{$obj}->onchange = "cescala('{$i}')";
} else {
$edit->{$obj} = new autoUpdateField('dxp', '0', '0');
}
//$edit->$obj->insertValue = 0;
$edit->{$obj}->rel_id = 'itpfac';
$edit->{$obj}->db_name = 'dxe';
$edit->{$obj}->ind = $i;
$obj = 'sinvmmargen_' . $i;
$edit->{$obj} = new hiddenField('', $obj);
$edit->{$obj}->insertValue = $row->mmargen;
$edit->{$obj}->rel_id = 'itpfac';
$edit->{$obj}->db_name = 'sinvmmargen';
$edit->{$obj}->ind = $i;
$edit->{$obj}->pointer = true;
$obj = 'costo_' . $i;
$edit->{$obj} = new hiddenField('', $obj);
$edit->{$obj}->insertValue = $row->costo;
$edit->{$obj}->rel_id = 'itpfac';
$edit->{$obj}->db_name = 'costo';
$edit->{$obj}->ind = $i;
$obj = 'tota_' . $i;
$edit->{$obj} = new hiddenField('', $obj);
$edit->{$obj}->insertValue = 0;
$edit->{$obj}->rel_id = 'itpfac';
$edit->{$obj}->db_name = 'tota';
$edit->{$obj}->ind = $i;
$i++;
}
$sinvcana = $i;
// fin de campos para detalle
$edit->ivat = new inputField('Impuesto', 'iva');
$edit->ivat->css_class = 'inputnum';
$edit->ivat->type = 'inputhidden';
$edit->ivat->readonly = true;
$edit->ivat->size = 10;
$edit->totals = new inputField('Sub-Total', 'totals');
$edit->totals->css_class = 'inputnum';
$edit->totals->type = 'inputhidden';
$edit->totals->readonly = true;
$edit->totals->size = 10;
$edit->totalg = new inputField('Monto Total', 'totalg');
$edit->totalg->css_class = 'inputnum';
$edit->totalg->type = 'inputhidden';
$edit->totalg->readonly = true;
$edit->totalg->size = 10;
$edit->estampa = new autoUpdateField('estampa', date('Ymd'), date('Ymd'));
$edit->hora = new autoUpdateField('hora', date('H:i:s'), date('H:i:s'));
$edit->usuario = new autoUpdateField('usuario', $this->secu->usuario(), $this->secu->usuario());
$control = $this->rapyd->uri->get_edited_id();
if ($edit->getstatus() == 'show') {
$action = "javascript:window.location='" . site_url($this->url . 'filterscli') . "'";
$edit->button('btn_add', 'Agregar', $action, 'TR');
}
$edit->buttons('save', 'undo', 'modify', 'delete', 'back');
if ($this->genesal) {
$edit->build();
$conten['cana'] = $sinvcana;
$conten['form'] =& $edit;
$conten['title'] = heading('Pedidos No. ' . $edit->numero->value);
$data['head'] = style('mayor/estilo.css');
$data['script'] = script('jquery.js');
$data['script'] .= phpscript('nformat.js');
$data['content'] = $this->load->view('view_pfaclitemayor', $conten, true);
$data['title'] = '';
$this->load->view('view_ventanas_lite', $data);
} else {
$edit->on_save_redirect = false;
$edit->build();
if ($edit->on_success()) {
echo 'Pedido Guardado';
} elseif ($edit->on_error()) {
echo html_entity_decode(preg_replace('/<[^>]*>/', '', $edit->error_string));
}
}
}
示例2: dataedit
function dataedit()
{
$this->rapyd->load('dataedit');
$scli = array('tabla' => 'scli', 'columnas' => array('cliente' => 'Código Cliente', 'nombre' => 'Nombre', 'contacto' => 'Contacto'), 'filtro' => array('cliente' => 'Código Cliente', 'nombre' => 'Nombre'), 'retornar' => array('cliente' => 'cliente'), 'titulo' => 'Buscar Cliente');
$boton = $this->datasis->modbus($scli);
$edit = new DataEdit($this->tits, 'edres');
$id = $edit->getval('id');
if ($id !== false) {
$action = "javascript:window.location='" . site_url($this->url . 'formato/' . $id) . "'";
$edit->button('btn_formato', 'Descargar formato', $action);
}
$edit->back_url = site_url($this->url . 'filteredgrid');
$edit->post_process('insert', '_post_insert');
$edit->post_process('update', '_post_update');
$edit->post_process('delete', '_post_delete');
$edit->pre_process('insert', '_pre_insert');
$edit->pre_process('update', '_pre_update');
$edit->pre_process('delete', '_pre_delete');
$edit->numero = new inputField('Número', 'numero');
$edit->numero->rule = 'max_length[8]|required|unique';
$edit->numero->size = 10;
$edit->numero->mode = 'autohide';
$edit->numero->maxlength = 8;
$edit->numero->when = array('show', 'modify');
$edit->fecha = new dateField('Fecha', 'fecha');
$edit->fecha->rule = 'required|chfecha';
$edit->fecha->insertValue = date('Y-m-d');
$edit->fecha->size = 10;
$edit->fecha->maxlength = 8;
$edit->cliente = new inputField('Cliente', 'cliente');
$edit->cliente->rule = 'max_length[5]|existescli|required';
$edit->cliente->size = 7;
$edit->cliente->maxlength = 5;
$edit->cliente->append($boton);
$edit->edificacion = new dropdownField('Edificación', 'edificacion');
$edit->edificacion->option('', 'Seleccionar');
$edit->edificacion->options('SELECT id,TRIM(nombre) AS nombre FROM `edif` ORDER BY nombre');
$edit->edificacion->rule = 'max_length[11]';
$edit->inmueble = new dropdownField('Inmueble', 'inmueble');
$edit->inmueble->option('', 'Seleccionar');
$edif = $edit->getval('edificacion');
if ($edif !== false) {
$dbedif = $this->db->escape($edif);
$edit->inmueble->option('', 'Seleccionar');
$edit->inmueble->options("SELECT id,TRIM(descripcion) AS nombre FROM `edinmue` WHERE status='D' AND edificacion={$dbedif} ORDER BY descripcion");
} else {
$edit->inmueble->option('', 'Seleccione una edificacion');
}
$edit->inmueble->rule = 'max_length[11]';
$edit->reserva = new inputField('Monto de la Reservación', 'reserva');
$edit->reserva->rule = 'max_length[17]|numeric|callback_chmonto|required';
$edit->reserva->css_class = 'inputnum';
$edit->reserva->size = 19;
$edit->reserva->maxlength = 17;
$mSQL = "SELECT cod_banc, nomb_banc FROM tban WHERE cod_banc<>'CAJ'";
$query = $this->db->query($mSQL);
$bancos = array();
foreach ($query->result() as $row) {
$bancos[$row->cod_banc] = $row->nomb_banc;
}
for ($i = 1; $i < 4; $i++) {
$group = 'Formas de pago ' . $i;
$obj1 = 'formap' . $i;
$edit->{$obj1} = new dropdownField('Pago ' . $i, $obj1);
$edit->{$obj1}->option('', 'Ninguno');
$edit->{$obj1}->option('CH', 'Cheque');
$edit->{$obj1}->option('DE', 'Deposito');
$edit->{$obj1}->option('NC', 'Transferencia');
$edit->{$obj1}->group = $group;
$edit->{$obj1}->style = 'width:140px';
$edit->{$obj1}->rule = 'max_length[2]';
if ($i == 1) {
$edit->{$obj1}->rule = 'required';
}
$obj2 = 'banco' . $i;
$edit->{$obj2} = new dropdownField('Banco ' . $i, $obj2);
$edit->{$obj2}->option('', 'Seleccionar banco');
$edit->{$obj2}->options($bancos);
$edit->{$obj2}->group = $group;
$edit->{$obj2}->rule = 'max_length[3]|condi_required|callback_chpago[' . $i . ']';
$edit->{$obj2}->in = $obj1;
$obj4 = 'pfecha' . $i;
$edit->{$obj4} = new dateonlyField('Fecha ', $obj4);
$edit->{$obj4}->group = $group;
$edit->{$obj4}->rule = 'condi_required|callback_chpago[' . $i . ']';
$edit->{$obj4}->size = 10;
//$edit->$obj4->in=$obj1;
$obj3 = 'nummp' . $i;
$edit->{$obj3} = new inputField('Número referencia', $obj3);
$edit->{$obj3}->rule = 'max_length[20]|condi_required|callback_chpago[' . $i . ']';
$edit->{$obj3}->size = 20;
$edit->{$obj3}->maxlength = 20;
$edit->{$obj3}->group = $group;
$obj4 = 'monto' . $i;
$edit->{$obj4} = new inputField('Monto', $obj4);
$edit->{$obj4}->rule = 'condi_required|callback_chpago[' . $i . ']';
$edit->{$obj4}->css_class = 'inputnum';
$edit->{$obj4}->size = 19;
$edit->{$obj4}->maxlength = 17;
$edit->{$obj4}->group = $group;
//.........这里部分代码省略.........