本文整理汇总了PHP中DataFilter::is_valid方法的典型用法代码示例。如果您正苦于以下问题:PHP DataFilter::is_valid方法的具体用法?PHP DataFilter::is_valid怎么用?PHP DataFilter::is_valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataFilter
的用法示例。
在下文中一共展示了DataFilter::is_valid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filteredgrid
function filteredgrid()
{
$this->rapyd->load("datafilter", "datagrid");
$atts = array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0');
$filter = new DataFilter("Filtro de Busqueda", 'sitemslog');
$filter->fechad = new dateonlyField("Desde", "fechad", 'd/m/Y');
$filter->fechah = new dateonlyField("Hasta", "fechah", 'd/m/Y');
$filter->fechad->clause = $filter->fechah->clause = "where";
$filter->fechad->db_name = $filter->fechah->db_name = "fecha";
$filter->fechad->size = $filter->fechah->size = 12;
$filter->fechad->insertValue = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 30, date("Y")));
$filter->fechah->insertValue = date("Y-m-d");
$filter->fechad->operator = ">=";
$filter->fechah->operator = "<=";
$filter->cajero = new dropdownField("Cajero", "cajero");
$filter->cajero->option('', 'Todos');
$filter->cajero->options("Select cajero, nombre as value from scaj ");
$filter->cajero->style = 'width:150px;';
$filter->vendedor = new dropdownField("Vendedor", "vendedor");
$filter->vendedor->option('', 'Todos');
$filter->vendedor->options("Select vendedor, nombre from vend ");
$filter->vendedor->style = 'width:150px;';
$filter->buttons("reset", "search");
$filter->build();
if ($this->rapyd->uri->is_set("search") and $filter->is_valid()) {
$grid = new DataGrid("Resultados");
$grid->per_page = 15;
$uri = anchor_popup('supervisor/sitemslog/detalle/<#id#>', '<#id#>', $atts);
$grid->column("Numero", $uri);
$grid->column("Fecha", "<b><dbdate_to_human><#fecha#></dbdate_to_human></b>", 'fecha', "align='center'");
$grid->column("Cajero", "cajero");
$grid->column("Vendedor", "vendedor");
$grid->column("Tipo", "tipo");
$grid->column("Cliente", "cod_cli");
$grid->column("Hora", "<#hora#>", 'hora', "align='center'");
$grid->build();
//echo $grid->db->last_query();
$tabla = $grid->output;
} else {
$tabla = '';
}
$data['content'] = $filter->output . $tabla;
$data['title'] = "<h1>Log de Ventas</h1>";
$data["head"] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例2: filteredgrid
function filteredgrid()
{
$this->rapyd->load("datafilter", "datagrid");
$filter = new DataFilter("Filtro de Busqueda", 'logusu');
//$filter->db->select(array());
$filter->usuario = new dropdownField("Usuario", "usuario");
$filter->usuario->option('', 'Todos');
$filter->usuario->options("Select usuario, usuario as value from logusu group by usuario");
$filter->usuario->style = 'width:150px;';
$filter->fechad = new dateonlyField("Desde", "fechad", 'd/m/Y');
$filter->fechah = new dateonlyField("Hasta", "fechah", 'd/m/Y');
$filter->fechad->clause = $filter->fechah->clause = "where";
$filter->fechad->db_name = $filter->fechah->db_name = "fecha";
$filter->fechad->size = $filter->fechah->size = 12;
$filter->fechad->insertValue = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 30, date("Y")));
$filter->fechah->insertValue = date("Y-m-d");
$filter->fechad->operator = ">=";
$filter->fechah->operator = "<=";
$filter->modulo = new inputField("Módulo", "modulo");
$filter->modulo->size = 6;
$filter->referencia = new inputField("Referencia", "comenta");
$filter->referencia->size = 60;
$filter->buttons("reset", "search");
$filter->build();
if ($this->rapyd->uri->is_set("search") and $filter->is_valid()) {
$grid = new DataGrid("Resultados");
$grid->per_page = 15;
$grid->column_orderby("Usuario", "usuario", 'usuario');
$grid->column_orderby("Fecha", "<b><dbdate_to_human><#fecha#></dbdate_to_human></b>", 'fecha', "align='center'");
$grid->column_orderby("Hora", "<#hora#>", 'hora', "align='center'");
$grid->column_orderby("Módulo", "modulo", 'modulo');
$grid->column_orderby("Acción", "comenta", 'comenta');
$grid->build();
//echo $grid->db->last_query();
$tabla = $grid->output;
} else {
$tabla = '';
}
$data['content'] = $filter->output . $tabla;
$data['title'] = "<h1>Log de Usuarios</h1>";
$data["head"] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例3: montos
$bool = $this->db->query("CREATE TABLE PRENOM{$contra} SELECT * FROM {$tabla}");
if ($bool) {
echo "_Si";
}
}
function montos()
{
$this->rapyd->load('datagrid', 'fields', 'datafilter');
$error = '';
if ($this->input->post('pros') !== FALSE) {
$concepto = $this->input->post('concepto');
$conceptoe = $this->db->escape($concepto);
$pmontos = $this->input->post('monto');
//$this->load->library('pnomina');
$formula = $this->datasis->dameval("SELECT formula FROM conc WHERE concepto={$conceptoe}");
foreach ($pmontos as $cod => $cant) {
if (!is_numeric($cant)) {
$error .= "{$cant} no es un valor num&erico;rico<br>";
} else {
$this->actualizaprenom($cod, $cant, $concepto, $formula);
$this->calculaprenom(false, $cod);
}
}
}
$filter = new DataFilter(" ", 'prenom');
$filter->error_string = $error;
$filter->concepto = new dropdownField("Concepto", "concepto");
$filter->concepto->option("", "Seleccionar");
$filter->concepto->options("SELECT concepto,CONCAT_WS(' ',concepto,descrip) descrip FROM prenom WHERE formula like '%XMONTO%' GROUP BY concepto ORDER BY descrip");
$filter->concepto->clause = "where";
$filter->concepto->operator = "=";
$filter->concepto->rule = "required";
$filter->buttons("reset", "search");
$filter->build();
$ggrid = '';
if ($filter->is_valid()) {
$ggrid = form_open('/nomina/prenom/montos/search/osp');
$ggrid .= form_hidden('concepto', $filter->concepto->newValue);
$monto = new inputField("Monto", "monto");
$monto->grid_name = 'monto[<#codigo#>]';
$monto->status = 'modify';
$monto->size = 12;
$monto->css_class = 'inputnum';
$grid = new DataGrid("Concepto (" . $filter->concepto->newValue . ") " . $filter->concepto->options[$filter->concepto->newValue]);
$grid->column("Código", "codigo");
$grid->column("Nombre", "nombre");
$grid->column("Monto", $monto, 'align=\'right\'');
$grid->column("Valor", 'valor', 'align=\'right\'');
$grid->submit('pros', 'Guardar', "BR");
$grid->build();
$ggrid .= $grid->output;
$ggrid .= form_close();
}
$script = '
<script type="text/javascript">
$(function() {
$(".inputnum").numeric(".");
});
</script>';
$data['content'] = $filter->output . anchor('nomina/prenom', 'Inicio') . $ggrid;
示例4: filteredgrid
function filteredgrid()
{
$this->rapyd->load('datafilter', 'datagrid');
$filter = new DataFilter('Filtro de Búsqueda', 'sitemslog');
$filter->fechad = new dateonlyField('Rango de Fechas', 'fechad', 'd/m/Y');
$filter->fechah = new dateonlyField('Hasta', 'fechah', 'd/m/Y');
$filter->fechad->clause = $filter->fechah->clause = 'where';
$filter->fechad->db_name = $filter->fechah->db_name = 'fecha';
$filter->fechad->size = $filter->fechah->size = 12;
//$filter->fechad->insertValue = date("Y-m-d",mktime(0, 0, 0, date("m"), date("d")-1, date("Y")));
$filter->fechad->insertValue = date('Y-m-d');
$filter->fechah->insertValue = date('Y-m-d');
$filter->fechad->operator = '>=';
$filter->fechah->operator = '<=';
$filter->fechah->in = 'fechad';
$filter->cajero = new dropdownField('Cajero', 'cajero');
$filter->cajero->option('', 'Todos');
$filter->cajero->options('SELECT cajero, nombre AS value FROM scaj ORDER BY cajero');
$filter->cajero->style = 'width:150px;';
$filter->vendedor = new dropdownField('Vendedor', 'vendedor');
$filter->vendedor->option('', 'Todos');
$filter->vendedor->options('SELECT vendedor, nombre FROM vend ORDER BY vendedor');
$filter->vendedor->style = 'width:150px;';
$filter->numero = new inputField('Número', 'numero');
$filter->numero->size = 15;
$filter->numero->maxlength = 15;
$filter->descrip = new inputField('Descripción', 'desca');
$filter->usuario = new dropdownField('Usuario', 'usuario');
$filter->usuario->option('', 'Todos');
$filter->usuario->options('SELECT us_codigo,CONCAT_WS(\'-\',us_codigo,us_nombre) AS val FROM usuario ORDER BY us_codigo');
$filter->usuario->style = 'width:150px;';
$filter->tipo = new dropdownField('Operación', 'tipo');
$filter->tipo->option('', 'Todos');
$filter->tipo->option('ABORTADO', 'ABORTADO');
$filter->tipo->option('AGREGA', 'AGREGA');
$filter->tipo->option('ELIMINADO', 'ELIMINADO');
$filter->tipo->option('MODIFICA', 'MODIFICA');
$filter->tipo->style = 'width:150px;';
$filter->buttons('reset', 'search');
$filter->build();
if ($this->rapyd->uri->is_set('search') and $filter->is_valid()) {
$grid = new DataGrid('Resultados');
$grid->per_page = 15;
$grid->column_orderby('Operación', 'tipo', 'tipo', 'align=\'left\'');
$grid->column_orderby('Numero', '<b><#tipoa#><#numa#></b>', 'numa', 'align=\'left\'');
$grid->column_orderby('Fecha', '<dbdate_to_human><#fecha#></dbdate_to_human> <#hora#>', 'fecha', 'align=\'center\'');
$grid->column_orderby('Código', 'codigoa', 'codigoa', 'align=\'left\'');
$grid->column_orderby('Descripción', 'desca', 'desca', 'align=\'left\'');
$grid->column_orderby('Cantidad', '<nformat><#cana#></nformat>', 'cana', 'align=\'right\'');
$grid->column_orderby('Precio', '<format><#preca#></nformat>', 'preca', 'align=\'right\'');
$grid->column_orderby('Total', '<nformat><#tota#></nformat>', 'tota', 'align=\'right\'');
$grid->column_orderby('Vendedor', 'vendedor', 'vendedor', 'align=\'center\'');
$grid->column_orderby('Cajero', 'cajero', 'cajero', 'align=\'center\'');
$grid->column_orderby('Usuario', 'usuario', 'usuario');
$grid->build();
$tabla = $grid->output;
$sq = preg_replace('/LIMIT +[0-9]+[, ]*[0-9]*/', '', $grid->db->last_query());
$sq = raencode(base64_encode($this->encrypt->encode($sq)));
$tabla .= anchor('xlsauto/repo64/' . $sq, 'Descargar a Excell');
} else {
$tabla = '';
}
$data['content'] = $filter->output . $tabla;
$data['title'] = heading('Bitácora de Facturación');
$data['head'] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例5: montos
function montos()
{
$this->rapyd->load('datagrid', 'fields', 'datafilter');
/*$this->load->library('form_validation');
if ($this->form_validation->run() == FALSE){
$this->load->view('myform');
}else{
$this->load->view('formsuccess');
}*/
$error = '';
if ($this->input->post('pros') !== FALSE) {
$concepto = $this->db->escape($this->input->post('concepto'));
$pmontos = $this->input->post('monto');
foreach ($pmontos as $cod => $cant) {
$cod = $this->db->escape($cod);
if (!is_numeric($cant)) {
$error .= "{$cant} no es un valor numerico<br>";
} else {
$data = array('monto' => $cant);
$where = "codigo = {$cod} AND concepto ={$concepto} ";
$mSQL = $this->db->update_string('prenom', $data, $where);
$this->db->simple_query($mSQL);
}
}
}
$filter = new DataFilter(" ", 'prenom');
$filter->error_string = $error;
$filter->concepto = new dropdownField("Concepto", "concepto");
$filter->concepto->option("", "Seleccionar");
$filter->concepto->options("SELECT concepto,descrip FROM prenom GROUP BY concepto ORDER BY descrip");
$filter->concepto->clause = "where";
$filter->concepto->operator = "=";
$filter->concepto->rule = "required";
$filter->buttons("reset", "search");
$filter->build();
$ggrid = '';
if ($filter->is_valid()) {
$ggrid = form_open('/nomina/prenom/montos/search/osp');
$ggrid .= form_hidden('concepto', $filter->concepto->newValue);
$monto = new inputField("Monto", "monto");
$monto->grid_name = 'monto[<#codigo#>]';
$monto->status = 'modify';
$monto->size = 12;
$monto->css_class = 'inputnum';
$grid = new DataGrid("Concepto (" . $filter->concepto->newValue . ") " . $filter->concepto->options[$filter->concepto->newValue]);
//$grid->db->where('concepto','015');
//$grid->per_page = $filter->db->num_rows() ;
$grid->column("Código", "codigo");
$grid->column("Nombre", "nombre");
$grid->column("Monto", $monto, 'align=\'right\'');
$grid->submit('pros', 'Guardar', "BR");
$grid->build();
$ggrid .= $grid->output;
$ggrid .= form_close();
}
$script = '
<script type="text/javascript">
$(function() {
$(".inputnum").numeric(".");
});
</script>';
$data['content'] = $filter->output . $ggrid;
$data['title'] = '<h1>Asignación de montos</h1>';
$data['script'] = $script;
$data["head"] = $this->rapyd->get_head() . script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js");
$this->load->view('view_ventanas', $data);
}
示例6: copia
function copia($usua = null)
{
$this->rapyd->load("datafilter", "datagrid");
$usuario = $usua;
function ractivo($acceso, $codigo)
{
if ($acceso == 'S') {
$retorna = form_checkbox($codigo, 'accept', TRUE);
} else {
$retorna = form_checkbox($codigo, 'accept', FALSE);
}
return $retorna;
}
$filter = new DataFilter("");
$filter->db->select(array("b.modulo", 'b.codigo', "a.usuario", "a.usuario as value", "a.acceso", "b.titulo"));
$filter->db->from("sida AS a");
$filter->db->join("tmenus AS b", "a.modulo=b.codigo");
$filter->db->orderby("b.modulo");
$filter->usuario = new dropdownField("Copiar de", "usuario");
$filter->usuario->options("Select us_codigo as value,CONCAT_WS(' - ', us_codigo, us_nombre) as codigo from usuario group by us_codigo");
$filter->usuario->style = 'width:250px;';
$filter->buttons("reset", "search");
$filter->build();
if ($this->rapyd->uri->is_set("search") and $filter->is_valid()) {
$usr = $filter->usuario->newValue;
$mSQL = "INSERT IGNORE INTO sida SELECT '{$usr}',b.codigo,'N' FROM sida AS a RIGHT JOIN tmenus AS b ON a.modulo=b.codigo AND a.usuario='{$usr}' WHERE a.modulo IS NULL";
$this->db->simple_query($mSQL);
$copiar = anchor("supervisor/acdatasis/copiar/{$usr}/{$usuario}", 'Copiar');
$grid = new Datagrid("Resultados");
$grid->use_function('ractivo');
$link = site_url('/supervisor/acdatasis/activar');
//$grid->per_page = 15;
$grid->column("Módulo", "modulo");
$grid->column("Nombre", "titulo");
$grid->column("Acceso", "<ractivo><#acceso#>|<#codigo#>|</ractivo>", 'align="center"');
$grid->build();
$tabla = $copiar . $grid->output;
//echo $grid->db->last_query();
$url = site_url('supervisor/acdatasis/activar');
$data['script'] = '<script type="text/javascript">
$(document).ready(function() {
$("form :checkbox").click(function () {
usr=$("#usuario").attr("value");
$.ajax({type: "POST",
url: "' . $url . '",
data: "codigo="+this.name+"&usuario="+usr,
success: function(msg){
if (msg==0)
alert("Ocurrio un problema");
}
});
}).change();
});
</script>';
} else {
$tabla = '';
}
$data['content'] = ' Usuario:' . $usuario . $filter->output . form_open('') . $tabla . form_close();
$data['title'] = "<h1>Copiar Accesos de Usuario en DataSIS</h1>";
$data["head"] = script("jquery.js") . $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例7: index
//.........这里部分代码省略.........
if (!empty($cen)) {
if ($t == 1) {
if ($tipo_doc == 'F') {
$rt = form_button('asignar', $cen, 'onclick="riega(\'' . $cen . '\');"');
} else {
$rt = form_button('asignar', $cen, 'onclick="riegadev(\'' . $cen . '\');"');
}
} else {
if ($tipo_doc == 'F') {
$rt = form_button('asignar', $cen, 'onclick="nfiscal(\'' . $cen . '\');"');
} else {
$rt = form_button('asignar', $cen, 'onclick="nfiscaldev(\'' . $cen . '\');"');
}
}
} else {
$rt = '--';
}
return $rt;
}
$atts = array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0');
$filter = new DataFilter('', 'sfac');
//$filter->db->where('tipo_doc','F');
$filter->script($jquery);
$filter->fecha = new dateonlyField('Desde', 'fecha');
$filter->fecha->clause = 'where';
$filter->fecha->db_name = 'fecha';
$filter->fecha->insertValue = date('Y-m-d');
$filter->fecha->operator = '=';
$filter->fecha->rule = 'required|chfecha';
$filter->fecha->append("<a onclick='buscaref()'>Traer de referencia</a>");
$filter->cajero = new dropdownField('Cajero', 'cajero');
$filter->cajero->option('', 'Seleccionar');
$filter->cajero->option(' ', 'Creditos');
$filter->cajero->options('SELECT cajero, CONCAT_WS("-",cajero,nombre) FROM scaj ORDER BY cajero');
$filter->usuario = new dropdownField('Usuario', 'usuario');
$filter->usuario->option('', 'Todos');
$filter->usuario->options('SELECT us_codigo AS cod,us_codigo FROM usuario ORDER BY us_codigo');
$filter->usuario->rule = 'condi_required|callback_chusuario';
$filter->tipo_doc = new dropdownField('Tipo Doc.', 'tipo_doc');
$filter->tipo_doc->option('F', 'Facturas');
$filter->tipo_doc->option('D', 'Devoluciones');
$filter->tipo_doc->rule = 'required|enum[D,F]';
$filter->nulos = new dropdownField('Filtrar seriales nulos', 'nulos');
$filter->nulos->option('s', 'Si');
$filter->nulos->option('n', 'No');
$filter->nulos->clause = '';
$filter->nulos->group = 'No afecta el filtro';
$filter->nulos->append('Si se activa esta opcion no se riega el número en los campos donde el serial de la máquina fiscal es nulo');
$filter->nulos->rule = 'enum[s,n]';
$filter->buttons('reset', 'search');
$filter->build();
if ($this->rapyd->uri->is_set('search') && $filter->is_valid()) {
$fecha = $filter->fecha->newValue;
$dbfecha = $this->db->escape($fecha);
$fields = $this->db->field_data('sfac');
$ppk = array();
foreach ($fields as $field) {
if ($field->primary_key == 1) {
$ppk[] = '<#' . $field->name . '#>';
}
}
$llink = anchor('supervisor/sfacfiscal/editsfac/modify/' . implode('/', $ppk), '<#tipo_doc#><#numero#>');
$uri2 = anchor_popup('formatos/verhtml/FACTURA/<#tipo_doc#>/<#numero#>', 'Ver HTML', $atts);
$grid = new DataGrid('');
$grid->use_function('exissinv');
$grid->per_page = 30;
$grid->db->orderby('numero');
$grid->column('Fecha', '<dbdate_to_human><#fecha#></dbdate_to_human>', 'fecha');
$grid->column('Nombre', 'nombre');
$grid->column('Referencia', $llink);
$grid->column('Usuario', 'usuario');
$grid->column('Cajero', 'cajero');
$grid->column('Monto', '<nformat><#totalg#></nformat>', 'align="right"');
$grid->column('N.Fiscal', '<exissinv><#nfiscal#>|2|<#tipo_doc#></exissinv>', 'align="center"');
$grid->column('Serial Maq.', '<exissinv><#maqfiscal#>|1|<#tipo_doc#></exissinv>', 'align="center"');
$grid->column('Ver factura', $uri2, 'align="center"');
$grid->build();
//echo $grid->db->last_query();
$mSQL = $grid->db->last_query();
$mSQL = str_replace('*', 'SUM(totalg)', $mSQL);
$corte = stripos($mSQL, 'ORDER');
if ($corte !== false) {
$mSQL = substr($mSQL, 0, $corte);
}
$monto = $this->datasis->dameval($mSQL);
$tabla = 'Monto: ' . nformat($monto) . $grid->output;
$mSQL = 'SELECT COUNT(*) AS cana,serial, MAX(factura) AS factura,MAX(ncnumero) AS ncnumero,SUM(exento+base+iva+base1+iva1+base2+iva2-ncexento-ncbase-nciva-ncbase1-nciva1-ncbase2-nciva2) AS total FROM fiscalz WHERE fecha=' . $dbfecha . ' GROUP BY serial';
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
$tabla .= $row->serial . ' x' . $row->cana . ' - F' . $row->factura . ' - D' . $row->ncnumero . ' - ' . nformat($row->total) . br();
}
} else {
$tabla = '<div class="alert">' . $filter->error_string . '</div>';
}
//if(strlen($filter->error_string)) $data['error']=$filter->error_string;
$data['content'] = $filter->output . $tabla;
$data['title'] = '<h1>Arreglos de consistencias fiscal en facturas</h1>';
$data['head'] = $this->rapyd->get_head() . script('jquery.js');
$this->load->view('view_ventanas', $data);
}
示例8: montos
function montos()
{
$this->rapyd->load('datagrid', 'fields', 'datafilter');
$error = '';
if ($this->input->post('pros') !== false) {
$concepto = $this->db->escape($this->input->post('concepto'));
$pmontos = $this->input->post('monto');
$this->load->library('pnomina');
$formula = $this->datasis->dameval("SELECT formula FROM conc WHERE concepto={$concepto}");
foreach ($pmontos as $cod => $cant) {
if (!is_numeric($cant)) {
$error .= "{$cant} no es un valor numérico<br>";
} else {
$this->pnomina->CODIGO = $cod;
$this->pnomina->MONTO = $cant;
//$valor=0;
$valor = $this->pnomina->evalform($formula);
$cod = $this->db->escape($cod);
$data = array('monto' => $cant, 'valor' => $valor);
$where = "codigo = {$cod} AND concepto ={$concepto} ";
$mSQL = $this->db->update_string('prenom', $data, $where);
$this->db->simple_query($mSQL);
}
}
}
$filter = new DataFilter(' ', 'prenom');
$filter->error_string = $error;
$filter->concepto = new dropdownField('Concepto', 'concepto');
$filter->concepto->option('', 'Seleccionar');
$filter->concepto->options("SELECT concepto,descrip FROM prenom GROUP BY concepto ORDER BY descrip");
$filter->concepto->clause = 'where';
$filter->concepto->operator = '=';
$filter->concepto->rule = 'required';
$filter->buttons('reset', 'search');
$filter->build();
$ggrid = '';
if ($filter->is_valid()) {
$ggrid = form_open('/nomina/prenom/montos/search/osp');
$ggrid .= form_hidden('concepto', $filter->concepto->newValue);
$monto = new inputField('Monto', 'monto');
$monto->grid_name = 'monto[<#codigo#>]';
$monto->status = 'modify';
$monto->size = 12;
$monto->css_class = 'inputnum';
$grid = new DataGrid("Concepto (" . $filter->concepto->newValue . ") " . $filter->concepto->options[$filter->concepto->newValue]);
$grid->column('Código', 'codigo');
$grid->column('Nombre', 'nombre');
$grid->column('Monto', $monto, 'align=\'right\'');
$grid->column('Valor', 'valor', 'align=\'right\'');
$grid->submit('pros', 'Guardar', 'BR');
$grid->build();
$ggrid .= $grid->output;
$ggrid .= form_close();
}
$script = '
<script type="text/javascript">
$(function() {
$(".inputnum").numeric(".");
});
</script>';
$data['content'] = $filter->output . $ggrid;
$data['title'] = '<h1>Asignación de montos</h1>';
$data['script'] = $script;
$data['head'] = $this->rapyd->get_head() . script('jquery.pack.js') . script('plugins/jquery.numeric.pack.js') . script('plugins/jquery.floatnumber.js');
$this->load->view('view_ventanas', $data);
}
示例9: index
function index()
{
//SELECT * FROM bmov
//WHERE codbanc='01' AND EXTRACT(YEAR_MONTH FROM fecha)<=201004 AND anulado!='S' AND liable!='N' AND
//(concilia=0 OR EXTRACT(YEAR_MONTH FROM concilia)>=20100430 OR concilia<fecha)
$this->rapyd->load('datafilter', 'datagrid');
$filter = new DataFilter('');
$filter->db->from('bmov');
$filter->db->where('anulado !=', 'S');
$filter->db->where('liable !=', 'N');
$filter->mes = new dropdownField('Fecha', 'mes');
$filter->mes->clause = '';
$filter->mes->rule = 'required';
$filter->mes->style = 'width:50px';
for ($i = 1; $i <= 12; $i++) {
$mmes = str_pad($i, 2, '0', STR_PAD_LEFT);
$filter->mes->option($mmes, $mmes);
}
$filter->anio = new inputField('Año', 'anio');
$filter->anio->rule = 'required';
$filter->anio->clause = '';
$filter->anio->in = 'mes';
$filter->anio->size = 5;
$filter->banco = new dropdownField('Banco', 'codbanc');
$filter->banco->rule = 'required';
$filter->banco->clause = 'where';
$filter->banco->option('', 'Seleccionar');
$filter->banco->options('SELECT codbanc AS CLAVE, banco FROM banc WHERE CHAR_LENGTH(tbanco)>0 ORDER BY banco');
$filter->banco->operator = '=';
$filter->tipo_op = new dropdownField('Tipo de Operacion', 'tipo_op');
$filter->tipo_op->option('', 'Todos');
$filter->tipo_op->option('NC', 'Nota de Crédito');
$filter->tipo_op->option('ND', 'Nota de Debito');
$filter->tipo_op->option('DE', 'Deposito');
/*$filter->concilia = new dropdownField('Conciliado', 'concilia');
$filter->concilia->option('','Todos');
$filter->concilia->option('S','Si');
$filter->concilia->option('N','No');*/
//$filter->submit('btnsubmit','Descargar');
$filter->buttons('search');
$filter->build();
if ($this->rapyd->uri->is_set('search') and $filter->is_valid()) {
function conci($conci, $codbanc, $tipo_op, $numero, $fecha)
{
$fech = explode('-', $conci);
$arr = array($codbanc, $tipo_op, $numero, $fecha);
if ($fech[0] + $fech[1] + $fech[2] == 0) {
return form_checkbox($codbanc . $tipo_op . $numero, serialize($arr));
} else {
return form_checkbox($codbanc . $tipo_op . $numero, serialize($arr), TRUE) . dbdate_to_human($conci);
}
}
$fecha = $filter->anio->newValue . $filter->mes->newValue . days_in_month($filter->mes->newValue);
$grid = new DataGrid('Efectos por conciliar');
$grid->use_function('conci');
$grid->order_by('fecha', 'desc');
$grid->per_page = 15;
$grid->column_orderby('Fecha', '<dbdate_to_human><#fecha#></dbdate_to_human>', 'fecha', 'align=\'center\'');
$grid->column_orderby('Numero', 'numero', 'numero');
$grid->column_orderby('Descripción', 'nombre', 'nombre');
$grid->column_orderby('Monto', '<nformat><#monto#></nformat>', 'monto', 'align=\'right\'');
$grid->column_orderby('Conciliado', "<conci><#concilia#>|<#codbanc#>|<#tipo_op#>|<#numero#>|{$fecha}</conci>", 'concilia', 'align=\'center\'');
$grid->build();
//echo $grid->db->last_query();
$ggrid = $grid->output;
} else {
$ggrid = '';
}
$data['content'] = $filter->output . $ggrid;
$data['title'] = '<h1>Conciliaciones de Bancos</h1>';
$data['script'] = '<script language="javascript" type="text/javascript">';
$data['script'] .= '
$(document).ready(function(){
$(":checkbox").change(function(){
name=$(this).attr("name");
$.post("' . site_url('finanzas/conci/cconci') . '",{ data: $(this).val()},
function(data){
if(data=="1"){
return true;
}else{
$("input[name=\'"+name+"\']").removeAttr("checked");
alert("Hubo un error, comuniquese con soporte tecnico");
return false;
}
});
});
});';
$data['script'] .= '</script>';
$data['head'] = $this->rapyd->get_head() . script('jquery.js');
$this->load->view('view_ventanas', $data);
}
示例10: filteredgrid
//.........这里部分代码省略.........
$filter->origen = new dropdownField('Orígen', 'origen');
$filter->origen->option('', 'Todos');
$filter->origen->option('3I', 'Ventas Caja');
$filter->origen->option('3R', 'Ventas Restaurante');
$filter->origen->option('3M', 'Ventas Mayor');
$filter->origen->option('1T', 'Transferencias');
$filter->origen->option('2C', 'Compras');
$filter->origen->option('4N', 'Nota/Entrega');
$filter->origen->option('6C', 'Conversión');
$filter->origen->option('5C', 'Ajuste de inventario');
$filter->origen->option('5D', 'Consignación');
$filter->origen->option('0F', 'Inv. Físico comienzo del día');
$filter->origen->option('9F', 'Inv. Físico final del día');
//$filter->origen->style = 'width:120px';
$filter->origen->group = 'UNO';
$filter->fechad = new dateonlyField('Desde', 'fecha', 'd/m/Y');
$filter->fechad->operator = '>=';
$filter->fechad->insertValue = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') - 30, date('Y')));
$filter->fechad->group = 'DOS';
$filter->fechah = new dateonlyField('Hasta', 'fechah', 'd/m/Y');
$filter->fechah->db_name = 'fecha';
$filter->fechah->operator = '<=';
$filter->fechah->insertValue = date('Y-m-d');
$filter->fechah->group = 'DOS';
$filter->fechah->clause = $filter->fechad->clause = $filter->codigo->clause = 'where';
$filter->fechah->size = $filter->fechad->size = 10;
$filter->fechah->rule = $filter->fechad->rule = 'required|chfecha';
$filter->buttons('reset', 'search');
$filter->build('dataformfiltro');
$data['filtro'] = $filter->output;
$code = $this->input->post('codigo');
$data['content'] = '';
$cana = 0;
if ($code && $filter->is_valid()) {
$dbcode = $this->db->escape($code);
$mSQL = "SELECT CONCAT_WS(' ',TRIM(descrip),TRIM(descrip2)) descrip,existen,activo FROM sinv WHERE codigo={$dbcode}";
$query = $this->db->query($mSQL);
if ($query->num_rows() > 0) {
$row = $query->row();
$descrip = $row->descrip;
$activo = $row->activo;
$existen = floatval($row->existen);
$actual = $this->datasis->dameval("SELECT SUM(existen) AS cana FROM itsinv WHERE codigo={$dbcode}");
if (floatval($actual) != $existen) {
$this->db->simple_query("UPDATE sinv SET existen={$actual} WHERE codigo={$dbcode}");
}
} else {
$activo = 'N';
$descrip = 'No encontrado.';
$existen = 0;
}
$link = "/inventario/kardex/grid/<#origen#>/<dbdate_to_human><#fecha#>|Ymd</dbdate_to_human>/<raencode><#codigo#></raencode>/<raencode><#ubica#></raencode>";
$grid = new DataGrid2("Producto: ({$code}) {$descrip}");
$grid->table_id = 'kardextabla';
$grid->agrupar(' ', 'almacen');
$grid->use_function('convierte', 'str_replace', 'colorgal');
$grid->db->select(array('IFNULL( b.ubides , a.ubica ) almacen', 'a.ubica', 'a.fecha', 'a.venta', 'a.cantidad', 'a.saldo', 'a.monto', 'a.salcant', 'TRIM(a.codigo) AS codigo', 'a.origen', 'a.promedio', '(a.venta/a.cantidad)*(a.cantidad>0) AS vpromedio', 'ROUND(100-(a.promedio*100/(a.venta/a.cantidad)),2)*(a.origen="3I") AS vmargen', '((a.venta/a.cantidad)-a.promedio)*a.cantidad*(a.origen="3I") AS vutil', 'c.activo', 'c.grupo'));
$grid->db->from('costos a');
$grid->db->join('caub b', 'b.ubica=a.ubica', 'LEFT');
$grid->db->join('sinv c', 'a.codigo=c.codigo', 'LEFT');
$grid->db->orderby('almacen, fecha, origen');
$grid->per_page = 60;
$grid->column('Orígen', '<p style="background-color: rgba<colorgal><#origen#></colorgal>;font-size:1.3em;font-weight: bold;margin:0px;padding:0px;border:0px;"><convierte><#origen#>|' . $link . '</convierte></p>', 'align=\'left\' nowrap');
$grid->column('Fecha', '<dbdate_to_human><#fecha#></dbdate_to_human>');
$grid->column('Cantidad', '<nformat><#cantidad#></nformat>', 'align=\'right\'');
$grid->column('<b style="color:#FFFFFF">Acumulado</b>', '<b style="font-size:1.3em"><nformat><#salcant#></nformat></b>', 'align=\'right\'');
示例11: almainconsis
function almainconsis()
{
$this->rapyd->load("datafilter", "datagrid");
$filter = new DataFilter("Clientes inconsistentes");
$filter->fechad = new dateonlyField('Desde', 'fechad');
$filter->fechah = new dateonlyField('Hasta', 'fechah');
$filter->fechad->clause = $filter->fechah->clause = "where";
$filter->fechad->db_name = $filter->fechah->db_name = "fecha";
$filter->fechad->insertValue = date("Y-m-d");
$filter->fechah->insertValue = date("Y-m-d");
$filter->fechad->operator = ">=";
$filter->fechah->operator = "<=";
$filter->buttons("reset", "search");
$filter->build();
if ($this->rapyd->uri->is_set("search") and $filter->is_valid()) {
$fechah = $filter->fechah->newValue;
$fechad = $filter->fechad->newValue;
$alma = $this->datasis->dameval("SELECT a.ubica FROM (`costos` as a) LEFT JOIN `caub` AS b ON `a`.`ubica`=`b`.`ubica` WHERE `b`.`ubica` = 'NULL' AND `origen` = '3I' AND a.fecha >= '{$fechad}' AND a.fecha <= '{$fechah}'");
//echo $alma;
$uri = anchor('supervisor/mantenimiento/cambioalma/modify/<#tipo_doc#>/<#numero#>', 'Cambio');
$grid = new DataGrid('Almacenes inconsistentes');
$select = array('a.fecha', 'a.numero', 'a.cod_cli', 'a.tipo_doc', 'a.totalg', 'a.almacen');
$grid->db->select($select);
$grid->db->from('sfac as a');
$grid->db->where("a.almacen", $alma);
$grid->db->where("a.fecha >= ", $fechad);
$grid->db->where("a.fecha <=", $fechah);
$grid->per_page = 15;
$grid->column('Fecha', '<dbdate_to_human><#fecha#></dbdate_to_human>', 'fecha');
$grid->column('Numero', 'numero');
$grid->column('Cliente', 'cod_cli');
$grid->column('Tipo', 'tipo_doc');
$grid->column('Monto', 'totalg');
$grid->column('Almacen', 'almacen');
$grid->column('Realizar', $uri);
$grid->build();
//echo $grid->db->last_query();
//memowrite($grid->db->last_query());
$tabla = $grid->output;
} else {
$tabla = '';
}
$data['content'] = $filter->output . $tabla;
$data['title'] = "<h1>Almacenes con problemas de incosistencias</h1>";
$data["head"] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例12: filteredgrid
function filteredgrid()
{
//$this->datasis->modulo_id(35,1);
$this->rapyd->load("datafilter", "datagrid");
//$this->rapyd->uri->keep_persistence();
$where = 'activo = "S"';
$mf = $this->datasis->puede(333);
$mo = $this->datasis->puede(334);
if ($mf && $mo) {
} elseif ($mf) {
$where .= ' AND tipocta="F"';
} elseif ($mo) {
$where .= ' AND tipocta<>"F"';
}
$mBANC = array('tabla' => 'banc', 'columnas' => array('codbanc' => 'Cóodigo', 'banco' => 'Banco', 'numcuent' => 'Cuenta', 'saldo' => 'Saldo'), 'filtro' => array('codbanc' => 'Cóodigo', 'banco' => 'Banco', 'saldo' => 'Saldo', 'numcuent' => 'Cuenta'), 'retornar' => array('codbanc' => 'codbanc', 'banco' => 'nombreb'), 'where' => $where, 'titulo' => 'Buscar Bancos');
$bBANC = $this->datasis->p_modbus($mBANC, "banc");
$filter = new DataFilter("");
$filter->db->from("mbancnoc a");
$filter->id = new inputField("Número", "id");
$filter->id->db_name = "a.id";
$filter->id->size = 10;
$filter->cheque = new inputField("Cheque", "cheque");
$filter->cheque->db_name = "a.cheque";
$filter->cheque->size = 10;
$filter->fecha = new dateonlyField("Fecha", "fecha");
$filter->fecha->dbformat = "Y-m-d";
$filter->fecha->size = 12;
$filter->fconcilia = new dateonlyField("F. Conciliado", "fconcilia");
$filter->fconcilia->dbformat = "Y-m-d";
$filter->fconcilia->size = 12;
$filter->codbanc = new inputField("Banco", 'codbanc');
$filter->codbanc->size = 6;
$filter->codbanc->append($bBANC);
$filter->monto = new inputField("Monto", 'monto');
$filter->monto->size = 6;
$filter->benefi = new inputField("A nombre de", 'benefi');
$filter->benefi->size = 20;
$filter->tipo_doc = new dropdownField("Tipo Doc", "tipo_doc");
$filter->tipo_doc->option("", "");
$filter->tipo_doc->option("ND", "Nota de Debito");
$filter->tipo_doc->option("NC", "Nota de Credito");
$filter->tipo_doc->option("CH", "Cheque");
$filter->tipo_doc->option("DP", "Deposito");
$filter->vnoc = new dropdownField("Ver", "vnoc");
$filter->vnoc->clause = " ";
$filter->vnoc->db_name = " ";
$filter->vnoc->option('', 'TODOS');
$filter->vnoc->option('S', 'CONCILIADOS');
$filter->vnoc->option('N', 'NO CONCILIADOS');
$filter->buttons("reset", "search");
$filter->build();
$uri = anchor($this->url . 'dataedit/show/<#id#>', '<str_pad><#id#>|8|0|STR_PAD_LEFT</str_pad>');
$uri2 = anchor($this->url . 'fconci/modify/<#id#>', 'Conciliar');
if ($filter->is_valid()) {
$q1 = $filter->db->_compile_select();
$vnoc = $filter->vnoc->newValue;
$q = "SELECT todo.* FROM (";
$q .= $q1;
$q .= ")todo";
if ($vnoc == 'S') {
$q .= " WHERE fconcilia IS NOT NULL";
}
if ($vnoc == 'N') {
$q .= " WHERE fconcilia IS NULL";
}
$qa = $this->db->query($q);
$qa = $qa->result_array($qa);
$grid = new DataGrid("No Contabilizados", $qa);
$grid->order_by("id", "desc");
$grid->per_page = 20;
$grid->use_function('substr', 'str_pad');
$grid->column_orderby("Número", $uri, "numero");
$grid->column_orderby("Cheque", "cheque", "cheque");
$grid->column_orderby("Tipo", "tipo_doc", "tipo_doc");
$grid->column_orderby("Fecha", "<dbdate_to_human><#fecha#></dbdate_to_human>", "fecha", "align='center'");
$grid->column_orderby("Banco", "codbanc", "fecha", "align='center'");
$grid->column_orderby("Monto", "<nformat><#monto#>|2|,|.</nformat>", "monto", "align='right'");
$grid->column_orderby("F. Conciliado", "<dbdate_to_human><#fconcilia#></dbdate_to_human>", "fconcilia", "align='center'");
$grid->column_orderby("Conciliar", $uri2, "id");
$grid->add($this->url . "dataedit/create");
$grid->build();
$ggrid = $grid->output;
} else {
$ggrid = '';
}
//$data['content'] = $filter->output.$grid->output;
$data['filtro'] = $filter->output;
$data['content'] = $ggrid;
$data['script'] = script("jquery.js") . "\n";
$data['title'] = "{$this->titp}";
$data["head"] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例13: index
function index()
{
$this->load->library('PDFReporte2');
$this->rapyd->load("datafilter");
$repo = $this->uri->segment(3);
$esta = $this->uri->segment(4);
//**************************
$filter = new DataFilter("Filtro del Reporte");
$filter->attributes = array('onsubmit' => 'is_loaded()');
$filter->db->select("fecha, numero, tipo_op,concepto, (tipo_op NOT IN ('CH','ND'))*monto as debitos, (tipo_op IN ('CH','ND'))*monto as creditos,' ' as grupo");
$filter->db->from('bmov as a');
$filter->db->join('banc as b', 'a.codbanc=b.codbanc');
$filter->db->orderby('fecha');
$filter->fecha = new dateonlyField("Desde", "fechad", 'm/Y');
$filter->fecha->clause = 'where';
$filter->fecha->db_name = "EXTRACT(YEAR_MONTH FROM fecha)";
$filter->fecha->insertValue = date("Y-m-d");
$filter->fecha->operator = "=";
$filter->fecha->dbformat = 'Ym';
$filter->fecha->size = 7;
$filter->fecha->append(' mes/año');
$filter->fecha->rule = "required";
$filter->banco = new dropdownField("Caja/Banco", "codbanc");
$filter->banco->db_name = "a.codbanc";
$filter->banco->option("", "");
$filter->banco->options("SELECT codbanc, banco FROM bmov ORDER BY banco ");
$filter->banco->rule = "required";
$filter->buttons("search");
$filter->build();
if ($this->rapyd->uri->is_set("search") and $filter->is_valid()) {
$mSQL = $filter->db->_compile_select();
//echo $mSQL;
$mSALDOANT = $this->datasis->dameval("SELECT SUM(IF(tipo_op IN ('CH', 'ND'),-1,1)*monto) AS saldo FROM bmov WHERE EXTRACT(YEAR_MONTH FROM fecha) <" . $filter->fecha->newValue . " AND codbanc = '" . $filter->banco->newValue . "'");
$mSALDOACT = 0;
$sobretabla = '';
if (!empty($filter->banco->newValue)) {
$sobretabla .= 'Banco: ' . $filter->banco->newValue;
}
$pdf = new PDFReporte2($mSQL);
$pdf->setHeadValores('TITULO1');
$pdf->setSubHeadValores('TITULO2', 'TITULO3');
$pdf->setTitulo("Estado de Cuenta");
$pdf->setSobreTabla($sobretabla);
$pdf->setSubTitulo("Para la fecha: " . $this->input->post('fechad'));
$pdf->AddPage();
$pdf->setTableTitu(8, 'Times');
$pdf->AddCol('fecha', 20, 'Fecha', 'L', 8);
$pdf->AddCol('numero', 25, 'Número', 'L', 8);
$pdf->AddCol('tipo_op', 15, 'Tipo Op', 'L', 8);
$pdf->AddCol('concepto', 70, 'Concepto', 'L', 8);
$pdf->AddCol('debitos', 30, 'Débitos', 'R', 8);
$pdf->AddCol('creditos', 30, 'Créditos', 'R', 8);
$pdf->setTotalizar('debitos', 'creditos');
$pdf->setGrupoLabel("<#grupo#>Saldo Anterior: {$mSALDOANT}, Saldo Actual: {$mSALDOACT}");
$pdf->setGrupo('grupo');
$pdf->Table();
$pdf->Output();
} else {
if (strlen($filter->error_string)) {
$data["error"] = $filter->error_string;
}
$data["filtro"] = $filter->output;
$data["titulo"] = '<h2 class="mainheader">Estado de Cuenta<h2>';
$data["head"] = $this->rapyd->get_head();
$this->load->view('view_freportes', $data);
}
//**************************
//**************************
}
示例14: sntealma
function sntealma()
{
$this->datasis->modulo_id('900', 1);
$this->rapyd->load("datafilter", "datagrid");
$filter = new DataFilter("Cambio de almacén en notas de entrega", 'snte');
$filter->numero = new inputField('Número', 'numero');
$filter->numero->size = 10;
$filter->fechad = new dateonlyField('Desde', 'fechad');
$filter->fechah = new dateonlyField('Hasta', 'fechah');
$filter->fechad->clause = $filter->fechah->clause = "where";
$filter->fechad->db_name = $filter->fechah->db_name = "fecha";
$filter->fechad->insertValue = date("Y-m-d");
$filter->fechah->insertValue = date("Y-m-d");
$filter->fechad->operator = ">=";
$filter->fechah->operator = "<=";
$filter->buttons("reset", "search");
$filter->build();
if ($this->rapyd->uri->is_set('search') && $filter->is_valid()) {
$uri = anchor('supervisor/mantenimiento/sntecambioalma/modify/<#numero#>', '<#almacen#>');
$grid = new DataGrid('Notas de entrega');
$grid->per_page = 15;
$grid->column('Fecha', '<dbdate_to_human><#fecha#></dbdate_to_human>');
$grid->column('Almacén', $uri);
$grid->column('Numero', 'numero');
$grid->column('Cliente', 'cod_cli');
$grid->column('Nombre', 'nombre');
$grid->column('Monto', '<nformat><#gtotal#></nformat>', 'align="right"');
$grid->build();
$tabla = $grid->output;
} else {
$tabla = '';
}
$data['content'] = $filter->output . $tabla;
$data['title'] = "<h1>Cambio de almacén en notas de entrega</h1>";
$data['head'] = $this->rapyd->get_head();
$this->load->view('view_ventanas', $data);
}
示例15: index
//.........这里部分代码省略.........
//$filter->codbanc->db_name='a.codbanc';
$y = date('Y');
$filter->anio = new dropdownField('Año', 'anio');
$filter->anio->option($y, $y);
for ($i = $y - 2; $i <= $y + 2; $i++) {
$filter->anio->option($i, $i);
}
$filter->anio->rule = 'required';
$filter->anio->clause = '';
$filter->anio->in = 'mes';
$filter->anio->size = 5;
$filter->anio->style = "width:100px;";
$filter->anio->group = "Datos de Estado de Cuenta";
$filter->mes = new dropdownField('Fecha mes/año', 'mes');
$filter->mes->clause = '';
$filter->mes->rule = 'required';
$filter->mes->style = 'width:50px';
for ($i = 1; $i <= 12; $i++) {
$mmes = str_pad($i, 2, '0', STR_PAD_LEFT);
$filter->mes->option($mmes, $mmes);
}
$filter->mes->group = "Datos de Estado de Cuenta";
$filter->buttons('reset', 'search');
$filter->build();
$tipos = array("tch" => "T. Cheques", "tnd" => "T. ND", "tdp" => "T. Depositos", "tnc" => "T. NC");
$salida = '';
foreach ($tipos as $key => $value) {
${$key} = new inputField($value, $key);
${$key}->status = "create";
${$key}->size = 15;
${$key}->build();
$salida .= ${$key}->label . ${$key}->output;
}
if ($this->rapyd->uri->is_set('search') and $filter->is_valid()) {
$q1 = $filter->db->_compile_select();
$fechad = $filter->fechad->newValue;
$codbanc = $filter->codbanc->newValue;
$tipo_doc = $filter->tipo_doc->newValue;
$codbanc = $filter->codbanc->newValue;
$cheque = $filter->cheque->newValue;
$cod_prov = $filter->cod_prov->newValue;
$benefi = $filter->benefi->newValue;
$codbance = $this->db->escape($codbanc);
$fechaddb = $fechad;
$tipo_doce = $this->db->escape($tipo_doc);
$chequee = $this->db->escape($cheque);
$benefie = $this->db->escape($benefi);
$vnoc = $this->input->post('vnoc');
$anio = $filter->anio->newValue;
$mes = $filter->mes->newValue;
$q = "SELECT todo.tipo_doc='DP' tdp,MID(cheque,LENGTH(cheque)-3,4) ordena,todo.* FROM ( ";
$q .= $q1;
if ($vnoc) {
$q2 = " SELECT * FROM mbanc WHERE codbanc={$codbance} AND fecha<{$fechaddb} AND concilia='N' AND status NOT IN ('AN') ";
if ($tipo_doc) {
$q2 .= " AND tipo_doc={$tipo_doce} ";
}
if ($cheque) {
$q2 .= " AND tipo_doc={$chequee} ";
}
if ($benefi) {
$q2 .= " AND tipo_doc={$benefie} ";
}
$q .= " UNION ALL ";
$q .= $q2;
}