Exemple #1
0
 function index()
 {
     $this->rapyd->load('dataform');
     $filter = new dataForm('buscador/index/procesar');
     $filter->valor = new inputField('Valor', 'valor');
     $filter->valor->rule = 'required';
     $filter->valor->size = 20;
     $filter->submit('btnsubmit', 'Buscar');
     $filter->build_form();
     $sal = '';
     if ($filter->on_success()) {
         $this->load->library('table');
         $this->table->set_heading('Tabla', 'Campo', 'Coincidencias');
         $valor = $this->db->escape($filter->valor->newValue);
         $tables = $this->db->list_tables();
         foreach ($tables as $table) {
             $fields = $this->db->list_fields($table);
             foreach ($fields as $field) {
                 $mSQL = "SELECT COUNT(*) AS cana FROM `{$table}` WHERE `" . $field . "` = {$valor}";
                 $cana = $this->datasis->dameval($mSQL);
                 if ($cana > 0) {
                     $this->table->add_row($table, $field, $cana);
                 }
             }
         }
         $sal = $this->table->generate();
     }
     $data['content'] = $filter->output . $sal;
     $data['title'] = heading('Busca un valor en toda la base de datos');
     $data['head'] = $this->rapyd->get_head();
     $this->load->view('view_ventanas', $data);
 }
Exemple #2
0
 function sel()
 {
     $this->rapyd->load("dataform");
     $tipo = $this->input->post('tipo');
     $form = new dataForm('presupuesto/selpres/sel');
     if ($tipo !== false) {
         $this->session->set_userdata(array("tipo" => $tipo));
     }
     $form->pres = new freeField("Presupuesto Activo", "tipò", $this->session->userdata('tipo'));
     $form->tipo = new dropdownField('Presupuesto', 'tipo');
     $form->tipo->options("SELECT tipo,tipo as valor FROM tipopres ORDER BY tipo");
     $form->submit("btnsubmit", "Seleccionar");
     $form->build_form();
     $data['content'] = $form->output;
     $data['title'] = " Presupuesto Activo ";
     $data["head"] = $this->rapyd->get_head();
     $this->load->view('view_ventanas', $data);
 }
Exemple #3
0
 function seleccion($ban = '0')
 {
     $this->rapyd->load("dataform", "datagrid");
     $form = new dataForm('presupuesto/presupgenera/carga');
     if ($ban == 0) {
         $form->msj = new freeField("", "tipò", "Cargo");
     }
     $form->estruadm = new dropdownField("Estructura Administrativa", "estruadm");
     $form->estruadm->options("SELECT codigo,CONCAT_WS(' ',codigo,denominacion) FROM estruadm WHERE LENGTH(codigo)=(SELECT LENGTH(valor) from valores WHERE nombre='FORMATOESTRU') ORDER BY codigo");
     $form->tipo = new dropdownField("Tipo de presupuesto", "tipo");
     $form->tipo->option("G", "Gasto");
     $form->tipo->option("T", "Gasto e Ingreso");
     $form->tipo->option("I", "Ingreso");
     $form->tipo->style = 'width:150px;';
     $form->fondo = new dropdownField("Origen de Fondo", "fondo");
     $form->fondo->options("SELECT fondo, fondo AS val FROM fondo");
     $form->fondo->style = 'width:150px;';
     $form->submit("btnsubmit", "Generar");
     $form->build_form();
     $grid = new DataGrid("");
     $grid->db->select(array("codigoadm", "tipo"));
     $grid->db->from('presupuesto');
     $grid->db->orderby('codigoadm', 'desc');
     $grid->db->groupby(array("codigoadm", " tipo"));
     //$grid->db->query("SELECT codigoadm, tipo FROM presupuesto GROUP BY codigoadm, tipo");
     //$grid->order_by("sect_pres","asc");
     $grid->column_orderby("Estructura Administrativa", "codigoadm", "codigoadm", "align='left'");
     $grid->column_orderby("Tipo", "tipo", "tipo", "align='left'");
     $grid->build();
     //$data['filtro']  = $form->output;
     $data['content'] = $form->output . $grid->output;
     $data['script'] = script("jquery.js") . "\n";
     $data['title'] = "Presupuestos Generados";
     //$data['content'] = $form->output.$grid->output;
     //$data['title']   = " Generar Presupuesto ";
     $data["head"] = $this->rapyd->get_head();
     $this->load->view('view_ventanas', $data);
 }
