本文整理汇总了PHP中DataEdit::on_error方法的典型用法代码示例。如果您正苦于以下问题:PHP DataEdit::on_error方法的具体用法?PHP DataEdit::on_error怎么用?PHP DataEdit::on_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataEdit
的用法示例。
在下文中一共展示了DataEdit::on_error方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dataedit
//.........这里部分代码省略.........
$edit->codbanc = new dropdownField('Banco', 'codbanc');
$edit->codbanc->style = 'width:480px';
$edit->codbanc->mode = 'autohide';
$edit->codbanc->rule = 'required';
$edit->codbanc->option('', 'Seleccionar');
$edit->codbanc->options("SELECT TRIM(codbanc) AS codbanc,CONCAT_WS(' ',codbanc,banco,numcuent) AS desca FROM banc WHERE tbanco<>'CAJ'");
$edit->saldoi = new inputField('Saldo Inicial', 'saldoi');
$edit->saldoi->rule = 'numeric|required';
$edit->saldoi->insertValue = '0.0';
$edit->saldoi->css_class = 'inputnum';
$edit->saldoi->onkeyup = 'totalizar()';
$edit->saldoi->size = 15;
$edit->saldoi->maxlength = 18;
$edit->saldof = new inputField('Saldo Final', 'saldof');
$edit->saldof->insertValue = '0.0';
$edit->saldof->rule = 'numeric|required';
$edit->saldof->css_class = 'inputnum';
$edit->saldof->onkeyup = 'totalizar()';
$edit->saldof->size = 15;
$edit->saldof->maxlength = 18;
$edit->deposito = new inputField('Depósitos', 'deposito');
$edit->deposito->rule = 'numeric';
$edit->deposito->type = 'inputhidden';
$edit->deposito->insertValue = '0.0';
$edit->deposito->css_class = 'inputnum';
$edit->deposito->size = 20;
$edit->deposito->maxlength = 18;
$edit->credito = new inputField('Notas de Crédito', 'credito');
$edit->credito->rule = 'numeric';
$edit->credito->type = 'inputhidden';
$edit->credito->insertValue = '0.0';
$edit->credito->css_class = 'inputnum';
$edit->credito->size = 20;
$edit->credito->maxlength = 18;
$edit->cheque = new inputField('Cheques', 'cheque');
$edit->cheque->rule = 'numeric';
$edit->cheque->type = 'inputhidden';
$edit->cheque->insertValue = '0.0';
$edit->cheque->css_class = 'inputnum';
$edit->cheque->size = 20;
$edit->cheque->maxlength = 18;
$edit->debito = new inputField('Notas de Débito', 'debito');
$edit->debito->rule = 'numeric';
$edit->debito->type = 'inputhidden';
$edit->debito->insertValue = '0.0';
$edit->debito->css_class = 'inputnum';
$edit->debito->size = 20;
$edit->debito->maxlength = 18;
$edit->cdeposito = new inputField('Depósitos', 'cdeposito');
$edit->cdeposito->rule = 'numeric';
$edit->cdeposito->insertValue = '0.0';
$edit->cdeposito->css_class = 'inputnum';
$edit->cdeposito->onkeyup = 'totalizar()';
$edit->cdeposito->size = 12;
$edit->cdeposito->maxlength = 18;
$edit->ccredito = new inputField('Notas de Crédito', 'ccredito');
$edit->ccredito->rule = 'numeric';
$edit->ccredito->insertValue = '0.0';
$edit->ccredito->css_class = 'inputnum';
$edit->ccredito->onkeyup = 'totalizar()';
$edit->ccredito->size = 12;
$edit->ccredito->maxlength = 18;
$edit->ccheque = new inputField('Cheques', 'ccheque');
$edit->ccheque->rule = 'numeric';
$edit->ccheque->insertValue = '0.0';
$edit->ccheque->css_class = 'inputnum';
$edit->ccheque->onkeyup = 'totalizar()';
$edit->ccheque->size = 12;
$edit->ccheque->maxlength = 18;
$edit->cdebito = new inputField('Notas de Débito', 'cdebito');
$edit->cdebito->rule = 'numeric';
$edit->cdebito->insertValue = '0.0';
$edit->cdebito->css_class = 'inputnum';
$edit->cdebito->onkeyup = 'totalizar()';
$edit->cdebito->size = 12;
$edit->cdebito->maxlength = 18;
//$edit->status = new inputField('Estatus','status');
//$edit->status->rule='';
//$edit->status->size =3;
//$edit->status->maxlength =1;
$edit->usuario = new autoUpdateField('usuario', $this->secu->usuario(), $this->secu->usuario());
$edit->estampa = new autoUpdateField('estampa', date('Ymd'), date('Ymd'));
$edit->hora = new autoUpdateField('hora', date('H:i:s'), date('H:i:s'));
$edit->build();
if ($edit->on_success()) {
$rt = array('status' => 'A', 'mensaje' => 'Registro guardado', 'pk' => $edit->_dataobject->pk);
echo json_encode($rt);
return true;
}
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['form'] =& $edit;
$this->load->view('view_bconci', $conten);
}
}
示例2: dataeditdialog
//.........这里部分代码省略.........
$edit->email->size = 40;
$edit->email->maxlength = 100;
$edit->tipo = new autoUpdateField('tipo', '1', '1');
$edit->credito = new autoUpdateField('credito', 'N', 'N');
$edit->limite = new autoUpdateField('limite', '0', '0');
$script = '
$(function() {
$("#sclidialogrifci").focusout(function(){
rif=$(this).val().toUpperCase();
$(this).val(rif);
$("#sclidialogrifci").val(rif);
if(!chrif(rif)){
alert("Al parecer el RIF colocado no es correcto, por favor verifique con el SENIAT.");
return true;
}else{
$.ajax({
type: "POST",
url: "' . site_url('ajax/traerif') . '",
dataType: "json",
data: {rifci: rif},
success: function(data){
if(data.error==0){
if($("#sclidialognombre").val()==""){
$("#sclidialognombre").val(data.nombre);
}
}
}
});
//Chequea si esta repetido
$.ajax({
type: "POST",
url: "' . site_url('ajax/rifrep/C') . '",
dataType: "json",
data: {rifci: rif, codigo: ' . json_encode($edit->get_from_dataobjetct('cliente')) . '},
success: function(data){
if(data.rt){
$.prompt(data.msj,{
buttons: { Continuar: true },
focus: 1,
submit:function(e,v,m,f){
$("#nombre").focus();
}
});
$("#sclidialogrifci").unbind("focusout");
}
}
});
//Fin del chequeo repetido
}
});
});
function chrif(rif){
rif.toUpperCase();
var patt=/[EJPGV][0-9]{9} * /g;
if(patt.test(rif)){
var factor= new Array(4,3,2,7,6,5,4,3,2);
var v=0;
if(rif[0]=="V"){
v=1;
}else if(rif[0]=="E"){
v=2;
}else if(rif[0]=="J"){
v=3;
}else if(rif[0]=="P"){
v=4;
}else if(rif[0]=="G"){
v=5;
}
acum=v*factor[0];
for(i=1;i<9;i++){
acum=acum+parseInt(rif[i])*factor[i];
}
acum=11-acum%11;
if(acum>=10 || acum<=0){
acum=0;
}
return (acum==parseInt(rif[9]));
}else{
return true;
}
}';
$edit->script($script);
$edit->build();
if ($edit->on_show()) {
echo $edit->output;
}
if ($edit->on_success()) {
$data = array('id' => $edit->_dataobject->get('id'), 'cliente' => $edit->_dataobject->get('cliente'), 'nombre' => $edit->_dataobject->get('nombre'), 'rifci' => $edit->_dataobject->get('rifci'), 'tipo' => $edit->_dataobject->get('tipo'), 'direc' => $edit->_dataobject->get('dire11'), 'descuento' => 0);
$rt = array('status' => 'A', 'mensaje' => 'Registro guardado', 'data' => $data, 'pk' => $edit->_dataobject->pk);
echo json_encode($rt);
}
if ($edit->on_error()) {
$rt = array('status' => 'B', 'mensaje' => $edit->error_string, 'pk' => $edit->_dataobject->pk);
echo json_encode($rt);
}
}
示例3: 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));
}
}
}
示例4: dataedit
function dataedit()
{
$this->rapyd->load("dataedit");
$edit = new DataEdit("Unidad", "unidad");
$edit->post_process('insert', '_post_insert');
$edit->post_process('update', '_post_update');
$edit->post_process('delete', '_post_delete');
$edit->back_url = site_url("inventario/unidad/filteredgrid");
$edit->unidades = new inputField("Unidad", 'unidades');
$edit->unidades->size = 15;
$edit->unidades->maxlength = 30;
$edit->unidades->rule = "trim|strtoupper|required";
$edit->buttons("modify", "save", "undo", "delete", "back");
$edit->build();
if ($this->genesal) {
$edit->build();
$data['content'] = $edit->output;
$data['title'] = heading('Unidad');
$data['head'] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $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));
}
}
}
示例5: ncppro
//.........这里部分代码省略.........
$edit->preducida->showformat = 'decimal';
$edit->padicional = new inputField('', 'padicional');
$edit->padicional->rule = 'numeric';
$edit->padicional->type = 'inputhidden';
$edit->padicional->insertValue = $ivas['sobretasa'];
$edit->padicional->showformat = 'decimal';
//bases de los impuestos
$edit->montasa = new inputField('Montasa', 'montasa');
$edit->montasa->rule = 'max_length[17]|numeric|positive';
$edit->montasa->css_class = 'inputnum';
$edit->montasa->size = 19;
$edit->montasa->maxlength = 17;
$edit->montasa->rule = 'condi_required';
$edit->monredu = new inputField('Monredu', 'monredu');
$edit->monredu->rule = 'max_length[17]|numeric|positive';
$edit->monredu->css_class = 'inputnum';
$edit->monredu->size = 19;
$edit->monredu->maxlength = 17;
$edit->monredu->rule = 'condi_required';
$edit->monadic = new inputField('Monadic', 'monadic');
$edit->monadic->rule = 'max_length[17]|numeric|positive';
$edit->monadic->css_class = 'inputnum';
$edit->monadic->size = 19;
$edit->monadic->maxlength = 17;
$edit->monadic->rule = 'condi_required';
//fin de las bases de los impuestos
$edit->tasa = new inputField('general', 'tasa');
$edit->tasa->rule = 'max_length[17]|numeric';
$edit->tasa->css_class = 'inputnum';
$edit->tasa->size = 12;
$edit->tasa->maxlength = 17;
$edit->tasa->rule = 'condi_required|callback_chmontasa[G]';
$edit->reducida = new inputField('reducida', 'reducida');
$edit->reducida->rule = 'max_length[17]|numeric|positive';
$edit->reducida->css_class = 'inputnum';
$edit->reducida->size = 12;
$edit->reducida->maxlength = 17;
$edit->reducida->rule = 'condi_required|callback_chmontasa[R]';
$edit->sobretasa = new inputField('adicional', 'sobretasa');
$edit->sobretasa->rule = 'max_length[17]|numeric|positive';
$edit->sobretasa->css_class = 'inputnum';
$edit->sobretasa->size = 12;
$edit->sobretasa->maxlength = 17;
$edit->sobretasa->rule = 'condi_required|callback_chmontasa[A]|positive';
$edit->exento = new inputField('Exento', 'exento');
$edit->exento->rule = 'max_length[17]|numeric';
$edit->exento->css_class = 'inputnum';
$edit->exento->size = 19;
$edit->exento->maxlength = 17;
$edit->exento->rule = 'condi_required|positive';
$edit->reteiva = new inputField('Ret. IVA', 'reteiva');
$edit->reteiva->rule = 'max_length[17]|numeric';
$edit->reteiva->css_class = 'inputnum';
$edit->reteiva->size = 19;
$edit->reteiva->maxlength = 17;
$edit->reteiva->insertValue = '0';
$edit->reteiva->rule = 'condi_required|callback_chobligatipo[NC]|positive';
$edit->monto = new inputField('Total', 'monto');
$edit->monto->rule = 'required|max_length[17]|numeric';
$edit->monto->css_class = 'inputnum';
$edit->monto->size = 19;
$edit->monto->maxlength = 17;
$edit->monto->type = 'inputhidden';
//Campos comodines
$edit->sprvreteiva = new hiddenField('', 'sprvreteiva');
$edit->aplrete = new hiddenField('', 'aplrete');
//Fin de los campos comodines
$edit->tipo_doc = new autoUpdateField('tipo_doc', 'NC', 'NC');
$edit->usuario = new autoUpdateField('usuario', $this->secu->usuario(), $this->secu->usuario());
$edit->estampa = new autoUpdateField('estampa', date('Ymd'), date('Ymd'));
$edit->hora = new autoUpdateField('hora', date('H:i:s'), date('H:i:s'));
$arr_ptasa = array();
$edit->apltasa = new dropdownField('', 'apltasa');
$mSQL = 'SELECT fecha,tasa,redutasa,sobretasa FROM civa ORDER BY fecha DESC LIMIT 3';
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
$arr_ptasa[] = array(floatval($row->tasa), floatval($row->redutasa), floatval($row->sobretasa));
$edit->apltasa->option($row->fecha, dbdate_to_human($row->fecha));
}
$edit->apltasa->onchange = 'chapltasa()';
$edit->apltasa->style = 'width:100px;';
$edit->apltasa->rule = 'required';
$edit->build();
if ($edit->on_success()) {
$rt = array('status' => 'A', 'mensaje' => 'Registro guardado', 'pk' => $edit->_dataobject->pk);
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['json_ptasa'] = json_encode($arr_ptasa);
$conten['form'] =& $edit;
$conten['title'] = heading('Nota de crédito a factura pagada a proveedor');
$this->load->view('view_ncppro', $conten);
}
}
示例6: reporte
function reporte()
{
header('Content-Type: text/html; charset=' . $this->config->item('charset'));
$this->rapyd->load('dataedit');
$this->rapyd->uri->keep_persistence();
$atts = array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0');
$edit = new DataEdit('', 'reportes');
$id = $edit->_dataobject->pk['nombre'];
$uri2 = anchor_popup('reportes/ver/' . $id, 'Probar reporte', $atts);
$uri3 = anchor_popup('supervisor/mantenimiento/centinelas', 'Centinela', $atts);
$edit->title(' ');
$script = '
$("#df1").submit(function(){
$("#proteo").val(editor.getValue());
$.post("' . site_url('supervisor/repomenu/gajax_proteo/update/' . $id) . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
function(data){
//alert("Reporte guardado" + data);
}
);
return false;
});
function guarda() {
$("#proteo").val(editor.getValue());
$.post("' . site_url('supervisor/repomenu/gajax_proteo/update/' . $id) . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
function(data){
//alert("Reporte guardado" + data);
}
);
return false;
};
function fcargar(){
$.post("' . site_url('supervisor/repomenu/cargar/') . '", { nombre:"' . $id . '"},
function(data){
if (data){ $("#proteo").val(editor.setValue(data)); } else { alert("Archivo vacio");}
});
return false;
};
function fguardar(){
$("#proteo").val(editor.getValue());
$.post("' . site_url('supervisor/repomenu/guardar/') . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
function(data){
alert(data);
});
return false;
};';
$edit->script($script, 'modify');
$edit->back_save = true;
$edit->back_cancel = true;
$edit->back_cancel_save = true;
$edit->back_url = site_url('supervisor/repomenu/filteredgrid');
$edit->proteo = new textareaField('', 'proteo');
$edit->proteo->rows = 30;
$edit->proteo->cols = 130;
$edit->proteo->css_class = 'text-indent:100px;width:90%;11';
//$edit->buttons('modify', 'save', 'undo', 'delete', 'back');
//$accion=$this->datasis->jwinopen(site_url('reportes/ver/'.$id."'"));
//$edit->button_status('btn_probar','Probar Reporte',$accion,'TL','modify');
//$accion=$this->datasis->jwinopen(site_url('supervisor/mantenimiento/centinelas'));
//$edit->button_status('btn_centinela','Centinelas',$accion,'TL','modify');
//$edit->button_status('btn_guardar' ,'Guardar a Archivo' ,'fguardar()','TL','modify');
//$edit->button_status('btn_cargar' ,'Cargar desde Archivo','fcargar()' ,'TL','modify');
$edit->build();
$rt = array('status' => '', 'msj' => '', 'pk' => '');
if ($edit->on_success()) {
$rt['status'] = 'A';
$rt['msj'] = 'Guardado';
echo json_encode($rt);
}
if ($edit->on_error()) {
$rt['status'] = 'B';
$rt['msj'] = $edit->error_string;
echo json_encode($rt);
}
//$this->rapyd->jquery[]='$("#proteo").tabby();';
//$this->rapyd->jquery[]='$("#proteo").linedtextarea();';
if ($edit->on_show()) {
$data['back_url'] = $edit->back_url;
$data['content'] = $edit->output;
$data['title'] = $id;
$data['head'] = $this->rapyd->get_head();
$this->load->view('editorep', $data);
}
}
示例7: formato
//.........这里部分代码省略.........
$edit->cuenta = new inputField('Contable', 'cuenta');
$edit->cuenta->rule = 'trim|existecpla';
$edit->cuenta->append($bcpla);
$edit->cuenta->size = 15;
$edit->cuenta->maxlength = 15;
$edit->cuenta->insertValue = $this->datasis->dameval('SELECT cuenta FROM grcl WHERE gr_desc like "CONSUMIDOR FINAL%"');
$edit->telefono = new inputField('Teléfonos', 'telefono');
$edit->telefono->rule = 'trim';
$edit->telefono->size = 20;
$edit->telefono->maxlength = 30;
$edit->telefon2 = new inputField('Fax', 'telefon2');
$edit->telefon2->rule = 'trim';
$edit->telefon2->size = 20;
$edit->telefon2->maxlength = 25;
$edit->tipo = new dropdownField('Tipo ', 'tipo');
$edit->tipo->options(array('1' => 'Precio 1', '2' => 'Precio 2', '3' => 'Precio 3', '4' => 'Precio 4', '0' => 'Inactivo'));
$edit->tipo->style = 'width:90px';
$edit->formap = new inputField('Días', 'formap');
$edit->formap->css_class = 'inputnum';
$edit->formap->rule = 'trim|integer';
$edit->formap->maxlength = 10;
$edit->formap->size = 6;
$edit->limite = new inputField('Límite', 'limite');
$edit->limite->css_class = 'inputnum';
$edit->limite->rule = 'trim|numeric';
$edit->limite->maxlength = 12;
$edit->limite->size = 10;
$edit->vendedor = new dropdownField('Vendedor', 'vendedor');
$edit->vendedor->option('', 'Ninguno');
$edit->vendedor->options("SELECT vendedor, CONCAT(vendedor,'-',nombre) AS nom FROM vend WHERE tipo IN ('V','A') ORDER BY vendedor");
$edit->vendedor->style = 'width:250px';
$edit->porvend = new inputField('Comisión%', 'porvend');
$edit->porvend->css_class = 'inputnum';
$edit->porvend->rule = 'trim|numeric';
$edit->porvend->size = 4;
$edit->porvend->maxlength = 5;
$edit->cobrador = new dropdownField('Cobrador', 'cobrador');
$edit->cobrador->option('', 'Ninguno');
$edit->cobrador->options("SELECT vendedor, CONCAT(vendedor,'-',nombre) nombre FROM vend WHERE tipo IN ('C','A') ORDER BY vendedor");
$edit->cobrador->style = 'width:250px';
$edit->porcobr = new inputField('Comisión%', 'porcobr');
$edit->porcobr->css_class = 'inputnum';
$edit->porcobr->rule = 'trim|numeric';
$edit->porcobr->size = 4;
$edit->porcobr->maxlength = 5;
$edit->observa = new textareaField('Observación', 'observa');
$edit->observa->rule = 'trim';
$edit->observa->cols = 70;
$edit->observa->rows = 3;
$edit->mensaje = new inputField('Mensaje', 'mensaje');
$edit->mensaje->rule = 'trim';
$edit->mensaje->size = 50;
$edit->mensaje->maxlength = 40;
$edit->mmargen = new inputField("Margen al Mayor", 'mmargen');
$edit->mmargen->css_class = 'inputnum';
$edit->mmargen->size = 10;
$edit->mmargen->maxlength = 10;
$edit->buttons('modify', 'save', 'undo', 'delete', 'back');
if ($this->genesal) {
$edit->build();
$style = '
<style type="text/css">
.maintabcontainer {width: 780px; margin: 5px auto;}
</style>';
$conten['pais'] = $this->pi18n->pais;
$conten['form'] =& $edit;
$data['content'] = $this->load->view('view_sclicol', $conten, true);
$data['content'] .= $this->pi18n->fallas();
$data['smenu'] = $this->load->view('view_sub_menu', $smenu, true);
if ($this->pi18n->pais == 'COLOMBIA') {
$data['title'] = heading('Clientes');
} else {
$data['title'] = heading('(' . $edit->cliente->value . ') ' . substr($edit->nombre->value, 0, 30));
}
$data['script'] = script('jquery.js');
$data['script'] .= script('jquery-ui.js');
$data['script'] .= script('jquery.alerts.js');
$data['script'] .= script('plugins/jquery.numeric.pack.js');
$data['script'] .= script('plugins/jquery.floatnumber.js');
$data['script'] .= script('plugins/jquery.autocomplete.js');
$data['script'] .= script('plugins/jquery.blockUI.js');
//$data["script"] .= script("sinvmaes.js");
$data['script'] .= $script;
$data['style'] = style("jquery.alerts.css");
$data['style'] .= style("redmond/jquery-ui.css");
$data['style'] .= style('jquery.autocomplete.css');
$data['style'] .= $style;
$data['head'] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
} else {
$edit->on_save_redirect = false;
$edit->build();
if ($edit->on_success()) {
$rt = 'Cliente Guardado';
} elseif ($edit->on_error()) {
$rt = html_entity_decode(preg_replace('/<[^>]*>/', '', $edit->error_string));
}
return $rt;
}
}