Exemple #4
0
 function imppago()
 {
     // Si manda el valor en el uri
     if ($this->uri->total_segments() == 6) {
         $tt = $this->uri->segment($this->uri->total_segments());
         if ($this->uri->segment(5) == 'procesar') {
             $_POST['valor'] = $tt;
         }
     } else {
         $tt = 'procesar';
     }
     $this->rapyd->load('datagrid', 'dataform');
     $filter = new dataForm('contabilidad/casi/localizador/' . $tipo . '/procesar');
     $filter->valor = new inputField($tit, 'valor');
     $filter->valor->rule = 'required' . $rul;
     $filter->valor->autocomplete = false;
     $filter->valor->maxlength = $maxlen;
     $filter->valor->size = 15;
     if ($tt != 'procesar') {
         $filter->valor->insertValue = $tt;
     }
     $action = "javascript:window.location='" . site_url('contabilidad/casi/auditoria') . "'";
     $filter->button('btn_regresa', 'Regresar', $action, 'BL');
     $filter->submit('btnsubmit', 'Buscar');
     $filter->build_form();
     $sal = '';
     /*
     		$verdad = ($filter->on_success() && $filter->is_valid());
     		if ( $tt <> 'procesar') {
     			$verdad = true;
     		}
     */
     if ($filter->on_success() && $filter->is_valid()) {
         $this->load->library('table');
         $this->table->set_heading('Tabla', 'Campo', 'Coincidencias');
         //$valor = str_pad($filter->valor->newValue,8,'0', STR_PAD_LEFT);
         if ($valor == '00000000') {
             $valor = $tt;
         }
         $valor = $this->db->escape($valor);
         $tables = $this->db->list_tables();
         foreach ($tables as $table) {
             if (preg_match("/^view_.*\$|^sp_.*\$|^viemovinxventas\$/i", $table)) {
                 continue;
             }
             $fields = $this->db->list_fields($table);
             if (in_array($cc, $fields)) {
                 $mSQL = "SELECT COUNT(*) AS cana FROM `{$table}` WHERE {$cc} = {$valor}";
                 $cana = $this->datasis->dameval($mSQL);
                 if ($cana > 0) {
                     $grid = new DataGrid("{$table}: {$cana}");
                     //$grid->per_page = $cana;
                     $grid->db->from($table);
                     $grid->db->where("{$cc} = {$valor}");
                     $grid->db->limit(200);
                     if (in_array('id', $fields)) {
                         $grid->db->orderby('id', 'desc');
                     }
                     foreach ($fields as $ff) {
                         $grid->column($ff, $ff);
                     }
                     $grid->build();
                     $sal .= $grid->output;
                 }
             }
         }
     }
     $data['content'] = $filter->output . $sal;
     $data['title'] = heading('Localizador de Transacciones');
     $data['head'] = $this->rapyd->get_head();
     $this->load->view('view_ventanas', $data);
 }
Exemple #5
0
 function localizador($tipo)
 {
     if ($tipo == 'cuenta') {
         $cc = 'cuenta';
         $tit = 'N&uacute;mero de cuenta';
         $rul = '';
         $maxlen = '20';
     } else {
         $cc = 'transac';
         $tit = 'N&uacute;mero de transacci&oacute;n';
         $rul = '|callback_chvalidt';
         $maxlen = '8';
     }
     // Si manda el valor en el uri
     if ($this->uri->total_segments() == 6) {
         $tt = $this->uri->segment($this->uri->total_segments());
         if ($this->uri->segment(5) == 'procesar') {
             $_POST['valor'] = $tt;
         }
     } else {
         $tt = 'procesar';
     }
     $this->rapyd->load('datagrid', 'dataform');
     $filter = new dataForm('contabilidad/casi/localizador/' . $tipo . '/procesar');
     $filter->valor = new inputField($tit, 'valor');
     $filter->valor->rule = 'required' . $rul;
     $filter->valor->autocomplete = false;
     $filter->valor->maxlength = $maxlen;
     $filter->valor->size = 10;
     if ($tt != 'procesar') {
         $filter->valor->insertValue = $tt;
     }
     $action = "javascript:window.location='" . site_url('contabilidad/casi/auditoria') . "'";
     $filter->button('btn_regresa', 'Regresar', $action, 'BL');
     $filter->submit('btnsubmit', 'Buscar');
     $filter->build_form();
     $sal = '';
     $verdad = $filter->on_success() && $filter->is_valid();
     if ($tt != 'procesar') {
         $verdad = true;
     }
     if ($verdad) {
         $valor = str_pad($filter->valor->newValue, 8, '0', STR_PAD_LEFT);
         if ($valor == '00000000') {
             $valor = $tt;
         }
         $valor = $this->db->escape($valor);
         $tables = $this->db->list_tables();
         foreach ($tables as $table) {
             if (preg_match("/^view_.*\$|^sp_.*\$|^viemovinxventas\$|^vietodife\$/i", $table)) {
                 continue;
             }
             if ($cc == 'cuenta' && $table == 'itcasi') {
                 continue;
             }
             $valasi = $cc == 'transac' && ($table == 'casi' || $table == 'itcasi');
             $fields = $this->db->list_fields($table);
             if (in_array($cc, $fields) || $valasi) {
                 if ($valasi) {
                     $ccc = 'comprob';
                 } else {
                     $ccc = $cc;
                 }
                 $mSQL = "SELECT COUNT(*) AS cana FROM `{$table}` WHERE {$ccc} = {$valor}";
                 $cana = intval($this->datasis->dameval($mSQL));
                 if ($cana > 0) {
                     $grid = new DataGrid("{$table}: {$cana}");
                     //$grid->per_page = $cana;
                     $grid->db->from($table);
                     $grid->db->where("{$ccc} = {$valor}");
                     $grid->db->limit(200);
                     if (in_array('id', $fields)) {
                         $grid->db->orderby('id', 'desc');
                     }
                     foreach ($fields as $ff) {
                         $grid->column($ff, $ff);
                     }
                     $grid->build();
                     //echo $grid->db->last_query();
                     $sal .= $grid->output;
                 }
             }
         }
     }
     $data['content'] = $filter->output . $sal;
     $data['title'] = heading('Localizador de Transacciones');
     $data['head'] = $this->rapyd->get_head();
     $this->load->view('view_ventanas', $data);
 }