Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php class M_droid extends CI_Model { public function __construct() { parent::__constru..
Decoded Output download
<?php
class M_droid extends CI_Model { public function __construct() { parent::__construct(); $this->load->database(); } function lea_inv() { return $this->db->query("SELECT * FROM articulo WHERE existencia>0")->result_array(); } function env_inv($sede, $data) { if ($sede == 1) { $table = "articulo"; } else { $table = "articulo2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigo='" . $db["codigo"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["marca"] != $art->marca || $db["referencia"] != $art->referencia || $db["existencia"] != $art->existencia || $db["comprometido"] != $art->comprometido || $db["precio1"] != $art->precio1 || $db["preciofin1"] != $art->preciofin1 || $db["dscto_medicamentos"] != $art->dscto_medicamentos || $db["diasindex"] != $art->diasindex || $db["diascred"] != $art->diascred) { $this->db->where("codigo", $db["codigo"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_inv2() { return $this->db->query("SELECT * FROM articulo WHERE existencia=0 LIMIT 1,2600")->result_array(); } function env_inv2($sede, $data) { if ($sede == 1) { $table = "articulo"; } else { $table = "articulo2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigo='" . $db["codigo"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["marca"] != $art->marca || $db["referencia"] != $art->referencia || $db["existencia"] != $art->existencia || $db["comprometido"] != $art->comprometido || $db["precio1"] != $art->precio1 || $db["preciofin1"] != $art->preciofin1 || $db["dscto_medicamentos"] != $art->dscto_medicamentos || $db["diasindex"] != $art->diasindex || $db["diascred"] != $art->diascred) { $this->db->where("codigo", $db["codigo"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_inv3() { return $this->db->query("SELECT * FROM articulo WHERE existencia=0 LIMIT 2601,2600")->result_array(); } function env_inv3($sede, $data) { if ($sede == 1) { $table = "articulo"; } else { $table = "articulo2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigo='" . $db["codigo"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["marca"] != $art->marca || $db["referencia"] != $art->referencia || $db["existencia"] != $art->existencia || $db["comprometido"] != $art->comprometido || $db["precio1"] != $art->precio1 || $db["preciofin1"] != $art->preciofin1 || $db["dscto_medicamentos"] != $art->dscto_medicamentos || $db["diasindex"] != $art->diasindex || $db["diascred"] != $art->diascred) { $this->db->where("codigo", $db["codigo"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_inv4() { return $this->db->query("SELECT * FROM articulo WHERE existencia=0 LIMIT 5201,2600")->result_array(); } function env_inv4($sede, $data) { if ($sede == 1) { $table = "articulo"; } else { $table = "articulo2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigo='" . $db["codigo"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["marca"] != $art->marca || $db["referencia"] != $art->referencia || $db["existencia"] != $art->existencia || $db["comprometido"] != $art->comprometido || $db["precio1"] != $art->precio1 || $db["preciofin1"] != $art->preciofin1 || $db["dscto_medicamentos"] != $art->dscto_medicamentos || $db["diasindex"] != $art->diasindex || $db["diascred"] != $art->diascred) { $this->db->where("codigo", $db["codigo"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc() { return $this->db->query("SELECT * FROM artilotes LIMIT 1,2600")->result_array(); } function env_existenc($sede, $data) { if ($sede == 1) { $table = "artilotes"; } else { $table = "artilotes2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["consumido"] != $art->consumido || $db["cantidad"] != $art->cantidad) { $this->db->where("codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'")->update($table, array("cantidad" => $db["cantidad"], "consumido" => $db["consumido"], "ubica" => $db["ubica"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc2() { return $this->db->query("SELECT * FROM artilotes LIMIT 2601,2600")->result_array(); } function env_existenc2($sede, $data) { if ($sede == 1) { $table = "artilotes"; } else { $table = "artilotes2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["consumido"] != $art->consumido || $db["cantidad"] != $art->cantidad) { $this->db->where("codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'")->update($table, array("cantidad" => $db["cantidad"], "consumido" => $db["consumido"], "ubica" => $db["ubica"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc3() { return $this->db->query("SELECT * FROM artilotes LIMIT 5201,2600")->result_array(); } function env_existenc3($sede, $data) { if ($sede == 1) { $table = "artilotes"; } else { $table = "artilotes2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["consumido"] != $art->consumido || $db["cantidad"] != $art->cantidad) { $this->db->where("codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'")->update($table, array("cantidad" => $db["cantidad"], "consumido" => $db["consumido"], "ubica" => $db["ubica"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc4() { return $this->db->query("SELECT * FROM artilotes LIMIT 7801,2600")->result_array(); } function env_existenc4($sede, $data) { if ($sede == 1) { $table = "artilotes"; } else { $table = "artilotes2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["consumido"] != $art->consumido || $db["cantidad"] != $art->cantidad) { $this->db->where("codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'")->update($table, array("cantidad" => $db["cantidad"], "consumido" => $db["consumido"], "ubica" => $db["ubica"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc5() { return $this->db->query("SELECT * FROM artilotes LIMIT 10401,2600")->result_array(); } function env_existenc5($sede, $data) { if ($sede == 1) { $table = "artilotes"; } else { $table = "artilotes2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["consumido"] != $art->consumido || $db["cantidad"] != $art->cantidad) { $this->db->where("codigoart='" . $db["codigoart"] . "' && almacen='" . $db["almacen"] . "' && lote='" . $db["lote"] . "'")->update($table, array("cantidad" => $db["cantidad"], "consumido" => $db["consumido"], "ubica" => $db["ubica"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_fac() { return $this->db->query("SELECT * FROM operti WHERE fechacrea>=DATE_SUB(CURDATE(),INTERVAL 3 DAY) && (tipodoc='FAC' || tipodoc='NOT' || tipodoc='N/C' || tipodoc='N/D' || tipodoc='RET');")->result_array(); } function env_fac($sede, $data) { if ($sede == 1) { $table = "operti"; } else { $table = "operti2"; } $i = 0; foreach ($data as $db) { $val = $this->db->query("SELECT NULL FROM {$table} WHERE documento='" . $db["documento"] . "' && tipodoc='" . $db["tipodoc"] . "'")->num_rows(); if ($val == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } function lea_item() { return $this->db->query("SELECT * FROM opermv WHERE fechadoc>=DATE_SUB(CURDATE(),INTERVAL 3 DAY) && (tipodoc='FAC' || tipodoc='NOT' || tipodoc='N/C' || tipodoc='N/D' || tipodoc='RET');")->result_array(); } function env_item($sede, $data) { if ($sede == 1) { $table = "opermv"; } else { $table = "opermv2"; } $i = 0; foreach ($data as $db) { $val = $this->db->query("SELECT NULL FROM {$table} WHERE documento='" . $db["documento"] . "' && tipodoc='" . $db["tipodoc"] . "' && codigo='" . $db["codigo"] . "' && cantidad='" . $db["cantidad"] . "' && lote='" . $db["lote"] . "'")->num_rows(); if ($val == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } function lea_comp() { return $this->db->query("SELECT codigo,comprometido FROM articulo WHERE existencia>0")->result_array(); } function env_comp($sede, $data) { if ($sede == 1) { $table = "articulo"; } else { $table = "articulo2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT NULL FROM {$table} WHERE codigo='" . $db["codigo"] . "'"); if ($art->num_rows() > 0) { $art = $art->row(); if ($db["comprometido"] != $art->comprometido) { $this->db->where("codigo", $db["codigo"])->update($table, array("comprometido" => $db["comprometido"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_proveed() { return $this->db->query("SELECT * FROM proveed")->result_array(); } function env_proveed($sede, $data) { if ($sede == 1) { $table = "proveed"; } else { $table = "proveed2"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("SELECT * FROM {$table} WHERE codigo='" . $db["codigo"] . "'"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($art->descu != $db["descu"] || $art->vol != $db["vol"] || $art->descu2 != $db["descu2"] || $art->vol2 != $db["vol2"] || $art->descu3 != $db["descu3"] || $art->vol3 != $db["vol3"] || $art->descu4 != $db["descu4"] || $art->vol4 != $db["vol4"] || $art->descu5 != $db["descu5"] || $art->vol5 != $db["vol5"]) { $this->db->where("id", $db["id"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function genebarra($codigo, $densidad = 2, $alto = 30) { require "vendor/autoload.php"; $generator = new Picqer\Barcode\BarcodeGeneratorHTML(); return $generator->getBarcode($codigo, $generator::TYPE_CODE_128, $densidad, $alto); } public function productos($a, $b, $c, $d, $f, $e, $cli) { $this->load->library("table"); $clidescu = $this->db->query("SELECT descuento n FROM cliempre WHERE codigo='{$cli}'")->row(); if ($clidescu->n != '') { $desculinea = $clidescu->n; } else { $desculinea = 0; } $html = ''; $this->table->set_heading("Categoria", "Principio.Activo", "Laboratorio", "Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;">"); $bd = $this->db->query("SELECT codigo, nombre FROM grupos WHERE codigo not in (06,07)")->result(); $grupo = "<select class="w3-select" id="grupo_prod" onchange="search_med();"><option value="" selected>Todo</option>"; foreach ($bd as $dt) { if ($a == $dt->codigo) { $slt = "selected"; } else { $slt = ''; } $grupo .= "<option value="" . $dt->codigo . "" " . $slt . ">" . $dt->nombre . "</option>"; } $grupo .= "</select>"; $bd3 = $this->db->query("SELECT nombre FROM proveed")->result(); $prov = "<input class="w3-input" id="prov_prod" value="" . $d . "" onchange="search_med();" list="listprov" placeholder="Laboratorio..."><datalist id="listprov">"; foreach ($bd3 as $dt3) { $prov .= "<option value="" . $dt3->nombre . "">"; } $prov .= "</datalist>"; $bdref = $this->db->query("SELECT DISTINCT referencia nom FROM articulo WHERE referencia!='';")->result(); $ref = "<input class="w3-input" id="ref_prod" value="" . $f . "" onchange="search_med();" list="listref" placeholder="Principio..."><datalist id="listref">"; foreach ($bdref as $dtref) { $ref .= "<option value="" . $dtref->nom . "">"; } $ref .= "</datalist>"; $this->table->add_row('' . $grupo . '', $ref, '' . $prov . '', "<input type="text" id="like_med" onchange="search_med();" value="" . $b . "" class="w3-input w3-border" placeholder="Productos...">"); $filter = $this->table->generate(); if ($c == '') { $c = 1; } $CantidadMostrar = 30; $sql = $this->tiposqlprod($a, $b, $d, $e, $f); $totalreg = $this->totreg($sql); $TotalRegistro = ceil($totalreg / $CantidadMostrar); $prod = "<table class="w3-table-all w3-hoverable w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Producto</th><th>Principio.Activo</th><th>Marca</th><th>Vence</th><th>Precio</th><th>IVA</th><th>Precio+Iva</th><th>Descu</th><th>Descu.Lineal</th><th>PrecioFin</th><th>Exist</th><th></th><th></th></tr>"; $bd2 = $this->db->query("SELECT a.codigo, CONCAT(a.codigo,' ',a.nombre,' ',IF(a.dscto_medicamentos>0,CONCAT('<b class="w3-droid2">\302\xa1PROMOCION ',a.dscto_medicamentos,'%!','</b>'),IF(a.dscto_medicamentos2>0,CONCAT('<b class="w3-droid2">\xc2\xa1PROMOCION ',a.dscto_medicamentos2,'%!','</b>'),''))) nombre,a.referencia,a.marca,
ROUND(a.precio1,2) precio,CONCAT(ROUND(a.impuesto1),'%',' ',ROUND(a.precio1*(a.impuesto1/100),2)) iva, ROUND(a.preciofin1,2) precioiva,CONCAT(a.dscto_medicamentos,'%',' ',ROUND(a.preciofin1*(a.dscto_medicamentos/100),2),' ',a.dscto_medicamentos2,'%',' ',ROUND(a.preciofin1*(a.dscto_medicamentos2/100),2)) descu, \xa CONCAT(ROUND({$desculinea}),'%',' ',ROUND((a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100)))*({$desculinea}/100),2)) desculinea,ROUND(a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100))-((a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100)))*({$desculinea}/100)),2) preciofin, ROUND(a.existencia-a.comprometido,2) disp, a.impuesto1,a.dscto_medicamentos,a.dscto_medicamentos2\xa FROM articulo AS a JOIN artilotes d ON d.codigoart=a.codigo && (d.almacen=02 || d.almacen=07) && d.cantidad-d.consumido>0 JOIN artiprov b ON a.codigo=b.codigo LEFT JOIN proveed c ON c.codigo=b.proveedor\xa WHERE a.existencia-a.comprometido>0 && a.para_web='1' && a.grupo NOT IN (06,07) " . $sql . "
GROUP BY d.codigoart ORDER BY a.nombre ASC LIMIT " . ($c - 1) * $CantidadMostrar . " , " . $CantidadMostrar . '')->result(); $i = 0; foreach ($bd2 as $dt2) { $i++; if ($dt2->dscto_medicamentos > 0 || $dt2->dscto_medicamentos2 > 0 || $desculinea > 0) { $color = "class="w3-droid2""; } else { $color = "class="w3-droid""; } $bdlot = $this->db->query("SELECT c.lote,(c.cantidad-c.consumido) exist, c.elab, c.vence FROM artilotes AS c WHERE c.codigoart='{$dt2->codigo}' && c.cantidad!=c.consumido ORDER BY c.vence ASC LIMIT 1")->row(); $prod .= "<tr><input type="hidden" id="cod" . $i . "" value="" . $dt2->codigo . "">"; $prod .= "<td>" . $dt2->nombre . "</td><td>" . $dt2->referencia . "</td><td>" . $dt2->marca . "</td><td>" . $bdlot->vence . "</td><td>" . $dt2->precio . "</td><td>" . $dt2->iva . "</td><td>" . $dt2->precioiva . "</td><td " . $color . ">" . $dt2->descu . "</td><td " . $color . ">" . $dt2->desculinea . "</td><td " . $color . ">" . $dt2->preciofin . "</td><td>" . $dt2->disp . "</td>
<td><input class="w3-input" type="text" id="cant" . $i . "" maxlength="5" placeholder="n" onchange="reg_pedido($('#cod" . $i . "').val(),$('#cant" . $i . "').val());return false;" style="width:20px" pattern="[0-9]{1,5}" title="*Max cinco(05) Digitos *Numeros" required/></td>
<td><a onclick="reg_pedido($('#cod" . $i . "').val(),$('#cant" . $i . "').val());return false;"><img src="" . base_url() . "images/registrar.png" alt="Registrar" title="Registrar" style="width:16px;height:16px;border:0;"></a></td></tr>"; } $prod .= "</table>"; $html .= "
<input type="hidden" id="btnped">
<a class="w3-btn w3-round-xxlarge w3-hover-fondodroid w3-border" style="cursor:pointer;width:100px;heigth:50px;" onclick="$('#btnped').val('');pedidos();"><img src="" . base_url() . "images/btntodo.png" style="width:30px;border:0;">Todo</a>\xa <a class="w3-btn w3-round-xxlarge w3-hover-fondodroid w3-border" style="cursor:pointer;width:100px;heigth:50px;" onclick="$('#btnped').val(1);pedidos();"><img src="" . base_url() . "images/ofertas.png" style="width:30px;border:0;">Ofertas</a><br><br>
" . $filter . "<br>
" . $prod . "
<script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var grupo=document.getElementById("grupo_prod").value;\xa var like_med=document.getElementById("like_med").value;
var btn=$("#btnped").val();
if(tip==7 || tip==2) { cli=$("#idcli").val(); var url="pedidos2/"; } else { var url="pedidos/"; }
var key="droid903";\xa var datos = {
"grupo" : grupo,\xa "like_med" : like_med,\xa "pag" : DecrementNum,\xa "key" : key,btn:btn,cli:cli\xa };\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/"+url,
type: "POST",
beforesend: function() {\xa swal({\xa title:"",
text:"Cargando",\xa icon: baseurl+"images/loading2.gif",\xa buttons: false, \xa closeOnClickOutside: false,\xa //timer: 5000,
//icon: "success"
});
},
success: function(data) {\xa $("#body").html(data);\xa $("#like_med").val(like_med); $("#btnped").val(btn); swal.close();
}\xa \xa });
}
function numpag(a){ before();
var key="droid903";\xa var grupo=document.getElementById("grupo_prod").value;
var like_med=document.getElementById("like_med").value;
var btn=$("#btnped").val();\xa if(tip==7 || tip==2) { cli=$("#idcli").val(); var url="pedidos2/"; } else { var url="pedidos/"; }
var datos = {
"grupo" : grupo,
"like_med" : like_med,
"key":key, btn:btn,\xa "pag" : a,cli:cli\xa };\xa \xa $.ajax({
data: datos,
url: baseurl+"c_droid/"+url,
type: "POST",
beforesend: function() {
swal({
title:"",
text:"Cargando",\xa icon: baseurl+"images/loading2.gif",\xa buttons: false, \xa closeOnClickOutside: false,
//timer: 5000,
//icon: "success"\xa }); \xa },
success: function(data) {\xa $("#body").html(data);\xa $("#like_med").val(like_med); $("#btnped").val(btn); swal.close();
}
\xa });\xa }
\xa function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var grupo=document.getElementById("grupo_prod").value;
var like_med=document.getElementById("like_med").value;
var btn=$("#btnped").val();
if(tip==7 || tip==2) { cli=$("#idcli").val(); var url="pedidos2/"; } else { var url="pedidos/"; }\xa var key="droid903";
var datos = {\xa "grupo" : grupo,\xa "like_med" : like_med,
"key":key, btn:btn,\xa "pag" : IncrimentNum,cli:cli\xa };
\xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/"+url,
type: "POST",
beforesend: function() {
swal({
title:"",
text:"Cargando",\xa icon: baseurl+"images/loading2.gif",\xa buttons: false,
closeOnClickOutside: false,\xa //timer: 5000,\xa //icon: "success"
});
},\xa success: function(data) {
$("#body").html(data);
$("#like_med").val(like_med); $("#btnped").val(btn); swal.close();\xa }\xa \xa });\xa }\xa </script>
"; $IncrimentNum = $c + 1 <= $TotalRegistro ? $c + 1 : 1; $DecrementNum = $c - 1 < 1 ? 1 : $c - 1; $html .= "<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $c - (ceil($CantidadMostrar / 2) - 1); $Hasta = $c + (ceil($CantidadMostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $CantidadMostrar ? $CantidadMostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $c) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } public function tiposqlprod($a, $b, $d, $e, $f) { $sql = ''; if ($a == '' && $b != '' && $d == '' && $f == '') { $sql = "&& (a.nombre LIKE "%" . $b . "%" || a.codigo="" . $b . "")"; } elseif ($a != '' && $b == '' && $d == '' && $f == '') { $sql = "&& a.grupo="" . $a . """; } elseif ($a == '' && $b == '' && $d != '' && $f == '') { $sql = "&& c.nombre="" . $d . """; } elseif ($a == '' && $b == '' && $d == '' && $f != '') { $sql = "&& a.referencia="" . $f . """; } elseif ($a != '' && $b != '' && $d == '' && $f == '') { $sql = "&& a.grupo="" . $a . "" && (a.nombre LIKE "%" . $b . "%" || a.codigo="" . $b . "")"; } elseif ($a != '' && $b != '' && $d != '' && $f == '') { $sql = "&& a.grupo="" . $a . "" && (a.nombre LIKE "%" . $b . "%" || a.codigo="" . $b . "") && c.nombre="" . $d . """; } elseif ($a != '' && $b != '' && $d == '' && $f != '') { $sql = "&& a.grupo="" . $a . "" && (a.nombre LIKE "%" . $b . "%" || a.codigo="" . $b . "") && a.referencia="" . $f . """; } if ($e == 1) { $sql .= "&& a.dscto_medicamentos>0"; } return $sql; } public function totreg($sql) { $bd = $this->db->query("SELECT a.nombre, a.precio1,round(a.preciofin1,2) preciofin, round(a.existencia,2) disp, a.impuesto1 FROM articulo AS a
JOIN artiprov b ON a.codigo=b.codigo LEFT JOIN proveed c ON c.codigo=b.proveedor
WHERE a.existencia!=0 && a.grupo!=06 " . $sql . " && a.para_web='1' GROUP BY a.codigo")->num_rows(); return $bd; } public function reg_pedido($a, $b, $c) { if ($c != '') { $val = $this->db->query("SELECT NULL FROM tem_pedido WHERE cod_med='{$a}' && cod_cli='{$c}'")->num_rows(); if ($val == 0 && $b > 0) { $noped = array("codigo" => $a, "cliente" => $c, "cant" => $b); $this->db->insert("noped", $noped); $val2 = $this->db->query("SELECT ROUND((SUM(a.cantidad)-SUM(a.consumido))-(b.comprometido+(SELECT IF(SUM(cant>0),SUM(cant),0) FROM tem_pedido WHERE cod_med=a.codigoart))) exist, b.dscto_medicamentos descu, b.dscto_medicamentos2 descu2
FROM artilotes AS a\xa JOIN articulo AS b ON a.codigoart=b.codigo && b.para_web='1'\xa WHERE a.codigoart='{$a}' && a.almacen NOT IN (01,05,06,08) GROUP BY a.codigoart")->row(); if ($b <= $val2->exist) { $datos = array("cod_med" => $a, "cod_cli" => $c, "cant" => $b, "dsctoprc" => $val2->descu, "dsctoprc2" => $val2->descu2); $this->db->insert("tem_pedido", $datos); } else { if ($val2->exist > 0) { $datos = array("cod_med" => $a, "cod_cli" => $c, "cant" => $val2->exist, "dsctoprc" => $val2->descu, "dsctoprc2" => $val2->descu2); $this->db->insert("tem_pedido", $datos); } } } } return $this->db->affected_rows(); } public function pedidos($c) { $this->load->library("table"); $html = ''; $subtot = 0; $total = 0; $iva = 0; $totdesc = 0; $totdesclinea = 0; $i = 0; $html .= "<table class="w3-table w3-hoverable"><tr class="w3-fondodroid"><th>N</th><th>Producto</th><th>Cantidad</th><th>Precio</th><th>Sub.Total</th><th>IVA</th><th>Descu</th><th>Descu.Lineal</th><th>Total</th><th></th></tr>"; $clidescu = $this->db->query("SELECT descuento n FROM cliempre WHERE codigo='{$c}'")->row(); if ($clidescu->n != '') { $desculinea = $clidescu->n; } else { $desculinea = 0; } $bd = $this->db->query("SELECT a.id_pedido, b.nombre, a.cod_med, a.cant, round(b.precio1,2) precio1, CONCAT(ROUND(b.impuesto1),'%',' ', ROUND(b.precio1*(b.impuesto1/100),2)*a.cant) iva,
CONCAT(b.dscto_medicamentos,'%',' ',ROUND(b.preciofin1*(b.dscto_medicamentos/100),2)*a.cant,' ',b.dscto_medicamentos2,'%',' ',ROUND(b.preciofin1*(b.dscto_medicamentos2/100),2)*a.cant) descu, CONCAT(ROUND({$desculinea}),'%',' ',ROUND((b.preciofin1-(b.preciofin1*(b.dscto_medicamentos/100))-((b.preciofin1-(b.preciofin1*(b.dscto_medicamentos/100)))*(b.dscto_medicamentos2/100)))*({$desculinea}/100),2)*a.cant) desculinea,
(ROUND(b.preciofin1*(b.dscto_medicamentos/100),2)*a.cant)+(ROUND(b.preciofin1*(b.dscto_medicamentos2/100),2)*a.cant) descu2,ROUND((b.preciofin1-(b.preciofin1*(b.dscto_medicamentos/100)))*({$desculinea}/100),2)*a.cant desculinea2,
ROUND(b.precio1*a.cant,2) subtot,ROUND(a.cant*ROUND(b.preciofin1-(b.preciofin1*(b.dscto_medicamentos/100))-((b.preciofin1-(b.preciofin1*(b.dscto_medicamentos/100)))*({$desculinea}/100)),2),2) total
FROM tem_pedido AS a
JOIN articulo AS b ON a.cod_med=b.codigo\xa WHERE a.cod_cli='{$c}'")->result(); foreach ($bd as $dt) { if ($dt->desculinea2 > 0 || $dt->descu2) { $color = "class="w3-droid2""; $color2 = "w3-droid2"; } else { $color = "class="w3-droid""; $color2 = "w3-droid"; } $i++; $total += $dt->total; $iva += $dt->iva; $totdesc += $dt->descu2; $totdesclinea += $dt->desculinea2; $subtot += $dt->subtot; $html .= "<input type="hidden" id="ped" . $i . "" name="idped" value="" . $dt->id_pedido . ""><input type="hidden" value="" . $dt->cant . "" name="cantorg">"; $html .= "<tr><td>" . $i . "</td><td>" . $dt->nombre . "</td><td><input type="text" class="w3-input" name="cantnew" style="width:20px" value="" . $dt->cant . "" onchange="cantcars()"></td><td>" . $dt->precio1 . "</td>
<td>" . $dt->subtot . "</td><td>" . $dt->iva . "</td><td " . $color . ">" . $dt->descu . "</td><td " . $color . ">" . $dt->desculinea . "</td><td " . $color . ">" . $dt->total . "</td>
<td><a onclick="elim_pedido($('#ped" . $i . "').val());return false;" style="cursor:pointer"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:16px;height:16px;border:0;"></a></td></tr>"; } $html .= $this->table->generate(); $html .= "
<table class="w3-table-all w3-hoverable w3-centered">
<tr>
<td class="w3-fondodroid w3-medium"> Sub Total: </td>\xa <td class="w3-medium">" . $subtot . "</td>
</tr>
<tr>\xa <tr>\xa <td class="w3-fondodroid w3-medium"> Total Iva: </td>
<td class="w3-medium">" . $iva . "</td>
</tr>\xa <tr>\xa <tr>
<td class="w3-fondodroid w3-medium"> Total Descuento Producto: </td>
<td class="w3-medium " . $color2 . "">" . $totdesc . "</td>\xa </tr>\xa <tr>
<tr>
<td class="w3-fondodroid w3-medium"> Total Descuento Linea: </td>
<td class="w3-medium " . $color2 . "">" . $totdesclinea . "</td>\xa </tr>
<tr>
<td class="w3-fondodroid w3-medium"> Total: </td>\xa <td class="w3-medium " . $color2 . "">" . $total . "</td>
</tr>\xa </table><br>
"; if ($i > 0) { $html .= "<input type="submit" name="Submit" onclick="alerta();" value="Enviar Factura" class="w3-button w3-round-xxlarge w3-centered w3-fondodroid w3-hover-white w3-border w3-hover-border-barras"/>"; } $bdfac = $this->db->query("SELECT d.documento,d.fechacrea, d.totneto,d.totimpuest, d.totalfinal, SUM(e.cantidad) cant, f.status FROM operti AS d\xa JOIN opermv AS e ON d.documento=e.documento\xa JOIN control_operti AS f ON d.antdoc=f.doc
WHERE codcliente='{$c}' && d.fechacrea>=DATE_ADD(CURDATE(), INTERVAL -10 DAY)
GROUP BY d.documento ORDER BY d.fechacrea desc LIMIT 10")->result(); $this->table->set_heading("N\302\xb0", "Fecha", "Sub.Total", "Iva", "Total", "Cantidad", "<th>Estatus<th>"); $html .= "<h3>Ultimos 10 Movimientos:</h3><br>"; foreach ($bdfac as $dtfac) { if ($dtfac->status == "0") { $status = "<td class="w3-yellow w3-center">Enviado</td>"; } elseif ($dtfac->status == "4") { $status = "<td class="w3-aqua w3-center">Recibido</td>"; } elseif ($dtfac->status == "1") { $status = "<td class="w3-pale-yellow w3-center">Procesando</td>"; } elseif ($dtfac->status == "2") { $status = "<td class="w3-blue w3-center">Empacado</td>"; } elseif ($dtfac->status == "3") { $status = "<td class="w3-lime w3-center">Cargado</td>"; } elseif ($dtfac->status == "5") { $status = "<td class="w3-green w3-center">Despachado</td>"; } $this->table->add_row('' . $dtfac->documento . '', '' . $dtfac->fechacrea . '', '' . $dtfac->totneto . '', '' . $dtfac->totimpuest . '', '' . $dtfac->totalfinal . '', '' . $dtfac->cant . '', $status); } $fac = $this->table->generate(); $html .= '' . $fac . ''; return $html; } function cantcars($id, $cant) { $row = count($id); $v = 0; for ($i = 0; $i < $row; $i++) { if ($id != '') { $this->db->query("UPDATE tem_pedido SET cant='" . $cant[$i] . "' WHERE id_pedido='" . $id[$i] . "'"); if ($this->db->affected_rows() > 0) { $v++; } } } return $v; } function carscli($cli) { return $this->db->query("SELECT NULL FROM tem_pedido WHERE cod_cli='{$cli}'")->num_rows(); } public function enviar_fac($a, $vend, $b, $tip, $descu) { $bddias = $this->db->query("SELECT b.diasindex, b.diascred FROM tem_pedido a JOIN articulo b ON a.cod_med=b.codigo WHERE a.cod_cli='{$a}' GROUP BY b.diasindex")->result(); $v = 0; $dtcli = $this->db->query("SELECT nombre, nrorif, direccion, telefono_movil, sector, subcodigo, vendedor,dias,descuento descu FROM cliempre WHERE codigo='{$a}'")->row(); if ($descu > 0 && ($dtcli->descu == 0 || $dtcli->descu == null || $dtcli->descu == '')) { $descu = $descu; } elseif ($dtcli->descu > 0) { $descu = $dtcli->descu; } else { $descu = 0; } foreach ($bddias as $dias) { $valprec = $this->db->query("SELECT NULL FROM artiprec WHERE fecha=curdate()")->num_rows(); if ($valprec == 0) { $prec = "JOIN articulo AS b ON (TRIM(a.cod_med)=TRIM(b.codigo) && b.para_web=1)"; } else { $prec = "JOIN artiprec AS b ON (TRIM(a.cod_med)=TRIM(b.codigo) && b.fecha=curdate()) JOIN articulo AS c ON (TRIM(b.codigo)=TRIM(c.codigo) && c.para_web=1)"; } $bdped = $this->db->query("SELECT a.id_pedido, a.cod_med,a.dsctoprc, b.nombre,b.grupo,a.cant, b.costo,b.precio1, b.impuesto1,
IF(b.impuesto1>0,((b.precio1-(b.precio1*(a.dsctoprc/100)))*(b.impuesto1/100))*a.cant,0) iva,
IF(a.dsctoprc>0,(b.preciofin1-(b.preciofin1*(a.dsctoprc/100))),b.preciofin1) preciofin1,
IF(a.dsctoprc>0,(b.precio1*a.cant)-((b.precio1*a.cant)*(a.dsctoprc/100)),(b.precio1*a.cant)) subtot,\xa (a.cant*IF(a.dsctoprc>0,(b.preciofin1-(b.preciofin1*(a.dsctoprc/100))),b.preciofin1)) total,
IF(b.impuesto1>0,(a.cant*IF(a.dsctoprc>0,(b.precio1-(b.precio1*(a.dsctoprc/100))),b.precio1)),0) baseimp,
IF(b.impuesto1=0,IF(a.dsctoprc>0,b.precio1-(b.precio1*(a.dsctoprc/100)),b.precio1)*a.cant,0) sinimp, b.comprometido,\xa a.dsctoprc dsctounit,
if(a.dsctoprc>0,(b.precio1*(a.dsctoprc/100)),0) dsctoprc,
if(a.dsctoprc>0,((b.precio1*(a.dsctoprc/100))*a.cant),0) totdesc,\xa a.dsctoprc2 dsctounit2,\xa if(a.dsctoprc2>0,(IF(a.dsctoprc>0,(b.precio1-(b.precio1*(a.dsctoprc/100))),b.precio1)*(a.dsctoprc2/100)),0) dsctoprc2,\xa if(a.dsctoprc2>0,((IF(a.dsctoprc>0,(b.precio1-(b.precio1*(a.dsctoprc/100))),b.precio1)*(a.dsctoprc2/100))*a.cant),0) totdesc2,
(b.precio1-if(a.dsctoprc>0,(b.precio1*(a.dsctoprc/100)),0)-if(a.dsctoprc2>0,(IF(a.dsctoprc>0,(b.precio1-(b.precio1*(a.dsctoprc/100))),b.precio1)*(a.dsctoprc2/100)),0)) preciounit\xa FROM tem_pedido AS a
" . $prec . "\xa WHERE a.cod_cli='{$a}' && b.diasindex='{$dias->diasindex}' ORDER BY a.cod_med ASC;")->result(); $num = $this->db->query("SELECT IF(MAX(SUBSTR(doc,2,8))+1>0,MAX(SUBSTR(doc,2,8))+1,1) n FROM control_operti WHERE doc like '%{$b}%'")->row(); $documento = str_pad($num->n, 7, "0", STR_PAD_LEFT); $tcosto = 0; $subtot = 0; $iva = 0; $baseimp = 0; $sinimp = 0; $total = 0; $totdesc = 0; $totdesc2 = 0; $i = 0; $descprm = 0; $pid = $this->genecod(12); foreach ($bdped as $dtped) { $tcosto += $dtped->costo; $subtot += $dtped->subtot; $iva += $dtped->iva; $baseimp += $dtped->baseimp; $sinimp += $dtped->sinimp; $total += $dtped->total; $totdesc += $dtped->totdesc; $totdesc2 += $dtped->totdesc2; $dsctoendm = $dtped->preciounit * ($descu / 100); $prcunit = $dtped->preciounit - $dsctoendm; $prcfin = $prcunit * (1 + $dtped->impuesto1 / 100); $descprm += $dsctoendm * $dtped->cant; $blot = $this->db->query("SELECT c.almacen,c.lote,c.cantidad-c.consumido exist FROM artilotes AS c \xa WHERE c.codigoart='{$dtped->cod_med}' && (c.cantidad-c.consumido)>0 && c.almacen NOT IN (01,05,06,08) ORDER BY c.vence ASC")->result(); $cant = $dtped->cant; $newcant = 0; foreach ($blot as $dlot) { if ($dlot->exist >= $cant) { $newcant = $cant; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $b . $documento . '', "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => '' . $dtped->cod_med . '', "pid" => '' . $pid . '', "nombre" => '' . $dtped->nombre . '', "costounit" => '' . $dtped->costo . '', "preciounit" => $prcunit, "dsctounit" => $dtped->dsctounit, "dsctoprc" => $dtped->dsctoprc, "dsctounit2" => $dtped->dsctounit2, "dsctoprc2" => $dtped->dsctoprc2, "dsctoendp" => $descu, "dsctoendm" => $dsctoendm, "preciofin" => $prcfin, "preciooriginal" => '' . $dtped->precio1 . '', "cantidad" => '' . $newcant . '', "montoneto" => '' . $dtped->subtot . '', "montototal" => '' . $dtped->total . '', "timpueprc" => '' . $dtped->impuesto1 . '', "almacen" => $dlot->almacen, "proveedor" => '' . $a . '', "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $vend, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $dtped->cant . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $dtped->baseimp . '', "baseimpo2" => "0", "lote" => $dlot->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $i++; } break; } elseif ($dlot->exist < $cant) { $cant = $cant - $dlot->exist; $newcant = $dlot->exist; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $b . $documento . '', "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => '' . $dtped->cod_med . '', "pid" => '' . $pid . '', "nombre" => '' . $dtped->nombre . '', "costounit" => '' . $dtped->costo . '', "preciounit" => $prcunit, "dsctounit" => '' . $dtped->dsctounit . '', "dsctoprc" => '' . $dtped->dsctoprc . '', "dsctounit2" => '' . $dtped->dsctounit2 . '', "dsctoprc2" => '' . $dtped->dsctoprc2 . '', "dsctoendp" => $descu, "dsctoendm" => $dsctoendm, "preciofin" => $prcfin, "preciooriginal" => '' . $dtped->precio1 . '', "cantidad" => '' . $newcant . '', "montoneto" => '' . $dtped->subtot . '', "montototal" => '' . $dtped->total . '', "timpueprc" => '' . $dtped->impuesto1 . '', "almacen" => $dlot->almacen, "proveedor" => '' . $a . '', "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $vend, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $dtped->cant . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $dtped->baseimp . '', "baseimpo2" => "0", "lote" => $dlot->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $i++; } } } if ($i > 0) { $this->db->query("UPDATE articulo set comprometido=comprometido+{$dtped->cant} WHERE codigo='{$dtped->cod_med}'"); } } if ($i > 0) { if ($dias->diascred > 0) { $diascred = $dias->diascred; } else { $diascred = $dtcli->dias; } $subtot = $subtot - $subtot * ($descu / 100); $total = $total - ($total * ($descu / 100) + $iva * ($descu / 100)); $iva = $iva - $iva * ($descu / 100); $sinimp = $sinimp - $sinimp * ($descu / 100); $baseimp = $baseimp - $baseimp * ($descu / 100); $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "moneda" => "000", "documento" => '' . $b . $documento . '', "codcliente" => '' . $a . '', "nombrecli" => '' . $dtcli->nombre . '', "contacto" => "N/A", "rif" => '' . $dtcli->nrorif . '', "direccion" => '' . $dtcli->direccion . '', "telefonos" => '' . $dtcli->telefono_movil . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => '' . $tcosto . '', "totbruto" => '' . $subtot . '', "totneto" => '' . $subtot . '', "totalfinal" => '' . $total . '', "totimpuest" => '' . $iva . '', "dsctoend1" => $descu, "dsctolinea" => $descprm, "totdescuen" => $totdesc, "totdescuen2" => $totdesc2, "impuesto1" => '' . $iva . '', "impuesto2" => '' . $iva . '', "diascred" => $diascred, "diasindex" => $dias->diasindex, "vendedor" => $vend, "factorcamb" => "1", "estacion" => "001", "sinimpuest" => '' . $sinimp . '', "almacen" => "02", "sector" => '' . $dtcli->sector . '', "subcodigo" => '' . $dtcli->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => '' . $baseimp . '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESp", "antdoc" => '' . $b . $documento . ''); $this->db->insert("operti", $datos2); if ($this->db->affected_rows() > 0) { $v++; $control = array("doc" => '' . $b . $documento . '', "status" => $tip); $this->db->insert("control_operti", $control); $this->psicotropicos($b, $documento, $tip); $this->limitfac30($b, $documento, $tip); $this->loguser("Carga Excel", "El usuario ha cargado el documento " . $b . $documento . " con " . $i . " productos."); } } } if ($v > 0) { $this->db->query("INSERT INTO backorder (doc,cliente,codigo,cantorg,cantfin,fecha)\xa SELECT '" . $b . $documento . "','{$a}',a.codigo,a.cant,IF(b.cant>0,b.cant,0),now() FROM noped a LEFT JOIN tem_pedido b ON (b.cod_med=a.codigo && a.cliente=b.cod_cli) WHERE a.cliente='{$a}'"); $this->db->where("cod_cli", $a)->delete("tem_pedido"); $this->db->where("cliente", $a)->delete("noped"); } return $v; } function psicotropicos($a, $b, $tip) { $num = $this->db->query("SELECT IF(MAX(SUBSTR(doc,2,8))+1>0,MAX(SUBSTR(doc,2,8))+1,1) n FROM control_operti WHERE doc like '%{$a}%'")->row(); $newdoc = str_pad($num->n, 7, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("SELECT * FROM operti WHERE documento='" . $a . $b . "' && tipodoc='ESP'")->row(); $item = $this->db->query("SELECT a.* FROM opermv a JOIN articulo b ON a.codigo=b.codigo WHERE a.documento='" . $a . $b . "' && a.tipodoc='ESP' && b.controlado=1")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; $totdesc2 = 0; $descprm = 0; $i = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $totdesc2 += $ditem->dsctoprc2 * $ditem->cantidad; $descprm += $ditem->dsctoendm * $ditem->cant; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $a . $newdoc . '', "grupo" => '' . $ditem->grupo . '', "origen" => "1", "codigo" => '' . $ditem->codigo . '', "pid" => '' . $pid . '', "nombre" => '' . $ditem->nombre . '', "costounit" => '' . $ditem->costounit . '', "preciounit" => $ditem->preciounit, "dsctounit" => '' . $ditem->dsctounit . '', "dsctoprc" => '' . $ditem->dsctoprc . '', "dsctounit2" => '' . $ditem->dsctounit2 . '', "dsctoprc2" => '' . $ditem->dsctoprc2 . '', "dsctoendm" => $ditem->dsctoendm, "dsctoendp" => $ditem->dsctoendp, "preciofin" => $ditem->preciofin, "preciooriginal" => '' . $ditem->preciooriginal . '', "cantidad" => '' . $ditem->cantidad . '', "montoneto" => '' . $ditem->montoneto . '', "montototal" => '' . $ditem->montototal . '', "timpueprc" => '' . $ditem->timpueprc . '', "almacen" => $ditem->almacen, "proveedor" => $ditem->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $ditem->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $ditem->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $ditem->baseimpo1 . '', "baseimpo2" => "0", "lote" => $ditem->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("DELETE FROM opermv WHERE documento='" . $a . $b . "' && tipodoc='ESP' && codigo='{$ditem->codigo}' && cantidad='{$ditem->cantidad}'"); } } if ($i > 0) { $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "moneda" => "000", "documento" => '' . $a . $newdoc . '', "codcliente" => $oper->codcliente, "nombrecli" => '' . $oper->nombrecli . '', "contacto" => "N/A", "rif" => '' . $oper->rif . '', "direccion" => '' . $oper->direccion . '', "telefonos" => '' . $oper->telefono_movil . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => $totcosto, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => $totfinal, "totimpuest" => $totimpues, "totdescuen" => $totdesc, "totdescuen2" => $totdesc2, "dsctoend1" => $oper->dsctoend1, "impuesto1" => $totimpues, "impuesto2" => $totimpues, "dsctolinea" => $descprm, "diascred" => $oper->diascred, "vendedor" => '' . $oper->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $oper->vendedor . '', "estacion" => "001", "sinimpuest" => 0, "almacen" => "02", "sector" => '' . $oper->sector . '', "subcodigo" => '' . $oper->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => '' . $a . $newdoc . ''); $this->db->insert("operti", $datos2); if ($this->db->affected_rows() > 0) { $control = array("doc" => '' . $a . $newdoc . '', "status" => $tip); $this->db->insert("control_operti", $control); } } } function limitfac30($a, $b, $tip) { $num = $this->db->query("SELECT IF(MAX(SUBSTR(doc,2,8))+1>0,MAX(SUBSTR(doc,2,8))+1,1) n FROM control_operti WHERE doc like '%{$a}%'")->row(); $newdoc = str_pad($num->n, 7, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("SELECT * FROM operti WHERE documento='" . $a . $b . "' && tipodoc='ESP'")->row(); $val = $this->db->query("SELECT NULL FROM opermv a WHERE a.documento='" . $a . $b . "' && a.tipodoc='ESP'")->num_rows(); if ($val > 30) { if ($val <= 60) { $div = 2; } else { if ($val > 60) { $div = 3; } } $mostrar = $val / $div; $mostrar = ROUND($mostrar, 0); $item = $this->db->query("SELECT a.* FROM opermv a WHERE a.documento='" . $a . $b . "' && a.tipodoc='ESP' LIMIT " . $mostrar . " , " . $mostrar . ";")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; $totdesc2 = 0; $descprm = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $totdesc2 += $ditem->dsctoprc2 * $ditem->cantidad; $descprm += $ditem->dsctoendm * $ditem->cant; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $a . $newdoc . '', "grupo" => '' . $ditem->grupo . '', "origen" => "1", "codigo" => '' . $ditem->codigo . '', "pid" => '' . $pid . '', "nombre" => '' . $ditem->nombre . '', "costounit" => '' . $ditem->costounit . '', "preciounit" => $ditem->preciounit, "dsctounit" => '' . $ditem->dsctounit . '', "dsctoprc" => '' . $ditem->dsctoprc . '', "dsctounit2" => '' . $ditem->dsctounit2 . '', "dsctoprc2" => '' . $ditem->dsctoprc2 . '', "dsctoendm" => $ditem->dsctoendm, "dsctoendp" => $ditem->dsctoendp, "preciofin" => $ditem->preciofin, "preciooriginal" => '' . $ditem->preciooriginal . '', "cantidad" => '' . $ditem->cantidad . '', "montoneto" => '' . $ditem->montoneto . '', "montototal" => '' . $ditem->montototal . '', "timpueprc" => '' . $ditem->timpueprc . '', "almacen" => $ditem->almacen, "proveedor" => $ditem->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $ditem->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $ditem->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $ditem->baseimpo1 . '', "baseimpo2" => "0", "lote" => $ditem->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("DELETE FROM opermv WHERE documento='" . $a . $b . "' && tipodoc='ESP' && codigo='{$ditem->codigo}' && cantidad='{$ditem->cantidad}'"); } } $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "moneda" => "000", "documento" => '' . $a . $newdoc . '', "codcliente" => $oper->codcliente, "nombrecli" => '' . $oper->nombrecli . '', "contacto" => "N/A", "rif" => '' . $oper->rif . '', "direccion" => '' . $oper->direccion . '', "telefonos" => '' . $oper->telefono_movil . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => $totcosto, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => $totfinal, "totimpuest" => $totimpues, "totdescuen" => $totdesc, "totdescuen2" => $totdesc2, "dsctoend1" => $oper->dsctoend1, "impuesto1" => $totimpues, "impuesto2" => $totimpues, "dsctolinea" => $descprm, "diascred" => $oper->diascred, "vendedor" => '' . $oper->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $oper->vendedor . '', "estacion" => "001", "sinimpuest" => 0, "almacen" => "02", "sector" => '' . $oper->sector . '', "subcodigo" => '' . $oper->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => '' . $a . $newdoc . ''); $this->db->insert("operti", $datos2); if ($this->db->affected_rows() > 0) { $control = array("doc" => '' . $a . $newdoc . '', "status" => $tip); $this->db->insert("control_operti", $control); $val = $this->db->query("SELECT NULL FROM opermv a WHERE a.documento='" . $a . $b . "' && a.tipodoc='ESP'")->num_rows(); if ($val > 30) { $this->limit2fac30($a, $b, $tip); } } } } function limit2fac30($a, $b, $tip) { $num = $this->db->query("SELECT IF(MAX(SUBSTR(doc,2,8))+1>0,MAX(SUBSTR(doc,2,8))+1,1) n FROM control_operti WHERE doc like '%{$a}%'")->row(); $newdoc = str_pad($num->n, 7, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("SELECT * FROM operti WHERE documento='" . $a . $b . "' && tipodoc='ESP'")->row(); $val = $this->db->query("SELECT NULL FROM opermv a WHERE a.documento='" . $a . $b . "' && a.tipodoc='ESP'")->num_rows(); if ($val > 30) { $mostrar = $val / 2; $mostrar = ROUND($mostrar, 0); $item = $this->db->query("SELECT a.* FROM opermv a WHERE a.documento='" . $a . $b . "' && a.tipodoc='ESP' LIMIT " . $mostrar . " , " . $mostrar . ";")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; $totdesc2 = 0; $descprm = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $totdesc2 += $ditem->dsctoprc2 * $ditem->cantidad; $descprm += $ditem->dsctoendm * $ditem->cant; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $a . $newdoc . '', "grupo" => '' . $ditem->grupo . '', "origen" => "1", "codigo" => '' . $ditem->codigo . '', "pid" => '' . $pid . '', "nombre" => '' . $ditem->nombre . '', "costounit" => '' . $ditem->costounit . '', "preciounit" => $ditem->preciounit, "dsctounit" => '' . $ditem->dsctounit . '', "dsctoprc" => '' . $ditem->dsctoprc . '', "dsctounit2" => '' . $ditem->dsctounit2 . '', "dsctoprc2" => '' . $ditem->dsctoprc2 . '', "dsctoendm" => $ditem->dsctoendm, "dsctoendp" => $ditem->dsctoendp, "preciofin" => $ditem->preciofin, "preciooriginal" => '' . $ditem->preciooriginal . '', "cantidad" => '' . $ditem->cantidad . '', "montoneto" => '' . $ditem->montoneto . '', "montototal" => '' . $ditem->montototal . '', "timpueprc" => '' . $ditem->timpueprc . '', "almacen" => $ditem->almacen, "proveedor" => $ditem->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $ditem->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $ditem->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $ditem->baseimpo1 . '', "baseimpo2" => "0", "lote" => $ditem->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("DELETE FROM opermv WHERE documento='" . $a . $b . "' && tipodoc='ESP' && codigo='{$ditem->codigo}' && cantidad='{$ditem->cantidad}'"); } } $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "moneda" => "000", "documento" => '' . $a . $newdoc . '', "codcliente" => $oper->codcliente, "nombrecli" => '' . $oper->nombrecli . '', "contacto" => "N/A", "rif" => '' . $oper->rif . '', "direccion" => '' . $oper->direccion . '', "telefonos" => '' . $oper->telefono_movil . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => $totcosto, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => $totfinal, "totimpuest" => $totimpues, "totdescuen" => $totdesc, "totdescuen2" => $totdesc2, "dsctoend1" => $oper->dsctoend1, "impuesto1" => $totimpues, "impuesto2" => $totimpues, "dsctolinea" => $descprm, "diascred" => $oper->diascred, "vendedor" => '' . $oper->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $oper->vendedor . '', "estacion" => "001", "sinimpuest" => 0, "almacen" => "02", "sector" => '' . $oper->sector . '', "subcodigo" => '' . $oper->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => '' . $a . $newdoc . ''); $this->db->insert("operti", $datos2); if ($this->db->affected_rows() > 0) { $control = array("doc" => '' . $a . $newdoc . '', "status" => $tip); $this->db->insert("control_operti", $control); } } } function faciva($a, $b) { $num = $this->db->query("SELECT IF(MAX(SUBSTR(doc,2,8))+1>0,MAX(SUBSTR(doc,2,8))+1,1) n FROM control_operti WHERE doc like '%{$a}%'")->row(); $newdoc = str_pad($num->n, 7, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("SELECT * FROM operti WHERE documento='" . $a . $b . "' && tipodoc='ESP'")->row(); $item = $this->db->query("SELECT * FROM opermv WHERE documento='" . $a . $b . "' && tipodoc='ESP' && timpueprc>0")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $a . $newdoc . '', "grupo" => '' . $ditem->grupo . '', "origen" => "1", "codigo" => '' . $ditem->codigo . '', "pid" => '' . $pid . '', "nombre" => '' . $ditem->nombre . '', "costounit" => '' . $ditem->costounit . '', "preciounit" => '' . $ditem->preciounit . '', "dsctounit" => '' . $ditem->dsctounit . '', "dsctoprc" => '' . $ditem->dsctoprc . '', "preciofin" => '' . $ditem->preciofin . '', "preciooriginal" => '' . $ditem->preciooriginal . '', "cantidad" => '' . $ditem->cantidad . '', "montoneto" => '' . $ditem->montoneto . '', "montototal" => '' . $ditem->montototal . '', "timpueprc" => '' . $ditem->timpueprc . '', "almacen" => $ditem->almacen, "proveedor" => $ditem->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $ditem->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $ditem->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $ditem->baseimpo1 . '', "baseimpo2" => "0", "lote" => $ditem->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("DELETE FROM opermv WHERE documento='" . $a . $b . "' && tipodoc='ESP' && codigo='{$ditem->codigo}' && cantidad='{$ditem->cantidad}'"); } } $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "moneda" => "000", "documento" => '' . $a . $newdoc . '', "codcliente" => $oper->codcliente, "nombrecli" => '' . $oper->nombrecli . '', "contacto" => "N/A", "rif" => '' . $oper->rif . '', "direccion" => '' . $oper->direccion . '', "telefonos" => '' . $oper->telefono_movil . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => $totcosto, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => $totfinal, "totimpuest" => $totimpues, "totdescuen" => $totdesc, "impuesto1" => $totimpues, "impuesto2" => $totimpues, "dsctolinea" => $totdesc, "diascred" => $oper->diascred, "vendedor" => '' . $oper->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $oper->vendedor . '', "estacion" => "001", "sinimpuest" => 0, "almacen" => "02", "sector" => '' . $oper->sector . '', "subcodigo" => '' . $oper->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => '' . $a . $newdoc . ''); $this->db->insert("operti", $datos2); if ($this->db->affected_rows() > 0) { $control = array("doc" => '' . $a . $newdoc . '', "status" => "0"); $this->db->insert("control_operti", $control); $this->db->query("\xa UPDATE operti a2 SET a2.totbruto=(SELECT SUM(montoneto) FROM opermv WHERE documento=a2.documento),\xa a2.totneto=(SELECT SUM(montoneto) FROM opermv WHERE documento=a2.documento),a2.totalfinal=(SELECT SUM(montototal) FROM opermv WHERE documento=a2.documento),\xa a2.baseimpo1=0,
a2.totimpuest=0,
a2.totdescuen=(SELECT SUM(dsctoprc*cantidad) FROM opermv WHERE documento=a2.documento),\xa a2.totcosto=(SELECT SUM(costounit) FROM opermv WHERE documento=a2.documento)\xa WHERE a2.documento='" . $a . $b . "' && a2.tipodoc='ESP';
"); } } function genecod($longitud) { $key = ''; $pattern = "1234567890"; $max = strlen($pattern) - 1; for ($i = 0; $i < $longitud; $i++) { $key .= $pattern[mt_rand(0, $max)]; } return $key; } public function elim_pedido($a) { $elim = $this->db->where("id_pedido", $a)->delete("tem_pedido"); echo $elim; } public function almaut($b) { $this->load->library("table"); if ($b != '') { $filter = "&& (a.documento='{$b}' || a.codcliente='{$b}' || a.nombrecli like '%{$b}%' || b.codigo='{$b}' || b.nombre like '%{$b}%')"; } else { $filter = ''; } if ($this->session->userdata("tip") == "2" || $this->session->userdata("tip") == "4" || $this->session->userdata("tip") == "3" || $this->session->userdata("tip") == "6" || $this->session->userdata("tip") == "11") { $solo = ''; } else { $solo = ''; } $bdfac = $this->db->query("SELECT a.documento,a.antdoc,a.tipodoc, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor, ROUND(SUM(b.cantidad),2) unidades, c.timeaut,c.timeasig,c.timeemp, c.status \xa FROM operti AS a \xa JOIN opermv AS b ON a.documento=b.documento\xa JOIN control_operti AS c ON a.antdoc=c.doc\xa WHERE a.fechacrea>=DATE_ADD(CURDATE(),INTERVAL -15 DAY) {$solo} && a.tipodoc='ESP' {$filter}
GROUP BY a.documento;")->result(); $tunid = $this->db->query("SELECT ROUND(SUM(b.cantidad),2) n
FROM operti AS a
JOIN opermv AS b ON a.documento=b.documento
JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.fechacrea>=DATE_ADD(CURDATE(),INTERVAL -10 DAY) {$solo} && a.tipodoc='ESP' {$filter}")->row(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid w3-fijo">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" id="like" placeholder="Ingrese su busqueda" onchange="almaut();"></td>
<td class="w3-center w3-btn"><a onclick="autorizar();"><img src="" . base_url() . "images/bn.png" alt="Autorizar" title="Autorizar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="reservaped();"><img src="" . base_url() . "images/reservado.png" alt="Reservar" title="Reservar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="prefac();"><img src="" . base_url() . "images/factura.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="viewpedtemp();"><img src="" . base_url() . "images/pedtemp.png" alt="Temporales" title="Temporales" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="viewbackorder();"><img src="" . base_url() . "images/backorder.png" alt="Backorder" title="Backorder" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="editfac();"><img src="" . base_url() . "images/editar.png" alt="Editar Vendedor" title="Editar Vendedor" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="aggcombo();"><img src="" . base_url() . "images/combo.png" alt="Agregar Combo" title="Agregar Combo" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="newprecio();"><img src="" . base_url() . "images/precionew.png" alt="Precio de Ma\xc3\261ana" title="Precio de Ma\303\261ana" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="almaut();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="elimfac();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>N</th><th>Doc</th><th>Codigo</th><th>Nombre</th><th>Sector</th><th>Vendedor</th><th>Unidades</th><th>F.Autoriza</th><th>F.Asigna</th><th>F.Emp</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $psico = 0; $leg = ''; $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtfac->documento}' LIMIT 1")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itfacaut($('#a" . $i . "').val());">"; $psico = $this->db->query("SELECT NULL FROM opermv a JOIN articulo b ON a.codigo=b.codigo WHERE a.documento='{$dtfac->documento}' && b.controlado=1")->num_rows(); if ($psico > 0) { $leg = "class="w3-pink""; } if ($dtfac->status == 0) { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtfac->status == 4) { $status = "Autorizado"; $color = "w3-yellow"; } elseif ($dtfac->status == 1) { $status = "Armando..."; $color = "w3-pale-yellow"; } elseif ($dtfac->status == 5 || $dtfac->status == 97) { $status = "Por Verificar"; $color = "w3-pale-blue"; } elseif ($dtfac->status == 98) { $status = "Listo"; $color = "w3-green"; } elseif ($dtfac->status == 99) { $status = "Reservado"; $color = "w3-orange"; } else { $status = "Error"; $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" name="status" value="" . $dtfac->status . "">\xa <input type="hidden" name="antdoc" value="" . $dtfac->antdoc . ""><input type="hidden" name="tipodoc" value="" . $dtfac->tipodoc . "">
<input type="hidden" name="psico" value="" . $psico . "">
<td>" . $i . "</td><td " . $leg . "><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->documento . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td><td>" . $dtfac->sector . "</td><td>" . $vend->nombre . "</td><td>" . $dtfac->unidades . "</td><td>" . $dtfac->timeaut . "</td><td>" . $dtfac->timeasig . "</td><td>" . $dtfac->timeemp . "</td><td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="11"><label class="w3-large"><b>Total Unidades: " . $tunid->n . "</b></label></td></tr></table>"; return $html; } public function itfacaut($a) { $this->load->library("table"); $bditfac = $this->db->query("SELECT c.codigo, c.nombre, ROUND(c.cantidad,2) cantidad, c.lote,c.almacen, c.timpueprc,c.status,c.dsctounit,ROUND(c.preciooriginal,2) precio,Round(c.preciofin,2) preciofin FROM opermv AS c WHERE c.documento='{$a}';")->result(); $nom = $this->db->query("SELECT nomape FROM trab as a JOIN control_operti as b ON a.id=b.trabempaq WHERE b.doc='{$a}'")->row(); $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$a}' LIMIT 1")->row(); $bdarti = $this->db->query("SELECT codigo,CONCAT('Nombre: ',nombre,' Cantidad: ',round(existencia-comprometido)) nombre FROM articulo WHERe para_web=1 && existencia>0")->result(); $art = "<input type="text" class="w3-input" id="newcodigo" list="listarti" placeholder="Producto..."><datalist id="listarti">"; foreach ($bdarti as $dbarti) { $art .= "<option value="" . $dbarti->codigo . "">" . $dbarti->nombre . "</option>"; } $art .= "</datalist>"; $html = "
<!--<a onclick="editproducto();" class="w3-btn"><img src="" . base_url() . "images/nd.png" alt="Generar N/D" title="Generar N/D" style="width:20px;height:20px;border:0;"></a>-->\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr>\xa <td class="w3-fondodroid">Vendedor:</td>
<td>" . $vend->nombre . "</td>
<td class="w3-fondodroid">Asignado:</td>\xa <td>" . $nom->nomape . "</td></tr>\xa </table><br>
<table class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>N</th><th>Alm</th><th>Producto</th><th>Precio</th><th>DESC</th><th>IVA</th><th>PrecioFin</th><th>Cantidad</th><th>Lote</th><th>Estatus</th><th></th></tr>"; $i = 0; $html .= "<tr><td></td><td></td><td>" . $art . "</td><td></td><td></td><td></td><td></td><td><input type="number" class="w3-input" id="newcantitem" placeholder="n..." style="width:30px;"></td><td></td><td></td><td><a onclick="regitemfac();" style="cursor:pointer"><img src="" . base_url() . "images/registrar.png" alt="Registrar Item" title="Registrar Item" style="width:20px;height:20px;border:0;"></a></td></tr>"; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtitfac->status == 1) { $status = "Listo"; $color = "w3-green"; $btnelim = ''; } if ($this->session->userdata("tip") == "2" || $this->session->userdata("tip") == "3" || $this->session->userdata("tip") == "6") { $btnelim = "<a onclick="alert_elim_almped($('#doc').val(),$('#codmed" . $i . "').val(),$('#cant" . $i . "').val(),$('#almacen" . $i . "').val());return false;"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:16px;height:16px;border:0;"></a>"; } $html .= "<tr><input type="hidden" id="doc" value="" . $a . ""><input type="hidden" id="codmed" . $i . "" value="" . $dtitfac->codigo . "">
<input type="hidden" id="almacen" . $i . "" value="" . $dtitfac->almacen . ""><input type="hidden" id="cant" . $i . "" value="" . $dtitfac->cantidad . "">\xa <td>" . $i . "</td><td>" . $dtitfac->almacen . "</td><td>" . $dtitfac->codigo . " " . $dtitfac->nombre . "</td><td ondblclick="inputprc($('#doc').val(),$('#codmed" . $i . "').val(),$('#cant" . $i . "').val(),'" . $dtitfac->precio . "','" . $i . "');" id="verprc" . $i . "">" . $dtitfac->precio . "</td><td>" . ROUND($dtitfac->dsctounit, 2) . "</td><td>" . ROUND($dtitfac->timpueprc, 2) . "</td><td>" . $dtitfac->preciofin . "</td><td ondblclick="inputcant($('#doc').val(),$('#codmed" . $i . "').val(),$('#cant" . $i . "').val(),'" . $i . "');" id="vercant" . $i . "">" . $dtitfac->cantidad . "</td><td ondblclick="viewmodlote('" . $dtitfac->codigo . "','" . $a . "','" . $dtitfac->cantidad . "');">" . $dtitfac->lote . "</td><td class="" . $color . " w3-center">" . $status . "</td><td class="w3-btn">" . $btnelim . "</td>\xa </tr>"; } $html .= "</table>"; return $html; } function regitemfac($doc, $cod, $cant) { $dtped = $this->db->query("SELECT nombre,precio1 precio,preciofin1 preciofin,costo, dscto_medicamentos descuprod,impuesto1 FROM articulo WHERe codigo='{$cod}'")->row(); $fac = $this->db->query("SELECT dsctoendp, vendedor,proveedor,fechadoc,fechayhora FROM opermv WHERe tipodoc='ESP' && documento='{$doc}' LIMIT 1")->row(); $blot = $this->db->query("SELECT c.almacen,c.lote,c.cantidad-c.consumido exist FROM artilotes AS c \xa WHERE c.codigoart='{$cod}' && (c.cantidad-c.consumido)>0 && c.almacen NOT IN (01,05,06) ORDER BY c.vence ASC")->result(); $newcant = 0; $i = 0; foreach ($blot as $dlot) { if ($dlot->exist >= $cant) { $newcant = $cant; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => $doc, "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => $cod, "pid" => '', "nombre" => '' . $dtped->nombre . '', "costounit" => '' . $dtped->costo . '', "preciounit" => $dtped->precio, "dsctounit" => '' . $dtped->descuprod . '', "dsctoprc" => 0, "dsctoendp" => $fac->dsctoendp, "dsctoendm" => 0, "preciofin" => $dtped->preciofin, "preciooriginal" => '' . $dtped->precio . '', "cantidad" => '' . $newcant . '', "montoneto" => 0, "montototal" => 0, "timpueprc" => '' . $dtped->impuesto1 . '', "almacen" => $dlot->almacen, "proveedor" => $fac->proveedor, "fechadoc" => $fac->fechadoc, "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $fac->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => $newcant, "estacion" => "001", "udinamica" => "1", "baseimpo1" => 0, "baseimpo2" => "0", "lote" => $dlot->lote, "idvalidacion" => '', "fechayhora" => $fac->fechayhora, "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo set comprometido=comprometido+{$newcant} WHERE codigo='{$cod}'"); $i++; } break; } elseif ($dlot->exist < $cant) { $cant = $cant - $dlot->exist; $newcant = $dlot->exist; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => $doc, "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => $cod, "pid" => '', "nombre" => '' . $dtped->nombre . '', "costounit" => '' . $dtped->costo . '', "preciounit" => $dtped->precio, "dsctounit" => '' . $dtped->descuprod . '', "dsctoprc" => 0, "dsctoendp" => $fac->dsctoendp, "dsctoendm" => 0, "preciofin" => $dtped->preciofin, "preciooriginal" => '' . $dtped->precio . '', "cantidad" => '' . $newcant . '', "montoneto" => 0, "montototal" => 0, "timpueprc" => '' . $dtped->impuesto1 . '', "almacen" => $dlot->almacen, "proveedor" => $fac->proveedor, "fechadoc" => $fac->fechadoc, "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $fac->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => $newcant, "estacion" => "001", "udinamica" => "1", "baseimpo1" => 0, "baseimpo2" => "0", "lote" => $dlot->lote, "idvalidacion" => '', "fechayhora" => $fac->fechayhora, "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo set comprometido=comprometido+{$newcant} WHERE codigo='{$cod}'"); $i++; } } } return $i; } function newprecio($doc) { $this->db->query("UPDATE opermv a JOIN articulo b ON a.codigo=b.codigo SET a.preciooriginal=b.precio1 WHERE tipodoc='ESP' && documento='{$doc}'"); return $this->db->affected_rows(); } function reservaped($doc) { $status = $this->db->query("SELECT status FROM control_operti WHERE doc='{$doc}'")->row()->status; if ($status == "99") { $this->db->query("UPDATE control_operti SET status=0 WHERE doc='{$doc}' && status=99"); } else { $this->db->query("UPDATE control_operti SET status=99 WHERE doc='{$doc}' && status=0"); } return $this->db->affected_rows(); } function viewbackorder($a) { $val = $this->db->query("SELECT * FROM backorder WHERE doc='{$a}'")->num_rows(); if ($val > 0) { $doc = $a; } else { $db = $this->db->query("SELECT antdoc FROM operti WHERe documento='{$a}'")->row(); $doc = $db->antdoc; } return $this->db->query("SELECT doc,cliente,codigo,(SELECT nombre FROM articulo WHERE codigo=a.codigo) nombre,cantorg pedido,cantfin cargado,fecha FROM backorder a WHERE doc='{$doc}'"); } function viewpedtemp() { return $this->db->query("SELECT a.cod_cli cliente, c.nombre nomcli, b.codigo,b.nombre, a.cant cantidad FROM tem_pedido a JOIN articulo b ON a.cod_med=b.codigo LEFT JOIN cliempre c ON c.codigo=a.cod_cli GROUP BY a.cod_cli, a.cod_med"); } function limpiarpedesp() { $this->db->query("TRUNCATE tem_pedido;"); return 1; } public function autorizar($a, $status) { if ($status == 99) { $this->db->query("UPDATE opermv a JOIN articulo b ON a.codigo=b.codigo SET a.preciooriginal=b.precio1, a.preciounit=b.precio1-(b.precio1*(b.dscto_medicamentos/100)), \xa a.preciofin=(b.precio1-(b.precio1*(b.dscto_medicamentos/100)))*(1+(b.impuesto1/100)),a.dsctounit=b.dscto_medicamentos,
a.dsctoprc=b.precio1*(b.dscto_medicamentos/100),a.timpueprc=b.impuesto1 WHERE a.documento='{$a}';\xa "); } $this->db->query("UPDATE operti a JOIN opermv b ON a.documento=b.documento SET a.fechacrea=curdate(), b.fechadoc=curdate() WHERE a.documento='{$a}'"); $datos = array("status" => "4", "timeaut" => date("Y-m-d H:i:s")); $this->db->where("doc", $a)->UPDATE("control_operti", $datos); if ($this->db->affected_rows() > 0) { $this->loguser("Autorizar", "El usuario ha autorizado el documento " . $a . ''); } return $this->db->affected_rows(); } function viewfac($a, $b) { if ($b == "ESP") { $this->ajustetotales($a, $b); } else { if ($b == "N/C") { $this->ajustetotalesnc($a, $b); } } $db = $this->db->query("SELECT ROUND(a.totald,2) totald,c.nombre vendedor,a.fechacrea,a.documento,a.tipodoc,a.nombrecli,a.rif,b.campo1 sicmb,b.sucursal,a.direccion direcenvio,ROUND(a.totneto,2)totneto,ROUND(a.totimpuest,2)totimpuest,a.sector,a.subcodigo,\xa CONCAT(ROUND(a.totdescuen,2),' ',ROUND(a.totdescuen2,2)) totdescuen,ROUND(a.dsctolinea,2)dsctolinea,ROUND(a.dsctolinea2,2) dsctolinea2,ROUND(a.dsctolinea3,2) dsctolinea3,ROUND(a.totalfinal,2)totalfinal,ROUND(a.baseimpo1,2)baseimpo1,ROUND(a.sinimpuest,2)sinimpuest,a.notas,a.vence,a.diascred,a.diasindex,a.referencia,a.codcliente,a.documentofiscal
FROM operti a
LEFT JOIN cliempre b ON a.codcliente=b.codigo\xa LEFT JOIN listvend c ON a.vendedor=c.codigo\xa WHERE a.documento='{$a}' && a.tipodoc='{$b}'")->row(); $tsiva = 0; $tsimp = 0; $tdesc = 0; $timp = 0; $tot = 0; $baseimp = 0; $nota = ''; $tsimp = $db->sinimpuest; $tsiva = $db->totneto; $tdesc = $db->totdescuen; $tdescprm = $db->dsctolinea; $tdescprm2 = $db->dsctolinea2; $tdescprm3 = $db->dsctolinea3; $timp = $db->totimpuest; $tot = $db->totalfinal; $baseimp = $db->baseimpo1; $nota = $db->notas; $facafec = $this->db->query("SELECT fechacrea,documento FROM operti where concat(tipodoc,documento)='{$db->referencia}'")->row(); $db2 = $this->db->query("SELECT ROUND(a.cantidad)cantidad,ROUND(a.cntdevuelt)cntdevuelt,a.lote,a.nombre,a.unidad,\xa (SELECT vence from artilotes WHERE codigoart=a.codigo && lote=a.lote && almacen=a.almacen limit 1) vence,ROUND(a.preciooriginal,2)preciooriginal,CONCAT(ROUND(a.dsctounit,0),'% ',ROUND(a.dsctoprc,2),', ',ROUND(a.dsctounit2,0),'% ',ROUND(a.dsctoprc2,2),', ',ROUND(a.dsctoendp2,0),'% ',ROUND(a.dsctoendm2,2),', ',ROUND(a.dsctoendp3,0),'% ',ROUND(a.dsctoendm3,2),', ',ROUND(a.dsctoendp,0),'% ',ROUND(a.dsctoendm,2)) descu,\xa ROUND(a.preciofin,2)preciofin,ROUND(a.montototal,2)montototal,ROUND(a.preciounit,2)preciounit,CONCAT(ROUND(a.timpueprc,0),'% ',ROUND(IF(a.timpueprc>0,a.preciounit*(a.timpueprc/100),0),2)) timpueprc
FROM opermv a
WHERE a.documento='{$a}' && a.tipodoc='{$b}'")->result(); $i = 0; $unid = 0; $db3 = $this->db->query("SELECT oficial FROM monecam WHERE fecha<=(SELECT fechacrea FROM operti WHERE documento='{$a}' && tipodoc='{$b}' LIMIT 1) ORDER BY fecha DESC LIMIT 1")->row(); $tasa = $db3->oficial; $db4 = $this->db->query("SELECT oficial FROM monecam WHERE fecha<='{$facafec->fechacrea}' ORDER BY fecha DESC LIMIT 1")->row(); $tasanc = $db4->oficial; $zona = $this->db->query("SELECT subsector n FROM subsectores WHERE codigo='{$db->sector}' && subcodigo='{$db->subcodigo}'")->row(); $segun = ''; if ($b == "ESP") { $totd = $tot / $tasa; $tipodoc = "Pedido:"; $tcant = "cantidad"; $diascred = "<td><b>D\303\xadas Cr\303\xa9dito: </b>" . $db->diascred . "</td><td><b>Promoci\303\263n " . $db->diasindex . " d\xc3\xadas sin indexar.</b></td>"; } elseif ($b == "FAC") { $totd = $db->totald; $tipodoc = "Factura:"; $tcant = "cantidad"; $diascred = "<td><b>D\303\255as Cr\xc3\xa9dito: </b>" . $db->diascred . "</td><td><b>Promoci\303\xb3n " . $db->diasindex . " d\xc3\xadas sin indexar.</b></td>"; } elseif ($b == "NOT") { $totd = $db->totald; $tipodoc = "Nota de entrega:"; $tcant = "cantidad"; $diascred = "<td><b>D\303\255as Cr\303\xa9dito: </b>" . $db->diascred . "</td>"; } elseif ($b == "N/C") { $totd = $db->totald; $segun = "<td><b>Seg\303\xban Factura: </b>" . $facafec->documento . "</td> <td><b>Fecha Emisi\xc3\xb3n Factura: </b>" . $facafec->fechacrea . "</td>"; $tipodoc = "Nota de Cr\303\251dito:"; $tcant = "cntdevuelt"; $diascred = ''; } elseif ($b == "N/D") { $totd = $db->totald; $tipodoc = "Nota de debito:"; $tcant = "cantidad"; $diascred = "<td><b>D\303\255as Cr\303\xa9dito: </b>" . $db->diascred . "</td>"; } if ($db->sucursal == '' || $db->sucursal == null) { $sucursal = "N/A"; } else { $sucursal = $db->sucursal; } $html = "<link rel="stylesheet" href="assets/css/w3.css?v=4"><html><div class="w3-center" style="margin-top:15%;margin-left:2.5%" >"; $html .= "<input type="hidden" value="" . $db->documento . "" id="numfac"><input type="hidden" value="" . $db->tipodoc . "" id="tipodoc">"; $html .= "<table class="w3-table w3-medium"><tr><td><b>" . $tipodoc . " </b>" . $db->documento . "</td><td><b>Fecha de Emisi\xc3\263n: </b>" . DateTime::createFromFormat("Y-m-d", $db->fechacrea)->format("d/m/Y") . "</td>" . $diascred . '' . $segun . "</tr></table>"; $html .= "<table class="w3-table w3-tiny"><tr><td><b>Cod. Cliente: </b>" . $db->codcliente . "</td><td><b>Raz\303\263n Social: </b>" . $db->nombrecli . "</td><td><b>R.I.F: </b>" . $db->rif . "</td><td><b>C\303\263digo SICM: </b>" . $db->sicmb . "</td><td><b>Vendedor: </b>" . $db->vendedor . "</td></tr></table>"; $html .= "<table class="w3-table w3-tiny"><tr><td><b>Sucursal: </b>" . $sucursal . "</td><td><b>Zona: </b>" . $zona->n . "</td><td><b>Domicilio Fiscal: </b>" . $db->direcenvio . "</td></tr></table><br>"; $html .= "<table class="w3-table-all w3-hoverable w3-textpdf" style="width:100%"><tr><th>Item</th><th>Cant</th><th>Lote</th><th>Descripci\xc3\xb3n del Articulo</th><th>F.V.</th><th>Precio.Org</th><th>Dscto.Prod1,Prod2,Vol,Prov,VIP</th><th>Precio.Unit</th><th>IVA</th><th>Total</th></tr>"; foreach ($db2 as $item) { $i++; $cant = $item->{$tcant}; $unid += ROUND($cant); $html .= "<tr><td>" . $i . "</td><td>" . ROUND($cant) . "</td><td>" . $item->lote . "</td><td>" . $item->nombre . "</td><td>" . $item->vence . "</td><td>" . $item->preciooriginal . "</td><td>" . $item->descu . "</td><td>" . $item->preciounit . "</td><td>" . $item->timpueprc . "</td><td>" . $item->montototal . "</td></tr>"; } if ($db->documentofiscal == "IGTF") { $baseigtf = $tot * 100 / 3; $baseimpIGTF = "<td class="w3-light-grey"><b>Base Imponible IGTF</b></td><td>" . $baseigtf . "</td>"; } else { $baseimpIGTF = ''; } $html .= "</table>"; $html .= "<table class="w3-table-all w3-textpdf" style="width:100%">\xa <tr><td class="w3-light-grey"><b>Unidades:</b></td><td>" . $unid . "</td>\xa <td class="w3-light-grey"><b>Subtotal:</b></td><td>" . $tsiva . "</td>
<td class="w3-light-grey"><b>Monto total exento:</b></td><td>" . $tsimp . "</td>
<td class="w3-light-grey"><b>Base imponible seg\xc3\272n al\303\255cuota:</b></td><td>" . $baseimp . "</td>\xa <td class="w3-light-grey"><b>Impuesto seg\303\272n Al\xc3\255cuota</b></td><td>" . $timp . "</td>
" . $baseimpIGTF . "
<td class="w3-light-grey"><b>Dscto.PROD1 Dscto.PROD2</b></td><td>" . $tdesc . "</td>\xa <td class="w3-light-grey"><b>Dscto.VOL</b></td><td>" . $tdescprm2 . "</td>\xa <td class="w3-light-grey"><b>Dscto.PROV</b></td><td>" . $tdescprm3 . "</td>
<td class="w3-light-grey"><b>Dscto.VIP</b></td><td>" . $tdescprm . "</td>
<td class="w3-light-grey"><b>Total:</b></td><td>" . $tot . "</td></tr>
</table><br>"; if ($b == "ESP" || $b == "FAC" || $b == "N/D") { $html .= "<table class="w3-table w3-textpdf" style="width:100%">
<tr><td class="w3-light-grey"><b>REF:</b></td><td class="w3-left">" . round($totd, 2) . "$ equivalentes a la tasa de cambio de BCV de 1 USD por " . round($tasa, 4) . " Bs.</td><td class="w3-light-grey"><b>Nota:</b></td><td class="w3-left">" . $nota . "</td></tr>
</table>
<table class="w3-table w3-textpdf" style="width:100%">\xa <tr><td>*De acuerdo a lo previsto en el Art. 25 Ley de IVA, se expresan los montos de la facturaci\303\263n en d\xc3\263lares. Si el pago se realiza posterior a su vencimiento, se genera un ajuste por diferencia en cambio, \xa calculado a la tasa del BCV.</td>
<td>*De conformidad a lo establecido en la providencia administrativa Nro SNAT/2022/000013, G.0 Nro 42.339 de fecha 17/03/2022, todo pago realizado en moneda distinta a la de curso legal en el pa\xc3\xads debe enterar \xa el equivalente al 3% por concepto de IGTF, o su equivalente en Bs. a la tasa de BCV del d\xc3\xada de pago, el cual ser\xc3\241 reflejado en comprobante de percepci\xc3\xb3n.</td></tr></table>
</div></html>"; } else { if ($b == "NOT") { $html .= "<table class="w3-table w3-textpdf" style="width:100%">\xa <tr><td class="w3-light-grey"><b>REF:</b></td><td>" . round($totd, 2) . "$ equivalentes a la tasa de cambio de BCV de 1 USD por " . round($tasa, 2) . " Bs.</td><td class="w3-light-grey"><b>Nota:</b></td><td class="w3-left">" . $nota . "</td></tr>\xa </table>
<table class="w3-table w3-textpdf" style="width:100%">\xa <tr><td>*De acuerdo a lo previsto en el Art. 25 Ley de IVA, se expresan los montos de la facturaci\xc3\xb3n en d\303\263lares. Si el pago se realiza posterior a su vencimiento, se genera un ajuste por diferencia en cambio, \xa calculado a la tasa del BCV.</td>
<td>*De conformidad a lo establecido en la providencia administrativa Nro SNAT/2022/000013, G.0 Nro 42.339 de fecha 17/03/2022, todo pago realizado en moneda distinta a la de curso legal en el pa\303\xads debe enterar \xa el equivalente al 3% por concepto de IGTF, o su equivalente en Bs. a la tasa de BCV del d\xc3\255a de pago, el cual ser\303\xa1 reflejado en comprobante de percepci\xc3\xb3n.</td></tr></table>
</div></html>"; } else { $html .= "<table class="w3-table w3-textpdf" style="width:100%">
<tr><td class="w3-light-grey"><b>REF:</b></td><td>" . round($totd, 2) . "$ equivalentes a la tasa de cambio de BCV de 1 USD por " . round($tasa, 2) . " Bs.</td><td class="w3-light-grey"><b>Nota:</b></td><td>Unidades devueltas.</td></tr>\xa </table>\xa </div></html>"; } } return $html; } public function promos($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE nom like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT * FROM promos " . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.id,CONCAT(b.codigo,' ',b.nombre) nombre,a.fdesde, a.fhasta, a.descu FROM promos a JOIN cliempre b ON a.cli=b.codigo " . $filter . " LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="promos()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="regpromos();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Promos" title="Registrar Promos" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="editpromos();"><img src="" . base_url() . "images/editar.png" alt="Editar Promos" title="Editar Promos" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="promos();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa </tr></table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>ID</th><th>Nombre</th><th>Desde</th><th>Hasta</th><th>Descu</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->fdesde <= date("Y-m-d H:i:s") && date("Y-m-d H:i:s") <= $dtfac->fhasta) { $status = "Activo"; $color = "class="w3-green""; } else { $status = "Inactivo"; $color = "class="w3-red""; } $html .= "<tr id="slect" . $i . ""><input type="hidden" name="doc" value="" . $dtfac->id . ""><input type="hidden" name="antdescu" value="" . $dtfac->descu . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->id . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->fdesde . "</td><td>" . $dtfac->fhasta . "</td>\xa <td>" . $dtfac->descu . "</td><td " . $color . ">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="6"><label class="w3-large"><b>Total Promos: " . $TotalRegistro . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903";\xa var datos = {
"pag" : DecrementNum,
"key" : key
};
$.ajax({\xa data: datos,
url: baseurl+"c_droid/promos",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); swal.close();
}\xa \xa });\xa }\xa \xa function numpag(a){ before();\xa var key="droid903";
var datos = {
"key":key,\xa "pag" : a
};\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/promos",
type: "POST",\xa success: function(data) {
$("#body").html(data); swal.close();\xa }\xa \xa });
}
function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903";\xa var datos = {\xa "key":key,\xa "pag" : IncrimentNum\xa };
$.ajax({\xa data: datos,
url: baseurl+"c_droid/promos",\xa type: "POST",\xa success: function(data) {
$("#body").html(data); swal.close();\xa }\xa
});
}
</script>\xa <div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>
\xa </div> "; return $html; } function regpromos($nom, $fdesde, $fhasta, $descu) { $this->db->insert("promos", array("cli" => $nom, "fdesde" => $fdesde, "fhasta" => $fhasta, "descu" => $descu)); $this->loguser("Crea Promo", "El usuario crea la promo " . $nom . " con fecha desde " . $fdesde . " hasta " . $fhasta . "; PROMO: " . $descu . "."); return $this->db->affected_rows(); } function editpromos($id, $fdesde, $fhasta, $descu) { $this->db->where("id", $id)->update("promos", array("fdesde" => $fdesde, "fhasta" => $fhasta, "descu" => $descu)); $this->loguser("Modifica Promo", "El usuario modifica la promo " . $id . " con fecha desde " . $fdesde . " hasta " . $fhasta . "; PROMO: " . $descu . "."); return $this->db->affected_rows(); } function viewdev($a, $b) { $db = $this->db->query("SELECT c.nombre vendedor,a.fechacrea,a.documento,a.tipodoc,a.nombrecli,a.rif,b.campo1 sicmb,b.direccion direcenvio,ROUND(a.totneto,2)totneto,ROUND(a.totimpuest,2)totimpuest,\xa ROUND(a.totdescuen,2)totdescuen,ROUND(a.totalfinal,2)totalfinal,ROUND(a.baseimpo1,2)baseimpo1,ROUND(a.sinimpuest,2)sinimpuest,a.notas,a.vence,a.diascred,a.referencia\xa FROM devolti a
JOIN cliempre b ON a.codcliente=b.codigo\xa JOIN listvend c ON a.vendedor=c.codigo\xa WHERE a.documento='{$a}' && a.tipodoc='{$b}'")->row(); $tsiva = 0; $tsimp = 0; $tdesc = 0; $timp = 0; $tot = 0; $baseimp = 0; $nota = ''; $tsimp = $db->sinimpuest; $tsiva = $db->totneto; $tdesc = $db->totdescuen; $timp = $db->totimpuest; $tot = $db->totalfinal; $baseimp = $db->baseimpo1; $nota = $db->notas; $facafec = $this->db->query("SELECT fechacrea,documento FROM operti where concat(tipodoc,documento)='{$db->referencia}'")->row(); $db2 = $this->db->query("SELECT ROUND(a.cantidad)cantidad,ROUND(a.cntdevuelt)cntdevuelt,a.lote,a.nombre,a.unidad,\xa (SELECT vence from artilotes WHERE codigoart=a.codigo && lote=a.lote && almacen=a.almacen limit 1) vence,ROUND(a.preciounit,2)preciooriginal,CONCAT(ROUND(a.dsctounit,0),'% ',ROUND(a.dsctoprc,2)) descu,
ROUND(a.preciofin,2)preciofin,ROUND(a.montototal,2)montototal,ROUND(a.preciounit,2)preciounit,CONCAT(ROUND(a.timpueprc,0),'% ',ROUND(IF(a.timpueprc>0,a.preciounit*(a.timpueprc/100),0),2)) timpueprc
FROM devolmv a
WHERE a.documento='{$a}' && a.tipodoc='{$b}'")->result(); $i = 0; $unid = 0; $db3 = $this->db->query("SELECT oficial FROM monecam WHERE fecha<=(SELECT fechacrea FROM devolti WHERE documento='{$a}' && tipodoc='{$b}' LIMIT 1) ORDER BY fecha DESC LIMIT 1")->row(); $tasa = $db3->oficial; $db4 = $this->db->query("SELECT oficial FROM monecam WHERE fecha<='{$facafec->fechacrea}' ORDER BY fecha DESC LIMIT 1")->row(); $tasanc = $db4->oficial; $segun = ''; $totd = $tot / $tasa; if ($b == "DEV") { $totd = $tot / $tasa; $segun = "<td><b>Seg\xc3\272n Factura: </b>" . $facafec->documento . "</td> <td><b>Fecha Emisi\xc3\263n Factura: </b>" . $facafec->fechacrea . "</td>"; $tipodoc = "Devoluci\xc3\263n:"; $tcant = "cntdevuelt"; $diascred = ''; } $html = "<link rel="stylesheet" href="assets/css/w3.css?v=4"><html><div class="w3-center" style="margin-top:18%;margin-left:2.5%" >"; $html .= "<input type="hidden" value="" . $db->documento . "" id="numfac"><input type="hidden" value="" . $db->tipodoc . "" id="tipodoc">"; $html .= "<table class="w3-table w3-medium"><tr><td><b>" . $tipodoc . " </b>" . $db->documento . "</td><td><b>Fecha de Emisi\xc3\263n: </b>" . DateTime::createFromFormat("Y-m-d", $db->fechacrea)->format("d/m/Y") . "</td>" . $diascred . '' . $segun . "</tr></table>"; $html .= "<table class="w3-table w3-tiny"><tr><td><b>Raz\303\263n Social: </b>" . $db->nombrecli . "</td><td><b>R.I.F: </b>" . $db->rif . "</td><td><b>C\303\xb3digo SICM: </b>" . $db->sicmb . "</td><td><b>Vendedor: </b>" . $db->vendedor . "</td></tr></table>"; $html .= "<table class="w3-table w3-tiny"><tr><td><b>Domicilio Fiscal: </b>" . $db->direcenvio . "</td></table><br>"; $html .= "<table class="w3-table-all w3-hoverable w3-textpdf" style="width:100%"><tr><th>Item</th><th>Cant</th><th>Lote</th><th>Descripci\303\263n del Articulo</th><th>F.V.</th><th>Precio.Org</th><th>Descuento</th><th>Precio.Unit</th><th>IVA</th><th>Precio.Fin</th><th>Total</th></tr>"; foreach ($db2 as $item) { $i++; $cant = $item->{$tcant}; $unid += ROUND($cant); $html .= "<tr><td>" . $i . "</td><td>" . ROUND($cant) . "</td><td>" . $item->lote . "</td><td>" . $item->nombre . "</td><td>" . $item->vence . "</td><td>" . $item->preciooriginal . "</td><td>" . $item->descu . "</td><td>" . $item->preciounit . "</td><td>" . $item->timpueprc . "</td><td>" . $item->preciofin . "</td><td>" . $item->montototal . "</td></tr>"; } $html .= "</table>"; $html .= "<table class="w3-table-all w3-textpdf" style="width:100%">
<tr><td class="w3-light-grey"><b>Unidades:</b></td><td>" . $unid . "</td><td class="w3-light-grey"><b>Subtotal:</b></td><td>" . $tsiva . "</td><td class="w3-light-grey"><b>Monto total exento:</b></td><td>" . $tsimp . "</td><td class="w3-light-grey"><b>Base imponible seg\xc3\272n al\303\xadcuota:</b></td><td>" . $baseimp . "</td>
<td class="w3-light-grey"><b>Impuesto seg\303\xban Al\303\xadcuota</b></td><td>" . $timp . "</td><td class="w3-light-grey"><b>Descuento</b></td><td>" . $tdesc . "</td><td class="w3-light-grey"><b>Total:</b></td><td>" . $tot . "</td></tr>\xa </table><br>"; $html .= "<table class="w3-table w3-textpdf" style="width:100%">
<tr><td class="w3-light-grey"><b>REF:</b></td><td>" . round($totd, 2) . "$ equivalentes a la tasa de cambio de BCV de 1 USD por " . round($tasanc, 2) . " Bs.</td><td class="w3-light-grey"><b>Nota:</b></td><td>Unidades devueltas.</td></tr>\xa </table>
</div></html>"; return $html; } function impdoc($doc, $tip, $ncontrol) { $this->db->query("UPDATE operti set estatusdoc='1',orden='{$ncontrol}' WHERE documento='{$doc}' && tipodoc='{$tip}' && estatusdoc='0'"); if ($this->db->affected_rows() > 0) { $this->loguser("Imprime", "El usuario imprime documento " . $tip . $doc . ''); } } function convnotfac($a) { $num = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='FAC'")->row(); $newdoc = str_pad($num->n, 8, "0", STR_PAD_LEFT); $this->db->query("UPDATE operti SET documento='{$newdoc}',fechacrea=CURDATE(),emision=CURDATE(),recepcion=CURDATE(),fechayhora=NOW(),tipodoc='FAC',totald=totalfinal/(SELECT oficial FROM monecam WHERE fecha<=CURDATE() ORDER BY fecha DESC LIMIT 1) WHERE documento='{$a}' && tipodoc='NOT'"); $this->db->query("UPDATE opermv SET documento='{$newdoc}',fechadoc=CURDATE(),tipodoc='FAC' WHERE documento='{$a}' && tipodoc='NOT'"); $this->loguser("Facturar", "El usuario convierte nota de entrega " . $a . " en factura " . $newdoc . ''); return $this->db->affected_rows(); } function validalote($doc, $tip) { $bd = $this->db->query("SELECT almacen,codigo,lote,cantidad FROM opermv WHERE tipodoc='{$tip}' && documento='{$doc}'")->result(); $i = 0; foreach ($bd as $dt) { $bd2 = $this->db->query("SELECT NULL FROM artilotes WHERE almacen='{$dt->almacen}' && codigoart='{$dt->codigo}' && lote='{$dt->lote}' && (cantidad-consumido)>='{$dt->cantidad}'")->num_rows(); if ($bd2 == 0) { $i++; return $data = array("row" => 0, "alm" => $dt->almacen, "prod" => $dt->codigo, "lote" => $dt->lote); } } if ($i == 0) { return $data = array("row" => 1); } } function facturar($a, $b, $c, $nota, $dias) { $this->db->query("DELETE FROM opermv WHERE documento='{$a}' && tipodoc='{$b}' && cantidad=0"); $this->db->query("UPDATE operti set diasindex='{$dias}' WHERE documento='{$a}'"); if ($c == "FAC") { $tipdoc = "FAC"; } elseif ($c == "NOT") { $tipdoc = "NOT"; } elseif ($c == "NOT2") { $tipdoc = "NOT"; $this->db->query("UPDATE opermv SET preciofin=preciounit,timpueprc=0 WHERE documento='{$a}'"); $this->db->query("UPDATE operti SET totimpuest=0,baseimpo1=0,sinimpuest=totneto,totalfinal=totneto WHERE documento='{$a}'"); } elseif ($c == "NOT3") { $tipdoc = "NOT"; $this->db->query("UPDATE opermv SET preciooriginal=0,preciounit=0,preciofin=0,timpueprc=0 WHERE documento='{$a}'"); $this->db->query("UPDATE operti SET totimpuest=0,baseimpo1=0,sinimpuest=0,totalfinal=0,totneto=0,totbruto=0 WHERE documento='{$a}'"); } $this->ajustetotales($a, "ESP"); $i = 0; $db = $this->db->query("SELECT a.almacen,a.codigo,a.lote,a.cantidad FROM opermv a WHERE a.documento='{$a}';"); $db4 = $this->db->query("SELECT ROUND(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=CURDATE() ORDER BY fecha DESC LIMIT 1),4) totald,a.notas FROM operti a WHERE a.documento='{$a}';")->row(); $this->db->query("UPDATE operti SET totald='{$db4->totald}' WHERE documento='{$a}'"); $notas = $nota . " " . $db4->notas; foreach ($db->result() as $dt) { $this->db->query("UPDATE artilotes SET consumido=consumido+{$dt->cantidad} WHERE almacen='{$dt->almacen}' && codigoart='{$dt->codigo}' && lote='{$dt->lote}'"); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo SET existencia=existencia-{$dt->cantidad},comprometido=comprometido-{$dt->cantidad} WHERE codigo='{$dt->codigo}'"); if ($this->db->affected_rows() > 0) { $i++; } } } if ($db->num_rows() > 0) { if ($db->num_rows() == $i) { $num = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='{$tipdoc}'")->row(); $newdoc = str_pad($num->n, 8, "0", STR_PAD_LEFT); $data4 = array("documento" => $newdoc, "tipodoc" => $tipdoc, "antdoc" => $a, "orden" => $b, "notas" => $notas, "emision" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "recepcion" => date("Y-m-d"), "fechayhora" => date("Y-m-d H:i:s"), "uemisor" => $this->session->userdata("cod")); $this->db->where("documento", $a)->update("operti", $data4); $data5 = array("documento" => $newdoc, "tipodoc" => $tipdoc, "fechadoc" => date("Y-m-d")); $this->db->where("documento", $a)->update("opermv", $data5); $this->loguser("Facturar", "El usuario ha facturado el documento " . $a . " con " . $i . " productos. Nuevo documento: " . $newdoc . ''); return $data = array("row" => 1, "doc" => $newdoc, "tipodoc" => $tipdoc); } } else { return 0; } } function ajustetotales($a, $b) { $this->promoprov($a, $b); $this->promofac($a, $b); $this->db->query("UPDATE opermv SET dsctoprc=(IF(dsctounit>0,preciooriginal*(dsctounit/100),0)),preciounit=preciooriginal-dsctoprc,
dsctoprc2=(IF(dsctounit2>0,preciounit*(dsctounit2/100),0)), preciounit=preciounit-dsctoprc2, dsctoendm2=IF(dsctoendp2>0,(preciounit*(dsctoendp2/100)),0),preciounit=preciounit-dsctoendm2,
dsctoendm3=IF(dsctoendp3>0,(preciounit*(dsctoendp3/100)),0),preciounit=preciounit-dsctoendm3,dsctoendm=IF(dsctoendp>0,(preciounit*(dsctoendp/100)),0),preciounit=preciounit-dsctoendm,\xa preciofin=preciounit*(1+(timpueprc/100)) WHERE documento='{$a}' && tipodoc='{$b}'"); $this->db->query("UPDATE opermv SET montoneto=(preciounit*cantidad),\xa montototal=(preciofin*cantidad) WHERE documento='{$a}' && tipodoc='{$b}'"); $this->db->query("UPDATE operti a SET a.totcosto=(SELECT SUM(b.costounit) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),
a.totbruto=(SELECT SUM(b.montoneto) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),
a.totneto=(SELECT SUM(b.montoneto) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),\xa a.totimpuest=(SELECT SUM(IF(b.timpueprc>0,(b.preciounit*(b.timpueprc/100))*b.cantidad,0)) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),\xa a.totdescuen=(SELECT SUM(b.dsctoprc*b.cantidad) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),
a.totdescuen2=(SELECT SUM(b.dsctoprc2*b.cantidad) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),\xa a.totalfinal=(SELECT SUM(b.montototal) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),
a.baseimpo1=(SELECT SUM(if(b.timpueprc>0,b.montoneto,0)) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),
a.sinimpuest=(SELECT SUM(if(b.timpueprc=0,b.montoneto,0)) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc), \xa a.dsctolinea=(SELECT SUM(b.dsctoendm*b.cantidad) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),\xa a.dsctolinea2=(SELECT SUM(b.dsctoendm2*b.cantidad) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc),
a.dsctolinea3=(SELECT SUM(b.dsctoendm3*b.cantidad) FROM opermv b WHERE b.documento=a.documento && b.tipodoc=a.tipodoc) WHERE a.documento='{$a}' && a.tipodoc='{$b}'"); } function ajustetotalesnc($a, $b) { $db = $this->db->query("SELECT referencia FROM operti WHERE documento='{$a}' && tipodoc='{$b}'")->row(); if (intval($db->referencia) < "52057") { $this->db->query("UPDATE opermv SET preciofin=preciounit+(preciounit*(timpueprc/100)) WHERE documento='{$a}' && tipodoc='{$b}'"); $this->db->query("UPDATE opermv SET montototal=preciofin*cntdevuelt WHERE documento='{$a}' && tipodoc='{$b}'"); $this->db->query("UPDATE operti set totalfinal=totalfinal+totimpuest WHERE referencia='{$db->referencia}' && tipodoc='N/C' && totalfinal=totneto && totimpuest>0"); $this->db->query("UPDATE devolti set totalfinal=totalfinal+totimpuest WHERE referencia='{$db->referencia}' && tipodoc='DEV' && totalfinal=totneto && totimpuest>0"); } } function promoprov($a, $b) { $bd = $this->db->query("SELECT c.codigo, \xa IF(SUM(a.cantidad)>=c.vol && SUM(a.cantidad)<c.vol2,c.descu,IF(SUM(a.cantidad)>=c.vol2 && SUM(a.cantidad)<c.vol3,c.descu2,
IF(SUM(a.cantidad)>=c.vol3 && SUM(a.cantidad)<c.vol4,c.descu3,IF(SUM(a.cantidad)>=c.vol4 && SUM(a.cantidad)<c.vol5,c.descu4,IF(SUM(a.cantidad)>=c.vol5,c.descu5,0))))) descu
FROM opermv a \xa JOIN artiprov b ON a.codigo=b.codigo
JOIN proveed c ON b.proveedor=c.codigo \xa WHERE a.documento='{$a}' && a.tipodoc='{$b}' GROUP BY c.codigo HAVING descu>0;\xa \xa \xa ")->result(); foreach ($bd as $db) { $this->db->query("UPDATE opermv a1 JOIN artiprov b1 ON (a1.codigo=b1.codigo && b1.marca=1) SET a1.dsctoendp2='{$db->descu}' WHERE a1.documento='{$a}' && a1.tipodoc='{$b}' && b1.proveedor='{$db->codigo}';"); } } function promofac($a, $b) { $cli = $this->db->query("SELECT codcliente FROM operti WHERE documento='{$a}' && tipodoc='{$b}'")->row()->codcliente; $promo = $this->db->query("SELECT descu,COUNT(*) item FROM promos WHERE fdesde<=NOW() && NOW()<=fhasta && cli='{$cli}' LIMIT 1")->row(); if ($promo->item > 0) { $this->db->query("UPDATE opermv SET dsctoendp3='{$promo->descu}' WHERE documento='{$a}' && tipodoc='{$b}'"); } } function elimfac($a) { $bd = $this->db->query("SELECT codigo,cantidad FROM opermv WHERe documento='{$a}'")->result(); $i = 0; foreach ($bd as $db) { $art = $this->db->query("SELECT comprometido FROM articulo WHERE codigo='{$db->codigo}'")->row(); $comp = $art->comprometido - $db->cantidad; $this->db->query("UPDATE articulo set comprometido='{$comp}' WHERE codigo='{$db->codigo}'"); if ($this->db->affected_rows() > 0) { $i++; } } if ($i > 0) { $this->db->where("documento", $a)->delete("operti"); $this->db->where("doc", $a)->delete("control_operti"); $this->db->where("documento", $a)->delete("opermv"); $this->loguser("Eliminar", "El usuario elimina el pedido " . $a . "."); return $this->db->affected_rows(); } } function ajustelotes() { $lot = $this->db->query("SELECT almacen,codigoart,nombre,lote,cargo+cargo2 cargo,descargo+descargo2 descargo,ingreso,egreso,devuelta, IF((cargo+cargo2-descargo-descargo2+ingreso-egreso+devuelta)>0,(cargo+cargo2-descargo-descargo2+ingreso-egreso+devuelta),0) existen,existart,consumido FROM (\xa SELECT a.almacen,a.codigoart,b.nombre,a.lote,
IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>'2023-12-29'),0) cargo,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>'2023-12-29'),0) cargo2,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>'2023-12-29'),0) descargo,
IF((SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>'2023-12-29'),0) descargo2,\xa IF((SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.status='1')>0,(SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.status='1'),0) ingreso,\xa ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29'),0),0) egreso,\xa ROUND(IF((SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29')>0,(SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29'),0),0) devuelta,\xa a.cantidad-a.consumido existart, a.consumido\xa FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo GROUP BY a.almacen,a.codigoart,a.lote) kardex having existen!=existart")->result(); $i = 0; foreach ($lot as $dlot) { if ($dlot->existen > $dlot->existart) { $cant = $dlot->existen - $dlot->existart; $this->db->query("UPDATE artilotes SET cantidad=cantidad+{$cant} WHERE almacen='{$dlot->almacen}' && codigoart='{$dlot->codigoart}' && lote='{$dlot->lote}'"); if ($this->db->affected_rows() > 0) { $i++; } } elseif ($dlot->existart > $dlot->existen) { $cant = $dlot->existart - $dlot->existen; $this->db->query("UPDATE artilotes SET consumido=consumido+{$cant} WHERE almacen='{$dlot->almacen}' && codigoart='{$dlot->codigoart}' && lote='{$dlot->lote}'"); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } function ajustearti() { $this->ajustelotes(); $this->db->query("UPDATE artilotes a SET consumido=cantidad WHERE consumido>cantidad;"); $this->db->query("UPDATE articulo SET comprometido=0 WHERE comprometido>0 && codigo NOT IN (SELECT codigo FROM opermv WHERE tipodoc='ESP');"); $this->db->query("UPDATE articulo SET comprometido=0 WHERE comprometido<0;"); $this->db->query("DELETE FROM artiprov WHERE codigo NOT IN (SELECT codigo FROM articulo)"); $this->db->query("DELETE FROM artilotes WHERE codigoart NOT IN (SELECT codigo FROM articulo)"); $art = $this->db->query("SELECT a.codigo,IF((SUM(b.cantidad)-SUM(b.consumido))>0,SUM(b.cantidad)-SUM(b.consumido),0) disp
FROM articulo a JOIN artilotes b ON a.codigo=b.codigoart GROUP BY a.codigo")->result(); $i = 0; foreach ($art as $dart) { $this->db->query("UPDATE articulo SET existencia='{$dart->disp}' WHERE codigo='{$dart->codigo}'"); if ($this->db->affected_rows() > 0) { $i++; } } return $i; } function ajusteordc() { $val = $this->db->query("SELECT b.codigo,b.lote,b.elab,b.vence,b.cant,a.almacen,a.proveed FROM ordc a JOIN itordc b ON a.id=b.ordc WHERE a.`status`='1' && b.`status`='1' && b.lote NOT IN (SELECT lote FROM artilotes WHERE codigoart=b.codigo)"); if ($val->num_rows() > 0) { $i = 0; foreach ($val->result() as $dval) { $i++; $this->ajusteordcinv($dval->codigo, $dval->lote, $dval->elab, $dval->vence, $dval->cant, $dval->costo, $dval->almacen, $dval->proveed); } } if ($i <= 0) { $val2 = $this->db->query("SELECT a.codigo,a.lote,a.elab,a.vence,a.cant,a.costo,b.almacen,b.proveed FROM itordc a JOIN ordc b ON a.ordc=b.id
WHERE a.`status`=1 && b.`status`='1' && a.codigo NOT IN (SELECT codigoart FROM artilotes WHERE codigo=a.codigo && lote=a.lote && recepcion>=b.frecep)"); if ($val2->num_rows() > 0) { foreach ($val2->result() as $dval) { $i++; $this->ajusteordcinv($dval->codigo, $dval->lote, $dval->elab, $dval->vence, $dval->cant, $dval->costo, $dval->almacen, $dval->proveed); } } } return $i; } public function clientesexcel($a) { $trab = $this->session->userdata("cod"); $bdcli = $this->db->query("SELECT DISTINCT a.codigo, a.nombre,a.sucursal, b.nombre nombrev FROM cliempre a JOIN listvend b ON a.vendedor=b.codigo WHERE a.status='1'")->result(); $html = "<input type="text" class="w3-input" id="idcli" onchange="credicli();" list="listcli" placeholder="Codigo de cliente" value="" . $a . "" />\xa <datalist id="listcli">"; foreach ($bdcli as $dtcli) { $html .= "<option value="" . $dtcli->codigo . "">Sucursal: " . $dtcli->sucursal . " " . $dtcli->nombre . " " . $dtcli->nombrev . "</option>"; } $html .= "</datalist>"; return $html; } public function clientespromos($a) { $trab = $this->session->userdata("cod"); $bdcli = $this->db->query("SELECT DISTINCT a.codigo, a.nombre,a.sucursal, b.nombre nombrev FROM cliempre a JOIN listvend b ON a.vendedor=b.codigo WHERE a.status='1'")->result(); $html = "<input type="text" class="w3-input" id="idcli" list="listcli" placeholder="Codigo de cliente" value="" . $a . "" />\xa <datalist id="listcli">"; foreach ($bdcli as $dtcli) { $html .= "<option value="" . $dtcli->codigo . "">Sucursal: " . $dtcli->sucursal . " " . $dtcli->nombre . " " . $dtcli->nombrev . "</option>"; } $html .= "</datalist>"; return $html; } function clidescu($cli) { return $this->db->query("SELECT ROUND(descuento) n FROM cliempre WHERE codigo='{$cli}'")->row()->n; } public function clientes($a) { $trab = $this->session->userdata("cod"); $bdcli = $this->db->query("SELECT DISTINCT a.codigo, a.nombre,a.sucursal, b.nombre nombrev FROM cliempre a JOIN listvend b ON a.vendedor=b.codigo WHERE a.status='1'")->result(); $html = "<input type="text" class="w3-input" id="idcli" onchange="pedidos();credicli();" list="listcli" placeholder="Codigo de cliente" value="" . $a . "" />\xa <datalist id="listcli">"; foreach ($bdcli as $dtcli) { $html .= "<option value="" . $dtcli->codigo . ""> Sucursal: " . $dtcli->sucursal . " " . $dtcli->nombre . " " . $dtcli->nombrev . "</option>"; } $html .= "</datalist>"; return $html; } function credicli($cli) { $bd = $this->db->query("SELECT a.documento,b.doc,a.codcliente,a.nombrecli,a.telefonos, \xa ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2) dolar,
ROUND((SELECT IF(SUM(b1.montod)>0, SUM(b1.montod),0) dolar FROM operti a1 JOIN opercli b1 ON a1.documento=b1.idfac WHERE a1.codcliente=a.codcliente && b1.idconsbanc IS NOT NULL && (a1.tipodoc='FAC' || a1.tipodoc='NOT')),2) pdolar,
ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2)-ROUND((SELECT IF(SUM(b1.montod)>0, SUM(b1.montod),0) dolar FROM operti a1 JOIN opercli b1 ON a1.documento=b1.idfac WHERE a1.codcliente=a.codcliente && b1.idconsbanc IS NOT NULL && (a1.tipodoc='FAC' || a1.tipodoc='NOT')),2) debe,\xa (SELECT a1.monto FROM prueba.credicli a1 WHERE a1.cliente=a.codcliente LIMIT 1) credito\xa FROM operti a
JOIN control_operti b ON a.antdoc=b.doc\xa JOIN cliempre c ON a.codcliente=c.codigo
WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.codcliente='{$cli}'
GROUP BY a.codcliente ORDER BY dolar DESC")->row(); $html = ''; $credito = $bd->credito - $bd->debe; $html .= "<table class="w3-table-all w3-hoverable w3-center">
<tr class="w3-fondodroid"><th>Total</th><th>Pagado</th><th>Debe</th><th>Credito</th></tr>\xa <tr><td>" . ROUND($bd->dolar, 2) . "</td><td>" . ROUND($bd->pdolar, 2) . "</td><td>" . ROUND($bd->debe, 2) . "</td><td>" . ROUND($credito, 2) . "</td></tr>\xa </table>"; return $html; } public function viewmodlote($a) { $bd = $this->db->query("SELECT c.lote,(c.cantidad-c.consumido) disp, c.vence,c.almacen FROM artilotes AS c WHERE c.codigoart='{$a}' && c.cantidad!=c.consumido ORDER BY c.vence")->result_array(); $data = array("lote" => $bd); return $data; } public function modlote($a, $b, $c, $d, $e) { $lote = $this->db->query("SELECT almacen,lote,COUNT(*) item FROM artilotes WHERE codigoart='{$b}' && CONCAT(almacen,lote)='{$d}' && (cantidad-consumido)>={$e} && almacen NOT IN (01,05,06)")->row(); if ($lote->item > 0) { $newcant = $c - $e; $dt = array("cantidad" => $newcant); $this->db->where("documento='{$a}' && codigo='{$b}' && cantidad='{$c}' LIMIT 1")->update("opermv", $dt); if ($this->db->affected_rows() > 0) { $bd2 = $this->db->query("SELECT a.id_empresa, a.agencia, a.tipodoc, a.documento, a.grupo, a.subgrupo, a.origen, a.codigo, a.codhijo, a.pid, a.nombre, a.costounit, a.preciounit, a.diferencia, a.dsctounit, a.coddescuento, \xa a.dsctoprc, a.dsctoendm, a.dsctomtolinea, a.dsctoendp, a.preciofin, a.prcrecargo, a.recargounit, a.preciooriginal, a.cantidad, a.cntdevuelt, a.unidevuelt, a.cntentrega, a.tallas, a.colores, a.montoneto, a.montototal, \xa a.almacen, a.proveedor, a.fechadoc, a.impuesto1, a.impuesto2, a.impuesto3, a.impuesto4, a.impuesto5, a.impuesto6, a.timpueprc, a.impu_mto, a.comision, a.comisprc, a.vendedor, a.emisor, a.usaserial, a.tipoprecio,
a.unidad, a.agrupado, a.cntagrupada, a.seimporto, a.desdeimpor, a.notas, a.oferta, a.compuesto, a.usaexist, a.marca, a.aux1, a.estacion, a.estacionfac, a.clasifica, a.cuentacont, a.placa, a.placaod, a.udinamica, a.cantref, \xa a.unidadref, a.baseimpo1, a.baseimpo2, a.baseimpo3, a.lote, a.imp_nacional, a.imp_producc, a.se_imprimio, a.ofertaconvenio, a.cod_servidor, a.prc_comi_servidor, a.mto_comi_servidor, a.checkin, a.habi_nro, a.idvalidacion, a.idoferta, \xa a.agenciant, a.tipodocant, a.documant, a.uemisorant, a.estacioant, a.fechadocant, a.fechayhora, a.frog, a.documentolocal, a.linbloq, a.enviado_kmonitor, a.se_guardo, a.baseimpo4, a.baseimpo5, a.baseimpo6, a.status, a.lote
FROM opermv as a WHERE documento='{$a}' && codigo='{$b}' && cantidad='{$newcant}'")->row_array(); $this->db->insert("opermv", $bd2); if ($this->db->affected_rows() > 0) { $dt2 = array("cantidad" => $e, "lote" => $lote->lote, "almacen" => $lote->almacen); $this->db->where("documento='{$a}' && codigo='{$b}' && cantidad='{$newcant}' LIMIT 1")->update("opermv", $dt2); if ($this->db->affected_rows() > 0) { $this->loguser("Cambio Lote", "El usuario modico el lote a " . $d . " para el documento " . $a . ''); return 1; } } } } } public function almped() { $this->load->library("table"); $bdfac = $this->db->query("SELECT a.documento,c.doc, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor, ROUND(SUM(b.cantidad),2) unidades,c.timeaut,c.timeasig,c.timeemp, c.status
FROM operti AS a
JOIN opermv AS b ON a.documento=b.documento
JOIN control_operti AS c ON a.antdoc=c.doc\xa WHERE a.fechacrea>=DATE_ADD(CURDATE(),INTERVAL -10 DAY) && (c.status='1' || c.status='4' || c.status='5' || c.status='97' || c.status='6')
GROUP BY a.documento;")->result(); $tunid = $this->db->query("SELECT ROUND(SUM(b.cantidad),2) n\xa FROM operti AS a \xa JOIN opermv AS b ON a.documento=b.documento
JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.fechacrea>=DATE_ADD(CURDATE(),INTERVAL -10 DAY) && (c.status='1' || c.status='4' || c.status='5');")->row(); $bdtrab = $this->db->query("SELECT d.id, d.nomape FROM trab AS d WHERE d.tip='3'")->result(); $trab = "<option value="" selected disabled>Seleccione</option>"; foreach ($bdtrab as $dttrab) { $trab .= "<option value="" . $dttrab->id . "">" . $dttrab->nomape . "</option>"; } $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr class="w3-fondodroid"><th>Estatus</th><th>Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></th><th>Asignaci\xc3\xb3n</th><th></th><th></th></tr>\xa <tr><td><select class="w3-select" id="vstatus" onchange="w3.filterHTML('#id01', '.item', this.value)">
<option value="" selected disabled>Seleccione</option>
<option value="Pendiente">Pendiente</option>\xa <option value="Procesando...">Procesando...</option>\xa </select></td><td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" oninput="w3.filterHTML('#id01', '.item', this.value)"></td>
<td><select class="w3-select" id="id_trab">" . $trab . "</select></td>\xa <td class="w3-center w3-btn"><a onclick="asignaped()"><img src="" . base_url() . "images/bn.png" alt="Asignar" title="Asignar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="almped();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>N</th><th>Doc</th><th>Codigo</th><th>Nombre</th><th>Sector</th><th>Vendedor</th><th>Empacador</th><th>Unidades</th><th>F.Autoriza</th><th>F.Asigna</th><th>F.Emp</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $nom = $this->db->query("SELECT IF(a.nomape!='',a.nomape,'n/a') nomape, b.scan FROM trab as a JOIN control_operti as b ON a.id=b.trabempaq WHERE (b.doc='{$dtfac->documento}' || b.doc='{$dtfac->doc}' )")->row(); $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtfac->documento}' LIMIT 1")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itfac($('#a" . $i . "').val());">"; if ($dtfac->status == 4) { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtfac->status == 1) { $status = "Armando..."; $color = "w3-pale-yellow"; } elseif ($dtfac->status == 5 || $dtfac->status == 97) { $status = "Verificando"; $color = "w3-pale-blue"; } elseif ($dtfac->status == 6) { $status = "Empacando"; $color = "w3-pale-green"; } elseif ($dtfac->status == 2) { $status = "Listo"; $color = "w3-green"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" name="status" value="" . $dtfac->status . "">
<td>" . $i . "</td><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->documento . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td><td>" . $dtfac->sector . "</td><td>" . $vend->nombre . "</td><td>" . $nom->nomape . "</td><td>" . $dtfac->unidades . "</td><td>" . $dtfac->timeaut . "</td><td>" . $dtfac->timeasig . "</td><td>" . $dtfac->timeemp . "</td><td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="12"><label class="w3-large"><b>Total Unidades: " . $tunid->n . "</b></label></td></tr></table>"; return $html; } public function itfac($a) { $this->load->library("table"); $bditfac = $this->db->query("SELECT c.codigo, c.nombre, ROUND(c.cantidad,2) cantidad, c.status,c.lote FROM opermv AS c WHERE c.documento='{$a}';")->result(); $nom = $this->db->query("SELECT a.nomape, b.scan FROM trab as a JOIN control_operti as b ON a.id=b.trabempaq WHERE b.doc='{$a}'")->row(); if ($nom->scan == 0) { $scan = "Normal"; } else { $scan = "Rapido"; } $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr>\xa <td class="w3-fondodroid">Asignado:</td>
<td>" . $nom->nomape . "</td>
<td class="w3-fondodroid">Modo Scanner:</td>
<td ondblclick="modscan('" . $a . "')" id="selectscan">" . $scan . "</td></tr>
</table><br>\xa <table class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Nombre</th><th>Cantidad</th><th>Lote</th><th>Estatus</th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtitfac->status == 1) { $status = "Listo"; $color = "w3-green"; } $html .= "<tr><input type="hidden" id="doc" value="" . $a . ""><input type="hidden" id="codmed" . $i . "" value="" . $dtitfac->codigo . ""><input type="hidden" id="cant" . $i . "" value="" . $dtitfac->cantidad . "">
<td>" . $dtitfac->codigo . "</td><td>" . $dtitfac->nombre . "</td><td>" . $dtitfac->cantidad . "</td><td>" . $dtitfac->lote . "</td><td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "</table>"; return $html; } public function editscan($a, $b) { $dt = array("scan" => $b); $this->db->where("doc", $a)->update("control_operti", $dt); if ($this->db->affected_rows() > 0) { $this->loguser("Empaquetado", "El usuario cambio el modo de SCAN para el documento " . $a . "."); } return $this->db->affected_rows(); } public function asignaped($a, $b) { $datos = array("status" => "1", "trabempaq" => $b, "timeasig" => date("Y-m-d H:i:s")); $this->db->where("doc", $a)->UPDATE("control_operti", $datos); if ($this->db->affected_rows() > 0) { $this->loguser("Empaquetado", "El usuario asigno al trabajador " . $b . " para el documento " . $a . "."); } return $this->db->affected_rows(); } public function elim_almped($a, $b, $c, $d) { $val = $this->db->query("SELECT NULL FROM opermv WHERE documento='{$a}'")->num_rows(); if ($val > 1) { $this->db->query("DELETE FROM opermv WHERE documento='{$a}' && codigo='{$b}' && almacen='{$d}' && cantidad='{$c}' LIMIT 1"); $this->db->query("UPDATE articulo set comprometido=comprometido-{$c} WHERE codigo='{$b}'"); if ($this->db->affected_rows() > 0) { $this->loguser("Eliminar", "El usuario elimino el producto " . $b . " con la cantidad " . $c . ", para el documento " . $a . "."); } } return $this->db->affected_rows(); } public function modcantalmped($a, $b, $c, $d) { $this->db->query("UPDATE opermv SET cantidad='{$d}', aux1='{$d}' WHERE documento='{$a}' && codigo='{$b}' && cantidad='{$c}'"); if ($d > $c) { $r = $d - $c; $this->db->query("UPDATE articulo set comprometido=comprometido+{$r} WHERE codigo='{$b}'"); } else { $r = $c - $d; $this->db->query("UPDATE articulo set comprometido=comprometido-{$r} WHERE codigo='{$b}'"); } if ($this->db->affected_rows() > 0) { $this->loguser("Modificar Cantidad", "El usuario cambio la cantidad del producto " . $b . ", de " . $c . " a " . $d . ", para el documento " . $a . "."); } return $this->db->affected_rows(); } public function modprcalmped($a, $b, $c, $d) { $db = $this->db->query("SELECT (impuesto1/100)+1 iva,(dscto_medicamentos/100) descu FROM articulo WHERE codigo='{$b}'")->row(); $preciofin = ($d - $d * $db->descu) * $db->iva; $this->db->query("UPDATE opermv SET preciooriginal='{$d}' WHERE documento='{$a}' && codigo='{$b}' && cantidad='{$c}'"); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE artiprec SET precio1='{$d}',preciofin1='{$preciofin}' WHERE codigo='{$b}' && fecha=curdate()"); $this->loguser("Modificar Precio", "El usuario cambio el precio del producto " . $b . " por " . $d . ", para el documento " . $a . "."); } return $this->db->affected_rows(); } public function almetiq() { $bd = $this->db->query("SELECT c.codigo, c.subcodigo,c.subsector zona, COUNT(e.id) bultos
FROM subsectores AS c JOIN operti AS d ON (c.codigo=TRIM(d.sector) && c.subcodigo=TRIM(d.subcodigo)) \xa JOIN control_operti AS f ON d.antdoc=f.doc\xa JOIN bultos AS e ON f.doc=e.doc
WHERE (d.tipodoc='FAC' || d.tipodoc='NOT') && f.status='2' && (f.reparto IS NULL || f.reparto=0) && SUBSTR(d.codcliente,1,3)!='INT' && d.fechacrea>=DATE_SUB(curdate(),INTERVAL 10 DAY) GROUP BY c.codigo,c.subcodigo;")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <td class="w3-center w3-btn"><a onclick="etiquetar()"><img src="" . base_url() . "images/imp.png" alt="Asignar" title="Asignar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="almetiq();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Subcodigo</th><th>Zona</th><th>Bultos</th></tr>"; $i = 0; foreach ($bd as $dt) { $i++; $html .= "<tr class="item" onclick="itetiq($('#a" . $i . "').val());">"; if ($dt->bultos < 10) { $color = "w3-red"; } elseif ($dt->bultos < 20) { $color = "w3-pale-yellow"; } elseif ($dt->bultos > 20) { $color = "W3-green"; } $html .= "<input type="hidden" id="a" . $i . "" name="cod" value="" . $dt->codigo . $dt->subcodigo . "">\xa <td>" . $dt->codigo . "</td><td>" . $dt->subcodigo . "</td><td>" . $dt->zona . "</td><td class="" . $color . "">" . $dt->bultos . "</td>\xa </tr>"; } $html .= "</table>\xa
"; return $html; } public function itetiq($a) { $bdetiq = $this->db->query("SELECT a.documento,a.fechacrea, a.nombrecli, a.codcliente ,CONCAT(c.id,c.doc,c.num) \xa bulto FROM operti AS a \xa JOIN control_operti AS b ON a.antdoc=b.doc\xa JOIN bultos AS c ON b.doc=c.doc
WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && b.status='2' && SUBSTR(a.codcliente,1,3)!='INT' && CONCAT(TRIM(a.sector),TRIM(a.subcodigo))='{$a}';")->result(); $html = "<a onclick="noetiq('" . $a . "');" class="w3-btn"><img src="" . base_url() . "images/descarte.png" alt="No Etiquetar" title="No Etiquetar" style="width:20px;height:20px;border:0;"></a>\xa <br><input oninput="w3.filterHTML('#id01', '.item1', this.value)" class="w3-input" placeholder="Buscar Factura"><br><table class="w3-table-all w3-hoverable w3-left-align w3-tiny" id="id01"><tr class="w3-fondodroid"><th><input type="checkbox" name="optcheck" class="w3-check" onclick="selectodo('check');">Doc</th><th>Fecha</th><th>Nombre</th><th>Codigo</th><th>Vendedor</th><th>Bultos</th></tr>"; $i = 0; foreach ($bdetiq as $dtetiq) { $i++; $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtetiq->documento}' LIMIT 1")->row(); $html .= "<tr class="item1" id="slect2" . $i . "" name="selec"><input type="hidden" name="doc" value="" . $dtetiq->bulto . ""><input type="hidden" name="doc2" value="" . $dtetiq->documento . "">
<td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtetiq->documento . "</td><td>" . $dtetiq->fechacrea . "</td><td>" . $dtetiq->nombrecli . "</td><td>" . $dtetiq->codcliente . "</td><td>" . $vend->nombre . "</td><td>" . $dtetiq->bulto . "</td></tr>"; } $html .= "</table>"; return $html; } function noetiq($a) { $doc = $this->db->query("SELECT antdoc n FROM operti WHERe documento='{$a}' && (tipodoc='FAC' || tipodoc='NOT')")->row(); if ($doc->n != '') { $this->db->query("UPDATE control_operti set status=3,reparto=1 WHERE doc='{$doc->n}'"); } return $this->db->affected_rows(); } public function etiquetas($a, $b) { $table1 = ''; $table2 = ''; $html = ''; $j = 0; for ($i = 0; $i <= $b; $i++) { $j++; if ($a[$i] != '') { $bdetiq = $this->db->query("SELECT a.documento,a.sector, a.antdoc, a.nombrecli, a.codcliente ,CONCAT(b.id,b.doc,b.num) bulto, c.id FROM operti AS a \xa JOIN bultos AS b ON a.antdoc=b.doc \xa JOIN control_operti AS c ON a.antdoc=c.doc
WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && CONCAT(b.id,b.doc,b.num)='{$a[$i]}' "); $rows = $b / 2; foreach ($bdetiq->result() as $dtetiq) { $sector = $this->db->query("SELECT zona FROM sectores WHERE codigo='{$dtetiq->sector}'")->row(); $barra = $this->genebarra($dtetiq->bulto, 1, 20); if ($j <= $rows) { $table1 .= "<table class="w3-table-all w3-centered" style="margin-top:1%;border-style:none;"><tr><td>Sector: " . $dtetiq->sector . " " . $sector->zona . " Documento: " . $dtetiq->documento . " Cliente: " . $dtetiq->nombrecli . "</td></tr><tr><td><div style="margin-left:35%">" . $barra . "</div></td></tr></table>"; } else { $table2 .= "<table class="w3-table-all w3-centered" style="margin-top:1%;border-style:none;"><tr><td>Sector: " . $dtetiq->sector . " " . $sector->zona . " Documento: " . $dtetiq->documento . " Cliente: " . $dtetiq->nombrecli . "</td></tr><tr><td><div style="margin-left:35%">" . $barra . "</div></td></tr></table>"; } if ($table1 != '' || $table2 != '') { $this->db->query("UPDATE control_operti SET status='3' WHERE id='{$dtetiq->id}'"); if ($this->db->affected_rows() > 0) { $this->loguser("Etiquetar", "El usuario creo la etiqueta del bulto " . $a[$i] . " para el documento " . $dtetiq->documento . ''); } } } } } $style = "\xa <html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="assets/css/w3.css"></head><body>"; $html .= "
" . $style . "\xa <div class="w3-half" style="width:50%">" . $table1 . "</div>\xa <div class="w3-half" style="width:50%;margin-left:2.5%">" . $table2 . "</div>\xa </body>\xa </html>\xa "; return $html; } public function almcarg() { $bd = $this->db->query("SELECT c.codigo,c.subcodigo, c.subsector zona, COUNT(e.id) bultos\xa FROM subsectores AS c JOIN operti AS d ON (c.codigo=TRIM(d.sector) && c.subcodigo=TRIM(d.subcodigo))
JOIN bultos AS e ON e.doc=d.antdoc\xa JOIN control_operti AS f ON d.antdoc=f.doc
WHERE (d.tipodoc='FAC' || d.tipodoc='NOT') && f.status='3' && (f.reparto='0' || f.reparto IS NULL) && SUBSTR(d.codcliente,1,3)!='INT' && d.fechacrea>=DATE_SUB(curdate(),INTERVAL 10 DAY) GROUP BY c.codigo,c.subcodigo;")->result(); $bdchofer = $this->db->query("SELECT a.id, a.nomape FROM trab AS a WHERE a.tip=1")->result(); $chofer = "<option value="" selected disabled>Seleccione</option>"; foreach ($bdchofer as $dtchofer) { $chofer .= "<option value="" . $dtchofer->id . "">" . $dtchofer->nomape . "</option>"; } $bdvehi = $this->db->query("SELECT id, descrip FROM vehic WHERe status='S'")->result(); $vehi = "<option value="" selected disabled>Seleccione</option>"; foreach ($bdvehi as $dtvehi) { $vehi .= "<option value="" . $dtvehi->id . "">" . $dtvehi->descrip . "</option>"; } $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr class="w3-fondodroid"><th>Chofer 1</th><th>Chofer 2</th><th>Vehiculo</th><th></th><th></th></tr>
<tr><td><select class="w3-select" id="trabcarg1">" . $chofer . "</select></td>\xa <td><select class="w3-select" id="trabcarg2">" . $chofer . "</select></td>
<td><select class="w3-select" id="vehi">" . $vehi . "</select></td>
<td class="w3-center w3-btn"><a onclick="asignacarg()"><img src="" . base_url() . "images/bn.png" alt="Asignar" title="Asignar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="almcarg();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Sub.Codigo</th><th>Zona</th><th>Bultos</th></tr>"; $i = 0; foreach ($bd as $dt) { $i++; $html .= "<tr onclick="itcarg($('#a" . $i . "').val());">"; if ($dt->bultos < 10) { $color = "w3-red"; } elseif ($dt->bultos < 20) { $color = "w3-pale-yellow"; } elseif ($dt->bultos > 20) { $color = "W3-green"; } $html .= "<input type="hidden" id="a" . $i . "" name="cod" value="" . $dt->codigo . $dt->subcodigo . "">\xa <td>" . $dt->codigo . "</td><td>" . $dt->subcodigo . "</td><td>" . $dt->zona . "</td><td class="" . $color . "">" . $dt->bultos . "</td>
</tr>"; } $html .= "</table>
"; return $html; } public function itcarg($a) { $bdcarg = $this->db->query("SELECT b.doc, a.documento, a.nombrecli, a.codcliente, a.vendedor, COUNT(b.id)
bultos FROM operti AS a \xa JOIN bultos AS b ON a.antdoc=b.doc \xa JOIN control_operti as c ON a.antdoc=c.doc\xa WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && c.status='3' && CONCAT(TRIM(a.sector),TRIM(a.subcodigo))='{$a}' && (c.reparto=0 || c.reparto IS NULL) && SUBSTR(a.codcliente,1,3)!='INT' GROUP BY b.doc;")->result(); $html = "<br><input oninput="w3.filterHTML('#id01', '.item1', this.value)" class="w3-input" placeholder="Buscar Factura"><br><table class="w3-table-all w3-hoverable w3-left-align w3-tiny" id="id01"><tr class="w3-fondodroid"><th><input type="checkbox" name="optcheck" class="w3-check" onclick="selectodo('check');">Doc</th><th>Nombre</th><th>Codigo</th><th>Vendedor</th><th>Bultos</th></tr>"; $i = 0; foreach ($bdcarg as $dtcarg) { $i++; $vend = $this->db->query("SELECT nombre FROM listvend WHERE codigo='{$dtcarg->vendedor}'")->row(); $html .= "<tr class="item1" id="slect2" . $i . "" name="selec"><input type="hidden" id="a" . $i . "" name="doc" value="" . $dtcarg->doc . ""><input type="hidden" id="cod" value="" . $a . ""><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtcarg->documento . "</td><td>" . $dtcarg->nombrecli . "</td><td>" . $dtcarg->codcliente . "</td><td>" . $vend->nombre . "</td><td>" . $dtcarg->bultos . "</td></tr>"; } $html .= "</table>"; return $html; } public function asignacarg($a) { $rep = $this->db->query("SELECT max(id) as id FROM reparto")->row(); $this->db->query("UPDATE control_operti SET reparto='{$rep->id}' WHERE doc='{$a}'"); if ($this->db->affected_rows() > 0) { $this->loguser("Cargar", "El usuario creo el reparto " . $rep->id . " para el documento " . $a . ''); } return $this->db->affected_rows(); } public function almdesp() { $bd = $this->db->query("SELECT a.id, a.status, a.fech,a.ruta, COUNT(e.id) bultos, c.descrip as vehiculo, a.chofer1, a.chofer2, IF(a.cargado IS NULL,'N/A',a.cargado) cargado, IF(a.entregado IS NULL,'N/A',a.entregado) entregado FROM reparto AS a
JOIN control_operti AS d ON a.id=d.reparto
JOIN bultos AS e ON d.doc=e.doc\xa JOIN vehic AS c ON a.vehiculo=c.id
WHERE a.fech>=DATE_ADD(CURDATE(),INTERVAL -15 DAY) GROUP BY a.id")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr class="w3-fondodroid"><th>Estatus</th><th>Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></th><th>Factura</th><th></th><th></th><th></th></tr>\xa <tr><td><select class="w3-select" id="vstatus" onchange="w3.filterHTML('#id01', '.item', this.value)">
<option value="" selected disabled>Seleccione</option><option value="Pendiente">Pendiente</option><option value="Asignado">Asignado</option><option value="Cargado">Cargado</option><option value="En Camino">En Camino</option><option value="Entregado">Entregado</option></select></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" oninput="w3.filterHTML('#id01', '.item', this.value)"></td><td><input type="text" class="w3-input" placeholder="buscar factura" onchange="itdesp($('#searchfac').val(),'N/A','N/A');$('#searchfac').val('')" id="searchfac"></td>\xa <!--<td class="w3-center w3-btn"><a onclick="asignadesp()"><img src="" . base_url() . "images/bn.png" alt="Asignar" title="Asignar" style="width:20px;height:20px;border:0;"></a></td>-->
<td class="w3-center w3-btn"><a onclick="guia();"><img src="" . base_url() . "images/imp.png" alt="Guia" title="Guia" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="almdesp();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Id</th><th>Estauts</th><th>Fecha</th><th>Ruta</th><th>Bultos</th><th>Vehiculo</th><th>Cargado</th><th>Entregado</th></tr>"; $i = 0; foreach ($bd as $dt) { $i++; $trab1 = $this->db->query("SELECT a.nomape FROM trab AS a WHERE id='{$dt->chofer1}'")->row(); $trab2 = $this->db->query("SELECT a.nomape FROM trab AS a WHERE id='{$dt->chofer2}'")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itdesp($('#a" . $i . "').val(),$('#b" . $i . "').val(),$('#c" . $i . "').val());">"; if ($dt->cargado == "N/A") { $color = "w3-red"; } else { if ($dt->cargado != "N/A") { $color = "w3-green"; } } if ($dt->entregado == "N/A") { $color2 = "w3-red"; } else { if ($dt->entregado != "N/A") { $color2 = "w3-green"; } } if ($dt->status == "0") { $color3 = "w3-red"; $status = "Pendiente"; } elseif ($dt->status == "1") { $color3 = "w3-pale-yellow"; $status = "Cargado"; } elseif ($dt->status == "3") { $color3 = "w3-lime"; $status = "En Camino"; } elseif ($dt->status == "4") { $color3 = "w3-green"; $status = "Entregado"; } $html .= "<input type="hidden" id="a" . $i . "" name="id" value="" . $dt->id . ""><input type="hidden" id="b" . $i . "" name="trab1" value="" . $trab1->nomape . ""><input type="hidden" id="c" . $i . "" name="trab2" value="" . $trab2->nomape . "">
<td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dt->id . "</td><td class="" . $color3 . "">" . $status . "</td><td>" . $dt->fech . "</td><td>" . $dt->ruta . "</td><td>" . $dt->bultos . "</td><td id="newvehi" . $i . "" ondblclick="newvehi('" . $i . "');">" . $dt->vehiculo . "</td><td class="" . $color . "">" . $dt->cargado . "</td><td class="" . $color2 . "">" . $dt->entregado . "</td>
</tr>"; } $html .= "</table>
"; return $html; } public function itdesp($a, $b, $c) { $bddesp = $this->db->query("SELECT c.doc,a.documento, a.nombrecli, a.codcliente FROM operti AS a
JOIN control_operti as c ON a.antdoc=c.doc
WHERE a.tipodoc='FAC' && c.status='3' && (c.reparto='{$a}' || a.documento='{$a}') ORDER BY a.documento")->result(); $idrep = $this->db->query("SELECT a.id FROM reparto a JOIN control_operti b ON a.id=b.reparto JOIN operti c ON c.antdoc=b.doc WHERE c.documento='{$a}'"); if ($idrep->num_rows() > 0) { $didrep = $idrep->row(); $rep = $didrep->id; } else { $rep = $a; } $html = "<br><input oninput="w3.filterHTML('#id02', '.item2', this.value)" class="w3-input" placeholder="Buscar Factura"><br>\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Reparto</td><td>" . $rep . "</td><td class="w3-fondodroid">Chofer 1</td><td id="newchof1" ondblclick="newchof(1," . $a . ");">" . $b . "</td><td class="w3-fondodroid">Chofer 2</td><td id="newchof2" ondblclick="newchof(2," . $a . ");">" . $c . "</td><td class="w3-btn"><a onclick="bfacrep();"><img src="" . base_url() . "images/borrar.png" style="width:18px;height:18px;border:0px;"></a></td></tr>
</table><br>\xa <table class="w3-table-all w3-hoverable w3-left-align w3-tiny" id="id02"><tr class="w3-fondodroid"><th>Doc</th><th>Nombre</th><th>Codigo</th><th>Bultos</th><th>Cargado</th><th>Entregado</th></tr>"; $i = 0; foreach ($bddesp as $dtdesp) { $i++; $bd = $this->db->query("SELECT CONCAT(id,doc,num) bulto, IF(cargado IS NULL,'N/A',cargado) cargado, IF(entregado IS NULL,'N/A',entregado) entragado FROM bultos WHERE doc='{$dtdesp->doc}'")->result(); foreach ($bd as $dt) { if ($dt->cargado == "N/A") { $color = "w3-red"; } else { $color = "w3-green"; } if ($dt->entregado = "N/A") { $color2 = "w3-red"; } else { $color2 = "w3-green"; } $html .= "<input type="hidden" name="doc" value="" . $dtdesp->doc . ""><input type="hidden" id="rep" value="" . $rep . ""><tr class="item2" id="slect2" . $i . ""><td><input type="checkbox" onclick="w3.toggleClass('#slect2" . $i . "','w3-yellow');" class="w3-check" name="check2">" . $dtdesp->documento . "</td><td>" . $dtdesp->nombrecli . "</td><td>" . $dtdesp->codcliente . "</td><td>" . $dt->bulto . "</td><td class="" . $color . "">" . $dt->cargado . "</td><td class="" . $color2 . "">" . $dt->entregado . "</td></tr>"; } } $html .= "</table>"; return $html; } public function asignadesp($a) { $datos = array("status" => "1"); $n = $this->db->query("SELECT NULL FROM control_operti AS a JOIN bultos AS b ON a.doc=b.doc WHERE a.reparto='{$a}'")->num_rows(); $s = $this->db->query("SELECT NULL FROM control_operti AS a JOIN bultos AS b ON a.doc=b.doc WHERE a.reparto='{$a}' && b.cargado IS NOT NULL")->num_rows(); if ($n == $s) { $bd2 = $this->db->where("id", $a)->update("reparto", $datos); } return $bd2; } public function bfacrep($a) { $this->db->query("UPDATE control_operti SET reparto=null WHERE doc='{$a}'"); return $this->db->affected_rows(); } public function guia($a) { $bd = $this->db->query("SELECT a.documento,a.codcliente, a.nombrecli, a.direccion FROM operti as a JOIN control_operti as b ON a.antdoc=b.doc WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && b.status='3' && b.reparto='{$a}' GROUP BY a.nombrecli ORDER BY a.nombrecli asc;")->result(); $style = "<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="assets/css/w3.css"></head><body>"; $table = "<table class="w3-table-all w3-hoverable w3-centered" style="margin-left:2.5%"><tr><th>Reparto</th><th>Cliente</th><th>Unid</th><th>Detalles</th><th>Asesor</th><th>Fecha/Firma</th></tr>"; $tbultos = 0; foreach ($bd as $dt) { $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dt->documento}' LIMIT 1")->row(); $dunid = $this->db->query("SELECT SUM(b.cantidad) unid FROM operti AS a \xa JOIN opermv b ON a.documento=b.documento
JOIN control_operti as c ON a.antdoc=c.doc
WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && c.status='3' && c.reparto='{$a}' && a.codcliente='{$dt->codcliente}';")->row(); $dirr = $this->db->query("SELECT direcenvio, if(perscont!='',perscont,'N/A') contacto, if(telefonos!='',telefonos,if(telefono_movil!='',telefono_movil,'N/A')) telefono, if(campo4!='',campo4,'N/A') hor FROM cliempre WHERE codigo='{$dt->codcliente}'")->row(); $table .= "<tr>"; $bd2 = $this->db->query("SELECT a.documento,IF(b.refg='s','Si ','No ') refg, COUNT(b.id)
bultos FROM operti AS a
JOIN bultos AS b ON a.antdoc=b.doc \xa JOIN control_operti as c ON a.antdoc=c.doc\xa WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && c.status='3' && c.reparto='{$a}' && a.codcliente='{$dt->codcliente}' GROUP BY b.doc ;")->result(); $table .= "<td style="width:5%;">" . $a . "</td><td class="w3-left-align" style="width:40%;"><b>Codigo:</b> " . $dt->codcliente . " <b>Nombre:</b> " . $dt->nombrecli . " <b>Contacto:</b> " . $dirr->contacto . " <b>Telefono:</b> " . $dirr->telefono . " <br> <b>Direccion:</b> " . $dirr->direcenvio . " <br> <b>Horario:</b> " . $dirr->hor . " <br> </td>\xa <td style="width:5%;">" . ROUND($dunid->unid, 2) . "</td><td style="width:35%;">"; foreach ($bd2 as $dt2) { $tbultos += $dt2->bultos; $table .= " <b>Doc:</b>" . $dt2->documento . " <b>Bultos:</b>" . $dt2->bultos . " <b>Frio:</b>" . $dt2->refg . " <br>"; } $table .= "</td>\xa <td style="width:5%;">" . $vend->nombre . "</td>\xa <td style="width:10%;"></td>\xa </tr>
"; } $chof1 = $this->db->query("SELECT nomape, vehiculo, fech FROM trab as a JOIN reparto as b ON a.id=b.chofer1 WHERE b.id='{$a}'")->row(); $chof2 = $this->db->query("SELECT nomape FROM trab as a JOIN reparto as b ON a.id=b.chofer2 WHERE b.id='{$a}'")->row(); $vehi = $this->db->query("SELECT descrip FROM vehic WHERE id='{$chof1->vehiculo}'")->row(); $html = "
" . $style . "\xa<div class="w3-center w3-tiny"><img src="images/header.jpg" alt="Header" style="width:100%;"></div>
<h3 class="w3-center">Gu\xc3\255a de Reparto<h3>\xa<div class="w3-center w3-tiny">
<table class="w3-table"><tr><td><b>Chofer 1:</b></td><td>" . $chof1->nomape . "</td><td><b>Chofer 2:</b></td><td>" . $chof2->nomape . "</td><td><b>Vehiculo:</b></td><td>" . $vehi->descrip . "</td><td><b>Fecha:</b></td><td>" . $chof1->fech . "</td></tr></table><br>\xa<table class="w3-table"><tr><td><b>Salida:</b></td><td>Fecha ____________</td><td>Hora ____________</td></tr><tr><td><b>Retorno:</b></td><td>Fecha ____________</td><td>Hora ____________</td></tr></table><br>
" . $table . "\xa<table class="w3-table-all w3-hoverable w3-centered"><tr><td>Total Bultos:</td><td>" . $tbultos . "</td></tr></table>\xa</div>\xa</body>
</html>
"; return $html; } public function factura($a, $b) { $this->load->library("table"); $cli = $this->session->userdata("cod"); if (base_url() === "https://www.medifar.com.ve/") { $filtercli = "&& a.codcliente='{$cli}'"; } else { $filtercli = ''; } if ($b != '') { $filter = "&& (a.documento='{$b}' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor='{$b}' || a.tipodoc='{$b}')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM operti AS a \xa LEFT JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.tipodoc='FAC' " . $filter . " {$filtercli}\xa GROUP BY a.documento ORDER BY a.documento DESC;")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.documento,a.antdoc,a.tipodoc,a.fechacrea,a.vence, a.codcliente, a.nombrecli,a.orden, a.telefonos, a.sector,a.vendedor, (SELECT ROUND(SUM(cantidad)-SUM(cntdevuelt)) FROM opermv WHERE tipodoc='FAC' && documento=a.documento) unidades, c.timeaut,c.timeasig,c.timeemp,
IF(c.status IS NOT NULL && c.status!='',c.status,2) status,a.estatusdoc
FROM operti AS a
LEFT JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.tipodoc='FAC' " . $filter . " {$filtercli}\xa GROUP BY a.documento ORDER BY a.documento DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="factura()" id="likefac"></td>\xa <td class="w3-center w3-btn"><a onclick="prefac();"><img src="" . base_url() . "images/factura.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="viewbackorder();"><img src="" . base_url() . "images/backorder.png" alt="Backorder" title="Backorder" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="copyfac();"><img src="" . base_url() . "images/copiarfac.png" alt="Anular y Copiar" title="Anular y Copiar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="formdevfac();"><img src="" . base_url() . "images/devolver.png" alt="Devolver" title="Devolver" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="editfac();"><img src="" . base_url() . "images/editar.png" alt="Editar Vendedor" title="Editar Vendedor" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="factura();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <!--<td class="w3-center w3-btn"><a onclick="elimfac();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td>--></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>N</th><th>Doc</th><th>Codigo</th><th>Nombre</th><th>N.Control</th><th>Fecha</th><th>Vence</th><th>Sector</th><th>Vendedor</th><th>Unidades</th><th>F.Autoriza</th><th>F.Asigna</th><th>F.Emp</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtfac->documento}' LIMIT 1")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itemfac($('#a" . $i . "').val(),$('#b" . $i . "').val());">"; if ($dtfac->estatusdoc == "1") { $status = "Impresa"; $color = "w3-green"; } else { if ($dtfac->estatusdoc == "0") { $status = "No impresa"; $color = "w3-red"; } else { if ($dtfac->estatusdoc == "X") { $status = "Anulada"; $color = "w3-orange"; } } } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" id="b" . $i . "" name="tipodoc" value="" . $dtfac->tipodoc . "">
<input type="hidden" name="antdoc" value="" . $dtfac->antdoc . ""><input type="hidden" name="status" value="" . $dtfac->status . "">\xa <td>" . $i . "</td><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->documento . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td><td>" . $dtfac->orden . "</td>
<td>" . $dtfac->fechacrea . "</td><td>" . $dtfac->vence . "</td><td>" . $dtfac->sector . "</td><td>" . $vend->nombre . "</td><td>" . $dtfac->unidades . "</td><td>" . $dtfac->timeaut . "</td><td>" . $dtfac->timeasig . "</td><td>" . $dtfac->timeemp . "</td>\xa <td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Factura: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">
function DecrementNumfac(){
var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903"; var likefac=$('#likefac').val();\xa var datos = {\xa "pag" : DecrementNum,\xa "key" : key,\xa likefac:likefac\xa };\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/factura",
type: "POST",
success: function(data) {
$("#body").html(data);
$("#likefac").val(likefac);
}\xa \xa });
}
\xa function numpagfac(a){
var key="droid903"; var likefac=$('#likefac').val();\xa
var datos = {
"key":key,\xa "pag" : a,
likefac:likefac
};\xa \xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/factura",
type: "POST",
success: function(data) {
$("#body").html(data);
$("#likefac").val(likefac);\xa }
\xa });\xa }\xa
function IncrimentNumfac(){\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903"; var likefac=$('#likefac').val();
var datos = {\xa "key":key,\xa "pag" : IncrimentNum,
likefac:likefac
};
\xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/factura",\xa type: "POST",
success: function(data) {\xa $("#body").html(data);
$("#likefac").val(likefac);\xa }\xa
});\xa }\xa </script>
<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumFac();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNumfac();" class="w3-bar-item w3-button">»</a>
</div> "; return $html; } public function notfac($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "&& (a.documento='{$b}' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor like '%{$b}%' || a.tipodoc='{$b}')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM operti AS a \xa JOIN opermv AS b ON a.documento=b.documento
LEFT JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.tipodoc='NOT' " . $filter . "
GROUP BY a.documento ORDER BY a.documento DESC;")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.documento,a.antdoc,a.tipodoc,a.fechacrea,a.vence, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor, (SELECT ROUND(SUM(cantidad)-SUM(cntdevuelt)) FROM opermv WHERE tipodoc='NOT' && documento=a.documento) unidades, c.timeaut,c.timeasig,c.timeemp,
IF(c.status IS NOT NULL && c.status!='',c.status,2) status,a.estatusdoc\xa FROM operti AS a
JOIN opermv AS b ON a.documento=b.documento
LEFT JOIN control_operti AS c ON a.antdoc=c.doc\xa WHERE a.tipodoc='NOT' " . $filter . "\xa GROUP BY a.documento ORDER BY a.documento DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="notfac()" id="likefac"></td>\xa <td class="w3-center w3-btn"><a onclick="prefac();"><img src="" . base_url() . "images/factura.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="formdevfac();"><img src="" . base_url() . "images/devolver.png" alt="Devolver" title="Devolver" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="convnotfac();"><img src="" . base_url() . "images/volver.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="notfac();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <!--<td class="w3-center w3-btn"><a onclick="elimfac();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td>--></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>N</th><th>Doc</th><th>Codigo</th><th>Nombre</th><th>Fecha</th><th>Vence</th><th>Sector</th><th>Vendedor</th><th>Unidades</th>\xa <th>F.Autoriza</th><th>F.Asigna</th><th>F.Emp</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->estatusdoc == "1") { $status = "Impresa"; $color = "w3-green"; } else { if ($dtfac->estatusdoc == "0") { $status = "No impresa"; $color = "w3-red"; } else { if ($dtfac->estatusdoc == "X") { $status = "Anulada"; $color = "w3-orange"; } } } $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtfac->documento}' LIMIT 1")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itemfac($('#a" . $i . "').val(),$('#b" . $i . "').val());">"; $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" id="b" . $i . "" name="tipodoc" value="" . $dtfac->tipodoc . "">
<input type="hidden" name="antdoc" value="" . $dtfac->antdoc . ""><input type="hidden" name="status" value="" . $dtfac->status . "">\xa <td>" . $i . "</td><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->documento . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td>
<td>" . $dtfac->fechacrea . "</td><td>" . $dtfac->vence . "</td><td>" . $dtfac->sector . "</td><td>" . $vend->nombre . "</td><td>" . $dtfac->unidades . "</td><td>" . $dtfac->timeaut . "</td><td>" . $dtfac->timeasig . "</td><td>" . $dtfac->timeemp . "</td>\xa <td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNumfac(){\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903"; var likefac=$('#likefac').val();\xa var datos = {\xa "pag" : DecrementNum,\xa "key" : key,\xa likefac:likefac\xa };
$.ajax({\xa data: datos,
url: baseurl+"c_droid/notfac",\xa type: "POST",
success: function(data) {
$("#body").html(data);\xa $("#likefac").val(likefac);\xa }
\xa });\xa }
\xa function numpagfac(a){\xa var key="droid903"; var likefac=$('#likefac').val();\xa \xa var datos = {
"key":key,
"pag" : a,
likefac:likefac
};\xa \xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/notfac",
type: "POST",\xa success: function(data) {\xa $("#body").html(data);
$("#likefac").val(likefac);
}
\xa });\xa }
function IncrimentNumfac(){\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var likefac=$('#likefac').val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum,
likefac:likefac
};
$.ajax({
data: datos,\xa url: baseurl+"c_droid/notfac",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data);
$("#likefac").val(likefac);
}
\xa });
}
</script>\xa <div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumFac();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNumfac();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function ncfac($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "&& (a.documento='{$b}' || a.referencia like '%{$b}%' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor like '%{$b}%' || a.tipodoc='{$b}')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM operti AS a
LEFT JOIN control_operti AS c ON a.antdoc=c.doc\xa WHERE a.tipodoc='N/C' " . $filter . "\xa GROUP BY a.documento ORDER BY a.documento DESC;")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.documento,a.antdoc,a.tipodoc,a.fechacrea,a.vence, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor, (SELECT ROUND(SUM(cantidad)-SUM(cntdevuelt)) FROM opermv WHERE tipodoc='N/C' && documento=a.documento) unidades, c.timeaut,c.timeasig,c.timeemp,
IF(c.status IS NOT NULL && c.status!='',c.status,2) status,IF(a.aplicanc!='',a.aplicanc,'N/A') aplicanc ,a.estatusdoc
FROM operti AS a
LEFT JOIN control_operti AS c ON a.antdoc=c.doc\xa WHERE a.tipodoc='N/C' " . $filter . "
GROUP BY a.documento ORDER BY a.documento DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="ncfac()" id="likefac"></td>\xa <td class="w3-center w3-btn"><a onclick="prefac();"><img src="" . base_url() . "images/factura.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="ncfac();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="devncfac();"><img src="" . base_url() . "images/devolver.png" alt="Devolver" title="Devolver" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>N</th><th>Doc</th><th>Aplicado</th><th>Codigo</th><th>Nombre</th><th>Fecha</th><th>Vence</th><th>Sector</th><th>Vendedor</th><th>Unidades</th>\xa <th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtfac->documento}' LIMIT 1")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itemfac($('#a" . $i . "').val(),$('#b" . $i . "').val());">"; if ($dtfac->estatusdoc === "X") { $status = "Anulada"; $color = "w3-orange"; } elseif ($dtfac->aplicanc != "N/A") { $status = "Aplicado"; $color = "w3-green"; } else { $status = "No aplicado"; $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" id="b" . $i . "" name="tipodoc" value="" . $dtfac->tipodoc . "">\xa <input type="hidden" name="antdoc" value="" . $dtfac->antdoc . ""><input type="hidden" name="status" value="" . $dtfac->status . "">\xa <td>" . $i . "</td><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->documento . "</td><td>" . $dtfac->aplicanc . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td>\xa <td>" . $dtfac->fechacrea . "</td><td>" . $dtfac->vence . "</td><td>" . $dtfac->sector . "</td><td>" . $vend->nombre . "</td><td>" . $dtfac->unidades . "</td><td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">
function DecrementNumfac(){
var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903"; var likefac=$('#likefac').val();
var datos = {\xa "pag" : DecrementNum,\xa "key" : key,\xa likefac:likefac\xa };
$.ajax({
data: datos,
url: baseurl+"c_droid/ncfac",\xa type: "POST",
success: function(data) {
$("#body").html(data);\xa $("#likefac").val(likefac);\xa }\xa \xa });\xa }\xa \xa function numpagfac(a){\xa var key="droid903"; var likefac=$('#likefac').val();\xa \xa var datos = {
"key":key,\xa "pag" : a,\xa likefac:likefac
};
\xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/ncfac",
type: "POST",
success: function(data) {
$("#body").html(data);
$("#likefac").val(likefac);\xa }
});\xa }
\xa function IncrimentNumfac(){\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903"; var likefac=$('#likefac').val();\xa var datos = {\xa "key":key,\xa "pag" : IncrimentNum,\xa likefac:likefac
};
\xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/ncfac",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data);\xa $("#likefac").val(likefac);\xa }
\xa });\xa }
</script>
<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumFac();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNumfac();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } public function ndfac($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "&& (a.documento='{$b}' || a.referencia like '%{$b}%' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor like '%{$b}%' || a.tipodoc='{$b}')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM operti AS a
LEFT JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.tipodoc='N/D' " . $filter . "
GROUP BY a.documento ORDER BY a.documento DESC;")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.documento,a.antdoc,a.tipodoc,a.fechacrea,a.vence, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor, (SELECT ROUND(SUM(cantidad)-SUM(cntdevuelt)) FROM opermv WHERE tipodoc='N/D' && documento=a.documento) unidades, c.timeaut,c.timeasig,c.timeemp,
IF(c.status IS NOT NULL && c.status!='',c.status,2) status,a.estatusdoc\xa FROM operti AS a
LEFT JOIN control_operti AS c ON a.antdoc=c.doc
WHERE a.tipodoc='N/D' " . $filter . "\xa GROUP BY a.documento ORDER BY a.documento DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="ndfac()" id="likefac"></td>
<td class="w3-center w3-btn"><a onclick="prefac();"><img src="" . base_url() . "images/factura.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="ndfac();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="devndfac();"><img src="" . base_url() . "images/devolver.png" alt="Devolver" title="Devolver" style="width:20px;height:20px;border:0;"></a></td>\xa <!--<td class="w3-center w3-btn"><a onclick="elimfac();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td>--></tr>
</table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>N</th><th>Doc</th><th>Codigo</th><th>Nombre</th><th>Fecha</th><th>Vence</th><th>Sector</th><th>Vendedor</th><th>Unidades</th>
<th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$dtfac->documento}' LIMIT 1")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itemfac($('#a" . $i . "').val(),$('#b" . $i . "').val());">"; if ($dtfac->estatusdoc == "1") { $status = "Impresa"; $color = "w3-green"; } else { if ($dtfac->estatusdoc == "0") { $status = "No impresa"; $color = "w3-red"; } else { if ($dtfac->estatusdoc == "X") { $status = "Anulada"; $color = "w3-orange"; } } } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" id="b" . $i . "" name="tipodoc" value="" . $dtfac->tipodoc . "">
<input type="hidden" name="antdoc" value="" . $dtfac->antdoc . ""><input type="hidden" name="status" value="" . $dtfac->status . "">\xa <td>" . $i . "</td><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->documento . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td>\xa <td>" . $dtfac->fechacrea . "</td><td>" . $dtfac->vence . "</td><td>" . $dtfac->sector . "</td><td>" . $vend->nombre . "</td><td>" . $dtfac->unidades . "</td><td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNumfac(){\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903"; var likefac=$('#likefac').val();\xa var datos = {
"pag" : DecrementNum,
"key" : key,\xa likefac:likefac\xa };
\xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/ndfac",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data);
$("#likefac").val(likefac);\xa }\xa
});\xa }
function numpagfac(a){\xa var key="droid903"; var likefac=$('#likefac').val();
\xa var datos = {\xa "key":key,\xa "pag" : a,
likefac:likefac\xa };
$.ajax({
data: datos,\xa url: baseurl+"c_droid/ndfac",
type: "POST",\xa success: function(data) {
$("#body").html(data);
$("#likefac").val(likefac);
}
\xa });\xa }
\xa function IncrimentNumfac(){
var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var likefac=$('#likefac').val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum,
likefac:likefac
};\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/ndfac",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data);
$("#likefac").val(likefac);
}\xa
});
}
</script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumFac();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNumfac();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function itemfac($a, $b) { $this->load->library("table"); $bditfac = $this->db->query("SELECT c.codigo, c.nombre, ROUND(c.cantidad,0) cantidad,ROUND(c.cntdevuelt,0) devuelta, c.lote, c.status FROM opermv AS c WHERE c.documento='{$a}' && c.tipodoc='{$b}';")->result(); $nom = $this->db->query("SELECT nomape FROM trab as a JOIN control_operti as b ON a.id=b.trabempaq WHERE b.doc='{$a}'")->row(); $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$a}' LIMIT 1")->row(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Nombre</th><th>Cantidad</th><th>Devuelta</th><th>Lote</th><th>Estatus</th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtitfac->status == 1) { $status = "Listo"; $color = "w3-green"; } $html .= "<tr><input type="hidden" id="doc" value="" . $a . ""><input type="hidden" id="codmed" . $i . "" value="" . $dtitfac->codigo . ""><input type="hidden" id="cant" . $i . "" value="" . $dtitfac->cantidad . "">\xa <td>" . $dtitfac->codigo . "</td><td>" . $dtitfac->nombre . "</td><td>" . $dtitfac->cantidad . "</td><td>" . $dtitfac->devuelta . "</td><td>" . $dtitfac->lote . "</td><td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "</table>"; return $html; } function devndfac($doc) { $bd = $this->db->query("SELECT NULL FROM operti WHERE documento='{$doc}' && tipodoc='N/D' && (estatusdoc='1' || estatusdoc='0')")->num_rows(); if ($bd > 0) { $i = 0; $num2 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/C'")->row(); $newdoc = str_pad($num2->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $this->db->query("INSERT INTO operti SELECT * FROM operti WHERE documento='{$doc}' && tipodoc='N/D'"); $this->db->query("UPDATE operti set documento='{$newdoc}',tipodoc='N/C',fechacrea=curdate(),emision=curdate(),recepcion=curdate(),fechayhora=NOW(),referencia='N/D{$doc}',estatusdoc='0'\xa WHERE documento='{$doc}' && tipodoc='N/D' LIMIT 1"); if ($this->db->affected_rows() > 0) { $bd = $this->db->query("SELECT * FROM opermv WHERE documento='{$doc}' && tipodoc='N/D'")->result(); foreach ($bd as $dtped) { $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "documento" => $newdoc, "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => '' . $dtped->codigo . '', "pid" => '' . $pid . '', "nombre" => "Anulaci\xc3\263n seg\xc3\xban nota de d\303\251bito: " . $doc . " de Fecha " . $dtped->fechadoc . " por un Monto " . $dtped->montototal . " BsS", "costounit" => '' . $dtped->costounit . '', "preciounit" => $dtped->preciounit, "dsctounit" => '' . $dtped->dsctounit . '', "dsctoprc" => '' . $dtped->dsctoprc . '', "dsctoendp" => $dtped->dsctoendp, "dsctoendm" => $dtped->dsctoendm, "preciofin" => '' . $dtped->preciofin . '', "preciooriginal" => '' . $dtped->preciooriginal . '', "cantidad" => '' . $dtped->cantidad . '', "montoneto" => '' . $dtped->montoneto . '', "montototal" => '' . $dtped->montototal . '', "timpueprc" => '' . $dtped->timpueprc . '', "almacen" => $dtped->almacen, "proveedor" => '' . $dtped->proveedor . '', "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $dtped->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $dtped->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $dtped->baseimpo1 . '', "baseimpo2" => "0", "lote" => $dtped->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); } $this->db->query("UPDATE operti set estatusdoc='X' WHERE documento='{$doc}' && tipodoc='N/D'"); if ($this->db->affected_rows() > 0) { $i++; } $this->loguser("Devolucion", "El usuario a devuelto la nota de debito " . $doc . ", nota de credito por anulacion " . $newdoc . ''); } return $i; } } function devncfac($doc) { $bd = $this->db->query("SELECT NULL FROM operti WHERE documento='{$doc}' && tipodoc='N/C' && (estatusdoc='1' || estatusdoc='0')")->num_rows(); if ($bd > 0) { $i = 0; $num2 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/D'")->row(); $newdoc = str_pad($num2->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $this->db->query("INSERT INTO operti SELECT * FROM operti WHERE documento='{$doc}' && tipodoc='N/C'"); $this->db->query("UPDATE operti set documento='{$newdoc}',tipodoc='N/D',fechacrea=curdate(),emision=curdate(),recepcion=curdate(),fechayhora=NOW(),referencia='N/C{$doc}',estatusdoc='0'\xa WHERE documento='{$doc}' && tipodoc='N/C' LIMIT 1"); if ($this->db->affected_rows() > 0) { $bd = $this->db->query("SELECT * FROM opermv WHERE documento='{$doc}' && tipodoc='N/C'")->result(); foreach ($bd as $dtped) { $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "documento" => $newdoc, "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => '' . $dtped->codigo . '', "pid" => '' . $pid . '', "nombre" => $dtped->nombre, "costounit" => '' . $dtped->costounit . '', "preciounit" => $dtped->preciounit, "dsctounit" => '' . $dtped->dsctounit . '', "dsctoprc" => '' . $dtped->dsctoprc . '', "dsctoendp" => $dtped->dsctoendp, "dsctoendm" => $dtped->dsctoendm, "preciofin" => '' . $dtped->preciofin . '', "preciooriginal" => '' . $dtped->preciooriginal . '', "cantidad" => '' . $dtped->cantidad . '', "montoneto" => '' . $dtped->montoneto . '', "montototal" => '' . $dtped->montototal . '', "timpueprc" => '' . $dtped->timpueprc . '', "almacen" => $dtped->almacen, "proveedor" => '' . $dtped->proveedor . '', "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $dtped->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $dtped->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $dtped->baseimpo1 . '', "baseimpo2" => "0", "lote" => $dtped->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); } $this->db->query("UPDATE operti set estatusdoc='X' WHERE documento='{$doc}' && tipodoc='N/C'"); if ($this->db->affected_rows() > 0) { $this->db->query("DELETE FROM aplicanc WHERE nc='{$doc}'"); } if ($this->db->affected_rows() > 0) { $i++; } $this->loguser("Devolucion", "El usuario a devuelto la nota de credito " . $doc . ", nota de debito por anulacion " . $newdoc . ''); } return $i; } } function copyfac($doc, $tip, $cli, $orden) { $num1 = $this->db->query("SELECT IF(MAX(SUBSTR(doc,2,8))+1>0,MAX(SUBSTR(doc,2,8))+1,1) n FROM control_operti WHERE doc like '%C%'")->row(); $controldoc = str_pad($num1->n, 7, "0", STR_PAD_LEFT); $control = array("doc" => "C" . $controldoc, "status" => "2"); $this->db->insert("control_operti", $control); $num2 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='FAC'")->row(); $newdoc = str_pad($num2->n, 8, "0", STR_PAD_LEFT); $cli2 = $this->db->query("SELECT nombre,direccion,nrorif FROM cliempre WHERE codigo='{$cli}'")->row(); $pid = $this->genecod(12); $this->db->query("INSERT INTO operti SELECT * FROM operti WHERE documento='{$doc}' && tipodoc='{$tip}'"); $this->db->query("UPDATE operti set documento='{$newdoc}',codcliente='{$cli}',orden='{$orden}',nombrecli='{$cli2->nombre}',direccion='{$cli2->direccion}',rif='{$cli2->nrorif}',fechacrea=curdate(),emision=curdate(),recepcion=curdate()
WHERE documento='{$doc}' && tipodoc='{$tip}' LIMIT 1"); $bd = $this->db->query("SELECT * FROM opermv WHERE documento='{$doc}' && tipodoc='{$tip}'")->result(); foreach ($bd as $dtped) { $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "FAC", "documento" => $newdoc, "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => '' . $dtped->codigo . '', "pid" => '' . $pid . '', "nombre" => '' . $dtped->nombre . '', "costounit" => '' . $dtped->costounit . '', "preciounit" => $dtped->preciounit, "dsctounit" => '' . $dtped->dsctounit . '', "dsctoprc" => '' . $dtped->dsctoprc . '', "dsctoendp" => $dtped->dsctoendp, "dsctoendm" => $dtped->dsctoendm, "preciofin" => '' . $dtped->preciofin . '', "preciooriginal" => '' . $dtped->preciooriginal . '', "cantidad" => '' . $dtped->cantidad . '', "montoneto" => '' . $dtped->montoneto . '', "montototal" => '' . $dtped->montototal . '', "timpueprc" => '' . $dtped->timpueprc . '', "almacen" => $dtped->almacen, "proveedor" => '' . $dtped->proveedor . '', "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $dtped->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $dtped->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $dtped->baseimpo1 . '', "baseimpo2" => "0", "lote" => $dtped->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); } $this->db->query("UPDATE artilotes a JOIN opermv b ON (a.almacen=b.almacen && a.codigoart=b.codigo && a.lote=b.lote)\xa SET a.consumido=a.consumido+b.cantidad WHERE b.documento='{$newdoc}'"); $this->loguser("Copy FAC", "El usuario a copiado la factura " . $doc . " para " . $newdoc . ''); return $this->db->affected_rows(); } function editfac($doc, $tip, $vend, $diasc, $dias, $orden) { $this->db->query("UPDATE operti set vendedor='{$vend}',diascred='{$diasc}',diasindex='{$dias}',orden='{$orden}' WHERE documento='{$doc}' && tipodoc='{$tip}'"); $this->loguser("Modificar", "El usuario modifica la Factura " . $doc . ", Vendedor: " . $vend . ", Dia index: " . $dias . ", N.Control: " . $orden . "."); return $this->db->affected_rows(); } function genencfac($doc, $tip, $por, $obser) { $val = $this->db->query("SELECT NULL FROM operti b WHERE b.referencia='" . $tip . $doc . "' && b.tipodoc='N/C' && (b.aplicanc='' || b.aplicanc IS NULL)")->num_rows(); if ($val == 0) { $bd = $this->db->query("SELECT a.vendedor,a.rif,a.codcliente,a.nombrecli, a.direccion,a.antdoc,a.telefonos,a.diascred,a.totdescuen,a.fechacrea,a.sector,a.totneto,a.rif,
(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY FECHA DESC LIMIT 1) tasa\xa FROM operti a WHERE a.documento='{$doc}' && a.tipodoc='{$tip}'")->row(); $newdoc = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/C'")->row(); $newdoc = str_pad($newdoc->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $user = $this->session->userdata("cod"); $totneto = $bd->totneto * ($por / 100); $totald = $totneto / $bd->tasa; $opermv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "documento" => $newdoc, "grupo" => "N/A", "origen" => "1", "codigo" => "N/A", "pid" => '' . $pid . '', "nombre" => $obser, "costounit" => 0, "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "preciofin" => 0, "preciooriginal" => 0, "cantidad" => 0, "cntdevuelt" => 0, "montoneto" => $totneto, "montototal" => $totneto, "timpueprc" => 0, "almacen" => "N/A", "proveedor" => $bd->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $bd->vendedor . '', "emisor" => $user, "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => 0, "baseimpo2" => "0", "lote" => "N/A", "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $opermv); $operti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "moneda" => "000", "documento" => $newdoc, "codcliente" => $bd->codcliente, "nombrecli" => $bd->nombrecli, "contacto" => "N/A", "rif" => $bd->rif, "direccion" => $bd->direccion, "telefonos" => $bd->telefonos, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => 0, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => '' . $totneto . '', "totimpuest" => 0, "totdescuen" => 0, "impuesto1" => "0", "impuesto2" => "0", "dsctolinea" => 0, "diascred" => $bd->diascred, "vendedor" => '' . $bd->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $user . '', "estacion" => "001", "sinimpuest" => $totneto, "almacen" => "N/A", "sector" => '' . $bd->sector . '', "subcodigo" => '' . $bd->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => 0, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "FAC", "antdoc" => $bd->antdoc, "referencia" => $tip . $doc, "totald" => $totald); $this->db->insert("operti", $operti); $fac[0] = $doc; $this->regncfac($fac, $newdoc, $bd->codcliente); $this->loguser("Genera N/C", "El usuario a generado la nota de credito por motivo de " . $obser . " para el documento " . $doc . ''); return $this->db->affected_rows(); } } function genencfacmonto($doc, $tip, $por, $obser) { $val = $this->db->query("SELECT NULL FROM operti b WHERE b.referencia='" . $tip . $doc . "' && b.tipodoc='N/C' && (b.aplicanc='' || b.aplicanc IS NULL)")->num_rows(); if ($val == 0) { $bd = $this->db->query("SELECT a.vendedor,a.fechacrea,a.rif,a.codcliente,a.nombrecli, a.direccion,a.antdoc,a.telefonos,a.diascred,a.totdescuen,a.fechacrea,a.sector,a.totneto,a.rif,\xa (SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY FECHA DESC LIMIT 1) tasa\xa FROM operti a WHERE a.documento='{$doc}' && a.tipodoc='{$tip}'")->row(); $newdoc = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/C'")->row(); $newdoc = str_pad($newdoc->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $user = $this->session->userdata("cod"); $totneto = $por; $totald = $totneto / $bd->tasa; $opermv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "documento" => $newdoc, "grupo" => "N/A", "origen" => "1", "codigo" => "N/A", "pid" => '' . $pid . '', "nombre" => $obser, "costounit" => 0, "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "preciofin" => 0, "preciooriginal" => 0, "cantidad" => 0, "cntdevuelt" => 0, "montoneto" => $totneto, "montototal" => $totneto, "timpueprc" => 0, "almacen" => "N/A", "proveedor" => $bd->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $bd->vendedor . '', "emisor" => $user, "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => 0, "baseimpo2" => "0", "lote" => "N/A", "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $opermv); $operti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "moneda" => "000", "documento" => $newdoc, "codcliente" => $bd->codcliente, "nombrecli" => $bd->nombrecli, "contacto" => "N/A", "rif" => $bd->rif, "direccion" => $bd->direccion, "telefonos" => $bd->telefonos, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => 0, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => '' . $totneto . '', "totimpuest" => 0, "totdescuen" => 0, "impuesto1" => "0", "impuesto2" => "0", "dsctolinea" => 0, "diascred" => $bd->diascred, "vendedor" => '' . $bd->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $user . '', "estacion" => "001", "sinimpuest" => $totneto, "almacen" => "N/A", "sector" => '' . $bd->sector . '', "subcodigo" => '' . $bd->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => 0, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "FAC", "antdoc" => $bd->antdoc, "referencia" => $tip . $doc, "totald" => $totald); $this->db->insert("operti", $operti); $fac[0] = $doc; $this->regncfac($fac, $newdoc, $bd->codcliente); $this->loguser("Genera N/C", "El usuario a generado la nota de credito por motivo de " . $obser . " para el documento " . $doc . ''); return $this->db->affected_rows(); } } function genendfacmonto($doc, $tip, $por, $obser) { $bd = $this->db->query("SELECT a.vendedor,a.fechacrea,a.rif,a.codcliente,a.nombrecli, a.direccion,a.antdoc,a.telefonos,a.diascred,a.totdescuen,a.fechacrea,a.sector,a.totneto,a.rif,
(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY FECHA DESC LIMIT 1) tasa
FROM operti a WHERE a.documento='{$doc}' && a.tipodoc='{$tip}'")->row(); $newdoc = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/D'")->row(); $newdoc = str_pad($newdoc->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $user = $this->session->userdata("cod"); $totneto = $por; $totald = $totneto / $bd->tasa; $opermv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "documento" => $newdoc, "grupo" => "N/A", "origen" => "1", "codigo" => "N/A", "pid" => '' . $pid . '', "nombre" => $obser, "costounit" => 0, "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "preciofin" => 0, "preciooriginal" => 0, "cantidad" => 0, "cntdevuelt" => 0, "montoneto" => $totneto, "montototal" => $totneto, "timpueprc" => 0, "almacen" => "N/A", "proveedor" => $bd->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $bd->vendedor . '', "emisor" => $user, "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => 0, "baseimpo2" => "0", "lote" => "N/A", "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $opermv); $operti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "moneda" => "000", "documento" => $newdoc, "codcliente" => $bd->codcliente, "nombrecli" => $bd->nombrecli, "contacto" => "N/A", "rif" => $bd->rif, "direccion" => $bd->direccion, "telefonos" => $bd->telefonos, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => 0, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => '' . $totneto . '', "totimpuest" => 0, "totdescuen" => 0, "impuesto1" => "0", "impuesto2" => "0", "dsctolinea" => 0, "diascred" => $bd->diascred, "vendedor" => '' . $bd->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $user . '', "estacion" => "001", "sinimpuest" => $totneto, "almacen" => "N/A", "sector" => '' . $bd->sector . '', "subcodigo" => '' . $bd->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => 0, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "FAC", "antdoc" => $bd->antdoc, "referencia" => $tip . $doc, "totald" => $totald); $this->db->insert("operti", $operti); $fac[0] = $doc; $this->regncfac($fac, $newdoc, $bd->codcliente); $this->loguser("Genera N/C", "El usuario a generado la nota de credito por motivo de " . $obser . " para el documento " . $doc . ''); return $this->db->affected_rows(); } function formdevfac($a, $b) { $bd = $this->db->query("SELECT codigo,lote,ROUND(cantidad-cntdevuelt,0) cantidad FROM opermv WHERE documento='{$a}' && tipodoc='{$b}'")->result(); $html = "<br>
<input type="hidden" id="devdoc" value="" . $a . "" /><input type="hidden" id="devtipodoc" value="" . $b . "" />\xa <input type="button" class="w3-btn w3-blue w3-border w3-hover-white" value="Parcial" onclick="w3.show('#devparcial');w3.hide('#devtotal');"> <input type="button" class="w3-btn w3-orange w3-border w3-hover-white" value="Total" onclick="w3.show('#devtotal');w3.hide('#devparcial');"><br><br>
<div id="devparcial" style="display:none"><table class="w3-table-all w3-hoverable">\xa "; foreach ($bd as $dt) { $html .= "<tr><td class="w3-fondodroid">Codigo:</td><td>" . $dt->codigo . "</td>\xa <td class="w3-fondodroid">Lote:</td><td>" . $dt->lote . "</td>
<td class="w3-fondodroid">Cantidad:</td><td><input type="hidden" name="antcant" value="" . $dt->cantidad . "">" . $dt->cantidad . "</td>\xa <td class="w3-fondodroid">Devuelta:</td><td><input type="hidden" name="devcod" value="" . $dt->codigo . ""><input type="hidden" name="devlot" value="" . $dt->lote . ""><input type="number" name="devcant" class="w3-input" placeholder="cantidad devueltas..."></td>\xa </tr>"; } $html .= "</table><br>\xa <input type="submit" class="w3-btn w3-green w3-border w3-hover-white" value="Registrar" onclick="devfac();"><br><br>\xa </div>"; $html .= "<div id="devtotal" style="display:none">\xa <input type="submit" class="w3-btn w3-green w3-border w3-hover-white" value="Registrar" onclick="devfac2();"><br><br>\xa </div>"; return $html; } function devfac($a1, $a2, $a3, $a4, $a5, $a6) { if ($a5 <= $a6) { $this->db->query("UPDATE opermv SET cntdevuelt='{$a5}' WHERE tipodoc='{$a2}' && documento='{$a1}' && codigo='{$a3}' && lote='{$a4}'"); return $this->db->affected_rows(); } } function limpianc($doc, $tip) { $this->db->query("UPDATE opermv SET cntdevuelt=0 WHERE documento='{$doc}' && tipodoc='{$tip}'"); } function facnotacred($a1, $a2) { $bd = $this->db->query("SELECT c.impuesto1,b.preciooriginal,b.preciofin,b.costounit,b.preciounit,b.cantidad,b.cntdevuelt,a.vendedor,b.codigo,b.lote,b.nombre,a.rif,a.codcliente,
a.nombrecli, a.direccion,b.dsctounit,b.dsctoprc,b.proveedor,a.antdoc,b.grupo,a.telefonos,a.diascred,a.totdescuen,b.almacen,a.fechacrea,a.sector,a.dsctoend1,\xa (b.cntdevuelt*b.preciounit) totsiva,
(b.cntdevuelt*b.preciofin) tot,
(IF(b.timpueprc>0,b.preciounit*(b.timpueprc/100),0)*b.cntdevuelt) totimp,
(IF(c.impuesto1>0,b.cntdevuelt*b.preciounit,0)) baseimp,
(IF(c.impuesto1=0,b.cntdevuelt*b.preciounit,0)) sinimp,
(b.cntdevuelt*(b.costounit/b.cantidad)) totcosto
FROM operti a JOIN opermv b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) JOIN articulo c ON b.codigo=c.codigo WHERE a.documento='{$a1}' && a.tipodoc='{$a2}' && b.cntdevuelt>0 && a.tipodoc='FAC';")->result(); $tot = 0; $totsiva = 0; $totimp = 0; $baseimp = 0; $totcosto = 0; $sinimp = 0; ${$totdesc} = 0; $user = $this->session->userdata("cod"); $num1 = $this->db->query("SELECT MAX(documento)+1 n FROM devolti WHERE tipodoc='DEV'")->row(); $num1 = str_pad($num1->n, 8, "0", STR_PAD_LEFT); $num2 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/C'")->row(); $num2 = str_pad($num2->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); foreach ($bd as $dt) { $descu = $dt->dsctoend1; $vend = $dt->vendedor; $rif = $dt->rif; $cli = $dt->codcliente; $nomcli = $dt->nombrecli; $dirr = $dt->direccion; $telf = $dt->telefonos; $diascred = $dt->diascred; $sector = $dt->sector; $antdoc = $dt->antdoc; $subcodigo = $dt->subcodigo; $fechacrea = $dt->fechacrea; $tot += $dt->tot; $totsiva += $dt->totsiva; $totimp += $dt->totimp; $baseimp += $dt->baseimp; $totcosto += $dt->totcosto; $sinimp += $dt->sinimp; $totdesc += $dt->totdesc; $devolmv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "documento" => $num1, "grupo" => $dt->grupo, "origen" => "1", "codigo" => $dt->codigo, "pid" => '' . $pid . '', "nombre" => $dt->nombre, "costounit" => $dt->totcosto, "preciounit" => $dt->preciounit, "dsctounit" => $dt->dsctounit, "dsctoprc" => $dt->dsctoprc, "preciofin" => $dt->preciofin, "precioorig" => $dt->preciooriginal, "cantidad" => $dt->cntdevuelt, "cntdevuelt" => $dt->cntdevuelt, "montoneto" => $dt->totsiva, "montototal" => $dt->tot, "timpueprc" => $dt->impuesto1, "almacen" => $dt->almacen, "proveedor" => $dt->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $dt->vendedor . '', "emisor" => $user, "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => $dt->baseimp, "baseimpo2" => "0", "lote" => $dt->lote); $this->db->insert("devolmv", $devolmv); $opermv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "documento" => $num2, "grupo" => $dt->grupo, "origen" => "1", "codigo" => $dt->codigo, "pid" => '' . $pid . '', "nombre" => $dt->nombre, "costounit" => $dt->totcosto, "preciounit" => $dt->preciounit, "dsctounit" => $dt->dsctounit, "dsctoprc" => $dt->dsctoprc, "preciofin" => $dt->preciofin, "preciooriginal" => $dt->preciooriginal, "cantidad" => $dt->cntdevuelt, "cntdevuelt" => $dt->cntdevuelt, "montoneto" => $dt->totsiva, "montototal" => $dt->tot, "timpueprc" => $dt->impuesto1, "almacen" => $dt->almacen, "proveedor" => $dt->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $dt->vendedor . '', "emisor" => $user, "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => $dt->baseimp, "baseimpo2" => "0", "lote" => $dt->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $opermv); } $devolti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "moneda" => "000", "documento" => $num1, "codcliente" => $cli, "nombrecli" => $nomcli, "contacto" => "N/A", "rif" => $rif, "direccion" => $dirr, "telefonos" => $telf, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => $totcosto, "totbruto" => $totsiva, "totneto" => $totsiva, "totalfinal" => '' . $tot . '', "totimpuest" => $totimp, "totdescuen" => $totdesc, "impuesto1" => "0", "impuesto2" => "0", "diascred" => $diascred, "vendedor" => '' . $vend . '', "factorcamb" => "1", "uemisor" => '' . $vend . '', "estacion" => "001", "sinimpuest" => $sinimp, "almacen" => "02", "sector" => '' . $sector . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "referencia" => $a2 . $a1); $this->db->insert("devolti", $devolti); $tasa = $this->db->query("SELECT oficial n FROM monecam WHERE fecha<='{$fechacrea}' ORDER BY fecha DESC LIMIT 1")->row(); $totald = $tot / $tasa->n; $operti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "moneda" => "000", "documento" => $num2, "codcliente" => $cli, "nombrecli" => $nomcli, "contacto" => "N/A", "rif" => $rif, "direccion" => $dirr, "telefonos" => $telf, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => $totcosto, "totbruto" => $totsiva, "totneto" => $totsiva, "totalfinal" => '' . $tot . '', "totimpuest" => $totimp, "totdescuen" => $totdesc, "impuesto1" => "0", "impuesto2" => "0", "diascred" => $diascred, "vendedor" => '' . $vend . '', "factorcamb" => "1", "uemisor" => '' . $vend . '', "estacion" => "001", "sinimpuest" => $sinimp, "almacen" => "02", "sector" => '' . $sector . '', "subcodigo" => '' . $subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "FAC", "antdoc" => $antdoc, "referencia" => $a2 . $a1, "dsctoend1" => $descu, "totald" => $totald); $this->db->insert("operti", $operti); $doc[0] = $a1; $this->regncfac($doc, $num2, $cli); $this->db->query("UPDATE opermv a SET a.cntdevuelt = IF((SELECT SUM(a1.cntdevuelt) FROM devolmv a1 JOIN devolti b1 ON a1.documento=b1.documento WHERE b1.referencia=CONCAT(a.tipodoc,a.documento) && a1.almacen=a.almacen && a1.codigo=a.codigo && a1.lote=a.lote) >0,
(SELECT SUM(a1.cntdevuelt) FROM devolmv a1 JOIN devolti b1 ON a1.documento=b1.documento WHERE b1.referencia=CONCAT(a.tipodoc,a.documento) && a1.almacen=a.almacen && a1.codigo=a.codigo && a1.lote=a.lote) ,0)\xa WHERE a.tipodoc='{$a2}' && documento='{$a1}'"); $this->db->query("UPDATE devolmv a SET a.cntdevuelt=a.cantidad WHERE a.cntdevuelt> a.cantidad;"); $this->db->query("UPDATE opermv a SET a.cntdevuelt=a.cantidad WHERE a.cntdevuelt> a.cantidad;"); $this->loguser("Devolucion Parcial", "El usuario a devuelto item de la factura " . $a1 . ", nota de credito NC" . $num2 . ''); } function facnotacred2($doc, $tipodoc) { $val = $this->db->query("SELECT NULL FROM operti WHERE referencia='" . $tipodoc . $doc . "' && tipodoc='N/C' && estatusdoc!='X'")->num_rows(); if ($val == 0) { $num1 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/C'")->row(); $newdoc = str_pad($num1->n, 8, "0", STR_PAD_LEFT); $num2 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM devolti WHERE tipodoc='DEV'")->row(); $newdoc2 = str_pad($num2->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $this->db->query("INSERT INTO operti SELECT * FROM operti WHERE documento='{$doc}' && tipodoc='{$tipodoc}'"); $this->db->query("UPDATE operti SET tipodoc='N/C',documento='{$newdoc}',referencia='" . $tipodoc . $doc . "',fechacrea=curdate(),emision=curdate(),recepcion=curdate(),fechayhora=NOW() \xa WHERE documento='{$doc}' && tipodoc='{$tipodoc}' LIMIT 1"); $v = $this->db->affected_rows(); $fac = $this->db->query("SELECT * FROM operti WHERE documento='{$doc}' && tipodoc='{$tipodoc}'")->row(); $bd = $this->db->query("SELECT * FROM opermv WHERE documento='{$doc}' && tipodoc='{$tipodoc}'")->result(); $devolti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "moneda" => "000", "documento" => $newdoc2, "codcliente" => $fac->codcliente, "nombrecli" => $fac->nombrecli, "contacto" => "N/A", "rif" => $fac->rif, "direccion" => $fac->direccion, "telefonos" => $fac->telefonos, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => $fac->totcosto, "totbruto" => $fac->totbruto, "totneto" => $fac->totneto, "totalfinal" => $fac->totalfinal, "totimpuest" => $fac->totimpuest, "totdescuen" => $fac->totdescuen, "impuesto1" => "0", "impuesto2" => "0", "diascred" => $fac->diascred, "vendedor" => $fac->vendedor, "factorcamb" => "1", "uemisor" => "N/A", "estacion" => "001", "sinimpuest" => $fac->sinimpuest, "almacen" => "02", "sector" => $fac->sector, "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $fac->baseimpo1, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "referencia" => $tipodoc . $doc); $this->db->insert("devolti", $devolti); foreach ($bd as $dtped) { $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/C", "documento" => $newdoc, "grupo" => '' . $dtped->grupo . '', "origen" => "1", "codigo" => '' . $dtped->codigo . '', "pid" => '' . $pid . '', "nombre" => '' . $dtped->nombre . '', "costounit" => '' . $dtped->costounit . '', "preciounit" => $dtped->preciounit, "dsctounit" => '' . $dtped->dsctounit . '', "dsctoprc" => '' . $dtped->dsctoprc . '', "dsctoendp" => $dtped->dsctoendp, "dsctoendm" => $dtped->dsctoendm, "preciofin" => '' . $dtped->preciofin . '', "preciooriginal" => '' . $dtped->preciooriginal . '', "cantidad" => '' . $dtped->cantidad . '', "cntdevuelt" => $dtped->cantidad, "montoneto" => '' . $dtped->montoneto . '', "montototal" => '' . $dtped->montototal . '', "timpueprc" => '' . $dtped->timpueprc . '', "almacen" => $dtped->almacen, "proveedor" => '' . $dtped->proveedor . '', "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $dtped->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $dtped->aux1 . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => '' . $dtped->baseimpo1 . '', "baseimpo2" => "0", "lote" => $dtped->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); $devolmv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "documento" => $newdoc2, "grupo" => $dtped->grupo, "origen" => "1", "codigo" => $dtped->codigo, "pid" => '' . $pid . '', "nombre" => $dtped->nombre, "costounit" => $dtped->costounit, "preciounit" => $dtped->preciounit, "dsctounit" => $dtped->dsctounit, "dsctoprc" => $dtped->dsctoprc, "preciofin" => $dtped->preciofin, "precioorig" => $dtped->preciooriginal, "cantidad" => $dtped->cantidad, "cntdevuelt" => $dtped->cantidad, "montoneto" => $dtped->montoneto, "montototal" => $dtped->montototal, "timpueprc" => $dtped->timpueprc, "almacen" => $dtped->almacen, "proveedor" => $dtped->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $dtped->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => $dtped->baseimpo1, "baseimpo2" => "0", "lote" => $dtped->lote); $this->db->insert("devolmv", $devolmv); } if ($v > 0) { $facnc[0] = $doc; $this->db->query("UPDATE operti set estatusdoc='X' WHERE documento='{$doc}' && tipodoc='FAC'"); $this->db->query("UPDATE opermv SET cntdevuelt=cantidad WHERE documento='{$doc}' && tipodoc='FAC'"); $this->regncfac($facnc, $newdoc, $fac->codcliente); $this->loguser("Devolucion Total", "El usuario a devuelto la factura " . $doc . ", nota de credito NC" . $newdoc . ''); } return $this->db->affected_rows(); } } function notnotacred($a1, $a2) { $bd = $this->db->query("SELECT c.impuesto1,b.preciooriginal,b.preciofin,b.costounit,b.preciounit,b.cantidad,b.cntdevuelt,a.vendedor,b.codigo,b.lote,b.nombre,a.rif,a.codcliente,\xa a.nombrecli, a.direccion,b.dsctounit,b.dsctoprc,b.proveedor,a.antdoc,b.grupo,a.telefonos,a.diascred,a.totdescuen,b.almacen,a.fechacrea,a.sector,a.dsctoend1,\xa (b.cntdevuelt*b.preciounit) totsiva,
(b.cntdevuelt*b.preciofin) tot,
(IF(b.timpueprc>0,b.preciounit*(b.timpueprc/100),0)*b.cntdevuelt) totimp,\xa (IF(c.impuesto1>0,b.cntdevuelt*b.preciounit,0)) baseimp,
(IF(c.impuesto1=0,b.cntdevuelt*b.preciounit,0)) sinimp,\xa (b.cntdevuelt*(b.costounit/b.cantidad)) totcosto,
(ROUND(b.dsctoprc,2)*b.cntdevuelt) totdesc\xa FROM operti a JOIN opermv b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) JOIN articulo c ON b.codigo=c.codigo WHERE a.documento='{$a1}' && a.tipodoc='{$a2}' && b.cntdevuelt>0 && a.tipodoc='NOT';")->result(); $tot = 0; $totsiva = 0; $totimp = 0; $baseimp = 0; $totcosto = 0; $sinimp = 0; ${$totdesc} = 0; $user = $this->session->userdata("cod"); $num1 = $this->db->query("SELECT MAX(documento)+1 n FROM devolti WHERE tipodoc='DEV'")->row(); $num1 = str_pad($num1->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); foreach ($bd as $dt) { $vend = $dt->vendedor; $rif = $dt->rif; $cli = $dt->codcliente; $nomcli = $dt->nombrecli; $dirr = $dt->direccion; $telf = $dt->telefonos; $diascred = $dt->diascred; $sector = $dt->sector; $antdoc = $dt->antdoc; $subcodigo = $dt->subcodigo; $fechacrea = $dt->fechacrea; $tot += $dt->tot; $totsiva += $dt->totsiva; $totimp += $dt->totimp; $baseimp += $dt->baseimp; $totcosto += $dt->totcosto; $sinimp += $dt->sinimp; $totdesc += $dt->totdesc; $devolmv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "documento" => $num1, "grupo" => $dt->grupo, "origen" => "1", "codigo" => $dt->codigo, "pid" => '' . $pid . '', "nombre" => $dt->nombre, "costounit" => $dt->totcosto, "preciounit" => $dt->preciounit, "dsctounit" => $dt->dsctounit, "dsctoprc" => $dt->dsctoprc, "preciofin" => $dt->preciofin, "precioorig" => $dt->preciooriginal, "cantidad" => $dt->cntdevuelt, "cntdevuelt" => $dt->cntdevuelt, "montoneto" => $dt->totsiva, "montototal" => $dt->tot, "timpueprc" => $dt->impuesto1, "almacen" => $dt->almacen, "proveedor" => $dt->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $dt->vendedor . '', "emisor" => $user, "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => $dt->baseimp, "baseimpo2" => "0", "lote" => $dt->lote); $this->db->insert("devolmv", $devolmv); } $devolti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "moneda" => "000", "documento" => $num1, "codcliente" => $cli, "nombrecli" => $nomcli, "contacto" => "N/A", "rif" => $rif, "direccion" => $dirr, "telefonos" => $telf, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => $totcosto, "totbruto" => $totsiva, "totneto" => $totsiva, "totalfinal" => '' . $tot . '', "totimpuest" => $totimp, "totdescuen" => $totdesc, "impuesto1" => "0", "impuesto2" => "0", "diascred" => $diascred, "vendedor" => '' . $vend . '', "factorcamb" => "1", "uemisor" => '' . $vend . '', "estacion" => "001", "sinimpuest" => $sinimp, "almacen" => "02", "sector" => '' . $sector . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimp, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "referencia" => $a2 . $a1); $this->db->insert("devolti", $devolti); $this->db->query("UPDATE opermv a SET a.cntdevuelt = IF((SELECT SUM(a1.cntdevuelt) FROM devolmv a1 JOIN devolti b1 ON a1.documento=b1.documento WHERE b1.referencia=CONCAT(a.tipodoc,a.documento) && a1.almacen=a.almacen && a1.codigo=a.codigo && a1.lote=a.lote) >0,
(SELECT SUM(a1.cntdevuelt) FROM devolmv a1 JOIN devolti b1 ON a1.documento=b1.documento WHERE b1.referencia=CONCAT(a.tipodoc,a.documento) && a1.almacen=a.almacen && a1.codigo=a.codigo && a1.lote=a.lote) ,0)
WHERE a.tipodoc='{$a2}' && documento='{$a1}'"); $this->db->query("UPDATE devolmv a SET a.cntdevuelt=a.cantidad WHERE a.cntdevuelt> a.cantidad;"); $this->db->query("UPDATE opermv a SET a.cntdevuelt=a.cantidad WHERE a.cntdevuelt> a.cantidad;"); $this->loguser("Devolucion Parcial", "El usuario a devuelto los item para la nota " . $a1 . ", comprobante DEV" . $num1 . ''); } function notnotacred2($doc, $tipodoc) { $val = $this->db->query("SELECT NULL FROM devolti WHERE referencia='" . $tipodoc . $doc . "' && tipodoc='DEV'")->num_rows(); if ($val == 0) { $num2 = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM devolti WHERE tipodoc='DEV'")->row(); $newdoc2 = str_pad($num2->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $fac = $this->db->query("SELECT * FROM operti WHERE documento='{$doc}' && tipodoc='{$tipodoc}'")->row(); $bd = $this->db->query("SELECT * FROM opermv WHERE documento='{$doc}' && tipodoc='{$tipodoc}'")->result(); $devolti = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "moneda" => "000", "documento" => $newdoc2, "codcliente" => $fac->codcliente, "nombrecli" => $fac->nombrecli, "contacto" => "N/A", "rif" => $fac->rif, "direccion" => $fac->direccion, "telefonos" => $fac->telefonos, "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => $fac->totcosto, "totbruto" => $fac->totbruto, "totneto" => $fac->totneto, "totalfinal" => $fac->totalfinal, "totimpuest" => $fac->totimpuest, "totdescuen" => $fac->totdescuen, "impuesto1" => "0", "impuesto2" => "0", "diascred" => $fac->diascred, "vendedor" => $fac->vendedor, "factorcamb" => "1", "uemisor" => $fac->uemisor, "estacion" => "001", "sinimpuest" => $fac->sinimpuest, "almacen" => "02", "sector" => $fac->sector, "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $fac->baseimpo1, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "referencia" => $tipodoc . $doc); $this->db->insert("devolti", $devolti); $v = $this->db->affected_rows(); foreach ($bd as $dtped) { $devolmv = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "DEV", "documento" => $newdoc2, "grupo" => $dtped->grupo, "origen" => "1", "codigo" => $dtped->codigo, "pid" => '' . $pid . '', "nombre" => $dtped->nombre, "costounit" => $dtped->costounit, "preciounit" => $dtped->preciounit, "dsctounit" => $dtped->dsctounit, "dsctoprc" => $dtped->dsctoprc, "preciofin" => $dtped->preciofin, "precioorig" => $dtped->preciooriginal, "cantidad" => $dtped->cantidad, "cntdevuelt" => $dtped->cantidad, "montoneto" => $dtped->montoneto, "montototal" => $dtped->montototal, "timpueprc" => $dtped->timpueprc, "almacen" => $dtped->almacen, "proveedor" => $dtped->proveedor, "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $dtped->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => $dtped->baseimpo1, "baseimpo2" => "0", "lote" => $dtped->lote); $this->db->insert("devolmv", $devolmv); } if ($v > 0) { $this->db->query("UPDATE operti set estatusdoc='X' WHERE documento='{$doc}' && tipodoc='NOT'"); $this->db->query("UPDATE opermv SET cntdevuelt=cantidad WHERE documento='{$doc}' && tipodoc='NOT'"); $this->loguser("Devolucion Total", "El usuario a devuelto la nota de entrega " . $doc . ", comprobante DEV" . $newdoc2 . ''); } return $this->db->affected_rows(); } } public function cobranza($a, $b) { $this->conciliabanc(); $this->load->library("table"); if ($b != '') { $filter = "&& (a.documento='{$b}' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL
FROM operti a
JOIN control_operti b ON a.antdoc=b.doc
WHERE (a.tipodoc='FAC' || (a.tipodoc='NOT' && a.estatusdoc!='X')) {$filter} && a.totald>0\xa GROUP BY a.codcliente")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.codcliente,ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2) dolar FROM operti a\xa JOIN control_operti b ON a.antdoc=b.doc
WHERE (a.tipodoc='FAC' || (a.tipodoc='NOT' && a.estatusdoc!='X')) {$filter}\xa GROUP BY a.codcliente ORDER BY dolar DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . '')->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="cobranza();" id="likefac"></td>\xa <td class="w3-center w3-btn"><a onclick="selectbancos();w3.show('#modcargabanc');"><img src="" . base_url() . "images/excel.png" alt="Cargar Consolidado" title="Cargar Consolidado" style="width:18px;height:18px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="cuentascli();"><img src="" . base_url() . "images/factura.png" alt="Estado Cuentas" title="Estado Cuentas" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="recpago();"><img src="" . base_url() . "images/recibo.png" alt="Recibo Pago" title="Recibo Pago" style="width:18px;height:18px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="retfac();"><img src="" . base_url() . "images/retenciones.png" alt="Recibo Retencion" title="Recibo Retencion" style="width:18px;height:18px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="cobranza();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Cliente</th><th>Nombre</th><th>Telf</th><th>Total.Bs</th><th>Total.$</th><th>Pagado</th><th>Debe</th><th>Estatus</th></tr>"; $i = 0; $debe = 0; foreach ($bdfac as $dtfac2) { $i++; $dtfac = $this->db->query("SELECT a.documento,b.doc,a.codcliente,c.nombre,IF(c.telefonos!='',c.telefonos,IF(c.telefono_movil!='',c.telefono_movil,'N/A')) telf, ROUND(SUM(a.totalfinal),4) totalfinal,\xa ROUND(ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2)*IF(b.fechdolar='0000-00-00',IF(CURDATE()<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1)),2) bs, ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2) dolar,
ROUND((SELECT IF(SUM(b1.monto)>0, SUM(b1.monto),0) bs FROM operti a1 JOIN opercli b1 ON a1.documento=b1.idfac WHERE a1.codcliente=a.codcliente && b1.idconsbanc IS NOT NULL && (a1.tipodoc='FAC' || a1.tipodoc='NOT')),2) pbs,
ROUND((SELECT IF(SUM(b1.montod)>0, SUM(b1.montod),0) dolar FROM operti a1 JOIN opercli b1 ON a1.documento=b1.idfac WHERE a1.codcliente=a.codcliente && b1.idconsbanc IS NOT NULL && (a1.tipodoc='FAC' || a1.tipodoc='NOT')),2) pdolar,
IF(b.fechdolar='0000-00-00',IF(CURDATE()<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),IF(b.fechdolar<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1))) tasa
FROM operti a\xa JOIN control_operti b ON a.antdoc=b.doc
JOIN cliempre c ON a.codcliente=c.codigo\xa WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.codcliente='{$dtfac2->codcliente}'")->row(); $nc = $this->db->query("SELECT ROUND(SUM(a.totald),2) totald FROM aplicanc a WHERE a.nc IN (SELECT documento FROM operti a WHERE a.codcliente='{$dtfac->codcliente}' && a.tipodoc='N/C')")->row(); $ret = $this->db->query("SELECT ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti a WHERE a.codcliente='{$dtfac->codcliente}' && a.tipodoc='RET'")->row(); $debe = ROUND($dtfac->dolar - $nc->totald - $ret->totald - $dtfac->pdolar, 2); $monto = ROUND($debe * $dtfac->tasa, 2); $html .= "<tr id="slect" . $i . "" class="item">"; if ($debe <= 3) { $status = "Listo"; $color = "w3-green"; } else { $status = "Pendiente"; $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->codcliente . "">
<td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="checkcli">" . $dtfac->codcliente . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->telf . "</td><td><b>Ant: </b>" . $dtfac->totalfinal . " <b>Desp: </b>" . $dtfac->bs . "</td><td><b>TOT: </b>" . $dtfac->dolar . " <b>N/C: </b>" . $nc->totald . " <b>RET: </b>" . $ret->totald . "</td><td>" . $dtfac->pbs . " <b>Bs</b> " . $dtfac->pdolar . " <b>$</b></td><td>" . $monto . " <b>Bs</b> " . $debe . " <b>$</b></td><td class="" . $color . "" onclick="itcobro($('#a" . $i . "').val());" style="cursor:pointer">" . $status . "</td>
</tr>"; } $html .= "<!--<tr><td class="w3-center w3-fondodroid" colspan="11"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr>--></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNumcza(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903"; var like=$("#likefac").val();\xa var datos = {
"pag" : DecrementNum,
"key" : key\xa };\xa
$.ajax({
data: datos,
url: baseurl+"c_droid/cobranza",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();
}\xa
});\xa }\xa \xa function numpagcza(a){ before();
var key="droid903"; var like=$("#likefac").val();
\xa var datos = {
"key":key,\xa "pag" : a\xa };\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/cobranza",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();
}
\xa });
}
function IncrimentNumcza(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#likefac").val();
var datos = {
"key":key,
"pag" : IncrimentNum
};\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/cobranza",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();\xa }
\xa });
}
</script>\xa <div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNumcza();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagcza($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagcza($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNumcza();" class="w3-bar-item w3-button">»</a>
\xa </div> "; return $html; } public function itcobro($a) { $bditfac = $this->db->query("SELECT a.tipodoc,a.documento,a.antdoc,a.fechacrea,a.recepcion,a.vence,a.vencec,b.doc,a.codcliente, IF(a.notas LIKE '%PROMO%','S','N') promo,\xa a.totald dolar,a.totalfinal,a.diasindex,\xa (SELECT moneda FROM opercli where idfac=a.documento group by moneda limit 1) tipopag,
(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasaorg\xa FROM operti a
JOIN control_operti b ON a.antdoc=b.doc\xa WHERE a.codcliente='{$a}' && (a.tipodoc='FAC' || (a.tipodoc='NOT' && a.estatusdoc!='X')) && a.totald>0
GROUP BY a.documento ORDER BY a.documento DESC")->result(); $html = "
<div class="w3-fijo">\xa <a onclick="viewauditapag();" class="w3-btn"><img src="" . base_url() . "images/factura.png" alt="Estado Cuentas" title="Estado Cuentas" style="width:20px;height:20px;border:0;"></a>
<a onclick="genendfacmonto();" class="w3-btn"><img src="" . base_url() . "images/nd.png" alt="Generar N/D" title="Generar N/D" style="width:20px;height:20px;border:0;"></a>\xa <a onclick="regfrecep();" class="w3-btn"><img src="" . base_url() . "images/frecep.png" alt="Registrar Recepcion" title="Registrar Recepcion" style="width:20px;height:20px;border:0;"></a>
<!--<a onclick="alertanoindex();" class="w3-btn"><img src="" . base_url() . "images/noindex.png" alt="No Index" title="No Index" style="width:20px;height:20px;border:0;"></a>-->
<a onclick="movbanc();"><img src="" . base_url() . "images/dinero.png" alt="Consolidado Bancario" title="Consolidado Bancario" style="width:20px;height:20px;border:0;">\xa <a onclick="formpagos();"><img src="" . base_url() . "images/iconpag2.png" alt="Registrar Pago" title="Registrar Pago Efectivo" style="width:20px;height:20px;border:0;">
<!--<a onclick="alertanoindex2();" class="w3-btn"><img src="" . base_url() . "images/noindex2.png" alt="No Index" title="No Index" style="width:20px;height:20px;border:0;"></a>-->\xa <a onclick="ajustepagos();" class="w3-btn"><img src="" . base_url() . "images/ajustepagos.png" alt="Ajuste Pagos" title="Ajuste Pagos" style="width:20px;height:20px;border:0;"></a>\xa <a onclick="transpagos();" class="w3-btn"><img src="" . base_url() . "images/transmoney.png" alt="Transferir Sobrante" title="Transferir Sobrante" style="width:20px;height:20px;border:0;"></a>\xa <a onclick="regretfac();" class="w3-btn"><img src="" . base_url() . "images/retencion.png" alt="Registrar Retencion" title="Registrar Retencion" style="width:20px;height:20px;border:0;"></a>
<a onclick="regncfac();" class="w3-btn"><img src="" . base_url() . "images/nc.png" alt="Aplicar N/C" title="Aplicar N/C" style="width:20px;height:20px;border:0;"></a>
<a onclick="genencfac();" class="w3-btn"><img src="" . base_url() . "images/credito.png" alt="Generar N/C %" title="Generar N/C %" style="width:20px;height:20px;border:0;"></a>
<a onclick="genencfacmonto();" class="w3-btn"><img src="" . base_url() . "images/ncmonto.png" alt="Generar N/C Monto" title="Generar N/C Monto" style="width:20px;height:20px;border:0;"></a>
<a onclick="elimpago();" class="w3-btn"><img src="" . base_url() . "images/elimpago.png" alt="Eliminar Pago" title="Eliminar Pago" style="width:20px;height:20px;border:0;"></a>
</div>\xa <table class="w3-table-all w3-hoverable w3-left-align w3-tiny" style="width:100%;"><tr class="w3-fondodroid w3-fijo"><th>Documento</th><th>Tipo</th><th>N/D</th><th>Fecha</th><th>Recepcion</th><th>Vence</th><th>Total Bs</th><th>Index Bs</th>\xa <th>Total $</th><th>Pagado</th><th>Debe</th><th>Estatus</th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $tasa = $this->db->query("SELECT IF(b.fechdolar='0000-00-00',IF(CURDATE()<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),IF(b.fechdolar<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1))) n FROM operti a JOIN control_operti b ON a.antdoc=b.doc WHERE a.documento='{$dtitfac->documento}' && (a.tipodoc='NOT' || a.tipodoc='FAC') LIMIT 1")->row(); $pagado = $this->db->query("SELECT IF(SUM(b1.monto)>0, SUM(b1.monto),0) bs,IF(SUM(b1.montod)>0, SUM(b1.montod),0) dolar FROM opercli b1 WHERE b1.idfac='{$dtitfac->documento}' && b1.idconsbanc IS NOT NULL")->row(); $nc = $this->db->query("SELECT if(ROUND(SUM(totald),2)>0,ROUND(SUM(totald),2),0) totald FROM aplicanc WHERE fac='{$dtitfac->documento}'")->row(); $ret = $this->db->query("SELECT if(ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2)>0,ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2),0) totald FROM operti a WHERE a.antdoc='{$dtitfac->antdoc}' && a.tipodoc='RET'")->row(); if ($tasa->n < $dtitfac->tasaorg) { $tasa->n = $dtitfac->tasaorg; } $bs = ($dtitfac->dolar - $nc->totald) * $tasa->n; $bsorg = ($dtitfac->dolar - $nc->totald) * $dtitfac->tasaorg; $debe = ROUND($dtitfac->dolar - $nc->totald - $ret->totald - $pagado->dolar, 2); $bdnd = $this->db->query("SELECT documento,ROUND(totalfinal,2) totalfinal FROM operti WHERE antdoc='{$dtitfac->antdoc}' && tipodoc='N/D' && (estatusdoc='1' || estatusdoc='0')")->row(); if ($bdnd->documento > 0) { $nd = $bdnd->documento; $index = $bdnd->totalfinal; } else { $nd = "N/A"; if ($bs > $bsorg) { $index = ROUND($bs - $bsorg, 2); } else { $index = 0; } } if ($debe <= 0.55) { $status = "Listo"; $color = "w3-green"; $this->indexfac($dtitfac->antdoc); } else { $status = "Pendiente"; $color = "w3-red"; } if ($dtitfac->promo == "S") { $promo = "class="w3-pink""; } else { $promo = ''; } $monto = ROUND($debe * $tasa->n, 2); $html .= "<tr id="slect2" . $i . ""><input type="hidden" name="doc2" value="" . $dtitfac->documento . ""><input type="hidden" name="tipodoc" value="" . $dtitfac->tipodoc . "">\xa <input type="hidden" name="status" value="" . $status . ""><input type="hidden" name="monto" value="" . $monto . ""><input type="hidden" name="dolar" value="" . $debe . "">\xa <input type="hidden" name="cli2" value="" . $dtitfac->codcliente . "">\xa <td " . $promo . "><input type="checkbox" onclick="w3.toggleClass('#slect2" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtitfac->documento . " <b>Tasa</b> " . $dtitfac->tasaorg . "</td><td>" . $dtitfac->tipodoc . "</td><td>" . $nd . "</td><td>" . $dtitfac->fechacrea . "</td>
<td>" . $dtitfac->recepcion . "</td><td><b>V.I: </b>" . $dtitfac->vence . " <b>V.C: </b>" . $dtitfac->vencec . "</td><td><b>Ant: </b>" . ROUND($bsorg, 2) . " <b>Desp: </b>" . ROUND($bs, 2) . "</td><td>" . $index . " <b>Tasa:</b> " . $tasa->n . " <b>Day:</b> " . $dtitfac->diasindex . "</td>
<td><b>TOT: </b>" . $dtitfac->dolar . " <b>N/C: </b>" . $nc->totald . " <b>RET: </b>" . $ret->totald . "</td><td>" . $pagado->bs . " <b>Bs</b> " . $pagado->dolar . " <b>$</b></td><td>" . $monto . " <b>Bs</b> " . $debe . " <b>$</b></td>
<td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "</table>\xa "; return $html; } public function cuentas_pagar($a, $b) { $this->conciliabanc_pagos(); $this->load->library("table"); if ($b != '') { $filter = "WHERE (a.documento='{$b}' || b.rif='{$b}' || b.nombre LIKE '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL
FROM compras a\xa JOIN proveed b ON a.proveed=b.id {$filter}
GROUP BY a.codcliente")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT b.rif,ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2) dolar FROM compras a\xa JOIN proveed b ON a.proveed=b.id {$filter}
GROUP BY b.rif ORDER BY dolar DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . '')->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="cuentas_pagar();" id="likefac"></td>\xa <td class="w3-center w3-btn"><a onclick="selectbancos();w3.show('#modcargabanc');"><img src="" . base_url() . "images/excel.png" alt="Cargar Consolidado" title="Cargar Consolidado" style="width:18px;height:18px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="cuentas_pagar();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Cliente</th><th>Nombre</th><th>Total.Bs</th><th>Total.$</th><th>Pagado</th><th>Debe</th><th>Estatus</th></tr>"; $i = 0; $debe = 0; foreach ($bdfac as $dtfac2) { $i++; $dtfac = $this->db->query("SELECT a.documento,b.rif,b.nombre, ROUND(SUM(a.total),4) totalfinal,
ROUND(ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2)*(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) bs, ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2) dolar, \xa ROUND((SELECT IF(SUM(b1.monto)>0, SUM(b1.monto),0) bs FROM compras a1 JOIN proveed c1 ON a1.proveed=c1.id JOIN operprov b1 ON a1.documento=b1.idfac WHERE c1.rif=b.rif && b1.idconsbanc IS NOT NULL),2) pbs,
ROUND((SELECT IF(SUM(b1.montod)>0, SUM(b1.montod),0) dolar FROM compras a1 JOIN proveed c1 ON a1.proveed=c1.id JOIN operprov b1 ON a1.documento=b1.idfac WHERE c1.rif=b.rif && b1.idconsbanc IS NOT NULL),2) pdolar,\xa (SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1) tasa
FROM compras a\xa JOIN proveed b ON a.proveed=b.id
WHERE b.rif='{$dtfac2->rif}' && a.tipodoc='FAC'")->row(); $nc = $this->db->query("SELECT ROUND(SUM(a.totald),2) totald FROM compras a JOIN proveed b ON a.proveed=b.id WHERE a.tipodoc='N/C' && b.rif='{$dtfac2->rif}')")->row(); $ret = $this->db->query("SELECT ROUND(SUM(a.totald),2) totald FROM compras a JOIN proveed b ON a.proveed=b.id WHERE a.tipodoc='RET' && b.rif='{$dtfac2->rif}')")->row(); $debe = ROUND($dtfac->dolar - $nc->totald - $ret->totald - $dtfac->pdolar, 2); $monto = ROUND($debe * $dtfac->tasa, 2); $html .= "<tr id="slect" . $i . "" class="item">"; if ($debe <= 3) { $status = "Listo"; $color = "w3-green"; } else { $status = "Pendiente"; $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->rif . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="checkcli">" . $dtfac->rif . "</td><td>" . $dtfac->nombre . "</td><td><b>Ant: </b>" . $dtfac->totalfinal . " <b>Desp: </b>" . $dtfac->bs . "</td><td><b>TOT: </b>" . $dtfac->dolar . " <b>N/C: </b>" . $nc->totald . " <b>RET: </b>" . $ret->totald . "</td><td>" . $dtfac->pbs . " <b>Bs</b> " . $dtfac->pdolar . " <b>$</b></td><td>" . $monto . " <b>Bs</b> " . $debe . " <b>$</b></td><td class="" . $color . "" onclick="itcuentas($('#a" . $i . "').val());" style="cursor:pointer">" . $status . "</td>
</tr>"; } $html .= "<!--<tr><td class="w3-center w3-fondodroid" colspan="11"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr>--></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">
function DecrementNumcza(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903"; var like=$("#likefac").val();\xa var datos = {\xa "pag" : DecrementNum,
"key" : key\xa };
\xa $.ajax({
data: datos,
url: baseurl+"c_droid/cuentas_pagar",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();
}\xa
});
}
\xa function numpagcza(a){ before();\xa var key="droid903"; var like=$("#likefac").val();\xa \xa var datos = {\xa "key":key,\xa "pag" : a
};\xa \xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/cuentas_pagar",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();
}\xa \xa });\xa }\xa \xa function IncrimentNumcza(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#likefac").val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum
};
$.ajax({
data: datos,\xa url: baseurl+"c_droid/cuentas_pagar",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();\xa }\xa
});\xa }\xa </script>\xa <div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumcza();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagcza($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagcza($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNumcza();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function itcuentas($a) { $bditfac = $this->db->query("SELECT a.tipodoc,a.documento,a.fechadoc fechacrea,b.rif,a.totald dolar,a.totalfinal,(SELECT dias FROM ordc WHERE npres=a.documento && proveed=b.id) dias,
(SELECT moneda FROM operprov where idfac=a.documento group by moneda limit 1) tipopag,
(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1) tasaorg
FROM compras a\xa JOIN proveed b ON a.proveed=b.id\xa WHERE b.rif='{$a}' && a.tipodoc='FAC'
GROUP BY a.documento ORDER BY a.documento DESC")->result(); $html = "
<div class="w3-fijo">
<a onclick="viewauditapag2();" class="w3-btn"><img src="" . base_url() . "images/factura.png" alt="Estado Cuentas" title="Estado Cuentas" style="width:20px;height:20px;border:0;"></a>\xa <a onclick="movbanc2();"><img src="" . base_url() . "images/dinero.png" alt="Consolidado Bancario" title="Consolidado Bancario" style="width:20px;height:20px;border:0;">\xa <a onclick="formpagos2();"><img src="" . base_url() . "images/iconpag2.png" alt="Registrar Pago" title="Registrar Pago Efectivo" style="width:20px;height:20px;border:0;">
<a onclick="elimpago();" class="w3-btn"><img src="" . base_url() . "images/elimpago.png" alt="Eliminar Pago" title="Eliminar Pago" style="width:20px;height:20px;border:0;"></a>
</div>
<table class="w3-table-all w3-hoverable w3-left-align w3-tiny" style="width:100%;"><tr class="w3-fondodroid w3-fijo"><th>Documento</th><th>Tipo</th><th>N/D</th><th>Fecha</th><th>Recepcion</th><th>Vence</th><th>Total Bs</th><th>Index Bs</th>
<th>Total $</th><th>Pagado</th><th>Debe</th><th>Estatus</th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $tasa = $this->db->query("SELECT IF(b.fechdolar='0000-00-00',IF(CURDATE()<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),IF(b.fechdolar<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1))) n FROM operti a JOIN control_operti b ON a.antdoc=b.doc WHERE a.documento='{$dtitfac->documento}' && (a.tipodoc='NOT' || a.tipodoc='FAC') LIMIT 1")->row(); $pagado = $this->db->query("SELECT IF(SUM(b1.monto)>0, SUM(b1.monto),0) bs,IF(SUM(b1.montod)>0, SUM(b1.montod),0) dolar FROM opercli b1 WHERE b1.idfac='{$dtitfac->documento}' && b1.idconsbanc IS NOT NULL")->row(); $nc = $this->db->query("SELECT if(ROUND(SUM(totald),2)>0,ROUND(SUM(totald),2),0) totald FROM aplicanc WHERE fac='{$dtitfac->documento}'")->row(); $ret = $this->db->query("SELECT if(ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2)>0,ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2),0) totald FROM operti a WHERE a.antdoc='{$dtitfac->antdoc}' && a.tipodoc='RET'")->row(); if ($tasa->n < $dtitfac->tasaorg) { $tasa->n = $dtitfac->tasaorg; } $bs = ($dtitfac->dolar - $nc->totald) * $tasa->n; $bsorg = ($dtitfac->dolar - $nc->totald) * $dtitfac->tasaorg; $debe = ROUND($dtitfac->dolar - $nc->totald - $ret->totald - $pagado->dolar, 2); $bdnd = $this->db->query("SELECT documento,ROUND(totalfinal,2) totalfinal FROM operti WHERE antdoc='{$dtitfac->antdoc}' && tipodoc='N/D' && (estatusdoc='1' || estatusdoc='0')")->row(); if ($bdnd->documento > 0) { $nd = $bdnd->documento; $index = $bdnd->totalfinal; } else { $nd = "N/A"; if ($bs > $bsorg) { $index = ROUND($bs - $bsorg, 2); } else { $index = 0; } } if ($debe <= 0.55) { $status = "Listo"; $color = "w3-green"; $this->indexfac($dtitfac->antdoc); } else { $status = "Pendiente"; $color = "w3-red"; } if ($dtitfac->promo == "S") { $promo = "class="w3-pink""; } else { $promo = ''; } $monto = ROUND($debe * $tasa->n, 2); $html .= "<tr id="slect2" . $i . ""><input type="hidden" name="doc2" value="" . $dtitfac->documento . ""><input type="hidden" name="tipodoc" value="" . $dtitfac->tipodoc . "">
<input type="hidden" name="status" value="" . $status . ""><input type="hidden" name="monto" value="" . $monto . ""><input type="hidden" name="dolar" value="" . $debe . "">\xa <input type="hidden" name="cli2" value="" . $dtitfac->codcliente . "">\xa <td " . $promo . "><input type="checkbox" onclick="w3.toggleClass('#slect2" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtitfac->documento . " <b>Tasa</b> " . $dtitfac->tasaorg . "</td><td>" . $dtitfac->tipodoc . "</td><td>" . $nd . "</td><td>" . $dtitfac->fechacrea . "</td>\xa <td>" . $dtitfac->recepcion . "</td><td><b>V.I: </b>" . $dtitfac->vence . " <b>V.C: </b>" . $dtitfac->vencec . "</td><td><b>Ant: </b>" . ROUND($bsorg, 2) . " <b>Desp: </b>" . ROUND($bs, 2) . "</td><td>" . $index . " <b>Tasa:</b> " . $tasa->n . " <b>Day:</b> " . $dtitfac->diasindex . "</td>
<td><b>TOT: </b>" . $dtitfac->dolar . " <b>N/C: </b>" . $nc->totald . " <b>RET: </b>" . $ret->totald . "</td><td>" . $pagado->bs . " <b>Bs</b> " . $pagado->dolar . " <b>$</b></td><td>" . $monto . " <b>Bs</b> " . $debe . " <b>$</b></td>
<td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "</table>\xa "; return $html; } public function cobranza_igtf($a, $b) { $this->conciliabanc(); $this->load->library("table"); if ($b != '') { $filter = "&& (a.documento='{$b}' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL
FROM operti a
WHERE a.tipodoc='N/D' {$filter} && estatusdoc!='X' && a.documentofiscal='IGTF'
GROUP BY a.codcliente")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.codcliente,ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2) dolar FROM operti a
JOIN opermv b ON (b.documento=a.documento && b.tipodoc=a.tipodoc && b.nombre LIKE '%Cobro IGTF%')\xa WHERE a.tipodoc='N/D' " . $filter . " && estatusdoc!='X'\xa GROUP BY a.codcliente ORDER BY dolar DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . '')->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="cobranza_igtf();" id="likefac"></td>
<td class="w3-center w3-btn"><a onclick="movbanc();"><img src="" . base_url() . "images/dinero.png" alt="Consolidado Bancario" title="Consolidado Bancario" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="cobranza_igtf();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Cliente</th><th>Nombre</th><th>Telf</th><th>Total.Bs</th><th>Pagado</th><th>Debe</th><th>Estatus</th></tr>"; $i = 0; $debe = 0; foreach ($bdfac as $dtfac2) { $i++; $dtfac = $this->db->query("SELECT a.documento,a.codcliente,c.nombre,IF(c.telefonos!='',c.telefonos,IF(c.telefono_movil!='',c.telefono_movil,'N/A')) telf, ROUND(SUM(a.totalfinal),4) totalfinal, \xa ROUND((SELECT SUM(monto) FROM opercli WHERE idfac=a.documento),2) pbs\xa FROM operti a
JOIN cliempre c ON a.codcliente=c.codigo
WHERE a.tipodoc='N/D' && a.codcliente='{$dtfac2->codcliente}' && a.documentofiscal='IGTF'")->row(); $debe = ROUND($dtfac->totalfinal - $dtfac->pbs, 2); $html .= "<tr id="slect" . $i . "" class="item">"; if ($debe <= 3) { $status = "Listo"; $color = "w3-green"; } else { $status = "Pendiente"; $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->codcliente . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="checkcli">" . $dtfac->codcliente . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->telf . "</td><td>" . $dtfac->totalfinal . "</td><td>" . $dtfac->pbs . " <b>Bs</b> </td><td>" . $debe . " <b>Bs</b></td><td class="" . $color . "" onclick="itcobro_igtf($('#a" . $i . "').val());" style="cursor:pointer">" . $status . "</td>\xa </tr>"; } $html .= "<!--<tr><td class="w3-center w3-fondodroid" colspan="11"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr>--></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNumcza(){ before();
var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903"; var like=$("#likefac").val();\xa var datos = {
"pag" : DecrementNum,
"key" : key
};\xa
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/cobranza_igtf",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();
}\xa
});
}
function numpagcza(a){ before();\xa var key="droid903"; var like=$("#likefac").val();\xa \xa var datos = {\xa "key":key,\xa "pag" : a\xa };
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/cobranza_igtf",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();
}\xa
});
}
\xa function IncrimentNumcza(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#likefac").val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum\xa };\xa
$.ajax({
data: datos,
url: baseurl+"c_droid/cobranza_igtf",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#likefac").val(like); swal.close();\xa }
\xa });\xa }\xa </script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumcza();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagcza($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpagcza($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNumcza();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function itcobro_igtf($a) { $bditfac = $this->db->query("SELECT a.tipodoc,a.documento,a.referencia,a.antdoc,a.fechacrea,a.recepcion,a.vence,a.vencec,a.codcliente,\xa a.totald dolar,a.totalfinal,a.diasindex,
(SELECT moneda FROM opercli where idfac=a.documento group by moneda limit 1) tipopag
FROM operti a\xa WHERE a.codcliente='{$a}' && a.tipodoc='N/D' && a.totald>0 && a.documentofiscal='IGTF'\xa GROUP BY a.documento")->result(); $html = "
<a onclick="viewauditapag();" class="w3-btn"><img src="" . base_url() . "images/factura.png" alt="Estado Cuentas" title="Estado Cuentas" style="width:20px;height:20px;border:0;"></a>\xa <a onclick="movbanc();"><img src="" . base_url() . "images/dinero.png" alt="Consolidado Bancario" title="Consolidado Bancario" style="width:20px;height:20px;border:0;">
<a onclick="formpagos();"><img src="" . base_url() . "images/iconpag2.png" alt="Registrar Pago" title="Registrar Pago Efectivo" style="width:20px;height:20px;border:0;">\xa <a onclick="elimpago();" class="w3-btn"><img src="" . base_url() . "images/elimpago.png" alt="Eliminar Pago" title="Eliminar Pago" style="width:20px;height:20px;border:0;"></a>\xa <table class="w3-table-all w3-hoverable w3-left-align w3-tiny" style="width:100%;"><tr class="w3-fondodroid w3-fijo"><th>Documento</th><th>Referencia</th><th>Tipo</th><th>Fecha</th><th>Total Bs</th>\xa <th>Pagado</th><th>Debe</th><th>Estatus</th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $pagado = $this->db->query("SELECT IF(SUM(b1.monto)>0, SUM(b1.monto),0) bs FROM opercli b1 WHERE b1.idfac='{$dtitfac->documento}' && b1.idconsbanc IS NOT NULL")->row(); $debe = ROUND($dtitfac->totalfinal - $pagado->bs, 2); if ($debe <= 3) { $status = "Listo"; $color = "w3-green"; } else { $status = "Pendiente"; $color = "w3-red"; } $html .= "<tr id="slect2" . $i . ""><input type="hidden" name="doc2" value="" . $dtitfac->documento . ""><input type="hidden" name="tipodoc" value="" . $dtitfac->tipodoc . "">
<input type="hidden" name="status" value="" . $status . ""><input type="hidden" name="monto" value="" . $debe . ""><input type="hidden" name="dolar" value="" . $debe . "">\xa <input type="hidden" name="cli2" value="" . $dtitfac->codcliente . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect2" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtitfac->documento . "</td><td>" . $dtitfac->referencia . "</td><td>" . $dtitfac->tipodoc . "</td><td>" . $dtitfac->fechacrea . "</td>
<td>" . $dtitfac->totalfinal . " <b>Bs</b></td><td>" . $pagado->bs . " <b>Bs</b></td><td>" . $debe . " <b>Bs</b></b></td>\xa <td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "</table>"; return $html; } function elimpago($id) { if ($id > 0) { $this->db->query("DELETE FROM opercli WHERE idconsbanc='{$id}';"); $this->db->query("UPDATE consbanc SET STATUS='N' WHERE id='{$id}'"); if ($this->db->affected_rows() > 0) { $this->loguser("Anulacion Pago", "El usuario anula el pago " . $id . "."); } return $this->db->affected_rows(); } } function auditapag($doc, $tip) { return $this->db->query("SELECT a.idfac FAC,a.idconsbanc IDbanc,a.fech Fpago,a.tip tipo,a.moneda,a.ref referencia,(SELECT nom FROM banori WHERE id=a.bancori) origen, (SELECT nom FROM bandest WHERE id=a.bancdest) destino,
ROUND((SELECT oficial FROM monecam WHERE fecha<=(SELECT fechacrea FROM operti WHERE documento=a.idfac && tipodoc='{$tip}') ORDER BY fecha DESC LIMIT 1),2) tasaorg,
a.monto bs, a.montod dolar,monto/montod tasapago, a.observ, (SeLeCT nomape FROM trab where id=a.user) user, a.freg registro FROM opercli a WHERE a.idfac='{$doc}' && a.idconsbanc IS NOT NULL"); } public function movbanc($a, $b) { if ($b != '') { $filter = "WHERE monto>0 && (id='{$b}' || monto='{$b}' || descrip LIKE '%{$b}%' || ref='{$b}' || fac like '%{$b}%')"; } else { $filter = "WHERE monto>0 "; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT id,fech,ref,descrip,monto,banco,GROUP_CONCAT(fac) aplica FROM \xa (SELECT a.id,a.fech,a.ref,a.descrip,a.monto,(SELECT nom FROM bandest WHERE id=a.banco) banco, b.idfac fac FROM consbanc a LEFT JOIN opercli b on a.id=b.idconsbanc) \xa movbanc {$filter} GROUP BY id")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT id,fech,ref,descrip,monto,banco,codbanc,GROUP_CONCAT(fac) aplica,status FROM \xa (SELECT a.id,a.fech,a.ref,a.descrip,a.monto,(SELECT nom FROM bandest WHERE id=a.banco) banco,a.banco codbanc, b.idfac fac, a.status\xa FROM consbanc a LEFT JOIN opercli b on a.id=b.idconsbanc) movbanc {$filter} GROUP BY id ORDER BY fech DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . '')->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid w3-fijo">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="movbanc()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="formpagos2();"><img src="" . base_url() . "images/iconpag2.png" alt="Registrar Pago" title="Registrar Pago" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="desblokpag();"><img src="" . base_url() . "images/devolver.png" alt="Desbloquear Pago" title="Desbloquear Pago" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="movbanc();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo">\xa <th>ID</th><th>Fecha</th><th>Referencia</th><th>Descrip</th><th>monto</th><th>Banco</th><th>Aplica</th><th>Estatus</th>\xa </tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->status == "S") { $color = "class="w3-green""; $status = "Bien"; } else { $color = "class="w3-red""; $status = "Mal"; } $html .= "<tr id="slectmov" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" name="movfech" value="" . $dtfac->fech . ""><input type="hidden" name="movref" value="" . $dtfac->ref . ""><input type="hidden" name="movid" value="" . $dtfac->id . "">
<input type="hidden" name="movbanco" value="" . $dtfac->codbanc . ""> <input type="hidden" name="movmonto" value="" . $dtfac->monto . ""><input type="hidden" name="movstatus" value="" . $status . ""><input type="hidden" name="movaplica" value="" . $dtfac->aplica . "">
<td><input type="checkbox" onclick="w3.toggleClass('#slectmov" . $i . "','w3-yellow');" class="w3-check" name="checkmov">" . $dtfac->id . "</td>
<td>" . $dtfac->fech . "</td><td>" . $dtfac->ref . "</td><td>" . $dtfac->descrip . "</td><td>" . $dtfac->monto . "</td><td>" . $dtfac->banco . "</td><td>" . $dtfac->aplica . "</td><td " . $color . ">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Movimientos: " . $totalreg . "</b></label></td></tr></table>
\xa \xa <div id="modregpago2" class="w3-modal">
<div class="w3-modal-content w3-card-4" style="width: 500px;">\xa <header class="w3-container w3-fondodroid w3-padding-large">
<span onclick="w3.hide('#modregpago2');" class="w3-button w3-display-topright">×</span>\xa <h3 class="w3-center" style="color: #fff;text-shadow:1px 1px 0 #000"><b>Registrar Pago</b></h3>
</header>
<div class="w3-container w3-center"> <br><br>\xa\xa <table id="table" class="w3-table-all w3-centered w3-hoverable">
<input type="hidden" id="codbanc"><input type="hidden" id="numero"><input type="hidden" id="fbanco">\xa\x9 \x9\x9<tr>\xa <td class="w3-fondodroid">Tipo:</td>
<td><select class="w3-select w3-padding" id="tip" required>
<option value="" selected disabled>Seleccione</option><option value="TRANS">Transferencia</option><option value="PMOVI">Pago Movil</option><option value="EFECT">Efectivo</option>
<option value="OTROS">Otro Sobrante</option><option value="OTROF">Otro Faltante</option>\xa </select></td>
</tr>\xa\xa <tr>\xa <td class="w3-fondodroid">Banco Origen: </td>
<td><select class="w3-select w3-padding" id="bancocli" required>
<option value="" selected disabled>Seleccione</option>
</select></td>
</tr>\xa\xa <tr>\xa <td class="w3-fondodroid">Monto BS:</td>
<td id="view_montofac"></td>\xa <td class="w3-fondodroid">Monto Bancario:</td><td><input type="text" class="w3-input" id="movmonto" disabled></td>
</tr>
<tr>
<td class="w3-fondodroid">Descripcion:</td>\xa <td><textarea id="descrip" name="descrip" rows="4" placeholder="Descripcion..." maxlength="255" cols="25"></textarea>
</tr>\xa </table><br>
<input onclick="regpagosbs();" class="w3-btn w3-green w3-border w3-hover-white" value="Registrar"><br><br>
</div>
</div>
</div>
"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNum(){ before();
var DecrementNum=document.getElementById("DecrementNum").value;
var like=$("#like").val();
var key="droid903";\xa var datos = {
"pag" : DecrementNum,\xa "key" : key,"like":like
};
\xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/movbanc",\xa type: "POST",
success: function(data) {
$("#movbanc").html(data); $("#like").val(like); swal.close()\xa }
});
}\xa
function numpag(a){ before();
var key="droid903";
var like=$("#like").val();\xa var datos = {
"key":key,\xa "pag" : a,like:like\xa };\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/movbanc",\xa type: "POST",\xa success: function(data) {\xa $("#movbanc").html(data); $("#like").val(like); swal.close()\xa }\xa
});\xa }
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum,like:like\xa };
\xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/movbanc",
type: "POST",
success: function(data) {\xa $("#movbanc").html(data); $("#like").val(like); swal.close()
}
});
}\xa </script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } function desblokpag($id) { $this->db->query("UPDATE consbanc SET STATUS='N', noblock='S' WHERE id='{$id}';"); return $this->db->affected_rows(); } public function cuentascli($cli) { $this->load->library("table"); $bditfac = $this->db->query("SELECT Documento,codcliente Codigo,fechacrea Fecha,Vence,diascred Credito,Diasindex,Tasa,Totalbs,Indexbs,Totald,NC,RET,PagadoBs,pagadod Pagado$,totald-(pagadod+nc+ret) Debe$ FROM
(SELECT a.documento, a.codcliente,a.fechacrea,a.vence,a.diascred,a.diasindex, ROUND(a.totalfinal,2) totalbs,\xa ROUND(ROUND(IF(SUM(a.totald)>0, SUM(a.totald),0),2)*IF(b.fechdolar='0000-00-00',IF(CURDATE()<DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1))-a.totalfinal,2) indexbs
,ROUND(a.totald,2) totald,
IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,\xa IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET,\xa ROUND((SELECT IF(SUM(monto)>0,SUM(monto),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadobs,\xa ROUND((SELECT IF(SUM(montod)>0,SUM(montod),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadod,
IF(b.fechdolar='0000-00-00',IF(CURDATE()<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1)) tasa\xa FROM operti a JOIN control_operti b ON a.antdoc=b.doc WHERE a.codcliente='{$cli}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && totald>0
GROUP BY a.documento) estado_cuenta WHERE (totald-0.5)>(pagadod+NC+RET)
UNION \xa SELECT null Documento, null Codigo,null Fecha,null Recepcion,null Credito,null Diasindex,null Tasa, null Totalbs,null Indexbs,SUM(totald) Totald,NC,RET,null PagadoBs,SUM(pagadod) Pagado$,SUM(totald)-(SUM(pagadod)+SUM(nc)+SUM(ret)) Debe$ FROM
(SELECT ROUND(a.totald,2) totald,\xa IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,
IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET,\xa ROUND((SELECT IF(SUM(montod)>0,SUM(montod),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadod\xa FROM operti a JOIN control_operti b ON a.antdoc=b.doc WHERE a.codcliente='{$cli}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && totald>0
GROUP BY a.documento) estado_cuenta WHERE (totald-0.5)>(pagadod+NC+RET)"); $nom = $this->db->query("SELECT nombre n FROM cliempre WHERE codigo='{$cli}'")->row(); $html = "<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="assets/css/w3.css"></head><body>\xa <div class="w3-center w3-tiny"><img src="images/header.jpg" alt="Header" style="width:100%;"></div>\xa <h3 class="w3-center">Estado de Cuenta: " . $nom->n . "<h3>\xa <div class="w3-center">"; $html .= $this->table->generate($bditfac); $html .= "</div></body></html>"; return $html; } function valcontribuy($doc) { $cli = $this->db->query("SELECT codcliente FROM operti WHERE (tipodoc='FAC' || tipodoc='NOT') && documento='{$doc}'")->row()->codcliente; $val = $this->db->query("SELECT NULL FROM operti WHERE codcliente='{$cli}' && tipodoc='RET'")->num_rows(); return $val; } function genendfac($doc, $tip) { $antdoc = $this->db->query("SELECT totald,antdoc n FROM operti WHERE documento='{$doc}' && tipodoc='{$tip}'")->row(); $fecha = $this->db->query("SELECT IF(max(a.fech) IS NOT NULL,max(a.fech),curdate()) n FROM opercli a JOIN operti b ON a.idfac=b.documento WHERE b.antdoc='{$antdoc->n}' && (b.tipodoc='FAC' || b.tipodoc='NOT') LIMIT 1")->row(); $bd = $this->db->query("SELECT NULL FROM operti WHERE antdoc='{$antdoc->n}' && tipodoc='N/D' && (estatusdoc='0' || estatusdoc='1')")->num_rows(); if ($bd == 0) { $bd2 = $this->db->query("SELECT a.fechacrea,a.tipodoc,a.documento,a.codcliente,a.nombrecli,a.rif,a.direccion,a.telefonos,a.diascred,a.vendedor,a.sector,a.subcodigo,
a.totalfinal,a.totneto,a.baseimpo1,a.totimpuest,a.sinimpuest,a.totald,ROUND(a.totalfinal,2) totalfinal,
IF(b.fechdolar='0000-00-00',IF('{$fecha->n}'<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),IF(b.fechdolar<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1))) tasa,\xa (SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasaorg\xa FROM operti a JOIN control_operti b ON a.antdoc=b.doc JOIN cliempre c ON a.codcliente=c.codigo WHERE a.antdoc='{$antdoc->n}' && (a.tipodoc='FAC' || a.tipodoc='NOT') GROUP BY a.antdoc")->row(); $valpag = $this->db->query("SELECT SUM(montod) montod FROM opercli a WHERE a.idfac='{$bd2->documento}' && a.idconsbanc IS NOT NULL;")->row(); $nc = $this->db->query("SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac='{$bd2->documento}'")->row(); $ret = $this->db->query("SELECT ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti a WHERE a.antdoc='{$antdoc->n}' && a.tipodoc='RET'")->row(); $totald = $bd2->totald - $nc->totald - $ret->totald; $bsorg = $totald * $bd2->tasaorg; if ($valpag->montod - 0.1 <= $totald) { $num = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/D'")->row(); $newdoc = str_pad($num->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $bdab = $this->db->query("SELECT a.fech,a.monto,a.montod,(SELECT oficial FROM monecam WHERE fecha<=a.fech ORDER BY fecha DESC LIMIT 1) tasa FROM opercli a WHERE a.idfac='{$bd2->documento}' && a.idconsbanc IS NOT NULL;")->result(); $bs = 0; $dtotneto = ROUND($bd2->totneto / $bd2->tasaorg, 2); $dbaseimpo = ROUND($bd2->baseimpo1 / $bd2->tasaorg, 2); $dtotimpuest = ROUND($bd2->totimpuest / $bd2->tasaorg, 2); $dsinimpuest = ROUND($bd2->sinimpuest / $bd2->tasaorg, 2); $bstotneto2 = $bd2->totneto; $bsbaseimpo2 = $bd2->baseimpo1; $bstotimpuest2 = $bd2->totimpuest; $bssinimpuest2 = $bd2->sinimpuest; if ($nc->totald > 0) { $porcent_nc = ROUND($nc->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } if ($ret->totald > 0) { $porcent_nc = ROUND($ret->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } $bstotneto = 0; $bsbaseimpo = 0; $bstotimpuest = 0; $bssinimpuest = 0; $porcent = 0; foreach ($bdab as $dbab) { $porcent = ROUND($dbab->montod * 100 / $totald, 2); $bstotneto += ROUND($dtotneto * ($porcent / 100) * $dbab->tasa, 2); $bsbaseimpo += ROUND($dbaseimpo * ($porcent / 100) * $dbab->tasa, 2); $bstotimpuest += ROUND($dtotimpuest * ($porcent / 100) * $dbab->tasa, 2); $bssinimpuest += ROUND($dsinimpuest * ($porcent / 100) * $dbab->tasa, 2); } $bs = $bstotneto + $bstotimpuest; if ($bs > $bsorg) { $debe = $bs - $bsorg; $newtotd = $debe / $bd2->tasa; $totneto = $bstotneto - $bstotneto2; $baseimpo = $bsbaseimpo - $bsbaseimpo2; $totimpuest = $bstotimpuest - $bstotimpuest2; $sinimpuest = $bssinimpuest - $bssinimpuest2; $total = $totneto + $totimpuest; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "documento" => $newdoc, "grupo" => "N/A", "origen" => "1", "codigo" => "N/A", "pid" => '' . $pid . '', "nombre" => "Ajuste por diferencial cambiario segun Factura: " . $bd2->documento . " de Fecha " . DateTime::createFromFormat("Y-m-d", $bd2->fechacrea)->format("d/m/Y") . " por un Monto " . $bd2->totalfinal . " BsS.", "costounit" => 0, "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "preciofin" => 0, "preciooriginal" => 0, "cantidad" => 1, "montoneto" => $totneto, "montototal" => $total, "timpueprc" => 0, "almacen" => "02", "proveedor" => "N/A", "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $bd2->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => "0", "baseimpo2" => "0", "lote" => "N/A", "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $datos); $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "moneda" => "000", "documento" => $newdoc, "codcliente" => '' . $bd2->codcliente . '', "nombrecli" => '' . $bd2->nombrecli . '', "contacto" => "N/A", "rif" => '' . $bd2->rif . '', "direccion" => '' . $bd2->direccion . '', "telefonos" => '' . $bd2->telefonos . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => 0, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => '' . $total . '', "totimpuest" => $totimpuest, "totdescuen" => 0, "impuesto1" => 0, "impuesto2" => "0", "dsctolinea" => 0, "diascred" => $bd2->diascred, "vendedor" => '' . $bd2->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $bd2->vendedor . '', "estacion" => "001", "sinimpuest" => $sinimpuest, "almacen" => "02", "sector" => '' . $bd2->sector . '', "subcodigo" => '' . $bd2->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimpo, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => $antdoc->n, "referencia" => $bd2->tipodoc . $bd2->documento, "totald" => $newtotd); $this->db->insert("operti", $datos2); $this->db->query("UPDATE control_operti set fechdolar='{$fecha->n}' WHERE doc='{$antdoc->n}' && fechdolar='0000-00-00'"); $this->generecpag($antdoc->n); } else { $this->db->query("UPDATE control_operti set fechdolar='{$bd2->fechacrea}' WHERE doc='{$antdoc->n}' && fechdolar='0000-00-00'"); $this->generecpag($antdoc->n); } } } else { $this->generecpag($antdoc->n); } return 1; } function noindexfac($a) { $bd = $this->db->query("SELECT fechacrea,antdoc FROM operti WHERe documento='{$a}'")->row(); $this->db->query("UPDATE control_operti set fechdolar='{$bd->fechacrea}' WHERE doc='{$bd->antdoc}'"); $this->loguser("No INDEX", "El usuario no indexa el documento:" . $a . ''); return $this->db->affected_rows(); } function noindexfac2($a) { $bd = $this->db->query("SELECT fechacrea,antdoc FROM operti WHERe documento='{$a}'")->row(); $this->db->query("UPDATE opercli a SET montod=monto/(SELECT oficial FROM monecam WHERE fecha<=(SELECT fechacrea FROM operti WHERE documento=a.idfac) ORDER BY fecha DESC LIMIT 1) WHERE a.idfac='{$a}';"); $this->db->query("UPDATE control_operti set fechdolar='{$bd->fechacrea}' WHERE doc='{$bd->antdoc}'"); $this->loguser("No INDEX", "El usuario no indexa el documento:" . $a . ''); return $this->db->affected_rows(); } function ajustepagos($a) { $bd = $this->db->query("SELECT b.fech,a.antdoc FROM operti a JOIN opercli b ON a.documento=b.idfac WHERe a.documento='{$a}' && b.idconsbanc IS NOT NULL ORDER BY b.fech DESC LIMIT 1")->row(); $this->db->query("UPDATE opercli a JOIN operti b ON a.idfac=b.documento \xa SET a.montod=a.monto/IF(a.fech<=DATE_ADD(b.recepcion,INTERVAL b.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=b.fechacrea ORDER BY fecha DESC LIMIT 1),\xa (SELECT oficial FROM monecam WHERE fecha<=a.fech ORDER BY fecha DESC LIMIT 1)) WHERE a.idfac='{$a}';"); $this->db->query("UPDATE control_operti set fechdolar='{$bd->fech}' WHERE doc='{$bd->antdoc}'"); $this->loguser("Ajuste Pagos", "El usuario ajusta los pagos para el documento:" . $a . ''); return $this->db->affected_rows(); } function transpagos($doc, $dest, $mont) { $db = $this->db->query("SELECT id,idconsbanc,monto,montod, monto/montod tasa,fech,tip,moneda,ref,bancori,bancdest,user,freg FROM opercli WHERE idfac='{$doc}' && idconsbanc IS NOT NULL ORDER BY montod DESC LIMIT 1")->row(); $val = $this->db->query("SELECT a.antdoc,SUM(b.montod) totpag,a.totald,COUNT(*) item FROM operti a JOIN opercli b ON a.documento=b.idfac WHERE a.documento='{$doc}' && b.idconsbanc IS NOT NULL")->row(); $nc = $this->db->query("SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac='{$doc}'")->row(); $ret = $this->db->query("SELECT ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti a WHERE a.antdoc='{$val->antdoc}' && a.tipodoc='RET'")->row(); $sobra = $val->totpag - ($val->totald - $nc->totald - $ret->totald); if ($val->item > 0 && $sobra >= $mont) { $bs = ROUND($mont * $db->tasa, 2); $val2 = $this->db->query("SELECT NULL FROM opercli WHERE idfac='{$dest}' && idconsbanc='{$db->idconsbanc}' && fech='{$db->fech}'")->num_rows(); if ($val2 == 0) { $this->db->insert("opercli", array("id" => $db->id, "idfac" => $dest, "idconsbanc" => $db->idconsbanc, "fech" => $db->fech, "tip" => $db->tip, "moneda" => $db->moneda, "ref" => $db->ref, "bancori" => $db->bancori, "bancdest" => $db->bancdest, "monto" => $bs, "montod" => $mont, "observ" => "transferencia de " . $doc . " para " . $dest, "user" => $db->user, "recibo" => 0, "freg" => $db->freg)); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE opercli set monto=monto-{$bs},montod=montod-{$mont} WHERE idfac='{$doc}' && id='{$db->id}' && idconsbanc='{$db->idconsbanc}' && monto='{$db->monto}' && montod='{$db->montod}' LIMIT 1"); $this->loguser("Trans Pagos", "El usuario transfiere " . $mont . " de " . $doc . " para " . $dest . ''); return $this->db->affected_rows(); } } else { $this->db->query("UPDATE opercli set monto=monto+{$bs},montod=montod+{$mont} WHERE idfac='{$dest}' && idconsbanc='{$db->idconsbanc}' && fech='{$db->fech}' LIMIT 1"); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE opercli set monto=monto-{$bs},montod=montod-{$mont} WHERE idfac='{$doc}' && id='{$db->id}' && idconsbanc='{$db->idconsbanc}' && monto='{$db->monto}' && montod='{$db->montod}' LIMIT 1"); $this->loguser("Trans Pagos", "El usuario transfiere " . $mont . " de " . $doc . " para " . $dest . ''); return $this->db->affected_rows(); } } } } function indexfac($a) { $fecha = $this->db->query("SELECT IF(max(a.fech) IS NOT NULL,max(a.fech),curdate()) n FROM opercli a JOIN operti b ON a.idfac=b.documento WHERE b.antdoc='{$a}' && (b.tipodoc='FAC' || b.tipodoc='NOT') LIMIT 1")->row(); $bd = $this->db->query("SELECT NULL FROM operti WHERE antdoc='{$a}' && tipodoc='N/D' && (estatusdoc='0' || estatusdoc='1')")->num_rows(); if ($bd == 0 && $fecha->n >= "2023-09-26") { $bd2 = $this->db->query("SELECT a.fechacrea,a.tipodoc,a.documento,a.codcliente,a.nombrecli,a.rif,a.direccion,a.telefonos,a.diascred,a.vendedor,a.sector,a.subcodigo,
a.totalfinal,a.totneto,a.baseimpo1,a.totimpuest,a.sinimpuest,a.totald,ROUND(a.totalfinal,2) totalfinal,
IF(b.fechdolar='0000-00-00',IF('{$fecha->n}'<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1)),IF(b.fechdolar<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1),(SELECT oficial FROM monecam WHERE fecha<=b.fechdolar ORDER BY fecha DESC LIMIT 1))) tasa,\xa (SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasaorg
FROM operti a JOIN control_operti b ON a.antdoc=b.doc JOIN cliempre c ON a.codcliente=c.codigo WHERE a.antdoc='{$a}' && a.tipodoc='FAC' GROUP BY a.antdoc")->row(); $valpag = $this->db->query("SELECT SUM(montod) montod FROM opercli a WHERE a.idfac='{$bd2->documento}' && a.idconsbanc IS NOT NULL;")->row(); $nc = $this->db->query("SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac='{$bd2->documento}'")->row(); $ret = $this->db->query("SELECT ROUND(SUM(a.totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti a WHERE a.antdoc='{$a}' && a.tipodoc='RET'")->row(); if ($bd2->tasa < $bd2->tasaorg) { $bd2->tasa = $bd2->tasaorg; } $totald = $bd2->totald - $nc->totald - $ret->totald; $bsorg = $totald * $bd2->tasaorg; if ($valpag->montod <= $totald) { $num = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/D'")->row(); $newdoc = str_pad($num->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $bdab = $this->db->query("SELECT a.fech,a.monto,a.montod,(SELECT oficial FROM monecam WHERE fecha<=a.fech ORDER BY fecha DESC LIMIT 1) tasa FROM opercli a WHERE a.idfac='{$bd2->documento}' && a.idconsbanc IS NOT NULL;")->result(); $bs = 0; $dtotneto = ROUND($bd2->totneto / $bd2->tasaorg, 2); $dbaseimpo = ROUND($bd2->baseimpo1 / $bd2->tasaorg, 2); $dtotimpuest = ROUND($bd2->totimpuest / $bd2->tasaorg, 2); $dsinimpuest = ROUND($bd2->sinimpuest / $bd2->tasaorg, 2); $bstotneto2 = $bd2->totneto; $bsbaseimpo2 = $bd2->baseimpo1; $bstotimpuest2 = $bd2->totimpuest; $bssinimpuest2 = $bd2->sinimpuest; if ($nc->totald > 0) { $porcent_nc = ROUND($nc->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } if ($ret->totald > 0) { $porcent_nc = ROUND($ret->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } $bstotneto = 0; $bsbaseimpo = 0; $bstotimpuest = 0; $bssinimpuest = 0; $porcent = 0; foreach ($bdab as $dbab) { $porcent = ROUND($dbab->montod * 100 / $totald, 2); $bstotneto += ROUND($dtotneto * ($porcent / 100) * $dbab->tasa, 2); $bsbaseimpo += ROUND($dbaseimpo * ($porcent / 100) * $dbab->tasa, 2); $bstotimpuest += ROUND($dtotimpuest * ($porcent / 100) * $dbab->tasa, 2); $bssinimpuest += ROUND($dsinimpuest * ($porcent / 100) * $dbab->tasa, 2); } $bs = $bstotneto + $bstotimpuest; $dolar = 0.5 * $bd2->tasaorg; if ($bs > $bsorg + $dolar) { $debe = $bs - $bsorg; $newtotd = $debe / $bd2->tasa; $totneto = $bstotneto - $bstotneto2; $baseimpo = $bsbaseimpo - $bsbaseimpo2; $totimpuest = $bstotimpuest - $bstotimpuest2; $sinimpuest = $bssinimpuest - $bssinimpuest2; $total = $totneto + $totimpuest; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "documento" => $newdoc, "grupo" => "N/A", "origen" => "1", "codigo" => "N/A", "pid" => '' . $pid . '', "nombre" => "Ajuste por diferencial cambiario segun Factura: " . $bd2->documento . " de Fecha " . DateTime::createFromFormat("Y-m-d", $bd2->fechacrea)->format("d/m/Y") . " por un Monto " . $bd2->totalfinal . " BsS.", "costounit" => 0, "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "preciofin" => 0, "preciooriginal" => 0, "cantidad" => 1, "montoneto" => $totneto, "montototal" => $total, "timpueprc" => 0, "almacen" => "02", "proveedor" => "N/A", "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '' . $bd2->vendedor . '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => "0", "baseimpo2" => "0", "lote" => "N/A", "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $datos); $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "moneda" => "000", "documento" => $newdoc, "codcliente" => '' . $bd2->codcliente . '', "nombrecli" => '' . $bd2->nombrecli . '', "contacto" => "N/A", "rif" => '' . $bd2->rif . '', "direccion" => '' . $bd2->direccion . '', "telefonos" => '' . $bd2->telefonos . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => 0, "totbruto" => $totneto, "totneto" => $totneto, "totalfinal" => '' . $total . '', "totimpuest" => $totimpuest, "totdescuen" => 0, "impuesto1" => 0, "impuesto2" => "0", "dsctolinea" => 0, "diascred" => $bd2->diascred, "vendedor" => '' . $bd2->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $bd2->vendedor . '', "estacion" => "001", "sinimpuest" => $sinimpuest, "almacen" => "02", "sector" => '' . $bd2->sector . '', "subcodigo" => '' . $bd2->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => $baseimpo, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => $a, "referencia" => $bd2->tipodoc . $bd2->documento, "totald" => $newtotd); $this->db->insert("operti", $datos2); $this->db->query("UPDATE control_operti set fechdolar='{$fecha->n}' WHERE doc='{$a}' && fechdolar='0000-00-00'"); $this->generecpag($a); } else { $this->db->query("UPDATE control_operti set fechdolar='{$bd2->fechacrea}' WHERE doc='{$a}' && fechdolar='0000-00-00'"); $this->generecpag($a); } } } else { $this->generecpag($a); } } function igtf($fac, $fpago, $monto) { $bd2 = $this->db->query("SELECT *,COUNT(*) item FROM operti WHERE documento='{$fac}' && tipodoc='FAC'")->row(); if ($bd2->item > 0) { $tasa = $this->db->query("SELECT oficial FROM monecam WHERE fecha<='{$fpago}' ORDER BY fecha DESC LIMIT 1")->row()->oficial; $num = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='N/D'")->row(); $newdoc = str_pad($num->n, 8, "0", STR_PAD_LEFT); $pid = $this->genecod(12); $totald = $monto * 0.03; $total = $totald * $tasa; $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "documento" => $newdoc, "grupo" => "N/A", "origen" => "1", "codigo" => "N/A", "pid" => '' . $pid . '', "nombre" => "Cobro IGTF 3% en moneda extranjera segun Factura: " . $bd2->documento . " de Fecha " . DateTime::createFromFormat("Y-m-d", $bd2->fechacrea)->format("d/m/Y") . " por un Monto " . $bd2->totalfinal . " BsS.", "costounit" => 0, "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "preciofin" => 0, "preciooriginal" => 0, "cantidad" => 1, "montoneto" => $total, "montototal" => $total, "timpueprc" => 0, "almacen" => "02", "proveedor" => "N/A", "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => $bd2->vendedor, "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => "1", "estacion" => "001", "udinamica" => "1", "baseimpo1" => "0", "baseimpo2" => "0", "lote" => "N/A", "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0", "status" => 1); $this->db->insert("opermv", $datos); $datos2 = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "N/D", "moneda" => "000", "documento" => $newdoc, "codcliente" => '' . $bd2->codcliente . '', "nombrecli" => '' . $bd2->nombrecli . '', "contacto" => "N/A", "rif" => '' . $bd2->rif . '', "direccion" => '' . $bd2->direccion . '', "telefonos" => '' . $bd2->telefonos . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => 0, "totbruto" => 0, "totneto" => 0, "totalfinal" => '' . $total . '', "totimpuest" => 0, "totdescuen" => 0, "impuesto1" => 0, "impuesto2" => "0", "dsctolinea" => 0, "diascred" => $bd2->diascred, "vendedor" => '' . $bd2->vendedor . '', "factorcamb" => "1", "uemisor" => '' . $bd2->vendedor . '', "estacion" => "001", "sinimpuest" => 0, "almacen" => "02", "sector" => '' . $bd2->sector . '', "subcodigo" => '' . $bd2->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => 0, "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "IGTF", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "ESP", "antdoc" => $bd2->antdoc, "referencia" => $bd2->tipodoc . $bd2->documento, "totald" => $totald); $this->db->insert("operti", $datos2); } } public function mcuenta($bduser) { $bd = $this->db->query("SELECT id cod_banc, nom nomb_banc from banori WHERE id NOT IN (54) order by nom asc"); return $bd->result_array(); } public function bancos() { $bd = $this->db->query("SELECT id cod_banc, nom nomb_banc from bandest WHERE moneda='VE' order by nom asc"); return $bd->result_array(); } public function bancos2() { $bd = $this->db->query("SELECT id cod_banc, nom nomb_banc from bandest WHERE moneda='USD' order by nom asc"); return $bd->result_array(); } public function selectbancos() { $bd = $this->db->query("SELECT id cod_banc, nom nomb_banc from bandest"); return $bd->result_array(); } public function selectzona() { $bd = $this->db->query("SELECT concat(codigo,subcodigo) cod,subsector nom from subsectores ORDER BY nom ASC"); return $bd->result(); } function tasabcv($fh) { return $this->db->query("SELECT oficial FROM monecam WHERE fecha<='{$fh}' ORDER BY fecha DESC LIMIT 1")->row()->oficial; } public function regpagado($data, $b) { $user = $this->session->userdata("cod"); $rows = count($data["fac"]); $fac = $data["fac"]; $mfac = $data["mfac"]; $j = 0; $num = $this->db->query("SELECT MAX(id)+1 id FROM opercli")->row(); $id = $num->id; if ($id == null) { $id = 1; } if ($data["tip"] == "EFECT" || $data["tip"] == "OTROS" || $data["tip"] == "OTROF") { $valida = 0; } else { $valida = null; } for ($i = 0; $i < $rows; $i++) { $val1 = $this->db->query("SELECT COUNT(*) item FROM operti WHERE documento='" . $fac[$i] . "' && (recepcion>fechacrea || sector='10') ")->row()->item; if ($fac[$i] != '' && $val1 > 0) { $dfac = $this->db->query("SELECT IF('" . $data["fbanco"] . "'<=DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY),a.fechacrea,'" . $data["fbanco"] . "') fecha FROM operti a JOIN control_operti b ON a.antdoc=b.doc WHERE a.documento='" . $fac[$i] . "' GROUP BY a.documento")->row(); $tasa = $this->db->query("SELECT oficial FROM monecam WHERE fecha<='{$dfac->fecha}' ORDER BY fecha DESC LIMIT 1")->row(); if ($b == "VE") { $totd = $mfac[$i] / $tasa->oficial; $totbs = $mfac[$i]; } else { $totd = $mfac[$i]; $totbs = $mfac[$i] * $tasa->oficial; $this->igtf($fac[$i], $data["fbanco"], $mfac[$i]); } $datos = array("id" => $id, "idfac" => $fac[$i], "idconsbanc" => $valida, "fech" => $data["fbanco"], "tip" => $data["tip"], "moneda" => $b, "ref" => $data["numero"], "bancori" => $data["bancocli"], "bancdest" => $data["codbanc"], "monto" => $totbs, "montod" => $totd, "observ" => $data["descrip"], "user" => $user, "freg" => date("Y-m-d")); $this->db->insert("opercli", $datos); if ($this->db->affected_rows() > 0) { $j++; if ($valida == 0) { $antdoc = $this->db->query("SELECT antdoc FROM operti WHERE documento='{$fac[$i]}'")->row(); $this->generecpag($antdoc->antdoc); $this->loguser("Pago", "El usuario registro un pago: " . $totbs . " Bs, " . $totd . " $ Oficial: " . $tasa->oficial . " Fecha: " . $data["fbanco"] . " Moneda: " . $b . " para el documento " . $fac[$i] . ''); } } } } if ($j > 0) { $this->conciliabanc(); } return $j; } function conciliabanc() { $bd = $this->db->query("SELECT b.antdoc,a.id,b.rif,a.fech,a.ref,a.bancdest,a.tip,a.moneda,SUM(a.monto) monto,SUM(a.montod) montod
FROM opercli a\xa JOIN operti b ON a.idfac=b.documento\xa WHERE a.idconsbanc IS NULL GROUP BY a.id,b.codcliente;"); $i = 0; $rows = $bd->num_rows(); if ($bd->num_rows() > 0) { foreach ($bd->result() as $db) { if ($db->moneda == "VE") { $bd2 = $this->db->query("SELECT id FROM bandest WHERE moneda='VE'")->result(); foreach ($bd2 as $db2) { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->rif}%' || ref='{$db->ref}') && monto='{$db->monto}'"); } else { if ($db->tip == "PMOVI") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->ref}%' || ref='{$db->ref}') && monto='{$db->monto}'"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->monto}'"); } else { if ($db->tip == "PMOVI") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->monto}'"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } } } } if ($db->moneda == "USD") { $bd2 = $this->db->query("SELECT id FROM bandest WHERE moneda='USD'")->result(); foreach ($bd2 as $db2) { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->rif}%' || ref='{$db->ref}') && monto='{$db->montod}'"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->montod}'"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } } } } } } if ($rows > $i) { $bd = $this->db->query("SELECT a.id,a.idfac,b.rif,a.fech,a.ref,a.bancdest,a.tip,a.moneda,a.monto,a.montod,b.antdoc
FROM opercli a\xa JOIN operti b ON a.idfac=b.documento\xa WHERE a.idconsbanc IS NULL"); if ($bd->num_rows() > 0) { foreach ($bd->result() as $db) { if ($db->moneda == "VE") { $bd2 = $this->db->query("SELECT id FROM bandest WHERE moneda='VE'")->result(); foreach ($bd2 as $db2) { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->rif}%' || ref='{$db->ref}') && monto='{$db->monto}'"); } else { if ($db->tip == "PMOVI") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->ref}%' || ref='{$db->ref}') && monto='{$db->monto}'"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}' && idfac='{$db->idfac}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->monto}'"); } else { if ($db->tip == "PMOVI") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->monto}'"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}' && idfac='{$db->idfac}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } } } } if ($db->moneda == "USD") { $bd2 = $this->db->query("SELECT id FROM bandest WHERE moneda='USD'")->result(); foreach ($bd2 as $db2) { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->rif}%' || ref='{$db->ref}') && monto='{$db->montod}'"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}' && idfac='{$db->idfac}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->montod}'"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE opercli SET idconsbanc='{$db3->id}' WHERE id='{$db->id}' && idfac='{$db->idfac}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); $this->generecpag($db->antdoc); } } } } } } } } $this->db->query("DELETE FROM opercli WHERE freg<=DATE_SUB(CURDATE(),INTERVAL 6 DAY) && idconsbanc IS NULL"); $this->db->query("UPDATE consbanc SET status='S' WHERE fech<=DATE_SUB(CURDATE(),INTERVAL 30 DAY) && status='N' && noblock='N'"); } function conciliabanc_pagos() { $bd = $this->db->query("SELECT a.id,(SELECT rif FROM proveed WHERE id=b.proveed) rif,a.fech,a.ref,a.bancdest,a.tip,a.moneda,a.monto\xa FROM operprov a\xa JOIN compras b ON a.idfac=b.documento\xa WHERE a.idconsbanc IS NULL GROUP BY a.id"); $i = 0; $rows = $bd->num_rows(); if ($bd->num_rows() > 0) { foreach ($bd->result() as $db) { if ($db->moneda == "VE") { $bd2 = $this->db->query("SELECT id FROM bandest WHERE moneda='VE'")->result(); foreach ($bd2 as $db2) { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->rif}%' || ref='{$db->ref}') && monto='{$db->monto}'"); } else { if ($db->tip == "PMOVI") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && (descrip LIKE '%{$db->ref}%' || ref='{$db->ref}') && monto='{$db->monto}'"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE operprov SET idconsbanc='{$db3->id}' WHERE id='{$db->id}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); } } else { if ($db->tip == "TRANS") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->monto}'"); } else { if ($db->tip == "PMOVI") { $bd3 = $this->db->query("SELECT id FROM consbanc WHERE banco='{$db2->id}' && status='N' && fech='{$db->fech}' && monto='{$db->monto}'"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("UPDATE operprov SET idconsbanc='{$db3->id}' WHERE id='{$db->id}'"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE consbanc SET status='S' WHERE id='{$db3->id}'"); } } } } } } } $this->db->query("DELETE FROM operprov WHERE freg<=DATE_SUB(CURDATE(),INTERVAL 6 DAY) && idconsbanc IS NULL"); $this->db->query("UPDATE consbanc SET status='S' WHERE fech<=DATE_SUB(CURDATE(),INTERVAL 30 DAY) && status='N' && noblock='N'"); } function excelcban($a, $b, $c, $d, $e) { $val = $this->db->query("SELECT NULL FROM consbanc WHERE ref='{$b}' && monto='{$d}' && banco='{$e}'")->num_rows(); if ($val == 0) { $data = array("fech" => $a, "ref" => $b, "descrip" => $c, "monto" => $d, "banco" => $e); $this->db->insert("consbanc", $data); return $this->db->affected_rows(); } } function excellote($alm, $cod, $lot, $cant, $tip, $elab, $venc) { $v = 0; if ($alm != '' && $cod != '' && $lot != '' && $cant != '' && $tip != '' && $venc != '') { if ($tip == "1") { $ajusteinv = array("tipo" => $tip, "codigo" => $cod, "lote" => $lot, "dlote" => $lot, "alm" => $alm, "dalm" => $alm, "cant" => $cant, "fech" => date("Y-m-d")); $this->db->insert("ajusteinv", $ajusteinv); if ($this->db->affected_rows() > 0) { $vallot = $this->db->query("SELECT NULL FROM artilotes WHERE almacen='{$alm}' && codigoart='{$cod}' && lote='{$lot}'")->num_rows(); if ($vallot > 0) { $this->db->query("UPDATE artilotes set cantidad=cantidad+'{$cant}' WHERE almacen='{$alm}' && codigoart='{$cod}' && lote='{$lot}'"); if ($this->db->affected_rows() > 0) { $v++; $this->loguser("Ajuste Inventario", "El usuario realiza el proceso:" . $tip . " para almacen:" . $alm . " producto:" . $cod . " lote:" . $lot . " elab:" . $elab . " vence:" . $venc . " cant:" . $cant . ''); $this->db->query("UPDATE articulo set existencia=existencia+'{$cant}' WHERE codigo='{$cod}'"); } } else { $lote = array("id_empresa" => "DMEDIF", "agencia" => "001", "almacen" => $alm, "codigoart" => $cod, "lote" => $lot, "elab" => $elab, "vence" => $venc, "cantidad" => $cant, "recepcion" => date("Y-m-d")); $this->db->insert("artilotes", $lote); if ($this->db->affected_rows() > 0) { $v++; $this->loguser("Ajuste Inventario", "El usuario realiza el proceso:" . $tip . " para almacen:" . $alm . " producto:" . $cod . " lote:" . $lot . " elab:" . $elab . " vence:" . $venc . " cant:" . $cant . ''); $this->db->query("UPDATE articulo set existencia=existencia+'{$cant}' WHERE codigo='{$cod}'"); } } } } else { if ($tip == "0") { $vallot = $this->db->query("SELECT NULL FROM artilotes WHERE almacen='{$alm}' && codigoart='{$cod}' && lote='{$lot}' && (cantidad-consumido)>='{$cant}'")->num_rows(); if ($vallot > 0) { $ajusteinv = array("tipo" => $tip, "codigo" => $cod, "lote" => $lot, "dlote" => $lot, "alm" => $alm, "dalm" => $alm, "cant" => $cant, "fech" => date("Y-m-d")); $this->db->insert("ajusteinv", $ajusteinv); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE artilotes set cantidad=cantidad-'{$cant}' WHERE almacen='{$alm}' && codigoart='{$cod}' && lote='{$lot}'"); if ($this->db->affected_rows() > 0) { $v++; $this->loguser("Ajuste Inventario", "El usuario realiza el proceso:" . $tip . " para almacen:" . $alm . " producto:" . $cod . " lote:" . $lot . " elab:" . $elab . " vence:" . $venc . " cant:" . $cant . ''); $this->db->query("UPDATE articulo set existencia=existencia-'{$cant}' WHERE codigo='{$cod}'"); } } } } } } return $v; } function limpiadrog($drog) { if ($drog == 1) { $this->db->query("TRUNCATE drocerca;"); } if ($drog == 2) { $this->db->query("TRUNCATE mastranto;"); } if ($drog == 3) { $this->db->query("TRUNCATE santoremedio;"); } if ($drog == 4) { $this->db->query("TRUNCATE drolanca;"); } if ($drog == 5) { $this->db->query("TRUNCATE dronena;"); } } function exceldrogueria($cod, $barr, $nom, $prc, $drog) { if ($cod != '' && $cod != null) { if ($drog == "1") { $data = array("codigo" => $cod, "barra" => $barr, "nombre" => $nom, "precio" => $prc); $this->db->insert("drocerca", $data); } if ($drog == "2") { $tasa = $this->db->query("SELECT oficial n FROM monecam WHERe fecha IN (SELECT MAX(FECHA) FROM monecam)")->row(); $precio = $prc * $tasa->n; $cod = $this->db->escape($cod); $nom = $this->db->escape($nom); $data = array("codigo" => trim($cod, "'"), "barra" => $barr, "nombre" => trim($nom, "'"), "precio" => $precio); $this->db->insert("mastranto", $data); } if ($drog == "3") { $cod = $this->db->escape($cod); $nom = $this->db->escape($nom); $data = array("codigo" => trim($cod, "'"), "barra" => $barr, "nombre" => trim($nom, "'"), "precio" => $prc); $this->db->insert("santoremedio", $data); } } return $this->db->affected_rows(); } function inv_drocerca($data) { $this->db->insert("drocerca", $data); } function inv_drolanca($data) { $this->db->insert("drolanca", $data); } function inv_dronena($data) { $this->db->insert("dronena", $data); } function generecpag($a) { $bd = $this->db->query("SELECT a.id,a.idfac,b.codcliente,b.nombrecli,b.rif,b.direccion, b.telefonos,a.monto,c.fechdolar,b.vendedor,b.sector,b.subcodigo,\xa CONCAT(b.tipodoc,b.documento) referencia,a.observ notas,(SELECT oficial FROM monecam WHERE fecha<=a.fech ORDER BY fecha DESC LIMIT 1) tasa FROM opercli a \xa JOIN operti b ON a.idfac=b.documento JOIN control_operti c ON b.antdoc=c.doc WHERE b.antdoc='{$a}' && a.idconsbanc IS NOT NULL && a.recibo=0 GROUP BY a.id,a.idfac;")->result(); $user = $this->session->userdata("cod"); foreach ($bd as $db) { $num = $this->db->query("SELECT MAX(SUBSTR(documento,2,8))+1 n FROM operti WHERE tipodoc='REC'")->row(); $newdoc = str_pad($num->n, 7, "0", STR_PAD_LEFT); $recibo = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "REC", "moneda" => "000", "documento" => "C" . $newdoc, "codcliente" => '' . $db->codcliente . '', "nombrecli" => '' . $db->nombrecli . '', "contacto" => "N/A", "rif" => '' . $db->rif . '', "direccion" => '' . $db->direccion . '', "telefonos" => '' . $db->telefonos . '', "tipoprecio" => "1", "emision" => '' . date("Y-m-d") . '', "recepcion" => '' . date("Y-m-d") . '', "vence" => '' . date("Y-m-d") . '', "fechacrea" => '' . date("Y-m-d") . '', "totcosto" => 0, "totbruto" => $db->monto, "totneto" => $db->monto, "totalfinal" => $db->monto, "totimpuest" => "0", "totdescuen" => 0, "impuesto1" => "0", "impuesto2" => "0", "dsctolinea" => 0, "diascred" => '', "vendedor" => '' . $db->vendedor . '', "factorcamb" => "1", "uemisor" => $user, "estacion" => "001", "sinimpuest" => "0", "almacen" => "02", "sector" => '' . $db->sector . '', "subcodigo" => '' . $db->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => "0", "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "FAC", "antdoc" => $a, "referencia" => $db->referencia, "notas" => $db->notas); $this->db->insert("operti", $recibo); if ($this->db->affected_rows() > 0) { $totald = ROUND($db->monto / $db->tasa, 2); $this->db->query("UPDATE operti SET totald='{$totald}' WHERE documento='C" . $newdoc . "' && tipodoc='REC'"); $this->db->query("UPDATE opercli SET recibo=1 WHERE id='{$db->id}' && idfac='{$db->idfac}'"); } } } function regretfac($doc, $tip, $ord, $mont) { $val = $this->db->query("SELECT NULL FROM operti b WHERE b.referencia='" . $tip . $doc . "' && b.tipodoc='RET'")->num_rows(); if ($val == 0) { $db = $this->db->query("SELECT b.fechacrea,b.codcliente,b.nombrecli,b.rif,b.direccion, b.telefonos,b.vendedor,b.sector,b.subcodigo,b.antdoc,\xa CONCAT(b.tipodoc,b.documento) referencia FROM operti b WHERE b.documento='{$doc}' && b.tipodoc='{$tip}'")->row(); $num = $this->db->query("SELECT IF(MAX(documento)+1>0,MAX(documento)+1,1) n FROM operti WHERE tipodoc='RET'")->row(); $newdoc = str_pad($num->n, 8, "0", STR_PAD_LEFT); $user = $this->session->userdata("cod"); $ret = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "RET", "moneda" => "000", "documento" => $newdoc, "codcliente" => '' . $db->codcliente . '', "nombrecli" => '' . $db->nombrecli . '', "contacto" => "N/A", "rif" => '' . $db->rif . '', "direccion" => '' . $db->direccion . '', "telefonos" => '' . $db->telefonos . '', "tipoprecio" => "1", "emision" => $db->fechacrea, "recepcion" => date("Y-m-d"), "vence" => date("Y-m-d"), "fechacrea" => date("Y-m-d"), "totcosto" => 0, "totbruto" => $mont, "totneto" => $mont, "totalfinal" => $mont, "totimpuest" => "0", "totdescuen" => 0, "impuesto1" => "0", "impuesto2" => "0", "dsctolinea" => 0, "diascred" => '', "vendedor" => '' . $db->vendedor . '', "factorcamb" => "1", "uemisor" => $user, "estacion" => "001", "sinimpuest" => "0", "almacen" => "02", "sector" => '' . $db->sector . '', "subcodigo" => '' . $db->subcodigo . '', "formafis" => "1", "al_libro" => "1", "dbcr" => "1", "horadocum" => '' . date("H:i:s") . '', "ampm" => "2", "escredito" => "1", "baseimpo1" => "0", "fechayhora" => '' . date("Y-m-d H:i:s") . '', "idvalidacion" => '', "documentofiscal" => "0 Recibida", "comanda_movil" => "0", "comanda_kmonitor" => "0", "notimbrar" => "1", "antipo" => "FAC", "antdoc" => $db->antdoc, "referencia" => $db->referencia, "orden" => $ord); $this->db->insert("operti", $ret); $this->loguser("Retencion", "El usuario registra retencion " . $newdoc . " por " . $mont . " al documento " . $doc . ''); return $this->db->affected_rows(); } } function retfac($cli, $fech) { $bd = $this->db->query("SELECT * FROM operti WHERE codcliente='{$cli}' && tipodoc='RET' && fechacrea>='{$fech}'")->result(); $html = "<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="assets/css/w3.css"></head><body>"; $i = 0; foreach ($bd as $db) { $i++; $j = $i / 2; if (is_int($j)) { $pag = "w3-saltopag"; } else { $pag = ''; } $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$db->documento}' LIMIT 1")->row(); $html .= "<div class="w3-center w3-tiny"><img src="images/header.jpg" alt="Header" style="width:100%;"></div>\xa <h3 class="w3-center">Comprobante de Retencion: " . $db->documento . "<h3>\xa <div class="w3-center w3-tiny " . $pag . "">
<table class="w3-table-all w3-hoverable"><tr><th>Hemos recibido del cliente " . $db->nombrecli . " la cantidad de " . ROUND($db->totalfinal, 2) . " Bolivares</th></tr>\xa <tr class=""><th>Orden registrada:" . $db->orden . "</th></tr>\xa </table><br>\xa <table class="w3-table-all w3-hoverable"><tr><th>Emision</th><th>Tipo</th><th>Documento</th><th>Cliente</th><th>Monto retenido</th></tr>\xa <tr><td>" . $db->fechacrea . "</td><td colspan="2">" . $db->referencia . "</td><td>" . $db->nombrecli . "</td><td>" . ROUND($db->totalfinal, 2) . "</td></tr>
</table><br>\xa <table class="w3-table-all w3-hoverable"><tr><th>Vendedor</th><th>Firma</th></tr>\xa <tr><td>" . $vend->nombre . "</td><td>___________________________________________</td></tr>\xa </table><br><br><hr>\xa </div>
"; } $html .= "
\xa </body>
</html>\xa"; return $html; } function regncfac($doc, $nc, $cli) { $val = $this->db->query("SELECT NULL FROM operti WHERE documento='{$nc}' && tipodoc='N/C' && (aplicanc='' || aplicanc IS NULL) && estatusdoc!='X'"); if ($val->num_rows() > 0) { $bdnc = $this->db->query("SELECT totald FROM operti WHERE documento='{$nc}' && tipodoc='N/C'")->row(); $row = count($doc); $dolarnc = $bdnc->totald; $num = $this->db->query("SELECT max(id) n FROM aplicanc")->row(); $num = $num->n + 1; $j = 0; for ($i = 0; $i < $row; $i++) { if ($doc[$i] != '') { $fac = $this->db->query("SELECT documento,totald FROM operti WHERE documento='{$doc[$i]}'")->row(); if ($dolarnc > $fac->totald) { $j++; $dolarnc -= $fac->totald; $data = array("id" => $num, "nc" => $nc, "fac" => $fac->documento, "cliente" => $cli, "totald" => $fac->totald, "fecha" => date("Y-m-d H:i:s")); $this->db->insert("aplicanc", $data); $this->loguser("Aplica N/C", "El usuario aplica nota de credito " . $nc . " a documento " . $doc[$i] . " por " . $fac->totald . ''); } else { $j++; $data = array("id" => $num, "nc" => $nc, "fac" => $fac->documento, "cliente" => $cli, "totald" => $dolarnc, "fecha" => date("Y-m-d H:i:s")); $this->db->insert("aplicanc", $data); $this->loguser("Aplica N/C", "El usuario aplica nota de credito " . $nc . " a documento " . $doc[$i] . " por " . $dolarnc . ''); break 1; } } } if ($j > 0) { $this->db->query("UPDATE operti set aplicanc='{$num}',totald='{$bdnc->totald}' WHERE documento='{$nc}' && tipodoc='N/C'"); return 1; } } } function regfrecep($doc, $tip, $fech) { $bd = $this->db->query("SELECT diasindex dias FROM operti WHERE documento='{$doc}' && tipodoc='{$tip}';")->row(); $bd2 = $this->db->query("SELECT diascred dias FROM operti WHERE documento='{$doc}' && tipodoc='{$tip}';")->row(); $this->db->query("UPDATE operti set recepcion='{$fech}',vence=DATE_ADD('{$fech}',INTERVAL '{$bd->dias}' DAY),vencec=DATE_ADD('{$fech}',INTERVAL '{$bd2->dias}' DAY) WHERE documento='{$doc}' && tipodoc='{$tip}'"); $this->loguser("Recepcion", "El usuario registra fecha de recepcion " . $fech . " para el documento:" . $doc . ''); return $this->db->affected_rows(); } function recpago($cli, $fech) { $bd = $this->db->query("SELECT * FROM operti WHERE codcliente='{$cli}' && tipodoc='REC' && fechacrea>='{$fech}'")->result(); $html = "<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="assets/css/w3.css"></head><body>"; $i = 0; foreach ($bd as $db) { $i++; $tasa = ROUND($db->totalfinal / $db->totald, 2); $j = $i / 2; if (is_int($j)) { $pag = "w3-saltopag"; } else { $pag = ''; } $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$db->documento}' LIMIT 1")->row(); $html .= "<div class="w3-center w3-tiny"><img src="images/header.jpg" alt="Header" style="width:100%;"></div>
<h3 class="w3-center">Comprobante de Pago: " . $db->documento . "<h3>
<div class="w3-center w3-tiny " . $pag . "">\xa <table class="w3-table-all w3-hoverable"><tr><th>Hemos recibido del cliente " . $db->nombrecli . ": " . ROUND($db->totald, 2) . " $, " . ROUND($db->totalfinal) . " BS, BCV " . $tasa . " Bs</th></tr>
<tr class=""><th>" . $db->notas . "</th></tr>
</table><br>\xa <table class="w3-table-all w3-hoverable"><tr><th>Emision</th><th>Tipo</th><th>Documento</th><th>Cliente</th><th>Monto abonado</th></tr>\xa <tr><td>" . $db->fechacrea . "</td><td colspan="2">" . $db->referencia . "</td><td>" . $db->nombrecli . "</td><td>" . ROUND($db->totalfinal, 2) . "</td></tr>\xa </table><br>
<table class="w3-table-all w3-hoverable"><tr><th>Vendedor</th><th>Firma</th></tr>
<tr><td>" . $vend->nombre . "</td><td>___________________________________________</td></tr>
</table><br><br><hr>
</div>\xa "; } $html .= "\xa
</body>
</html>
"; return $html; } public function ordc($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE a.id='{$b}' || c.nombre like '%{$b}%' || a.npres='{$b}' || a.ncontrol='{$b}' || b.codigo='{$b}'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT null
FROM ordc a
LEFT JOIN itordc b ON a.id=b.ordc
JOIN proveed c ON a.proveed=c.id " . $filter . "
GROUP BY a.id ORDER BY a.`id` desc")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.id,c.nombre,a.npres,a.ncontrol,a.femis,a.frecep,SUM(b.cant) unid,IF(a.tipopag=0,'Consignado',IF(a.tipopag=1,'Contado','N/A')) tipopag,a.`status`,a.almacen\xa FROM ordc a\xa left JOIN itordc b ON a.id=b.ordc\xa JOIN proveed c ON a.proveed=c.id " . $filter . "\xa GROUP BY a.id ORDER BY a.`id` DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="ordc()" id="likeordc"></td>
<td class="w3-center w3-btn"><a onclick="w3.show('#formordc');"><img src="" . base_url() . "images/registrar.png" alt="Registrar Orden" title="Registrar Orden" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"> <a onclick="w3.show('#formprov');"><img src="" . base_url() . "images/registrar.png" alt="Registrar Prov" title="Registrar Prov" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="pdforden();"><img src="" . base_url() . "images/imp.png" alt="Imprimir Orden" title="Imprimir Orden" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="editordc();"><img src="" . base_url() . "images/editar.png" alt="Editar Orden" title="Editar Orden" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="ordc();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="elimordc();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>N.Orden</th><th>N.Doc</th><th>N.Control</th><th>Nombre</th><th>Emision</th><th>Recepcion</th><th>Unidades</th><th>Almacen</th><th>Tipo</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" class="item" onclick="itordc($('#a" . $i . "').val());">"; if ($dtfac->status == "1") { $status = "Listo"; $color = "w3-green"; } elseif ($dtfac->status == "0") { $status = "Pendiente"; $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->id . ""><input type="hidden" name="status" value="" . $dtfac->status . "">
<input type="hidden" name="ncontrol" value="" . $dtfac->ncontrol . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->id . "</td><td>" . $dtfac->npres . "</td><td>" . $dtfac->ncontrol . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->femis . "</td><td>" . $dtfac->frecep . "</td><td>" . $dtfac->unid . "</td><td>" . $dtfac->almacen . "</td><td>" . $dtfac->tipopag . "</td><td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Ordenes: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903";\xa var datos = {\xa "pag" : DecrementNum,
"key" : key
};
\xa $.ajax({
data: datos,
url: baseurl+"c_droid/ordc",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); swal.close();
}\xa
});
}\xa \xa function numpag(a){ before();\xa var key="droid903";\xa \xa var datos = {\xa "key":key,
"pag" : a\xa };
\xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/ordc",
type: "POST",\xa success: function(data) {
$("#body").html(data); swal.close();
}
\xa });\xa }
\xa function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903";
var datos = {\xa "key":key,
"pag" : IncrimentNum
};\xa
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/ordc",
type: "POST",
success: function(data) {
$("#body").html(data); swal.close();
}\xa
});
}\xa </script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function itordc($a) { $this->load->library("table"); $bditfac = $this->db->query("SELECT a.codigo,b.nombre,a.lote,a.elab,a.vence,a.cant,a.scan,a.costo,a.costoref,a.iva,a.status FROM itordc a LEFT JOIN articulo b ON a.codigo=b.codigo WHERE ordc='{$a}';")->result(); $bdarti = $this->db->query("SELECT a.codigo,b.nombre FROM artiprov a
JOIN articulo b ON a.codigo=b.codigo
JOIN proveed c ON c.codigo=a.proveedor
JOIN ordc d ON d.proveed=c.id WHERE d.id='{$a}'
ORDER BY b.nombre ASC")->result(); $alm = $this->db->query("SELECT almacen n FROM ordc WHERe id='{$a}'")->row(); $art = "<input type="text" class="w3-input" id="codigo" list="listarti" placeholder="Producto..."><datalist id="listarti">"; foreach ($bdarti as $dbarti) { $art .= "<option value="" . $dbarti->codigo . "">" . $dbarti->nombre . "</option>"; } $art .= "</datalist>"; $val = $this->db->query("SELECT status FROM ordc where id='{$a}'")->row(); if ($val->status == 0) { $btnscan = "<!--<input type="submit" class="w3-btn w3-green w3-border w3-hover-white" value="SCAN" onclick="w3.hide('#scan1');w3.show('#scan');">--!><input type="submit" class="w3-btn w3-teal w3-border w3-hover-white" value="Guardar" onclick="valordcscan('" . $a . "');/*w3.hide('#scan');/*w3.hide('#scan');w3.show('#scan1');*/">"; $formreg = "<tr><input type="hidden" id="ordc" value="" . $a . ""><td>" . $art . "</td><td><input type="text" class="w3-input" id="lote" placeholder="Lote..."></td><td><input type="date" class="w3-input" id="elab"></td>\xa <td><input type="date" class="w3-input" id="vence"></td><td><input type="text" class="w3-input" id="cant" placeholder="n" style="width:30px;"></td>
<td>N/A</td><td><input type="number" class="w3-input" id="iva" placeholder="n" style="width:50px;"></td><td><input type="text" class="w3-input" id="costo" placeholder="n" style="width:50px;"></td><td>N/A</td>\xa <td class="w3-btn"><a onclick="regitordc();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Item" title="Registrar Item" style="width:20px;height:20px;border:0;"></a></td></tr>"; } else { $btnscan = ''; $formreg = "<input type="hidden" id="ordc" value="" . $a . ""><input type="hidden" id="alm" value="" . $alm->n . "">"; } $subtotal = 0; $excento = 0; $baseimp = 0; $totimpuest = 0; $iva = 0; $total = 0; $tasa = $this->db->query("SELECT (SELECT oficial FROM monecam WHERE fecha<=a.femis ORDER BY fecha DESC LIMIT 1) oficial FROM ordc a WHERE a.id='{$a}'")->row()->oficial; $html = "
<a onclick="regarti_ordc();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Articulo" title="Registrar Articulo" style="width:20px;height:20px;border:0;"></a>
<table class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Producto</th><th>Lote</th><th>Elab</th><th>Vence</th><th>Cantidad</th><th>Scan</th><th>IVA</th><th>Costo</th><th>Estatus</th><th></th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->iva > 0) { $iva = $dtitfac->costoref * 0.16 * $dtitfac->cant; $totimpuest += $iva; $baseimp += $dtitfac->costoref * $dtitfac->cant; } else { $excento += $dtitfac->costoref * $dtitfac->cant; } if ($val->status == 0) { $status = "Pendiente"; $color = "w3-red"; $elim = "<a onclick="elimitordc('" . $a . "','" . $dtitfac->codigo . "');"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a>"; $editprod = ''; } elseif ($val->status == 1) { $status = "Listo"; $color = "w3-green"; $elim = ''; $editprod = ''; } $html .= "<tr ondblclick="edititordc('" . $dtitfac->codigo . "','" . $dtitfac->lote . "','" . $dtitfac->status . "');">
<td>" . $dtitfac->codigo . " " . $dtitfac->nombre . "</td><td>" . $dtitfac->lote . "</td><td>" . $dtitfac->elab . "</td><td>" . $dtitfac->vence . "</td><td>" . $dtitfac->cant . "</td><td>" . $dtitfac->scan . "</td><td>" . $dtitfac->iva . "</td><td>" . $dtitfac->costo . "</td>\xa <td class="" . $color . " w3-center">" . $status . "</td><td>" . $elim . "</td>
</tr>"; } $subtotal = ROUND($excento + $baseimp, 2); $total = ROUND($subtotal + $totimpuest, 2); $excento_bs = ROUND($excento * $tasa, 2); $baseimp_bs = ROUND($baseimp * $tasa, 2); $totimpuest_bs = ROUND($totimpuest * $tasa, 2); $subtotal_bs = ROUND($excento_bs + $baseimp_bs, 2); $total_bs = ROUND($subtotal_bs + $totimpuest_bs, 2); $html .= '' . $formreg . "</table><br><br>\xa <table class="w3-table-all w3-hoverable w3-left-align w3-small"><tr><td class="w3-fondodroid">Subtotal</td><td>" . $subtotal_bs . "Bs " . $subtotal . "$</td><td class="w3-fondodroid">Monto Excento</td><td>" . $excento_bs . "Bs " . $excento . "$</td><td class="w3-fondodroid">Base imponible</td><td>" . $baseimp_bs . "Bs " . $baseimp . "$</td><td class="w3-fondodroid">Total Impuesto</td><td>" . $totimpuest_bs . "Bs " . $totimpuest . "$</td><td class="w3-fondodroid">Total</td><td>" . $total_bs . "Bs " . $total . "$</td></tr></table><br><br>
<div style="display:none" id="scan" class="w3-center"><table class="w3-table-all w3-hoverable"><tr><td class="w3-fondodroid">Lote:</td><td><input type="text" class="w3-input" id="lotordc" placeholder="lote..." style="width:50px;"></td>\xa <td class="w3-fondodroid">Barras:</td><td><input type="text" class="w3-input" placeholder="Codigo barras..." id="codscan" onchange="ordcscan();"></td></tr></table></div>
<div style="display:none" id="scan1" class="w3-center"><table class="w3-table-all w3-hoverable"><tr><td class="w3-fondodroid">Lote:</td><td><input type="text" class="w3-input" id="lotordc2" placeholder="lote..." style="width:50px;"></td>
<td class="w3-fondodroid">Cant:</td><td><input type="text" class="w3-input" id="cantordc" placeholder="n" style="width:30px;"></td>
<td class="w3-fondodroid">Barras:</td><td><input type="text" class="w3-input" placeholder="Codigo barras..." id="codscan1" onchange="ordcscan1();"></td></tr></table></div><br><br>\xa \xa " . $btnscan . ''; return $html; } public function retencion_compras($a, $b) { $this->load->library("table"); $prov = $this->db->query("SELECT id FROM proveed WHERE nombre like '%{$b}% '")->row()->id; if ($b != '') { $filter = "&& proveed='{$prov}' || nret='{$b}'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT null\xa FROM compras WHERE tipodoc='RET' && retiene>0 {$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.fechadoc fecha,a.documento,a.referencia,(SELECT rif FROM proveed WHERE id=a.proveed) rif, (SELECT nombre FROM proveed WHERE id=a.proveed) nombre, CONCAT(a.alicret,' %') alicuota, \xa a.retiene monto, a.nret, a.tiporet\xa FROM compras a WHERE tipodoc='RET' && retiene>0 {$filter} ORDER BY a.nret DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="retencion_compras()" id="like"></td>
<td class="w3-center w3-btn"><a onclick="w3.show('#formretcomp');"><img src="" . base_url() . "images/registrar.png" alt="Registrar Orden" title="Registrar Orden" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="retencion_compras();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcelretencionescomp();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Fecha</th><th>Tipo</th><th>Documento</th><th>Afecta</th><th>N.Comprobante</th><th>Rif</th>
<th>nombre</th><th>Alicuota</th><th>Monto</th><th></th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" class="item">"; $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->nret . "">\xa <td><!--<input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">-->" . $dtfac->fecha . "</td><td>" . $dtfac->tiporet . "</td><td>" . $dtfac->documento . "</td><td>" . $dtfac->referencia . "</td>\xa <td>" . $dtfac->nret . "</td><td>" . $dtfac->rif . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->alicuota . "</td><td>" . $dtfac->monto . "</td>
<td><a onclick="pdfretencion(" . $dtfac->nret . ");"><img src="" . base_url() . "images/imp.png" alt="Imprimir" title="Imprimir" style="width:20px;height:20px;border:0;"></a></td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total retenciones: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903"; likefac:$("#like").val();\xa var datos = {
"pag" : DecrementNum,\xa "key" : key, likefac:likefac
};
$.ajax({
data: datos,\xa url: baseurl+"c_droid/retencion_compras",
type: "POST",\xa success: function(data) {
$("#body").html(data); swal.close(); $("#like").val(likefac);
}\xa
});
}\xa \xa function numpag(a){ before();\xa var key="droid903"; likefac:$("#like").val();
\xa var datos = {\xa "key":key,\xa "pag" : a, likefac:likefac
};
\xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/retencion_compras",\xa type: "POST",\xa success: function(data) {
$("#body").html(data); swal.close(); $("#like").val(likefac);\xa }\xa \xa });\xa }\xa
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; likefac:$("#like").val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum, likefac:likefac\xa };
\xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/retencion_compras",\xa type: "POST",
success: function(data) {
$("#body").html(data); swal.close(); $("#like").val(likefac);\xa }\xa \xa });
}
</script>\xa <div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } function facprov($prov, $tipdoc) { if ($tipdoc == "FAC") { $fac = $this->db->query("SELECT documento FROM compras WHERE proveed='{$prov}' && tipodoc='FAC' && totimpuest>0")->result(); $html = "<option value="" disabled selected>Seleccione</option>"; foreach ($fac as $dfac) { $html .= "<option value="" . $dfac->documento . "">" . $dfac->documento . "</option>"; } } elseif ($tipdoc == "N/D") { $fac = $this->db->query("SELECT documento FROM compras WHERE proveed='{$prov}' && tipodoc='N/D' && totimpuest>0")->result(); $html = "<option value="" disabled selected>Seleccione</option>"; foreach ($fac as $dfac) { $html .= "<option value="" . $dfac->documento . "">" . $dfac->documento . "</option>"; } } else { $fac = $this->db->query("SELECT documento FROM compras WHERE proveed='{$prov}' && tipodoc='N/C' && totimpuest>0")->result(); $html = "<option value="" disabled selected>Seleccione</option>"; foreach ($fac as $dfac) { $html .= "<option value="" . $dfac->documento . "">" . $dfac->documento . "</option>"; } } $retiene = $this->db->query("SELECT retiene FROM proveed WHERE id='{$prov}'")->row()->retiene; return array("fac" => $html, "alic" => $retiene); } function montoret($prov, $doc, $tip) { $db = $this->db->query("SELECT totimpuest iva FROM compras WHERE proveed='{$prov}' && documento='{$doc}' && tipodoc='{$tip}'")->row(); $retiene = $this->db->query("SELECT retiene FROM proveed WHERE id='{$prov}'")->row()->retiene; $monto = $db->iva * $retiene / 100; return $monto; } function regretcomp($prov, $fecha, $tipdoc, $doc, $alic, $monto) { $db = $this->db->query("SELECT a.fechadoc Fecha,(SELECT prov.rif FROM proveed prov WHERE prov.id=a.proveed) rif,(SELECT prov.nombre FROM proveed prov WHERE prov.id=a.proveed) nombre,\xa a.documento,a.ncontrol,a.referencia,a.subtotal,a.total, a.sinimpuest excento,a.baseimpo base_imponible, a.totimpuest iva
FROM compras a
WHERE a.documento='{$doc}' && tipodoc='{$tipdoc}' && a.proveed='{$prov}'")->row(); $num = $this->db->query("SELECT IF(MAX(SUBSTR(nret,7,14))+1>0,MAX(SUBSTR(nret,7,14))+1,1) n FROM compras WHERE tipodoc='RET'")->row(); $num = str_pad($num->n, 8, "0", STR_PAD_LEFT); $nret = DATE("Ym") . $num; if ($tipdoc == "FAC") { $tiporet = "01"; $ref = ''; } elseif ($tipdoc = "N/D" || ($tipdoc = "N/C")) { if ($tipdoc = "N/D") { $tiporet = "02"; } else { $tiporet = "03"; } $ref = $db->referencia; } $this->db->insert("compras", array("proveed" => $prov, "fechadoc" => $fecha, "tipodoc" => "RET", "documento" => $doc, "nret" => $nret, "ncontrol" => $db->ncontrol, "fechayhora" => date("Y-m-d H:i:s"), "referencia" => $ref, "alicret" => $alic, "subtotal" => $db->subtotal, "sinimpuest" => $db->excento, "baseimpo" => $db->base_imponible, "totimpuest" => $db->iva, "total" => $db->total, "retiene" => $monto, "descrip" => "SE retiene el " . $monto . " para el documento " . $tipdoc . $doc . '', "tiporet" => $tiporet, "fecharet" => date("Y-m-d"))); if ($this->db->affected_rows() > 0) { return 1; } } function pdfretencion($a) { $db = $this->db->query("SELECT proveed, date_format(fechadoc, '%d-%m-%Y')fechadoc,date_format(fecharet, '%d-%m-%Y')fecharet, IF(tiporet='01',documento,00) factura, ncontrol, IF(tiporet='02',documento,00) nd, IF(tiporet='03',documento,00) nc, IF(tiporet='02' || tiporet='03',referencia,00) fac_afectada,
tiporet,ROUND(total,2)total,ROUND(sinimpuest,2)sinimpuest,ROUND(baseimpo,2)baseimpo,'16%' alicuota,ROUND(totimpuest,2)totimpuest,alicret,ROUND(retiene,2)retiene FROM compras WHERE nret='{$a}'")->row(); $sujeto = $this->db->query("SELECT nombre,rif FROM proveed WHERE id='{$db->proveed}'")->row(); $totfin = $db->total - $db->retiene; $html = "<link rel="stylesheet" href="assets/css/w3.css?v=4"><html><div class="w3-center w3-textpdf" style="margin-top:2.5%;margin-left:2.5%" >"; $html .= "\xa <div class="w3-row-padding">\xa <div class="w3-col s6 w3-left-align"><h1 class="w3-tiny"><b>COMPROBANTE RETENCION IVA</b></h1>
<p>Ley IVA Art. 11: La Administraci\xc3\263n Tributaria podr\xc3\241 designar como responsables del pago del impuesto, en calidad de agentes de retenci\303\263n, a quienes por sus funciones p\xc3\272blicas o por raz\303\263n de sus actividades privadas intervengan en operaciones gravadas con el impuesto establecido en esta Ley.<p>
<p><b>Providencia Administrativa N\302\260 SNAT/2015/0049 del 10/08/2015</b></p>
</div>\xa <div class="w3-col s6">\xa <table class="w3-table-all">\xa <tr class="w3-light-grey"><th>NRO.COMPROBANTE</th><th>FECHA</th></tr>
<tr><td>" . $a . "</td><td>" . $db->fecharet . "</td></tr>\xa </table> \xa </div>\xa
</div><br>\xa\xa <table class="w3-table-all w3-left-align">
<tr class="w3-light-grey"><th>NOMBRE O RAZON SOCIAL DEL AGENTE DE RETENCION</th><th>REGISTRO DE INFORMACION FISCAL DEL AGENTE DE RETENCION</th></tr>\xa <tr><td>MEDIFAR SALUD C.A</td><td>J-40834246-4</td></tr>\xa </table> <br>\xa\xa <table class="w3-table-all w3-left-align">\xa <tr class="w3-light-grey"><th>DIRECCION FISCAL DEL AGENTE DE RETENCION</th><th>PERIODO FISCAL</th></tr>\xa <tr><td>CALLE HALLEY EDIF MEDIFAR SALUD, LOCAL 3-38 SECTOR SAN BENITO VUELTA DE LOLA MERIDA EDO MERIDA</td><td>A\303\221O:" . date("Y") . " MES:" . date("m") . "</td></tr>\xa </table> <br>\xa
<table class="w3-table-all w3-left-align">\xa <tr class="w3-light-grey"><th>NOMBRE O RAZON SOCIAL DEL SUJETO RETENIDO</th><th>REGISTRO DE INFORMACION FISCAL DEL AGENTE RETENIDO</th></tr>\xa <tr><td>" . $sujeto->nombre . "</td><td>" . $sujeto->rif . "</td></tr>\xa </table> <br>
\xa <table class="w3-table-all w3-left-align">
<tr class="w3-light-grey"><th>Oper.Nro</th><th>Fecha de Factura ND/NC</th><th>Numero de Factura</th><th>Numero de Control de Factura/D\303\251bito</th><th>Numero de Nota de D\303\xa9bito</th><th>Numero de Nota de Cr\303\xa9dito</th><th>Numero de Factura Afec.</th><th>Tipo de Transacci\303\263n</th><th>Total Compras Incluyendo IVA</th><th>Compras Sin Derecho a Cr\303\xa9dito IVA</th><th>Base Imponible</th><th>% Alicuota</th><th>Impuesto</th><th>Porcentaje Retenido</th><th>IVA Retenido</th></tr>
<tr><td>1</td><td>" . $db->fechadoc . "</td><td>" . $db->factura . "</td><td>" . $db->ncontrol . "</td><td>" . $db->nd . "</td><td>" . $db->nc . "</td><td>" . $db->fac_afectada . "</td><td>" . $db->tiporet . "</td><td>" . $db->total . "</td><td>" . $db->sinimpuest . "</td><td>" . $db->baseimpo . "</td><td>" . $db->alicuota . "</td><td>" . $db->totimpuest . "</td><td>" . $db->alicret . "</td><td>" . $db->retiene . "</td></tr>
<tr class="w3-light-grey"><td colspan="8" class="w3-center"><b>Totales</b></td><td>" . $db->total . "</td><td></td><td>" . $db->baseimpo . "</td><td>" . $db->alicuota . "</td><td></td><td></td><td>" . $db->retiene . "</td><tr>\xa </table><br>\xa
<div class="w3-row-padding">
<div class="w3-col s4 w3-left-align"><p><b>Recibido Por:</b></p><br><br><br>
<p>Nombre y Apellido:</p>
<p>Firma:</p>
<p>CI:</p>\xa <p>Fecha:</p>\xa </div>
<div class="w3-col s4">
<p><b>AGENTE DE RETENCION</b></p>\xa <p>(Sello, Fecha y Firma)</p><br>\xa <img src="images/firma_medifar.png" alt="Header" style="width:60%;">\xa </div>
<div class="w3-col s4"><p><b>TOTAL A PAGAR BS... " . $totfin . "</b></p></div> \xa </div><br>\xa \xa "; $html .= "</div></html>"; return $html; } public function compras($a, $b) { $this->load->library("table"); $prov = $this->db->query("SELECT id FROM proveed WHERE nombre like '%{$b}% '")->row()->id; if ($b != '') { $filter = "&& proveed='{$prov}' || documento='{$b}'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT null
FROM compras WHERE (tipodoc='FAC' || tipodoc='N/D' || tipodoc='N/C') {$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.fechadoc fecha,a.tipodoc,a.documento,a.ncontrol,(SELECT rif FROM proveed WHERE id=a.proveed) rif, (SELECT nombre FROM proveed WHERE id=a.proveed) nombre, a.referencia,
a.subtotal,a.sinimpuest,a.baseimpo,a.totimpuest,a.total,CONCAT(a.proveed,a.tipodoc,a.documento) idcomp
FROM compras a WHERE (tipodoc='FAC' || tipodoc='N/D' || tipodoc='N/C') {$filter} ORDER BY a.fechadoc LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="compras()" id="like"></td>
<td class="w3-center w3-btn"><a onclick="w3.show('#formcomp');"><img src="" . base_url() . "images/registrar.png" alt="Registrar Compra" title="Registrar Compra" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="compras();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Fecha</th><th>Tipo</th><th>Documento</th><th>N.Control</th><th>Afecta</th><th>RIF</th><th>Nombre</th><th>Subtotal</th>\xa <th>Excento</th><th>Base.Imponible</th><th>IVA</th><th>Total</th><td></td>\xa </tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" class="item">"; $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . "">\xa <td><!--<input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">-->" . $dtfac->fecha . "</td><td>" . $dtfac->tipodoc . "</td><td>" . $dtfac->documento . "</td><td>" . $dtfac->ncontrol . "</td>\xa <td>" . $dtfac->referencia . "</td><td>" . $dtfac->rif . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->subtotal . "</td><td>" . $dtfac->sinimpuest . "</td><td>" . $dtfac->baseimpo . "</td><td>" . $dtfac->totimpuest . "</td><td>" . $dtfac->total . "</td>
<td><a onclick="formeditcomp('" . $dtfac->idcomp . "');"><img src="" . base_url() . "images/editar.png" alt="Editar" title="Editar" style="width:20px;height:20px;border:0;"></a></td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Documentos: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNum(){ before();
var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903"; likefac:$("#like").val();
var datos = {
"pag" : DecrementNum,
"key" : key, likefac:likefac\xa };
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/compras",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); swal.close(); $("#like").val(likefac);\xa }
});
}
function numpag(a){ before();
var key="droid903"; likefac:$("#like").val();\xa \xa var datos = {\xa "key":key,
"pag" : a, likefac:likefac\xa };\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/compras",
type: "POST",
success: function(data) {\xa $("#body").html(data); swal.close(); $("#like").val(likefac);
}\xa
});\xa }
function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; likefac:$("#like").val();\xa var datos = {
"key":key,\xa "pag" : IncrimentNum, likefac:likefac
};\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/compras",\xa type: "POST",
success: function(data) {
$("#body").html(data); swal.close(); $("#like").val(likefac);\xa }\xa
});\xa }
</script>
<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } function afectafac($prov) { $fac = $this->db->query("SELECT documento FROM compras WHERE tipodoc='FAC' && proveed='{$prov}'")->result(); $html = "<input type="text" class="w3-input" id="idafectafac" placeholder="factura afectada..." list="fac"><datalist id="fac">"; foreach ($fac as $dfac) { $html .= "<option value="" . $dfac->documento . "">" . $dfac->documento . "</option>"; } $html .= "</datalist>"; return $html; } function regcompra($prov, $fecha, $tipodoc, $ncontrol, $doc, $ref, $excento, $baseimp, $iva, $total) { $i = 0; $tasa = $this->db->query("SELECT oficial FROM monecam WHERE fecha<='{$fecha}' ORDER BY fecha DESC LIMIT 1")->row()->oficial; $subtotal = $excento + $baseimp; $totald = $total / $tasa; $this->db->insert("compras", array("proveed" => $prov, "tipodoc" => $tipodoc, "documento" => $doc, "ncontrol" => $ncontrol, "referencia" => $ref, "descrip" => '', "subtotal" => $subtotal, "sinimpuest" => $excento, "baseimpo" => $baseimp, "totimpuest" => $iva, "total" => $total, "totald" => $totald, "fechadoc" => $fecha, "fechayhora" => date("Y-m-d H:i:s"))); if ($this->db->affected_rows() > 0) { $i++; } if ($i > 0 && $iva > 0) { $alic = $this->db->query("SELECT retiene FROM proveed WHERE id='{$prov}'")->row()->retiene; if ($alic > 0) { $retiene = $iva * ($alic / 100); $this->regretcomp($prov, $fecha, $tipodoc, $doc, $alic, $retiene); } } return $i; } function editcompra($id, $excento, $baseimp, $iva, $total) { $i = 0; $tasa = $this->db->query("SELECT (SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1) oficial FROM compras a WHERE CONCAT(a.proveed,a.tipodoc,a.documento)='{$id}'")->row()->oficial; $subtotal = $excento + $baseimp; $totald = $total / $tasa; $this->db->where("CONCAT(proveed,tipodoc,documento)='{$id}'")->update("compras", array("sinimpuest" => $excento, "baseimpo" => $baseimp, "totimpuest" => $iva, "total" => $total, "totald" => $totald)); if ($this->db->affected_rows() > 0) { $i++; } if ($i > 0 && $iva > 0) { $alic = $this->db->query("SELECT b.id,b.retiene,a.tipodoc,a.documento FROM compras a JOIN proveed b ON a.proveed=b.id WHERE CONCAT(a.proveed,a.tipodoc,a.documento)='{$id}'")->row(); if ($alic->retiene > 0) { $retiene = $iva * ($alic->retiene / 100); $this->editretcomp($alic->id, $alic->documento, $excento, $baseimp, $iva, $total, $totald, $retiene); } } return $i; } function editretcomp($prov, $doc, $excento, $base, $iva, $total, $totald, $monto) { $this->db->query("UPDATE compras SET sinimpuest='{$excento}',baseimpo='{$base}',totimpuest='{$iva}',total='{$total}',totald='{$totald}', retiene='{$monto}'\xa WHERE proveed='{$prov}' && tipodoc='RET' && documento='{$doc}'"); } public function combo($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE nom='{$b}'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT * FROM combo;")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT * FROM combo {$filter} LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="ordc()" id="likeordc"></td>
<td class="w3-center w3-btn"><a onclick="w3.show('#formcombo');"><img src="" . base_url() . "images/registrar.png" alt="Registrar Combo" title="Registrar Combo" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="combo();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="elimcombo();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Id</th><th>Nombre</th><th>Precio</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" onclick="itcombo(" . $dtfac->id . ");"><input type="hidden" name="idcombo" value="" . $dtfac->id . "">
<td><input type="checkbox" class="w3-check" name="checkcombo" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');">" . $dtfac->id . "</td> <td>" . $dtfac->nom . "</td><td>" . $dtfac->precio . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="2"><label class="w3-large"><b>Total Combos: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903";\xa var datos = {\xa "pag" : DecrementNum,\xa "key" : key\xa };
$.ajax({
data: datos,
url: baseurl+"c_droid/combo",
type: "POST",\xa success: function(data) {\xa $("#body").html(data);
}
});
}\xa
function numpag(a){ before();\xa var key="droid903";
\xa var datos = {\xa "key":key,
"pag" : a
};
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/combo",\xa type: "POST",
success: function(data) {\xa $("#body").html(data);
}
});
}
function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903";\xa var datos = {
"key":key,
"pag" : IncrimentNum
};\xa \xa $.ajax({
data: datos,
url: baseurl+"c_droid/combo",\xa type: "POST",
success: function(data) {\xa $("#body").html(data);
}
\xa });\xa }\xa </script>\xa <div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>
</div> "; return $html; } public function itcombo($a) { $this->load->library("table"); $bditfac = $this->db->query("SELECT a.idcombo,a.codigo,b.nombre,a.cantidad FROM itcombo a JOIN articulo b ON a.codigo=b.codigo WHERE a.idcombo='{$a}';")->result(); $bdarti = $this->db->query("SELECT a.codigo,a.nombre FROM articulo a WHERE a.existencia>0")->result(); $art = "<input type="text" class="w3-input" id="codigo" list="listarti" placeholder="Producto..."><datalist id="listarti">"; foreach ($bdarti as $dbarti) { $art .= "<option value="" . $dbarti->codigo . "">" . $dbarti->nombre . "</option>"; } $art .= "</datalist>"; $formreg = "<tr><input type="hidden" id="combo" value="" . $a . ""><td>" . $art . "</td><td>N/A</td><td><input type="text" class="w3-input" id="cant" placeholder="n" style="width:30px;"></td>\xa <td class="w3-btn"><a onclick="regitcombo();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Item" title="Registrar Item" style="width:20px;height:20px;border:0;"></a></td></tr>"; $html = "
<table class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Nombre</th><th>Cantidad</th><th></th></tr>"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $html .= "<tr>
<td>" . $dtitfac->codigo . "</td><td>" . $dtitfac->nombre . "</td><td>" . $dtitfac->cantidad . "</td><td><a onclick="elimitcombo('" . $a . "','" . $dtitfac->codigo . "');"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td>
</tr>"; } $html .= '' . $formreg . "</table><br><br>"; return $html; } function editordc($a, $b, $c, $d) { $this->db->query("UPDATE ordc SET npres='{$b}',ncontrol='{$c}',femis='{$d}' WHERE id='{$a}'"); $i = 0; if ($this->db->affected_rows() > 0) { $i++; $this->db->query("UPDATE itordc SET costoref=ROUND(costo/(SELECT oficial FROM monecam WHERE fecha<='{$d}' ORDER BY fecha DESC LIMIT 1),4) WHERE ordc='{$a}'"); if (substr($c, 0, 3) == "00-") { $fac = $this->db->query("SELECT a.proveed, a.femis fecha,'FAC' tipodoc,a.ncontrol,a.npres doc,SUM(IF(b.iva=0,b.costo*b.cant,0)) excento,
SUM(IF(b.iva>0,b.costo*b.cant,0)) baseimp,SUM(IF(b.iva>0,(b.costo*b.cant),0))*(b.iva/100) iva\xa FROM ordc a JOIN itordc b ON a.id=b.ordc WHERE a.id='{$a}' GROUP BY a.id")->row(); $total = $fac->excento + $fac->baseimp + $fac->iva; $this->regcompra($fac->proveed, $fac->fecha, $fac->tipodoc, $fac->ncontrol, $fac->doc, '', $fac->excento, $fac->baseimp, $fac->iva, $total); } } return $i; } function formedititordc($ordc, $cod, $lote) { $bd = $this->db->query("SELECT elab,vence,lote,cant,costo,status FROM itordc WHERe ordc='{$ordc}' && codigo='{$cod}' && lote='{$lote}'")->row(); return json_encode(array("elab" => $bd->elab, "vence" => $bd->vence, "cant" => $bd->cant, "lote" => $bd->lote, "cost" => $bd->costo, "status" => $bd->status)); } function edititordc($ordc, $cod, $elab, $venc, $lot, $dlot, $cant, $cost, $stat, $alm) { $v = 0; $j = 0; $tasa = $this->db->query("SELECT (SELECT oficial FROM monecam WHERE fecha<=a.femis ORDER BY fecha DESC LIMIT 1) oficial FROM ordc a WHERE a.id='{$ordc}'")->row()->oficial; $costoref = $cost / $tasa; $this->db->query("UPDATE itordc SET elab='{$elab}',vence='{$venc}',lote='{$dlot}',cant='{$cant}',scan='{$cant}',costo='{$cost}',costoref='{$costoref}' WHERE ordc='{$ordc}' && codigo='{$cod}' && lote='{$lot}'"); if ($this->db->affected_rows() > 0) { $v++; } if ($stat == 1 && $v > 0) { $val = $this->db->query("SELECT NULL FROM artilotes WHERe codigoart='{$cod}' && lote='{$lot}' && almacen='{$alm}'")->num_rows(); if ($val > 0) { $this->db->query("UPDATE artilotes set lote='{$dlot}',elab='{$elab}',vence='{$venc}' WHERE codigoart='{$cod}' && lote='{$lot}' && almacen='{$alm}'"); if ($this->db->affected_rows() > 0) { $j++; } } } $this->loguser("Modificar Orden", "El usuario modifica el " . $cod . " para la orden " . $ordc . ", lote " . $lot . " para " . $dlot . ", exito orden: " . $v . ",exito artilote: " . $j . ''); return $v; } function pdforden($a) { $db = $this->db->query("SELECT * FROM ordc a JOIN proveed b ON a.proveed=b.id WHERE a.id='{$a}'")->row(); $db2 = $this->db->query("SELECT a.*,b.nombre,a.costo*a.cant total FROM itordc a JOIN articulo b ON a.codigo=b.codigo WHERE a.ordc='{$a}'")->result(); $html = "<link rel="stylesheet" href="assets/css/w3.css?v=4"><html><div class="w3-center" style="margin-top:2%" ><img src="images/header.jpg" alt="Header" style="width:100%;"><br>"; $i = 0; $tot = 0; $unid = ''; $html .= "<table class="w3-table w3-medium"><tr><td><b>Orden de Compra: </b>" . $a . "</td><td><b>Fecha de Emisi\303\263n: </b>" . DateTime::createFromFormat("Y-m-d", $db->femis)->format("d/m/Y") . "</td></tr></table>"; $html .= "<table class="w3-table w3-tiny"><tr><td><b>Proveedor: </b>" . $db->nombre . "</td><td><b>R.I.F: </b>" . $db->rif . "</td><td><b>N.Presupuesto: </b>" . $db->npres . "</td><td><b>N.Control: </b>" . $db->ncontrol . "</td></tr></table><br>"; $html .= "<table class="w3-table-all w3-hoverable w3-textpdf" style="width:100%"><tr><th>Item</th><th>Cant</th><th>Lote</th><th>Descripci\xc3\xb3n del Articulo</th><th>Elab</th><th>F.V.</th><th>Precio</th><th>Total</th></tr>"; $i = 0; foreach ($db2 as $item) { $i++; $unid += $item->cant; $tot += $item->total; $html .= "<tr><td>" . $i . "</td><td>" . $item->cant . "</td><td>" . $item->lote . "</td><td>" . $item->nombre . "</td><td>" . $item->elab . "</td><td>" . $item->vence . "</td><td>" . round($item->costo, 2) . "</td><td>" . $item->total . "</td></tr>"; } $html .= "<table class="w3-table-all w3-textpdf" style="width:100%">\xa <td class="w3-light-grey"><b>Total Unid:</b></td><td>" . round($unid, 0) . "</td><td class="w3-light-grey"><b>Total a pagar:</b></td><td>" . round($tot, 2) . "</td></tr>\xa </table><br>"; return $html; } function prov() { $bd = $this->db->query("SELECT id, nombre FROM proveed ORDER BY nombre ASC")->result(); $html = "<input type="text" class="w3-input" id="prov" list="dataprov"><datalist id="dataprov">"; foreach ($bd as $db) { $html .= "<option value="" . $db->id . "">" . $db->nombre . "</option>"; } $html .= "</datalist>"; return $html; } function formeditprov($idprov) { $bd = $this->db->query("SELECT id, nombre FROM proveed ORDER BY nombre ASC")->result(); $prov = "<input type="text" class="w3-input" id="idprov" list="dataprov" onchange="proveed();" value="" . $idprov . ""><datalist id="dataprov">"; foreach ($bd as $db) { $prov .= "<option value="" . $db->id . "">" . $db->nombre . "</option>"; } $prov .= "</datalist>"; $datos = $this->db->query("SELECT * FROM proveed WHERe id='{$idprov}'")->row(); return array("id" => $prov, "nombre" => $datos->nombre, "rif" => $datos->rif, "telefono" => $datos->telefono, "direccion" => $datos->direccion, "nombre_contacto" => $datos->nombre_contacto, "telefono_contacto" => $datos->telefono_contacto, "dias" => $datos->dias, "inicio" => $datos->inicio, "final" => $datos->final, "diaspromo" => $datos->diaspromo, "mganan" => $datos->mganan, "descu" => $datos->descu, "retiene" => $datos->retiene, "islr_j" => $datos->islr_j); } function almacen() { $db = $this->db->query("SELECT a.codigo,a.nombre FROM almacene a WHERE a.codigo NOT IN (06)")->result(); $html = "<select class="w3-select" id="alm"><option value="" disabled selected>Seleccione</option>"; foreach ($db as $db) { $html .= "<option value="" . $db->codigo . "">" . $db->nombre . "</option>"; } $html .= "</select>"; return $html; } function regordc($a, $b, $c, $d, $dias) { $data = array("proveed" => $a, "femis" => $b, "tipopag" => $c, "almacen" => TRIM($d), "dias" => $dias); $this->db->insert("ordc", $data); $this->loguser("Orden", "El usuario genera orden para el proveed: " . $a . " Emitido: " . $b . " Tipopag: " . $c . " Almacen: " . $d . ''); return $this->db->affected_rows(); } function regcombo($a, $b) { $data = array("nom" => $a, "precio" => $b); $this->db->insert("combo", $data); $this->loguser("Registro Combo", "El usuario registra combo " . $a . "."); return $this->db->affected_rows(); } function regitordc($a, $b, $c, $f, $g, $d, $iva, $e) { $tasa = $this->db->query("SELECT (SELECT oficial FROM monecam WHERE fecha<=a.femis ORDER BY fecha DESC LIMIT 1) oficial FROM ordc a WHERE a.id='{$a}'")->row(); $costoref = $e / $tasa->oficial; $this->db->query("UPDATE articulo set impuesto1='{$iva}' WHERE codigo='{$b}'"); $data = array("ordc" => $a, "codigo" => TRIM($b), "lote" => TRIM($c), "elab" => "0000-00-00", "vence" => $g, "cant" => $d, "scan" => $d, "status" => 1, "iva" => $iva, "costo" => $e, "costoref" => $costoref); $this->db->insert("itordc", $data); $this->loguser("Item Orden", "El usuario agrega producto: " . $b . ", lote: " . $c . ", elab:" . $f . " vence:" . $g . " cant:" . $d . ", costo:" . $e . " para la orden " . $a . ''); return $this->db->affected_rows(); } function regitcombo($a, $b, $c) { $data = array("idcombo" => $a, "codigo" => $b, "cantidad" => $c); $this->db->insert("itcombo", $data); $this->loguser("Registro Item Combo", "El usuario agrega producto: " . $b . ", cant:" . $c . "."); return $this->db->affected_rows(); } function elimordc($a) { $rows = count($a); $j = 0; for ($i = 0; $i < $rows; $i++) { if ($a[$i] > 0) { $this->db->where("ordc", $a[$i])->delete("itordc"); $this->db->where("id", $a[$i])->delete("ordc"); } if ($this->db->affected_rows() > 0) { $j++; } } $this->loguser("Eliminar", "El usuario elimina la orden " . $a . "."); return $j; } function elimcombo($a) { $rows = count($a); $j = 0; for ($i = 0; $i < $rows; $i++) { if ($a[$i] > 0) { $this->db->where("idcombo", $a[$i])->delete("itcombo"); $this->db->where("id", $a[$i])->delete("combo"); } if ($this->db->affected_rows() > 0) { $j++; } } $this->loguser("Eliminar", "El usuario elimina el combo " . $a . "."); return $j; } function elimitordc($a, $b) { $this->db->query("DELETE FROM itordc WHERE ordc='{$a}' && codigo='{$b}'"); $this->loguser("Eliminar", "El usuario elimina el item " . $b . " para la orden " . $a . "."); return $this->db->affected_rows(); } function elimitcombo($a, $b) { $this->db->query("DELETE FROM itcombo WHERE idcombo='{$a}' && codigo='{$b}'"); $this->loguser("Eliminar", "El usuario elimina el item " . $b . " para el combo " . $a . "."); return $this->db->affected_rows(); } function formaggcombo() { $bd = $this->db->query("SELECT id, nom FROM combo")->result(); $html = "<select class="w3-select" id="idcombo"><option value="" disabled selected>Seleccione</option>"; foreach ($bd as $db) { $html .= "<option value="" . $db->id . "">" . $db->nom . "</option>"; } $html .= "</select>"; return $html; } function aggcombo($a, $b) { $bd = $this->db->query("SELECT a.codigo, b.nombre,a.cantidad,b.grupo,b.comprometido,b.precio1,b.preciofin1 FROM itcombo a JOIN articulo b ON a.codigo=b.codigo WHERE idcombo='{$b}' GROUP BY a.codigo")->result(); $v = 0; $usaprc = $this->db->query("SELECT precio n FROM combo WHERE id='{$b}'")->row(); foreach ($bd as $db) { if ($usaprc->n == "S") { $prcorg = $db->precio1; $prcfin = $db->preciofin1; } else { $prcorg = 0; $prcfin = 0; } $bdlot = $this->db->query("SELECT c.almacen,c.lote,(c.cantidad-c.consumido) exist, c.elab, c.vence FROM artilotes AS c
WHERE c.codigoart='{$db->codigo}' && c.cantidad>c.consumido && c.almacen NOT IN (01,05,06) ORDER BY c.almacen ASC, (c.cantidad-c.consumido) ASC LIMIT 1")->row(); if ($bdlot->almacen == '' || $bdlot->almacen == null) { $alm = "02"; } else { $alm = $bdlot->almacen; } $datos = array("id_empresa" => "DMEDIF", "agencia" => "001", "tipodoc" => "ESP", "documento" => '' . $a . '', "grupo" => '' . $db->grupo . '', "origen" => "1", "codigo" => '' . $db->codigo . '', "pid" => "combo", "nombre" => '' . $db->nombre . '', "costounit" => "0", "preciounit" => 0, "dsctounit" => 0, "dsctoprc" => 0, "dsctoendp" => 0, "dsctoendm" => 0, "preciofin" => $prcfin, "preciooriginal" => $prcorg, "cantidad" => '' . $db->cantidad . '', "montoneto" => 0, "montototal" => 0, "timpueprc" => 0, "almacen" => $alm, "proveedor" => "n/a", "fechadoc" => '' . date("Y-m-d") . '', "impuesto1" => "0", "impuesto2" => "0", "vendedor" => '', "emisor" => "FACTURAD", "usaserial" => "2", "tipoprecio" => "1", "unidad" => "UND", "agrupado" => "2", "compuesto" => "2", "usaexist" => "1", "aux1" => '' . $db->cantidad . '', "estacion" => "001", "udinamica" => "1", "baseimpo1" => 0, "baseimpo2" => "0", "lote" => $bdlot->lote, "idvalidacion" => '', "fechayhora" => '' . date("Y-m-d H:i:s") . '', "enviado_kmonitor" => "0"); $this->db->insert("opermv", $datos); if ($this->db->affected_rows() > 0) { $v++; $newcomp = $db->cantidad + $db->comprometido; $dato3 = array("comprometido" => $newcomp); $this->db->where("codigo", $db->codigo)->update("articulo", $dato3); } } return $v; } function ordcscan($a, $b, $c) { $bd = $this->db->query("SELECT TRIM(codigo) codigo FROM invcodalternativo WHERE (codalternativo='{$b}' || codigo='{$b}')"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("SELECT cant, scan FROM itordc WHERE ordc='{$a}' && codigo='{$db->codigo}' && lote='{$c}'")->row(); if ($bd2->cant > $bd2->scan) { $new = $bd2->scan + 1; $this->db->query("UPDATE itordc set scan='{$new}' WHERE ordc='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("UPDATE itordc set status=1 WHERE ordc='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); $i = 2; $this->valordcscan($a); } else { $i = 1; } } } else { $i = 2; $this->valordcscan($a); } } else { $i = 0; } return $i; } function ordcscan1($a, $b, $c, $d) { $bd = $this->db->query("SELECT TRIM(codigo) codigo FROM invcodalternativo WHERE (codalternativo='{$b}' || codigo='{$b}')"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("SELECT cant, scan FROM itordc WHERE ordc='{$a}' && codigo='{$db->codigo}' && lote='{$c}'")->row(); if ($bd2->cant > $bd2->scan) { if ($d <= $bd2->cant) { $new = $d; $this->db->query("UPDATE itordc set scan='{$new}' WHERE ordc='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("UPDATE itordc set status=1 WHERE ordc='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); $i = 2; $this->valordcscan($a); } else { $i = 1; } } } else { $i = 3; } } else { $i = 2; $this->valordcscan($a); } } else { $i = 0; } return $i; } public function valordcscan($a) { $db = $this->db->query("SELECT NULL FROM itordc WHERE ordc='{$a}'")->num_rows(); $db2 = $this->db->query("SELECT NULL FROM itordc WHERE ordc='{$a}' && cant=scan")->num_rows(); if ($db == $db2) { $this->db->query("UPDATE ordc SET frecep=CURDATE(),status=1 WHERE id='{$a}'"); if ($this->db->affected_rows() > 0) { $bd3 = $this->db->query("SELECT a.codigo,a.lote,a.elab,a.vence,a.cant,a.costo,b.almacen,b.proveed FROM itordc a JOIN ordc b ON a.ordc=b.id WHERE a.ordc='{$a}'")->result(); foreach ($bd3 as $db3) { $this->ajusteordcinv($db3->codigo, $db3->lote, $db3->elab, $db3->vence, $db3->cant, $db3->costo, $db3->almacen, $db3->proveed); } } } } function ajusteordcinv($cod, $lot, $elab, $venc, $cant, $cost, $alm, $prov) { $vallote = $this->db->query("SELECT NULL FROM artilotes WHERE codigoart='{$cod}' && almacen='{$alm}' && lote='{$lot}' && recepcion<=curdate()")->num_rows(); if ($vallote > 0) { $this->db->query("UPDATE artilotes SET cantidad=cantidad+{$cant},recepcion=curdate(),costo='{$cost}' WHERE codigoart='{$cod}' && almacen='{$alm}' && lote='{$lot}'"); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo SET existencia=existencia+{$cant} WHERE codigo='{$cod}'"); } } else { $this->db->query("INSERT INTO `artilotes` (`id_empresa`, `agencia`, `lote`, `codigoart`, `almacen`, `inactivo`, `elab`, `vence`, `cantidad`, `consumido`, `comprometido`, `costo`, `recepcion`, `precio1`, `precio2`,\xa `precio3`, `precio4`, `precio5`, `precio6`, `precio7`, `precio8`, `preciofin1`, `preciofin2`, `preciofin3`, `preciofin4`, `preciofin5`, `preciofin6`, `preciofin7`, `preciofin8`, `precio1grp`, `precio2grp`, `precio3grp`,
`precio4grp`, `precio5grp`, `precio6grp`, `precio7grp`, `precio8grp`, `factorlote`, `numlote`) VALUES ('DMEDIF', '001', '{$lot}', '{$cod}', '{$alm}', 0, '{$elab}', '{$venc}', '{$cant}', 0.0, 0.0, '{$cost}', \xa CURDATE(), 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \xa 0.0, 0.0, 0.0, 0.0, 0.0, '{$lot}');"); if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo SET existencia=existencia+{$cant} WHERE codigo='{$cod}'"); } } } public function artilist($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE a.codigo='{$b}' || b.nombre like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT a.*,b.nombre FROM artilist a JOIN articulo b On a.codigo=b.codigo " . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.*,b.nombre FROM artilist a JOIN articulo b On a.codigo=b.codigo " . $filter . " LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $hora = $this->db->query("SELECT IF(time(NOW())>='13:00:00','S','N') n")->row(); if ($hora->n == "S") { $ajusteprc = "<td class="w3-center w3-btn"><a onclick="alertaajustelist();"><img src="" . base_url() . "images/bn.png" alt="Ejecutar" title="Ejecutar" style="width:20px;height:20px;border:0;"></a></td>"; } else { $ajusteprc = ''; } $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="artilist()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="w3.show('#modexcellist');"><img src="" . base_url() . "images/excel.png" alt="Carga List" title="Carga List" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="exportexcelarti();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="ajusteprod();"><img src="" . base_url() . "images/ajustes.png" alt="Ajuste Producto" title="Ajuste Producto" style="width:20px;height:20px;border:0;"></a></td>\xa " . $ajusteprc . "\xa <td class="w3-center w3-btn"><a onclick="artilist();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa </tr></table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Moneda</th><th>Producto</th><th>Ant.Costo</th><th>Desp.Costo</th><th>Ant.Precio1</th><th>Desp.Precio1</th><th>Ant.Preciofin1</th><th>Desp.Preciofin1</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; if ($dtfac->apreciofin1 < $dtfac->dpreciofin1) { $status = "Mayor"; $color = "w3-green"; } else { if ($dtfac->apreciofin1 == $dtfac->dpreciofin1) { $status = "Igual"; $color = "w3-blue"; } else { $status = "Menor"; $color = "w3-red"; } } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->id . "">\xa <td>" . $dtfac->moneda . "</td><td>" . $dtfac->codigo . " " . $dtfac->nombre . "</td><td>" . $dtfac->acosto . "</td><td>" . $dtfac->dcosto . "</td><td>" . $dtfac->aprecio1 . "</td><td>" . $dtfac->dprecio1 . "</td><td>" . $dtfac->apreciofin1 . "</td><td>" . $dtfac->dpreciofin1 . "</td><td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "<!--<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Registros: " . $totalreg . "</b></label></td></tr>--></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903";
var datos = {
"pag" : DecrementNum,
"key" : key\xa };
$.ajax({
data: datos,\xa url: baseurl+"c_droid/artilist",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); swal.close();\xa }
});\xa }\xa
function numpag(a){ before();\xa var key="droid903";
\xa var datos = {
"key":key,
"pag" : a\xa };
\xa $.ajax({
data: datos,
url: baseurl+"c_droid/artilist",
type: "POST",
success: function(data) {\xa $("#body").html(data); swal.close();\xa }\xa \xa });\xa }
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903";
var datos = {
"key":key,\xa "pag" : IncrimentNum
};
$.ajax({
data: datos,
url: baseurl+"c_droid/artilist",\xa type: "POST",
success: function(data) {
$("#body").html(data); swal.close();\xa }
\xa });\xa }\xa </script>
<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function artilist2($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE a.codigo='{$b}' || b.nombre like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT a.*,b.nombre FROM artilist a JOIN articulo b On a.codigo=b.codigo " . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.*,b.nombre FROM artilist a JOIN articulo b On a.codigo=b.codigo " . $filter . " LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $hora = $this->db->query("SELECT IF(time(NOW())>='16:00:00','S','N') n")->row(); if ($hora->n == "S") { $ajusteprc = "<td class="w3-center w3-btn"><a onclick="alertaajustelist2();"><img src="" . base_url() . "images/bn.png" alt="Ejecutar" title="Ejecutar" style="width:20px;height:20px;border:0;"></a></td>"; } else { $ajusteprc = ''; } $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="artilist2()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="w3.show('#modexcellist');"><img src="" . base_url() . "images/excel.png" alt="Carga List" title="Carga List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcelarti2();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>\xa <!--<td class="w3-center w3-btn"><a onclick="ajusteprod2();"><img src="" . base_url() . "images/ajustes.png" alt="Ajuste Producto" title="Ajuste Producto" style="width:20px;height:20px;border:0;"></a></td>-->\xa " . $ajusteprc . "
<td class="w3-center w3-btn"><a onclick="artilist2();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>
</tr></table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Moneda</th><th>Producto</th><th>Ant.Costo</th><th>Desp.Costo</th><th>Ant.Precio1</th><th>Desp.Precio1</th><th>Ant.Preciofin1</th><th>Desp.Preciofin1</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; if ($dtfac->apreciofin1 < $dtfac->dpreciofin1) { $status = "Mayor"; $color = "w3-green"; } else { if ($dtfac->apreciofin1 == $dtfac->dpreciofin1) { $status = "Igual"; $color = "w3-blue"; } else { $status = "Menor"; $color = "w3-red"; } } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->id . "">
<td>" . $dtfac->moneda . "</td><td>" . $dtfac->codigo . " " . $dtfac->nombre . "</td><td>" . $dtfac->acosto . "</td><td>" . $dtfac->dcosto . "</td><td>" . $dtfac->aprecio1 . "</td><td>" . $dtfac->dprecio1 . "</td><td>" . $dtfac->apreciofin1 . "</td><td>" . $dtfac->dpreciofin1 . "</td><td class="" . $color . " w3-center">" . $status . "</td>
</tr>"; } $html .= "<!--<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Productos: " . $TotalRegistro . "</b></label></td></tr>--></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">\xa function DecrementNum(){ before();
var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903";
var datos = {\xa "pag" : DecrementNum,
"key" : key\xa };\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/artilist",
type: "POST",
success: function(data) {\xa $("#body").html(data); swal.close();\xa }
\xa });\xa }
\xa function numpag(a){ before();
var key="droid903";
var datos = {
"key":key,
"pag" : a
};\xa \xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/artilist",\xa type: "POST",
success: function(data) {
$("#body").html(data); swal.close();
}\xa \xa });\xa }
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903";\xa var datos = {
"key":key,
"pag" : IncrimentNum\xa };
\xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/artilist",\xa type: "POST",
success: function(data) {
$("#body").html(data); swal.close();\xa }\xa
});\xa }
</script>\xa <div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa\xa </div> "; return $html; } public function ajusteprod($prod, $cost, $descu, $nom, $ganan) { $this->db->query("UPDATE articulo set costo='{$cost}',dscto_medicamentos='{$descu}',nombre='{$nom}' WHERE codigo='{$prod}'"); $db = $this->db->query("SELECT a.costo,a.precio1,a.preciofin1,a.impuesto1,c.mganan, c.moneda\xa FROM articulo a
JOIN artiprov b ON a.codigo=b.codigo\xa JOIN proveed c ON b.proveedor=c.codigo
WHERE a.codigo='{$prod}';")->row(); $tasa = $this->db->query("SELECT referencia FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); if ($db->moneda == "VE") { $moneda = $cost; } else { $moneda = $cost * $tasa->referencia; } $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($ganan / 100 + 1); $preciofin1 = $precio1 * $iva; $this->db->query("UPDATE opermv set preciooriginal='{$precio1}',preciofin='{$preciofin1}',dsctounit='{$descu}',nombre='{$nom}' WHERE codigo='{$prod}' && tipodoc='ESP' && fechadoc=CURDATE()"); $this->db->query("UPDATE artiprec set costo='{$cost}',precio1='{$precio1}',preciofin1='{$preciofin1}',descu='{$descu}' WHERE codigo='{$prod}' && fecha=curdate()"); $this->db->query("UPDATE articosto set costo='{$cost}',precio='{$precio1}',preciofin='{$preciofin1}',descu='{$descu}' WHERE codigo='{$prod}' && fecha=curdate()"); $this->db->query("UPDATE articulo set costo='{$cost}',precio1='{$precio1}',preciofin1='{$preciofin1}',dscto_medicamentos='{$descu}' WHERE codigo='{$prod}'"); $this->loguser("Ajuste Producto", "El usuario ajusta Producto " . $prod . ", Costo " . $cost . ", Ganancia " . $ganan . ", Precio " . $precio1 . ", PrecioFin" . $preciofin1 . " Descu " . $descu . ", Tasa " . $tasa->referencia . "."); return $this->db->affected_rows(); } function sincroprc($cod, $prc, $prcf, $util, $cost, $iva, $sde) { $table = "articulo"; $this->db->where("codigo", $cod)->update($table, array("precio1" => $prc, "preciofin1" => $prcf, "util1" => $util, "impuesto1" => $iva, "costo" => $cost)); return $this->db->affected_rows(); } function prcprod($prod) { $bd = $this->db->query("SELECT a.costo,a.dscto_medicamentos descu,a.nombre,c.mganan FROM articulo a\xa JOIN artiprov b ON a.codigo=b.codigo
JOIN proveed c ON b.proveedor=c.codigo WHERe a.codigo='{$prod}'")->row(); return json_encode(array("cost" => $bd->costo, "descu" => $bd->descu, "nombre" => $bd->nombre, "ganan" => $bd->mganan)); } public function monecam() { $this->load->library("table"); $bdfac = $this->db->query("SELECT * FROM monecam WHERE fecha>=DATE_SUB(curdate(),INTERVAL 15 DAY) ORDER BY fecha DESC;")->result(); $html = "
<a onclick="elimtasa();" class="w3-btn"><img src="" . base_url() . "images/borrar.png" alt="Eliminar Tasa" title="Elimina Tasa" style="width:20px;height:20px;border:0;"></a>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Fecha</th><th>BCV</th><th>Monitor</th><th></th></tr>
<tr><td><input type="date" class="w3-input" id="fecha"></td><td><input type="text" class="w3-input" id="bcv" placeholder="ingrese bcv..."></td><td><input type="text" class="w3-input" id="monitor" placeholder="ingrese monitor;"></td>
<td class="w3-btn"><a onclick="regmonecam();" style="cursor:pointer"><img src="" . base_url() . "images/registrar.png" alt="Registrar Item" title="Registrar Item" style="width:20px;height:20px;border:0;"></a></td></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; $html .= "<input type="hidden" id="a" . $i . "" name="doc2" value="" . $dtfac->id . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect2" . $i . "','w3-yellow');" class="w3-check" name="check2">" . $dtfac->fecha . "</td><td>" . $dtfac->oficial . "</td><td>" . $dtfac->referencia . "</td><td><td>\xa </tr>"; } $html .= "</table>"; return $html; } public function codganacli() { $this->load->library("table"); $cli = $this->clientes(''); $bdfac = $this->db->query("SELECT * FROM codgana")->result(); $html = "
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Cliente</th><th>Codigo</th><th>Premio</th><th>Emitido</th><th>Recepci\303\263n</th><th></th><th></th></tr>
<td>" . $cli . "</td><td></td><td><input type="text" class="w3-input" id="premio" placeholder="descrip premio"></td><td></td><td></td>\xa <td class="w3-btn"><a onclick="regcodgana();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Item" title="Registrar Item" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="showcodgana();"><img src="" . base_url() . "images/imp.png" alt="Imprimir Premio" title="Imprimir Orden" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-btn"><a onclick="codganacli();"><img src="" . base_url() . "images/reload.png" alt="Actualizar Modulo" title="Actualizar Item" style="width:20px;height:20px;border:0;"></a></td></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->frecep != null) { $color = "w3-green"; } else { $color = "w3-red"; } $html .= "<tr id="slect" . $i . "">"; $html .= "\xa <input type="hidden" name="cliente" value="" . $dtfac->cliente . ""><input type="hidden" name="codgana" value="" . $dtfac->codgana . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->cliente . "</td><td>" . $dtfac->codgana . "</td><td>" . $dtfac->premio . "</td><td>" . $dtfac->femi . "</td><td class="" . $color . "">" . $dtfac->frecep . "</td><td></td>\xa </tr>"; } $html .= "</table>"; return $html; } function regcodgana($cli, $prem) { $cod = $this->genecod("8"); $this->db->insert("codgana", array("cliente" => $cli, "codgana" => $cod, "premio" => $prem, "femi" => date("Y-m-d"))); return $this->db->affected_rows(); } function val_codgana($cod) { $db = $this->db->query("SELECT premio FROM codgana WHERE codgana='{$cod}'"); $row = $db->num_rows(); if ($row > 0) { $db = $db->row(); $this->db->query("UPDATE codgana SET frecep=curdate() WHERE codgana='{$cod}'"); $prem = $db->premio; } return json_encode(array("row" => $row, "premio" => $prem)); } function regmonecam($a, $b, $c) { $data = array("moneorg" => "VE", "moneda" => "USD", "fecha" => $a, "oficial" => $b, "referencia" => $c); $this->db->insert("monecam", $data); if ($this->db->affected_rows() > 0) { $this->cambiodolar(); $this->loguser("Tasa Dolar", "El usuario registra Oficial " . $b . ", Referencia " . $c . "."); return 1; } } function elimtasa($id) { $bd = $this->db->query("SELECT * FROM monecam WHERe id='{$id}'")->row(); $this->db->query("DELETE FROM monecam WHERE id='{$id}'"); $this->loguser("Eliminar", "El usuario elimina la tasa Oficial " . $bd->oficial . ", Referencia " . $bd->referenca . " para el " . $bd->fecha . "."); return $this->db->affected_rows(); } function cambiodolar() { $this->respaldoprec(); $bd = $this->db->query("SELECT a.codigo,a.costo,a.precio1,a.existencia,a.preciofin1,a.impuesto1,c.mganan, c.moneda\xa FROM articulo a\xa JOIN artiprov b ON a.codigo=b.codigo\xa JOIN proveed c ON b.proveedor=c.codigo\xa WHERE a.existencia>0 GROUP BY a.codigo")->result(); $i = 0; foreach ($bd as $db) { $tasa = $this->db->query("SELECT referencia FROM monecam WHERE fecha in (SELECT MAX(fecha) FROM monecam)")->row(); if ($db->moneda == "VE") { $moneda = $db->costo; } else { $moneda = $db->costo * $tasa->referencia; } $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($db->mganan / 100 + 1); $preciofin1 = $precio1 * $iva; $this->db->query("UPDATE articulo SET precio1='{$precio1}',preciofin1='{$preciofin1}' WHERE codigo='{$db->codigo}'"); if ($this->db->affected_rows()) { $i++; } } return $i; } function truncateartilist() { $this->db->query("TRUNCATE artilist;"); } function excellistcost($a, $b, $c, $d, $e, $f, $promo, $descu2) { $this->db->query("UPDATE articulo SET dscto_medicamentos='{$d}',dscto_medicamentos2='{$descu2}', impuesto1='{$c}',diasindex='{$e}',diascred='{$f}' WHERE codigo='{$a}'"); $this->db->query("UPDATE artiprov SET marca='{$promo}' WHERE codigo='{$a}'"); if ($a != null && $a != '') { $db = $this->db->query("SELECT a.codigo,a.costo,a.precio1,a.existencia,a.preciofin1,a.impuesto1,c.mganan, c.moneda\xa FROM articulo a
LEFT JOIN artiprov b ON a.codigo=b.codigo
LEFT JOIN proveed c ON b.proveedor=c.codigo\xa WHERE a.codigo='{$a}';")->row(); $tasa = $this->db->query("SELECT referencia FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); if ($db->moneda == "VE") { $moneda = $b; } else { $moneda = $b * $tasa->referencia; } $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($db->mganan / 100 + 1); $preciofin1 = $precio1 * $iva; $art = array("codigo" => $db->codigo, "moneda" => $db->moneda, "acosto" => $db->costo, "dcosto" => $b, "aprecio1" => $db->precio1, "dprecio1" => $precio1, "apreciofin1" => $db->preciofin1, "dpreciofin1" => $preciofin1); $this->db->insert("artilist", $art); return $this->db->affected_rows(); } } function excellistcost2($a, $nom, $b, $c, $d, $descu, $descu2) { if ($a != null && $a != '') { $db = $this->db->query("SELECT a.codigo,a.costo,ROUND(a.precio1,2) precio1,a.existencia,a.preciofin1,a.impuesto1,ROUND(a.util1,2) mganan, c.moneda\xa FROM articulo a
LEFT JOIN artiprov b ON a.codigo=b.codigo
LEFT JOIN proveed c ON b.proveedor=c.codigo
WHERE a.codigo='{$a}';")->row(); if ($db->codigo != '') { $this->db->query("UPDATE articulo set dscto_medicamentos='{$descu}',dscto_medicamentos2='{$descu2}' WHERE codigo='{$a}'"); if ($b > 0) { if ($db->mganan != $d) { $mganan = $d; $this->db->query("UPDATE articulo set util1='{$d}' WHERE codigo='{$a}'"); } else { $mganan = $db->mganan; } if ($c > 0) { $mganan = $c * 100 / $b - 100; $this->db->query("UPDATE articulo set util1='{$mganan}' WHERE codigo='{$a}'"); } $tasa = $this->db->query("SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($mganan / 100 + 1); $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "VE"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("codigo" => $db->codigo, "moneda" => $tipom, "acosto" => $db->costo, "dcosto" => $moneda, "aprecio1" => $db->precio1, "dprecio1" => $precio1, "apreciofin1" => $db->preciofin1, "dpreciofin1" => $preciofin1, "autil1" => $db->mganan, "util1" => $mganan); $this->db->insert("artilist", $art); } else { if ($c > 0) { $mganan = $c * 100 / $db->costo - 100; $this->db->query("UPDATE articulo set util1='{$mganan}' WHERE codigo='{$a}'"); } $tasa = $this->db->query("SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $c; $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "VE"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("codigo" => $db->codigo, "moneda" => $tipom, "acosto" => $db->costo, "dcosto" => $db->costo, "aprecio1" => $db->precio1, "dprecio1" => $precio1, "apreciofin1" => $db->preciofin1, "dpreciofin1" => $preciofin1, "autil1" => $db->mganan, "util1" => $mganan); $this->db->insert("artilist", $art); } } else { $db = $this->db->query("SELECT a.codigo,a.costo,ROUND(a.precio1,2) precio1,a.existencia,a.preciofin1,a.impuesto1,ROUND(a.util1,2) mganan, c.moneda\xa FROM articulo a
LEFT JOIN artiprov b ON a.codigo=b.codigo
LEFT JOIN proveed c ON b.proveedor=c.codigo
WHERE a.nombre='{$nom}';")->row(); if ($db->codigo != '') { $this->db->query("UPDATE articulo set dscto_medicamentos='{$descu}',dscto_medicamentos2='{$descu2}' WHERE codigo='{$db->codigo}'"); if ($b > 0) { if ($db->mganan != $d) { $mganan = $d; $this->db->query("UPDATE articulo set util1='{$d}' WHERE codigo='{$db->codigo}'"); } else { $mganan = $db->mganan; } if ($c > 0) { $mganan = $c * 100 / $b - 100; $this->db->query("UPDATE articulo set util1='{$mganan}' WHERE codigo='{$db->codigo}'"); } $tasa = $this->db->query("SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($mganan / 100 + 1); $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "VE"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("codigo" => $db->codigo, "moneda" => $tipom, "acosto" => $db->costo, "dcosto" => $moneda, "aprecio1" => $db->precio1, "dprecio1" => $precio1, "apreciofin1" => $db->preciofin1, "dpreciofin1" => $preciofin1, "autil1" => $db->mganan, "util1" => $mganan); $this->db->insert("artilist", $art); } else { if ($c > 0) { $mganan = $c * 100 / $db->costo - 100; $this->db->query("UPDATE articulo set util1='{$mganan}' WHERE codigo='{$db->codigo}'"); } $tasa = $this->db->query("SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $c; $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "VE"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("codigo" => $db->codigo, "moneda" => $tipom, "acosto" => $db->costo, "dcosto" => $db->costo, "aprecio1" => $db->precio1, "dprecio1" => $precio1, "apreciofin1" => $db->preciofin1, "dpreciofin1" => $preciofin1, "autil1" => $db->mganan, "util1" => $mganan); $this->db->insert("artilist", $art); } } } return $this->db->affected_rows(); } } function excellistdescucli($a, $b, $tipo, $clase) { if ($a != null && $a != '') { $this->db->where("codigo", $a)->update("cliempre", array("descuento" => $b, "tipo" => $tipo, "subdivision" => $clase)); return $this->db->affected_rows(); } } function ajustelistinv() { $this->corteconsig(); $this->respaldoprec(); $bd = $this->db->query("SELECT a.codigo,a.acosto,a.dcosto,a.aprecio1,a.dprecio1,a.apreciofin1,a.dpreciofin1,c.moneda,c.nombre,c.mganan FROM artilist a JOIN artiprov b ON a.codigo=b.codigo\xa JOIN proveed c on c.codigo=b.proveedor GROUP BY a.codigo")->result(); $i = 0; $tasa = $this->db->query("SELECT referencia FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); foreach ($bd as $db) { $descu = $this->db->query("SELECT a.dscto_medicamentos n FROM articulo a WHERE a.codigo='{$db->codigo}'")->row(); $valcopy = $this->db->query("SELECT NULL FROM articosto WHERE codigo='{$db->codigo}' && fecha=curdate() && costo='{$db->acosto}'")->num_rows(); if ($valcopy == 0) { $copyart = array("codigo" => $db->codigo, "fecha" => date("Y-m-d"), "costo" => $db->acosto, "descu" => $descu->n, "moneda" => $db->moneda, "precio" => $db->aprecio1, "preciofin" => $db->apreciofin1); $this->db->insert("articosto", $copyart); } if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo SET costo='{$db->dcosto}',precio1='{$db->dprecio1}',preciofin1='{$db->dpreciofin1}' WHERE codigo='{$db->codigo}'"); if ($this->db->affected_rows()) { $i++; $this->loguser("Ajuste Precios", "El usuario ajusta precios Proveedor " . $db->nombre . ", Producto " . $db->codigo . ", Costo " . $db->dcosto . ", Ganancia " . $db->mganan . ",Precio " . $db->dprecio1 . ", PrecioFin " . $db->dpreciofin1 . " Tasa " . $tasa->referencia . "."); } } } if ($i > 0) { $this->truncateartilist(); } return $i; } function ajustelistinv2() { $this->corteconsig(); $this->respaldoprec(); $bd = $this->db->query("SELECT a.codigo,a.acosto,a.dcosto,a.aprecio1,a.dprecio1,a.apreciofin1,a.dpreciofin1,c.moneda,c.nombre,a.util1 mganan FROM artilist a JOIN artiprov b ON a.codigo=b.codigo\xa JOIN proveed c on c.codigo=b.proveedor GROUP BY a.codigo")->result(); $i = 0; $tasa = $this->db->query("SELECT referencia FROM monecam ORDER BY fecha DESC LIMIT 1")->row(); foreach ($bd as $db) { $valcopy = $this->db->query("SELECT NULL FROM articosto WHERE codigo='{$db->codigo}' && fecha=curdate() && costo='{$db->acosto}'")->num_rows(); if ($valcopy == 0) { $copyart = array("codigo" => $db->codigo, "fecha" => date("Y-m-d"), "costo" => $db->acosto, "descu" => 0, "moneda" => $db->moneda, "precio" => $db->aprecio1, "preciofin" => $db->apreciofin1); $this->db->insert("articosto", $copyart); } if ($this->db->affected_rows() > 0) { $this->db->query("UPDATE articulo SET costo='{$db->dcosto}',precio1='{$db->dprecio1}',preciofin1='{$db->dpreciofin1}',util1='{$db->mganan}' WHERE codigo='{$db->codigo}'"); if ($this->db->affected_rows()) { $i++; $this->loguser("Ajuste Precios", "El usuario ajusta precios Productos " . $db->nombre . ", Producto " . $db->codigo . ", Costo " . $db->dcosto . ", Ganancia " . $db->mganan . ",Precio " . $db->dprecio1 . ", PrecioFin " . $db->dpreciofin1 . " Tasa " . $tasa->referencia . "."); } } } if ($i > 0) { $this->truncateartilist(); } return $i; } function respaldoprec() { $val = $this->db->query("SELECT NULL FROM artiprec WHERE fecha=curdate()")->num_rows(); if ($val == 0) { $art = $this->db->query("SELECT codigo, nombre,grupo,costo,precio1, preciofin1,impuesto1,diasindex,diascred FROM articulo WHERE existencia>0")->result(); foreach ($art as $dart) { $tasa = $this->db->query("SELECT oficial FROM monecam WHERE fecha<=CURDATE() ORDER BY fecha DESC LIMIT 1")->row()->oficial; $costobs = $dart->costo * $tasa; $data = array("fecha" => date("Y-m-d"), "nombre" => $dart->nombre, "grupo" => $dart->grupo, "costo" => $dart->costo, "codigo" => $dart->codigo, "precio1" => $dart->precio1, "preciofin1" => $dart->preciofin1, "impuesto1" => $dart->impuesto1, "costobs" => $costobs); $this->db->insert("artiprec", $data); } } } function exportexcelarti($a) { return $this->db->query("SELECT trim(a.codigo) codigo,a.nombre,d.nombre lab,d.moneda,b.almacen,ROUND(a.costo,2)costo,
ROUND(a.impuesto1,0) iva,a.dscto_medicamentos descu,a.diasindex,a.diascred,c.marca promo_prov,a.dscto_medicamentos2 descu2,ROUND(a.existencia,0) existen\xa FROM articulo a\xa LEFT JOIN artilotes b ON a.codigo=b.codigoart\xa JOIN artiprov c ON a.codigo=c.codigo\xa JOIN proveed d ON c.proveedor=d.codigo\xa WHERE d.id='{$a}'
GROUP BY a.codigo ORDER BY a.codigo ASC"); } function exportexcelarti2($a) { if ($a == "Todo") { return $this->db->query("SELECT trim(a.codigo) codigo,a.nombre,ROUND(a.costo,2)costo,\xa ROUND(a.precio1/(SELECT oficial FROM monecam ORDER BY fecha desc LIMIT 1),2) precio,ROUND(a.util1,2) utilidad,dscto_medicamentos descu,dscto_medicamentos2 descu2, ROUND(a.existencia) existen
FROM articulo a where a.existencia>0;"); } else { return $this->db->query("SELECT trim(a.codigo) codigo,a.nombre,ROUND(a.costo,2)costo,
ROUND(a.precio1/(SELECT oficial FROM monecam ORDER BY fecha desc LIMIT 1),2) precio,ROUND(a.util1,2) utilidad,dscto_medicamentos descu,dscto_medicamentos2 descu2, ROUND(a.existencia) existen\xa FROM articulo a where a.grupo='{$a}' && a.existencia>0;"); } } function tipoartilist() { $bd = $this->db->query("SELECT codigo,nombre FROM grupos;")->result(); $html = ''; foreach ($bd as $db) { $html .= "<option value="" . $db->codigo . "">" . $db->nombre . "</option>"; } return $html; } function corteconsig() { $bd = $this->db->query("SELECT a.proveedor FROM artiprov a JOIN artilist b on a.codigo=b.codigo GROUP BY a.proveedor")->result(); foreach ($bd as $db) { $bd2 = $this->db->query("SELECT a.id,a.frecep,\xa (SELECT IF(SUM(cant)>0,SUM(cant),0) FROM itordc WHERE ordc=a.id) cant,
(SELECT IF(SUM(consumido)>0,SUM(consumido),0) FROM consigordc WHERE ordc=a.id) cons \xa FROM ordc a JOIN proveed b on a.proveed=b.id \xa WHERE b.codigo='{$db->proveedor}' && a.tipopag='0' && a.status='1'")->result(); foreach ($bd2 as $db2) { if ($db2->cons < $db2->cant) { $bd3 = $this->db->query("SELECT id,codigo,lote FROM itordc WHERE ordc='{$db2->id}'")->result(); $bd4 = $this->db->query("SELECT fecha FROM consigordc WHERE ordc='{$db2->id}' ORDER BY fecha DESC LIMIT 1"); if ($bd4->num_rows() > 0) { $db4 = $bd4->row(); $fech = $db4->fecha; } else { $fech = $db2->frecep; } foreach ($bd3 as $db3) { $bd5 = $this->db->query("SELECT SUM(a.cantidad) cons,SUM(a.cntdevuelt) dev FROM opermv a JOIN operti b ON a.documento=b.documento WHERE a.codigo='{$db3->codigo}' && a.lote='{$db3->lote}' && a.fechadoc>'{$fech}' && (b.tipodoc='FAC' || b.tipodoc='NOT') GROUP BY a.codigo,a.lote"); $db6 = $this->db->query("SELECT acosto FROM artilist WHERE codigo='{$db3->codigo}'")->row(); $cost = $db6->acosto; if ($cost == null) { $cost = 0; } if ($bd5->num_rows() > 0) { $db5 = $bd5->row(); $consig = array("ordc" => $db2->id, "itordc" => $db3->id, "fecha" => date("Y-m-d"), "consumido" => $db5->cons, "devuelta" => $db5->dev, "costo" => $cost); $this->db->insert("consigordc", $consig); } } } } } } public function proveed($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE codigo='{$b}' || nombre like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT codigo,nombre,rif,dias,inicio,final,diaspromo, moneda,mganan,descu,vol FROM proveed " . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT codigo,nombre,rif,dias,inicio,final,diaspromo, moneda,mganan,descu,vol,descu2,vol2,descu3,vol3,descu4,vol4,descu5,vol5,retiene FROM proveed " . $filter . " ORDER BY nombre ASC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="proveed()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="w3.show('#modexcelprov');"><img src="" . base_url() . "images/excel.png" alt="Carga List" title="Carga List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcellistprov();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="w3.show('#formprov');"><img src="" . base_url() . "images/registrar.png" alt="Registrar Prov" title="Registrar Prov" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="w3.show('#formeditprov');"><img src="" . base_url() . "images/editar.png" alt="Editar Proveedor" title="Editar Proveedor" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="proveed();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Nombre</th><th>Rif</th><th>Moneda</th><th>Ganancia</th><th>Dias</th><th>Descu</th><th>Vol</th><th>Descu2</th><th>Vol2</th><th>Descu3</th><th>Vol3</th><th>Descu4</th><th>Vol4</th><th>Descu5</th><th>Vol5</th><th>Inicio</th><th>Final</th><th>Dias Promo</th><th>Retiene</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($this->session->userdata("tip") == 8 || $this->session->userdata("tip") == 2) { $mganan = $dtfac->mganan; } else { $mganan = ''; } $html .= "<tr id="slect" . $i . "" class="item" onclick="itprov($('#a" . $i . "').val());">"; $html .= "<input type="hidden" id="a" . $i . "" name="codigo" value="" . $dtfac->codigo . "">
<td>" . $dtfac->codigo . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->rif . "</td><td>" . $dtfac->moneda . "</td><td>" . $mganan . "</td><td>" . $dtfac->dias . "</td><td>" . $dtfac->descu . "</td><td>" . $dtfac->vol . "</td><td>" . $dtfac->descu2 . "</td><td>" . $dtfac->vol2 . "</td><td>" . $dtfac->descu3 . "</td><td>" . $dtfac->vol3 . "</td><td>" . $dtfac->descu4 . "</td><td>" . $dtfac->vol4 . "</td><td>" . $dtfac->descu5 . "</td><td>" . $dtfac->vol5 . "</td><td>" . $dtfac->inicio . "</td><td>" . $dtfac->final . "</td><td>" . $dtfac->diaspromo . "</td>
<td>" . $dtfac->retiene . "</td>
</tr>"; } $html .= "<!--<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total registros: " . $totalreg . "</b></label></td></tr>--></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNum(){ before();
var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903";\xa var datos = {\xa "pag" : DecrementNum,
"key" : key
};
\xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/proveed",\xa type: "POST",
success: function(data) {\xa $("#body").html(data);
}\xa \xa });
}
\xa function numpag(a){ before();\xa var key="droid903";
var datos = {\xa "key":key,
"pag" : a
};\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/proveed",
type: "POST",\xa success: function(data) {
$("#body").html(data);\xa }\xa
});
}\xa \xa function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903";
var datos = {\xa "key":key,
"pag" : IncrimentNum\xa };\xa \xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/proveed",\xa type: "POST",\xa success: function(data) {
$("#body").html(data);\xa }\xa
});\xa }
</script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>
</div> "; return $html; } public function itprov($a) { $this->load->library("table"); $bdfac = $this->db->query("SELECT a.codigo,b.nombre FROM artiprov a JOIN articulo b on a.codigo=b.codigo WHERE a.proveedor='{$a}' ORDER BY b.nombre ASC;")->result(); $html = "
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Nombre</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->id . "">\xa <td>" . $dtfac->codigo . "</td><td>" . $dtfac->nombre . "</td>\xa </tr>"; } $html .= "</table>"; return $html; } function excellistprov($id, $a, $b, $c, $d, $e, $f, $g, $h, $desc, $vol, $desc2, $vol2, $desc3, $vol3, $desc4, $vol4, $desc5, $vol5, $ret, $islr) { $cod = str_pad($id, 4, "0", STR_PAD_LEFT); $data = array("nombre" => $a, "rif" => $b, "dias" => $c, "inicio" => $d, "final" => $e, "diaspromo" => $f, "moneda" => $g, "mganan" => $h, "descu" => $desc, "vol" => $vol, "descu2" => $desc2, "vol2" => $vol2, "descu3" => $desc3, "vol3" => $vol3, "descu4" => $desc4, "vol4" => $vol4, "descu5" => $desc5, "vol5" => $vol5, "retiene" => $ret, "islr_j" => $islr); $this->db->where("codigo", $cod)->update("proveed", $data); return $this->db->affected_rows(); } function excellistprov2($id, $a, $b, $c, $d, $e, $f, $g, $desc, $vol, $desc2, $vol2, $desc3, $vol3, $desc4, $vol4, $desc5, $vol5, $ret, $islr) { $cod = str_pad($id, 4, "0", STR_PAD_LEFT); $data = array("nombre" => $a, "rif" => $b, "dias" => $c, "inicio" => $d, "final" => $e, "diaspromo" => $f, "moneda" => $g, "descu" => $desc, "vol" => $vol, "descu2" => $desc2, "vol2" => $vol2, "descu3" => $desc3, "vol3" => $vol3, "descu4" => $desc4, "vol4" => $vol4, "descu5" => $desc5, "vol5" => $vol5, "retiene" => $ret, "islr_j" => $islr); $this->db->where("codigo", $cod)->update("proveed", $data); return $this->db->affected_rows(); } function regprov($a, $b, $c, $d, $e, $f, $g, $h, $i, $telf, $dirr, $nomcontac, $telfcontac, $retiene, $islr) { $num = $this->db->query("SELECT MAX(codigo)+1 n FROM proveed")->row(); $newcod = str_pad($num->n, 4, "0", STR_PAD_LEFT); $data = array("codigo" => $newcod, "nombre" => $a, "rif" => $b, "dias" => $c, "inicio" => $d, "final" => $e, "diaspromo" => $f, "moneda" => $g, "mganan" => $h, "descu" => $i, "telefono" => $telf, "direccion" => $dirr, "nombre_contacto" => $nomcontac, "telefono_contacto" => $telfcontac, "retiene" => $retiene, "islr_j" => $islr); $this->db->insert("proveed", $data); $this->loguser("Crea Proveed", "El usuario crea el proveedor:" . $a . " codigo:" . $newcod . " rif:" . $b . " dias:" . $c . " moneda:" . $g . " descu:" . $i . ''); return $this->db->affected_rows(); } function editproveed($id, $a, $b, $c, $d, $e, $f, $g, $h, $i, $telf, $dirr, $nomcontac, $telfcontac, $retiene, $islr) { $num = $this->db->query("SELECT MAX(codigo)+1 n FROM proveed")->row(); $newcod = str_pad($num->n, 4, "0", STR_PAD_LEFT); $data = array("codigo" => $newcod, "nombre" => $a, "rif" => $b, "dias" => $c, "inicio" => $d, "final" => $e, "diaspromo" => $f, "moneda" => $g, "mganan" => $h, "descu" => $i, "telefono" => $telf, "direccion" => $dirr, "nombre_contacto" => $nomcontac, "telefono_contacto" => $telfcontac, "retiene" => $retiene, "islr_j" => $islr); $this->db->where("id='{$id}'")->update("proveed", $data); $this->loguser("Edita Proveed", "El usuario edita el proveedor:" . $a . " codigo:" . $newcod . " rif:" . $b . " dias:" . $c . " moneda:" . $g . " descu:" . $i . ''); return $this->db->affected_rows(); } function exportexcellistprov() { if ($this->session->userdata("tip") == 8 || $this->session->userdata("tip") == 2) { return $this->db->query("SELECT codigo,nombre,rif,dias,inicio,final,diaspromo,moneda,mganan,descu,vol,descu2,vol2,descu3,vol3,descu4,vol4,descu5,vol5,retiene,islr_j FROM proveed ORDER BY nombre ASC"); } else { return $this->db->query("SELECT codigo,nombre,rif,dias,inicio,final,diaspromo,moneda,'0' mganan,descu,vol,descu2,vol2,descu3,vol3,descu4,vol4,descu5,vol5,retiene,islr_j FROM proveed ORDER BY nombre ASC"); } } public function consigordc($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE a.ordc='{$b}' || c.nombre like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM consigordc a \xa JOIN ordc b ON a.ordc=b.id JOIN proveed c ON b.proveed=c.id " . $filter . " GROUP BY a.ordc,a.fecha ORDER BY a.ncontrol,a.fecha DESC")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.ordc,a.fecha,c.nombre, c.moneda,SUM(a.consumido) cons,IF(a.ncontrol>0,a.ncontrol,'N/A') ncontrol FROM consigordc a
JOIN ordc b ON a.ordc=b.id JOIN proveed c ON b.proveed=c.id " . $filter . " GROUP BY a.ordc,a.fecha ORDER BY a.ncontrol,a.fecha DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="consigordc()" id="like"></td>
<td class="w3-center w3-btn"><a onclick="exportexcelconsig();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="regncontrol();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Control" title="Registrar Control" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="consigordc();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Orden</th><th>Corte</th><th>Nombre</th><th>Moneda</th><th>Consumido</th><th>Total</th><th>Ncontrol</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $bd = $this->db->query("SELECT SUM(consumido*costo) total FROM consigordc WHERE ordc='{$dtfac->ordc}' && fecha='{$dtfac->fecha}' GROUP BY itordc")->result(); $tot = 0; foreach ($bd as $dt) { $tot += $dt->total; } if ($dtfac->ncontrol == "N/A") { $color = "class="w3-red""; $status = "Pendiente"; } else { $color = "class="w3-green""; $status = "Listo"; } $html .= "<tr id="slect" . $i . "" class="item" onclick="itconsig($('#a" . $i . "').val(),$('#b" . $i . "').val());">"; $html .= "<input type="hidden" id="a" . $i . "" name="orden" value="" . $dtfac->ordc . ""><input type="hidden" id="b" . $i . "" name="corte" value="" . $dtfac->fecha . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->ordc . "</td><td>" . $dtfac->fecha . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->moneda . "</td><td>" . $dtfac->cons . "</td><td>" . $tot . "</td><td>" . $dtfac->ncontrol . "</td><td " . $color . ">" . $status . "</td>\xa </tr>"; } $html .= "</table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903";\xa var datos = {
"pag" : DecrementNum,
"key" : key
};\xa
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/consigordc",
type: "POST",\xa success: function(data) {
$("#body").html(data); swal.close();
}\xa
});
}\xa \xa function numpag(a){ before();\xa var key="droid903";\xa \xa var datos = {\xa "key":key,
"pag" : a
};
\xa $.ajax({
data: datos,
url: baseurl+"c_droid/consigordc",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); swal.close();
}
});\xa }
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903";\xa var datos = {
"key":key,\xa "pag" : IncrimentNum\xa };
$.ajax({\xa data: datos,
url: baseurl+"c_droid/consigordc",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); swal.close();
}
});\xa }\xa </script>\xa <div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } public function itconsig($a, $b) { $this->load->library("table"); $bdfac = $this->db->query("SELECT b.codigo,b.lote,b.cant,a.consumido,a.devuelta,a.costo,(a.consumido*a.costo) total FROM consigordc a JOIN itordc b ON a.itordc=b.id WHERE a.ordc='{$a}' && a.fecha='{$b}' GROUP BY a.itordc")->result(); $html = "\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Lote</th><th>Cantidad</th><th>Consumido</th><th>Devuelta</th><th>Costo</th><th>Total</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->id . "">
<td>" . $dtfac->codigo . "</td><td>" . $dtfac->lote . "</td><td>" . $dtfac->cant . "</td><td>" . $dtfac->consumido . "</td><td>" . $dtfac->devuelta . "</td><td>" . $dtfac->costo . "</td><td>" . $dtfac->total . "</td>\xa </tr>"; } $html .= "</table>"; return $html; } public function regncontrol($a, $b, $c) { $this->db->query("UPDATE consigordc set ncontrol='{$c}' WHERE ordc='{$a}' && fecha='{$b}'"); return $this->db->affected_rows(); } function exportexcelconsig($a, $b) { return $this->db->query("SELECT b.codigo,b.lote,b.cant,a.consumido,a.devuelta,d.moneda,a.costo,(a.consumido*a.costo) total FROM consigordc a \xa JOIN itordc b ON a.itordc=b.id JOIN ordc c ON c.id=a.ordc JOIN proveed d ON d.id=c.proveed\xa WHERE a.ordc='{$a}' && a.fecha='{$b}' GROUP BY a.itordc"); } public function kardex($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE (a.codigoart='{$b}' || b.nombre like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM (SELECT NULL FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo " . $filter . ") kardex ")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT almacen,codigoart,nombre,lote,cargo+cargo2 cargo,descargo+descargo2 descargo,ingreso,egreso,devuelta, IF((cargo+cargo2-descargo-descargo2+ingreso-egreso+devuelta)>0,(cargo+cargo2-descargo-descargo2+ingreso-egreso+devuelta),0) existen FROM (\xa SELECT a.almacen,a.codigoart,b.nombre,a.lote,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>'2023-12-29'),0) cargo,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>'2023-12-29'),0) cargo2,
IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>'2023-12-29'),0) descargo,
IF((SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>'2023-12-29')>0,(SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>'2023-12-29'),0) descargo2,\xa IF((SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.status='1')>0,(SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.status='1'),0) ingreso,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29'),0),0) egreso,\xa ROUND(IF((SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29')>0,(SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29'),0),0) devuelta
FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo " . $filter . " GROUP BY a.almacen,a.codigoart,a.lote) kardex LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="kardex()" id="like"></td>\xa <!--<td><input type="date" class="w3-input" id="fdesde"><input type="date" class="w3-input" id="fhasta"></td>-->
<td class="w3-center w3-btn"><a onclick="kardex();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>\xa </tr></table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Almacen</th><th>Codigo</th><th>Nombre</th><th>Lote</th><th>Cargo</th><th>Descargo</th><th>Ingreso</th>
<th>Egreso</th><th>Devuelta</th><th>Existen</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; if ($dtfac->existen > 0) { $color = "w3-green"; } else { $color = "w3-red"; } $html .= "<input type="hidden" id="a" . $i . "" name="codigo" value="" . $dtfac->codigoart . ""> <input type="hidden" id="a" . $i . "" name="almacen" value="" . $dtfac->almacen . "">\xa <input type="hidden" id="a" . $i . "" name="lote" value="" . $dtfac->lote . "">
<td>" . $dtfac->almacen . "</td><td>" . $dtfac->codigoart . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->lote . "</td><td style="cursor:pointer;" onclick="itkardex(" . $i . ",1);">" . $dtfac->cargo . "</td><td style="cursor:pointer;" onclick="itkardex(" . $i . ",2);">" . $dtfac->descargo . "</td>
<td style="cursor:pointer;" onclick="itkardex(" . $i . ",3);">" . $dtfac->ingreso . "</td><td style="cursor:pointer;" onclick="itkardex(" . $i . ",4);">" . $dtfac->egreso . "</td><td style="cursor:pointer;" onclick="itkardex(" . $i . ",5);">" . $dtfac->devuelta . "</td><td class="" . $color . "">" . $dtfac->existen . "</td>
</tr>"; } $html .= "</table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">
function DecrementNum(){ before();
var DecrementNum=document.getElementById("DecrementNum").value; var like=$("#like").val();
var key="droid903";\xa var datos = {
"pag" : DecrementNum,
"key" : key\xa };
$.ajax({
data: datos,\xa url: baseurl+"c_droid/kardex",\xa type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()
}
\xa });\xa }
function numpag(a){ before();
var key="droid903"; var like=$("#like").val();\xa \xa var datos = {
"key":key,\xa "pag" : a
};\xa \xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/kardex",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}\xa \xa });
}
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();\xa var datos = {
"key":key,
"pag" : IncrimentNum
};\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/kardex",
type: "POST",
success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()
}
});\xa }\xa </script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } public function itkardex($alm, $cod, $lot, $fdesde, $fhasta, $cons) { $this->load->library("table"); if ($cons == 1) { $bdfac = $this->db->query("SELECT id doc,'MESYST' cliente,dalm almacen,codigo,dlote lote,cant,fech fecha FROM ajusteinv a WHERE a.dalm='{$alm}' && a.codigo='{$cod}' && a.dlote='{$lot}' && (a.tipo=1 || a.tipo=3) && a.fech>'2023-12-29'\xa UNION
SELECT null,null,null,NULL,'<b>Total</b>',SUM(cant),null FROM ajusteinv a WHERE a.dalm='{$alm}' && a.codigo='{$cod}' && a.dlote='{$lot}' && (a.tipo=1 || a.tipo=3) && a.fech>'2023-12-29';")->result(); } if ($cons == 2) { $bdfac = $this->db->query("SELECT id doc,'MESYST' cliente,alm almacen,codigo,lote,cant,fech fecha FROM ajusteinv a WHERE a.alm='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && (a.tipo=0 || a.tipo=3) && a.fech>'2023-12-29'
UNION \xa SELECT null,null,NULL,null,'<b>Total</b>',SUM(cant),null FROM ajusteinv a WHERE a.alm='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && (a.tipo=0 || a.tipo=3) && a.fech>'2023-12-29';")->result(); } if ($cons == 3) { $bdfac = $this->db->query("SELECT a.ordc doc,'MESYST' cliente,b.almacen,a.codigo,a.lote,a.cant,b.frecep fecha FROM itordc a JOIN ordc b ON a.ordc=b.id WHERE b.almacen='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && b.frecep>'2023-12-29'\xa UNION \xa SELECT null,null,null,NULL,'<b>total</b>',SUM(a.cant) cant,null FROM itordc a JOIN ordc b ON a.ordc=b.id WHERE b.almacen='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && b.frecep>'2023-12-29'")->result(); } if ($cons == 4) { $bdfac = $this->db->query("SELECT a.documento doc,concat(b.codcliente,b.nombrecli) cliente,a.almacen,a.codigo,a.lote,ROUND(a.cantidad,0) cant,b.fechacrea fecha FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.almacen='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && b.fechacrea>'2023-12-29' GROUP BY a.documento,a.almacen,a.codigo,a.lote
UNION \xa SELECT null,null,null,NULL,'<b>total</b>',ROUND(SUM(a.cantidad),0) cant,null FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.almacen='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && b.fechacrea>'2023-12-29' GROUP BY a.almacen,a.codigo,a.lote")->result(); } if ($cons == 5) { $bdfac = $this->db->query("SELECT a.documento doc,concat(b.codcliente,b.nombrecli) cliente,a.almacen,a.codigo,a.lote,ROUND(a.cntdevuelt,0) cant,b.fechacrea fecha FROM devolmv a JOIN devolti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.almacen='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && a.cntdevuelt>0 && a.tipodoc='DEV' && b.fechacrea>'2023-12-29' GROUP BY a.documento,a.almacen,a.codigo,a.lote
UNION \xa SELECT null,null,null,NULL,'<b>total</b>',ROUND(SUM(a.cntdevuelt),0) cant,null FROM devolmv a JOIN devolti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.almacen='{$alm}' && a.codigo='{$cod}' && a.lote='{$lot}' && a.cntdevuelt>0 && a.tipodoc='DEV' && b.fechacrea>'2023-12-29' GROUP BY a.almacen,a.codigo,a.lote")->result(); } $html = "
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Documento</th><th>Cliente</th><th>Almacen</th><th>Codigo</th><th>Lote</th><th>Cantidad</th><th>Fecha</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>
<td>" . $dtfac->doc . "</td> <td>" . $dtfac->cliente . "</td> <td>" . $dtfac->almacen . "</td> <td>" . $dtfac->codigo . "</td> <td>" . $dtfac->lote . "</td> <td>" . $dtfac->cant . "</td> <td>" . $dtfac->fecha . "</td>
</tr>"; } $html .= "</table>"; return $html; } function activaart($cod) { $row = count($cod); $j = 0; for ($i = 0; $i < $row; $i++) { if ($cod[$i] != '' && $cod[$i] != null) { $bd = $this->db->query("SELECT para_web FROM articulo WHERE codigo='{$cod[$i]}'")->row(); if ($bd->para_web == 1) { $new = 0; } else { $new = 1; } $this->db->query("UPDATE articulo set para_web='{$new}' WHERE codigo='{$cod[$i]}'"); if ($this->db->affected_rows() > 0) { $j++; $this->loguser("Activa/Desactiva Articulo", "El usuario activa\desactiva, proceso: " . $new . ", para el producto " . $cod[$i] . "."); } } } return $j; } public function articulo($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE (a.codigo='{$b}' || a.nombre like '%{$b}%' || a.marca like '%{$b}%'|| d.nombre like '%{$b}%' || d.codigo='{$b}')"; if ($b == ">0") { $filter = "WHERE a.comprometido>0"; } } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL
FROM articulo a
LEFT JOIN artiprov c ON a.codigo=c.codigo
LEFT JOIN proveed d ON c.proveedor=d.codigo
" . $filter . "\xa GROUP BY a.codigo ORDER BY a.codigo ASC")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.codigo,CONCAT(TRIM(a.codigo),' ',a.nombre) produc,a.referencia,a.marca lab,ROUND(a.precio1,2)precio1,ROUND(a.preciofin1,2)preciofin1,\xa ROUND(a.impuesto1,0) iva,ROUND(a.existencia-(a.comprometido+(SELECT IF(SUM(cant>0),SUM(cant),0) FROM tem_pedido WHERE cod_med=a.codigo)),0) existen,d.moneda,ROUND(a.comprometido+(SELECT IF(SUM(cant>0),SUM(cant),0) FROM tem_pedido WHERE cod_med=a.codigo),0) comp,a.controlado,a.para_web,a.diasindex,a.diascred\xa FROM articulo a
LEFT JOIN artiprov c ON a.codigo=c.codigo
LEFT JOIN proveed d ON c.proveedor=d.codigo
" . $filter . "
GROUP BY a.codigo ORDER BY existen DESC,a.codigo ASC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="articulo()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="w3.show('#modcargalote');"><img src="" . base_url() . "images/excel.png" alt="Cargar Ajuste" title="Cargar Ajuste" style="width:18px;height:18px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="ajustecant();"><img src="" . base_url() . "images/ajustecaja.png" alt="Ajuste Cargo/Descargo" title="Ajuste Cargo/Descargo" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="tranfalm();"><img src="" . base_url() . "images/tranfalm.png" alt="Cargar Transaferencia" title="Cargar Transaferencia" style="width:18px;height:18px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="exportexcelartitodo();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcelartimovil();"><img src="" . base_url() . "images/xls.png" alt="Export List Movil" title="Export List Movil" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="regarti();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Articulo" title="Registrar Articulo" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="editarti();"><img src="" . base_url() . "images/editar.png" alt="Editar Articulo" title="Editar Articulo" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="activaart();"><img src="" . base_url() . "images/ajustes.png" alt="Activar/Inactivar" title="Activar/Inactivar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="ajustearti();"><img src="" . base_url() . "images/ajuste.png" alt="Ajustar Inventario" title="Ajustar Inventario" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="articulo();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Producto</th><th>Principio</th><th>Marca</th><th>Moneda</th><th>Dias.I</th><th>Dias.C</th><th>Precio1</th><th>IVA</th><th>Preciofin1</th>
<th>Existen</th><th>Comp</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->controlado == 1) { $leg = "class="w3-pink""; } else { $leg = ''; } if ($dtfac->existen > 0) { $color2 = "class="w3-green""; } else { $color2 = "class="w3-red""; } if ($dtfac->para_web > 0) { $color = "class="w3-green""; $status = "Activo"; } else { $color = "class="w3-red""; $status = "Inactivo"; } if ($dtfac->moneda == "VE") { $monen = " Bs"; } else { $monen = " $"; } $html .= "<tr id="slect" . $i . "" class="item" onclick="itart($('#a" . $i . "').val());">"; $html .= "<input type="hidden" id="a" . $i . "" name="codigo" value="" . $dtfac->codigo . "">\xa <td " . $leg . "><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->produc . "</td><td>" . $dtfac->referencia . "</td><td>" . $dtfac->lab . "</td><td>" . $monen . "</td><td>" . $dtfac->diasindex . "</td><td>" . $dtfac->diascred . "</td>\xa <td>" . $dtfac->precio1 . "</td><td>" . $dtfac->iva . "</td><td>" . $dtfac->preciofin1 . "</td><td " . $color2 . ">" . $dtfac->existen . "</td><td>" . $dtfac->comp . "</td><td " . $color . ">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Producto: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903"; var like=$("#like").val();\xa var datos = {\xa "pag" : DecrementNum,
"key" : key,like:like\xa };
\xa $.ajax({
data: datos,
url: baseurl+"c_droid/articulo",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}
});\xa }
function numpag(a){ before();\xa var key="droid903";
var like=$("#like").val();
var datos = {
"key":key,\xa "pag" : a,like:like
};
\xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/articulo",
type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }
\xa });\xa }
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();\xa var datos = {\xa "key":key,\xa "pag" : IncrimentNum,like:like
};\xa
$.ajax({\xa data: datos,
url: baseurl+"c_droid/articulo",\xa type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }\xa
});
}
</script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } public function itart($a) { $this->load->library("table"); $bdfac = $this->db->query("SELECT codigoart,almacen,recepcion,lote,elab,vence,ubica,ROUND(cantidad,0) cantidad,ROUND(consumido,0) consumido,ROUND(cantidad-consumido,0) existen FROM artilotes WHERE codigoart='{$a}'")->result(); $html = "
<a onclick="editlote();" class="w3-btn"><img src="" . base_url() . "images/editar.png" alt="Editar Lote" title="Editar Lote" style="width:20px;height:20px;border:0;"></a>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Almacen</th><th>Recepcion</th><th>Lote</th><th>Elab</th><th>Vence</th><th>Ubica</th><th>Cantidad</th><th>consumido</th><th>Existen</th></tr>"; $i = 0; $tot = 0; foreach ($bdfac as $dtfac) { $i++; $tot += $dtfac->existen; $html .= "<tr id="slect" . $i . "">"; $html .= "<input type="hidden" name="almacen" value="" . $dtfac->almacen . ""> <input type="hidden" name="codigoart" value="" . $dtfac->codigoart . ""> <input type="hidden" name="lote" value="" . $dtfac->lote . "">
<input type="hidden" name="elab" value="" . $dtfac->elab . ""> <input type="hidden" name="vence" value="" . $dtfac->vence . ""><input type="hidden" name="ubica" value="" . $dtfac->ubica . "">\xa <td><input type="checkbox" name="rowitart" class="w3-check" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');">" . $dtfac->almacen . "</td><td>" . $dtfac->recepcion . "</td><td>" . $dtfac->lote . "</td><td>" . $dtfac->elab . "</td><td>" . $dtfac->vence . "</td><td>" . $dtfac->ubica . "</td><td>" . $dtfac->cantidad . "</td><td>" . $dtfac->consumido . "</td><td>" . $dtfac->existen . "</td>\xa </tr>"; } $html .= "<tr class="w3-fondodroid w3-medium"><td colspan="8" class="w3-center"> <b>Total Existencia:</b> </td><td>" . $tot . "</td></tr></table>"; return $html; } public function conteo($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE b.nombre like '%{$b}%' || c.nomape like '%{$b}%' && a.freg>'2023-12-29'"; } else { $filter = "WHERE a.freg>'2023-12-29'"; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM conteo a\xa JOIN proveed b ON a.prov=b.id LEFT JOIN trab c ON c.id=a.trab {$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.id,b.nombre prov, a.freg, a.fasig, a.fterm,
c.nomape trab, a.freg2,a.fasig2,a.fterm2,a.ajcont,a.status FROM conteo a\xa JOIN proveed b ON a.prov=b.id LEFT JOIN trab c ON c.id=a.trab {$filter} ORDER BY a.id DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $bdtrab = $this->db->query("SELECT d.id, d.nomape FROM trab AS d WHERE d.tip='3'")->result(); $trab = "<option value="" selected disabled>Seleccione</option>"; foreach ($bdtrab as $dttrab) { $trab .= "<option value="" . $dttrab->id . "">" . $dttrab->nomape . "</option>"; } $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="conteo()" id="like"></td>\xa <td><select class="w3-select" id="id_trab">" . $trab . "</select></td>
<td><select class="w3-select" id="tip"><option vale="" disabled selected>Seleccione</option><option value="1">1er Conteo</option><option value="2">2do Conteo</option></select></td>\xa <td class="w3-center w3-btn"><a onclick="asigconteo()"><img src="" . base_url() . "images/bn.png" alt="Asignar" title="Asignar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="ajusteconteo();"><img src="" . base_url() . "images/ajustes.png" alt="Ajustar Inventario" title="Ajustar Inventario" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="regconteo();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Conteo" title="Registrar Conteo" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="conteo();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="elimconteo();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Id</th><th>Proveedor</th><th>Registro</th><th>Asigna</th><th>Termina</th><th>Usuario</th><th>Registro2</th>\xa <th>Asigna2</th><th>Termina2</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->status == 1) { $color = "w3-green"; $status = "Listo " . $dtfac->ajcont; } elseif ($dtfac->status == 2) { $color = "w3-pale-green"; $status = "Ajustar"; } else { $color = "w3-red"; $status = "Pendiente"; } $html .= "<tr id="slect" . $i . "" class="item" onclick="itconteo($('#a" . $i . "').val());">"; $html .= "<input type="hidden" id="a" . $i . "" name="id" value="" . $dtfac->id . ""> <input type="hidden" name="status" value="" . $dtfac->status . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->id . "</td><td>" . $dtfac->prov . "</td><td>" . $dtfac->freg . "</td><td>" . $dtfac->fasig . "</td><td>" . $dtfac->fterm . "</td><td>" . $dtfac->trab . "</td><td>" . $dtfac->freg2 . "</td><td>" . $dtfac->fasig2 . "</td>\xa <td>" . $dtfac->fterm2 . "</td><td class="" . $color . "">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Producto: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903"; var like=$("#like").val();
var datos = {\xa "pag" : DecrementNum,\xa "key" : key,like:like
};\xa \xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/conteo",
type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }
\xa });
}
function numpag(a){ before();\xa var key="droid903";
var like=$("#like").val();
var datos = {
"key":key,
"pag" : a,like:like\xa };
\xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/conteo",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }
});\xa }\xa
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();
var datos = {\xa "key":key,\xa "pag" : IncrimentNum,like:like\xa };
$.ajax({\xa data: datos,
url: baseurl+"c_droid/conteo",\xa type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()
}\xa \xa });
}\xa </script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>
\xa </div> "; return $html; } public function itconteo($a) { $this->load->library("table"); $this->db->query("UPDATE itconteo a JOIN conteo c ON (a.conteo=c.id && c.status=0) JOIN artilotes b ON (a.cod=b.codigoart && a.lote=b.lote && a.alm=b.almacen) SET a.cantorg=(b.cantidad-b.consumido) WHERE a.conteo='{$a}'"); $bdfac = $this->db->query("SELECT a.*,b.nombre FROM itconteo a JOIN articulo b ON a.cod=b.codigo WHERE a.conteo='{$a}'")->result(); $html = "
<a onclick="editconteo();" class="w3-btn"><img src="" . base_url() . "images/editar.png" alt="Editar Conteo" title="Editar Conteo" style="width:20px;height:20px;border:0;"></a>\xa <a onclick="elimitconteo();" class="w3-btn"><img src="" . base_url() . "images/borrar.png" alt="Eliminar Producto" title="Elimina Producto" style="width:20px;height:20px;border:0;"></a>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid">
<th><input type="checkbox" name="optcheck" class="w3-check" onclick="selectodo('rowitcont');">Almacen</th><th>Producto</th><th>Lote</th><th>CantOrg</th><th>1er Conteo</th><th>2do Conteo</th><th>Estatus</th></tr>"; $i = 0; $tot = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->cantorg != $dtfac->cant && $dtfac->cantorg != $dtfac->cant2) { $color = "w3-red"; $status = "Mal"; } else { $color = "w3-green"; $status = "Bien"; } $html .= "<tr id="slect2" . $i . "" name="selec">"; $html .= "<input type="hidden" name="id2" value="" . $dtfac->conteo . ""><input type="hidden" name="alm" value="" . $dtfac->alm . ""><input type="hidden" name="cant2" value="" . $dtfac->cant2 . "">
<input type="hidden" name="cod" value="" . $dtfac->cod . ""><input type="hidden" name="lot" value="" . $dtfac->lote . ""><input type="hidden" name="cant" value="" . $dtfac->cant . "">
<td><input type="checkbox" name="rowitcont" class="w3-check" onclick="w3.toggleClass('#slect2" . $i . "','w3-yellow');">" . $dtfac->alm . "</td><td>" . $dtfac->cod . " " . $dtfac->nombre . "</td><td>" . $dtfac->lote . "</td><td>" . $dtfac->cantorg . "</td>\xa <td>" . $dtfac->cant . "</td><td>" . $dtfac->cant2 . "</td><td class="" . $color . "">" . $status . "</td>\xa </tr>"; } $html .= "</table>"; return $html; } function regconteo($prov) { $data = array("prov" => $prov, "freg" => date("Y-m-d H:i:s")); $this->db->insert("conteo", $data); $i = 0; if ($this->db->affected_rows() > 0) { $i++; $id = $this->db->query("SELECT max(id) n FROM conteo")->row(); $bd = $this->db->query("SELECT c.almacen,c.codigoart codigo, c.lote, ROUND(c.cantidad-c.consumido,0) cant FROM proveed a JOIN artiprov b ON a.codigo=b.proveedor JOIN artilotes c ON c.codigoart=b.codigo WHERE a.id='{$prov}'
GROUP BY c.almacen,c.codigoart,c.lote")->result(); foreach ($bd as $db) { $data2 = array("conteo" => $id->n, "alm" => $db->almacen, "cod" => $db->codigo, "lote" => $db->lote, "cantorg" => $db->cant); $this->db->insert("itconteo", $data2); $this->db->where("codigo", $db->codigo)->update("articulo", array("para_web" => 0)); } } if ($i > 0) { $this->loguser("Conteo", "El usuario registra el conteo para el proveedor " . $prov . "."); } return $i; } function asigconteo($id, $trab, $tip) { if ($tip == 1) { $ctrab = "trab"; $fasig = "fasig"; } else { $ctrab = "trab"; $fasig = "fasig2"; } $this->db->query("UPDATE conteo SET {$ctrab}='{$trab}',{$fasig}=NOW(),status='0' WHERE id='{$id}'"); return $this->db->affected_rows(); } function ajusteconteo($id, $tip) { $bd = $this->db->query("SELECT * FROM itconteo WHERE conteo='{$id}'")->result(); $j = 0; foreach ($bd as $db) { $exit = $this->db->query("SELECT ROUND(cantidad-consumido,0) n FROM artilotes WHERE almacen='{$db->alm}' && codigoart='{$db->cod}' && lote='{$db->lote}'")->row(); if ($tip == 1) { $cont = $db->cant; } else { $cont = $db->cant2; } if ($cont > $exit->n) { $real = $cont - $exit->n; $this->db->query("UPDATE artilotes set cantidad=cantidad+'{$real}' WHERE almacen='{$db->alm}' && codigoart='{$db->cod}' && lote='{$db->lote}'"); if ($this->db->affected_rows() > 0) { $j++; $this->db->where("codigo", $db->cod)->update("articulo", array("para_web" => 1)); } $ajusteinv = array("tipo" => "1", "codigo" => $db->cod, "lote" => $db->lote, "dlote" => $db->lote, "alm" => $db->alm, "dalm" => $db->alm, "cant" => $real, "fech" => date("Y-m-d")); $this->db->insert("ajusteinv", $ajusteinv); $this->loguser("Ajuste Inventario", "El usuario realiza el proceso: 1 para almacen:" . $db->alm . " producto:" . $db->cod . " lote:" . $db->lote . " cant:" . $real . ''); } elseif ($cont < $exit->n) { $real = $exit->n - $cont; $this->db->query("UPDATE artilotes set cantidad=cantidad-'{$real}' WHERE almacen='{$db->alm}' && codigoart='{$db->cod}' && lote='{$db->lote}'"); if ($this->db->affected_rows() > 0) { $j++; $this->db->where("codigo", $db->cod)->update("articulo", array("para_web" => 1)); } $ajusteinv = array("tipo" => "0", "codigo" => $db->cod, "lote" => $db->lote, "dlote" => $db->lote, "alm" => $db->alm, "dalm" => $db->alm, "cant" => $real, "fech" => date("Y-m-d")); $this->db->insert("ajusteinv", $ajusteinv); $this->loguser("Ajuste Inventario", "El usuario realiza el proceso: 0 para almacen:" . $db->alm . " producto:" . $db->cod . " lote:" . $db->lote . " cant:" . $real . ''); } else { $j++; } } if ($j > 0) { $this->db->query("UPDATE conteo SET status=1,ajcont='{$tip}' WHERE id='{$id}'"); } return $j; } function editconteo($id, $alm, $cod, $lot, $cant, $cant2) { $this->db->query("UPDATE itconteo SET cant='{$cant}',cant2='{$cant2}' WHERE conteo='{$id}' && alm='{$alm}' && cod='{$cod}' && lote='{$lot}'"); return $this->db->affected_rows(); } function elimconteo($id) { $row = count($id); $j = 0; for ($i = 0; $i < $row; $i++) { if ($id[$i] != '') { $this->db->query("DELETE FROM conteo WHERE id='{$id[$i]}'"); if ($this->db->affected_rows() > 0) { $j++; $bd = $this->db->query("SELECT cod FROM itconteo WHERE conteo='{$id[$i]}'")->result(); foreach ($bd as $db) { $this->db->where("codigo", $db->cod)->update("articulo", array("para_web" => 1)); } } } } return $j; } function elimitconteo($id, $alm, $cod, $lot) { $row = count($id); $j = 0; $html = ''; for ($i = 0; $i < $row; $i++) { if ($id[$i] != '') { $this->db->query("DELETE FROM itconteo WHERE conteo='{$id[$i]}' && alm='{$alm[$i]}' && cod='{$cod[$i]}' && lote='{$lot[$i]}'"); $html .= $id[$i] . " " . $alm[$i] . " " . $cod[$i] . " " . $lot[$i]; if ($this->db->affected_rows() > 0) { $j++; $this->db->where("codigo", $cod[$i])->update("articulo", array("para_web" => 1)); } } } return $j; } function lotcod($cod) { $bd = $this->db->query("SELECT lote,concat(almacen,' ',lote,' ',cantidad-consumido) nombre FROM artilotes WHERE codigoart='{$cod}' && (cantidad-consumido)>0")->result(); $html = ''; foreach ($bd as $db) { $html .= "<option value="" . $db->lote . "">" . $db->nombre . "</option>"; } return $html; } function tranfalm($cod, $alm, $lot, $dalm, $dlot, $dcant) { $this->db->query("INSERT INTO `ajusteinv` (`tipo`, `codigo`, `lote`, `dlote`, `alm`, `dalm`, `cant`, `fech`) VALUES (3, '{$cod}', '{$lot}', '{$dlot}', '{$alm}', '{$dalm}', '{$dcant}', curdate());"); $this->db->query("UPDATE artilotes set cantidad=cantidad-'{$dcant}' WHERE codigoart='{$cod}' && almacen='{$alm}' && lote='{$lot}'"); $val = $this->db->query("SELECT NULL FROM artilotes WHERE codigoart='{$cod}' && almacen='{$dalm}' && lote='{$dlot}'")->num_rows(); if ($val > 0) { $this->db->query("UPDATE artilotes set cantidad=cantidad+'{$dcant}' WHERE codigoart='{$cod}' && almacen='{$dalm}' && lote='{$dlot}'"); } else { $data = array("codigoart" => $cod, "cantidad" => $dcant, "lote" => $dlot, "almacen" => $dalm, "elab" => "0000-00-00", "vence" => "0000-00-00", "recepcion" => date("Y-m-d")); $this->db->insert("artilotes", $data); } $this->loguser("Transferencia", "El usuario ha transferido " . $dcant . " unidades, almacen:" . $alm . ",lote: " . $lot . ", para el almacen:" . $dalm . ",lote:" . $dlot . ''); return $this->db->affected_rows(); } function formtranfalm($cod) { $alm = $this->db->query("SELECT CONCAT('Almacen: ',almacen,' Lote: ',lote,' Cantidad:',ROUND(cantidad-consumido)) nombre, almacen FROM artilotes WHERE codigoart='{$cod}'")->result(); $lot = $this->db->query("SELECT CONCAT('Almacen: ',almacen,' Lote: ',lote,' Cantidad:',ROUND(cantidad-consumido)) nombre, lote FROM artilotes WHERE codigoart='{$cod}'")->result(); $optalm = "<option value="" disabled selected>Seleccione</option>"; $optlot = "<option value="" disabled selected>Seleccione</option>"; foreach ($alm as $dalm) { if ($dalm->almacen != '') { $optalm .= "<option value="" . $dalm->almacen . "">" . $dalm->nombre . "</option>"; } } foreach ($lot as $dlot) { if ($dlot->lote != '') { $optlot .= "<option value="" . $dlot->lote . "">" . $dlot->nombre . "</option>"; } } return array("alm" => $optalm, "lot" => $optlot); } function formajustecant() { $bdarti = $this->db->query("SELECT codigo,nombre FROM articulo")->result(); $art = "<input type="text" class="w3-input" id="codigo" list="listarti" placeholder="Producto..." onchange="formalmlot();"><datalist id="listarti">"; foreach ($bdarti as $dbarti) { $art .= "<option value="" . $dbarti->codigo . "">" . $dbarti->nombre . "</option>"; } $art .= "</datalist>"; return array("prod" => $art); } function exportexcelartitodo() { return $this->db->query("SELECT SUBSTR(a.codigo,1,3) categoria,(SELECT nombre from grupos where codigo=a.grupo) subcategoria,trim(a.codigo) codigo,a.nombre,a.referencia,ROUND(a.existencia,0) existen,ROUND(a.precio1,2)precio,ROUND(a.precio1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) dprecio,\xa ROUND(a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100)),2)preciofin,ROUND((a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100)))/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) dpreciofin,a.marca,
(SELECT vence FROM artilotes WHERE codigoart=a.codigo && cantidad>consumido ORDER BY vence ASC LIMIT 1) vence,\xa ROUND(a.impuesto1,0) iva,a.dscto_medicamentos descu,
\x9\x9\x9CONCAT(if((SELECT COUNT(*) FROM artilotes WHERE codigoart=a.codigo && recepcion>=DATE_SUB(CURDATE(),INTERVAL 5 DAY))>0,'NUEVO!',''),IF(a.dscto_medicamentos>0,CONCAT('<b class="w3-green">\xc2\xa1PROMOCION ',a.dscto_medicamentos,'%!','</b>'),'')) nuevo,\xa IF((SELECT codalternativo FROM invcodalternativo WHERE codigo=a.codigo LIMIT 1)!='',(SELECT codalternativo FROM invcodalternativo WHERE codigo=a.codigo LIMIT 1),'N/A') barra,
(SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor
FROM articulo a JOIN artilotes d ON d.codigoart=a.codigo && (d.almacen=02 || d.almacen=07) && d.cantidad-d.consumido>0\xa WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && a.grupo NOT IN (06,07)
GROUP BY a.codigo ORDER BY a.codigo ASC"); } function exportexcelartimovil() { return $this->db->query("SELECT SUBSTR(a.codigo,1,3) categoria,(SELECT nombre from grupos where codigo=a.grupo) subcategoria,(SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor,CONCAT(trim(a.codigo),' ',a.nombre) producto, CONCAT('<b>Ref:</b> ',a.referencia,' <b>Marca:</b> ',a.marca,' <b>Precio sin iva:</b> ',ROUND(a.precio1,2)precio,' <b>Precio con iva:</b> ',ROUND(a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100)),2)preciofin,\xa ' <b>Precio $:</b> ',ROUND((a.preciofin1-(a.preciofin1*(a.dscto_medicamentos/100)))/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2)preciofin,' <b>Descuento:</b> ',ROUND(a.dscto_medicamentos,0),' <b>Existen:</b> ',ROUND(a.existencia,0)) detalles,
(SELECT vence FROM artilotes WHERE codigoart=a.codigo && cantidad>consumido ORDER BY vence ASC LIMIT 1) vence,\xa if((SELECT COUNT(*) FROM artilotes WHERE codigoart=a.codigo && recepcion>=DATE_SUB(CURDATE(),INTERVAL 5 DAY))>0,'<b>NUEVO!</b>','') nuevo,
ROUND(a.preciofin1,2) preciofin,ROUND(a.preciofin1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) preciod,ROUND(a.dscto_medicamentos,0) descu,a.nombre
FROM articulo a JOIN artilotes d ON d.codigoart=a.codigo && (d.almacen=02 || d.almacen=07) && d.cantidad-d.consumido>0\xa WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && a.grupo NOT IN (06,07)\xa GROUP BY a.codigo ORDER BY a.codigo ASC"); } function exportexcelcli() { return $this->db->query("SELECT a.sucursal,a.tipo,a.subdivision clase,a.codigo,a.nombre,a.nrorif rif,TRIM(a.campo1) sicm,TRIM(a.campo3) sica,TRIM(a.telefonos) telf,TRIM(a.telefono_movil) telf2,b.nombre vendedor,
TRIM(a.direccion) direc,TRIM(a.direcenvio) direcenv,c.zona,d.subsector,TRIM(a.campo4) horario,dias,a.fecha fingreso,a.email,a.perscont contac,ROUND(a.descuento) descuento,IF(a.status>0,'Activo','Inactivo') Estatus
FROM cliempre a LEFT JOIN listvend b ON a.vendedor=b.codigo
LEFT JOIN sectores c ON a.sector=c.codigo\xa LEFT JOIN subsectores d ON (a.sector=d.codigo && a.subcodigo=d.subcodigo) GROUP BY a.codigo"); } function exportexcelvend() { return $this->db->query("SELECT codigo,nombre,cedula,telefonos,email,sector,subcodigo subsector FROM listvend"); } function formarti() { $this->db->query("SET CHARSET utf8"); $prov = $this->db->query("SELECT codigo,nombre FROM proveed GROUP BY nombre ORDER BY nombre ASC")->result(); $cod = $this->db->query("SELECT SUBSTR(codigo,1,3) tip FROM articulo GROUP BY tip ORDER BY tip ASC")->result(); $group = $this->db->query("SELECT codigo,nombre FROM grupos ORDER BY nombre ASC")->result(); $optprov = "<datalist id="dataprov">"; $optcod = ''; $optgroup = ''; foreach ($prov as $dprov) { $optprov .= "<option value="" . $dprov->codigo . "">" . $dprov->nombre . "</option>"; } $optprov .= "</datalist>"; foreach ($cod as $dcod) { $optcod .= "<option value="" . $dcod->tip . "">" . $dcod->tip . "</option>"; } foreach ($group as $dgroup) { $optgroup .= "<option value="" . $dgroup->codigo . "">" . $dgroup->nombre . "</option>"; } return array("provcod" => $optprov, "tipcod" => $optcod, "grupo" => $optgroup); } function formartiedit($cod) { $bd = $this->db->query("SELECT a.nombre,a.marca,a.referencia ref,b.codalternativo barra,a.controlado,IF(a.controlado=1,'SI','NO') nomcontrol,a.grupo,d.nombre nomgrup,c.proveedor,c.nombre nomprov,a.impuesto1 FROM articulo a left JOIN invcodalternativo b ON a.codigo=b.codigo\xa left JOIN artiprov c ON a.codigo=c.codigo JOIN grupos d ON d.codigo=a.grupo WHERE a.codigo='{$cod}'")->row(); return array("nom" => $bd->nombre, "barr" => $bd->barra, "legal" => $bd->controlado, "nomlegal" => $bd->nomcontrol, "grup" => $bd->grupo, "nomgrup" => $bd->nomgrup, "prov" => $bd->proveedor, "nomprov" => $bd->nomprov, "iva" => $bd->impuesto1, "marca" => $bd->marca, "ref" => $bd->ref); } function formcli() { $vend = $this->db->query("SELECT codigo,nombre,telefonos FROM listvend GROUP BY nombre ORDER BY nombre ASC")->result(); $sec = $this->db->query("SELECT codigo,zona FROM sectores ORDER BY zona ASC")->result(); $zon = $this->db->query("SELECT subcodigo,subsector FROM subsectores ORDER BY subsector ASC")->result(); $optprov = ''; $optcod = ''; $optgroup = ''; foreach ($vend as $dvend) { $optprov .= "<option value="" . $dvend->codigo . "">" . $dvend->nombre . "</option>"; } foreach ($sec as $dsec) { $optcod .= "<option value="" . $dsec->codigo . "">" . $dsec->zona . "</option>"; } foreach ($zon as $dzon) { $optgroup .= "<option value="" . $dzon->subcodigo . "">" . $dzon->subsector . "</option>"; } return array("vend" => $optprov, "sec" => $optcod, "zon" => $optgroup); } function formcliedit($cli) { $db = $this->db->query("SELECT a.codigo,a.nombre,a.nrorif rif,TRIM(a.campo1) sicm,TRIM(a.campo3) sica,TRIM(a.telefonos) telf,TRIM(a.telefono_movil) telf2,b.nombre nomvend,a.vendedor,\xa TRIM(a.direccion) direc,TRIM(a.direcenvio) direcenv,c.zona,d.subsector,TRIM(a.campo4) horario,dias,a.sector,a.subcodigo,a.email,a.sucursal,a.perscont contacto
FROM cliempre a LEFT JOIN listvend b ON a.vendedor=b.codigo\xa LEFT JOIN sectores c ON a.sector=c.codigo\xa LEFT JOIN subsectores d ON (a.sector=d.codigo && a.subcodigo=d.subcodigo) WHERe a.codigo='{$cli}' GROUP BY a.codigo")->row(); $data = array("razon" => $db->nombre, "rif" => $db->rif, "sicm" => $db->sicm, "sica" => $db->sica, "telf" => $db->telf, "telf2" => $db->telf2, "vend" => $db->vendedor, "nomvend" => $db->nomvend, "dirrf" => $db->direc, "dirre" => $db->direcenv, "sector" => $db->sector, "subcodigo" => $db->subcodigo, "zona" => $db->zona, "subzona" => $db->subsector, "horr" => $db->horario, "dias" => $db->dias, "email" => $db->email, "sucursal" => $db->sucursal, "contacto" => $db->contacto); return mb_convert_encoding($data, "UTF-8", "UTF-8"); } function regarti($prov, $tip, $grup, $nom, $barr, $iva, $leg, $marca, $ref) { $nom = strtoupper($nom); $nomprov = $this->db->query("SELECT nombre FROM proveed WHERE codigo='{$prov}'")->row(); $user = $this->session->userdata("cod"); $num = $this->db->query("SELECT MAX(SUBSTR(codigo,4,7))+1 n FROM articulo WHERE SUBSTR(codigo,1,3)='{$tip}';")->row(); $newcod = str_pad($num->n, 4, "0", STR_PAD_LEFT); $artprov = array("id_empresa" => "DMEDIF", "agencia" => "001", "codigo" => '' . $tip . $newcod . '', "proveedor" => $prov, "nombre" => $nomprov->nombre, "fechalista" => date("Y-m-d")); $art = array("id_empresa" => "DMEDIF", "agencia" => "001", "codigo" => '' . $tip . $newcod . '', "grupo" => $grup, "nombre" => $nom, "marca" => $marca, "referencia" => $ref, "creadopor" => $user, "modifpor" => "N/A", "fechacrea" => date("Y-m-d"), "impuesto1" => $iva, "controlado" => $leg, "para_web" => 0); if ($barr == "N/A" || $barr == '') { $barras = '' . $tip . $newcod . ''; } else { $barras = $barr; } $dtbarr = array("id_empresa" => "DMEDIF", "agencia" => "001", "codigo" => '' . $tip . $newcod . '', "codalternativo" => $barras); $this->db->insert("artiprov", $artprov); $this->db->insert("articulo", $art); $this->db->insert("invcodalternativo", $dtbarr); $this->loguser("Crea Producto", "El usuario crea el producto " . $tip . $newcod . ", grupo:" . $grup . ",prov:" . $prov . ", nombre:" . $nom . ",barra:" . $barr . ",iva:" . $iva . ",leg:" . $leg . ''); return $this->db->affected_rows(); } function editarti($cod, $nom, $barr, $prov, $grup, $leg, $iva, $marca, $ref) { $nomprov = $this->db->query("SELECT nombre FROM proveed WHERe codigo='{$prov}'")->row(); $user = $this->session->userdata("cod"); $art = array("nombre" => $nom, "grupo" => $grup, "controlado" => $leg, "impuesto1" => $iva, "modifpor" => $user, "marca" => $marca, "referencia" => $ref); $dtbarr = array("codalternativo" => $barr); $artprov = array("proveedor" => $prov, "nombre" => $nomprov->nombre); $this->db->where("codigo", $cod)->update("articulo", $art); $this->db->where("codigo", $cod)->update("invcodalternativo", $dtbarr); $this->db->where("codigo", $cod)->update("artiprov", $artprov); $this->loguser("Modificar", "El usuario ha modificado la ficha del articulo " . $cod . " por nom:" . $nom . ",barra:" . $barr . ",prov:" . $prov . ",grup:" . $grup . ",leg:" . $leg . ",iva:" . $iva, ''); return $this->db->affected_rows(); } function editlote($cod, $alm, $lot, $elab, $venc, $ubic) { $art = array("elab" => $elab, "vence" => $venc, "ubica" => $ubic); $this->db->where("CONCAT(codigoart,lote)='{$cod}' && almacen='{$alm}'")->update("artilotes", $art); $this->loguser("Modificar", "El usuario ha modificado la ficha del lote " . $lot . " para el producto " . $cod . " por lot:" . $lot . ",alm:" . $alm . ",elab:" . $elab . ",venc:" . $venc . ",ubica:" . $ubic . "."); return $this->db->affected_rows(); } function regcli($razon, $rif, $sicm, $sica, $telf, $telf2, $vend, $dirrf, $dirre, $sector, $zona, $horr, $dias, $email, $tip, $sucursal, $contac, $tipo, $segmento) { if ($tip == 1) { $num = $this->db->query("SELECT MAX(SUBSTR(codigo,3,6))+1 n FROM cliempre WHERE SUBSTR(codigo,1,2)='MF';")->row(); $newcod = str_pad($num->n, 4, "0", STR_PAD_LEFT); $newcod = "MF" . $newcod; } else { $num = $this->db->query("SELECT MAX(SUBSTR(codigo,4,7))+1 n FROM cliempre WHERE SUBSTR(codigo,1,3)='INT';")->row(); $newcod = str_pad($num->n, 4, "0", STR_PAD_LEFT); $newcod = "INT" . $newcod; } $cli = array("codigo" => $newcod, "nombre" => $razon, "nrorif" => $rif, "campo1" => $sicm, "campo3" => $sica, "telefonos" => $telf, "telefono_movil" => $telf2, "vendedor" => $vend, "direccion" => $dirrf, "direcenvio" => $dirre, "sector" => trim($sector), "subcodigo" => trim($zona), "campo4" => $horr, "dias" => $dias, "email" => $email, "sucursal" => $sucursal, "perscont" => $contac, "tipo" => $tipo, "subdivision" => $segmento, "fecha" => date("Y-m-d")); $this->db->insert("cliempre", $cli); $this->loguser("Registro Cliente", "El usuario registra al cliente MF" . $newcod . "."); return $this->db->affected_rows(); } function editcli($cod, $razon, $rif, $sicm, $sica, $telf, $telf2, $vend, $dirrf, $dirre, $sector, $zona, $horr, $dias, $email, $sucursal, $contac, $tipo, $segmento) { $cli = array("nombre" => $razon, "nrorif" => $rif, "campo1" => $sicm, "campo3" => $sica, "telefonos" => $telf, "telefono_movil" => $telf2, "vendedor" => $vend, "direccion" => $dirrf, "direcenvio" => $dirre, "sector" => $sector, "subcodigo" => $zona, "campo4" => $horr, "dias" => $dias, "email" => $email, "sucursal" => $sucursal, "perscont" => $contac, "tipo" => $tipo, "subdivision" => $segmento); $this->db->where("codigo", $cod)->update("cliempre", $cli); $this->loguser("Modificar", "El usuario modifica al cliente " . $cod . " los datos de su ficha."); return $this->db->affected_rows(); } public function devol($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "&& (a.referencia like '%{$b}%' || a.codcliente='{$b}' || a.nombrecli LIKE '%{$b}%' || a.vendedor like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT a.documento,\xa a.referencia,a.tipodoc,a.fechacrea,a.vence, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor, \xa ROUND(SUM(b.cantidad)- SUM(b.cntdevuelt),0) unidades, a.status\xa FROM devolti AS a JOIN devolmv AS b ON a.documento=b.documento
WHERE a.tipodoc='DEV' " . $filter . "\xa GROUP BY a.documento")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.documento,\xa a.referencia,a.tipodoc,a.fechacrea,a.vence, a.codcliente, a.nombrecli, a.telefonos, a.sector,a.vendedor,
ROUND(SUM(b.cantidad)- SUM(b.cntdevuelt),0) unidades, a.status\xa FROM devolti AS a JOIN devolmv AS b ON a.documento=b.documento
WHERE a.tipodoc='DEV' " . $filter . "
GROUP BY a.documento ORDER BY a.status ASC,a.documento DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="devol()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="prefac2();"><img src="" . base_url() . "images/factura.png" alt="Facturar" title="Facturar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="autdevol();"><img src="" . base_url() . "images/bn.png" alt="Autorizar" title="Autorizar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="cuadevol();"><img src="" . base_url() . "images/cuarentena.png" alt="Cuarentena" title="Cuarentena" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="devol();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td>
<!--<td class="w3-center w3-btn"><a onclick="elimfac();"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:20px;height:20px;border:0;"></a></td>--></tr>
</table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>N</th><th>Tipo</th><th>Doc</th><th>Referencia</th><th>Codigo</th><th>Nombre</th><th>Fecha</th><th>Vence</th><th>Sector</th><th>Vendedor</th><th>Unidades</th><th>F.Autoriza</th><th>F.Asigna</th><th>F.Emp</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $oper = $this->db->query("SELECT b.nombre,a.antdoc,c.timeasig,c.timeemp,c.timeaut FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo \xa LEFT JOIN control_operti c ON c.doc=a.antdoc\xa WHERE CONCAT(a.tipodoc,a.documento)='{$dtfac->referencia}' GROUP BY a.documento")->row(); $html .= "<tr id="slect" . $i . "" class="item" onclick="itdevol($('#a" . $i . "').val(),$('#b" . $i . "').val());">"; if ($dtfac->status == "0") { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtfac->status == "1") { $status = "Listo"; $color = "w3-green"; } $html .= "<input type="hidden" id="a" . $i . "" name="doc" value="" . $dtfac->documento . ""><input type="hidden" id="b" . $i . "" name="tipodoc" value="" . $dtfac->tipodoc . "">
<input type="hidden" name="antdoc" value="" . $dtfac->antdoc . ""><input type="hidden" name="status" value="" . $dtfac->status . "">
<td>" . $i . "</td><td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->tipodoc . "</td>\xa <td>" . $dtfac->documento . "</td><td>" . $dtfac->referencia . "</td><td>" . $dtfac->codcliente . "</td><td>" . $dtfac->nombrecli . "</td><td>" . $dtfac->fechacrea . "</td>
<td>" . $dtfac->vence . "</td><td>" . $dtfac->sector . "</td><td>" . $oper->nombre . "</td><td>" . $dtfac->unidades . "</td><td>" . $oper->timeaut . "</td><td>" . $oper->timeasig . "</td>\xa <td>" . $oper->timeemp . "</td><td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Unidades: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNumfac(){\xa var DecrementNum=document.getElementById("DecrementNum").value;
var key="droid903";\xa var datos = {\xa "pag" : DecrementNum,
"key" : key\xa };\xa
$.ajax({
data: datos,
url: baseurl+"c_droid/devol",\xa type: "POST",
success: function(data) {
$("#body").html(data);\xa }
\xa });\xa }\xa
function numpagfac(a){
var key="droid903";
\xa var datos = {\xa "key":key,
"pag" : a\xa };\xa
$.ajax({
data: datos,
url: baseurl+"c_droid/devol",
type: "POST",
success: function(data) {\xa $("#body").html(data);\xa }\xa \xa });
}
function IncrimentNumfac(){
var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903";\xa var datos = {
"key":key,
"pag" : IncrimentNum
};
$.ajax({
data: datos,
url: baseurl+"c_droid/devol",\xa type: "POST",
success: function(data) {\xa $("#body").html(data);\xa }\xa \xa });
}
</script>
<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNumFac();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpagfac($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNumfac();" class="w3-bar-item w3-button">»</a>\xa \xa </div> "; return $html; } public function itdevol($a, $b) { $this->load->library("table"); $bditfac = $this->db->query("SELECT c.codigo, c.nombre, c.lote,ROUND(c.cantidad,0) cantidad,ROUND(c.cntdevuelt,0) devuelta,c.scan, TRIM(c.lote), c.status FROM devolmv AS c WHERE c.documento='{$a}' && c.tipodoc='{$b}';")->result(); $nom = $this->db->query("SELECT nomape FROM trab as a JOIN control_operti as b ON a.id=b.trabempaq WHERE b.doc='{$a}'")->row(); $vend = $this->db->query("SELECT b.nombre FROM operti as a JOIN listvend as b ON a.vendedor=b.codigo WHERE a.documento='{$a}' LIMIT 1")->row(); $val = $this->db->query("SELECT status FROM devolti where documento='{$a}' && tipodoc='{$b}'")->row(); if ($val->status == 0) { $btnscan = "<input type="hidden" id="doc" value="" . $a . ""><input type="submit" class="w3-btn w3-green w3-border w3-hover-white" value="SCAN" onclick="w3.hide('#scan1');w3.show('#scan');"><input type="submit" class="w3-btn w3-teal w3-border w3-hover-white" value="1SCAN" onclick="w3.hide('#scan');w3.show('#scan1');">"; } else { $btnscan = ''; } $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Nombre</th><th>Cantidad</th><th>Devuelta</th><th>Recibida</th><th>Lote</th><th>Estatus</th></tr>\xa <input type="hidden" id="doc" value="" . $a . ""><input type="hidden" id="tipdoc" value="" . $b . "">"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "Pendiente"; $color = "w3-red"; } elseif ($dtitfac->status == 1) { $status = "Listo"; $color = "w3-green"; } $html .= "<tr>\xa <td>" . $dtitfac->codigo . "</td><td>" . $dtitfac->nombre . "</td><td>" . $dtitfac->cantidad . "</td><td>" . $dtitfac->devuelta . "</td><td>" . $dtitfac->scan . "</td><td>" . $dtitfac->lote . "</td><td class="" . $color . " w3-center">" . $status . "</td>\xa </tr>"; } $html .= "</table><br><br>
<div style="display:none" id="scan" class="w3-center"><table class="w3-table-all w3-hoverable"><tr><td class="w3-fondodroid">Lote:</td><td><input type="text" class="w3-input" id="lotdev" placeholder="lote..." style="width:50px;"></td>
<td class="w3-fondodroid">Barras:</td><td><input type="text" class="w3-input" placeholder="Codigo barras..." id="codscan" onchange="devolscan();"></td></tr></table></div>
<div style="display:none" id="scan1" class="w3-center"><table class="w3-table-all w3-hoverable"><tr><td class="w3-fondodroid">Lote:</td><td><input type="text" class="w3-input" id="lotdev2" placeholder="lote..." style="width:50px;"></td>
<td class="w3-fondodroid">Cant:</td><td><input type="text" class="w3-input" id="cantdev" placeholder="n" style="width:30px;"></td>
<td class="w3-fondodroid">Barras:</td><td><input type="text" class="w3-input" placeholder="Codigo barras..." id="codscan1" onchange="devolscan1();"></td></tr></table></div><br><br>\xa
" . $btnscan . ''; return $html; } function devolscan($a, $b, $c) { $bd = $this->db->query("SELECT codigo FROM invcodalternativo WHERE codalternativo='{$b}' || codigo='{$b}'"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("SELECT cntdevuelt cant, scan FROM devolmv WHERE documento='{$a}' && codigo='{$db->codigo}' && lote='{$c}'")->row(); if ($bd2->cant > $bd2->scan) { $new = $bd2->scan + 1; $this->db->query("UPDATE devolmv set scan='{$new}' WHERE documento='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("UPDATE devolmv set status=1 WHERE documento='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); $i = 2; } else { $i = 1; } } } else { $i = 2; } } else { $i = 0; } return $i; } function devolscan1($a, $b, $c, $d) { $bd = $this->db->query("SELECT codigo FROM invcodalternativo WHERE codalternativo='{$b}' || codigo='{$b}'"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("SELECT cntdevuelt cant, scan FROM devolmv WHERE documento='{$a}' && codigo='{$db->codigo}' && lote='{$c}'")->row(); if ($bd2->cant > $bd2->scan) { if ($d <= $bd2->cant) { $new = $d; $this->db->query("UPDATE devolmv set scan='{$new}' WHERE documento='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("UPDATE devolmv set status=1 WHERE documento='{$a}' && codigo='{$db->codigo}' && lote='{$c}'"); $i = 2; } else { $i = 1; } } } else { $i = 3; } } else { $i = 2; } } else { $i = 0; } return $i; } function ajustdevolinv($a, $b) { $db = $this->db->query("SELECT NULL FROM devolmv WHERE documento='{$a}' && cntdevuelt>0")->num_rows(); $db2 = $this->db->query("SELECT NULL FROM devolmv WHERE documento='{$a}' && cntdevuelt>0 && cntdevuelt=scan")->num_rows(); if ($db == $db2) { $this->db->query("UPDATE devolti SET status=1 WHERE documento='{$a}'"); if ($this->db->affected_rows() > 0) { $i = 0; $bd = $this->db->query("SELECT almacen, codigo,lote,grupo,cntdevuelt cant FROM devolmv WHERE documento='{$a}'")->result(); foreach ($bd as $dt) { if ($b == '') { $lot = $this->db->query("SELECT consumido FROM artilotes WHERE almacen='{$dt->almacen}' && codigoart='{$dt->codigo}' && lote='{$dt->lote}'")->row(); $art = $this->db->query("SELECT existencia FROM articulo WHERE codigo='{$dt->codigo}'")->row(); $conslot = $lot->consumido - $dt->cant; $existart = $art->existencia + $dt->cant; $this->db->query("UPDATE artilotes SET consumido='{$conslot}' WHERE almacen='{$dt->almacen}' && codigoart='{$dt->codigo}' && lote='{$dt->lote}'"); $this->db->query("UPDATE articulo SET existencia='{$existart}' WHERE codigo='{$dt->codigo}'"); if ($this->db->affected_rows() > 0) { $i++; } } else { $lot = $this->db->query("SELECT preciofin1,precio1,elab,vence,costo FROM artilotes WHERE almacen='{$dt->almacen}' && codigoart='{$dt->codigo}' && lote='{$dt->lote}'")->row(); $art = $this->db->query("SELECT existencia FROM articulo WHERE codigo='{$dt->codigo}'")->row(); $this->db->query("INSERT INTO `artilotes` (`id_empresa`, `agencia`, `lote`, `codigoart`, `almacen`, `inactivo`, `elab`, `vence`, `cantidad`, `consumido`, `comprometido`, `costo`, `recepcion`, `precio1`, `precio2`,
`precio3`, `precio4`, `precio5`, `precio6`, `precio7`, `precio8`, `preciofin1`, `preciofin2`, `preciofin3`, `preciofin4`, `preciofin5`, `preciofin6`, `preciofin7`, `preciofin8`, `precio1grp`, `precio2grp`, `precio3grp`,
`precio4grp`, `precio5grp`, `precio6grp`, `precio7grp`, `precio8grp`, `factorlote`, `numlote`) VALUES ('DMEDIF', '001', '{$dt->lote}', '{$dt->codigo}', '{$b}', 0, '{$lot->elab}', '{$lot->vence}', '{$dt->cant}', 0.0, 0.0, '{$lot->costo}',
CURDATE(), {$lot->precio1}, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {$lot->preciofin1}, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \xa 0.0, 0.0, 0.0, 0.0, 0.0, '{$dt->lote}');\xa "); $existart = $art->existencia + $dt->cant; $this->db->query("UPDATE articulo SET existencia='{$existart}' WHERE codigo='{$dt->codigo}'"); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } } } public function compara($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE (a.codigo='{$b}' || a.nombre like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM (
SELECT null\xa FROM articulo a JOIN invcodalternativo b ON a.codigo=b.codigo
{$filter}
) compara")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT codigo,barra,nombre,medifar,drocerca,drolanca,dronena FROM (
SELECT a.codigo,b.codalternativo barra,a.nombre,ROUND(a.preciofin1,2) medifar,\xa (SELECT MIN(if(a1.Oferta< a1.Precio,ROUND(a1.Oferta,2),ROUND(a1.Precio,2))) FROM drocerca a1 WHERE a1.codbarras=b.codalternativo) drocerca,\xa (SELECT MIN(iF(a2.iva>0,ROUND(a2.Precio*1.16,2),ROUND(a2.Precio,2))) FROM drolanca a2 WHERE a2.codbarras=b.codalternativo) drolanca,
(SELECT MIN(a3.precio) FROM drolanca a3 WHERE a3.codbarras=b.codalternativo) dronena\xa FROM articulo a JOIN invcodalternativo b ON a.codigo=b.codigo
{$filter}
) compara ORDER BY nombre ASC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . " ")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="compara()" id="like"></td>
<!--<td class="w3-center w3-btn"><a onclick="exceldrogueria();"><img src="" . base_url() . "images/excel.png" alt="Carga List" title="Carga List" style="width:20px;height:20px;border:0;"></a></td>-->
<td class="w3-center w3-btn"><a onclick="dataftp();"><img src="" . base_url() . "images/data.png" alt="Actualiza PRECIOS" title="Actualiza PRECIOS" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="compara();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Codigo</th><th>Barra</th><th>Nombre</th><th>Medifar</th>
<th>Drocerca</th><th>Drolanca</th><th>Dronena</th><th>Cobeca</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $col1 = "w3-pale-red"; $col2 = "w3-pale-red"; $col3 = "w3-pale-red"; $col4 = "w3-pale-red"; if ($dtfac->dronena > 0) { $dronena = $dtfac->dronena; } else { $dronena = 999999; } if ($dtfac->drocerca > 0) { $drocerca = $dtfac->drocerca; } else { $drocerca = 999999; } if ($dtfac->drolanca > 0) { $drolanca = $dtfac->drolanca; } else { $drolanca = 999999; } $val = min($dtfac->medifar, $dronena, $drocerca, $drolanca); if ($val == $dtfac->medifar) { $col1 = "w3-pale-green"; } if ($val == $dtfac->dronena && $dtfac->dronena > 0) { $col4 = "w3-pale-green"; } if ($val == $dtfac->drocerca && $dtfac->drocerca > 0) { $col2 = "w3-pale-green"; } if ($val == $dtfac->drolanca && $dtfac->drolanca > 0) { $col3 = "w3-pale-green"; } $html .= "<tr id="slect" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" id="a" . $i . "" name="codigo" value="" . $dtfac->codigo . "">
<td>" . $dtfac->codigo . "</td><td>" . $dtfac->barra . "</td><td>" . $dtfac->nombre . "</td><td class="" . $col1 . "">" . $dtfac->medifar . "</td>\xa <td class="" . $col2 . "">" . $dtfac->drocerca . "</td><td class="" . $col3 . "">" . $dtfac->drolanca . "</td><td class="" . $col4 . "">" . $dtfac->dronena . "</td><td></td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Productos: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNum(){ before(); \xa var DecrementNum=document.getElementById("DecrementNum").value;
var like=$("#like").val();
var key="droid903";\xa var datos = {\xa "pag" : DecrementNum,\xa "key" : key,"like":like
};\xa
$.ajax({
data: datos,
url: baseurl+"c_droid/compara",\xa type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()
}
\xa });\xa }\xa
function numpag(a){ before();
var key="droid903";
var like=$("#like").val();\xa var datos = {
"key":key,
"pag" : a,like:like
};\xa \xa $.ajax({
data: datos,
url: baseurl+"c_droid/compara",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}
});
}\xa
function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();\xa var datos = {
"key":key,
"pag" : IncrimentNum,like:like
};\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/compara",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}\xa
});
}
</script>\xa <div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "
<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>
\xa </div> "; return $html; } public function cliempre($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE (a.codigo='{$b}' || a.nombre like '%{$b}%' || a.email like '%{$b}%' || b.nombre like '%{$b}%' || a.nrorif='%{$b}%' || a.telefono_movil like '%{$b}%' || a.telefonos like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL
FROM cliempre a LEFT JOIN listvend b ON a.vendedor=b.codigo
LEFT JOIN sectores c ON a.sector=c.codigo
LEFT JOIN subsectores d ON (a.sector=d.codigo && a.subcodigo=d.subcodigo) GROUP BY a.codigo")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.codigo,a.nombre,a.nrorif rif,TRIM(a.campo1) sicm,TRIM(a.campo3) sica,TRIM(a.telefonos) telf,TRIM(a.telefono_movil) telf2,b.nombre vendedor,a.sucursal,\xa TRIM(a.direccion) direc,TRIM(a.direcenvio) direcenv,c.zona,d.subsector,TRIM(a.campo4) horario,a.dias,a.email,a.perscont,a.fecha,a.status,round(a.descuento) descu,a.perscont contac,a.tipo,a.subdivision
FROM cliempre a LEFT JOIN listvend b ON a.vendedor=b.codigo\xa LEFT JOIN sectores c ON a.sector=c.codigo\xa LEFT JOIN subsectores d ON (a.sector=d.codigo && a.subcodigo=d.subcodigo) " . $filter . " GROUP BY a.codigo ORDER BY a.nombre LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . " ")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid w3-fijo">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="cliempre()" id="like"></td>
<td class="w3-center w3-btn"><a onclick="w3.show('#cargdescu');"><img src="" . base_url() . "images/excel.png" alt="Carga Data" title="Carga Data" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcelcli();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="regcli();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Cliente" title="Registrar Cliente" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="editcli();"><img src="" . base_url() . "images/editar.png" alt="Editar Cliente" title="Editar Cliente" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="activacli();"><img src="" . base_url() . "images/ajustes.png" alt="Activar/Inactivar" title="Activar/Inactivar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="cliempre();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Cliente</th><th>Sucursal</th><th>Tipo</th><th>Clase</th><th>Nombre</th><th>Rif</th><th>Email</th><th>SICM</th><th>SICA</th><th>Dias</th><th>Descu</th><th>Telf</th>
<th>Telf2</th><th>Contacto</th><th>Vendedor</th><th>Dirr.Fiscal</th><th>Dirr.Envio</th><th>Zona</th><th>Sector</th><th>Contac</th><th>Horario</th><th>Ingreso</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->status == 1) { $color = "class="w3-green""; $status = "Activo"; } else { $color = "class="w3-red""; $status = "Inactivo"; } if ($dtfac->descu > 0) { $color2 = "class="w3-green""; } else { $color2 = "class="w3-red""; } $html .= "<tr id="slect" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" id="a" . $i . "" name="codigo" value="" . $dtfac->codigo . "">
<td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->codigo . "</td>\xa <td>" . $dtfac->sucursal . "</td><td>" . $dtfac->tipo . "</td><td>" . $dtfac->subdivision . "</td><td>" . $dtfac->nombre . "</td><td>" . $dtfac->rif . "</td><td>" . $dtfac->email . "</td><td>" . $dtfac->sicm . "</td><td>" . $dtfac->sica . "</td><td>" . $dtfac->dias . "</td><td " . $color2 . ">" . $dtfac->descu . "</td><td>" . $dtfac->telf . "</td><td>" . $dtfac->telf2 . "</td>\xa <td>" . $dtfac->perscont . "</td><td>" . $dtfac->vendedor . "</td><td>" . $dtfac->direc . "</td><td>" . $dtfac->direcenv . "</td><td>" . $dtfac->zona . "</td><td>" . $dtfac->subsector . "</td><td>" . $dtfac->contac . "</td><td>" . $dtfac->horario . "</td><td>" . $dtfac->fecha . "</td><td " . $color . ">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Clientes: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;
var like=$("#like").val();
var key="droid903";
var datos = {
"pag" : DecrementNum,\xa "key" : key,"like":like\xa };
$.ajax({
data: datos,\xa url: baseurl+"c_droid/cliempre",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}
});
}
function numpag(a){ before();
var key="droid903";
var like=$("#like").val();\xa var datos = {
"key":key,
"pag" : a,like:like\xa };
$.ajax({
data: datos,
url: baseurl+"c_droid/cliempre",
type: "POST",\xa success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }\xa
});\xa }
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903"; var like=$("#like").val();\xa var datos = {
"key":key,
"pag" : IncrimentNum,like:like\xa };\xa \xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/cliempre",
type: "POST",
success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()
}\xa \xa });
}\xa </script>\xa <div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa \xa </div> "; return $html; } function activacli($cod) { $row = count($cod); $j = 0; for ($i = 0; $i < $row; $i++) { if ($cod[$i] != '' && $cod[$i] != null) { $bd = $this->db->query("SELECT status FROM cliempre WHERE codigo='{$cod[$i]}'")->row(); if ($bd->status == 1) { $new = 0; } else { $new = 1; } $this->db->query("UPDATE cliempre set status='{$new}' WHERE codigo='{$cod[$i]}'"); if ($this->db->affected_rows() > 0) { $j++; $this->loguser("Activa/Desactiva Cliempre", "El usuario activa\desactiva, proceso: " . $new . ", para el cliente " . $cod[$i] . "."); } } } return $j; } public function viewloguser($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE (b.nomape like '%{$b}%' || a.modulo like '%{$b}%' || a.descrip like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT * FROM loguser a JOIN trab b ON a.iduser=b.id " . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT * FROM loguser a JOIN trab b ON a.iduser=b.id " . $filter . " ORDER BY a.fcha DESC LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . " ")->result(); $html = "
<table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="loguser()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="exportloguser();"><img src="" . base_url() . "images/xls.png" alt="Export Excel" title="Export Excel" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="loguser();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Modulo</th><th>Nombre</th><th>Cedula</th><th>Descripcion</th><th>Fecha</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" name="codigo" value="" . $dtfac->id . "">
<td><!--<input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">-->" . $dtfac->modulo . " <td>" . $dtfac->nomape . "</td> <td>" . $dtfac->cedula . "</td> \xa <td>" . $dtfac->descrip . "</td> <td>" . $dtfac->fcha . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Movimientos: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var like=$("#like").val();\xa var key="droid903";\xa var datos = {
"pag" : DecrementNum,
"key" : key,"like":like\xa };
$.ajax({
data: datos,
url: baseurl+"c_droid/loguser",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }
\xa });\xa }\xa
function numpag(a){ before();\xa var key="droid903";\xa var like=$("#like").val();
var datos = {
"key":key,\xa "pag" : a,like:like
};\xa \xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/loguser",
type: "POST",
success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }\xa
});\xa }\xa
function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();
var datos = {
"key":key,
"pag" : IncrimentNum,like:like
};\xa
$.ajax({
data: datos,\xa url: baseurl+"c_droid/loguser",
type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }\xa
});\xa }
</script>\xa <div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa \xa </div> "; return $html; } function exportloguser($desde, $hasta) { return $this->db->query("SELECT a.modulo,b.nomape,b.cedula,a.descrip,a.fcha FROM loguser a JOIN trab b ON a.iduser=b.id WHERE a.fcha>='{$desde}' && a.fcha<='{$hasta}' ORDER BY a.fcha DESC"); } public function trabuser($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE a.nomape like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT null FROM trab a \xa LEFT JOIN trabdroid b ON a.id=b.id_trab " . $filter . " GROUP BY a.id")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT a.id,a.nomape,a.cedula,a.telefono,a.uuid,b.user,b.pass,a.tip FROM trab a
LEFT JOIN trabdroid b ON a.id=b.id_trab " . $filter . "
GROUP BY a.id ORDER BY a.tip,a.nomape LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . " ")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="trabuser()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="regtrab();"><img src="" . base_url() . "images/registrar.png" alt="Registrar" title="Registrar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="edittrab();"><img src="" . base_url() . "images/editar.png" alt="Editar" title="Editar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="trabuser();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>
<table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Id</th><th>Nombre</th><th>Cedula</th><th>Telefono</th><th>APP</th><th>Usuario</th><th>Clave</th><th>Cargo</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $cargo = ''; if ($dtfac->tip == 1) { $cargo = "Chofer"; } elseif ($dtfac->tip == 0) { $cargo = "Inactivo"; } elseif ($dtfac->tip == 2) { $cargo = "Admin"; } elseif ($dtfac->tip == 3) { $cargo = "Almacen"; } elseif ($dtfac->tip == 4) { $cargo = "Facturacion"; } elseif ($dtfac->tip == 5) { $cargo = "Logistica"; } elseif ($dtfac->tip == 6) { $cargo = "Supervisor Venta"; } elseif ($dtfac->tip == 7) { $cargo = "Ventas"; } elseif ($dtfac->tip == 8) { $cargo = "Supervisor Compra"; } elseif ($dtfac->tip == 9) { $cargo = "Compras"; } elseif ($dtfac->tip == 10) { $cargo = "Cobranza"; } elseif ($dtfac->tip == 11) { $cargo = "Estadista"; } elseif ($dtfac->tip == 12) { $cargo = "Regente"; } elseif ($dtfac->tip == 13) { $cargo = "Calidad"; } elseif ($dtfac->tip == 14) { $cargo = "Contabilidad"; } $html .= "<tr id="slect" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" name="id" value="" . $dtfac->id . ""><input type="hidden" name="nombre" value="" . $dtfac->nomape . ""><input type="hidden" name="cedula" value="" . $dtfac->cedula . "">
<input type="hidden" name="telefono" value="" . $dtfac->telefono . ""><input type="hidden" name="uuid" value="" . $dtfac->uuid . ""><input type="hidden" name="user" value="" . $dtfac->user . "">\xa <input type="hidden" name="pass" value="" . $dtfac->pass . ""><input type="hidden" name="tip" value="" . $dtfac->tip . "">\xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->id . " <td>" . $dtfac->nomape . "</td><td>" . $dtfac->cedula . "</td> \xa <td>" . $dtfac->telefono . "</td><td>" . $dtfac->uuid . "</td><td>" . $dtfac->user . "</td><td>" . $dtfac->pass . "</td><td>" . $cargo . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="6"><label class="w3-large"><b>Total Trabajadores: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var like=$("#like").val();\xa var key="droid903";
var datos = {
"pag" : DecrementNum,
"key" : key,"like":like\xa };
\xa $.ajax({
data: datos,
url: baseurl+"c_droid/trabuser",\xa type: "POST",
success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }
\xa });
}\xa \xa function numpag(a){ before();\xa var key="droid903";
var like=$("#like").val();
var datos = {
"key":key,\xa "pag" : a,like:like
};\xa \xa $.ajax({
data: datos,
url: baseurl+"c_droid/trabuser",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }
});\xa }\xa \xa function IncrimentNum(){ before();\xa var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903"; var like=$("#like").val();\xa var datos = {\xa "key":key,\xa "pag" : IncrimentNum,like:like
};
$.ajax({
data: datos,
url: baseurl+"c_droid/trabuser",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }
});\xa }\xa </script>\xa <div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa \xa </div> "; return $html; } public function regtrab($ci, $nom, $telf, $tip, $user, $pass) { $trab = array("cedula" => $ci, "nomape" => $nom, "telefono" => $telf, "tip" => $tip); $this->db->insert("trab", $trab); $id = $this->db->query("SELECT MAX(id) n FROM trab")->row(); $trabdroid = array("id_trab" => $id->n, "user" => $user, "pass" => $pass, "tip" => $tip); $this->db->insert("trabdroid", $trabdroid); return $this->db->affected_rows(); } public function edittrab($id, $ci, $nom, $telf, $uuid, $tip, $user, $pass) { $trabdroid = array("user" => $user, "pass" => $pass, "tip" => $tip); $i = 0; $this->db->where("id_trab", $id)->update("trabdroid", $trabdroid); if ($this->db->affected_rows() == 0) { $val = $this->db->query("SELECT NULL FROM trabdroid WHERE id_trab='{$id}'")->num_rows(); if ($user != '' && $pass != '' && $val == 0) { $i++; $trabdroid2 = array("id_trab" => $id, "user" => $user, "pass" => $pass, "tip" => $tip); $this->db->insert("trabdroid", $trabdroid2); } } else { $i++; } $trab = array("cedula" => $ci, "nomape" => $nom, "telefono" => $telf, "uuid" => $uuid, "tip" => $tip); $this->db->where("id", $id)->update("trab", $trab); if ($this->db->affected_rows() > 0) { $i++; } return $i; } public function vehi($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE a.nomape like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL FROM vehic")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT * FROM vehic LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . " ")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="vehi()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="regvehi();"><img src="" . base_url() . "images/registrar.png" alt="Registrar" title="Registrar" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="editvehi();"><img src="" . base_url() . "images/editar.png" alt="Editar" title="Editar" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="vehi();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid"><th>Id</th><th>Placa</th><th>Descripcion</th><th>Marca</th><th>Modelo</th><th>Estatus</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $cargo = ''; if ($dtfac->status == "S") { $status = "Activo"; $color = "class="w3-green""; } elseif ($dtfac->status == "N") { $status = "Inactivo"; $color = "class="w3-red""; } $html .= "<tr id="slect" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" name="id" value="" . $dtfac->id . ""><input type="hidden" name="placa" value="" . $dtfac->placa . ""><input type="hidden" name="descrip" value="" . $dtfac->descrip . "">
<input type="hidden" name="marca" value="" . $dtfac->marca . ""><input type="hidden" name="modelo" value="" . $dtfac->modelo . ""><input type="hidden" name="status" value="" . $dtfac->status . "">
<td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->id . " <td>" . $dtfac->placa . "</td><td>" . $dtfac->descrip . "</td> \xa <td>" . $dtfac->marca . "</td><td>" . $dtfac->modelo . "</td><td " . $color . ">" . $status . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="6"><label class="w3-large"><b>Total Vehiculos: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">\xa function DecrementNum(){ before();
var DecrementNum=document.getElementById("DecrementNum").value;
var like=$("#like").val();\xa var key="droid903";\xa var datos = {\xa "pag" : DecrementNum,\xa "key" : key,"like":like\xa };\xa \xa $.ajax({\xa data: datos,\xa url: baseurl+"c_droid/viewvehi",
type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }\xa
});
}\xa
function numpag(a){ before();\xa var key="droid903";
var like=$("#like").val();
var datos = {
"key":key,
"pag" : a,like:like\xa };\xa \xa $.ajax({\xa data: datos,
url: baseurl+"c_droid/viewvehi",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}\xa
});
}
\xa function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;
var key="droid903"; var like=$("#like").val();\xa var datos = {\xa "key":key,
"pag" : IncrimentNum,like:like
};\xa \xa $.ajax({
data: datos,
url: baseurl+"c_droid/viewvehi",
type: "POST",
success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()\xa }
});\xa }\xa </script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">
<a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">\xa <a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>
</div> "; return $html; } public function regvehi($placa, $descrip, $marca, $modelo, $status) { $trab = array("placa" => $placa, "descrip" => $descrip, "marca" => $marca, "modelo" => $modelo, "status" => $status); $this->db->insert("vehic", $trab); return $this->db->affected_rows(); } public function editviewvehi($id, $placa, $descrip, $marca, $modelo, $status) { $vehic = array("placa" => $placa, "descrip" => $descrip, "marca" => $marca, "modelo" => $modelo, "status" => $status); $this->db->where("id", $id)->update("vehic", $vehic); return $this->db->affected_rows(); } public function listvend($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "WHERE (a.codigo='{$b}' || a.nombre like '%{$b}%' || a.email like '%{$b}%' || a.cedula='%{$b}%' || a.telefono_movil like '%{$b}%' || a.telefonos like '%{$b}%')"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT NULL\xa FROM listvend a " . $filter . " GROUP BY a.codigo ORDER BY a.nombre")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT codigo,nombre,cedula,direccion,(SELECT zona FROM sectores WHERE codigo=a.sector) zona,(SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo) subzona\xa ,TRIM(a.telefonos) telf, TRIM(a.telefono_movil) telf2,a.email,a.sector,a.subcodigo,a.fecha
FROM listvend a " . $filter . " GROUP BY a.codigo ORDER BY a.nombre LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . " ")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">
<tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>
<td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="listvend()" id="like"></td>
<td class="w3-center w3-btn"><a onclick="regvend();"><img src="" . base_url() . "images/registrar.png" alt="Registrar Vendedores" title="Registrar Vendedores" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcelvend();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="editvend();"><img src="" . base_url() . "images/editar.png" alt="Editar Vend" title="Editar Vend" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="listvend();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>
</table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo"><th>Codigo</th><th>Nombre</th><th>Cedula</th><th>Direccion</th><th>Zona</th><th>Sub Zona</th><th>Telf</th><th>Telf2</th>\xa <th>Email</th><th>Fingreso</th></tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" class="item" onclick="">"; $html .= "<input type="hidden" name="codigo" value="" . $dtfac->codigo . ""><input type="hidden" name="nombre" value="" . $dtfac->nombre . ""><input type="hidden" name="cedula" value="" . $dtfac->cedula . "">
<input type="hidden" name="sector" value="" . $dtfac->sector . ""><input type="hidden" name="zona" value="" . $dtfac->zona . ""><input type="hidden" name="subcodigo" value="" . $dtfac->subcodigo . "">
<input type="hidden" name="subzona" value="" . $dtfac->subzona . ""><input type="hidden" name="email" value="" . $dtfac->email . ""><input type="hidden" name="telf" value="" . $dtfac->telf . ""><input type="hidden" name="fing" value="" . $dtfac->fecha . ""> \xa <td><input type="checkbox" onclick="w3.toggleClass('#slect" . $i . "','w3-yellow');" class="w3-check" name="check">" . $dtfac->codigo . " <td>" . $dtfac->nombre . "</td> <td>" . $dtfac->cedula . "</td>
<td>" . $dtfac->direccion . "</td> <td>" . $dtfac->zona . "</td> <td>" . $dtfac->subzona . "</td> <td>" . $dtfac->telf . "</td>
<td>" . $dtfac->telf2 . "</td><td>" . $dtfac->email . "</td><td>" . $dtfac->fecha . "</td>\xa </tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total Vendedores: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa <script type="text/javascript">\xa function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var like=$("#like").val();\xa var key="droid903";
var datos = {
"pag" : DecrementNum,
"key" : key,"like":like
};\xa
$.ajax({
data: datos,
url: baseurl+"c_droid/listvend",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }
\xa });
}
\xa function numpag(a){ before();
var key="droid903";\xa var like=$("#like").val();\xa var datos = {
"key":key,\xa "pag" : a,like:like\xa };\xa
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/listvend",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}\xa \xa });\xa }\xa \xa function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903"; var like=$("#like").val();
var datos = {
"key":key,\xa "pag" : IncrimentNum,like:like\xa };\xa
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/listvend",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()\xa }\xa \xa });
}\xa </script>
<div class="w3-bar w3-border w3-barras">
<input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">\xa <a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } function editvend($cod, $nom, $ci, $sec, $sub, $email, $telf, $fing) { $data = array("nombre" => $nom, "cedula" => $ci, "sector" => $sec, "subcodigo" => $sub, "email" => $email, "telefonos" => $telf, "fecha" => $fing); $this->db->where("codigo", $cod)->update("listvend", $data); $this->loguser("Modificar", "El usuario modifica la ficha al vendedor " . $cod . "."); return $this->db->affected_rows(); } function sectores($zona) { $bd = $this->db->query("SELECT subcodigo,subsector FROM subsectores WHERE codigo='{$zona}' ORDER BY subsector ASC"); $html = ''; foreach ($bd->result() as $db) { $html .= "<option value="" . $db->subcodigo . "">" . $db->subsector . "</option>"; } return $html; } function regvend($cod, $nom, $ci, $sec, $sub, $email, $telf, $fing) { $data = array("codigo" => $cod, "nombre" => $nom, "cedula" => $ci, "sector" => $sec, "subcodigo" => $sub, "email" => $email, "telefonos" => $telf, "fecha" => $fing); $this->db->insert("listvend", $data); $this->loguser("Registro Vendedor", "El usuario registra al vendedor " . $cod . ". de " . $nom . " y " . $ci . ''); return $this->db->affected_rows(); } public function pedweb() { $bd = $this->db->query("SELECT a.* FROM operti a JOIN control_operti b ON a.documento=b.doc WHERE a.fechacrea>=DATE_ADD(CURDATE(), INTERVAL -10 DAY) && b.status='0' GROUP BY a.documento;"); return $bd->result_array(); } public function cargapedweb($a) { foreach ($a as $b) { $val = $this->db->query("SELECT NULL FROM operti WHERE (documento='" . $b["documento"] . "' || antdoc='" . $b["documento"] . "')")->num_rows(); if ($val == 0) { $bd = $this->db->insert("operti", $b); $control = array("doc" => $b["documento"], "status" => "0"); $this->db->insert("control_operti", $control); } } return $bd; } public function ped2web() { $bd = $this->db->query("SELECT a.* FROM opermv as a LEFT JOIN operti as b ON a.documento=b.documento JOIN control_operti as c ON b.documento=c.doc WHERE b.fechacrea>=DATE_ADD(CURDATE(), INTERVAL -10 DAY) && c.status='0';"); return $bd->result_array(); } public function cargaped2web($a) { foreach ($a as $b) { $val = $this->db->query("SELECT NULL FROM opermv WHERE documento='" . $b["documento"] . "' && codigo='" . $b["codigo"] . "'")->num_rows(); if ($val == 0) { $bd = $this->db->insert("opermv", $b); $art = $this->db->query("SELECT comprometido FROM articulo WHERE codigo='" . $b["codigo"] . "'")->row(); $newcomp = $b["cantidad"] + $art->comprometido; $dato3 = array("comprometido" => $newcomp); $this->db->where("codigo", $b["codigo"])->update("articulo", $dato3); } } return $bd; } public function confi4web() { $bd = $this->db->query("SELECT documento FROM operti AS a JOIN control_operti as b ON a.documento=b.doc WHERE a.fechacrea>=DATE_ADD(CURDATE(), INTERVAL -10 DAY) && b.status='0';"); if ($bd->num_rows() > 0) { foreach ($bd->result() as $dt) { $datos = array("status" => "4"); $bd2 = $this->db->where("doc", $dt->documento)->update("control_operti", $datos); } } return $bd2; } public function confi1web($a) { $datos = array("status" => "1"); $bd = $this->db->where("doc", $a)->update("control_operti", $datos); return $bd; } public function editvehi($a, $b) { $datos = array("vehiculo" => $b); $sql = "id='{$a}' && status='0'"; $bd = $this->db->where($sql)->update("reparto", $datos); return $bd; } public function editchof($a, $b, $c) { if ($c == 1) { $datos = array("chofer1" => $b); } else { $datos = array("chofer2" => $b); } $sql = "id='{$a}' && status='0'"; $bd = $this->db->where($sql)->update("reparto", $datos); return $bd; } public function mencuest() { $bd1 = $this->db->query("SELECT * FROM encuest"); $bd2 = $this->db->query("SELECT * FROM pregencuest"); $bd3 = $this->db->query("SELECT * FROM respencuest"); $stitle = "<option value="" selected disabled>Seleccione</option>"; $title = "<table id="table" class="w3-table-all w3-hoverable w3-centered"><tr class="w3-fondodroid"><th>ID</th><th>Titulo</th><th></th></tr>"; $preg = "<table id="table" class="w3-table-all w3-hoverable w3-centered"><tr class="w3-fondodroid"><th>ID</th><th>Encuesta</th><th>Pregunta</th><th></th></tr>"; $resp = "<table id="table" class="w3-table-all w3-hoverable w3-centered"><tr class="w3-fondodroid"><th>ID</th><th>Respuesta</th><th></th></tr>"; $i = 1; foreach ($bd1->result() as $dt1) { $i++; $stitle .= "<option value="" . $dt1->id . "">" . $dt1->title . "<option>"; $title .= "<tr><td>" . $dt1->id . "</td><td>" . $dt1->title . "</td><td></td></tr>"; } $title .= "<tr><td>" . $i . "</td><td><input type="text" class="w3-input" id="a" placeholder="titulo"></td><td class="w3-btn"><a onclick="regtitle($('#a').val())"><img src="" . base_url() . "images/registrar.png" alt="Registrar" style="width:16px"></a></td></tr></table>"; $b = 1; foreach ($bd2->result() as $dt2) { $b++; $preg .= "<tr><td>" . $dt2->id . "</td><td>" . $dt2->id_encuest . "</td><td>" . $dt2->pregunta . "</td><td></td></tr>"; } $preg .= "<tr><td>" . $b . "</td><td><select class="w3-select" id="c">" . $stitle . "<select></td><td><input type="text" class="w3-input" id="b" placeholder="pregunta"></td><td class="w3-btn"><a onclick="regpreg($('#c').val(),$('#b').val())"><img src="" . base_url() . "images/registrar.png" alt="Registrar" style="width:16px"></a></td></tr></table>"; $c = 1; foreach ($bd3->result() as $dt3) { $c++; $resp .= "<tr><td>" . $dt3->id . "</td><td>" . $dt3->respuesta . "</td><td></td></tr>"; } $resp .= "<tr><td>" . $c . "</td><td><input type="text" class="w3-input" id="d" placeholder="respuesta"></td><td class="w3-btn"><a onclick="regresp($('#d').val())"><img src="" . base_url() . "images/registrar.png" alt="Registrar" style="width:16px"></a></td></tr></table>"; $data = array("title" => $title, "preg" => $preg, "resp" => $resp); return $data; } public function zonaencuest() { $bd = $this->db->query("SELECT id, title FROM encuest GROUP BY title ORDER BY title"); $data = array("encuest" => $bd->result_array(), "rows" => $bd->num_rows()); return $data; } public function verencuest($a) { $bd = $this->db->query("SELECT id,pregunta FROM pregencuest WHERE id_encuest='{$a}' ORDER BY pregunta"); $bd2 = $this->db->query("SELECT id,respuesta FROM respencuest ORDER BY respuesta"); $data = array("preg" => $bd->result_array(), "resp" => $bd2->result_array()); return $data; } function vend() { $bd = $this->db->query("SELECT codigo,nombre FROM listvend GROUP BY codigo")->result(); $html = "<input type="text" class="w3-input" id="idvend" list="listvend" placeholder="Vendedor..." value="" />\xa <datalist id="listvend">"; foreach ($bd as $dt) { $html .= "<option value="" . $dt->codigo . "">" . $dt->nombre . "</option>"; } $html .= "</datalist>"; return $html; } function formeditfac($doc) { $db = $this->db->query("SELECT vendedor cod,orden, diascred diasc, diasindex dias FROM operti WHERE documento='{$doc}'")->row(); $bd = $this->db->query("SELECT codigo,nombre FROM listvend GROUP BY codigo")->result(); $html = "<table><tr><td>Vendedor:<td><td><input type="text" class="w3-input" id="idvend" list="listvend" value="" . $db->cod . "" placeholder="Vendedor..." value="" /></t></tr>\xa <datalist id="listvend">"; foreach ($bd as $dt) { $html .= "<option value="" . $dt->codigo . "">" . $dt->nombre . "</option>"; } $html .= "</datalist>
<tr><td>Dias Credito:<td><td><input type="text" class="w3-input" id="swdiasc" value="" . $db->diasc . "" placeholder="dias"></t></tr>
<tr><td>Dias Index:<td><td><input type="text" class="w3-input" id="swdias" value="" . $db->dias . "" placeholder="dias"></t></tr>
<tr><td>N.Control:<td><td><input type="text" class="w3-input" id="swncontrol" value="" . $db->orden . "" placeholder="num control..."></t></tr></table>"; return $html; } public function regtitle($a) { $datos = array("title" => $a); $bd = $this->db->insert("encuest", $datos); return $bd; } public function regpreg($a, $b) { $datos = array("id_encuest" => $a, "pregunta" => $b); $bd = $this->db->insert("pregencuest", $datos); return $bd; } public function regresp($a) { $datos = array("respuesta" => $a); $bd = $this->db->insert("respencuest", $datos); return $bd; } public function regencuest($a, $b, $c, $d) { $bcli = $this->db->query("SELECT codigo FROM cliempre WHERE nombre like '%{$d}%'"); if ($bcli->num_rows() > 0) { $dcli = $bcli->row(); $datos = array("id_encuest" => $a, "id_preg" => $b, "id_resp" => $c, "cliente" => $dcli->codigo, "fech" => date("Y-m-d")); $bd = $this->db->insert("cliencuest", $datos); } return $bd; } public function searchcli($a) { $bd = $this->db->query("SELECT a.codigo FROM cliempre AS a WHERE a.nombre='{$a}'")->row(); return $bd->codigo; } public function loguser($a, $b) { if ($this->session->userdata("cod") == null || $this->session->userdata("cod") == '') { $cod = 0; } else { $cod = $this->session->userdata("cod"); } $datos = array("iduser" => $cod, "modulo" => $a, "descrip" => $b, "fcha" => date("Y-m-d H:i:s")); $this->db->insert("loguser", $datos); } public function admruleta() { $item = $this->itruleta(); $html = ''; $part = $this->db->query("SELECT * FROM gnruleta")->result_array(); $html .= "\xa <div id="overflow1" class="w3-col s6 w3-responsive w3-sombra">
<table class="w3-table-all w3-hoverable w3-centered" id="table">\xa <tr class="w3-barras"><th>ID</th><th>ITEMS</th><th></th></tr>"; $i = 0; foreach ($item as $ditem) { $id = $ditem["id"]; $max = $id + 1; $i++; $html .= "<tr><input type="hidden" id="item" . $i . "" value="" . $ditem["id"] . ""><td>" . $ditem["id"] . "</td><td>" . $ditem["item"] . "</td><td><a onclick="elmitrul($('#item" . $i . "').val());return false;"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:16px;height:16px;border:0;"></a></td></tr>"; } $html .= "<tr><td>" . $max . "</td><td><input type="text" id="newitem" class="w3-input" placeholder="new..."></td><td><a onclick="regitrul();return false;"><img src="" . base_url() . "images/registrar.png" alt="Registrar" title="Registrar" style="width:16px;height:16px;border:0;"></a></td></tr>
\x9</table>
\x9</div>\xa\xa <div id="overflow2" class="w3-col s6 w3-responsive w3-sombra">\xa <table class="w3-table-all w3-hoverable w3-centered" id="table">
<tr class="w3-barras"><th>ID</th><th>Ganador</th><th>Fecha</th><th></th><th></th></tr>"; $i = 0; foreach ($part as $dpart) { $id = $dpart["id"]; $max = $id + 1; $i++; $nom = $this->db->query("SELECT nombre from cliempre WHERE nrorif='" . $dpart["identy"] . "'"); if ($nom->num_rows() == 0) { $nom = $this->db->query("SELECT nomape from trab WHERE cedula='" . $dpart["identy"] . "'"); if ($nom->num_rows() > 0) { $dnom = $nom->row(); $nombre = $dnom->nomape; } else { $nombre = $dpart["identy"]; } } else { $dnom = $nom->row(); $nombre = $dnom->nombre; } $orgDate = $dpart["fecha"]; $newDate = date("Ymd", strtotime($orgDate)); $urlimg = $dpart["identy"] . "_" . $newDate; $html .= "<tr><input type="hidden" value="" . $urlimg . "" id="b" . $i . ""><input type="hidden" id="a" . $i . "" value="" . $dpart["id"] . ""><td>" . $dpart["id"] . "</td><td>" . $nombre . "</td><td>" . $dpart["fecha"] . "</td><td><a onclick="elmgnrul($('#a" . $i . "').val());return false;"><img src="" . base_url() . "images/borrar.png" alt="Eliminar" title="Eliminar" style="width:16px;height:16px;border:0;"></a></td><td><a onclick="vergnrul($('#b" . $i . "').val());return false;"><img src="" . base_url() . "images/buscar.png" alt="Ver" title="Ver" style="width:16px;height:16px;border:0;"></a></td></tr>"; } $html .= "\xa\x9</table>
</div>\xa\xa\xa "; return $html; } public function itruleta() { $bd = $this->db->query("SELECT id, item FROM itruleta ORDER BY id")->result_array(); return $bd; } public function regitrul($a) { $data = array("item" => $a); $this->db->insert("itruleta", $data); return $this->db->affected_rows(); } public function elmitrul($a) { $this->db->query("DELETE FROM itruleta WHERE id='{$a}'"); return $this->db->affected_rows(); } public function elmgnrul($a) { $this->db->query("DELETE FROM gnruleta WHERE id='{$a}'"); return $this->db->affected_rows(); } public function valgnrul($a) { $bd = $this->db->query("SELECT NULL FROM gnruleta WHERE identy='{$a}'"); return $bd->num_rows(); } public function reggnrul($a) { $this->db->insert("gnruleta", $a); } function reportvtagrup($inic, $fin, $grup) { if ($grup == "TOT") { $sql = ''; } else { $sql = "&& SUBSTR(a.codigo,1,3)="" . $grup . """; } return $this->db->query("SELECT a.codigo,a.nombre, ROUND(SUM(a.cantidad-a.cntdevuelt),2) unidades, ROUND(SUM(IF(a.tipodoc='N/C',a.montototal*-1,a.montototal)),2) bs,ROUND(SUM(IF(a.tipodoc='N/C',a.montototal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1)*-1,a.montototal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1))),2) dolar FROM opermv a\xa WHERE a.fechadoc>='{$inic}' && a.fechadoc<='{$fin}' && (a.tipodoc='FAC' || a.tipodoc='NOT' || a.tipodoc='N/C') " . $sql . " GROUP BY a.codigo\xa UNION\xa SELECT null,null,ROUND(SUM(a.cantidad-a.cntdevuelt),2) unidades, ROUND(SUM(IF(a.tipodoc='N/C',a.montototal*-1,a.montototal)),2) bs,ROUND(SUM(IF(a.tipodoc='N/C',a.montototal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1)*-1,a.montototal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1))),2) dolar FROM opermv a\xa WHERE a.fechadoc>='{$inic}' && a.fechadoc<='{$fin}' && (a.tipodoc='FAC' || a.tipodoc='NOT' || a.tipodoc='N/C') " . $sql . ''); } function reportcobroefectivo($inic, $fin) { return $this->db->query("SELECT vendedor,sector,subsector,emision,recepcion,vence v_index, vencec v_credito,diascred,diasindex,fpago,freg,codcliente,nombrecli,documento,ROUND(totneto,2)totneto,ROUND(totneto/tasa,2) totnetod,ROUND(totimpuest,2)totimpuest,\xa ROUND(totalfinal,2)totalfinalbs,ROUND(indexnd,2)indexnd,ROUND(totalfinal$,2) totalfinal$,nc,ROUND(ret/tasa,2) ret,IF(tipopago='USD',pagadod,pagadobs) pagado,tipopago,modopago,banco,referencia\xa FROM (
SELECT (SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,\xa (SELECT zona FROM sectores WHERE codigo=a.sector LIMIT 1) sector,\xa (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo LIMIT 1) subsector,
a.emision,a.recepcion,a.vence,a.vencec,a.diascred,a.diasindex,b.fech fpago,b.freg,a.codcliente,a.nombrecli,a.documento,a.totneto,a.totimpuest,a.totalfinal,a.totald totalfinal$,
IF((SELECT totalfinal FROM operti WHERE referencia=CONCAT(a.tipodoc,a.documento) && tipodoc='N/D' && estatusdoc!='X' LIMIT 1)>0,(SELECT totalfinal FROM operti WHERE referencia=CONCAT(a.tipodoc,a.documento) && tipodoc='N/D' && estatusdoc!='X' LIMIT 1),0) indexnd,
IF((SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento)>0,(SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento),0) nc,\xa IF((SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento))>0,(SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento)),0) ret,
(SELECT moneda FROM opercli where idfac=a.documento ORDER BY freg DESC limit 1) tipopago,
GROUP_CONCAT(b.tip) modopago,\xa GROUP_CONCAT((SELECT nom FROM bandest WHERE id=b.bancdest)) banco,
GROUP_CONCAT(b.ref) referencia,\xa (SELECT SUM(c.monto) FROM opercli c WHERE c.idfac=a.documento && c.idconsbanc IS NOT NULL) pagadobs,\xa (SELECT SUM(c.montod) FROM opercli c WHERE c.idfac=a.documento && c.idconsbanc IS NOT NULL) pagadod,
(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasa
FROM operti a JOIN opercli b ON (a.documento=b.idfac && b.freg>='{$inic}')
WHERE b.freg>='{$inic}' && b.freg<='{$fin}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && b.idconsbanc IS NOT NULL && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')\xa GROUP BY a.documento) cobranzaefectiva WHERE pagadod+nc+(ret/tasa)>=(totalfinal$-0.5) ORDER BY documento ASC;"); } function reportcierrecaja($ini, $fin) { return $this->db->query("SELECT a.fech fecha,(SELECT CONCAT(codcliente,' ',nombrecli) FROM operti WHERE documento=a.idfac && (tipodoc='NOT' || tipodoc='FAC') LIMIT 1) cliente,GROUP_CONCAT(idfac SEPARATOR '-') factura, tip tipo_pago, moneda, ref referencia,
(SELECT nom FROM banori WHERE id=a.bancori) banco_origen,\xa (SELECT nom FROM bandest WHERE id=a.bancdest) banco_destino, SUM(a.monto) bs,SUM(a.montod) $,\xa (SELECT nomape FROM trab WHERE id=a.`user`) usuario \xa FROM opercli a WHERE a.idconsbanc IS NOT NULL && a.idconsbanc>0 && a.fech>='{$ini}' && a.fech<='{$fin}'
GROUP BY a.idconsbanc
UNION\xa SELECT a.fech fecha,(SELECT CONCAT(codcliente,' ',nombrecli) FROM operti WHERE documento=a.idfac && (tipodoc='NOT' || tipodoc='FAC') LIMIT 1) cliente,GROUP_CONCAT(idfac SEPARATOR '-') factura, tip tipo_pago, moneda, ref referencia,\xa (SELECT nom FROM banori WHERE id=a.bancori) banco_origen,
(SELECT nom FROM bandest WHERE id=a.bancdest) banco_destino, a.monto bs,a.montod $,\xa (SELECT nomape FROM trab WHERE id=a.`user`) usuario
FROM opercli a WHERE a.idconsbanc IS NOT NULL && a.idconsbanc=0 && a.fech>='{$ini}' && a.fech<='{$fin}'"); } function reportreparto($inic, $fin) { return $this->db->query("SELECT b.reparto,a.ruta,c.documento,c.codcliente,c.nombrecli,(SELECT nomape FROM trab WHERE id=a.chofer1) chofer1,(SELECT nomape FROM trab WHERE id=a.chofer2) chofer2,(SELECT COUNT(id) FROM bultos WHERE doc=c.antdoc GROUP BY doc) bultos,ROUND((SELECT SUM(cantidad-cntdevuelt) FROM opermv WHERE tipodoc=c.tipodoc && documento=c.documento)) Unid,a.fech cargado,a.entregado\xa FROM reparto a JOIN control_operti b ON a.id=b.reparto JOIN operti c ON b.doc=c.antdoc && (c.tipodoc='FAC' || c.tipodoc='NOT')\xa WHERE a.fech>='{$inic}' && a.fech<='{$fin}' ORDER BY b.reparto ASC"); } function reportbackorder($inic, $fin) { $datos = $this->db->query("SELECT a.codigo,(SELECT nombre FROM articulo where codigo=a.codigo) nombre,SUM(a.cantorg) pedido,SUM(a.cantfin) procesado,SUM(a.cantorg)-SUM(a.cantfin) pendiente FROM backorder a \xa JOIN operti b ON (a.doc=b.antdoc && b.fechacrea>='{$inic}' && b.fechacrea<='{$fin}') WHERE DATE(a.fecha)>='{$inic}' && DATE(a.fecha)<='{$fin}'
&& a.codigo IN (SELECT codigo FROM opermv WHERE tipodoc=b.tipodoc && documento=b.documento && codigo=a.codigo)\xa GROUP BY a.codigo;"); $totped = 0; $totpro = 0; $totpend = 0; $total = "<table class="w3-table-all w3-hoverable w3-centered"><tr><td class="w3-fondodroid">Pedido</td><td>" . $totped . "</td><td class="w3-fondodroid">Procesado</td><td>" . $totpro . "</td><td class="w3-fondodroid">Pendiente</td><td>" . $totpend . "</td></tr></table>"; return array("datos" => $datos, "total" => $total); } function reportbackorder2($inic, $fin) { $datos = $this->db->query("SELECT b.codcliente,b.nombrecli,a.codigo,(SELECT nombre FROM articulo where codigo=a.codigo) nombre,SUM(a.cantorg) pedido,SUM(a.cantfin) procesado,SUM(a.cantorg)-SUM(a.cantfin) pendiente FROM backorder a
JOIN operti b ON (a.doc=b.antdoc && b.fechacrea>='{$inic}' && b.fechacrea<='{$fin}') WHERE DATE(a.fecha)>='{$inic}' && DATE(a.fecha)<='{$fin}'
&& a.codigo IN (SELECT codigo FROM opermv WHERE tipodoc=b.tipodoc && documento=b.documento && codigo=a.codigo)\xa GROUP BY b.codcliente,a.codigo;"); $totped = 0; $totpro = 0; $totpend = 0; foreach ($datos->result() as $db) { $totped += $db->pedido; $totpro += $db->procesado; $totpend += $db->pendiente; } $total = "<table class="w3-table-all w3-hoverable w3-centered"><tr><td class="w3-fondodroid">Pedido</td><td>" . $totped . "</td><td class="w3-fondodroid">Procesado</td><td>" . $totpro . "</td><td class="w3-fondodroid">Pendiente</td><td>" . $totpend . "</td></tr></table>"; return array("datos" => $datos, "total" => $total); } function reportventadetallada($inic, $fin) { return $this->db->query("SELECT b.codcliente,b.vence v_index,b.nombrecli,b.fechacrea emision,b.documento,ROUND(a.preciounit,2) preciounit,a.almacen,ROUND(SUM(a.cantidad),0) cantidad,ROUND(SUM(a.cntdevuelt),0) cntdevuelt,ROUND(a.montoneto,2) montoneto,ROUND(a.montototal,2) montototal,\xa round(a.montoneto/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) montonetod, \xa round(a.montototal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) montontotald,\xa a.codigo,a.lote,a.nombre, (SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor, b.vendedor codvend, a.dsctounit,a.dsctoendp dsctopromo,
(SELECT nombre FROM listvend WHERE codigo=b.vendedor LIMIT 1) nomvend,\xa (SELECT marca FROM articulo WHERE codigo=a.codigo) marca,
(SELECT subsector FROM subsectores WHERE codigo=b.sector && subcodigo=b.subcodigo LIMIT 1) zona\xa FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.fechadoc>='{$inic}' && a.fechadoc<='{$fin}' && (a.tipodoc='NOT' || a.tipodoc='FAC') && SUBSTR(a.codigo,1,3)!='N/A' GROUP BY a.documento,a.codigo,a.lote"); } function reportventadetallada2($inic, $fin) { return $this->db->query("SELECT b.codcliente,b.vence v_index,b.nombrecli,b.fechacrea emision,b.documento,ROUND(a.costounit,2) costo$,ROUND(a.costounit*(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) costobs,ROUND(a.preciooriginal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) preciooriginal$,ROUND(a.preciooriginal,2) preciooriginalBs,a.almacen,ROUND(SUM(a.cantidad),0) cantidad,ROUND(SUM(a.cntdevuelt),0) cntdevuelt,ROUND(a.montoneto,2) montoneto,ROUND(a.montototal,2) montototal,
round(a.montoneto/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) montonetod, \xa round(a.montototal/(SELECT oficial FROM monecam WHERE fecha<=a.fechadoc ORDER BY fecha DESC LIMIT 1),2) montontotald,
a.codigo,a.lote,a.nombre, (SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor, b.vendedor codvend, a.dsctounit,a.dsctoendp dsctopromo,\xa (SELECT nombre FROM listvend WHERE codigo=b.vendedor LIMIT 1) nomvend,\xa (SELECT marca FROM articulo WHERE codigo=a.codigo) marca,\xa (SELECT subsector FROM subsectores WHERE codigo=b.sector && subcodigo=b.subcodigo LIMIT 1) zona
FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.fechadoc>='{$inic}' && a.fechadoc<='{$fin}' && (a.tipodoc='NOT' || a.tipodoc='FAC') GROUP BY a.documento,a.codigo,a.lote"); } function reportventaprov($ini, $fin, $prov) { $codprov = $this->db->query("SELECT codigo n FROM proveed WHERE id='{$prov}'")->row(); return $this->db->query("SELECT almacen,codigo,nombre,lote,ROUND(costo,2)costo,ROUND(exist_inicial)exist_inicial,ROUND(cant)cant,ROUND(dev)dev,ROUND(exist_inicial-cant+dev) exist_final FROM
(SELECT a.almacen,a.codigoart codigo,c.nombre,a.lote, (SELECT costounit FROM opermv WHERE codigo=a.codigoart && fechadoc<='{$fin}' ORDER BY fechadoc DESC LIMIT 1) costo,
IF((SELECT SUM(cantidad-cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc<'{$ini}')>0,a.cantidad-(SELECT SUM(cantidad-cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc<'{$ini}'),a.cantidad) exist_inicial,\xa IF((SELECT SUM(cantidad) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}')>0,(SELECT SUM(cantidad) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}'),0) cant,\xa IF((SELECT SUM(cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}')>0,(SELECT SUM(cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}'),0) dev\xa FROM artilotes a JOIN artiprov b ON a.codigoart=b.codigo\xa JOIN articulo c ON b.codigo=c.codigo\xa WHERE b.proveedor='{$codprov->n}' && a.almacen NOT IN (01,05,06)
GROUP BY a.codigoart,a.almacen,a.lote) ventaprov
UNION\xa SELECT null almacen,null codigo,null nombre,null lote,ROUND(SUM(costo),2)costo,ROUND(SUM(exist_inicial))exist_inicial,ROUND(SUM(cant))cant,ROUND(SUM(dev))dev,ROUND(SUM(exist_inicial-cant+dev)) exist_final FROM
(SELECT a.almacen,a.codigoart codigo,c.nombre,a.lote, (SELECT costounit FROM opermv WHERE codigo=a.codigoart && fechadoc<='{$fin}' ORDER BY fechadoc DESC LIMIT 1) costo,
IF((SELECT SUM(cantidad-cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc<'{$ini}')>0,a.cantidad-(SELECT SUM(cantidad-cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc<'{$ini}'),a.cantidad-a.consumido) exist_inicial,
IF((SELECT SUM(cantidad) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}')>0,(SELECT SUM(cantidad) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}'),0) cant,
IF((SELECT SUM(cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}')>0,(SELECT SUM(cntdevuelt) FROM opermv WHERE codigo=a.codigoart && lote=a.lote && almacen=a.almacen && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$ini}' && fechadoc<='{$fin}'),0) dev\xa FROM artilotes a JOIN artiprov b ON a.codigoart=b.codigo\xa JOIN articulo c ON b.codigo=c.codigo\xa WHERE b.proveedor='{$codprov->n}' && a.almacen NOT IN (01,05,06)\xa GROUP BY a.codigoart,a.almacen,a.lote) ventaprov"); } function reportventaprovcli($ini, $fin, $prov) { return $this->db->query("SELECT a.fechadoc,b.documento,b.nombrecli,a.codigo,a.nombre, ROUND(SUM(a.cantidad)) vendidas,ROUND(SUM(a.cntdevuelt)) devueltas,ROUND(a.costounit,2) costo,ROUND(a.preciounit,2) precio\xa FROM opermv a\xa JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc)\xa JOIN artiprov c ON a.codigo=c.codigo\xa JOIN proveed d ON c.proveedor=d.codigo
WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && d.id='{$prov}'
GROUP BY b.documento,b.codcliente,a.codigo ORDER BY a.fechadoc ASC"); } function reportventaprov2($ini, $fin, $prov) { return $this->db->query("SELECT b.documento,b.nombrecli,a.codigo,a.nombre, ROUND(SUM(a.cantidad)) unidades,ROUND(a.dsctoendp) porcent,ROUND(a.preciooriginal,2) preciooriginal,ROUND(a.dsctoendm,2) descu,ROUND(a.preciounit,2) total,ROUND(a.dsctoendm*SUM(a.cantidad),2) totaldescu
FROM opermv a\xa JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc)\xa JOIN artiprov c ON a.codigo=c.codigo
JOIN proveed d ON c.proveedor=d.codigo\xa WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && a.dsctoendp>0 && d.id='{$prov}'
GROUP BY b.documento,b.codcliente,a.codigo,a.dsctoendp"); } function reportventavend($ini, $fin, $vend) { $totcli = $this->db->query("SELECT NULL FROM operti WHERE fechacrea>='{$ini}' && fechacrea<='{$fin}' && vendedor='{$vend}' && (tipodoc='FAC' || tipodoc='NOT') GROUP BY codcliente")->num_rows(); $totins = $this->db->query("SELECT ROUND(SUM(cantidad-cntdevuelt),2) n FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && b.vendedor='{$vend}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && substr(a.codigo,1,3)='INS'")->row(); $totalm = $this->db->query("SELECT ROUND(SUM(cantidad-cntdevuelt),2) n FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && b.vendedor='{$vend}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && substr(a.codigo,1,3)='ALM'")->row(); $totmed = $this->db->query("SELECT ROUND(SUM(cantidad-cntdevuelt),2) n FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && b.vendedor='{$vend}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && substr(a.codigo,1,3)='MED'")->row(); $totmis = $this->db->query("SELECT ROUND(SUM(cantidad-cntdevuelt),2) n FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc) WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && b.vendedor='{$vend}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && substr(a.codigo,1,3)='MIS'")->row(); return $this->db->query("SELECT (SELECT nombre FROM listvend WHERE codigo=a.vendedor)vendedor,a.tipodoc,a.documento,a.codcliente,a.nombrecli,b.codigo,b.nombre,ROUND(SUM(b.cantidad-b.cntdevuelt),0) cantidad,\xa ROUND(SUM(b.montototal),2) total,(SELECT zona FROM sectores WHERe codigo=a.sector)sector,(SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo)subsector FROM opermv b JOIN operti a ON (a.documento=b.documento && a.tipodoc=b.tipodoc)
WHERE a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}' && a.vendedor='{$vend}' && (a.tipodoc='FAC' || a.tipodoc='NOT')
GROUP BY a.documento,b.codigo\xa UNION
SELECT '<b>Total Clientes</b> {$totcli}','<b>Total ALM</b> {$totalm->n}','<b>Total MED</b> {$totmed->n}','<b>Total INS</b> {$totins->n}','<b>Total MIS</b> {$totmis->n}',CONCAT('<b>Total Unid</b>',' ',ROUND(SUM(b.cantidad-b.cntdevuelt),0)) cantidad,\xa CONCAT('<b>Total Bs</b>',' ',ROUND(SUM(b.montototal),2)) total,null,null,null,null FROM opermv b JOIN operti a ON (a.documento=b.documento && a.tipodoc=b.tipodoc)
WHERE a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}' && a.vendedor='{$vend}' && (a.tipodoc='FAC' || a.tipodoc='NOT')"); } function reportventacli($ini, $fin, $cli) { return $this->db->query("SELECT * FROM ( SELECT a.fechacrea fecha,b.codigo, b.nombre, ROUND(SUM(b.cantidad),0) cantidad FROM operti a JOIN opermv b ON a.documento=b.documento WHERE a.codcliente='{$cli}' && a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}'\xa GROUP BY b.codigo
UNION
SELECT null,null, '<b>Total Unidades</b>', ROUND(SUM(b.cantidad),0) cantidad FROM operti a JOIN opermv b ON a.documento=b.documento WHERE a.codcliente='{$cli}' && a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}'\xa GROUP BY a.codcliente ) ventacli ORDER BY cantidad DESC"); } function reportrecepcion($ini, $fin) { return $this->db->query("SELECT a.id orden,a.femis emision,a.frecep recepcion,(SELECT nombre FROM proveed WHERE id=a.proveed) prov,a.almacen,b.codigo,
(SELECT nombre FROM articulo WHERE codigo=b.codigo) nombre,b.lote,b.elab,b.vence,b.cant,b.costo\xa FROM ordc a JOIN itordc b ON a.id=b.ordc WHERE a.frecep>='{$ini}' && a.frecep<='{$fin}' && a.`status`=1 && b.`status`=1"); } function reportcobranza($ini, $fin) { return $this->db->query("SELECT (SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,a.documento,
(SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo ) zona,a.codcliente,
a.fechacrea,a.nombrecli,ROUND(a.totalfinal,2) totalfinal,ROUND(a.totimpuest,2) totimpuest,ROUND(a.totneto,2) totneto,ROUND(a.totald,2) totald,
IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,
IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET,
(SELECT GROUP_CONCAT(monto) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL GROUP BY idfac) abonobs,
(SELECT GROUP_CONCAT(montod) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL GROUP BY idfac) abono$,\xa ROUND((SELECT IF(SUM(monto)>0,SUM(monto),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadobs,
ROUND((SELECT IF(SUM(montod)>0,SUM(montod),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadod,ROUND(a.totpagos,2) pagos_pskcloud,a.recepcion,a.diascred
FROM operti a WHERE a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')"); } function reportcobranzazona($zona) { return $this->db->query("SELECT vendedor,documento,zona,codcliente, fechacrea,vence v_index,vencec v_credito,nombrecli,totalfinal,totimpuest,totneto,totald,nc,ret,abonobs,abono$,pagadobs,pagadod,pagos_pskcloud,(totald-(pagadod+nc+ret)) debe$,recepcion,diascred FROM (\xa SELECT (SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,a.documento,\xa (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo ) zona,a.codcliente,\xa a.fechacrea,a.vence,a.vencec,a.nombrecli,ROUND(a.totalfinal,2) totalfinal,ROUND(a.totimpuest,2) totimpuest,ROUND(a.totneto,2) totneto,ROUND(a.totald,2) totald,
IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,
IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET,
(SELECT GROUP_CONCAT(monto SEPARATOR ';') FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL GROUP BY idfac) abonobs,\xa (SELECT GROUP_CONCAT(montod SEPARATOR ';') FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL GROUP BY idfac) abono$,\xa ROUND((SELECT IF(SUM(monto)>0,SUM(monto),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadobs,\xa ROUND((SELECT IF(SUM(montod)>0,SUM(montod),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagadod,ROUND(a.totpagos,2) pagos_pskcloud,a.recepcion,a.diascred\xa FROM operti a WHERE CONCAT(a.sector,a.subcodigo)='{$zona}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')) cobranzazona HAVING pagadod+nc+ret<(totald-0.5)"); } function reportcobranzazonatodo($ini, $fin) { return $this->db->query("SELECT vendedor,zona,documento,emision,recepcion,diascred,vence_index,vence_credito,codcliente,nombrecli,totalbs,total$,IF(pagado$>0,pagado$,0) pagado$, IF(NC>0,NC,0) NC,IF(RET>0,RET,0) RET FROM
(
SELECT (SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,\xa (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo ) zona,\xa a.documento,a.fechacrea emision,a.recepcion,a.diascred,DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY) vence_index,
DATE_ADD(a.recepcion,INTERVAL a.diascred DAY) vence_credito,a.codcliente,a.nombrecli,ROUND(a.totalfinal,2) totalbs,ROUND(SUM(a.totald),2) total$,
ROUND((SELECT IF(SUM(montod)>0,SUM(montod),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagado$,
(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento) NC,\xa (SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='') RET\xa FROM operti a\xa WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.totald>0 && a.estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000') && (a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}')
GROUP BY a.documento \xa ) \xa pendiente HAVING pagado$+NC+RET<(total$-0.5) ORDER BY documento ASC"); } function reportcobranzazonatodobs($ini, $fin) { return $this->db->query("SELECT vendedor,zona,documento,emision,recepcion,diascred,vence_index,vence_credito,codcliente,nombrecli,totalbs,total$,IF(pagado$>0,pagado$,0) pagado$, IF(NC>0,NC,0) NC,IF(RET>0,RET,0) RET FROM
( \xa SELECT (SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,\xa (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo ) zona,\xa a.documento,a.fechacrea emision,a.recepcion,a.diascred,DATE_ADD(a.recepcion,INTERVAL a.diasindex DAY) vence_index,
DATE_ADD(a.recepcion,INTERVAL a.diascred DAY) vence_credito,a.codcliente,a.nombrecli,ROUND(a.totalfinal,2) totalbs,\xa ROUND((SELECT IF(SUM(montod)>0,SUM(montod),0) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL),2) pagado$,
(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento) NC,\xa (SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='') RET\xa FROM operti a
WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.totald>0 && a.estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000') && (a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}')\xa GROUP BY a.documento \xa ) \xa pendiente HAVING pagado$+NC+RET<(total$-0.5) ORDER BY documento ASC"); } function reportdiasvenc($ini, $fin) { return $this->db->query("SELECT a.documento,a.codcliente,a.nombrecli, a.vence, MAX(b.fech) fpago,dateDIFF(b.fech,a.vence) dias\xa FROM operti a
JOIN opercli b ON a.documento=b.idfac && b.idconsbanc IS NOT NULL
WHERE a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && SUBSTR(a.codcliente,1,3)!='INT'\xa GROUP BY a.documento"); } function reportconcibanc() { return $this->db->query("SELECT trim(a.codigo)codigo,a.nombre,(SELECT nombre FROM listvend WHERE codigo=a.vendedor) vendedor,
TRIM(a.telefonos)telefonos,TRIM(a.telefono_movil)telefono_movil,b.fech fbanco,b.ref,b.descrip,b.monto, (SELECT documento FROM operti WHERE codcliente=a.codigo && totalfinal=b.monto && (tipodoc='FAC' || tipodoc='NOT')) FAC\xa FROM cliempre a JOIN consbanc b ON b.descrip LIKE CONCAT('%',a.nrorif,'%') WHERE b.`status`='N'\xa GROUP BY a.codigo,b.id HAVING monto>0;"); } function reportdesempeno($ini, $fin) { return $this->db->query("SELECT a.documento,a.nombrecli,(SELECT nomape FROM trab WHERe id=b.trabempaq) armador,(SELECT nomape FROM trab WHERe id=b.trabempaq3) verificador, (SELECT nomape FROM trab WHERe id=a.uemisor) facturador,
(SELECT nomape FROM trab WHERe id=b.trabempaq2) empacador,\xa (SELECT COUNT(*) FROM opermv WHERE tipodoc=a.tipodoc && documento=a.documento) item,ROUND((SELECT SUM(cantidad) FROM opermv WHERE tipodoc=a.tipodoc && documento=a.documento),0) Unid,
(SELECT SUM(num) FROM bultos WHERE doc=a.antdoc) bultos, (SELECT refg FROM bultos WHERE doc=a.antdoc LIMIT 1) frio,\xa TIMESTAMPDIFF(MINUTE,b.timeaut,a.fechayhora) minutos,b.timeaut autorizado,b.timeasig tomado_armado,b.timearm armado,b.timeasig3 tomado_verificar,
b.timeverif verificado,a.fechayhora facturado,b.timeasig2 tomado_empacar,b.timeemp empacado \xa FROM operti a JOIN control_operti b ON a.antdoc=b.doc WHERE a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}' && (a.tipodoc='FAC' || a.tipodoc='NOT');"); } function reportvtacontrol($ini, $fin) { return $this->db->query("SELECT a.tipodoc,a.documento,(SELECT nombrecli FROM operti WHERe documento=a.documento LIMIT 1) nombrecli,a.fechadoc fecha,a.codigo,a.nombre,\xa ROUND(IF((SELECT SUM(cantidad-consumido) FROM artilotes WHERE codigoart=a.codigo && almacen NOT IN (01,05,06)) IS NOT NULL,(SELECT SUM(cantidad-consumido) FROM artilotes WHERE codigoart=a.codigo && almacen NOT IN (01,05,06)),b.existencia),0) existen,\xa ROUND(SUM(a.cantidad),0) vendidas, ROUND(SUM(cntdevuelt),0) devueltas FROM opermv a JOIN articulo b ON a.codigo=b.codigo
WHERE b.controlado=1 && (a.tipodoc='FAC' || a.tipodoc='NOT') && a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' GROUP BY a.documento,a.codigo"); } function reportvtaregula($ini, $fin) { return $this->db->query("SELECT a.tipodoc,a.documento,(SELECT nombrecli FROM operti WHERe documento=a.documento LIMIT 1) nombrecli,a.fechadoc fecha,a.codigo,a.nombre,\xa ROUND(IF((SELECT SUM(cantidad-consumido) FROM artilotes WHERE codigoart=a.codigo && almacen NOT IN (01,05,06)) IS NOT NULL,(SELECT SUM(cantidad-consumido) FROM artilotes WHERE codigoart=a.codigo && almacen NOT IN (01,05,06)),b.existencia),0) existen,\xa ROUND(SUM(a.cantidad),0) vendidas, ROUND(SUM(cntdevuelt),0) devueltas FROM opermv a JOIN articulo b ON a.codigo=b.codigo
WHERE b.nombre REGEXP 'azitromicina|cefixima|cefotaxima|ceftazidima|ceftriaxona|ciprofloxacina|claritromicina|levofloxacina|lincomicina|insulina' && (a.tipodoc='FAC' || a.tipodoc='NOT') && a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' GROUP BY a.documento,a.codigo;"); } function reportfacvencidas($ini, $fin) { return $this->db->query("SELECT a.documento,a.codcliente,a.nombrecli,a.fechacrea,a.recepcion,
DATE_ADD(a.recepcion,INTERVAL a.diascred DAY) vence, DATEDIFF(CURDATE(),DATE_ADD(a.recepcion,INTERVAL a.diascred DAY)) dias
FROM operti a WHERE a.fechacrea>='{$ini}' && a.fechacrea<='{$fin}' && a.totpagos=0 && a.tipodoc='FAC' && a.documento NOT IN (SELECT idfac FROM opercli GROUP BY idfac) HAVING dias>0;"); } function reportarti() { return $this->db->query("SELECT b.almacen,a.codigo,a.nombre,b.lote, (SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor,a.marca,
(SELECT codalternativo FROM invcodalternativo WHERE codigo=a.codigo LIMIT 1) barra,b.ubica,if((b.cantidad-b.consumido)>0,ROUND(a.existencia),0) existarti, MIN(b.vence) vence,
ROUND(b.cantidad-b.consumido,0) existlote FROM articulo a \xa LEFT JOIN artilotes b ON a.codigo=b.codigoart\xa WHERE a.existencia>0 && (b.cantidad - b.consumido)>0 && a.para_web=1\xa GROUP BY a.codigo,b.lote"); } function reportartrota($ini, $fin) { return $this->db->query("SELECT codigo,nombre,marca,promday,rotacion,stock,ROUND(IF((rotacion-stock)>0,(rotacion-stock),0)) sugerido,round((stock/promday)/7,2) disponible_semanal FROM (\xa SELECT a.codigo,a.nombre,a.marca,ROUND(SUM(a.cantidad)/DATEDIFF('{$fin}','{$ini}'),2) promday,
ROUND(SUM(a.cantidad)) rotacion, ROUND((SELECT existencia FROM articulo WHERE codigo=a.codigo)) stock
FROM opermv a WHERE a.fechadoc>='{$ini}' && a.fechadoc<='{$fin}' && a.codigo!='N/A' GROUP BY a.codigo \xa ) rotacion ORDER BY sugerido DESC"); } function reportarticero() { return $this->db->query("SELECT a.codigo,a.nombre, (SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor,a.marca,ROUND(existencia) existen FROM articulo a WHERE a.existencia=0 GROUP BY a.codigo"); } function reportarti02() { return $this->db->query("SELECT SUBSTR(a.codigo,1,3) tipo,a.codigo,a.nombre,b.almacen,ROUND(a.costo*(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) costo,ROUND((SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) BCV,ROUND(SUM(b.cantidad)-SUM(b.consumido)) existen, ROUND((a.costo*(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1))*(SUM(b.cantidad)-SUM(b.consumido)),2) total FROM articulo a \xa JOIN artilotes b ON (a.codigo=b.codigoart && b.almacen=02)
GROUP BY a.codigo HAVING existen>0
"); } function reportartioff() { return $this->db->query("SELECT b.almacen,a.codigo,a.nombre,b.lote, (SELECT nombre FROM artiprov WHERE codigo=a.codigo LIMIT 1) proveedor,a.marca,\xa (SELECT codalternativo FROM invcodalternativo WHERE codigo=a.codigo LIMIT 1) barra,b.ubica,if((b.cantidad-b.consumido)>0,ROUND(a.existencia),0) existarti, MIN(b.vence) vence,
ROUND(b.cantidad-b.consumido,0) existlote FROM articulo a \xa LEFT JOIN artilotes b ON a.codigo=b.codigoart
WHERE a.existencia>0 && (b.cantidad - b.consumido)>0 && a.para_web=0\xa GROUP BY a.codigo,b.lote"); } function reportartivence($ini, $fin) { return $this->db->query("SELECT a.codigo,a.nombre,b.almacen,b.lote,b.vence FROM articulo a JOIN artilotes b ON a.codigo=b.codigoart WHERE b.vence>='{$ini}' && b.vence<='{$fin}' GROUP BY a.codigo;"); } function graficas() { $opt = "<option value="" disabled selected>Seleccione</option>
<option value="1">Venta Grupo</option>
<option value="2">Venta Vendedores</option><option value="7">Venta Zona</option>
<option value="5">Venta Cliente</option><option value="6">Venta Productos</option>"; if ($this->session->userdata("tip") == 2 || $this->session->userdata("tip") == 10 || $this->session->userdata("tip") == 11) { $opt .= "<option value="3">Cobranza por Dias</option>
<option value="8">Cobranza por Mes</option>\xa <option value="4">Cobranza por Zona</option>
"; } $html = "<br><br>
<div class="w3-hide-small">
<table class="w3-table-all w3-hoverable">\xa <tr><td class="w3-fondodroid">Desde</td><td><input type="date" class="w3-input" id="desde"></td>\xa <td class="w3-fondodroid">Hasta</td><td><input type="date" class="w3-input" id="hasta"></td>\xa <td class="w3-fondodroid">Modalidad</td><td><select id="tipo" class="w3-select">" . $opt . "</select></td>\xa <td class="w3-btn"><a onclick="optgraficas();"><img src="" . base_url() . "images/bn.png" alt="Autorizar" title="Autorizar" style="width:20px;height:20px;border:0;"></a><td>
</tr>\xa </table>\xa </div><br><br>
\xa <div class="w3-hide-large w3-hide-medium">
<table class="w3-table-all w3-hoverable">\xa <tr><td class="w3-fondodroid">Desde</td><td><input type="date" class="w3-input" id="desde2"></td>
<td class="w3-fondodroid">Hasta</td><td><input type="date" class="w3-input" id="hasta2"></td>
<tr><td class="w3-fondodroid">Modalidad</td><td><select id="tipo2" class="w3-select">" . $opt . "</select></td>\xa <td class="w3-btn"><a onclick="optgraficas2();"><img src="" . base_url() . "images/bn.png" alt="Autorizar" title="Autorizar" style="width:20px;height:20px;border:0;"></a><td></tr>\xa </tr>
</table>\xa </div><br>\xa <div id="reporte" class="w3-responsive" style="width:95%;height:600px"></div>\xa <div id="reporte2"></div><br><br>\xa "; return $html; } function optgraficas($tip, $desde, $hasta) { $html = ''; if ($tip == 1) { $html = $this->db->query("SELECT n,mes,SUM(IF(grupo='ALM',unidades,0)) alm,SUM(IF(grupo='MED',unidades,0)) med,SUM(IF(grupo='INS',unidades,0)) ins, SUM(IF(grupo='MIS',unidades,0)) mis,SUM(unidades) total FROM
(SELECT MONTH(a.fechadoc) n,
IF(MONTH(a.fechadoc)=1,'ENE',IF(MONTH(a.fechadoc)=2,'FEB',IF(MONTH(a.fechadoc)=3,'MAR',IF(MONTH(a.fechadoc)=4,'ABR',IF(MONTH(a.fechadoc)=5,'MAY',IF(MONTH(a.fechadoc)=6,'JUN',
IF(MONTH(a.fechadoc)=7,'JUL',IF(MONTH(a.fechadoc)=8,'AGO',IF(MONTH(a.fechadoc)=9,'SEP',IF(MONTH(a.fechadoc)=10,'OCT',IF(MONTH(a.fechadoc)=11,'NOV',IF(MONTH(a.fechadoc)=12,'DIC','')))))))))))) mes, SUBSTR(a.codigo,1,3) grupo,\xa ROUND(IF(MONTH(a.fechadoc)=1,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=2,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=3,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=4,SUM(a.cantidad-a.cntdevuelt),
IF(MONTH(a.fechadoc)=5,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=6,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=7,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=8,SUM(a.cantidad-a.cntdevuelt),\xa IF(MONTH(a.fechadoc)=9,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=10,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=11,SUM(a.cantidad-a.cntdevuelt),IF(MONTH(a.fechadoc)=12,SUM(a.cantidad-a.cntdevuelt),0)))))))))))),0) unidades
FROM opermv a\xa WHERE a.fechadoc>='{$desde}' && a.fechadoc<='{$hasta}' && (a.tipodoc='FAC' || a.tipodoc='NOT') && SUBSTR(a.codigo,1,3)!='N/A' \xa GROUP BY MONTH(a.fechadoc),SUBSTR(a.codigo,1,3)) ventagrupo GROUP BY mes ORDER BY n")->result(); } if ($tip == 2) { $html = $this->db->query("SELECT vendedor,nombre,cant,dev,unid FROM (SELECT b.vendedor,c.nombre,ROUND(SUM(a.cantidad),2) cant,ROUND(SUM(a.cntdevuelt),2) dev,
ROUND(SUM(a.cantidad)-SUM(a.cntdevuelt),0) unid\xa FROM opermv a \xa JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc)\xa JOIN listvend c ON c.codigo=b.vendedor
WHERE a.fechadoc>='{$desde}' && a.fechadoc<='{$hasta}' && (a.tipodoc='FAC' || a.tipodoc='NOT')
GROUP BY b.vendedor ) vendedores ORDER BY unid DESC")->result(); } if ($tip == 3) { $bd = $this->db->query("SELECT null dias,CONCAT('<b>Total</b> ',ROUND(dolar,2)) dolar,CONCAT('<b>Total</b> ',ROUND(pagado,2))pagado,CONCAT('<b>Total</b> ',ROUND(NC,2))NC,CONCAT('<b>Total</b> ',
ROUND(RET,2))RET,CONCAT('<b>Total</b> ',ROUND(dolar-(pagado+nc+ret),2))debe,CONCAT('<b>Total</b> ',ROUND(((pagado+nc+ret)*100)/dolar,2)) cumplido FROM \xa (SELECT SUM(totald) dolar, (SELECT SUM(montod) FROM opercli WHERE idconsbanc IS NOT NULL) pagado,
IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc),0) NC,\xa IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE tipodoc='RET')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE tipodoc='RET'),0) RET
FROM operti a WHERE tipodoc='FAC' || tipodoc='NOT' && totald>0 && estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000') ) total
UNION\xa SELECT dias, ROUND(SUM(dolar),2) dolar, ROUND(SUM(pagado),2) pagado,ROUND(SUM(NC),2) NC,ROUND(SUM(RET),2) RET, ROUND(SUM(dolar)-(SUM(pagado)+SUM(NC)+SUM(RET)),2) debe,ROUND(((SUM(pagado)+SUM(NC)+SUM(RET))*100)/SUM(dolar),2) cumplido FROM
(SELECT DATEDIFF(DATE_ADD(a.recepcion,INTERVAL a.diascred DAY),CURDATE()) dias, SUM(a.totald) dolar,\xa (SELECT SUM(montod) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL) pagado,\xa IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,\xa IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET\xa FROM operti a WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.totald>0 && a.estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')\xa GROUP BY a.documento) cobranzadia GROUP BY dias ")->result(); $html .= "<table class="w3-table-all w3-hoverable"><tr class="w3-fondodroid w3-fijo"><th>Vence</th><th>Dolar</th><th>Pagado</th><th>NC</th><th>RET</th><th>Debe</th><th>Cumplido</th></tr>"; $i = 0; foreach ($bd as $db) { $i++; if ($db->cumplido <= 50) { $color = "w3-red"; } elseif ($db->cumplido <= 70) { $color = "w3-pale-green"; } elseif ($db->cumplido > 70) { $color = "w3-green"; } $html .= "
<input type="hidden" name="dias" value="" . $db->dias . "">
<tr onclick="infodeudas(" . $i . ",1);"><td>" . $db->dias . "</td><td>" . $db->dolar . "</td><td>" . $db->pagado . "</td><td>" . $db->NC . "</td><td>" . $db->RET . "</td><td>" . $db->debe . "</td><td class="" . $color . "">" . $db->cumplido . " %</td></tr>"; } $html .= "</table>
<script type="text/javascript">
function infodeudas(a,b){\xa let i=parseInt(a)-1;\xa var dias=document.getElementsByName("dias")[i].value;
var data={dias:dias,tip:b};
$.post(baseurl+"c_droid/infodeudas",data,function(r){ $("#viewdetalles").show(); $("#detalles").html(r); });\xa }\xa </script>\xa "; } if ($tip == 4) { $bd = $this->db->query("SELECT null zona, CONCAT('<b>Total</b> ',ROUND(dolar,2)) dolar,CONCAT('<b>Total</b> ',ROUND(pagado,2))pagado,CONCAT('<b>Total</b> ',ROUND(NC,2))NC,CONCAT('<b>Total</b> ',
ROUND(RET,2))RET,CONCAT('<b>Total</b> ',ROUND(dolar-(pagado+NC+RET),2))debe,CONCAT('<b>Total</b> ',ROUND(((pagado+nc+ret)*100)/dolar,2)) cumplido FROM
(SELECT SUM(totald) dolar, (SELECT SUM(montod) FROM opercli WHERE idconsbanc IS NOT NULL) pagado,
IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc),0) NC,
IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE tipodoc='RET')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE tipodoc='RET'),0) RET
FROM operti a WHERE tipodoc='FAC' || tipodoc='NOT' && totald>0 && estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')) total\xa UNION\xa SELECT zona, ROUND(SUM(dolar),2) dolar, ROUND(SUM(pagado),2) pagado,ROUND(SUM(NC),2) NC,ROUND(SUM(RET),2) RET, ROUND(SUM(dolar)-(SUM(pagado)+SUM(NC)+SUM(RET)),2) debe,ROUND(((SUM(pagado)+SUM(NC)+SUM(RET))*100)/SUM(dolar),2) cumplido FROM
(SELECT CONCAT(a.sector,a.subcodigo) zona, SUM(a.totald) dolar,(SELECT SUM(montod) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL) pagado,
IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,
IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET\xa FROM operti a WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.totald>0 && a.estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')\xa GROUP BY a.documento) cobranzames GROUP BY zona")->result(); $html .= "<table class="w3-table-all w3-hoverable"><tr class="w3-fondodroid w3-fijo"><th>Zona</th><th>Dolar</th><th>Pagado</th><th>NC</th><th>RET</th><th>Debe</th><th>Cumplido</th></tr>"; $i = 0; foreach ($bd as $db) { $i++; if ($db->cumplido <= 50) { $color = "w3-red"; } elseif ($db->cumplido <= 70) { $color = "w3-pale-green"; } elseif ($db->cumplido > 70) { $color = "w3-green"; } $zona = $this->db->query("SELECT subsector n FROM subsectores WHERE CONCAT(codigo,subcodigo)='{$db->zona}'")->row(); $html .= "\xa <input type="hidden" name="dias" value="" . $db->zona . "">\xa <tr onclick="infodeudas(" . $i . ",2);"><td>" . $zona->n . "</td><td>" . $db->dolar . "</td><td>" . $db->pagado . "</td><td>" . $db->NC . "</td><td>" . $db->RET . "</td><td>" . $db->debe . "</td><td class="" . $color . "">" . $db->cumplido . " %</td></tr>"; } $html .= "</table>
<script type="text/javascript">
function infodeudas(a,b){\xa let i=parseInt(a)-1;
var dias=document.getElementsByName("dias")[i].value;
var data={dias:dias,tip:b};\xa $.post(baseurl+"c_droid/infodeudas",data,function(r){ $("#viewdetalles").show(); $("#detalles").html(r); });\xa }
</script>
"; } if ($tip == 5) { $html = $this->db->query("SELECT CONCAT(codcliente,' ',nombrecli) nombre,cant,dev,cant-dev unid FROM (SELECT b.codcliente,b.nombrecli,ROUND(SUM(a.cantidad),2) cant,ROUND(SUM(a.cntdevuelt),2) dev\xa FROM opermv a
JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc)\xa WHERE a.fechadoc>='{$desde}' && a.fechadoc<='{$hasta}' && (a.tipodoc='FAC' || a.tipodoc='NOT')\xa GROUP BY b.codcliente ORDER BY (SUM(a.cantidad)-SUM(a.cntdevuelt)) DESC LIMIT 30) clientes ORDER BY unid DESC")->result(); } if ($tip == 6) { $html = $this->db->query("SELECT CONCAT(codigo,' ',nombre) nombre,cant,dev,cant-dev unid FROM (SELECT a.codigo,a.nombre,ROUND(SUM(a.cantidad),2) cant,ROUND(SUM(a.cntdevuelt),2) dev\xa FROM opermv a
WHERE a.fechadoc>='{$desde}' && a.fechadoc<='{$hasta}' && (a.tipodoc='FAC' || a.tipodoc='NOT')\xa GROUP BY a.codigo ORDER BY (SUM(a.cantidad)-SUM(a.cntdevuelt)) DESC LIMIT 30) clientes ORDER BY unid DESC")->result(); } if ($tip == 7) { $html = $this->db->query("SELECT zona nombre,cant,dev,cant-dev unid FROM (SELECT (SELECT subsector FROM subsectores WHERE codigo=b.sector && subcodigo=b.subcodigo) zona,ROUND(SUM(a.cantidad),2) cant,ROUND(SUM(a.cntdevuelt),2) dev\xa FROM opermv a JOIN operti b ON (a.documento=b.documento && a.tipodoc=b.tipodoc)\xa WHERE a.fechadoc>='{$desde}' && a.fechadoc<='{$hasta}' && (a.tipodoc='FAC' || a.tipodoc='NOT')
GROUP BY b.sector,b.subcodigo ORDER BY (SUM(a.cantidad)-SUM(a.cntdevuelt)) DESC LIMIT 30) zona ORDER BY unid DESC")->result(); } if ($tip == 8) { $bd = $this->db->query("SELECT null mes, CONCAT('<b>Total</b> ',ROUND(dolar,2)) dolar,CONCAT('<b>Total</b> ',ROUND(pagado,2))pagado,CONCAT('<b>Total</b> ',ROUND(NC,2))NC,CONCAT('<b>Total</b> ',
ROUND(RET,2))RET,CONCAT('<b>Total</b> ',ROUND(dolar-(pagado+nc+ret),2))debe,CONCAT('<b>Total</b> ',ROUND(((pagado+nc+ret)*100)/dolar,2)) cumplido FROM
(SELECT SUM(totald) dolar, (SELECT SUM(montod) FROM opercli WHERE idconsbanc IS NOT NULL) pagado,\xa IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc),0) NC,\xa IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE tipodoc='RET')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE tipodoc='RET'),0) RET\xa FROM operti a WHERE tipodoc='FAC' || tipodoc='NOT' && totald>0 && estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000') ) total
UNION
SELECT mes, ROUND(SUM(dolar),2) dolar, ROUND(SUM(pagado),2) pagado,ROUND(SUM(NC),2) NC,ROUND(SUM(RET),2) RET, ROUND(SUM(dolar)-(SUM(pagado)+SUM(NC)+SUM(RET)),2) debe,ROUND(((SUM(pagado)+SUM(NC)+SUM(RET))*100)/SUM(dolar),2) cumplido FROM
(SELECT CONCAT(MONTH(fechacrea),'-',YEAR(fechacrea)) mes, SUM(a.totald) dolar,
(SELECT SUM(montod) FROM opercli WHERE idfac=a.documento && idconsbanc IS NOT NULL) pagado,\xa IF((SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento)>0,(SELECT ROUND(SUM(totald),2) totald FROM aplicanc WHERE fac=a.documento),0) NC,\xa IF((SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET' && antdoc!='')>0,(SELECT ROUND(SUM(totalfinal/(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1)),2) totald FROM operti WHERE antdoc=a.antdoc && tipodoc='RET'),0) RET\xa FROM operti a WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && a.totald>0 && a.estatusdoc!='X' && (SUBSTR(a.codcliente,1,3)!='INT' && a.codcliente!='MF0000')\xa GROUP BY a.documento) cobranzames GROUP BY mes")->result(); $html .= "<table class="w3-table-all w3-hoverable"><tr class="w3-fondodroid w3-fijo"><th>Mes-A\303\xb1o</th><th>Dolar</th><th>Pagado</th><th>NC</th><th>RET</th><th>Debe</th><th>Cumplido</th></tr>"; $i = 0; foreach ($bd as $db) { $i++; if ($db->cumplido <= 50) { $color = "w3-red"; } elseif ($db->cumplido <= 70) { $color = "w3-pale-green"; } elseif ($db->cumplido > 70) { $color = "w3-green"; } $html .= "
<input type="hidden" name="dias" value="" . $db->mes . "">
<tr onclick="infodeudas(" . $i . ",3);"><td>" . $db->mes . "</td><td>" . $db->dolar . "</td><td>" . $db->pagado . "</td><td>" . $db->NC . "</td><td>" . $db->RET . "</td><td>" . $db->debe . "</td><td class="" . $color . "">" . $db->cumplido . " %</td></tr>"; } $html .= "</table>\xa <script type="text/javascript">\xa function infodeudas(a,b){
let i=parseInt(a)-1;\xa var dias=document.getElementsByName("dias")[i].value;\xa var data={dias:dias,tip:b};\xa $.post(baseurl+"c_droid/infodeudas",data,function(r){ $("#viewdetalles").show(); $("#detalles").html(r); });
}
</script>\xa "; } return $html; } function infodeudas($cod, $tip) { if ($tip == 1) { $sql = $this->db->query("SELECT zona,vendedor,documento,fechacrea,recepcion,vence,codcliente,nombrecli,totald,ROUND(pagado+nc+(ret/tasa),2) pagado,IF((totald-0.5)>IF(pagado+nc+(ret/tasa)>0,pagado+nc+(ret/tasa),0),'<b class="w3-red">MAL</b>','<b class="w3-green">BIEN</b>') status FROM\xa (SELECT (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo) zona,(SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,a.documento,\xa a.fechacrea,a.recepcion,DATE_ADD(a.recepcion,INTERVAL a.diascred DAY) vence,a.codcliente,a.nombrecli,ROUND(a.totald,2) totald,\xa IF((SELECT SUM(montod) FROM opercli WHERE idfac=a.documento)>0,(SELECT SUM(montod) FROM opercli WHERE idfac=a.documento),0) pagado,\xa IF((SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento)>0,(SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento),0) nc,\xa IF((SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento))>0,(SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento)),0) ret,
(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasa
FROM operti a WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && datediff(DATE_ADD(a.recepcion,INTERVAL a.diascred DAY),CURDATE())='{$cod}' && a.totald>0 && a.estatusdoc!='X') deudasfac"); } if ($tip == 2) { $sql = $this->db->query("SELECT zona,vendedor,documento,fechacrea,recepcion,vence,codcliente,nombrecli,totald,ROUND(pagado+nc+(ret/tasa),2) pagado,IF((totald-0.5)>IF(pagado+nc+(ret/tasa)>0,pagado+nc+(ret/tasa),0),'<b class="w3-red">MAL</b>','<b class="w3-green">BIEN</b>') status FROM\xa (SELECT (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo) zona,(SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,a.documento,
a.fechacrea,a.recepcion,DATE_ADD(a.recepcion,INTERVAL a.diascred DAY) vence,a.codcliente,a.nombrecli,ROUND(a.totald,2) totald,\xa IF((SELECT SUM(montod) FROM opercli WHERE idfac=a.documento)>0,(SELECT SUM(montod) FROM opercli WHERE idfac=a.documento),0) pagado,
IF((SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento)>0,(SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento),0) nc,
IF((SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento))>0,(SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento)),0) ret,\xa (SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasa \xa FROM operti a WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && CONCAT(a.sector,a.subcodigo)='{$cod}' && a.totald>0 && a.estatusdoc!='X') deudasfac"); } if ($tip == 3) { $sql = $this->db->query("SELECT zona,vendedor,documento,fechacrea,recepcion,vence,codcliente,nombrecli,totald,ROUND(pagado+nc+(ret/tasa),2) pagado,IF((totald-0.5)>IF(pagado+nc+(ret/tasa)>0,pagado+nc+(ret/tasa),0),'<b class="w3-red">MAL</b>','<b class="w3-green">BIEN</b>') status FROM
(SELECT (SELECT subsector FROM subsectores WHERE codigo=a.sector && subcodigo=a.subcodigo) zona,(SELECT nombre FROM listvend WHERE codigo=a.vendedor LIMIT 1) vendedor,a.documento,
a.fechacrea,a.recepcion,DATE_ADD(a.recepcion,INTERVAL a.diascred DAY) vence,a.codcliente,a.nombrecli,ROUND(a.totald,2) totald,\xa IF((SELECT SUM(montod) FROM opercli WHERE idfac=a.documento)>0,(SELECT SUM(montod) FROM opercli WHERE idfac=a.documento),0) pagado,
IF((SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento)>0,(SELECT SUM(totald) FROM aplicanc WHERE fac=a.documento),0) nc,\xa IF((SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento))>0,(SELECT totalfinal FROM operti WHERE tipodoc='RET' && referencia=CONCAT(a.tipodoc,a.documento)),0) ret,
(SELECT oficial FROM monecam WHERE fecha<=a.fechacrea ORDER BY fecha DESC LIMIT 1) tasa
FROM operti a WHERE (a.tipodoc='FAC' || a.tipodoc='NOT') && CONCAT(MONTH(fechacrea),'-',YEAR(fechacrea))='{$cod}' && a.totald>0 && a.estatusdoc!='X') deudasfac"); } return $sql; } function stylepdf() { return "
<style>
/** Define now the real margins of every page in the PDF **/
body {\xa margin-top: 4cm;
margin-left: 1cm;
margin-right: 2cm;\xa margin-bottom: 2cm;
}\xa\xa/** Define the header rules **/\xaheader {
position: fixed;
top: 0cm;
left: 0cm;
right: 0cm;
height: 2cm;
/** Extra personal styles **/\xa background-color: #eaeaea;\xa color: black;\xa text-align: center;
line-height: 1.5cm;\xa}\xa\xa/** Define the footer rules **/
footer {
position: fixed;
bottom: 0cm;\xa left: 0cm;
right: 0cm;
height: 2cm;\xa
/** Extra personal styles **/
background-color: #eaeaea;
color: black;\xa text-align: center;
line-height: 1.5cm;
}\xafooter .pagenum:before {
content: counter(page);\xa}\xa</style>
"; } function catalogoalm() { $style = $this->stylepdf(); $bd = $this->db->query("SELECT a.rutafoto,a.codigo,a.nombre,a.marca,ROUND(a.preciofin1,2) preciobs, ROUND(a.preciofin1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) preciod,\xa ROUND(a.existencia-a.comprometido) exist FROM articulo a WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && SUBSTR(a.codigo,1,3)='ALM' && a.rutafoto!='' ORDER BY a.nombre ASC"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "<tr>"; } $table .= "<td><label class="w3-medium"><img src="images/" . $dt->rutafoto . "" alt="img_" . $dt->codigo . "" style="width:220px;height:220px"><br><b>" . $dt->codigo . "</b> <b>NOMBRE: </b> " . $dt->nombre . "
<b>MARCA: </b>" . $dt->marca . " <b>PRECIO Bs: </b>" . $dt->preciobs . " <b>PRECIO $: </b>" . $dt->preciod . " <b>EXIST: </b>" . $dt->exist . "</label></td>"; if ($i == 3) { $table .= "</tr>"; $i = 0; } } } $html = "
<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/w3.css">" . $style . "\xa </head><body>\xa <header><img src="images/cintillo.jpg" alt="Header" style="width:100%;"></header><br>\xa <table class="w3-table">
" . $table . "\xa </table>
<footer>
<div class="pagenum-container">Page <span class="pagenum"></span></div>
</footer>\xa <main>
<div>Main content goes here </div>
</main>
</body></html>"; return $html; } function catalogonovex() { $style = $this->stylepdf(); $bd = $this->db->query("SELECT a.rutafoto,a.codigo,a.nombre,a.marca,ROUND(a.preciofin1,2) preciobs, ROUND(a.preciofin1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) preciod,
ROUND(a.existencia-a.comprometido) exist FROM articulo a JOIN artiprov b ON a.codigo=b.codigo WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && b.proveedor IN (0088,0230) && a.rutafoto!='' GROUP BY a.codigo ORDER BY a.nombre ASC"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "<tr>"; } $table .= "<td><label class="w3-medium"><img src="images/" . $dt->rutafoto . "" alt="img_" . $dt->codigo . "" style="width:220px;height:220px"><br><b>" . $dt->codigo . "</b> <b>NOMBRE: </b> " . $dt->nombre . "\xa <b>MARCA: </b>" . $dt->marca . " <b>PRECIO Bs: </b>" . $dt->preciobs . " <b>PRECIO $: </b>" . $dt->preciod . " <b>EXIST: </b>" . $dt->exist . "</label></td>"; if ($i == 3) { $table .= "</tr>"; $i = 0; } } } $html = "\xa <html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">\xa <meta name="viewport" content="width=device-width, initial-scale=1.0">\xa <link rel="stylesheet" href="assets/css/w3.css">" . $style . "\xa </head><body>
<header><img src="images/cintillo.jpg" alt="Header" style="width:100%;"></header><br>\xa <table class="w3-table">
" . $table . "
</table>
<footer>\xa <div class="pagenum-container">Page <span class="pagenum"></span></div>
</footer>\xa <main>
<div>Main content goes here </div>\xa </main>\xa </body></html>"; return $html; } function catalogoins() { $style = $this->stylepdf(); $bd = $this->db->query("SELECT a.rutafoto,a.codigo,a.nombre,a.marca,ROUND(a.preciofin1,2) preciobs, ROUND(a.preciofin1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) preciod,\xa ROUND(a.existencia-a.comprometido) exist FROM articulo a WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && SUBSTR(a.codigo,1,3)='INS' && a.rutafoto!='' ORDER BY a.nombre ASC"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "<tr>"; } $table .= "<td><label class="w3-medium"><img src="images/" . $dt->rutafoto . "" alt="img_" . $dt->codigo . "" style="width:220px;height:220px"><br><b><b>" . $dt->codigo . "</b> NOMBRE: </b>" . $dt->nombre . "\xa <b>MARCA: </b>" . $dt->marca . " <b>PRECIO Bs: </b>" . $dt->preciobs . " <b>PRECIO $: </b>" . $dt->preciod . " <b>EXIST: </b>" . $dt->exist . "</label></td>"; if ($i == 3) { $table .= "</tr>"; $i = 0; } } } $html = "
<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/w3.css">" . $style . "
</head><body>
<header><img src="images/cintillo.jpg" alt="Header" style="width:100%;"></header><br>
<table class="w3-table">\xa " . $table . "\xa </table>
<footer>
<div class="pagenum-container">Page <span class="pagenum"></span></div>
</footer>
<main>\xa <div>Main content goes here </div>
</main>
</body></html>"; return $html; } function catalogomis() { $style = $this->stylepdf(); $bd = $this->db->query("SELECT a.rutafoto,a.codigo,a.nombre,a.marca,ROUND(a.preciofin1,2) preciobs, ROUND(a.preciofin1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) preciod,
ROUND(a.existencia-a.comprometido) exist FROM articulo a WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && SUBSTR(a.codigo,1,3)='MIS' && a.rutafoto!='' ORDER BY a.nombre ASC"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "<tr>"; } $table .= "<td><label class="w3-medium"><img src="images/" . $dt->rutafoto . "" alt="img_" . $dt->codigo . "" style="width:220px;height:220px"><br><b>" . $dt->codigo . "</b> <b>NOMBRE: </b>" . $dt->nombre . "\xa <b>MARCA: </b>" . $dt->marca . " <b>PRECIO Bs: </b>" . $dt->preciobs . " <b>PRECIO $: </b>" . $dt->preciod . " <b>EXIST: </b>" . $dt->exist . "</label></td>"; if ($i == 3) { $table .= "</tr>"; $i = 0; } } } $html = "
<html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">\xa <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/w3.css">" . $style . "
</head><body>\xa <header><img src="images/cintillo.jpg" alt="Header" style="width:100%;"></header><br>\xa <table class="w3-table">
" . $table . "
</table>\xa <footer>\xa <div class="pagenum-container">Page <span class="pagenum"></span></div>\xa </footer>\xa <main>
<div>Main content goes here </div>\xa </main>
</body></html>"; return $html; } function catalogobebes() { $style = $this->stylepdf(); $bd = $this->db->query("SELECT a.rutafoto,a.codigo,a.nombre,a.marca,ROUND(a.preciofin1,2) preciobs, ROUND(a.preciofin1/(SELECT oficial FROM monecam ORDER BY fecha DESC LIMIT 1),2) preciod,
ROUND(a.existencia-a.comprometido) exist FROM articulo a WHERE (a.existencia-a.comprometido)>0 && a.para_web='1' && SUBSTR(a.codigo,1,3)='MIS' && a.marca REGEXP 'PHARSANA|ICEBERG|BEBELLE|SOMA|CHICCO|GENIAL' && a.rutafoto!='' \xa && a.codigo NOT IN ('MIS0015','MIS0040','MIS0028','MIS0624','MIS0317','MIS0014','MIS0015','MIS0088','MIS0090','MIS0249','MIS0328','MIS0743','MIS0223','MIS0095') ORDER BY a.nombre ASC"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "<tr>"; } $table .= "<td><label class="w3-medium"><img src="images/" . $dt->rutafoto . "" alt="img_" . $dt->codigo . "" style="width:220px;height:220px"><br><b>" . $dt->codigo . "</b> <b>NOMBRE: </b>" . $dt->nombre . "\xa <b>MARCA: </b>" . $dt->marca . " <b>PRECIO Bs: </b>" . $dt->preciobs . " <b>PRECIO $: </b>" . $dt->preciod . " <b>EXIST: </b>" . $dt->exist . "</label></td>"; if ($i == 3) { $table .= "</tr>"; $i = 0; } } } $html = "\xa <html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">\xa <meta name="viewport" content="width=device-width, initial-scale=1.0">\xa <link rel="stylesheet" href="assets/css/w3.css">" . $style . "
</head><body>
<header><img src="images/cintillo.jpg" alt="Header" style="width:100%;"></header><br>
<table class="w3-table">
" . $table . "
</table>\xa <footer>\xa <div class="pagenum-container">Page <span class="pagenum"></span></div>\xa </footer>
<main>
<div>Main content goes here </div>\xa </main>\xa </body></html>"; return $html; } public function farmapatria($a, $b) { $this->load->library("table"); if ($b != '') { $filter = "&& drogueria LIKE '%{$b}%' || razon like '%{$b}%'"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("SELECT * FROM farmapatria WHERE emision>=DATE_SUB(curdate(),INTERVAL 3 MONTH) {$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("SELECT * FROM farmapatria WHERE emision>=DATE_SUB(curdate(),INTERVAL 3 MONTH) {$filter} ORDER BY guia desc LIMIT " . ($a - 1) * $mostrar . " , " . $mostrar . ";")->result(); $html = "\xa <table class="w3-table-all w3-hoverable w3-left-align">\xa <tr><td class="w3-fondodroid">Buscar <img src="" . base_url() . "images/buscar.png" alt="Buscar" title="Buscar" style="width:18px;border:0;"></td>\xa <td><input type="text" class="w3-input" placeholder="Ingrese su busqueda" onchange="farmapatria()" id="like"></td>\xa <td class="w3-center w3-btn"><a onclick="exportexcelfarma();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List" style="width:20px;height:20px;border:0;"></a></td>
<td class="w3-center w3-btn"><a onclick="exportexceltopfarmacli();"><img src="" . base_url() . "images/xls.png" alt="Export List" title="Export List Top Clientes" style="width:20px;height:20px;border:0;"></a></td>\xa <td class="w3-center w3-btn"><a onclick="farmapatria();"><img src="" . base_url() . "images/reload.png" alt="Recargar" title="Recargar" style="width:20px;height:20px;border:0;"></a></td></tr>\xa </table><br>\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid w3-fijo">\xa <th>Guia</th><th>Estatus</th><th>Emision</th><th>Vence</th><th>FAC</th><th>SICM</th><th>Drogueria</th><th>Cliente</th><th>Rif</th><th>Direccion</th><th>Estado</th><th>Telefono</th><th>Contac</th><th>Email</th><th>Bultos</th><th>Renglon</th><th>unidades</th>
</tr>"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr id="slect" . $i . "" class="item" onclick="itfarma($('#a" . $i . "').val());">"; $html .= "<input type="hidden" id="a" . $i . ""value="" . $dtfac->guia . "">\xa <td>" . $dtfac->guia . "</td><td>" . $dtfac->status . "</td><td>" . $dtfac->emision . "</td><td>" . $dtfac->vence . "</td><td>" . $dtfac->fac . "</td><td>" . $dtfac->sicm . "</td><td>" . $dtfac->drogueria . "</td>\xa <td>" . $dtfac->razon . "</td><td>" . $dtfac->rif . "</td><td>" . $dtfac->dirr . "</td><td>" . $dtfac->estado . "</td><td>" . $dtfac->telf . "</td><td>" . $dtfac->contac . "</td><td>" . $dtfac->email . "</td>\xa <td>" . $dtfac->bultos . "</td><td>" . $dtfac->renglon . "</td><td>" . $dtfac->unid . "</td>
</tr>"; } $html .= "<tr><td class="w3-center w3-fondodroid" colspan="13"><label class="w3-large"><b>Total de Guias: " . $totalreg . "</b></label></td></tr></table>"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "
<script type="text/javascript">
function DecrementNum(){ before();\xa var DecrementNum=document.getElementById("DecrementNum").value;\xa var key="droid903"; var like=$("#like").val();
var datos = {\xa "pag" : DecrementNum,
"key" : key,like:like
};
$.ajax({
data: datos,
url: baseurl+"c_droid/farmapatria",\xa type: "POST",
success: function(data) {
$("#body").html(data); $("#like").val(like); swal.close()
}
});\xa }\xa \xa function numpag(a){ before();\xa var key="droid903";
var like=$("#like").val();\xa var datos = {
"key":key,
"pag" : a,like:like
};\xa \xa $.ajax({
data: datos,\xa url: baseurl+"c_droid/farmapatria",\xa type: "POST",\xa success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}\xa \xa });
}
function IncrimentNum(){ before();
var IncrimentNum=document.getElementById("IncrimentNum").value;\xa var key="droid903"; var like=$("#like").val();\xa var datos = {\xa "key":key,\xa "pag" : IncrimentNum,like:like\xa };
$.ajax({\xa data: datos,\xa url: baseurl+"c_droid/farmapatria",\xa type: "POST",
success: function(data) {\xa $("#body").html(data); $("#like").val(like); swal.close()
}\xa \xa });\xa }
</script>
<div class="w3-bar w3-border w3-barras">\xa <input type="hidden" id="DecrementNum" value="" . $DecrementNum . "">\xa <a onclick="DecrementNum();" class="w3-bar-item w3-button">«</a>"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "idpagina" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "w3-fondodroid"; $html .= "\xa <input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } else { $hover = ''; $html .= "<input type="hidden" id="" . $id . "" value="" . $i . "">
<a onclick="numpag($('#" . $id . "').val());" class="w3-bar-item w3-button " . $hover . "">" . $i . "</a>"; } } } $html .= "<input type="hidden" id="IncrimentNum" value="" . $IncrimentNum . "">
<a onclick="IncrimentNum();" class="w3-bar-item w3-button">»</a>\xa
</div> "; return $html; } public function itfarma($a) { $this->load->library("table"); $bdfac = $this->db->query("SELECT item FROM itfarma WHERE guia='{$a}'")->result(); $html = "\xa <table id="id01" class="w3-table-all w3-hoverable w3-left-align w3-tiny"><tr class="w3-fondodroid">
<th>Item</th>\xa </tr>"; $i = 0; $tot = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "<tr>"; $html .= "<td>" . $dtfac->item . "<td>
</tr>"; } return $html; } function idfarma() { $bd = $this->db->query("SELECT MAX(guia) n FROM farmapatria")->row(); return $bd->n; } function regdatafarma($guia, $status, $emision, $vence, $fac, $sicm, $razon, $rif, $dirr, $estado, $telf, $contac, $email, $bultos, $renglon, $unid, $item, $drog) { $farma = array("guia" => $guia, "status" => $status, "emision" => DateTime::createFromFormat("d-m-Y H:i", $emision)->format("Y-m-d H:i:s"), "vence" => DateTime::createFromFormat("d-m-Y", $vence)->format("Y-m-d"), "fac" => $fac, "sicm" => $sicm, "razon" => $razon, "rif" => $rif, "dirr" => $dirr, "estado" => $estado, "telf" => $telf, "contact" => $contac, "email" => $email, "bultos" => $bultos, "renglon" => $renglon, "unid" => $unid, "drogueria" => $drog); $itfarma = array("guia" => $guia, "item" => $item); $this->db->insert("farmapatria", $farma); if ($this->db->affected_rows() > 0) { $this->db->insert("itfarma", $itfarma); return $this->db->affected_rows(); } } function exportexcelfarma($desde, $hasta) { return $this->db->query("SELECT a.guia,a.status,a.emision,a.vence,a.fac,a.sicm,a.drogueria,a.razon,a.rif,a.dirr,a.estado,a.telf,a.contact,a.email,a.bultos,a.renglon,a.unid
FROM farmapatria a /*JOIN itfarma b ON a.guia=b.guia*/ WHERE a.emision>='{$desde}' && a.emision<='{$hasta}' ORDER BY a.emision desc"); } function exportexcellibroventas($desde, $hasta) { return $this->db->query("SELECT date_format(fecha, '%d-%m-%Y') fecha,documento,tipodoc,ncontrol,nombre,tipocont,rif,total,baseimponible,alicuota,iva,excento,retiene,baseimponible_IGTF,'' IGTF_2, IGTF FROM
(SELECT null documento,null tipodoc,null ncontrol,null tipocont,null rif,ROUND(SUM(IF(tipodoc='N/C',a.totalfinal*-1,a.totalfinal)),2) total,ROUND(SUM(IF(tipodoc='N/C',a.baseimpo1*-1,IF(a.documentofiscal='IGTF',0,a.baseimpo1))),2) baseimponible,null alicuota,ROUND(SUM(IF(tipodoc='N/C',a.totimpuest*-1,a.totimpuest)),2) IVA, ROUND(SUM(IF(tipodoc='N/C',a.sinimpuest*-1,a.sinimpuest)),2) excento,\xa ROUND((SELECT SUM(a1.totalfinal) FROM operti a1 WHERE a1.tipodoc='RET' && a1.fechayhora>='{$desde}' && a1.fechayhora<='{$hasta}'),2) retiene, \xa ROUND((SELECT SUM((a1.totalfinal*100)/3) FROM operti a1 WHERE a1.tipodoc='N/D' && a1.documentofiscal='IGTF' && a1.fechayhora>='{$desde}' && a1.fechayhora<='{$hasta}'),2) baseimponible_IGTF,
\x9ROUND((SELECT SUM(a1.totalfinal) FROM operti a1 WHERE a1.tipodoc='N/D' && a1.documentofiscal='IGTF' && a1.fechayhora>='{$desde}' && a1.fechayhora<='{$hasta}'),2) IGTF,NOW() fechayhora, null nombre,'Total' fecha
FROM operti a WHERE tipodoc IN ('FAC','N/C','N/D')
&& a.fechacrea>='{$desde}' && a.fechacrea<='{$hasta}'
UNION\xa SELECT documento,IF(tipodoc='FAC','FACTURA',IF(tipodoc='N/C','NOTA DE CREDITO',IF(tipodoc='N/D','NOTA DE DEBITO',IF(tipodoc='RET','RETENCION','N/A')))) tipodoc,a.orden ncontrol,'CONTRIBUYENTE' tipocont,\xa a.rif,IF(a.tipodoc!='RET' && a.documentofiscal!='IGTF',ROUND(a.totalfinal,2),0.00) total,IF(a.documentofiscal='IGTF',0,ROUND(a.baseimpo1,2)) baseimponible,IF(a.totimpuest>0,'16.00','0.00') alicuota,ROUND(a.totimpuest,2) IVA,ROUND(a.sinimpuest,2) excento,\xa IF(a.tipodoc='RET',ROUND(a.totalfinal,2),0.00) retiene,IF(a.documentofiscal='IGTF',ROUND((a.totalfinal*100)/3,2),0) baseimponible_IGTF,IF(a.documentofiscal='IGTF',ROUND(a.totalfinal,2),0.00) IGTF,a.fechayhora,
a.nombrecli nombre,a.fechacrea fecha
FROM operti a WHERE tipodoc IN ('FAC','N/C','N/D','RET')
&& a.fechacrea>='{$desde}' && a.fechacrea<='{$hasta}'
) libroventas ORDER BY ncontrol ASC\xa "); } function exportexcellibrocomp($desde, $hasta) { return $this->db->query("SELECT date_format(fecha, '%d-%m-%Y') fecha, tipodoc,rif,nombre,factura,n_control,nota_debito,nota_credito,factura_afectada,ROUND(total,2)total,ROUND(excento,2)excento,ROUND(base_imponible,2) base_imponible, alicuota, ROUND(iva,2) iva, ROUND(iva_retenido,2) iva_retenido, alicuota_retencion, comprobante_retencion,baseimponible_IGTF, '' pago_igtf2,pago_igtf FROM (\xa SELECT IF(a.tipodoc!='RET',a.fechadoc,a.fecharet) fecha, IF(a.tipodoc='FAC','FACTURA',IF(a.tipodoc='N/D','NOTA DE DEBITO',IF(a.tipodoc='N/C','NOTA DE CREDITO',IF(a.tipodoc='RET','RETENCION','')))) tipodoc, (SELECT rif FROM proveed WHERE id=a.proveed) rif,(SELECT nombre FROM proveed WHERE id=a.proveed) nombre,
IF(a.tipodoc='FAC',a.documento,'') factura, IF(a.tipodoc!='RET',a.ncontrol,'') n_control, IF(a.tipodoc='N/D',a.documento,'') nota_debito, IF(a.tipodoc='N/C',a.documento,'') nota_credito,IF(a.tipodoc='N/D' || a.tipodoc='N/C',a.referencia,IF(a.tipodoc='RET',a.documento,'')) factura_afectada,
IF(a.tipodoc!='RET',a.total,'') total,IF(a.tipodoc!='RET',a.sinimpuest,'') excento,IF(a.tipodoc!='RET',a.baseimpo,'') base_imponible,'16%' alicuota, IF(a.tipodoc!='RET',a.totimpuest,'') iva,
IF(a.tipodoc='RET',a.retiene,'') iva_retenido, IF(a.tipodoc='RET',(SELECT retiene FROM proveed WHERE id=a.proveed),'') alicuota_retencion, IF(a.tipodoc='RET',a.nret,'') comprobante_retencion, '' baseimponible_IGTF, '' pago_igtf \xa FROM compras a WHERE a.fechayhora>='{$desde} 00:00:00' && a.fechayhora<='{$hasta} 23:59:00' ORDER BY a.fechayhora ASC\xa ) librocompras"); } function exportexcellibroinv($desde, $hasta) { return $this->db->query("SELECT codigo,nombre,exist_inicial,costo costo1,exist_inicial*costo costo_total1,entrada,costo costo2,entrada*costo costo_total2,salida,costo costo3,salida*costo costo_total3,autoconsumo,costo costo4,autoconsumo*costo costo_total4, exist_inicial+entrada-autoconsumo-salida exist_final, costo costo5, (exist_inicial+entrada-autoconsumo-salida)*costo costo_total5 FROM (
SELECT codigo,CONCAT(nombre,' Almacen: ',almacen,' Lote: ',lote) nombre,costo,
IF(cargoini+cargoini2+ingresoini+devueltaini-egresoini-descargoini-descargoini2>0,cargoini+cargoini2+ingresoini+devueltaini-egresoini-descargoini-descargoini2,0) exist_inicial,\xa ingreso+cargo+cargo2+devuelta entrada, egreso salida,descargo+descargo2 autoconsumo FROM (\xa SELECT a.almacen,a.codigoart codigo,b.nombre,a.lote,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech<'{$desde}'),0) cargoini,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech<'{$desde}'),0) cargoini2,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech<'{$desde}'),0) descargoini,
IF((SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech<'{$desde}'),0) descargoini2,\xa IF((SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.frecep<'{$desde}')>0,(SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.frecep<'{$desde}'),0) ingresoini,\xa ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29' && fechadoc<'{$desde}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29' && fechadoc<'{$desde}'),0),0) egresoini,
ROUND(IF((SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29' && fechadoc<'{$desde}')>0,(SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29' && fechadoc<'{$desde}'),0),0) devueltaini,
IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>='{$desde}' && fech<='{$hasta}'),0) cargo,
IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}'),0) cargo2,
IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>='{$desde}' && fech<='{$hasta}'),0) descargo,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}'),0) descargo2,
IF((SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>='{$desde}' && b1.frecep<='{$hasta}')>0,(SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>='{$desde}' && b1.frecep<='{$hasta}'),0) ingreso,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) egreso,\xa ROUND(IF((SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) devuelta,\xa ROUND((SELECT (SUM(costobs)/COUNT(*)) FROM artiprec WHERE codigo=a.codigoart),2) costo
FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo WHERE a.almacen=02 GROUP BY a.almacen,a.codigoart,a.lote\xa UNION
SELECT a.almacen,a.codigoart codigo,b.nombre,a.lote,\xa 0 cargoini,0 cargoini2,0 descargoini,0 descargoini2,0 ingresoini,0 egresoini,0 devueltaini,0 cargo,0 cargo2,0 descargo,0 descargo2,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) ingreso,\xa ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) egreso,0 devuelta,
ROUND((SELECT (SUM(costobs)/COUNT(*)) FROM artiprec WHERE codigo=a.codigoart),2) costo
FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo WHERE a.almacen=07 GROUP BY a.almacen,a.codigoart,a.lote
) kardex \xa ) total WHERE (exist_inicial+entrada-autoconsumo-salida)>=0 having exist_inicial>0 || entrada>0 || salida>0 || autoconsumo>0 || exist_final>0\xa UNION
SELECT null,null,SUM(exist_inicial)exist_inicial,null,SUM(exist_inicial*costo) costo_total1,SUM(entrada) entrada,null,SUM(entrada*costo) costo_total2,SUM(salida) salida,null,SUM(salida*costo) costo_total3,SUM(autoconsumo) autoconsumo,null,SUM(autoconsumo*costo) costo_total4, SUM(exist_inicial+entrada-autoconsumo-salida) exist_final, null, SUM((exist_inicial+entrada-autoconsumo-salida)*costo) costo_total5 FROM (
SELECT codigo,CONCAT(nombre,' Almacen: ',almacen,' Lote: ',lote) nombre,costo,
IF(cargoini+cargoini2+ingresoini+devueltaini-egresoini-descargoini-descargoini2>0,cargoini+cargoini2+ingresoini+devueltaini-egresoini-descargoini-descargoini2,0) exist_inicial,\xa ingreso+cargo+cargo2+devuelta entrada, egreso salida,descargo+descargo2 autoconsumo FROM (\xa SELECT a.almacen,a.codigoart codigo,b.nombre,a.lote,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech<'{$desde}'),0) cargoini,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech<'{$desde}'),0) cargoini2,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech<'{$desde}'),0) descargoini,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech<'{$desde}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech<'{$desde}'),0) descargoini2,
IF((SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.frecep<'{$desde}')>0,(SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>'2023-12-29' && b1.frecep<'{$desde}'),0) ingresoini,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29' && fechadoc<'{$desde}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>'2023-12-29' && fechadoc<'{$desde}'),0),0) egresoini,\xa ROUND(IF((SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29' && fechadoc<'{$desde}')>0,(SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>'2023-12-29' && fechadoc<'{$desde}'),0),0) devueltaini,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=1 && fech>='{$desde}' && fech<='{$hasta}'),0) cargo,\xa IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}'),0) cargo2,
IF((SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE dalm=a.almacen && codigo=a.codigoart && dlote=a.lote && tipo=0 && fech>='{$desde}' && fech<='{$hasta}'),0) descargo,
IF((SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}')>0,(SELECT SUM(cant) FROM ajusteinv WHERE alm=a.almacen && codigo=a.codigoart && lote=a.lote && tipo=3 && fech>='{$desde}' && fech<='{$hasta}'),0) descargo2,
IF((SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>='{$desde}' && b1.frecep<='{$hasta}')>0,(SELECT SUM(cant) FROM itordc a1 JOIN ordc b1 ON a1.ordc=b1.id WHERE b1.almacen=a.almacen && a1.codigo=a.codigoart && lote=a.lote && b1.frecep>='{$desde}' && b1.frecep<='{$hasta}'),0) ingreso,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) egreso,
ROUND(IF((SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cntdevuelt) FROM devolmv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && tipodoc='DEV' && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) devuelta,
ROUND((SELECT (SUM(costobs)/COUNT(*)) FROM artiprec WHERE codigo=a.codigoart),2) costo
FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo WHERE a.almacen=02 GROUP BY a.almacen,a.codigoart,a.lote
UNION\xa SELECT a.almacen,a.codigoart codigo,b.nombre,a.lote,\xa 0 cargoini,0 cargoini2,0 descargoini,0 descargoini2,0 ingresoini,0 egresoini,0 devueltaini,0 cargo,0 cargo2,0 descargo,0 descargo2,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) ingreso,
ROUND(IF((SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}')>0,(SELECT SUM(cantidad) FROM opermv WHERE almacen=a.almacen && codigo=a.codigoart && lote=a.lote && (tipodoc='FAC' || tipodoc='NOT') && fechadoc>='{$desde}' && fechadoc<='{$hasta}'),0),0) egreso,0 devuelta,
ROUND((SELECT (SUM(costobs)/COUNT(*)) FROM artiprec WHERE codigo=a.codigoart),2) costo
FROM artilotes a JOIN articulo b ON a.codigoart=b.codigo WHERE a.almacen=07 GROUP BY a.almacen,a.codigoart,a.lote
) kardex
) total WHERE (exist_inicial+entrada-autoconsumo-salida)>=0 having exist_inicial>0 || entrada>0 || salida>0 || autoconsumo>0 || exist_final>0"); } function exportexcellibrobanc($desde, $hasta, $banc) { $this->db->query("SET @acumulador = (SELECT SUM(monto) FROM consbanc WHERE fech<'{$desde}' && banco='{$banc}');"); return $this->db->query("SELECT ref referencia, fech fecha, tipo, descrip, razon,ROUND(entrada,2)entrada,salida, @acumulador:=((entrada-salida)+@acumulador) saldo FROM (\xaSELECT a.ref,a.fech,'Cobro de factura' tipo,
GROUP_CONCAT(b.idfac) descrip, (SELECT CONCAT(codcliente,' ',nombrecli) FROM operti WHERE documento=b.idfac && (tipodoc='FAC' || tipodoc='NOT') LIMIT 1) razon,
if(a.monto>0,a.monto,0) entrada, if(a.monto<0,a.monto,0) salida
FROM consbanc a JOIN opercli b ON a.ref=b.ref WHERE a.banco='{$banc}' && a.fech>='{$desde}' && a.fech<='{$hasta}' GROUP BY a.ref
) librobanco ORDER BY fecha,referencia;"); } function exportexcelretenciones($desde, $hasta) { return $this->db->query("SELECT tipodoc,documento,referencia,codcliente,nombrecli, totalfinal monto FROM operti WHERE tipodoc='RET' && fechacrea>='{$desde}' && fechacrea<='{$hasta}'"); } function exportexcelretencionescomp($desde, $hasta) { return $this->db->query("SELECT 'J408342464' rifmedifar, CONCAT(year(fechadoc),month(fechadoc)) periodo_fiscal, fechadoc fecha_retencion,'C' compras,tiporet tipo, (SELECT rif FROM proveed WHERE id=a.proveed) rif,\xa a.documento factura,ncontrol n_control, total total_Factura, baseimpo base_imponible, retiene iva_retenido, referencia factura_afec, nret n_comprobante, sinimpuest excento,'16.00' alicuota, '0' expediente\xa FROM compras a WHERE tipodoc='RET' && fechadoc>='{$desde}' && fechadoc<='{$hasta}'"); } function exportexcelreportmovbanc() { return $this->db->query("SELECT fech,ref,descrip, monto, (SELECT nom FROM bandest WHERE id=a.banco) banco,a.`status` estatus,a.noblock desbloqueado \xa FROM consbanc a WHERE a.id NOT IN (SELECT idconsbanc FROM opercli) && a.fech>=20240101 ORDER BY fech DESC;"); } function exportexceltopfarmacli($desde, $hasta) { return $this->db->query("SELECT razon,estado,dirr,telf,contact,email,SUM(unid) unidades FROM farmapatria WHERE razon LIKE '%farmac%'\xa && emision>='{$desde}' && emision<='{$hasta}'
GROUP BY razon
ORDER BY unidades DESC"); } function sede() { $db = $this->db->query("SELECT control FROM sede")->row(); return $db->control; } function repara() { $bd = $this->db->query("SELECT codigo\xa FROM articulo
WHERE codigo NOT IN (SELECT codigoart FROM artilotes GROUP BY codigoart)
&& para_web=0")->result(); $i = 0; foreach ($bd as $dt) { $bd2 = $this->db->query("SELECT b.codigo,a.almacen,b.lote,b.elab,b.vence,SUM(b.cant) cant,a.frecep FROM ordc a JOIN itordc b ON a.id=b.ordc WHERE b.codigo='{$dt->codigo}'\xa GROUP BY b.codigo,a.almacen,b.lote")->result(); foreach ($bd2 as $dt2) { $lote = array("id_empresa" => "DMEDIF", "agencia" => "001", "almacen" => $dt2->almacen, "codigoart" => $dt2->codigo, "lote" => $dt2->lote, "elab" => $dt2->elab, "vence" => $dt2->vence, "cantidad" => $dt2->cant, "recepcion" => $dt2->frecep); $this->db->insert("artilotes", $lote); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } } ?>
Did this file decode correctly?
Original Code
<?php
class M_droid extends CI_Model { public function __construct() { parent::__construct(); $this->load->database(); } function lea_inv() { return $this->db->query("\x53\x45\114\x45\103\124\40\52\40\x46\x52\117\x4d\40\141\162\x74\x69\143\x75\x6c\x6f\x20\x57\110\105\x52\105\x20\x65\x78\151\163\x74\145\x6e\x63\x69\141\76\x30")->result_array(); } function env_inv($sede, $data) { if ($sede == 1) { $table = "\141\162\164\x69\x63\x75\154\x6f"; } else { $table = "\x61\162\x74\151\143\165\154\x6f\x32"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\123\105\x4c\x45\x43\x54\x20\x2a\40\106\122\x4f\115\40{$table}\40\127\x48\105\x52\105\x20\x63\x6f\x64\x69\147\157\75\47" . $db["\143\157\144\x69\147\157"] . "\x27"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\x6d\x61\162\143\x61"] != $art->marca || $db["\x72\145\146\x65\162\145\156\x63\x69\x61"] != $art->referencia || $db["\x65\170\151\x73\164\145\156\x63\151\x61"] != $art->existencia || $db["\x63\157\155\x70\162\157\155\x65\x74\151\144\x6f"] != $art->comprometido || $db["\160\x72\x65\x63\151\157\x31"] != $art->precio1 || $db["\160\162\x65\143\151\x6f\146\151\x6e\x31"] != $art->preciofin1 || $db["\x64\163\143\164\157\x5f\x6d\145\x64\151\x63\141\155\145\x6e\164\157\163"] != $art->dscto_medicamentos || $db["\x64\151\141\163\x69\156\144\145\x78"] != $art->diasindex || $db["\144\x69\x61\x73\x63\x72\145\144"] != $art->diascred) { $this->db->where("\143\x6f\144\151\147\157", $db["\x63\x6f\144\151\x67\157"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_inv2() { return $this->db->query("\x53\x45\x4c\105\x43\124\40\52\x20\106\x52\x4f\x4d\40\141\x72\x74\x69\x63\x75\x6c\x6f\x20\x57\x48\105\122\x45\40\145\x78\x69\x73\164\x65\156\x63\151\x61\x3d\60\x20\114\111\115\111\124\40\61\x2c\62\x36\x30\60")->result_array(); } function env_inv2($sede, $data) { if ($sede == 1) { $table = "\141\x72\x74\151\143\165\x6c\157"; } else { $table = "\x61\x72\x74\151\143\165\154\157\62"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\105\114\105\x43\124\x20\x2a\x20\x46\x52\x4f\x4d\40{$table}\40\127\x48\x45\122\105\x20\x63\x6f\x64\x69\x67\157\75\x27" . $db["\x63\x6f\144\x69\x67\x6f"] . "\x27"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\x6d\141\x72\x63\x61"] != $art->marca || $db["\162\x65\146\x65\162\x65\156\143\x69\x61"] != $art->referencia || $db["\x65\x78\151\163\x74\145\156\143\x69\x61"] != $art->existencia || $db["\143\x6f\x6d\160\x72\157\155\145\164\x69\144\157"] != $art->comprometido || $db["\x70\162\x65\143\151\x6f\61"] != $art->precio1 || $db["\160\162\x65\x63\x69\157\x66\x69\156\61"] != $art->preciofin1 || $db["\144\x73\x63\x74\157\137\x6d\x65\x64\151\x63\x61\x6d\x65\x6e\x74\157\x73"] != $art->dscto_medicamentos || $db["\x64\151\x61\x73\151\x6e\x64\x65\x78"] != $art->diasindex || $db["\144\x69\x61\x73\143\162\145\144"] != $art->diascred) { $this->db->where("\x63\157\144\x69\147\x6f", $db["\x63\157\144\151\x67\x6f"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_inv3() { return $this->db->query("\x53\x45\114\105\103\x54\40\x2a\x20\x46\122\x4f\115\x20\141\162\164\151\143\165\154\157\x20\x57\x48\105\x52\x45\40\145\x78\x69\163\164\x65\156\143\151\141\x3d\60\40\x4c\x49\115\x49\x54\40\x32\x36\60\61\x2c\62\66\60\60")->result_array(); } function env_inv3($sede, $data) { if ($sede == 1) { $table = "\x61\x72\164\x69\x63\165\154\x6f"; } else { $table = "\141\x72\x74\x69\143\165\x6c\157\x32"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\105\114\x45\x43\124\40\52\x20\106\122\x4f\115\x20{$table}\40\127\x48\x45\122\x45\x20\x63\157\x64\151\147\157\75\47" . $db["\x63\x6f\144\x69\147\157"] . "\x27"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\155\141\x72\x63\x61"] != $art->marca || $db["\x72\145\146\145\162\145\156\143\x69\x61"] != $art->referencia || $db["\145\170\151\163\x74\145\x6e\x63\151\x61"] != $art->existencia || $db["\x63\157\x6d\160\x72\x6f\x6d\145\x74\151\144\157"] != $art->comprometido || $db["\x70\x72\x65\x63\151\157\61"] != $art->precio1 || $db["\x70\x72\145\x63\151\x6f\146\151\x6e\61"] != $art->preciofin1 || $db["\144\163\x63\164\x6f\137\155\x65\x64\x69\143\141\x6d\145\x6e\x74\x6f\x73"] != $art->dscto_medicamentos || $db["\x64\151\141\163\x69\156\x64\x65\x78"] != $art->diasindex || $db["\144\x69\x61\x73\143\x72\x65\144"] != $art->diascred) { $this->db->where("\143\x6f\144\151\x67\157", $db["\x63\157\144\x69\147\157"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_inv4() { return $this->db->query("\123\x45\x4c\105\103\124\40\x2a\40\x46\x52\x4f\115\x20\x61\x72\164\151\143\165\x6c\x6f\x20\127\x48\x45\x52\105\x20\145\x78\151\x73\164\x65\x6e\x63\151\141\75\x30\x20\x4c\111\115\111\124\40\65\62\60\61\54\62\x36\60\x30")->result_array(); } function env_inv4($sede, $data) { if ($sede == 1) { $table = "\x61\162\x74\151\143\x75\x6c\x6f"; } else { $table = "\141\x72\164\151\x63\165\x6c\x6f\62"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\123\x45\x4c\x45\103\124\40\52\40\x46\122\117\x4d\40{$table}\x20\127\110\x45\122\x45\40\143\x6f\144\151\147\x6f\x3d\47" . $db["\x63\x6f\x64\x69\147\157"] . "\x27"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\x6d\141\x72\x63\141"] != $art->marca || $db["\x72\145\146\145\162\145\156\x63\x69\141"] != $art->referencia || $db["\x65\170\x69\x73\x74\x65\156\143\151\x61"] != $art->existencia || $db["\x63\x6f\155\160\162\157\x6d\x65\164\151\x64\x6f"] != $art->comprometido || $db["\160\162\x65\143\x69\157\61"] != $art->precio1 || $db["\160\x72\x65\143\151\x6f\146\151\156\x31"] != $art->preciofin1 || $db["\144\x73\143\x74\157\137\155\x65\144\151\143\x61\155\145\156\164\x6f\x73"] != $art->dscto_medicamentos || $db["\x64\151\141\x73\151\156\144\145\170"] != $art->diasindex || $db["\144\151\141\x73\143\162\145\x64"] != $art->diascred) { $this->db->where("\143\157\144\x69\147\x6f", $db["\143\157\x64\x69\x67\157"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc() { return $this->db->query("\x53\105\x4c\x45\x43\124\40\x2a\x20\x46\122\x4f\x4d\40\141\x72\x74\x69\x6c\x6f\x74\145\163\40\x4c\x49\x4d\x49\x54\40\61\54\x32\66\60\60")->result_array(); } function env_existenc($sede, $data) { if ($sede == 1) { $table = "\x61\162\164\151\154\157\x74\145\x73"; } else { $table = "\141\162\x74\x69\154\x6f\x74\145\x73\62"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\105\114\x45\103\124\40\52\x20\x46\x52\x4f\x4d\40{$table}\40\127\x48\x45\122\x45\40\x63\x6f\144\151\147\x6f\x61\162\164\75\47" . $db["\x63\x6f\x64\x69\147\157\141\162\x74"] . "\47\x20\46\x26\40\141\154\155\x61\x63\145\x6e\75\47" . $db["\x61\x6c\155\x61\x63\145\156"] . "\x27\40\46\46\x20\x6c\157\x74\145\75\x27" . $db["\x6c\x6f\164\145"] . "\47"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\x63\x6f\156\x73\x75\x6d\x69\144\157"] != $art->consumido || $db["\143\141\156\x74\x69\144\141\144"] != $art->cantidad) { $this->db->where("\143\157\144\x69\x67\157\x61\x72\x74\75\x27" . $db["\x63\157\x64\151\x67\157\141\x72\164"] . "\x27\40\46\46\x20\x61\x6c\155\x61\x63\145\156\75\x27" . $db["\141\154\x6d\x61\143\145\x6e"] . "\x27\40\x26\46\40\154\x6f\164\x65\75\47" . $db["\154\157\164\x65"] . "\47")->update($table, array("\143\141\156\164\x69\144\141\144" => $db["\143\141\x6e\164\151\x64\x61\144"], "\143\157\156\163\165\x6d\x69\x64\157" => $db["\x63\157\156\163\x75\155\151\144\157"], "\x75\x62\151\x63\141" => $db["\165\142\x69\143\141"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc2() { return $this->db->query("\123\105\x4c\x45\103\x54\40\x2a\x20\106\x52\117\x4d\40\x61\x72\x74\151\x6c\157\164\x65\x73\40\x4c\x49\x4d\111\x54\x20\62\x36\x30\61\x2c\x32\x36\60\60")->result_array(); } function env_existenc2($sede, $data) { if ($sede == 1) { $table = "\x61\162\164\151\x6c\157\164\145\x73"; } else { $table = "\141\x72\x74\151\154\x6f\164\x65\163\x32"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\x45\x4c\x45\103\x54\40\x2a\x20\106\x52\117\x4d\x20{$table}\x20\127\x48\x45\x52\x45\40\143\x6f\144\151\x67\157\141\x72\164\75\47" . $db["\143\x6f\144\151\147\157\141\162\164"] . "\47\40\46\x26\40\x61\154\x6d\141\143\145\x6e\75\47" . $db["\x61\x6c\x6d\141\x63\145\x6e"] . "\47\40\46\x26\40\x6c\x6f\x74\145\75\x27" . $db["\x6c\x6f\164\x65"] . "\x27"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\x63\157\156\x73\165\155\151\x64\x6f"] != $art->consumido || $db["\x63\141\156\164\151\144\x61\144"] != $art->cantidad) { $this->db->where("\x63\x6f\x64\x69\147\157\141\162\164\75\x27" . $db["\x63\x6f\x64\151\147\157\x61\x72\164"] . "\x27\x20\46\46\x20\x61\154\155\x61\143\x65\156\x3d\x27" . $db["\x61\154\155\141\x63\145\156"] . "\x27\40\46\46\40\154\157\164\x65\x3d\47" . $db["\x6c\157\x74\x65"] . "\x27")->update($table, array("\143\141\x6e\x74\151\144\141\144" => $db["\x63\x61\x6e\164\151\144\141\x64"], "\143\x6f\x6e\x73\165\x6d\151\144\x6f" => $db["\x63\x6f\x6e\163\x75\155\151\144\157"], "\165\x62\151\x63\x61" => $db["\x75\x62\x69\x63\x61"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc3() { return $this->db->query("\123\x45\x4c\x45\x43\124\x20\52\40\106\122\117\x4d\x20\x61\162\164\x69\x6c\x6f\x74\145\x73\x20\x4c\x49\x4d\111\x54\40\65\62\x30\x31\x2c\62\x36\x30\60")->result_array(); } function env_existenc3($sede, $data) { if ($sede == 1) { $table = "\x61\x72\x74\x69\154\157\164\x65\x73"; } else { $table = "\141\x72\164\151\x6c\x6f\x74\x65\x73\x32"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\105\x4c\x45\x43\124\x20\52\40\x46\122\x4f\x4d\40{$table}\x20\127\110\105\122\x45\x20\x63\x6f\x64\151\147\157\x61\x72\x74\75\x27" . $db["\x63\x6f\144\151\x67\x6f\141\x72\x74"] . "\x27\x20\46\46\40\141\x6c\155\141\x63\x65\156\x3d\x27" . $db["\141\x6c\155\x61\x63\145\156"] . "\x27\40\46\46\x20\154\157\x74\145\x3d\47" . $db["\154\x6f\x74\x65"] . "\47"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\143\x6f\156\163\165\x6d\x69\144\x6f"] != $art->consumido || $db["\143\141\x6e\164\x69\x64\141\x64"] != $art->cantidad) { $this->db->where("\143\157\x64\151\147\x6f\141\162\164\x3d\47" . $db["\143\157\144\x69\147\157\x61\162\164"] . "\47\x20\46\x26\40\x61\154\x6d\141\143\x65\x6e\75\x27" . $db["\141\x6c\x6d\141\143\x65\156"] . "\x27\40\x26\46\40\x6c\x6f\x74\x65\75\x27" . $db["\x6c\x6f\x74\145"] . "\x27")->update($table, array("\x63\x61\156\164\151\144\x61\144" => $db["\x63\141\x6e\164\x69\x64\141\x64"], "\143\157\156\163\x75\x6d\x69\144\x6f" => $db["\143\x6f\156\x73\165\155\x69\x64\157"], "\x75\x62\151\x63\x61" => $db["\x75\x62\151\143\x61"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc4() { return $this->db->query("\123\105\114\105\x43\124\x20\x2a\x20\106\x52\x4f\115\40\141\x72\x74\151\154\x6f\x74\145\x73\40\114\111\115\x49\x54\40\67\x38\x30\61\x2c\x32\66\x30\60")->result_array(); } function env_existenc4($sede, $data) { if ($sede == 1) { $table = "\141\162\x74\151\x6c\x6f\x74\x65\163"; } else { $table = "\141\162\164\151\x6c\x6f\x74\145\x73\62"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\105\114\x45\x43\x54\40\52\40\106\122\117\x4d\x20{$table}\x20\x57\x48\x45\122\105\40\x63\157\x64\x69\147\157\x61\162\164\x3d\x27" . $db["\143\x6f\x64\x69\147\x6f\141\x72\164"] . "\x27\40\46\x26\x20\141\154\x6d\141\x63\x65\x6e\75\x27" . $db["\141\154\155\x61\143\145\156"] . "\47\x20\x26\46\x20\x6c\157\x74\145\75\x27" . $db["\x6c\x6f\x74\145"] . "\47"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\143\x6f\x6e\163\165\x6d\151\144\157"] != $art->consumido || $db["\143\x61\156\x74\x69\144\x61\144"] != $art->cantidad) { $this->db->where("\x63\x6f\144\151\147\x6f\x61\162\164\x3d\47" . $db["\x63\x6f\144\x69\x67\x6f\141\162\x74"] . "\47\x20\46\x26\40\141\x6c\x6d\141\143\145\x6e\75\x27" . $db["\141\x6c\x6d\x61\143\145\156"] . "\47\40\46\x26\x20\x6c\157\x74\x65\x3d\x27" . $db["\x6c\157\x74\x65"] . "\47")->update($table, array("\143\141\156\x74\151\144\141\144" => $db["\x63\141\156\x74\151\x64\141\x64"], "\143\x6f\156\x73\x75\155\x69\x64\x6f" => $db["\x63\157\156\x73\165\155\x69\x64\x6f"], "\165\142\151\143\x61" => $db["\165\142\151\143\x61"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_existenc5() { return $this->db->query("\123\x45\114\105\103\x54\x20\x2a\x20\106\122\x4f\x4d\x20\141\x72\x74\x69\154\x6f\x74\x65\163\x20\x4c\111\x4d\x49\x54\40\61\60\64\60\61\54\62\x36\x30\x30")->result_array(); } function env_existenc5($sede, $data) { if ($sede == 1) { $table = "\x61\162\164\151\154\157\x74\145\163"; } else { $table = "\x61\x72\164\x69\154\157\x74\145\x73\62"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\123\105\x4c\x45\x43\x54\40\x2a\40\106\x52\117\x4d\x20{$table}\40\127\x48\x45\x52\x45\40\143\157\144\151\147\157\x61\x72\x74\x3d\47" . $db["\x63\x6f\144\151\x67\157\x61\162\x74"] . "\47\x20\x26\46\40\x61\x6c\155\141\143\145\156\75\47" . $db["\141\x6c\x6d\x61\x63\145\x6e"] . "\47\x20\46\46\x20\x6c\157\164\x65\x3d\x27" . $db["\154\157\164\x65"] . "\x27"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($db["\143\x6f\x6e\163\165\x6d\x69\x64\x6f"] != $art->consumido || $db["\143\141\156\x74\151\x64\141\x64"] != $art->cantidad) { $this->db->where("\143\157\144\151\x67\x6f\x61\162\x74\x3d\x27" . $db["\x63\157\x64\x69\x67\x6f\141\162\x74"] . "\47\x20\x26\x26\x20\x61\x6c\155\x61\x63\x65\x6e\x3d\47" . $db["\141\x6c\x6d\141\143\145\x6e"] . "\47\x20\x26\x26\x20\x6c\157\x74\145\75\x27" . $db["\154\x6f\x74\145"] . "\x27")->update($table, array("\x63\x61\x6e\x74\x69\144\141\144" => $db["\143\x61\156\x74\x69\144\141\x64"], "\x63\157\x6e\x73\x75\x6d\151\x64\157" => $db["\x63\x6f\x6e\x73\x75\x6d\x69\x64\x6f"], "\165\x62\x69\x63\141" => $db["\165\142\x69\x63\141"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_fac() { return $this->db->query("\x53\x45\x4c\x45\x43\x54\40\52\40\106\122\117\115\40\157\x70\145\x72\x74\x69\40\x57\x48\105\x52\x45\x20\x66\145\143\x68\141\x63\162\145\141\76\x3d\104\101\x54\105\x5f\x53\x55\102\x28\103\x55\122\104\101\124\x45\50\x29\x2c\x49\x4e\x54\x45\x52\x56\x41\114\x20\63\40\x44\x41\131\51\40\46\46\40\x28\164\x69\x70\157\144\x6f\143\x3d\x27\x46\x41\x43\x27\40\174\x7c\40\164\x69\x70\157\144\x6f\x63\x3d\x27\x4e\117\124\x27\x20\x7c\174\x20\164\x69\160\x6f\144\x6f\143\75\x27\116\57\x43\x27\40\174\174\40\164\x69\160\x6f\144\157\x63\75\47\116\57\x44\47\x20\174\x7c\40\x74\151\x70\157\x64\x6f\x63\x3d\x27\x52\x45\x54\47\51\x3b")->result_array(); } function env_fac($sede, $data) { if ($sede == 1) { $table = "\x6f\160\145\x72\164\151"; } else { $table = "\157\160\x65\x72\x74\x69\62"; } $i = 0; foreach ($data as $db) { $val = $this->db->query("\123\x45\114\x45\103\x54\x20\116\x55\x4c\x4c\40\x46\x52\x4f\115\x20{$table}\x20\x57\x48\105\122\105\40\x64\x6f\143\165\x6d\x65\x6e\x74\157\x3d\47" . $db["\144\x6f\143\165\x6d\145\x6e\164\157"] . "\x27\x20\46\x26\40\164\151\160\157\144\x6f\x63\x3d\47" . $db["\x74\x69\160\157\144\157\143"] . "\47")->num_rows(); if ($val == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } function lea_item() { return $this->db->query("\x53\105\x4c\105\x43\x54\40\x2a\40\106\x52\x4f\115\40\x6f\x70\145\162\155\166\x20\127\x48\105\122\105\x20\x66\x65\143\x68\x61\x64\x6f\x63\76\75\x44\101\x54\105\x5f\123\x55\102\x28\x43\x55\122\x44\101\124\105\x28\51\x2c\111\116\124\x45\122\126\x41\114\40\x33\x20\104\101\x59\51\40\x26\46\40\50\x74\x69\x70\157\144\157\143\x3d\x27\106\101\x43\x27\40\174\174\40\164\x69\160\x6f\x64\157\143\75\47\116\117\x54\47\x20\174\174\40\x74\x69\x70\157\144\x6f\x63\x3d\47\116\57\103\x27\x20\174\174\40\x74\151\160\157\144\x6f\143\x3d\47\116\x2f\104\47\40\x7c\x7c\40\164\x69\x70\157\x64\157\x63\x3d\x27\x52\x45\x54\47\x29\73")->result_array(); } function env_item($sede, $data) { if ($sede == 1) { $table = "\x6f\x70\145\x72\x6d\166"; } else { $table = "\157\160\145\x72\155\166\62"; } $i = 0; foreach ($data as $db) { $val = $this->db->query("\123\x45\x4c\x45\103\124\40\x4e\x55\114\114\x20\106\122\117\x4d\40{$table}\40\127\110\x45\122\105\40\144\x6f\143\165\x6d\x65\x6e\164\157\x3d\47" . $db["\144\x6f\x63\165\155\x65\x6e\164\157"] . "\x27\40\46\x26\40\164\151\x70\x6f\x64\157\x63\75\x27" . $db["\164\151\x70\x6f\x64\157\x63"] . "\47\x20\46\x26\x20\143\157\144\151\x67\x6f\75\47" . $db["\x63\157\x64\x69\x67\157"] . "\47\x20\x26\x26\x20\x63\141\156\164\x69\144\x61\144\x3d\x27" . $db["\143\x61\156\x74\x69\x64\141\x64"] . "\47\40\46\46\40\154\x6f\164\145\75\47" . $db["\x6c\x6f\x74\145"] . "\x27")->num_rows(); if ($val == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } function lea_comp() { return $this->db->query("\x53\105\114\105\103\124\40\x63\x6f\144\151\x67\x6f\x2c\x63\x6f\155\160\162\x6f\155\x65\x74\x69\x64\x6f\x20\x46\122\x4f\x4d\40\141\x72\164\151\x63\165\154\157\40\x57\x48\105\x52\105\x20\x65\x78\151\x73\164\x65\x6e\x63\x69\141\x3e\60")->result_array(); } function env_comp($sede, $data) { if ($sede == 1) { $table = "\141\162\164\x69\x63\165\x6c\x6f"; } else { $table = "\x61\x72\x74\151\143\165\154\157\62"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\123\105\114\105\103\x54\x20\x4e\125\x4c\x4c\x20\x46\x52\x4f\115\x20{$table}\40\127\x48\105\x52\105\x20\x63\157\x64\151\x67\157\75\47" . $db["\143\x6f\x64\x69\147\x6f"] . "\47"); if ($art->num_rows() > 0) { $art = $art->row(); if ($db["\x63\157\155\x70\162\157\155\145\x74\151\144\x6f"] != $art->comprometido) { $this->db->where("\x63\x6f\144\x69\x67\157", $db["\x63\x6f\144\x69\x67\x6f"])->update($table, array("\x63\x6f\x6d\160\x72\157\x6d\145\x74\x69\144\157" => $db["\143\157\155\160\162\x6f\x6d\145\164\x69\x64\157"])); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function lea_proveed() { return $this->db->query("\123\105\x4c\x45\x43\124\x20\x2a\x20\x46\x52\117\115\40\160\x72\x6f\166\145\145\x64")->result_array(); } function env_proveed($sede, $data) { if ($sede == 1) { $table = "\x70\x72\x6f\166\x65\x65\x64"; } else { $table = "\160\x72\x6f\166\145\145\144\x32"; } $i = 0; foreach ($data as $db) { $art = $this->db->query("\x53\x45\x4c\105\x43\x54\x20\x2a\x20\106\122\117\x4d\x20{$table}\x20\x57\x48\x45\122\x45\40\x63\157\x64\151\x67\x6f\75\47" . $db["\x63\x6f\144\151\147\157"] . "\47"); if ($art->num_rows() == 0) { $this->db->insert($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } else { $art = $art->row(); if ($art->descu != $db["\144\145\163\x63\165"] || $art->vol != $db["\x76\157\154"] || $art->descu2 != $db["\x64\145\x73\143\165\62"] || $art->vol2 != $db["\x76\x6f\154\x32"] || $art->descu3 != $db["\x64\145\x73\x63\x75\x33"] || $art->vol3 != $db["\166\157\154\x33"] || $art->descu4 != $db["\x64\x65\163\143\165\x34"] || $art->vol4 != $db["\166\x6f\154\64"] || $art->descu5 != $db["\x64\145\x73\143\165\x35"] || $art->vol5 != $db["\x76\157\154\65"]) { $this->db->where("\151\x64", $db["\151\144"])->update($table, $db); if ($this->db->affected_rows() > 0) { $i++; } } } } return $i; } function genebarra($codigo, $densidad = 2, $alto = 30) { require "\166\x65\x6e\x64\x6f\x72\57\141\x75\164\x6f\154\x6f\141\144\56\160\150\x70"; $generator = new Picqer\Barcode\BarcodeGeneratorHTML(); return $generator->getBarcode($codigo, $generator::TYPE_CODE_128, $densidad, $alto); } public function productos($a, $b, $c, $d, $f, $e, $cli) { $this->load->library("\x74\141\142\154\145"); $clidescu = $this->db->query("\123\105\114\x45\x43\x54\40\144\145\x73\143\165\x65\x6e\164\157\x20\x6e\40\106\x52\x4f\x4d\40\143\x6c\151\x65\x6d\x70\162\x65\40\127\x48\105\x52\x45\40\x63\157\x64\151\x67\x6f\x3d\x27{$cli}\x27")->row(); if ($clidescu->n != '') { $desculinea = $clidescu->n; } else { $desculinea = 0; } $html = ''; $this->table->set_heading("\x43\141\164\x65\x67\x6f\x72\x69\x61", "\120\x72\x69\156\143\151\x70\151\x6f\x2e\x41\143\x74\151\x76\157", "\x4c\141\142\x6f\162\141\164\157\x72\x69\157", "\x42\165\x73\143\x61\162\40\x3c\151\155\x67\40\x73\x72\x63\75\42" . base_url() . "\151\155\141\147\145\163\57\x62\x75\x73\x63\x61\x72\56\160\156\x67\42\40\141\154\164\75\x22\102\x75\x73\x63\x61\162\42\40\164\x69\x74\x6c\145\75\42\x42\165\x73\x63\141\x72\x22\40\x73\164\171\154\x65\x3d\x22\167\151\144\x74\x68\x3a\61\x38\x70\170\x3b\x62\x6f\x72\x64\145\162\x3a\x30\x3b\42\x3e"); $bd = $this->db->query("\123\105\x4c\x45\103\124\40\x63\157\x64\151\x67\157\x2c\40\x6e\x6f\x6d\142\x72\x65\x20\106\122\117\115\40\147\x72\165\160\157\x73\x20\x57\x48\105\x52\105\40\143\157\x64\151\147\x6f\40\156\157\x74\40\x69\x6e\x20\x28\x30\x36\x2c\60\x37\51")->result(); $grupo = "\74\163\x65\x6c\145\x63\x74\40\x63\154\x61\163\x73\x3d\42\x77\63\55\x73\x65\x6c\x65\143\x74\x22\x20\151\144\x3d\42\147\162\165\160\x6f\x5f\x70\x72\x6f\x64\42\x20\157\x6e\x63\x68\141\156\x67\x65\x3d\x22\x73\145\x61\x72\143\150\x5f\155\145\x64\x28\51\73\42\x3e\x3c\x6f\x70\164\151\x6f\x6e\x20\166\141\154\x75\x65\x3d\x22\x22\40\163\x65\x6c\145\x63\164\x65\144\76\124\157\x64\157\74\x2f\157\160\164\151\157\x6e\76"; foreach ($bd as $dt) { if ($a == $dt->codigo) { $slt = "\x73\x65\154\145\143\x74\145\x64"; } else { $slt = ''; } $grupo .= "\x3c\157\160\x74\x69\x6f\x6e\x20\166\x61\154\x75\145\75\42" . $dt->codigo . "\x22\40" . $slt . "\76" . $dt->nombre . "\74\57\157\160\164\151\x6f\156\x3e"; } $grupo .= "\74\57\x73\x65\154\145\x63\x74\x3e"; $bd3 = $this->db->query("\123\105\x4c\x45\103\124\x20\156\x6f\155\x62\x72\x65\40\x46\x52\x4f\115\x20\160\162\x6f\x76\x65\145\144")->result(); $prov = "\74\x69\156\x70\165\164\x20\143\x6c\x61\x73\x73\75\42\x77\x33\55\151\x6e\x70\x75\164\x22\40\151\144\75\42\160\x72\157\x76\137\x70\x72\x6f\144\x22\40\x76\x61\154\165\145\75\x22" . $d . "\42\x20\x6f\156\143\150\x61\156\x67\x65\75\x22\163\145\141\162\143\150\137\x6d\145\x64\x28\x29\73\x22\40\x6c\x69\x73\x74\x3d\x22\154\x69\x73\164\160\162\157\166\x22\x20\160\x6c\141\x63\x65\150\x6f\154\x64\x65\162\75\42\x4c\141\x62\x6f\x72\x61\164\x6f\x72\151\x6f\x2e\x2e\x2e\42\76\74\x64\x61\164\x61\154\151\163\x74\x20\x69\144\75\x22\x6c\151\x73\x74\160\162\x6f\x76\x22\x3e"; foreach ($bd3 as $dt3) { $prov .= "\74\157\x70\164\x69\x6f\156\x20\166\141\154\x75\145\x3d\x22" . $dt3->nombre . "\x22\x3e"; } $prov .= "\x3c\57\x64\x61\164\141\154\x69\x73\x74\x3e"; $bdref = $this->db->query("\123\x45\x4c\x45\x43\124\x20\x44\x49\x53\x54\111\116\103\124\x20\x72\x65\x66\x65\x72\x65\156\143\151\141\40\x6e\157\155\40\x46\122\117\115\x20\141\162\164\x69\x63\x75\154\x6f\x20\x57\x48\105\122\105\x20\x72\145\146\145\x72\x65\156\143\x69\141\41\75\47\47\73")->result(); $ref = "\x3c\151\156\160\165\x74\x20\143\x6c\x61\163\163\75\x22\x77\63\x2d\151\x6e\x70\x75\164\42\40\151\144\x3d\42\162\145\146\x5f\x70\162\x6f\x64\42\40\x76\141\154\x75\145\x3d\42" . $f . "\x22\40\157\156\143\x68\x61\156\147\x65\75\x22\x73\145\141\162\143\150\x5f\x6d\x65\x64\50\x29\x3b\x22\x20\x6c\x69\163\164\75\x22\154\151\163\x74\x72\145\146\x22\x20\x70\154\x61\143\x65\x68\157\x6c\x64\145\162\75\42\x50\162\151\x6e\x63\x69\x70\x69\157\x2e\56\56\x22\x3e\x3c\144\141\x74\141\x6c\151\163\164\x20\151\144\x3d\42\154\x69\x73\x74\162\145\146\42\x3e"; foreach ($bdref as $dtref) { $ref .= "\74\157\160\x74\x69\157\x6e\40\166\141\x6c\165\x65\x3d\x22" . $dtref->nom . "\x22\76"; } $ref .= "\x3c\57\144\x61\164\x61\154\x69\163\164\x3e"; $this->table->add_row('' . $grupo . '', $ref, '' . $prov . '', "\x3c\151\x6e\160\165\164\40\164\x79\x70\145\x3d\42\164\x65\170\x74\x22\x20\x69\144\x3d\x22\154\151\153\x65\137\155\145\x64\x22\40\x6f\156\x63\x68\141\x6e\x67\x65\75\x22\x73\145\x61\x72\x63\x68\x5f\x6d\x65\144\50\51\x3b\x22\40\166\x61\154\x75\x65\75\42" . $b . "\42\x20\143\154\x61\x73\163\75\42\x77\x33\x2d\x69\156\x70\x75\164\40\167\x33\x2d\142\157\162\x64\x65\x72\x22\x20\160\154\141\x63\145\150\x6f\154\x64\145\162\x3d\42\x50\162\x6f\144\x75\x63\x74\x6f\163\56\x2e\56\42\x3e"); $filter = $this->table->generate(); if ($c == '') { $c = 1; } $CantidadMostrar = 30; $sql = $this->tiposqlprod($a, $b, $d, $e, $f); $totalreg = $this->totreg($sql); $TotalRegistro = ceil($totalreg / $CantidadMostrar); $prod = "\74\164\141\142\154\145\x20\143\154\141\163\x73\75\x22\x77\63\55\164\x61\x62\x6c\145\x2d\x61\154\154\40\x77\x33\x2d\150\157\x76\145\x72\x61\x62\x6c\x65\40\x77\63\x2d\x74\151\156\171\42\76\x3c\x74\162\x20\x63\154\141\163\163\75\42\x77\63\55\146\157\156\144\x6f\x64\162\x6f\151\x64\x20\x77\x33\55\146\151\152\157\x22\x3e\74\164\x68\76\x50\162\x6f\x64\165\x63\x74\157\74\x2f\164\150\76\74\164\x68\x3e\x50\162\151\x6e\x63\151\160\x69\x6f\56\x41\143\x74\151\x76\x6f\74\57\x74\x68\x3e\74\x74\150\76\x4d\x61\x72\x63\141\74\57\x74\x68\x3e\x3c\164\x68\76\x56\145\x6e\143\145\74\x2f\164\150\x3e\x3c\x74\150\x3e\120\162\x65\143\151\x6f\74\x2f\164\x68\76\x3c\164\150\x3e\111\126\101\x3c\x2f\164\x68\x3e\74\164\150\76\x50\162\x65\x63\151\x6f\x2b\x49\166\141\x3c\57\164\150\x3e\x3c\164\x68\x3e\104\x65\x73\143\165\74\x2f\x74\x68\76\x3c\164\150\x3e\104\145\x73\143\165\56\x4c\x69\156\x65\x61\154\x3c\x2f\164\150\x3e\74\164\150\76\x50\162\145\x63\x69\x6f\106\x69\156\x3c\x2f\164\150\x3e\74\x74\150\76\x45\170\x69\x73\164\x3c\57\x74\150\x3e\74\164\x68\x3e\74\x2f\x74\150\76\74\164\150\x3e\74\x2f\x74\x68\76\74\57\164\x72\76"; $bd2 = $this->db->query("\x53\x45\x4c\x45\x43\124\x20\x61\x2e\143\x6f\x64\151\x67\x6f\x2c\x20\x43\x4f\116\x43\x41\124\50\141\56\143\x6f\x64\x69\147\157\x2c\47\40\x27\54\x61\56\x6e\x6f\x6d\x62\162\145\x2c\x27\x20\x27\x2c\x49\x46\50\141\x2e\144\163\143\x74\157\137\155\x65\144\151\x63\141\x6d\145\x6e\x74\x6f\x73\76\60\54\x43\117\116\103\101\x54\50\47\x3c\142\x20\143\154\x61\x73\x73\75\42\167\63\55\x64\162\x6f\x69\x64\x32\42\x3e\302\xa1\120\122\117\x4d\117\103\x49\x4f\116\x20\x27\x2c\x61\x2e\144\x73\x63\x74\x6f\137\x6d\145\144\151\143\x61\x6d\x65\x6e\x74\157\x73\x2c\47\45\x21\47\54\47\74\x2f\x62\x3e\47\x29\54\111\x46\x28\141\x2e\144\x73\x63\164\x6f\137\155\x65\x64\151\x63\x61\x6d\x65\x6e\x74\x6f\x73\62\x3e\60\54\103\x4f\116\x43\x41\x54\x28\47\x3c\x62\x20\143\154\141\x73\163\x3d\x22\x77\x33\55\144\x72\157\151\x64\62\42\x3e\xc2\xa1\120\122\x4f\x4d\117\x43\111\117\116\40\x27\x2c\141\x2e\x64\x73\143\x74\157\137\x6d\x65\x64\x69\x63\x61\x6d\x65\156\164\x6f\163\62\54\x27\45\x21\47\54\x27\74\57\142\76\x27\51\x2c\x27\x27\x29\x29\x29\x20\156\x6f\155\142\162\x65\54\141\x2e\162\x65\146\x65\x72\145\x6e\143\x69\x61\x2c\x61\56\155\141\x72\143\x61\x2c\40\12\40\x20\40\x20\40\40\40\40\122\x4f\125\116\104\50\141\56\160\162\x65\143\x69\x6f\x31\x2c\x32\x29\40\x70\x72\145\x63\x69\157\x2c\x43\x4f\x4e\103\x41\x54\50\122\x4f\x55\x4e\x44\x28\141\56\x69\155\160\165\x65\x73\164\157\x31\x29\54\x27\45\x27\x2c\47\40\x27\x2c\122\117\125\116\104\x28\141\x2e\x70\x72\145\x63\x69\x6f\61\x2a\50\x61\x2e\x69\155\160\x75\145\x73\164\157\61\x2f\61\x30\x30\x29\x2c\62\x29\51\x20\151\166\x61\54\x20\x20\122\117\125\116\x44\50\141\x2e\x70\x72\145\143\151\157\146\x69\156\61\x2c\x32\x29\x20\160\162\145\143\x69\157\x69\166\141\54\103\117\116\103\101\x54\50\141\x2e\x64\x73\x63\x74\x6f\137\155\x65\144\x69\143\x61\x6d\145\x6e\164\x6f\163\54\47\45\x27\54\x27\x20\47\x2c\x52\117\125\x4e\104\50\141\x2e\160\162\145\x63\151\x6f\146\151\156\x31\52\50\141\56\144\x73\143\164\x6f\137\x6d\145\x64\x69\x63\141\x6d\x65\156\164\x6f\x73\57\61\x30\60\51\54\x32\51\54\x27\40\x27\x2c\141\x2e\144\x73\x63\164\157\137\155\145\144\x69\x63\x61\155\x65\x6e\x74\157\163\62\x2c\47\x25\x27\54\47\x20\x27\54\122\x4f\125\x4e\104\50\x61\x2e\160\162\145\x63\151\x6f\x66\x69\x6e\61\52\x28\141\56\x64\163\143\x74\x6f\137\155\x65\144\x69\x63\x61\x6d\x65\156\164\x6f\x73\x32\57\x31\60\60\x29\54\x32\x29\51\40\x64\145\x73\x63\x75\54\40\xa\x20\40\x20\x20\40\40\x20\40\x43\117\116\x43\101\x54\x28\x52\117\x55\x4e\104\x28{$desculinea}\x29\x2c\x27\x25\x27\54\47\x20\x27\x2c\122\x4f\125\x4e\x44\50\50\x61\56\160\x72\145\143\x69\157\x66\151\x6e\x31\55\x28\x61\x2e\160\162\x65\143\151\x6f\x66\x69\156\x31\52\x28\141\x2e\x64\163\143\164\x6f\x5f\155\x65\x64\151\x63\x61\155\x65\x6e\164\x6f\163\57\61\x30\x30\51\x29\51\52\50{$desculinea}\57\61\60\x30\x29\54\62\51\x29\40\144\145\x73\x63\165\x6c\x69\156\145\141\54\x52\x4f\125\x4e\x44\50\x61\x2e\160\162\145\x63\151\x6f\146\x69\x6e\x31\x2d\x28\x61\56\x70\162\x65\x63\x69\x6f\x66\x69\156\x31\x2a\x28\141\56\144\163\x63\x74\x6f\x5f\155\145\x64\x69\143\141\155\145\x6e\164\157\163\57\x31\x30\60\x29\51\x2d\50\50\141\x2e\x70\162\x65\143\x69\x6f\x66\151\156\x31\55\x28\141\56\x70\x72\145\x63\x69\157\x66\151\x6e\61\52\x28\x61\x2e\x64\x73\x63\x74\x6f\137\x6d\145\x64\x69\x63\x61\155\x65\x6e\164\157\x73\x2f\61\x30\x30\51\51\51\x2a\x28{$desculinea}\x2f\x31\x30\x30\x29\x29\x2c\62\x29\x20\160\162\x65\143\151\157\146\x69\156\54\x20\x52\117\125\x4e\x44\x28\141\x2e\x65\x78\151\x73\164\145\156\143\151\x61\55\141\56\x63\157\x6d\160\x72\157\155\145\x74\x69\x64\157\54\x32\51\x20\144\151\163\x70\54\40\x61\x2e\151\155\x70\x75\x65\x73\x74\157\61\54\141\56\x64\x73\x63\x74\x6f\x5f\x6d\145\x64\x69\x63\141\155\145\156\164\157\x73\54\x61\x2e\144\x73\x63\x74\x6f\x5f\x6d\x65\x64\x69\143\141\155\x65\156\164\157\163\x32\xa\40\x20\40\x20\x20\x20\40\40\106\x52\x4f\x4d\40\141\162\164\151\x63\165\x6c\x6f\x20\x41\x53\40\x61\40\112\117\111\116\40\141\x72\x74\x69\x6c\157\164\145\x73\40\x64\x20\117\116\40\x64\56\143\157\x64\151\147\157\x61\x72\164\75\x61\x2e\x63\x6f\144\151\x67\157\x20\46\x26\x20\50\x64\x2e\141\x6c\x6d\141\143\x65\x6e\x3d\60\62\x20\174\x7c\x20\x64\x2e\141\x6c\155\141\143\x65\156\x3d\60\x37\x29\x20\x26\46\40\x64\x2e\x63\141\x6e\x74\x69\144\141\x64\55\x64\x2e\x63\x6f\x6e\163\165\155\x69\x64\x6f\76\x30\x20\112\117\111\x4e\x20\141\x72\164\x69\160\162\157\166\x20\x62\40\117\116\x20\141\56\x63\x6f\x64\151\147\157\x3d\x62\56\x63\x6f\x64\x69\147\157\40\x4c\x45\x46\x54\x20\112\x4f\111\116\40\x70\162\x6f\166\145\145\x64\40\143\x20\x4f\x4e\x20\143\56\143\157\144\151\147\x6f\x3d\x62\x2e\160\x72\x6f\166\145\x65\x64\157\x72\xa\40\40\40\x20\40\40\x20\40\x57\x48\x45\x52\105\x20\x61\56\145\x78\151\163\164\145\156\143\x69\141\x2d\141\56\x63\157\155\x70\162\x6f\x6d\145\x74\x69\x64\157\76\x30\x20\46\x26\40\141\56\160\141\162\x61\x5f\167\x65\142\75\x27\61\x27\x20\46\x26\x20\x61\56\147\162\x75\160\x6f\40\x4e\x4f\x54\40\111\116\40\50\60\66\54\x30\x37\51\x20" . $sql . "\40\12\x20\x20\40\40\x20\x20\x20\x20\x47\x52\117\x55\120\x20\x42\x59\40\x64\56\143\157\144\151\147\x6f\141\x72\164\40\x4f\x52\x44\105\122\40\102\x59\x20\141\56\156\157\155\142\162\145\x20\101\123\103\40\x4c\x49\x4d\111\x54\x20" . ($c - 1) * $CantidadMostrar . "\x20\54\x20" . $CantidadMostrar . '')->result(); $i = 0; foreach ($bd2 as $dt2) { $i++; if ($dt2->dscto_medicamentos > 0 || $dt2->dscto_medicamentos2 > 0 || $desculinea > 0) { $color = "\143\x6c\x61\163\163\x3d\42\167\x33\55\144\162\x6f\x69\144\x32\x22"; } else { $color = "\143\x6c\141\x73\163\75\x22\x77\63\x2d\144\162\x6f\x69\144\42"; } $bdlot = $this->db->query("\123\x45\114\x45\x43\x54\40\x63\56\x6c\157\164\x65\54\50\143\56\143\141\156\x74\x69\x64\x61\144\55\143\56\143\157\156\x73\x75\x6d\151\x64\157\x29\40\x65\170\x69\x73\164\x2c\40\x63\x2e\145\154\141\x62\54\x20\143\x2e\x76\x65\156\x63\145\40\x46\122\x4f\115\x20\141\x72\x74\151\154\x6f\x74\x65\x73\40\101\x53\x20\143\40\x57\110\105\x52\105\40\143\x2e\143\x6f\x64\151\147\x6f\141\x72\164\75\x27{$dt2->codigo}\47\40\46\46\40\x63\x2e\x63\141\x6e\x74\x69\144\x61\x64\41\x3d\143\x2e\x63\157\x6e\163\165\155\151\144\x6f\x20\x4f\x52\x44\105\x52\40\x42\x59\40\143\56\x76\145\x6e\143\145\x20\x41\x53\103\x20\x4c\111\115\x49\x54\40\x31")->row(); $prod .= "\74\164\162\x3e\74\151\156\160\x75\x74\40\x74\171\x70\145\75\x22\x68\x69\144\144\145\x6e\x22\40\151\144\x3d\x22\143\157\144" . $i . "\42\40\166\x61\x6c\x75\x65\75\42" . $dt2->codigo . "\x22\76"; $prod .= "\x3c\164\144\76" . $dt2->nombre . "\74\57\x74\x64\76\x3c\x74\x64\76" . $dt2->referencia . "\x3c\57\164\144\x3e\x3c\x74\x64\76" . $dt2->marca . "\x3c\57\164\144\x3e\x3c\164\x64\76" . $bdlot->vence . "\x3c\57\x74\144\x3e\74\164\x64\x3e" . $dt2->precio . "\74\57\164\x64\x3e\x3c\164\x64\x3e" . $dt2->iva . "\x3c\x2f\x74\144\76\x3c\164\x64\x3e" . $dt2->precioiva . "\74\57\164\x64\76\74\164\x64\40" . $color . "\76" . $dt2->descu . "\74\57\164\144\x3e\74\x74\144\x20" . $color . "\x3e" . $dt2->desculinea . "\x3c\x2f\164\x64\76\x3c\x74\144\x20" . $color . "\76" . $dt2->preciofin . "\74\x2f\164\144\x3e\x3c\164\144\x3e" . $dt2->disp . "\74\57\x74\x64\76\12\40\x20\x20\x20\40\40\40\40\40\40\x20\40\x3c\x74\144\x3e\74\151\x6e\x70\x75\164\x20\143\x6c\141\x73\x73\75\x22\167\x33\55\151\156\x70\x75\164\42\x20\164\171\160\x65\x3d\x22\164\145\x78\164\x22\40\151\x64\75\x22\x63\x61\156\x74" . $i . "\42\40\x6d\141\x78\154\x65\x6e\x67\x74\150\75\x22\65\42\40\160\154\x61\x63\145\150\157\154\144\145\162\75\42\x6e\x22\40\157\x6e\x63\150\x61\x6e\x67\145\75\42\162\145\147\x5f\160\x65\x64\151\144\157\x28\44\x28\47\43\143\x6f\144" . $i . "\47\51\56\166\141\x6c\x28\x29\x2c\x24\x28\47\x23\x63\x61\x6e\x74" . $i . "\x27\x29\56\x76\x61\154\x28\51\x29\x3b\x72\x65\164\165\x72\x6e\40\146\141\154\x73\x65\x3b\42\40\163\x74\171\154\145\75\x22\167\x69\144\x74\x68\x3a\62\60\x70\x78\x22\x20\160\x61\x74\164\x65\x72\156\x3d\x22\133\x30\x2d\x39\x5d\x7b\x31\x2c\65\x7d\x22\40\x74\151\164\x6c\x65\x3d\x22\x2a\x4d\141\170\x20\143\151\x6e\x63\x6f\50\x30\x35\51\x20\x44\x69\147\151\x74\x6f\x73\x20\52\x4e\x75\155\x65\162\157\163\x22\40\162\x65\161\x75\x69\x72\145\144\57\x3e\74\x2f\164\x64\x3e\12\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\40\x3c\x74\144\x3e\74\141\x20\x6f\156\143\154\x69\143\153\75\42\162\145\147\137\160\x65\x64\x69\x64\x6f\50\x24\x28\47\x23\x63\157\144" . $i . "\x27\x29\56\166\141\x6c\x28\x29\x2c\x24\x28\47\43\x63\141\156\164" . $i . "\47\51\x2e\166\141\x6c\50\51\51\73\x72\145\x74\165\x72\156\40\146\x61\154\x73\x65\73\42\x3e\74\151\155\147\x20\x73\162\x63\75\x22" . base_url() . "\x69\x6d\x61\x67\145\x73\57\162\x65\147\151\163\x74\x72\141\162\56\x70\x6e\147\x22\x20\141\x6c\x74\x3d\x22\x52\x65\x67\x69\163\x74\x72\x61\162\42\x20\x74\151\x74\154\145\75\x22\122\145\147\x69\x73\164\162\141\162\x22\40\163\x74\171\154\x65\75\42\x77\x69\144\x74\x68\x3a\61\x36\x70\x78\x3b\150\x65\151\147\150\164\72\x31\x36\x70\170\x3b\142\x6f\162\144\x65\x72\x3a\60\x3b\42\76\x3c\x2f\x61\76\74\57\x74\144\76\74\x2f\164\162\x3e"; } $prod .= "\74\57\164\x61\142\154\145\x3e"; $html .= "\12\x20\x20\40\40\40\x20\x20\40\74\151\156\160\x75\164\40\164\171\160\x65\x3d\x22\x68\x69\x64\144\x65\x6e\x22\40\x69\144\x3d\42\x62\x74\x6e\x70\145\144\42\x3e\12\40\x20\x20\40\x20\40\40\x20\x3c\141\x20\x63\x6c\x61\163\163\x3d\x22\167\x33\x2d\142\x74\x6e\x20\x77\x33\x2d\162\x6f\x75\156\x64\x2d\170\170\154\x61\x72\x67\145\40\x77\x33\x2d\x68\157\x76\145\x72\55\x66\157\x6e\x64\x6f\144\x72\x6f\151\x64\x20\x77\63\x2d\142\157\x72\144\145\x72\42\40\163\x74\x79\154\x65\75\x22\143\x75\x72\x73\x6f\162\72\x70\157\151\x6e\164\145\x72\x3b\167\x69\x64\164\x68\72\61\x30\x30\160\x78\73\x68\145\151\147\164\150\72\65\x30\x70\170\73\42\x20\157\x6e\x63\154\151\143\x6b\75\42\44\50\x27\x23\x62\x74\x6e\160\145\x64\47\51\56\x76\x61\154\x28\x27\47\x29\73\160\x65\x64\151\144\x6f\163\50\51\73\42\x3e\x3c\151\x6d\x67\x20\x73\162\143\x3d\x22" . base_url() . "\x69\x6d\x61\147\145\x73\x2f\142\x74\x6e\x74\157\x64\157\56\160\x6e\147\x22\40\x73\164\x79\154\145\x3d\x22\x77\151\144\164\150\x3a\63\60\160\x78\x3b\142\x6f\x72\x64\145\x72\x3a\60\x3b\42\x3e\x54\157\x64\x6f\x3c\57\141\x3e\xa\40\40\40\40\x20\x20\x20\40\74\141\x20\143\154\x61\x73\x73\75\x22\x77\x33\x2d\142\x74\156\x20\x77\63\55\x72\157\165\156\x64\x2d\x78\x78\154\141\x72\147\145\x20\167\x33\55\x68\x6f\x76\x65\x72\x2d\x66\x6f\156\x64\x6f\x64\x72\157\x69\x64\x20\167\x33\x2d\142\157\x72\144\x65\x72\42\x20\163\164\x79\x6c\x65\x3d\42\143\x75\162\x73\157\162\72\x70\157\x69\156\164\145\x72\x3b\x77\151\x64\x74\150\72\61\x30\60\x70\x78\x3b\x68\x65\151\x67\x74\150\x3a\x35\x30\x70\x78\x3b\x22\40\x6f\156\143\x6c\151\143\x6b\75\42\x24\x28\47\x23\142\x74\x6e\160\145\x64\47\51\x2e\x76\141\x6c\x28\x31\x29\73\x70\145\x64\x69\144\x6f\x73\x28\x29\73\42\x3e\x3c\x69\155\x67\x20\x73\162\143\75\42" . base_url() . "\151\x6d\141\147\145\x73\57\x6f\x66\x65\162\164\x61\x73\56\160\x6e\x67\x22\40\x73\x74\171\x6c\145\x3d\42\x77\x69\144\x74\x68\72\x33\60\x70\170\73\x62\x6f\x72\x64\x65\x72\72\x30\x3b\42\x3e\117\146\145\162\164\x61\163\x3c\57\x61\x3e\74\x62\x72\x3e\74\142\162\x3e\12\x20\x20\x20\x20\x20\x20\40\x20" . $filter . "\74\x62\x72\76\12\x20\x20\40\x20\40\40\40\x20" . $prod . "\12\x20\40\40\x20\40\40\40\40\x3c\163\x63\x72\151\x70\x74\40\x74\x79\x70\145\x3d\x22\164\x65\170\164\x2f\152\141\x76\x61\x73\143\x72\x69\x70\164\x22\76\12\x20\40\40\40\40\x20\x20\40\x66\165\x6e\143\x74\x69\x6f\x6e\x20\x44\x65\143\x72\145\155\145\156\164\116\165\155\x28\51\x7b\40\142\145\x66\x6f\x72\x65\50\51\x3b\xa\40\40\x20\40\x20\x20\40\40\40\x20\40\40\166\x61\x72\x20\104\x65\x63\x72\145\155\145\x6e\x74\x4e\165\155\75\x64\x6f\143\165\155\x65\156\164\56\x67\145\164\x45\154\145\155\x65\156\x74\102\171\111\x64\x28\x22\x44\145\143\x72\x65\155\x65\156\164\x4e\x75\x6d\42\51\x2e\166\x61\x6c\165\145\x3b\12\40\40\40\x20\x20\40\x20\40\40\x20\x20\40\166\x61\162\40\x67\x72\165\x70\x6f\x3d\x64\x6f\x63\x75\155\145\x6e\x74\56\x67\x65\164\x45\154\x65\155\x65\x6e\x74\102\171\x49\144\x28\42\x67\162\165\x70\157\137\160\x72\x6f\144\x22\x29\56\166\x61\154\165\x65\x3b\xa\40\40\40\40\40\40\40\x20\x20\x20\x20\40\x76\x61\x72\40\x6c\151\153\x65\x5f\155\x65\x64\x3d\x64\x6f\x63\165\155\145\156\164\56\x67\145\164\105\154\x65\x6d\x65\156\164\102\x79\111\144\x28\x22\x6c\151\153\145\x5f\155\145\x64\x22\x29\56\166\x61\154\x75\x65\x3b\12\40\40\x20\40\x20\x20\40\x20\40\40\40\40\166\x61\x72\40\142\x74\x6e\75\44\x28\x22\x23\142\x74\156\160\x65\x64\x22\x29\56\x76\x61\x6c\x28\x29\x3b\12\40\x20\x20\x20\x20\x20\40\40\x20\40\151\146\50\x74\x69\160\x3d\x3d\x37\x20\174\174\40\164\151\x70\x3d\75\62\51\40\173\x20\x63\x6c\x69\75\x24\50\42\43\151\x64\x63\154\x69\42\x29\x2e\166\141\154\50\x29\x3b\x20\x76\141\162\40\165\x72\x6c\x3d\42\160\x65\144\x69\x64\157\163\x32\57\42\73\x20\x7d\x20\145\x6c\x73\145\40\x7b\x20\x76\141\162\x20\165\162\x6c\x3d\42\x70\x65\144\x69\144\x6f\x73\x2f\x22\x3b\40\175\12\40\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\166\x61\162\40\x6b\x65\x79\75\42\144\x72\157\151\x64\71\60\63\42\x3b\xa\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x76\141\162\x20\x64\x61\x74\157\x73\x20\x3d\x20\173\12\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\42\147\x72\165\x70\157\42\x20\x3a\x20\x67\x72\165\x70\157\54\xa\40\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\40\x22\154\151\x6b\145\x5f\155\x65\x64\x22\x20\72\40\x6c\x69\x6b\x65\137\x6d\x65\x64\54\xa\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\40\40\40\x20\40\40\40\x22\x70\x61\147\42\x20\x3a\40\x44\145\x63\162\145\x6d\x65\156\x74\x4e\165\155\x2c\xa\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\42\153\x65\x79\42\x20\72\x20\x6b\145\171\54\142\x74\x6e\x3a\142\x74\156\54\x63\x6c\x69\72\143\x6c\151\xa\x20\x20\x20\x20\40\40\x20\40\40\40\40\x20\40\40\x20\x7d\x3b\xa\40\x20\40\x20\40\40\40\40\40\40\x20\12\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\x24\56\141\x6a\x61\170\x28\173\xa\x20\x20\40\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x64\x61\164\x61\x3a\x20\x64\141\164\x6f\163\54\12\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\x75\x72\x6c\x3a\x20\40\x62\x61\x73\145\165\x72\154\x2b\x22\143\x5f\x64\x72\x6f\x69\x64\x2f\x22\x2b\x75\162\x6c\x2c\12\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\x74\x79\160\145\72\40\x22\120\117\123\x54\42\54\12\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\142\145\146\x6f\x72\145\163\145\156\144\x3a\40\x66\165\x6e\143\x74\x69\157\x6e\x28\x29\x20\x7b\xa\x20\40\40\x20\40\40\40\x20\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\163\x77\x61\154\x28\x7b\xa\40\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\40\40\x74\151\164\154\x65\x3a\42\42\54\x20\12\x20\40\x20\x20\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\40\x20\40\40\164\x65\x78\164\72\42\103\x61\x72\x67\x61\156\144\x6f\x22\x2c\xa\x20\x20\x20\40\40\40\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x20\151\143\x6f\156\x3a\40\x62\141\x73\145\x75\x72\x6c\x2b\42\x69\x6d\141\147\x65\163\57\x6c\x6f\141\144\151\156\147\x32\56\x67\x69\x66\x22\54\xa\x20\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\40\40\40\40\x20\x62\x75\164\x74\x6f\x6e\163\x3a\x20\x66\141\x6c\163\145\x2c\40\x20\40\40\40\40\xa\40\x20\40\40\40\x20\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\143\154\x6f\x73\145\x4f\x6e\x43\154\151\x63\153\x4f\x75\x74\x73\x69\144\x65\x3a\x20\x66\141\x6c\163\x65\54\xa\x20\x20\40\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\40\57\x2f\x74\x69\x6d\x65\162\72\x20\65\60\x30\x30\54\12\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\x20\x20\57\57\x69\x63\157\x6e\72\40\42\x73\165\143\143\145\163\163\42\12\40\40\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\175\51\x3b\x20\40\12\40\x20\x20\40\x20\40\40\40\40\40\40\40\40\40\x20\x20\175\54\12\x20\x20\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\163\165\x63\x63\145\163\x73\72\x20\x66\x75\156\x63\x74\x69\x6f\x6e\50\x64\141\164\141\51\x20\173\xa\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\44\x28\42\x23\142\x6f\144\171\42\x29\x2e\x68\164\155\x6c\x28\x64\141\164\x61\51\73\xa\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\x24\x28\x22\43\x6c\x69\x6b\145\137\x6d\145\144\42\x29\56\x76\141\x6c\x28\154\x69\153\145\137\155\145\x64\x29\x3b\x20\44\50\x22\x23\x62\164\x6e\160\x65\x64\x22\51\56\166\141\154\x28\142\164\156\x29\x3b\40\163\x77\141\x6c\56\x63\x6c\x6f\163\x65\x28\x29\x3b\12\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\175\xa\40\x20\x20\40\40\x20\40\x20\40\40\x20\xa\x20\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x7d\x29\x3b\12\40\40\40\x20\x20\x20\40\x20\x20\x20\40\175\12\x20\40\40\x20\x20\40\x20\40\12\40\40\40\40\40\40\x20\40\40\x20\x20\146\165\156\x63\x74\x69\157\156\40\156\x75\x6d\x70\141\x67\x28\141\51\173\x20\x62\145\x66\x6f\162\x65\50\51\73\12\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x76\141\162\40\153\145\x79\75\42\144\x72\157\x69\x64\71\60\x33\x22\x3b\xa\x20\40\40\40\40\x20\40\40\x20\40\40\40\x76\x61\x72\40\147\162\x75\160\x6f\x3d\x64\x6f\x63\165\155\x65\156\x74\56\147\145\x74\x45\x6c\x65\155\145\x6e\x74\102\x79\x49\x64\50\42\x67\162\165\160\x6f\x5f\160\x72\x6f\x64\42\x29\56\x76\x61\154\x75\x65\73\12\40\x20\x20\40\x20\40\40\40\40\x20\40\40\x76\141\162\x20\x6c\151\x6b\145\137\155\x65\144\x3d\144\x6f\143\165\155\x65\156\164\x2e\147\145\x74\x45\154\145\155\145\x6e\164\102\171\111\144\50\x22\154\x69\153\x65\x5f\155\x65\144\42\51\56\x76\x61\x6c\165\145\x3b\12\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\166\141\162\x20\x62\164\156\x3d\x24\x28\42\43\142\x74\156\160\x65\x64\x22\x29\x2e\x76\x61\x6c\x28\51\x3b\xa\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x69\146\x28\164\151\x70\75\x3d\x37\40\174\x7c\40\164\151\x70\75\75\62\51\x20\x7b\x20\x63\x6c\151\x3d\x24\50\x22\43\151\144\143\154\151\x22\51\x2e\166\x61\154\x28\x29\73\x20\x76\x61\162\40\165\x72\x6c\x3d\42\x70\x65\x64\x69\x64\x6f\163\62\x2f\42\73\x20\175\40\145\154\163\x65\x20\x7b\40\x76\141\162\40\165\x72\154\75\42\x70\x65\x64\x69\x64\157\163\x2f\x22\x3b\40\175\12\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\166\x61\x72\40\x64\141\164\157\x73\40\x3d\40\x7b\12\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\40\40\x20\x20\40\40\40\x20\42\x67\162\x75\x70\157\42\x20\72\x20\x67\x72\165\160\157\x2c\12\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x22\154\x69\x6b\145\137\x6d\145\144\x22\x20\72\x20\x6c\151\153\x65\137\x6d\x65\144\x2c\12\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\42\x6b\145\x79\x22\72\153\x65\x79\x2c\40\x62\x74\x6e\x3a\x62\x74\156\54\xa\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x22\x70\141\147\x22\40\72\40\x61\x2c\143\x6c\151\72\x63\154\151\xa\40\40\x20\40\40\40\40\40\x20\x20\x20\40\40\40\x20\x7d\73\xa\40\x20\40\40\40\40\40\x20\x20\40\40\xa\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\44\x2e\141\152\141\x78\x28\x7b\12\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\144\141\164\x61\72\x20\x64\141\x74\x6f\x73\x2c\12\x20\x20\40\x20\40\40\x20\40\40\40\40\x20\40\40\x20\x20\40\40\x20\x75\x72\154\x3a\40\142\x61\163\x65\x75\x72\x6c\53\x22\x63\137\x64\162\157\151\x64\x2f\42\53\x75\x72\x6c\54\12\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\164\171\x70\145\x3a\40\x22\x50\117\123\124\x22\x2c\12\x20\40\40\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\40\40\40\x20\142\x65\146\157\162\x65\163\x65\x6e\x64\72\40\x66\x75\x6e\x63\x74\151\x6f\x6e\x28\x29\40\x7b\12\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\40\40\40\40\40\40\x20\40\163\167\141\x6c\x28\x7b\12\40\40\40\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\x20\40\x74\151\x74\x6c\x65\72\x22\42\54\x20\12\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\40\x20\x74\145\x78\164\x3a\x22\x43\141\x72\147\x61\x6e\144\x6f\42\x2c\xa\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\40\40\40\40\x20\x69\143\157\156\x3a\x20\142\x61\163\145\x75\162\x6c\x2b\x22\x69\155\141\x67\145\x73\57\x6c\x6f\x61\144\x69\x6e\147\62\56\x67\151\x66\42\54\xa\40\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\40\142\165\x74\x74\157\x6e\163\72\40\x66\x61\x6c\163\x65\x2c\x20\40\x20\x20\40\x20\xa\40\x20\x20\40\40\x20\x20\40\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\x20\40\x20\40\143\154\157\x73\x65\117\x6e\103\x6c\x69\143\153\x4f\165\164\163\x69\x64\x65\72\x20\146\141\x6c\x73\145\x2c\12\40\40\40\40\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\40\40\40\40\x20\x20\40\40\x2f\57\x74\151\x6d\x65\162\x3a\40\x35\x30\60\x30\x2c\12\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x2f\x2f\x69\x63\x6f\x6e\72\40\x22\163\x75\143\143\x65\x73\x73\x22\xa\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\175\x29\x3b\40\x20\xa\x20\40\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\40\x7d\54\12\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\163\x75\143\x63\145\x73\163\x3a\x20\x66\165\x6e\x63\164\x69\157\x6e\50\144\141\164\x61\51\x20\x7b\xa\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\44\x28\42\43\142\x6f\x64\171\x22\51\56\150\164\155\154\50\x64\141\164\141\51\x3b\xa\x20\x20\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\44\50\x22\x23\154\x69\153\145\x5f\x6d\x65\x64\x22\51\56\x76\x61\x6c\50\154\x69\x6b\x65\137\x6d\145\x64\51\73\x20\x20\44\x28\x22\43\142\x74\156\160\145\144\x22\51\56\x76\x61\154\50\x62\164\x6e\51\73\x20\163\x77\141\x6c\x2e\x63\x6c\x6f\163\145\x28\x29\x3b\12\x20\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\40\x20\x20\40\x20\175\12\40\40\40\40\x20\40\x20\x20\40\x20\40\xa\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x7d\51\x3b\xa\x20\40\x20\x20\x20\40\40\x20\x20\40\40\175\12\40\40\x20\40\x20\x20\x20\x20\xa\x20\40\40\x20\40\x20\x20\40\40\40\x20\146\x75\x6e\x63\164\151\157\x6e\x20\x49\x6e\143\x72\x69\x6d\145\156\164\x4e\x75\x6d\x28\x29\173\40\142\x65\146\x6f\x72\145\x28\51\x3b\12\x20\40\40\x20\x20\x20\40\x20\40\x20\40\40\166\141\x72\40\x49\x6e\143\162\x69\x6d\x65\x6e\164\116\x75\x6d\75\144\157\x63\x75\155\x65\x6e\164\56\x67\x65\164\105\154\145\155\x65\x6e\164\x42\x79\111\144\x28\x22\x49\156\x63\x72\x69\155\x65\x6e\164\116\x75\155\x22\x29\56\166\x61\x6c\x75\x65\73\xa\x20\40\40\40\40\40\40\40\x20\40\x20\40\x76\141\x72\x20\x67\162\165\160\157\x3d\x64\x6f\143\165\155\x65\156\x74\56\x67\145\164\105\154\145\155\x65\x6e\x74\102\x79\111\144\50\x22\147\162\x75\x70\157\x5f\160\x72\x6f\x64\x22\x29\56\166\x61\154\x75\145\x3b\12\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x76\x61\x72\x20\x6c\x69\x6b\145\137\155\145\144\x3d\144\x6f\143\165\155\145\x6e\164\56\147\145\164\105\x6c\145\155\x65\156\x74\102\x79\111\144\50\x22\x6c\151\153\145\137\x6d\145\x64\42\x29\x2e\x76\141\x6c\165\145\73\12\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x76\x61\162\x20\x62\164\156\75\44\x28\x22\43\x62\x74\x6e\160\145\144\x22\51\x2e\x76\141\x6c\x28\x29\73\12\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\40\40\151\146\50\x74\x69\160\x3d\x3d\x37\x20\174\174\40\164\x69\160\75\x3d\62\51\40\x7b\x20\143\154\151\x3d\x24\x28\42\x23\151\144\143\154\x69\42\x29\56\x76\x61\154\x28\x29\x3b\40\166\141\x72\40\x75\162\154\75\x22\x70\145\x64\151\x64\x6f\x73\x32\57\x22\x3b\40\175\40\x65\154\163\145\40\173\40\x76\x61\x72\40\165\x72\x6c\x3d\42\x70\145\x64\x69\x64\x6f\x73\57\x22\73\x20\175\xa\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x76\x61\162\x20\153\x65\x79\75\42\x64\162\x6f\x69\144\71\x30\63\42\73\12\40\x20\x20\40\40\x20\x20\40\40\40\40\40\x76\141\x72\x20\x64\x61\164\x6f\x73\40\x3d\x20\x7b\xa\40\40\x20\40\40\40\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\40\x20\42\x67\x72\165\x70\157\42\40\x3a\x20\147\x72\x75\x70\x6f\54\xa\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\40\x20\42\154\151\x6b\x65\x5f\155\145\144\x22\40\x3a\x20\154\151\153\x65\x5f\155\x65\144\x2c\12\x20\x20\40\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\40\x20\40\40\42\153\145\x79\x22\72\153\145\x79\54\x20\x62\x74\156\x3a\x62\x74\x6e\54\xa\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\40\x20\40\40\40\40\x22\x70\141\147\x22\x20\72\x20\x49\156\x63\162\151\155\x65\156\164\x4e\165\x6d\x2c\x63\154\151\x3a\x63\x6c\x69\xa\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\40\x20\40\x7d\x3b\12\40\x20\x20\40\x20\x20\40\x20\40\40\40\xa\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\x24\x2e\x61\x6a\141\x78\x28\x7b\12\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\40\40\x20\x64\x61\164\x61\72\x20\144\x61\164\157\163\x2c\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\40\40\40\40\40\x20\x20\x75\x72\x6c\72\x20\x20\x62\141\163\145\165\x72\x6c\53\42\143\x5f\144\162\x6f\151\144\57\x22\53\x75\x72\x6c\x2c\12\40\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\40\40\x20\40\164\171\160\x65\72\40\42\x50\117\123\124\x22\54\12\40\40\x20\40\40\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x62\x65\146\157\162\x65\163\x65\x6e\144\x3a\x20\146\x75\x6e\x63\164\151\x6f\x6e\50\51\40\173\12\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\40\x20\163\167\141\154\x28\x7b\12\40\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\164\x69\164\x6c\145\x3a\42\42\54\x20\12\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\40\40\40\x20\40\x20\40\40\40\40\x20\164\x65\170\x74\72\42\103\141\x72\x67\x61\x6e\x64\x6f\x22\54\xa\40\40\x20\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\40\40\40\x20\x20\40\40\x20\151\143\x6f\x6e\x3a\x20\x62\x61\x73\145\165\x72\x6c\53\x22\151\155\x61\x67\x65\163\57\x6c\157\141\x64\x69\156\147\x32\x2e\147\151\146\42\54\xa\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\142\x75\164\164\157\156\163\x3a\x20\x66\141\x6c\x73\x65\54\x20\x20\40\40\x20\x20\12\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\x20\40\x20\40\x20\x20\x20\40\40\40\x63\154\x6f\163\145\117\156\x43\x6c\x69\143\x6b\x4f\x75\164\163\151\x64\145\x3a\40\x66\x61\154\x73\145\54\xa\x20\40\40\40\40\x20\x20\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x2f\x2f\164\x69\155\x65\162\72\40\65\x30\60\60\x2c\xa\x20\40\40\40\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\40\40\x20\40\x20\40\x2f\x2f\151\x63\157\156\72\x20\x22\163\x75\143\143\x65\163\163\42\12\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\x7d\51\73\40\40\12\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\x7d\x2c\xa\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\x20\40\x20\40\40\x20\40\x73\x75\x63\x63\x65\163\x73\72\x20\x66\165\156\143\x74\151\157\156\50\x64\141\164\141\x29\40\x7b\12\x20\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\44\50\42\x23\142\x6f\144\x79\x22\51\x2e\150\x74\x6d\x6c\50\144\x61\164\141\51\x3b\12\40\x20\40\40\x20\40\40\x20\40\40\40\40\40\40\40\40\x20\40\x20\40\40\40\x20\x24\50\x22\43\154\x69\153\x65\137\x6d\145\x64\42\51\56\x76\141\x6c\50\154\151\153\x65\x5f\x6d\x65\144\51\x3b\40\x20\x24\x28\42\x23\142\x74\x6e\160\x65\x64\x22\51\56\166\141\154\50\x62\x74\156\51\73\40\x73\167\141\154\x2e\x63\154\157\163\145\x28\x29\x3b\xa\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x7d\xa\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\175\51\x3b\xa\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x7d\xa\x20\40\x20\40\40\40\x20\40\74\x2f\163\143\x72\151\160\164\x3e\12\40\40\x20\x20\x20\40\x20\40"; $IncrimentNum = $c + 1 <= $TotalRegistro ? $c + 1 : 1; $DecrementNum = $c - 1 < 1 ? 1 : $c - 1; $html .= "\x3c\144\151\x76\40\x63\154\141\x73\x73\75\42\167\x33\55\x62\x61\162\x20\167\x33\55\x62\157\x72\144\145\162\x20\167\63\55\x62\141\162\x72\141\x73\42\x3e\12\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x3c\151\x6e\x70\165\x74\x20\x74\x79\x70\x65\75\42\x68\x69\x64\144\145\x6e\x22\x20\x69\x64\75\x22\x44\x65\x63\x72\x65\x6d\145\156\164\x4e\x75\155\42\40\166\x61\x6c\x75\145\x3d\x22" . $DecrementNum . "\x22\x3e\12\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x3c\141\x20\157\x6e\x63\x6c\151\x63\153\x3d\42\104\145\x63\x72\x65\155\145\x6e\164\116\x75\155\50\51\x3b\42\40\143\x6c\141\163\x73\x3d\42\x77\x33\x2d\x62\141\x72\55\151\x74\145\x6d\40\x77\63\x2d\142\165\164\164\x6f\x6e\42\76\46\x6c\x61\x71\165\157\x3b\74\57\141\76"; $Desde = $c - (ceil($CantidadMostrar / 2) - 1); $Hasta = $c + (ceil($CantidadMostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $CantidadMostrar ? $CantidadMostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\141\147\x69\x6e\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $c) { $hover = "\x77\63\x2d\x66\157\x6e\x64\157\x64\x72\x6f\151\x64"; $html .= "\xa\x20\40\x20\x20\x20\40\x20\40\x20\40\x3c\x69\x6e\x70\x75\164\40\x74\171\x70\x65\x3d\42\150\x69\144\x64\x65\x6e\x22\40\151\144\75\x22" . $id . "\x22\40\x76\x61\154\x75\x65\75\x22" . $i . "\x22\76\12\40\40\40\x20\40\40\40\x20\40\40\x3c\141\40\157\156\143\x6c\151\x63\x6b\75\42\x6e\x75\155\x70\141\x67\50\44\x28\47\43" . $id . "\47\x29\x2e\x76\x61\x6c\x28\x29\x29\x3b\x22\40\143\154\141\163\163\x3d\x22\167\x33\x2d\142\141\x72\55\x69\164\x65\155\x20\x77\x33\x2d\x62\x75\164\164\157\156\40" . $hover . "\42\76" . $i . "\74\57\141\x3e"; } else { $hover = ''; $html .= "\x3c\x69\156\x70\165\164\x20\x74\x79\x70\x65\75\42\150\x69\x64\x64\x65\x6e\42\x20\x69\144\x3d\42" . $id . "\x22\40\166\x61\154\x75\x65\75\42" . $i . "\42\x3e\xa\40\40\x20\40\40\40\40\x20\x20\74\141\40\x6f\156\143\154\x69\143\153\x3d\x22\156\x75\155\160\x61\147\50\x24\x28\47\x23" . $id . "\47\x29\x2e\x76\141\154\x28\51\51\73\42\40\x63\x6c\x61\163\x73\75\x22\167\x33\x2d\x62\x61\162\55\x69\164\145\x6d\x20\167\x33\x2d\x62\165\164\x74\x6f\x6e\x20" . $hover . "\x22\76" . $i . "\x3c\57\x61\76"; } } } $html .= "\74\151\x6e\160\x75\x74\40\164\x79\160\x65\x3d\42\x68\x69\x64\x64\145\x6e\42\40\151\x64\75\x22\x49\156\143\162\151\x6d\x65\x6e\164\x4e\x75\155\42\x20\166\x61\x6c\x75\x65\x3d\42" . $IncrimentNum . "\x22\76\xa\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x3c\x61\40\157\156\143\154\151\143\x6b\x3d\42\111\x6e\x63\162\151\155\145\x6e\164\x4e\165\x6d\x28\51\73\42\x20\x63\x6c\141\163\163\75\x22\167\63\x2d\142\141\x72\55\151\164\x65\x6d\40\x77\x33\55\142\165\164\x74\x6f\156\42\76\x26\162\x61\x71\165\157\73\x3c\x2f\141\76\xa\12\x20\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x3c\x2f\x64\151\x76\x3e\40"; return $html; } public function tiposqlprod($a, $b, $d, $e, $f) { $sql = ''; if ($a == '' && $b != '' && $d == '' && $f == '') { $sql = "\x26\46\x20\50\x61\56\x6e\157\x6d\x62\x72\x65\x20\114\x49\113\x45\x20\42\x25" . $b . "\x25\x22\x20\174\x7c\x20\x61\56\x63\x6f\144\x69\x67\x6f\75\x22" . $b . "\x22\x29"; } elseif ($a != '' && $b == '' && $d == '' && $f == '') { $sql = "\x26\46\x20\141\56\147\162\x75\x70\157\75\42" . $a . "\42"; } elseif ($a == '' && $b == '' && $d != '' && $f == '') { $sql = "\46\x26\x20\x63\56\156\x6f\155\142\x72\145\x3d\42" . $d . "\42"; } elseif ($a == '' && $b == '' && $d == '' && $f != '') { $sql = "\x26\46\x20\141\56\x72\x65\146\x65\162\145\156\x63\x69\141\x3d\x22" . $f . "\x22"; } elseif ($a != '' && $b != '' && $d == '' && $f == '') { $sql = "\x26\46\40\141\56\147\162\165\160\157\75\x22" . $a . "\42\x20\46\46\x20\50\141\56\156\x6f\155\x62\x72\x65\x20\x4c\111\113\105\x20\x22\45" . $b . "\45\42\x20\174\174\x20\x61\x2e\143\157\x64\151\x67\x6f\x3d\42" . $b . "\x22\51"; } elseif ($a != '' && $b != '' && $d != '' && $f == '') { $sql = "\46\46\40\x61\x2e\147\162\165\160\157\x3d\42" . $a . "\42\x20\46\x26\40\50\141\56\156\157\x6d\x62\x72\x65\40\x4c\111\x4b\x45\x20\x22\45" . $b . "\45\x22\x20\x7c\174\40\x61\x2e\x63\157\x64\x69\147\157\x3d\x22" . $b . "\x22\x29\x20\46\46\40\x63\56\x6e\x6f\155\x62\162\x65\75\42" . $d . "\x22"; } elseif ($a != '' && $b != '' && $d == '' && $f != '') { $sql = "\x26\46\40\x61\x2e\147\x72\x75\160\x6f\x3d\42" . $a . "\42\40\46\x26\x20\x28\141\x2e\156\157\x6d\142\162\x65\x20\x4c\x49\x4b\x45\40\42\45" . $b . "\x25\42\40\174\x7c\x20\141\x2e\143\157\144\x69\147\157\75\x22" . $b . "\x22\51\x20\x26\x26\x20\x61\x2e\x72\145\x66\145\162\x65\x6e\143\x69\141\x3d\42" . $f . "\42"; } if ($e == 1) { $sql .= "\x26\x26\x20\141\56\144\x73\x63\164\157\x5f\155\145\x64\151\x63\141\x6d\x65\x6e\164\157\x73\76\60"; } return $sql; } public function totreg($sql) { $bd = $this->db->query("\123\x45\x4c\x45\103\124\x20\x61\x2e\156\157\155\142\x72\x65\x2c\x20\x61\56\x70\x72\x65\x63\x69\157\x31\54\x72\157\x75\156\144\50\141\x2e\x70\x72\x65\x63\151\x6f\x66\x69\156\x31\54\x32\x29\40\160\x72\x65\143\x69\157\146\151\x6e\x2c\x20\162\x6f\x75\x6e\144\50\x61\56\145\x78\x69\163\x74\x65\x6e\143\x69\141\x2c\x32\51\x20\144\151\x73\160\x2c\40\141\x2e\x69\155\x70\x75\x65\163\164\157\61\40\x46\x52\x4f\x4d\40\141\x72\164\x69\143\x75\x6c\x6f\x20\101\x53\40\x61\40\12\x20\40\x20\40\112\117\111\116\x20\x61\162\x74\x69\160\x72\x6f\166\x20\x62\x20\x4f\116\40\x61\x2e\x63\x6f\x64\151\147\157\75\x62\x2e\x63\157\x64\151\147\x6f\x20\114\x45\106\124\x20\112\x4f\x49\x4e\40\x70\x72\x6f\x76\x65\x65\x64\40\143\x20\117\x4e\x20\143\56\x63\157\x64\x69\x67\x6f\x3d\x62\x2e\x70\x72\x6f\166\145\x65\144\157\x72\12\x20\40\x20\x20\x57\x48\105\122\105\40\x61\56\145\x78\x69\x73\164\x65\156\143\151\x61\41\x3d\60\40\46\46\40\141\x2e\x67\162\x75\160\157\x21\75\60\66\40" . $sql . "\x20\x26\x26\40\x61\56\x70\141\x72\x61\137\x77\x65\142\75\x27\61\x27\x20\x47\122\117\125\120\40\x42\x59\40\141\56\x63\x6f\x64\x69\x67\x6f")->num_rows(); return $bd; } public function reg_pedido($a, $b, $c) { if ($c != '') { $val = $this->db->query("\123\105\x4c\105\103\124\40\x4e\125\x4c\114\x20\106\122\117\115\x20\164\145\x6d\137\x70\x65\x64\x69\144\157\40\x57\110\105\122\105\x20\x63\157\144\x5f\155\145\144\x3d\47{$a}\x27\x20\x26\x26\40\x63\157\144\137\143\154\x69\x3d\47{$c}\47")->num_rows(); if ($val == 0 && $b > 0) { $noped = array("\143\157\x64\x69\x67\157" => $a, "\143\154\x69\145\156\164\145" => $c, "\143\141\156\164" => $b); $this->db->insert("\156\x6f\160\145\144", $noped); $val2 = $this->db->query("\x53\105\114\105\103\x54\x20\122\x4f\125\116\104\x28\x28\x53\125\115\x28\141\x2e\x63\x61\x6e\x74\x69\x64\x61\x64\x29\x2d\123\x55\x4d\x28\x61\56\x63\157\156\x73\x75\155\151\144\157\51\51\55\x28\x62\56\143\157\x6d\160\x72\157\x6d\145\164\x69\144\x6f\53\x28\123\x45\114\x45\103\124\x20\x49\x46\50\x53\x55\115\50\x63\141\156\164\x3e\x30\x29\x2c\123\x55\115\x28\143\x61\156\164\x29\54\x30\x29\40\106\122\117\x4d\40\x74\x65\x6d\x5f\x70\145\x64\151\x64\157\x20\x57\x48\x45\122\105\x20\x63\x6f\x64\137\155\x65\x64\75\141\x2e\143\x6f\144\151\147\x6f\141\162\164\x29\x29\x29\x20\x65\170\151\163\164\54\x20\x62\56\144\163\143\x74\x6f\x5f\155\x65\144\x69\143\141\x6d\145\156\164\157\163\40\144\145\x73\x63\165\x2c\40\x62\56\x64\163\x63\164\157\x5f\x6d\x65\144\151\143\141\x6d\145\156\x74\157\163\62\40\x64\145\163\x63\x75\62\40\12\40\40\40\40\x20\x20\40\40\40\x20\40\40\106\x52\x4f\115\x20\141\162\164\151\154\x6f\x74\145\x73\x20\x41\123\x20\141\xa\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\x4a\117\111\116\x20\x61\162\x74\x69\143\165\154\157\40\x41\123\x20\x62\x20\x4f\x4e\40\x61\x2e\143\x6f\x64\151\x67\x6f\141\x72\164\75\x62\56\x63\157\144\151\x67\x6f\40\x26\46\x20\x62\56\x70\x61\162\x61\x5f\167\145\x62\x3d\47\x31\47\xa\x20\x20\40\40\40\40\x20\x20\40\40\40\40\127\x48\x45\x52\x45\x20\x61\x2e\x63\x6f\144\151\x67\x6f\141\162\x74\75\47{$a}\x27\x20\46\x26\40\x61\x2e\x61\154\x6d\141\x63\145\x6e\40\116\x4f\x54\x20\x49\116\40\50\60\61\54\60\65\54\x30\66\54\x30\70\x29\40\107\x52\117\125\x50\40\x42\131\40\141\56\143\x6f\x64\x69\x67\157\x61\x72\164")->row(); if ($b <= $val2->exist) { $datos = array("\143\x6f\x64\137\x6d\145\x64" => $a, "\x63\x6f\144\x5f\143\x6c\x69" => $c, "\x63\x61\x6e\x74" => $b, "\x64\163\x63\164\x6f\160\x72\143" => $val2->descu, "\x64\163\x63\x74\x6f\x70\162\x63\x32" => $val2->descu2); $this->db->insert("\164\145\155\x5f\160\145\x64\x69\x64\157", $datos); } else { if ($val2->exist > 0) { $datos = array("\x63\157\x64\x5f\x6d\145\144" => $a, "\143\157\x64\x5f\143\x6c\x69" => $c, "\x63\x61\x6e\164" => $val2->exist, "\x64\x73\x63\x74\x6f\160\x72\x63" => $val2->descu, "\144\163\x63\x74\x6f\x70\x72\x63\62" => $val2->descu2); $this->db->insert("\x74\x65\155\x5f\160\x65\x64\151\x64\157", $datos); } } } } return $this->db->affected_rows(); } public function pedidos($c) { $this->load->library("\x74\x61\x62\154\145"); $html = ''; $subtot = 0; $total = 0; $iva = 0; $totdesc = 0; $totdesclinea = 0; $i = 0; $html .= "\74\x74\x61\142\154\x65\x20\143\154\x61\x73\163\75\42\167\x33\x2d\x74\141\142\154\x65\x20\x77\63\55\x68\x6f\166\145\162\141\x62\154\145\x22\76\74\x74\x72\x20\143\154\x61\x73\x73\75\x22\x77\x33\55\146\157\156\x64\x6f\x64\x72\x6f\151\144\x22\x3e\x3c\x74\x68\76\x4e\x3c\x2f\x74\x68\x3e\x3c\x74\x68\76\120\x72\x6f\144\x75\143\x74\x6f\74\57\164\150\76\x3c\x74\150\x3e\103\141\156\x74\x69\144\141\x64\x3c\x2f\164\x68\76\74\x74\150\76\120\162\145\x63\x69\157\x3c\x2f\x74\x68\x3e\x3c\x74\x68\x3e\x53\165\142\56\x54\x6f\x74\x61\154\74\57\x74\x68\x3e\x3c\164\x68\76\x49\126\x41\x3c\57\x74\x68\76\x3c\164\150\x3e\x44\x65\163\x63\x75\x3c\57\x74\x68\x3e\x3c\164\150\x3e\104\145\x73\x63\x75\x2e\114\x69\156\x65\141\x6c\x3c\x2f\x74\x68\76\x3c\x74\x68\x3e\124\x6f\x74\x61\154\x3c\57\164\150\76\74\164\150\x3e\74\x2f\164\150\x3e\x3c\x2f\x74\162\76"; $clidescu = $this->db->query("\x53\x45\114\105\103\124\40\144\145\163\143\165\x65\156\x74\157\40\x6e\x20\x46\x52\x4f\115\x20\143\x6c\151\x65\155\x70\x72\145\40\127\110\x45\x52\x45\40\x63\x6f\144\151\147\x6f\75\47{$c}\47")->row(); if ($clidescu->n != '') { $desculinea = $clidescu->n; } else { $desculinea = 0; } $bd = $this->db->query("\123\105\114\105\103\x54\x20\x61\x2e\x69\x64\137\160\x65\144\x69\144\157\54\x20\x62\56\x6e\x6f\x6d\x62\162\145\54\x20\x61\x2e\143\157\x64\137\x6d\x65\x64\54\40\x61\x2e\x63\x61\156\x74\54\x20\x72\157\x75\156\x64\x28\x62\56\x70\162\x65\143\x69\157\x31\x2c\x32\x29\40\160\x72\145\x63\151\x6f\x31\54\40\x43\x4f\x4e\103\101\124\x28\x52\x4f\125\x4e\x44\x28\x62\56\151\155\x70\x75\x65\x73\164\x6f\x31\51\x2c\x27\x25\x27\x2c\x27\40\x27\54\40\122\x4f\x55\x4e\x44\x28\142\x2e\160\x72\145\x63\x69\157\61\x2a\x28\x62\56\151\x6d\160\165\x65\163\x74\x6f\x31\x2f\61\60\x30\51\x2c\62\x29\52\x61\x2e\x63\141\x6e\x74\51\40\151\x76\141\x2c\12\40\40\40\x20\103\x4f\x4e\x43\x41\124\x28\142\56\x64\x73\143\x74\157\137\x6d\x65\144\151\143\141\155\145\156\x74\157\163\54\47\45\47\x2c\x27\x20\47\x2c\122\117\x55\116\x44\x28\142\x2e\160\x72\145\x63\x69\x6f\146\x69\x6e\61\52\50\x62\x2e\x64\163\x63\164\157\x5f\155\x65\x64\151\x63\141\155\145\x6e\x74\x6f\x73\x2f\61\x30\60\x29\54\x32\51\x2a\141\x2e\x63\x61\x6e\164\54\47\x20\x27\54\142\56\x64\x73\x63\164\x6f\137\x6d\145\x64\x69\x63\141\155\145\x6e\x74\x6f\163\62\x2c\x27\45\x27\54\x27\40\x27\x2c\x52\x4f\x55\x4e\x44\50\x62\x2e\x70\162\x65\x63\151\157\x66\151\x6e\61\x2a\x28\x62\x2e\144\x73\143\164\157\137\x6d\145\x64\x69\x63\x61\155\145\156\x74\157\163\62\x2f\x31\x30\x30\x29\x2c\62\x29\x2a\x61\x2e\143\x61\x6e\164\x29\40\144\145\x73\x63\165\54\x20\103\117\116\x43\101\x54\x28\122\117\x55\x4e\x44\50{$desculinea}\x29\x2c\x27\45\47\x2c\x27\x20\x27\54\x52\x4f\125\116\104\50\x28\x62\x2e\160\x72\145\143\151\x6f\146\x69\156\61\55\50\x62\x2e\160\162\145\143\151\157\x66\x69\x6e\61\52\50\142\x2e\x64\163\x63\x74\157\137\155\145\144\151\x63\x61\x6d\x65\x6e\x74\157\x73\57\61\60\60\x29\51\55\x28\50\x62\x2e\x70\162\x65\x63\151\157\146\151\x6e\x31\x2d\x28\142\x2e\x70\162\x65\143\151\157\x66\x69\156\61\x2a\x28\x62\56\x64\x73\x63\x74\x6f\x5f\x6d\145\144\x69\143\141\x6d\x65\156\164\157\x73\57\x31\60\60\51\51\x29\52\50\x62\x2e\144\x73\143\164\x6f\x5f\x6d\x65\x64\x69\x63\x61\155\x65\156\164\x6f\x73\62\57\61\x30\x30\x29\51\51\52\x28{$desculinea}\x2f\x31\x30\x30\51\x2c\62\x29\x2a\141\x2e\143\x61\156\164\x29\x20\x64\145\x73\143\165\154\x69\156\145\141\54\12\x20\40\x20\40\50\x52\x4f\x55\116\104\x28\x62\x2e\x70\x72\145\x63\151\157\x66\x69\x6e\x31\52\50\x62\56\144\163\x63\x74\157\137\x6d\x65\144\x69\143\141\x6d\x65\x6e\x74\x6f\163\x2f\x31\60\60\x29\x2c\62\x29\x2a\141\56\143\141\x6e\164\x29\x2b\50\x52\117\125\116\x44\50\x62\56\160\x72\x65\x63\x69\x6f\x66\x69\x6e\61\52\50\x62\x2e\x64\x73\143\x74\157\137\x6d\145\x64\x69\143\x61\155\145\x6e\x74\x6f\163\62\57\x31\x30\x30\51\54\x32\51\x2a\141\56\143\x61\156\164\51\x20\x64\x65\163\143\165\62\x2c\122\x4f\125\116\x44\50\x28\142\x2e\x70\162\145\x63\x69\157\x66\151\x6e\x31\55\50\x62\x2e\160\x72\x65\x63\x69\157\x66\x69\156\61\x2a\50\142\56\144\163\143\164\x6f\137\155\145\x64\x69\x63\x61\155\145\x6e\164\x6f\x73\57\x31\x30\x30\x29\x29\x29\x2a\50{$desculinea}\x2f\61\x30\x30\x29\x2c\x32\51\52\141\56\x63\x61\156\x74\40\144\145\163\143\x75\154\151\x6e\145\141\62\x2c\12\40\x20\x20\40\x52\x4f\125\x4e\x44\50\142\56\x70\x72\x65\143\x69\157\61\52\x61\56\x63\x61\x6e\x74\54\x32\51\x20\x73\x75\x62\164\x6f\164\x2c\122\117\125\116\104\x28\x61\56\143\141\156\x74\52\x52\x4f\125\116\104\x28\142\56\160\162\x65\x63\x69\x6f\x66\x69\156\x31\55\x28\x62\56\x70\x72\145\x63\x69\157\x66\151\156\x31\52\50\142\x2e\144\x73\143\x74\157\137\155\145\144\151\143\x61\155\x65\x6e\164\x6f\163\x2f\61\60\x30\51\x29\x2d\50\x28\142\56\x70\162\145\143\151\x6f\146\151\156\x31\x2d\x28\142\56\160\x72\x65\x63\x69\157\x66\x69\x6e\x31\x2a\50\142\56\144\163\x63\x74\157\x5f\x6d\145\x64\x69\143\x61\x6d\x65\x6e\164\157\x73\57\x31\x30\60\51\51\x29\52\x28{$desculinea}\57\61\x30\x30\x29\51\54\62\x29\54\62\51\40\164\x6f\x74\141\154\12\x20\x20\x20\40\x20\106\122\117\x4d\40\164\145\155\x5f\x70\x65\x64\x69\x64\157\40\x41\123\40\141\12\x20\x20\x20\40\112\117\111\x4e\40\141\162\164\151\x63\165\154\x6f\40\101\123\x20\x62\40\x4f\x4e\40\141\x2e\143\x6f\x64\137\155\145\x64\x3d\x62\x2e\x63\157\x64\151\x67\157\xa\40\40\40\40\40\x57\110\105\122\105\40\x61\x2e\x63\157\144\x5f\143\154\x69\x3d\47{$c}\x27")->result(); foreach ($bd as $dt) { if ($dt->desculinea2 > 0 || $dt->descu2) { $color = "\x63\x6c\x61\x73\163\x3d\x22\x77\63\x2d\x64\162\x6f\151\x64\62\x22"; $color2 = "\x77\63\55\x64\162\157\151\x64\x32"; } else { $color = "\143\154\141\x73\163\75\42\167\x33\55\x64\162\x6f\x69\x64\x22"; $color2 = "\x77\63\55\x64\x72\157\x69\144"; } $i++; $total += $dt->total; $iva += $dt->iva; $totdesc += $dt->descu2; $totdesclinea += $dt->desculinea2; $subtot += $dt->subtot; $html .= "\x3c\x69\156\x70\x75\164\40\164\x79\160\x65\x3d\x22\150\151\x64\144\x65\x6e\x22\x20\x69\x64\x3d\42\x70\x65\x64" . $i . "\x22\x20\156\x61\x6d\x65\75\x22\x69\144\x70\x65\x64\x22\40\166\x61\x6c\x75\x65\75\42" . $dt->id_pedido . "\x22\76\74\151\156\160\x75\x74\40\x74\171\x70\145\x3d\42\x68\x69\144\x64\x65\x6e\42\40\166\141\154\x75\x65\x3d\42" . $dt->cant . "\x22\x20\156\x61\x6d\145\75\42\x63\x61\x6e\x74\157\162\x67\42\x3e"; $html .= "\x3c\164\162\76\74\x74\x64\x3e" . $i . "\74\x2f\164\x64\x3e\x3c\164\x64\76" . $dt->nombre . "\x3c\57\x74\144\76\74\164\x64\76\74\x69\156\x70\x75\164\x20\x74\x79\x70\x65\x3d\42\x74\145\x78\x74\x22\40\x63\x6c\x61\x73\163\x3d\42\x77\63\55\x69\x6e\160\165\164\x22\x20\40\156\x61\x6d\145\75\x22\143\141\156\164\x6e\x65\167\42\x20\163\164\x79\x6c\x65\x3d\42\x77\x69\144\164\150\x3a\62\x30\x70\x78\x22\x20\x76\x61\154\x75\x65\x3d\x22" . $dt->cant . "\x22\x20\x6f\156\x63\150\141\156\x67\x65\75\x22\143\141\x6e\x74\143\141\162\163\x28\51\x22\76\x3c\x2f\x74\144\x3e\x3c\164\x64\76" . $dt->precio1 . "\74\57\x74\x64\76\12\40\x20\x20\40\40\40\x20\40\x3c\x74\x64\x3e" . $dt->subtot . "\x3c\57\164\144\76\74\x74\x64\76" . $dt->iva . "\74\x2f\x74\x64\76\74\164\144\x20" . $color . "\x3e" . $dt->descu . "\x3c\x2f\x74\x64\x3e\74\164\x64\x20" . $color . "\x3e" . $dt->desculinea . "\74\57\164\144\76\x3c\164\x64\40" . $color . "\x3e" . $dt->total . "\74\x2f\164\x64\x3e\12\x20\x20\40\x20\x20\x20\x20\40\x3c\x74\x64\x3e\74\x61\40\157\156\143\x6c\x69\143\153\x3d\x22\x65\x6c\x69\155\137\x70\x65\144\151\x64\157\x28\44\x28\x27\x23\160\x65\x64" . $i . "\47\51\56\x76\x61\154\50\51\x29\73\x72\x65\164\x75\162\156\40\x66\141\154\163\145\x3b\x22\x20\163\164\171\154\x65\75\42\143\x75\x72\163\x6f\162\x3a\x70\157\151\x6e\x74\145\x72\x22\x3e\x3c\x69\155\147\40\x73\x72\x63\x3d\x22" . base_url() . "\151\155\141\147\x65\163\57\x62\157\162\162\141\x72\56\160\156\x67\x22\40\141\154\x74\x3d\x22\x45\x6c\x69\x6d\151\156\141\162\x22\x20\x74\x69\x74\154\x65\x3d\42\x45\x6c\x69\x6d\151\x6e\141\162\x22\x20\x73\x74\x79\154\145\75\x22\167\151\144\x74\150\x3a\x31\66\160\170\x3b\150\x65\x69\147\150\164\72\61\x36\x70\170\73\142\x6f\x72\144\145\x72\72\60\x3b\x22\76\74\x2f\x61\x3e\x3c\x2f\164\x64\x3e\x3c\57\x74\162\x3e"; } $html .= $this->table->generate(); $html .= "\12\x20\40\x20\40\x3c\x74\141\x62\154\145\x20\x63\x6c\141\163\x73\75\42\167\63\x2d\x74\x61\x62\x6c\x65\x2d\141\154\154\40\167\x33\55\x68\157\x76\145\162\x61\x62\x6c\145\40\167\63\x2d\143\x65\x6e\164\145\162\145\144\x22\x3e\12\40\40\x20\40\x3c\164\x72\x3e\12\x20\x20\40\x20\x3c\164\x64\40\143\x6c\141\163\163\x3d\42\167\63\x2d\146\x6f\156\x64\157\x64\x72\x6f\x69\x64\40\167\63\55\155\x65\144\151\x75\x6d\x22\x3e\x20\123\165\x62\x20\x54\x6f\164\x61\154\x3a\x20\74\57\164\144\76\xa\40\40\40\x20\74\x74\144\x20\x63\x6c\141\163\x73\75\42\x77\x33\55\x6d\x65\144\151\165\155\42\x3e" . $subtot . "\x3c\57\164\x64\76\12\x20\x20\40\40\74\57\164\x72\76\12\40\x20\40\x20\74\164\162\x3e\xa\x20\x20\40\x20\x3c\164\x72\76\xa\40\40\x20\40\74\164\144\40\x63\154\141\163\163\x3d\42\167\63\x2d\146\157\x6e\x64\157\144\162\157\x69\144\x20\x77\x33\55\x6d\145\x64\151\x75\155\x22\x3e\40\124\x6f\164\141\154\40\111\166\141\x3a\40\74\x2f\x74\x64\76\12\40\x20\40\40\x3c\164\x64\x20\143\154\x61\163\x73\75\x22\167\63\x2d\155\x65\x64\x69\x75\155\x22\76" . $iva . "\x3c\57\x74\x64\x3e\12\x20\x20\40\x20\x3c\57\164\162\x3e\xa\40\40\40\40\74\x74\x72\x3e\xa\x20\40\x20\40\x3c\164\162\76\12\x20\x20\x20\40\x3c\164\x64\x20\143\x6c\141\163\163\x3d\42\x77\63\55\x66\x6f\x6e\x64\x6f\144\x72\x6f\151\144\x20\167\63\55\x6d\145\x64\151\165\155\42\76\40\x54\x6f\164\141\154\x20\x44\145\163\x63\x75\x65\156\x74\157\x20\120\162\157\144\165\143\x74\x6f\72\40\74\57\164\x64\76\12\40\x20\40\x20\x3c\x74\x64\x20\143\x6c\141\x73\163\x3d\x22\x77\63\55\x6d\x65\x64\x69\165\155\40" . $color2 . "\42\x3e" . $totdesc . "\74\57\164\144\76\xa\x20\40\x20\x20\x3c\x2f\x74\162\76\xa\40\x20\40\40\74\164\x72\76\12\40\x20\x20\x20\74\164\x72\76\12\x20\x20\40\x20\x3c\x74\x64\x20\x63\x6c\x61\x73\x73\75\x22\167\x33\x2d\x66\x6f\x6e\144\157\144\x72\157\x69\x64\40\x77\x33\55\x6d\145\x64\x69\165\155\x22\76\40\124\157\164\x61\154\x20\104\x65\163\143\165\x65\156\x74\x6f\40\114\151\x6e\x65\141\72\x20\x3c\x2f\164\144\76\12\x20\40\40\x20\x3c\164\144\x20\x63\154\141\x73\163\x3d\x22\167\x33\55\155\145\x64\151\x75\155\x20" . $color2 . "\x22\x3e" . $totdesclinea . "\x3c\57\x74\x64\x3e\xa\x20\x20\40\40\x3c\x2f\x74\162\76\12\x20\x20\x20\x20\74\x74\162\76\12\x20\40\x20\40\74\164\x64\40\143\x6c\x61\163\x73\75\42\x77\x33\x2d\146\157\156\144\157\x64\162\x6f\x69\144\x20\x77\x33\x2d\x6d\x65\x64\x69\165\155\42\x3e\40\124\157\x74\x61\154\72\x20\74\57\164\x64\76\xa\x20\40\x20\x20\x3c\x74\144\40\x63\154\x61\163\163\x3d\x22\167\63\x2d\155\145\x64\x69\165\155\40" . $color2 . "\x22\76" . $total . "\x3c\x2f\x74\x64\x3e\12\x20\40\x20\40\x3c\x2f\164\162\x3e\xa\x20\x20\x20\40\74\57\164\141\x62\x6c\x65\x3e\x3c\142\x72\x3e\12\40\40\40\40"; if ($i > 0) { $html .= "\74\151\x6e\x70\165\164\40\164\171\x70\145\x3d\x22\x73\x75\x62\155\151\164\42\x20\x6e\x61\155\x65\75\42\123\x75\142\x6d\x69\x74\x22\x20\157\156\143\154\151\x63\153\75\42\141\x6c\145\162\164\141\x28\x29\73\x22\40\166\x61\154\x75\145\x3d\x22\x45\156\166\x69\141\162\40\106\141\143\164\165\x72\x61\42\x20\x63\x6c\x61\163\x73\75\x22\x77\x33\55\x62\x75\164\x74\x6f\x6e\x20\x77\63\x2d\162\x6f\x75\x6e\144\55\170\x78\154\141\162\147\x65\x20\x77\x33\x2d\143\145\156\x74\145\162\145\144\40\167\63\55\146\157\156\x64\157\x64\x72\157\x69\144\40\x77\63\55\150\x6f\x76\x65\162\55\167\150\151\164\x65\x20\167\63\x2d\x62\157\162\x64\145\162\40\x77\63\x2d\150\x6f\166\145\x72\55\142\x6f\162\x64\x65\x72\x2d\142\141\162\x72\141\163\42\x2f\x3e"; } $bdfac = $this->db->query("\123\x45\114\x45\x43\x54\40\144\56\144\x6f\x63\165\x6d\145\x6e\x74\157\x2c\x64\x2e\146\145\x63\150\141\143\x72\x65\141\x2c\40\144\x2e\164\x6f\164\x6e\145\164\x6f\54\x64\56\164\157\164\x69\155\x70\165\145\163\164\x2c\40\x64\x2e\164\157\164\x61\154\x66\151\156\141\154\54\40\123\125\x4d\x28\145\x2e\143\141\x6e\x74\x69\144\141\144\51\x20\x63\x61\x6e\164\54\x20\146\56\x73\164\141\164\165\x73\x20\x46\122\x4f\x4d\x20\x6f\160\145\x72\x74\x69\40\x41\123\40\x64\xa\40\x20\40\x20\112\117\x49\116\x20\x6f\160\x65\162\155\x76\x20\101\123\x20\x65\x20\x4f\116\40\144\x2e\x64\157\x63\x75\x6d\145\x6e\x74\x6f\x3d\145\56\144\157\x63\x75\155\145\156\x74\157\xa\40\40\x20\x20\x4a\117\x49\116\40\x63\x6f\x6e\x74\162\157\x6c\x5f\x6f\x70\x65\x72\x74\x69\x20\101\x53\40\146\40\117\x4e\x20\144\x2e\x61\156\x74\144\157\143\x3d\x66\56\144\x6f\143\12\x20\40\x20\40\x57\110\x45\122\105\x20\143\157\x64\x63\x6c\151\x65\x6e\x74\x65\75\47{$c}\x27\x20\x26\46\40\144\x2e\146\x65\x63\150\141\143\x72\145\x61\x3e\x3d\104\101\x54\105\137\x41\104\x44\50\x43\x55\122\104\x41\124\105\50\51\x2c\40\111\x4e\124\x45\x52\126\101\114\x20\x2d\x31\60\40\x44\101\x59\51\x20\12\x20\x20\40\x20\107\122\117\125\120\x20\x42\x59\x20\144\56\x64\x6f\143\x75\155\145\156\164\157\x20\117\x52\104\105\x52\40\102\131\x20\144\x2e\x66\x65\x63\x68\141\x63\x72\145\x61\x20\144\145\163\143\40\114\111\x4d\x49\124\40\61\x30")->result(); $this->table->set_heading("\116\302\xb0", "\106\x65\143\150\x61", "\123\165\142\56\124\157\164\x61\154", "\111\x76\x61", "\124\157\x74\x61\x6c", "\x43\141\x6e\x74\151\144\141\x64", "\74\164\150\x3e\105\163\164\x61\164\x75\x73\74\x74\x68\76"); $html .= "\x3c\150\x33\x3e\x55\x6c\x74\151\x6d\157\163\x20\x31\60\40\115\x6f\166\x69\155\151\145\x6e\x74\x6f\x73\x3a\x3c\x2f\150\x33\76\x3c\142\x72\x3e"; foreach ($bdfac as $dtfac) { if ($dtfac->status == "\x30") { $status = "\74\164\x64\x20\x63\x6c\141\x73\163\75\x22\167\63\55\171\145\154\154\x6f\167\40\x77\63\55\x63\x65\x6e\164\145\x72\x22\x3e\x45\156\x76\x69\141\x64\157\74\57\x74\x64\76"; } elseif ($dtfac->status == "\64") { $status = "\74\164\x64\x20\143\x6c\x61\163\163\75\x22\x77\63\x2d\141\161\165\141\40\x77\63\x2d\x63\x65\x6e\x74\x65\x72\42\x3e\122\x65\143\151\x62\151\144\x6f\x3c\57\x74\x64\x3e"; } elseif ($dtfac->status == "\x31") { $status = "\74\164\144\x20\x63\154\141\x73\x73\75\x22\x77\x33\55\160\x61\154\145\55\171\145\x6c\x6c\157\167\x20\x77\x33\x2d\x63\x65\156\164\x65\162\42\x3e\120\x72\x6f\143\145\163\x61\x6e\x64\157\x3c\57\x74\144\76"; } elseif ($dtfac->status == "\x32") { $status = "\x3c\164\x64\40\143\154\141\163\163\75\42\x77\x33\55\x62\x6c\x75\145\40\167\x33\55\143\145\x6e\164\x65\162\42\76\105\x6d\x70\141\x63\141\x64\157\74\x2f\x74\144\x3e"; } elseif ($dtfac->status == "\63") { $status = "\74\x74\144\x20\x63\154\x61\163\163\x3d\x22\x77\x33\x2d\x6c\x69\x6d\x65\x20\x77\x33\55\x63\145\x6e\164\x65\162\42\76\103\x61\162\147\141\x64\x6f\x3c\57\164\x64\76"; } elseif ($dtfac->status == "\x35") { $status = "\x3c\x74\144\40\143\x6c\141\163\x73\x3d\42\x77\63\x2d\147\x72\145\x65\156\40\x77\x33\55\143\145\x6e\x74\145\162\42\x3e\x44\145\163\160\x61\143\x68\141\x64\x6f\x3c\x2f\164\x64\x3e"; } $this->table->add_row('' . $dtfac->documento . '', '' . $dtfac->fechacrea . '', '' . $dtfac->totneto . '', '' . $dtfac->totimpuest . '', '' . $dtfac->totalfinal . '', '' . $dtfac->cant . '', $status); } $fac = $this->table->generate(); $html .= '' . $fac . ''; return $html; } function cantcars($id, $cant) { $row = count($id); $v = 0; for ($i = 0; $i < $row; $i++) { if ($id != '') { $this->db->query("\125\120\104\101\124\x45\x20\x74\x65\x6d\137\160\145\144\151\144\x6f\40\x53\105\124\40\x63\141\156\x74\75\x27" . $cant[$i] . "\47\x20\127\x48\105\x52\105\x20\x69\144\137\160\145\x64\151\x64\157\75\47" . $id[$i] . "\47"); if ($this->db->affected_rows() > 0) { $v++; } } } return $v; } function carscli($cli) { return $this->db->query("\x53\105\114\x45\x43\x54\x20\116\125\114\x4c\40\x46\x52\117\115\x20\x74\x65\x6d\137\x70\x65\x64\151\144\157\40\127\110\x45\122\105\x20\143\157\144\137\143\154\151\x3d\47{$cli}\x27")->num_rows(); } public function enviar_fac($a, $vend, $b, $tip, $descu) { $bddias = $this->db->query("\x53\x45\114\x45\103\x54\40\142\x2e\x64\x69\x61\163\x69\156\x64\x65\x78\x2c\40\142\56\x64\151\141\x73\x63\x72\145\144\x20\106\122\x4f\x4d\40\164\145\155\137\x70\x65\144\151\144\x6f\x20\x61\40\112\x4f\x49\116\x20\x61\x72\164\x69\x63\x75\154\x6f\x20\142\x20\117\x4e\x20\x61\56\x63\157\144\x5f\x6d\x65\x64\75\142\x2e\143\x6f\144\x69\x67\157\40\x57\110\105\122\x45\40\141\56\143\157\144\137\143\x6c\151\x3d\47{$a}\x27\x20\107\x52\x4f\x55\120\40\102\x59\40\x62\56\x64\x69\141\x73\x69\156\144\x65\x78")->result(); $v = 0; $dtcli = $this->db->query("\123\105\x4c\105\103\124\x20\156\157\155\142\x72\x65\54\x20\x6e\x72\x6f\162\x69\146\x2c\x20\x64\x69\162\145\x63\x63\151\x6f\156\54\40\x74\x65\154\145\146\x6f\x6e\157\137\x6d\157\166\x69\x6c\54\40\163\x65\x63\x74\157\x72\54\x20\163\x75\x62\x63\x6f\x64\x69\147\157\x2c\x20\166\145\156\144\145\x64\x6f\162\54\x64\151\x61\x73\54\144\145\x73\143\165\x65\156\x74\157\x20\x64\x65\x73\x63\x75\x20\x46\x52\117\115\x20\143\x6c\x69\x65\x6d\160\162\145\40\x57\x48\105\122\x45\x20\143\x6f\144\151\x67\157\75\x27{$a}\47")->row(); if ($descu > 0 && ($dtcli->descu == 0 || $dtcli->descu == null || $dtcli->descu == '')) { $descu = $descu; } elseif ($dtcli->descu > 0) { $descu = $dtcli->descu; } else { $descu = 0; } foreach ($bddias as $dias) { $valprec = $this->db->query("\123\x45\x4c\105\x43\124\40\116\x55\x4c\x4c\40\x46\x52\117\x4d\40\x61\162\x74\151\x70\162\145\x63\x20\127\x48\x45\122\105\x20\146\145\x63\150\141\x3d\143\165\x72\x64\141\x74\x65\x28\x29")->num_rows(); if ($valprec == 0) { $prec = "\x4a\x4f\111\x4e\x20\141\162\164\x69\x63\165\x6c\157\40\101\123\40\x62\x20\x4f\116\40\x28\124\x52\x49\115\50\x61\x2e\143\x6f\144\137\x6d\x65\144\51\x3d\124\122\111\115\x28\x62\56\143\x6f\144\151\x67\x6f\51\40\46\x26\x20\x62\x2e\160\x61\x72\141\137\167\145\142\75\x31\x29"; } else { $prec = "\112\117\111\x4e\x20\x61\162\x74\151\x70\x72\145\x63\40\101\123\x20\x62\40\x4f\x4e\40\x28\124\x52\x49\115\50\x61\x2e\x63\x6f\x64\x5f\155\x65\x64\51\x3d\x54\x52\x49\115\50\x62\x2e\143\157\144\x69\147\x6f\x29\40\46\x26\40\x62\x2e\146\x65\143\x68\x61\x3d\x63\x75\x72\144\x61\164\x65\50\51\51\40\112\117\111\x4e\40\x61\x72\x74\151\x63\x75\x6c\157\40\101\x53\40\143\40\117\116\x20\x28\x54\x52\111\x4d\x28\x62\56\143\157\x64\151\x67\157\51\x3d\x54\122\111\115\x28\143\x2e\x63\x6f\144\x69\x67\x6f\51\x20\x26\46\x20\x63\56\x70\x61\x72\x61\x5f\x77\145\x62\75\61\51"; } $bdped = $this->db->query("\123\105\114\x45\x43\124\x20\x61\56\x69\x64\137\160\x65\x64\151\144\x6f\x2c\40\141\x2e\x63\157\x64\x5f\155\x65\144\54\x61\x2e\144\x73\143\164\157\160\x72\x63\54\40\142\x2e\x6e\x6f\155\142\x72\x65\54\142\56\147\x72\165\160\157\x2c\141\56\x63\141\156\x74\54\x20\142\x2e\x63\157\x73\164\x6f\x2c\142\56\x70\x72\145\143\151\157\x31\54\x20\142\x2e\x69\x6d\x70\x75\x65\x73\x74\157\x31\54\12\x20\x20\x20\40\111\106\50\x62\x2e\151\x6d\160\165\x65\x73\x74\157\x31\x3e\x30\x2c\50\x28\x62\56\x70\162\145\x63\x69\x6f\x31\x2d\50\x62\56\x70\x72\145\x63\151\157\x31\52\50\141\x2e\x64\163\143\x74\x6f\x70\x72\x63\57\61\x30\60\x29\x29\51\x2a\50\142\56\x69\155\160\x75\x65\x73\164\157\61\57\61\x30\60\51\x29\x2a\141\x2e\143\141\156\x74\54\60\51\40\151\166\141\54\12\x20\x20\x20\111\x46\x28\x61\56\x64\163\143\164\157\160\x72\x63\x3e\60\54\x28\x62\x2e\x70\162\145\x63\151\x6f\146\x69\x6e\61\55\50\142\x2e\160\162\145\x63\x69\x6f\x66\x69\x6e\x31\52\x28\x61\x2e\x64\x73\x63\164\x6f\x70\x72\x63\x2f\61\x30\x30\51\x29\51\54\142\56\160\162\145\143\x69\x6f\x66\151\156\61\x29\40\x70\162\145\x63\x69\157\146\151\156\61\x2c\x20\12\x20\40\40\x20\x49\106\x28\x61\x2e\144\x73\x63\x74\x6f\160\x72\x63\76\x30\x2c\x28\x62\56\160\162\145\x63\x69\x6f\x31\x2a\x61\x2e\143\141\x6e\164\x29\55\50\x28\142\x2e\160\x72\145\x63\x69\x6f\61\x2a\141\56\x63\141\x6e\164\x29\x2a\50\141\x2e\x64\x73\143\x74\x6f\160\x72\x63\57\x31\60\x30\51\51\x2c\x28\x62\x2e\160\162\145\x63\x69\157\x31\52\141\x2e\x63\x61\x6e\x74\51\51\40\163\165\x62\164\x6f\164\54\xa\40\x20\x20\x28\x61\x2e\143\x61\156\x74\x2a\x49\106\x28\x61\x2e\x64\163\143\x74\157\x70\x72\x63\76\x30\54\50\142\x2e\160\x72\145\143\151\x6f\146\151\156\61\55\x28\x62\56\160\x72\145\x63\151\157\x66\151\x6e\x31\x2a\x28\x61\56\x64\x73\x63\x74\x6f\160\162\x63\x2f\61\60\x30\x29\51\51\54\142\56\x70\162\145\143\151\157\146\x69\156\61\51\x29\40\164\157\x74\141\x6c\54\40\12\40\40\x20\111\106\50\x62\56\151\155\160\x75\x65\163\x74\157\x31\x3e\60\54\x28\141\x2e\143\x61\x6e\x74\x2a\x49\106\x28\x61\x2e\x64\163\143\x74\x6f\160\x72\x63\x3e\x30\54\x28\x62\56\160\162\145\x63\151\x6f\61\55\x28\x62\56\x70\162\x65\143\151\x6f\x31\52\x28\x61\x2e\144\x73\143\x74\157\160\x72\143\x2f\x31\x30\x30\x29\51\51\54\x62\56\x70\162\x65\143\x69\157\61\51\x29\x2c\60\51\x20\142\x61\163\x65\151\155\x70\x2c\x20\12\x20\x20\40\111\106\50\x62\56\151\155\160\165\145\x73\x74\157\61\x3d\60\x2c\111\x46\50\141\x2e\144\163\143\x74\x6f\160\x72\x63\76\60\54\x62\56\160\x72\145\143\x69\x6f\x31\x2d\x28\x62\x2e\160\x72\x65\x63\151\x6f\61\52\x28\141\56\x64\x73\x63\164\157\x70\162\x63\x2f\61\60\60\51\x29\54\x62\56\x70\162\145\x63\151\x6f\x31\51\52\141\x2e\x63\x61\156\x74\54\x30\51\x20\x73\x69\156\151\155\160\x2c\x20\142\x2e\x63\x6f\155\x70\162\x6f\155\x65\164\151\x64\x6f\54\xa\40\x20\40\141\56\144\163\x63\x74\157\160\x72\143\40\144\163\x63\x74\157\x75\x6e\x69\164\54\12\x20\x20\40\151\146\x28\141\x2e\x64\163\143\x74\x6f\160\x72\x63\76\60\54\50\142\x2e\160\x72\145\143\x69\157\x31\x2a\x28\141\56\144\x73\143\x74\157\160\162\x63\57\61\60\x30\51\51\x2c\x30\x29\40\x64\163\x63\x74\157\x70\162\x63\54\12\x20\x20\x20\151\x66\x28\x61\x2e\144\163\143\x74\x6f\160\162\x63\x3e\x30\x2c\x28\x28\142\x2e\x70\x72\145\x63\x69\x6f\61\52\x28\x61\56\x64\163\x63\x74\157\x70\162\143\57\x31\x30\x30\51\51\x2a\141\56\143\141\156\164\x29\x2c\x30\51\x20\164\157\164\x64\145\163\143\x2c\xa\x20\x20\40\x61\56\144\x73\143\164\157\160\x72\x63\62\40\144\163\143\164\157\x75\x6e\151\164\62\x2c\xa\x20\x20\x20\x69\x66\50\x61\x2e\144\163\143\x74\157\160\162\143\x32\x3e\x30\54\x28\111\x46\50\141\56\x64\x73\143\x74\x6f\160\x72\143\x3e\60\54\x28\x62\56\x70\162\145\x63\151\x6f\61\x2d\50\142\x2e\160\x72\x65\143\x69\x6f\x31\x2a\50\x61\x2e\144\163\x63\164\x6f\x70\162\x63\57\x31\60\x30\51\x29\51\54\x62\x2e\x70\162\145\x63\151\x6f\x31\x29\52\50\x61\x2e\x64\163\143\x74\157\x70\162\x63\x32\57\61\x30\60\x29\51\x2c\60\51\x20\144\163\143\164\157\x70\162\143\x32\x2c\xa\40\40\40\151\146\x28\x61\x2e\x64\x73\x63\164\x6f\160\x72\x63\62\76\x30\x2c\x28\50\111\106\x28\141\56\x64\x73\143\164\x6f\160\x72\143\x3e\60\54\50\142\x2e\x70\x72\145\143\151\x6f\61\55\x28\142\56\x70\162\x65\x63\151\x6f\x31\52\50\141\x2e\x64\163\x63\x74\157\x70\162\143\x2f\61\x30\60\x29\x29\51\54\142\x2e\160\x72\x65\x63\151\x6f\x31\x29\52\x28\141\56\x64\x73\143\164\157\x70\162\x63\62\x2f\61\60\60\x29\x29\52\x61\x2e\143\x61\156\164\x29\x2c\x30\51\40\164\x6f\164\x64\x65\x73\x63\x32\x2c\12\40\x20\40\x28\x62\x2e\160\x72\x65\143\x69\157\61\55\151\x66\50\x61\56\x64\163\x63\164\157\160\x72\143\x3e\60\x2c\x28\x62\x2e\x70\x72\x65\x63\x69\157\x31\x2a\x28\141\56\x64\163\143\164\x6f\x70\x72\x63\57\61\60\60\x29\51\54\x30\51\x2d\x69\146\x28\141\56\x64\x73\143\x74\157\160\x72\x63\62\76\x30\x2c\x28\111\x46\x28\141\x2e\144\163\x63\x74\157\x70\162\x63\76\x30\x2c\x28\142\56\160\x72\145\x63\x69\157\x31\55\x28\142\x2e\160\162\x65\143\x69\157\61\x2a\50\141\56\x64\163\143\x74\x6f\160\162\143\57\61\x30\x30\x29\x29\51\x2c\x62\x2e\160\162\145\143\151\x6f\x31\51\x2a\50\x61\56\144\163\x63\164\157\160\x72\x63\x32\x2f\x31\60\x30\51\51\x2c\60\x29\x29\x20\160\162\145\x63\x69\157\165\x6e\x69\x74\xa\40\x20\40\x46\x52\x4f\115\40\x74\145\x6d\137\x70\x65\x64\x69\x64\157\40\x41\123\x20\x61\12\40\x20\x20" . $prec . "\xa\x20\x20\40\x57\x48\105\x52\x45\x20\141\x2e\143\x6f\144\137\143\x6c\x69\75\47{$a}\47\40\x26\x26\x20\x62\x2e\144\151\x61\x73\x69\156\144\x65\x78\x3d\47{$dias->diasindex}\x27\40\x4f\122\104\105\122\40\102\131\40\x61\x2e\x63\x6f\x64\x5f\155\145\x64\x20\x41\123\103\73")->result(); $num = $this->db->query("\123\105\114\x45\x43\x54\40\111\x46\50\115\101\x58\50\x53\x55\x42\123\124\122\x28\144\157\143\54\x32\54\70\51\x29\53\61\76\x30\54\x4d\101\130\x28\123\125\102\123\124\122\x28\144\x6f\143\54\x32\x2c\70\51\51\x2b\61\x2c\x31\x29\40\156\40\x46\x52\117\115\x20\x63\157\x6e\x74\x72\x6f\154\137\157\x70\x65\162\164\x69\40\x57\110\x45\x52\105\40\x64\157\x63\40\x6c\x69\153\x65\x20\47\x25{$b}\45\x27")->row(); $documento = str_pad($num->n, 7, "\60", STR_PAD_LEFT); $tcosto = 0; $subtot = 0; $iva = 0; $baseimp = 0; $sinimp = 0; $total = 0; $totdesc = 0; $totdesc2 = 0; $i = 0; $descprm = 0; $pid = $this->genecod(12); foreach ($bdped as $dtped) { $tcosto += $dtped->costo; $subtot += $dtped->subtot; $iva += $dtped->iva; $baseimp += $dtped->baseimp; $sinimp += $dtped->sinimp; $total += $dtped->total; $totdesc += $dtped->totdesc; $totdesc2 += $dtped->totdesc2; $dsctoendm = $dtped->preciounit * ($descu / 100); $prcunit = $dtped->preciounit - $dsctoendm; $prcfin = $prcunit * (1 + $dtped->impuesto1 / 100); $descprm += $dsctoendm * $dtped->cant; $blot = $this->db->query("\x53\105\x4c\x45\103\124\40\x63\x2e\141\154\155\x61\x63\145\x6e\54\x63\x2e\x6c\157\x74\145\x2c\143\56\x63\141\x6e\x74\151\x64\141\x64\x2d\143\x2e\x63\157\156\163\x75\x6d\x69\144\x6f\40\145\x78\151\x73\x74\x20\106\x52\x4f\x4d\x20\141\162\x74\151\x6c\x6f\x74\145\163\40\101\x53\40\143\x20\xa\40\40\40\x20\40\x20\40\x20\x57\110\x45\x52\105\x20\x63\x2e\143\157\x64\x69\x67\157\141\162\x74\x3d\47{$dtped->cod_med}\47\40\46\x26\x20\50\x63\x2e\143\141\156\164\151\x64\141\144\x2d\143\x2e\143\157\x6e\163\x75\155\151\x64\x6f\x29\76\x30\x20\46\x26\x20\x63\x2e\x61\154\155\x61\x63\x65\x6e\x20\x4e\x4f\x54\x20\111\116\40\x28\60\x31\54\x30\65\x2c\60\66\54\x30\70\51\x20\x4f\122\104\105\122\40\102\131\40\143\x2e\166\x65\x6e\x63\145\x20\x41\x53\103")->result(); $cant = $dtped->cant; $newcant = 0; foreach ($blot as $dlot) { if ($dlot->exist >= $cant) { $newcant = $cant; $datos = array("\151\144\137\x65\x6d\160\x72\x65\163\x61" => "\x44\x4d\105\104\x49\106", "\141\x67\145\x6e\143\x69\x61" => "\60\60\x31", "\164\x69\x70\x6f\x64\x6f\x63" => "\x45\x53\120", "\x64\157\143\165\x6d\x65\x6e\x74\157" => '' . $b . $documento . '', "\147\162\x75\x70\x6f" => '' . $dtped->grupo . '', "\157\x72\x69\x67\145\156" => "\61", "\143\157\144\x69\147\x6f" => '' . $dtped->cod_med . '', "\160\x69\x64" => '' . $pid . '', "\x6e\157\155\x62\162\145" => '' . $dtped->nombre . '', "\143\157\x73\x74\157\165\156\151\x74" => '' . $dtped->costo . '', "\x70\162\145\143\151\157\x75\x6e\151\164" => $prcunit, "\x64\x73\143\164\157\165\x6e\x69\x74" => $dtped->dsctounit, "\144\163\143\x74\x6f\160\x72\x63" => $dtped->dsctoprc, "\x64\163\x63\x74\x6f\165\156\151\164\x32" => $dtped->dsctounit2, "\x64\163\x63\164\157\x70\162\143\x32" => $dtped->dsctoprc2, "\x64\x73\143\164\x6f\x65\x6e\x64\x70" => $descu, "\x64\163\x63\x74\x6f\x65\156\x64\155" => $dsctoendm, "\160\x72\145\143\151\x6f\146\x69\x6e" => $prcfin, "\x70\162\x65\143\151\x6f\x6f\x72\x69\x67\151\156\x61\154" => '' . $dtped->precio1 . '', "\x63\x61\156\164\151\x64\x61\x64" => '' . $newcant . '', "\x6d\157\156\164\x6f\x6e\145\x74\x6f" => '' . $dtped->subtot . '', "\x6d\x6f\156\164\157\164\x6f\164\141\154" => '' . $dtped->total . '', "\x74\151\x6d\x70\165\x65\x70\162\143" => '' . $dtped->impuesto1 . '', "\x61\x6c\155\x61\x63\145\x6e" => $dlot->almacen, "\160\162\x6f\x76\x65\145\x64\157\x72" => '' . $a . '', "\146\x65\x63\150\141\x64\157\143" => '' . date("\131\x2d\x6d\55\144") . '', "\151\155\160\165\145\163\164\157\61" => "\60", "\151\x6d\160\165\x65\x73\x74\x6f\62" => "\60", "\x76\145\x6e\144\x65\x64\x6f\x72" => $vend, "\x65\155\151\163\157\x72" => "\106\x41\103\124\x55\122\101\104", "\165\163\141\163\145\162\x69\x61\154" => "\62", "\164\151\160\157\x70\162\x65\x63\x69\157" => "\x31", "\x75\x6e\x69\x64\141\144" => "\125\116\104", "\141\147\x72\165\x70\141\x64\157" => "\x32", "\143\x6f\155\x70\x75\x65\x73\164\x6f" => "\62", "\x75\x73\x61\145\170\x69\163\x74" => "\61", "\x61\x75\x78\61" => '' . $dtped->cant . '', "\145\x73\164\x61\143\151\x6f\156" => "\x30\60\61", "\165\144\151\x6e\x61\x6d\151\x63\x61" => "\x31", "\142\x61\163\x65\x69\x6d\160\157\61" => '' . $dtped->baseimp . '', "\x62\x61\x73\145\x69\x6d\160\157\x32" => "\x30", "\154\157\164\145" => $dlot->lote, "\x69\x64\166\141\154\151\x64\x61\143\x69\157\156" => '', "\x66\145\x63\150\141\x79\150\x6f\x72\141" => '' . date("\131\55\155\55\144\40\x48\x3a\x69\x3a\x73") . '', "\x65\x6e\x76\151\141\144\157\x5f\153\155\157\x6e\x69\x74\157\162" => "\60"); $this->db->insert("\157\x70\x65\162\x6d\166", $datos); if ($this->db->affected_rows() > 0) { $i++; } break; } elseif ($dlot->exist < $cant) { $cant = $cant - $dlot->exist; $newcant = $dlot->exist; $datos = array("\x69\x64\x5f\x65\155\160\x72\x65\163\141" => "\104\x4d\x45\x44\x49\x46", "\x61\x67\145\x6e\143\x69\141" => "\60\60\x31", "\164\x69\160\x6f\x64\x6f\143" => "\105\x53\120", "\144\157\x63\165\155\145\156\x74\x6f" => '' . $b . $documento . '', "\x67\162\x75\160\x6f" => '' . $dtped->grupo . '', "\x6f\x72\151\x67\x65\x6e" => "\61", "\143\x6f\x64\x69\147\x6f" => '' . $dtped->cod_med . '', "\160\x69\144" => '' . $pid . '', "\x6e\157\155\142\162\x65" => '' . $dtped->nombre . '', "\x63\x6f\163\164\x6f\165\x6e\x69\x74" => '' . $dtped->costo . '', "\x70\x72\145\143\151\x6f\165\156\x69\x74" => $prcunit, "\x64\163\143\164\157\165\x6e\151\x74" => '' . $dtped->dsctounit . '', "\144\x73\x63\164\x6f\160\162\143" => '' . $dtped->dsctoprc . '', "\x64\x73\x63\164\x6f\165\156\x69\x74\62" => '' . $dtped->dsctounit2 . '', "\x64\x73\143\164\157\x70\x72\x63\x32" => '' . $dtped->dsctoprc2 . '', "\x64\x73\143\164\157\145\156\x64\x70" => $descu, "\x64\x73\143\x74\157\x65\x6e\144\155" => $dsctoendm, "\160\x72\x65\x63\x69\x6f\x66\151\x6e" => $prcfin, "\160\162\145\143\151\x6f\x6f\x72\x69\147\x69\x6e\x61\x6c" => '' . $dtped->precio1 . '', "\143\x61\x6e\x74\151\144\x61\144" => '' . $newcant . '', "\x6d\157\x6e\164\x6f\x6e\145\164\x6f" => '' . $dtped->subtot . '', "\x6d\157\156\164\157\164\157\164\x61\x6c" => '' . $dtped->total . '', "\164\x69\x6d\x70\165\x65\160\162\x63" => '' . $dtped->impuesto1 . '', "\141\154\155\141\x63\x65\x6e" => $dlot->almacen, "\160\162\157\166\x65\x65\144\x6f\x72" => '' . $a . '', "\x66\x65\143\150\141\144\157\143" => '' . date("\131\55\x6d\x2d\x64") . '', "\151\155\x70\165\145\x73\x74\157\x31" => "\60", "\151\155\160\165\145\x73\x74\157\62" => "\60", "\x76\x65\x6e\144\x65\144\157\162" => $vend, "\x65\155\x69\x73\x6f\x72" => "\106\101\x43\124\125\x52\101\104", "\165\163\141\x73\145\162\151\x61\154" => "\62", "\164\151\x70\x6f\160\x72\x65\x63\x69\x6f" => "\61", "\x75\156\151\x64\141\144" => "\x55\x4e\104", "\141\x67\x72\165\x70\x61\x64\157" => "\62", "\143\x6f\x6d\x70\165\x65\x73\164\157" => "\x32", "\x75\x73\141\x65\170\x69\x73\x74" => "\61", "\x61\x75\x78\61" => '' . $dtped->cant . '', "\x65\x73\x74\141\143\151\157\x6e" => "\x30\60\x31", "\x75\x64\x69\x6e\x61\155\x69\143\x61" => "\x31", "\x62\141\163\145\151\155\160\x6f\61" => '' . $dtped->baseimp . '', "\142\141\163\145\151\155\x70\157\62" => "\60", "\x6c\157\164\145" => $dlot->lote, "\151\x64\x76\141\154\151\x64\x61\143\x69\157\x6e" => '', "\x66\145\x63\150\141\x79\x68\x6f\162\141" => '' . date("\131\55\155\55\x64\40\x48\x3a\x69\72\163") . '', "\x65\156\x76\x69\141\144\x6f\137\x6b\x6d\x6f\156\151\x74\x6f\162" => "\x30"); $this->db->insert("\x6f\x70\145\x72\155\166", $datos); if ($this->db->affected_rows() > 0) { $i++; } } } if ($i > 0) { $this->db->query("\125\120\104\x41\124\x45\x20\141\x72\x74\x69\143\x75\154\x6f\x20\x73\145\x74\x20\143\x6f\x6d\x70\x72\157\155\145\x74\x69\x64\x6f\75\143\157\155\x70\162\x6f\x6d\x65\x74\x69\x64\157\53{$dtped->cant}\40\x57\x48\x45\122\105\40\143\157\144\x69\x67\x6f\75\47{$dtped->cod_med}\x27"); } } if ($i > 0) { if ($dias->diascred > 0) { $diascred = $dias->diascred; } else { $diascred = $dtcli->dias; } $subtot = $subtot - $subtot * ($descu / 100); $total = $total - ($total * ($descu / 100) + $iva * ($descu / 100)); $iva = $iva - $iva * ($descu / 100); $sinimp = $sinimp - $sinimp * ($descu / 100); $baseimp = $baseimp - $baseimp * ($descu / 100); $datos2 = array("\x69\144\x5f\x65\155\160\x72\x65\x73\141" => "\104\x4d\x45\x44\x49\106", "\x61\147\145\156\143\x69\x61" => "\60\x30\x31", "\x74\x69\x70\157\x64\x6f\143" => "\x45\123\120", "\x6d\157\156\145\144\x61" => "\x30\x30\x30", "\x64\x6f\x63\165\x6d\x65\x6e\x74\x6f" => '' . $b . $documento . '', "\x63\x6f\x64\x63\154\x69\x65\156\x74\145" => '' . $a . '', "\156\157\x6d\x62\162\x65\x63\154\151" => '' . $dtcli->nombre . '', "\x63\x6f\x6e\164\x61\143\164\157" => "\116\x2f\101", "\162\x69\x66" => '' . $dtcli->nrorif . '', "\x64\x69\x72\145\143\x63\x69\157\x6e" => '' . $dtcli->direccion . '', "\164\x65\154\x65\x66\157\x6e\x6f\163" => '' . $dtcli->telefono_movil . '', "\164\151\160\x6f\160\x72\145\143\151\x6f" => "\61", "\145\155\151\163\151\157\x6e" => '' . date("\131\55\155\x2d\144") . '', "\162\145\x63\x65\160\143\x69\157\x6e" => '' . date("\131\x2d\155\x2d\144") . '', "\x76\x65\156\x63\x65" => '' . date("\x59\x2d\x6d\55\144") . '', "\146\145\143\x68\x61\x63\x72\145\141" => '' . date("\x59\x2d\x6d\x2d\x64") . '', "\x74\x6f\164\x63\157\163\164\157" => '' . $tcosto . '', "\164\157\x74\142\162\165\x74\157" => '' . $subtot . '', "\164\x6f\164\156\x65\164\157" => '' . $subtot . '', "\164\157\164\141\154\146\151\156\141\154" => '' . $total . '', "\x74\x6f\164\151\x6d\160\x75\x65\x73\164" => '' . $iva . '', "\x64\x73\143\x74\157\x65\x6e\144\x31" => $descu, "\144\x73\x63\164\x6f\x6c\151\156\145\141" => $descprm, "\x74\x6f\164\x64\145\163\143\165\145\x6e" => $totdesc, "\x74\x6f\164\x64\145\x73\143\165\x65\156\x32" => $totdesc2, "\x69\155\160\x75\x65\x73\164\x6f\x31" => '' . $iva . '', "\x69\x6d\x70\165\x65\x73\164\x6f\62" => '' . $iva . '', "\144\151\x61\x73\x63\162\145\144" => $diascred, "\x64\x69\141\163\151\156\x64\x65\x78" => $dias->diasindex, "\x76\x65\156\x64\145\x64\x6f\162" => $vend, "\146\141\x63\x74\x6f\162\143\x61\x6d\x62" => "\x31", "\x65\163\164\141\x63\151\x6f\x6e" => "\x30\x30\61", "\163\x69\156\x69\155\x70\x75\145\163\164" => '' . $sinimp . '', "\141\x6c\x6d\141\x63\145\x6e" => "\x30\62", "\163\x65\143\164\x6f\x72" => '' . $dtcli->sector . '', "\163\165\142\x63\x6f\x64\x69\x67\157" => '' . $dtcli->subcodigo . '', "\146\x6f\x72\155\x61\146\151\x73" => "\x31", "\x61\154\137\x6c\x69\x62\162\157" => "\61", "\144\x62\x63\162" => "\x31", "\x68\x6f\162\x61\x64\x6f\x63\x75\x6d" => '' . date("\110\x3a\x69\72\x73") . '', "\x61\x6d\160\x6d" => "\x32", "\145\163\x63\162\x65\x64\151\164\x6f" => "\61", "\142\141\163\x65\151\155\x70\x6f\61" => '' . $baseimp . '', "\x66\x65\143\x68\141\171\x68\157\x72\x61" => '' . date("\131\55\155\x2d\x64\40\x48\x3a\x69\72\x73") . '', "\151\144\x76\141\154\151\144\x61\x63\151\x6f\x6e" => '', "\x64\x6f\143\x75\x6d\x65\156\164\x6f\146\151\163\x63\141\x6c" => "\x30\x20\x52\x65\143\151\142\x69\x64\141", "\143\x6f\x6d\141\156\x64\141\137\155\x6f\166\x69\x6c" => "\x30", "\x63\x6f\155\x61\x6e\144\141\137\x6b\x6d\157\x6e\151\164\x6f\x72" => "\60", "\x6e\x6f\x74\x69\155\x62\x72\141\162" => "\61", "\x61\x6e\x74\151\x70\x6f" => "\x45\x53\160", "\x61\156\164\x64\x6f\x63" => '' . $b . $documento . ''); $this->db->insert("\x6f\160\x65\x72\x74\x69", $datos2); if ($this->db->affected_rows() > 0) { $v++; $control = array("\x64\x6f\x63" => '' . $b . $documento . '', "\x73\x74\141\x74\x75\x73" => $tip); $this->db->insert("\143\157\x6e\x74\x72\x6f\x6c\137\x6f\x70\x65\162\164\151", $control); $this->psicotropicos($b, $documento, $tip); $this->limitfac30($b, $documento, $tip); $this->loguser("\103\x61\x72\x67\141\40\105\x78\143\x65\x6c", "\105\154\x20\x75\163\x75\x61\x72\151\157\40\150\141\x20\143\141\x72\x67\x61\x64\x6f\x20\x65\154\40\x64\x6f\x63\x75\x6d\145\156\x74\x6f\40" . $b . $documento . "\x20\x63\x6f\x6e\40" . $i . "\x20\160\x72\157\x64\165\x63\x74\x6f\x73\56"); } } } if ($v > 0) { $this->db->query("\111\116\123\105\122\124\40\111\x4e\x54\117\x20\142\141\x63\x6b\157\162\x64\145\x72\40\50\144\157\x63\54\x63\x6c\151\x65\x6e\164\x65\54\x63\157\x64\x69\x67\157\x2c\x63\x61\x6e\x74\x6f\162\147\54\143\x61\156\164\146\x69\x6e\54\146\x65\x63\150\141\x29\xa\40\x20\x20\40\40\x20\40\40\123\x45\x4c\105\103\x54\x20\x27" . $b . $documento . "\x27\54\x27{$a}\x27\x2c\141\x2e\143\x6f\x64\x69\147\x6f\54\x61\x2e\x63\x61\x6e\x74\54\111\x46\50\x62\56\143\x61\x6e\x74\x3e\x30\54\x62\x2e\143\141\156\164\54\x30\x29\x2c\x6e\x6f\x77\x28\51\40\106\x52\117\115\40\x6e\x6f\160\145\x64\x20\x61\40\114\x45\106\124\x20\112\x4f\111\116\40\164\145\155\x5f\160\x65\x64\151\x64\x6f\40\142\x20\117\x4e\x20\50\142\56\x63\157\x64\137\155\x65\x64\75\x61\56\x63\x6f\x64\151\x67\157\40\x26\x26\x20\x61\56\x63\154\x69\x65\156\164\145\75\142\x2e\143\x6f\x64\x5f\x63\154\x69\x29\40\x57\x48\105\x52\105\x20\x61\56\x63\x6c\x69\x65\x6e\164\145\x3d\x27{$a}\47"); $this->db->where("\x63\157\144\x5f\143\x6c\151", $a)->delete("\x74\145\155\x5f\160\x65\x64\x69\144\157"); $this->db->where("\143\x6c\151\x65\156\164\145", $a)->delete("\x6e\x6f\x70\x65\x64"); } return $v; } function psicotropicos($a, $b, $tip) { $num = $this->db->query("\x53\105\x4c\105\x43\x54\x20\x49\x46\x28\x4d\x41\x58\x28\x53\x55\102\123\x54\x52\x28\x64\157\143\x2c\x32\54\x38\51\x29\x2b\61\76\x30\x2c\115\x41\130\x28\x53\x55\x42\123\x54\x52\50\144\157\x63\x2c\x32\x2c\x38\x29\x29\x2b\61\54\x31\x29\40\x6e\x20\106\122\117\115\x20\143\x6f\156\164\x72\157\x6c\x5f\x6f\160\145\162\x74\x69\40\127\110\x45\122\x45\x20\144\157\143\x20\x6c\x69\153\x65\x20\47\x25{$a}\45\47")->row(); $newdoc = str_pad($num->n, 7, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("\123\105\114\105\x43\124\40\x2a\x20\106\122\117\x4d\40\157\x70\145\162\164\151\x20\127\110\x45\122\105\40\144\x6f\143\165\155\145\x6e\164\x6f\x3d\x27" . $a . $b . "\x27\40\46\46\x20\164\x69\160\x6f\x64\157\143\x3d\x27\105\123\120\47")->row(); $item = $this->db->query("\x53\x45\x4c\105\103\x54\x20\141\x2e\x2a\x20\106\x52\x4f\x4d\x20\157\x70\145\162\x6d\166\40\x61\40\x4a\x4f\x49\116\40\141\x72\164\151\x63\165\154\x6f\x20\x62\40\x4f\x4e\40\x61\56\x63\157\144\x69\147\x6f\75\142\x2e\143\x6f\x64\151\x67\157\40\127\110\x45\x52\x45\40\x61\x2e\144\157\x63\x75\155\x65\x6e\x74\x6f\75\47" . $a . $b . "\x27\x20\46\x26\x20\141\56\x74\x69\x70\157\x64\157\143\x3d\x27\105\x53\120\x27\x20\x26\46\40\x62\56\x63\x6f\x6e\x74\162\157\154\x61\x64\x6f\75\61")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; $totdesc2 = 0; $descprm = 0; $i = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $totdesc2 += $ditem->dsctoprc2 * $ditem->cantidad; $descprm += $ditem->dsctoendm * $ditem->cant; $datos = array("\x69\144\137\x65\x6d\160\x72\145\163\141" => "\x44\x4d\105\104\111\106", "\141\147\145\156\x63\x69\x61" => "\60\x30\61", "\164\151\160\x6f\144\x6f\143" => "\105\x53\120", "\x64\157\x63\x75\x6d\x65\x6e\164\157" => '' . $a . $newdoc . '', "\147\162\165\160\x6f" => '' . $ditem->grupo . '', "\157\162\x69\x67\x65\156" => "\61", "\143\157\144\x69\x67\157" => '' . $ditem->codigo . '', "\160\x69\144" => '' . $pid . '', "\156\157\155\142\x72\145" => '' . $ditem->nombre . '', "\x63\x6f\163\x74\157\165\x6e\x69\x74" => '' . $ditem->costounit . '', "\160\x72\145\x63\x69\x6f\x75\156\x69\164" => $ditem->preciounit, "\x64\163\x63\x74\x6f\x75\x6e\x69\x74" => '' . $ditem->dsctounit . '', "\144\x73\x63\x74\157\160\162\143" => '' . $ditem->dsctoprc . '', "\144\x73\143\x74\157\165\x6e\151\164\x32" => '' . $ditem->dsctounit2 . '', "\x64\x73\143\164\157\x70\x72\x63\62" => '' . $ditem->dsctoprc2 . '', "\144\163\143\x74\x6f\x65\156\x64\155" => $ditem->dsctoendm, "\144\x73\143\x74\x6f\x65\156\x64\x70" => $ditem->dsctoendp, "\160\x72\145\143\x69\x6f\146\151\156" => $ditem->preciofin, "\x70\x72\x65\x63\x69\x6f\x6f\162\x69\147\x69\x6e\x61\x6c" => '' . $ditem->preciooriginal . '', "\143\141\x6e\x74\x69\x64\x61\x64" => '' . $ditem->cantidad . '', "\155\157\x6e\164\157\x6e\x65\164\x6f" => '' . $ditem->montoneto . '', "\155\x6f\156\x74\x6f\x74\157\x74\x61\154" => '' . $ditem->montototal . '', "\x74\x69\x6d\160\x75\x65\x70\162\143" => '' . $ditem->timpueprc . '', "\x61\154\155\x61\x63\145\x6e" => $ditem->almacen, "\x70\x72\157\166\145\x65\144\157\162" => $ditem->proveedor, "\x66\x65\143\x68\x61\144\x6f\143" => '' . date("\131\x2d\x6d\x2d\x64") . '', "\151\x6d\x70\165\145\163\x74\x6f\61" => "\60", "\x69\155\160\165\x65\163\164\x6f\62" => "\x30", "\x76\145\x6e\x64\x65\144\157\x72" => '' . $ditem->vendedor . '', "\x65\x6d\x69\x73\x6f\x72" => "\x46\101\103\x54\125\x52\101\x44", "\165\x73\141\x73\145\162\151\x61\x6c" => "\x32", "\x74\x69\x70\x6f\160\162\x65\x63\151\x6f" => "\61", "\x75\x6e\x69\x64\x61\x64" => "\125\x4e\x44", "\x61\x67\x72\165\160\141\x64\x6f" => "\x32", "\143\157\155\160\165\145\x73\164\x6f" => "\x32", "\x75\163\x61\145\170\x69\x73\x74" => "\61", "\141\x75\170\61" => '' . $ditem->aux1 . '', "\145\x73\x74\141\x63\151\157\x6e" => "\60\60\61", "\x75\144\151\156\141\155\x69\x63\x61" => "\x31", "\142\141\163\x65\x69\x6d\x70\157\x31" => '' . $ditem->baseimpo1 . '', "\142\x61\163\145\x69\155\x70\157\62" => "\x30", "\x6c\157\164\x65" => $ditem->lote, "\151\x64\x76\141\154\151\x64\141\143\151\x6f\x6e" => '', "\146\x65\x63\x68\141\x79\x68\157\x72\x61" => '' . date("\x59\x2d\155\55\144\x20\x48\x3a\x69\x3a\163") . '', "\145\x6e\166\151\141\x64\x6f\x5f\x6b\155\x6f\156\x69\x74\157\162" => "\60"); $this->db->insert("\x6f\x70\145\x72\155\x76", $datos); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x44\105\x4c\x45\124\105\40\x46\122\117\115\x20\157\160\145\x72\x6d\166\40\127\110\105\x52\105\40\144\157\143\165\155\145\x6e\164\157\x3d\47" . $a . $b . "\47\40\x26\46\40\164\151\x70\x6f\x64\157\x63\75\x27\x45\x53\x50\x27\40\46\x26\40\143\x6f\x64\x69\x67\x6f\x3d\47{$ditem->codigo}\x27\40\46\x26\x20\143\141\156\x74\151\144\141\x64\75\x27{$ditem->cantidad}\47"); } } if ($i > 0) { $datos2 = array("\151\144\137\145\155\x70\162\145\163\x61" => "\104\x4d\105\x44\111\x46", "\x61\x67\145\156\x63\151\141" => "\60\x30\x31", "\164\x69\x70\x6f\x64\x6f\x63" => "\105\123\120", "\x6d\x6f\156\145\x64\141" => "\60\60\x30", "\144\x6f\143\x75\155\145\156\164\x6f" => '' . $a . $newdoc . '', "\x63\x6f\144\143\x6c\x69\x65\x6e\x74\x65" => $oper->codcliente, "\156\x6f\x6d\x62\162\145\x63\x6c\x69" => '' . $oper->nombrecli . '', "\143\157\156\164\141\143\x74\x6f" => "\x4e\57\x41", "\162\x69\x66" => '' . $oper->rif . '', "\144\151\162\x65\x63\143\x69\157\x6e" => '' . $oper->direccion . '', "\164\145\154\x65\146\157\156\x6f\163" => '' . $oper->telefono_movil . '', "\164\151\x70\x6f\x70\162\x65\143\x69\157" => "\x31", "\145\155\x69\x73\x69\157\156" => '' . date("\131\x2d\155\x2d\x64") . '', "\162\145\143\145\160\x63\x69\157\x6e" => '' . date("\131\x2d\155\55\144") . '', "\x76\145\156\x63\x65" => '' . date("\x59\x2d\x6d\x2d\x64") . '', "\x66\145\x63\x68\x61\143\162\145\141" => '' . date("\131\x2d\155\55\x64") . '', "\164\157\164\x63\x6f\163\164\x6f" => $totcosto, "\164\157\164\142\x72\x75\164\157" => $totneto, "\x74\157\164\156\145\164\157" => $totneto, "\164\157\x74\141\154\x66\151\156\141\x6c" => $totfinal, "\x74\x6f\x74\x69\x6d\x70\165\x65\163\164" => $totimpues, "\164\x6f\x74\x64\145\x73\x63\165\x65\x6e" => $totdesc, "\164\x6f\164\144\145\163\x63\165\x65\x6e\62" => $totdesc2, "\144\163\143\x74\157\145\156\144\61" => $oper->dsctoend1, "\x69\x6d\160\165\x65\x73\164\157\x31" => $totimpues, "\151\155\x70\x75\145\163\164\157\x32" => $totimpues, "\144\x73\143\x74\x6f\x6c\151\x6e\145\x61" => $descprm, "\144\151\x61\163\143\x72\x65\x64" => $oper->diascred, "\166\x65\x6e\144\145\144\x6f\162" => '' . $oper->vendedor . '', "\146\x61\x63\x74\x6f\162\x63\x61\x6d\x62" => "\61", "\165\145\x6d\151\x73\157\x72" => '' . $oper->vendedor . '', "\x65\163\164\x61\143\151\157\156" => "\x30\x30\x31", "\x73\x69\156\151\155\160\x75\145\x73\x74" => 0, "\141\154\x6d\x61\x63\x65\x6e" => "\x30\x32", "\163\145\143\164\157\162" => '' . $oper->sector . '', "\x73\x75\x62\x63\157\x64\x69\147\x6f" => '' . $oper->subcodigo . '', "\x66\157\x72\x6d\141\146\151\x73" => "\61", "\x61\x6c\x5f\x6c\x69\142\162\157" => "\x31", "\x64\142\143\x72" => "\x31", "\150\x6f\x72\141\x64\x6f\x63\x75\155" => '' . date("\x48\72\151\72\x73") . '', "\141\155\x70\155" => "\x32", "\145\x73\x63\162\x65\x64\x69\164\157" => "\x31", "\x62\x61\163\x65\x69\x6d\x70\157\x31" => $baseimp, "\146\145\x63\x68\x61\171\150\x6f\x72\x61" => '' . date("\131\55\x6d\x2d\144\x20\x48\72\151\x3a\163") . '', "\x69\x64\x76\141\154\x69\144\x61\143\151\x6f\156" => '', "\x64\157\x63\x75\155\145\156\x74\157\146\x69\163\143\x61\154" => "\x30\40\122\x65\143\151\x62\x69\x64\141", "\x63\x6f\x6d\141\x6e\144\141\137\155\x6f\166\151\x6c" => "\60", "\x63\157\x6d\141\156\x64\141\137\153\155\x6f\156\151\x74\x6f\162" => "\60", "\156\157\164\x69\155\142\162\141\162" => "\x31", "\141\x6e\164\x69\x70\x6f" => "\105\123\x50", "\x61\x6e\x74\x64\157\x63" => '' . $a . $newdoc . ''); $this->db->insert("\157\x70\145\162\x74\x69", $datos2); if ($this->db->affected_rows() > 0) { $control = array("\144\x6f\x63" => '' . $a . $newdoc . '', "\x73\x74\x61\x74\x75\x73" => $tip); $this->db->insert("\x63\x6f\x6e\164\162\x6f\154\x5f\157\x70\145\x72\164\x69", $control); } } } function limitfac30($a, $b, $tip) { $num = $this->db->query("\123\105\114\105\103\124\x20\111\106\x28\x4d\101\x58\50\x53\x55\x42\x53\124\x52\x28\x64\x6f\143\54\62\54\70\x29\51\53\61\76\60\54\x4d\101\130\x28\x53\125\x42\x53\124\122\50\144\157\143\x2c\x32\x2c\70\x29\x29\x2b\x31\x2c\x31\x29\40\156\x20\106\122\117\115\40\143\157\x6e\x74\x72\x6f\x6c\x5f\x6f\x70\x65\162\x74\151\x20\x57\110\x45\122\105\x20\144\157\143\x20\154\151\153\x65\40\47\x25{$a}\x25\47")->row(); $newdoc = str_pad($num->n, 7, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("\123\105\x4c\x45\103\x54\40\x2a\x20\x46\x52\117\x4d\40\x6f\x70\x65\x72\164\151\x20\x57\x48\x45\x52\x45\x20\x64\x6f\x63\x75\155\145\156\164\x6f\x3d\47" . $a . $b . "\47\40\x26\46\x20\164\x69\160\157\x64\x6f\143\x3d\x27\105\x53\x50\x27")->row(); $val = $this->db->query("\123\105\x4c\x45\103\x54\x20\116\x55\114\x4c\40\x46\122\x4f\115\x20\157\x70\x65\x72\155\166\40\x61\40\x57\x48\x45\x52\105\40\x61\56\144\157\x63\x75\x6d\145\156\164\157\75\47" . $a . $b . "\47\x20\46\46\x20\x61\56\x74\151\160\157\144\x6f\x63\75\47\105\x53\x50\47")->num_rows(); if ($val > 30) { if ($val <= 60) { $div = 2; } else { if ($val > 60) { $div = 3; } } $mostrar = $val / $div; $mostrar = ROUND($mostrar, 0); $item = $this->db->query("\123\x45\114\105\103\x54\x20\x61\56\52\40\106\x52\117\115\40\x6f\x70\145\x72\x6d\x76\40\141\40\127\110\x45\x52\105\40\141\56\x64\x6f\x63\165\x6d\x65\x6e\164\x6f\75\47" . $a . $b . "\x27\x20\46\x26\40\x61\56\164\x69\x70\157\144\157\143\x3d\47\x45\123\120\47\40\114\111\115\111\124\40" . $mostrar . "\40\54\x20" . $mostrar . "\x3b")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; $totdesc2 = 0; $descprm = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $totdesc2 += $ditem->dsctoprc2 * $ditem->cantidad; $descprm += $ditem->dsctoendm * $ditem->cant; $datos = array("\x69\x64\x5f\145\155\x70\162\145\x73\141" => "\x44\115\x45\104\111\x46", "\141\147\x65\x6e\x63\151\141" => "\x30\x30\x31", "\164\151\160\x6f\144\x6f\143" => "\105\123\x50", "\x64\157\143\x75\155\145\156\164\x6f" => '' . $a . $newdoc . '', "\x67\162\x75\x70\157" => '' . $ditem->grupo . '', "\157\x72\x69\147\145\156" => "\x31", "\x63\157\x64\x69\147\157" => '' . $ditem->codigo . '', "\160\x69\144" => '' . $pid . '', "\156\157\x6d\142\162\x65" => '' . $ditem->nombre . '', "\143\x6f\163\164\157\x75\x6e\151\x74" => '' . $ditem->costounit . '', "\x70\x72\145\143\151\157\x75\156\x69\x74" => $ditem->preciounit, "\144\x73\x63\x74\157\x75\x6e\151\164" => '' . $ditem->dsctounit . '', "\144\163\x63\164\157\160\162\x63" => '' . $ditem->dsctoprc . '', "\x64\x73\x63\164\157\x75\156\x69\x74\x32" => '' . $ditem->dsctounit2 . '', "\x64\163\x63\x74\157\x70\162\x63\x32" => '' . $ditem->dsctoprc2 . '', "\x64\x73\x63\164\157\145\x6e\144\x6d" => $ditem->dsctoendm, "\x64\163\x63\164\x6f\145\156\144\160" => $ditem->dsctoendp, "\160\x72\x65\143\x69\157\146\x69\156" => $ditem->preciofin, "\160\x72\x65\x63\151\157\x6f\x72\151\x67\x69\x6e\x61\154" => '' . $ditem->preciooriginal . '', "\x63\141\156\164\x69\144\141\144" => '' . $ditem->cantidad . '', "\155\x6f\156\x74\157\x6e\x65\164\x6f" => '' . $ditem->montoneto . '', "\x6d\x6f\x6e\x74\157\164\x6f\164\141\154" => '' . $ditem->montototal . '', "\x74\151\155\x70\x75\145\160\162\x63" => '' . $ditem->timpueprc . '', "\x61\x6c\155\141\143\145\156" => $ditem->almacen, "\160\x72\157\x76\145\x65\x64\157\x72" => $ditem->proveedor, "\146\x65\143\150\x61\x64\x6f\143" => '' . date("\131\x2d\155\x2d\x64") . '', "\151\155\160\x75\145\163\x74\x6f\61" => "\x30", "\151\155\x70\165\x65\163\164\x6f\x32" => "\60", "\x76\145\x6e\144\145\x64\157\x72" => '' . $ditem->vendedor . '', "\145\x6d\151\x73\x6f\162" => "\106\101\x43\x54\x55\x52\x41\x44", "\165\163\x61\x73\145\x72\x69\141\154" => "\x32", "\x74\x69\160\x6f\160\162\x65\143\x69\157" => "\x31", "\165\156\x69\x64\x61\144" => "\125\116\x44", "\141\x67\x72\x75\x70\141\x64\x6f" => "\62", "\143\x6f\x6d\160\x75\x65\163\x74\157" => "\x32", "\165\x73\x61\x65\170\x69\163\x74" => "\61", "\x61\165\x78\61" => '' . $ditem->aux1 . '', "\145\163\x74\x61\x63\x69\157\x6e" => "\60\x30\x31", "\x75\x64\x69\x6e\141\x6d\151\143\141" => "\x31", "\142\141\163\x65\x69\x6d\160\157\x31" => '' . $ditem->baseimpo1 . '', "\x62\x61\163\145\151\155\160\157\x32" => "\60", "\x6c\157\x74\x65" => $ditem->lote, "\x69\x64\x76\x61\x6c\151\144\x61\143\151\x6f\x6e" => '', "\146\145\x63\150\141\171\150\157\162\x61" => '' . date("\x59\x2d\155\55\144\x20\110\x3a\x69\x3a\x73") . '', "\145\156\166\x69\x61\x64\157\x5f\x6b\x6d\157\156\x69\x74\x6f\x72" => "\x30"); $this->db->insert("\x6f\160\x65\162\x6d\x76", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("\104\x45\x4c\x45\124\x45\40\106\x52\x4f\x4d\40\157\160\145\x72\155\166\x20\x57\110\x45\122\105\x20\144\x6f\143\x75\155\145\x6e\x74\157\75\x27" . $a . $b . "\x27\40\46\x26\x20\164\151\x70\x6f\x64\157\143\x3d\x27\x45\x53\x50\47\40\46\46\40\143\x6f\x64\151\147\157\75\x27{$ditem->codigo}\x27\x20\46\x26\x20\143\141\156\164\x69\x64\x61\x64\75\x27{$ditem->cantidad}\47"); } } $datos2 = array("\x69\144\137\x65\x6d\x70\x72\x65\163\141" => "\x44\x4d\105\x44\x49\x46", "\141\x67\x65\x6e\143\x69\x61" => "\60\x30\x31", "\x74\x69\160\x6f\x64\x6f\x63" => "\105\123\120", "\155\x6f\156\145\x64\141" => "\x30\x30\60", "\x64\157\143\x75\x6d\x65\156\x74\157" => '' . $a . $newdoc . '', "\143\x6f\x64\143\154\151\145\x6e\164\145" => $oper->codcliente, "\156\x6f\155\142\162\x65\x63\154\151" => '' . $oper->nombrecli . '', "\x63\157\x6e\x74\x61\143\164\157" => "\116\57\101", "\x72\x69\146" => '' . $oper->rif . '', "\144\151\162\145\143\143\x69\157\156" => '' . $oper->direccion . '', "\x74\x65\x6c\x65\146\157\x6e\x6f\163" => '' . $oper->telefono_movil . '', "\164\x69\x70\x6f\160\162\x65\143\x69\x6f" => "\61", "\x65\155\x69\163\x69\157\156" => '' . date("\x59\x2d\x6d\x2d\144") . '', "\162\x65\143\145\160\x63\151\x6f\x6e" => '' . date("\131\55\155\x2d\144") . '', "\x76\145\156\x63\x65" => '' . date("\x59\x2d\x6d\55\x64") . '', "\146\x65\143\150\141\x63\x72\x65\141" => '' . date("\131\x2d\155\55\x64") . '', "\164\157\164\143\157\163\x74\x6f" => $totcosto, "\x74\x6f\164\142\x72\165\164\157" => $totneto, "\164\x6f\x74\x6e\145\x74\x6f" => $totneto, "\x74\x6f\164\x61\154\146\151\156\x61\x6c" => $totfinal, "\x74\x6f\x74\x69\155\x70\165\x65\163\x74" => $totimpues, "\x74\x6f\x74\x64\x65\x73\143\165\x65\x6e" => $totdesc, "\164\x6f\x74\x64\x65\163\x63\165\145\156\x32" => $totdesc2, "\x64\163\x63\x74\157\x65\x6e\144\61" => $oper->dsctoend1, "\151\155\160\165\x65\163\x74\x6f\x31" => $totimpues, "\x69\155\160\x75\145\x73\x74\157\x32" => $totimpues, "\144\x73\x63\164\x6f\x6c\151\x6e\145\x61" => $descprm, "\x64\x69\141\163\x63\x72\x65\144" => $oper->diascred, "\166\x65\x6e\144\x65\x64\157\162" => '' . $oper->vendedor . '', "\146\x61\x63\x74\157\162\x63\141\x6d\x62" => "\61", "\x75\x65\155\151\x73\x6f\x72" => '' . $oper->vendedor . '', "\x65\163\x74\x61\x63\x69\157\156" => "\60\x30\x31", "\163\x69\156\151\x6d\160\x75\145\163\164" => 0, "\141\154\x6d\141\143\x65\x6e" => "\60\x32", "\163\x65\143\164\x6f\162" => '' . $oper->sector . '', "\x73\x75\x62\x63\x6f\144\x69\147\x6f" => '' . $oper->subcodigo . '', "\x66\x6f\x72\x6d\x61\x66\151\163" => "\61", "\x61\154\137\x6c\x69\x62\162\157" => "\61", "\x64\142\143\162" => "\61", "\150\157\x72\x61\x64\x6f\x63\x75\x6d" => '' . date("\x48\x3a\151\72\163") . '', "\x61\155\160\x6d" => "\x32", "\x65\163\x63\x72\x65\x64\x69\164\157" => "\61", "\142\141\x73\x65\151\155\160\157\61" => $baseimp, "\146\x65\x63\x68\x61\171\150\157\162\141" => '' . date("\x59\x2d\155\55\144\x20\110\x3a\x69\x3a\163") . '', "\x69\x64\x76\x61\154\151\144\141\x63\151\157\x6e" => '', "\144\x6f\x63\165\x6d\145\x6e\x74\157\146\151\x73\x63\141\154" => "\x30\40\122\145\143\x69\142\151\144\x61", "\x63\157\155\x61\x6e\x64\141\137\x6d\157\x76\x69\x6c" => "\60", "\x63\x6f\155\141\x6e\x64\141\x5f\x6b\x6d\157\x6e\x69\x74\x6f\162" => "\x30", "\156\x6f\164\x69\x6d\142\x72\x61\162" => "\61", "\x61\156\164\x69\160\x6f" => "\x45\x53\120", "\141\x6e\x74\x64\x6f\x63" => '' . $a . $newdoc . ''); $this->db->insert("\x6f\x70\145\x72\x74\151", $datos2); if ($this->db->affected_rows() > 0) { $control = array("\144\157\143" => '' . $a . $newdoc . '', "\x73\x74\x61\x74\165\163" => $tip); $this->db->insert("\143\157\x6e\164\x72\x6f\154\137\x6f\x70\x65\x72\164\151", $control); $val = $this->db->query("\123\x45\x4c\105\103\x54\x20\x4e\x55\114\114\40\106\x52\117\115\40\157\x70\x65\x72\155\166\40\141\40\127\x48\105\122\105\x20\141\x2e\144\x6f\x63\x75\155\x65\x6e\164\x6f\x3d\47" . $a . $b . "\x27\40\x26\x26\x20\141\x2e\x74\151\x70\157\x64\157\x63\x3d\47\105\123\120\47")->num_rows(); if ($val > 30) { $this->limit2fac30($a, $b, $tip); } } } } function limit2fac30($a, $b, $tip) { $num = $this->db->query("\x53\105\x4c\105\x43\124\x20\111\x46\x28\115\x41\130\x28\x53\x55\x42\x53\x54\122\x28\x64\157\143\x2c\x32\x2c\70\51\51\x2b\61\76\60\x2c\x4d\x41\x58\x28\x53\125\x42\x53\x54\x52\50\x64\157\143\54\62\x2c\70\x29\x29\x2b\x31\x2c\61\x29\x20\156\40\x46\122\117\115\40\143\x6f\156\x74\x72\x6f\154\137\x6f\160\x65\162\164\x69\x20\x57\x48\105\122\x45\40\144\x6f\143\40\154\x69\153\x65\x20\47\x25{$a}\45\x27")->row(); $newdoc = str_pad($num->n, 7, "\60", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("\x53\105\x4c\x45\103\x54\x20\x2a\x20\106\122\117\x4d\40\x6f\x70\x65\x72\x74\x69\x20\127\110\105\122\105\40\144\157\143\x75\155\145\x6e\x74\x6f\75\47" . $a . $b . "\x27\40\x26\x26\x20\164\x69\160\x6f\144\157\143\75\47\105\123\120\47")->row(); $val = $this->db->query("\123\105\x4c\105\x43\x54\40\x4e\125\114\114\x20\x46\x52\117\115\40\157\x70\x65\x72\155\166\x20\x61\40\127\110\x45\x52\105\x20\x61\56\144\157\x63\x75\155\145\156\164\157\x3d\x27" . $a . $b . "\x27\x20\46\46\x20\141\56\x74\x69\160\x6f\x64\157\x63\75\47\105\123\120\47")->num_rows(); if ($val > 30) { $mostrar = $val / 2; $mostrar = ROUND($mostrar, 0); $item = $this->db->query("\x53\x45\114\x45\103\124\x20\141\x2e\x2a\x20\x46\122\117\115\x20\157\x70\x65\162\155\x76\40\x61\40\x57\x48\105\x52\x45\x20\141\56\x64\x6f\x63\x75\x6d\145\156\164\157\x3d\x27" . $a . $b . "\47\40\46\x26\x20\141\56\x74\151\160\x6f\144\157\143\75\47\105\x53\x50\47\40\114\x49\x4d\111\x54\40" . $mostrar . "\x20\54\40" . $mostrar . "\x3b")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; $totdesc2 = 0; $descprm = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $totdesc2 += $ditem->dsctoprc2 * $ditem->cantidad; $descprm += $ditem->dsctoendm * $ditem->cant; $datos = array("\x69\144\137\x65\x6d\x70\162\x65\x73\141" => "\104\x4d\x45\x44\111\x46", "\x61\147\x65\x6e\143\x69\141" => "\x30\x30\61", "\x74\x69\x70\157\144\x6f\x63" => "\x45\x53\x50", "\144\157\143\x75\x6d\x65\x6e\x74\x6f" => '' . $a . $newdoc . '', "\147\x72\x75\x70\x6f" => '' . $ditem->grupo . '', "\157\x72\x69\x67\145\156" => "\61", "\x63\x6f\x64\151\147\157" => '' . $ditem->codigo . '', "\x70\151\x64" => '' . $pid . '', "\x6e\157\x6d\142\x72\x65" => '' . $ditem->nombre . '', "\143\157\163\x74\x6f\165\156\151\x74" => '' . $ditem->costounit . '', "\160\x72\145\x63\x69\157\x75\x6e\151\x74" => $ditem->preciounit, "\144\x73\143\x74\x6f\x75\x6e\x69\164" => '' . $ditem->dsctounit . '', "\x64\x73\x63\164\157\160\162\143" => '' . $ditem->dsctoprc . '', "\x64\x73\x63\x74\157\165\x6e\151\164\x32" => '' . $ditem->dsctounit2 . '', "\144\163\143\164\157\x70\162\x63\62" => '' . $ditem->dsctoprc2 . '', "\x64\x73\x63\164\157\x65\x6e\144\x6d" => $ditem->dsctoendm, "\144\x73\143\x74\x6f\x65\156\x64\x70" => $ditem->dsctoendp, "\160\x72\x65\x63\x69\157\x66\151\x6e" => $ditem->preciofin, "\x70\x72\x65\x63\x69\157\157\x72\151\x67\x69\x6e\141\x6c" => '' . $ditem->preciooriginal . '', "\x63\141\156\x74\151\144\141\x64" => '' . $ditem->cantidad . '', "\x6d\157\156\x74\x6f\x6e\145\164\157" => '' . $ditem->montoneto . '', "\155\x6f\156\x74\157\164\157\x74\x61\x6c" => '' . $ditem->montototal . '', "\164\x69\x6d\160\x75\x65\160\x72\143" => '' . $ditem->timpueprc . '', "\x61\154\x6d\x61\143\x65\x6e" => $ditem->almacen, "\160\162\157\166\x65\x65\144\157\x72" => $ditem->proveedor, "\x66\x65\143\x68\x61\144\x6f\x63" => '' . date("\x59\55\x6d\x2d\144") . '', "\151\x6d\160\x75\x65\163\164\x6f\x31" => "\60", "\151\x6d\160\x75\145\163\164\157\62" => "\60", "\166\x65\x6e\x64\145\x64\x6f\162" => '' . $ditem->vendedor . '', "\x65\155\151\163\157\162" => "\x46\x41\x43\x54\x55\122\101\104", "\165\163\141\x73\x65\x72\x69\141\x6c" => "\x32", "\164\x69\x70\157\160\x72\x65\143\151\157" => "\61", "\165\156\x69\144\x61\x64" => "\x55\116\104", "\x61\x67\162\165\160\x61\x64\157" => "\x32", "\143\157\x6d\160\165\x65\x73\164\x6f" => "\62", "\165\163\x61\x65\x78\x69\163\x74" => "\x31", "\x61\x75\x78\x31" => '' . $ditem->aux1 . '', "\x65\163\x74\141\143\x69\x6f\x6e" => "\60\60\61", "\x75\144\151\x6e\141\x6d\x69\143\141" => "\61", "\142\141\163\145\151\155\160\x6f\61" => '' . $ditem->baseimpo1 . '', "\x62\x61\x73\145\x69\155\x70\x6f\62" => "\60", "\x6c\x6f\x74\145" => $ditem->lote, "\x69\x64\x76\141\x6c\x69\144\x61\143\151\x6f\156" => '', "\146\145\x63\150\141\x79\150\x6f\162\141" => '' . date("\131\55\x6d\x2d\x64\40\110\72\151\72\163") . '', "\145\156\166\151\x61\x64\157\x5f\x6b\x6d\x6f\156\x69\x74\x6f\x72" => "\60"); $this->db->insert("\157\x70\x65\x72\x6d\166", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("\x44\105\114\105\x54\105\x20\x46\122\117\115\40\x6f\x70\145\162\155\x76\x20\127\110\x45\x52\x45\x20\x64\x6f\143\x75\155\145\156\x74\157\75\47" . $a . $b . "\47\40\46\x26\40\x74\151\160\x6f\144\x6f\x63\75\47\105\123\x50\x27\40\46\x26\x20\x63\x6f\144\x69\x67\x6f\x3d\x27{$ditem->codigo}\x27\x20\46\46\x20\143\141\x6e\x74\x69\144\141\144\75\47{$ditem->cantidad}\47"); } } $datos2 = array("\151\x64\x5f\x65\155\160\162\x65\x73\x61" => "\104\115\105\x44\x49\106", "\141\x67\145\x6e\143\x69\141" => "\x30\x30\61", "\x74\x69\160\157\144\x6f\x63" => "\105\x53\120", "\x6d\x6f\156\x65\144\x61" => "\x30\60\x30", "\144\x6f\x63\165\155\x65\x6e\164\x6f" => '' . $a . $newdoc . '', "\x63\157\x64\143\154\151\x65\x6e\164\145" => $oper->codcliente, "\156\157\x6d\x62\162\x65\143\x6c\151" => '' . $oper->nombrecli . '', "\143\x6f\x6e\x74\141\x63\164\157" => "\x4e\x2f\101", "\162\151\146" => '' . $oper->rif . '', "\144\x69\162\145\143\143\151\157\156" => '' . $oper->direccion . '', "\164\145\154\x65\146\x6f\156\157\x73" => '' . $oper->telefono_movil . '', "\x74\151\160\x6f\160\x72\145\143\x69\157" => "\61", "\145\155\151\x73\x69\x6f\156" => '' . date("\x59\x2d\155\x2d\144") . '', "\162\145\x63\145\x70\x63\x69\x6f\156" => '' . date("\131\x2d\x6d\x2d\144") . '', "\x76\145\x6e\x63\145" => '' . date("\131\x2d\x6d\x2d\x64") . '', "\146\145\143\x68\141\x63\x72\145\x61" => '' . date("\131\55\155\x2d\144") . '', "\164\157\x74\x63\157\163\x74\157" => $totcosto, "\164\157\164\x62\162\165\x74\157" => $totneto, "\164\157\164\156\x65\164\x6f" => $totneto, "\164\157\164\141\x6c\x66\151\156\x61\154" => $totfinal, "\x74\157\x74\151\155\160\165\145\163\164" => $totimpues, "\164\157\164\144\x65\x73\x63\x75\145\156" => $totdesc, "\x74\157\x74\144\x65\x73\143\165\145\x6e\62" => $totdesc2, "\144\163\143\x74\157\145\x6e\x64\x31" => $oper->dsctoend1, "\151\155\160\165\x65\x73\164\x6f\x31" => $totimpues, "\x69\x6d\x70\x75\145\x73\164\157\x32" => $totimpues, "\x64\x73\143\164\x6f\x6c\151\156\145\141" => $descprm, "\144\151\141\x73\143\x72\145\144" => $oper->diascred, "\x76\145\156\x64\145\144\157\162" => '' . $oper->vendedor . '', "\146\141\x63\x74\x6f\x72\143\x61\155\x62" => "\x31", "\x75\x65\155\151\x73\x6f\x72" => '' . $oper->vendedor . '', "\x65\x73\x74\141\x63\x69\157\x6e" => "\60\x30\x31", "\x73\151\x6e\x69\x6d\160\165\x65\163\164" => 0, "\141\x6c\155\x61\x63\x65\156" => "\60\x32", "\x73\145\x63\164\x6f\x72" => '' . $oper->sector . '', "\x73\165\x62\x63\157\x64\151\147\157" => '' . $oper->subcodigo . '', "\x66\157\162\x6d\141\x66\x69\x73" => "\61", "\x61\154\x5f\154\x69\x62\x72\x6f" => "\61", "\x64\x62\143\x72" => "\61", "\150\x6f\x72\141\144\157\x63\165\x6d" => '' . date("\x48\x3a\x69\72\163") . '', "\x61\x6d\160\155" => "\x32", "\145\163\x63\162\x65\x64\151\x74\x6f" => "\61", "\x62\x61\x73\x65\x69\155\x70\x6f\61" => $baseimp, "\146\145\x63\150\x61\171\150\157\162\141" => '' . date("\x59\x2d\155\x2d\x64\40\110\x3a\151\x3a\x73") . '', "\x69\x64\x76\141\x6c\151\144\x61\143\x69\157\x6e" => '', "\144\x6f\143\x75\x6d\x65\x6e\x74\157\146\151\163\x63\141\x6c" => "\60\40\x52\x65\143\x69\x62\x69\144\141", "\143\x6f\155\x61\156\144\141\x5f\155\157\166\151\154" => "\x30", "\x63\x6f\155\x61\156\x64\141\x5f\x6b\x6d\x6f\156\151\x74\x6f\x72" => "\60", "\x6e\157\x74\151\x6d\x62\162\x61\x72" => "\61", "\x61\156\164\x69\x70\157" => "\105\123\x50", "\141\x6e\164\144\x6f\143" => '' . $a . $newdoc . ''); $this->db->insert("\x6f\160\145\162\164\x69", $datos2); if ($this->db->affected_rows() > 0) { $control = array("\x64\157\x63" => '' . $a . $newdoc . '', "\x73\164\x61\164\165\x73" => $tip); $this->db->insert("\143\157\x6e\164\x72\x6f\x6c\137\x6f\160\x65\x72\x74\x69", $control); } } } function faciva($a, $b) { $num = $this->db->query("\x53\x45\x4c\105\103\x54\40\x49\x46\50\x4d\x41\130\x28\x53\125\x42\x53\124\122\x28\144\157\143\54\62\x2c\x38\51\x29\53\x31\x3e\x30\x2c\x4d\x41\x58\50\x53\x55\102\x53\124\122\x28\144\157\143\x2c\x32\54\70\51\x29\x2b\x31\x2c\x31\51\x20\x6e\x20\106\x52\x4f\115\40\143\157\x6e\164\x72\157\x6c\x5f\x6f\160\x65\x72\x74\151\x20\127\x48\x45\122\105\x20\x64\x6f\x63\x20\x6c\x69\x6b\x65\x20\x27\45{$a}\45\47")->row(); $newdoc = str_pad($num->n, 7, "\60", STR_PAD_LEFT); $pid = $this->genecod(12); $oper = $this->db->query("\123\x45\114\x45\103\x54\x20\52\x20\106\122\117\115\40\x6f\x70\145\x72\x74\151\x20\127\110\x45\122\105\40\144\157\143\x75\x6d\x65\x6e\164\x6f\x3d\47" . $a . $b . "\47\x20\46\46\40\x74\x69\160\157\x64\x6f\143\x3d\47\x45\123\x50\47")->row(); $item = $this->db->query("\x53\105\x4c\105\103\x54\x20\52\x20\106\x52\x4f\115\x20\x6f\160\145\162\155\x76\x20\x57\110\x45\x52\x45\40\144\157\143\165\155\x65\156\164\157\x3d\x27" . $a . $b . "\x27\40\x26\46\40\164\151\160\157\x64\157\x63\75\x27\105\x53\x50\x27\x20\x26\x26\x20\164\x69\x6d\160\165\145\x70\x72\x63\x3e\60")->result(); $totneto = 0; $totimpues = 0; $baseimp = 0; $totfinal = 0; $totcosto = 0; $totdesc = 0; foreach ($item as $ditem) { $totneto += $ditem->montoneto; $totimpues += ($ditem->preciofin - $ditem->preciooriginal) * $ditem->cantidad; $baseimp += $ditem->baseimpo1; $totfinal += $ditem->montototal; $totcosto += $ditem->costounit; $totdesc += $ditem->dsctoprc * $ditem->cantidad; $datos = array("\151\x64\137\x65\155\160\162\x65\x73\x61" => "\x44\x4d\x45\x44\111\x46", "\x61\x67\x65\x6e\143\x69\141" => "\60\60\61", "\164\x69\x70\157\144\x6f\143" => "\105\x53\x50", "\144\157\143\x75\155\145\x6e\164\x6f" => '' . $a . $newdoc . '', "\x67\162\165\160\x6f" => '' . $ditem->grupo . '', "\x6f\x72\x69\x67\145\x6e" => "\61", "\143\x6f\144\x69\x67\x6f" => '' . $ditem->codigo . '', "\x70\x69\x64" => '' . $pid . '', "\156\x6f\155\x62\162\x65" => '' . $ditem->nombre . '', "\143\x6f\163\x74\157\x75\x6e\x69\x74" => '' . $ditem->costounit . '', "\160\x72\x65\143\151\x6f\x75\156\x69\164" => '' . $ditem->preciounit . '', "\144\163\143\x74\157\165\x6e\x69\x74" => '' . $ditem->dsctounit . '', "\144\x73\x63\x74\157\x70\x72\143" => '' . $ditem->dsctoprc . '', "\x70\162\x65\143\x69\157\x66\x69\156" => '' . $ditem->preciofin . '', "\x70\x72\x65\143\x69\157\x6f\162\151\x67\151\156\141\154" => '' . $ditem->preciooriginal . '', "\x63\141\156\x74\x69\144\141\x64" => '' . $ditem->cantidad . '', "\x6d\x6f\x6e\x74\157\x6e\x65\x74\157" => '' . $ditem->montoneto . '', "\155\x6f\156\164\x6f\164\x6f\164\141\154" => '' . $ditem->montototal . '', "\164\151\x6d\160\x75\x65\x70\162\x63" => '' . $ditem->timpueprc . '', "\141\154\155\x61\143\145\x6e" => $ditem->almacen, "\160\162\x6f\166\145\145\x64\x6f\162" => $ditem->proveedor, "\x66\145\x63\150\141\x64\x6f\143" => '' . date("\x59\55\x6d\x2d\144") . '', "\x69\155\160\x75\145\x73\164\x6f\61" => "\60", "\151\155\x70\x75\145\x73\164\x6f\x32" => "\60", "\166\x65\156\x64\145\x64\157\162" => '' . $ditem->vendedor . '', "\145\155\x69\163\x6f\x72" => "\106\x41\103\x54\125\x52\x41\104", "\x75\x73\x61\x73\145\x72\x69\x61\x6c" => "\62", "\x74\x69\160\x6f\x70\162\x65\143\x69\157" => "\x31", "\x75\156\151\x64\x61\x64" => "\125\x4e\x44", "\x61\x67\x72\165\x70\x61\x64\x6f" => "\62", "\143\x6f\155\160\165\145\163\x74\x6f" => "\x32", "\165\163\x61\x65\170\151\x73\x74" => "\x31", "\141\165\x78\x31" => '' . $ditem->aux1 . '', "\145\x73\x74\141\x63\x69\x6f\156" => "\x30\x30\x31", "\x75\144\151\156\141\x6d\151\x63\x61" => "\x31", "\142\x61\x73\x65\x69\155\x70\x6f\x31" => '' . $ditem->baseimpo1 . '', "\x62\x61\163\x65\x69\155\x70\x6f\x32" => "\x30", "\x6c\157\164\x65" => $ditem->lote, "\151\x64\x76\141\154\x69\144\141\x63\151\157\156" => '', "\x66\145\x63\x68\x61\171\150\x6f\162\x61" => '' . date("\131\x2d\155\55\x64\40\110\x3a\x69\x3a\x73") . '', "\x65\x6e\166\x69\x61\x64\157\x5f\x6b\x6d\x6f\156\151\164\157\162" => "\x30"); $this->db->insert("\x6f\160\x65\x72\x6d\166", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("\x44\105\114\105\x54\x45\40\106\122\117\x4d\40\x6f\160\x65\162\x6d\x76\40\x57\110\x45\x52\105\40\144\x6f\x63\x75\x6d\145\156\x74\x6f\75\47" . $a . $b . "\47\40\46\46\40\164\151\x70\x6f\x64\x6f\x63\75\x27\x45\123\x50\47\x20\x26\x26\40\x63\157\144\x69\x67\157\x3d\x27{$ditem->codigo}\x27\x20\x26\46\40\143\141\x6e\164\x69\144\141\144\x3d\x27{$ditem->cantidad}\x27"); } } $datos2 = array("\x69\144\x5f\145\x6d\160\162\145\163\x61" => "\104\115\105\104\x49\106", "\141\x67\145\156\143\x69\x61" => "\60\60\61", "\164\x69\x70\157\x64\157\143" => "\x45\x53\120", "\155\157\x6e\x65\x64\141" => "\x30\x30\x30", "\144\x6f\143\165\155\x65\156\x74\x6f" => '' . $a . $newdoc . '', "\143\x6f\x64\143\154\x69\145\156\x74\145" => $oper->codcliente, "\x6e\157\x6d\x62\162\x65\143\x6c\x69" => '' . $oper->nombrecli . '', "\143\157\156\164\x61\143\x74\157" => "\116\x2f\101", "\162\151\x66" => '' . $oper->rif . '', "\144\x69\162\x65\x63\x63\151\157\156" => '' . $oper->direccion . '', "\164\145\x6c\x65\146\157\x6e\x6f\x73" => '' . $oper->telefono_movil . '', "\164\151\160\x6f\x70\x72\145\143\x69\157" => "\x31", "\x65\x6d\x69\x73\x69\x6f\x6e" => '' . date("\x59\x2d\x6d\55\144") . '', "\162\x65\143\x65\160\143\151\x6f\x6e" => '' . date("\x59\x2d\155\55\x64") . '', "\166\x65\156\x63\145" => '' . date("\131\x2d\155\55\144") . '', "\x66\145\x63\x68\141\x63\x72\145\x61" => '' . date("\x59\x2d\x6d\55\x64") . '', "\164\157\164\x63\x6f\163\x74\157" => $totcosto, "\164\x6f\164\142\162\x75\x74\157" => $totneto, "\x74\157\164\156\145\164\x6f" => $totneto, "\x74\x6f\x74\x61\154\146\151\156\x61\154" => $totfinal, "\x74\x6f\x74\151\x6d\160\x75\x65\x73\x74" => $totimpues, "\x74\157\164\144\x65\x73\143\x75\145\156" => $totdesc, "\151\155\160\x75\x65\x73\x74\157\x31" => $totimpues, "\151\x6d\x70\x75\145\x73\164\157\62" => $totimpues, "\x64\163\143\x74\157\x6c\x69\156\145\x61" => $totdesc, "\144\151\x61\x73\x63\x72\145\x64" => $oper->diascred, "\166\145\156\144\x65\x64\157\162" => '' . $oper->vendedor . '', "\146\x61\x63\x74\x6f\162\143\x61\x6d\142" => "\61", "\x75\145\x6d\x69\163\x6f\x72" => '' . $oper->vendedor . '', "\145\x73\164\141\143\x69\157\x6e" => "\x30\60\61", "\x73\151\x6e\x69\x6d\x70\x75\145\163\x74" => 0, "\x61\154\x6d\141\143\145\x6e" => "\x30\x32", "\163\x65\x63\x74\157\162" => '' . $oper->sector . '', "\163\165\142\143\x6f\144\x69\147\157" => '' . $oper->subcodigo . '', "\x66\x6f\x72\155\141\146\151\163" => "\61", "\x61\x6c\x5f\154\x69\142\162\157" => "\61", "\x64\x62\x63\x72" => "\61", "\x68\157\x72\x61\144\157\x63\165\155" => '' . date("\x48\x3a\151\x3a\163") . '', "\x61\155\160\x6d" => "\62", "\145\x73\x63\x72\x65\144\151\164\x6f" => "\x31", "\142\x61\x73\145\151\x6d\160\157\61" => $baseimp, "\x66\145\143\x68\141\x79\150\157\162\x61" => '' . date("\x59\55\x6d\55\144\x20\x48\72\x69\72\163") . '', "\x69\x64\166\x61\x6c\151\x64\x61\x63\151\157\156" => '', "\x64\157\143\x75\155\145\x6e\x74\x6f\146\x69\x73\x63\x61\x6c" => "\x30\40\122\145\x63\x69\x62\151\144\x61", "\x63\157\155\x61\156\x64\x61\x5f\x6d\x6f\x76\x69\x6c" => "\x30", "\x63\157\x6d\141\156\144\x61\x5f\x6b\155\x6f\156\x69\164\157\x72" => "\60", "\156\x6f\164\x69\x6d\142\162\x61\x72" => "\x31", "\x61\x6e\x74\151\x70\157" => "\x45\123\120", "\x61\x6e\164\x64\x6f\x63" => '' . $a . $newdoc . ''); $this->db->insert("\157\x70\145\x72\x74\x69", $datos2); if ($this->db->affected_rows() > 0) { $control = array("\x64\x6f\x63" => '' . $a . $newdoc . '', "\163\x74\x61\x74\165\x73" => "\x30"); $this->db->insert("\x63\x6f\156\x74\x72\x6f\x6c\137\x6f\160\145\162\x74\151", $control); $this->db->query("\xa\x20\40\40\40\x20\x20\40\x20\x55\x50\104\x41\x54\x45\x20\157\160\145\162\164\x69\40\141\x32\x20\x53\x45\x54\x20\x61\62\x2e\164\x6f\164\x62\162\165\164\x6f\75\x28\x53\105\x4c\x45\x43\x54\40\x53\x55\115\50\x6d\157\x6e\x74\x6f\156\145\x74\x6f\x29\40\106\x52\117\x4d\40\157\160\x65\162\x6d\166\40\127\x48\x45\122\105\x20\x64\157\143\165\x6d\x65\x6e\x74\x6f\x3d\x61\62\56\144\x6f\x63\x75\x6d\x65\x6e\164\x6f\x29\x2c\xa\40\x20\x20\x20\x20\40\x20\x20\141\62\x2e\164\x6f\x74\156\145\164\x6f\75\50\123\105\114\105\x43\x54\x20\x53\x55\115\x28\155\157\156\x74\x6f\x6e\145\164\x6f\x29\40\x46\122\x4f\115\40\157\x70\145\x72\155\166\40\127\x48\x45\x52\x45\40\144\x6f\x63\165\x6d\x65\156\x74\x6f\x3d\x61\x32\x2e\144\157\x63\x75\x6d\145\x6e\x74\x6f\51\54\141\x32\x2e\164\x6f\164\x61\x6c\146\x69\x6e\141\x6c\x3d\x28\x53\105\114\x45\x43\124\x20\123\x55\x4d\x28\155\157\x6e\164\157\164\157\164\x61\154\x29\40\x46\x52\x4f\x4d\x20\x6f\160\x65\162\155\x76\x20\x57\110\x45\x52\105\40\x64\157\x63\165\x6d\145\156\164\x6f\x3d\141\x32\x2e\x64\157\x63\x75\155\145\x6e\x74\157\x29\54\xa\40\40\40\40\40\x20\x20\40\x61\62\56\x62\x61\163\145\151\155\x70\x6f\61\x3d\x30\54\12\x20\x20\x20\40\40\40\x20\x20\141\62\x2e\164\157\x74\151\x6d\160\165\x65\163\x74\75\60\x2c\12\x20\40\x20\x20\40\x20\40\40\x61\62\56\164\157\x74\x64\x65\x73\x63\165\x65\156\75\x28\123\x45\x4c\x45\103\124\40\x53\125\x4d\50\x64\163\x63\x74\157\160\x72\x63\x2a\x63\141\156\x74\x69\144\141\x64\x29\x20\x46\122\x4f\115\40\157\x70\x65\162\x6d\166\x20\127\x48\x45\122\105\40\x64\157\143\165\x6d\145\x6e\x74\x6f\x3d\141\x32\56\144\x6f\143\x75\155\145\156\x74\x6f\x29\54\xa\x20\40\40\40\x20\x20\x20\x20\141\62\x2e\x74\157\x74\143\157\163\164\157\75\50\123\105\114\x45\x43\124\x20\x53\x55\x4d\50\x63\157\x73\164\x6f\x75\x6e\x69\x74\x29\40\106\x52\117\115\40\x6f\x70\145\162\x6d\166\40\127\x48\105\122\x45\40\144\x6f\143\x75\155\145\156\164\157\75\141\62\x2e\144\157\143\x75\x6d\145\x6e\164\157\51\xa\40\x20\40\40\40\x20\x20\40\x57\x48\105\x52\x45\x20\141\x32\x2e\144\157\x63\x75\155\x65\x6e\164\x6f\75\47" . $a . $b . "\47\40\x26\x26\40\141\62\56\164\x69\x70\x6f\x64\x6f\143\x3d\47\x45\123\120\x27\x3b\12\40\40\x20\40\x20\x20\40\x20"); } } function genecod($longitud) { $key = ''; $pattern = "\x31\x32\63\x34\x35\x36\67\x38\x39\x30"; $max = strlen($pattern) - 1; for ($i = 0; $i < $longitud; $i++) { $key .= $pattern[mt_rand(0, $max)]; } return $key; } public function elim_pedido($a) { $elim = $this->db->where("\151\x64\x5f\x70\145\x64\151\144\x6f", $a)->delete("\164\145\x6d\137\160\145\144\x69\x64\157"); echo $elim; } public function almaut($b) { $this->load->library("\x74\141\x62\154\145"); if ($b != '') { $filter = "\46\x26\40\50\x61\56\144\157\143\165\x6d\145\156\x74\x6f\x3d\x27{$b}\x27\x20\174\x7c\x20\x61\x2e\x63\x6f\x64\143\154\x69\x65\x6e\x74\x65\75\x27{$b}\x27\40\x7c\174\40\x61\x2e\x6e\157\x6d\x62\x72\x65\x63\154\x69\40\x6c\151\x6b\x65\40\47\x25{$b}\45\x27\40\x7c\174\40\x62\x2e\143\157\x64\x69\147\157\x3d\47{$b}\x27\40\x7c\174\40\x62\56\156\157\x6d\142\162\x65\40\x6c\151\153\x65\x20\47\x25{$b}\x25\47\51"; } else { $filter = ''; } if ($this->session->userdata("\164\151\x70") == "\62" || $this->session->userdata("\164\x69\160") == "\64" || $this->session->userdata("\x74\x69\x70") == "\x33" || $this->session->userdata("\x74\151\160") == "\x36" || $this->session->userdata("\x74\151\160") == "\x31\x31") { $solo = ''; } else { $solo = ''; } $bdfac = $this->db->query("\123\105\114\105\x43\124\40\141\x2e\144\x6f\143\x75\155\x65\x6e\x74\157\54\x61\56\x61\x6e\x74\x64\157\x63\x2c\141\x2e\164\151\x70\x6f\x64\157\x63\x2c\x20\141\56\x63\x6f\x64\x63\x6c\151\145\156\x74\145\54\x20\141\56\156\x6f\155\142\x72\x65\x63\x6c\x69\54\x20\x61\x2e\x74\145\154\x65\x66\157\x6e\157\x73\54\40\141\x2e\x73\145\x63\164\157\x72\54\141\x2e\x76\x65\156\144\x65\x64\x6f\x72\x2c\x20\122\x4f\x55\x4e\x44\50\123\x55\x4d\50\142\x2e\143\141\156\164\x69\144\141\144\51\x2c\62\51\40\x75\x6e\151\x64\141\x64\145\x73\54\40\143\56\x74\151\x6d\x65\x61\x75\164\x2c\143\56\x74\x69\x6d\x65\x61\x73\x69\147\54\143\x2e\164\x69\155\145\145\x6d\160\x2c\40\143\56\x73\164\141\x74\165\x73\40\xa\40\x20\x20\x20\x46\122\x4f\115\x20\157\160\145\162\164\x69\x20\x41\x53\x20\x61\40\xa\40\40\40\40\x4a\x4f\x49\x4e\x20\157\x70\x65\x72\x6d\x76\40\x41\123\x20\x62\40\x4f\x4e\x20\141\56\x64\x6f\143\165\x6d\145\156\x74\157\x3d\142\56\x64\x6f\x63\x75\155\x65\156\x74\x6f\xa\40\x20\40\x20\112\x4f\111\x4e\40\x63\x6f\156\164\162\x6f\154\137\x6f\x70\145\162\164\151\40\x41\123\40\x63\40\117\x4e\x20\x61\56\141\x6e\x74\x64\x6f\x63\x3d\143\56\144\x6f\143\xa\40\x20\40\40\x57\x48\x45\x52\x45\40\x61\56\x66\145\143\x68\141\x63\x72\x65\141\x3e\x3d\x44\101\x54\105\x5f\x41\104\x44\50\103\125\122\104\101\x54\105\50\x29\x2c\111\x4e\124\x45\x52\x56\x41\114\x20\x2d\61\65\40\104\101\131\x29\40{$solo}\40\46\x26\x20\x61\x2e\x74\x69\x70\157\144\157\x63\75\x27\105\x53\x50\x27\x20{$filter}\12\x20\40\40\40\107\122\117\125\x50\x20\102\x59\40\x61\56\144\157\x63\165\155\x65\156\x74\x6f\x3b")->result(); $tunid = $this->db->query("\x53\x45\114\105\x43\124\x20\122\x4f\x55\116\104\x28\x53\125\115\50\x62\56\143\x61\x6e\x74\151\144\141\144\x29\54\x32\x29\40\x6e\12\40\40\40\40\x46\x52\x4f\115\x20\x6f\x70\x65\162\x74\x69\x20\101\x53\x20\141\40\12\x20\x20\40\x20\112\x4f\111\x4e\x20\157\160\145\x72\x6d\x76\40\101\123\40\x62\40\117\x4e\40\x61\56\144\157\143\165\155\x65\156\x74\157\x3d\142\x2e\144\x6f\143\165\x6d\x65\156\x74\157\12\x20\40\40\40\x4a\117\111\116\40\143\x6f\x6e\x74\x72\x6f\154\137\x6f\160\x65\162\164\151\40\101\x53\40\143\x20\117\x4e\40\141\x2e\x61\156\164\x64\157\143\x3d\143\56\144\157\x63\12\40\x20\40\40\x57\110\x45\122\105\x20\141\x2e\x66\x65\x63\150\141\x63\162\145\141\x3e\x3d\104\x41\124\105\137\x41\x44\x44\x28\103\x55\122\x44\x41\124\x45\x28\51\54\111\x4e\124\x45\122\126\101\114\40\x2d\x31\x30\x20\104\x41\131\x29\40{$solo}\x20\x26\46\x20\x61\56\x74\x69\160\157\x64\157\143\x3d\47\x45\123\120\x27\40{$filter}")->row(); $html = "\xa\x20\40\40\40\x3c\x74\x61\142\154\145\40\x63\154\141\163\x73\x3d\x22\x77\x33\x2d\x74\141\142\154\x65\55\141\154\x6c\x20\167\x33\55\150\157\166\x65\162\x61\x62\154\145\x20\x77\x33\x2d\x6c\x65\146\x74\x2d\141\x6c\x69\x67\156\x22\76\12\40\x20\x20\x20\74\164\x72\76\x3c\x74\x64\40\143\x6c\141\x73\163\75\42\x77\x33\x2d\x66\x6f\156\144\157\144\x72\157\x69\144\40\167\63\x2d\146\x69\x6a\157\42\76\102\165\x73\x63\141\162\x20\x3c\151\155\147\x20\163\x72\143\75\42" . base_url() . "\x69\x6d\x61\147\x65\163\x2f\142\165\163\143\x61\162\56\160\x6e\x67\x22\40\141\x6c\x74\75\42\x42\165\x73\143\x61\x72\42\40\164\151\x74\154\x65\x3d\x22\x42\165\x73\143\141\x72\x22\x20\x73\x74\x79\x6c\145\x3d\42\167\x69\144\x74\150\x3a\61\x38\x70\x78\73\x62\x6f\x72\x64\x65\x72\72\60\x3b\42\x3e\x3c\57\164\144\x3e\xa\40\x20\40\40\x3c\x74\x64\76\74\151\156\160\165\x74\40\x74\x79\160\x65\75\x22\164\145\x78\164\x22\x20\143\x6c\x61\x73\x73\75\42\167\63\55\x69\156\x70\165\164\42\x20\x69\x64\x3d\42\x6c\151\x6b\x65\42\x20\160\x6c\x61\x63\x65\150\157\x6c\x64\145\x72\75\x22\x49\x6e\x67\162\x65\163\145\x20\x73\x75\x20\142\165\x73\x71\x75\x65\x64\141\42\x20\x6f\x6e\143\x68\141\x6e\147\x65\75\42\141\x6c\x6d\x61\x75\x74\50\51\73\x22\76\x3c\x2f\x74\144\x3e\12\40\x20\x20\40\x3c\164\144\40\143\154\141\163\163\x3d\x22\167\x33\x2d\143\145\156\164\x65\x72\40\x77\x33\55\142\x74\x6e\x22\x3e\x3c\x61\40\x6f\x6e\143\154\151\143\153\75\x22\x61\165\x74\x6f\x72\x69\x7a\x61\162\x28\x29\73\42\x3e\74\151\x6d\147\40\x73\x72\x63\75\x22" . base_url() . "\x69\155\141\147\145\x73\x2f\142\156\x2e\x70\156\x67\x22\40\x61\154\164\75\42\101\x75\x74\157\x72\x69\172\141\162\x22\40\164\151\x74\x6c\x65\x3d\42\101\x75\164\157\x72\151\172\141\x72\42\x20\163\164\171\154\145\75\42\x77\151\144\164\150\x3a\62\x30\x70\170\73\x68\145\x69\x67\x68\164\x3a\x32\x30\160\x78\73\x62\157\162\144\x65\x72\72\x30\73\x22\x3e\74\57\x61\76\x3c\57\164\144\x3e\xa\40\x20\40\x20\74\x74\144\x20\x63\x6c\141\x73\x73\75\x22\167\63\55\x63\x65\156\164\145\x72\40\x77\63\55\142\x74\x6e\42\x3e\x3c\141\40\157\156\x63\154\x69\143\153\x3d\42\x72\x65\163\x65\x72\x76\x61\160\145\x64\50\51\x3b\x22\x3e\x3c\x69\x6d\x67\40\163\x72\143\75\x22" . base_url() . "\151\155\141\x67\145\x73\x2f\x72\x65\163\145\162\166\141\x64\x6f\x2e\x70\156\147\42\40\141\x6c\x74\75\x22\122\145\x73\x65\x72\166\x61\162\42\x20\164\151\164\x6c\x65\x3d\x22\122\145\x73\145\162\x76\141\162\x22\40\163\x74\171\x6c\x65\75\42\x77\x69\x64\x74\x68\72\x32\60\160\x78\x3b\x68\145\151\x67\150\164\72\62\60\x70\x78\73\x62\x6f\x72\144\145\162\x3a\60\73\42\x3e\74\57\x61\76\74\57\x74\144\x3e\12\x20\x20\40\40\74\164\144\x20\x63\154\141\163\163\x3d\x22\x77\63\x2d\x63\145\156\164\145\x72\x20\167\63\55\142\x74\x6e\x22\x3e\74\x61\40\x6f\156\x63\x6c\x69\x63\153\75\42\160\162\145\146\x61\x63\x28\x29\73\x22\x3e\74\151\155\147\40\163\162\143\75\x22" . base_url() . "\x69\155\x61\x67\145\x73\x2f\x66\x61\143\164\165\162\141\x2e\160\156\x67\42\40\141\154\164\x3d\42\106\x61\x63\x74\x75\x72\x61\162\x22\x20\164\x69\x74\x6c\145\x3d\42\106\141\143\x74\165\x72\x61\x72\42\x20\x73\x74\171\154\145\75\42\x77\151\144\x74\150\72\62\60\x70\x78\x3b\150\x65\151\147\150\164\x3a\62\60\160\170\73\x62\157\162\144\x65\x72\72\60\x3b\x22\x3e\74\x2f\x61\76\74\x2f\x74\x64\76\12\40\x20\40\40\74\164\144\40\x63\x6c\x61\163\x73\x3d\x22\x77\63\x2d\143\145\156\164\145\162\40\x77\63\x2d\x62\x74\x6e\42\76\x3c\141\x20\x6f\156\143\x6c\151\x63\x6b\75\x22\x76\151\145\167\x70\145\x64\164\x65\155\x70\50\x29\x3b\x22\x3e\x3c\x69\x6d\147\40\163\162\x63\75\42" . base_url() . "\151\155\141\147\x65\x73\57\160\x65\x64\164\145\155\160\56\160\x6e\x67\x22\40\141\x6c\164\x3d\x22\x54\145\x6d\160\x6f\162\141\154\x65\x73\x22\x20\x74\x69\164\154\145\x3d\42\x54\x65\155\x70\157\162\141\154\x65\x73\42\x20\x73\x74\x79\x6c\x65\x3d\42\x77\x69\x64\x74\150\72\x32\x30\x70\x78\x3b\x68\x65\151\x67\x68\x74\72\x32\60\160\x78\73\142\157\x72\144\145\x72\x3a\60\x3b\42\76\x3c\x2f\x61\76\74\57\x74\x64\x3e\xa\x20\40\40\40\x3c\164\144\x20\143\x6c\141\x73\163\75\x22\x77\x33\55\x63\x65\156\x74\145\162\40\x77\63\55\x62\x74\x6e\x22\x3e\x3c\141\40\157\x6e\x63\x6c\x69\x63\x6b\75\x22\166\151\145\167\142\141\x63\x6b\157\162\144\x65\162\x28\x29\x3b\42\x3e\74\x69\155\147\x20\163\x72\x63\75\42" . base_url() . "\x69\155\x61\147\x65\x73\x2f\142\x61\x63\x6b\x6f\162\144\x65\162\56\x70\156\x67\x22\40\x61\x6c\x74\75\x22\x42\141\143\153\x6f\x72\144\x65\x72\42\40\164\x69\164\154\x65\x3d\x22\102\141\143\153\x6f\162\144\145\162\x22\x20\x73\164\171\154\x65\x3d\x22\x77\151\x64\164\150\x3a\62\x30\160\170\73\x68\x65\x69\147\x68\x74\x3a\x32\x30\x70\x78\73\142\x6f\x72\x64\x65\x72\x3a\60\73\x22\x3e\74\57\141\76\x3c\x2f\x74\144\76\12\40\40\40\x20\x3c\164\144\x20\x63\x6c\x61\x73\x73\75\x22\x77\63\55\143\x65\156\x74\145\x72\40\x77\63\55\x62\x74\x6e\x22\76\x3c\x61\x20\157\156\143\154\x69\x63\x6b\75\x22\145\x64\x69\x74\146\141\143\50\51\73\42\76\x3c\x69\155\147\x20\163\162\x63\x3d\42" . base_url() . "\151\x6d\141\147\145\163\x2f\145\x64\x69\164\141\x72\x2e\x70\x6e\x67\42\x20\x61\x6c\164\x3d\x22\105\x64\151\164\x61\x72\40\x56\145\156\x64\145\144\x6f\x72\x22\40\x74\x69\x74\x6c\x65\75\42\105\x64\x69\164\x61\162\x20\126\145\156\144\x65\144\x6f\x72\x22\40\x73\x74\x79\x6c\x65\75\42\x77\151\144\164\150\x3a\x32\60\x70\170\x3b\150\x65\151\x67\150\164\x3a\62\60\x70\170\x3b\142\157\162\x64\145\x72\x3a\x30\73\x22\76\x3c\x2f\x61\76\x3c\57\x74\x64\x3e\xa\40\40\x20\40\x3c\x74\x64\x20\143\x6c\x61\x73\163\x3d\42\167\x33\x2d\143\145\x6e\x74\x65\162\x20\x77\x33\55\142\x74\x6e\42\x3e\x3c\141\x20\x6f\156\x63\154\x69\x63\153\x3d\42\x61\x67\147\143\x6f\155\142\157\50\x29\73\42\76\74\151\x6d\147\40\163\x72\143\x3d\x22" . base_url() . "\x69\x6d\141\147\x65\163\x2f\x63\x6f\155\x62\157\56\160\156\147\x22\40\141\154\x74\75\x22\x41\147\162\145\147\141\x72\40\103\157\x6d\142\x6f\x22\x20\164\151\164\154\145\x3d\42\101\x67\162\145\147\141\x72\x20\x43\x6f\155\142\157\42\x20\163\x74\171\154\x65\75\42\167\x69\144\x74\x68\72\x32\60\160\x78\73\x68\145\x69\x67\x68\164\x3a\62\60\160\170\73\x62\157\162\144\145\x72\72\x30\x3b\42\x3e\74\x2f\x61\76\74\57\164\x64\x3e\12\x20\x20\x20\x20\x3c\x74\144\x20\x63\x6c\141\163\x73\x3d\42\167\63\55\x63\x65\x6e\x74\145\x72\40\x77\63\55\142\x74\x6e\42\76\x3c\x61\40\x6f\x6e\143\x6c\151\x63\153\75\x22\x6e\x65\167\x70\162\x65\x63\151\157\50\51\73\42\76\x3c\151\x6d\147\x20\x73\x72\143\75\42" . base_url() . "\151\x6d\141\x67\145\163\x2f\x70\x72\145\143\151\157\x6e\x65\x77\x2e\x70\156\x67\x22\x20\141\154\164\75\42\120\162\145\x63\x69\x6f\40\144\x65\x20\x4d\141\xc3\261\141\156\x61\x22\x20\164\x69\164\x6c\x65\75\42\120\x72\x65\143\151\157\40\144\145\40\x4d\141\303\261\x61\x6e\x61\x22\x20\x73\164\x79\x6c\145\75\42\x77\151\144\164\x68\x3a\x32\x30\160\x78\x3b\x68\x65\x69\147\x68\164\72\62\x30\x70\170\x3b\142\157\x72\144\145\162\72\60\x3b\42\x3e\74\x2f\141\76\x3c\x2f\x74\144\x3e\xa\40\x20\40\x20\x3c\164\x64\40\143\154\x61\x73\163\x3d\x22\167\x33\55\x63\x65\x6e\x74\x65\x72\x20\x77\63\x2d\142\x74\x6e\x22\x3e\74\x61\40\157\156\143\154\x69\143\x6b\x3d\42\141\x6c\155\x61\x75\x74\x28\x29\73\42\x3e\x3c\151\x6d\x67\x20\163\x72\143\x3d\42" . base_url() . "\x69\x6d\x61\x67\145\163\57\162\145\154\157\x61\144\56\x70\x6e\147\x22\40\x61\154\x74\75\x22\x52\x65\143\x61\x72\147\x61\x72\42\x20\x74\x69\164\x6c\145\75\x22\x52\x65\143\141\162\147\141\x72\x22\x20\x73\164\171\154\x65\x3d\x22\x77\x69\144\x74\x68\x3a\x32\60\x70\x78\x3b\150\x65\x69\147\x68\164\x3a\62\60\x70\x78\73\142\157\x72\144\145\x72\72\x30\73\x22\x3e\x3c\x2f\x61\76\x3c\x2f\x74\144\76\xa\40\40\x20\40\74\x74\x64\x20\143\154\x61\x73\x73\75\42\167\x33\55\143\145\x6e\164\x65\162\40\167\x33\55\142\164\x6e\42\76\74\141\x20\157\156\x63\154\x69\143\153\x3d\x22\x65\x6c\x69\x6d\146\141\143\50\51\73\x22\x3e\x3c\x69\x6d\147\40\163\x72\143\75\x22" . base_url() . "\x69\155\141\147\x65\163\57\x62\x6f\162\162\x61\162\56\x70\156\147\x22\40\x61\154\164\x3d\42\x45\x6c\x69\x6d\151\x6e\x61\x72\x22\40\164\x69\x74\154\x65\x3d\x22\105\x6c\151\x6d\151\156\x61\x72\x22\40\x73\x74\x79\154\x65\75\x22\x77\151\144\164\150\x3a\62\60\x70\x78\73\150\145\x69\x67\x68\x74\x3a\62\x30\x70\170\x3b\142\157\x72\144\145\x72\x3a\60\73\x22\76\x3c\57\x61\76\x3c\x2f\164\144\76\x3c\57\164\x72\x3e\xa\x20\x20\40\x20\x3c\57\164\x61\x62\x6c\x65\76\74\142\x72\x3e\12\40\40\x20\x20\74\164\141\x62\x6c\145\x20\x69\144\75\42\151\x64\x30\61\x22\40\x63\154\x61\x73\163\75\x22\x77\63\x2d\164\x61\142\154\x65\55\141\154\154\x20\x77\63\55\150\157\166\145\x72\x61\x62\x6c\x65\x20\167\63\55\x6c\x65\146\x74\x2d\x61\154\x69\147\x6e\40\167\x33\55\164\x69\x6e\171\x22\x3e\x3c\x74\162\x20\143\154\x61\x73\x73\75\42\x77\x33\55\146\x6f\x6e\144\x6f\144\162\157\x69\x64\x22\x3e\x3c\x74\150\x3e\x4e\74\x2f\164\150\x3e\74\x74\x68\x3e\104\x6f\x63\74\57\x74\x68\76\x3c\164\150\x3e\x43\x6f\144\x69\147\157\74\x2f\x74\x68\76\74\x74\x68\x3e\x4e\x6f\155\x62\x72\x65\74\57\x74\x68\76\74\x74\x68\x3e\123\145\x63\164\157\162\x3c\57\164\x68\76\x3c\x74\x68\x3e\126\145\x6e\144\x65\x64\157\162\x3c\x2f\164\x68\76\74\164\x68\76\x55\x6e\151\144\x61\144\x65\163\74\x2f\x74\150\x3e\x3c\x74\150\76\106\x2e\x41\x75\x74\157\x72\x69\x7a\x61\74\57\x74\150\76\x3c\164\150\76\x46\x2e\x41\163\x69\147\x6e\141\x3c\x2f\164\150\x3e\x3c\x74\x68\76\106\x2e\105\x6d\160\74\57\164\x68\76\74\x74\x68\x3e\105\x73\164\x61\164\165\163\74\x2f\x74\x68\76\74\57\164\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $psico = 0; $leg = ''; $vend = $this->db->query("\x53\105\114\105\103\x54\x20\142\56\x6e\157\x6d\x62\x72\x65\x20\x46\122\x4f\115\x20\157\x70\x65\x72\x74\x69\x20\x61\x73\40\141\40\112\117\111\116\x20\154\151\163\x74\166\145\x6e\144\x20\141\x73\x20\x62\x20\x4f\116\40\141\x2e\x76\145\156\144\145\144\x6f\162\x3d\142\x2e\143\x6f\144\151\147\x6f\x20\127\110\105\122\x45\x20\x61\56\x64\157\143\165\155\x65\x6e\x74\x6f\x3d\47{$dtfac->documento}\47\40\x4c\111\x4d\x49\x54\x20\x31")->row(); $html .= "\x3c\164\x72\40\151\x64\x3d\x22\163\154\145\x63\164" . $i . "\42\40\x63\x6c\x61\x73\163\x3d\42\x69\164\145\x6d\42\40\x6f\156\x63\154\x69\x63\x6b\75\42\x69\164\146\x61\143\x61\x75\x74\x28\x24\x28\x27\43\x61" . $i . "\x27\51\x2e\x76\141\x6c\x28\x29\51\73\42\x3e"; $psico = $this->db->query("\x53\105\114\x45\103\x54\x20\116\x55\114\x4c\x20\x46\122\117\115\x20\157\160\x65\162\x6d\166\40\x61\x20\x4a\117\x49\116\x20\x61\162\x74\x69\x63\x75\x6c\157\x20\142\x20\x4f\x4e\40\x61\x2e\x63\x6f\x64\x69\147\x6f\75\x62\56\x63\x6f\x64\151\x67\157\40\127\x48\x45\x52\105\x20\x61\x2e\x64\x6f\x63\165\x6d\x65\x6e\x74\x6f\75\x27{$dtfac->documento}\47\x20\46\46\40\142\x2e\143\157\156\x74\x72\157\x6c\141\144\x6f\75\61")->num_rows(); if ($psico > 0) { $leg = "\x63\154\x61\x73\x73\x3d\42\167\x33\55\160\151\156\153\x22"; } if ($dtfac->status == 0) { $status = "\x50\x65\156\144\x69\x65\x6e\164\145"; $color = "\x77\63\x2d\x72\x65\144"; } elseif ($dtfac->status == 4) { $status = "\x41\165\x74\157\162\151\172\141\x64\157"; $color = "\x77\63\55\x79\145\154\154\157\x77"; } elseif ($dtfac->status == 1) { $status = "\101\x72\x6d\141\156\144\157\x2e\56\x2e"; $color = "\167\63\55\x70\x61\x6c\x65\55\x79\x65\154\x6c\157\x77"; } elseif ($dtfac->status == 5 || $dtfac->status == 97) { $status = "\120\157\x72\40\126\x65\162\151\x66\151\143\x61\x72"; $color = "\x77\63\55\x70\x61\154\x65\x2d\142\x6c\x75\145"; } elseif ($dtfac->status == 98) { $status = "\x4c\151\x73\164\157"; $color = "\167\63\x2d\x67\162\145\145\156"; } elseif ($dtfac->status == 99) { $status = "\122\x65\x73\145\x72\x76\141\x64\x6f"; $color = "\x77\x33\55\157\162\141\156\x67\x65"; } else { $status = "\105\162\162\x6f\162"; $color = "\167\x33\55\162\145\144"; } $html .= "\74\x69\x6e\x70\165\164\x20\164\x79\160\145\x3d\42\150\x69\x64\144\x65\x6e\x22\40\x69\x64\75\42\141" . $i . "\x22\40\x6e\x61\x6d\145\x3d\x22\144\157\143\42\x20\166\141\x6c\165\145\75\42" . $dtfac->documento . "\x22\x3e\74\x69\x6e\160\165\x74\x20\164\x79\x70\145\x3d\42\150\151\x64\144\145\x6e\x22\40\x6e\x61\155\145\x3d\42\x73\164\x61\x74\165\x73\x22\x20\166\x61\154\165\145\75\42" . $dtfac->status . "\x22\x3e\xa\40\x20\40\x20\x20\40\40\x20\x3c\151\x6e\x70\x75\x74\40\164\171\160\145\x3d\x22\x68\151\144\x64\x65\156\42\40\x6e\x61\155\x65\x3d\x22\141\156\x74\x64\157\x63\42\40\x76\141\154\x75\145\x3d\42" . $dtfac->antdoc . "\42\x3e\74\x69\156\160\x75\164\40\164\171\160\x65\75\42\x68\x69\x64\144\145\x6e\x22\x20\156\141\x6d\x65\x3d\x22\x74\151\160\157\144\157\x63\42\x20\166\141\x6c\x75\x65\x3d\42" . $dtfac->tipodoc . "\42\x3e\12\40\x20\x20\x20\x20\40\40\x20\74\151\x6e\x70\x75\164\40\x74\x79\x70\x65\75\42\x68\151\144\144\145\x6e\42\x20\x6e\x61\155\x65\75\x22\160\x73\x69\x63\157\42\40\166\x61\154\x75\145\75\42" . $psico . "\x22\76\12\x20\40\x20\40\x20\40\40\x20\x3c\x74\x64\x3e" . $i . "\x3c\x2f\x74\x64\x3e\74\164\144\40" . $leg . "\x3e\x3c\151\156\x70\165\x74\40\x74\x79\160\145\x3d\42\x63\x68\145\x63\x6b\x62\x6f\170\42\40\x6f\156\143\x6c\x69\x63\153\x3d\x22\x77\x33\x2e\x74\157\x67\147\x6c\x65\103\154\141\x73\163\x28\x27\43\x73\154\145\x63\x74" . $i . "\47\x2c\x27\x77\x33\55\171\145\x6c\x6c\157\x77\x27\51\x3b\42\40\143\154\x61\x73\x73\x3d\x22\167\x33\55\143\150\x65\143\153\x22\40\x6e\141\155\145\x3d\x22\143\x68\x65\143\153\42\76" . $dtfac->documento . "\74\57\x74\x64\x3e\74\x74\144\x3e" . $dtfac->codcliente . "\74\57\164\x64\76\74\x74\144\76" . $dtfac->nombrecli . "\x3c\x2f\164\x64\x3e\x3c\x74\x64\76" . $dtfac->sector . "\x3c\57\x74\144\76\x3c\x74\144\x3e" . $vend->nombre . "\x3c\x2f\x74\144\x3e\74\164\144\76" . $dtfac->unidades . "\74\x2f\x74\x64\x3e\74\164\144\76" . $dtfac->timeaut . "\x3c\57\x74\x64\x3e\x3c\x74\144\76" . $dtfac->timeasig . "\x3c\x2f\x74\x64\76\74\164\144\76" . $dtfac->timeemp . "\x3c\57\164\x64\x3e\x3c\x74\144\40\x63\154\x61\163\x73\75\42" . $color . "\40\167\63\55\143\x65\156\x74\145\162\x22\x3e" . $status . "\74\57\164\x64\x3e\xa\40\40\x20\40\40\x20\40\40\x3c\x2f\164\162\76"; } $html .= "\x3c\x74\162\x3e\x3c\x74\144\x20\143\154\x61\163\163\x3d\42\x77\x33\x2d\143\x65\156\x74\x65\x72\40\x77\63\x2d\146\157\156\x64\157\x64\x72\157\x69\144\x22\x20\x63\157\x6c\x73\160\x61\x6e\x3d\42\x31\61\42\76\74\154\141\x62\x65\154\x20\x63\x6c\141\x73\163\x3d\42\x77\x33\55\x6c\141\162\147\145\42\76\74\x62\x3e\x54\157\164\141\x6c\x20\125\x6e\151\x64\141\x64\145\163\72\x20" . $tunid->n . "\74\57\x62\x3e\x3c\x2f\154\x61\x62\x65\x6c\76\x3c\x2f\164\144\76\x3c\x2f\164\162\x3e\74\57\164\x61\142\x6c\x65\76"; return $html; } public function itfacaut($a) { $this->load->library("\x74\x61\x62\x6c\145"); $bditfac = $this->db->query("\x53\x45\x4c\105\103\x54\x20\x63\x2e\143\x6f\144\x69\x67\x6f\x2c\x20\x63\56\156\157\x6d\142\162\x65\54\x20\122\x4f\125\x4e\x44\x28\x63\56\x63\x61\x6e\x74\x69\144\x61\144\x2c\62\x29\x20\x63\141\156\x74\151\x64\141\144\54\40\143\56\154\x6f\164\145\x2c\143\56\141\x6c\x6d\x61\143\145\x6e\54\40\x63\x2e\x74\x69\155\x70\165\145\x70\x72\x63\x2c\x63\56\163\x74\x61\164\x75\163\x2c\x63\56\144\x73\x63\x74\x6f\x75\156\x69\164\54\x52\x4f\x55\116\x44\50\143\56\160\x72\x65\143\x69\157\157\x72\x69\147\x69\x6e\141\154\54\x32\51\x20\160\162\x65\143\x69\157\x2c\x52\x6f\165\x6e\x64\50\x63\56\x70\162\x65\x63\x69\157\x66\x69\156\x2c\x32\51\x20\x70\162\x65\143\151\157\146\151\156\40\106\x52\x4f\x4d\40\157\x70\x65\x72\x6d\166\40\x41\123\40\x63\40\x57\110\105\122\x45\x20\143\x2e\144\157\143\x75\155\x65\x6e\x74\157\x3d\47{$a}\47\x3b")->result(); $nom = $this->db->query("\x53\105\x4c\x45\x43\124\x20\x6e\x6f\x6d\x61\160\x65\x20\x46\122\117\x4d\x20\164\x72\x61\x62\40\x61\x73\40\x61\x20\112\x4f\111\x4e\x20\143\157\x6e\164\x72\157\154\x5f\x6f\x70\x65\x72\164\x69\40\141\x73\x20\x62\40\117\116\40\141\x2e\151\144\x3d\x62\56\x74\162\141\142\x65\155\x70\141\161\40\127\x48\105\122\105\x20\x62\x2e\144\x6f\143\x3d\x27{$a}\x27")->row(); $vend = $this->db->query("\123\105\x4c\x45\103\124\40\142\x2e\x6e\157\155\x62\162\145\x20\x46\122\x4f\x4d\x20\157\x70\145\162\164\x69\x20\141\163\40\x61\x20\x4a\117\x49\116\x20\154\x69\x73\164\166\x65\x6e\x64\40\x61\163\x20\142\40\117\x4e\40\x61\x2e\x76\145\x6e\144\x65\x64\157\x72\75\x62\x2e\x63\x6f\x64\x69\x67\x6f\x20\127\110\x45\122\105\40\141\x2e\144\x6f\143\x75\x6d\145\x6e\x74\157\x3d\x27{$a}\x27\x20\114\111\x4d\111\x54\40\61")->row(); $bdarti = $this->db->query("\x53\x45\x4c\105\103\x54\40\143\157\144\151\147\x6f\54\103\117\116\103\x41\124\50\x27\x4e\157\155\142\x72\145\x3a\40\47\x2c\156\157\155\x62\x72\145\54\x27\40\x43\141\x6e\164\151\144\141\144\x3a\40\47\x2c\x72\157\x75\156\144\x28\145\x78\151\163\x74\145\x6e\143\x69\x61\x2d\143\x6f\155\160\x72\157\x6d\x65\x74\x69\x64\x6f\x29\x29\40\156\x6f\155\142\162\x65\x20\x46\x52\x4f\115\40\141\162\164\x69\143\x75\x6c\157\40\127\x48\105\x52\145\x20\160\141\162\x61\x5f\167\145\142\75\61\x20\x26\46\x20\x65\170\151\163\164\x65\156\143\151\x61\76\x30")->result(); $art = "\74\x69\156\x70\x75\164\x20\164\171\160\145\x3d\42\x74\x65\170\x74\42\40\143\154\x61\163\163\x3d\42\x77\x33\x2d\151\156\160\x75\164\42\40\x69\x64\75\42\156\x65\x77\x63\157\144\x69\147\x6f\x22\x20\x6c\151\x73\164\x3d\42\x6c\151\x73\164\x61\162\164\151\42\40\160\154\x61\x63\145\x68\157\x6c\144\145\x72\x3d\x22\x50\x72\157\x64\x75\143\x74\x6f\x2e\x2e\56\42\76\74\x64\x61\x74\x61\x6c\151\x73\x74\x20\x69\x64\x3d\x22\154\151\163\x74\141\x72\x74\x69\42\x3e"; foreach ($bdarti as $dbarti) { $art .= "\x3c\x6f\x70\x74\x69\157\x6e\x20\166\141\154\x75\145\x3d\x22" . $dbarti->codigo . "\x22\76" . $dbarti->nombre . "\x3c\x2f\x6f\x70\164\x69\x6f\x6e\76"; } $art .= "\x3c\x2f\144\141\164\141\154\x69\163\x74\76"; $html = "\12\40\40\40\x20\74\x21\x2d\x2d\x3c\141\x20\157\156\143\x6c\151\x63\153\x3d\42\145\144\x69\164\x70\x72\157\144\x75\143\x74\157\x28\x29\x3b\42\40\x63\154\141\x73\163\75\42\167\x33\55\142\x74\156\x22\76\x3c\151\155\x67\40\x73\x72\x63\x3d\42" . base_url() . "\151\x6d\x61\x67\x65\163\57\x6e\x64\x2e\x70\156\147\x22\x20\141\x6c\164\x3d\42\107\145\156\x65\162\141\162\x20\116\x2f\x44\42\x20\x74\x69\x74\154\145\75\42\x47\x65\156\x65\162\x61\162\40\116\57\104\x22\40\x73\x74\x79\x6c\145\x3d\x22\167\151\144\164\x68\x3a\62\60\160\x78\73\x68\145\x69\147\x68\x74\x3a\62\60\160\170\x3b\142\157\x72\144\145\162\72\x30\73\42\x3e\x3c\x2f\141\x3e\x2d\55\76\xa\x20\x20\40\x20\74\x74\141\x62\x6c\x65\x20\x63\x6c\141\x73\x73\x3d\42\167\63\55\x74\141\142\154\x65\x2d\141\154\154\x20\167\63\55\150\157\x76\145\x72\x61\x62\154\145\40\x77\63\55\x6c\145\x66\164\55\141\154\151\147\156\42\76\12\40\x20\40\x20\x3c\164\162\76\xa\x20\40\40\40\x3c\164\144\x20\x63\x6c\x61\x73\x73\x3d\42\x77\63\x2d\x66\x6f\156\144\157\x64\162\157\151\x64\42\x3e\126\145\x6e\144\x65\144\157\162\x3a\x3c\57\164\x64\x3e\12\40\40\40\x20\74\x74\x64\x3e" . $vend->nombre . "\x3c\57\164\x64\x3e\12\x20\x20\x20\x20\74\x74\x64\x20\143\154\141\x73\x73\75\42\x77\x33\55\x66\x6f\156\144\x6f\x64\162\157\151\144\42\76\101\163\x69\x67\156\x61\144\x6f\72\74\57\x74\x64\x3e\xa\x20\x20\40\x20\x3c\x74\x64\76" . $nom->nomape . "\x3c\57\164\144\76\x3c\x2f\164\162\x3e\xa\40\40\40\40\x3c\57\x74\141\x62\x6c\145\x3e\74\142\x72\x3e\12\x20\40\40\x20\74\164\x61\x62\x6c\145\x20\x63\154\x61\163\163\x3d\x22\x77\63\55\164\141\x62\x6c\x65\55\x61\x6c\x6c\40\x77\63\x2d\x68\157\166\x65\x72\141\x62\x6c\x65\x20\x77\63\x2d\154\145\x66\x74\x2d\x61\x6c\x69\x67\156\40\x77\x33\x2d\x74\x69\156\x79\x22\x3e\x3c\x74\x72\40\x63\x6c\141\163\x73\75\42\x77\x33\x2d\146\157\156\144\157\144\162\x6f\x69\144\x22\x3e\x3c\164\150\x3e\x4e\x3c\x2f\x74\x68\x3e\x3c\x74\150\76\x41\x6c\x6d\x3c\x2f\x74\150\76\x3c\x74\x68\76\x50\162\157\x64\x75\x63\x74\x6f\74\57\164\x68\x3e\74\164\150\x3e\x50\162\x65\143\x69\157\x3c\x2f\x74\x68\76\x3c\x74\150\76\104\105\123\103\x3c\57\x74\x68\x3e\74\x74\150\x3e\111\126\x41\74\57\164\150\x3e\x3c\x74\150\76\120\162\145\x63\151\x6f\x46\x69\x6e\x3c\57\x74\150\76\x3c\x74\150\76\103\x61\x6e\x74\151\x64\x61\144\x3c\x2f\x74\150\76\x3c\x74\150\x3e\114\157\164\x65\74\57\x74\150\76\x3c\164\150\76\x45\163\x74\141\164\165\163\x3c\x2f\x74\x68\76\74\164\x68\76\x3c\x2f\164\150\76\74\x2f\164\162\76"; $i = 0; $html .= "\74\164\162\x3e\74\164\144\x3e\74\x2f\x74\x64\x3e\x3c\x74\144\x3e\x3c\x2f\x74\144\x3e\x3c\x74\144\x3e" . $art . "\74\x2f\x74\144\76\x3c\x74\x64\x3e\74\x2f\164\144\76\x3c\x74\x64\x3e\74\57\164\144\76\x3c\164\x64\76\x3c\57\164\x64\76\x3c\164\144\x3e\x3c\57\x74\144\76\74\164\144\x3e\74\151\x6e\160\165\x74\x20\164\x79\160\145\75\42\156\165\155\142\x65\x72\x22\x20\143\x6c\x61\x73\x73\75\x22\x77\x33\55\x69\x6e\160\165\x74\x22\x20\x69\x64\x3d\x22\156\145\167\143\141\156\x74\x69\x74\x65\155\x22\x20\x70\154\x61\143\145\x68\157\154\144\145\x72\75\x22\156\56\x2e\x2e\x22\40\x73\164\171\x6c\x65\x3d\42\167\151\x64\164\x68\72\63\60\x70\170\x3b\42\x3e\74\57\x74\x64\x3e\x3c\164\x64\x3e\74\x2f\164\144\76\x3c\x74\x64\x3e\74\57\x74\x64\x3e\74\164\144\76\x3c\x61\x20\157\x6e\x63\154\151\x63\153\x3d\x22\162\145\x67\151\164\145\x6d\x66\141\143\50\x29\x3b\42\40\x73\x74\171\154\145\75\42\x63\x75\x72\163\x6f\162\x3a\160\x6f\151\156\164\x65\162\x22\76\74\x69\x6d\147\40\x73\x72\143\x3d\42" . base_url() . "\x69\x6d\141\147\145\163\x2f\162\x65\x67\151\163\x74\x72\141\x72\x2e\160\x6e\147\42\40\x61\x6c\164\x3d\x22\x52\x65\x67\151\x73\x74\162\141\162\x20\x49\164\145\x6d\42\40\x74\x69\164\154\x65\x3d\x22\x52\x65\147\x69\x73\x74\162\141\162\x20\111\x74\145\x6d\42\40\x73\x74\171\x6c\145\75\42\x77\x69\x64\164\x68\72\62\60\x70\x78\x3b\150\145\x69\x67\150\x74\x3a\62\60\160\170\73\x62\x6f\x72\144\x65\x72\x3a\x30\73\x22\x3e\x3c\57\141\76\x3c\57\x74\144\x3e\x3c\57\x74\x72\x3e"; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "\120\x65\156\144\151\145\156\164\x65"; $color = "\167\63\x2d\162\145\x64"; } elseif ($dtitfac->status == 1) { $status = "\114\151\x73\x74\x6f"; $color = "\167\63\55\147\162\145\145\x6e"; $btnelim = ''; } if ($this->session->userdata("\x74\151\x70") == "\x32" || $this->session->userdata("\164\x69\160") == "\63" || $this->session->userdata("\164\151\160") == "\66") { $btnelim = "\74\141\x20\x6f\x6e\143\x6c\x69\x63\x6b\75\42\x61\x6c\x65\x72\164\x5f\145\x6c\151\x6d\137\141\154\155\160\x65\x64\50\44\50\x27\x23\x64\157\x63\47\51\56\166\x61\x6c\50\51\x2c\x24\x28\47\x23\143\x6f\144\155\x65\144" . $i . "\47\x29\56\x76\x61\x6c\x28\x29\54\44\x28\47\43\x63\x61\156\x74" . $i . "\x27\51\x2e\x76\x61\154\50\51\x2c\44\50\47\x23\141\154\x6d\141\x63\145\x6e" . $i . "\47\51\56\x76\141\x6c\x28\x29\51\73\162\145\164\x75\162\156\x20\x66\x61\154\163\145\73\42\x3e\74\151\x6d\147\x20\x73\x72\143\x3d\x22" . base_url() . "\x69\155\141\x67\x65\163\57\142\157\162\x72\x61\x72\56\160\x6e\x67\42\40\141\x6c\164\75\42\105\x6c\x69\x6d\151\x6e\x61\x72\42\40\x74\x69\164\154\145\75\x22\x45\x6c\x69\155\x69\156\141\x72\42\x20\163\x74\x79\154\x65\75\x22\x77\x69\x64\164\x68\72\61\x36\160\x78\73\x68\x65\151\147\150\164\72\x31\66\160\170\x3b\x62\x6f\162\144\x65\162\72\60\73\42\76\74\57\141\x3e"; } $html .= "\x3c\x74\x72\x3e\74\x69\156\x70\x75\164\x20\164\x79\x70\145\75\x22\x68\x69\x64\x64\145\156\x22\x20\x69\144\x3d\42\x64\157\x63\x22\40\x76\x61\x6c\165\x65\x3d\42" . $a . "\x22\76\x3c\151\x6e\x70\x75\x74\40\x74\x79\x70\x65\x3d\x22\x68\x69\144\144\x65\156\42\40\x69\x64\x3d\x22\x63\157\x64\155\145\x64" . $i . "\42\40\x76\x61\x6c\165\145\x3d\42" . $dtitfac->codigo . "\42\x3e\12\40\40\x20\x20\x20\40\40\40\74\151\156\x70\165\x74\x20\x74\x79\x70\x65\75\x22\x68\151\144\144\x65\156\42\40\x69\144\75\x22\x61\x6c\155\141\143\x65\156" . $i . "\x22\40\166\x61\x6c\165\x65\x3d\x22" . $dtitfac->almacen . "\x22\x3e\x3c\151\156\160\x75\164\40\164\x79\x70\x65\75\42\x68\151\x64\144\x65\156\42\40\x69\x64\75\42\143\141\x6e\164" . $i . "\42\x20\166\x61\154\x75\x65\x3d\x22" . $dtitfac->cantidad . "\x22\x3e\xa\40\40\40\x20\x20\x20\40\40\74\164\x64\76" . $i . "\x3c\x2f\164\144\x3e\x3c\x74\144\x3e" . $dtitfac->almacen . "\x3c\x2f\164\x64\x3e\x3c\x74\x64\76" . $dtitfac->codigo . "\40" . $dtitfac->nombre . "\x3c\57\x74\x64\76\74\x74\x64\x20\x6f\x6e\x64\142\x6c\143\x6c\151\x63\x6b\x3d\42\151\x6e\x70\165\x74\160\x72\143\x28\44\x28\47\43\144\x6f\143\x27\51\x2e\166\141\x6c\x28\51\54\x24\50\x27\43\143\x6f\x64\x6d\145\x64" . $i . "\47\51\x2e\x76\141\x6c\50\x29\x2c\x24\50\47\x23\x63\x61\x6e\164" . $i . "\x27\51\x2e\x76\141\x6c\50\x29\x2c\x27" . $dtitfac->precio . "\x27\54\47" . $i . "\47\51\x3b\42\40\151\144\x3d\42\x76\145\x72\x70\x72\143" . $i . "\42\x3e" . $dtitfac->precio . "\74\x2f\x74\x64\x3e\74\x74\144\x3e" . ROUND($dtitfac->dsctounit, 2) . "\74\57\164\x64\76\74\164\x64\x3e" . ROUND($dtitfac->timpueprc, 2) . "\74\57\x74\144\76\x3c\164\144\76" . $dtitfac->preciofin . "\74\57\x74\x64\76\x3c\x74\144\40\157\x6e\x64\x62\154\143\x6c\151\143\153\x3d\x22\x69\x6e\160\x75\x74\x63\x61\156\x74\50\x24\x28\47\43\x64\x6f\x63\47\51\56\166\x61\x6c\50\51\x2c\x24\50\47\43\x63\157\144\x6d\145\x64" . $i . "\x27\x29\x2e\x76\141\154\x28\x29\54\44\x28\x27\43\x63\141\156\164" . $i . "\47\51\56\166\x61\154\x28\x29\54\47" . $i . "\x27\x29\x3b\x22\40\x69\144\75\x22\166\x65\x72\143\x61\156\x74" . $i . "\x22\x3e" . $dtitfac->cantidad . "\x3c\57\x74\144\76\74\x74\x64\40\x6f\156\x64\x62\x6c\x63\x6c\151\x63\153\x3d\x22\x76\151\x65\x77\155\x6f\144\154\157\164\145\x28\x27" . $dtitfac->codigo . "\47\54\x27" . $a . "\x27\x2c\47" . $dtitfac->cantidad . "\x27\x29\x3b\42\76" . $dtitfac->lote . "\x3c\x2f\164\144\x3e\74\x74\x64\x20\143\x6c\x61\163\x73\75\x22" . $color . "\40\167\x33\x2d\x63\145\156\x74\x65\x72\x22\x3e" . $status . "\74\x2f\x74\144\x3e\x3c\x74\144\40\x63\x6c\x61\163\163\75\42\x77\63\55\x62\164\156\42\76" . $btnelim . "\74\57\164\144\76\xa\x20\x20\40\x20\x20\x20\x20\40\74\x2f\x74\x72\x3e"; } $html .= "\x3c\57\x74\x61\142\x6c\145\76"; return $html; } function regitemfac($doc, $cod, $cant) { $dtped = $this->db->query("\123\x45\x4c\x45\103\124\40\156\157\155\x62\162\x65\x2c\160\162\x65\143\151\157\x31\x20\x70\162\145\143\x69\157\54\160\162\145\143\151\x6f\146\151\156\61\x20\160\162\x65\143\x69\x6f\x66\x69\156\x2c\x63\157\x73\164\157\54\40\144\163\143\x74\157\x5f\155\145\x64\x69\143\141\155\145\156\164\157\163\x20\144\145\163\x63\x75\160\162\x6f\x64\54\x69\x6d\x70\165\x65\163\x74\157\x31\x20\x46\x52\117\x4d\40\x61\x72\x74\x69\143\x75\x6c\x6f\40\127\110\105\122\x65\40\143\x6f\x64\x69\147\157\75\47{$cod}\47")->row(); $fac = $this->db->query("\123\105\x4c\x45\103\x54\x20\x64\163\x63\x74\157\x65\156\x64\160\x2c\40\x76\145\156\x64\x65\144\157\x72\x2c\160\162\157\x76\x65\145\x64\x6f\x72\x2c\146\x65\x63\x68\x61\x64\x6f\x63\x2c\x66\145\x63\150\141\171\150\157\162\141\x20\x46\x52\x4f\x4d\40\157\x70\145\x72\155\x76\40\127\110\x45\x52\x65\40\x74\x69\x70\157\x64\x6f\x63\75\47\105\123\x50\x27\x20\46\46\x20\144\157\143\x75\x6d\145\156\164\157\x3d\x27{$doc}\x27\x20\114\111\x4d\x49\x54\x20\61")->row(); $blot = $this->db->query("\x53\105\x4c\x45\x43\x54\40\143\56\x61\x6c\155\141\x63\x65\x6e\54\143\56\154\x6f\164\145\54\x63\x2e\x63\141\x6e\164\151\144\x61\144\x2d\143\x2e\143\157\x6e\163\x75\155\151\144\x6f\40\x65\170\151\x73\164\40\x46\122\x4f\115\x20\141\x72\164\151\x6c\x6f\164\145\x73\40\101\x53\x20\x63\40\xa\40\x20\40\x20\x57\x48\x45\x52\105\40\x63\56\143\157\x64\x69\147\157\141\x72\x74\x3d\47{$cod}\x27\x20\46\x26\x20\x28\143\56\x63\x61\156\x74\151\144\x61\x64\x2d\x63\x2e\143\157\156\x73\165\x6d\x69\144\157\x29\x3e\60\x20\x26\x26\x20\143\56\x61\154\x6d\x61\143\145\x6e\40\116\x4f\124\40\111\116\x20\x28\x30\61\54\x30\65\54\60\x36\51\40\117\x52\104\105\122\x20\x42\x59\40\143\x2e\x76\145\156\143\145\40\101\123\103")->result(); $newcant = 0; $i = 0; foreach ($blot as $dlot) { if ($dlot->exist >= $cant) { $newcant = $cant; $datos = array("\151\x64\x5f\x65\155\160\x72\145\x73\141" => "\104\115\105\104\x49\106", "\x61\x67\145\x6e\x63\x69\x61" => "\x30\60\61", "\164\151\x70\x6f\x64\157\x63" => "\x45\x53\120", "\144\x6f\143\x75\155\145\156\x74\x6f" => $doc, "\x67\162\165\160\157" => '' . $dtped->grupo . '', "\157\x72\151\x67\145\x6e" => "\x31", "\143\157\144\x69\147\157" => $cod, "\x70\151\x64" => '', "\x6e\157\x6d\142\x72\x65" => '' . $dtped->nombre . '', "\143\x6f\x73\164\x6f\165\x6e\151\164" => '' . $dtped->costo . '', "\160\x72\145\143\x69\157\x75\x6e\x69\164" => $dtped->precio, "\144\163\143\x74\157\165\156\x69\164" => '' . $dtped->descuprod . '', "\144\163\x63\x74\x6f\x70\x72\143" => 0, "\x64\x73\143\164\x6f\145\156\144\x70" => $fac->dsctoendp, "\144\x73\143\x74\x6f\x65\156\x64\155" => 0, "\x70\162\x65\143\151\x6f\146\151\156" => $dtped->preciofin, "\x70\x72\145\143\x69\157\157\162\x69\147\151\156\x61\x6c" => '' . $dtped->precio . '', "\143\141\x6e\x74\151\144\x61\x64" => '' . $newcant . '', "\x6d\x6f\156\x74\x6f\x6e\x65\x74\157" => 0, "\x6d\157\x6e\x74\x6f\x74\x6f\164\x61\x6c" => 0, "\164\151\155\160\165\145\160\x72\143" => '' . $dtped->impuesto1 . '', "\x61\154\155\141\143\x65\156" => $dlot->almacen, "\x70\x72\157\166\x65\x65\144\x6f\x72" => $fac->proveedor, "\x66\145\143\x68\141\x64\157\143" => $fac->fechadoc, "\x69\155\160\165\145\x73\x74\157\x31" => "\x30", "\x69\155\160\x75\145\163\x74\x6f\x32" => "\x30", "\166\x65\x6e\x64\145\144\x6f\162" => $fac->vendedor, "\145\x6d\x69\x73\x6f\x72" => "\106\101\x43\124\x55\122\x41\x44", "\x75\x73\141\163\x65\x72\151\x61\154" => "\x32", "\164\x69\x70\157\x70\x72\145\x63\x69\157" => "\61", "\x75\156\151\144\141\144" => "\125\x4e\104", "\x61\x67\162\165\x70\141\144\x6f" => "\62", "\143\x6f\155\160\x75\145\163\x74\x6f" => "\62", "\x75\x73\x61\145\x78\151\x73\164" => "\x31", "\x61\165\x78\61" => $newcant, "\x65\x73\x74\141\143\151\x6f\x6e" => "\x30\x30\61", "\165\x64\151\x6e\x61\x6d\x69\143\x61" => "\61", "\x62\141\163\x65\151\155\x70\157\x31" => 0, "\142\141\163\x65\151\x6d\x70\x6f\x32" => "\60", "\x6c\x6f\x74\x65" => $dlot->lote, "\x69\x64\x76\x61\x6c\x69\144\141\143\151\157\x6e" => '', "\146\x65\143\150\141\x79\x68\x6f\x72\141" => $fac->fechayhora, "\x65\x6e\x76\151\141\144\x6f\x5f\x6b\155\x6f\156\151\x74\x6f\162" => "\60"); $this->db->insert("\x6f\x70\x65\x72\155\166", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("\x55\x50\x44\101\124\x45\x20\141\x72\164\151\143\x75\154\x6f\x20\163\145\x74\x20\x63\x6f\x6d\160\162\x6f\x6d\x65\164\151\144\x6f\75\x63\157\x6d\160\162\x6f\x6d\145\x74\151\x64\157\x2b{$newcant}\x20\127\110\x45\x52\x45\x20\x63\x6f\144\x69\x67\157\75\47{$cod}\x27"); $i++; } break; } elseif ($dlot->exist < $cant) { $cant = $cant - $dlot->exist; $newcant = $dlot->exist; $datos = array("\x69\144\137\x65\155\x70\x72\145\163\141" => "\104\x4d\105\x44\x49\106", "\141\147\145\156\x63\151\141" => "\60\60\x31", "\x74\x69\x70\x6f\x64\x6f\143" => "\105\x53\120", "\144\157\143\165\155\x65\x6e\164\157" => $doc, "\147\162\165\x70\x6f" => '' . $dtped->grupo . '', "\157\x72\x69\147\145\x6e" => "\61", "\143\157\144\x69\x67\157" => $cod, "\x70\x69\144" => '', "\x6e\157\155\142\162\145" => '' . $dtped->nombre . '', "\x63\157\163\164\x6f\165\x6e\x69\x74" => '' . $dtped->costo . '', "\x70\162\145\x63\x69\157\165\156\151\x74" => $dtped->precio, "\144\x73\143\164\x6f\165\x6e\151\164" => '' . $dtped->descuprod . '', "\144\x73\143\164\x6f\160\162\x63" => 0, "\x64\x73\143\164\157\x65\156\x64\160" => $fac->dsctoendp, "\144\163\143\164\157\145\156\144\x6d" => 0, "\x70\x72\x65\143\x69\157\x66\x69\156" => $dtped->preciofin, "\160\162\x65\143\x69\157\x6f\x72\x69\147\151\x6e\141\x6c" => '' . $dtped->precio . '', "\143\x61\x6e\164\151\x64\x61\x64" => '' . $newcant . '', "\155\x6f\156\x74\157\x6e\x65\x74\x6f" => 0, "\155\157\x6e\x74\157\x74\x6f\x74\x61\x6c" => 0, "\164\x69\x6d\x70\x75\x65\160\162\x63" => '' . $dtped->impuesto1 . '', "\x61\154\x6d\141\143\145\x6e" => $dlot->almacen, "\160\x72\x6f\x76\145\145\x64\x6f\162" => $fac->proveedor, "\146\x65\143\150\x61\144\x6f\x63" => $fac->fechadoc, "\151\155\x70\x75\x65\163\x74\x6f\61" => "\60", "\x69\155\160\x75\145\x73\x74\x6f\62" => "\x30", "\166\x65\156\x64\145\x64\157\162" => $fac->vendedor, "\145\x6d\x69\x73\157\162" => "\x46\x41\x43\124\x55\x52\x41\x44", "\x75\x73\x61\163\145\x72\151\141\x6c" => "\62", "\164\151\x70\x6f\160\x72\145\143\x69\x6f" => "\x31", "\x75\156\x69\144\141\x64" => "\x55\116\104", "\x61\x67\x72\165\160\x61\x64\157" => "\62", "\143\157\155\x70\165\x65\x73\x74\x6f" => "\x32", "\165\x73\141\145\170\x69\x73\164" => "\x31", "\141\x75\170\61" => $newcant, "\145\x73\x74\x61\143\151\157\156" => "\60\60\x31", "\165\x64\151\x6e\141\x6d\151\143\x61" => "\x31", "\142\141\163\145\151\155\x70\157\x31" => 0, "\142\x61\163\x65\x69\155\160\x6f\x32" => "\x30", "\x6c\157\x74\145" => $dlot->lote, "\x69\x64\x76\141\154\x69\x64\x61\143\151\157\x6e" => '', "\146\x65\x63\150\x61\x79\x68\157\162\141" => $fac->fechayhora, "\145\x6e\166\x69\x61\x64\157\137\x6b\x6d\x6f\x6e\151\x74\157\x72" => "\60"); $this->db->insert("\157\160\x65\162\x6d\166", $datos); if ($this->db->affected_rows() > 0) { $this->db->query("\x55\120\x44\x41\124\x45\40\141\162\x74\151\x63\165\154\157\x20\163\145\164\40\143\157\155\x70\162\157\155\x65\x74\151\144\157\x3d\x63\x6f\155\x70\x72\157\155\145\x74\x69\x64\x6f\x2b{$newcant}\x20\x57\110\105\122\105\40\143\157\144\x69\147\157\75\47{$cod}\x27"); $i++; } } } return $i; } function newprecio($doc) { $this->db->query("\125\x50\104\x41\124\105\x20\157\x70\145\x72\x6d\x76\40\141\x20\x4a\117\x49\116\40\x61\x72\x74\151\143\x75\x6c\x6f\40\x62\x20\117\x4e\x20\141\56\x63\x6f\x64\x69\147\157\75\x62\56\143\x6f\x64\x69\x67\157\x20\x53\105\124\40\141\56\160\162\x65\143\151\157\x6f\x72\x69\147\151\156\141\154\x3d\x62\56\x70\x72\x65\143\x69\157\61\40\x57\110\x45\x52\x45\40\164\x69\x70\157\144\x6f\143\75\47\x45\123\120\47\40\x26\x26\40\144\x6f\x63\x75\x6d\145\156\164\157\75\47{$doc}\47"); return $this->db->affected_rows(); } function reservaped($doc) { $status = $this->db->query("\x53\105\x4c\105\103\124\x20\163\164\141\164\165\163\x20\106\x52\x4f\x4d\x20\x63\157\x6e\164\x72\x6f\x6c\137\x6f\x70\145\x72\x74\151\x20\x57\110\x45\122\105\40\144\157\143\x3d\x27{$doc}\47")->row()->status; if ($status == "\x39\71") { $this->db->query("\125\x50\104\x41\x54\105\x20\143\x6f\x6e\x74\x72\157\154\x5f\157\x70\145\x72\x74\151\40\123\105\124\x20\x73\164\x61\x74\165\x73\75\x30\40\x57\x48\x45\122\x45\40\144\157\143\x3d\x27{$doc}\x27\x20\46\46\40\163\164\x61\x74\165\163\x3d\71\x39"); } else { $this->db->query("\x55\120\x44\x41\x54\105\x20\143\157\x6e\x74\x72\157\x6c\137\x6f\x70\145\162\x74\x69\40\x53\x45\x54\40\x73\x74\141\x74\165\163\75\71\x39\x20\x57\x48\x45\122\105\x20\144\157\143\75\47{$doc}\x27\40\x26\x26\x20\163\x74\x61\164\165\163\75\60"); } return $this->db->affected_rows(); } function viewbackorder($a) { $val = $this->db->query("\x53\105\114\105\x43\x54\40\52\40\x46\122\117\115\40\x62\141\143\153\x6f\x72\x64\145\x72\40\x57\x48\105\122\105\40\x64\x6f\143\75\47{$a}\47")->num_rows(); if ($val > 0) { $doc = $a; } else { $db = $this->db->query("\x53\x45\x4c\x45\103\x54\x20\141\x6e\x74\x64\x6f\x63\x20\x46\122\117\115\40\157\160\145\162\x74\151\40\127\x48\105\x52\145\x20\144\157\x63\165\x6d\x65\x6e\164\157\75\x27{$a}\47")->row(); $doc = $db->antdoc; } return $this->db->query("\x53\x45\114\105\x43\x54\x20\x64\x6f\x63\54\x63\154\151\145\x6e\164\x65\x2c\143\x6f\x64\151\x67\157\x2c\x28\123\x45\114\105\103\124\40\156\x6f\x6d\142\x72\145\x20\106\122\117\x4d\40\141\162\164\x69\x63\165\x6c\x6f\40\x57\x48\x45\122\105\x20\143\157\x64\151\147\x6f\75\x61\56\143\157\144\151\x67\x6f\51\x20\156\x6f\x6d\x62\162\145\54\x63\141\156\164\x6f\x72\x67\x20\x70\x65\144\x69\144\157\54\143\141\156\164\146\151\156\40\x63\x61\162\x67\141\x64\157\x2c\x66\145\x63\150\x61\x20\x46\122\x4f\x4d\x20\142\x61\x63\x6b\x6f\162\x64\145\x72\x20\x61\40\127\x48\x45\122\x45\40\x64\x6f\x63\x3d\47{$doc}\47"); } function viewpedtemp() { return $this->db->query("\123\x45\x4c\105\x43\124\x20\141\56\143\x6f\144\137\143\154\x69\x20\143\154\x69\145\x6e\x74\145\54\x20\x63\56\156\x6f\155\142\x72\x65\40\156\x6f\155\143\154\151\54\40\142\x2e\x63\157\x64\151\147\157\x2c\x62\56\156\157\x6d\142\x72\145\54\40\x61\56\143\x61\x6e\x74\40\x63\141\156\164\151\x64\141\144\x20\x46\x52\x4f\115\40\x74\x65\x6d\x5f\x70\145\144\151\144\x6f\x20\141\x20\x4a\117\x49\116\40\141\162\x74\151\x63\x75\154\x6f\40\x62\x20\117\116\x20\141\56\x63\x6f\x64\137\x6d\145\144\x3d\142\56\143\157\144\151\147\x6f\40\x4c\105\106\x54\x20\x4a\117\111\x4e\x20\x63\154\151\x65\x6d\x70\x72\145\x20\x63\40\x4f\x4e\x20\x63\56\x63\157\x64\x69\147\x6f\x3d\x61\x2e\x63\157\144\137\x63\154\151\x20\x47\x52\117\x55\120\40\x42\131\40\141\x2e\143\157\x64\x5f\143\154\151\54\40\141\x2e\143\157\144\x5f\x6d\x65\x64"); } function limpiarpedesp() { $this->db->query("\124\122\x55\x4e\x43\101\x54\x45\x20\x74\145\155\x5f\x70\x65\144\151\x64\x6f\73"); return 1; } public function autorizar($a, $status) { if ($status == 99) { $this->db->query("\125\x50\104\x41\124\x45\40\x6f\160\x65\162\x6d\x76\x20\141\x20\112\x4f\x49\116\x20\x61\162\164\151\x63\x75\154\x6f\40\142\40\x4f\116\x20\x61\x2e\x63\x6f\x64\151\147\x6f\75\142\x2e\x63\x6f\x64\151\x67\x6f\40\x53\105\124\40\141\x2e\160\x72\x65\x63\x69\157\x6f\162\151\147\x69\x6e\x61\x6c\75\x62\56\x70\x72\x65\x63\x69\157\61\x2c\40\141\x2e\x70\162\145\143\x69\157\x75\156\x69\164\75\x62\x2e\x70\162\145\143\151\x6f\x31\55\x28\x62\56\160\x72\x65\143\151\x6f\x31\x2a\x28\142\56\x64\x73\x63\x74\x6f\137\155\145\144\151\x63\x61\155\x65\156\164\x6f\163\57\x31\x30\60\51\x29\x2c\x20\xa\x20\40\x20\x20\x20\x20\x20\40\141\56\160\162\x65\143\x69\x6f\146\151\x6e\75\x28\142\x2e\x70\x72\145\x63\x69\157\x31\x2d\x28\x62\x2e\160\162\145\143\151\x6f\x31\x2a\50\142\56\x64\163\143\164\157\137\155\x65\144\x69\x63\x61\155\145\156\x74\x6f\x73\57\x31\x30\x30\x29\x29\51\x2a\x28\x31\x2b\x28\x62\56\x69\155\x70\x75\x65\163\164\157\x31\57\x31\60\60\x29\51\54\x61\x2e\144\x73\x63\x74\x6f\165\x6e\x69\x74\x3d\142\56\x64\x73\143\164\157\x5f\x6d\x65\144\151\143\141\155\145\156\x74\x6f\x73\54\12\x20\x20\x20\40\40\40\x20\x20\141\56\144\163\143\164\x6f\160\x72\x63\x3d\x62\x2e\x70\x72\x65\143\151\x6f\x31\x2a\50\x62\56\144\x73\143\164\157\137\155\x65\x64\151\x63\141\155\145\156\164\x6f\163\57\61\60\x30\x29\54\141\x2e\164\x69\x6d\160\165\x65\160\162\143\x3d\x62\56\x69\x6d\160\165\145\163\164\x6f\x31\x20\127\110\x45\122\105\x20\141\56\144\x6f\x63\x75\x6d\x65\156\x74\157\x3d\47{$a}\x27\73\xa\x20\x20\x20\40\40\x20\40\40"); } $this->db->query("\x55\120\104\x41\x54\105\40\x6f\x70\145\162\x74\151\x20\141\x20\x4a\117\111\x4e\x20\157\160\145\x72\x6d\x76\40\142\40\117\116\40\141\x2e\x64\x6f\143\165\155\x65\156\164\x6f\75\x62\x2e\x64\157\x63\165\x6d\x65\156\x74\157\40\123\x45\x54\40\x61\x2e\x66\x65\143\x68\x61\143\162\x65\141\x3d\x63\165\x72\x64\141\x74\145\x28\x29\54\x20\142\56\146\145\x63\150\141\144\157\143\75\143\165\x72\144\x61\x74\145\50\51\x20\127\x48\x45\x52\x45\40\x61\x2e\x64\x6f\143\165\x6d\x65\x6e\164\157\75\47{$a}\x27"); $datos = array("\163\x74\141\164\165\x73" => "\64", "\x74\151\x6d\145\x61\x75\164" => date("\131\55\x6d\x2d\144\x20\x48\72\151\72\163")); $this->db->where("\144\157\x63", $a)->UPDATE("\x63\x6f\156\164\x72\157\x6c\x5f\x6f\x70\x65\x72\x74\151", $datos); if ($this->db->affected_rows() > 0) { $this->loguser("\101\x75\164\157\162\x69\172\141\162", "\105\x6c\40\x75\x73\165\141\162\151\x6f\x20\150\x61\40\141\165\164\x6f\x72\151\x7a\141\x64\x6f\40\145\x6c\40\144\157\143\165\155\x65\x6e\x74\x6f\x20" . $a . ''); } return $this->db->affected_rows(); } function viewfac($a, $b) { if ($b == "\x45\x53\x50") { $this->ajustetotales($a, $b); } else { if ($b == "\116\x2f\x43") { $this->ajustetotalesnc($a, $b); } } $db = $this->db->query("\123\105\x4c\x45\x43\x54\x20\x52\x4f\125\116\104\50\141\56\164\x6f\164\x61\x6c\x64\54\62\51\40\164\x6f\x74\141\154\x64\54\x63\x2e\156\157\155\x62\162\145\40\166\x65\x6e\x64\145\x64\x6f\x72\54\x61\56\146\145\143\150\141\143\162\145\x61\x2c\141\56\x64\157\x63\x75\155\x65\156\x74\x6f\54\x61\x2e\164\151\x70\x6f\x64\157\143\x2c\x61\56\x6e\x6f\155\x62\x72\x65\x63\154\x69\54\x61\x2e\162\151\146\x2c\x62\x2e\143\x61\x6d\x70\157\x31\40\163\151\x63\x6d\x62\x2c\x62\56\x73\x75\143\x75\x72\163\x61\x6c\x2c\x61\56\144\151\162\x65\143\143\151\x6f\156\x20\144\151\162\x65\143\145\x6e\x76\x69\x6f\x2c\122\117\x55\116\x44\50\141\x2e\164\x6f\164\x6e\145\x74\157\54\x32\51\x74\157\x74\156\x65\164\157\54\x52\x4f\125\116\x44\x28\x61\x2e\164\157\x74\x69\155\160\165\145\163\x74\x2c\x32\51\164\x6f\164\x69\x6d\x70\x75\x65\163\x74\54\x61\56\163\x65\143\x74\x6f\x72\54\x61\x2e\163\165\142\143\157\x64\151\147\157\x2c\xa\40\x20\x20\x20\103\117\116\x43\101\x54\x28\x52\117\x55\116\x44\50\x61\56\x74\157\164\144\x65\163\143\x75\x65\156\x2c\62\x29\54\x27\40\47\x2c\x52\x4f\x55\x4e\x44\50\x61\56\164\x6f\164\144\145\x73\143\x75\x65\x6e\62\x2c\x32\51\51\40\x74\157\x74\144\145\163\x63\x75\145\x6e\x2c\x52\x4f\125\116\x44\x28\x61\56\x64\x73\143\x74\157\154\x69\x6e\x65\x61\54\62\x29\144\x73\143\164\x6f\x6c\x69\x6e\145\x61\x2c\122\x4f\125\116\x44\x28\141\x2e\x64\163\x63\x74\157\x6c\x69\x6e\145\141\x32\54\x32\51\x20\x64\x73\143\164\x6f\154\151\x6e\x65\141\x32\54\122\x4f\125\x4e\104\x28\141\x2e\144\x73\x63\164\157\x6c\151\156\x65\x61\63\54\62\51\40\x64\x73\x63\164\x6f\x6c\x69\x6e\145\x61\63\54\122\117\x55\x4e\x44\50\141\56\164\x6f\164\141\154\x66\151\x6e\141\154\x2c\62\x29\164\157\x74\x61\x6c\146\x69\x6e\x61\x6c\x2c\x52\117\x55\x4e\x44\50\141\56\142\141\163\145\151\155\160\157\61\x2c\62\51\142\141\x73\145\151\155\160\157\x31\54\122\x4f\x55\x4e\x44\x28\x61\x2e\163\x69\156\151\x6d\x70\x75\x65\x73\x74\54\62\x29\x73\151\156\x69\155\160\165\145\163\164\54\x61\56\x6e\x6f\x74\x61\163\x2c\141\56\x76\x65\x6e\143\145\x2c\141\x2e\x64\151\x61\163\x63\162\x65\144\x2c\141\x2e\x64\151\x61\163\x69\x6e\144\145\x78\54\x61\x2e\x72\x65\x66\x65\x72\145\156\143\151\141\x2c\x61\x2e\143\157\144\143\154\151\x65\x6e\x74\x65\x2c\141\x2e\144\x6f\143\165\x6d\145\x6e\x74\157\x66\151\163\x63\x61\154\12\x20\40\40\x20\x46\122\117\115\x20\157\160\145\x72\164\151\x20\x61\12\40\40\40\x20\114\x45\x46\124\40\x4a\117\111\x4e\x20\143\x6c\x69\x65\x6d\x70\162\145\40\142\x20\x4f\x4e\40\141\x2e\143\x6f\144\x63\154\x69\145\156\164\x65\75\x62\56\x63\x6f\x64\x69\147\157\xa\x20\x20\x20\40\114\x45\x46\x54\40\112\117\111\116\40\x6c\151\163\164\166\145\x6e\144\x20\x63\x20\117\116\40\x61\x2e\x76\x65\156\144\145\x64\x6f\162\x3d\143\56\x63\157\144\151\147\157\xa\x20\40\x20\40\127\110\105\x52\x45\40\x61\x2e\x64\157\143\165\x6d\x65\x6e\164\x6f\75\x27{$a}\x27\x20\46\46\40\x61\56\x74\x69\160\157\144\157\x63\75\x27{$b}\x27")->row(); $tsiva = 0; $tsimp = 0; $tdesc = 0; $timp = 0; $tot = 0; $baseimp = 0; $nota = ''; $tsimp = $db->sinimpuest; $tsiva = $db->totneto; $tdesc = $db->totdescuen; $tdescprm = $db->dsctolinea; $tdescprm2 = $db->dsctolinea2; $tdescprm3 = $db->dsctolinea3; $timp = $db->totimpuest; $tot = $db->totalfinal; $baseimp = $db->baseimpo1; $nota = $db->notas; $facafec = $this->db->query("\123\x45\114\x45\103\x54\x20\146\x65\x63\x68\x61\143\x72\x65\141\x2c\x64\157\143\x75\x6d\145\156\164\157\40\106\x52\x4f\x4d\x20\x6f\x70\145\x72\x74\x69\x20\x77\150\x65\x72\145\x20\143\157\156\x63\x61\164\50\164\151\160\157\144\157\x63\54\144\157\143\165\155\x65\156\164\157\x29\75\x27{$db->referencia}\47")->row(); $db2 = $this->db->query("\x53\105\114\x45\x43\x54\40\x52\117\x55\x4e\104\x28\x61\x2e\143\x61\156\x74\151\x64\141\x64\x29\x63\141\x6e\x74\x69\144\x61\144\x2c\x52\117\125\116\x44\x28\141\x2e\x63\156\164\x64\145\166\165\x65\x6c\x74\x29\x63\156\164\144\145\x76\x75\x65\x6c\x74\x2c\x61\56\154\157\164\145\x2c\141\56\156\157\155\x62\162\145\x2c\141\x2e\165\x6e\x69\144\x61\144\x2c\xa\x20\40\x20\x20\x28\123\105\x4c\105\103\x54\x20\166\x65\x6e\143\145\40\x66\162\157\x6d\x20\141\x72\x74\x69\x6c\157\164\x65\x73\x20\x57\110\x45\122\x45\40\143\157\144\151\x67\x6f\x61\x72\x74\75\x61\56\x63\157\144\x69\147\157\x20\46\46\40\154\157\x74\x65\75\141\56\x6c\157\164\145\40\x26\46\40\x61\154\155\141\143\145\x6e\x3d\141\56\141\x6c\x6d\x61\x63\145\x6e\x20\x6c\x69\x6d\151\x74\40\x31\51\x20\x76\145\156\x63\x65\x2c\x52\x4f\x55\116\104\x28\141\x2e\x70\x72\x65\143\151\x6f\157\162\151\147\151\156\141\x6c\x2c\62\51\x70\x72\145\x63\x69\x6f\157\x72\151\147\x69\156\141\154\x2c\x43\117\x4e\103\x41\x54\50\122\x4f\125\116\104\50\x61\56\x64\163\x63\164\157\165\156\151\x74\54\x30\x29\54\47\x25\x20\47\54\122\117\125\x4e\104\x28\x61\x2e\144\x73\143\164\157\x70\x72\143\54\x32\x29\x2c\x27\x2c\x20\x27\54\122\117\x55\116\x44\50\x61\x2e\144\163\143\164\x6f\x75\156\x69\x74\x32\54\x30\51\54\47\x25\40\x27\54\122\117\125\116\104\x28\141\56\x64\x73\x63\x74\x6f\160\x72\143\62\54\x32\x29\54\47\x2c\40\x27\54\122\x4f\125\116\104\x28\141\56\x64\x73\x63\164\x6f\x65\156\x64\160\62\54\x30\51\x2c\x27\x25\40\x27\x2c\122\x4f\x55\x4e\104\x28\141\56\x64\163\x63\x74\x6f\145\x6e\x64\155\62\54\x32\51\54\47\54\x20\x27\x2c\122\x4f\125\x4e\104\50\141\56\144\163\143\x74\x6f\145\156\144\x70\x33\x2c\x30\x29\54\47\45\40\47\54\122\x4f\x55\116\x44\x28\x61\56\x64\163\143\164\157\x65\156\x64\x6d\x33\x2c\62\x29\54\x27\54\x20\47\x2c\x52\x4f\125\x4e\104\x28\x61\56\x64\x73\143\164\157\145\x6e\144\160\x2c\x30\51\54\47\x25\x20\x27\54\x52\117\x55\116\x44\50\141\x2e\x64\x73\x63\x74\157\x65\x6e\x64\x6d\54\62\x29\51\x20\144\145\x73\143\x75\x2c\xa\x20\40\40\x20\122\117\x55\116\104\x28\141\x2e\x70\162\x65\x63\151\x6f\x66\x69\x6e\x2c\62\x29\160\162\x65\x63\151\157\x66\151\x6e\x2c\122\117\x55\x4e\104\50\x61\x2e\x6d\x6f\156\x74\x6f\x74\157\164\x61\154\54\x32\x29\x6d\x6f\x6e\x74\x6f\x74\157\x74\x61\154\54\x52\117\125\x4e\104\50\x61\x2e\x70\x72\x65\143\151\157\x75\156\151\x74\54\62\51\160\162\145\143\x69\157\x75\156\151\164\54\103\117\x4e\103\101\124\50\x52\x4f\125\x4e\104\x28\x61\x2e\164\151\x6d\x70\165\145\160\x72\143\54\x30\x29\54\47\x25\x20\47\54\x52\x4f\x55\116\104\x28\111\x46\x28\x61\56\164\151\155\x70\165\x65\x70\162\x63\x3e\x30\54\141\x2e\x70\x72\x65\143\x69\x6f\165\x6e\151\x74\52\x28\141\56\x74\151\x6d\x70\165\x65\160\162\x63\57\61\60\x30\51\54\x30\51\54\x32\51\51\x20\x74\x69\155\160\165\145\x70\162\x63\12\40\40\x20\x20\x46\122\x4f\115\x20\157\160\145\x72\x6d\x76\40\x61\12\x20\x20\x20\40\127\110\x45\122\105\40\141\x2e\144\x6f\x63\x75\x6d\x65\156\164\157\75\x27{$a}\47\40\46\x26\40\x61\56\164\151\x70\157\x64\157\x63\x3d\x27{$b}\47")->result(); $i = 0; $unid = 0; $db3 = $this->db->query("\123\105\x4c\105\x43\x54\x20\x6f\x66\151\x63\x69\x61\154\40\106\x52\x4f\115\x20\155\157\x6e\x65\143\x61\x6d\x20\x57\x48\105\x52\x45\x20\146\145\x63\x68\141\x3c\75\x28\x53\x45\x4c\x45\x43\124\40\x66\145\x63\x68\x61\x63\162\x65\141\40\x46\x52\x4f\115\40\157\160\x65\162\x74\151\40\127\110\x45\122\x45\x20\x64\x6f\143\165\155\145\156\164\157\x3d\x27{$a}\x27\x20\x26\46\40\x74\x69\160\157\x64\x6f\x63\75\47{$b}\x27\x20\114\111\x4d\111\x54\x20\61\x29\x20\x4f\x52\104\105\122\x20\x42\x59\x20\x66\145\x63\150\141\40\x44\x45\x53\x43\x20\114\x49\115\111\124\x20\x31")->row(); $tasa = $db3->oficial; $db4 = $this->db->query("\x53\105\x4c\105\103\124\x20\x6f\x66\x69\143\151\141\154\40\x46\122\x4f\115\40\x6d\x6f\156\145\x63\141\155\x20\127\110\105\x52\x45\x20\x66\145\x63\150\141\74\x3d\47{$facafec->fechacrea}\x27\40\x4f\122\104\x45\x52\x20\102\x59\x20\x66\145\x63\x68\141\40\104\105\x53\103\x20\114\111\115\111\x54\x20\61")->row(); $tasanc = $db4->oficial; $zona = $this->db->query("\123\x45\114\105\x43\x54\40\163\165\142\163\145\x63\x74\157\162\40\156\40\106\122\x4f\x4d\x20\x73\165\x62\163\145\x63\x74\x6f\162\x65\x73\x20\127\x48\x45\122\105\40\143\157\144\151\x67\x6f\x3d\x27{$db->sector}\x27\x20\46\46\x20\x73\x75\142\143\157\x64\x69\147\157\75\47{$db->subcodigo}\47")->row(); $segun = ''; if ($b == "\105\x53\120") { $totd = $tot / $tasa; $tipodoc = "\x50\x65\144\151\x64\157\72"; $tcant = "\x63\141\x6e\164\x69\144\141\x64"; $diascred = "\x3c\x74\144\x3e\74\x62\x3e\104\303\xad\141\163\x20\103\x72\303\xa9\x64\151\164\x6f\x3a\40\x3c\57\142\76" . $db->diascred . "\74\57\164\144\x3e\74\164\x64\76\74\x62\x3e\120\x72\157\155\157\x63\x69\303\263\x6e\40" . $db->diasindex . "\40\144\xc3\xad\141\x73\40\x73\151\x6e\40\x69\156\x64\x65\x78\141\162\56\x3c\57\142\x3e\x3c\x2f\x74\144\x3e"; } elseif ($b == "\x46\x41\x43") { $totd = $db->totald; $tipodoc = "\x46\141\143\x74\x75\162\141\72"; $tcant = "\x63\141\156\164\x69\x64\x61\x64"; $diascred = "\74\164\x64\x3e\x3c\142\x3e\x44\303\255\141\x73\40\103\162\xc3\xa9\144\x69\x74\157\72\40\x3c\x2f\142\76" . $db->diascred . "\x3c\57\164\x64\x3e\x3c\x74\144\76\74\x62\x3e\120\x72\157\x6d\x6f\x63\x69\303\xb3\x6e\x20" . $db->diasindex . "\x20\x64\xc3\xad\141\x73\40\x73\151\x6e\40\151\x6e\x64\145\170\141\162\x2e\x3c\57\142\76\74\57\164\144\76"; } elseif ($b == "\x4e\117\x54") { $totd = $db->totald; $tipodoc = "\x4e\x6f\164\141\x20\x64\x65\x20\145\156\164\162\145\147\x61\72"; $tcant = "\x63\x61\156\x74\x69\144\141\x64"; $diascred = "\74\164\144\76\74\x62\76\104\303\255\x61\x73\40\103\x72\303\xa9\144\151\x74\157\x3a\x20\x3c\57\142\76" . $db->diascred . "\74\57\x74\x64\x3e"; } elseif ($b == "\x4e\x2f\x43") { $totd = $db->totald; $segun = "\74\x74\x64\76\x3c\142\76\x53\x65\147\303\xba\x6e\40\106\141\x63\164\x75\162\141\x3a\x20\x3c\x2f\x62\76" . $facafec->documento . "\x3c\57\x74\x64\76\40\74\164\144\x3e\74\x62\76\x46\x65\143\150\x61\40\x45\155\151\x73\x69\xc3\xb3\x6e\40\106\x61\143\164\x75\162\141\72\40\x3c\x2f\142\x3e" . $facafec->fechacrea . "\74\57\x74\144\76"; $tipodoc = "\x4e\157\164\141\x20\144\x65\40\103\x72\303\251\144\151\164\157\72"; $tcant = "\x63\156\164\144\x65\x76\165\145\154\x74"; $diascred = ''; } elseif ($b == "\116\x2f\104") { $totd = $db->totald; $tipodoc = "\116\157\x74\x61\x20\x64\145\40\144\x65\x62\151\164\x6f\72"; $tcant = "\x63\141\156\164\x69\144\141\144"; $diascred = "\x3c\164\144\x3e\x3c\x62\76\x44\303\255\x61\163\x20\103\162\303\xa9\144\151\164\157\72\x20\x3c\x2f\x62\76" . $db->diascred . "\x3c\57\x74\x64\76"; } if ($db->sucursal == '' || $db->sucursal == null) { $sucursal = "\116\57\x41"; } else { $sucursal = $db->sucursal; } $html = "\x3c\x6c\x69\156\153\40\162\145\154\75\x22\x73\164\171\x6c\x65\163\150\x65\x65\x74\42\x20\150\162\145\146\75\x22\141\x73\163\145\x74\163\57\143\x73\163\57\167\63\56\143\163\x73\77\166\75\x34\x22\76\x3c\150\164\155\x6c\x3e\x3c\144\x69\x76\40\x63\x6c\141\x73\163\x3d\x22\x77\x33\55\x63\x65\156\164\145\x72\42\40\x73\x74\x79\x6c\x65\x3d\42\x6d\x61\x72\x67\151\156\x2d\x74\x6f\160\72\61\65\x25\73\x6d\x61\162\147\x69\x6e\55\154\x65\x66\x74\72\x32\56\x35\45\x22\x20\76"; $html .= "\x3c\x69\156\x70\x75\164\x20\164\x79\x70\145\x3d\42\150\151\x64\144\145\x6e\42\40\x76\x61\x6c\165\145\x3d\42" . $db->documento . "\x22\x20\151\x64\75\42\x6e\165\155\146\x61\143\x22\76\74\x69\156\160\165\x74\x20\164\171\160\x65\75\x22\150\151\144\144\145\156\42\40\166\x61\x6c\165\145\75\x22" . $db->tipodoc . "\42\40\151\144\75\42\164\151\160\x6f\144\157\143\42\76"; $html .= "\x3c\164\x61\x62\154\145\x20\x63\x6c\x61\x73\x73\x3d\42\x77\x33\55\164\141\142\154\145\40\167\x33\55\x6d\145\144\x69\165\x6d\42\x3e\x3c\x74\x72\76\74\164\x64\x3e\x3c\142\76" . $tipodoc . "\40\74\57\142\x3e" . $db->documento . "\x3c\x2f\164\144\76\74\x74\x64\76\x3c\x62\x3e\x46\x65\x63\x68\141\40\144\145\40\105\x6d\151\x73\x69\xc3\263\x6e\72\40\x3c\x2f\142\x3e" . DateTime::createFromFormat("\131\x2d\155\x2d\x64", $db->fechacrea)->format("\x64\57\x6d\x2f\131") . "\74\57\x74\x64\76" . $diascred . '' . $segun . "\x3c\57\x74\x72\x3e\74\57\x74\141\142\154\145\76"; $html .= "\x3c\164\x61\142\x6c\x65\x20\x63\x6c\x61\163\x73\x3d\42\x77\63\55\x74\141\x62\154\x65\x20\167\x33\55\x74\x69\x6e\171\42\x3e\x3c\164\x72\76\x3c\x74\144\x3e\74\x62\x3e\x43\157\144\x2e\40\x43\154\151\x65\x6e\x74\x65\x3a\x20\x3c\57\x62\x3e" . $db->codcliente . "\74\57\x74\144\x3e\74\164\x64\76\74\142\76\122\141\172\303\263\156\x20\123\157\143\x69\x61\154\72\x20\x3c\57\142\76" . $db->nombrecli . "\74\57\164\144\x3e\x3c\164\144\x3e\x3c\142\76\122\x2e\111\56\x46\x3a\40\74\x2f\142\76" . $db->rif . "\x3c\57\164\144\76\x3c\x74\x64\76\x3c\142\x3e\103\303\263\144\151\x67\x6f\40\x53\x49\x43\115\72\40\x3c\x2f\x62\x3e" . $db->sicmb . "\74\x2f\x74\x64\76\x3c\x74\144\76\74\142\76\x56\x65\156\x64\145\144\157\x72\72\x20\x3c\57\x62\x3e" . $db->vendedor . "\x3c\57\x74\144\76\74\x2f\164\162\76\74\57\164\141\x62\x6c\145\x3e"; $html .= "\x3c\164\141\142\x6c\145\40\x63\154\x61\163\x73\75\x22\167\x33\55\164\141\142\154\x65\40\167\x33\x2d\164\151\156\171\x22\x3e\74\x74\162\x3e\x3c\x74\144\x3e\x3c\x62\x3e\123\x75\143\165\x72\163\x61\x6c\72\40\x3c\x2f\142\76" . $sucursal . "\x3c\x2f\164\x64\x3e\74\164\144\x3e\74\142\x3e\132\x6f\156\141\x3a\x20\74\57\142\76" . $zona->n . "\74\57\x74\144\76\x3c\164\144\76\74\x62\x3e\104\x6f\x6d\x69\143\151\154\151\x6f\40\x46\151\x73\x63\141\154\72\40\x3c\x2f\x62\x3e" . $db->direcenvio . "\74\x2f\x74\x64\76\74\57\x74\162\x3e\x3c\57\164\x61\x62\x6c\145\76\x3c\x62\x72\76"; $html .= "\x3c\164\x61\x62\x6c\x65\40\143\154\x61\x73\163\75\x22\167\63\x2d\164\141\142\x6c\x65\55\141\154\x6c\x20\x77\63\x2d\150\x6f\166\145\162\x61\x62\x6c\145\40\167\63\x2d\164\x65\170\164\x70\144\146\42\40\x73\164\171\x6c\145\x3d\42\167\151\x64\164\x68\72\x31\60\60\x25\x22\x3e\x3c\x74\162\x3e\74\164\x68\76\x49\x74\x65\x6d\74\x2f\164\150\x3e\x3c\164\x68\x3e\x43\141\x6e\164\x3c\x2f\x74\150\76\74\x74\x68\x3e\x4c\x6f\x74\x65\x3c\57\x74\150\x3e\74\x74\x68\x3e\104\x65\163\x63\x72\151\160\x63\x69\xc3\xb3\x6e\40\x64\145\x6c\x20\x41\x72\x74\151\x63\x75\154\157\x3c\x2f\x74\150\76\74\164\x68\x3e\106\56\126\x2e\74\x2f\164\x68\x3e\x3c\164\150\76\120\x72\145\143\151\157\56\117\162\x67\74\57\164\x68\x3e\x3c\x74\x68\76\104\163\143\164\x6f\56\x50\162\157\144\x31\x2c\x50\x72\x6f\x64\62\x2c\x56\x6f\154\54\120\162\x6f\x76\x2c\126\x49\x50\x3c\x2f\164\x68\76\x3c\164\150\x3e\120\x72\x65\143\x69\157\x2e\x55\156\151\x74\x3c\57\164\x68\x3e\74\x74\150\76\x49\126\x41\74\57\x74\x68\x3e\74\x74\x68\x3e\124\x6f\164\141\154\x3c\x2f\164\x68\76\x3c\57\164\x72\76"; foreach ($db2 as $item) { $i++; $cant = $item->{$tcant}; $unid += ROUND($cant); $html .= "\x3c\164\x72\76\74\164\144\76" . $i . "\74\x2f\164\144\x3e\x3c\164\x64\x3e" . ROUND($cant) . "\x3c\x2f\164\144\x3e\x3c\164\144\76" . $item->lote . "\x3c\57\x74\x64\76\74\164\x64\76" . $item->nombre . "\74\57\164\144\x3e\x3c\x74\x64\x3e" . $item->vence . "\74\57\x74\144\76\74\164\144\x3e" . $item->preciooriginal . "\x3c\x2f\x74\144\x3e\x3c\164\144\x3e" . $item->descu . "\x3c\x2f\x74\144\x3e\74\164\144\76" . $item->preciounit . "\74\57\x74\144\76\x3c\x74\x64\76" . $item->timpueprc . "\x3c\57\164\144\x3e\74\x74\x64\x3e" . $item->montototal . "\74\x2f\164\144\x3e\x3c\x2f\x74\x72\x3e"; } if ($db->documentofiscal == "\x49\x47\124\106") { $baseigtf = $tot * 100 / 3; $baseimpIGTF = "\x3c\x74\x64\x20\x63\154\x61\163\x73\x3d\x22\167\63\55\x6c\x69\147\150\164\x2d\147\162\x65\x79\42\76\74\142\76\102\141\163\145\x20\111\x6d\160\x6f\156\x69\x62\x6c\145\40\111\107\x54\x46\x3c\x2f\142\x3e\x3c\x2f\164\x64\x3e\x3c\x74\x64\76" . $baseigtf . "\x3c\57\164\x64\76"; } else { $baseimpIGTF = ''; } $html .= "\74\x2f\164\x61\142\x6c\x65\x3e"; $html .= "\74\164\141\x62\154\x65\40\143\x6c\141\163\x73\75\x22\167\63\55\164\x61\x62\x6c\145\x2d\x61\154\x6c\40\x77\x33\55\x74\145\170\x74\x70\x64\146\x22\x20\x73\x74\x79\154\145\75\x22\x77\x69\144\164\x68\72\x31\x30\60\45\x22\x3e\xa\x20\40\40\40\40\40\40\40\x20\40\40\40\x3c\x74\x72\x3e\x3c\164\x64\x20\143\x6c\x61\x73\x73\x3d\x22\167\63\x2d\154\x69\147\150\164\55\x67\162\x65\x79\42\76\74\142\x3e\125\x6e\151\x64\141\144\x65\x73\72\74\x2f\142\76\x3c\x2f\x74\144\x3e\x3c\164\144\76" . $unid . "\x3c\x2f\x74\144\x3e\xa\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\74\x74\x64\x20\x63\x6c\141\163\x73\x3d\42\167\63\55\154\151\147\x68\164\x2d\147\x72\145\171\42\x3e\74\x62\x3e\x53\165\x62\x74\x6f\x74\x61\x6c\72\x3c\x2f\x62\x3e\x3c\57\164\x64\76\74\164\x64\x3e" . $tsiva . "\x3c\57\164\x64\76\12\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\40\74\x74\144\40\x63\x6c\141\x73\163\x3d\42\167\x33\55\154\x69\147\x68\164\55\x67\162\145\x79\42\76\74\142\x3e\115\157\156\164\157\x20\164\x6f\164\141\154\40\145\170\x65\156\x74\157\x3a\74\x2f\x62\76\74\x2f\164\x64\x3e\74\x74\x64\x3e" . $tsimp . "\x3c\57\164\144\x3e\12\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\74\x74\x64\x20\x63\154\x61\163\163\75\42\x77\63\x2d\154\151\147\x68\x74\55\147\162\145\x79\42\76\x3c\142\x3e\102\x61\x73\145\x20\x69\x6d\160\x6f\156\151\142\x6c\x65\40\163\145\147\xc3\272\156\x20\x61\154\303\255\143\x75\x6f\164\141\x3a\74\57\142\76\x3c\57\x74\144\x3e\x3c\164\144\x3e" . $baseimp . "\x3c\x2f\x74\144\x3e\xa\40\x20\40\x20\40\40\x20\40\40\40\40\x20\74\164\x64\x20\x63\x6c\141\163\x73\75\x22\x77\x33\55\154\151\x67\150\164\x2d\x67\162\x65\x79\42\x3e\74\142\x3e\x49\155\x70\x75\x65\x73\x74\x6f\x20\x73\x65\147\303\272\x6e\x20\x41\154\xc3\255\x63\165\x6f\x74\x61\x3c\x2f\x62\x3e\74\x2f\x74\x64\76\74\164\144\76" . $timp . "\74\x2f\x74\x64\76\12\40\40\x20\40\40\x20\x20\40\40\x20\x20\40" . $baseimpIGTF . "\12\40\40\40\x20\x20\40\x20\40\40\40\x20\40\x3c\164\144\x20\x63\x6c\x61\x73\x73\75\x22\167\x33\55\154\151\x67\x68\x74\x2d\147\x72\145\171\x22\76\x3c\142\76\x44\163\143\164\x6f\56\120\x52\117\x44\x31\40\x44\163\x63\164\157\x2e\120\x52\x4f\104\x32\x3c\x2f\x62\76\x3c\x2f\164\x64\x3e\74\164\144\76" . $tdesc . "\74\57\x74\x64\x3e\xa\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\74\164\144\x20\x63\x6c\x61\163\x73\75\x22\167\x33\55\x6c\x69\x67\150\x74\x2d\x67\162\145\171\x22\76\74\142\x3e\x44\x73\x63\164\x6f\56\126\x4f\x4c\74\57\142\76\x3c\57\x74\x64\76\74\164\x64\x3e" . $tdescprm2 . "\x3c\57\x74\x64\76\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\74\164\x64\x20\x63\x6c\x61\x73\163\x3d\x22\x77\63\55\x6c\151\x67\x68\x74\55\147\162\145\171\42\x3e\x3c\142\76\104\x73\x63\x74\157\x2e\x50\x52\x4f\x56\x3c\x2f\x62\76\x3c\x2f\x74\x64\76\74\164\144\76" . $tdescprm3 . "\x3c\x2f\x74\144\76\12\x20\x20\40\40\40\x20\x20\40\40\40\40\40\x3c\x74\x64\40\x63\154\141\163\163\x3d\42\x77\x33\55\x6c\x69\147\x68\164\55\x67\x72\x65\171\x22\76\74\142\x3e\x44\x73\143\164\x6f\56\x56\x49\x50\x3c\57\x62\x3e\74\x2f\164\144\76\x3c\x74\144\76" . $tdescprm . "\x3c\x2f\164\144\x3e\12\40\40\40\40\40\40\x20\x20\40\40\40\40\74\164\x64\40\x63\x6c\141\x73\x73\75\x22\167\x33\55\154\151\147\150\164\x2d\x67\x72\x65\171\42\x3e\74\x62\x3e\x54\157\x74\x61\154\x3a\x3c\x2f\x62\x3e\x3c\x2f\x74\144\76\x3c\x74\x64\x3e" . $tot . "\x3c\57\164\x64\x3e\74\57\164\162\x3e\12\x20\40\40\40\40\40\40\x20\x20\40\40\x20\74\x2f\x74\141\142\x6c\x65\x3e\x3c\x62\162\x3e"; if ($b == "\105\x53\x50" || $b == "\106\x41\x43" || $b == "\x4e\x2f\104") { $html .= "\74\x74\x61\142\154\145\x20\143\x6c\141\x73\x73\x3d\x22\167\63\55\164\x61\x62\x6c\145\40\167\x33\55\164\145\x78\x74\x70\x64\x66\42\x20\x73\164\x79\154\x65\75\x22\x77\x69\144\164\x68\x3a\61\60\x30\x25\x22\x3e\12\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x20\40\x20\x3c\164\x72\x3e\74\x74\144\40\143\x6c\x61\x73\163\75\x22\x77\63\x2d\154\x69\x67\x68\164\x2d\x67\x72\x65\171\x22\76\74\142\x3e\x52\x45\x46\x3a\74\x2f\x62\76\x3c\57\164\144\76\x3c\164\x64\40\143\x6c\141\x73\x73\75\x22\167\63\55\154\x65\146\164\x22\76" . round($totd, 2) . "\44\40\145\x71\165\151\166\141\154\145\156\x74\145\x73\40\141\40\x6c\x61\40\164\141\163\x61\40\x64\145\x20\x63\x61\155\x62\151\157\x20\x64\x65\40\x42\103\x56\40\x64\x65\x20\61\x20\125\123\104\x20\x70\157\x72\40" . round($tasa, 4) . "\40\x42\163\x2e\x3c\57\x74\144\x3e\x3c\164\144\40\x63\154\x61\163\163\75\x22\167\63\x2d\x6c\151\147\150\164\55\147\x72\x65\171\x22\x3e\74\142\76\x4e\x6f\x74\141\72\x3c\57\142\76\x3c\x2f\x74\x64\x3e\x3c\164\144\40\143\x6c\141\163\163\x3d\x22\167\63\x2d\x6c\145\x66\164\42\76" . $nota . "\x3c\57\164\144\76\x3c\57\164\x72\x3e\12\x20\40\40\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\74\57\164\141\142\154\x65\76\12\40\40\40\40\x20\40\40\x20\40\x20\40\40\40\40\x20\x20\74\164\141\142\x6c\x65\x20\143\154\x61\163\163\75\42\x77\x33\x2d\x74\x61\142\x6c\x65\x20\167\x33\x2d\164\x65\x78\x74\160\144\146\x22\x20\163\x74\x79\x6c\x65\75\x22\167\151\x64\164\x68\x3a\x31\60\60\x25\42\x3e\xa\x20\40\40\40\40\40\40\40\x20\x20\40\40\40\40\40\40\x3c\164\162\x3e\74\x74\x64\x3e\52\x44\145\x20\141\x63\165\145\x72\x64\x6f\40\141\x20\x6c\157\40\x70\x72\x65\x76\x69\x73\164\157\40\x65\156\40\145\154\x20\x41\x72\164\x2e\40\x32\65\40\x4c\x65\171\40\144\x65\40\x49\x56\x41\x2c\40\163\145\40\145\x78\x70\x72\145\x73\141\x6e\x20\154\157\163\x20\x6d\157\156\x74\157\163\40\144\145\x20\154\x61\40\146\x61\143\164\165\x72\x61\x63\x69\303\263\x6e\x20\145\x6e\40\x64\xc3\263\x6c\141\x72\x65\x73\56\40\x53\151\40\x65\x6c\40\x70\x61\x67\157\40\163\145\x20\162\x65\141\154\x69\172\141\40\160\157\163\164\x65\162\x69\x6f\162\x20\141\x20\163\x75\40\166\145\x6e\143\151\x6d\x69\145\x6e\x74\x6f\54\x20\x73\x65\40\x67\x65\x6e\x65\162\141\x20\x75\x6e\40\141\x6a\165\x73\x74\x65\40\x70\x6f\162\40\x64\x69\146\x65\162\x65\156\x63\151\141\x20\x65\156\40\143\141\x6d\142\x69\x6f\54\x20\xa\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\40\40\x63\141\154\x63\x75\154\x61\x64\157\x20\141\x20\x6c\x61\x20\164\141\x73\x61\x20\x64\x65\154\x20\102\x43\x56\56\x3c\x2f\x74\144\76\12\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x3c\164\144\x3e\x2a\104\145\x20\x63\x6f\156\146\x6f\162\155\151\144\x61\x64\40\141\40\x6c\x6f\x20\145\x73\164\x61\x62\154\145\x63\x69\x64\157\x20\145\x6e\x20\154\141\40\160\x72\x6f\166\151\x64\x65\156\143\x69\141\40\141\x64\155\x69\x6e\x69\163\164\x72\x61\164\x69\x76\x61\40\116\162\157\40\x53\116\x41\x54\x2f\62\60\x32\x32\x2f\60\60\60\x30\x31\x33\54\40\x47\56\x30\40\116\162\157\x20\x34\x32\56\x33\x33\71\x20\144\145\x20\146\145\143\150\x61\40\x31\67\x2f\x30\x33\57\62\x30\62\62\54\40\x74\157\x64\157\x20\x70\x61\x67\157\40\x72\x65\141\x6c\151\172\x61\x64\157\x20\145\156\40\x6d\157\x6e\x65\x64\x61\x20\144\151\x73\164\x69\156\164\x61\x20\141\x20\x6c\x61\x20\144\145\40\x63\x75\x72\163\157\40\154\145\x67\141\x6c\x20\145\156\x20\145\x6c\40\160\141\xc3\xad\163\x20\x64\145\x62\x65\40\145\x6e\x74\145\162\141\x72\x20\xa\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\145\154\x20\x65\161\165\151\x76\141\154\x65\x6e\164\145\x20\x61\154\40\63\45\x20\x70\x6f\x72\x20\143\157\x6e\143\x65\160\x74\157\x20\144\x65\40\111\x47\124\x46\x2c\x20\157\40\163\165\40\x65\161\x75\151\x76\x61\x6c\x65\156\164\x65\x20\145\x6e\40\102\163\x2e\x20\141\x20\154\x61\40\x74\x61\x73\x61\x20\x64\145\40\x42\x43\126\40\144\x65\154\40\144\xc3\xad\141\40\144\145\40\x70\141\x67\157\x2c\x20\145\x6c\x20\143\x75\x61\x6c\x20\x73\145\x72\xc3\241\40\x72\x65\146\x6c\145\152\141\x64\x6f\x20\x65\x6e\x20\143\x6f\x6d\x70\x72\x6f\x62\x61\156\164\x65\40\x64\x65\x20\x70\145\162\143\145\x70\143\x69\xc3\xb3\x6e\x2e\x3c\57\x74\x64\76\x3c\57\164\162\76\x3c\x2f\x74\x61\142\154\x65\76\12\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x3c\57\144\x69\x76\x3e\x3c\x2f\150\x74\x6d\154\76"; } else { if ($b == "\116\117\124") { $html .= "\x3c\x74\141\142\154\x65\x20\x63\154\x61\163\163\x3d\42\167\63\55\x74\141\142\x6c\x65\40\167\x33\x2d\x74\x65\170\164\160\144\146\42\x20\163\x74\171\154\x65\x3d\42\167\151\x64\x74\x68\72\x31\x30\60\x25\x22\76\xa\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x3c\164\162\76\74\164\x64\x20\143\154\x61\163\x73\x3d\x22\167\x33\55\x6c\x69\x67\150\164\55\147\x72\x65\171\x22\x3e\x3c\x62\x3e\x52\x45\x46\72\74\57\142\x3e\x3c\x2f\x74\x64\76\x3c\x74\144\76" . round($totd, 2) . "\44\x20\x65\x71\165\151\166\x61\154\145\156\164\x65\x73\40\x61\40\154\x61\x20\164\141\163\x61\x20\x64\145\40\143\141\x6d\142\x69\x6f\40\x64\x65\x20\102\x43\126\x20\144\x65\40\x31\x20\x55\123\104\x20\160\157\162\40" . round($tasa, 2) . "\x20\102\163\56\x3c\57\x74\144\x3e\x3c\x74\144\x20\x63\x6c\x61\x73\163\75\x22\167\x33\55\154\151\147\150\x74\x2d\x67\x72\145\171\42\x3e\74\142\76\116\157\x74\141\72\x3c\x2f\142\x3e\74\x2f\164\x64\76\x3c\x74\x64\x20\143\154\x61\x73\x73\75\42\x77\63\55\154\x65\x66\164\42\76" . $nota . "\74\57\x74\144\76\x3c\x2f\164\x72\x3e\xa\40\x20\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\40\40\74\x2f\x74\141\142\x6c\x65\76\12\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x74\x61\142\x6c\x65\40\x63\x6c\x61\163\163\x3d\42\x77\x33\x2d\x74\x61\x62\x6c\145\40\167\63\55\164\145\170\164\x70\144\x66\x22\x20\x73\164\x79\154\x65\x3d\42\x77\151\144\164\150\72\x31\x30\x30\45\42\x3e\xa\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x3c\x74\162\76\74\x74\x64\x3e\52\x44\145\40\141\143\165\x65\x72\x64\157\40\141\40\x6c\157\x20\x70\x72\x65\x76\x69\x73\164\x6f\40\145\156\40\145\x6c\40\101\162\x74\x2e\40\x32\x35\x20\114\145\171\40\144\145\40\111\126\x41\54\x20\x73\145\40\145\x78\160\x72\145\163\141\156\x20\x6c\157\163\40\x6d\157\156\164\x6f\x73\40\x64\x65\40\x6c\x61\40\x66\x61\143\164\165\162\x61\x63\x69\xc3\xb3\x6e\40\145\x6e\40\x64\303\263\154\141\x72\x65\x73\x2e\40\123\x69\x20\145\154\40\160\141\147\157\40\163\x65\x20\162\x65\x61\x6c\x69\172\x61\40\x70\157\x73\164\145\162\x69\x6f\x72\x20\x61\x20\163\165\40\166\x65\156\143\151\155\151\145\156\164\157\x2c\x20\163\145\40\147\x65\156\145\x72\141\40\165\156\40\x61\x6a\165\163\164\145\x20\x70\x6f\162\x20\144\x69\146\145\162\x65\x6e\143\x69\141\40\145\156\x20\143\x61\x6d\x62\151\x6f\x2c\40\xa\40\x20\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\40\143\141\154\143\165\x6c\141\x64\157\x20\141\x20\x6c\x61\40\164\141\163\141\x20\x64\145\x6c\x20\102\x43\126\x2e\74\x2f\164\144\76\12\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\74\x74\x64\x3e\52\104\145\40\143\x6f\156\x66\157\x72\x6d\x69\x64\141\144\x20\141\x20\154\x6f\x20\145\163\x74\x61\x62\x6c\145\143\x69\144\157\40\145\156\40\x6c\141\x20\160\162\157\x76\151\x64\145\156\143\151\x61\x20\x61\144\x6d\151\156\151\x73\x74\162\x61\x74\x69\x76\141\40\116\162\x6f\x20\123\x4e\x41\x54\x2f\62\60\x32\x32\57\x30\60\x30\60\61\63\x2c\x20\x47\56\60\x20\x4e\x72\x6f\40\x34\x32\56\63\x33\71\x20\x64\145\40\x66\x65\x63\150\141\x20\61\x37\x2f\60\x33\57\62\x30\62\x32\54\x20\x74\x6f\144\157\40\x70\x61\147\157\x20\162\145\141\x6c\x69\x7a\x61\144\157\x20\x65\156\x20\155\x6f\156\145\x64\x61\x20\x64\151\163\164\151\156\164\x61\x20\141\40\154\x61\x20\x64\145\x20\x63\x75\162\x73\157\x20\x6c\x65\x67\x61\154\40\x65\x6e\x20\x65\x6c\40\x70\x61\303\xad\x73\40\x64\145\x62\x65\40\x65\x6e\164\x65\x72\x61\162\40\xa\40\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x65\154\40\145\x71\165\151\x76\x61\154\x65\x6e\x74\145\40\141\154\x20\x33\45\x20\x70\x6f\162\x20\x63\157\x6e\143\x65\160\x74\157\40\x64\145\x20\x49\107\124\x46\x2c\x20\x6f\40\163\x75\x20\145\x71\165\151\166\141\x6c\x65\156\164\145\40\x65\156\40\x42\163\x2e\40\141\40\154\x61\40\x74\141\163\x61\x20\x64\145\x20\x42\103\126\40\x64\145\154\x20\144\xc3\255\141\40\x64\x65\40\x70\141\x67\x6f\54\x20\145\x6c\x20\x63\x75\141\x6c\40\163\x65\162\303\xa1\40\162\145\x66\x6c\145\x6a\141\x64\x6f\x20\145\x6e\40\x63\157\x6d\160\x72\157\x62\141\156\164\x65\40\x64\145\x20\160\x65\x72\143\x65\x70\143\x69\xc3\xb3\156\x2e\x3c\57\164\144\x3e\x3c\57\164\162\76\74\x2f\x74\x61\142\x6c\145\x3e\12\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\x20\40\40\74\x2f\144\x69\166\x3e\74\x2f\150\x74\x6d\154\x3e"; } else { $html .= "\x3c\164\141\x62\x6c\x65\x20\x63\x6c\141\163\x73\75\x22\167\63\x2d\164\x61\142\154\145\x20\x77\x33\x2d\x74\x65\x78\x74\x70\144\146\42\40\x73\164\171\154\x65\75\x22\167\151\144\x74\150\72\61\x30\60\45\42\x3e\12\x20\40\x20\40\x20\40\x20\40\x20\40\40\40\40\40\40\40\x3c\164\162\x3e\x3c\x74\x64\40\143\154\x61\x73\x73\75\x22\x77\x33\55\154\151\147\x68\164\55\147\x72\145\x79\42\x3e\74\x62\76\122\105\106\x3a\74\57\142\76\74\x2f\x74\144\76\x3c\x74\144\x3e" . round($totd, 2) . "\x24\x20\x65\x71\x75\x69\x76\141\154\x65\156\164\145\163\x20\141\40\x6c\x61\40\164\141\x73\x61\40\x64\x65\x20\143\x61\155\142\x69\x6f\40\x64\145\40\x42\x43\x56\x20\x64\x65\40\x31\40\125\x53\x44\40\160\x6f\x72\x20" . round($tasa, 2) . "\x20\102\x73\x2e\x3c\57\x74\x64\76\74\x74\144\x20\x63\x6c\x61\163\x73\75\x22\x77\63\55\x6c\x69\x67\x68\x74\55\x67\162\x65\171\42\x3e\x3c\142\x3e\116\x6f\x74\x61\72\74\57\142\x3e\x3c\57\x74\144\76\x3c\164\x64\76\x55\x6e\x69\144\x61\144\145\163\40\144\x65\x76\165\145\x6c\x74\x61\x73\x2e\x3c\57\x74\144\76\74\57\164\x72\76\xa\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\x3c\57\164\x61\142\x6c\145\x3e\xa\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\40\74\57\144\151\x76\x3e\74\x2f\x68\164\x6d\x6c\76"; } } return $html; } public function promos($a, $b) { $this->load->library("\x74\141\x62\x6c\x65"); if ($b != '') { $filter = "\127\110\x45\x52\105\x20\156\x6f\x6d\x20\x6c\151\x6b\145\40\47\45{$b}\x25\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\x45\x4c\x45\103\x54\40\52\40\106\x52\x4f\115\x20\160\162\157\155\x6f\163\40" . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\114\x45\103\x54\40\x61\56\151\x64\x2c\103\117\x4e\103\x41\x54\x28\x62\x2e\x63\x6f\144\x69\x67\x6f\54\x27\x20\x27\x2c\x62\x2e\x6e\157\155\142\162\x65\51\x20\x6e\x6f\x6d\x62\162\145\x2c\141\x2e\x66\144\145\x73\x64\145\x2c\x20\141\56\146\150\x61\x73\164\x61\x2c\40\x61\56\144\145\x73\x63\x75\x20\106\122\117\x4d\x20\x70\x72\x6f\x6d\x6f\163\40\x61\40\112\x4f\x49\116\40\143\x6c\151\x65\x6d\x70\x72\x65\40\x62\x20\117\116\x20\141\x2e\143\x6c\x69\75\142\56\x63\157\x64\x69\147\x6f\x20" . $filter . "\x20\114\111\115\111\124\40" . ($a - 1) * $mostrar . "\40\54\40" . $mostrar . "\73")->result(); $html = "\12\40\x20\x20\x20\74\x74\141\142\x6c\145\40\143\x6c\x61\x73\163\75\x22\x77\x33\x2d\164\141\142\154\145\x2d\x61\154\154\40\x77\x33\55\150\x6f\166\x65\162\141\142\x6c\x65\40\x77\63\x2d\x6c\145\x66\164\x2d\141\x6c\x69\x67\156\42\76\xa\40\x20\x20\x20\74\x74\162\76\x3c\x74\x64\40\x63\154\141\x73\163\x3d\x22\167\63\x2d\x66\x6f\x6e\144\157\x64\x72\x6f\151\x64\42\76\102\165\163\x63\141\x72\40\x3c\x69\155\147\x20\163\162\143\75\x22" . base_url() . "\151\155\x61\x67\145\x73\x2f\x62\165\x73\143\x61\162\x2e\x70\x6e\x67\x22\x20\x61\x6c\x74\x3d\x22\x42\x75\x73\143\141\x72\x22\40\164\151\x74\154\x65\75\42\x42\165\x73\143\141\x72\x22\x20\x73\x74\171\154\145\x3d\42\x77\151\x64\164\150\72\61\x38\160\x78\x3b\x62\157\x72\x64\x65\x72\72\x30\x3b\x22\x3e\74\x2f\164\144\x3e\xa\40\x20\40\x20\74\164\x64\x3e\x3c\151\x6e\x70\165\164\x20\164\x79\x70\145\x3d\42\164\x65\170\164\42\40\x63\154\141\x73\163\x3d\x22\x77\x33\55\151\156\x70\x75\164\x22\40\160\x6c\141\143\145\150\157\154\144\x65\x72\x3d\42\111\x6e\147\x72\x65\163\145\x20\x73\165\x20\x62\x75\163\161\x75\x65\x64\141\x22\x20\x6f\156\143\x68\x61\x6e\147\145\75\42\x70\x72\x6f\155\x6f\163\x28\x29\x22\40\151\x64\75\42\154\151\x6b\145\x22\x3e\74\x2f\164\x64\76\xa\40\40\x20\40\x3c\x74\x64\40\143\x6c\141\163\x73\x3d\x22\x77\63\x2d\143\x65\156\x74\x65\162\x20\x77\63\55\x62\x74\x6e\x22\76\x3c\x61\40\157\156\x63\x6c\x69\143\153\75\42\162\145\x67\x70\x72\157\155\157\163\50\51\73\42\x3e\x3c\x69\x6d\147\x20\163\x72\143\x3d\x22" . base_url() . "\x69\x6d\141\x67\145\163\x2f\x72\x65\x67\x69\x73\164\x72\x61\162\56\160\x6e\147\42\x20\141\x6c\x74\x3d\42\x52\145\147\151\x73\x74\162\x61\x72\40\x50\x72\157\155\x6f\163\x22\x20\164\x69\164\x6c\145\75\x22\x52\145\x67\x69\x73\164\162\141\x72\40\x50\162\x6f\155\157\x73\42\x20\163\164\x79\154\145\x3d\x22\x77\151\144\x74\150\x3a\62\60\x70\170\73\x68\x65\151\147\x68\x74\x3a\62\x30\x70\170\73\x62\x6f\x72\144\145\x72\x3a\60\73\42\76\x3c\x2f\x61\76\74\57\x74\144\76\12\x20\x20\x20\40\x3c\164\x64\40\143\154\141\x73\x73\75\x22\167\x33\x2d\143\145\x6e\x74\145\x72\40\167\x33\x2d\142\x74\156\42\76\x3c\x61\40\x6f\156\x63\154\151\x63\153\75\x22\x65\144\151\x74\160\x72\x6f\155\157\163\x28\x29\73\42\x3e\x3c\151\x6d\147\40\x73\x72\143\75\x22" . base_url() . "\x69\x6d\x61\147\x65\163\x2f\x65\x64\x69\x74\x61\x72\x2e\x70\156\x67\x22\x20\141\x6c\164\x3d\x22\105\144\151\164\141\x72\x20\120\x72\157\155\x6f\x73\x22\x20\164\151\164\154\145\75\x22\x45\x64\151\164\x61\x72\40\120\162\157\x6d\157\x73\42\40\x73\164\171\154\145\x3d\x22\167\151\144\164\150\72\x32\60\x70\x78\x3b\x68\145\x69\x67\x68\x74\72\62\60\160\170\x3b\x62\x6f\162\144\x65\x72\x3a\60\73\42\76\x3c\x2f\x61\x3e\74\x2f\164\x64\76\xa\40\x20\40\40\x3c\x74\x64\x20\143\154\x61\163\x73\x3d\x22\167\x33\55\x63\x65\156\164\145\162\40\167\63\x2d\x62\164\156\42\x3e\74\x61\x20\157\x6e\x63\154\x69\x63\x6b\75\x22\160\162\157\x6d\x6f\x73\x28\x29\73\42\x3e\74\x69\x6d\x67\40\x73\162\x63\75\x22" . base_url() . "\x69\155\x61\x67\x65\163\x2f\162\x65\154\157\x61\144\56\160\156\147\42\x20\x61\x6c\x74\x3d\x22\x52\x65\x63\141\162\147\x61\x72\42\x20\x74\151\x74\154\145\x3d\42\x52\145\x63\x61\x72\147\141\x72\42\x20\163\x74\x79\x6c\145\x3d\x22\x77\151\x64\x74\150\x3a\x32\60\160\x78\x3b\x68\x65\x69\147\150\x74\72\62\x30\x70\170\x3b\142\157\x72\144\x65\x72\x3a\60\x3b\x22\76\74\x2f\141\76\x3c\57\164\144\76\xa\x20\40\x20\40\74\x2f\164\x72\76\x3c\x2f\x74\x61\142\154\x65\x3e\74\142\162\76\12\40\40\x20\40\74\164\141\142\x6c\x65\x20\151\144\x3d\42\151\x64\x30\x31\x22\x20\143\154\141\x73\x73\75\x22\167\x33\x2d\x74\141\x62\154\x65\55\141\x6c\x6c\40\x77\63\x2d\150\157\166\145\x72\141\142\x6c\x65\40\167\x33\55\154\x65\x66\164\55\x61\154\151\147\156\40\x77\x33\55\x74\151\x6e\171\42\x3e\74\x74\162\x20\143\154\x61\x73\x73\75\42\x77\x33\x2d\146\157\x6e\x64\x6f\x64\x72\x6f\x69\x64\x22\x3e\x3c\x74\150\76\x49\104\x3c\x2f\164\150\x3e\74\164\150\x3e\116\157\155\142\162\145\x3c\57\x74\x68\x3e\74\x74\150\76\x44\x65\x73\144\145\74\x2f\164\150\76\x3c\164\150\x3e\110\x61\163\164\x61\x3c\x2f\164\150\x3e\x3c\164\150\76\104\145\163\143\165\x3c\57\164\150\x3e\x3c\164\150\76\105\163\164\141\164\x75\x73\74\57\164\x68\76\74\x2f\x74\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->fdesde <= date("\x59\x2d\x6d\55\144\40\x48\72\x69\72\163") && date("\131\x2d\x6d\x2d\144\x20\x48\x3a\151\72\163") <= $dtfac->fhasta) { $status = "\x41\143\x74\x69\x76\157"; $color = "\143\154\x61\163\x73\x3d\x22\167\x33\55\x67\x72\x65\145\x6e\42"; } else { $status = "\x49\156\x61\143\x74\151\166\157"; $color = "\143\x6c\x61\163\163\x3d\42\x77\x33\55\162\145\144\x22"; } $html .= "\74\164\x72\40\x69\x64\75\42\163\154\x65\x63\164" . $i . "\x22\x3e\74\x69\x6e\160\165\164\40\164\171\x70\145\x3d\x22\x68\x69\x64\144\x65\156\42\40\156\141\155\x65\75\42\144\157\x63\42\40\166\141\154\x75\x65\x3d\42" . $dtfac->id . "\x22\x3e\x3c\151\156\x70\165\x74\40\x74\x79\x70\x65\x3d\x22\x68\151\x64\x64\x65\156\x22\40\x6e\x61\155\145\x3d\42\141\156\x74\144\145\x73\x63\165\42\40\x76\x61\154\x75\x65\75\x22" . $dtfac->descu . "\x22\76\xa\x20\x20\x20\40\x20\x20\40\x20\x3c\x74\x64\76\x3c\x69\156\x70\165\x74\40\x74\x79\x70\x65\75\x22\143\x68\x65\143\153\x62\x6f\x78\x22\40\157\156\143\154\151\x63\x6b\x3d\x22\x77\63\56\164\x6f\147\147\x6c\145\x43\154\x61\x73\x73\x28\47\x23\163\x6c\x65\x63\164" . $i . "\47\x2c\x27\167\x33\x2d\x79\145\154\154\157\x77\x27\x29\x3b\42\x20\x63\154\141\x73\163\x3d\x22\167\x33\x2d\x63\150\x65\x63\x6b\x22\40\x6e\x61\x6d\x65\75\42\x63\x68\145\x63\x6b\x22\76" . $dtfac->id . "\74\57\164\144\76\x3c\x74\x64\76" . $dtfac->nombre . "\74\57\x74\x64\x3e\x3c\x74\144\x3e" . $dtfac->fdesde . "\x3c\x2f\x74\144\x3e\x3c\164\144\x3e" . $dtfac->fhasta . "\x3c\57\x74\x64\76\xa\40\x20\40\40\x20\x20\40\40\74\164\x64\x3e" . $dtfac->descu . "\x3c\57\164\144\76\x3c\x74\144\40" . $color . "\76" . $status . "\x3c\x2f\164\144\76\xa\40\40\40\40\40\x20\40\40\74\x2f\164\162\x3e"; } $html .= "\74\x74\162\76\x3c\x74\x64\x20\143\154\x61\163\x73\75\42\167\x33\x2d\143\145\x6e\x74\x65\162\40\x77\63\x2d\146\x6f\156\144\157\144\162\x6f\151\144\x22\40\143\x6f\x6c\163\x70\x61\x6e\x3d\x22\66\x22\76\74\x6c\x61\x62\145\154\x20\143\154\141\x73\x73\75\x22\167\63\x2d\154\x61\x72\147\x65\x22\76\74\142\x3e\x54\157\164\141\154\x20\x50\x72\157\x6d\157\x73\72\x20" . $TotalRegistro . "\74\x2f\x62\76\74\x2f\154\141\x62\145\154\76\x3c\x2f\164\144\x3e\74\57\164\x72\76\74\57\164\x61\x62\154\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\40\40\x20\x20\x20\40\40\74\x73\x63\162\151\x70\164\x20\x74\171\x70\x65\x3d\42\x74\145\x78\x74\57\152\x61\x76\x61\x73\143\162\151\160\x74\42\x3e\xa\40\40\x20\x20\40\x20\40\40\146\x75\156\x63\164\151\157\156\40\104\145\x63\x72\x65\x6d\145\x6e\x74\x4e\x75\x6d\x28\x29\x7b\40\142\x65\146\157\x72\145\50\x29\x3b\xa\x20\40\x20\40\x20\40\40\40\40\x20\40\x20\x76\x61\x72\x20\x44\145\143\x72\145\x6d\x65\156\x74\x4e\165\x6d\75\x64\157\x63\x75\155\145\x6e\x74\56\x67\x65\x74\x45\x6c\x65\155\145\x6e\x74\102\x79\111\144\50\42\x44\x65\143\162\145\155\145\156\164\116\165\155\42\51\56\166\141\154\x75\x65\73\12\x20\40\x20\x20\x20\x20\40\x20\40\40\40\40\166\x61\162\x20\x6b\x65\171\x3d\x22\x64\x72\x6f\151\x64\x39\60\63\x22\73\xa\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x76\x61\x72\40\144\x61\164\x6f\163\x20\75\x20\173\12\x20\40\40\x20\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\42\160\x61\147\x22\40\x3a\40\x44\145\x63\162\x65\155\x65\x6e\164\116\165\x6d\x2c\12\x20\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\40\40\40\42\x6b\145\x79\x22\x20\72\40\x6b\145\171\12\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\x7d\73\12\40\x20\x20\40\x20\40\x20\40\x20\40\x20\12\40\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x24\x2e\x61\152\141\170\x28\x7b\xa\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\144\141\x74\141\72\40\144\x61\164\157\x73\54\12\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\40\40\x75\x72\x6c\x3a\x20\x20\142\x61\163\145\165\x72\154\53\x22\143\137\x64\162\157\x69\144\x2f\x70\162\157\x6d\x6f\x73\42\x2c\12\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\x74\x79\160\x65\72\x20\42\120\117\x53\124\x22\54\xa\x20\40\40\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\40\x73\x75\x63\x63\145\163\163\x3a\x20\146\x75\156\x63\x74\151\x6f\156\50\x64\x61\x74\141\x29\40\173\xa\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\40\40\x24\50\x22\x23\x62\x6f\x64\x79\42\x29\x2e\x68\x74\155\154\50\144\141\164\x61\x29\73\x20\x73\167\x61\x6c\x2e\143\154\x6f\x73\x65\50\x29\x3b\12\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\40\x20\x20\x7d\xa\40\40\40\x20\x20\40\40\x20\40\x20\x20\xa\x20\40\40\40\40\40\40\40\40\40\40\x20\40\40\40\175\51\73\xa\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\175\xa\40\x20\x20\x20\x20\x20\40\40\xa\40\40\40\x20\x20\x20\x20\40\40\40\40\x66\x75\156\x63\164\151\x6f\156\x20\x6e\x75\155\x70\141\147\x28\x61\51\173\40\142\145\x66\x6f\162\145\50\51\73\xa\40\40\40\40\x20\40\40\x20\40\40\40\x20\x76\141\x72\x20\153\145\x79\75\x22\144\162\x6f\151\x64\71\x30\63\42\73\12\x20\40\40\40\40\40\x20\40\12\40\40\x20\40\x20\40\40\x20\x20\x20\40\40\166\141\162\40\144\141\164\157\163\x20\x3d\40\173\12\x20\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\40\x20\x20\42\153\145\x79\x22\72\153\145\x79\x2c\xa\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\42\x70\x61\x67\42\x20\x3a\40\x61\12\40\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x7d\x3b\xa\x20\40\x20\40\x20\40\40\40\40\x20\40\12\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x24\x2e\141\152\141\170\x28\x7b\xa\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x64\141\164\141\x3a\x20\x64\141\x74\157\163\x2c\12\40\40\40\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\40\x75\x72\154\72\40\x62\x61\x73\x65\165\162\x6c\53\x22\x63\x5f\144\162\x6f\151\144\57\x70\x72\x6f\x6d\x6f\x73\42\54\12\40\40\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\164\x79\160\x65\72\40\x22\x50\117\123\x54\42\54\xa\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x73\x75\x63\143\x65\163\x73\72\40\x66\x75\156\x63\164\x69\x6f\x6e\50\x64\141\x74\x61\51\x20\x7b\12\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\x24\x28\x22\x23\142\157\x64\x79\x22\x29\x2e\150\x74\x6d\x6c\50\x64\141\164\141\x29\73\40\163\x77\141\x6c\56\143\x6c\157\x73\x65\x28\51\73\xa\40\40\x20\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\40\40\40\40\x7d\xa\x20\40\x20\40\40\40\x20\40\x20\40\40\xa\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\40\175\x29\73\12\x20\x20\x20\x20\40\40\40\40\x20\40\40\175\12\x20\x20\x20\x20\x20\40\40\40\12\x20\40\40\40\x20\40\40\x20\40\x20\x20\146\x75\x6e\143\164\151\x6f\156\x20\111\156\143\162\151\x6d\x65\x6e\x74\116\165\155\50\51\173\x20\142\x65\x66\x6f\162\x65\50\x29\73\12\x20\40\40\40\40\40\x20\x20\40\40\x20\40\166\141\x72\x20\x49\x6e\143\x72\x69\155\x65\x6e\x74\116\165\155\75\x64\157\143\165\x6d\x65\156\x74\56\x67\x65\164\x45\x6c\145\155\x65\156\164\x42\x79\111\144\50\x22\111\156\x63\x72\x69\x6d\x65\x6e\x74\116\x75\155\x22\x29\x2e\x76\x61\x6c\x75\x65\x3b\xa\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x76\141\162\40\x6b\145\x79\x3d\42\144\162\157\x69\144\71\x30\x33\42\73\xa\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x76\141\x72\40\144\141\x74\157\x73\40\x3d\x20\173\xa\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\42\153\145\171\x22\72\x6b\145\171\x2c\xa\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x22\160\141\x67\x22\40\x3a\x20\111\156\143\162\x69\155\145\x6e\164\116\x75\155\xa\40\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\40\x7d\73\12\x20\x20\40\40\x20\40\40\40\x20\x20\40\12\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\44\56\141\x6a\x61\170\x28\173\xa\40\40\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x64\x61\164\x61\72\40\x64\141\x74\x6f\x73\x2c\12\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\x20\x75\x72\154\72\x20\40\x62\x61\163\x65\x75\x72\x6c\x2b\x22\x63\x5f\x64\162\x6f\x69\x64\57\x70\162\x6f\155\x6f\163\x22\x2c\xa\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\40\40\40\x20\x74\171\x70\x65\72\x20\42\x50\117\x53\124\x22\x2c\xa\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\x73\165\x63\x63\145\163\x73\x3a\x20\146\x75\x6e\x63\x74\151\157\x6e\x28\x64\141\164\x61\51\x20\173\12\x20\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\44\x28\x22\x23\142\x6f\144\x79\x22\x29\56\x68\164\155\x6c\x28\x64\141\164\141\x29\x3b\x20\x73\x77\141\x6c\x2e\x63\x6c\x6f\163\x65\x28\x29\73\xa\x20\40\40\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x7d\xa\x20\x20\x20\40\x20\x20\40\40\40\40\x20\12\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x7d\51\x3b\12\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\175\12\40\40\x20\x20\x20\x20\40\40\74\x2f\x73\143\162\x69\160\164\x3e\xa\40\x20\x20\x20\x20\x20\40\x20\x3c\144\x69\x76\40\x63\x6c\141\163\x73\x3d\x22\x77\63\x2d\x62\x61\162\40\167\63\55\142\157\x72\144\145\x72\40\x77\63\55\142\141\162\162\x61\x73\x22\x3e\xa\40\40\x20\40\x20\40\40\x20\74\x69\156\x70\x75\164\40\x74\x79\x70\x65\75\x22\x68\151\144\144\x65\156\42\40\151\x64\75\42\104\x65\143\162\x65\x6d\x65\156\164\x4e\165\155\x22\x20\166\x61\x6c\x75\x65\75\42" . $DecrementNum . "\x22\76\12\x20\x20\x20\40\x20\x20\x20\40\x3c\141\x20\x6f\x6e\143\154\x69\x63\x6b\75\x22\x44\145\143\162\145\155\x65\156\164\116\165\155\50\51\73\x22\x20\x63\154\141\163\x73\x3d\x22\x77\63\55\x62\141\x72\55\x69\x74\x65\x6d\x20\x77\x33\55\142\165\164\x74\x6f\156\42\x3e\46\x6c\x61\161\x75\x6f\73\x3c\57\141\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\141\x67\x69\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\x33\x2d\146\x6f\x6e\144\157\x64\162\157\x69\x64"; $html .= "\12\40\40\40\40\x20\40\x20\x20\x3c\151\x6e\160\165\x74\40\164\171\160\145\75\42\x68\x69\144\144\x65\156\x22\x20\151\x64\x3d\42" . $id . "\x22\40\166\x61\154\165\x65\x3d\42" . $i . "\x22\x3e\12\x20\40\40\40\40\40\x20\x20\74\141\x20\x6f\x6e\143\x6c\x69\143\x6b\75\42\156\165\x6d\160\x61\147\x28\x24\x28\x27\43" . $id . "\47\x29\x2e\x76\141\154\x28\x29\x29\x3b\42\40\143\154\x61\x73\x73\x3d\42\167\x33\55\142\141\x72\x2d\151\x74\145\155\40\167\x33\55\x62\x75\x74\x74\157\156\x20" . $hover . "\x22\x3e" . $i . "\x3c\57\141\76"; } else { $hover = ''; $html .= "\74\151\x6e\160\165\164\x20\164\x79\x70\x65\x3d\42\150\151\144\144\x65\156\x22\x20\x69\144\75\42" . $id . "\x22\40\166\141\x6c\165\x65\x3d\42" . $i . "\42\x3e\xa\x20\40\x20\40\40\40\x20\x20\x3c\141\x20\157\156\x63\154\x69\x63\x6b\x3d\x22\156\165\x6d\160\141\x67\50\x24\50\47\43" . $id . "\x27\x29\56\166\141\154\x28\51\51\73\x22\40\x63\154\141\163\163\75\x22\167\63\55\x62\x61\162\55\151\x74\x65\155\x20\x77\63\x2d\142\x75\x74\164\157\x6e\x20" . $hover . "\42\x3e" . $i . "\x3c\x2f\141\x3e"; } } } $html .= "\74\151\x6e\x70\x75\164\40\x74\x79\x70\x65\75\x22\x68\151\x64\x64\x65\156\x22\x20\151\144\x3d\42\x49\156\x63\x72\151\x6d\145\156\164\116\165\155\x22\x20\166\141\154\x75\145\75\x22" . $IncrimentNum . "\x22\x3e\12\x20\40\40\x20\40\x20\x20\x20\x3c\141\x20\157\x6e\143\154\x69\143\x6b\75\42\111\156\143\x72\151\x6d\x65\x6e\164\116\165\155\50\x29\73\x22\40\x63\154\x61\163\163\x3d\42\x77\63\x2d\142\x61\162\55\x69\164\x65\x6d\x20\x77\63\55\142\165\x74\164\157\x6e\x22\76\46\162\x61\x71\x75\157\73\x3c\57\x61\x3e\12\xa\40\x20\40\x20\40\40\40\40\74\x2f\144\x69\166\76\40"; return $html; } function regpromos($nom, $fdesde, $fhasta, $descu) { $this->db->insert("\x70\162\x6f\x6d\x6f\163", array("\x63\154\151" => $nom, "\146\144\x65\x73\144\145" => $fdesde, "\146\150\x61\163\164\x61" => $fhasta, "\x64\x65\x73\143\165" => $descu)); $this->loguser("\103\162\x65\141\40\x50\x72\157\155\157", "\x45\x6c\x20\165\163\x75\141\162\x69\157\40\x63\162\145\141\40\154\141\40\x70\162\x6f\155\x6f\x20" . $nom . "\40\143\x6f\x6e\40\x66\145\143\150\x61\40\144\145\163\x64\x65\40" . $fdesde . "\40\x68\141\x73\164\141\40" . $fhasta . "\x3b\x20\x50\x52\x4f\115\x4f\72\40" . $descu . "\56"); return $this->db->affected_rows(); } function editpromos($id, $fdesde, $fhasta, $descu) { $this->db->where("\151\144", $id)->update("\160\162\157\x6d\157\x73", array("\x66\144\x65\163\x64\145" => $fdesde, "\146\x68\141\163\164\141" => $fhasta, "\144\x65\163\143\x75" => $descu)); $this->loguser("\115\157\144\x69\146\151\x63\x61\40\120\x72\x6f\x6d\x6f", "\x45\154\40\165\x73\165\141\x72\151\157\x20\x6d\157\144\x69\x66\x69\143\x61\40\x6c\x61\x20\x70\x72\x6f\155\x6f\x20" . $id . "\x20\x63\x6f\156\x20\x66\145\143\150\x61\x20\144\145\x73\144\x65\x20" . $fdesde . "\40\x68\x61\163\x74\x61\40" . $fhasta . "\73\40\x50\x52\x4f\115\x4f\72\x20" . $descu . "\x2e"); return $this->db->affected_rows(); } function viewdev($a, $b) { $db = $this->db->query("\x53\105\114\x45\x43\124\40\143\x2e\x6e\157\x6d\x62\162\x65\x20\x76\x65\156\144\145\x64\x6f\162\54\x61\56\146\x65\x63\x68\x61\143\162\145\x61\54\141\x2e\x64\157\143\x75\x6d\x65\x6e\x74\157\54\x61\x2e\x74\151\x70\157\x64\157\143\x2c\141\56\156\157\155\142\162\145\143\154\x69\54\141\x2e\x72\151\146\54\142\x2e\x63\141\x6d\x70\x6f\61\40\163\x69\x63\155\142\54\x62\x2e\144\151\162\145\143\143\x69\x6f\x6e\x20\144\x69\162\x65\x63\x65\x6e\x76\151\x6f\x2c\122\117\125\116\104\x28\x61\x2e\164\x6f\164\x6e\x65\x74\x6f\x2c\x32\51\164\x6f\164\x6e\145\x74\x6f\54\122\x4f\x55\116\104\50\x61\56\164\x6f\x74\151\x6d\x70\165\145\x73\164\x2c\x32\51\164\x6f\x74\x69\155\x70\165\145\163\x74\x2c\xa\x20\x20\40\40\122\x4f\x55\x4e\x44\x28\141\56\164\157\x74\144\145\163\x63\165\x65\156\x2c\x32\51\164\157\x74\144\145\163\143\165\145\156\x2c\x52\117\x55\116\x44\x28\141\x2e\164\x6f\x74\x61\154\x66\151\156\x61\154\x2c\62\51\164\157\164\x61\154\x66\x69\156\x61\x6c\54\x52\x4f\x55\116\104\x28\x61\x2e\142\141\163\x65\x69\x6d\160\x6f\61\54\x32\x29\142\141\163\x65\x69\155\x70\x6f\61\54\x52\117\125\x4e\x44\x28\x61\56\163\x69\156\151\155\x70\165\x65\163\164\54\62\x29\163\151\156\x69\155\160\x75\x65\163\164\x2c\x61\56\x6e\157\164\x61\163\54\x61\56\166\x65\156\x63\x65\x2c\141\56\144\151\141\163\143\x72\145\x64\x2c\141\x2e\x72\145\146\x65\162\x65\x6e\143\151\141\xa\40\40\x20\x20\x46\x52\x4f\x4d\40\144\x65\x76\x6f\x6c\164\151\40\141\12\x20\40\x20\x20\112\117\111\x4e\x20\143\x6c\x69\145\155\x70\162\x65\40\x62\x20\117\x4e\40\141\x2e\143\x6f\144\x63\154\151\145\156\x74\x65\x3d\142\56\143\x6f\x64\x69\147\157\xa\x20\40\x20\x20\x4a\x4f\x49\x4e\x20\154\151\x73\x74\166\145\x6e\144\x20\x63\40\x4f\x4e\40\x61\56\166\x65\156\x64\145\144\157\162\x3d\143\x2e\x63\x6f\x64\x69\x67\x6f\xa\40\40\x20\x20\127\110\105\x52\105\x20\141\x2e\144\157\x63\165\155\x65\x6e\164\x6f\x3d\x27{$a}\47\40\x26\x26\x20\141\x2e\x74\x69\x70\157\x64\x6f\x63\75\x27{$b}\47")->row(); $tsiva = 0; $tsimp = 0; $tdesc = 0; $timp = 0; $tot = 0; $baseimp = 0; $nota = ''; $tsimp = $db->sinimpuest; $tsiva = $db->totneto; $tdesc = $db->totdescuen; $timp = $db->totimpuest; $tot = $db->totalfinal; $baseimp = $db->baseimpo1; $nota = $db->notas; $facafec = $this->db->query("\123\x45\114\x45\x43\124\40\x66\x65\143\150\x61\143\162\x65\141\x2c\144\157\x63\165\x6d\145\156\x74\157\x20\106\x52\117\x4d\40\x6f\160\145\x72\x74\x69\40\167\x68\145\x72\145\x20\x63\157\156\x63\141\164\50\x74\151\160\x6f\144\157\143\x2c\144\x6f\x63\165\155\145\x6e\x74\x6f\51\75\47{$db->referencia}\47")->row(); $db2 = $this->db->query("\123\x45\114\105\103\124\40\122\x4f\x55\x4e\104\x28\141\56\143\141\x6e\164\x69\144\141\x64\x29\x63\141\x6e\x74\x69\144\141\144\x2c\122\117\125\x4e\x44\x28\x61\x2e\143\x6e\164\144\145\166\x75\x65\154\164\x29\x63\x6e\x74\144\145\166\165\x65\154\x74\54\141\56\154\157\x74\x65\54\141\x2e\156\157\155\x62\162\145\54\141\x2e\x75\156\151\x64\x61\x64\54\xa\40\40\40\x20\50\123\x45\114\x45\x43\124\40\166\x65\x6e\x63\x65\40\146\162\157\155\x20\x61\162\x74\151\x6c\157\164\x65\x73\40\127\110\105\x52\x45\x20\143\157\144\x69\x67\x6f\x61\162\x74\x3d\141\56\x63\157\x64\151\147\x6f\x20\46\46\x20\154\x6f\164\145\75\141\x2e\x6c\157\x74\x65\40\46\x26\x20\x61\x6c\155\x61\x63\145\x6e\75\x61\x2e\x61\154\155\x61\143\x65\x6e\40\x6c\x69\155\x69\164\x20\x31\51\x20\x76\x65\156\x63\145\x2c\122\117\x55\116\x44\50\x61\x2e\x70\x72\x65\x63\x69\157\165\156\x69\164\54\x32\x29\x70\162\145\x63\151\x6f\x6f\162\x69\x67\151\x6e\x61\154\54\103\117\x4e\103\x41\x54\50\x52\117\125\x4e\x44\x28\x61\56\x64\163\143\164\x6f\x75\x6e\151\164\54\60\51\54\47\x25\x20\x27\x2c\x52\x4f\x55\116\x44\x28\141\x2e\144\x73\x63\x74\x6f\160\x72\x63\x2c\62\x29\51\x20\x64\145\x73\x63\x75\54\12\x20\x20\40\40\122\117\125\x4e\x44\50\141\56\x70\x72\145\x63\x69\x6f\x66\151\156\x2c\x32\51\160\162\x65\143\151\157\x66\151\x6e\54\122\x4f\125\x4e\104\50\x61\56\x6d\157\x6e\164\157\164\x6f\164\141\154\x2c\x32\51\x6d\x6f\x6e\x74\x6f\164\157\164\141\154\54\122\117\125\116\104\50\x61\x2e\160\162\x65\x63\x69\157\x75\156\x69\x74\54\62\51\x70\x72\145\x63\x69\x6f\165\156\x69\x74\54\x43\117\116\x43\101\x54\x28\122\117\x55\x4e\104\x28\x61\x2e\164\151\155\160\165\145\160\162\143\54\x30\51\54\x27\45\40\x27\x2c\122\117\125\x4e\104\50\111\x46\x28\x61\56\164\x69\x6d\x70\x75\x65\160\162\143\76\60\x2c\141\56\x70\162\145\x63\151\x6f\x75\x6e\x69\164\x2a\x28\141\x2e\x74\x69\x6d\160\x75\x65\x70\x72\x63\x2f\x31\60\x30\51\54\60\51\54\62\51\51\40\x74\151\x6d\x70\165\145\160\x72\x63\12\40\x20\x20\x20\106\x52\x4f\115\x20\x64\145\x76\157\154\155\x76\40\141\12\x20\40\x20\40\127\x48\105\x52\105\x20\141\56\x64\157\143\x75\155\x65\156\x74\x6f\75\47{$a}\x27\x20\x26\x26\40\141\x2e\164\151\160\157\144\x6f\143\x3d\x27{$b}\x27")->result(); $i = 0; $unid = 0; $db3 = $this->db->query("\123\x45\114\x45\x43\124\40\157\x66\x69\x63\151\141\x6c\40\106\x52\117\115\40\155\157\x6e\145\143\x61\x6d\40\127\x48\105\x52\105\40\146\145\x63\x68\x61\x3c\75\x28\123\105\x4c\105\103\124\40\146\145\143\x68\x61\143\x72\145\141\40\106\122\x4f\115\x20\x64\145\166\x6f\154\164\151\40\x57\110\105\x52\105\40\x64\157\143\165\x6d\x65\156\164\157\75\x27{$a}\47\x20\46\x26\x20\x74\151\x70\x6f\144\x6f\x63\x3d\47{$b}\x27\x20\x4c\x49\115\111\x54\x20\x31\51\x20\117\122\104\105\x52\40\102\131\x20\146\145\143\x68\x61\x20\x44\x45\123\103\x20\x4c\x49\115\x49\x54\x20\x31")->row(); $tasa = $db3->oficial; $db4 = $this->db->query("\x53\105\x4c\105\103\124\x20\157\x66\151\x63\x69\x61\x6c\40\x46\x52\x4f\x4d\40\155\x6f\x6e\x65\x63\x61\155\40\127\110\105\122\105\x20\146\145\143\150\141\x3c\75\47{$facafec->fechacrea}\x27\x20\117\x52\104\x45\x52\x20\102\x59\40\146\x65\143\150\x61\40\104\105\x53\x43\x20\x4c\x49\115\x49\124\40\61")->row(); $tasanc = $db4->oficial; $segun = ''; $totd = $tot / $tasa; if ($b == "\104\x45\x56") { $totd = $tot / $tasa; $segun = "\x3c\x74\144\x3e\74\142\76\123\x65\147\xc3\272\x6e\40\x46\x61\x63\x74\165\162\141\72\x20\74\x2f\142\x3e" . $facafec->documento . "\x3c\57\x74\x64\76\40\74\x74\144\x3e\74\x62\x3e\x46\145\143\x68\141\x20\105\155\x69\x73\x69\xc3\263\156\x20\106\x61\143\164\x75\x72\x61\x3a\x20\74\x2f\x62\76" . $facafec->fechacrea . "\x3c\x2f\164\x64\76"; $tipodoc = "\104\145\166\157\x6c\165\x63\x69\xc3\263\156\72"; $tcant = "\143\x6e\164\144\145\x76\165\x65\x6c\164"; $diascred = ''; } $html = "\74\x6c\151\156\153\40\x72\x65\x6c\75\x22\x73\x74\171\154\x65\163\150\x65\x65\164\42\x20\150\x72\145\x66\75\42\141\163\x73\x65\164\163\x2f\143\x73\163\x2f\x77\x33\56\143\163\x73\x3f\166\75\64\x22\x3e\74\150\164\155\x6c\x3e\x3c\144\x69\166\x20\143\154\x61\x73\163\x3d\42\x77\x33\55\x63\x65\x6e\164\x65\162\42\x20\x73\x74\x79\x6c\x65\75\42\155\x61\162\147\151\156\55\x74\157\x70\x3a\x31\x38\x25\x3b\x6d\141\x72\x67\151\156\55\x6c\x65\146\x74\x3a\x32\x2e\65\x25\x22\x20\x3e"; $html .= "\x3c\151\156\160\x75\x74\40\x74\171\x70\x65\75\x22\x68\x69\144\x64\145\x6e\x22\x20\166\x61\x6c\x75\x65\x3d\x22" . $db->documento . "\x22\x20\151\144\x3d\42\156\165\155\146\141\x63\42\x3e\x3c\x69\156\x70\165\164\x20\x74\171\160\145\x3d\42\x68\x69\144\x64\x65\156\x22\x20\x76\141\x6c\x75\145\x3d\x22" . $db->tipodoc . "\x22\x20\x69\x64\75\42\164\x69\160\x6f\144\x6f\143\x22\76"; $html .= "\74\x74\141\142\x6c\x65\40\x63\x6c\x61\x73\x73\x3d\42\x77\x33\55\164\141\x62\154\145\x20\x77\63\55\x6d\x65\144\x69\165\x6d\x22\x3e\x3c\x74\x72\76\74\x74\144\76\74\142\76" . $tipodoc . "\40\74\57\x62\x3e" . $db->documento . "\x3c\x2f\164\144\76\x3c\x74\144\x3e\x3c\x62\x3e\106\x65\x63\150\x61\x20\x64\145\x20\x45\155\x69\163\x69\xc3\263\156\x3a\40\74\x2f\142\x3e" . DateTime::createFromFormat("\131\55\x6d\x2d\144", $db->fechacrea)->format("\144\x2f\155\57\x59") . "\x3c\57\x74\144\x3e" . $diascred . '' . $segun . "\x3c\57\164\x72\76\74\x2f\x74\141\142\x6c\145\76"; $html .= "\74\164\141\142\154\145\x20\143\154\x61\x73\163\75\x22\167\x33\55\164\141\x62\x6c\145\x20\x77\x33\55\x74\x69\156\x79\42\76\74\x74\162\x3e\x3c\x74\144\x3e\74\x62\x3e\x52\x61\172\303\263\156\40\x53\x6f\x63\x69\x61\x6c\x3a\40\74\57\142\x3e" . $db->nombrecli . "\74\x2f\164\x64\76\74\x74\x64\x3e\74\142\76\122\56\111\56\x46\72\x20\x3c\x2f\142\x3e" . $db->rif . "\74\x2f\x74\x64\x3e\x3c\164\144\x3e\x3c\x62\76\x43\303\xb3\x64\x69\147\157\x20\123\111\x43\115\72\40\x3c\x2f\142\x3e" . $db->sicmb . "\74\57\164\x64\76\74\x74\144\76\x3c\x62\x3e\x56\145\x6e\x64\145\x64\157\162\x3a\40\x3c\x2f\142\76" . $db->vendedor . "\74\57\164\144\x3e\74\x2f\x74\162\76\x3c\57\x74\x61\x62\x6c\x65\76"; $html .= "\x3c\164\141\x62\154\x65\x20\143\x6c\141\163\x73\x3d\x22\167\x33\55\164\x61\142\154\x65\x20\167\x33\55\164\151\x6e\x79\42\76\x3c\x74\162\x3e\74\164\144\76\x3c\x62\76\104\157\x6d\151\143\x69\154\151\157\40\x46\x69\163\143\x61\154\x3a\x20\x3c\x2f\x62\76" . $db->direcenvio . "\x3c\x2f\164\144\x3e\x3c\x2f\164\141\x62\x6c\x65\x3e\74\142\162\x3e"; $html .= "\x3c\164\x61\x62\154\145\40\x63\x6c\141\163\x73\75\x22\x77\63\55\164\141\x62\x6c\x65\x2d\x61\154\154\x20\167\63\x2d\x68\157\166\145\162\x61\x62\154\145\40\167\63\55\164\145\x78\164\x70\144\x66\42\40\163\164\171\x6c\145\x3d\42\167\x69\144\x74\x68\x3a\x31\x30\60\x25\x22\x3e\74\164\x72\76\74\164\x68\76\x49\164\145\155\74\57\164\150\76\x3c\x74\150\x3e\x43\141\156\164\74\x2f\x74\150\x3e\x3c\164\x68\x3e\x4c\x6f\x74\x65\74\57\x74\150\76\74\x74\150\76\104\x65\x73\143\162\x69\160\143\151\303\263\x6e\40\x64\145\x6c\x20\x41\x72\x74\x69\143\x75\x6c\157\74\x2f\x74\x68\76\x3c\x74\150\76\106\56\126\x2e\74\57\x74\150\x3e\x3c\164\x68\x3e\x50\162\145\x63\x69\x6f\56\117\x72\147\x3c\57\x74\x68\76\x3c\x74\150\x3e\x44\145\x73\x63\x75\x65\x6e\164\x6f\74\57\x74\150\76\x3c\x74\x68\x3e\x50\162\x65\143\151\157\x2e\x55\x6e\151\164\x3c\x2f\x74\x68\x3e\74\x74\x68\x3e\111\126\101\x3c\x2f\x74\x68\x3e\74\164\x68\x3e\120\162\145\143\151\x6f\56\106\x69\x6e\74\x2f\x74\x68\76\x3c\x74\x68\76\x54\157\x74\x61\154\x3c\x2f\164\150\x3e\x3c\x2f\164\x72\76"; foreach ($db2 as $item) { $i++; $cant = $item->{$tcant}; $unid += ROUND($cant); $html .= "\x3c\x74\162\76\74\164\x64\x3e" . $i . "\x3c\57\x74\144\76\74\164\x64\x3e" . ROUND($cant) . "\74\x2f\164\x64\x3e\x3c\x74\x64\76" . $item->lote . "\74\57\x74\x64\x3e\x3c\164\144\x3e" . $item->nombre . "\x3c\x2f\x74\144\76\x3c\x74\144\x3e" . $item->vence . "\74\x2f\x74\144\76\74\164\144\x3e" . $item->preciooriginal . "\x3c\x2f\x74\144\x3e\x3c\164\144\76" . $item->descu . "\74\x2f\164\144\76\74\164\144\x3e" . $item->preciounit . "\74\57\164\144\x3e\74\164\144\x3e" . $item->timpueprc . "\x3c\x2f\164\144\76\x3c\x74\x64\76" . $item->preciofin . "\74\x2f\164\144\76\74\164\144\x3e" . $item->montototal . "\x3c\x2f\x74\x64\76\74\57\x74\162\x3e"; } $html .= "\x3c\57\x74\141\142\x6c\145\76"; $html .= "\74\164\141\x62\x6c\x65\40\143\154\141\x73\163\75\x22\x77\63\x2d\x74\141\x62\154\x65\x2d\x61\x6c\x6c\40\167\63\x2d\164\145\x78\164\x70\144\x66\42\40\x73\164\x79\x6c\x65\x3d\x22\167\x69\144\x74\x68\x3a\x31\60\60\x25\42\x3e\12\x20\40\40\40\x20\x20\40\x20\x20\40\x20\40\74\164\162\x3e\x3c\x74\x64\40\x63\154\141\x73\x73\x3d\42\x77\63\55\154\x69\x67\x68\164\x2d\147\x72\x65\171\x22\x3e\74\x62\76\125\x6e\x69\x64\141\144\145\163\x3a\74\x2f\x62\x3e\x3c\57\x74\x64\76\x3c\x74\x64\76" . $unid . "\x3c\x2f\x74\x64\76\74\164\144\x20\x63\x6c\x61\163\x73\x3d\42\x77\63\55\154\151\147\150\x74\x2d\147\x72\145\171\x22\76\x3c\x62\76\x53\165\x62\x74\x6f\x74\141\154\72\74\57\142\76\74\x2f\164\x64\76\x3c\164\x64\76" . $tsiva . "\x3c\x2f\164\x64\x3e\74\x74\x64\40\143\154\x61\x73\x73\x3d\x22\167\63\55\154\151\x67\150\164\55\x67\x72\145\x79\42\76\74\x62\x3e\115\x6f\x6e\164\157\x20\x74\x6f\164\x61\154\x20\145\170\145\156\x74\x6f\x3a\74\x2f\142\x3e\74\x2f\x74\x64\x3e\74\164\x64\76" . $tsimp . "\x3c\x2f\164\144\76\74\164\x64\40\x63\154\x61\x73\163\x3d\x22\167\63\x2d\x6c\151\147\x68\164\x2d\147\x72\145\171\x22\x3e\x3c\x62\76\102\141\163\145\x20\x69\155\x70\157\x6e\151\x62\x6c\x65\40\163\x65\x67\xc3\272\156\40\x61\x6c\303\xad\x63\x75\157\164\x61\x3a\x3c\x2f\142\76\74\x2f\x74\144\76\x3c\164\x64\76" . $baseimp . "\74\x2f\164\144\x3e\12\40\40\40\40\40\x20\x20\40\40\40\40\40\74\x74\x64\40\143\154\x61\x73\x73\x3d\x22\167\x33\55\x6c\151\147\150\164\55\147\x72\x65\x79\42\76\x3c\142\76\111\155\x70\165\x65\163\164\157\x20\163\x65\147\303\xba\156\40\x41\x6c\303\xad\x63\x75\157\164\x61\74\x2f\x62\x3e\x3c\57\x74\x64\76\74\x74\144\x3e" . $timp . "\x3c\57\x74\x64\76\x3c\x74\144\40\x63\154\141\x73\163\75\42\x77\x33\55\x6c\151\147\x68\x74\x2d\147\162\x65\171\42\x3e\x3c\142\x3e\x44\x65\163\143\x75\x65\156\164\x6f\74\x2f\x62\x3e\x3c\x2f\x74\x64\x3e\74\164\144\76" . $tdesc . "\74\x2f\164\144\76\74\x74\144\x20\143\154\141\x73\x73\75\x22\x77\63\55\x6c\x69\x67\150\164\x2d\147\162\x65\171\42\x3e\74\x62\x3e\x54\x6f\164\141\x6c\x3a\x3c\57\142\76\x3c\x2f\x74\x64\76\x3c\x74\144\x3e" . $tot . "\x3c\57\x74\144\76\x3c\57\x74\x72\76\xa\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\74\x2f\164\141\x62\154\145\x3e\74\x62\x72\x3e"; $html .= "\74\164\x61\142\154\145\x20\x63\154\141\163\x73\x3d\42\167\x33\55\x74\141\142\154\x65\x20\x77\x33\55\x74\x65\x78\164\x70\144\x66\42\x20\163\x74\x79\154\x65\x3d\x22\167\151\144\x74\150\x3a\x31\x30\60\45\x22\x3e\12\x20\40\40\40\40\x20\40\40\40\x20\40\40\40\40\x20\x20\x3c\x74\x72\x3e\74\x74\144\40\143\x6c\x61\163\x73\75\42\167\x33\55\x6c\151\147\150\164\x2d\x67\162\x65\x79\42\76\74\142\x3e\122\105\106\x3a\74\x2f\x62\76\74\57\x74\x64\76\74\x74\x64\76" . round($totd, 2) . "\x24\40\145\x71\x75\151\166\141\x6c\x65\x6e\x74\x65\x73\40\x61\40\x6c\141\x20\164\141\163\141\40\144\x65\x20\143\x61\155\x62\151\x6f\x20\144\145\x20\102\x43\x56\x20\144\145\x20\x31\x20\x55\x53\x44\40\x70\157\x72\x20" . round($tasanc, 2) . "\40\x42\163\56\74\57\164\144\76\74\164\x64\x20\143\154\x61\x73\163\75\x22\167\x33\55\154\x69\x67\150\x74\x2d\x67\x72\145\x79\42\x3e\x3c\142\x3e\116\x6f\x74\x61\x3a\x3c\57\x62\x3e\x3c\57\x74\144\76\x3c\x74\144\x3e\x55\x6e\x69\x64\141\x64\x65\x73\40\144\145\x76\x75\145\154\x74\141\x73\56\74\57\x74\x64\x3e\74\57\164\x72\x3e\xa\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x3c\57\164\141\142\154\x65\76\12\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\x3c\x2f\x64\x69\166\x3e\x3c\57\x68\x74\x6d\x6c\x3e"; return $html; } function impdoc($doc, $tip, $ncontrol) { $this->db->query("\x55\x50\x44\x41\124\105\x20\157\160\145\162\164\151\x20\x73\x65\x74\40\x65\163\164\141\x74\165\163\144\157\143\x3d\47\61\x27\54\157\x72\144\145\x6e\x3d\47{$ncontrol}\47\x20\x57\110\105\x52\x45\x20\x64\157\x63\x75\x6d\145\156\x74\x6f\75\47{$doc}\x27\40\46\x26\x20\x74\151\160\157\144\157\x63\75\47{$tip}\x27\40\x26\x26\40\x65\x73\x74\x61\164\165\163\x64\x6f\x63\75\x27\x30\x27"); if ($this->db->affected_rows() > 0) { $this->loguser("\x49\x6d\160\x72\x69\155\x65", "\105\x6c\x20\x75\163\165\x61\x72\x69\157\x20\x69\x6d\x70\162\x69\x6d\145\x20\144\157\143\x75\x6d\145\156\x74\157\x20" . $tip . $doc . ''); } } function convnotfac($a) { $num = $this->db->query("\x53\x45\x4c\x45\103\124\40\111\x46\50\115\x41\x58\x28\144\x6f\x63\x75\155\x65\156\164\x6f\51\53\x31\76\60\54\x4d\x41\130\50\x64\x6f\143\x75\155\145\x6e\164\x6f\51\53\61\x2c\x31\x29\40\x6e\x20\x46\122\117\x4d\40\x6f\160\x65\162\164\x69\40\x57\110\105\122\105\40\x74\x69\x70\157\x64\x6f\x63\x3d\x27\106\101\x43\x27")->row(); $newdoc = str_pad($num->n, 8, "\60", STR_PAD_LEFT); $this->db->query("\125\x50\x44\101\124\x45\x20\157\160\x65\162\164\x69\40\x53\x45\x54\40\144\157\143\165\155\145\156\x74\157\75\47{$newdoc}\x27\x2c\x66\145\x63\150\x61\143\162\145\x61\x3d\103\x55\122\104\x41\124\105\x28\51\54\x65\x6d\151\163\x69\157\x6e\x3d\x43\125\122\104\x41\x54\105\50\x29\54\x72\x65\x63\145\x70\143\x69\157\156\75\103\125\x52\104\101\x54\105\50\51\54\146\145\143\x68\141\171\150\x6f\162\141\x3d\x4e\x4f\127\50\51\54\164\x69\160\157\x64\x6f\143\x3d\47\x46\x41\x43\47\x2c\164\157\164\141\x6c\144\75\x74\x6f\x74\x61\154\x66\x69\156\x61\154\57\50\x53\x45\x4c\105\103\x54\x20\x6f\x66\151\143\151\x61\x6c\x20\x46\122\x4f\115\40\x6d\157\x6e\x65\x63\x61\x6d\x20\127\110\x45\x52\105\40\x66\145\x63\150\x61\74\x3d\103\125\122\104\x41\x54\105\50\51\40\117\x52\x44\x45\122\x20\x42\131\40\x66\x65\143\150\141\x20\x44\105\123\103\40\x4c\111\x4d\x49\124\40\x31\x29\x20\x57\110\105\x52\x45\x20\x64\x6f\x63\x75\x6d\x65\x6e\164\157\75\47{$a}\x27\x20\46\x26\x20\164\x69\x70\157\144\157\143\75\x27\116\117\124\x27"); $this->db->query("\x55\120\104\101\124\105\x20\x6f\160\x65\x72\155\x76\x20\123\x45\124\40\x64\x6f\143\x75\x6d\x65\156\164\x6f\75\47{$newdoc}\47\54\x66\x65\143\x68\141\x64\x6f\143\75\103\125\122\104\101\x54\105\50\51\x2c\164\151\160\x6f\144\x6f\x63\x3d\x27\106\101\x43\47\x20\x57\110\105\122\x45\40\144\x6f\x63\165\x6d\145\x6e\x74\157\x3d\47{$a}\x27\x20\x26\46\x20\164\x69\160\x6f\144\x6f\x63\75\x27\x4e\x4f\x54\x27"); $this->loguser("\106\x61\143\164\165\x72\141\162", "\x45\154\40\x75\x73\x75\141\162\151\157\40\x63\157\x6e\166\x69\145\x72\164\x65\40\156\x6f\164\141\40\144\145\x20\x65\156\x74\x72\145\x67\141\x20" . $a . "\x20\145\x6e\40\x66\141\143\x74\165\x72\141\x20" . $newdoc . ''); return $this->db->affected_rows(); } function validalote($doc, $tip) { $bd = $this->db->query("\x53\x45\114\x45\103\x54\x20\x61\x6c\155\141\x63\x65\156\54\143\157\x64\151\x67\157\54\154\157\164\x65\x2c\x63\x61\x6e\164\x69\144\141\x64\x20\106\122\117\115\x20\157\x70\x65\162\155\x76\x20\x57\x48\105\122\105\x20\x74\151\160\157\144\x6f\x63\x3d\47{$tip}\x27\x20\46\46\x20\144\x6f\x63\165\155\145\x6e\164\157\75\x27{$doc}\x27")->result(); $i = 0; foreach ($bd as $dt) { $bd2 = $this->db->query("\123\x45\114\x45\103\x54\x20\x4e\125\x4c\x4c\x20\x46\122\117\115\40\141\x72\164\x69\154\157\164\x65\x73\40\x57\x48\105\x52\105\x20\x61\x6c\155\x61\x63\x65\x6e\75\47{$dt->almacen}\47\x20\46\x26\x20\143\157\x64\151\x67\x6f\x61\162\x74\x3d\47{$dt->codigo}\47\x20\46\x26\x20\x6c\157\x74\x65\x3d\47{$dt->lote}\47\x20\46\x26\x20\x28\143\x61\x6e\x74\151\144\141\144\55\x63\157\156\x73\x75\155\151\x64\x6f\51\x3e\x3d\x27{$dt->cantidad}\x27")->num_rows(); if ($bd2 == 0) { $i++; return $data = array("\x72\x6f\x77" => 0, "\x61\x6c\x6d" => $dt->almacen, "\160\162\x6f\144" => $dt->codigo, "\154\x6f\x74\145" => $dt->lote); } } if ($i == 0) { return $data = array("\x72\x6f\x77" => 1); } } function facturar($a, $b, $c, $nota, $dias) { $this->db->query("\104\105\114\x45\124\105\x20\x46\x52\x4f\115\x20\x6f\x70\145\162\155\x76\40\x57\110\x45\122\x45\x20\x64\x6f\x63\x75\155\145\156\x74\157\75\x27{$a}\x27\x20\x26\x26\x20\164\x69\x70\x6f\x64\x6f\x63\75\47{$b}\47\x20\x26\x26\40\x63\141\x6e\x74\x69\x64\141\144\75\x30"); $this->db->query("\125\x50\x44\101\x54\x45\x20\157\160\145\x72\164\151\40\x73\145\x74\40\x64\x69\x61\163\x69\156\x64\145\x78\x3d\47{$dias}\47\40\x57\110\x45\122\105\40\144\x6f\x63\x75\x6d\x65\x6e\x74\x6f\x3d\x27{$a}\47"); if ($c == "\x46\x41\103") { $tipdoc = "\x46\x41\x43"; } elseif ($c == "\116\x4f\124") { $tipdoc = "\x4e\x4f\x54"; } elseif ($c == "\x4e\117\x54\x32") { $tipdoc = "\116\117\x54"; $this->db->query("\125\x50\x44\101\124\105\40\157\160\145\x72\x6d\x76\x20\x53\x45\124\40\x70\162\145\143\x69\x6f\x66\151\156\75\x70\x72\x65\x63\x69\157\x75\156\x69\164\x2c\x74\151\x6d\160\x75\145\x70\162\143\x3d\x30\40\127\110\x45\x52\x45\x20\x64\157\143\165\155\145\156\x74\157\75\x27{$a}\47"); $this->db->query("\125\120\x44\x41\124\x45\40\157\160\x65\162\x74\151\40\123\105\x54\40\x74\x6f\x74\151\155\x70\165\145\163\164\75\x30\54\x62\x61\163\145\151\x6d\160\x6f\x31\75\60\54\163\151\x6e\x69\x6d\160\x75\x65\x73\164\x3d\164\x6f\164\x6e\145\x74\157\54\x74\x6f\x74\x61\154\x66\x69\x6e\x61\x6c\75\x74\x6f\x74\156\145\x74\157\x20\x57\110\105\122\x45\x20\144\x6f\x63\x75\x6d\145\x6e\x74\x6f\75\47{$a}\47"); } elseif ($c == "\x4e\x4f\x54\x33") { $tipdoc = "\116\x4f\x54"; $this->db->query("\125\x50\104\x41\124\105\40\157\160\145\162\x6d\166\40\x53\105\124\40\x70\x72\145\x63\x69\157\157\x72\151\x67\151\156\x61\154\75\60\x2c\x70\162\145\x63\151\x6f\x75\156\x69\164\75\x30\54\160\162\145\143\x69\x6f\146\x69\156\x3d\x30\54\164\151\155\x70\165\x65\x70\162\x63\x3d\60\40\127\110\105\122\105\x20\144\x6f\x63\x75\x6d\145\x6e\x74\157\x3d\x27{$a}\x27"); $this->db->query("\125\x50\104\101\x54\105\40\157\x70\145\162\x74\151\40\x53\x45\124\40\164\x6f\x74\x69\155\160\x75\x65\163\x74\75\x30\54\x62\141\x73\145\151\x6d\x70\157\x31\x3d\x30\x2c\163\151\156\x69\x6d\160\x75\x65\163\x74\75\x30\54\164\157\164\x61\x6c\x66\151\156\x61\x6c\x3d\60\x2c\164\157\164\x6e\x65\164\157\x3d\x30\54\x74\157\164\x62\162\165\164\x6f\x3d\x30\40\x57\110\x45\x52\105\40\x64\x6f\x63\165\155\145\156\164\157\x3d\x27{$a}\47"); } $this->ajustetotales($a, "\105\123\120"); $i = 0; $db = $this->db->query("\x53\x45\x4c\x45\x43\x54\40\x61\x2e\x61\154\155\141\143\x65\x6e\x2c\141\56\x63\157\144\151\x67\157\54\x61\56\x6c\157\164\145\x2c\141\56\x63\x61\156\x74\x69\x64\141\144\40\x46\x52\x4f\115\40\157\x70\145\x72\155\166\40\141\40\x57\110\x45\x52\x45\x20\x61\56\x64\x6f\143\x75\155\x65\x6e\x74\157\x3d\x27{$a}\47\73"); $db4 = $this->db->query("\123\105\114\x45\103\124\40\x52\117\x55\x4e\x44\50\x61\x2e\164\x6f\x74\141\x6c\146\x69\156\x61\154\x2f\x28\x53\105\114\105\x43\124\x20\157\146\151\x63\x69\x61\x6c\x20\106\x52\117\x4d\x20\155\157\x6e\x65\143\141\x6d\40\127\x48\105\x52\x45\x20\146\x65\x63\150\141\74\x3d\x43\125\x52\104\101\x54\x45\x28\x29\40\117\122\x44\105\x52\40\x42\131\40\146\145\x63\150\x61\x20\x44\105\x53\103\x20\114\111\x4d\x49\x54\40\x31\51\x2c\x34\51\x20\x74\x6f\x74\x61\154\144\54\x61\x2e\x6e\x6f\x74\x61\x73\40\106\122\117\x4d\x20\157\x70\x65\162\x74\151\x20\x61\x20\x57\110\105\x52\105\x20\141\x2e\144\x6f\x63\x75\155\145\x6e\x74\157\75\47{$a}\x27\x3b")->row(); $this->db->query("\125\x50\104\101\x54\x45\x20\157\160\145\162\x74\x69\x20\123\x45\x54\40\x74\x6f\164\x61\x6c\144\x3d\47{$db4->totald}\x27\40\127\110\x45\x52\105\x20\x64\157\143\165\x6d\145\x6e\x74\x6f\75\47{$a}\47"); $notas = $nota . "\40" . $db4->notas; foreach ($db->result() as $dt) { $this->db->query("\125\x50\x44\101\124\x45\x20\141\162\x74\x69\154\x6f\x74\145\163\40\123\x45\x54\40\143\x6f\x6e\x73\x75\155\151\144\157\75\143\x6f\x6e\163\165\155\151\144\157\x2b{$dt->cantidad}\40\x57\x48\105\x52\x45\x20\141\x6c\x6d\141\143\x65\156\75\47{$dt->almacen}\47\40\46\x26\x20\143\157\144\x69\x67\x6f\x61\162\x74\x3d\47{$dt->codigo}\x27\40\46\46\x20\x6c\157\164\x65\x3d\47{$dt->lote}\47"); if ($this->db->affected_rows() > 0) { $this->db->query("\x55\x50\x44\101\124\105\x20\x61\162\x74\151\143\x75\x6c\x6f\x20\123\105\124\40\145\170\151\163\164\x65\156\143\x69\x61\x3d\145\x78\151\163\164\x65\x6e\143\x69\x61\x2d{$dt->cantidad}\x2c\143\157\x6d\x70\162\x6f\x6d\145\164\x69\144\x6f\75\x63\x6f\x6d\x70\162\157\x6d\145\x74\151\144\157\55{$dt->cantidad}\40\127\110\x45\x52\105\x20\x63\x6f\144\151\147\157\x3d\x27{$dt->codigo}\x27"); if ($this->db->affected_rows() > 0) { $i++; } } } if ($db->num_rows() > 0) { if ($db->num_rows() == $i) { $num = $this->db->query("\x53\x45\114\105\103\124\x20\x49\106\x28\115\x41\x58\x28\144\x6f\x63\x75\x6d\x65\156\164\157\51\x2b\x31\76\60\54\115\x41\x58\x28\144\x6f\143\165\155\145\x6e\164\157\51\x2b\61\54\x31\x29\x20\x6e\x20\x46\x52\x4f\115\40\157\x70\145\x72\x74\151\x20\x57\110\105\x52\105\40\164\x69\x70\157\x64\157\x63\75\47{$tipdoc}\x27")->row(); $newdoc = str_pad($num->n, 8, "\60", STR_PAD_LEFT); $data4 = array("\x64\x6f\143\165\155\x65\156\x74\157" => $newdoc, "\x74\151\x70\157\144\x6f\x63" => $tipdoc, "\x61\156\x74\144\157\143" => $a, "\x6f\162\x64\145\156" => $b, "\x6e\x6f\164\141\163" => $notas, "\x65\155\x69\x73\151\157\156" => date("\x59\55\155\55\144"), "\x66\145\x63\x68\x61\143\162\145\141" => date("\131\x2d\155\x2d\144"), "\x72\145\x63\145\160\x63\151\x6f\156" => date("\x59\x2d\x6d\55\144"), "\x66\x65\x63\x68\x61\x79\150\157\162\141" => date("\131\55\x6d\55\x64\40\x48\72\x69\x3a\163"), "\x75\x65\155\151\x73\x6f\162" => $this->session->userdata("\143\x6f\x64")); $this->db->where("\x64\157\143\165\x6d\145\x6e\164\x6f", $a)->update("\x6f\160\145\162\x74\x69", $data4); $data5 = array("\144\157\143\165\x6d\x65\156\x74\157" => $newdoc, "\164\151\x70\157\144\157\143" => $tipdoc, "\x66\x65\x63\150\141\144\x6f\143" => date("\131\55\x6d\x2d\144")); $this->db->where("\x64\157\143\165\x6d\x65\x6e\x74\157", $a)->update("\157\160\x65\162\x6d\166", $data5); $this->loguser("\106\141\143\x74\x75\x72\x61\x72", "\105\x6c\x20\165\x73\165\141\x72\151\157\40\150\x61\x20\x66\x61\143\164\165\162\141\x64\x6f\40\145\x6c\x20\x64\157\x63\x75\155\145\x6e\x74\157\40" . $a . "\40\143\157\156\x20" . $i . "\40\160\x72\x6f\144\x75\x63\x74\157\163\56\x20\x4e\x75\145\166\157\x20\x64\x6f\143\x75\155\x65\156\x74\x6f\x3a\40" . $newdoc . ''); return $data = array("\162\157\x77" => 1, "\x64\157\143" => $newdoc, "\164\151\160\157\144\x6f\x63" => $tipdoc); } } else { return 0; } } function ajustetotales($a, $b) { $this->promoprov($a, $b); $this->promofac($a, $b); $this->db->query("\x55\x50\x44\101\124\x45\x20\x6f\x70\x65\162\155\x76\40\123\105\x54\x20\x64\163\143\164\157\160\x72\x63\75\50\111\x46\50\144\x73\143\x74\157\165\x6e\x69\x74\76\60\x2c\x70\x72\145\x63\151\157\x6f\162\x69\147\151\x6e\x61\x6c\x2a\50\144\163\x63\x74\x6f\x75\x6e\x69\164\x2f\61\x30\60\x29\x2c\60\51\x29\x2c\160\162\x65\143\x69\157\x75\x6e\x69\164\x3d\160\162\x65\x63\151\x6f\157\x72\x69\x67\151\156\141\x6c\x2d\144\163\x63\164\x6f\x70\162\x63\x2c\12\40\x20\x20\x20\x64\163\143\164\157\160\x72\143\x32\75\x28\x49\106\x28\x64\163\143\x74\x6f\x75\x6e\x69\164\x32\x3e\60\54\x70\x72\145\x63\x69\157\165\156\x69\x74\52\x28\144\163\x63\x74\157\165\156\151\x74\x32\57\61\60\60\x29\54\x30\x29\51\x2c\40\160\162\x65\143\151\157\165\x6e\x69\164\x3d\160\x72\145\x63\x69\x6f\165\x6e\151\164\55\144\163\143\x74\x6f\160\x72\x63\62\54\40\144\163\x63\x74\157\x65\156\x64\155\62\75\x49\106\50\144\163\x63\x74\157\x65\x6e\x64\160\62\76\x30\54\x28\x70\162\145\143\x69\x6f\165\x6e\151\164\x2a\50\144\x73\143\x74\x6f\x65\x6e\x64\x70\x32\x2f\61\60\60\x29\x29\54\x30\x29\54\x70\162\145\x63\151\157\x75\x6e\x69\164\75\x70\x72\x65\143\x69\x6f\x75\x6e\x69\x74\55\x64\163\143\x74\x6f\145\156\x64\x6d\62\54\12\x20\40\x20\40\144\163\x63\x74\x6f\x65\x6e\144\x6d\63\x3d\111\x46\x28\144\163\143\x74\157\145\x6e\x64\160\x33\x3e\x30\x2c\50\x70\x72\145\x63\151\157\x75\x6e\x69\x74\52\x28\x64\x73\143\164\157\145\x6e\144\x70\63\57\x31\60\x30\51\51\54\60\x29\x2c\160\162\x65\x63\x69\x6f\165\x6e\x69\x74\75\160\x72\x65\x63\151\157\x75\156\x69\x74\55\x64\163\143\164\x6f\x65\x6e\x64\155\63\x2c\x64\x73\x63\x74\157\145\x6e\x64\155\75\111\x46\50\144\163\143\x74\157\x65\156\x64\160\x3e\60\x2c\x28\x70\162\145\143\x69\157\x75\x6e\x69\x74\x2a\50\x64\x73\x63\164\157\145\x6e\x64\160\x2f\x31\60\x30\51\x29\54\x30\x29\x2c\x70\162\x65\x63\x69\157\165\x6e\151\164\75\160\162\x65\x63\151\157\x75\x6e\x69\164\55\144\x73\143\x74\x6f\x65\x6e\144\x6d\54\xa\x20\x20\x20\x20\x70\162\145\x63\151\157\146\151\x6e\75\x70\162\145\143\151\157\x75\x6e\151\164\52\x28\x31\53\x28\164\151\155\160\165\x65\160\162\x63\57\61\x30\x30\x29\51\x20\x57\110\105\122\x45\x20\x64\x6f\143\165\x6d\145\x6e\x74\x6f\75\47{$a}\x27\x20\46\x26\40\164\151\x70\x6f\x64\x6f\143\75\47{$b}\47"); $this->db->query("\x55\120\104\101\124\x45\40\157\160\x65\x72\x6d\166\40\x53\x45\x54\x20\155\x6f\156\164\157\156\145\164\157\x3d\50\160\x72\x65\x63\151\157\165\156\x69\x74\x2a\x63\x61\x6e\164\151\144\x61\144\x29\54\xa\40\x20\40\40\x6d\157\156\x74\x6f\x74\x6f\164\141\x6c\75\x28\x70\162\145\143\x69\157\x66\x69\156\x2a\143\x61\x6e\x74\x69\x64\141\x64\51\x20\127\x48\105\x52\105\x20\144\157\x63\165\x6d\145\156\x74\157\x3d\x27{$a}\x27\40\x26\46\x20\164\151\160\x6f\x64\x6f\x63\x3d\x27{$b}\x27"); $this->db->query("\125\120\x44\x41\124\105\40\157\160\145\162\164\151\x20\141\x20\x53\x45\x54\x20\x61\x2e\164\x6f\164\x63\x6f\x73\x74\x6f\75\50\x53\105\x4c\105\x43\124\x20\123\125\115\x28\142\x2e\143\157\163\x74\157\165\156\151\164\x29\x20\106\x52\x4f\x4d\x20\157\x70\x65\162\155\166\40\142\40\x57\x48\x45\122\x45\40\x62\56\144\157\x63\x75\x6d\145\x6e\x74\x6f\x3d\x61\x2e\x64\157\143\165\155\x65\x6e\x74\157\40\x26\46\40\142\x2e\x74\x69\160\157\x64\157\x63\x3d\141\56\164\151\x70\x6f\144\157\x63\x29\54\12\x20\x20\40\x20\x61\x2e\164\x6f\164\x62\162\x75\164\157\75\x28\x53\x45\114\x45\103\124\40\x53\125\115\x28\142\56\x6d\157\156\164\x6f\x6e\x65\x74\x6f\51\x20\x46\x52\x4f\x4d\x20\157\160\x65\162\155\x76\40\142\x20\127\110\x45\x52\105\40\142\x2e\144\x6f\143\165\155\145\x6e\x74\157\x3d\x61\56\x64\157\143\x75\x6d\145\x6e\x74\x6f\40\x26\x26\40\142\56\x74\x69\160\x6f\144\157\x63\x3d\141\56\x74\x69\160\x6f\144\157\x63\x29\54\12\x20\40\x20\40\141\x2e\x74\x6f\x74\156\x65\x74\157\x3d\50\x53\105\x4c\x45\x43\x54\40\123\x55\115\50\142\x2e\x6d\157\x6e\164\x6f\x6e\145\x74\157\x29\x20\x46\x52\x4f\115\x20\x6f\x70\x65\x72\155\x76\40\142\40\x57\x48\105\x52\x45\x20\x62\56\x64\x6f\143\165\155\145\x6e\164\157\75\141\56\x64\157\x63\x75\155\145\x6e\x74\157\40\x26\46\40\x62\56\x74\x69\160\157\144\157\143\75\141\56\x74\151\x70\x6f\x64\x6f\143\x29\54\xa\40\40\40\40\x61\x2e\164\157\x74\x69\x6d\x70\x75\145\x73\x74\75\x28\123\x45\x4c\105\103\124\40\x53\125\115\50\111\106\x28\x62\x2e\x74\x69\x6d\160\x75\x65\x70\x72\143\76\x30\x2c\50\x62\56\160\162\x65\143\x69\157\x75\156\x69\164\x2a\x28\x62\x2e\x74\151\155\x70\165\145\x70\x72\x63\x2f\61\60\60\x29\x29\52\x62\56\x63\141\x6e\x74\151\144\141\144\54\x30\x29\x29\x20\x46\x52\x4f\x4d\x20\x6f\x70\x65\x72\x6d\x76\40\x62\40\x57\x48\105\x52\105\x20\142\56\144\157\x63\x75\155\145\156\164\x6f\x3d\141\56\144\157\143\165\x6d\145\156\x74\157\x20\46\x26\x20\142\x2e\x74\151\160\157\144\157\143\75\x61\x2e\x74\151\x70\x6f\x64\157\x63\51\x2c\xa\x20\40\40\40\x61\56\x74\157\164\144\145\163\x63\165\145\156\x3d\x28\x53\x45\114\x45\x43\124\x20\x53\125\x4d\x28\x62\x2e\144\x73\x63\x74\x6f\160\162\143\x2a\x62\x2e\x63\x61\156\x74\151\144\x61\144\51\x20\106\122\x4f\x4d\x20\157\160\x65\x72\155\166\x20\142\x20\127\x48\105\x52\105\40\x62\x2e\x64\157\x63\165\x6d\145\x6e\x74\157\x3d\141\56\x64\x6f\143\x75\x6d\x65\156\164\157\x20\x26\46\40\142\56\x74\x69\x70\157\x64\x6f\143\75\141\x2e\164\151\x70\x6f\x64\157\143\x29\x2c\12\x20\x20\40\40\x61\x2e\x74\x6f\x74\x64\145\163\x63\x75\x65\156\x32\x3d\x28\123\105\x4c\105\x43\124\x20\123\x55\x4d\x28\x62\x2e\x64\x73\143\x74\x6f\x70\162\143\62\52\142\x2e\x63\141\x6e\164\x69\144\x61\x64\x29\40\x46\122\x4f\115\40\x6f\x70\x65\162\x6d\x76\x20\142\x20\x57\x48\x45\122\x45\x20\x62\56\x64\x6f\143\x75\x6d\145\156\164\x6f\75\x61\x2e\144\x6f\x63\x75\x6d\x65\156\164\157\x20\x26\46\40\x62\56\x74\151\x70\x6f\x64\x6f\x63\75\141\56\164\x69\x70\157\x64\157\x63\x29\x2c\xa\40\x20\x20\x20\x61\56\164\157\x74\141\154\x66\x69\156\141\154\75\50\123\105\x4c\105\103\124\x20\123\125\x4d\50\142\56\x6d\x6f\x6e\164\x6f\164\157\164\x61\154\51\x20\x46\122\117\115\40\157\x70\145\x72\x6d\166\x20\x62\x20\127\x48\x45\x52\x45\x20\x62\56\144\157\x63\165\x6d\x65\156\x74\x6f\75\x61\x2e\x64\157\x63\x75\x6d\x65\156\x74\157\40\x26\x26\40\142\56\x74\151\x70\x6f\x64\x6f\x63\x3d\x61\x2e\164\151\x70\157\x64\157\x63\51\54\12\x20\x20\x20\x20\x61\x2e\x62\141\x73\x65\151\x6d\x70\157\61\x3d\50\x53\105\114\105\103\x54\40\123\x55\115\50\151\146\50\x62\56\164\151\155\x70\165\x65\160\x72\x63\x3e\x30\x2c\x62\56\x6d\157\x6e\164\x6f\x6e\x65\164\x6f\x2c\x30\x29\x29\40\x46\122\117\115\40\x6f\x70\x65\162\x6d\166\x20\x62\x20\x57\x48\x45\122\x45\x20\142\x2e\144\157\143\x75\x6d\145\x6e\164\x6f\75\x61\56\x64\157\143\165\155\145\x6e\x74\157\x20\46\x26\x20\x62\56\x74\151\160\x6f\144\157\x63\x3d\141\x2e\164\151\160\157\x64\x6f\143\x29\54\12\40\x20\40\40\141\x2e\163\x69\x6e\151\155\160\x75\145\x73\x74\x3d\50\123\105\114\x45\103\124\x20\123\x55\x4d\x28\x69\x66\x28\142\56\x74\x69\155\160\x75\145\x70\162\143\75\x30\x2c\142\x2e\x6d\157\156\164\157\x6e\145\164\x6f\54\60\x29\x29\40\106\x52\x4f\x4d\40\157\x70\145\x72\x6d\166\x20\x62\x20\x57\110\x45\122\105\40\142\56\x64\157\143\x75\x6d\145\x6e\x74\157\x3d\141\x2e\144\x6f\143\x75\155\145\156\x74\157\x20\x26\x26\40\142\x2e\x74\x69\x70\157\x64\x6f\x63\x3d\x61\x2e\164\151\x70\x6f\144\x6f\143\x29\54\40\xa\x20\40\x20\40\141\56\144\x73\143\164\157\x6c\x69\x6e\x65\x61\x3d\x28\123\x45\x4c\105\103\x54\x20\123\x55\115\50\142\56\x64\x73\143\164\157\x65\156\144\155\x2a\x62\x2e\x63\141\x6e\164\151\x64\141\x64\x29\40\106\x52\x4f\115\40\157\160\145\x72\155\166\40\142\x20\x57\110\x45\122\105\40\x62\56\x64\157\143\x75\x6d\x65\156\164\x6f\75\x61\56\x64\157\x63\x75\155\x65\x6e\x74\x6f\x20\x26\46\40\x62\56\x74\151\x70\157\x64\157\143\x3d\141\56\x74\x69\x70\157\x64\157\143\x29\54\xa\x20\x20\40\40\141\56\x64\163\x63\164\157\x6c\151\x6e\x65\x61\x32\x3d\50\x53\105\114\x45\x43\124\40\123\x55\x4d\x28\142\56\144\163\x63\164\157\145\x6e\x64\155\x32\x2a\x62\56\143\141\156\x74\x69\x64\141\144\x29\40\106\122\x4f\x4d\40\157\x70\145\x72\155\166\x20\x62\x20\x57\x48\105\x52\x45\40\x62\x2e\144\x6f\143\165\x6d\x65\x6e\164\157\75\141\x2e\x64\157\143\x75\x6d\145\x6e\164\157\40\x26\46\x20\x62\56\x74\151\160\157\144\x6f\x63\75\141\x2e\164\151\x70\157\144\x6f\x63\51\54\12\x20\40\40\40\x61\56\x64\x73\143\x74\x6f\154\x69\x6e\145\x61\x33\x3d\x28\123\x45\x4c\105\x43\124\x20\123\x55\x4d\50\142\x2e\144\163\143\x74\157\145\x6e\x64\x6d\63\x2a\x62\56\143\141\156\x74\151\144\x61\x64\x29\x20\106\x52\x4f\115\x20\x6f\160\145\x72\x6d\166\x20\142\x20\x57\x48\x45\122\x45\x20\142\56\144\x6f\143\165\155\x65\156\x74\157\75\141\56\x64\157\143\165\155\x65\x6e\x74\x6f\40\46\46\x20\142\x2e\164\151\x70\157\x64\x6f\x63\75\141\x2e\164\x69\x70\157\x64\157\x63\51\x20\127\110\x45\122\105\x20\141\x2e\x64\157\x63\165\155\145\x6e\164\157\x3d\47{$a}\47\x20\x26\x26\x20\x61\x2e\x74\151\160\157\x64\x6f\x63\75\47{$b}\x27"); } function ajustetotalesnc($a, $b) { $db = $this->db->query("\x53\105\x4c\105\103\x54\x20\162\145\x66\x65\162\145\156\143\151\x61\40\x46\x52\x4f\115\40\157\160\x65\x72\164\x69\x20\x57\110\x45\122\105\40\144\x6f\143\x75\155\x65\x6e\x74\157\75\x27{$a}\x27\x20\x26\46\40\164\x69\160\157\144\x6f\143\75\x27{$b}\x27")->row(); if (intval($db->referencia) < "\65\62\x30\65\x37") { $this->db->query("\125\120\x44\101\x54\105\x20\157\160\x65\x72\155\166\x20\123\105\x54\x20\160\x72\145\143\151\x6f\146\151\x6e\x3d\160\x72\145\143\x69\x6f\165\x6e\x69\x74\53\50\x70\162\145\x63\151\157\x75\156\x69\x74\x2a\x28\164\x69\155\160\165\x65\x70\162\x63\57\61\x30\60\x29\51\40\127\110\x45\122\x45\40\144\157\x63\165\x6d\x65\156\x74\157\75\x27{$a}\x27\x20\46\46\40\164\151\160\x6f\x64\157\x63\75\x27{$b}\x27"); $this->db->query("\x55\120\x44\x41\124\105\x20\x6f\x70\x65\x72\155\x76\40\123\x45\124\40\155\x6f\x6e\164\157\x74\157\164\x61\x6c\x3d\x70\162\145\143\x69\x6f\146\x69\x6e\x2a\143\x6e\x74\144\x65\166\x75\145\154\164\x20\127\x48\x45\x52\x45\40\x64\157\x63\165\155\x65\156\164\x6f\75\47{$a}\47\x20\x26\x26\x20\164\x69\x70\157\144\x6f\143\x3d\x27{$b}\47"); $this->db->query("\125\x50\x44\x41\x54\105\40\157\x70\145\162\164\x69\x20\163\x65\164\x20\x74\157\x74\x61\x6c\146\151\x6e\x61\x6c\75\164\157\164\x61\x6c\x66\151\x6e\x61\154\x2b\164\157\x74\151\x6d\x70\x75\145\x73\x74\x20\x57\110\x45\122\105\40\162\145\146\x65\x72\145\156\143\x69\141\75\x27{$db->referencia}\47\40\46\46\x20\x74\151\x70\x6f\x64\157\143\x3d\x27\x4e\x2f\103\47\x20\46\46\40\x74\x6f\x74\141\x6c\146\151\x6e\x61\x6c\75\x74\157\164\156\x65\164\x6f\x20\46\x26\x20\164\x6f\x74\x69\x6d\x70\x75\x65\x73\x74\76\x30"); $this->db->query("\x55\x50\104\x41\x54\x45\x20\x64\x65\x76\157\154\x74\151\40\163\x65\164\x20\x74\157\164\x61\x6c\x66\x69\156\x61\x6c\x3d\x74\157\x74\x61\x6c\146\151\x6e\x61\154\53\x74\157\164\151\155\x70\165\145\x73\164\x20\127\110\x45\x52\x45\40\162\145\x66\145\x72\145\x6e\143\151\141\75\47{$db->referencia}\47\40\46\46\40\x74\151\x70\x6f\x64\x6f\143\75\47\x44\105\x56\x27\x20\x26\x26\40\x74\x6f\x74\141\x6c\x66\151\x6e\141\x6c\x3d\x74\157\164\156\145\x74\157\x20\46\x26\x20\164\157\164\x69\155\160\x75\x65\x73\x74\x3e\60"); } } function promoprov($a, $b) { $bd = $this->db->query("\123\x45\114\x45\103\x54\x20\143\x2e\143\157\x64\151\x67\157\x2c\40\xa\40\40\40\111\106\x28\x53\x55\115\50\141\x2e\143\141\156\x74\x69\144\x61\x64\51\x3e\75\x63\x2e\x76\157\154\x20\46\46\40\123\x55\x4d\x28\x61\x2e\x63\141\x6e\x74\x69\144\141\x64\51\74\143\x2e\x76\157\154\x32\54\x63\x2e\144\145\x73\x63\165\54\111\106\x28\123\x55\115\50\141\56\143\x61\156\x74\x69\x64\141\x64\51\x3e\75\143\x2e\166\x6f\154\x32\x20\46\46\x20\123\125\x4d\x28\141\x2e\x63\x61\156\x74\151\x64\x61\144\x29\x3c\x63\x2e\x76\x6f\154\63\54\143\x2e\x64\x65\163\143\165\x32\54\12\x20\40\x20\x49\106\x28\x53\x55\115\x28\x61\x2e\x63\x61\x6e\x74\x69\144\x61\144\51\76\75\x63\56\166\157\x6c\x33\x20\x26\x26\x20\123\125\x4d\x28\x61\x2e\x63\x61\x6e\164\151\x64\x61\x64\x29\x3c\x63\x2e\166\157\x6c\x34\x2c\143\56\x64\x65\163\143\165\x33\54\x49\106\50\x53\x55\x4d\50\x61\x2e\x63\x61\156\x74\151\144\141\x64\x29\x3e\x3d\x63\x2e\x76\157\154\64\40\46\46\x20\123\x55\x4d\x28\141\56\x63\141\156\x74\151\x64\141\144\51\x3c\143\x2e\x76\157\x6c\x35\x2c\x63\56\x64\x65\163\x63\165\64\54\111\x46\x28\x53\125\115\50\141\x2e\x63\141\156\164\x69\x64\x61\144\51\x3e\75\143\56\166\x6f\x6c\x35\54\x63\56\x64\145\163\x63\165\x35\x2c\x30\51\x29\51\51\x29\40\x64\145\x73\x63\165\40\12\40\x20\40\40\40\40\106\x52\117\x4d\40\157\x70\x65\x72\x6d\x76\40\x61\40\xa\x20\x20\x20\x20\40\x20\112\x4f\x49\116\x20\x61\x72\x74\x69\x70\x72\157\166\40\x62\x20\x4f\x4e\x20\x61\56\x63\x6f\x64\151\x67\x6f\x3d\x62\x2e\143\x6f\x64\x69\x67\157\x20\12\x20\40\x20\40\40\x20\112\117\x49\x4e\40\x70\162\157\x76\x65\x65\144\x20\143\x20\117\x4e\40\x62\56\160\162\157\x76\145\145\x64\x6f\162\75\x63\x2e\143\157\144\151\147\x6f\40\xa\40\x20\40\40\40\x20\127\110\105\x52\105\40\x61\x2e\x64\x6f\143\165\155\x65\x6e\x74\x6f\x3d\x27{$a}\47\40\x26\x26\x20\x61\x2e\164\x69\160\x6f\x64\157\143\x3d\47{$b}\x27\40\x47\x52\x4f\125\120\x20\x42\131\40\x63\56\143\157\x64\x69\147\157\x20\x48\101\x56\111\116\107\40\144\145\163\x63\x75\x3e\60\x3b\xa\x20\40\40\xa\x20\x20\40\xa\x20\40\40")->result(); foreach ($bd as $db) { $this->db->query("\125\x50\104\x41\x54\x45\40\157\160\x65\x72\155\x76\40\x61\61\40\112\x4f\x49\x4e\40\x61\162\164\x69\160\162\157\x76\x20\x62\x31\40\x4f\116\40\50\141\x31\x2e\x63\157\144\x69\147\157\75\x62\61\56\x63\x6f\144\x69\147\157\40\46\46\40\x62\61\56\x6d\x61\162\143\x61\75\x31\x29\40\x53\105\x54\40\141\61\x2e\x64\x73\143\x74\x6f\x65\156\144\160\x32\x3d\x27{$db->descu}\x27\x20\127\110\x45\122\105\40\141\x31\56\144\157\x63\165\155\x65\156\164\157\x3d\x27{$a}\47\40\46\x26\x20\x61\x31\56\164\x69\160\157\144\157\x63\75\x27{$b}\47\x20\x26\46\40\x20\142\61\56\160\162\157\166\145\145\x64\x6f\162\x3d\x27{$db->codigo}\x27\73"); } } function promofac($a, $b) { $cli = $this->db->query("\x53\105\x4c\105\103\x54\40\x63\157\144\143\x6c\x69\x65\156\x74\x65\40\x46\122\117\115\x20\157\160\145\x72\x74\151\x20\127\x48\105\122\105\40\144\x6f\143\x75\155\x65\156\x74\157\75\x27{$a}\47\x20\x26\46\40\164\x69\160\157\x64\157\143\x3d\x27{$b}\x27")->row()->codcliente; $promo = $this->db->query("\123\x45\114\105\x43\x54\40\x64\x65\163\x63\x75\x2c\103\117\125\x4e\x54\50\52\x29\40\151\x74\x65\x6d\40\x46\x52\x4f\115\40\160\x72\x6f\x6d\157\x73\40\x57\110\x45\x52\x45\x20\146\144\x65\163\x64\x65\74\x3d\116\117\x57\x28\51\x20\x26\46\40\116\x4f\x57\50\51\x3c\x3d\x66\150\141\163\164\x61\40\46\46\x20\143\154\151\75\47{$cli}\x27\40\114\111\x4d\111\124\x20\61")->row(); if ($promo->item > 0) { $this->db->query("\x55\x50\104\x41\x54\105\x20\x6f\160\x65\162\155\166\x20\123\105\x54\x20\144\x73\143\164\157\x65\156\144\160\x33\75\47{$promo->descu}\47\40\127\x48\105\x52\x45\40\x64\x6f\143\165\155\145\156\164\157\75\47{$a}\x27\x20\46\x26\x20\164\x69\160\157\x64\157\143\75\47{$b}\47"); } } function elimfac($a) { $bd = $this->db->query("\123\105\114\x45\103\124\40\143\x6f\144\x69\147\x6f\x2c\143\x61\156\164\151\144\141\x64\40\x46\122\117\x4d\x20\157\x70\x65\162\x6d\x76\40\x57\110\105\122\x65\40\144\x6f\143\x75\x6d\145\156\x74\x6f\75\47{$a}\47")->result(); $i = 0; foreach ($bd as $db) { $art = $this->db->query("\x53\105\x4c\x45\103\x54\40\143\x6f\x6d\x70\x72\x6f\x6d\x65\164\151\x64\157\x20\106\122\x4f\115\40\141\x72\x74\151\x63\x75\x6c\x6f\40\127\x48\x45\122\x45\40\x63\157\x64\151\147\x6f\75\x27{$db->codigo}\47")->row(); $comp = $art->comprometido - $db->cantidad; $this->db->query("\125\120\104\x41\x54\105\x20\141\162\x74\x69\x63\165\154\x6f\40\x73\x65\x74\x20\143\157\x6d\160\x72\x6f\155\145\164\151\x64\157\x3d\47{$comp}\x27\40\127\110\105\x52\x45\x20\x63\x6f\x64\151\147\157\x3d\x27{$db->codigo}\x27"); if ($this->db->affected_rows() > 0) { $i++; } } if ($i > 0) { $this->db->where("\x64\157\x63\165\155\145\156\x74\x6f", $a)->delete("\x6f\160\x65\x72\x74\x69"); $this->db->where("\x64\x6f\143", $a)->delete("\x63\x6f\156\164\x72\x6f\x6c\x5f\x6f\x70\145\162\164\x69"); $this->db->where("\x64\x6f\143\x75\155\145\156\164\157", $a)->delete("\157\x70\145\162\x6d\x76"); $this->loguser("\x45\x6c\x69\155\x69\156\141\x72", "\105\154\x20\x75\x73\165\x61\162\x69\157\40\x65\x6c\151\155\151\x6e\141\x20\x65\x6c\x20\160\x65\144\x69\x64\157\40" . $a . "\56"); return $this->db->affected_rows(); } } function ajustelotes() { $lot = $this->db->query("\123\x45\114\x45\103\124\40\x61\154\x6d\x61\143\145\156\x2c\x63\x6f\x64\151\147\x6f\141\x72\164\54\156\157\155\142\x72\x65\54\154\x6f\x74\145\54\143\141\162\x67\157\53\x63\141\x72\147\x6f\x32\x20\x63\141\x72\x67\157\x2c\144\145\x73\143\x61\x72\x67\157\53\144\x65\163\x63\x61\162\147\157\62\40\x64\x65\163\x63\x61\162\x67\x6f\54\151\156\x67\x72\x65\x73\157\54\145\147\162\x65\x73\x6f\x2c\x64\145\166\x75\x65\x6c\x74\141\x2c\40\111\106\x28\x28\x63\x61\x72\x67\x6f\x2b\x63\x61\x72\147\x6f\62\55\144\145\x73\143\141\162\x67\x6f\x2d\x64\x65\163\x63\141\x72\x67\x6f\62\x2b\151\x6e\x67\x72\145\x73\157\55\145\x67\162\145\x73\x6f\53\144\145\166\x75\145\x6c\x74\x61\51\76\x30\54\50\x63\141\162\x67\x6f\53\x63\141\162\x67\x6f\62\55\x64\145\x73\x63\141\162\147\x6f\55\x64\145\x73\143\x61\162\147\x6f\x32\53\x69\x6e\147\162\x65\163\x6f\x2d\145\x67\162\x65\x73\157\x2b\144\x65\x76\x75\145\154\x74\141\x29\54\60\x29\40\x65\170\151\x73\164\x65\x6e\x2c\145\x78\151\163\164\141\x72\164\54\x63\157\156\x73\x75\155\x69\144\157\x20\106\122\x4f\115\x20\x28\xa\40\x20\x20\40\x20\40\x20\40\123\105\114\105\x43\x54\40\141\56\x61\154\155\141\x63\145\156\54\x61\x2e\x63\157\x64\151\147\157\141\162\164\x2c\142\x2e\156\x6f\x6d\142\x72\x65\x2c\x61\56\x6c\x6f\164\x65\54\12\x20\40\x20\40\x20\x20\x20\40\x49\106\50\50\123\105\114\x45\x43\x54\x20\123\x55\115\x28\143\141\x6e\x74\51\40\106\x52\x4f\x4d\40\141\x6a\x75\x73\x74\x65\x69\156\166\x20\127\x48\105\x52\x45\40\x64\141\x6c\x6d\75\x61\56\141\x6c\x6d\x61\x63\x65\x6e\x20\x26\46\40\143\x6f\144\151\147\x6f\x3d\x61\x2e\x63\157\144\151\147\157\141\x72\164\40\46\x26\40\144\x6c\157\x74\x65\x3d\x61\x2e\x6c\x6f\x74\145\40\46\46\40\x74\151\160\157\75\x31\40\46\x26\x20\146\145\143\150\76\x27\62\60\62\63\55\61\62\x2d\62\x39\x27\51\76\x30\54\x28\x53\x45\x4c\105\103\124\x20\123\x55\115\x28\x63\141\156\164\x29\x20\x46\122\x4f\x4d\x20\141\152\165\x73\164\145\x69\156\x76\x20\127\x48\105\122\105\40\144\141\154\155\75\141\56\x61\x6c\155\x61\x63\145\156\40\x26\x26\x20\x63\x6f\x64\151\x67\x6f\x3d\x61\x2e\x63\157\144\x69\x67\x6f\141\162\x74\40\x26\46\x20\x64\154\x6f\164\145\75\x61\x2e\x6c\x6f\x74\145\x20\46\46\x20\x74\151\x70\x6f\75\x31\x20\x26\x26\40\146\x65\x63\x68\x3e\47\x32\x30\x32\63\x2d\61\x32\55\x32\71\47\51\x2c\60\51\x20\x63\x61\162\147\x6f\54\xa\x20\40\40\40\x20\x20\40\x20\x49\x46\50\50\x53\105\x4c\x45\x43\x54\x20\x53\125\115\x28\143\141\x6e\x74\51\40\x46\x52\117\x4d\40\141\x6a\x75\x73\164\x65\x69\x6e\x76\x20\x57\x48\105\122\x45\40\144\141\154\x6d\x3d\141\x2e\141\154\x6d\x61\x63\145\x6e\40\46\46\x20\143\157\x64\x69\147\x6f\x3d\141\56\143\x6f\x64\151\x67\x6f\x61\162\x74\x20\46\x26\40\x64\154\x6f\164\145\x3d\141\56\x6c\157\164\x65\40\x26\x26\x20\x74\x69\x70\157\x3d\63\x20\x26\46\40\x66\145\143\150\76\x27\x32\60\x32\x33\x2d\61\x32\x2d\62\71\x27\51\x3e\60\54\50\x53\105\x4c\x45\103\124\40\123\125\x4d\50\143\x61\x6e\x74\x29\x20\106\x52\x4f\x4d\40\141\152\x75\x73\x74\145\x69\156\x76\x20\x57\x48\x45\x52\105\40\x64\x61\154\x6d\x3d\141\x2e\x61\154\x6d\141\x63\145\x6e\x20\46\x26\40\143\157\144\151\x67\157\75\x61\56\143\x6f\144\x69\x67\157\141\162\164\40\46\46\x20\x64\x6c\x6f\x74\x65\75\x61\x2e\154\x6f\164\x65\40\x26\46\40\164\x69\160\157\x3d\63\40\46\46\x20\146\145\x63\x68\76\47\x32\x30\62\x33\x2d\61\x32\x2d\x32\71\47\51\54\60\x29\x20\143\141\x72\x67\157\62\x2c\xa\40\x20\x20\x20\40\40\x20\x20\x49\106\50\50\x53\x45\x4c\x45\x43\124\x20\x53\x55\115\50\143\141\156\x74\x29\x20\106\122\x4f\x4d\x20\x61\x6a\x75\x73\164\145\151\156\x76\40\127\x48\105\122\105\x20\144\x61\154\155\x3d\x61\x2e\x61\x6c\155\x61\143\x65\156\x20\x26\x26\40\143\x6f\x64\x69\147\157\x3d\x61\56\x63\157\144\x69\147\157\x61\x72\164\x20\46\x26\40\x64\154\x6f\164\145\x3d\141\x2e\x6c\x6f\164\x65\40\46\46\40\164\x69\x70\x6f\75\60\x20\46\x26\x20\x66\x65\143\150\76\x27\62\60\x32\63\x2d\61\x32\55\62\x39\47\x29\x3e\60\x2c\50\x53\x45\x4c\105\x43\x54\x20\123\125\x4d\50\143\x61\x6e\164\51\40\x46\x52\x4f\115\x20\x61\x6a\165\163\164\145\151\156\166\x20\x57\x48\105\x52\105\x20\144\x61\x6c\155\x3d\141\x2e\141\x6c\x6d\141\143\x65\x6e\40\46\46\40\143\157\144\151\x67\x6f\75\x61\x2e\143\157\x64\x69\x67\157\x61\162\164\x20\x26\46\40\x64\x6c\157\164\145\x3d\x61\56\x6c\157\164\145\x20\46\x26\40\x74\x69\160\x6f\x3d\x30\x20\46\46\x20\146\145\x63\x68\76\x27\x32\x30\x32\x33\55\x31\x32\x2d\62\71\x27\x29\54\60\x29\x20\x64\145\x73\x63\x61\162\147\157\54\12\40\40\x20\40\40\x20\x20\40\x49\106\x28\x28\x53\105\114\105\103\124\x20\123\125\115\x28\143\141\x6e\x74\51\40\106\122\117\x4d\40\141\152\x75\163\x74\145\151\156\x76\x20\x57\110\x45\x52\105\x20\141\154\155\x3d\141\x2e\141\x6c\x6d\141\143\145\x6e\x20\x26\x26\x20\x63\x6f\x64\151\147\157\75\141\56\143\157\144\x69\147\x6f\x61\x72\164\40\x26\x26\x20\154\x6f\x74\x65\75\x61\x2e\154\x6f\x74\145\40\46\x26\x20\x74\x69\160\157\75\63\x20\46\46\40\x66\x65\x63\150\x3e\x27\62\60\x32\63\55\x31\x32\x2d\x32\71\47\51\76\x30\54\50\x53\105\x4c\105\103\x54\40\123\125\115\50\143\141\x6e\164\x29\40\106\122\x4f\x4d\40\x61\x6a\x75\x73\x74\x65\x69\156\x76\40\127\110\105\122\105\x20\x61\x6c\155\x3d\x61\56\141\154\155\x61\143\145\156\40\x26\46\40\x63\x6f\144\x69\147\157\x3d\141\56\x63\157\144\x69\x67\x6f\x61\x72\164\40\46\x26\x20\154\x6f\164\x65\75\141\x2e\x6c\x6f\x74\x65\40\x26\x26\40\x74\x69\x70\157\x3d\x33\40\46\46\x20\x66\x65\143\150\x3e\x27\x32\60\62\63\x2d\61\x32\x2d\62\x39\47\x29\54\x30\x29\40\144\145\163\x63\141\x72\x67\157\62\54\xa\40\40\40\x20\40\40\40\40\111\x46\50\x28\x53\x45\114\105\103\124\40\x53\125\x4d\50\x63\x61\x6e\x74\51\x20\x46\122\117\x4d\40\151\x74\x6f\x72\x64\x63\40\x61\x31\40\112\x4f\x49\x4e\x20\x6f\x72\x64\143\40\x62\x31\40\117\x4e\40\141\x31\56\x6f\x72\x64\x63\x3d\x62\61\56\151\x64\40\127\110\105\x52\x45\40\142\x31\x2e\x61\154\x6d\x61\x63\145\x6e\75\141\56\x61\154\155\x61\143\x65\156\x20\x26\46\x20\x61\x31\56\143\x6f\x64\151\x67\157\75\141\56\143\157\x64\151\147\157\x61\x72\164\x20\x26\46\x20\154\x6f\x74\145\75\x61\56\x6c\157\x74\x65\40\46\x26\x20\x62\61\56\146\x72\x65\143\x65\160\76\x27\x32\60\62\63\55\x31\x32\x2d\x32\x39\47\40\x26\46\x20\x62\61\x2e\163\164\141\164\165\x73\x3d\x27\61\47\51\76\x30\54\50\123\x45\x4c\x45\103\124\40\123\x55\115\50\143\x61\x6e\x74\x29\40\x46\122\117\115\x20\151\164\157\x72\144\x63\40\141\x31\40\x4a\117\x49\x4e\x20\157\x72\144\x63\x20\142\x31\x20\117\x4e\x20\x61\x31\x2e\157\162\144\x63\75\x62\61\56\151\x64\40\x57\x48\x45\122\105\x20\142\61\56\141\154\155\141\143\145\156\x3d\141\x2e\x61\154\155\141\143\145\156\40\46\x26\x20\141\x31\56\143\157\x64\x69\147\x6f\75\x61\56\x63\157\144\x69\147\157\141\162\164\40\x26\x26\40\154\x6f\164\x65\x3d\141\56\x6c\x6f\x74\x65\x20\46\x26\x20\142\x31\x2e\x66\x72\145\143\145\x70\76\x27\x32\x30\62\63\x2d\x31\62\55\62\x39\47\x20\x26\46\x20\142\x31\56\163\164\141\x74\165\x73\75\x27\61\47\x29\54\x30\x29\x20\x69\x6e\147\x72\145\x73\x6f\54\xa\x20\x20\40\x20\40\x20\40\x20\x52\x4f\x55\x4e\x44\50\111\106\x28\50\123\105\x4c\105\x43\124\x20\x53\x55\115\50\143\141\x6e\x74\x69\x64\x61\x64\x29\x20\x46\x52\117\x4d\40\x6f\160\145\162\x6d\x76\40\x57\x48\105\122\x45\40\x61\154\155\141\x63\x65\x6e\75\x61\56\x61\x6c\155\141\143\145\x6e\40\46\x26\x20\x63\x6f\x64\151\x67\157\x3d\141\56\143\157\x64\151\147\157\x61\x72\x74\x20\x26\x26\40\x6c\x6f\164\x65\x3d\x61\x2e\154\157\164\x65\x20\x26\x26\x20\x28\x74\x69\160\x6f\x64\x6f\x63\x3d\47\106\x41\x43\47\x20\x7c\174\40\164\x69\160\157\144\157\x63\x3d\x27\x4e\x4f\124\x27\x29\40\46\46\40\x66\x65\143\x68\x61\x64\x6f\x63\76\47\62\x30\x32\63\x2d\x31\x32\x2d\62\71\47\x29\76\x30\54\x28\123\x45\114\x45\103\x54\x20\x53\125\115\50\x63\x61\156\164\151\144\x61\x64\51\x20\x46\x52\117\115\40\157\x70\x65\x72\x6d\166\x20\127\x48\105\122\x45\40\x61\154\155\141\x63\x65\x6e\x3d\141\56\x61\x6c\x6d\x61\143\x65\x6e\40\46\46\x20\143\x6f\x64\151\147\157\x3d\141\x2e\143\157\144\151\x67\x6f\141\162\164\40\46\x26\40\154\157\164\145\x3d\x61\x2e\x6c\x6f\164\145\x20\x26\x26\40\50\x74\151\160\x6f\x64\x6f\143\75\47\106\x41\103\47\40\174\174\40\164\x69\x70\157\144\x6f\x63\75\47\x4e\x4f\124\47\51\x20\x26\46\x20\x66\x65\143\150\141\x64\157\143\x3e\47\62\60\62\63\55\x31\x32\55\62\71\47\51\x2c\x30\x29\54\x30\51\40\x65\147\162\145\x73\x6f\x2c\xa\40\40\40\40\x20\40\40\40\x52\x4f\x55\116\x44\x28\x49\x46\50\50\x53\105\114\x45\x43\124\x20\123\x55\115\50\x63\156\x74\x64\145\x76\x75\x65\x6c\164\51\x20\x46\x52\117\115\40\x64\145\x76\157\154\155\x76\40\x57\x48\x45\x52\105\x20\141\154\x6d\x61\143\x65\x6e\75\x61\x2e\141\x6c\x6d\141\143\145\156\x20\x26\x26\40\x63\x6f\144\151\x67\157\x3d\141\x2e\x63\x6f\x64\x69\147\x6f\x61\162\164\40\46\x26\x20\154\x6f\x74\x65\75\141\x2e\154\157\164\145\x20\x26\x26\x20\x74\x69\160\x6f\x64\157\143\75\47\104\x45\x56\47\40\x26\x26\x20\x66\x65\x63\150\141\144\157\143\x3e\47\x32\x30\x32\63\x2d\x31\62\55\62\x39\x27\51\x3e\60\54\x28\123\x45\114\105\x43\124\40\123\x55\115\50\x63\x6e\164\144\x65\166\x75\145\154\164\x29\x20\106\122\x4f\x4d\40\x64\x65\166\157\x6c\x6d\x76\40\x57\110\x45\x52\105\x20\x61\x6c\x6d\x61\x63\x65\x6e\x3d\x61\x2e\x61\x6c\x6d\x61\x63\x65\x6e\40\46\x26\x20\143\x6f\144\151\147\157\x3d\141\56\x63\157\144\151\147\x6f\141\162\164\x20\46\46\40\154\157\164\x65\75\x61\56\154\x6f\x74\x65\40\46\x26\x20\164\x69\160\x6f\144\x6f\x63\x3d\x27\104\x45\126\47\40\46\46\x20\146\145\x63\x68\141\144\x6f\x63\76\47\x32\x30\62\x33\x2d\61\62\55\62\71\47\x29\x2c\60\x29\x2c\x30\x29\x20\x64\x65\166\165\x65\x6c\164\x61\x2c\xa\x20\40\x20\x20\40\40\40\x20\x61\x2e\143\141\156\164\x69\x64\141\144\x2d\x61\x2e\143\157\x6e\163\165\155\x69\x64\x6f\x20\x65\x78\151\x73\x74\141\x72\x74\x2c\x20\141\x2e\143\x6f\x6e\163\165\155\x69\144\x6f\xa\40\40\x20\40\40\40\x20\40\x46\122\117\x4d\40\141\x72\x74\x69\x6c\x6f\x74\x65\x73\40\x61\40\x4a\x4f\x49\116\x20\x61\162\164\151\143\165\154\157\x20\142\x20\x4f\x4e\40\141\x2e\x63\157\x64\151\x67\x6f\141\162\164\75\142\56\143\x6f\x64\x69\147\x6f\40\107\122\117\x55\x50\40\x42\x59\40\141\56\x61\x6c\155\x61\x63\x65\x6e\54\x61\56\x63\x6f\x64\151\147\157\141\x72\x74\x2c\x61\56\154\157\x74\145\51\x20\x6b\141\x72\x64\145\170\40\150\x61\x76\x69\156\x67\40\x65\x78\x69\x73\164\x65\156\41\75\x65\170\x69\163\164\141\x72\x74")->result(); $i = 0; foreach ($lot as $dlot) { if ($dlot->existen > $dlot->existart) { $cant = $dlot->existen - $dlot->existart; $this->db->query("\x55\x50\x44\101\124\105\40\x61\x72\x74\x69\154\157\164\145\x73\40\123\105\124\40\143\x61\x6e\164\x69\144\x61\x64\75\x63\x61\x6e\164\151\x64\x61\x64\53{$cant}\40\127\x48\105\122\105\40\141\154\x6d\x61\143\x65\x6e\x3d\47{$dlot->almacen}\47\x20\46\x26\x20\143\x6f\144\151\147\157\141\x72\x74\x3d\x27{$dlot->codigoart}\47\40\x26\46\40\x6c\x6f\x74\145\75\x27{$dlot->lote}\x27"); if ($this->db->affected_rows() > 0) { $i++; } } elseif ($dlot->existart > $dlot->existen) { $cant = $dlot->existart - $dlot->existen; $this->db->query("\125\120\104\x41\x54\105\40\141\162\x74\151\154\157\164\145\x73\x20\123\105\124\40\143\157\x6e\x73\165\x6d\151\x64\157\x3d\x63\157\x6e\x73\x75\155\x69\144\157\x2b{$cant}\40\127\x48\x45\x52\105\x20\x61\154\x6d\141\x63\145\156\x3d\x27{$dlot->almacen}\x27\40\46\46\x20\x63\157\144\151\147\x6f\141\162\x74\75\47{$dlot->codigoart}\47\40\46\x26\x20\x6c\x6f\x74\x65\x3d\x27{$dlot->lote}\47"); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } function ajustearti() { $this->ajustelotes(); $this->db->query("\x55\x50\x44\x41\x54\x45\40\x61\162\164\151\x6c\157\x74\145\163\x20\141\x20\123\105\x54\40\x63\x6f\x6e\x73\165\155\151\x64\157\x3d\143\141\x6e\164\151\144\141\x64\40\x57\110\x45\x52\105\40\143\157\156\163\165\x6d\151\144\157\76\x63\141\x6e\x74\x69\x64\x61\144\x3b"); $this->db->query("\125\x50\104\x41\x54\x45\x20\x61\x72\164\x69\x63\x75\154\x6f\x20\x53\105\x54\40\143\157\155\160\162\x6f\x6d\x65\x74\x69\144\157\75\x30\40\127\x48\x45\122\105\40\143\x6f\155\x70\x72\157\x6d\x65\164\151\x64\157\x3e\60\x20\46\x26\x20\x63\157\144\x69\147\x6f\x20\x4e\117\x54\40\x49\116\40\x28\x53\x45\x4c\x45\x43\x54\40\x63\x6f\x64\x69\147\x6f\40\106\x52\x4f\115\x20\x6f\160\x65\162\155\x76\x20\127\x48\105\x52\x45\x20\164\151\x70\x6f\x64\x6f\x63\75\x27\x45\123\x50\x27\x29\73"); $this->db->query("\x55\x50\x44\x41\124\x45\40\141\162\164\x69\x63\165\154\x6f\40\x53\x45\124\40\x63\157\x6d\x70\x72\157\x6d\x65\164\151\x64\157\x3d\x30\x20\127\x48\x45\122\105\x20\x63\x6f\155\x70\162\157\155\x65\164\x69\144\157\x3c\x30\x3b"); $this->db->query("\104\x45\x4c\x45\124\x45\40\106\x52\117\115\40\141\x72\164\x69\x70\162\157\166\40\127\110\x45\122\x45\40\x63\x6f\x64\x69\147\x6f\40\116\x4f\124\40\x49\116\40\x28\x53\105\114\x45\103\124\x20\143\x6f\144\151\147\157\40\x46\122\117\115\40\x61\x72\x74\151\x63\165\154\157\51"); $this->db->query("\104\x45\x4c\x45\x54\105\40\x46\122\117\x4d\40\141\162\164\x69\x6c\x6f\x74\x65\163\x20\127\x48\105\122\105\40\143\x6f\144\x69\x67\x6f\x61\x72\x74\40\x4e\117\x54\x20\111\x4e\40\x28\x53\105\114\x45\x43\124\40\x63\x6f\144\151\147\157\40\x46\122\117\115\40\141\x72\164\151\143\x75\x6c\x6f\x29"); $art = $this->db->query("\x53\x45\114\105\103\124\40\141\x2e\x63\157\144\151\x67\x6f\x2c\x49\x46\50\x28\x53\x55\x4d\50\142\56\143\x61\x6e\164\151\144\141\144\x29\55\123\x55\115\50\142\x2e\143\x6f\x6e\163\165\x6d\151\144\x6f\51\51\76\x30\54\123\125\x4d\50\x62\x2e\x63\x61\156\x74\151\x64\x61\144\x29\x2d\x53\x55\115\x28\x62\x2e\x63\157\x6e\x73\x75\155\151\144\x6f\x29\54\60\51\40\x64\151\x73\x70\x20\12\40\x20\x20\40\106\x52\x4f\115\x20\141\x72\x74\x69\x63\x75\x6c\157\x20\141\40\112\x4f\111\x4e\40\141\162\164\x69\x6c\157\x74\x65\163\40\x62\40\117\116\40\141\x2e\x63\x6f\x64\151\x67\x6f\x3d\142\x2e\143\157\x64\x69\147\157\x61\162\x74\40\x47\122\117\125\120\x20\x42\131\x20\x61\x2e\x63\x6f\x64\151\x67\x6f")->result(); $i = 0; foreach ($art as $dart) { $this->db->query("\x55\120\104\x41\124\x45\40\141\x72\x74\x69\x63\x75\x6c\157\40\123\x45\124\x20\x65\170\151\x73\164\x65\156\x63\151\x61\75\47{$dart->disp}\47\x20\x57\x48\x45\x52\105\x20\143\157\144\x69\147\x6f\x3d\47{$dart->codigo}\x27"); if ($this->db->affected_rows() > 0) { $i++; } } return $i; } function ajusteordc() { $val = $this->db->query("\123\x45\x4c\105\x43\124\40\x62\56\x63\x6f\x64\151\147\157\54\x62\56\x6c\157\x74\145\x2c\142\x2e\145\x6c\141\142\54\x62\56\x76\145\156\143\x65\x2c\142\56\143\141\156\x74\54\141\x2e\x61\x6c\155\141\x63\x65\156\x2c\x61\56\x70\162\x6f\x76\x65\x65\144\40\106\122\x4f\115\x20\x6f\162\144\x63\40\x61\x20\112\117\111\116\40\151\x74\x6f\x72\144\143\x20\x62\x20\117\116\40\141\56\151\144\x3d\x62\56\157\x72\144\x63\x20\40\x57\x48\105\122\105\40\141\x2e\140\163\164\x61\x74\x75\x73\x60\75\47\x31\x27\x20\46\46\40\142\56\140\163\x74\x61\x74\165\x73\140\75\47\61\47\x20\46\46\x20\142\x2e\154\157\x74\145\40\x4e\x4f\x54\40\111\116\x20\x28\x53\105\114\105\103\124\x20\154\157\164\x65\40\106\122\x4f\x4d\x20\141\162\164\151\154\x6f\164\x65\x73\40\x57\110\105\x52\105\x20\143\157\144\x69\147\x6f\141\162\x74\x3d\142\x2e\x63\157\144\151\147\x6f\x29"); if ($val->num_rows() > 0) { $i = 0; foreach ($val->result() as $dval) { $i++; $this->ajusteordcinv($dval->codigo, $dval->lote, $dval->elab, $dval->vence, $dval->cant, $dval->costo, $dval->almacen, $dval->proveed); } } if ($i <= 0) { $val2 = $this->db->query("\x53\105\x4c\105\x43\x54\40\x61\56\143\x6f\144\151\147\x6f\x2c\141\56\x6c\x6f\164\x65\x2c\141\x2e\x65\154\x61\x62\54\x61\56\x76\x65\x6e\x63\145\x2c\141\56\x63\x61\156\x74\x2c\141\x2e\143\x6f\x73\x74\x6f\54\142\x2e\141\154\155\141\143\x65\x6e\x2c\x62\x2e\x70\162\x6f\166\x65\x65\x64\40\x46\122\x4f\115\40\x69\164\157\x72\144\x63\x20\141\40\112\x4f\x49\x4e\40\157\162\144\x63\x20\x62\x20\x4f\116\x20\141\56\157\x72\x64\x63\75\x62\56\x69\x64\x20\12\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\40\127\110\x45\122\x45\40\141\56\140\163\x74\141\164\165\163\140\x3d\61\40\x26\46\40\x62\x2e\140\x73\x74\141\x74\165\x73\140\x3d\47\x31\x27\40\x26\46\40\x61\56\143\157\x64\151\147\157\40\x4e\117\124\40\x49\116\40\x28\x53\105\x4c\x45\x43\x54\40\143\x6f\x64\151\147\157\141\x72\x74\40\106\122\117\115\x20\x61\x72\x74\x69\x6c\157\164\x65\x73\40\127\x48\105\x52\105\x20\x63\x6f\144\x69\x67\x6f\75\x61\x2e\143\x6f\x64\x69\x67\157\40\x26\46\40\154\x6f\x74\x65\75\x61\x2e\x6c\157\164\145\x20\46\x26\x20\x72\x65\143\x65\160\143\x69\157\x6e\76\x3d\x62\x2e\146\162\x65\x63\145\160\51"); if ($val2->num_rows() > 0) { foreach ($val2->result() as $dval) { $i++; $this->ajusteordcinv($dval->codigo, $dval->lote, $dval->elab, $dval->vence, $dval->cant, $dval->costo, $dval->almacen, $dval->proveed); } } } return $i; } public function clientesexcel($a) { $trab = $this->session->userdata("\143\157\144"); $bdcli = $this->db->query("\x53\x45\x4c\x45\103\x54\x20\104\x49\x53\x54\x49\116\103\124\40\141\56\143\157\144\x69\147\157\x2c\x20\141\x2e\x6e\x6f\155\x62\162\x65\54\141\x2e\x73\x75\x63\x75\x72\163\x61\154\x2c\40\x62\x2e\x6e\x6f\x6d\x62\x72\145\40\x6e\x6f\x6d\142\x72\145\x76\x20\106\x52\x4f\115\40\143\154\151\x65\155\x70\162\x65\40\x61\40\112\x4f\x49\116\40\154\151\x73\x74\x76\145\x6e\x64\x20\142\40\117\116\40\141\x2e\x76\145\x6e\144\x65\x64\x6f\162\75\x62\x2e\143\157\144\x69\147\x6f\x20\127\110\105\x52\105\40\141\56\x73\x74\141\x74\165\x73\x3d\47\x31\47")->result(); $html = "\x3c\151\156\160\x75\x74\x20\x74\171\160\145\75\42\164\145\170\164\x22\40\x63\154\141\163\x73\75\42\x77\63\55\151\156\x70\165\164\x22\x20\151\144\75\42\x69\x64\x63\154\151\x22\40\x6f\x6e\x63\x68\x61\x6e\x67\x65\75\x22\143\162\x65\144\151\143\154\151\50\51\x3b\42\x20\x6c\151\163\x74\75\42\154\x69\163\164\x63\154\x69\x22\40\160\154\141\x63\x65\x68\157\x6c\x64\145\162\75\x22\103\x6f\x64\x69\147\157\x20\144\145\x20\143\154\x69\x65\156\x74\x65\x22\x20\166\x61\154\165\x65\75\42" . $a . "\x22\40\x2f\76\xa\x20\40\40\40\74\144\x61\164\x61\x6c\x69\163\164\x20\x69\x64\75\42\x6c\x69\x73\x74\143\154\151\x22\x3e"; foreach ($bdcli as $dtcli) { $html .= "\74\x6f\x70\x74\x69\157\x6e\x20\166\x61\154\x75\x65\75\42" . $dtcli->codigo . "\x22\76\123\165\143\x75\x72\x73\x61\154\x3a\x20" . $dtcli->sucursal . "\40" . $dtcli->nombre . "\40" . $dtcli->nombrev . "\x3c\57\157\x70\x74\151\x6f\156\76"; } $html .= "\x3c\57\x64\x61\x74\x61\154\151\163\x74\76"; return $html; } public function clientespromos($a) { $trab = $this->session->userdata("\143\x6f\x64"); $bdcli = $this->db->query("\123\105\114\x45\103\124\40\x44\111\x53\x54\111\x4e\x43\124\40\141\x2e\143\x6f\x64\x69\147\157\54\x20\141\56\x6e\x6f\155\142\x72\145\x2c\141\x2e\163\x75\143\x75\162\163\141\x6c\54\40\142\56\156\157\x6d\142\162\x65\x20\156\157\155\142\x72\145\x76\40\106\x52\x4f\x4d\40\143\154\x69\145\155\160\162\x65\40\x61\x20\112\117\x49\x4e\40\x6c\x69\163\164\166\x65\156\x64\40\x62\40\x4f\116\40\141\x2e\166\x65\156\144\x65\144\157\x72\x3d\x62\x2e\x63\157\x64\x69\x67\157\40\127\x48\x45\122\x45\40\141\56\163\164\141\x74\x75\163\75\47\x31\x27")->result(); $html = "\74\151\x6e\160\165\x74\x20\x74\171\160\145\x3d\x22\164\x65\x78\x74\42\40\x63\x6c\x61\x73\163\75\42\x77\x33\x2d\151\156\x70\x75\x74\42\40\151\x64\75\x22\151\x64\x63\154\x69\x22\x20\x6c\x69\x73\164\x3d\x22\154\151\163\x74\143\154\151\42\x20\x70\x6c\x61\143\145\150\x6f\154\144\145\x72\x3d\42\x43\157\x64\x69\x67\157\40\144\x65\40\x63\x6c\x69\145\x6e\164\145\42\x20\166\141\154\165\145\x3d\42" . $a . "\42\40\57\x3e\xa\x20\40\40\x20\x3c\144\x61\x74\141\x6c\x69\x73\164\x20\x69\x64\75\42\154\x69\x73\164\x63\154\x69\x22\76"; foreach ($bdcli as $dtcli) { $html .= "\74\x6f\160\164\x69\x6f\156\x20\x76\x61\x6c\x75\x65\x3d\x22" . $dtcli->codigo . "\42\x3e\123\x75\x63\x75\162\163\x61\154\72\40" . $dtcli->sucursal . "\x20" . $dtcli->nombre . "\40" . $dtcli->nombrev . "\74\x2f\x6f\x70\x74\151\x6f\156\x3e"; } $html .= "\74\57\x64\x61\164\141\x6c\x69\163\164\76"; return $html; } function clidescu($cli) { return $this->db->query("\x53\x45\x4c\x45\x43\124\x20\x52\x4f\x55\x4e\104\x28\x64\145\x73\x63\x75\145\156\164\157\x29\x20\x6e\x20\x46\x52\x4f\x4d\40\143\154\151\x65\x6d\160\x72\x65\40\x57\x48\105\x52\105\40\x63\157\144\151\147\x6f\x3d\x27{$cli}\x27")->row()->n; } public function clientes($a) { $trab = $this->session->userdata("\143\x6f\144"); $bdcli = $this->db->query("\123\x45\x4c\x45\103\124\x20\104\111\x53\124\111\116\103\x54\40\x61\x2e\x63\x6f\x64\151\147\x6f\54\40\x61\56\156\x6f\155\x62\x72\145\54\141\56\x73\x75\143\x75\x72\x73\x61\x6c\x2c\40\142\x2e\156\157\155\x62\x72\145\x20\156\x6f\x6d\x62\162\x65\166\x20\x46\x52\x4f\x4d\x20\143\x6c\151\145\155\160\162\x65\x20\x61\x20\x4a\x4f\111\x4e\x20\154\151\163\164\166\x65\x6e\144\x20\x62\x20\x4f\x4e\x20\x61\56\166\145\x6e\144\x65\x64\x6f\x72\75\x62\x2e\143\x6f\144\x69\147\157\x20\x57\110\105\x52\x45\x20\x61\x2e\163\x74\x61\x74\x75\163\75\x27\61\47")->result(); $html = "\74\x69\156\x70\165\164\x20\x74\x79\x70\x65\75\42\164\x65\170\x74\42\40\x63\154\x61\163\x73\75\42\167\x33\x2d\151\156\x70\165\x74\42\x20\151\144\x3d\42\151\144\143\154\x69\x22\x20\157\x6e\x63\150\141\x6e\x67\145\75\42\x70\145\x64\x69\x64\157\x73\x28\51\x3b\x63\x72\145\144\x69\143\154\x69\x28\51\73\42\40\x6c\151\163\164\75\42\x6c\x69\x73\x74\143\x6c\x69\42\x20\x70\x6c\x61\x63\145\x68\x6f\154\x64\x65\x72\75\42\103\x6f\144\x69\x67\x6f\40\x64\145\x20\143\x6c\x69\145\156\x74\x65\42\x20\166\x61\x6c\165\145\75\42" . $a . "\42\40\x2f\x3e\xa\40\40\x20\x20\74\x64\141\164\x61\x6c\x69\163\x74\x20\151\x64\x3d\42\154\x69\x73\164\143\x6c\x69\42\x3e"; foreach ($bdcli as $dtcli) { $html .= "\x3c\157\160\164\151\x6f\156\40\166\141\154\165\145\75\42" . $dtcli->codigo . "\x22\76\x20\123\x75\143\165\162\163\141\154\72\x20" . $dtcli->sucursal . "\40" . $dtcli->nombre . "\40" . $dtcli->nombrev . "\x3c\x2f\157\160\164\151\157\156\76"; } $html .= "\74\57\x64\x61\164\x61\154\151\x73\164\76"; return $html; } function credicli($cli) { $bd = $this->db->query("\x53\x45\114\x45\x43\124\x20\x61\x2e\x64\x6f\143\165\x6d\x65\x6e\x74\157\54\142\56\x64\x6f\143\54\x61\56\143\157\x64\143\x6c\151\145\156\x74\x65\54\141\x2e\x6e\x6f\x6d\142\x72\x65\x63\x6c\x69\x2c\x61\x2e\x74\145\x6c\145\x66\x6f\x6e\x6f\163\x2c\40\xa\40\x20\x20\x20\x52\x4f\x55\x4e\104\50\x49\106\x28\123\125\x4d\50\x61\x2e\x74\x6f\164\141\154\144\x29\x3e\60\54\40\x53\125\x4d\50\x61\x2e\164\x6f\x74\141\154\144\51\54\60\51\54\x32\x29\x20\x64\157\154\x61\162\x2c\x20\12\40\x20\x20\40\122\117\125\x4e\x44\x28\x28\x53\x45\114\x45\103\124\40\x49\106\x28\123\125\115\x28\x62\61\x2e\x6d\157\x6e\164\x6f\x64\51\x3e\x30\54\40\x53\125\x4d\50\142\x31\56\x6d\x6f\x6e\164\x6f\x64\x29\x2c\x30\51\x20\x64\x6f\154\x61\x72\x20\x46\x52\117\x4d\x20\157\x70\x65\x72\x74\151\40\141\61\40\112\117\111\x4e\x20\x6f\x70\145\x72\x63\154\x69\x20\x62\x31\40\x4f\116\x20\141\61\x2e\144\x6f\143\165\x6d\x65\156\x74\157\x3d\x62\x31\x2e\151\x64\146\141\x63\40\x57\x48\105\x52\x45\40\141\x31\x2e\143\x6f\144\143\x6c\x69\x65\x6e\x74\x65\75\x61\56\143\157\x64\x63\154\151\x65\156\164\x65\40\x26\x26\40\x62\61\x2e\151\144\143\157\156\163\x62\x61\x6e\x63\x20\x49\123\40\116\x4f\124\40\x4e\x55\114\114\40\46\46\x20\x28\141\61\56\164\151\x70\x6f\x64\x6f\143\x3d\x27\106\x41\x43\47\x20\x7c\174\x20\x61\x31\x2e\164\x69\160\x6f\x64\x6f\143\75\47\116\117\x54\x27\x29\51\54\62\x29\x20\160\x64\x6f\154\141\x72\54\12\40\40\x20\40\40\122\117\x55\x4e\104\50\111\x46\x28\x53\x55\x4d\x28\x61\x2e\164\x6f\x74\x61\154\144\51\76\x30\x2c\x20\123\x55\x4d\x28\x61\56\x74\x6f\x74\141\x6c\x64\51\54\60\51\x2c\x32\51\55\x52\117\x55\116\x44\50\x28\x53\x45\x4c\105\x43\124\40\111\106\x28\123\x55\x4d\50\x62\x31\x2e\x6d\x6f\156\164\x6f\144\51\x3e\60\x2c\40\123\125\x4d\50\x62\61\56\x6d\157\156\164\157\144\x29\54\60\x29\x20\x64\x6f\154\x61\x72\x20\x46\x52\x4f\115\x20\x6f\160\145\162\164\x69\40\x61\x31\40\112\117\x49\x4e\40\157\x70\x65\162\x63\x6c\151\x20\142\x31\x20\x4f\x4e\x20\141\61\56\x64\x6f\x63\165\155\145\156\164\157\75\x62\x31\56\x69\144\x66\141\x63\x20\127\x48\x45\122\x45\x20\141\x31\56\x63\x6f\x64\x63\154\x69\x65\156\164\x65\75\141\56\143\157\x64\x63\154\151\x65\x6e\164\145\x20\46\46\40\x62\61\56\x69\x64\x63\157\x6e\163\142\141\x6e\x63\x20\111\x53\x20\x4e\117\124\x20\x4e\x55\114\x4c\40\46\x26\40\x28\x61\x31\56\164\x69\160\157\144\x6f\143\75\47\x46\x41\103\x27\x20\174\174\x20\141\61\x2e\x74\151\160\x6f\x64\x6f\x63\75\47\116\x4f\124\47\51\x29\54\x32\x29\40\144\x65\x62\x65\x2c\xa\40\40\x20\40\x28\x53\x45\x4c\105\x43\x54\40\x61\61\x2e\x6d\157\156\x74\x6f\40\106\x52\x4f\x4d\40\x70\x72\x75\145\142\x61\56\143\162\x65\x64\151\143\154\151\40\141\x31\x20\x57\110\x45\122\105\x20\141\61\56\143\154\151\x65\156\x74\145\x3d\x61\x2e\143\157\144\x63\x6c\151\145\x6e\x74\x65\x20\x4c\111\115\x49\x54\x20\61\51\40\143\162\145\x64\x69\x74\x6f\xa\11\40\106\122\117\x4d\40\157\x70\x65\x72\x74\151\40\x61\12\x20\40\40\40\x4a\x4f\111\116\40\143\x6f\x6e\x74\162\157\x6c\x5f\157\160\145\x72\x74\151\40\x62\x20\117\116\40\141\x2e\x61\x6e\x74\x64\x6f\143\x3d\142\x2e\x64\157\143\xa\x20\40\40\x20\112\x4f\111\x4e\x20\143\x6c\x69\145\x6d\x70\x72\145\x20\143\x20\x4f\x4e\x20\x61\56\143\157\x64\143\154\x69\145\x6e\x74\145\75\x63\x2e\x63\x6f\x64\151\x67\157\12\40\x20\40\x20\x57\x48\x45\x52\x45\40\50\141\56\x74\x69\160\157\144\157\143\x3d\x27\106\101\103\47\40\174\174\40\x61\56\x74\151\x70\x6f\x64\x6f\143\x3d\x27\x4e\117\124\x27\x29\40\x26\46\x20\141\56\143\x6f\144\x63\154\151\x65\156\x74\x65\x3d\x27{$cli}\47\12\x20\x20\40\x20\x47\122\x4f\x55\120\x20\x42\x59\x20\141\x2e\x63\157\x64\143\154\151\x65\156\164\x65\x20\117\122\x44\105\x52\x20\x42\x59\40\x64\157\x6c\141\x72\40\104\105\123\x43")->row(); $html = ''; $credito = $bd->credito - $bd->debe; $html .= "\74\x74\x61\x62\x6c\x65\x20\143\x6c\141\163\163\x3d\x22\167\63\55\164\x61\x62\154\x65\x2d\x61\x6c\x6c\40\167\63\55\x68\157\166\x65\x72\x61\142\x6c\x65\40\167\x33\55\x63\x65\156\x74\x65\x72\42\x3e\12\40\40\40\40\x3c\164\x72\40\143\x6c\141\163\163\75\x22\167\x33\55\x66\157\156\x64\157\x64\162\x6f\x69\144\42\x3e\74\164\x68\76\124\x6f\164\141\154\x3c\57\164\150\x3e\x3c\x74\150\x3e\x50\x61\147\x61\x64\157\74\x2f\164\x68\76\x3c\164\x68\76\104\145\x62\x65\x3c\57\x74\150\76\x3c\x74\x68\76\103\162\145\144\151\164\157\x3c\x2f\164\x68\76\x3c\x2f\164\x72\x3e\xa\x20\40\40\40\74\164\x72\76\x3c\164\x64\76" . ROUND($bd->dolar, 2) . "\74\x2f\x74\x64\76\74\164\144\76" . ROUND($bd->pdolar, 2) . "\x3c\x2f\164\x64\76\x3c\x74\x64\x3e" . ROUND($bd->debe, 2) . "\74\x2f\164\144\76\x3c\x74\144\x3e" . ROUND($credito, 2) . "\74\57\x74\x64\76\74\57\164\x72\76\xa\40\x20\x20\x20\x3c\x2f\164\x61\x62\x6c\x65\76"; return $html; } public function viewmodlote($a) { $bd = $this->db->query("\x53\105\114\x45\103\124\x20\x63\56\154\157\x74\x65\x2c\50\x63\56\x63\141\156\164\x69\144\x61\144\x2d\143\56\x63\157\156\163\165\155\151\144\157\x29\x20\x64\x69\x73\x70\x2c\40\143\x2e\x76\x65\x6e\143\x65\54\x63\x2e\141\154\155\x61\143\x65\156\x20\x46\x52\117\115\x20\141\x72\164\x69\154\x6f\x74\x65\x73\40\x41\123\x20\143\x20\x57\x48\105\x52\x45\40\143\56\x63\x6f\x64\x69\147\157\x61\162\x74\x3d\x27{$a}\x27\x20\x26\46\40\x63\56\143\x61\156\164\x69\x64\141\x64\41\75\143\x2e\143\157\x6e\x73\165\x6d\151\144\x6f\40\x4f\x52\104\x45\122\40\102\131\40\143\x2e\166\145\156\143\145")->result_array(); $data = array("\154\x6f\164\x65" => $bd); return $data; } public function modlote($a, $b, $c, $d, $e) { $lote = $this->db->query("\123\x45\114\x45\103\124\x20\141\x6c\x6d\141\x63\145\156\54\x6c\157\164\x65\x2c\x43\117\x55\x4e\124\x28\x2a\x29\x20\151\x74\145\x6d\x20\106\122\117\x4d\x20\x61\162\164\x69\154\157\164\145\x73\x20\x57\110\105\x52\105\x20\x63\157\144\x69\x67\157\141\162\x74\75\x27{$b}\x27\x20\46\46\40\x43\117\116\x43\x41\x54\x28\x61\x6c\155\x61\143\x65\156\x2c\154\x6f\164\x65\x29\x3d\x27{$d}\x27\40\x26\46\x20\50\x63\x61\156\164\151\x64\141\144\x2d\x63\157\156\163\165\155\x69\144\x6f\51\x3e\x3d{$e}\40\46\x26\40\141\154\x6d\141\143\145\x6e\40\x4e\117\124\x20\111\116\40\50\60\x31\x2c\60\x35\54\60\x36\x29")->row(); if ($lote->item > 0) { $newcant = $c - $e; $dt = array("\143\x61\156\164\x69\144\141\x64" => $newcant); $this->db->where("\x64\x6f\x63\165\155\x65\x6e\164\x6f\75\47{$a}\x27\40\x26\x26\x20\x63\157\x64\x69\147\x6f\x3d\47{$b}\x27\40\x26\x26\40\x63\x61\156\x74\x69\x64\141\x64\75\47{$c}\x27\x20\x4c\x49\x4d\111\124\40\x31")->update("\x6f\160\145\162\155\x76", $dt); if ($this->db->affected_rows() > 0) { $bd2 = $this->db->query("\123\105\x4c\x45\103\124\40\141\x2e\x69\144\x5f\145\x6d\x70\162\x65\x73\x61\54\40\141\x2e\x61\147\x65\156\143\x69\x61\x2c\40\x61\x2e\164\x69\x70\x6f\144\x6f\x63\54\x20\141\x2e\144\x6f\x63\x75\155\145\x6e\x74\157\54\x20\x61\56\x67\162\165\160\157\54\x20\x61\x2e\163\165\x62\x67\162\x75\160\x6f\54\x20\x61\x2e\x6f\162\151\147\145\156\x2c\40\141\x2e\x63\157\x64\151\147\x6f\x2c\40\x61\56\143\x6f\x64\x68\x69\x6a\157\x2c\x20\141\x2e\x70\x69\144\54\40\141\56\156\157\x6d\x62\x72\x65\54\x20\x61\56\x63\157\x73\164\157\x75\156\151\x74\x2c\x20\141\56\160\x72\x65\143\151\x6f\x75\x6e\151\164\54\x20\141\56\x64\x69\146\x65\162\x65\x6e\x63\151\141\54\x20\141\56\144\x73\x63\x74\157\x75\x6e\x69\x74\x2c\40\x61\x2e\143\157\144\144\x65\163\143\x75\x65\x6e\x74\157\54\40\xa\x20\40\40\x20\40\40\x20\40\x20\40\40\40\x61\56\144\163\143\164\x6f\160\x72\143\x2c\40\141\56\x64\x73\143\164\x6f\x65\156\144\x6d\x2c\40\x61\x2e\144\163\143\x74\x6f\155\x74\x6f\154\x69\156\x65\141\x2c\40\141\56\144\x73\143\164\157\145\156\144\x70\54\40\141\56\160\x72\x65\143\151\157\x66\x69\156\54\40\141\x2e\x70\162\143\162\145\x63\x61\162\147\x6f\54\40\x61\x2e\162\145\143\x61\x72\147\x6f\165\156\x69\164\54\40\141\x2e\160\162\145\x63\151\x6f\157\162\x69\147\x69\156\141\x6c\54\x20\x61\56\x63\x61\x6e\164\151\x64\141\144\x2c\x20\x61\56\x63\x6e\164\x64\x65\x76\x75\x65\x6c\x74\54\40\141\x2e\165\x6e\x69\x64\x65\x76\x75\145\x6c\164\x2c\x20\x61\x2e\143\x6e\x74\145\x6e\x74\162\145\x67\x61\x2c\x20\141\x2e\x74\x61\x6c\x6c\141\163\x2c\40\x61\56\143\x6f\x6c\157\162\145\163\x2c\40\141\x2e\x6d\x6f\x6e\164\x6f\x6e\145\164\157\54\x20\141\56\x6d\157\x6e\164\x6f\164\x6f\x74\x61\x6c\54\40\xa\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\141\x2e\x61\x6c\x6d\x61\x63\x65\x6e\x2c\x20\x61\x2e\x70\x72\157\166\145\x65\144\x6f\162\x2c\40\x61\x2e\146\145\143\x68\141\144\x6f\143\x2c\40\141\x2e\x69\155\160\x75\x65\x73\x74\x6f\61\54\x20\x61\x2e\151\x6d\160\165\145\x73\164\157\62\54\40\x61\56\151\155\x70\x75\x65\163\164\x6f\x33\54\x20\x61\56\x69\x6d\x70\x75\x65\x73\x74\x6f\64\54\40\141\56\x69\x6d\160\x75\145\163\164\x6f\x35\54\x20\141\x2e\151\155\x70\165\x65\x73\x74\x6f\66\x2c\x20\141\56\164\151\155\160\165\145\160\162\x63\x2c\x20\x61\x2e\151\x6d\160\x75\137\155\x74\157\54\40\x61\56\x63\157\155\x69\x73\x69\157\156\54\40\x61\56\143\157\x6d\x69\163\160\x72\143\54\x20\141\56\x76\145\156\144\145\x64\x6f\x72\54\40\x61\56\x65\155\x69\163\157\162\54\40\x61\x2e\x75\163\141\163\x65\x72\x69\141\154\x2c\x20\141\x2e\164\x69\x70\157\x70\162\145\143\x69\157\54\x20\12\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\141\56\165\x6e\x69\x64\141\x64\x2c\40\141\x2e\141\x67\162\165\160\141\x64\157\54\x20\141\56\x63\156\164\x61\147\x72\x75\160\141\x64\x61\54\40\x61\56\x73\145\151\x6d\160\157\x72\x74\x6f\x2c\x20\141\56\x64\145\163\x64\x65\x69\155\160\x6f\162\54\x20\141\56\x6e\157\164\141\163\x2c\40\x61\x2e\x6f\x66\x65\162\164\x61\x2c\40\x61\56\143\157\x6d\x70\x75\x65\x73\164\x6f\x2c\x20\141\x2e\165\163\141\145\x78\x69\x73\x74\54\40\141\56\x6d\x61\x72\143\141\54\40\x61\x2e\x61\x75\x78\61\x2c\40\141\x2e\x65\163\164\x61\143\x69\x6f\x6e\54\x20\141\56\x65\x73\x74\141\143\151\157\156\x66\141\x63\54\x20\x61\x2e\x63\154\141\163\151\146\x69\143\141\x2c\40\x61\56\143\165\x65\156\x74\141\143\157\x6e\x74\54\x20\141\x2e\x70\154\141\143\141\54\40\x61\x2e\x70\154\141\143\x61\x6f\x64\54\x20\141\56\165\144\x69\156\141\155\x69\x63\141\x2c\x20\x61\56\143\x61\156\x74\x72\145\146\54\40\xa\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x61\56\x75\156\x69\x64\141\x64\162\145\x66\x2c\40\x61\56\142\x61\x73\x65\151\x6d\x70\x6f\x31\x2c\40\x61\56\142\141\x73\x65\x69\x6d\x70\157\62\x2c\40\141\x2e\142\141\163\x65\151\x6d\x70\x6f\63\x2c\40\x61\x2e\154\157\x74\145\x2c\40\141\56\x69\155\160\137\x6e\x61\143\x69\157\x6e\141\x6c\54\40\x61\56\151\155\160\x5f\x70\162\157\144\x75\x63\x63\x2c\x20\x61\x2e\163\x65\137\151\155\x70\162\151\x6d\x69\x6f\x2c\40\141\56\x6f\146\145\162\164\x61\x63\x6f\156\x76\145\x6e\151\x6f\54\40\x61\56\143\x6f\144\137\163\145\x72\x76\x69\144\157\x72\x2c\40\x61\x2e\160\162\143\137\143\x6f\x6d\x69\x5f\x73\x65\162\166\x69\x64\157\162\54\40\141\x2e\155\x74\x6f\137\x63\157\155\x69\x5f\163\145\x72\166\x69\x64\157\x72\54\40\141\56\x63\150\x65\143\x6b\x69\x6e\54\40\141\56\x68\x61\142\x69\137\156\162\x6f\54\x20\x61\56\151\x64\166\x61\154\x69\x64\141\x63\x69\157\156\54\x20\141\x2e\x69\x64\x6f\x66\145\x72\x74\x61\54\40\xa\40\40\x20\x20\40\40\40\40\x20\x20\x20\40\x61\56\141\x67\x65\x6e\143\151\x61\156\164\54\40\141\56\164\x69\x70\157\x64\x6f\x63\141\x6e\x74\x2c\x20\141\56\x64\157\143\165\x6d\141\x6e\164\54\x20\x61\56\165\145\155\x69\163\x6f\x72\141\156\164\x2c\40\x61\56\x65\x73\x74\141\143\x69\x6f\141\156\164\x2c\40\141\56\x66\145\143\150\141\x64\157\143\x61\x6e\x74\x2c\x20\x61\56\x66\145\143\150\x61\x79\x68\x6f\162\x61\54\40\x61\x2e\146\x72\x6f\147\x2c\x20\141\x2e\x64\x6f\143\x75\x6d\x65\156\164\x6f\154\x6f\143\141\154\54\40\141\56\x6c\151\x6e\142\x6c\x6f\161\54\x20\141\56\x65\x6e\x76\x69\141\x64\x6f\x5f\153\155\157\156\151\164\x6f\162\54\40\141\56\163\x65\137\x67\x75\x61\x72\144\x6f\x2c\40\x61\56\142\141\163\145\x69\155\x70\157\64\x2c\40\141\x2e\142\141\163\145\x69\155\160\x6f\x35\54\x20\x61\x2e\x62\141\163\145\x69\155\x70\x6f\66\54\40\x61\x2e\x73\x74\x61\164\165\x73\x2c\40\141\56\154\157\164\145\40\12\40\40\40\40\40\40\40\x20\x20\x20\40\x20\x46\x52\117\x4d\40\157\x70\145\162\155\166\40\141\163\40\x61\x20\x57\110\x45\x52\x45\40\144\x6f\x63\165\155\145\156\x74\x6f\x3d\47{$a}\47\40\x26\x26\40\143\x6f\144\151\147\157\75\x27{$b}\x27\40\46\x26\x20\143\x61\x6e\164\x69\144\x61\x64\75\47{$newcant}\x27")->row_array(); $this->db->insert("\157\160\x65\162\x6d\x76", $bd2); if ($this->db->affected_rows() > 0) { $dt2 = array("\x63\141\156\x74\x69\x64\x61\144" => $e, "\x6c\x6f\x74\x65" => $lote->lote, "\x61\154\x6d\x61\x63\145\156" => $lote->almacen); $this->db->where("\144\x6f\143\x75\155\145\x6e\x74\x6f\x3d\x27{$a}\47\40\46\46\40\x63\x6f\x64\x69\147\x6f\75\x27{$b}\47\40\x26\46\40\x63\141\x6e\x74\151\x64\x61\x64\75\47{$newcant}\47\40\x4c\x49\x4d\111\x54\x20\61")->update("\157\x70\145\x72\155\166", $dt2); if ($this->db->affected_rows() > 0) { $this->loguser("\103\141\x6d\x62\151\157\40\114\x6f\x74\145", "\x45\x6c\x20\165\163\165\x61\x72\151\157\40\155\157\144\x69\143\x6f\x20\x65\154\40\154\x6f\x74\145\40\141\x20" . $d . "\40\x70\141\x72\141\x20\x65\154\x20\144\157\x63\165\155\145\x6e\x74\x6f\x20" . $a . ''); return 1; } } } } } public function almped() { $this->load->library("\164\x61\x62\x6c\x65"); $bdfac = $this->db->query("\123\x45\x4c\105\x43\124\x20\x61\56\x64\x6f\143\x75\x6d\x65\156\x74\x6f\54\x63\x2e\144\x6f\x63\54\x20\x61\56\143\157\144\x63\x6c\151\x65\x6e\x74\145\x2c\x20\141\x2e\x6e\x6f\x6d\x62\162\145\x63\154\151\x2c\x20\141\x2e\x74\145\154\x65\146\x6f\x6e\x6f\x73\x2c\40\141\56\x73\x65\x63\164\x6f\162\54\141\56\166\x65\156\144\145\144\x6f\x72\54\40\x52\117\x55\x4e\x44\50\x53\125\x4d\50\142\56\143\x61\156\164\151\x64\141\144\x29\x2c\x32\x29\40\165\156\x69\x64\141\144\x65\x73\x2c\x63\x2e\x74\x69\x6d\x65\141\165\x74\54\x63\56\164\151\155\x65\x61\x73\151\147\x2c\143\x2e\x74\x69\x6d\x65\145\155\x70\54\40\143\x2e\x73\164\141\x74\165\x73\40\12\40\40\40\x20\x46\122\x4f\x4d\x20\157\x70\x65\162\164\151\40\x41\x53\40\x61\40\12\40\40\40\x20\112\117\x49\x4e\x20\x6f\160\x65\x72\155\x76\40\101\123\40\x62\40\x4f\x4e\40\x61\56\144\x6f\143\165\155\x65\x6e\x74\x6f\x3d\142\x2e\x64\157\143\165\x6d\145\156\x74\157\12\x20\40\x20\40\112\117\x49\116\40\x63\157\156\164\x72\x6f\154\x5f\157\160\145\162\164\151\x20\x41\123\x20\x63\40\x4f\x4e\40\x61\56\141\156\x74\144\157\x63\x3d\x63\x2e\144\157\143\xa\40\40\40\x20\x57\x48\105\x52\x45\x20\141\x2e\146\145\x63\x68\x61\x63\x72\145\x61\x3e\75\x44\101\124\105\x5f\x41\104\104\x28\x43\x55\122\104\x41\x54\x45\x28\x29\54\111\x4e\x54\105\122\126\101\x4c\40\55\x31\60\40\104\x41\x59\x29\40\x20\x26\46\40\x28\143\56\x73\164\x61\164\165\x73\75\47\x31\x27\40\174\174\x20\x63\x2e\x73\164\141\164\165\163\x3d\x27\x34\x27\40\x7c\x7c\40\x63\x2e\x73\164\141\x74\165\x73\75\47\65\x27\x20\x7c\x7c\x20\x63\x2e\163\x74\x61\x74\165\x73\75\x27\71\67\x27\40\174\x7c\40\x63\56\163\164\141\x74\x75\163\75\x27\66\x27\51\12\x20\40\x20\40\x47\122\117\125\120\40\102\131\40\141\56\144\x6f\143\165\155\145\x6e\x74\x6f\x3b")->result(); $tunid = $this->db->query("\x53\105\114\x45\103\124\40\x52\117\x55\116\104\50\123\x55\x4d\x28\142\x2e\x63\x61\x6e\164\151\144\x61\144\51\54\x32\51\40\x6e\xa\40\x20\40\x20\106\x52\117\x4d\40\157\160\145\x72\x74\x69\40\x41\x53\40\141\x20\xa\40\40\x20\x20\x4a\117\x49\116\40\x6f\x70\x65\162\x6d\166\40\x41\x53\x20\142\x20\x4f\116\x20\141\x2e\x64\157\x63\x75\155\145\x6e\x74\x6f\75\x62\x2e\144\157\x63\165\x6d\x65\156\164\x6f\12\40\40\40\40\112\117\x49\x4e\x20\143\x6f\156\x74\162\x6f\x6c\x5f\157\160\x65\162\164\x69\40\101\x53\x20\143\40\x4f\116\40\141\x2e\x61\x6e\164\x64\x6f\143\75\x63\x2e\x64\x6f\143\12\40\40\x20\40\x57\x48\x45\x52\105\40\x61\56\146\x65\x63\x68\141\143\x72\x65\141\76\x3d\x44\101\124\105\137\101\104\x44\x28\x43\x55\x52\104\x41\x54\x45\x28\x29\x2c\x49\x4e\124\105\122\126\101\114\40\55\x31\60\40\x44\101\131\x29\40\x26\46\x20\50\x63\56\x73\164\x61\164\x75\x73\75\x27\x31\47\40\x7c\174\x20\x63\56\163\164\141\164\165\163\x3d\47\64\47\40\174\x7c\x20\x63\x2e\x73\x74\x61\164\165\x73\x3d\47\65\47\51\x3b")->row(); $bdtrab = $this->db->query("\123\x45\x4c\105\x43\124\40\144\56\x69\x64\x2c\x20\144\x2e\156\x6f\x6d\141\160\x65\x20\106\x52\117\x4d\x20\164\162\141\142\40\x41\123\40\144\40\x57\110\105\x52\x45\x20\144\56\164\x69\160\x3d\47\x33\47")->result(); $trab = "\x3c\157\x70\x74\151\157\156\40\166\x61\154\165\x65\75\42\42\x20\x73\145\x6c\145\143\164\x65\x64\x20\x64\x69\x73\141\x62\x6c\x65\x64\76\x53\x65\154\145\x63\143\151\157\156\x65\x3c\57\x6f\160\164\151\157\156\76"; foreach ($bdtrab as $dttrab) { $trab .= "\x3c\x6f\160\x74\x69\157\156\x20\166\141\x6c\x75\x65\75\42" . $dttrab->id . "\42\76" . $dttrab->nomape . "\x3c\x2f\157\x70\x74\151\157\156\76"; } $html = "\12\x20\40\x20\40\74\164\x61\142\154\145\x20\x63\154\x61\163\163\x3d\x22\167\63\55\164\141\x62\154\145\55\141\154\154\x20\167\63\x2d\x68\157\x76\145\162\141\142\154\x65\40\167\63\55\154\x65\x66\x74\x2d\141\x6c\151\147\x6e\x22\x3e\12\40\40\x20\40\x3c\164\x72\40\x63\154\x61\163\x73\x3d\x22\167\63\x2d\146\157\156\x64\157\x64\x72\x6f\151\x64\42\x3e\x3c\164\x68\76\x45\x73\x74\x61\164\165\x73\x3c\x2f\x74\150\76\74\164\x68\x3e\x42\x75\163\143\x61\162\x20\x3c\151\155\147\x20\163\162\143\x3d\x22" . base_url() . "\x69\155\141\147\x65\163\57\142\165\x73\x63\x61\x72\x2e\x70\156\147\42\40\x61\154\164\x3d\42\x42\165\x73\143\141\x72\42\x20\164\151\164\x6c\x65\75\x22\x42\x75\163\143\141\162\x22\x20\163\164\171\x6c\145\75\x22\x77\x69\144\x74\150\72\x31\70\x70\170\x3b\142\x6f\162\144\x65\162\72\x30\x3b\42\x3e\x3c\57\164\x68\x3e\x3c\x74\150\76\101\163\151\x67\156\141\x63\x69\xc3\xb3\x6e\74\57\x74\150\x3e\x3c\x74\x68\76\x3c\x2f\x74\x68\x3e\74\x74\x68\x3e\x3c\x2f\164\x68\x3e\74\x2f\164\162\76\xa\40\x20\x20\x20\x3c\164\162\x3e\74\164\144\76\74\163\x65\154\x65\143\164\x20\x63\154\141\x73\x73\x3d\x22\167\63\x2d\x73\x65\x6c\x65\x63\164\x22\40\151\144\75\x22\166\x73\164\x61\x74\165\x73\x22\x20\x6f\x6e\143\x68\x61\156\x67\145\75\42\167\63\x2e\x66\x69\x6c\x74\145\162\110\124\115\114\x28\47\43\151\144\60\61\x27\x2c\40\x27\56\151\164\145\x6d\x27\x2c\x20\164\x68\151\163\56\x76\x61\x6c\165\145\51\42\x3e\12\40\x20\40\x20\x3c\x6f\160\164\151\157\x6e\x20\x76\x61\154\165\145\x3d\x22\42\40\x73\x65\154\145\x63\164\145\144\x20\144\151\163\x61\142\x6c\x65\x64\76\123\145\154\145\143\143\151\x6f\x6e\x65\74\x2f\157\160\x74\x69\157\x6e\76\12\40\40\40\x20\x3c\x6f\x70\164\151\157\156\40\x76\x61\x6c\165\x65\75\42\120\x65\x6e\x64\151\145\156\164\145\x22\x3e\x50\145\156\x64\x69\x65\x6e\164\145\x3c\x2f\x6f\160\x74\x69\x6f\x6e\x3e\xa\40\40\x20\x20\x3c\x6f\160\164\151\157\x6e\40\166\x61\154\x75\x65\75\42\x50\162\x6f\143\145\163\141\156\x64\157\56\x2e\x2e\42\76\120\x72\x6f\x63\x65\163\x61\x6e\x64\157\x2e\x2e\56\74\x2f\157\x70\164\151\157\x6e\x3e\xa\40\40\40\x20\74\57\x73\x65\x6c\145\x63\164\76\x3c\x2f\164\x64\x3e\74\x74\x64\x3e\74\x69\x6e\x70\x75\x74\x20\x74\x79\x70\x65\75\42\x74\145\x78\x74\x22\40\x63\x6c\141\x73\x73\75\42\x77\x33\55\151\x6e\x70\x75\x74\x22\40\160\154\141\x63\x65\150\157\154\x64\145\162\x3d\x22\x49\x6e\147\162\145\x73\145\40\x73\x75\40\142\165\x73\x71\x75\x65\144\x61\x22\x20\x6f\156\x69\156\160\165\x74\x3d\x22\x77\63\x2e\146\x69\x6c\164\x65\162\110\x54\x4d\114\50\47\43\x69\144\60\x31\x27\x2c\x20\x27\56\x69\x74\x65\155\x27\x2c\40\164\150\x69\x73\x2e\166\x61\x6c\x75\x65\x29\42\76\x3c\x2f\x74\x64\76\12\40\40\40\x20\74\x74\x64\76\x3c\163\x65\x6c\145\143\164\40\x63\154\141\163\163\75\42\167\x33\55\163\145\154\145\x63\164\x22\40\x69\x64\x3d\42\x69\144\137\164\162\141\142\42\76" . $trab . "\74\x2f\x73\x65\x6c\x65\x63\x74\x3e\x3c\57\164\x64\x3e\xa\40\40\40\40\74\x74\x64\x20\x63\154\x61\x73\x73\75\x22\167\x33\55\x63\x65\156\164\145\x72\40\167\63\x2d\142\x74\x6e\42\76\x3c\141\x20\x6f\x6e\143\x6c\151\x63\x6b\x3d\x22\141\x73\x69\x67\156\141\160\145\x64\50\x29\x22\x3e\74\151\x6d\147\40\x73\162\x63\75\42" . base_url() . "\151\155\141\147\x65\x73\x2f\x62\156\56\160\x6e\x67\x22\x20\141\154\x74\x3d\42\x41\x73\151\147\156\141\162\x22\40\x74\151\x74\154\145\x3d\x22\101\x73\151\147\156\x61\x72\x22\x20\x73\x74\171\154\145\75\42\x77\151\144\164\150\x3a\x32\60\160\170\73\x68\x65\x69\147\150\x74\x3a\x32\x30\x70\x78\x3b\x62\x6f\x72\144\x65\162\x3a\60\x3b\42\x3e\x3c\x2f\141\x3e\x3c\x2f\x74\x64\76\xa\x20\40\x20\40\x3c\x74\x64\40\143\154\141\163\163\x3d\42\167\63\55\143\x65\x6e\164\x65\x72\40\x77\63\x2d\x62\164\x6e\42\76\x3c\x61\40\x6f\x6e\x63\x6c\x69\x63\x6b\x3d\x22\141\x6c\x6d\160\x65\x64\x28\x29\x3b\42\x3e\74\x69\x6d\x67\x20\163\x72\143\75\x22" . base_url() . "\x69\x6d\x61\147\x65\x73\x2f\162\145\154\157\141\144\56\x70\156\147\42\x20\141\154\x74\x3d\42\x52\145\x63\x61\x72\147\x61\162\42\x20\x74\151\x74\x6c\x65\75\42\122\145\143\x61\162\x67\141\162\x22\x20\x73\164\x79\x6c\x65\75\42\167\x69\144\x74\150\72\62\x30\160\170\x3b\150\x65\151\x67\150\x74\x3a\62\x30\x70\x78\73\142\x6f\x72\x64\x65\162\72\60\73\42\76\74\x2f\x61\76\74\x2f\164\x64\76\x3c\57\164\162\x3e\xa\40\x20\x20\40\74\57\x74\x61\142\x6c\x65\76\x3c\142\x72\x3e\xa\x20\x20\40\40\74\164\141\x62\154\145\40\151\144\75\42\151\144\x30\61\x22\x20\143\x6c\141\163\163\75\42\x77\63\55\x74\141\142\x6c\x65\55\x61\154\x6c\40\x77\x33\55\x68\x6f\x76\x65\x72\x61\x62\154\x65\40\x77\63\55\x6c\x65\146\x74\55\141\154\151\x67\x6e\x20\x77\x33\x2d\x74\151\156\171\42\x3e\x3c\164\162\x20\x63\x6c\x61\x73\x73\x3d\42\167\x33\55\146\x6f\156\144\157\144\162\157\x69\x64\42\x3e\74\x74\x68\76\x4e\x3c\57\x74\150\x3e\74\x74\150\x3e\104\157\x63\x3c\57\164\150\x3e\x3c\164\150\76\x43\157\144\151\147\157\74\x2f\x74\x68\x3e\74\x74\150\x3e\x4e\x6f\155\x62\162\145\74\57\164\150\x3e\74\x74\x68\x3e\123\x65\x63\164\x6f\162\x3c\57\164\x68\76\x3c\164\x68\x3e\x56\x65\x6e\x64\x65\x64\157\x72\x3c\57\x74\150\76\74\x74\150\76\x45\x6d\x70\x61\143\141\144\157\162\x3c\x2f\x74\150\76\x3c\x74\150\x3e\125\x6e\x69\144\x61\x64\x65\x73\74\57\164\x68\76\74\x74\x68\x3e\106\x2e\101\165\164\157\162\x69\172\x61\x3c\57\x74\x68\76\74\x74\150\76\x46\56\101\163\151\147\x6e\141\74\x2f\164\x68\76\x3c\x74\x68\76\x46\x2e\105\x6d\160\74\57\164\150\76\74\x74\x68\x3e\x45\163\x74\x61\164\165\x73\x3c\57\164\150\76\x3c\57\164\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $nom = $this->db->query("\123\105\x4c\105\103\x54\x20\111\x46\50\x61\56\156\157\x6d\x61\160\x65\x21\x3d\47\47\x2c\x61\x2e\x6e\157\x6d\x61\160\145\54\47\x6e\x2f\141\x27\51\x20\156\x6f\x6d\141\160\x65\x2c\x20\x62\56\x73\143\x61\x6e\40\106\122\x4f\115\40\x74\x72\x61\142\40\141\x73\x20\x61\x20\x4a\x4f\111\116\x20\x63\x6f\x6e\164\x72\x6f\154\x5f\157\x70\x65\x72\164\151\40\141\163\40\142\x20\117\x4e\40\x61\x2e\x69\144\x3d\142\56\x74\162\x61\142\145\155\x70\141\x71\40\127\x48\105\122\x45\x20\50\142\x2e\144\x6f\x63\75\47{$dtfac->documento}\x27\x20\174\174\40\x62\56\144\x6f\x63\75\47{$dtfac->doc}\47\40\x29")->row(); $vend = $this->db->query("\123\x45\x4c\105\103\124\40\x62\x2e\x6e\x6f\155\x62\x72\x65\40\x46\122\117\115\40\157\160\x65\162\164\x69\x20\x61\x73\x20\x61\40\112\117\111\116\x20\154\151\x73\x74\166\x65\156\x64\40\141\x73\x20\142\40\x4f\116\x20\x61\56\166\145\156\x64\x65\144\x6f\x72\75\142\x2e\x63\x6f\x64\151\147\x6f\x20\127\x48\105\x52\x45\40\141\x2e\144\157\143\165\x6d\x65\x6e\164\x6f\75\47{$dtfac->documento}\x27\40\x4c\x49\x4d\x49\124\40\61")->row(); $html .= "\74\x74\x72\40\151\x64\x3d\42\163\x6c\x65\x63\x74" . $i . "\x22\40\x63\154\x61\163\163\x3d\x22\151\164\x65\x6d\42\x20\x6f\x6e\x63\154\151\x63\x6b\75\42\151\x74\146\x61\143\x28\44\x28\47\x23\x61" . $i . "\x27\51\x2e\x76\x61\154\x28\51\51\x3b\x22\76"; if ($dtfac->status == 4) { $status = "\x50\145\x6e\144\x69\x65\x6e\164\x65"; $color = "\x77\x33\x2d\x72\x65\x64"; } elseif ($dtfac->status == 1) { $status = "\x41\x72\155\141\156\x64\157\x2e\56\x2e"; $color = "\x77\63\x2d\160\x61\154\145\x2d\171\x65\154\x6c\x6f\167"; } elseif ($dtfac->status == 5 || $dtfac->status == 97) { $status = "\126\145\x72\151\146\x69\143\x61\x6e\x64\x6f"; $color = "\x77\x33\55\x70\141\154\x65\55\x62\154\165\145"; } elseif ($dtfac->status == 6) { $status = "\x45\155\160\141\143\141\156\x64\157"; $color = "\167\63\x2d\160\x61\x6c\x65\x2d\x67\x72\x65\x65\x6e"; } elseif ($dtfac->status == 2) { $status = "\114\151\163\x74\x6f"; $color = "\167\63\55\x67\162\x65\x65\x6e"; } $html .= "\x3c\151\x6e\x70\x75\x74\x20\164\171\x70\145\75\x22\x68\x69\x64\x64\x65\156\42\40\151\144\75\42\141" . $i . "\x22\40\156\x61\155\x65\75\x22\144\x6f\143\42\40\166\141\154\x75\x65\x3d\42" . $dtfac->documento . "\x22\x3e\74\151\x6e\160\165\x74\x20\164\171\x70\x65\75\x22\150\151\x64\144\x65\x6e\x22\40\156\x61\155\145\x3d\x22\x73\x74\x61\164\x75\163\x22\40\166\141\154\x75\x65\75\42" . $dtfac->status . "\42\x3e\12\x20\40\x20\40\x20\40\x20\x20\x3c\x74\144\x3e" . $i . "\x3c\x2f\164\x64\76\x3c\164\x64\76\74\x69\x6e\x70\165\164\40\164\171\x70\x65\x3d\42\x63\x68\x65\x63\x6b\142\x6f\170\42\x20\157\x6e\143\154\x69\x63\153\75\42\167\63\x2e\164\x6f\147\x67\154\x65\x43\x6c\x61\x73\x73\x28\47\x23\x73\154\x65\x63\164" . $i . "\47\x2c\x27\167\x33\55\x79\145\154\154\x6f\x77\47\x29\x3b\x22\x20\143\x6c\x61\x73\x73\x3d\x22\167\x33\x2d\x63\x68\145\x63\x6b\x22\x20\x6e\x61\155\x65\x3d\x22\143\150\145\143\153\42\76" . $dtfac->documento . "\74\57\164\144\x3e\x3c\x74\144\76" . $dtfac->codcliente . "\74\57\x74\144\x3e\74\x74\144\76" . $dtfac->nombrecli . "\x3c\57\x74\x64\76\74\164\x64\x3e" . $dtfac->sector . "\74\57\164\144\x3e\x3c\164\x64\x3e" . $vend->nombre . "\74\x2f\164\144\x3e\x3c\x74\144\76" . $nom->nomape . "\74\57\x74\144\76\x3c\x74\x64\76" . $dtfac->unidades . "\74\57\x74\144\x3e\74\x74\x64\76" . $dtfac->timeaut . "\74\57\x74\144\x3e\x3c\x74\x64\x3e" . $dtfac->timeasig . "\74\x2f\x74\x64\76\74\164\x64\x3e" . $dtfac->timeemp . "\x3c\57\x74\144\76\74\164\x64\x20\x63\154\141\x73\163\x3d\x22" . $color . "\x20\167\x33\55\x63\x65\x6e\164\145\162\42\76" . $status . "\x3c\x2f\164\144\76\12\40\x20\x20\x20\40\x20\x20\40\x3c\57\164\162\76"; } $html .= "\x3c\164\162\76\x3c\164\x64\40\143\x6c\x61\163\163\75\42\x77\x33\x2d\143\145\156\x74\x65\162\x20\x77\63\x2d\146\x6f\x6e\x64\x6f\x64\162\x6f\x69\x64\42\x20\143\157\154\x73\x70\x61\156\x3d\x22\x31\62\42\x3e\x3c\x6c\x61\x62\x65\154\40\143\154\141\163\163\x3d\x22\167\x33\x2d\154\x61\x72\147\x65\x22\x3e\x3c\142\76\x54\x6f\164\141\x6c\40\x55\156\x69\144\141\144\x65\163\x3a\x20" . $tunid->n . "\x3c\57\142\76\x3c\x2f\154\141\x62\145\x6c\76\x3c\57\x74\144\76\x3c\57\x74\162\x3e\74\x2f\164\x61\142\x6c\145\76"; return $html; } public function itfac($a) { $this->load->library("\164\141\x62\x6c\145"); $bditfac = $this->db->query("\x53\105\114\x45\x43\x54\40\x63\x2e\143\x6f\144\151\147\157\x2c\40\x63\x2e\x6e\x6f\155\142\x72\x65\x2c\x20\122\x4f\x55\116\x44\50\143\x2e\x63\141\x6e\164\151\144\x61\x64\54\62\x29\40\x63\141\156\164\151\x64\x61\x64\54\40\x63\x2e\x73\164\141\164\x75\x73\54\x63\56\154\x6f\164\145\40\x46\x52\117\x4d\x20\157\160\145\x72\x6d\x76\40\101\x53\x20\143\40\x57\110\x45\122\x45\40\x63\x2e\x64\x6f\143\165\x6d\x65\156\x74\x6f\75\x27{$a}\47\x3b")->result(); $nom = $this->db->query("\x53\105\x4c\x45\103\x54\x20\141\x2e\x6e\157\x6d\x61\x70\145\x2c\x20\142\56\163\x63\141\156\x20\106\x52\117\115\x20\164\x72\141\x62\40\141\x73\x20\141\40\112\117\x49\x4e\x20\143\157\156\164\162\x6f\154\137\x6f\x70\145\x72\x74\151\40\x61\x73\40\x62\x20\x4f\x4e\40\x61\x2e\x69\144\x3d\142\x2e\x74\162\x61\142\145\155\160\x61\161\40\x57\110\x45\122\105\x20\x62\x2e\x64\x6f\143\75\47{$a}\47")->row(); if ($nom->scan == 0) { $scan = "\116\x6f\162\x6d\141\154"; } else { $scan = "\122\141\x70\151\x64\157"; } $html = "\xa\40\40\x20\x20\x3c\164\141\x62\x6c\x65\x20\x63\x6c\x61\x73\x73\x3d\42\x77\x33\55\164\141\x62\x6c\x65\x2d\141\154\154\40\167\x33\55\x68\157\166\145\162\x61\x62\154\x65\x20\x77\63\55\x6c\145\146\x74\55\x61\154\x69\147\x6e\42\76\12\40\40\40\x20\74\x74\x72\x3e\xa\x20\x20\40\40\x3c\164\144\x20\143\x6c\x61\163\x73\x3d\x22\x77\x33\x2d\x66\x6f\156\144\157\x64\162\x6f\x69\144\x22\76\x41\x73\x69\147\x6e\141\x64\157\x3a\74\x2f\x74\144\x3e\12\x20\x20\40\40\74\x74\144\76" . $nom->nomape . "\x3c\x2f\164\x64\x3e\12\40\40\40\40\74\x74\x64\x20\143\154\141\x73\x73\x3d\42\x77\x33\55\x66\x6f\x6e\x64\x6f\144\x72\157\151\x64\42\76\115\157\144\157\40\x53\143\141\156\x6e\145\x72\x3a\74\x2f\164\x64\x3e\12\40\40\x20\x20\x3c\164\x64\40\x6f\156\144\142\154\x63\x6c\x69\143\x6b\75\x22\x6d\x6f\x64\x73\143\x61\x6e\x28\47" . $a . "\x27\51\x22\40\151\144\75\42\x73\145\154\145\143\164\x73\x63\141\156\x22\x3e" . $scan . "\74\x2f\164\x64\x3e\x3c\x2f\x74\162\x3e\12\x20\x20\40\x20\74\57\164\141\x62\x6c\x65\76\74\142\x72\76\xa\40\40\40\x20\x3c\x74\141\x62\x6c\x65\x20\143\154\141\163\163\x3d\x22\167\x33\x2d\164\x61\x62\x6c\145\55\x61\x6c\x6c\x20\167\63\x2d\150\x6f\x76\145\162\141\142\154\145\40\x77\63\x2d\154\145\146\x74\x2d\x61\x6c\151\x67\x6e\40\x77\63\55\164\151\x6e\171\42\76\x3c\164\x72\40\143\x6c\141\x73\163\x3d\x22\x77\x33\x2d\x66\157\156\144\157\x64\x72\x6f\151\144\42\x3e\x3c\x74\x68\x3e\x43\x6f\144\x69\147\x6f\74\x2f\x74\x68\x3e\x3c\164\150\x3e\116\x6f\155\142\x72\145\x3c\57\x74\150\x3e\74\164\x68\x3e\x43\141\156\x74\x69\x64\x61\x64\x3c\57\x74\150\x3e\74\164\150\x3e\114\x6f\164\145\74\57\164\150\x3e\x3c\164\150\x3e\105\x73\x74\x61\164\x75\x73\74\57\x74\150\x3e\x3c\x2f\x74\x72\76"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "\120\x65\156\x64\x69\x65\x6e\164\x65"; $color = "\167\x33\55\162\145\144"; } elseif ($dtitfac->status == 1) { $status = "\x4c\x69\163\164\157"; $color = "\x77\x33\x2d\147\162\145\145\x6e"; } $html .= "\74\x74\x72\x3e\x3c\x69\156\160\165\164\x20\x74\x79\160\145\75\x22\x68\151\x64\144\x65\156\x22\x20\x69\x64\75\x22\144\x6f\x63\42\40\x76\141\154\x75\x65\75\x22" . $a . "\42\x3e\x3c\151\x6e\160\165\164\40\164\x79\x70\145\75\x22\150\151\x64\x64\145\156\x22\x20\151\144\75\42\x63\x6f\144\x6d\145\144" . $i . "\42\x20\x76\141\x6c\x75\145\x3d\x22" . $dtitfac->codigo . "\42\x3e\74\x69\x6e\160\165\164\40\164\171\160\x65\75\x22\150\x69\x64\144\x65\156\42\x20\151\144\75\42\143\x61\156\164" . $i . "\x22\40\x76\x61\154\x75\x65\x3d\42" . $dtitfac->cantidad . "\42\x3e\12\40\40\40\40\x20\40\40\40\74\164\x64\76" . $dtitfac->codigo . "\x3c\x2f\164\144\76\x3c\164\x64\x3e" . $dtitfac->nombre . "\x3c\57\x74\x64\76\x3c\164\x64\x3e" . $dtitfac->cantidad . "\74\57\164\144\x3e\74\x74\144\x3e" . $dtitfac->lote . "\x3c\57\x74\x64\x3e\x3c\164\x64\x20\x63\x6c\141\x73\x73\x3d\42" . $color . "\40\167\63\x2d\143\145\156\x74\145\x72\x22\76" . $status . "\74\57\x74\x64\76\xa\x20\40\40\40\x20\40\x20\x20\74\x2f\x74\x72\x3e"; } $html .= "\x3c\57\x74\141\x62\154\145\x3e"; return $html; } public function editscan($a, $b) { $dt = array("\163\143\x61\x6e" => $b); $this->db->where("\x64\x6f\x63", $a)->update("\143\157\x6e\164\162\157\154\x5f\x6f\x70\x65\x72\x74\x69", $dt); if ($this->db->affected_rows() > 0) { $this->loguser("\105\x6d\160\141\161\165\x65\x74\x61\x64\x6f", "\105\x6c\x20\165\163\x75\141\x72\151\157\40\x63\x61\x6d\142\151\157\x20\x65\x6c\x20\x6d\157\144\157\x20\x64\x65\40\x53\x43\x41\116\40\x70\141\162\x61\40\x65\154\x20\144\x6f\x63\165\155\145\x6e\x74\x6f\x20" . $a . "\x2e"); } return $this->db->affected_rows(); } public function asignaped($a, $b) { $datos = array("\163\164\x61\164\x75\x73" => "\x31", "\x74\x72\141\142\x65\x6d\x70\x61\x71" => $b, "\164\x69\x6d\145\x61\163\151\x67" => date("\131\55\155\55\144\x20\x48\72\151\x3a\163")); $this->db->where("\144\157\143", $a)->UPDATE("\x63\x6f\x6e\164\x72\157\x6c\x5f\157\x70\145\x72\164\151", $datos); if ($this->db->affected_rows() > 0) { $this->loguser("\x45\x6d\160\141\161\165\145\x74\141\144\157", "\x45\154\x20\165\163\165\x61\x72\151\x6f\x20\141\163\151\147\156\x6f\40\x61\x6c\x20\164\162\x61\142\141\152\141\x64\157\162\40" . $b . "\40\160\141\162\141\x20\x65\x6c\40\144\157\143\x75\x6d\x65\x6e\x74\157\40" . $a . "\x2e"); } return $this->db->affected_rows(); } public function elim_almped($a, $b, $c, $d) { $val = $this->db->query("\123\105\114\x45\103\124\40\116\x55\x4c\114\40\106\x52\x4f\x4d\x20\x6f\x70\x65\162\155\x76\40\127\x48\105\x52\x45\40\144\157\x63\165\155\x65\x6e\x74\157\75\47{$a}\47")->num_rows(); if ($val > 1) { $this->db->query("\x44\105\114\x45\124\105\x20\x46\x52\117\x4d\40\x6f\160\145\162\155\166\x20\x57\110\x45\x52\105\40\x64\x6f\143\165\x6d\145\x6e\x74\x6f\x3d\x27{$a}\x27\40\46\x26\40\x63\157\x64\x69\147\157\x3d\47{$b}\x27\40\x26\46\x20\x61\x6c\155\x61\143\145\156\x3d\x27{$d}\x27\40\46\x26\40\143\x61\156\x74\151\x64\x61\x64\75\x27{$c}\x27\40\114\111\x4d\x49\x54\40\61"); $this->db->query("\125\120\104\x41\124\105\40\141\162\164\x69\143\x75\x6c\x6f\40\x73\x65\x74\x20\x63\x6f\x6d\160\x72\x6f\x6d\145\x74\151\144\x6f\75\143\x6f\155\160\162\x6f\155\145\x74\x69\144\x6f\55{$c}\40\x57\110\105\x52\105\x20\143\157\x64\151\147\x6f\x3d\47{$b}\x27"); if ($this->db->affected_rows() > 0) { $this->loguser("\105\x6c\151\x6d\151\x6e\141\162", "\105\154\x20\165\x73\x75\141\x72\x69\157\40\145\154\151\x6d\151\x6e\157\40\145\x6c\40\160\x72\157\144\165\x63\x74\157\40" . $b . "\x20\143\x6f\x6e\x20\154\x61\x20\x63\141\x6e\164\x69\x64\141\144\40" . $c . "\54\40\160\x61\x72\141\40\x65\x6c\x20\x64\157\x63\165\155\x65\x6e\164\x6f\40" . $a . "\56"); } } return $this->db->affected_rows(); } public function modcantalmped($a, $b, $c, $d) { $this->db->query("\125\x50\x44\x41\x54\105\40\157\160\x65\162\x6d\x76\x20\x53\105\x54\x20\x63\141\156\x74\x69\144\x61\144\x3d\x27{$d}\47\54\x20\141\x75\170\x31\75\47{$d}\x27\x20\x57\x48\105\122\x45\x20\144\x6f\143\x75\x6d\x65\156\164\x6f\75\47{$a}\47\40\x26\46\x20\143\x6f\x64\151\x67\x6f\x3d\x27{$b}\47\40\46\x26\x20\x63\141\156\x74\151\x64\141\x64\75\x27{$c}\47"); if ($d > $c) { $r = $d - $c; $this->db->query("\125\120\104\x41\124\x45\x20\x61\162\x74\x69\143\165\x6c\x6f\40\x73\145\x74\x20\143\x6f\x6d\x70\162\x6f\x6d\145\164\151\x64\x6f\x3d\143\x6f\x6d\x70\162\x6f\155\145\164\x69\144\157\x2b{$r}\40\127\x48\105\x52\x45\40\x63\x6f\144\x69\147\157\75\47{$b}\47"); } else { $r = $c - $d; $this->db->query("\x55\x50\104\101\x54\105\40\x61\x72\x74\151\143\x75\154\157\x20\x73\x65\x74\40\143\157\x6d\160\162\157\x6d\145\x74\151\144\x6f\75\143\x6f\155\x70\x72\157\155\x65\x74\x69\x64\x6f\x2d{$r}\40\127\x48\x45\122\x45\40\143\x6f\x64\x69\147\x6f\x3d\47{$b}\x27"); } if ($this->db->affected_rows() > 0) { $this->loguser("\x4d\x6f\144\151\x66\x69\143\141\162\40\x43\x61\156\x74\x69\x64\141\x64", "\105\x6c\40\165\x73\165\x61\x72\x69\x6f\40\143\141\155\x62\x69\157\40\x6c\141\x20\143\x61\156\x74\x69\144\141\x64\x20\x64\x65\x6c\x20\160\x72\x6f\x64\x75\x63\x74\x6f\x20" . $b . "\x2c\40\x64\x65\40" . $c . "\40\x61\40" . $d . "\x2c\40\x70\x61\x72\x61\x20\145\x6c\40\144\x6f\x63\165\155\145\156\x74\157\x20" . $a . "\56"); } return $this->db->affected_rows(); } public function modprcalmped($a, $b, $c, $d) { $db = $this->db->query("\123\x45\114\105\103\124\x20\50\151\155\x70\165\x65\x73\164\x6f\61\57\x31\60\x30\x29\x2b\x31\x20\151\166\x61\x2c\50\144\163\x63\x74\x6f\137\x6d\145\x64\151\x63\x61\155\145\156\164\157\x73\x2f\61\x30\60\51\40\x64\x65\163\x63\x75\40\40\106\122\117\115\40\141\x72\164\x69\x63\x75\x6c\157\x20\127\110\x45\x52\x45\40\143\x6f\x64\x69\147\157\75\47{$b}\47")->row(); $preciofin = ($d - $d * $db->descu) * $db->iva; $this->db->query("\x55\x50\104\x41\124\105\x20\x6f\x70\x65\x72\x6d\166\40\123\105\x54\x20\160\x72\145\x63\x69\157\x6f\x72\151\147\x69\156\x61\154\x3d\x27{$d}\47\x20\x57\x48\105\122\105\40\x64\x6f\143\165\155\145\156\164\157\x3d\x27{$a}\47\40\46\x26\x20\x63\x6f\144\x69\x67\157\x3d\47{$b}\47\x20\x26\46\40\143\141\156\x74\151\144\141\144\x3d\47{$c}\47"); if ($this->db->affected_rows() > 0) { $this->db->query("\x55\120\x44\x41\x54\x45\40\x61\x72\164\x69\160\x72\x65\143\40\x53\x45\124\40\160\x72\145\x63\151\x6f\x31\x3d\x27{$d}\47\54\160\162\x65\x63\151\157\146\x69\156\x31\75\x27{$preciofin}\x27\40\127\x48\105\x52\105\40\x63\157\144\151\147\x6f\x3d\x27{$b}\x27\x20\x26\x26\40\x66\145\143\150\141\75\143\x75\162\x64\x61\x74\x65\50\x29"); $this->loguser("\x4d\x6f\144\151\146\x69\143\141\x72\x20\x50\162\x65\x63\151\157", "\x45\154\40\x75\163\x75\x61\162\151\157\40\x63\141\x6d\142\151\x6f\x20\x65\154\x20\160\x72\x65\143\x69\157\x20\144\x65\x6c\x20\160\x72\x6f\144\165\x63\x74\x6f\40" . $b . "\40\160\157\x72\40" . $d . "\x2c\x20\160\141\x72\141\x20\x65\x6c\40\x64\157\143\x75\x6d\x65\156\164\157\40" . $a . "\x2e"); } return $this->db->affected_rows(); } public function almetiq() { $bd = $this->db->query("\x53\x45\x4c\105\x43\124\x20\x63\56\143\157\144\x69\147\157\x2c\x20\x63\x2e\163\165\x62\143\157\x64\x69\147\157\x2c\x63\x2e\163\165\x62\x73\x65\x63\x74\x6f\162\40\x7a\157\x6e\141\54\40\103\117\125\116\x54\50\145\56\x69\144\51\40\142\x75\x6c\164\157\163\12\40\x20\x20\40\x46\122\117\115\x20\x73\x75\142\x73\x65\x63\164\157\x72\x65\163\40\101\x53\40\x63\x20\x4a\x4f\111\x4e\x20\x6f\x70\145\162\164\x69\40\x41\123\x20\144\40\x4f\x4e\40\50\x63\56\x63\157\x64\x69\147\157\75\124\122\111\115\50\x64\56\x73\x65\143\164\157\162\x29\x20\x26\46\40\143\56\163\165\142\143\x6f\144\x69\147\x6f\75\124\122\x49\x4d\x28\x64\56\163\165\x62\x63\157\144\x69\x67\x6f\x29\x29\40\xa\x20\40\x20\x20\x4a\x4f\111\x4e\40\143\157\156\164\x72\157\x6c\137\x6f\x70\x65\x72\x74\151\40\101\x53\40\x66\40\x4f\116\40\144\56\x61\x6e\164\x64\x6f\143\75\146\x2e\144\157\x63\xa\x20\x20\40\x20\x4a\x4f\111\x4e\x20\x62\165\154\164\157\x73\40\101\123\x20\x65\40\x4f\x4e\40\x66\56\144\x6f\x63\x3d\145\56\144\157\x63\12\x20\x20\40\40\127\110\105\x52\x45\x20\50\144\56\x74\151\160\157\x64\x6f\143\75\x27\106\101\x43\47\x20\x7c\x7c\40\144\x2e\164\x69\160\157\x64\157\x63\x3d\x27\116\x4f\x54\x27\51\40\46\x26\x20\146\56\163\x74\x61\164\x75\x73\x3d\x27\62\47\40\x26\x26\x20\x28\x66\56\162\x65\x70\141\162\x74\157\x20\111\123\40\116\x55\114\114\x20\x7c\x7c\40\x66\56\162\145\x70\141\162\x74\157\75\60\51\40\x26\x26\40\x53\x55\x42\x53\124\122\50\144\56\143\x6f\x64\143\x6c\151\145\x6e\x74\x65\x2c\x31\x2c\63\x29\41\x3d\47\x49\x4e\124\x27\x20\46\46\40\x64\x2e\146\x65\143\150\x61\143\162\x65\141\x3e\75\x44\x41\x54\x45\x5f\123\125\x42\50\x63\165\x72\x64\x61\x74\145\x28\x29\x2c\x49\116\124\x45\122\126\101\x4c\40\x31\x30\x20\x44\x41\x59\51\x20\107\122\117\x55\120\x20\x42\x59\x20\x63\x2e\143\157\144\151\147\x6f\x2c\143\x2e\163\165\142\143\157\x64\151\147\x6f\73")->result(); $html = "\xa\40\x20\x20\x20\x3c\x74\x61\x62\154\145\x20\143\x6c\141\163\x73\x3d\42\x77\63\x2d\164\x61\x62\154\145\x2d\141\154\154\40\167\x33\55\150\157\x76\x65\x72\141\x62\154\x65\x20\x77\x33\x2d\154\x65\146\x74\x2d\141\154\x69\147\156\x22\x3e\xa\40\x20\40\x20\x3c\164\x64\x20\143\154\141\x73\x73\75\x22\x77\63\x2d\x63\145\x6e\164\145\162\x20\x77\x33\x2d\142\x74\156\42\x3e\x3c\x61\40\x6f\156\x63\x6c\151\x63\153\75\x22\145\x74\x69\161\165\145\164\141\x72\50\x29\42\76\x3c\151\155\147\x20\163\162\143\x3d\42" . base_url() . "\151\x6d\x61\x67\145\x73\57\x69\155\x70\x2e\x70\156\x67\x22\x20\141\154\x74\75\x22\x41\x73\151\x67\156\x61\x72\42\x20\164\151\164\x6c\145\75\42\x41\x73\151\x67\156\x61\162\42\x20\163\x74\x79\x6c\145\75\x22\x77\151\144\x74\150\x3a\62\60\x70\x78\x3b\x68\145\x69\147\150\x74\72\x32\x30\x70\170\x3b\x62\157\162\x64\145\162\x3a\x30\73\x22\x3e\x3c\57\x61\76\74\57\164\x64\76\12\40\40\x20\40\x3c\x74\x64\x20\x63\x6c\x61\x73\163\x3d\x22\x77\63\x2d\143\x65\x6e\x74\145\x72\40\167\63\55\142\x74\x6e\x22\x3e\74\x61\x20\157\x6e\x63\154\151\143\x6b\x3d\42\x61\154\x6d\145\164\x69\161\50\x29\73\42\76\x3c\151\155\147\x20\x73\x72\143\75\42" . base_url() . "\151\155\x61\x67\x65\x73\x2f\x72\x65\154\x6f\x61\x64\x2e\x70\x6e\x67\x22\x20\141\x6c\x74\x3d\x22\x52\x65\x63\141\x72\x67\141\x72\x22\x20\x74\x69\164\x6c\x65\75\42\x52\x65\x63\x61\162\x67\x61\x72\42\x20\163\164\x79\154\x65\75\x22\x77\x69\x64\x74\150\72\x32\60\160\170\73\150\145\x69\147\x68\164\72\62\60\x70\170\x3b\x62\157\162\x64\x65\x72\x3a\x30\x3b\42\x3e\74\57\x61\x3e\74\57\x74\144\76\x3c\57\164\162\x3e\12\x20\40\x20\40\74\57\x74\141\x62\154\145\76\x3c\142\162\76\12\x20\40\x20\40\x3c\164\141\142\154\x65\40\151\144\75\x22\x69\144\x30\61\42\x20\x63\x6c\141\163\x73\x3d\x22\167\63\55\164\x61\x62\x6c\x65\x2d\141\x6c\154\40\x77\x33\55\150\157\x76\145\162\141\x62\x6c\145\40\167\x33\x2d\x6c\x65\x66\x74\x2d\x61\x6c\x69\147\x6e\40\167\x33\55\x74\x69\156\171\x22\76\74\x74\162\x20\x63\x6c\x61\x73\x73\x3d\42\x77\x33\55\146\157\x6e\144\157\144\x72\x6f\151\144\42\76\74\x74\150\76\103\157\144\x69\x67\157\x3c\57\164\x68\76\74\x74\x68\x3e\123\x75\142\x63\x6f\144\151\x67\x6f\74\57\x74\x68\76\74\164\150\x3e\x5a\x6f\x6e\x61\74\57\x74\x68\x3e\74\x74\x68\76\x42\165\x6c\164\x6f\x73\x3c\57\x74\x68\76\x3c\57\x74\162\76"; $i = 0; foreach ($bd as $dt) { $i++; $html .= "\x3c\164\162\40\143\x6c\141\x73\x73\x3d\x22\x69\x74\145\155\42\x20\x6f\x6e\x63\x6c\x69\143\153\75\42\151\164\145\164\x69\161\50\x24\x28\47\43\x61" . $i . "\47\51\x2e\166\141\154\50\51\x29\x3b\42\x3e"; if ($dt->bultos < 10) { $color = "\x77\x33\x2d\162\145\144"; } elseif ($dt->bultos < 20) { $color = "\x77\x33\x2d\x70\x61\x6c\x65\x2d\x79\x65\x6c\x6c\x6f\167"; } elseif ($dt->bultos > 20) { $color = "\x57\x33\55\147\x72\145\x65\x6e"; } $html .= "\x3c\x69\156\x70\x75\164\x20\164\x79\x70\145\75\42\x68\151\x64\x64\145\156\x22\x20\151\144\75\42\141" . $i . "\x22\40\156\141\155\145\75\42\143\x6f\144\x22\40\x76\141\x6c\x75\145\75\x22" . $dt->codigo . $dt->subcodigo . "\42\x3e\xa\40\x20\x20\40\40\x20\x20\x20\74\x74\x64\76" . $dt->codigo . "\x3c\57\x74\x64\x3e\74\164\x64\x3e" . $dt->subcodigo . "\x3c\x2f\164\144\76\x3c\164\144\x3e" . $dt->zona . "\x3c\x2f\164\144\x3e\74\x74\144\40\143\x6c\x61\x73\163\x3d\x22" . $color . "\42\76" . $dt->bultos . "\74\x2f\164\144\76\xa\40\40\x20\40\40\40\40\40\74\x2f\x74\162\76"; } $html .= "\x3c\57\164\141\142\x6c\x65\76\xa\x20\40\x20\40\12\40\x20\x20\40\12\40\x20\x20\40"; return $html; } public function itetiq($a) { $bdetiq = $this->db->query("\123\x45\114\x45\103\124\x20\x61\56\144\157\x63\x75\155\x65\156\164\157\54\x61\x2e\146\145\x63\150\x61\143\x72\x65\141\x2c\x20\141\x2e\x6e\157\155\x62\x72\x65\x63\154\151\54\x20\x61\56\143\x6f\x64\x63\154\x69\x65\156\x74\x65\40\54\x43\117\116\x43\x41\124\50\143\56\x69\x64\54\143\56\x64\157\143\x2c\143\x2e\x6e\165\x6d\51\40\xa\x20\40\x20\x20\142\165\x6c\164\x6f\40\x46\122\x4f\115\40\x6f\x70\x65\162\164\151\40\x41\x53\x20\141\x20\xa\40\x20\x20\40\x4a\117\111\x4e\40\x63\x6f\156\x74\x72\157\154\137\x6f\x70\145\x72\164\x69\40\x41\123\40\142\x20\117\x4e\40\141\56\x61\x6e\x74\x64\157\143\x3d\x62\x2e\x64\x6f\x63\xa\x20\x20\x20\x20\112\x4f\x49\116\x20\142\165\x6c\x74\157\163\x20\x41\x53\x20\x63\x20\117\x4e\40\142\x2e\x64\x6f\143\75\143\56\x64\157\143\40\12\x20\x20\40\x20\x57\x48\x45\x52\x45\x20\50\x61\x2e\x74\x69\160\157\144\x6f\x63\x3d\x27\106\101\x43\47\x20\174\x7c\x20\x61\x2e\x74\x69\x70\157\x64\157\143\75\x27\116\x4f\x54\x27\x29\x20\46\46\x20\142\x2e\163\164\x61\x74\x75\x73\x3d\47\62\x27\x20\40\x26\46\40\x53\x55\x42\123\124\122\x28\x61\56\x63\157\x64\143\x6c\151\145\156\164\x65\x2c\61\54\63\51\x21\x3d\47\111\x4e\x54\47\x20\46\x26\x20\103\117\116\x43\x41\124\x28\x54\x52\111\115\x28\x61\x2e\163\145\143\x74\157\x72\x29\54\124\122\x49\115\x28\x61\56\x73\x75\142\x63\x6f\x64\x69\x67\x6f\51\x29\x3d\x27{$a}\x27\x3b")->result(); $html = "\x3c\x61\40\x6f\156\x63\x6c\x69\143\153\75\42\156\x6f\145\x74\x69\161\x28\x27" . $a . "\x27\51\x3b\x22\40\x63\154\x61\163\x73\x3d\x22\167\x33\x2d\142\x74\156\x22\x3e\74\151\x6d\147\40\x73\162\143\75\x22" . base_url() . "\151\x6d\x61\147\145\x73\x2f\144\145\x73\143\x61\162\164\x65\56\x70\x6e\147\42\40\141\x6c\164\75\42\x4e\x6f\x20\x45\164\151\161\x75\145\x74\141\162\x22\40\x74\151\164\154\145\x3d\42\x4e\x6f\x20\x45\x74\151\x71\165\x65\x74\141\162\42\x20\x73\164\171\154\x65\75\42\x77\x69\144\x74\x68\72\62\x30\160\170\x3b\x68\145\x69\147\x68\x74\x3a\x32\x30\x70\170\73\x62\157\162\144\x65\x72\x3a\60\x3b\42\x3e\74\x2f\x61\76\xa\x20\x20\40\x20\x3c\142\x72\76\x3c\151\x6e\160\x75\x74\40\157\x6e\151\x6e\160\165\x74\x3d\x22\x77\x33\x2e\x66\151\x6c\164\x65\x72\x48\x54\x4d\x4c\x28\x27\43\151\x64\x30\61\47\54\x20\x27\56\151\164\145\x6d\61\x27\x2c\40\164\150\151\x73\56\x76\x61\x6c\x75\145\x29\42\x20\143\x6c\141\163\163\x3d\42\x77\63\x2d\x69\x6e\160\165\164\42\x20\160\154\141\143\x65\150\157\x6c\144\145\162\x3d\42\x42\x75\163\143\141\162\40\106\141\x63\x74\165\x72\141\42\x3e\74\142\x72\x3e\x3c\164\141\x62\x6c\145\x20\143\154\141\x73\163\75\x22\167\x33\x2d\164\x61\142\x6c\x65\55\x61\x6c\x6c\x20\167\63\55\150\x6f\x76\145\x72\x61\142\x6c\145\x20\x77\x33\55\x6c\145\x66\x74\55\141\154\151\x67\156\40\167\x33\x2d\164\151\x6e\x79\42\x20\151\144\x3d\42\151\144\x30\61\42\x3e\74\164\x72\x20\143\154\x61\x73\x73\x3d\x22\x77\63\x2d\x66\157\156\x64\x6f\144\x72\157\x69\144\x22\76\x3c\x74\150\x3e\74\x69\156\160\x75\164\x20\164\x79\160\145\x3d\x22\x63\150\145\x63\x6b\142\157\x78\42\40\156\x61\155\145\x3d\42\x6f\160\164\143\x68\145\143\x6b\42\40\x63\x6c\141\x73\x73\x3d\x22\x77\x33\55\143\150\145\143\x6b\42\40\x6f\156\x63\x6c\x69\x63\153\x3d\x22\163\145\x6c\x65\x63\x74\x6f\144\x6f\x28\47\143\150\x65\143\x6b\x27\51\x3b\42\x3e\104\157\143\74\x2f\x74\x68\x3e\x3c\164\x68\76\106\145\143\150\x61\x3c\x2f\164\150\x3e\x3c\x74\150\76\x4e\157\x6d\142\162\x65\x3c\x2f\x74\x68\76\74\164\x68\x3e\103\157\x64\151\147\157\74\57\x74\x68\76\74\x74\150\76\x56\x65\x6e\x64\145\x64\x6f\162\x3c\x2f\x74\150\76\74\x74\150\76\102\x75\x6c\x74\x6f\x73\x3c\x2f\164\150\x3e\x3c\57\x74\x72\x3e"; $i = 0; foreach ($bdetiq as $dtetiq) { $i++; $vend = $this->db->query("\123\105\114\105\103\124\x20\142\56\x6e\157\x6d\x62\162\x65\x20\x46\122\117\115\40\x6f\x70\x65\x72\x74\x69\40\141\163\40\x61\x20\x4a\x4f\111\x4e\x20\x6c\x69\163\x74\x76\145\x6e\144\x20\x61\163\x20\x62\x20\117\116\x20\x61\56\166\145\156\144\x65\144\157\162\x3d\142\56\143\157\x64\151\147\x6f\x20\x57\x48\105\x52\105\40\141\x2e\x64\157\143\165\155\x65\156\164\x6f\x3d\47{$dtetiq->documento}\47\40\114\x49\x4d\111\124\40\61")->row(); $html .= "\74\x74\162\x20\143\154\141\163\x73\x3d\x22\151\164\145\x6d\x31\42\40\x69\144\75\42\x73\x6c\x65\x63\164\x32" . $i . "\x22\x20\156\141\155\145\x3d\x22\x73\145\154\x65\x63\42\76\74\151\156\160\165\x74\40\x74\x79\160\x65\x3d\42\150\x69\144\144\145\x6e\x22\40\156\141\x6d\x65\x3d\x22\144\157\x63\x22\x20\x76\141\154\165\x65\x3d\42" . $dtetiq->bulto . "\42\x3e\x3c\151\156\x70\165\x74\x20\164\x79\160\145\x3d\42\150\x69\144\x64\x65\x6e\x22\x20\x6e\141\x6d\x65\75\x22\144\157\143\x32\42\40\x76\x61\154\x75\x65\x3d\x22" . $dtetiq->documento . "\x22\x3e\12\x20\x20\40\40\40\x20\40\40\x3c\x74\144\x3e\x3c\151\156\160\x75\x74\40\x74\171\x70\145\75\42\x63\150\x65\143\153\142\157\x78\x22\x20\x6f\156\143\154\151\x63\x6b\x3d\x22\x77\x33\x2e\x74\157\147\147\x6c\145\103\x6c\x61\x73\163\50\47\43\x73\154\x65\x63\164" . $i . "\x27\54\47\x77\x33\55\x79\x65\x6c\x6c\157\167\47\x29\73\x22\x20\143\x6c\141\163\163\x3d\42\167\63\55\x63\x68\x65\143\153\42\40\x6e\141\155\145\75\x22\x63\150\x65\143\153\x22\x3e" . $dtetiq->documento . "\x3c\x2f\164\x64\x3e\x3c\164\144\76" . $dtetiq->fechacrea . "\x3c\57\164\x64\x3e\74\x74\144\76" . $dtetiq->nombrecli . "\74\x2f\164\144\76\x3c\164\x64\76" . $dtetiq->codcliente . "\74\57\164\x64\76\74\164\x64\76" . $vend->nombre . "\x3c\57\x74\144\x3e\74\x74\x64\76" . $dtetiq->bulto . "\x3c\57\164\144\76\74\x2f\x74\x72\x3e"; } $html .= "\x3c\57\x74\141\142\154\145\76"; return $html; } function noetiq($a) { $doc = $this->db->query("\123\x45\114\105\103\x54\40\141\x6e\x74\x64\157\143\x20\156\x20\x46\x52\117\115\x20\157\160\145\162\164\151\40\127\110\x45\x52\145\x20\144\x6f\143\x75\x6d\145\156\x74\x6f\x3d\x27{$a}\47\40\46\x26\x20\50\x74\x69\x70\x6f\x64\x6f\x63\x3d\x27\x46\x41\103\47\40\174\x7c\x20\164\151\x70\157\x64\x6f\x63\x3d\47\x4e\x4f\x54\x27\x29")->row(); if ($doc->n != '') { $this->db->query("\125\x50\104\x41\124\105\x20\x63\157\x6e\164\162\x6f\154\137\x6f\160\145\162\x74\151\x20\x73\x65\164\x20\x73\164\x61\164\165\163\75\63\x2c\162\x65\160\141\162\x74\x6f\75\x31\x20\127\x48\105\x52\x45\40\144\x6f\x63\x3d\47{$doc->n}\47"); } return $this->db->affected_rows(); } public function etiquetas($a, $b) { $table1 = ''; $table2 = ''; $html = ''; $j = 0; for ($i = 0; $i <= $b; $i++) { $j++; if ($a[$i] != '') { $bdetiq = $this->db->query("\123\x45\114\x45\x43\x54\x20\x61\56\144\x6f\x63\x75\x6d\x65\x6e\x74\x6f\x2c\141\x2e\x73\145\143\164\x6f\162\x2c\x20\141\x2e\141\x6e\164\x64\157\143\54\40\x61\56\156\157\x6d\142\162\145\x63\154\x69\54\40\x61\56\x63\157\144\x63\154\x69\145\x6e\x74\145\40\x2c\x43\x4f\x4e\x43\x41\x54\50\x62\56\151\144\x2c\x62\x2e\x64\x6f\143\x2c\142\x2e\x6e\165\x6d\x29\x20\x62\165\154\x74\x6f\54\40\x63\56\x69\x64\x20\x46\x52\x4f\115\x20\x6f\x70\x65\162\x74\x69\x20\101\123\40\x61\40\xa\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\x4a\117\111\x4e\40\142\165\x6c\x74\x6f\x73\x20\x41\x53\40\x62\x20\x4f\116\40\x61\56\141\x6e\164\144\x6f\x63\75\x62\56\144\157\x63\40\xa\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\112\117\111\116\x20\143\157\x6e\164\162\x6f\x6c\x5f\157\160\x65\162\x74\x69\x20\x41\123\x20\143\40\x4f\x4e\x20\141\x2e\141\x6e\x74\x64\x6f\143\75\143\56\144\157\x63\12\x20\40\40\40\40\40\40\x20\x20\x20\40\40\127\x48\105\122\105\x20\x28\x61\x2e\x74\x69\x70\157\144\x6f\143\75\x27\106\101\x43\47\40\x7c\174\40\x61\56\164\x69\160\157\144\x6f\143\x3d\47\116\117\124\x27\51\x20\x26\46\x20\x43\x4f\116\103\101\x54\50\x62\x2e\151\144\54\x62\x2e\x64\x6f\x63\54\x62\x2e\156\x75\155\51\75\47{$a[$i]}\x27\40"); $rows = $b / 2; foreach ($bdetiq->result() as $dtetiq) { $sector = $this->db->query("\123\x45\114\105\x43\x54\x20\x7a\157\x6e\141\x20\106\122\117\115\40\163\145\x63\164\x6f\x72\x65\x73\40\x57\110\x45\x52\105\x20\x63\157\144\x69\147\x6f\x3d\47{$dtetiq->sector}\x27")->row(); $barra = $this->genebarra($dtetiq->bulto, 1, 20); if ($j <= $rows) { $table1 .= "\x3c\164\141\x62\x6c\145\x20\143\154\x61\163\x73\x3d\42\x77\x33\55\164\x61\x62\154\145\x2d\x61\x6c\x6c\40\167\x33\55\x63\x65\x6e\x74\x65\x72\145\144\x22\40\x73\164\x79\x6c\x65\75\42\x6d\141\x72\147\151\x6e\x2d\164\x6f\160\72\61\x25\x3b\142\157\162\144\x65\162\55\x73\x74\x79\x6c\x65\72\156\x6f\156\145\73\42\76\74\x74\162\76\x3c\x74\144\76\x53\145\x63\164\157\x72\72\x20" . $dtetiq->sector . "\x20" . $sector->zona . "\x20\104\157\143\x75\x6d\145\156\164\x6f\x3a\40" . $dtetiq->documento . "\x20\103\x6c\x69\145\156\164\145\x3a\x20" . $dtetiq->nombrecli . "\74\x2f\164\144\x3e\x3c\57\x74\162\76\74\x74\162\76\74\x74\144\76\x3c\x64\151\166\x20\x73\164\171\154\145\x3d\42\155\141\162\147\x69\156\55\154\x65\x66\x74\72\63\x35\45\42\76" . $barra . "\74\57\144\151\166\76\74\x2f\164\144\x3e\74\57\x74\x72\x3e\x3c\x2f\x74\141\x62\154\145\x3e"; } else { $table2 .= "\74\164\141\x62\x6c\x65\x20\x63\154\x61\163\163\75\x22\167\x33\x2d\x74\141\x62\154\x65\55\x61\x6c\154\x20\167\63\55\143\145\156\x74\145\x72\145\x64\42\40\x73\164\171\154\x65\x3d\42\x6d\141\162\147\x69\156\x2d\164\x6f\x70\72\61\x25\73\142\157\162\x64\145\162\55\x73\x74\x79\x6c\145\72\x6e\157\156\145\x3b\42\x3e\74\164\162\76\x3c\164\x64\76\123\x65\143\164\157\x72\72\40" . $dtetiq->sector . "\40" . $sector->zona . "\40\104\x6f\x63\x75\155\x65\156\164\x6f\72\x20" . $dtetiq->documento . "\x20\x43\154\x69\145\156\x74\x65\72\x20" . $dtetiq->nombrecli . "\74\x2f\164\x64\76\74\57\164\162\76\x3c\x74\162\76\x3c\x74\144\76\x3c\x64\151\x76\x20\x73\164\x79\154\145\75\42\x6d\141\x72\147\x69\156\x2d\x6c\x65\x66\164\72\x33\65\x25\42\x3e" . $barra . "\74\x2f\x64\151\166\76\x3c\57\x74\x64\76\74\x2f\x74\x72\76\74\57\x74\141\142\x6c\145\x3e"; } if ($table1 != '' || $table2 != '') { $this->db->query("\125\120\x44\101\124\x45\x20\x63\157\156\x74\x72\157\154\137\x6f\160\145\x72\x74\x69\x20\123\x45\x54\40\163\164\141\164\x75\163\x3d\47\x33\47\x20\127\110\105\122\x45\x20\151\144\75\x27{$dtetiq->id}\x27"); if ($this->db->affected_rows() > 0) { $this->loguser("\105\164\151\161\165\145\164\141\162", "\x45\154\x20\165\163\x75\x61\162\151\x6f\40\x63\x72\145\x6f\40\154\141\40\x65\164\151\161\165\x65\164\141\40\144\145\154\40\x62\x75\x6c\164\157\40" . $a[$i] . "\x20\160\x61\162\x61\40\145\154\x20\144\157\143\165\155\145\x6e\164\157\40" . $dtetiq->documento . ''); } } } } } $style = "\xa\x20\x20\40\40\x3c\x68\164\x6d\x6c\x3e\74\x68\x65\x61\x64\x3e\74\155\145\x74\141\x20\x63\x68\141\x72\x73\145\164\75\42\125\x54\x46\x2d\70\x22\x3e\74\x6d\x65\x74\141\40\x68\164\164\160\x2d\x65\161\165\151\x76\75\x22\x58\x2d\x55\x41\x2d\x43\x6f\x6d\160\141\164\x69\x62\x6c\145\42\x20\143\x6f\x6e\x74\145\x6e\164\x3d\42\x49\x45\x3d\x65\x64\x67\145\x22\76\x3c\155\x65\x74\x61\x20\156\141\155\x65\75\42\166\x69\145\x77\x70\157\x72\x74\x22\40\x63\157\x6e\x74\x65\156\164\x3d\42\x77\x69\x64\164\x68\x3d\x64\x65\x76\x69\143\145\x2d\167\x69\x64\164\150\x2c\x20\x69\156\151\x74\151\141\154\55\163\143\x61\x6c\145\75\x31\x2e\x30\x22\x3e\x3c\154\151\x6e\153\x20\162\x65\154\75\x22\x73\164\x79\x6c\x65\x73\150\x65\x65\164\42\x20\x68\x72\x65\146\75\42\141\163\163\x65\164\x73\57\x63\x73\x73\57\167\63\x2e\x63\163\163\x22\76\74\x2f\x68\x65\x61\144\76\74\142\x6f\x64\171\76"; $html .= "\12\x20\40\40\x20" . $style . "\xa\40\40\40\x20\74\x64\151\166\40\143\x6c\141\163\x73\75\42\x77\63\55\150\x61\154\x66\42\x20\163\164\x79\154\145\x3d\42\167\151\144\164\x68\72\65\x30\45\x22\x3e" . $table1 . "\74\x2f\144\x69\x76\76\xa\x20\40\40\x20\x3c\144\151\166\x20\x63\154\141\163\x73\75\x22\x77\63\x2d\150\x61\x6c\x66\42\x20\163\x74\x79\x6c\x65\x3d\42\167\x69\144\164\150\72\65\x30\45\x3b\155\141\162\x67\x69\156\x2d\154\x65\x66\x74\72\x32\x2e\x35\45\42\x3e" . $table2 . "\74\x2f\x64\x69\x76\x3e\xa\x20\40\x20\40\x3c\57\142\x6f\144\x79\x3e\xa\x20\x20\x20\40\74\x2f\x68\164\155\x6c\76\xa\40\x20\x20\x20"; return $html; } public function almcarg() { $bd = $this->db->query("\x53\x45\114\x45\x43\x54\x20\x63\56\143\x6f\144\x69\147\157\x2c\x63\x2e\163\x75\x62\x63\x6f\144\151\147\x6f\54\x20\143\x2e\163\x75\x62\x73\145\143\x74\157\x72\x20\172\x6f\x6e\141\54\x20\103\117\125\116\124\x28\145\56\151\144\51\40\x62\x75\154\164\157\x73\xa\x20\x20\x20\x20\106\x52\x4f\x4d\40\163\165\x62\x73\145\143\164\x6f\162\x65\163\40\x41\x53\40\x63\x20\112\117\x49\x4e\40\157\x70\145\x72\x74\x69\40\x41\x53\x20\x64\x20\x4f\x4e\40\50\x63\x2e\x63\x6f\x64\x69\x67\x6f\x3d\x54\122\111\x4d\50\x64\56\x73\x65\143\x74\157\x72\x29\40\x26\x26\40\143\56\x73\x75\142\x63\157\144\151\147\x6f\x3d\x54\122\111\x4d\50\144\56\163\165\142\x63\x6f\144\151\147\157\51\51\x20\x20\12\x20\40\40\x20\x4a\117\x49\116\x20\142\x75\154\x74\x6f\163\40\101\123\40\x65\x20\x4f\x4e\x20\145\x2e\144\x6f\x63\75\144\x2e\141\156\164\x64\x6f\x63\xa\x20\x20\40\40\x4a\x4f\x49\116\40\x63\157\x6e\x74\162\x6f\x6c\x5f\x6f\x70\x65\162\x74\x69\40\x41\x53\40\x66\40\117\116\x20\x64\x2e\141\156\164\144\157\x63\x3d\x66\x2e\x64\x6f\x63\12\40\40\x20\40\x57\x48\105\122\105\x20\x28\x64\x2e\x74\x69\160\157\x64\157\x63\x3d\47\x46\x41\x43\x27\x20\x7c\x7c\40\x64\56\164\151\x70\157\x64\x6f\143\x3d\x27\x4e\117\124\x27\x29\x20\46\x26\x20\x66\56\x73\x74\141\x74\165\163\x3d\x27\63\47\x20\46\46\x20\x28\146\56\162\145\x70\x61\162\x74\157\x3d\x27\x30\47\x20\40\x7c\174\x20\146\x2e\x72\145\x70\x61\x72\164\x6f\40\111\123\x20\116\125\114\x4c\x29\40\46\46\40\123\125\102\x53\124\x52\x28\x64\x2e\x63\157\144\143\x6c\151\x65\156\164\145\x2c\x31\x2c\63\x29\x21\75\47\111\x4e\x54\x27\40\x26\46\x20\144\56\x66\145\143\x68\x61\x63\x72\x65\x61\x3e\x3d\x44\x41\124\x45\137\x53\125\102\50\x63\x75\162\144\141\164\145\50\x29\x2c\111\x4e\124\x45\122\126\101\114\40\x31\60\40\104\x41\x59\x29\x20\x47\122\117\125\120\x20\x42\x59\x20\x63\56\x63\157\x64\151\x67\157\x2c\x63\56\163\x75\142\143\157\144\x69\x67\157\73")->result(); $bdchofer = $this->db->query("\123\105\x4c\x45\x43\124\40\141\x2e\x69\144\x2c\x20\141\x2e\x6e\x6f\x6d\x61\x70\x65\40\x46\122\117\x4d\x20\x74\x72\141\142\x20\101\123\x20\x61\x20\127\x48\105\x52\x45\x20\x61\56\164\x69\x70\75\x31")->result(); $chofer = "\74\157\x70\x74\151\x6f\156\40\x76\x61\154\x75\x65\x3d\42\x22\40\163\x65\x6c\145\143\x74\145\x64\40\144\151\x73\141\142\154\x65\144\76\x53\x65\154\145\x63\143\151\x6f\156\145\x3c\x2f\x6f\x70\x74\x69\x6f\156\x3e"; foreach ($bdchofer as $dtchofer) { $chofer .= "\74\x6f\160\164\x69\157\x6e\40\166\x61\x6c\165\145\75\x22" . $dtchofer->id . "\x22\76" . $dtchofer->nomape . "\x3c\x2f\x6f\160\x74\x69\x6f\156\x3e"; } $bdvehi = $this->db->query("\123\x45\x4c\x45\103\x54\40\151\x64\54\x20\x64\145\x73\143\162\151\160\40\106\122\x4f\x4d\x20\x76\145\x68\151\143\x20\127\x48\105\x52\x65\40\163\x74\x61\x74\165\x73\x3d\x27\123\x27")->result(); $vehi = "\74\157\160\164\151\x6f\x6e\x20\166\141\x6c\165\145\x3d\42\x22\40\x73\145\x6c\x65\143\x74\x65\144\40\144\x69\163\141\142\x6c\145\144\76\x53\x65\x6c\145\143\x63\x69\x6f\x6e\x65\x3c\57\157\x70\x74\151\x6f\x6e\76"; foreach ($bdvehi as $dtvehi) { $vehi .= "\x3c\157\x70\164\151\157\156\40\166\141\x6c\165\145\75\x22" . $dtvehi->id . "\x22\76" . $dtvehi->descrip . "\74\57\x6f\160\164\151\157\156\76"; } $html = "\12\40\40\x20\x20\74\x74\141\x62\x6c\x65\x20\x63\154\141\163\163\x3d\x22\x77\63\55\x74\x61\x62\x6c\x65\x2d\141\x6c\x6c\40\167\x33\55\x68\x6f\x76\x65\162\x61\x62\x6c\145\x20\167\x33\x2d\x6c\x65\x66\x74\55\141\154\x69\x67\156\x22\76\12\x20\x20\40\x20\74\164\x72\40\x63\154\141\x73\163\75\42\167\63\55\146\x6f\156\144\x6f\x64\162\x6f\151\144\42\76\74\x74\150\76\103\150\157\x66\x65\x72\x20\x31\74\x2f\164\150\76\74\164\150\x3e\103\150\x6f\x66\145\x72\x20\x32\x3c\x2f\164\x68\76\74\164\x68\76\126\145\x68\151\143\x75\154\x6f\x3c\x2f\x74\x68\76\74\x74\150\76\74\57\164\150\x3e\74\x74\150\x3e\x3c\57\164\150\76\74\57\x74\162\76\12\x20\x20\40\40\74\164\x72\76\74\x74\144\76\74\x73\145\x6c\145\143\x74\40\x63\154\x61\x73\163\x3d\42\167\x33\55\x73\145\x6c\x65\x63\x74\42\x20\151\x64\x3d\42\x74\x72\141\x62\x63\x61\162\147\61\x22\76" . $chofer . "\x3c\57\x73\145\x6c\x65\143\164\76\74\x2f\x74\144\76\xa\40\x20\40\40\x3c\164\144\x3e\x3c\x73\x65\x6c\145\143\x74\x20\x63\154\141\x73\163\75\42\167\63\x2d\163\x65\x6c\x65\x63\164\x22\x20\x69\144\x3d\42\164\x72\141\x62\x63\x61\162\x67\x32\x22\x3e" . $chofer . "\74\57\x73\x65\x6c\x65\143\x74\x3e\74\x2f\164\144\76\12\x20\40\40\40\74\x74\x64\x3e\74\x73\145\154\145\x63\164\x20\x63\154\141\163\163\75\42\x77\63\55\163\145\154\145\x63\164\x22\40\151\144\x3d\x22\166\x65\x68\151\x22\x3e" . $vehi . "\74\57\x73\145\154\x65\143\x74\76\74\57\x74\x64\76\12\x20\40\x20\x20\x3c\164\x64\40\x63\x6c\141\x73\x73\75\x22\167\63\x2d\x63\145\x6e\164\145\x72\40\167\x33\55\x62\164\156\42\x3e\x3c\141\x20\157\156\143\154\151\143\153\x3d\42\x61\163\x69\147\x6e\141\x63\141\x72\147\x28\x29\x22\x3e\x3c\151\x6d\147\40\x73\162\x63\x3d\42" . base_url() . "\151\155\141\x67\145\163\57\x62\156\56\160\x6e\147\x22\x20\141\154\164\x3d\42\x41\x73\151\x67\x6e\x61\x72\x22\40\164\151\164\154\145\x3d\x22\101\163\151\147\156\141\x72\42\x20\x73\164\x79\154\x65\x3d\42\x77\x69\x64\164\x68\72\x32\60\x70\x78\x3b\x68\x65\x69\147\150\x74\72\62\60\160\170\73\x62\x6f\x72\x64\145\162\72\x30\73\42\x3e\x3c\x2f\x61\x3e\x3c\x2f\x74\x64\x3e\xa\40\40\40\x20\x3c\x74\x64\40\x63\x6c\141\x73\163\75\x22\x77\x33\x2d\143\145\156\x74\145\162\40\167\x33\55\x62\x74\x6e\42\x3e\74\141\40\x6f\x6e\143\154\x69\x63\153\75\x22\141\x6c\x6d\x63\x61\x72\x67\x28\x29\73\42\76\74\x69\x6d\147\40\x73\x72\x63\x3d\x22" . base_url() . "\151\155\141\147\145\x73\x2f\x72\145\154\157\141\144\x2e\160\156\147\42\x20\x61\x6c\x74\x3d\42\122\x65\x63\141\x72\147\141\162\x22\x20\164\x69\164\154\145\75\x22\122\x65\143\x61\x72\147\x61\x72\42\x20\x73\164\x79\x6c\x65\x3d\42\167\151\x64\164\x68\72\x32\x30\160\170\x3b\x68\145\x69\147\150\x74\x3a\x32\60\x70\170\x3b\x62\157\162\144\x65\x72\72\x30\73\x22\x3e\74\x2f\x61\76\x3c\57\164\144\76\x3c\x2f\164\162\x3e\12\40\40\40\40\74\57\x74\141\x62\x6c\145\x3e\x3c\x62\162\76\12\40\x20\40\x20\74\164\x61\142\154\x65\40\x69\144\75\42\151\x64\60\x31\42\40\x63\x6c\x61\163\x73\75\x22\x77\63\55\164\141\142\154\145\x2d\x61\154\x6c\x20\x77\x33\x2d\150\x6f\166\145\x72\x61\142\154\145\40\167\x33\55\x6c\145\146\x74\x2d\141\x6c\151\147\x6e\x20\x77\63\x2d\x74\151\x6e\x79\x22\76\74\x74\x72\40\x63\154\x61\163\163\75\42\167\x33\55\x66\157\x6e\x64\157\144\x72\157\x69\144\x22\76\74\x74\150\x3e\103\x6f\x64\151\147\157\74\57\164\150\x3e\74\x74\x68\76\123\165\x62\56\103\x6f\x64\x69\x67\157\x3c\x2f\x74\x68\x3e\x3c\164\150\76\x5a\x6f\x6e\141\74\57\164\150\x3e\74\x74\x68\x3e\x42\165\154\x74\157\x73\x3c\x2f\x74\150\x3e\x3c\x2f\x74\162\x3e"; $i = 0; foreach ($bd as $dt) { $i++; $html .= "\74\164\162\x20\x6f\156\x63\x6c\x69\143\x6b\x3d\x22\x69\x74\143\141\162\x67\50\44\50\47\43\x61" . $i . "\x27\51\x2e\x76\x61\154\50\51\x29\x3b\42\76"; if ($dt->bultos < 10) { $color = "\x77\63\x2d\x72\x65\x64"; } elseif ($dt->bultos < 20) { $color = "\x77\63\55\160\x61\x6c\x65\55\171\145\154\x6c\x6f\167"; } elseif ($dt->bultos > 20) { $color = "\127\x33\x2d\147\x72\145\x65\x6e"; } $html .= "\x3c\151\x6e\x70\165\x74\40\164\171\x70\x65\x3d\42\150\x69\x64\144\145\x6e\x22\40\x69\x64\75\x22\141" . $i . "\x22\40\156\x61\x6d\145\75\42\x63\157\144\42\x20\x76\x61\x6c\165\145\75\x22" . $dt->codigo . $dt->subcodigo . "\x22\x3e\xa\x20\40\40\x20\x20\x20\x20\x20\74\164\144\x3e" . $dt->codigo . "\74\x2f\x74\144\x3e\x3c\x74\x64\76" . $dt->subcodigo . "\x3c\57\164\x64\x3e\74\x74\x64\x3e" . $dt->zona . "\74\x2f\164\x64\76\x3c\x74\144\x20\x63\154\141\x73\x73\x3d\42" . $color . "\x22\76" . $dt->bultos . "\x3c\x2f\164\x64\x3e\12\x20\40\x20\40\40\40\40\40\74\x2f\x74\162\x3e"; } $html .= "\x3c\57\x74\141\142\x6c\145\x3e\12\40\40\x20\40\12\x20\x20\x20\x20\12\x20\40\40\x20"; return $html; } public function itcarg($a) { $bdcarg = $this->db->query("\x53\x45\x4c\105\x43\x54\x20\142\56\x64\x6f\x63\54\x20\141\x2e\144\157\x63\x75\155\145\156\164\x6f\54\40\141\x2e\x6e\157\x6d\142\x72\x65\143\154\151\54\40\x61\x2e\143\157\144\143\x6c\151\145\156\x74\145\54\40\x61\x2e\166\145\156\x64\145\x64\x6f\x72\54\40\x43\117\125\116\124\x28\x62\56\x69\x64\x29\x20\12\40\x20\40\40\142\x75\154\x74\157\x73\40\106\122\x4f\x4d\x20\x6f\160\x65\162\164\151\x20\x41\123\x20\141\40\xa\x20\x20\40\x20\x4a\x4f\x49\116\x20\x62\165\x6c\164\157\x73\x20\101\123\x20\x62\40\117\116\40\x61\56\141\x6e\164\144\157\x63\75\x62\x2e\144\x6f\x63\40\xa\x20\x20\x20\40\112\117\x49\116\40\x63\x6f\156\x74\x72\157\154\x5f\157\160\145\162\164\x69\40\141\x73\40\x63\40\x4f\116\40\141\56\141\156\x74\144\x6f\143\75\x63\56\x64\x6f\x63\xa\40\40\40\x20\x57\x48\105\122\x45\40\50\x61\x2e\164\151\x70\x6f\144\x6f\x63\x3d\x27\106\101\103\47\x20\x7c\x7c\x20\141\56\x74\x69\160\x6f\x64\x6f\143\x3d\x27\116\117\x54\47\51\40\46\46\40\x63\x2e\163\164\141\x74\165\163\x3d\47\x33\x27\40\46\46\x20\103\117\x4e\x43\101\124\x28\124\x52\111\115\50\141\56\x73\x65\x63\x74\157\162\51\x2c\124\x52\x49\x4d\x28\x61\x2e\163\x75\142\143\157\x64\151\x67\x6f\51\x29\75\47{$a}\47\40\x26\x26\x20\50\x63\x2e\162\x65\160\141\x72\164\x6f\x3d\x30\x20\x7c\x7c\x20\x63\56\x72\x65\160\141\162\164\157\40\111\123\x20\116\125\x4c\114\x29\40\46\46\x20\123\x55\x42\x53\124\x52\x28\x61\56\x63\157\x64\x63\154\151\x65\x6e\164\145\x2c\61\54\63\51\x21\75\x27\111\x4e\x54\47\40\x47\x52\117\x55\120\40\102\131\x20\x62\56\x64\x6f\143\x3b")->result(); $html = "\x3c\142\162\x3e\74\151\x6e\160\x75\x74\x20\157\156\x69\156\x70\x75\164\75\x22\167\63\x2e\146\x69\154\x74\145\162\x48\x54\x4d\x4c\50\x27\43\x69\x64\x30\61\47\x2c\40\47\x2e\151\164\x65\155\x31\x27\54\40\164\150\x69\x73\x2e\166\141\x6c\x75\145\51\42\x20\x63\154\141\x73\x73\x3d\x22\x77\63\x2d\151\x6e\x70\165\164\42\40\x70\154\x61\x63\x65\x68\x6f\154\x64\x65\x72\x3d\x22\x42\x75\163\143\x61\x72\x20\x46\141\143\164\x75\x72\141\42\x3e\74\x62\162\76\74\x74\x61\142\154\x65\x20\x63\154\x61\163\163\75\x22\167\x33\55\164\x61\142\154\x65\x2d\141\154\x6c\40\167\x33\x2d\x68\x6f\x76\x65\x72\141\x62\154\x65\40\x77\63\x2d\154\145\146\164\55\x61\154\x69\x67\x6e\40\167\63\55\164\x69\x6e\171\x22\x20\x69\144\75\42\x69\144\60\x31\x22\x3e\74\164\162\x20\x63\154\141\163\163\x3d\42\x77\x33\55\x66\x6f\156\144\157\144\x72\x6f\x69\144\42\76\x3c\164\x68\x3e\x3c\x69\156\x70\165\164\x20\x74\171\160\x65\x3d\x22\143\x68\x65\x63\x6b\142\157\170\42\40\x6e\x61\x6d\145\75\42\157\x70\164\143\150\145\x63\x6b\x22\x20\143\154\x61\x73\x73\x3d\42\x77\x33\55\x63\150\x65\143\153\x22\x20\157\156\143\154\x69\x63\153\x3d\42\163\x65\154\x65\x63\x74\157\x64\157\50\47\x63\150\x65\143\x6b\47\51\73\x22\x3e\104\157\143\74\x2f\x74\x68\x3e\x3c\x74\150\76\116\x6f\155\142\x72\145\x3c\57\x74\x68\x3e\74\x74\x68\x3e\103\157\x64\151\147\157\x3c\x2f\x74\150\76\x3c\x74\x68\x3e\x56\145\x6e\x64\x65\x64\x6f\x72\x3c\57\x74\150\76\74\x74\x68\76\x42\165\x6c\164\157\163\74\57\164\x68\x3e\x3c\57\x74\162\x3e"; $i = 0; foreach ($bdcarg as $dtcarg) { $i++; $vend = $this->db->query("\x53\x45\x4c\x45\103\x54\x20\156\x6f\155\x62\x72\145\x20\106\122\x4f\x4d\x20\x6c\x69\x73\x74\166\145\156\x64\x20\x57\110\x45\122\x45\40\x63\157\x64\x69\147\x6f\75\47{$dtcarg->vendedor}\x27")->row(); $html .= "\74\164\x72\40\x63\154\x61\163\x73\75\42\x69\x74\x65\x6d\x31\x22\x20\x69\144\75\x22\x73\x6c\x65\143\164\62" . $i . "\42\40\156\141\x6d\145\75\x22\x73\x65\x6c\145\143\x22\76\x3c\151\156\160\x75\164\x20\164\171\160\x65\x3d\42\x68\151\144\x64\x65\156\x22\40\x69\x64\75\x22\x61" . $i . "\42\x20\156\x61\x6d\145\75\42\x64\x6f\x63\42\40\x76\x61\154\x75\145\x3d\x22" . $dtcarg->doc . "\42\x3e\74\151\156\x70\165\164\40\164\x79\160\145\x3d\42\x68\151\144\144\145\156\x22\x20\x69\x64\75\x22\x63\157\x64\42\40\x76\x61\154\165\145\75\x22" . $a . "\x22\76\74\x74\144\x3e\74\x69\x6e\x70\x75\164\40\x74\171\160\145\75\x22\143\x68\x65\143\x6b\142\157\x78\x22\x20\x6f\x6e\143\154\151\x63\153\x3d\x22\x77\63\56\x74\157\x67\x67\154\145\x43\154\x61\x73\163\50\x27\43\163\154\145\143\164" . $i . "\x27\x2c\x27\167\x33\x2d\x79\145\154\154\x6f\x77\47\x29\73\42\40\143\154\141\163\x73\75\42\x77\63\x2d\x63\x68\145\x63\x6b\42\x20\156\141\155\145\75\x22\143\x68\145\x63\153\42\x3e" . $dtcarg->documento . "\x3c\57\164\144\76\74\x74\x64\76" . $dtcarg->nombrecli . "\x3c\57\x74\144\x3e\74\164\144\x3e" . $dtcarg->codcliente . "\74\x2f\164\144\76\x3c\164\x64\76" . $vend->nombre . "\74\57\x74\144\x3e\x3c\164\144\x3e" . $dtcarg->bultos . "\x3c\x2f\164\144\x3e\x3c\57\164\x72\x3e"; } $html .= "\74\57\x74\141\x62\154\145\76"; return $html; } public function asignacarg($a) { $rep = $this->db->query("\x53\105\x4c\x45\x43\124\40\155\x61\170\x28\151\144\51\x20\x61\163\x20\151\144\x20\x46\122\117\115\40\x72\x65\x70\x61\x72\164\x6f")->row(); $this->db->query("\125\120\x44\x41\x54\x45\x20\x63\x6f\156\x74\162\157\x6c\137\x6f\x70\145\x72\164\151\40\x53\105\124\x20\x72\145\160\141\162\164\157\75\x27{$rep->id}\47\x20\x57\110\105\122\105\x20\x64\x6f\143\x3d\x27{$a}\x27"); if ($this->db->affected_rows() > 0) { $this->loguser("\x43\x61\162\x67\x61\162", "\105\x6c\x20\165\x73\x75\141\162\x69\x6f\40\x63\162\145\x6f\40\x65\154\x20\x72\145\160\x61\x72\x74\x6f\x20" . $rep->id . "\40\x70\141\162\141\40\x65\x6c\40\144\x6f\143\165\x6d\145\x6e\164\157\x20" . $a . ''); } return $this->db->affected_rows(); } public function almdesp() { $bd = $this->db->query("\123\x45\x4c\x45\x43\x54\40\141\x2e\x69\x64\x2c\x20\x61\x2e\163\164\x61\164\165\163\54\x20\141\56\x66\x65\143\150\54\141\56\x72\165\164\141\54\40\x43\x4f\125\116\124\50\145\x2e\x69\144\x29\x20\142\x75\154\x74\157\163\54\x20\x63\56\144\x65\x73\x63\x72\151\x70\x20\x61\163\40\x76\145\150\x69\x63\x75\x6c\157\54\x20\141\x2e\x63\150\157\146\145\x72\x31\54\x20\141\x2e\x63\150\157\x66\145\162\x32\54\x20\x49\106\50\141\x2e\143\x61\162\147\141\x64\x6f\40\111\x53\x20\x4e\125\x4c\x4c\x2c\47\116\57\101\47\x2c\141\56\143\x61\162\147\141\144\157\x29\40\x63\x61\162\147\141\x64\157\x2c\40\111\x46\50\x61\x2e\145\x6e\164\x72\x65\x67\x61\144\x6f\40\x49\x53\x20\x4e\x55\x4c\114\x2c\x27\x4e\57\101\x27\x2c\141\56\x65\156\164\x72\145\x67\141\x64\x6f\51\x20\x65\x6e\x74\x72\145\147\141\x64\x6f\x20\106\122\x4f\115\40\x72\145\160\x61\x72\x74\x6f\x20\101\123\40\x61\12\40\40\40\40\112\x4f\111\116\40\x63\x6f\156\x74\x72\x6f\154\x5f\157\x70\145\x72\164\x69\40\101\123\x20\144\x20\117\x4e\40\141\56\x69\x64\x3d\144\x2e\162\145\x70\x61\162\x74\x6f\12\40\40\40\40\112\117\111\x4e\x20\x62\x75\154\x74\157\163\x20\101\x53\x20\x65\40\117\116\40\x64\x2e\144\157\x63\75\145\56\x64\157\143\xa\40\40\x20\x20\x4a\117\x49\116\40\166\x65\150\x69\143\x20\x41\123\40\x63\40\117\x4e\40\141\56\166\x65\x68\x69\x63\x75\154\x6f\x3d\143\x2e\151\144\12\40\40\x20\40\x57\x48\105\x52\105\x20\x61\56\146\x65\143\150\x3e\x3d\x44\x41\x54\105\x5f\101\104\x44\50\103\125\x52\104\x41\124\105\50\51\54\x49\116\124\x45\x52\126\x41\114\x20\55\61\x35\x20\x44\101\x59\51\40\x47\122\117\x55\x50\40\x42\131\x20\141\56\151\x64")->result(); $html = "\xa\x20\40\x20\x20\74\x74\x61\142\x6c\x65\40\143\154\x61\163\163\75\x22\167\x33\55\x74\141\x62\x6c\145\55\x61\154\154\x20\167\63\x2d\150\x6f\166\x65\x72\141\142\x6c\x65\x20\167\63\55\154\145\x66\x74\55\x61\154\x69\147\156\42\76\12\40\40\40\40\74\164\x72\40\143\154\x61\163\x73\75\42\167\63\x2d\x66\157\156\144\x6f\144\162\x6f\x69\144\x22\76\74\164\x68\x3e\x45\x73\x74\141\x74\165\x73\x3c\x2f\x74\x68\76\74\x74\150\x3e\x42\x75\163\143\141\x72\x20\x3c\x69\155\147\x20\163\162\x63\75\42" . base_url() . "\151\155\141\147\x65\163\57\x62\x75\x73\x63\141\x72\x2e\x70\156\x67\42\40\141\154\x74\75\42\102\x75\x73\143\x61\162\42\40\164\151\x74\154\x65\x3d\42\x42\x75\x73\x63\141\x72\x22\40\x73\164\171\154\145\x3d\42\x77\151\x64\164\150\x3a\x31\70\x70\170\73\x62\x6f\x72\144\145\162\x3a\x30\73\x22\x3e\74\x2f\164\150\76\x3c\164\150\x3e\x46\x61\x63\x74\165\162\141\x3c\x2f\164\x68\x3e\x3c\x74\150\76\x3c\57\x74\150\76\74\x74\150\x3e\74\57\164\x68\x3e\x3c\x74\150\x3e\x3c\x2f\164\x68\76\74\x2f\x74\x72\x3e\xa\40\40\x20\x20\x3c\164\x72\76\74\x74\x64\76\74\x73\x65\154\145\x63\x74\40\143\154\141\163\x73\75\42\x77\x33\x2d\163\x65\154\x65\143\164\42\x20\151\x64\75\x22\166\x73\x74\141\164\x75\x73\42\40\157\156\x63\150\141\156\147\x65\x3d\x22\167\x33\x2e\146\x69\154\x74\145\x72\x48\x54\x4d\114\x28\47\x23\x69\x64\x30\x31\x27\54\x20\x27\x2e\x69\x74\145\x6d\47\54\x20\x74\150\151\163\x2e\166\141\x6c\x75\145\x29\x22\76\12\40\x20\40\40\x3c\x6f\x70\x74\x69\157\x6e\40\166\x61\x6c\x75\x65\75\x22\x22\40\163\x65\x6c\145\143\164\145\x64\40\x64\x69\x73\141\x62\x6c\x65\144\x3e\x53\145\x6c\x65\x63\x63\151\157\x6e\x65\74\x2f\157\x70\x74\151\x6f\156\x3e\74\157\x70\164\x69\x6f\x6e\x20\x76\141\x6c\165\x65\x3d\42\120\145\x6e\144\151\x65\x6e\164\145\42\x3e\x50\x65\156\x64\151\145\156\164\145\x3c\x2f\157\160\x74\x69\157\x6e\x3e\74\x6f\x70\x74\151\x6f\x6e\x20\x76\x61\x6c\165\145\75\42\101\x73\151\x67\x6e\141\x64\x6f\42\76\101\163\151\147\x6e\141\x64\157\x3c\57\x6f\160\164\151\157\156\x3e\x3c\157\160\x74\151\x6f\x6e\x20\x76\141\154\165\x65\x3d\x22\103\141\162\147\x61\144\x6f\x22\x3e\x43\141\162\147\x61\144\157\74\57\157\160\x74\151\157\x6e\x3e\x3c\157\x70\164\x69\157\156\x20\166\141\154\x75\145\75\x22\x45\x6e\40\x43\141\155\151\156\x6f\42\76\105\x6e\40\103\141\x6d\x69\156\x6f\x3c\57\157\160\x74\x69\157\156\x3e\x3c\157\160\x74\x69\157\x6e\40\x76\141\x6c\x75\145\x3d\42\x45\x6e\x74\162\x65\x67\x61\x64\x6f\x22\76\x45\x6e\x74\162\145\147\141\x64\x6f\74\57\157\x70\x74\x69\157\156\x3e\74\57\163\x65\x6c\145\143\164\76\74\x2f\164\x64\x3e\12\40\40\40\40\x3c\x74\x64\76\x3c\151\156\160\165\164\x20\x74\x79\x70\x65\x3d\x22\164\x65\x78\x74\x22\x20\143\154\141\163\163\x3d\42\167\63\x2d\151\x6e\160\165\x74\x22\x20\160\154\x61\x63\x65\x68\x6f\154\144\x65\162\x3d\42\111\x6e\147\162\x65\163\145\40\163\165\40\142\x75\163\161\165\145\x64\141\42\40\157\x6e\151\156\x70\x75\x74\75\x22\167\x33\56\x66\x69\x6c\x74\145\x72\110\x54\x4d\114\x28\47\43\151\144\x30\x31\47\54\40\47\x2e\x69\164\x65\155\x27\54\x20\x74\150\x69\163\x2e\x76\x61\154\x75\x65\51\42\x3e\74\x2f\164\144\x3e\74\164\x64\76\x3c\x69\x6e\160\165\164\40\x74\x79\160\145\75\42\x74\145\170\x74\42\x20\143\x6c\x61\163\x73\x3d\42\x77\x33\55\x69\x6e\x70\165\164\x22\40\160\x6c\x61\143\x65\x68\x6f\x6c\x64\145\162\x3d\42\x62\x75\x73\x63\x61\162\40\x66\141\x63\x74\x75\x72\x61\x22\x20\157\156\x63\x68\x61\x6e\147\x65\75\x22\x69\164\x64\145\163\x70\x28\x24\50\47\x23\x73\145\x61\162\143\150\x66\141\143\x27\x29\x2e\166\141\x6c\50\51\54\x27\116\x2f\101\47\x2c\x27\116\57\x41\x27\51\73\44\x28\x27\x23\x73\145\x61\x72\x63\150\x66\141\143\47\x29\56\166\141\x6c\x28\x27\47\x29\42\x20\151\x64\x3d\42\163\145\x61\x72\x63\x68\146\141\x63\x22\x3e\x3c\x2f\164\144\76\xa\40\x20\x20\40\74\41\55\55\x3c\x74\x64\40\x63\x6c\141\x73\x73\x3d\42\x77\63\x2d\x63\x65\156\164\145\x72\x20\x77\x33\55\x62\x74\156\x22\76\74\141\x20\x6f\156\x63\154\x69\x63\153\x3d\x22\141\163\151\x67\156\x61\144\145\x73\x70\50\x29\x22\x3e\74\151\155\x67\40\x73\x72\143\75\42" . base_url() . "\x69\x6d\141\x67\x65\163\x2f\142\x6e\x2e\160\x6e\x67\42\40\x61\x6c\164\x3d\x22\101\x73\x69\147\156\141\x72\x22\x20\x74\151\x74\154\145\75\42\101\x73\151\x67\x6e\141\x72\42\40\163\164\171\x6c\145\75\42\x77\x69\144\x74\150\x3a\x32\60\160\170\x3b\150\145\151\x67\x68\x74\72\62\60\160\x78\73\142\x6f\162\x64\145\162\72\60\x3b\x22\x3e\x3c\57\x61\x3e\x3c\57\164\144\x3e\55\x2d\76\12\40\40\40\x20\74\164\144\40\143\x6c\x61\x73\163\x3d\42\167\63\55\x63\x65\x6e\164\x65\162\40\x77\63\x2d\142\x74\156\x22\76\74\141\40\x6f\x6e\143\x6c\x69\143\x6b\75\42\147\165\x69\x61\x28\51\x3b\x22\76\x3c\x69\155\147\x20\x73\162\x63\75\x22" . base_url() . "\x69\x6d\141\147\x65\x73\57\151\155\x70\x2e\160\156\147\42\x20\141\154\164\x3d\42\107\165\151\141\x22\40\164\151\164\x6c\145\x3d\x22\x47\x75\151\x61\42\x20\163\164\x79\x6c\x65\75\42\x77\151\x64\164\x68\x3a\x32\60\160\x78\x3b\x68\145\151\147\x68\x74\72\x32\60\x70\170\73\142\157\x72\144\145\x72\x3a\x30\x3b\x22\x3e\74\x2f\141\76\74\x2f\x74\144\76\xa\x20\x20\40\40\74\x74\x64\x20\x63\x6c\141\163\x73\75\42\167\x33\x2d\x63\145\156\164\x65\x72\x20\x77\x33\x2d\x62\x74\x6e\42\76\x3c\x61\40\157\156\143\154\151\143\x6b\75\x22\141\154\x6d\144\x65\x73\x70\x28\51\73\x22\76\74\x69\155\147\40\163\162\x63\75\42" . base_url() . "\x69\x6d\x61\147\x65\163\57\x72\x65\154\157\141\144\56\160\x6e\147\42\x20\x61\x6c\x74\75\42\x52\145\x63\x61\162\147\x61\162\42\x20\164\x69\x74\154\145\x3d\42\122\145\x63\x61\x72\147\141\x72\42\x20\x73\164\x79\x6c\x65\75\x22\x77\151\144\164\150\x3a\x32\60\160\x78\x3b\150\145\x69\x67\150\x74\x3a\x32\x30\x70\170\x3b\142\x6f\x72\x64\145\162\x3a\x30\73\42\x3e\74\57\141\x3e\x3c\57\164\x64\x3e\74\x2f\164\162\76\12\x20\x20\x20\40\74\x2f\164\x61\x62\x6c\x65\x3e\x3c\x62\x72\x3e\xa\40\40\40\x20\x3c\164\x61\142\x6c\145\40\x69\144\x3d\x22\151\144\x30\x31\x22\40\143\154\141\163\x73\x3d\42\x77\63\x2d\x74\x61\142\x6c\x65\55\x61\154\x6c\40\x77\x33\x2d\x68\x6f\166\x65\x72\x61\x62\154\145\x20\167\63\55\154\x65\x66\x74\x2d\141\154\151\x67\156\40\167\63\55\x74\x69\x6e\x79\x22\76\74\164\162\x20\x63\154\x61\163\163\75\42\167\63\x2d\x66\157\x6e\144\157\144\x72\157\151\144\x22\76\x3c\x74\150\76\x49\x64\74\x2f\x74\x68\x3e\74\164\x68\76\105\163\x74\x61\165\164\163\x3c\x2f\164\x68\76\74\x74\x68\x3e\x46\145\x63\150\x61\74\57\x74\150\76\74\x74\x68\76\122\165\164\x61\x3c\57\164\x68\76\x3c\x74\150\x3e\x42\x75\154\x74\x6f\163\x3c\57\164\150\x3e\x3c\164\150\76\126\145\x68\x69\x63\x75\x6c\157\x3c\57\164\x68\76\x3c\164\x68\76\x43\x61\162\147\141\x64\x6f\74\x2f\x74\150\x3e\74\164\x68\76\x45\x6e\164\162\145\x67\x61\x64\x6f\x3c\x2f\164\150\x3e\x3c\57\x74\x72\76"; $i = 0; foreach ($bd as $dt) { $i++; $trab1 = $this->db->query("\x53\105\114\105\x43\x54\x20\141\x2e\156\157\155\141\160\x65\40\106\x52\117\x4d\40\164\x72\141\142\40\101\x53\x20\x61\40\127\110\x45\x52\x45\40\x69\144\x3d\47{$dt->chofer1}\x27")->row(); $trab2 = $this->db->query("\123\105\x4c\x45\x43\124\40\141\x2e\156\157\155\x61\160\145\x20\x46\x52\x4f\x4d\40\x74\x72\x61\x62\x20\x41\123\x20\x61\x20\127\x48\105\122\x45\40\151\144\75\x27{$dt->chofer2}\47")->row(); $html .= "\x3c\x74\x72\40\x69\x64\x3d\x22\x73\154\145\x63\164" . $i . "\42\40\x63\154\141\163\163\75\x22\151\x74\145\x6d\x22\40\x6f\156\143\x6c\151\x63\153\x3d\x22\x69\164\144\x65\x73\160\x28\44\50\47\x23\x61" . $i . "\x27\51\x2e\x76\x61\154\50\x29\x2c\44\x28\47\x23\142" . $i . "\47\x29\56\166\141\x6c\50\51\x2c\44\50\x27\x23\x63" . $i . "\47\51\x2e\x76\141\x6c\x28\x29\x29\x3b\42\x3e"; if ($dt->cargado == "\x4e\57\x41") { $color = "\167\63\x2d\162\145\144"; } else { if ($dt->cargado != "\x4e\57\x41") { $color = "\x77\x33\x2d\147\162\145\145\x6e"; } } if ($dt->entregado == "\x4e\57\x41") { $color2 = "\167\x33\x2d\x72\x65\x64"; } else { if ($dt->entregado != "\116\x2f\x41") { $color2 = "\x77\x33\55\x67\x72\x65\x65\156"; } } if ($dt->status == "\x30") { $color3 = "\x77\63\55\x72\145\144"; $status = "\x50\x65\x6e\x64\x69\145\x6e\x74\x65"; } elseif ($dt->status == "\x31") { $color3 = "\x77\63\x2d\x70\x61\x6c\x65\55\x79\x65\154\x6c\x6f\167"; $status = "\103\x61\x72\x67\x61\144\x6f"; } elseif ($dt->status == "\63") { $color3 = "\x77\63\x2d\154\151\155\145"; $status = "\x45\x6e\40\x43\141\155\151\x6e\157"; } elseif ($dt->status == "\x34") { $color3 = "\x77\63\55\147\162\145\145\156"; $status = "\105\x6e\164\x72\x65\x67\x61\x64\x6f"; } $html .= "\74\151\156\160\165\164\x20\x74\171\x70\x65\75\42\x68\151\x64\144\145\x6e\x22\x20\151\x64\x3d\x22\141" . $i . "\42\40\156\x61\155\145\75\x22\x69\144\x22\40\166\x61\154\x75\x65\75\x22" . $dt->id . "\x22\76\x3c\x69\x6e\x70\x75\x74\40\164\x79\x70\145\75\42\150\x69\x64\144\x65\x6e\x22\40\x69\144\x3d\x22\142" . $i . "\42\40\156\141\155\x65\x3d\42\164\162\x61\x62\61\x22\40\x76\x61\x6c\165\x65\x3d\42" . $trab1->nomape . "\42\76\74\x69\x6e\x70\165\x74\40\x74\171\160\x65\75\42\150\x69\144\144\145\x6e\42\40\151\144\x3d\42\143" . $i . "\42\x20\156\x61\x6d\x65\75\x22\x74\162\x61\x62\62\x22\x20\x76\x61\154\x75\145\75\42" . $trab2->nomape . "\x22\x3e\12\x20\x20\40\40\x20\x20\x20\40\x3c\x74\x64\76\x3c\x69\x6e\160\x75\164\x20\x74\171\160\x65\x3d\x22\143\150\145\143\153\142\x6f\x78\x22\x20\x6f\x6e\x63\x6c\x69\143\153\75\x22\x77\x33\x2e\164\157\147\147\154\145\x43\154\141\x73\x73\50\47\43\x73\154\145\x63\x74" . $i . "\x27\54\47\x77\x33\55\x79\145\154\154\x6f\167\47\x29\x3b\x22\40\x63\154\x61\x73\163\75\x22\x77\x33\x2d\143\150\x65\143\x6b\42\40\156\x61\155\145\75\42\x63\150\x65\x63\x6b\42\76" . $dt->id . "\74\x2f\164\x64\x3e\x3c\x74\144\x20\143\x6c\141\x73\x73\x3d\x22" . $color3 . "\42\76" . $status . "\x3c\57\164\144\x3e\74\x74\144\76" . $dt->fech . "\74\x2f\x74\144\76\74\x74\144\76" . $dt->ruta . "\x3c\x2f\x74\x64\x3e\74\164\x64\76" . $dt->bultos . "\74\x2f\x74\144\x3e\74\x74\x64\x20\x69\144\75\x22\156\145\167\x76\x65\150\151" . $i . "\42\x20\157\156\144\142\154\x63\154\x69\143\153\x3d\x22\x6e\x65\167\166\145\150\151\50\47" . $i . "\47\51\x3b\x22\76" . $dt->vehiculo . "\74\x2f\x74\x64\76\74\x74\x64\x20\x63\154\x61\x73\163\x3d\42" . $color . "\42\x3e" . $dt->cargado . "\x3c\x2f\164\x64\76\74\164\144\40\x63\154\141\x73\x73\x3d\42" . $color2 . "\42\76" . $dt->entregado . "\x3c\57\x74\x64\x3e\12\40\x20\40\x20\x20\40\x20\x20\74\x2f\x74\162\x3e"; } $html .= "\74\x2f\164\x61\142\x6c\145\x3e\12\x20\40\x20\x20\12\x20\40\x20\40\12\x20\x20\40\x20"; return $html; } public function itdesp($a, $b, $c) { $bddesp = $this->db->query("\x53\x45\x4c\105\x43\x54\x20\x63\x2e\144\x6f\x63\x2c\141\56\x64\157\143\x75\x6d\145\156\164\157\54\40\141\x2e\156\x6f\155\142\162\x65\143\x6c\151\54\40\x61\x2e\143\x6f\x64\143\154\x69\x65\156\x74\145\40\106\122\117\115\40\157\x70\x65\x72\164\151\40\101\x53\x20\141\x20\12\x20\x20\40\x20\112\x4f\x49\x4e\40\x63\x6f\156\164\x72\157\154\x5f\x6f\160\x65\162\164\151\40\141\x73\x20\143\40\117\x4e\40\141\56\x61\156\x74\144\x6f\143\x3d\143\56\144\157\x63\12\x20\x20\x20\x20\x57\110\x45\x52\105\40\x61\x2e\x74\151\x70\x6f\144\157\x63\x3d\x27\106\101\x43\x27\40\46\x26\x20\x63\56\163\164\x61\x74\165\x73\x3d\47\x33\47\40\x26\x26\40\x28\143\56\162\x65\x70\x61\x72\x74\157\75\47{$a}\x27\40\x7c\174\40\x61\x2e\x64\157\143\x75\155\145\156\164\x6f\75\47{$a}\x27\x29\40\x4f\x52\104\x45\x52\x20\102\x59\40\x61\56\144\x6f\x63\165\155\x65\156\x74\x6f")->result(); $idrep = $this->db->query("\123\105\114\x45\x43\x54\40\141\56\x69\144\x20\x46\x52\117\x4d\40\162\x65\160\141\x72\x74\157\x20\141\x20\x4a\x4f\111\116\x20\143\157\x6e\164\162\157\154\x5f\x6f\160\145\162\x74\x69\x20\142\x20\117\x4e\40\x61\x2e\x69\144\x3d\142\x2e\x72\145\160\x61\162\164\157\40\x4a\x4f\x49\116\40\x6f\160\x65\162\164\x69\40\143\40\117\116\x20\143\x2e\141\156\164\144\157\143\x3d\142\56\144\x6f\x63\x20\127\110\105\122\x45\x20\143\56\144\157\x63\x75\155\x65\x6e\164\157\75\x27{$a}\47"); if ($idrep->num_rows() > 0) { $didrep = $idrep->row(); $rep = $didrep->id; } else { $rep = $a; } $html = "\74\142\162\76\x3c\x69\156\160\x75\164\x20\x6f\156\151\x6e\x70\165\x74\75\x22\x77\63\56\146\151\154\164\x65\162\110\x54\x4d\x4c\50\47\x23\x69\x64\x30\x32\47\54\40\47\56\x69\164\x65\155\62\x27\x2c\x20\x74\150\x69\163\x2e\166\141\154\165\145\x29\x22\x20\x63\x6c\x61\163\163\x3d\x22\167\x33\55\x69\156\x70\x75\x74\x22\40\160\x6c\x61\x63\x65\x68\x6f\154\x64\x65\162\75\42\x42\165\x73\x63\x61\162\x20\x46\x61\x63\x74\165\162\x61\x22\76\74\142\x72\x3e\xa\x20\x20\x20\x20\x3c\164\x61\x62\x6c\x65\40\x63\154\141\163\163\75\x22\167\x33\x2d\x74\141\x62\154\x65\x2d\x61\x6c\x6c\x20\167\63\55\x68\x6f\x76\x65\162\x61\x62\x6c\x65\x20\167\x33\x2d\154\145\146\164\x2d\141\154\x69\x67\x6e\x22\x3e\xa\x20\40\40\40\x3c\x74\162\76\74\x74\x64\x20\143\x6c\141\x73\x73\75\x22\167\63\x2d\x66\x6f\156\144\x6f\x64\162\157\x69\144\x22\x3e\122\x65\160\x61\x72\164\x6f\x3c\x2f\x74\144\x3e\x3c\164\x64\76" . $rep . "\x3c\57\x74\x64\76\x3c\x74\144\x20\x63\154\x61\163\x73\x3d\42\167\x33\55\x66\x6f\x6e\x64\157\x64\x72\157\151\144\42\76\x43\150\x6f\146\145\x72\40\61\x3c\x2f\x74\x64\x3e\74\x74\x64\x20\151\x64\x3d\42\156\145\167\143\x68\157\146\61\x22\40\157\156\144\x62\154\x63\x6c\x69\143\x6b\75\x22\x6e\145\x77\143\x68\x6f\x66\x28\x31\x2c" . $a . "\51\x3b\x22\76" . $b . "\74\x2f\164\144\x3e\x3c\x74\x64\x20\143\x6c\x61\163\x73\x3d\x22\167\x33\x2d\146\157\156\x64\x6f\144\x72\157\x69\144\42\76\x43\x68\157\x66\145\x72\x20\x32\x3c\57\164\144\76\74\164\x64\x20\x69\x64\75\x22\156\x65\167\143\x68\x6f\x66\62\x22\x20\157\156\x64\x62\154\143\154\x69\x63\x6b\75\42\x6e\x65\x77\143\x68\157\146\50\62\x2c" . $a . "\x29\73\x22\76" . $c . "\x3c\57\164\144\x3e\x3c\164\144\40\x63\154\141\163\x73\75\42\167\x33\55\142\x74\x6e\42\x3e\74\x61\40\x6f\156\x63\x6c\151\143\153\75\x22\142\146\x61\143\162\x65\160\50\51\73\42\76\74\x69\x6d\147\x20\x73\162\143\75\42" . base_url() . "\151\x6d\x61\x67\x65\163\57\x62\x6f\162\162\141\162\56\x70\x6e\147\42\x20\163\x74\171\154\145\x3d\x22\167\151\x64\x74\150\72\61\x38\160\170\73\x68\x65\x69\147\150\164\x3a\x31\x38\160\x78\x3b\142\x6f\162\144\145\162\72\60\160\x78\x3b\x22\76\x3c\x2f\x61\x3e\x3c\57\164\144\76\x3c\57\x74\162\x3e\12\x20\x20\x20\40\74\x2f\164\x61\x62\x6c\145\76\74\x62\x72\76\xa\x20\40\40\x20\74\x74\141\x62\154\145\x20\143\154\141\x73\163\x3d\x22\x77\63\x2d\x74\141\x62\154\x65\55\141\x6c\x6c\x20\167\x33\55\150\x6f\x76\145\162\x61\142\154\x65\x20\x77\x33\55\x6c\145\146\x74\x2d\x61\x6c\x69\147\156\x20\167\63\55\164\151\156\x79\42\40\x69\144\x3d\x22\151\x64\x30\62\42\76\74\164\162\x20\143\154\x61\x73\x73\75\42\167\63\x2d\146\x6f\156\144\157\x64\162\157\151\x64\x22\76\74\x74\150\x3e\x44\157\x63\74\57\164\150\76\74\x74\150\x3e\116\157\155\x62\x72\x65\74\x2f\164\x68\x3e\74\164\150\76\103\x6f\x64\x69\147\157\74\57\x74\150\76\74\x74\150\x3e\102\x75\x6c\164\x6f\163\x3c\57\x74\x68\76\74\x74\x68\76\x43\141\x72\147\141\144\x6f\74\57\x74\150\x3e\74\164\150\x3e\105\x6e\164\162\x65\x67\141\x64\157\x3c\x2f\164\150\x3e\74\x2f\164\x72\x3e"; $i = 0; foreach ($bddesp as $dtdesp) { $i++; $bd = $this->db->query("\x53\x45\114\x45\x43\124\x20\103\x4f\x4e\x43\101\124\50\151\144\x2c\x64\x6f\x63\x2c\x6e\165\155\51\40\142\x75\x6c\x74\x6f\x2c\40\111\106\50\143\x61\162\147\141\144\157\x20\111\x53\40\116\125\x4c\x4c\54\47\x4e\x2f\101\x27\54\143\x61\162\147\141\x64\x6f\x29\40\x63\141\162\147\141\144\157\x2c\x20\111\106\x28\145\156\x74\162\x65\x67\x61\x64\157\x20\111\123\x20\x4e\125\x4c\x4c\x2c\x27\x4e\57\x41\x27\54\145\x6e\164\162\x65\147\x61\x64\x6f\51\x20\145\156\164\162\141\x67\141\144\157\x20\106\x52\117\x4d\x20\142\x75\154\164\x6f\x73\x20\127\x48\105\x52\x45\40\144\x6f\143\x3d\x27{$dtdesp->doc}\47")->result(); foreach ($bd as $dt) { if ($dt->cargado == "\116\57\x41") { $color = "\x77\63\x2d\162\145\x64"; } else { $color = "\x77\63\x2d\147\x72\x65\145\x6e"; } if ($dt->entregado = "\x4e\57\101") { $color2 = "\167\63\x2d\x72\x65\x64"; } else { $color2 = "\167\63\55\147\x72\145\x65\x6e"; } $html .= "\74\151\156\x70\x75\x74\x20\164\171\x70\145\75\x22\x68\x69\144\144\145\x6e\x22\x20\x6e\x61\x6d\145\75\x22\x64\x6f\x63\42\x20\166\x61\154\165\x65\75\x22" . $dtdesp->doc . "\x22\76\x3c\x69\x6e\160\165\x74\40\x74\171\160\145\75\42\150\151\144\x64\145\x6e\x22\x20\151\144\75\x22\x72\x65\x70\x22\40\x76\141\x6c\x75\x65\x3d\x22" . $rep . "\x22\x3e\74\x74\162\x20\x63\154\x61\163\x73\75\x22\151\x74\x65\155\x32\42\40\151\144\x3d\42\163\x6c\x65\143\x74\62" . $i . "\42\x3e\74\x74\x64\76\74\x69\156\x70\165\x74\40\164\x79\x70\145\75\42\x63\150\145\143\x6b\142\157\170\42\40\x6f\156\143\154\151\143\153\75\42\x77\x33\x2e\x74\157\x67\147\154\145\x43\154\x61\163\x73\50\47\x23\163\x6c\145\143\x74\x32" . $i . "\47\x2c\x27\167\x33\55\171\145\154\x6c\x6f\x77\47\51\73\42\x20\143\x6c\x61\x73\163\75\42\167\63\x2d\143\x68\x65\x63\x6b\42\x20\156\141\x6d\x65\x3d\x22\143\150\145\x63\153\62\42\76" . $dtdesp->documento . "\74\57\164\x64\x3e\74\164\x64\x3e" . $dtdesp->nombrecli . "\x3c\57\x74\x64\x3e\x3c\164\144\76" . $dtdesp->codcliente . "\x3c\57\164\x64\76\74\x74\144\x3e" . $dt->bulto . "\74\57\164\x64\x3e\x3c\x74\x64\x20\x63\154\x61\x73\x73\75\42" . $color . "\x22\x3e" . $dt->cargado . "\x3c\57\164\x64\x3e\x3c\x74\144\x20\143\154\x61\x73\163\75\42" . $color2 . "\42\x3e" . $dt->entregado . "\74\x2f\x74\x64\76\x3c\x2f\164\162\x3e"; } } $html .= "\x3c\57\x74\x61\x62\154\x65\x3e"; return $html; } public function asignadesp($a) { $datos = array("\x73\x74\141\x74\x75\163" => "\61"); $n = $this->db->query("\123\105\x4c\x45\x43\x54\40\x4e\x55\x4c\114\40\106\x52\117\x4d\x20\x63\x6f\x6e\164\x72\x6f\154\137\157\x70\x65\162\x74\x69\40\x41\x53\x20\141\40\112\117\111\116\x20\x62\x75\154\164\157\163\x20\x41\123\40\142\40\117\x4e\40\141\x2e\x64\x6f\x63\x3d\142\56\x64\x6f\143\x20\127\110\x45\122\x45\x20\x61\56\x72\x65\160\141\x72\x74\157\x3d\x27{$a}\x27")->num_rows(); $s = $this->db->query("\x53\x45\114\x45\x43\124\x20\x4e\x55\114\x4c\x20\x46\122\117\x4d\40\x63\157\x6e\x74\162\x6f\x6c\x5f\157\x70\x65\x72\x74\151\40\x41\123\x20\141\x20\x4a\117\111\x4e\40\x62\x75\154\x74\x6f\163\40\101\x53\x20\142\40\117\116\x20\141\56\x64\157\x63\75\142\56\144\157\x63\x20\127\x48\105\122\105\x20\141\56\162\145\x70\141\162\x74\157\x3d\x27{$a}\x27\40\x26\46\40\x62\x2e\143\141\162\147\x61\144\157\x20\111\x53\x20\x4e\x4f\124\x20\x4e\x55\114\114")->num_rows(); if ($n == $s) { $bd2 = $this->db->where("\151\144", $a)->update("\x72\145\x70\141\x72\164\x6f", $datos); } return $bd2; } public function bfacrep($a) { $this->db->query("\x55\x50\x44\x41\x54\x45\x20\143\x6f\156\x74\x72\157\154\137\157\160\145\162\x74\151\x20\x53\x45\124\40\x72\145\x70\x61\x72\x74\x6f\75\x6e\x75\154\x6c\40\127\x48\105\122\x45\40\144\x6f\x63\x3d\47{$a}\47"); return $this->db->affected_rows(); } public function guia($a) { $bd = $this->db->query("\123\105\114\105\x43\124\40\x61\56\144\157\143\165\x6d\145\x6e\x74\x6f\54\x61\56\143\x6f\144\143\x6c\151\145\x6e\164\x65\x2c\x20\141\x2e\156\157\x6d\142\162\145\143\154\151\54\40\141\56\x64\151\162\x65\x63\143\x69\157\x6e\40\106\122\117\115\x20\157\x70\x65\x72\x74\151\40\x61\163\40\141\40\x4a\x4f\111\116\x20\143\x6f\156\x74\162\x6f\x6c\137\157\x70\145\x72\164\x69\40\x61\163\40\x62\40\117\116\x20\x61\x2e\141\x6e\x74\144\157\143\75\x62\x2e\x64\157\143\40\127\x48\105\x52\105\40\40\50\x61\x2e\164\x69\x70\x6f\144\157\143\x3d\47\106\x41\x43\47\x20\x7c\x7c\40\x61\56\164\x69\160\157\144\157\143\75\47\x4e\117\124\47\51\40\x26\x26\40\142\x2e\x73\x74\141\x74\165\x73\75\47\x33\47\40\x26\46\x20\x62\x2e\x72\145\x70\x61\162\x74\157\x3d\x27{$a}\x27\x20\107\x52\117\x55\120\40\102\131\40\x61\x2e\x6e\x6f\155\x62\162\145\143\x6c\x69\40\117\122\x44\105\122\x20\102\x59\x20\x61\x2e\x6e\x6f\x6d\142\x72\145\x63\x6c\x69\x20\x61\x73\143\x3b")->result(); $style = "\74\150\164\x6d\154\x3e\74\150\145\141\x64\76\x3c\155\145\x74\x61\x20\143\x68\141\162\x73\x65\164\75\42\125\x54\106\x2d\70\x22\76\x3c\155\x65\x74\141\40\150\164\x74\x70\55\145\x71\x75\151\x76\75\42\130\55\x55\x41\55\x43\x6f\x6d\160\141\164\151\142\x6c\x65\42\x20\x63\157\156\164\145\x6e\x74\x3d\x22\111\x45\x3d\x65\x64\x67\145\x22\x3e\x3c\155\145\x74\x61\40\x6e\x61\x6d\145\75\42\166\151\x65\167\x70\x6f\162\164\42\40\x63\x6f\156\164\145\x6e\164\75\42\167\x69\144\164\x68\75\x64\x65\166\151\143\145\55\167\151\144\x74\150\x2c\40\151\156\x69\164\x69\141\x6c\x2d\163\x63\x61\x6c\145\75\61\x2e\x30\x22\76\x3c\x6c\x69\x6e\153\x20\162\145\154\x3d\42\x73\164\x79\154\145\x73\150\x65\145\x74\x22\40\150\162\145\146\75\x22\x61\163\163\x65\x74\163\57\x63\x73\163\x2f\x77\63\56\x63\x73\163\42\x3e\74\x2f\150\145\141\x64\76\74\142\x6f\x64\171\76"; $table = "\74\164\141\142\x6c\x65\40\x63\x6c\x61\x73\x73\x3d\42\x77\x33\x2d\164\141\x62\x6c\x65\55\x61\x6c\154\x20\167\63\x2d\150\x6f\166\145\162\x61\x62\x6c\145\x20\167\x33\x2d\143\145\x6e\x74\145\162\x65\x64\42\40\163\x74\x79\x6c\x65\x3d\42\155\141\162\x67\x69\x6e\55\154\x65\146\164\x3a\62\56\x35\x25\x22\x3e\x3c\164\162\76\74\164\x68\76\x52\145\x70\141\x72\x74\x6f\x3c\57\x74\x68\76\74\x74\150\x3e\x43\x6c\151\x65\156\x74\x65\x3c\57\x74\150\x3e\x3c\x74\150\76\x55\x6e\151\144\74\x2f\x74\150\x3e\74\164\150\x3e\x44\x65\164\141\x6c\154\145\x73\74\x2f\x74\150\x3e\x3c\164\x68\x3e\101\x73\145\163\x6f\162\74\57\164\150\76\74\x74\x68\x3e\106\x65\143\150\x61\57\106\x69\x72\x6d\x61\x3c\57\x74\150\76\74\x2f\x74\x72\x3e"; $tbultos = 0; foreach ($bd as $dt) { $vend = $this->db->query("\123\x45\x4c\x45\103\124\40\142\x2e\156\157\x6d\x62\162\145\40\106\x52\117\x4d\40\x6f\x70\x65\x72\164\x69\40\x61\x73\x20\141\x20\x4a\x4f\111\x4e\x20\154\x69\163\164\x76\x65\156\144\40\x61\163\40\142\40\x4f\x4e\x20\141\x2e\166\145\156\144\145\x64\157\x72\75\x62\56\143\157\144\x69\x67\157\40\127\110\x45\x52\x45\40\141\56\x64\157\x63\x75\x6d\145\x6e\x74\x6f\75\47{$dt->documento}\47\x20\114\111\x4d\111\124\x20\61")->row(); $dunid = $this->db->query("\x53\x45\114\105\x43\x54\x20\123\x55\115\x28\142\x2e\x63\x61\x6e\164\x69\x64\x61\144\51\x20\165\x6e\151\144\x20\106\122\117\x4d\x20\157\x70\x65\x72\164\x69\x20\x41\x53\x20\141\x20\xa\40\40\x20\40\40\40\x20\40\x4a\117\x49\x4e\x20\x6f\160\145\x72\x6d\x76\x20\142\40\117\116\x20\141\56\144\x6f\143\x75\155\x65\x6e\164\x6f\x3d\x62\56\144\x6f\x63\165\155\145\156\x74\x6f\12\40\x20\x20\x20\x20\x20\40\40\112\x4f\x49\x4e\40\x63\x6f\x6e\x74\162\157\x6c\137\157\160\x65\x72\164\151\x20\x61\163\x20\x63\40\x4f\x4e\40\141\56\x61\156\x74\144\x6f\x63\75\143\x2e\144\x6f\143\12\40\x20\40\40\40\x20\40\40\127\x48\105\x52\105\x20\x28\141\56\x74\x69\160\x6f\144\x6f\143\75\x27\106\x41\103\x27\x20\174\x7c\x20\141\56\x74\x69\160\157\x64\157\x63\75\47\116\x4f\124\47\x29\x20\46\46\40\x63\56\163\x74\141\x74\165\x73\x3d\47\x33\x27\x20\x26\x26\x20\x63\x2e\162\x65\160\141\162\164\157\x3d\47{$a}\47\40\x26\x26\x20\x61\56\x63\x6f\x64\x63\x6c\151\145\x6e\x74\145\x3d\47{$dt->codcliente}\47\x3b")->row(); $dirr = $this->db->query("\123\x45\x4c\x45\103\124\40\x64\x69\x72\x65\143\x65\156\166\x69\157\54\x20\151\146\x28\x70\x65\162\163\x63\157\156\x74\41\x3d\47\x27\54\x70\x65\162\x73\143\157\156\164\x2c\x27\116\x2f\x41\x27\x29\x20\143\157\x6e\164\141\x63\164\157\x2c\40\x69\x66\x28\164\x65\x6c\x65\146\x6f\156\157\163\41\x3d\x27\47\x2c\164\x65\x6c\x65\146\x6f\x6e\157\x73\x2c\151\x66\x28\164\145\x6c\145\146\x6f\156\157\137\155\x6f\166\151\x6c\41\75\x27\47\x2c\164\145\x6c\145\146\x6f\x6e\x6f\x5f\x6d\157\x76\151\154\x2c\x27\116\x2f\101\47\x29\51\40\x74\145\x6c\145\x66\157\156\x6f\x2c\x20\151\146\x28\143\141\x6d\x70\157\64\41\75\47\47\x2c\x63\141\x6d\160\x6f\x34\x2c\47\116\57\x41\x27\51\x20\x68\157\162\x20\x46\x52\117\x4d\40\x63\154\x69\145\x6d\160\x72\145\x20\127\x48\105\122\x45\40\143\157\144\x69\147\157\75\47{$dt->codcliente}\x27")->row(); $table .= "\x3c\x74\x72\76"; $bd2 = $this->db->query("\123\x45\x4c\x45\103\124\40\x61\x2e\x64\x6f\x63\165\x6d\145\156\164\x6f\54\111\x46\x28\x62\56\162\x65\x66\x67\x3d\x27\163\x27\x2c\47\123\x69\40\x27\x2c\x27\x4e\157\x20\47\51\x20\162\145\146\x67\54\40\103\x4f\125\116\124\x28\x62\x2e\151\x64\51\x20\12\x20\x20\x20\x20\x20\x20\x20\x20\142\165\154\164\157\x73\x20\106\x52\x4f\115\x20\x6f\160\145\162\x74\151\x20\x41\123\x20\141\40\12\x20\40\40\40\x20\x20\x20\x20\x4a\117\x49\x4e\40\142\x75\154\x74\157\x73\40\101\x53\40\142\40\x4f\x4e\x20\141\56\x61\156\164\x64\x6f\x63\x3d\142\x2e\144\157\x63\40\xa\40\x20\x20\40\x20\40\40\40\x4a\117\111\x4e\40\x63\157\x6e\x74\162\x6f\x6c\x5f\x6f\160\145\x72\164\x69\40\x61\x73\40\x63\40\x4f\x4e\x20\x61\x2e\x61\x6e\164\x64\157\x63\75\x63\56\144\157\143\xa\x20\x20\x20\40\40\40\x20\x20\x57\110\x45\122\x45\40\x28\x61\56\164\151\x70\157\x64\157\143\x3d\x27\x46\101\103\x27\x20\x7c\x7c\40\141\x2e\x74\151\160\x6f\144\x6f\x63\75\47\116\x4f\124\x27\x29\x20\x26\x26\40\x63\56\163\164\141\164\165\x73\x3d\47\x33\47\40\x26\x26\x20\143\x2e\x72\145\x70\141\x72\x74\157\75\47{$a}\x27\40\x26\46\40\x61\x2e\x63\x6f\144\143\154\x69\x65\x6e\164\x65\75\x27{$dt->codcliente}\47\x20\x47\x52\x4f\125\x50\x20\102\x59\x20\142\x2e\144\157\143\x20\x3b")->result(); $table .= "\74\164\x64\40\163\x74\x79\x6c\145\x3d\x22\167\x69\x64\x74\x68\72\x35\45\x3b\42\x3e" . $a . "\74\x2f\164\x64\x3e\74\x74\144\x20\x63\x6c\141\x73\163\75\x22\167\63\55\154\x65\x66\164\55\x61\x6c\151\147\156\x22\40\x73\x74\x79\x6c\145\75\x22\167\151\144\x74\x68\72\64\x30\45\x3b\x22\x3e\74\142\76\103\x6f\144\x69\x67\157\72\x3c\x2f\x62\76\40" . $dt->codcliente . "\x20\x3c\x62\76\x4e\x6f\x6d\142\x72\145\72\x3c\x2f\x62\x3e\40" . $dt->nombrecli . "\40\74\142\76\103\157\156\x74\x61\x63\x74\157\x3a\74\x2f\x62\x3e\x20" . $dirr->contacto . "\40\x3c\142\x3e\x54\x65\x6c\145\x66\x6f\156\157\x3a\x3c\57\142\x3e\x20" . $dirr->telefono . "\x20\40\x3c\x62\162\x3e\40\74\x62\76\x44\x69\x72\x65\143\x63\151\x6f\x6e\x3a\x3c\57\142\x3e\x20" . $dirr->direcenvio . "\x20\74\142\162\76\x20\74\142\x3e\x48\157\162\141\x72\151\x6f\72\74\x2f\142\x3e\x20" . $dirr->hor . "\x20\x3c\x62\162\x3e\x20\74\x2f\164\x64\76\xa\x20\40\x20\40\40\x20\40\40\x3c\x74\144\40\x73\x74\171\154\x65\x3d\x22\x77\151\144\164\x68\x3a\65\45\73\42\76" . ROUND($dunid->unid, 2) . "\74\x2f\164\144\x3e\x3c\x74\x64\40\163\164\171\154\145\x3d\x22\167\151\x64\x74\x68\x3a\x33\x35\45\73\42\x3e"; foreach ($bd2 as $dt2) { $tbultos += $dt2->bultos; $table .= "\x20\x3c\142\x3e\x44\x6f\x63\x3a\74\57\x62\76" . $dt2->documento . "\40\x3c\142\76\x42\165\x6c\x74\x6f\163\x3a\74\x2f\142\x3e" . $dt2->bultos . "\40\x3c\142\76\106\162\151\157\72\x3c\57\142\x3e" . $dt2->refg . "\40\x3c\142\162\76"; } $table .= "\x3c\57\x74\x64\x3e\xa\x20\x20\40\40\x20\40\x20\40\74\x74\144\40\163\x74\x79\154\145\75\42\x77\151\x64\x74\x68\72\65\45\73\42\x3e" . $vend->nombre . "\x3c\x2f\164\x64\x3e\xa\x20\x20\40\x20\x20\x20\x20\40\x3c\x74\144\x20\163\164\x79\x6c\145\x3d\x22\x77\151\144\164\x68\x3a\x31\60\x25\x3b\x22\x3e\74\x2f\x74\144\76\xa\x20\40\40\x20\x20\40\x20\x20\74\57\x74\x72\x3e\12\x20\40\x20\x20\40\40\x20\x20"; } $chof1 = $this->db->query("\123\x45\114\x45\x43\124\x20\x6e\157\155\141\x70\x65\54\x20\166\x65\150\x69\143\165\x6c\x6f\x2c\x20\146\145\143\150\40\x46\x52\x4f\115\x20\164\162\141\x62\40\141\x73\x20\x61\x20\x4a\117\111\x4e\x20\x72\145\160\141\162\x74\x6f\40\x61\163\40\142\x20\x4f\116\40\141\x2e\151\144\75\x62\56\x63\x68\x6f\x66\145\162\x31\x20\x57\x48\x45\x52\105\x20\142\x2e\x69\144\75\47{$a}\x27")->row(); $chof2 = $this->db->query("\x53\105\114\105\x43\x54\40\x6e\157\155\x61\160\x65\40\x46\122\117\x4d\40\x74\162\141\x62\40\x61\163\40\141\40\x4a\x4f\111\x4e\x20\x72\145\x70\141\x72\x74\x6f\40\141\163\40\x62\x20\117\116\40\141\56\151\144\75\x62\x2e\143\x68\157\146\x65\162\62\x20\127\x48\x45\x52\x45\40\142\56\151\144\75\47{$a}\47")->row(); $vehi = $this->db->query("\x53\x45\114\x45\103\124\x20\x64\x65\x73\143\162\x69\x70\40\x46\122\117\x4d\40\166\145\150\x69\x63\40\127\x48\x45\x52\105\40\151\144\x3d\x27{$chof1->vehiculo}\47")->row(); $html = "\12" . $style . "\xa\x3c\144\x69\x76\40\x63\154\x61\x73\163\75\x22\167\63\55\x63\x65\x6e\164\145\162\x20\x77\x33\x2d\164\x69\x6e\171\x22\76\74\x69\x6d\147\40\163\x72\x63\75\42\151\155\x61\147\x65\163\x2f\x68\x65\x61\144\145\x72\x2e\x6a\x70\x67\42\40\141\x6c\164\x3d\x22\110\145\x61\144\145\x72\x22\40\163\x74\171\154\x65\x3d\x22\167\151\144\164\150\72\x31\60\x30\x25\73\x22\76\74\57\144\151\x76\76\12\x3c\150\63\40\143\x6c\x61\163\163\75\42\x77\x33\55\x63\x65\x6e\x74\x65\x72\42\76\x47\165\xc3\255\x61\40\144\145\40\122\145\x70\x61\162\x74\x6f\x3c\150\x33\76\xa\x3c\x64\151\x76\x20\x63\x6c\x61\163\x73\x3d\x22\x77\x33\55\x63\x65\156\x74\x65\162\40\x77\x33\55\x74\151\x6e\171\42\76\12\74\164\x61\x62\154\145\x20\x63\154\141\x73\163\x3d\42\167\63\x2d\164\141\x62\x6c\x65\x22\x3e\74\x74\x72\76\x3c\x74\x64\76\74\x62\x3e\x43\x68\157\146\145\162\40\x31\72\x3c\57\142\76\74\x2f\164\x64\x3e\x3c\164\144\76" . $chof1->nomape . "\x3c\x2f\x74\144\x3e\x3c\x74\x64\76\x3c\142\76\103\150\157\x66\x65\162\40\62\72\x3c\x2f\142\x3e\x3c\57\x74\144\x3e\x3c\x74\144\76" . $chof2->nomape . "\x3c\57\x74\x64\x3e\74\164\144\76\x3c\x62\x3e\x56\x65\150\151\143\165\154\x6f\72\x3c\57\142\76\x3c\x2f\x74\x64\76\x3c\x74\x64\76" . $vehi->descrip . "\74\x2f\164\144\x3e\x3c\164\x64\x3e\x3c\x62\x3e\x46\x65\x63\x68\141\x3a\x3c\57\x62\x3e\74\x2f\x74\144\76\74\164\144\x3e" . $chof1->fech . "\74\x2f\164\144\x3e\74\57\x74\x72\x3e\74\57\164\x61\x62\154\x65\76\x3c\x62\162\76\xa\x3c\164\141\142\x6c\x65\40\143\154\141\x73\x73\x3d\42\167\x33\x2d\164\141\x62\154\x65\42\76\74\x74\162\76\x3c\x74\x64\x3e\x3c\x62\x3e\x53\x61\x6c\x69\x64\x61\72\74\x2f\x62\x3e\74\57\x74\x64\76\74\x74\x64\76\106\x65\143\x68\x61\x20\137\x5f\137\137\137\x5f\137\137\137\137\x5f\x5f\74\57\x74\144\x3e\x3c\164\x64\76\x48\x6f\162\141\x20\x5f\x5f\x5f\137\x5f\x5f\x5f\137\137\137\x5f\137\x3c\x2f\x74\x64\76\74\57\x74\162\x3e\74\x74\162\76\74\x74\x64\76\74\x62\76\x52\x65\164\157\162\x6e\157\x3a\74\57\142\76\x3c\57\164\x64\76\74\164\144\x3e\x46\145\143\x68\141\x20\137\x5f\x5f\137\137\137\x5f\137\137\x5f\137\x5f\x3c\57\x74\144\x3e\74\164\144\x3e\110\157\x72\141\40\x5f\x5f\x5f\x5f\x5f\x5f\x5f\137\x5f\137\137\x5f\74\57\x74\144\76\x3c\57\164\162\x3e\x3c\x2f\164\x61\x62\x6c\145\76\x3c\x62\162\x3e\12" . $table . "\xa\74\164\141\142\154\145\x20\143\x6c\x61\x73\163\x3d\42\x77\x33\x2d\164\x61\142\154\x65\x2d\x61\x6c\x6c\x20\167\x33\55\x68\157\166\145\x72\141\142\x6c\145\x20\167\x33\55\143\145\156\x74\x65\162\145\x64\42\x3e\x3c\x74\162\76\74\164\x64\x3e\x54\157\164\x61\x6c\40\102\x75\x6c\x74\x6f\163\x3a\x3c\x2f\164\144\x3e\x3c\164\144\x3e" . $tbultos . "\74\x2f\164\x64\x3e\74\57\164\162\x3e\x3c\x2f\x74\141\x62\154\x65\76\xa\74\x2f\x64\x69\166\76\xa\74\x2f\142\x6f\144\x79\x3e\12\74\x2f\150\x74\155\154\x3e\12"; return $html; } public function factura($a, $b) { $this->load->library("\164\141\x62\154\x65"); $cli = $this->session->userdata("\143\157\x64"); if (base_url() === "\150\164\164\x70\x73\x3a\57\x2f\167\167\x77\x2e\x6d\145\144\151\x66\141\x72\56\143\x6f\x6d\x2e\166\x65\57") { $filtercli = "\x26\x26\40\141\56\x63\x6f\144\x63\x6c\151\x65\x6e\x74\145\75\x27{$cli}\47"; } else { $filtercli = ''; } if ($b != '') { $filter = "\x26\x26\40\x28\x61\x2e\x64\x6f\143\165\x6d\x65\x6e\164\x6f\x3d\47{$b}\x27\40\174\174\x20\x61\56\143\157\x64\143\x6c\151\145\x6e\164\145\75\x27{$b}\47\x20\x7c\174\x20\x61\x2e\x6e\157\x6d\142\162\x65\143\154\x69\40\114\x49\x4b\105\40\47\45{$b}\45\x27\40\174\x7c\x20\x61\x2e\x76\x65\156\144\145\144\x6f\162\75\47{$b}\47\40\x7c\x7c\x20\x61\x2e\164\151\160\157\x64\x6f\x63\75\x27{$b}\x27\x29"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\x4c\x45\x43\x54\40\116\125\x4c\114\x20\x46\x52\117\x4d\x20\157\x70\x65\x72\164\151\40\x41\123\x20\141\x20\xa\x20\x20\x20\40\x20\40\40\114\x45\x46\x54\40\112\x4f\x49\x4e\x20\143\x6f\156\x74\162\157\x6c\x5f\x6f\x70\145\x72\164\151\40\x41\123\40\143\x20\x4f\x4e\40\x61\56\x61\x6e\x74\x64\157\x63\75\x63\56\x64\x6f\143\12\40\40\x20\40\40\x20\40\127\x48\x45\122\105\x20\141\56\x74\x69\x70\157\144\157\x63\75\47\x46\x41\103\x27\40" . $filter . "\40{$filtercli}\xa\x20\40\x20\40\40\40\x20\107\x52\117\125\120\x20\102\x59\x20\141\56\x64\x6f\x63\x75\155\x65\x6e\x74\x6f\40\x4f\x52\x44\105\122\40\x42\131\x20\141\56\x64\157\143\x75\155\145\x6e\164\x6f\40\x44\105\123\103\73")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\105\x4c\105\103\x54\x20\141\x2e\144\157\x63\165\155\145\156\164\x6f\54\141\x2e\x61\156\x74\x64\157\x63\x2c\141\56\164\x69\x70\157\x64\x6f\143\x2c\x61\x2e\x66\145\143\150\x61\143\162\145\141\54\x61\56\166\145\156\143\x65\54\40\x61\56\x63\157\144\143\154\151\x65\156\164\x65\x2c\40\x61\56\x6e\157\155\x62\x72\145\143\x6c\151\x2c\141\56\157\162\144\x65\x6e\54\40\141\x2e\164\x65\x6c\x65\146\x6f\156\157\163\x2c\40\x61\x2e\163\x65\x63\x74\157\162\x2c\141\56\166\x65\156\144\145\x64\x6f\x72\54\40\x28\123\105\x4c\105\103\x54\40\x52\x4f\x55\116\x44\50\x53\125\x4d\x28\x63\141\x6e\x74\151\x64\141\x64\51\x2d\123\x55\115\50\143\x6e\164\144\x65\166\165\x65\x6c\x74\x29\x29\x20\x46\122\117\115\x20\x6f\x70\x65\x72\x6d\x76\40\127\110\x45\x52\x45\40\164\151\160\157\x64\157\x63\x3d\47\x46\x41\103\x27\40\46\46\40\144\157\143\x75\x6d\x65\156\x74\x6f\x3d\x61\56\144\x6f\x63\x75\155\x65\x6e\164\157\x29\40\x75\156\x69\144\x61\144\x65\x73\54\x20\143\56\164\x69\x6d\x65\141\x75\x74\54\143\x2e\x74\151\x6d\x65\141\163\151\147\x2c\143\56\x74\151\x6d\x65\x65\155\x70\54\40\12\40\x20\40\x20\111\106\50\143\56\x73\164\x61\x74\165\x73\x20\111\x53\x20\x4e\x4f\124\40\x4e\125\x4c\x4c\x20\46\x26\40\143\x2e\x73\x74\141\164\165\x73\x21\x3d\x27\x27\x2c\143\x2e\x73\x74\141\x74\x75\163\x2c\x32\x29\40\163\164\x61\164\x75\163\x2c\141\x2e\x65\163\164\x61\164\165\163\x64\157\x63\x20\12\40\x20\x20\40\106\x52\x4f\115\40\x6f\x70\x65\x72\164\x69\40\x41\x53\x20\x61\x20\12\40\40\40\x20\114\105\x46\x54\x20\112\117\111\116\40\x63\x6f\x6e\x74\x72\x6f\154\x5f\157\x70\x65\162\x74\151\x20\101\123\x20\x63\40\x4f\116\40\x61\56\141\156\x74\144\157\143\75\x63\x2e\x64\x6f\143\12\x20\x20\40\x20\127\110\105\122\105\x20\x61\56\164\x69\160\157\144\157\143\x3d\x27\x46\101\x43\47\x20" . $filter . "\40{$filtercli}\xa\40\x20\x20\x20\x47\x52\117\x55\x50\40\x42\131\x20\x61\x2e\x64\157\x63\165\155\x65\x6e\164\157\40\x4f\x52\x44\105\122\x20\102\131\40\x61\56\x64\157\143\x75\x6d\x65\156\164\x6f\40\x44\105\123\103\40\114\x49\x4d\x49\x54\x20" . ($a - 1) * $mostrar . "\40\54\x20" . $mostrar . "\73")->result(); $html = "\12\x20\40\40\x20\x3c\164\141\x62\x6c\x65\40\143\154\x61\163\x73\75\x22\x77\x33\x2d\164\x61\142\154\145\55\x61\x6c\x6c\40\167\x33\x2d\x68\x6f\166\145\x72\x61\142\x6c\145\x20\167\x33\x2d\154\145\146\164\x2d\x61\154\x69\147\156\x22\x3e\xa\40\x20\x20\40\x3c\164\162\76\74\x74\x64\x20\x63\154\x61\x73\x73\75\x22\167\63\55\x66\157\156\x64\x6f\x64\162\x6f\151\144\42\76\102\x75\x73\x63\x61\x72\x20\x3c\151\x6d\x67\40\x73\x72\x63\x3d\x22" . base_url() . "\x69\x6d\x61\x67\x65\163\57\x62\165\163\x63\x61\x72\56\x70\x6e\x67\x22\x20\x61\154\164\x3d\x22\x42\165\x73\143\141\162\x22\x20\x74\151\164\154\x65\x3d\x22\102\x75\x73\x63\141\162\42\40\x73\164\x79\x6c\x65\x3d\42\167\x69\144\x74\x68\x3a\x31\x38\160\170\x3b\142\x6f\162\144\x65\x72\72\x30\73\42\x3e\74\x2f\x74\144\76\12\40\40\40\x20\74\x74\x64\x3e\74\151\x6e\x70\165\164\40\x74\171\x70\145\75\42\164\x65\170\x74\42\x20\x63\154\x61\x73\x73\x3d\42\167\x33\x2d\x69\156\160\165\164\x22\40\x70\x6c\x61\143\145\x68\x6f\x6c\x64\x65\x72\75\42\111\x6e\147\162\145\x73\145\40\x73\x75\40\142\x75\x73\x71\x75\x65\144\141\x22\40\x6f\156\143\150\x61\156\x67\145\x3d\x22\146\141\x63\164\165\x72\141\x28\x29\42\40\x69\144\x3d\42\x6c\x69\x6b\x65\x66\x61\143\42\x3e\74\x2f\164\144\76\xa\40\40\40\40\x3c\164\x64\40\x63\x6c\141\163\x73\x3d\42\167\63\x2d\143\x65\156\x74\x65\x72\40\x77\x33\x2d\x62\164\x6e\x22\x3e\x3c\x61\x20\x6f\156\143\x6c\151\x63\x6b\75\x22\160\162\145\146\141\143\50\51\x3b\42\x3e\74\151\155\x67\x20\x73\162\143\75\42" . base_url() . "\151\155\x61\147\x65\163\57\x66\141\143\x74\165\x72\141\x2e\x70\x6e\147\42\x20\x61\x6c\x74\x3d\42\x46\141\143\164\165\162\141\x72\x22\40\164\151\164\x6c\145\x3d\x22\x46\x61\143\164\x75\x72\x61\x72\42\x20\x73\164\171\x6c\145\75\x22\x77\x69\144\164\150\x3a\x32\x30\160\170\x3b\150\x65\151\x67\150\164\x3a\x32\x30\160\170\73\142\157\x72\144\x65\162\x3a\60\x3b\42\76\x3c\57\x61\76\74\57\x74\144\76\xa\x20\40\x20\40\74\164\144\40\143\x6c\141\163\x73\x3d\42\167\x33\55\x63\145\x6e\164\145\162\40\x77\x33\x2d\x62\x74\156\42\76\x3c\x61\40\x6f\156\143\154\x69\143\x6b\x3d\x22\x76\151\145\x77\x62\141\x63\153\x6f\162\144\145\162\50\x29\x3b\x22\76\74\151\155\147\x20\x73\x72\x63\x3d\42" . base_url() . "\151\x6d\x61\x67\145\x73\57\142\x61\x63\x6b\x6f\x72\144\x65\x72\56\160\156\147\42\x20\x61\154\x74\75\42\x42\141\x63\x6b\157\x72\144\145\162\x22\40\164\151\x74\x6c\x65\75\x22\x42\141\x63\153\157\162\144\x65\x72\42\x20\163\164\x79\154\x65\x3d\42\x77\x69\x64\164\150\x3a\x32\60\x70\x78\x3b\x68\145\x69\147\x68\x74\x3a\62\x30\x70\170\73\142\x6f\x72\144\x65\162\x3a\x30\73\x22\76\74\x2f\x61\x3e\74\57\164\144\x3e\xa\x20\40\x20\x20\74\164\x64\40\x63\x6c\141\x73\163\x3d\42\167\63\55\x63\x65\x6e\164\x65\x72\40\167\63\x2d\x62\x74\x6e\x22\x3e\x3c\141\x20\x6f\x6e\143\x6c\x69\x63\153\75\42\x63\157\160\x79\x66\141\143\x28\x29\x3b\x22\76\x3c\151\155\x67\40\x73\x72\x63\75\x22" . base_url() . "\151\155\141\147\x65\x73\x2f\143\x6f\160\151\x61\162\x66\141\143\56\x70\x6e\x67\x22\40\141\154\164\75\x22\101\x6e\165\x6c\141\162\40\x79\x20\x43\x6f\x70\x69\x61\162\42\40\x74\x69\164\x6c\145\75\x22\101\156\165\x6c\x61\162\40\171\40\x43\157\160\151\141\x72\x22\x20\x73\x74\171\x6c\x65\x3d\42\167\151\144\x74\150\x3a\x32\60\160\170\73\150\x65\151\147\x68\x74\72\x32\60\160\x78\x3b\x62\157\x72\144\x65\x72\x3a\60\x3b\42\x3e\x3c\57\x61\76\x3c\57\x74\x64\76\xa\40\40\x20\x20\x3c\164\144\40\143\x6c\x61\x73\x73\x3d\x22\167\63\x2d\143\x65\x6e\164\145\x72\x20\x77\63\x2d\x62\164\156\x22\76\74\x61\x20\157\156\x63\154\151\x63\153\75\42\146\157\162\155\144\145\166\x66\x61\x63\50\x29\73\x22\x3e\x3c\151\155\147\40\x73\x72\143\75\x22" . base_url() . "\151\x6d\141\147\x65\x73\57\x64\x65\x76\157\154\x76\145\162\x2e\160\156\x67\42\40\141\x6c\164\x3d\x22\x44\145\166\157\x6c\166\x65\162\42\x20\164\151\x74\154\x65\75\42\104\x65\166\x6f\x6c\x76\145\162\42\40\x73\164\x79\x6c\x65\x3d\42\167\151\x64\164\x68\x3a\x32\60\160\x78\73\x68\x65\151\147\150\x74\x3a\x32\60\160\170\x3b\142\x6f\x72\x64\x65\x72\x3a\x30\x3b\x22\x3e\74\x2f\x61\x3e\x3c\x2f\164\x64\76\xa\40\x20\40\40\74\x74\144\x20\143\x6c\x61\x73\x73\x3d\42\167\63\55\143\145\x6e\x74\145\162\x20\x77\x33\x2d\142\x74\156\x22\x3e\x3c\141\40\157\156\x63\x6c\x69\143\153\x3d\42\x65\x64\x69\x74\146\141\x63\x28\x29\73\42\x3e\74\x69\155\147\40\163\x72\x63\x3d\x22" . base_url() . "\151\155\x61\x67\145\163\x2f\x65\144\151\164\141\x72\x2e\160\x6e\147\x22\x20\x61\154\x74\75\42\105\144\x69\x74\x61\x72\40\126\145\156\144\145\144\157\162\x22\40\x74\151\164\x6c\x65\75\42\x45\144\x69\164\x61\162\x20\x56\145\156\x64\x65\x64\x6f\162\x22\x20\163\x74\x79\154\x65\x3d\42\167\x69\144\x74\150\72\x32\x30\x70\x78\x3b\150\145\x69\x67\150\x74\72\x32\x30\x70\x78\73\142\157\162\x64\145\162\x3a\60\73\42\x3e\x3c\57\141\x3e\x3c\57\164\144\76\12\40\40\40\40\74\164\x64\x20\143\154\x61\163\x73\x3d\x22\167\63\x2d\143\x65\156\x74\145\x72\40\167\63\55\x62\164\156\x22\76\74\x61\x20\157\x6e\143\154\x69\143\153\75\42\x66\141\143\164\x75\x72\141\50\x29\73\42\76\74\151\155\x67\40\163\162\x63\75\x22" . base_url() . "\x69\155\x61\147\145\x73\57\x72\x65\154\157\141\x64\x2e\160\156\x67\42\x20\x61\x6c\164\x3d\x22\122\145\143\x61\x72\x67\141\x72\42\40\x74\151\164\154\x65\x3d\x22\x52\x65\143\x61\x72\x67\141\x72\42\40\163\164\x79\x6c\x65\75\x22\167\x69\x64\164\x68\72\x32\x30\160\170\73\150\145\x69\147\x68\164\x3a\62\60\x70\170\x3b\142\x6f\162\x64\x65\x72\x3a\x30\x3b\x22\76\74\57\141\x3e\x3c\x2f\164\x64\76\xa\40\x20\x20\40\74\x21\x2d\x2d\x3c\x74\x64\x20\x63\x6c\x61\163\163\75\x22\x77\x33\x2d\143\145\156\x74\145\162\40\x77\63\x2d\142\164\156\x22\76\74\141\x20\157\x6e\143\x6c\151\x63\x6b\x3d\42\145\154\x69\155\146\141\x63\50\51\73\x22\76\74\151\155\x67\x20\163\162\143\75\x22" . base_url() . "\x69\155\141\x67\x65\x73\57\x62\x6f\162\x72\141\x72\x2e\160\156\147\x22\40\141\x6c\x74\x3d\x22\x45\x6c\x69\155\151\156\x61\x72\42\x20\164\151\x74\154\x65\75\x22\105\154\x69\x6d\151\156\x61\x72\42\40\163\164\171\x6c\145\x3d\x22\x77\x69\x64\x74\150\72\x32\x30\160\x78\73\150\145\151\x67\150\164\72\x32\60\x70\x78\73\142\157\162\x64\145\x72\72\x30\x3b\42\76\x3c\x2f\141\76\74\57\164\x64\76\55\55\x3e\74\x2f\x74\162\x3e\xa\x20\x20\40\40\74\x2f\164\141\142\154\145\76\74\x62\x72\x3e\12\40\40\x20\40\x3c\164\x61\x62\154\x65\x20\x69\x64\x3d\42\151\144\x30\x31\x22\x20\143\154\x61\163\163\75\x22\167\63\x2d\x74\141\142\154\x65\55\141\154\154\40\167\x33\x2d\150\x6f\166\145\x72\x61\x62\x6c\x65\x20\167\x33\x2d\x6c\x65\146\x74\55\x61\x6c\x69\147\x6e\x20\167\63\x2d\x74\x69\156\x79\x22\x3e\x3c\x74\x72\x20\x63\x6c\141\163\163\75\x22\x77\x33\55\146\x6f\x6e\144\157\144\x72\157\151\x64\40\x20\x77\63\x2d\146\x69\152\x6f\x22\76\x3c\x74\150\76\116\74\x2f\x74\150\x3e\74\x74\x68\x3e\x44\x6f\x63\74\x2f\x74\x68\x3e\x3c\x74\x68\x3e\x43\x6f\x64\151\x67\x6f\74\57\x74\x68\x3e\74\164\x68\x3e\x4e\x6f\x6d\x62\x72\145\74\x2f\x74\x68\x3e\x3c\x74\150\76\116\x2e\103\157\156\164\x72\157\x6c\x3c\57\164\150\x3e\x3c\164\x68\76\x46\145\143\150\x61\74\57\164\150\x3e\x3c\x74\150\x3e\x56\x65\x6e\143\145\x3c\57\164\x68\x3e\x3c\x74\x68\76\123\145\x63\164\x6f\162\x3c\57\x74\x68\x3e\x3c\164\x68\x3e\126\x65\156\144\x65\144\x6f\162\x3c\57\164\150\x3e\x3c\164\x68\x3e\x55\x6e\x69\144\141\144\145\x73\x3c\57\x74\x68\76\x3c\x74\x68\76\x46\x2e\x41\x75\164\x6f\x72\151\x7a\141\74\x2f\x74\x68\x3e\x3c\164\150\x3e\106\x2e\x41\163\x69\147\156\x61\x3c\x2f\x74\x68\x3e\x3c\164\150\76\106\56\x45\155\x70\74\x2f\x74\150\76\x3c\164\x68\x3e\105\x73\x74\x61\x74\165\163\x3c\x2f\x74\150\76\74\x2f\164\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $vend = $this->db->query("\x53\x45\x4c\x45\103\x54\x20\142\56\156\157\155\x62\x72\x65\40\x46\x52\x4f\x4d\40\x6f\x70\x65\x72\164\151\x20\141\163\40\141\x20\112\117\111\116\x20\x6c\151\x73\164\x76\145\156\x64\x20\141\x73\x20\142\40\117\x4e\40\141\56\166\x65\156\144\x65\144\157\162\75\x62\x2e\x63\157\x64\x69\147\x6f\x20\127\110\x45\122\105\x20\x61\56\x64\157\143\165\155\x65\x6e\x74\157\75\47{$dtfac->documento}\x27\x20\114\111\x4d\111\x54\40\61")->row(); $html .= "\x3c\164\x72\x20\151\144\75\x22\163\154\145\143\x74" . $i . "\42\x20\x63\154\141\x73\x73\x3d\42\151\x74\x65\x6d\x22\40\x6f\x6e\143\x6c\151\x63\153\75\42\x69\164\145\155\x66\x61\143\50\x24\x28\x27\43\141" . $i . "\x27\51\56\x76\x61\154\50\x29\54\44\50\x27\43\x62" . $i . "\x27\x29\x2e\x76\141\154\50\51\x29\x3b\42\76"; if ($dtfac->estatusdoc == "\x31") { $status = "\111\155\160\x72\145\x73\141"; $color = "\x77\63\x2d\x67\x72\x65\x65\156"; } else { if ($dtfac->estatusdoc == "\60") { $status = "\116\157\x20\151\x6d\160\x72\145\163\x61"; $color = "\167\63\55\x72\145\144"; } else { if ($dtfac->estatusdoc == "\x58") { $status = "\101\156\165\x6c\141\144\x61"; $color = "\167\x33\55\x6f\162\141\156\147\145"; } } } $html .= "\x3c\x69\156\x70\165\164\40\164\x79\160\x65\75\42\150\151\x64\144\x65\156\x22\x20\x69\144\x3d\x22\x61" . $i . "\42\40\x6e\x61\155\145\x3d\42\144\157\x63\42\x20\x76\141\x6c\165\145\75\42" . $dtfac->documento . "\x22\76\x3c\151\x6e\x70\165\x74\40\x74\x79\160\x65\75\42\x68\151\144\144\x65\x6e\x22\x20\x69\x64\75\42\x62" . $i . "\42\x20\x6e\x61\x6d\x65\75\42\164\x69\160\157\x64\x6f\143\x22\40\x76\x61\154\165\145\75\42" . $dtfac->tipodoc . "\42\76\12\x20\x20\40\x20\40\40\40\40\x3c\x69\156\x70\165\164\40\x74\x79\160\x65\x3d\42\150\151\x64\x64\145\156\x22\40\156\x61\155\x65\x3d\42\141\156\164\x64\x6f\x63\42\40\x76\x61\154\x75\x65\x3d\42" . $dtfac->antdoc . "\42\x3e\x3c\x69\156\x70\x75\x74\x20\164\171\160\x65\75\42\150\x69\x64\x64\145\x6e\42\x20\x6e\x61\155\145\x3d\x22\x73\x74\141\164\x75\x73\42\x20\166\x61\x6c\165\x65\75\42" . $dtfac->status . "\x22\x3e\xa\x20\x20\40\40\40\40\40\40\74\164\144\76" . $i . "\74\57\x74\144\x3e\74\x74\x64\76\x3c\x69\156\160\165\164\x20\x74\x79\160\x65\75\42\143\x68\x65\x63\153\142\157\170\42\40\x6f\156\143\x6c\x69\x63\153\x3d\x22\167\x33\x2e\x74\x6f\x67\x67\x6c\x65\x43\x6c\141\163\163\50\47\x23\x73\154\145\143\164" . $i . "\47\x2c\x27\167\x33\55\171\x65\x6c\154\x6f\167\x27\51\73\42\40\143\x6c\x61\x73\163\75\42\167\x33\x2d\x63\x68\x65\143\x6b\42\x20\x6e\141\x6d\x65\75\42\x63\150\145\143\153\42\x3e" . $dtfac->documento . "\x3c\57\x74\144\x3e\x3c\x74\144\76" . $dtfac->codcliente . "\74\57\164\144\76\74\164\144\x3e" . $dtfac->nombrecli . "\74\x2f\164\144\76\74\x74\x64\x3e" . $dtfac->orden . "\74\57\164\x64\x3e\12\x20\40\x20\x20\x20\x20\x20\x20\74\x74\144\x3e" . $dtfac->fechacrea . "\74\x2f\164\144\x3e\x3c\164\144\76" . $dtfac->vence . "\x3c\57\164\x64\76\74\164\x64\x3e" . $dtfac->sector . "\74\x2f\x74\x64\76\x3c\x74\x64\76" . $vend->nombre . "\74\57\x74\144\76\74\x74\144\76" . $dtfac->unidades . "\x3c\x2f\164\x64\x3e\x3c\164\144\x3e" . $dtfac->timeaut . "\74\x2f\x74\144\76\74\164\x64\x3e" . $dtfac->timeasig . "\74\57\x74\x64\x3e\74\164\x64\76" . $dtfac->timeemp . "\74\57\164\144\x3e\xa\40\40\x20\40\40\x20\40\40\x3c\164\144\x20\x63\x6c\141\x73\163\x3d\42" . $color . "\40\167\x33\55\x63\145\156\x74\145\162\42\x3e" . $status . "\74\57\164\x64\x3e\xa\x20\x20\x20\40\40\40\40\x20\74\57\164\162\x3e"; } $html .= "\74\164\162\x3e\74\164\144\40\143\154\x61\163\163\x3d\x22\x77\63\x2d\143\145\x6e\x74\145\162\x20\167\63\x2d\x66\157\x6e\144\x6f\144\162\x6f\x69\x64\x22\x20\x63\157\x6c\163\x70\x61\x6e\75\42\x31\x33\x22\76\74\154\141\x62\145\154\x20\143\154\x61\163\x73\75\42\x77\63\x2d\x6c\141\x72\147\x65\x22\76\x3c\142\x3e\124\157\x74\x61\154\40\x46\141\x63\164\x75\x72\x61\x3a\x20" . $totalreg . "\x3c\57\142\76\74\x2f\x6c\x61\x62\x65\154\x3e\x3c\57\164\144\x3e\x3c\x2f\164\x72\x3e\74\57\164\x61\142\x6c\x65\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\40\40\x20\40\x20\x20\x3c\163\x63\162\151\x70\164\x20\x74\171\x70\x65\75\42\164\x65\170\164\x2f\x6a\x61\x76\x61\x73\143\x72\151\x70\164\x22\x3e\12\40\x20\x20\x20\x20\x20\40\x20\x66\165\156\x63\164\151\x6f\x6e\40\x44\145\x63\x72\x65\155\145\156\164\x4e\165\155\146\x61\143\x28\x29\173\12\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\x76\x61\162\x20\104\145\143\162\145\155\145\156\x74\116\165\x6d\x3d\144\x6f\143\x75\x6d\x65\156\x74\56\147\145\x74\x45\x6c\x65\x6d\145\x6e\x74\102\x79\x49\144\50\x22\x44\x65\x63\162\145\x6d\145\156\x74\x4e\x75\x6d\42\x29\x2e\x76\141\x6c\165\145\x3b\12\x20\40\x20\40\x20\40\x20\40\40\40\x20\x20\166\x61\x72\40\x6b\x65\171\75\x22\x64\x72\157\151\144\x39\60\x33\42\x3b\40\x76\141\162\40\154\151\153\x65\x66\x61\143\75\44\50\x27\x23\x6c\151\153\145\146\x61\x63\x27\x29\x2e\x76\141\154\50\x29\73\xa\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\166\141\162\40\144\x61\164\x6f\163\40\75\x20\x7b\xa\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x22\x70\x61\147\x22\40\72\40\x44\145\143\x72\x65\155\145\x6e\164\116\165\155\x2c\xa\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\42\153\x65\171\42\x20\72\40\153\145\171\54\xa\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\40\x20\x6c\151\x6b\145\x66\x61\143\x3a\154\151\x6b\x65\146\141\x63\xa\x20\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\40\40\175\x3b\xa\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\12\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\44\x2e\x61\x6a\x61\170\50\x7b\xa\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x64\141\164\141\72\x20\x64\x61\164\x6f\x73\54\12\x20\40\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x75\x72\154\x3a\40\40\142\x61\163\x65\165\x72\154\53\42\x63\x5f\144\x72\x6f\x69\x64\57\146\141\x63\164\x75\x72\x61\x22\x2c\12\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\40\x74\x79\x70\145\x3a\40\42\120\x4f\123\x54\x22\54\12\40\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\x73\165\x63\143\145\163\x73\x3a\40\x66\x75\156\143\x74\x69\x6f\156\50\144\141\164\141\51\40\173\12\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\44\x28\42\43\x62\x6f\144\x79\42\x29\x2e\150\164\155\154\x28\x64\141\x74\141\51\x3b\12\40\x20\40\40\40\40\x20\x20\40\40\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\x24\50\42\x23\154\x69\153\145\146\141\143\x22\x29\56\x76\141\154\50\x6c\x69\153\x65\x66\x61\x63\51\x3b\12\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\175\xa\40\x20\40\40\40\x20\40\x20\40\x20\x20\xa\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\175\51\x3b\12\x20\40\40\x20\40\x20\40\40\40\40\x20\175\12\x20\40\x20\40\40\40\40\x20\xa\40\x20\40\40\x20\x20\x20\40\40\x20\x20\146\165\156\143\x74\151\157\156\40\x6e\x75\x6d\160\141\x67\146\x61\x63\50\x61\51\x7b\12\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\166\x61\162\x20\153\x65\171\x3d\x22\144\x72\x6f\x69\x64\x39\x30\x33\42\x3b\x20\166\x61\162\40\x6c\x69\x6b\x65\146\x61\x63\75\x24\x28\x27\43\x6c\x69\x6b\145\146\x61\x63\47\51\x2e\166\x61\x6c\50\x29\x3b\xa\40\x20\40\40\x20\x20\40\x20\12\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x76\x61\162\40\144\x61\x74\x6f\163\x20\x3d\40\173\12\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\40\x20\x20\42\153\145\x79\42\x3a\153\x65\x79\54\xa\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x22\160\x61\x67\42\x20\72\x20\141\54\12\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\40\40\40\x20\x20\40\x6c\151\153\x65\x66\141\x63\72\154\151\x6b\x65\x66\141\143\12\40\40\40\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\175\x3b\xa\40\40\40\x20\x20\40\40\x20\40\40\x20\xa\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x24\x2e\x61\152\141\x78\x28\x7b\xa\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\40\40\144\141\x74\141\72\x20\x64\141\x74\157\x73\54\xa\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\x75\x72\154\72\40\142\141\163\x65\x75\162\x6c\53\42\143\x5f\144\162\157\151\144\x2f\x66\x61\143\x74\165\162\x61\x22\x2c\12\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\164\171\x70\x65\72\x20\42\120\117\123\124\x22\x2c\12\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\163\x75\143\x63\145\x73\163\72\x20\146\165\x6e\143\x74\x69\157\156\x28\x64\x61\164\141\x29\x20\x7b\12\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\40\x24\50\x22\x23\x62\x6f\144\171\42\51\x2e\150\164\x6d\154\50\144\x61\x74\141\x29\x3b\12\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\40\40\40\x20\x20\40\x24\x28\42\43\154\151\x6b\x65\x66\141\x63\x22\x29\x2e\x76\141\154\x28\154\x69\x6b\145\146\141\143\51\73\xa\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x7d\12\x20\40\x20\40\40\40\40\x20\40\40\x20\xa\x20\40\x20\40\40\x20\40\40\40\40\x20\40\40\40\x20\x7d\51\73\xa\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x7d\xa\40\40\40\40\x20\40\x20\x20\12\40\40\40\40\40\x20\x20\40\40\40\40\146\165\156\143\x74\151\157\156\x20\111\156\x63\162\x69\155\x65\x6e\164\x4e\165\x6d\x66\x61\x63\50\x29\x7b\xa\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x76\x61\162\40\x49\x6e\x63\x72\x69\x6d\145\156\164\116\x75\x6d\x3d\x64\x6f\143\165\x6d\145\156\x74\56\x67\145\x74\105\x6c\145\x6d\x65\x6e\x74\x42\x79\111\x64\50\x22\111\156\143\x72\151\155\145\x6e\164\116\165\x6d\42\51\56\x76\141\x6c\x75\145\x3b\xa\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\166\141\x72\x20\153\x65\171\x3d\x22\x64\162\157\x69\144\x39\x30\63\42\x3b\40\166\141\162\40\x6c\x69\153\145\146\x61\x63\x3d\44\50\47\43\154\x69\153\145\x66\x61\x63\x27\51\x2e\166\x61\x6c\50\x29\x3b\12\40\x20\40\x20\x20\40\x20\40\40\x20\40\40\166\141\x72\40\144\141\164\x6f\163\x20\75\x20\173\xa\40\x20\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\x22\153\x65\x79\42\x3a\153\145\x79\54\xa\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\42\x70\141\x67\42\x20\x3a\40\x49\156\x63\x72\x69\155\x65\x6e\164\116\x75\155\54\12\40\40\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x6c\x69\x6b\x65\x66\x61\143\x3a\x6c\x69\x6b\x65\x66\141\x63\12\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\175\x3b\12\40\x20\x20\x20\40\40\x20\40\x20\40\40\xa\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x24\56\x61\152\x61\x78\50\x7b\xa\40\40\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\x20\x20\40\40\x64\x61\164\x61\72\x20\144\141\164\157\x73\54\12\40\x20\40\x20\40\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x75\162\154\x3a\40\x20\x62\141\x73\x65\x75\x72\x6c\x2b\42\x63\x5f\144\162\x6f\151\x64\57\146\141\x63\164\165\x72\141\42\x2c\xa\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\40\40\164\171\160\x65\x3a\x20\42\120\117\x53\x54\42\54\12\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\40\x20\x73\165\143\x63\145\163\x73\72\40\x66\x75\156\x63\164\151\157\x6e\50\144\141\164\141\51\x20\x7b\xa\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\x24\x28\42\x23\142\157\x64\171\x22\51\x2e\150\164\155\154\50\144\x61\x74\141\51\x3b\12\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x20\x20\44\x28\42\x23\154\x69\x6b\x65\146\141\143\x22\x29\56\x76\141\x6c\x28\x6c\x69\153\x65\x66\x61\143\51\x3b\xa\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x20\x7d\xa\40\40\40\40\40\x20\x20\40\40\40\40\12\40\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\175\51\x3b\xa\40\x20\x20\x20\x20\40\x20\x20\40\40\40\175\xa\40\x20\x20\40\40\x20\40\40\74\57\x73\x63\162\x69\x70\164\76\12\40\x20\40\x20\x20\x20\x20\x20\74\x64\151\166\40\x63\x6c\141\x73\x73\x3d\42\167\63\55\142\141\162\40\x77\x33\55\x62\157\x72\x64\145\162\40\167\x33\x2d\x62\141\162\162\x61\163\42\x3e\12\40\x20\40\x20\x20\40\x20\40\74\x69\156\160\x75\x74\x20\x74\171\x70\145\x3d\x22\150\x69\x64\x64\x65\x6e\42\40\x69\144\x3d\42\104\145\x63\x72\145\x6d\x65\156\164\116\165\x6d\42\x20\x76\141\x6c\165\145\x3d\42" . $DecrementNum . "\42\x3e\xa\x20\40\40\40\x20\40\x20\40\74\x61\40\157\x6e\x63\x6c\151\143\153\x3d\42\x44\145\x63\x72\145\x6d\145\x6e\x74\116\165\x6d\x46\141\x63\x28\51\73\42\x20\143\154\141\163\x73\x3d\x22\167\63\55\x62\x61\x72\55\x69\164\145\x6d\x20\167\x33\55\x62\x75\x74\x74\157\156\x22\x3e\46\x6c\x61\x71\x75\x6f\x3b\x3c\x2f\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\x64\x70\x61\x67\151\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\x2d\146\x6f\x6e\x64\x6f\x64\162\x6f\x69\x64"; $html .= "\xa\x20\x20\x20\x20\40\40\40\40\x3c\151\156\x70\165\x74\40\x74\171\160\145\75\42\x68\x69\144\144\x65\x6e\42\40\x69\x64\x3d\x22" . $id . "\42\x20\166\141\154\x75\x65\75\x22" . $i . "\x22\76\xa\x20\x20\x20\x20\40\x20\x20\x20\x3c\141\x20\157\x6e\x63\154\x69\x63\x6b\x3d\42\x6e\x75\x6d\x70\141\x67\x66\x61\x63\50\44\50\47\43" . $id . "\47\x29\56\x76\141\x6c\x28\x29\x29\x3b\42\40\143\x6c\141\163\163\x3d\x22\x77\x33\x2d\142\x61\x72\x2d\x69\164\145\x6d\40\x77\x33\55\x62\165\164\x74\x6f\156\x20" . $hover . "\x22\x3e" . $i . "\x3c\x2f\x61\76"; } else { $hover = ''; $html .= "\74\151\x6e\x70\165\x74\40\x74\x79\x70\x65\75\x22\150\151\144\x64\x65\x6e\x22\x20\x69\x64\x3d\42" . $id . "\42\40\166\x61\x6c\165\x65\75\x22" . $i . "\42\x3e\xa\x20\x20\40\x20\40\x20\x20\40\x3c\141\x20\x6f\156\143\x6c\x69\x63\153\75\x22\156\x75\x6d\x70\x61\x67\146\x61\x63\50\x24\50\47\43" . $id . "\x27\51\56\166\141\x6c\x28\51\x29\x3b\42\x20\x63\x6c\141\x73\163\75\42\167\x33\x2d\x62\x61\x72\55\151\164\x65\x6d\40\167\63\x2d\142\x75\x74\x74\x6f\x6e\x20" . $hover . "\x22\x3e" . $i . "\74\x2f\141\76"; } } } $html .= "\x3c\x69\x6e\160\165\x74\40\164\171\x70\x65\x3d\x22\150\x69\144\x64\145\x6e\42\40\x69\x64\x3d\42\x49\x6e\143\x72\151\155\145\x6e\x74\116\x75\x6d\x22\x20\166\141\154\x75\x65\x3d\42" . $IncrimentNum . "\x22\76\xa\40\x20\40\40\40\40\x20\x20\74\141\x20\x6f\156\143\154\x69\143\x6b\x3d\42\111\x6e\x63\162\151\155\x65\x6e\x74\x4e\165\155\146\x61\143\50\x29\73\42\x20\143\154\141\163\163\x3d\42\x77\x33\55\x62\x61\x72\x2d\x69\164\x65\x6d\x20\x77\63\x2d\142\x75\x74\x74\157\156\x22\76\46\x72\141\x71\x75\x6f\x3b\x3c\x2f\x61\76\12\12\x20\40\x20\x20\40\x20\x20\x20\74\57\144\151\x76\76\x20"; return $html; } public function notfac($a, $b) { $this->load->library("\164\x61\142\154\145"); if ($b != '') { $filter = "\x26\46\x20\x28\141\x2e\x64\x6f\143\x75\x6d\x65\156\164\157\75\x27{$b}\x27\40\174\174\x20\x61\56\143\x6f\x64\x63\x6c\151\145\156\164\145\x3d\x27{$b}\x27\40\174\x7c\x20\141\x2e\x6e\x6f\155\x62\162\145\x63\154\x69\x20\x4c\111\113\105\x20\47\x25{$b}\x25\x27\x20\x7c\x7c\x20\141\x2e\x76\x65\156\x64\145\144\x6f\x72\40\154\151\x6b\145\x20\47\45{$b}\x25\x27\x20\174\174\x20\x61\56\164\151\x70\157\144\x6f\143\x3d\x27{$b}\47\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\105\x4c\105\103\x54\x20\x4e\125\x4c\x4c\x20\x46\x52\117\x4d\x20\157\160\145\162\164\x69\x20\101\123\x20\141\40\xa\40\x20\x20\40\x20\40\40\112\x4f\111\116\x20\x6f\160\145\x72\x6d\x76\x20\101\123\40\x62\x20\x4f\x4e\40\x61\x2e\x64\x6f\143\x75\155\x65\156\164\x6f\75\142\x2e\144\157\x63\x75\x6d\145\x6e\164\x6f\12\x20\40\40\40\40\x20\x20\x4c\x45\106\x54\40\112\117\x49\116\x20\x63\x6f\156\x74\162\x6f\154\x5f\157\x70\x65\162\164\151\x20\x41\x53\40\143\40\x4f\116\40\141\x2e\x61\156\x74\144\157\143\x3d\x63\x2e\x64\157\143\12\x20\x20\40\x20\40\40\40\127\110\105\122\x45\40\x61\x2e\x74\x69\160\157\x64\157\x63\x3d\x27\116\x4f\124\47\40" . $filter . "\12\40\40\40\x20\40\x20\40\107\x52\117\x55\120\40\102\131\x20\x61\x2e\x64\157\x63\165\155\x65\156\x74\157\x20\117\122\x44\x45\x52\40\x42\x59\40\141\x2e\x64\157\x63\x75\155\x65\156\x74\x6f\x20\104\105\x53\x43\73")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\x61\56\144\157\143\165\x6d\x65\x6e\164\157\54\141\x2e\x61\x6e\164\x64\x6f\143\54\141\56\x74\151\160\x6f\144\x6f\143\54\141\x2e\146\x65\x63\x68\141\x63\x72\x65\x61\54\x61\56\x76\x65\x6e\x63\x65\x2c\40\141\x2e\x63\x6f\x64\x63\154\151\145\x6e\164\x65\x2c\40\x61\56\156\157\x6d\142\162\x65\143\x6c\x69\54\40\x61\56\164\145\x6c\x65\146\157\x6e\x6f\163\54\x20\x61\56\163\x65\x63\164\157\x72\54\x61\x2e\x76\x65\x6e\144\145\144\157\162\54\40\50\123\x45\114\105\103\124\40\x52\x4f\125\x4e\104\50\x53\x55\x4d\x28\x63\141\x6e\164\x69\x64\x61\144\51\x2d\x53\125\x4d\x28\x63\156\164\144\x65\x76\165\145\154\164\x29\51\40\106\x52\x4f\x4d\x20\157\x70\145\x72\155\166\40\127\110\105\x52\105\40\164\151\x70\x6f\144\x6f\143\x3d\47\x4e\x4f\124\x27\40\46\x26\x20\144\x6f\143\x75\155\145\x6e\x74\157\x3d\x61\x2e\x64\157\143\165\x6d\x65\156\164\x6f\51\40\165\x6e\151\x64\141\144\145\163\x2c\x20\x63\56\x74\x69\155\x65\141\165\x74\54\143\x2e\x74\151\x6d\x65\x61\x73\x69\x67\x2c\x63\x2e\x74\x69\x6d\145\x65\155\x70\54\x20\12\x20\x20\40\40\x49\x46\50\x63\56\x73\x74\x61\164\165\163\40\x49\x53\x20\x4e\x4f\124\x20\x4e\125\114\114\x20\46\x26\x20\143\56\x73\x74\x61\164\165\x73\x21\75\x27\47\54\x63\56\x73\164\141\x74\x75\x73\x2c\x32\51\x20\x73\164\x61\x74\x75\163\x2c\x61\x2e\x65\163\164\141\164\165\163\x64\157\x63\xa\x20\40\40\x20\x46\x52\x4f\x4d\40\157\x70\145\x72\164\x69\x20\x41\x53\40\141\x20\12\x20\40\40\x20\112\117\x49\x4e\x20\x6f\160\145\x72\x6d\x76\40\x41\x53\x20\142\40\117\116\x20\x61\x2e\144\157\x63\x75\x6d\145\x6e\164\x6f\75\x62\56\x64\x6f\x63\165\155\x65\x6e\164\157\12\x20\40\x20\x20\x4c\105\x46\x54\40\112\x4f\x49\116\x20\143\157\156\x74\x72\157\x6c\137\x6f\x70\x65\162\x74\151\x20\101\123\40\143\x20\117\116\40\x61\56\x61\x6e\x74\144\x6f\x63\75\143\x2e\x64\157\143\xa\x20\x20\40\x20\127\110\x45\x52\105\x20\141\x2e\164\151\x70\x6f\x64\x6f\x63\75\47\x4e\117\124\x27\x20" . $filter . "\xa\40\40\x20\x20\107\x52\x4f\125\120\x20\x42\x59\x20\141\56\x64\157\x63\165\155\145\156\x74\x6f\x20\117\x52\x44\x45\x52\40\x42\131\40\x61\56\x64\157\x63\x75\x6d\145\x6e\x74\157\x20\104\x45\x53\x43\40\114\111\x4d\111\x54\x20" . ($a - 1) * $mostrar . "\x20\54\40" . $mostrar . "\73")->result(); $html = "\12\40\x20\x20\x20\74\x74\x61\x62\x6c\x65\40\143\x6c\141\x73\163\x3d\x22\167\x33\55\x74\x61\x62\x6c\x65\55\x61\154\154\40\167\x33\x2d\x68\x6f\x76\145\x72\x61\x62\154\x65\40\167\63\x2d\154\x65\146\164\x2d\x61\154\151\147\156\42\x3e\12\x20\x20\x20\x20\74\x74\162\x3e\x3c\164\144\x20\x63\x6c\141\163\x73\75\42\167\x33\x2d\146\157\156\x64\x6f\x64\162\x6f\151\144\x22\76\x42\x75\x73\143\141\x72\x20\x3c\151\155\x67\x20\x73\x72\x63\x3d\42" . base_url() . "\x69\155\x61\x67\x65\x73\57\142\165\163\143\141\162\56\x70\x6e\147\x22\40\x61\154\x74\x3d\x22\x42\165\x73\143\x61\x72\x22\x20\x74\x69\164\154\x65\x3d\42\x42\x75\x73\x63\x61\162\x22\40\163\164\x79\x6c\145\75\x22\167\x69\144\x74\x68\72\61\x38\160\x78\73\142\x6f\x72\144\145\x72\x3a\x30\73\42\76\x3c\57\x74\x64\x3e\12\x20\40\40\x20\74\164\144\x3e\x3c\151\x6e\160\165\164\x20\x74\x79\x70\x65\x3d\42\164\145\x78\164\x22\40\143\154\x61\x73\163\75\42\167\x33\55\x69\156\x70\165\164\42\40\160\x6c\141\143\145\x68\157\154\144\x65\162\75\42\x49\156\x67\162\x65\x73\x65\x20\x73\x75\40\142\x75\163\161\165\x65\x64\141\42\x20\x6f\156\143\150\x61\156\x67\145\x3d\x22\156\x6f\164\x66\141\x63\x28\51\x22\40\x69\x64\75\42\154\151\x6b\x65\x66\141\x63\x22\76\x3c\x2f\x74\144\x3e\xa\40\x20\40\40\x3c\x74\144\40\143\154\141\x73\163\75\x22\x77\x33\55\x63\145\x6e\x74\x65\162\x20\167\x33\x2d\x62\164\156\42\76\x3c\x61\x20\157\156\x63\x6c\x69\143\153\x3d\42\x70\x72\145\146\141\143\x28\51\73\x22\x3e\74\x69\155\x67\40\163\162\143\x3d\x22" . base_url() . "\151\155\x61\147\x65\x73\57\x66\x61\x63\x74\x75\x72\141\x2e\x70\x6e\x67\42\40\x61\x6c\x74\x3d\42\106\141\143\164\x75\162\x61\x72\x22\x20\x74\151\164\154\x65\x3d\x22\x46\141\143\164\165\x72\141\x72\42\40\x73\164\171\x6c\x65\75\42\x77\x69\x64\164\x68\x3a\x32\60\x70\x78\x3b\x68\145\x69\x67\150\x74\72\62\60\160\170\x3b\x62\x6f\x72\144\145\162\x3a\60\x3b\x22\x3e\x3c\57\141\76\x3c\57\x74\x64\x3e\xa\40\x20\x20\x20\74\x74\144\40\143\x6c\x61\163\x73\x3d\x22\167\63\x2d\143\145\156\164\145\x72\40\167\63\55\142\164\x6e\x22\x3e\74\x61\x20\157\x6e\x63\x6c\x69\x63\x6b\75\42\x66\x6f\162\155\x64\145\166\x66\x61\143\50\51\73\x22\x3e\74\x69\155\147\x20\163\162\x63\75\x22" . base_url() . "\151\x6d\x61\147\145\163\x2f\x64\x65\x76\157\x6c\166\x65\162\56\160\156\147\x22\x20\141\154\164\75\x22\x44\x65\166\157\x6c\x76\145\x72\x22\40\164\x69\164\154\145\75\x22\104\145\166\157\x6c\x76\x65\x72\42\x20\163\x74\x79\154\145\75\x22\x77\151\x64\x74\150\72\x32\60\x70\170\73\x68\x65\151\147\150\164\x3a\x32\60\160\170\x3b\x62\157\162\x64\145\x72\x3a\x30\73\42\x3e\x3c\x2f\141\76\74\x2f\164\x64\76\12\x20\x20\40\40\x3c\164\144\x20\143\154\x61\163\x73\x3d\42\x77\63\55\x63\145\x6e\164\x65\162\x20\x77\x33\x2d\142\164\x6e\42\76\x3c\141\x20\x6f\x6e\143\x6c\151\143\x6b\x3d\42\143\157\x6e\166\156\x6f\164\x66\141\x63\x28\51\73\42\x3e\x3c\151\x6d\x67\x20\x73\162\x63\75\42" . base_url() . "\x69\x6d\141\x67\145\163\x2f\166\x6f\x6c\x76\x65\x72\x2e\x70\x6e\147\x22\40\x61\154\164\x3d\x22\106\x61\x63\164\165\x72\x61\162\42\40\x74\x69\x74\154\x65\x3d\42\106\141\143\164\165\162\x61\162\x22\x20\163\164\171\x6c\145\75\x22\x77\151\x64\164\x68\72\62\x30\x70\170\x3b\150\x65\151\x67\x68\164\x3a\x32\60\160\x78\x3b\x62\157\162\x64\x65\x72\72\x30\73\x22\76\x3c\x2f\x61\x3e\74\57\x74\144\76\12\x20\x20\40\x20\74\x74\144\40\143\154\x61\163\x73\x3d\x22\167\x33\55\143\145\x6e\x74\145\162\x20\167\x33\x2d\x62\x74\x6e\42\x3e\x3c\x61\40\157\x6e\x63\154\x69\143\x6b\x3d\42\x6e\157\x74\146\x61\x63\x28\x29\x3b\x22\x3e\x3c\x69\155\147\40\x73\x72\143\75\42" . base_url() . "\x69\155\x61\x67\145\x73\57\162\145\x6c\157\x61\144\x2e\x70\156\x67\x22\40\x61\x6c\x74\75\x22\122\145\143\141\162\x67\141\162\42\x20\164\151\x74\154\x65\x3d\42\x52\145\143\x61\x72\x67\x61\x72\42\40\x73\164\171\154\x65\x3d\x22\x77\151\x64\x74\x68\x3a\62\x30\x70\x78\x3b\x68\x65\x69\x67\150\164\72\x32\x30\160\x78\73\x62\x6f\162\144\145\x72\72\60\73\42\76\x3c\x2f\x61\x3e\74\57\164\x64\76\xa\x20\x20\40\x20\x3c\x21\x2d\x2d\x3c\164\x64\x20\x63\x6c\x61\x73\x73\75\42\x77\63\55\143\x65\156\164\145\162\40\167\x33\x2d\x62\164\156\x22\x3e\x3c\141\x20\x6f\x6e\143\154\151\x63\153\75\42\145\x6c\151\155\x66\141\143\x28\x29\73\42\76\x3c\x69\x6d\x67\x20\163\x72\143\75\x22" . base_url() . "\151\x6d\141\x67\x65\163\57\142\x6f\162\x72\x61\x72\x2e\160\x6e\x67\42\40\x61\x6c\164\75\x22\x45\x6c\151\155\151\156\x61\162\42\40\x74\x69\164\x6c\145\75\x22\x45\x6c\x69\x6d\x69\156\141\x72\42\x20\x73\x74\171\154\145\75\x22\167\151\x64\164\150\x3a\62\60\x70\x78\x3b\150\x65\x69\147\150\x74\x3a\62\x30\x70\170\x3b\142\157\x72\x64\145\x72\72\x30\73\x22\76\x3c\57\x61\76\74\x2f\x74\144\76\55\x2d\76\74\57\x74\x72\x3e\xa\40\40\40\x20\x3c\57\x74\141\x62\154\x65\76\74\x62\x72\x3e\12\x20\40\x20\40\x3c\164\141\x62\x6c\145\40\x69\x64\75\42\x69\x64\x30\61\x22\x20\x63\x6c\141\x73\163\x3d\42\167\x33\x2d\x74\x61\x62\154\x65\55\141\154\x6c\x20\x77\63\x2d\150\x6f\166\145\162\x61\x62\x6c\x65\40\167\63\x2d\x6c\145\x66\164\55\x61\154\151\x67\x6e\40\x77\x33\x2d\164\x69\156\171\42\x3e\x3c\164\x72\x20\143\x6c\x61\163\x73\75\42\167\x33\55\x66\157\156\144\x6f\x64\162\x6f\x69\x64\x20\167\x33\55\146\x69\152\x6f\x22\x3e\74\164\x68\x3e\x4e\x3c\x2f\164\150\x3e\x3c\164\150\76\x44\x6f\x63\74\57\x74\150\76\x3c\x74\x68\76\x43\157\x64\x69\x67\157\74\57\x74\x68\76\74\x74\x68\76\116\x6f\155\x62\x72\145\74\x2f\x74\150\76\x3c\164\x68\x3e\x46\145\x63\150\x61\74\x2f\x74\x68\76\74\x74\150\x3e\x56\145\156\143\x65\74\57\x74\x68\x3e\74\164\150\76\123\x65\x63\x74\157\x72\74\57\x74\150\76\74\x74\150\76\x56\x65\156\144\x65\x64\x6f\162\x3c\x2f\x74\x68\x3e\x3c\x74\x68\76\x55\156\x69\144\x61\144\145\163\x3c\57\164\150\x3e\xa\40\40\x20\x20\x3c\x74\150\x3e\106\x2e\x41\165\164\157\162\x69\172\x61\x3c\57\164\150\76\x3c\x74\x68\76\106\56\x41\163\151\x67\156\x61\x3c\57\164\x68\76\74\164\150\x3e\106\x2e\x45\155\x70\74\x2f\164\x68\x3e\74\x74\x68\x3e\x45\163\164\x61\x74\x75\163\x3c\57\164\x68\76\x3c\x2f\x74\x72\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->estatusdoc == "\61") { $status = "\111\155\160\162\145\163\141"; $color = "\x77\x33\x2d\x67\x72\145\145\156"; } else { if ($dtfac->estatusdoc == "\x30") { $status = "\116\157\40\x69\155\x70\162\x65\x73\x61"; $color = "\167\x33\55\x72\x65\x64"; } else { if ($dtfac->estatusdoc == "\x58") { $status = "\x41\156\165\154\141\x64\141"; $color = "\167\63\55\157\162\141\x6e\147\x65"; } } } $vend = $this->db->query("\x53\105\x4c\105\x43\x54\x20\142\x2e\156\157\155\x62\162\x65\40\x46\122\x4f\x4d\40\x6f\x70\145\162\164\151\40\141\163\x20\141\x20\112\117\x49\x4e\40\154\151\x73\x74\x76\145\x6e\144\40\141\163\40\x62\x20\117\116\x20\141\56\x76\145\x6e\x64\145\x64\x6f\162\75\142\56\x63\x6f\144\x69\147\x6f\40\x57\x48\x45\x52\x45\x20\x61\56\144\x6f\143\x75\155\145\156\x74\x6f\75\47{$dtfac->documento}\x27\40\x4c\111\115\x49\x54\x20\61")->row(); $html .= "\74\164\162\40\151\x64\x3d\x22\163\154\x65\x63\164" . $i . "\42\x20\x63\x6c\141\x73\163\75\x22\x69\164\x65\155\42\40\157\x6e\143\x6c\x69\143\153\x3d\x22\x69\x74\145\x6d\x66\141\143\50\44\50\47\43\141" . $i . "\x27\x29\56\x76\x61\154\x28\x29\x2c\44\x28\x27\43\x62" . $i . "\x27\51\x2e\166\141\x6c\x28\x29\x29\x3b\42\x3e"; $html .= "\x3c\x69\x6e\x70\165\x74\40\x74\171\160\x65\75\42\x68\151\144\144\145\x6e\x22\40\x69\x64\75\42\141" . $i . "\42\x20\156\141\155\x65\x3d\42\x64\x6f\x63\42\40\166\141\154\x75\145\75\42" . $dtfac->documento . "\x22\76\74\x69\156\x70\x75\x74\x20\164\x79\x70\x65\x3d\x22\150\151\x64\144\x65\156\42\x20\151\x64\x3d\x22\142" . $i . "\x22\40\156\141\155\145\x3d\x22\164\151\x70\x6f\x64\x6f\x63\42\x20\166\141\154\x75\x65\75\x22" . $dtfac->tipodoc . "\42\x3e\12\40\40\x20\x20\40\x20\x20\x20\x3c\x69\x6e\x70\165\x74\40\x74\x79\160\145\x3d\x22\x68\151\x64\144\x65\x6e\x22\x20\156\141\x6d\x65\x3d\x22\x61\156\164\x64\x6f\x63\x22\40\166\141\154\165\x65\75\42" . $dtfac->antdoc . "\x22\x3e\x3c\151\x6e\x70\x75\x74\x20\x74\x79\x70\145\x3d\42\150\x69\x64\x64\x65\156\x22\40\x6e\x61\155\145\x3d\x22\163\164\141\x74\x75\163\x22\x20\166\141\x6c\165\x65\x3d\42" . $dtfac->status . "\x22\76\xa\40\x20\40\40\40\x20\x20\x20\74\x74\144\76" . $i . "\x3c\57\164\144\76\74\164\x64\76\x3c\x69\x6e\160\165\164\40\164\171\160\145\75\x22\143\x68\x65\x63\153\x62\x6f\x78\42\40\x6f\156\143\154\x69\143\x6b\75\x22\x77\x33\56\x74\x6f\147\x67\154\145\x43\x6c\x61\x73\x73\x28\x27\43\x73\154\145\x63\x74" . $i . "\47\54\x27\167\63\x2d\x79\145\x6c\154\x6f\167\x27\51\x3b\x22\40\143\154\141\x73\163\75\x22\x77\x33\x2d\x63\150\x65\143\x6b\42\x20\156\x61\x6d\145\75\x22\143\x68\145\143\x6b\42\x3e" . $dtfac->documento . "\74\57\x74\144\76\x3c\x74\x64\x3e" . $dtfac->codcliente . "\x3c\57\x74\144\76\74\164\144\x3e" . $dtfac->nombrecli . "\74\57\164\x64\76\12\x20\40\x20\x20\x20\x20\x20\40\74\x74\144\76" . $dtfac->fechacrea . "\74\57\164\x64\x3e\74\x74\x64\76" . $dtfac->vence . "\x3c\x2f\164\144\76\x3c\x74\x64\76" . $dtfac->sector . "\x3c\57\x74\144\x3e\74\164\x64\76" . $vend->nombre . "\74\x2f\164\144\x3e\x3c\164\x64\76" . $dtfac->unidades . "\x3c\57\x74\x64\76\74\x74\x64\76" . $dtfac->timeaut . "\x3c\x2f\164\x64\76\74\164\144\76" . $dtfac->timeasig . "\x3c\x2f\164\144\x3e\x3c\x74\144\x3e" . $dtfac->timeemp . "\74\x2f\164\x64\76\xa\40\40\x20\40\40\40\40\40\x3c\x74\x64\40\143\154\x61\x73\163\x3d\42" . $color . "\x20\x77\x33\x2d\x63\x65\156\164\145\x72\42\76" . $status . "\74\x2f\164\144\76\xa\40\40\x20\40\x20\40\40\40\x3c\57\164\162\76"; } $html .= "\74\x74\162\76\74\164\144\40\x63\154\x61\x73\x73\75\42\x77\63\x2d\x63\x65\x6e\x74\145\162\x20\x77\63\x2d\x66\157\156\144\x6f\x64\162\157\x69\x64\42\x20\143\157\x6c\163\160\x61\x6e\75\42\61\x33\42\76\74\x6c\141\142\145\154\40\x63\x6c\141\x73\163\x3d\42\167\x33\55\154\x61\162\x67\145\x22\x3e\74\142\76\124\157\164\141\154\x20\125\156\x69\x64\141\x64\x65\x73\x3a\x20" . $totalreg . "\74\57\142\76\74\57\154\141\142\145\154\76\74\57\164\144\76\x3c\57\x74\x72\x3e\x3c\x2f\x74\x61\x62\154\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\x20\x20\x20\x20\x20\x20\x20\74\x73\143\x72\x69\160\164\x20\x74\171\x70\x65\x3d\x22\x74\145\170\x74\x2f\x6a\x61\166\x61\x73\143\162\151\160\x74\42\x3e\12\x20\x20\40\x20\40\40\40\40\146\x75\x6e\x63\164\151\x6f\x6e\x20\104\x65\143\162\x65\155\x65\156\x74\x4e\165\155\x66\x61\x63\x28\x29\x7b\xa\40\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x76\141\162\x20\104\145\143\x72\145\155\145\x6e\x74\116\x75\x6d\x3d\x64\x6f\x63\165\155\x65\x6e\x74\56\x67\x65\x74\x45\x6c\145\x6d\145\x6e\164\x42\171\x49\144\x28\42\x44\x65\x63\x72\145\155\x65\x6e\x74\116\165\155\x22\51\x2e\166\x61\x6c\x75\x65\x3b\xa\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x76\141\162\x20\x6b\x65\171\x3d\42\x64\162\157\151\x64\x39\x30\x33\42\x3b\x20\x76\x61\162\40\154\x69\153\145\x66\141\143\75\44\50\x27\x23\x6c\151\x6b\145\x66\x61\143\x27\51\56\x76\x61\x6c\50\x29\73\xa\40\40\40\x20\x20\40\40\x20\40\40\40\40\166\141\x72\x20\144\141\x74\157\163\x20\x3d\x20\x7b\xa\40\40\40\x20\40\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\x20\x20\x22\x70\x61\x67\42\x20\x3a\x20\x44\145\x63\162\145\155\145\x6e\x74\x4e\x75\155\x2c\xa\x20\40\x20\40\x20\40\40\40\40\40\40\x20\40\x20\x20\40\x20\40\40\x22\153\145\171\42\40\x3a\40\x6b\x65\171\54\xa\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\154\x69\x6b\x65\x66\x61\x63\x3a\x6c\x69\x6b\x65\146\x61\x63\xa\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\x7d\x3b\12\40\40\x20\40\x20\40\x20\x20\x20\x20\40\12\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\44\x2e\x61\x6a\141\x78\50\173\xa\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\x64\x61\x74\x61\72\40\x64\141\164\x6f\x73\x2c\12\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\165\x72\x6c\x3a\x20\x20\142\x61\163\x65\165\162\154\53\x22\x63\137\x64\x72\x6f\151\144\x2f\x6e\157\164\x66\x61\x63\42\x2c\xa\x20\40\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\164\171\160\x65\x3a\40\42\120\117\123\124\x22\x2c\12\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\163\x75\143\143\145\163\163\72\x20\146\x75\x6e\x63\164\151\157\x6e\50\x64\x61\164\141\51\x20\173\12\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\x24\50\42\x23\x62\x6f\x64\171\x22\51\x2e\150\164\x6d\x6c\50\144\x61\x74\x61\51\x3b\xa\x20\40\40\40\40\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x24\50\x22\x23\x6c\x69\153\x65\x66\141\143\x22\x29\56\x76\141\x6c\x28\154\151\153\145\146\141\143\51\73\xa\x20\x20\40\40\40\40\40\x20\40\40\40\40\x20\40\40\x20\40\x20\x20\x7d\12\40\40\x20\40\40\x20\40\40\x20\x20\40\xa\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\175\51\x3b\xa\40\x20\40\x20\40\40\x20\40\x20\x20\40\175\12\x20\x20\x20\x20\x20\x20\40\x20\xa\40\x20\x20\x20\40\40\x20\40\40\x20\x20\146\x75\x6e\x63\164\151\157\x6e\x20\x6e\x75\x6d\160\141\147\x66\x61\x63\x28\x61\x29\x7b\xa\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x76\x61\x72\x20\x6b\145\171\75\x22\x64\162\157\151\144\x39\x30\63\x22\73\40\166\141\162\x20\x6c\151\x6b\145\146\x61\x63\75\x24\x28\47\x23\154\x69\x6b\x65\x66\141\x63\47\51\56\x76\141\x6c\50\x29\x3b\xa\40\40\40\40\x20\x20\40\x20\xa\40\40\40\40\40\40\x20\40\40\40\x20\x20\166\141\162\40\x64\141\164\157\163\40\75\40\x7b\12\x20\40\40\x20\x20\40\40\40\40\40\40\40\40\40\x20\40\40\x20\40\x20\x22\153\145\x79\x22\72\153\x65\x79\54\12\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\42\x70\141\147\x22\x20\x3a\40\x61\54\12\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x20\40\x6c\151\153\x65\146\141\x63\x3a\x6c\x69\153\x65\146\x61\143\12\40\40\40\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\175\x3b\xa\40\40\x20\x20\40\x20\40\x20\x20\40\40\xa\40\40\40\x20\40\x20\x20\40\40\40\40\x20\40\40\x20\x24\56\141\152\x61\x78\50\x7b\12\x20\40\x20\40\40\40\40\40\40\x20\40\40\x20\40\x20\x20\40\x20\40\144\x61\164\x61\x3a\40\144\141\164\157\163\54\xa\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x75\162\154\72\x20\x62\x61\163\145\x75\x72\154\x2b\42\x63\x5f\144\x72\x6f\x69\x64\x2f\x6e\x6f\164\x66\x61\x63\x22\54\12\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\164\171\160\x65\72\x20\42\120\117\x53\124\x22\x2c\xa\x20\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\40\x20\40\x20\x73\165\x63\143\145\163\x73\x3a\40\x66\165\x6e\143\x74\151\x6f\x6e\50\144\x61\x74\141\x29\40\173\xa\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x20\44\x28\x22\x23\142\x6f\144\171\42\x29\x2e\150\164\x6d\x6c\50\x64\141\164\x61\x29\x3b\12\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\40\40\40\x24\x28\x22\43\154\151\153\x65\x66\x61\x63\42\51\x2e\166\141\154\x28\x6c\151\153\145\x66\141\x63\x29\73\12\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\x20\x7d\12\40\x20\x20\x20\x20\40\40\x20\x20\40\40\xa\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\40\175\51\73\xa\40\40\x20\x20\40\x20\40\40\x20\x20\x20\175\12\40\40\40\x20\x20\x20\40\x20\12\x20\40\40\40\40\x20\40\40\40\40\x20\x66\x75\x6e\143\x74\x69\157\156\x20\111\x6e\x63\x72\x69\x6d\x65\156\164\116\165\x6d\x66\x61\143\x28\51\x7b\xa\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\166\141\x72\x20\111\156\x63\162\151\x6d\145\156\164\116\165\x6d\x3d\144\x6f\143\x75\155\x65\x6e\x74\56\147\145\164\105\154\145\x6d\x65\156\x74\102\171\111\144\50\42\x49\x6e\143\x72\151\x6d\145\x6e\164\116\x75\155\x22\x29\56\x76\x61\154\165\145\73\12\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x76\x61\162\x20\x6b\x65\x79\x3d\x22\144\162\x6f\151\144\x39\60\x33\42\x3b\x20\166\141\162\40\154\151\x6b\x65\146\141\x63\x3d\44\x28\47\x23\154\x69\153\x65\146\141\143\x27\x29\56\x76\141\154\x28\x29\x3b\xa\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\166\x61\162\x20\x64\x61\x74\x6f\163\x20\x3d\40\x7b\xa\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\42\153\x65\171\42\72\153\x65\171\x2c\12\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\42\160\141\x67\42\40\x3a\x20\111\156\x63\162\151\x6d\145\156\164\116\165\155\x2c\12\40\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\x6c\151\153\145\146\x61\x63\72\x6c\151\x6b\x65\146\141\x63\12\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\175\x3b\12\40\40\40\40\x20\x20\40\40\x20\40\x20\12\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x20\44\56\x61\x6a\141\170\50\x7b\12\40\40\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x64\x61\x74\x61\x3a\x20\144\141\164\x6f\163\54\xa\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\165\x72\154\72\x20\40\142\x61\x73\145\165\162\x6c\x2b\x22\x63\x5f\x64\x72\x6f\x69\x64\57\x6e\x6f\x74\x66\141\x63\x22\54\xa\x20\x20\40\40\40\40\40\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\164\x79\x70\145\x3a\40\x22\120\x4f\x53\124\x22\54\xa\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x73\165\143\143\x65\x73\x73\72\40\x66\x75\156\x63\x74\x69\x6f\156\x28\144\141\x74\x61\x29\40\x7b\xa\x20\40\40\x20\x20\x20\40\40\40\40\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\44\x28\x22\43\142\x6f\x64\171\x22\x29\x2e\150\x74\x6d\x6c\x28\x64\x61\x74\x61\51\x3b\12\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\44\x28\42\43\154\x69\x6b\x65\146\141\x63\42\51\56\x76\141\154\50\154\151\x6b\145\146\x61\x63\x29\x3b\12\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x7d\12\40\40\40\40\x20\40\x20\x20\40\40\x20\xa\40\40\x20\x20\40\x20\40\40\40\40\40\40\40\40\x20\175\x29\x3b\12\40\40\x20\40\40\x20\x20\40\40\x20\40\175\12\x20\x20\x20\40\x20\40\x20\40\x3c\x2f\163\x63\x72\151\x70\164\76\xa\x20\40\x20\40\40\x20\40\x20\74\x64\151\x76\x20\143\x6c\141\x73\x73\75\x22\167\x33\55\x62\141\162\40\167\x33\x2d\x62\157\162\x64\145\x72\x20\x77\63\x2d\142\x61\x72\162\141\163\x22\76\12\40\40\x20\x20\40\x20\x20\40\74\151\x6e\160\x75\x74\40\164\x79\160\145\x3d\x22\x68\151\x64\144\145\x6e\x22\x20\x69\x64\75\x22\104\145\143\x72\x65\x6d\145\156\164\x4e\165\155\x22\40\166\x61\154\165\x65\75\42" . $DecrementNum . "\42\76\xa\40\x20\40\x20\x20\40\40\x20\x3c\x61\x20\x6f\x6e\x63\154\x69\x63\153\x3d\x22\104\x65\x63\162\x65\155\145\x6e\164\x4e\165\155\x46\x61\x63\x28\51\x3b\42\x20\x63\154\x61\x73\x73\x3d\x22\167\63\x2d\142\141\162\x2d\151\164\x65\x6d\40\167\x33\x2d\x62\x75\x74\x74\157\156\x22\x3e\46\154\141\x71\165\157\x3b\74\57\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\141\x67\151\156\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\x66\157\x6e\144\157\x64\162\x6f\151\144"; $html .= "\12\40\x20\x20\x20\40\40\40\x20\74\x69\x6e\x70\165\x74\x20\164\x79\160\145\x3d\42\x68\151\x64\x64\145\156\x22\x20\x69\144\x3d\42" . $id . "\x22\40\x76\x61\x6c\165\x65\75\x22" . $i . "\42\x3e\xa\x20\x20\40\x20\x20\40\40\40\x3c\141\40\157\156\x63\x6c\x69\143\153\75\x22\x6e\165\x6d\160\x61\x67\146\141\143\50\x24\x28\47\x23" . $id . "\47\51\56\166\x61\x6c\x28\x29\x29\73\x22\x20\143\x6c\x61\x73\x73\x3d\x22\167\x33\x2d\x62\141\x72\55\x69\164\x65\x6d\x20\x77\x33\55\x62\165\164\x74\157\x6e\x20" . $hover . "\x22\x3e" . $i . "\x3c\x2f\x61\76"; } else { $hover = ''; $html .= "\x3c\x69\156\160\165\164\40\164\171\160\145\75\x22\150\x69\144\144\x65\156\42\40\151\x64\75\42" . $id . "\x22\x20\166\x61\154\165\145\x3d\42" . $i . "\42\76\12\40\40\x20\40\40\x20\x20\x20\74\x61\x20\157\x6e\143\x6c\x69\x63\x6b\x3d\x22\156\x75\x6d\160\141\147\x66\141\x63\x28\44\50\47\x23" . $id . "\47\x29\x2e\166\141\154\50\x29\x29\73\42\x20\143\154\x61\x73\163\75\42\x77\63\55\142\141\162\55\151\x74\x65\x6d\40\167\63\55\x62\165\x74\164\157\x6e\x20" . $hover . "\42\76" . $i . "\x3c\x2f\x61\x3e"; } } } $html .= "\x3c\x69\156\160\165\x74\40\164\171\160\x65\75\42\150\x69\x64\x64\145\156\x22\x20\151\x64\x3d\x22\x49\x6e\143\162\x69\155\x65\x6e\x74\116\165\155\x22\40\166\x61\x6c\165\145\75\42" . $IncrimentNum . "\42\x3e\xa\x20\x20\40\40\40\40\40\40\x3c\141\40\157\x6e\x63\x6c\x69\x63\x6b\x3d\42\x49\156\x63\x72\x69\155\145\156\164\116\165\x6d\x66\141\x63\x28\51\x3b\x22\40\143\x6c\x61\163\163\75\42\167\63\x2d\x62\x61\162\x2d\151\x74\145\x6d\40\x77\x33\55\x62\165\x74\x74\x6f\156\42\76\x26\162\x61\161\x75\x6f\73\x3c\x2f\141\x3e\xa\xa\40\40\x20\40\x20\40\40\x20\x3c\57\144\x69\166\x3e\x20"; return $html; } public function ncfac($a, $b) { $this->load->library("\164\141\x62\x6c\145"); if ($b != '') { $filter = "\46\46\40\50\141\x2e\144\x6f\x63\165\x6d\x65\x6e\164\157\75\47{$b}\x27\40\x7c\174\x20\141\x2e\x72\145\x66\x65\x72\145\156\x63\x69\141\40\x6c\151\153\145\x20\x27\45{$b}\45\47\x20\x7c\174\40\x61\x2e\x63\x6f\x64\x63\154\151\x65\x6e\164\145\75\x27{$b}\47\40\174\x7c\40\x61\56\x6e\x6f\x6d\142\162\x65\143\154\x69\x20\114\111\x4b\x45\x20\x27\x25{$b}\x25\x27\40\174\174\x20\141\x2e\x76\x65\156\144\145\144\x6f\x72\40\x6c\x69\153\x65\40\47\45{$b}\x25\x27\x20\x7c\x7c\x20\141\56\x74\151\160\x6f\144\157\143\75\47{$b}\47\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\105\114\105\103\124\40\116\125\114\x4c\40\106\x52\117\115\40\157\160\x65\x72\x74\x69\x20\x41\x53\x20\141\40\12\40\x20\40\x20\40\40\40\x4c\x45\x46\x54\40\x4a\x4f\x49\x4e\40\143\x6f\156\x74\162\x6f\154\137\157\x70\x65\162\x74\151\x20\x41\123\40\x63\x20\117\116\40\141\x2e\141\156\x74\x64\x6f\x63\75\x63\x2e\x64\157\x63\xa\x20\40\x20\40\40\x20\40\x57\x48\x45\x52\105\x20\x61\x2e\x74\151\160\157\x64\x6f\143\x3d\x27\x4e\57\x43\47\40" . $filter . "\xa\x20\40\x20\40\x20\40\40\x47\x52\117\125\120\x20\102\131\x20\141\56\144\157\143\165\x6d\145\156\164\157\x20\117\x52\104\105\x52\x20\x42\x59\x20\x61\x2e\x64\157\x63\165\155\145\x6e\x74\157\40\x44\105\x53\103\73")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\x4c\x45\103\x54\x20\x61\56\144\x6f\x63\x75\x6d\x65\156\164\157\x2c\x61\x2e\141\x6e\x74\144\x6f\x63\54\x61\x2e\x74\x69\x70\157\144\157\x63\54\141\x2e\x66\145\143\150\141\143\x72\x65\141\54\x61\x2e\166\x65\x6e\x63\145\x2c\x20\x61\56\143\x6f\x64\x63\x6c\151\x65\156\x74\145\x2c\x20\x61\x2e\156\157\x6d\x62\x72\x65\x63\x6c\x69\54\x20\141\56\164\x65\x6c\x65\x66\x6f\x6e\x6f\163\x2c\x20\x61\56\163\145\x63\x74\157\162\54\141\56\x76\x65\156\144\x65\144\x6f\162\54\x20\x28\123\x45\114\x45\x43\124\40\x52\117\x55\x4e\104\x28\x53\125\x4d\x28\x63\x61\x6e\164\x69\x64\x61\144\x29\55\123\x55\115\50\143\156\x74\144\x65\166\x75\145\x6c\x74\x29\x29\40\x46\x52\117\115\x20\157\x70\145\x72\155\166\x20\x57\110\x45\x52\x45\x20\164\151\x70\157\144\x6f\143\x3d\47\x4e\x2f\103\x27\40\46\46\x20\x64\x6f\x63\165\x6d\x65\156\164\x6f\x3d\141\56\144\157\x63\165\155\x65\x6e\164\x6f\51\40\165\x6e\x69\x64\141\144\145\163\54\40\x63\x2e\x74\151\155\x65\x61\x75\x74\54\143\x2e\x74\x69\155\145\x61\163\x69\147\54\x63\56\164\x69\155\145\x65\155\160\54\x20\12\x20\40\40\x20\x49\x46\x28\143\56\163\x74\141\164\165\x73\40\111\x53\40\x4e\117\124\40\116\125\114\114\40\46\46\40\x63\56\163\x74\x61\x74\165\x73\x21\x3d\47\x27\x2c\143\x2e\x73\x74\141\164\165\163\x2c\x32\x29\x20\163\164\x61\x74\x75\x73\x2c\111\106\x28\141\x2e\x61\x70\154\x69\143\141\x6e\143\41\x3d\47\47\54\x61\x2e\x61\x70\x6c\151\x63\x61\x6e\143\x2c\x27\116\57\x41\47\51\40\x61\160\154\151\x63\x61\156\143\40\x2c\141\56\x65\x73\x74\141\x74\x75\x73\x64\157\x63\12\40\40\x20\40\106\122\x4f\x4d\x20\157\160\x65\162\164\x69\x20\x41\123\40\141\40\12\40\x20\40\40\114\105\x46\x54\x20\112\x4f\111\116\40\x63\x6f\x6e\x74\162\x6f\x6c\x5f\157\160\145\x72\164\x69\x20\x41\x53\40\x63\x20\117\x4e\x20\141\x2e\141\x6e\x74\x64\157\143\75\143\x2e\144\157\x63\xa\x20\x20\40\x20\127\x48\105\122\x45\x20\141\x2e\164\x69\x70\157\144\157\143\75\47\x4e\57\103\47\x20" . $filter . "\12\x20\40\40\x20\107\122\117\x55\120\40\x42\131\40\141\x2e\x64\x6f\x63\x75\155\145\156\x74\157\x20\x4f\x52\x44\x45\122\40\x42\x59\x20\x61\x2e\x64\157\143\x75\x6d\145\x6e\164\x6f\x20\x44\x45\123\x43\40\114\111\115\x49\124\40" . ($a - 1) * $mostrar . "\x20\x2c\x20" . $mostrar . "\73")->result(); $html = "\xa\x20\40\40\x20\x3c\164\141\142\154\x65\40\143\154\141\163\x73\75\42\167\x33\x2d\x74\x61\142\x6c\145\x2d\141\154\154\40\167\x33\x2d\x68\x6f\x76\x65\162\x61\142\154\x65\40\x77\x33\55\x6c\x65\x66\164\55\141\154\x69\x67\156\x22\76\12\x20\40\40\x20\74\x74\x72\x3e\x3c\164\x64\40\143\x6c\141\x73\163\75\x22\167\x33\x2d\x66\x6f\156\x64\x6f\x64\x72\157\x69\x64\42\76\x42\165\x73\143\141\x72\40\x3c\151\155\147\x20\x73\162\x63\x3d\x22" . base_url() . "\151\155\x61\147\145\x73\57\x62\165\163\x63\x61\162\x2e\160\156\147\42\x20\x61\154\164\x3d\x22\x42\165\163\x63\141\x72\x22\x20\x74\x69\164\x6c\145\x3d\42\x42\165\163\143\141\162\x22\x20\x73\x74\x79\x6c\145\75\42\x77\x69\x64\164\150\x3a\x31\70\160\x78\73\x62\x6f\x72\144\145\x72\x3a\x30\x3b\x22\x3e\x3c\57\x74\144\76\12\40\x20\40\x20\x3c\x74\144\76\74\x69\x6e\160\x75\164\x20\164\x79\x70\145\75\x22\164\145\x78\164\42\40\143\154\x61\x73\x73\x3d\x22\167\63\55\x69\156\x70\x75\x74\x22\x20\x70\154\x61\143\145\150\157\x6c\x64\145\162\x3d\42\111\156\x67\x72\x65\163\x65\40\x73\x75\40\142\x75\163\161\x75\x65\x64\x61\x22\x20\157\156\x63\x68\x61\156\x67\x65\75\x22\x6e\143\x66\x61\x63\50\51\x22\40\x69\x64\x3d\42\x6c\x69\153\145\146\x61\143\x22\x3e\x3c\57\164\x64\76\xa\x20\x20\40\40\74\164\144\x20\143\154\x61\163\x73\75\42\x77\x33\x2d\143\145\x6e\164\145\x72\40\x77\x33\x2d\142\x74\x6e\42\76\x3c\141\x20\157\x6e\x63\154\151\x63\153\x3d\x22\x70\x72\145\x66\x61\143\50\51\x3b\x22\76\x3c\151\155\147\40\163\162\x63\x3d\42" . base_url() . "\x69\x6d\141\147\145\163\57\x66\141\143\x74\x75\x72\x61\x2e\x70\x6e\147\42\x20\141\154\x74\x3d\x22\x46\x61\x63\x74\x75\162\x61\x72\42\x20\x74\x69\x74\x6c\145\x3d\42\x46\x61\x63\164\x75\x72\141\x72\42\x20\163\164\171\x6c\145\75\42\167\151\144\x74\x68\72\x32\x30\160\x78\x3b\x68\145\151\147\150\x74\x3a\x32\60\160\x78\73\x62\157\162\144\x65\x72\72\x30\x3b\x22\76\74\57\141\76\74\57\164\x64\76\xa\x20\40\40\40\x3c\x74\144\x20\143\x6c\141\x73\163\75\42\167\63\x2d\x63\145\x6e\x74\x65\x72\40\167\x33\x2d\x62\x74\x6e\42\x3e\x3c\x61\x20\x6f\156\143\154\x69\143\153\x3d\42\x6e\143\146\141\x63\50\x29\x3b\x22\76\74\151\155\x67\x20\x73\162\x63\x3d\42" . base_url() . "\151\x6d\x61\x67\145\x73\57\162\x65\x6c\157\141\144\56\x70\x6e\147\x22\x20\141\154\164\x3d\x22\122\145\143\141\162\147\x61\162\42\x20\x74\x69\164\154\145\75\x22\x52\145\x63\141\x72\147\x61\x72\x22\40\x73\164\171\154\145\75\x22\x77\151\x64\x74\x68\x3a\x32\60\160\x78\73\150\145\151\147\x68\164\72\62\60\x70\x78\73\142\x6f\x72\x64\145\x72\72\60\73\42\76\74\x2f\x61\x3e\74\x2f\x74\144\76\xa\40\x20\40\40\74\x74\144\40\x63\x6c\x61\x73\163\75\42\167\x33\55\143\145\x6e\164\145\162\x20\167\x33\55\142\164\x6e\x22\76\74\141\40\157\156\x63\x6c\x69\x63\x6b\x3d\x22\x64\145\166\x6e\x63\x66\141\x63\50\51\73\42\x3e\74\151\155\x67\40\163\162\143\x3d\x22" . base_url() . "\151\x6d\x61\147\145\x73\57\144\145\x76\157\154\166\145\x72\56\x70\x6e\147\42\x20\x61\154\x74\75\x22\x44\145\166\x6f\154\166\145\x72\42\40\x74\151\164\x6c\x65\x3d\x22\104\145\x76\157\x6c\166\145\x72\x22\x20\x73\x74\x79\154\145\x3d\42\x77\x69\x64\x74\150\72\x32\x30\160\170\x3b\150\x65\x69\147\150\164\72\62\x30\160\x78\73\142\x6f\162\x64\145\162\x3a\60\73\x22\x3e\74\57\141\x3e\x3c\57\x74\x64\76\74\57\164\x72\x3e\12\x20\40\40\x20\x3c\x2f\x74\141\142\154\x65\x3e\74\142\162\76\xa\x20\40\x20\40\x3c\x74\x61\x62\154\145\x20\151\144\75\42\x69\144\x30\x31\x22\x20\x63\154\x61\x73\163\75\x22\x77\x33\x2d\164\x61\142\154\x65\55\141\x6c\154\x20\167\x33\x2d\x68\x6f\166\x65\162\x61\142\x6c\145\x20\167\63\55\x6c\145\x66\164\x2d\x61\x6c\151\147\156\40\x77\x33\x2d\x74\151\156\x79\42\76\x3c\x74\x72\x20\143\154\141\163\x73\75\42\167\63\x2d\146\x6f\156\x64\x6f\x64\x72\x6f\x69\x64\40\167\63\55\146\151\x6a\x6f\42\76\x3c\164\x68\x3e\x4e\74\x2f\164\x68\76\74\164\x68\x3e\x44\x6f\143\74\57\164\x68\76\74\164\x68\76\x41\x70\x6c\151\x63\141\x64\x6f\74\x2f\x74\150\x3e\x3c\x74\150\x3e\103\157\x64\x69\147\157\74\57\164\150\x3e\74\164\150\x3e\116\x6f\x6d\142\162\x65\x3c\x2f\x74\x68\76\x3c\164\x68\x3e\x46\x65\143\x68\x61\x3c\57\164\x68\x3e\x3c\x74\150\x3e\x56\x65\x6e\143\x65\74\x2f\x74\x68\76\74\164\x68\x3e\123\145\x63\x74\x6f\x72\x3c\57\164\150\x3e\x3c\x74\150\x3e\x56\145\156\144\145\144\x6f\162\74\57\x74\x68\x3e\x3c\164\x68\x3e\x55\x6e\151\144\x61\144\145\163\74\57\164\150\x3e\xa\40\x20\40\40\x3c\x74\x68\76\x45\163\x74\141\164\x75\163\x3c\57\164\x68\x3e\74\57\x74\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $vend = $this->db->query("\123\x45\x4c\x45\103\124\40\142\x2e\x6e\157\155\x62\x72\145\40\106\122\117\115\40\x6f\x70\145\162\x74\151\40\x61\163\40\x61\40\112\117\111\x4e\40\154\151\163\164\166\145\x6e\144\40\x61\x73\x20\142\x20\x4f\116\40\x61\x2e\166\145\x6e\x64\x65\x64\x6f\162\x3d\142\x2e\x63\157\144\x69\147\157\x20\127\x48\x45\x52\105\x20\141\x2e\144\x6f\x63\165\155\145\x6e\164\x6f\x3d\47{$dtfac->documento}\47\40\114\x49\x4d\111\124\40\61")->row(); $html .= "\74\164\x72\x20\151\144\x3d\42\163\154\x65\143\x74" . $i . "\x22\x20\143\154\x61\x73\x73\x3d\x22\x69\164\145\x6d\42\40\x6f\156\143\x6c\151\x63\x6b\75\x22\151\x74\x65\x6d\146\x61\143\x28\x24\x28\47\x23\141" . $i . "\x27\x29\56\166\141\x6c\x28\51\x2c\x24\50\x27\x23\142" . $i . "\47\51\x2e\166\141\154\50\51\51\73\x22\x3e"; if ($dtfac->estatusdoc === "\x58") { $status = "\x41\x6e\165\x6c\x61\144\141"; $color = "\x77\x33\55\157\x72\141\x6e\147\x65"; } elseif ($dtfac->aplicanc != "\116\57\x41") { $status = "\101\x70\x6c\151\143\x61\x64\x6f"; $color = "\167\63\55\x67\x72\x65\x65\156"; } else { $status = "\x4e\157\x20\141\160\x6c\x69\143\x61\144\x6f"; $color = "\167\x33\55\162\145\x64"; } $html .= "\x3c\x69\x6e\160\x75\164\40\164\x79\160\x65\75\x22\x68\151\144\144\145\x6e\x22\40\151\144\x3d\x22\141" . $i . "\42\40\x6e\141\155\145\x3d\42\x64\157\143\42\40\166\141\x6c\x75\x65\75\42" . $dtfac->documento . "\42\x3e\74\x69\156\160\165\164\x20\164\171\160\145\75\42\x68\151\x64\144\x65\156\x22\x20\151\x64\x3d\42\142" . $i . "\42\40\156\x61\155\x65\75\x22\164\x69\x70\157\x64\x6f\143\42\40\x76\141\154\165\x65\75\42" . $dtfac->tipodoc . "\x22\x3e\xa\x20\40\40\x20\40\x20\40\40\74\x69\156\160\165\164\40\x74\x79\x70\x65\x3d\x22\x68\151\x64\144\145\156\x22\x20\x6e\x61\x6d\145\75\42\141\156\164\144\x6f\x63\x22\x20\x76\x61\154\165\145\75\x22" . $dtfac->antdoc . "\x22\76\74\x69\x6e\x70\165\x74\40\164\x79\x70\x65\75\42\x68\151\144\144\145\x6e\42\40\156\x61\x6d\145\x3d\x22\x73\x74\x61\x74\x75\x73\x22\x20\166\x61\154\x75\x65\75\42" . $dtfac->status . "\42\x3e\xa\x20\40\x20\x20\x20\40\x20\40\x3c\x74\144\x3e" . $i . "\x3c\x2f\164\x64\76\74\164\144\76\x3c\151\156\160\165\x74\x20\x74\171\x70\145\75\42\x63\x68\x65\x63\153\x62\157\x78\42\40\157\x6e\x63\x6c\151\143\x6b\x3d\42\x77\63\x2e\164\157\x67\147\154\145\103\154\141\x73\x73\50\x27\x23\163\154\145\143\164" . $i . "\x27\x2c\x27\167\63\55\x79\145\x6c\x6c\157\167\x27\51\73\x22\40\143\x6c\141\x73\x73\x3d\42\x77\x33\x2d\143\x68\x65\143\x6b\x22\40\156\x61\155\x65\75\42\143\150\145\143\x6b\x22\76" . $dtfac->documento . "\x3c\57\164\x64\x3e\x3c\x74\x64\x3e" . $dtfac->aplicanc . "\x3c\57\164\x64\76\x3c\x74\x64\x3e" . $dtfac->codcliente . "\74\57\x74\144\x3e\74\x74\x64\76" . $dtfac->nombrecli . "\x3c\57\164\x64\x3e\xa\x20\40\40\x20\40\40\40\x20\74\164\x64\76" . $dtfac->fechacrea . "\x3c\57\x74\144\x3e\74\164\144\x3e" . $dtfac->vence . "\74\x2f\x74\x64\x3e\74\x74\x64\76" . $dtfac->sector . "\x3c\x2f\164\x64\x3e\74\x74\x64\x3e" . $vend->nombre . "\x3c\57\164\x64\76\74\164\x64\76" . $dtfac->unidades . "\74\x2f\x74\144\x3e\x3c\164\x64\40\143\x6c\x61\163\163\x3d\42" . $color . "\40\x77\63\55\x63\145\x6e\164\x65\x72\x22\76" . $status . "\74\x2f\164\144\x3e\12\x20\x20\40\40\40\x20\x20\40\74\57\164\x72\76"; } $html .= "\74\x74\162\x3e\x3c\x74\x64\x20\143\x6c\x61\x73\x73\75\x22\167\x33\55\x63\x65\156\x74\145\x72\40\x77\x33\55\x66\157\x6e\x64\x6f\x64\162\x6f\x69\x64\x22\x20\x63\x6f\154\163\160\141\x6e\75\42\61\63\42\76\74\x6c\141\142\145\x6c\x20\x63\x6c\x61\x73\163\75\42\167\63\x2d\x6c\141\x72\x67\145\x22\76\74\x62\76\124\157\x74\141\154\40\125\x6e\151\144\x61\144\x65\x73\72\40" . $totalreg . "\74\x2f\142\76\74\57\x6c\141\142\145\154\76\x3c\57\x74\144\76\x3c\57\x74\x72\x3e\x3c\57\164\141\142\x6c\145\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\40\x20\x20\x20\40\40\74\x73\143\x72\151\x70\x74\x20\x74\171\160\x65\75\42\164\x65\170\x74\57\152\x61\x76\x61\x73\143\x72\151\x70\164\42\x3e\12\x20\x20\40\x20\40\x20\x20\x20\x66\165\x6e\143\x74\151\x6f\x6e\x20\104\x65\143\162\x65\x6d\x65\x6e\x74\116\165\x6d\x66\x61\x63\50\51\173\12\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\166\x61\x72\x20\x44\145\x63\x72\145\x6d\x65\x6e\x74\x4e\x75\155\x3d\x64\x6f\x63\165\155\145\x6e\x74\56\147\145\164\x45\154\145\x6d\x65\x6e\x74\102\171\111\144\x28\x22\x44\145\143\x72\145\155\145\156\x74\x4e\165\x6d\x22\51\x2e\x76\x61\154\x75\x65\x3b\12\40\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x76\x61\162\x20\x6b\145\171\75\42\144\x72\157\x69\x64\71\x30\x33\42\73\40\x76\141\162\x20\x6c\151\153\x65\x66\x61\143\x3d\44\x28\x27\43\x6c\151\x6b\x65\146\141\143\x27\x29\56\166\x61\154\50\x29\73\12\40\40\x20\40\40\40\x20\x20\40\x20\40\40\166\141\x72\x20\144\x61\x74\x6f\163\40\75\x20\173\xa\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\42\160\141\147\x22\x20\x3a\x20\104\x65\143\162\145\x6d\145\x6e\164\x4e\165\155\54\xa\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x22\x6b\145\x79\42\x20\72\40\153\145\171\54\xa\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x20\x20\40\x20\40\154\151\153\145\146\141\x63\72\x6c\151\153\x65\x66\141\x63\xa\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\x20\175\73\12\40\40\x20\40\40\x20\x20\40\x20\40\x20\12\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\x24\x2e\141\x6a\x61\170\50\x7b\12\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\144\x61\x74\141\72\40\x64\x61\x74\x6f\163\54\12\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\40\x20\x20\x75\162\154\x3a\40\x20\142\x61\163\x65\x75\x72\x6c\x2b\42\143\137\144\162\x6f\x69\x64\57\x6e\143\x66\141\x63\x22\54\xa\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x74\x79\160\145\72\x20\x22\120\x4f\123\x54\x22\54\12\40\40\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\40\x20\163\165\x63\x63\145\163\163\x3a\x20\x66\165\x6e\143\164\x69\157\x6e\x28\144\x61\x74\141\x29\40\173\12\x20\40\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\x20\x24\x28\42\43\142\157\144\x79\x22\51\x2e\x68\x74\x6d\154\x28\x64\x61\164\141\51\73\xa\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x24\x28\x22\43\x6c\151\x6b\x65\x66\141\x63\42\51\x2e\x76\x61\154\50\x6c\151\x6b\145\x66\x61\143\x29\x3b\xa\x20\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\x20\x7d\xa\x20\40\40\40\x20\40\40\x20\x20\40\x20\xa\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\175\x29\x3b\xa\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\175\xa\x20\x20\40\40\x20\40\40\x20\xa\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\146\x75\156\x63\x74\x69\x6f\156\x20\x6e\165\155\x70\141\x67\146\141\x63\x28\x61\x29\173\xa\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\166\141\162\x20\153\145\171\75\42\x64\x72\x6f\151\x64\71\60\63\42\73\40\x76\x61\x72\x20\154\151\x6b\x65\x66\x61\x63\x3d\x24\x28\x27\x23\x6c\x69\x6b\x65\x66\x61\x63\47\x29\x2e\x76\141\x6c\50\51\73\xa\x20\x20\x20\40\40\x20\x20\40\xa\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\x76\141\x72\x20\x64\141\164\x6f\x73\40\75\40\173\12\x20\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\42\153\145\x79\42\x3a\153\145\171\54\xa\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\40\40\x22\x70\141\x67\42\40\x3a\40\x61\x2c\xa\40\x20\x20\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\x20\40\x20\154\151\x6b\x65\x66\141\143\72\x6c\x69\153\145\146\x61\143\12\40\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x7d\73\12\x20\40\40\x20\40\40\x20\40\40\40\x20\xa\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x24\56\141\152\141\170\50\173\xa\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\x64\x61\164\141\x3a\x20\144\x61\x74\157\x73\54\12\40\40\x20\40\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\x75\162\x6c\72\40\142\141\163\x65\x75\162\154\53\42\143\x5f\144\162\x6f\151\x64\57\x6e\x63\x66\x61\x63\42\x2c\12\x20\40\x20\40\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\x20\40\x20\x74\x79\x70\x65\x3a\x20\42\120\x4f\x53\x54\42\54\12\40\40\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\40\x73\165\x63\143\145\x73\x73\72\x20\x66\x75\156\143\164\x69\157\156\x28\144\x61\164\141\x29\40\x7b\12\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x24\x28\x22\x23\x62\157\x64\171\x22\51\x2e\x68\164\155\x6c\x28\144\x61\x74\x61\x29\x3b\12\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\44\x28\42\x23\x6c\151\x6b\x65\x66\x61\143\x22\51\56\x76\x61\x6c\50\x6c\151\x6b\x65\146\x61\x63\51\73\xa\40\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\175\12\40\x20\x20\x20\40\40\x20\x20\40\40\x20\12\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\175\x29\73\xa\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\x7d\12\x20\x20\x20\40\40\40\40\x20\xa\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\146\165\156\x63\x74\151\x6f\x6e\40\x49\x6e\x63\x72\151\155\x65\x6e\x74\x4e\x75\x6d\146\x61\143\50\51\x7b\xa\40\x20\40\x20\x20\x20\40\40\x20\40\40\40\x76\x61\x72\40\111\x6e\x63\x72\151\155\x65\x6e\x74\116\x75\x6d\75\x64\157\143\165\155\x65\x6e\x74\x2e\147\145\x74\105\154\x65\x6d\145\156\x74\102\x79\111\144\x28\42\x49\156\x63\162\151\155\x65\x6e\164\x4e\x75\x6d\42\x29\56\166\x61\154\x75\145\x3b\xa\x20\40\x20\x20\40\40\x20\x20\40\40\x20\x20\166\x61\x72\40\x6b\x65\x79\75\x22\144\x72\157\151\x64\71\x30\63\x22\x3b\40\166\141\162\x20\x6c\151\153\145\146\x61\x63\x3d\x24\x28\47\x23\x6c\x69\153\x65\146\x61\x63\47\x29\x2e\166\x61\x6c\x28\x29\73\xa\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x76\141\x72\40\144\x61\164\157\x73\40\x3d\x20\x7b\xa\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\40\40\40\x20\40\42\x6b\145\x79\42\72\x6b\145\x79\x2c\xa\40\40\40\40\x20\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\40\x22\160\141\147\x22\x20\x3a\40\x49\x6e\x63\x72\151\155\x65\156\164\116\165\x6d\54\xa\40\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\x20\x20\40\x6c\x69\153\145\146\x61\143\x3a\x6c\x69\153\145\146\141\143\12\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\175\73\12\40\40\40\x20\x20\40\x20\x20\x20\40\x20\xa\x20\x20\x20\40\40\x20\40\40\40\40\40\x20\40\40\x20\x24\x2e\141\x6a\141\x78\50\x7b\12\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\x20\40\144\141\x74\141\72\x20\x64\x61\x74\x6f\x73\x2c\xa\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\40\165\x72\x6c\72\40\x20\142\x61\x73\145\165\x72\x6c\53\x22\143\x5f\x64\x72\x6f\151\x64\57\156\143\146\141\x63\42\54\xa\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\164\171\x70\x65\72\x20\x22\120\x4f\123\x54\x22\54\xa\40\40\x20\40\x20\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\163\x75\143\143\145\x73\163\72\x20\146\165\156\143\164\151\x6f\x6e\50\144\141\x74\x61\x29\40\x7b\xa\x20\40\40\40\40\40\40\x20\40\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\44\x28\x22\x23\142\157\x64\171\42\x29\x2e\x68\164\155\154\x28\x64\141\x74\141\x29\x3b\xa\x20\x20\40\40\40\40\40\40\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\40\40\x24\x28\x22\x23\x6c\151\x6b\x65\146\141\x63\42\x29\56\x76\x61\x6c\50\x6c\151\x6b\x65\x66\x61\143\51\73\xa\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x7d\12\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\xa\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\175\x29\x3b\xa\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x7d\12\40\x20\x20\40\x20\40\40\x20\74\57\x73\x63\162\151\x70\x74\76\12\40\40\40\40\x20\40\x20\x20\x3c\144\151\x76\x20\x63\x6c\x61\x73\163\75\x22\x77\x33\x2d\x62\x61\x72\x20\x77\63\x2d\x62\157\162\x64\x65\x72\x20\167\63\55\142\141\162\x72\141\163\x22\76\12\x20\40\40\x20\40\40\x20\40\x3c\151\x6e\x70\x75\164\x20\x74\171\x70\145\x3d\x22\x68\x69\x64\144\145\x6e\x22\40\x69\x64\75\x22\104\145\x63\162\145\x6d\x65\156\164\x4e\x75\x6d\42\40\x76\x61\x6c\165\145\x3d\42" . $DecrementNum . "\42\76\xa\x20\40\x20\x20\40\40\40\40\x3c\141\40\157\156\143\154\151\143\x6b\x3d\42\104\145\x63\162\x65\155\x65\x6e\x74\x4e\x75\155\x46\141\x63\50\51\73\x22\x20\143\154\x61\163\163\75\x22\x77\63\55\142\141\x72\x2d\151\x74\145\155\40\x77\x33\x2d\x62\x75\164\164\157\x6e\42\x3e\x26\154\141\161\x75\157\73\x3c\57\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\x64\160\x61\147\x69\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\x2d\x66\x6f\x6e\x64\157\144\x72\x6f\151\144"; $html .= "\12\x20\x20\40\x20\40\40\x20\x20\x3c\151\156\160\165\164\x20\164\171\x70\x65\x3d\x22\x68\x69\x64\144\145\156\x22\x20\151\x64\75\42" . $id . "\42\x20\x76\x61\154\x75\145\x3d\x22" . $i . "\x22\76\xa\40\x20\40\40\x20\40\40\x20\x3c\141\40\157\x6e\143\x6c\151\143\153\75\42\156\165\155\x70\141\x67\146\141\143\50\44\x28\x27\x23" . $id . "\47\51\x2e\166\141\x6c\50\x29\x29\x3b\42\40\143\154\141\163\x73\75\x22\x77\63\x2d\142\x61\162\55\151\164\x65\155\x20\x77\63\x2d\x62\x75\164\164\157\x6e\x20" . $hover . "\x22\76" . $i . "\74\57\x61\x3e"; } else { $hover = ''; $html .= "\x3c\151\156\x70\x75\164\40\x74\171\x70\145\75\x22\150\151\144\144\x65\156\42\40\151\x64\x3d\42" . $id . "\42\x20\166\141\x6c\165\x65\75\42" . $i . "\42\x3e\12\40\x20\x20\x20\x20\40\40\x20\x3c\141\x20\x6f\x6e\x63\154\x69\x63\x6b\75\x22\156\x75\155\160\x61\x67\x66\141\143\50\x24\x28\x27\x23" . $id . "\x27\x29\x2e\166\141\154\x28\51\51\73\42\x20\x63\154\x61\163\163\75\x22\x77\x33\55\142\141\162\55\x69\x74\145\x6d\40\x77\63\55\142\x75\x74\x74\157\156\40" . $hover . "\42\x3e" . $i . "\74\57\x61\76"; } } } $html .= "\x3c\151\156\160\x75\164\40\164\171\160\x65\x3d\x22\x68\x69\144\144\x65\x6e\42\40\x69\x64\75\x22\111\x6e\143\162\x69\155\x65\156\x74\116\165\x6d\42\40\x76\x61\154\x75\x65\x3d\x22" . $IncrimentNum . "\42\76\12\x20\40\40\x20\x20\40\40\x20\x3c\x61\40\157\x6e\143\154\x69\x63\153\75\x22\x49\156\x63\162\151\x6d\145\156\x74\116\165\155\x66\141\x63\x28\51\x3b\42\40\x63\154\x61\163\x73\x3d\x22\167\x33\x2d\x62\x61\162\x2d\151\x74\145\155\40\167\x33\x2d\142\x75\x74\164\157\x6e\42\x3e\x26\162\141\x71\x75\157\x3b\x3c\57\141\76\xa\12\40\40\x20\x20\x20\40\40\x20\74\x2f\144\151\x76\x3e\x20"; return $html; } public function ndfac($a, $b) { $this->load->library("\x74\141\x62\154\145"); if ($b != '') { $filter = "\x26\x26\x20\x28\x61\x2e\144\157\143\165\155\x65\x6e\164\157\x3d\47{$b}\x27\40\174\174\x20\x61\x2e\x72\x65\x66\x65\162\145\x6e\x63\x69\x61\40\x6c\x69\x6b\x65\40\47\45{$b}\x25\x27\40\x7c\x7c\40\141\x2e\x63\x6f\x64\x63\154\x69\x65\x6e\164\145\x3d\x27{$b}\47\x20\174\x7c\x20\141\x2e\x6e\157\155\142\162\x65\x63\x6c\151\x20\114\x49\113\x45\40\47\x25{$b}\x25\x27\40\x7c\174\x20\141\56\166\145\x6e\x64\x65\144\157\x72\x20\154\151\x6b\x65\40\x27\45{$b}\x25\x27\40\174\x7c\x20\x61\56\164\x69\x70\x6f\144\157\x63\x3d\x27{$b}\47\x29"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\105\x4c\x45\103\x54\x20\116\125\114\x4c\40\x46\x52\117\x4d\40\157\x70\145\x72\164\x69\x20\101\x53\x20\141\12\x20\x20\40\x20\x20\x20\40\114\x45\106\124\x20\112\117\x49\116\x20\143\x6f\x6e\164\162\157\154\x5f\x6f\160\145\x72\164\x69\40\101\x53\40\x63\x20\117\x4e\40\x61\56\x61\x6e\x74\x64\157\143\75\143\56\x64\x6f\x63\12\40\x20\40\40\40\x20\40\x57\110\105\x52\105\40\x61\56\164\151\x70\x6f\144\157\143\75\47\116\57\104\x27\x20" . $filter . "\12\40\x20\40\40\40\40\x20\107\x52\x4f\x55\x50\40\x42\131\40\141\56\144\157\143\165\x6d\145\x6e\164\x6f\x20\117\122\104\x45\x52\x20\102\x59\40\x61\x2e\144\x6f\x63\165\x6d\145\156\x74\157\40\104\x45\x53\x43\x3b")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\114\x45\x43\x54\40\141\x2e\144\x6f\x63\x75\x6d\x65\156\x74\x6f\54\x61\56\141\156\164\144\157\143\54\141\56\164\x69\160\157\x64\x6f\x63\x2c\141\56\x66\145\x63\150\141\x63\162\145\141\x2c\x61\x2e\x76\145\x6e\143\145\54\40\x61\x2e\x63\x6f\144\143\154\x69\145\x6e\x74\x65\x2c\40\141\56\x6e\x6f\x6d\x62\162\x65\x63\x6c\151\54\x20\141\56\164\x65\154\x65\x66\x6f\x6e\x6f\163\54\x20\x61\x2e\x73\145\x63\164\x6f\162\54\141\56\166\x65\x6e\144\145\144\x6f\162\x2c\x20\x28\123\x45\114\x45\x43\x54\40\122\117\125\x4e\x44\x28\123\125\115\50\x63\141\156\x74\x69\144\x61\144\51\x2d\123\x55\115\50\x63\156\x74\x64\x65\x76\165\145\x6c\x74\x29\x29\x20\106\x52\117\115\40\x6f\x70\x65\162\155\166\40\x57\x48\x45\x52\105\40\164\x69\x70\157\144\157\x63\x3d\47\116\x2f\x44\47\x20\46\46\x20\144\157\x63\x75\155\x65\156\x74\157\x3d\141\56\144\157\x63\165\155\145\156\x74\157\51\40\165\156\x69\144\141\144\x65\x73\x2c\40\x63\x2e\164\x69\x6d\145\x61\x75\x74\54\143\x2e\164\151\155\x65\x61\163\151\x67\x2c\143\x2e\x74\151\155\x65\x65\155\160\x2c\x20\12\40\40\40\40\x49\106\50\x63\x2e\163\x74\x61\x74\x75\x73\x20\x49\x53\40\x4e\x4f\x54\40\x4e\x55\x4c\x4c\40\46\46\40\x63\56\163\164\141\164\165\163\41\75\47\x27\x2c\x63\56\x73\x74\x61\x74\x75\x73\54\62\x29\40\163\x74\141\164\x75\163\x2c\141\56\145\x73\x74\x61\x74\165\163\x64\157\x63\xa\x20\x20\40\40\x46\x52\117\115\x20\157\160\145\162\x74\151\40\101\x53\40\x61\40\12\x20\x20\40\x20\114\x45\x46\x54\40\x4a\117\x49\x4e\x20\143\157\x6e\x74\x72\x6f\x6c\x5f\157\160\x65\x72\x74\151\x20\x41\123\x20\x63\40\117\116\x20\141\x2e\141\x6e\x74\x64\157\x63\x3d\x63\56\x64\x6f\x63\12\40\40\40\40\127\x48\x45\x52\x45\x20\141\56\164\x69\x70\157\144\157\x63\75\47\x4e\x2f\104\47\40" . $filter . "\xa\x20\x20\x20\x20\x47\x52\117\x55\120\x20\102\x59\x20\141\x2e\144\157\143\165\x6d\145\156\x74\157\40\117\x52\104\x45\122\x20\x42\x59\40\x61\56\144\x6f\143\165\155\145\x6e\164\x6f\x20\104\105\x53\x43\40\x4c\x49\115\x49\124\40" . ($a - 1) * $mostrar . "\x20\54\x20" . $mostrar . "\73")->result(); $html = "\12\40\x20\40\40\x3c\x74\141\x62\154\x65\x20\143\x6c\141\163\x73\x3d\x22\x77\63\x2d\164\141\x62\154\x65\55\x61\154\154\40\x77\63\x2d\x68\x6f\x76\x65\x72\141\142\x6c\145\40\x77\x33\55\x6c\x65\146\164\55\x61\x6c\151\x67\x6e\x22\76\xa\40\x20\x20\x20\x3c\x74\x72\76\74\164\144\40\143\x6c\141\x73\163\x3d\42\167\63\55\x66\157\156\x64\x6f\144\x72\157\x69\x64\42\x3e\x42\165\163\143\141\162\40\74\x69\155\147\x20\163\162\x63\x3d\42" . base_url() . "\x69\155\x61\x67\x65\163\x2f\x62\165\163\143\141\162\x2e\160\x6e\147\42\40\x61\x6c\164\75\42\x42\165\163\x63\141\x72\x22\40\x74\x69\164\x6c\x65\x3d\42\x42\165\x73\143\x61\x72\42\40\x73\164\171\154\x65\75\42\167\x69\144\x74\150\x3a\x31\70\x70\x78\73\x62\157\162\x64\x65\x72\72\60\x3b\42\x3e\x3c\57\x74\144\x3e\12\x20\40\40\x20\74\x74\x64\x3e\x3c\151\156\160\165\x74\x20\x74\x79\160\145\75\x22\x74\145\170\164\x22\x20\x63\x6c\141\163\163\75\x22\x77\63\55\x69\156\x70\x75\x74\x22\x20\160\x6c\x61\x63\145\x68\x6f\154\x64\x65\162\75\42\111\156\x67\162\x65\163\x65\40\x73\165\x20\x62\165\x73\x71\165\x65\144\x61\42\40\x6f\156\x63\150\141\156\147\145\x3d\42\x6e\144\146\x61\x63\50\x29\42\40\x69\144\x3d\42\x6c\151\x6b\x65\146\x61\x63\x22\x3e\x3c\57\164\x64\76\12\x20\40\x20\40\x3c\x74\144\x20\x63\x6c\x61\x73\163\x3d\42\x77\x33\x2d\143\x65\156\164\x65\162\40\167\x33\x2d\x62\164\156\x22\x3e\74\141\40\x6f\156\143\154\151\x63\x6b\75\42\x70\x72\145\x66\x61\143\50\x29\x3b\x22\x3e\74\151\155\147\x20\x73\162\x63\75\x22" . base_url() . "\151\x6d\x61\147\145\x73\x2f\146\x61\143\164\x75\162\x61\x2e\160\x6e\x67\42\x20\141\x6c\x74\x3d\42\x46\x61\143\164\165\x72\141\162\42\40\x74\x69\x74\154\x65\75\42\x46\141\x63\x74\x75\162\141\162\42\x20\163\x74\x79\x6c\x65\75\42\x77\x69\x64\x74\150\72\x32\60\x70\x78\73\x68\145\151\147\150\164\72\62\x30\160\170\73\142\157\x72\144\145\x72\x3a\x30\73\x22\x3e\74\57\141\x3e\x3c\x2f\164\x64\x3e\12\40\40\x20\40\x3c\x74\x64\40\143\154\141\x73\163\75\x22\x77\x33\x2d\143\145\x6e\164\x65\162\40\167\x33\55\142\x74\156\x22\x3e\x3c\x61\x20\x6f\x6e\143\x6c\151\x63\153\x3d\42\156\144\146\141\143\x28\x29\73\42\x3e\x3c\x69\x6d\147\40\x73\162\143\x3d\x22" . base_url() . "\x69\x6d\141\147\145\163\57\162\145\154\x6f\x61\x64\x2e\160\156\x67\42\x20\x61\x6c\164\75\x22\122\x65\143\x61\x72\147\141\x72\42\40\164\x69\164\x6c\145\x3d\x22\122\145\x63\x61\162\147\141\162\x22\x20\x73\x74\x79\x6c\x65\75\42\x77\x69\x64\x74\x68\72\62\x30\x70\x78\x3b\x68\145\151\147\x68\x74\x3a\x32\60\x70\x78\x3b\x62\x6f\162\144\x65\x72\72\60\x3b\42\76\74\57\x61\x3e\x3c\x2f\164\144\76\xa\x20\x20\x20\40\74\x74\x64\40\x63\x6c\141\x73\163\x3d\x22\x77\63\55\143\x65\x6e\164\145\162\40\167\63\55\x62\x74\x6e\42\76\x3c\x61\40\157\156\x63\x6c\151\143\x6b\x3d\42\144\x65\166\156\144\146\141\x63\50\x29\x3b\x22\76\x3c\x69\x6d\x67\x20\x73\162\x63\75\x22" . base_url() . "\151\155\141\147\x65\163\57\x64\x65\166\157\154\x76\x65\x72\x2e\x70\156\x67\x22\40\141\154\x74\75\42\104\145\166\157\x6c\166\x65\162\x22\x20\164\151\x74\x6c\x65\x3d\42\x44\x65\166\x6f\154\x76\145\x72\x22\x20\x73\x74\x79\154\145\75\x22\x77\151\x64\164\x68\72\62\x30\160\x78\x3b\x68\145\151\x67\150\164\x3a\62\60\x70\x78\73\142\x6f\162\x64\x65\162\x3a\x30\73\42\76\74\x2f\x61\x3e\74\57\164\144\x3e\xa\x20\40\x20\40\74\x21\x2d\x2d\74\164\144\40\x63\x6c\x61\x73\x73\75\x22\x77\x33\x2d\143\145\156\x74\145\162\x20\x77\63\55\x62\x74\156\42\x3e\x3c\141\40\x6f\x6e\143\x6c\151\x63\x6b\75\x22\145\x6c\x69\x6d\146\141\143\50\x29\73\x22\x3e\74\x69\x6d\x67\x20\163\x72\143\75\x22" . base_url() . "\151\x6d\x61\147\145\163\x2f\x62\157\162\162\141\x72\56\x70\x6e\x67\42\x20\x61\154\x74\x3d\42\105\x6c\x69\x6d\x69\x6e\141\x72\x22\40\164\x69\x74\154\x65\x3d\x22\105\x6c\x69\155\x69\x6e\x61\162\42\x20\163\164\171\154\145\75\x22\x77\151\x64\164\x68\x3a\62\60\x70\170\x3b\150\x65\x69\147\150\164\x3a\x32\x30\x70\x78\73\x62\x6f\162\x64\145\162\72\60\73\x22\76\74\57\141\x3e\74\x2f\x74\x64\x3e\x2d\55\76\x3c\x2f\x74\162\76\12\40\x20\40\40\74\x2f\x74\x61\142\x6c\145\x3e\74\x62\162\76\xa\x20\40\40\40\74\164\x61\142\154\145\40\x69\144\x3d\42\151\x64\60\61\x22\x20\143\154\x61\x73\x73\75\42\x77\x33\x2d\164\141\x62\154\145\55\x61\x6c\x6c\x20\x77\63\x2d\x68\157\x76\x65\162\x61\x62\154\x65\x20\167\x33\55\x6c\145\146\164\x2d\141\x6c\x69\x67\x6e\x20\167\63\55\x74\151\x6e\x79\x22\76\74\164\162\40\x63\154\141\x73\163\x3d\x22\x77\x33\x2d\x66\x6f\156\144\x6f\x64\x72\x6f\x69\144\x20\x77\63\x2d\x66\x69\152\x6f\x22\x3e\74\164\x68\x3e\116\x3c\57\x74\x68\76\x3c\x74\150\76\104\157\143\74\x2f\164\x68\76\x3c\164\150\x3e\103\157\144\151\x67\x6f\74\x2f\x74\x68\76\74\x74\150\x3e\116\x6f\x6d\142\x72\145\x3c\x2f\164\x68\76\x3c\x74\150\x3e\x46\x65\x63\150\x61\x3c\57\164\x68\x3e\74\164\x68\76\x56\145\x6e\143\145\74\57\x74\x68\76\74\x74\x68\x3e\x53\x65\x63\164\x6f\162\x3c\57\164\150\76\x3c\164\x68\x3e\x56\x65\x6e\144\x65\x64\x6f\x72\x3c\57\x74\150\76\x3c\164\150\76\125\156\x69\144\x61\144\x65\x73\74\x2f\164\150\x3e\12\40\40\40\74\164\x68\x3e\x45\x73\164\141\164\165\x73\74\x2f\164\x68\76\74\x2f\164\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $vend = $this->db->query("\x53\x45\x4c\105\x43\x54\40\x62\x2e\156\157\x6d\142\x72\145\x20\x46\122\x4f\x4d\40\157\160\145\162\x74\x69\40\x61\163\x20\141\40\112\x4f\111\116\40\154\151\x73\x74\x76\x65\156\144\x20\x61\163\40\x62\40\x4f\x4e\x20\141\56\x76\x65\x6e\144\x65\x64\157\x72\x3d\142\56\143\157\144\x69\147\x6f\40\127\x48\105\x52\x45\40\141\x2e\144\157\143\165\155\x65\x6e\x74\x6f\75\47{$dtfac->documento}\x27\x20\114\x49\x4d\111\x54\40\x31")->row(); $html .= "\x3c\164\x72\x20\151\144\75\42\163\x6c\145\143\x74" . $i . "\42\40\143\154\141\163\x73\x3d\42\x69\164\x65\x6d\x22\x20\x6f\x6e\x63\x6c\x69\x63\153\x3d\42\x69\x74\145\155\x66\141\143\50\x24\x28\47\43\x61" . $i . "\47\x29\56\166\141\154\50\x29\54\44\50\x27\43\142" . $i . "\47\51\x2e\166\x61\154\50\51\51\73\42\x3e"; if ($dtfac->estatusdoc == "\x31") { $status = "\111\155\160\162\145\163\x61"; $color = "\x77\63\x2d\147\x72\x65\145\x6e"; } else { if ($dtfac->estatusdoc == "\x30") { $status = "\x4e\157\40\x69\155\x70\162\x65\x73\141"; $color = "\167\63\55\x72\x65\x64"; } else { if ($dtfac->estatusdoc == "\130") { $status = "\101\x6e\x75\154\x61\144\x61"; $color = "\167\63\55\x6f\162\141\x6e\147\x65"; } } } $html .= "\74\151\156\160\x75\x74\x20\x74\171\x70\145\75\x22\x68\151\x64\x64\x65\x6e\42\x20\151\x64\75\x22\x61" . $i . "\42\x20\156\141\x6d\x65\x3d\x22\x64\x6f\x63\42\40\x76\141\x6c\165\x65\75\42" . $dtfac->documento . "\x22\x3e\x3c\151\156\x70\x75\x74\40\164\x79\x70\x65\75\x22\150\x69\144\144\145\x6e\42\40\151\x64\75\42\x62" . $i . "\x22\x20\156\141\155\145\75\42\x74\x69\160\157\144\157\x63\42\x20\166\x61\x6c\165\145\75\x22" . $dtfac->tipodoc . "\42\76\12\x20\x20\x20\40\x20\40\x20\x20\x3c\151\x6e\x70\165\164\x20\x74\x79\160\145\75\x22\150\x69\x64\x64\x65\x6e\42\40\x6e\x61\155\145\x3d\x22\141\x6e\x74\144\157\x63\42\x20\166\x61\x6c\165\x65\75\x22" . $dtfac->antdoc . "\x22\76\x3c\x69\x6e\160\165\x74\40\x74\171\x70\x65\75\x22\150\x69\x64\144\x65\156\42\40\156\x61\x6d\x65\75\42\x73\164\141\x74\x75\x73\x22\x20\166\x61\154\x75\145\75\x22" . $dtfac->status . "\x22\76\xa\40\40\x20\40\40\x20\x20\x20\74\x74\x64\x3e" . $i . "\x3c\57\x74\144\x3e\x3c\164\x64\x3e\74\x69\x6e\x70\165\164\x20\164\171\x70\145\x3d\x22\x63\150\145\143\x6b\142\157\x78\x22\x20\x6f\156\x63\154\x69\x63\x6b\x3d\42\167\x33\x2e\x74\x6f\x67\x67\x6c\x65\103\154\141\163\x73\50\47\43\x73\x6c\x65\x63\x74" . $i . "\x27\x2c\x27\x77\x33\55\171\x65\x6c\154\157\x77\47\x29\x3b\x22\x20\x63\154\x61\x73\x73\75\42\x77\x33\55\x63\x68\x65\x63\x6b\42\x20\156\x61\x6d\145\x3d\x22\x63\150\x65\143\153\x22\76" . $dtfac->documento . "\x3c\57\x74\144\x3e\x3c\x74\144\76" . $dtfac->codcliente . "\74\x2f\164\x64\x3e\74\x74\x64\76" . $dtfac->nombrecli . "\74\x2f\x74\x64\76\xa\40\x20\x20\x20\x20\40\40\x20\74\x74\x64\x3e" . $dtfac->fechacrea . "\x3c\x2f\164\x64\x3e\x3c\x74\144\76" . $dtfac->vence . "\74\x2f\164\x64\x3e\74\164\144\x3e" . $dtfac->sector . "\74\57\164\x64\76\x3c\x74\x64\76" . $vend->nombre . "\x3c\57\164\x64\76\x3c\x74\x64\76" . $dtfac->unidades . "\x3c\x2f\164\144\x3e\74\x74\144\40\143\154\141\163\x73\x3d\42" . $color . "\40\167\63\55\x63\x65\156\x74\145\162\x22\76" . $status . "\74\57\164\x64\x3e\12\40\x20\x20\40\x20\x20\40\40\74\x2f\164\162\76"; } $html .= "\x3c\164\162\x3e\74\164\x64\x20\143\x6c\141\163\x73\75\x22\167\63\55\143\x65\x6e\x74\x65\162\40\167\x33\55\x66\157\156\144\157\x64\x72\157\151\x64\42\40\143\x6f\154\x73\x70\141\x6e\75\42\x31\63\x22\76\74\154\x61\142\145\154\x20\143\x6c\x61\163\163\75\42\x77\x33\55\154\141\162\147\x65\42\76\74\142\76\124\157\164\x61\x6c\x20\125\x6e\151\144\x61\x64\145\163\72\x20" . $totalreg . "\74\57\x62\76\x3c\57\x6c\141\142\145\154\76\x3c\x2f\164\x64\x3e\x3c\x2f\164\162\76\x3c\57\x74\x61\142\154\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\40\x20\x20\x20\40\x20\40\74\163\x63\x72\151\160\164\40\x74\x79\160\145\75\x22\164\145\170\x74\57\x6a\x61\166\141\x73\x63\162\x69\160\x74\42\76\12\x20\x20\40\40\40\x20\40\40\x66\x75\156\143\x74\x69\157\x6e\40\104\x65\143\x72\x65\x6d\145\156\x74\116\x75\x6d\146\141\143\50\x29\x7b\xa\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\x76\x61\x72\40\104\145\143\x72\145\155\145\x6e\x74\116\x75\x6d\x3d\144\157\143\x75\155\145\x6e\x74\x2e\147\145\x74\105\154\x65\155\145\x6e\x74\x42\171\x49\144\50\42\x44\145\143\x72\x65\155\x65\156\x74\x4e\165\155\x22\51\56\166\141\154\x75\145\x3b\12\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x76\x61\162\40\153\145\x79\75\42\x64\x72\x6f\151\x64\71\60\x33\42\x3b\x20\166\x61\162\40\154\x69\x6b\x65\146\x61\x63\x3d\44\x28\x27\43\154\x69\153\145\146\141\x63\47\x29\56\x76\141\x6c\50\x29\73\xa\40\40\40\40\40\40\40\40\x20\x20\x20\x20\x76\x61\162\40\x64\x61\x74\157\163\40\75\x20\x7b\12\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x22\160\141\x67\x22\40\x3a\40\x44\x65\x63\x72\145\x6d\x65\x6e\x74\x4e\165\x6d\x2c\12\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\40\x22\153\145\171\x22\40\72\40\x6b\x65\171\54\xa\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\154\151\x6b\x65\146\x61\143\x3a\x6c\x69\x6b\x65\x66\x61\143\xa\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x7d\73\12\x20\x20\x20\x20\40\40\40\40\40\x20\40\xa\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\44\56\141\x6a\141\170\x28\x7b\xa\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\x64\x61\164\x61\72\x20\x64\141\164\x6f\163\54\12\x20\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x75\162\154\x3a\40\x20\x62\x61\163\145\165\162\154\x2b\x22\143\137\144\162\x6f\x69\144\x2f\156\144\x66\141\143\x22\54\xa\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\x74\171\x70\x65\x3a\x20\42\120\117\x53\124\42\54\xa\x20\x20\x20\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\x73\165\x63\x63\145\163\x73\x3a\40\146\165\x6e\x63\x74\151\x6f\156\50\x64\141\x74\x61\51\40\x7b\xa\40\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\40\x24\50\x22\43\x62\157\144\171\42\51\x2e\150\164\x6d\x6c\x28\144\x61\164\x61\51\x3b\12\40\x20\x20\x20\40\40\40\40\40\40\40\x20\x20\40\40\40\40\40\x20\x20\40\x20\40\44\x28\x22\x23\154\151\x6b\x65\x66\x61\143\x22\x29\56\x76\x61\x6c\x28\x6c\x69\x6b\145\x66\x61\x63\51\73\xa\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x7d\xa\x20\x20\40\40\40\40\40\x20\40\40\x20\12\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\175\51\73\xa\x20\40\40\x20\40\40\x20\40\x20\40\40\x7d\12\x20\x20\x20\40\x20\x20\40\x20\12\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x66\x75\x6e\x63\164\x69\157\156\x20\x6e\165\x6d\x70\x61\x67\x66\141\x63\x28\x61\x29\173\xa\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\166\141\x72\x20\x6b\x65\x79\x3d\x22\x64\x72\x6f\151\144\x39\x30\63\42\x3b\x20\166\141\162\40\x6c\151\x6b\x65\146\x61\x63\75\x24\x28\47\43\154\x69\153\x65\x66\141\143\x27\51\56\166\141\154\50\x29\x3b\12\x20\x20\x20\x20\x20\x20\40\40\xa\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\x76\x61\162\40\x64\141\x74\x6f\x73\x20\75\x20\173\xa\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\42\x6b\x65\x79\x22\x3a\153\145\171\x2c\xa\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\x20\40\40\x20\x20\x22\160\x61\x67\42\40\72\40\x61\54\12\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x6c\151\153\145\x66\x61\143\72\x6c\151\x6b\145\x66\x61\143\xa\40\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\40\175\73\12\40\x20\40\40\x20\40\40\40\40\x20\40\12\x20\40\40\40\40\40\40\x20\40\40\40\40\x20\40\40\x24\56\141\152\x61\170\x28\173\12\40\40\40\40\40\40\40\40\x20\40\40\40\40\40\40\40\x20\40\x20\144\x61\164\141\x3a\x20\x64\141\x74\x6f\x73\54\xa\x20\40\x20\40\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x75\162\x6c\x3a\x20\142\x61\x73\145\165\x72\x6c\x2b\x22\143\137\144\162\x6f\151\x64\x2f\x6e\144\x66\141\x63\x22\54\12\40\x20\40\40\40\40\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\40\164\171\x70\145\x3a\40\x22\x50\x4f\123\124\42\54\xa\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\163\x75\143\x63\145\163\x73\x3a\x20\146\165\156\x63\164\151\157\156\x28\x64\x61\164\x61\51\40\173\12\x20\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\40\40\40\x20\40\40\40\40\x20\44\x28\42\43\142\x6f\144\x79\42\x29\56\x68\164\x6d\154\50\144\x61\x74\x61\x29\73\12\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x24\x28\42\43\x6c\151\153\145\146\141\143\x22\x29\56\166\141\x6c\50\154\151\x6b\x65\146\x61\143\x29\73\12\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x7d\12\x20\40\x20\40\40\40\x20\x20\40\x20\40\xa\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\175\x29\x3b\xa\40\40\40\x20\x20\40\40\x20\40\40\40\x7d\12\x20\40\40\x20\40\40\40\40\xa\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x66\x75\156\143\164\x69\157\x6e\x20\111\x6e\143\x72\151\155\145\x6e\x74\116\x75\155\146\141\143\50\x29\x7b\12\40\40\40\40\x20\x20\40\40\40\x20\40\x20\166\x61\x72\x20\111\x6e\143\162\151\x6d\x65\x6e\x74\x4e\165\155\x3d\144\157\x63\x75\155\145\x6e\164\x2e\147\x65\164\105\154\x65\x6d\x65\x6e\x74\102\x79\x49\144\x28\42\111\156\x63\162\151\x6d\145\x6e\x74\x4e\165\155\x22\51\56\166\x61\x6c\165\x65\73\12\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x76\141\162\x20\153\x65\171\x3d\42\x64\x72\157\x69\144\71\60\63\42\x3b\40\x76\141\162\x20\154\151\x6b\x65\x66\x61\x63\x3d\44\x28\47\x23\x6c\x69\x6b\x65\x66\141\143\x27\51\x2e\166\141\x6c\50\51\x3b\xa\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\166\x61\162\40\x64\x61\x74\157\163\x20\x3d\x20\173\xa\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\x20\40\x20\40\40\40\42\153\x65\171\x22\72\x6b\145\x79\x2c\12\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\42\x70\141\x67\42\40\x3a\40\x49\x6e\143\162\151\155\145\156\x74\x4e\x75\x6d\54\12\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\40\x6c\x69\x6b\x65\146\141\x63\x3a\x6c\x69\x6b\145\146\x61\x63\12\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x7d\73\xa\x20\40\40\40\x20\40\x20\x20\x20\x20\40\12\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\44\56\x61\x6a\x61\170\50\173\12\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x64\141\164\x61\72\x20\144\141\x74\157\163\x2c\xa\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x75\x72\154\x3a\x20\40\142\141\x73\145\165\162\154\x2b\x22\x63\x5f\x64\162\x6f\151\x64\57\x6e\144\146\141\x63\42\54\xa\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\x20\40\164\x79\x70\x65\x3a\x20\x22\x50\x4f\123\124\42\54\xa\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\163\x75\143\x63\x65\163\163\72\40\x66\x75\156\143\164\151\157\x6e\x28\x64\141\164\141\51\40\173\xa\40\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x24\x28\x22\x23\x62\x6f\x64\171\x22\x29\56\150\x74\155\154\50\144\x61\164\x61\x29\73\12\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\x20\40\40\x20\40\x20\x24\50\42\43\x6c\x69\153\145\x66\141\143\x22\51\x2e\166\x61\154\50\x6c\151\153\x65\x66\x61\143\51\x3b\12\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\175\xa\40\x20\40\x20\x20\40\40\40\x20\40\40\12\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\175\x29\73\12\40\40\x20\40\x20\40\40\x20\40\40\x20\175\12\40\40\40\x20\40\x20\40\40\x3c\x2f\x73\143\x72\x69\x70\x74\76\12\40\x20\x20\x20\x20\40\x20\40\x3c\144\x69\x76\40\143\154\141\x73\x73\75\42\167\63\x2d\142\x61\x72\40\167\x33\x2d\x62\157\x72\144\x65\x72\x20\x77\63\x2d\x62\x61\162\162\x61\163\x22\x3e\xa\x20\x20\x20\x20\x20\x20\x20\40\74\151\x6e\160\165\164\x20\164\171\160\145\75\42\150\x69\144\x64\x65\156\42\40\151\x64\x3d\x22\x44\145\143\x72\145\x6d\x65\x6e\164\116\165\x6d\42\x20\x76\141\154\x75\145\75\42" . $DecrementNum . "\x22\76\xa\40\x20\x20\x20\40\40\40\x20\x3c\x61\x20\x6f\x6e\143\154\x69\x63\x6b\x3d\x22\104\145\x63\x72\x65\x6d\x65\x6e\164\x4e\x75\155\x46\x61\x63\50\51\73\42\x20\x63\x6c\x61\163\x73\75\x22\167\x33\55\x62\x61\x72\x2d\x69\164\145\155\40\167\x33\x2d\x62\165\164\164\x6f\156\x22\x3e\x26\x6c\x61\x71\165\x6f\73\74\x2f\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\x64\x70\141\147\151\x6e\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\x2d\x66\157\156\x64\157\x64\162\x6f\x69\x64"; $html .= "\xa\40\x20\40\x20\x20\40\40\x20\x3c\x69\x6e\160\165\164\x20\x74\171\x70\145\75\42\x68\151\144\x64\x65\x6e\42\40\151\x64\75\x22" . $id . "\42\x20\x76\x61\x6c\165\x65\75\42" . $i . "\x22\76\12\40\40\40\x20\40\x20\x20\x20\x3c\x61\x20\157\x6e\143\x6c\x69\x63\x6b\x3d\x22\x6e\165\x6d\x70\x61\x67\x66\141\x63\50\x24\50\47\43" . $id . "\47\51\x2e\166\x61\154\50\51\x29\73\x22\x20\143\x6c\x61\x73\x73\75\x22\x77\x33\55\142\141\x72\55\x69\164\x65\x6d\x20\167\63\55\142\x75\x74\164\x6f\x6e\x20" . $hover . "\x22\76" . $i . "\x3c\x2f\141\76"; } else { $hover = ''; $html .= "\74\151\x6e\160\x75\x74\40\x74\x79\x70\x65\x3d\42\150\151\x64\x64\145\x6e\x22\40\151\x64\75\42" . $id . "\x22\x20\166\x61\x6c\x75\x65\75\x22" . $i . "\42\x3e\12\x20\40\x20\40\x20\x20\x20\40\x3c\141\40\157\x6e\x63\154\151\143\x6b\75\42\156\x75\x6d\160\x61\x67\x66\x61\x63\x28\x24\50\x27\x23" . $id . "\x27\x29\x2e\166\x61\x6c\50\x29\x29\x3b\42\40\x63\x6c\x61\x73\163\75\42\x77\63\55\x62\141\162\x2d\151\164\x65\155\40\167\x33\x2d\142\165\164\x74\157\x6e\x20" . $hover . "\42\76" . $i . "\x3c\57\141\76"; } } } $html .= "\x3c\x69\156\x70\x75\164\x20\164\171\x70\145\75\x22\x68\151\144\x64\x65\x6e\42\40\151\144\x3d\42\x49\156\x63\x72\x69\x6d\145\x6e\x74\x4e\165\155\x22\40\166\141\154\x75\x65\x3d\42" . $IncrimentNum . "\42\x3e\12\x20\40\x20\40\x20\x20\x20\40\74\x61\40\x6f\x6e\x63\x6c\151\143\x6b\75\x22\x49\x6e\x63\x72\x69\155\x65\156\164\116\165\155\x66\x61\x63\50\x29\73\x22\x20\x63\154\x61\x73\x73\x3d\42\x77\x33\x2d\x62\x61\x72\x2d\151\164\145\x6d\40\167\x33\x2d\142\165\x74\x74\x6f\x6e\42\76\46\x72\x61\x71\x75\157\x3b\x3c\57\141\x3e\xa\xa\40\40\x20\x20\40\40\x20\40\x3c\x2f\144\151\166\x3e\40"; return $html; } public function itemfac($a, $b) { $this->load->library("\164\141\142\x6c\145"); $bditfac = $this->db->query("\x53\105\x4c\105\103\x54\40\143\56\x63\157\x64\x69\147\x6f\54\40\x63\x2e\x6e\157\155\x62\162\x65\x2c\40\x52\117\125\x4e\x44\50\143\56\143\141\x6e\164\151\x64\x61\144\54\x30\x29\x20\143\x61\x6e\x74\151\x64\141\x64\x2c\x52\117\125\116\x44\50\x63\x2e\143\156\x74\x64\x65\x76\x75\145\x6c\x74\x2c\x30\x29\x20\144\x65\166\165\x65\154\x74\141\x2c\x20\143\56\x6c\x6f\164\145\x2c\x20\x63\56\x73\x74\x61\x74\x75\163\40\x46\x52\x4f\x4d\x20\x6f\160\x65\x72\x6d\166\x20\x41\123\40\x63\x20\x57\x48\105\x52\105\x20\143\56\x64\x6f\143\165\x6d\145\x6e\164\x6f\x3d\47{$a}\x27\x20\x26\x26\40\143\56\x74\x69\160\157\x64\x6f\143\75\47{$b}\47\73")->result(); $nom = $this->db->query("\x53\105\x4c\x45\103\124\x20\x6e\x6f\x6d\141\160\x65\40\x46\x52\x4f\115\40\164\162\141\142\x20\141\x73\x20\141\40\x4a\x4f\111\x4e\x20\143\x6f\x6e\x74\x72\157\x6c\x5f\157\160\145\162\164\x69\40\141\163\40\142\40\x4f\x4e\40\x61\x2e\151\x64\75\x62\x2e\x74\x72\x61\142\145\x6d\x70\x61\161\40\127\x48\105\x52\x45\x20\x62\56\144\157\143\75\x27{$a}\x27")->row(); $vend = $this->db->query("\x53\x45\x4c\105\x43\x54\x20\142\x2e\156\157\155\x62\162\145\x20\106\122\x4f\115\x20\x6f\x70\145\162\x74\x69\40\141\163\x20\x61\40\x4a\117\111\x4e\x20\154\151\x73\x74\166\x65\156\144\x20\141\163\x20\142\x20\x4f\x4e\x20\x61\56\x76\x65\156\144\145\144\157\162\75\142\56\143\157\144\x69\x67\157\40\x57\110\x45\122\105\x20\141\x2e\144\x6f\143\165\x6d\145\x6e\164\x6f\75\47{$a}\47\40\x4c\111\x4d\111\x54\40\61")->row(); $html = "\12\40\x20\x20\x20\74\164\x61\x62\154\145\x20\143\154\x61\x73\x73\75\42\167\63\x2d\x74\141\142\x6c\x65\x2d\141\x6c\x6c\40\x77\63\x2d\x68\x6f\166\145\162\141\142\154\145\40\167\x33\x2d\154\145\x66\164\55\x61\x6c\x69\147\x6e\40\x77\x33\55\x74\x69\x6e\x79\x22\x3e\x3c\x74\x72\x20\x63\x6c\141\x73\163\x3d\x22\167\63\55\x66\157\156\x64\x6f\x64\162\157\151\144\42\x3e\74\164\150\x3e\103\157\144\151\x67\x6f\x3c\x2f\x74\x68\76\x3c\x74\150\x3e\x4e\x6f\155\142\x72\x65\74\57\x74\150\x3e\x3c\x74\150\76\103\x61\156\x74\151\x64\141\144\74\x2f\164\x68\x3e\x3c\164\150\76\x44\x65\x76\x75\x65\x6c\x74\141\74\x2f\x74\x68\76\74\164\150\76\114\157\x74\145\74\x2f\164\150\x3e\x3c\164\x68\x3e\105\163\x74\141\x74\165\x73\x3c\57\164\150\x3e\x3c\57\x74\x72\76"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "\120\145\156\x64\151\145\x6e\164\x65"; $color = "\x77\x33\55\x72\145\144"; } elseif ($dtitfac->status == 1) { $status = "\x4c\x69\163\x74\157"; $color = "\x77\x33\55\147\x72\145\x65\x6e"; } $html .= "\74\x74\x72\x3e\x3c\x69\x6e\160\165\164\x20\x74\x79\x70\145\75\42\x68\151\144\144\x65\x6e\x22\40\151\x64\75\42\144\x6f\x63\42\40\166\141\x6c\x75\145\x3d\x22" . $a . "\x22\76\x3c\151\x6e\x70\x75\x74\40\164\x79\x70\145\x3d\42\x68\151\x64\144\145\x6e\42\x20\151\144\75\x22\x63\x6f\x64\155\x65\144" . $i . "\x22\x20\x76\141\154\165\x65\x3d\42" . $dtitfac->codigo . "\42\76\74\151\x6e\160\165\164\x20\x74\x79\160\x65\x3d\42\x68\x69\144\144\145\156\x22\x20\151\x64\75\42\x63\141\x6e\x74" . $i . "\x22\x20\x76\x61\154\x75\145\x3d\42" . $dtitfac->cantidad . "\x22\76\xa\40\40\40\40\x20\40\x20\40\74\164\144\76" . $dtitfac->codigo . "\74\x2f\x74\144\76\74\164\x64\76" . $dtitfac->nombre . "\x3c\57\164\x64\76\x3c\x74\144\76" . $dtitfac->cantidad . "\x3c\57\164\144\76\74\x74\x64\x3e" . $dtitfac->devuelta . "\74\57\x74\x64\76\x3c\x74\144\x3e" . $dtitfac->lote . "\x3c\57\164\x64\x3e\x3c\164\x64\x20\x63\x6c\x61\163\163\75\42" . $color . "\x20\x77\63\x2d\x63\145\x6e\164\145\162\x22\76" . $status . "\x3c\x2f\x74\x64\x3e\xa\x20\x20\x20\x20\x20\x20\x20\40\74\x2f\x74\x72\x3e"; } $html .= "\74\x2f\x74\141\x62\154\x65\x3e"; return $html; } function devndfac($doc) { $bd = $this->db->query("\x53\x45\x4c\x45\103\x54\40\x4e\x55\x4c\x4c\x20\x46\x52\117\115\40\x6f\x70\145\162\164\x69\x20\x57\x48\105\x52\105\x20\144\x6f\143\165\x6d\x65\x6e\x74\157\x3d\47{$doc}\x27\40\x26\46\40\x74\151\160\x6f\144\x6f\x63\x3d\x27\x4e\x2f\104\47\40\46\46\x20\50\x65\x73\x74\141\164\x75\163\144\157\143\x3d\47\61\47\40\174\x7c\40\145\x73\x74\141\x74\x75\163\x64\x6f\x63\x3d\x27\60\47\x29")->num_rows(); if ($bd > 0) { $i = 0; $num2 = $this->db->query("\123\105\x4c\105\x43\x54\x20\x49\106\50\x4d\101\130\x28\144\157\143\x75\155\x65\x6e\x74\x6f\x29\53\x31\76\x30\x2c\115\x41\x58\x28\x64\157\x63\165\x6d\x65\x6e\x74\x6f\51\53\x31\x2c\61\x29\x20\156\x20\x46\122\117\115\x20\x6f\160\x65\162\164\x69\x20\x57\x48\x45\122\x45\40\x74\151\160\157\144\x6f\143\x3d\47\116\x2f\x43\x27")->row(); $newdoc = str_pad($num2->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $this->db->query("\111\x4e\123\105\122\124\40\111\116\124\x4f\40\x6f\160\145\x72\164\x69\x20\123\x45\x4c\105\x43\x54\x20\x2a\x20\x46\122\117\x4d\40\x6f\160\145\x72\164\x69\x20\x57\x48\105\x52\x45\40\x64\x6f\143\165\x6d\x65\x6e\164\157\75\x27{$doc}\x27\x20\x26\46\40\x74\151\x70\x6f\x64\x6f\x63\75\x27\116\57\x44\x27"); $this->db->query("\x55\x50\x44\x41\124\x45\x20\157\x70\x65\162\x74\151\40\x73\145\164\40\x64\157\x63\165\155\x65\x6e\164\157\x3d\x27{$newdoc}\47\54\x74\151\x70\157\x64\157\x63\x3d\47\116\57\x43\x27\54\146\x65\143\150\141\143\162\x65\141\x3d\x63\165\x72\x64\141\164\145\50\x29\x2c\145\155\151\163\x69\x6f\x6e\x3d\x63\165\x72\144\x61\x74\x65\50\x29\x2c\x72\145\x63\x65\160\x63\151\x6f\156\75\x63\x75\x72\144\141\164\x65\50\x29\x2c\146\x65\x63\150\141\171\150\x6f\162\141\x3d\116\x4f\127\50\x29\54\162\x65\x66\145\162\145\156\143\x69\141\75\47\116\57\104{$doc}\x27\54\145\x73\164\x61\164\x75\163\x64\157\143\x3d\47\60\x27\xa\40\40\40\40\40\x20\x20\40\x57\x48\105\x52\105\x20\x64\x6f\143\x75\155\145\x6e\164\x6f\x3d\47{$doc}\47\40\x26\46\x20\x74\151\160\x6f\x64\x6f\143\x3d\47\x4e\57\104\47\40\x4c\111\115\111\124\40\61"); if ($this->db->affected_rows() > 0) { $bd = $this->db->query("\123\x45\114\x45\x43\x54\40\x2a\40\106\122\x4f\115\40\157\160\x65\x72\155\x76\x20\127\x48\x45\x52\105\x20\144\157\x63\165\155\x65\156\x74\x6f\x3d\47{$doc}\x27\x20\x26\46\x20\164\151\x70\157\144\x6f\x63\75\x27\x4e\57\104\x27")->result(); foreach ($bd as $dtped) { $datos = array("\151\x64\137\145\x6d\x70\x72\x65\163\x61" => "\x44\x4d\x45\104\111\x46", "\x61\x67\x65\156\x63\151\x61" => "\60\60\x31", "\164\151\x70\x6f\144\x6f\x63" => "\116\x2f\x43", "\144\x6f\143\165\x6d\x65\x6e\164\x6f" => $newdoc, "\147\x72\x75\160\157" => '' . $dtped->grupo . '', "\157\x72\151\147\x65\156" => "\x31", "\143\157\x64\x69\147\x6f" => '' . $dtped->codigo . '', "\160\151\x64" => '' . $pid . '', "\x6e\x6f\155\x62\162\x65" => "\x41\156\165\x6c\x61\x63\151\xc3\263\x6e\40\163\x65\x67\xc3\xba\156\x20\x6e\157\164\x61\40\x64\145\x20\144\303\251\142\151\x74\157\72\x20" . $doc . "\40\x64\145\40\106\x65\x63\150\x61\40" . $dtped->fechadoc . "\40\160\x6f\162\x20\x75\x6e\40\x4d\157\x6e\x74\x6f\x20" . $dtped->montototal . "\x20\x42\163\x53", "\143\157\163\x74\x6f\x75\x6e\151\164" => '' . $dtped->costounit . '', "\160\162\145\143\151\157\165\x6e\151\164" => $dtped->preciounit, "\144\163\143\164\157\x75\156\151\164" => '' . $dtped->dsctounit . '', "\144\163\x63\x74\157\160\x72\143" => '' . $dtped->dsctoprc . '', "\x64\163\143\164\x6f\145\156\x64\x70" => $dtped->dsctoendp, "\144\x73\x63\x74\x6f\x65\156\144\x6d" => $dtped->dsctoendm, "\160\162\145\143\151\157\x66\151\x6e" => '' . $dtped->preciofin . '', "\160\x72\x65\143\151\157\x6f\x72\151\x67\151\156\141\154" => '' . $dtped->preciooriginal . '', "\143\141\x6e\164\x69\x64\x61\144" => '' . $dtped->cantidad . '', "\155\x6f\x6e\x74\157\156\145\164\157" => '' . $dtped->montoneto . '', "\155\x6f\156\164\157\164\157\164\141\x6c" => '' . $dtped->montototal . '', "\164\x69\155\160\165\x65\160\162\x63" => '' . $dtped->timpueprc . '', "\141\154\155\x61\x63\145\156" => $dtped->almacen, "\160\162\157\166\145\x65\x64\157\162" => '' . $dtped->proveedor . '', "\x66\145\x63\x68\141\x64\157\143" => '' . date("\x59\x2d\155\55\x64") . '', "\x69\155\160\x75\x65\x73\164\157\61" => "\x30", "\x69\x6d\x70\165\x65\x73\164\x6f\x32" => "\60", "\x76\x65\x6e\x64\145\x64\x6f\162" => $dtped->vendedor, "\x65\x6d\x69\163\x6f\162" => "\x46\101\x43\124\125\x52\101\x44", "\165\163\x61\x73\x65\x72\151\x61\154" => "\x32", "\164\x69\160\x6f\160\162\145\143\x69\157" => "\61", "\x75\156\151\x64\141\144" => "\x55\x4e\x44", "\x61\x67\162\165\160\x61\144\157" => "\62", "\x63\157\155\160\x75\x65\163\164\157" => "\x32", "\165\163\141\x65\170\x69\x73\x74" => "\x31", "\x61\x75\x78\x31" => '' . $dtped->aux1 . '', "\145\163\164\x61\x63\151\x6f\x6e" => "\60\x30\x31", "\x75\x64\151\x6e\141\x6d\151\x63\141" => "\x31", "\142\141\163\x65\151\155\x70\157\x31" => '' . $dtped->baseimpo1 . '', "\142\141\x73\x65\151\155\x70\157\x32" => "\x30", "\x6c\x6f\x74\x65" => $dtped->lote, "\151\x64\166\x61\154\151\144\x61\143\151\x6f\x6e" => '', "\146\x65\x63\150\141\171\150\x6f\x72\141" => '' . date("\131\55\x6d\55\x64\40\110\72\x69\x3a\x73") . '', "\145\156\x76\151\141\144\157\137\153\x6d\157\x6e\151\x74\157\162" => "\60"); $this->db->insert("\x6f\x70\x65\x72\x6d\x76", $datos); } $this->db->query("\125\120\104\x41\124\105\40\157\160\x65\x72\x74\x69\40\x73\145\164\x20\x65\x73\x74\141\x74\x75\163\x64\157\143\75\47\130\47\40\x57\x48\105\x52\x45\x20\144\157\143\x75\x6d\x65\156\164\x6f\x3d\47{$doc}\47\40\46\x26\x20\x74\151\x70\157\x64\x6f\x63\x3d\x27\x4e\57\104\x27"); if ($this->db->affected_rows() > 0) { $i++; } $this->loguser("\104\145\166\157\154\x75\143\151\x6f\156", "\x45\154\x20\165\163\x75\141\162\151\x6f\40\141\40\x64\x65\x76\165\145\x6c\x74\x6f\x20\154\141\x20\x6e\x6f\x74\x61\40\144\x65\40\144\145\142\x69\164\157\40" . $doc . "\x2c\40\156\x6f\164\x61\40\x64\x65\x20\x63\162\x65\x64\x69\x74\157\40\160\157\162\40\x61\x6e\x75\154\x61\143\x69\157\156\40" . $newdoc . ''); } return $i; } } function devncfac($doc) { $bd = $this->db->query("\123\x45\114\x45\x43\124\x20\116\125\x4c\114\x20\106\x52\x4f\x4d\x20\157\x70\145\x72\164\151\x20\127\110\105\x52\105\40\x64\x6f\x63\165\x6d\145\x6e\164\157\x3d\47{$doc}\47\x20\46\46\x20\164\x69\160\x6f\144\157\x63\x3d\x27\x4e\x2f\103\x27\40\46\46\40\50\x65\163\164\141\x74\165\x73\144\157\143\75\x27\61\47\x20\x7c\x7c\x20\x65\x73\164\x61\x74\x75\163\144\157\x63\x3d\47\60\47\x29")->num_rows(); if ($bd > 0) { $i = 0; $num2 = $this->db->query("\123\105\x4c\x45\x43\x54\x20\x49\x46\x28\115\101\x58\x28\x64\x6f\x63\165\155\145\x6e\x74\157\51\53\61\76\60\x2c\115\x41\x58\x28\144\x6f\x63\x75\155\x65\x6e\164\157\51\53\x31\x2c\x31\x29\x20\156\x20\106\122\117\115\40\157\160\145\x72\164\x69\40\x57\110\x45\x52\105\40\x74\151\x70\157\144\x6f\x63\x3d\47\116\57\x44\47")->row(); $newdoc = str_pad($num2->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $this->db->query("\111\x4e\123\x45\122\x54\40\x49\116\124\117\40\157\x70\145\x72\x74\x69\40\x53\x45\114\105\103\124\40\x2a\x20\x46\122\x4f\x4d\x20\157\x70\x65\162\x74\x69\40\x57\110\x45\x52\x45\x20\144\x6f\x63\165\155\x65\156\164\x6f\x3d\x27{$doc}\x27\40\46\46\x20\164\151\x70\157\x64\157\143\x3d\47\116\x2f\x43\47"); $this->db->query("\x55\120\104\x41\x54\x45\40\x6f\x70\x65\x72\164\151\40\163\x65\x74\40\x64\x6f\x63\x75\x6d\145\156\164\157\75\47{$newdoc}\47\x2c\164\x69\x70\x6f\x64\157\143\x3d\x27\x4e\x2f\104\47\54\x66\145\x63\150\141\x63\162\145\141\75\x63\x75\x72\144\x61\164\145\50\x29\x2c\x65\155\x69\x73\x69\x6f\x6e\75\x63\165\162\x64\x61\x74\x65\50\x29\54\162\x65\143\145\160\143\x69\x6f\x6e\x3d\x63\x75\x72\x64\141\x74\x65\50\x29\54\x66\x65\x63\150\141\171\x68\157\x72\x61\x3d\x4e\x4f\x57\x28\x29\x2c\162\x65\146\x65\162\x65\x6e\x63\x69\x61\75\47\x4e\57\x43{$doc}\47\54\x65\x73\164\x61\164\165\163\x64\157\x63\75\x27\x30\x27\xa\40\40\x20\40\40\x20\40\x20\127\x48\105\122\x45\40\144\x6f\143\x75\x6d\145\156\x74\x6f\75\x27{$doc}\47\40\x26\46\40\x74\x69\x70\157\144\157\143\x3d\47\116\57\x43\47\x20\114\111\x4d\111\x54\40\61"); if ($this->db->affected_rows() > 0) { $bd = $this->db->query("\x53\x45\114\105\x43\124\x20\52\x20\106\122\117\115\40\x6f\160\x65\162\155\x76\40\127\110\105\122\105\40\144\x6f\143\x75\x6d\x65\156\x74\x6f\x3d\x27{$doc}\47\40\46\x26\40\164\151\160\157\144\x6f\143\x3d\x27\x4e\57\103\47")->result(); foreach ($bd as $dtped) { $datos = array("\151\144\137\x65\155\160\162\x65\x73\141" => "\x44\115\x45\104\111\106", "\141\147\145\x6e\x63\x69\141" => "\60\x30\x31", "\x74\151\160\157\144\x6f\x63" => "\116\57\104", "\x64\x6f\143\x75\x6d\x65\156\164\157" => $newdoc, "\147\x72\165\x70\x6f" => '' . $dtped->grupo . '', "\x6f\x72\151\147\x65\156" => "\x31", "\143\x6f\144\x69\x67\x6f" => '' . $dtped->codigo . '', "\x70\151\144" => '' . $pid . '', "\156\x6f\155\x62\162\145" => $dtped->nombre, "\x63\157\x73\164\x6f\165\156\x69\x74" => '' . $dtped->costounit . '', "\x70\x72\x65\143\151\157\x75\x6e\151\x74" => $dtped->preciounit, "\144\163\143\x74\157\x75\x6e\x69\164" => '' . $dtped->dsctounit . '', "\144\x73\143\164\157\x70\x72\143" => '' . $dtped->dsctoprc . '', "\144\x73\143\164\157\145\156\144\x70" => $dtped->dsctoendp, "\x64\x73\143\x74\157\x65\156\x64\155" => $dtped->dsctoendm, "\160\162\145\143\x69\x6f\x66\151\156" => '' . $dtped->preciofin . '', "\160\x72\x65\143\151\157\157\162\x69\147\151\156\141\154" => '' . $dtped->preciooriginal . '', "\143\x61\156\x74\151\144\141\144" => '' . $dtped->cantidad . '', "\155\x6f\x6e\164\157\x6e\145\x74\157" => '' . $dtped->montoneto . '', "\155\157\156\x74\157\x74\x6f\x74\141\x6c" => '' . $dtped->montototal . '', "\164\x69\155\x70\x75\x65\x70\x72\143" => '' . $dtped->timpueprc . '', "\x61\154\155\x61\x63\145\156" => $dtped->almacen, "\x70\162\x6f\x76\145\145\x64\x6f\162" => '' . $dtped->proveedor . '', "\146\x65\143\150\141\x64\157\143" => '' . date("\x59\x2d\x6d\55\144") . '', "\x69\155\160\x75\x65\163\164\157\61" => "\60", "\x69\x6d\x70\165\145\163\x74\157\x32" => "\x30", "\x76\x65\156\x64\145\x64\157\162" => $dtped->vendedor, "\x65\155\151\x73\x6f\x72" => "\x46\101\103\124\125\x52\101\x44", "\x75\163\x61\163\145\x72\x69\141\x6c" => "\x32", "\164\x69\x70\157\160\x72\145\143\x69\x6f" => "\x31", "\165\x6e\151\144\141\144" => "\x55\x4e\x44", "\141\147\162\165\160\141\144\x6f" => "\62", "\x63\x6f\155\x70\x75\x65\x73\x74\157" => "\62", "\165\163\141\145\170\x69\x73\x74" => "\x31", "\x61\x75\170\x31" => '' . $dtped->aux1 . '', "\x65\163\164\x61\143\151\157\x6e" => "\x30\x30\61", "\165\x64\x69\156\141\x6d\151\x63\141" => "\x31", "\x62\x61\163\145\151\x6d\160\x6f\61" => '' . $dtped->baseimpo1 . '', "\142\141\x73\145\x69\x6d\160\x6f\x32" => "\60", "\154\x6f\x74\x65" => $dtped->lote, "\x69\x64\x76\141\x6c\151\x64\x61\x63\151\157\x6e" => '', "\x66\x65\x63\150\x61\x79\x68\157\162\141" => '' . date("\131\x2d\x6d\x2d\x64\40\x48\x3a\151\x3a\163") . '', "\145\156\166\151\x61\x64\157\x5f\x6b\x6d\x6f\156\151\x74\157\162" => "\60"); $this->db->insert("\x6f\160\145\x72\155\166", $datos); } $this->db->query("\125\x50\x44\x41\x54\x45\x20\157\x70\145\x72\164\x69\40\163\145\x74\x20\x65\x73\x74\x61\164\165\x73\144\x6f\143\75\x27\130\47\x20\x57\x48\x45\x52\105\x20\x64\157\x63\x75\155\x65\156\164\157\75\47{$doc}\x27\40\46\x26\40\x74\151\x70\157\144\x6f\x63\75\47\116\57\103\47"); if ($this->db->affected_rows() > 0) { $this->db->query("\104\x45\x4c\105\124\105\40\106\x52\117\x4d\40\x61\x70\x6c\151\143\141\156\143\x20\x57\110\105\122\x45\40\156\143\75\47{$doc}\47"); } if ($this->db->affected_rows() > 0) { $i++; } $this->loguser("\104\x65\166\157\x6c\x75\143\151\x6f\x6e", "\x45\x6c\x20\165\163\165\x61\162\x69\x6f\x20\x61\40\144\x65\x76\165\x65\x6c\164\x6f\40\x6c\x61\40\x6e\157\164\x61\x20\x64\145\40\143\x72\145\x64\x69\164\x6f\40" . $doc . "\x2c\40\156\157\164\x61\x20\x64\145\x20\x64\x65\142\x69\x74\157\40\x70\157\x72\x20\x61\156\x75\x6c\x61\143\x69\157\x6e\x20" . $newdoc . ''); } return $i; } } function copyfac($doc, $tip, $cli, $orden) { $num1 = $this->db->query("\x53\x45\x4c\105\x43\124\x20\x49\x46\50\115\x41\130\x28\123\125\x42\x53\124\x52\50\144\157\x63\54\x32\x2c\x38\51\x29\x2b\61\x3e\x30\54\x4d\x41\130\50\x53\x55\x42\x53\124\122\50\144\x6f\x63\x2c\62\54\x38\51\51\53\x31\54\x31\51\x20\156\x20\106\x52\117\x4d\x20\143\157\156\164\162\157\x6c\137\x6f\x70\145\x72\164\151\40\x57\110\105\x52\105\x20\x64\x6f\x63\x20\154\x69\x6b\145\x20\x27\x25\x43\x25\47")->row(); $controldoc = str_pad($num1->n, 7, "\60", STR_PAD_LEFT); $control = array("\x64\157\x63" => "\103" . $controldoc, "\163\164\141\x74\165\x73" => "\62"); $this->db->insert("\x63\157\156\x74\162\157\154\x5f\157\160\x65\162\164\x69", $control); $num2 = $this->db->query("\123\105\x4c\x45\103\x54\x20\111\106\50\115\x41\130\50\144\157\143\x75\x6d\x65\156\x74\157\x29\53\x31\76\x30\x2c\x4d\x41\x58\50\144\157\143\165\x6d\x65\156\164\157\51\x2b\x31\x2c\61\51\x20\156\x20\106\x52\x4f\x4d\40\x6f\160\x65\162\x74\151\x20\x57\x48\105\x52\105\x20\x74\x69\x70\157\144\157\x63\x3d\x27\106\101\x43\47")->row(); $newdoc = str_pad($num2->n, 8, "\60", STR_PAD_LEFT); $cli2 = $this->db->query("\123\105\114\x45\103\x54\40\x6e\x6f\x6d\x62\162\x65\54\144\x69\x72\145\x63\143\x69\x6f\x6e\x2c\156\162\157\162\151\x66\40\106\x52\x4f\115\40\x63\154\151\x65\x6d\160\x72\145\40\x57\110\105\x52\105\x20\x63\157\x64\x69\147\157\x3d\x27{$cli}\47")->row(); $pid = $this->genecod(12); $this->db->query("\111\116\x53\x45\x52\x54\x20\111\x4e\124\x4f\x20\157\160\x65\x72\164\x69\x20\x53\105\114\105\103\124\x20\52\40\106\122\x4f\x4d\40\x6f\x70\145\x72\x74\x69\x20\127\x48\x45\122\105\40\144\157\143\x75\155\x65\156\164\x6f\75\x27{$doc}\x27\x20\46\46\40\164\151\160\157\144\x6f\x63\x3d\x27{$tip}\47"); $this->db->query("\125\x50\104\101\x54\105\x20\x6f\160\145\x72\x74\151\x20\163\145\164\40\144\157\x63\x75\x6d\x65\x6e\164\x6f\x3d\x27{$newdoc}\x27\x2c\143\157\144\143\x6c\x69\x65\156\164\x65\75\x27{$cli}\x27\x2c\157\x72\x64\x65\x6e\75\x27{$orden}\x27\x2c\x6e\x6f\155\x62\162\145\143\154\151\x3d\47{$cli2->nombre}\x27\x2c\x64\x69\162\x65\x63\x63\x69\x6f\x6e\75\x27{$cli2->direccion}\x27\54\x72\x69\146\75\47{$cli2->nrorif}\47\x2c\x66\145\x63\x68\141\143\162\x65\x61\x3d\x63\165\x72\144\x61\164\145\50\51\54\145\155\x69\x73\x69\x6f\x6e\75\143\165\x72\144\141\164\x65\x28\x29\54\x72\x65\143\x65\x70\143\151\157\x6e\x3d\143\x75\x72\x64\141\x74\145\x28\51\40\12\x20\40\40\x20\x57\x48\x45\x52\105\x20\x64\157\x63\165\x6d\145\156\164\157\75\x27{$doc}\x27\40\x26\46\40\x74\x69\x70\157\144\157\143\75\47{$tip}\x27\40\x4c\111\x4d\111\x54\40\61"); $bd = $this->db->query("\123\105\x4c\x45\x43\124\40\x2a\x20\x46\x52\x4f\115\40\x6f\160\145\162\x6d\166\x20\127\x48\x45\122\105\40\x64\157\x63\165\x6d\145\x6e\x74\157\x3d\x27{$doc}\47\40\x26\46\x20\164\151\160\157\144\157\143\x3d\47{$tip}\x27")->result(); foreach ($bd as $dtped) { $datos = array("\151\144\x5f\x65\x6d\x70\162\145\163\x61" => "\x44\x4d\105\104\x49\x46", "\x61\x67\x65\156\143\x69\141" => "\60\60\61", "\x74\151\160\x6f\x64\157\x63" => "\106\101\103", "\x64\x6f\x63\165\155\145\156\164\157" => $newdoc, "\147\162\165\x70\157" => '' . $dtped->grupo . '', "\157\162\151\147\x65\156" => "\x31", "\x63\157\x64\151\x67\x6f" => '' . $dtped->codigo . '', "\x70\151\x64" => '' . $pid . '', "\x6e\157\155\x62\162\x65" => '' . $dtped->nombre . '', "\143\157\x73\x74\x6f\165\156\151\x74" => '' . $dtped->costounit . '', "\160\x72\x65\143\151\157\165\x6e\151\x74" => $dtped->preciounit, "\x64\163\143\164\157\x75\x6e\x69\x74" => '' . $dtped->dsctounit . '', "\x64\x73\143\164\x6f\160\162\143" => '' . $dtped->dsctoprc . '', "\144\x73\x63\164\x6f\x65\x6e\x64\x70" => $dtped->dsctoendp, "\x64\163\143\x74\157\x65\x6e\144\155" => $dtped->dsctoendm, "\x70\162\145\143\151\x6f\146\x69\156" => '' . $dtped->preciofin . '', "\x70\x72\x65\x63\151\x6f\x6f\162\x69\x67\x69\x6e\141\x6c" => '' . $dtped->preciooriginal . '', "\143\x61\156\164\x69\144\x61\x64" => '' . $dtped->cantidad . '', "\x6d\x6f\156\x74\157\x6e\x65\164\x6f" => '' . $dtped->montoneto . '', "\155\157\x6e\164\157\x74\157\x74\141\154" => '' . $dtped->montototal . '', "\x74\x69\155\x70\x75\x65\x70\162\x63" => '' . $dtped->timpueprc . '', "\x61\154\155\141\x63\x65\x6e" => $dtped->almacen, "\x70\162\x6f\x76\145\145\x64\157\162" => '' . $dtped->proveedor . '', "\x66\x65\x63\x68\141\x64\157\x63" => '' . date("\x59\55\x6d\55\x64") . '', "\x69\x6d\x70\165\x65\x73\164\157\61" => "\60", "\x69\155\x70\x75\x65\x73\164\x6f\62" => "\x30", "\166\x65\x6e\144\145\144\157\162" => $dtped->vendedor, "\x65\x6d\x69\163\x6f\162" => "\x46\101\x43\124\x55\x52\101\104", "\x75\163\141\x73\145\162\151\x61\154" => "\x32", "\164\x69\x70\157\160\x72\145\x63\151\x6f" => "\61", "\x75\156\151\x64\141\144" => "\125\x4e\104", "\x61\147\x72\165\160\141\x64\x6f" => "\62", "\x63\x6f\155\x70\x75\x65\163\164\x6f" => "\62", "\x75\x73\141\145\x78\x69\x73\x74" => "\61", "\x61\x75\170\x31" => '' . $dtped->aux1 . '', "\x65\x73\164\x61\143\151\157\x6e" => "\x30\60\x31", "\x75\144\151\156\141\155\x69\143\x61" => "\61", "\x62\x61\x73\145\x69\x6d\x70\x6f\61" => '' . $dtped->baseimpo1 . '', "\x62\141\163\x65\x69\155\x70\x6f\62" => "\x30", "\x6c\x6f\x74\145" => $dtped->lote, "\151\x64\166\141\154\x69\x64\x61\143\151\x6f\x6e" => '', "\x66\x65\x63\150\141\x79\150\157\162\x61" => '' . date("\131\x2d\x6d\55\144\x20\x48\72\151\72\x73") . '', "\x65\156\x76\x69\x61\144\x6f\x5f\153\x6d\157\x6e\x69\x74\157\x72" => "\60"); $this->db->insert("\x6f\x70\x65\162\155\166", $datos); } $this->db->query("\x55\x50\x44\x41\124\x45\40\x61\x72\164\151\154\x6f\x74\x65\x73\x20\x61\x20\112\117\111\x4e\x20\x6f\x70\145\x72\155\166\x20\142\40\x4f\x4e\x20\x28\x61\x2e\141\x6c\155\x61\x63\x65\x6e\x3d\142\x2e\x61\x6c\155\141\143\145\x6e\40\x26\x26\40\141\56\x63\x6f\x64\151\147\x6f\x61\x72\164\x3d\x62\56\143\x6f\144\151\147\157\x20\x26\x26\x20\x61\56\x6c\157\x74\x65\75\x62\x2e\154\157\x74\x65\x29\xa\40\x20\40\40\123\x45\x54\x20\141\56\x63\157\156\163\x75\155\x69\144\157\x3d\x61\x2e\x63\157\x6e\163\x75\x6d\x69\x64\157\x2b\x62\56\x63\141\156\164\x69\x64\141\144\40\127\x48\x45\x52\105\x20\142\56\144\157\x63\165\x6d\x65\156\164\157\75\47{$newdoc}\x27"); $this->loguser("\x43\157\160\x79\40\x46\x41\103", "\105\154\x20\165\x73\x75\x61\162\x69\x6f\40\141\x20\143\x6f\160\x69\141\x64\157\x20\154\x61\x20\x66\x61\x63\164\x75\x72\x61\40" . $doc . "\40\160\141\x72\x61\40" . $newdoc . ''); return $this->db->affected_rows(); } function editfac($doc, $tip, $vend, $diasc, $dias, $orden) { $this->db->query("\125\120\x44\x41\124\105\x20\157\160\x65\x72\x74\x69\x20\x73\145\x74\40\166\145\156\144\x65\x64\157\162\75\x27{$vend}\x27\x2c\x64\151\141\163\143\x72\x65\x64\75\x27{$diasc}\x27\x2c\x64\x69\x61\163\x69\x6e\x64\x65\170\75\x27{$dias}\47\54\157\x72\x64\145\156\75\47{$orden}\47\x20\x57\110\105\x52\x45\40\x64\x6f\x63\x75\x6d\x65\x6e\x74\x6f\x3d\x27{$doc}\x27\x20\46\46\x20\x74\x69\160\x6f\x64\x6f\143\75\47{$tip}\47"); $this->loguser("\x4d\157\144\x69\146\x69\x63\141\x72", "\105\154\40\165\163\165\141\162\x69\x6f\x20\155\157\144\x69\146\x69\x63\141\40\x6c\141\40\106\141\x63\x74\x75\162\141\40" . $doc . "\x2c\40\126\145\156\x64\145\x64\x6f\162\72\40" . $vend . "\x2c\x20\x44\151\x61\x20\151\156\144\x65\x78\x3a\x20" . $dias . "\x2c\40\x4e\56\x43\x6f\156\x74\x72\157\x6c\x3a\x20" . $orden . "\56"); return $this->db->affected_rows(); } function genencfac($doc, $tip, $por, $obser) { $val = $this->db->query("\123\x45\114\x45\x43\124\40\x4e\125\114\114\x20\106\122\117\115\x20\x6f\160\x65\x72\x74\151\x20\142\40\127\110\105\122\x45\x20\x62\x2e\162\145\146\145\x72\145\156\143\151\x61\x3d\47" . $tip . $doc . "\47\x20\46\46\x20\x62\56\x74\151\x70\x6f\x64\x6f\x63\75\x27\x4e\x2f\103\47\40\46\x26\x20\50\x62\x2e\x61\x70\x6c\x69\143\x61\x6e\143\x3d\47\47\x20\174\x7c\x20\142\56\x61\160\x6c\151\143\141\x6e\143\x20\x49\x53\40\116\125\114\114\51")->num_rows(); if ($val == 0) { $bd = $this->db->query("\x53\105\114\105\103\x54\x20\x61\56\x76\x65\x6e\x64\x65\x64\x6f\162\x2c\x61\x2e\x72\151\146\54\141\x2e\x63\x6f\144\x63\x6c\x69\145\156\164\x65\x2c\141\x2e\x6e\157\155\142\162\x65\143\x6c\151\x2c\40\141\x2e\x64\x69\162\x65\143\x63\x69\157\156\54\x61\x2e\x61\x6e\164\x64\x6f\x63\x2c\141\56\164\145\x6c\x65\x66\x6f\156\x6f\x73\54\x61\56\x64\151\141\x73\x63\162\x65\144\x2c\x61\x2e\x74\x6f\164\144\145\163\143\x75\145\156\x2c\141\56\x66\145\x63\x68\x61\143\162\x65\x61\x2c\141\x2e\x73\145\x63\x74\x6f\x72\x2c\141\x2e\164\x6f\164\156\x65\x74\157\x2c\141\x2e\162\151\146\54\12\x20\40\x20\x20\50\x53\105\114\105\103\x54\x20\157\x66\x69\x63\151\x61\154\40\x46\x52\117\x4d\x20\x6d\157\x6e\x65\x63\x61\155\x20\127\110\105\122\105\x20\146\145\x63\150\x61\74\75\x61\56\x66\x65\143\x68\141\143\x72\145\141\40\x4f\x52\104\105\x52\x20\x42\x59\40\106\x45\x43\110\x41\40\x44\x45\x53\x43\40\x4c\x49\115\x49\x54\x20\61\x29\x20\164\141\163\141\xa\x20\40\40\40\x46\122\x4f\x4d\40\157\160\x65\x72\164\x69\x20\x61\40\127\x48\105\x52\105\x20\141\x2e\144\x6f\x63\x75\x6d\x65\x6e\164\157\75\x27{$doc}\47\40\x26\x26\40\141\x2e\x74\151\x70\x6f\x64\x6f\143\75\47{$tip}\x27")->row(); $newdoc = $this->db->query("\123\x45\114\x45\103\124\x20\111\x46\x28\115\101\130\50\144\x6f\x63\x75\x6d\x65\156\164\157\51\53\61\76\x30\54\115\101\130\50\x64\x6f\143\x75\x6d\145\x6e\x74\x6f\x29\53\61\54\x31\51\40\x6e\40\x46\122\x4f\x4d\40\157\160\145\x72\164\151\40\x57\x48\105\x52\105\40\164\x69\x70\x6f\144\x6f\x63\x3d\x27\116\x2f\103\x27")->row(); $newdoc = str_pad($newdoc->n, 8, "\60", STR_PAD_LEFT); $pid = $this->genecod(12); $user = $this->session->userdata("\x63\x6f\x64"); $totneto = $bd->totneto * ($por / 100); $totald = $totneto / $bd->tasa; $opermv = array("\151\144\x5f\145\x6d\160\x72\x65\x73\x61" => "\104\115\x45\104\111\106", "\141\x67\x65\x6e\143\151\x61" => "\x30\x30\x31", "\164\151\x70\x6f\144\x6f\x63" => "\x4e\x2f\103", "\144\x6f\x63\165\x6d\x65\x6e\164\x6f" => $newdoc, "\147\162\x75\x70\x6f" => "\116\x2f\101", "\x6f\x72\x69\x67\145\x6e" => "\x31", "\x63\157\x64\x69\x67\157" => "\116\57\101", "\160\151\x64" => '' . $pid . '', "\x6e\x6f\155\142\162\145" => $obser, "\143\157\x73\x74\157\165\156\151\164" => 0, "\x70\162\x65\143\x69\x6f\x75\x6e\x69\x74" => 0, "\144\163\143\x74\x6f\165\x6e\151\164" => 0, "\x64\163\143\164\157\x70\162\143" => 0, "\160\x72\145\x63\x69\x6f\x66\151\x6e" => 0, "\160\162\x65\143\x69\x6f\157\x72\x69\147\151\x6e\x61\154" => 0, "\x63\x61\x6e\x74\x69\x64\141\144" => 0, "\143\156\164\x64\x65\x76\165\x65\154\164" => 0, "\155\157\156\x74\x6f\156\145\164\x6f" => $totneto, "\155\157\156\x74\x6f\x74\x6f\x74\141\154" => $totneto, "\164\x69\x6d\160\165\x65\x70\x72\143" => 0, "\141\x6c\155\141\143\145\156" => "\116\57\101", "\160\162\x6f\166\x65\145\144\x6f\x72" => $bd->proveedor, "\x66\x65\x63\150\141\144\x6f\x63" => '' . date("\131\55\155\x2d\144") . '', "\151\155\160\x75\145\x73\164\x6f\x31" => "\x30", "\x69\x6d\160\165\145\x73\164\x6f\x32" => "\60", "\166\145\x6e\144\x65\144\157\x72" => '' . $bd->vendedor . '', "\x65\155\x69\163\x6f\162" => $user, "\x75\163\141\163\x65\162\x69\x61\x6c" => "\x32", "\164\x69\160\x6f\160\162\x65\143\x69\x6f" => "\61", "\165\156\x69\x64\x61\x64" => "\125\116\x44", "\141\147\x72\x75\160\x61\x64\x6f" => "\x32", "\x63\157\x6d\x70\x75\x65\x73\x74\x6f" => "\x32", "\165\x73\x61\145\x78\x69\x73\x74" => "\x31", "\x61\165\x78\61" => "\x31", "\145\x73\x74\141\x63\151\157\156" => "\x30\x30\x31", "\x75\x64\151\x6e\x61\x6d\151\143\x61" => "\61", "\142\x61\x73\x65\x69\155\160\157\61" => 0, "\x62\x61\163\145\x69\x6d\160\157\x32" => "\x30", "\154\157\164\145" => "\116\x2f\x41", "\151\x64\x76\141\x6c\151\x64\141\x63\151\x6f\156" => '', "\146\145\143\150\141\171\150\x6f\162\x61" => '' . date("\131\x2d\155\x2d\x64\40\x48\72\x69\x3a\163") . '', "\x65\156\x76\x69\141\144\x6f\x5f\x6b\x6d\157\156\151\x74\157\x72" => "\60", "\x73\164\141\164\165\x73" => 1); $this->db->insert("\157\160\x65\162\x6d\x76", $opermv); $operti = array("\x69\144\x5f\145\x6d\160\162\x65\163\x61" => "\x44\x4d\105\x44\x49\x46", "\141\x67\145\x6e\143\x69\x61" => "\x30\60\61", "\164\x69\160\x6f\x64\157\x63" => "\116\57\103", "\155\157\156\145\x64\x61" => "\x30\60\60", "\144\x6f\x63\165\x6d\x65\156\164\157" => $newdoc, "\x63\x6f\x64\x63\x6c\151\145\156\x74\x65" => $bd->codcliente, "\156\x6f\x6d\142\162\145\x63\154\151" => $bd->nombrecli, "\143\x6f\x6e\164\x61\x63\x74\x6f" => "\x4e\57\x41", "\x72\x69\146" => $bd->rif, "\144\151\x72\145\x63\143\151\157\156" => $bd->direccion, "\x74\x65\154\x65\146\157\156\157\x73" => $bd->telefonos, "\164\151\160\x6f\x70\x72\145\x63\x69\157" => "\61", "\x65\155\151\163\151\x6f\156" => '' . date("\x59\x2d\x6d\x2d\144") . '', "\x72\x65\143\145\160\143\151\x6f\156" => date("\x59\x2d\x6d\55\x64"), "\166\x65\x6e\x63\x65" => date("\131\x2d\155\x2d\x64"), "\x66\x65\x63\x68\141\x63\x72\145\x61" => date("\x59\x2d\x6d\x2d\144"), "\164\157\x74\143\157\163\164\157" => 0, "\164\x6f\164\142\x72\165\164\x6f" => $totneto, "\x74\x6f\164\156\145\x74\157" => $totneto, "\x74\157\x74\x61\154\x66\x69\156\141\154" => '' . $totneto . '', "\164\157\x74\x69\x6d\x70\165\145\163\164" => 0, "\164\157\164\x64\145\x73\143\x75\x65\x6e" => 0, "\x69\155\160\x75\x65\x73\164\157\x31" => "\x30", "\x69\155\x70\165\145\163\x74\157\x32" => "\x30", "\144\163\143\x74\157\x6c\x69\156\x65\x61" => 0, "\144\151\141\163\143\x72\145\144" => $bd->diascred, "\x76\145\x6e\144\145\x64\x6f\162" => '' . $bd->vendedor . '', "\x66\141\143\164\x6f\162\143\141\x6d\142" => "\61", "\x75\x65\x6d\x69\163\x6f\162" => '' . $user . '', "\x65\x73\x74\141\x63\x69\x6f\x6e" => "\x30\x30\x31", "\x73\151\156\151\x6d\x70\x75\x65\x73\x74" => $totneto, "\x61\154\155\141\x63\x65\156" => "\116\x2f\101", "\x73\x65\143\164\157\x72" => '' . $bd->sector . '', "\163\x75\x62\143\x6f\x64\151\147\x6f" => '' . $bd->subcodigo . '', "\146\x6f\162\155\141\x66\151\x73" => "\61", "\x61\x6c\x5f\154\151\142\x72\157" => "\61", "\x64\142\x63\x72" => "\61", "\x68\x6f\x72\141\144\x6f\x63\x75\x6d" => '' . date("\x48\x3a\x69\72\163") . '', "\141\x6d\160\155" => "\x32", "\145\x73\x63\162\x65\x64\x69\x74\157" => "\x31", "\x62\141\163\x65\151\x6d\x70\157\x31" => 0, "\146\145\143\150\141\171\150\x6f\162\141" => '' . date("\x59\55\x6d\x2d\144\40\x48\x3a\151\x3a\163") . '', "\x69\x64\166\141\x6c\x69\144\141\143\151\x6f\x6e" => '', "\x64\157\x63\x75\155\x65\156\164\157\146\x69\x73\x63\x61\154" => "\60\40\122\x65\143\151\x62\151\144\x61", "\143\157\x6d\x61\x6e\x64\141\x5f\x6d\157\x76\151\154" => "\x30", "\143\157\x6d\141\156\x64\x61\137\153\155\157\156\151\164\x6f\x72" => "\60", "\x6e\157\164\151\155\x62\x72\x61\x72" => "\x31", "\x61\156\x74\x69\160\157" => "\106\101\x43", "\141\x6e\164\x64\157\143" => $bd->antdoc, "\x72\145\146\145\x72\145\x6e\x63\151\x61" => $tip . $doc, "\164\157\164\141\x6c\144" => $totald); $this->db->insert("\x6f\x70\x65\x72\164\x69", $operti); $fac[0] = $doc; $this->regncfac($fac, $newdoc, $bd->codcliente); $this->loguser("\107\x65\x6e\x65\162\x61\x20\116\57\103", "\x45\x6c\x20\165\163\165\x61\162\151\x6f\x20\141\40\147\145\156\145\162\141\x64\157\x20\x6c\141\x20\156\157\164\141\x20\x64\145\x20\x63\x72\x65\144\151\164\x6f\x20\x70\157\x72\x20\155\157\x74\151\166\157\x20\144\x65\40" . $obser . "\40\160\x61\162\141\x20\145\154\x20\144\x6f\x63\x75\x6d\145\x6e\164\157\40" . $doc . ''); return $this->db->affected_rows(); } } function genencfacmonto($doc, $tip, $por, $obser) { $val = $this->db->query("\123\x45\x4c\105\x43\124\x20\116\125\x4c\x4c\x20\106\122\117\115\x20\157\x70\145\162\x74\x69\x20\142\x20\x57\110\x45\x52\105\x20\142\x2e\162\145\x66\x65\162\145\x6e\143\151\x61\75\47" . $tip . $doc . "\x27\40\46\46\x20\x62\x2e\x74\x69\160\157\144\157\x63\75\47\116\x2f\x43\x27\40\46\x26\40\50\142\56\141\x70\154\151\x63\x61\156\x63\x3d\x27\x27\x20\174\174\40\142\x2e\x61\x70\x6c\151\x63\x61\x6e\x63\x20\111\x53\40\116\x55\x4c\x4c\51")->num_rows(); if ($val == 0) { $bd = $this->db->query("\123\105\114\105\103\124\x20\141\x2e\x76\145\156\144\x65\x64\157\x72\x2c\x61\56\x66\145\143\150\141\143\162\x65\x61\x2c\141\x2e\162\x69\x66\54\x61\56\x63\x6f\144\x63\154\x69\x65\156\x74\145\54\x61\56\156\x6f\x6d\142\x72\145\143\x6c\151\x2c\x20\x61\x2e\x64\151\x72\x65\x63\143\151\157\x6e\54\x61\56\141\156\x74\x64\x6f\143\54\141\x2e\164\145\x6c\145\146\157\156\157\163\x2c\x61\56\x64\x69\141\163\x63\162\x65\144\x2c\141\x2e\164\x6f\x74\x64\145\x73\143\x75\145\156\54\141\56\146\x65\143\150\141\x63\162\x65\x61\x2c\141\56\x73\x65\143\x74\157\x72\54\141\56\x74\157\x74\156\145\x74\x6f\x2c\141\x2e\162\x69\146\x2c\xa\40\40\x20\40\50\123\105\x4c\x45\103\x54\x20\157\146\151\143\x69\x61\154\40\106\x52\117\x4d\40\155\x6f\x6e\x65\x63\141\155\40\x57\110\x45\x52\x45\x20\x66\145\x63\x68\141\74\x3d\x61\x2e\x66\x65\143\150\141\x63\x72\145\x61\x20\117\x52\104\105\x52\x20\102\x59\x20\x46\105\x43\110\x41\40\x44\105\123\103\40\114\111\x4d\x49\124\x20\61\51\40\164\141\163\141\xa\x20\40\x20\x20\x46\122\117\x4d\x20\x6f\x70\145\x72\164\151\x20\x61\40\127\x48\105\x52\105\40\x61\56\x64\x6f\143\x75\x6d\145\156\164\157\x3d\x27{$doc}\x27\40\46\x26\x20\141\x2e\164\x69\x70\x6f\144\x6f\x63\x3d\47{$tip}\x27")->row(); $newdoc = $this->db->query("\x53\105\x4c\x45\103\124\40\111\106\x28\115\101\x58\x28\x64\x6f\x63\x75\x6d\x65\x6e\164\157\51\53\61\x3e\x30\x2c\115\x41\x58\50\x64\x6f\x63\165\155\145\x6e\164\157\x29\53\x31\x2c\61\x29\x20\x6e\x20\x46\122\x4f\x4d\x20\x6f\x70\x65\162\x74\x69\40\127\x48\105\122\105\40\x74\151\x70\157\144\x6f\x63\x3d\47\116\57\x43\x27")->row(); $newdoc = str_pad($newdoc->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $user = $this->session->userdata("\143\157\x64"); $totneto = $por; $totald = $totneto / $bd->tasa; $opermv = array("\x69\144\x5f\145\155\x70\x72\145\163\x61" => "\x44\x4d\105\x44\111\106", "\141\147\145\156\143\x69\141" => "\x30\60\x31", "\x74\x69\160\157\144\157\143" => "\116\x2f\103", "\144\x6f\143\165\x6d\x65\156\164\157" => $newdoc, "\x67\162\x75\x70\157" => "\116\57\x41", "\x6f\162\x69\147\x65\156" => "\x31", "\143\157\x64\x69\147\x6f" => "\116\x2f\101", "\160\x69\x64" => '' . $pid . '', "\156\x6f\155\142\x72\x65" => $obser, "\x63\x6f\163\x74\x6f\165\x6e\x69\164" => 0, "\160\x72\x65\x63\151\x6f\x75\156\x69\164" => 0, "\144\163\x63\164\157\x75\x6e\x69\164" => 0, "\x64\163\x63\164\x6f\160\x72\143" => 0, "\x70\162\145\143\151\x6f\146\151\x6e" => 0, "\160\x72\x65\x63\151\x6f\x6f\162\x69\x67\x69\156\x61\154" => 0, "\143\x61\156\164\x69\x64\x61\x64" => 0, "\x63\x6e\164\x64\x65\166\x75\x65\x6c\x74" => 0, "\x6d\x6f\x6e\164\157\156\145\x74\x6f" => $totneto, "\x6d\x6f\156\x74\157\x74\157\164\x61\x6c" => $totneto, "\x74\x69\155\160\165\x65\160\162\x63" => 0, "\141\154\155\x61\x63\145\x6e" => "\x4e\x2f\101", "\x70\x72\157\166\x65\x65\144\157\x72" => $bd->proveedor, "\x66\x65\x63\x68\141\144\157\143" => '' . date("\131\x2d\x6d\55\144") . '', "\x69\155\x70\x75\145\x73\164\x6f\x31" => "\60", "\151\155\x70\165\x65\x73\x74\157\x32" => "\60", "\x76\145\156\144\x65\x64\x6f\162" => '' . $bd->vendedor . '', "\x65\155\x69\163\x6f\x72" => $user, "\165\163\x61\x73\145\x72\x69\141\x6c" => "\62", "\164\151\x70\157\x70\x72\145\143\x69\157" => "\61", "\x75\156\151\x64\141\144" => "\125\116\x44", "\141\147\x72\165\160\x61\x64\x6f" => "\62", "\143\x6f\155\160\165\145\x73\164\157" => "\x32", "\165\163\141\x65\170\151\163\x74" => "\x31", "\141\165\x78\x31" => "\61", "\145\163\164\141\x63\x69\157\x6e" => "\x30\x30\x31", "\x75\x64\x69\x6e\x61\155\151\143\141" => "\61", "\142\x61\x73\x65\151\155\x70\157\x31" => 0, "\142\141\x73\x65\x69\x6d\x70\x6f\62" => "\60", "\x6c\x6f\164\x65" => "\x4e\x2f\101", "\x69\x64\166\141\x6c\x69\x64\x61\x63\x69\157\156" => '', "\x66\x65\x63\x68\141\x79\x68\x6f\162\x61" => '' . date("\x59\55\x6d\55\x64\x20\110\x3a\x69\x3a\x73") . '', "\x65\156\166\151\x61\144\x6f\137\153\x6d\157\x6e\x69\164\157\162" => "\x30", "\163\164\x61\164\165\163" => 1); $this->db->insert("\157\160\145\x72\155\166", $opermv); $operti = array("\151\x64\137\145\x6d\x70\162\x65\x73\141" => "\104\115\x45\x44\x49\106", "\141\147\x65\156\143\x69\141" => "\60\60\61", "\164\x69\x70\157\x64\x6f\143" => "\x4e\57\103", "\155\x6f\x6e\145\x64\141" => "\60\x30\60", "\x64\157\x63\165\x6d\145\156\x74\157" => $newdoc, "\143\157\144\x63\154\151\x65\156\164\x65" => $bd->codcliente, "\x6e\x6f\155\x62\162\145\143\x6c\151" => $bd->nombrecli, "\x63\157\x6e\164\141\143\164\x6f" => "\x4e\57\101", "\162\151\x66" => $bd->rif, "\144\x69\162\x65\x63\x63\x69\157\156" => $bd->direccion, "\164\145\154\145\146\157\156\x6f\x73" => $bd->telefonos, "\x74\151\x70\x6f\x70\x72\145\143\151\x6f" => "\x31", "\145\x6d\151\163\151\x6f\156" => '' . date("\131\x2d\x6d\55\144") . '', "\162\x65\143\x65\160\x63\x69\x6f\156" => date("\x59\x2d\x6d\55\x64"), "\x76\x65\156\143\145" => date("\x59\x2d\155\55\x64"), "\x66\x65\x63\150\x61\143\x72\145\141" => date("\x59\x2d\155\x2d\144"), "\164\x6f\x74\x63\x6f\x73\x74\157" => 0, "\164\x6f\164\x62\162\165\164\x6f" => $totneto, "\x74\157\x74\x6e\145\164\157" => $totneto, "\x74\x6f\164\141\x6c\x66\x69\x6e\141\x6c" => '' . $totneto . '', "\x74\157\x74\151\x6d\160\x75\x65\163\164" => 0, "\164\157\x74\x64\145\x73\x63\x75\145\156" => 0, "\151\155\x70\x75\x65\x73\164\157\x31" => "\x30", "\x69\155\x70\165\145\x73\x74\x6f\62" => "\x30", "\x64\163\x63\164\x6f\154\x69\x6e\x65\141" => 0, "\144\x69\141\163\143\x72\145\x64" => $bd->diascred, "\166\x65\156\x64\x65\144\157\x72" => '' . $bd->vendedor . '', "\x66\x61\x63\164\157\162\143\x61\x6d\x62" => "\x31", "\165\x65\155\151\x73\157\162" => '' . $user . '', "\x65\x73\164\141\143\151\157\x6e" => "\60\x30\61", "\163\x69\156\x69\x6d\160\165\x65\163\164" => $totneto, "\x61\x6c\x6d\141\143\145\x6e" => "\x4e\57\x41", "\x73\x65\143\164\x6f\x72" => '' . $bd->sector . '', "\x73\x75\142\143\x6f\144\151\x67\157" => '' . $bd->subcodigo . '', "\x66\157\x72\x6d\x61\146\x69\x73" => "\x31", "\141\154\137\x6c\x69\x62\162\x6f" => "\61", "\x64\142\143\x72" => "\x31", "\150\x6f\162\141\144\157\x63\x75\x6d" => '' . date("\110\72\151\x3a\x73") . '', "\x61\x6d\x70\155" => "\x32", "\x65\163\x63\x72\145\144\x69\164\x6f" => "\x31", "\x62\141\163\145\x69\x6d\160\x6f\x31" => 0, "\146\x65\x63\150\141\171\x68\x6f\x72\141" => '' . date("\131\55\x6d\55\x64\40\110\x3a\x69\72\x73") . '', "\151\144\166\x61\154\151\x64\141\x63\x69\157\156" => '', "\144\157\x63\x75\x6d\145\156\x74\x6f\x66\151\163\143\x61\154" => "\60\40\x52\x65\143\151\142\x69\144\141", "\143\157\155\141\x6e\144\x61\x5f\x6d\157\x76\x69\x6c" => "\x30", "\143\x6f\x6d\x61\156\144\141\137\x6b\x6d\157\156\x69\x74\157\x72" => "\60", "\156\x6f\164\151\155\x62\162\141\162" => "\x31", "\141\x6e\x74\151\160\157" => "\106\x41\x43", "\141\156\x74\x64\157\143" => $bd->antdoc, "\162\145\146\x65\162\145\x6e\x63\151\x61" => $tip . $doc, "\164\x6f\164\141\x6c\x64" => $totald); $this->db->insert("\157\160\x65\162\x74\151", $operti); $fac[0] = $doc; $this->regncfac($fac, $newdoc, $bd->codcliente); $this->loguser("\107\x65\156\145\162\x61\x20\x4e\57\x43", "\x45\154\x20\165\163\165\x61\162\x69\157\40\141\40\147\145\156\x65\162\x61\144\157\x20\x6c\x61\x20\x6e\157\164\x61\x20\144\145\40\143\162\x65\x64\x69\x74\157\x20\x70\x6f\x72\40\x6d\x6f\x74\151\166\157\x20\144\145\40" . $obser . "\40\x70\x61\x72\141\40\145\154\x20\x64\x6f\x63\x75\155\x65\x6e\x74\157\x20" . $doc . ''); return $this->db->affected_rows(); } } function genendfacmonto($doc, $tip, $por, $obser) { $bd = $this->db->query("\123\x45\114\x45\103\124\x20\141\56\166\x65\x6e\144\145\144\157\x72\54\x61\56\146\x65\143\150\x61\x63\162\145\141\x2c\141\56\x72\151\x66\54\x61\56\x63\157\144\143\154\151\x65\156\x74\145\54\x61\56\156\157\155\142\162\145\143\x6c\151\54\40\141\56\x64\x69\x72\x65\x63\x63\151\x6f\x6e\54\x61\56\x61\156\164\144\157\143\54\141\56\x74\x65\154\145\x66\157\156\x6f\163\54\x61\x2e\x64\151\x61\163\143\162\145\x64\54\x61\x2e\x74\157\x74\144\145\x73\143\165\145\156\x2c\x61\x2e\x66\145\x63\150\141\143\x72\145\x61\54\x61\56\x73\x65\x63\x74\157\162\x2c\x61\x2e\164\157\164\x6e\x65\164\157\54\x61\56\x72\x69\146\x2c\12\40\x20\x20\x20\50\123\105\114\105\x43\x54\40\157\x66\x69\143\x69\141\x6c\x20\106\x52\x4f\x4d\x20\x6d\157\156\x65\143\141\155\x20\127\110\105\x52\105\x20\x66\145\x63\150\x61\74\75\141\56\x66\145\143\150\141\143\x72\145\141\40\117\x52\104\x45\122\x20\102\x59\x20\106\105\x43\110\x41\40\x44\x45\x53\103\x20\114\111\115\111\124\40\61\x29\x20\164\141\163\x61\12\40\x20\40\x20\x46\122\x4f\115\40\x6f\160\x65\x72\x74\151\x20\x61\x20\127\110\x45\122\x45\x20\141\x2e\144\157\x63\165\155\145\x6e\164\157\x3d\47{$doc}\47\x20\46\x26\x20\141\x2e\x74\x69\x70\x6f\144\x6f\x63\75\x27{$tip}\47")->row(); $newdoc = $this->db->query("\123\105\114\x45\x43\x54\x20\111\x46\x28\x4d\x41\x58\50\x64\x6f\143\165\155\145\x6e\164\157\x29\53\61\76\60\x2c\x4d\101\130\50\144\157\x63\x75\155\145\156\164\157\x29\53\61\54\x31\51\x20\156\x20\106\122\117\115\x20\x6f\x70\145\x72\x74\x69\40\127\110\x45\122\x45\x20\x74\x69\160\157\144\x6f\143\x3d\47\116\x2f\x44\47")->row(); $newdoc = str_pad($newdoc->n, 8, "\60", STR_PAD_LEFT); $pid = $this->genecod(12); $user = $this->session->userdata("\143\157\144"); $totneto = $por; $totald = $totneto / $bd->tasa; $opermv = array("\x69\x64\x5f\145\155\160\162\x65\163\141" => "\104\x4d\105\104\x49\106", "\141\x67\145\x6e\143\x69\x61" => "\60\60\61", "\x74\151\160\157\144\157\x63" => "\x4e\x2f\104", "\144\x6f\143\165\x6d\x65\156\x74\x6f" => $newdoc, "\147\162\165\x70\x6f" => "\x4e\57\x41", "\157\x72\x69\x67\145\156" => "\61", "\x63\157\x64\151\147\157" => "\x4e\x2f\x41", "\x70\151\x64" => '' . $pid . '', "\x6e\x6f\155\x62\x72\x65" => $obser, "\x63\157\163\x74\x6f\165\x6e\x69\x74" => 0, "\160\x72\x65\x63\151\157\165\x6e\151\164" => 0, "\x64\x73\x63\164\157\x75\x6e\x69\164" => 0, "\x64\163\143\164\x6f\160\x72\x63" => 0, "\x70\x72\145\x63\x69\x6f\146\151\x6e" => 0, "\x70\162\145\143\151\x6f\157\162\x69\147\x69\x6e\141\x6c" => 0, "\143\141\156\x74\x69\144\x61\144" => 0, "\143\156\164\144\145\166\165\145\154\x74" => 0, "\x6d\157\156\x74\157\x6e\x65\164\x6f" => $totneto, "\x6d\157\x6e\x74\x6f\164\157\x74\x61\x6c" => $totneto, "\x74\151\x6d\x70\165\145\x70\162\143" => 0, "\141\x6c\x6d\x61\143\145\156" => "\116\x2f\101", "\160\162\157\x76\145\145\x64\x6f\x72" => $bd->proveedor, "\146\145\143\x68\x61\144\x6f\x63" => '' . date("\131\55\155\55\x64") . '', "\x69\x6d\160\165\x65\163\164\x6f\x31" => "\60", "\151\x6d\160\165\145\x73\x74\157\x32" => "\60", "\x76\145\156\x64\x65\x64\x6f\x72" => '' . $bd->vendedor . '', "\x65\x6d\151\x73\157\162" => $user, "\x75\163\141\163\x65\x72\x69\141\x6c" => "\x32", "\x74\151\x70\157\x70\x72\x65\143\151\x6f" => "\61", "\165\156\x69\144\141\x64" => "\x55\116\x44", "\x61\x67\x72\x75\x70\141\144\157" => "\x32", "\143\157\155\x70\165\145\x73\x74\x6f" => "\62", "\165\x73\141\x65\170\151\163\164" => "\61", "\141\x75\x78\61" => "\x31", "\x65\163\164\x61\143\151\x6f\156" => "\60\x30\x31", "\165\x64\151\156\x61\155\151\x63\141" => "\x31", "\x62\x61\x73\x65\151\x6d\x70\x6f\61" => 0, "\x62\x61\163\145\x69\155\160\x6f\62" => "\60", "\154\x6f\164\145" => "\116\x2f\101", "\151\x64\x76\x61\154\x69\x64\x61\143\151\157\x6e" => '', "\146\x65\143\x68\141\171\x68\x6f\162\x61" => '' . date("\131\55\155\x2d\144\x20\x48\72\x69\x3a\163") . '', "\x65\156\x76\x69\141\x64\x6f\x5f\153\155\157\x6e\x69\164\157\162" => "\x30", "\x73\x74\x61\x74\165\163" => 1); $this->db->insert("\x6f\160\x65\162\x6d\x76", $opermv); $operti = array("\x69\144\137\x65\155\160\x72\x65\163\x61" => "\x44\115\x45\x44\x49\x46", "\x61\x67\145\x6e\x63\151\x61" => "\60\60\61", "\x74\151\x70\157\144\157\143" => "\x4e\x2f\104", "\x6d\x6f\x6e\x65\x64\141" => "\x30\60\60", "\144\x6f\143\x75\155\x65\156\164\x6f" => $newdoc, "\143\157\144\143\154\151\145\156\x74\145" => $bd->codcliente, "\x6e\x6f\x6d\x62\x72\x65\x63\154\151" => $bd->nombrecli, "\143\x6f\x6e\164\141\x63\164\157" => "\x4e\x2f\x41", "\162\151\x66" => $bd->rif, "\144\x69\x72\145\143\x63\x69\157\x6e" => $bd->direccion, "\164\x65\154\145\146\157\x6e\157\x73" => $bd->telefonos, "\x74\x69\160\157\x70\162\x65\143\151\x6f" => "\x31", "\x65\155\151\163\151\x6f\156" => '' . date("\x59\55\155\x2d\144") . '', "\162\145\x63\x65\x70\143\151\157\x6e" => date("\131\x2d\155\x2d\x64"), "\x76\x65\156\143\145" => date("\131\x2d\x6d\x2d\x64"), "\x66\x65\143\x68\x61\x63\162\x65\141" => date("\131\55\x6d\55\144"), "\164\157\164\143\157\163\164\x6f" => 0, "\x74\157\x74\x62\x72\x75\164\157" => $totneto, "\x74\157\164\x6e\x65\164\157" => $totneto, "\164\157\x74\x61\154\146\151\156\x61\154" => '' . $totneto . '', "\x74\x6f\x74\x69\x6d\x70\165\x65\163\164" => 0, "\x74\x6f\x74\x64\145\x73\x63\165\145\156" => 0, "\151\155\160\x75\x65\x73\x74\x6f\x31" => "\x30", "\151\x6d\160\x75\145\163\x74\x6f\62" => "\x30", "\x64\x73\143\164\157\x6c\151\x6e\145\141" => 0, "\144\x69\141\x73\143\x72\145\x64" => $bd->diascred, "\166\145\156\x64\145\144\157\x72" => '' . $bd->vendedor . '', "\146\141\x63\164\157\162\x63\141\x6d\142" => "\61", "\165\145\155\151\163\157\x72" => '' . $user . '', "\145\x73\164\141\x63\151\x6f\156" => "\60\60\61", "\x73\x69\x6e\x69\x6d\160\x75\145\x73\164" => $totneto, "\x61\x6c\155\x61\x63\x65\156" => "\116\57\101", "\163\x65\143\164\157\x72" => '' . $bd->sector . '', "\x73\165\x62\143\157\x64\151\147\157" => '' . $bd->subcodigo . '', "\x66\x6f\162\x6d\141\146\151\163" => "\x31", "\x61\x6c\137\154\151\x62\x72\157" => "\x31", "\x64\142\143\162" => "\x31", "\150\x6f\x72\141\144\x6f\x63\x75\x6d" => '' . date("\110\x3a\151\72\x73") . '', "\141\x6d\160\x6d" => "\62", "\145\163\x63\x72\x65\144\x69\x74\157" => "\61", "\142\x61\163\145\151\155\160\157\x31" => 0, "\146\x65\x63\x68\141\x79\150\x6f\162\141" => '' . date("\x59\x2d\x6d\55\x64\x20\x48\72\x69\72\163") . '', "\x69\144\166\x61\154\151\x64\141\x63\x69\157\156" => '', "\x64\x6f\x63\165\155\x65\156\x74\x6f\146\x69\x73\x63\141\154" => "\x30\x20\x52\145\143\151\x62\151\x64\x61", "\x63\x6f\x6d\141\156\144\x61\137\x6d\157\x76\151\x6c" => "\60", "\143\x6f\155\141\x6e\x64\141\137\153\155\x6f\156\x69\x74\157\x72" => "\60", "\156\157\164\x69\x6d\x62\x72\x61\x72" => "\x31", "\x61\156\164\151\160\157" => "\x46\x41\103", "\x61\x6e\x74\144\x6f\143" => $bd->antdoc, "\x72\145\x66\145\x72\x65\156\143\x69\x61" => $tip . $doc, "\x74\157\164\141\154\x64" => $totald); $this->db->insert("\157\160\145\x72\x74\151", $operti); $fac[0] = $doc; $this->regncfac($fac, $newdoc, $bd->codcliente); $this->loguser("\107\145\x6e\x65\162\141\40\116\57\x43", "\x45\x6c\x20\165\x73\165\141\x72\x69\157\x20\141\40\x67\145\x6e\x65\x72\141\144\x6f\x20\x6c\x61\x20\x6e\x6f\164\x61\x20\144\x65\40\x63\162\145\144\151\x74\x6f\x20\x70\x6f\x72\x20\155\x6f\x74\x69\x76\157\40\x64\145\40" . $obser . "\40\160\x61\162\x61\x20\145\x6c\x20\144\157\x63\165\155\145\x6e\x74\157\x20" . $doc . ''); return $this->db->affected_rows(); } function formdevfac($a, $b) { $bd = $this->db->query("\x53\105\x4c\x45\103\x54\x20\143\157\x64\x69\x67\x6f\x2c\154\157\164\x65\x2c\x52\117\x55\x4e\104\x28\143\141\156\x74\x69\144\141\x64\55\143\x6e\164\x64\x65\x76\x75\x65\x6c\x74\54\60\51\40\143\141\x6e\164\x69\x64\x61\x64\x20\x46\x52\117\x4d\40\157\x70\145\x72\x6d\166\x20\127\110\105\x52\x45\x20\144\x6f\x63\165\x6d\x65\156\164\157\75\x27{$a}\47\x20\46\x26\x20\x74\151\x70\x6f\144\157\143\x3d\47{$b}\47")->result(); $html = "\74\142\x72\76\12\40\x20\40\40\74\151\156\160\165\164\40\x74\171\x70\145\75\x22\150\151\x64\x64\x65\x6e\x22\40\151\x64\75\42\x64\x65\166\x64\x6f\143\42\40\x76\x61\154\165\x65\x3d\42" . $a . "\42\40\57\76\74\151\x6e\x70\x75\x74\x20\164\171\x70\145\x3d\42\150\151\144\x64\x65\156\42\x20\x69\x64\x3d\42\x64\x65\166\x74\x69\160\x6f\144\157\143\x22\x20\x76\141\154\x75\145\x3d\42" . $b . "\42\x20\57\76\xa\x20\x20\40\x20\74\x69\x6e\160\x75\x74\x20\164\x79\160\x65\75\x22\x62\165\x74\x74\157\156\x22\40\143\154\141\163\x73\75\x22\x77\63\55\x62\x74\156\x20\x77\63\x2d\142\x6c\165\x65\x20\x77\x33\x2d\x62\157\162\144\145\x72\x20\x77\x33\55\150\157\166\145\162\x2d\167\150\x69\164\x65\42\x20\166\x61\x6c\165\145\75\x22\120\141\162\x63\x69\141\154\x22\x20\x6f\156\x63\154\151\x63\153\x3d\42\x77\63\x2e\x73\150\157\x77\50\x27\43\144\x65\x76\160\x61\162\x63\151\141\154\x27\x29\x3b\x77\63\x2e\x68\151\144\145\x28\47\x23\144\145\x76\x74\x6f\164\x61\x6c\47\51\73\x22\x3e\40\74\151\x6e\x70\165\x74\40\164\171\x70\x65\x3d\x22\142\165\x74\164\x6f\156\42\x20\x63\154\141\x73\x73\x3d\42\x77\63\55\x62\x74\x6e\40\x77\x33\x2d\x6f\162\141\x6e\147\x65\x20\x77\x33\x2d\142\157\162\x64\145\162\x20\167\63\x2d\x68\x6f\166\145\162\55\167\150\151\x74\145\x22\40\166\x61\x6c\x75\145\75\x22\124\157\164\x61\x6c\x22\x20\157\x6e\143\154\x69\143\153\75\42\167\x33\56\163\x68\157\167\50\47\x23\144\145\166\164\157\164\x61\154\47\51\73\x77\63\56\x68\x69\144\145\x28\47\x23\144\x65\166\160\x61\162\x63\151\141\x6c\47\x29\x3b\42\76\x3c\142\162\76\x3c\x62\x72\x3e\12\x20\x20\40\40\x3c\x64\151\x76\40\151\x64\x3d\x22\144\x65\x76\160\141\162\143\x69\141\x6c\42\x20\163\x74\171\154\x65\75\x22\x64\x69\x73\160\154\x61\x79\72\x6e\157\x6e\x65\x22\76\x3c\x74\x61\x62\154\x65\x20\143\154\141\x73\x73\x3d\x22\x77\x33\x2d\x74\141\x62\x6c\x65\x2d\141\x6c\x6c\40\x77\x33\x2d\150\157\x76\x65\x72\141\142\154\145\42\x3e\xa\40\40\40"; foreach ($bd as $dt) { $html .= "\x3c\164\x72\76\74\x74\x64\40\143\x6c\141\x73\163\75\42\167\63\55\x66\157\156\x64\157\x64\x72\157\x69\144\42\76\103\x6f\144\151\x67\x6f\x3a\x3c\57\164\x64\x3e\74\x74\x64\76" . $dt->codigo . "\74\x2f\164\x64\x3e\xa\x20\40\40\x20\x20\x20\x20\40\x3c\x74\x64\40\x63\x6c\x61\x73\163\75\42\x77\x33\55\146\x6f\x6e\144\157\144\x72\x6f\151\x64\42\x3e\x4c\x6f\164\x65\72\x3c\x2f\164\x64\x3e\74\164\144\x3e" . $dt->lote . "\x3c\x2f\x74\144\76\12\x20\x20\x20\40\x20\x20\x20\x20\x3c\x74\x64\x20\x63\x6c\141\x73\163\x3d\42\x77\63\55\x66\x6f\156\144\157\144\162\x6f\151\x64\42\76\x43\x61\156\x74\x69\144\141\144\72\74\x2f\164\x64\76\74\x74\144\x3e\74\151\156\160\x75\x74\x20\x74\171\160\145\x3d\42\x68\151\144\x64\x65\x6e\x22\x20\156\141\155\x65\75\x22\x61\x6e\164\143\x61\x6e\x74\x22\40\x76\x61\154\x75\x65\x3d\x22" . $dt->cantidad . "\x22\x3e" . $dt->cantidad . "\x3c\x2f\164\144\x3e\xa\40\x20\40\x20\x20\40\40\x20\x3c\x74\144\40\x63\x6c\141\x73\163\x3d\x22\x77\63\x2d\x66\x6f\156\144\157\144\162\157\151\144\x22\76\x44\x65\166\x75\x65\154\164\141\72\74\57\x74\144\x3e\x3c\164\144\76\74\151\x6e\x70\x75\164\x20\164\x79\x70\x65\75\x22\x68\151\x64\x64\x65\x6e\x22\x20\x6e\x61\155\145\75\42\x64\145\166\143\157\144\x22\40\x76\x61\154\x75\x65\75\42" . $dt->codigo . "\x22\x3e\74\x69\x6e\x70\x75\164\40\164\171\160\x65\75\x22\x68\x69\x64\x64\x65\156\42\x20\156\141\x6d\145\75\42\144\145\166\x6c\x6f\x74\42\x20\x76\x61\x6c\165\x65\x3d\42" . $dt->lote . "\42\76\x3c\151\156\160\165\164\40\x74\x79\x70\145\75\42\156\x75\155\142\145\x72\42\40\x6e\x61\155\145\x3d\42\x64\145\166\143\x61\x6e\x74\42\40\x63\154\141\163\163\x3d\x22\x77\63\55\x69\156\x70\x75\164\x22\40\x70\x6c\141\143\x65\x68\157\x6c\144\145\162\x3d\42\x63\141\156\164\151\x64\x61\144\x20\144\x65\166\x75\145\154\x74\141\x73\56\56\56\42\x3e\74\x2f\x74\144\76\xa\40\x20\x20\40\x20\40\40\x20\74\57\164\162\x3e"; } $html .= "\x3c\57\x74\141\x62\x6c\x65\x3e\74\x62\x72\x3e\xa\x20\x20\x20\x20\74\151\156\x70\x75\164\x20\164\x79\x70\x65\x3d\42\x73\x75\142\155\151\x74\42\40\143\154\x61\x73\x73\x3d\42\x77\x33\55\142\164\156\40\167\63\55\147\162\145\x65\x6e\40\167\63\55\142\x6f\x72\x64\145\162\x20\167\x33\x2d\150\157\166\145\x72\x2d\x77\150\151\164\145\x22\x20\166\141\154\x75\145\75\x22\122\145\x67\x69\163\164\x72\141\x72\x22\x20\157\156\x63\154\151\143\x6b\75\42\x64\x65\166\146\x61\143\50\51\73\42\x3e\x3c\x62\x72\x3e\x3c\x62\x72\x3e\xa\40\40\x20\40\x3c\x2f\x64\151\166\76"; $html .= "\x3c\x64\151\x76\40\151\x64\x3d\x22\x64\145\166\x74\157\164\141\154\x22\40\x73\164\x79\154\x65\75\42\144\x69\x73\160\x6c\141\x79\72\x6e\157\156\x65\x22\76\xa\40\40\x20\40\x3c\151\x6e\160\x75\164\40\x74\x79\x70\x65\75\42\x73\165\142\x6d\x69\x74\x22\40\x63\154\x61\163\x73\75\x22\x77\63\x2d\x62\x74\x6e\x20\167\x33\x2d\x67\x72\145\x65\156\40\x77\63\55\142\x6f\x72\x64\x65\162\40\x77\63\x2d\x68\x6f\x76\145\x72\x2d\167\x68\151\164\145\x22\x20\166\x61\x6c\165\x65\x3d\42\122\145\x67\151\163\x74\x72\x61\162\42\x20\157\x6e\x63\154\151\x63\153\x3d\42\x64\145\x76\146\x61\143\x32\x28\x29\73\42\76\74\142\162\76\x3c\142\x72\76\xa\x20\x20\40\x20\x3c\57\x64\x69\x76\x3e"; return $html; } function devfac($a1, $a2, $a3, $a4, $a5, $a6) { if ($a5 <= $a6) { $this->db->query("\125\x50\x44\x41\124\x45\x20\x6f\x70\145\162\155\x76\40\x53\x45\x54\x20\x63\x6e\x74\x64\x65\x76\x75\145\x6c\x74\x3d\x27{$a5}\47\x20\127\x48\x45\122\105\40\164\x69\160\157\x64\157\x63\x3d\x27{$a2}\47\x20\46\x26\x20\144\157\x63\x75\x6d\145\156\x74\157\75\47{$a1}\47\x20\x26\x26\40\x63\157\144\x69\147\157\75\47{$a3}\x27\x20\46\46\40\x6c\157\x74\145\75\x27{$a4}\x27"); return $this->db->affected_rows(); } } function limpianc($doc, $tip) { $this->db->query("\x55\120\x44\101\x54\105\40\157\160\x65\x72\x6d\166\x20\123\x45\x54\x20\x63\156\164\144\145\166\165\x65\154\164\75\x30\x20\127\110\x45\x52\x45\40\144\x6f\x63\165\155\145\x6e\x74\157\x3d\x27{$doc}\x27\x20\x26\46\40\x74\151\160\157\144\157\143\75\47{$tip}\47"); } function facnotacred($a1, $a2) { $bd = $this->db->query("\x53\x45\114\105\103\x54\x20\143\x2e\x69\x6d\160\165\x65\x73\164\157\61\54\142\56\160\x72\x65\143\x69\x6f\x6f\162\x69\147\151\x6e\141\x6c\54\x62\x2e\x70\x72\x65\143\x69\x6f\146\151\156\x2c\142\56\143\157\163\164\x6f\165\156\x69\x74\54\x62\56\160\162\x65\x63\x69\x6f\165\156\151\164\54\x62\x2e\x63\141\156\x74\151\144\141\x64\x2c\142\x2e\143\156\x74\144\145\166\x75\x65\x6c\x74\54\141\x2e\166\145\156\144\x65\x64\157\162\x2c\142\56\x63\157\144\151\147\x6f\54\142\56\154\x6f\x74\145\x2c\142\x2e\x6e\157\x6d\x62\162\x65\54\x61\x2e\x72\151\x66\54\141\56\x63\x6f\144\143\154\x69\145\156\x74\x65\x2c\12\x20\x20\40\40\x61\56\x6e\x6f\x6d\x62\x72\145\x63\154\x69\54\40\x61\x2e\x64\x69\x72\x65\x63\x63\151\157\156\54\x62\56\144\163\143\x74\157\x75\x6e\151\x74\x2c\x62\x2e\144\163\x63\x74\x6f\x70\162\143\x2c\x62\x2e\160\162\157\166\x65\145\x64\157\x72\x2c\141\x2e\141\156\164\x64\157\143\54\142\x2e\x67\162\165\x70\x6f\54\141\56\x74\x65\154\x65\x66\157\x6e\x6f\x73\x2c\x61\56\x64\151\x61\x73\143\162\145\x64\x2c\x61\x2e\x74\157\164\144\x65\163\x63\165\x65\156\54\142\56\141\154\x6d\141\x63\x65\x6e\54\x61\x2e\x66\145\143\x68\141\143\162\145\141\54\x61\56\163\x65\x63\164\157\x72\x2c\141\x2e\x64\x73\x63\164\157\x65\156\x64\61\x2c\xa\x20\x20\x20\x20\x20\40\x20\x20\x28\x62\56\143\x6e\164\x64\x65\x76\x75\x65\154\164\52\142\56\160\x72\x65\143\x69\x6f\x75\x6e\x69\164\51\x20\164\157\164\163\151\x76\x61\54\12\40\40\x20\40\40\x20\x20\x20\x28\142\56\143\x6e\164\144\145\x76\x75\x65\154\164\x2a\x62\x2e\x70\x72\145\143\x69\157\146\151\x6e\51\40\164\x6f\x74\x2c\12\40\40\x20\x20\x20\x20\40\x20\50\111\106\50\142\56\x74\x69\155\x70\x75\x65\x70\x72\143\76\60\x2c\x62\56\x70\162\145\x63\151\157\x75\156\x69\164\52\50\x62\x2e\x74\151\155\160\165\x65\x70\x72\143\57\61\60\x30\51\54\x30\51\52\x62\x2e\x63\156\x74\x64\x65\x76\x75\x65\x6c\164\51\40\x74\x6f\164\151\x6d\x70\54\12\40\x20\40\x20\40\x20\40\x20\50\111\106\x28\x63\56\151\x6d\160\165\145\x73\x74\x6f\61\x3e\60\x2c\142\x2e\143\156\x74\x64\x65\x76\165\145\154\x74\52\x62\56\160\x72\x65\143\x69\x6f\x75\x6e\x69\164\54\60\51\x29\x20\x62\141\163\145\151\155\x70\54\12\x20\x20\40\x20\40\x20\x20\x20\x28\x49\x46\50\143\x2e\x69\155\160\165\x65\163\164\x6f\61\x3d\x30\54\x62\56\x63\x6e\164\144\x65\166\165\145\154\164\x2a\x62\x2e\160\162\x65\143\x69\157\165\x6e\151\x74\54\60\51\51\40\163\151\156\151\155\160\54\12\x20\x20\40\40\x20\x20\x20\x20\x28\142\x2e\143\x6e\x74\x64\145\166\x75\145\x6c\x74\x2a\50\x62\56\x63\157\163\164\157\x75\x6e\x69\x74\x2f\142\x2e\x63\x61\x6e\164\151\144\x61\144\x29\51\x20\164\157\164\143\x6f\163\x74\157\12\x20\40\x20\40\40\x20\x20\40\x46\122\x4f\x4d\x20\157\160\x65\162\164\151\40\x61\40\x4a\117\111\x4e\x20\x6f\x70\x65\x72\x6d\166\40\x62\x20\117\116\x20\x28\x61\56\144\157\143\x75\x6d\x65\156\x74\157\x3d\142\x2e\144\x6f\143\165\155\145\156\164\x6f\40\46\46\40\141\56\x74\x69\x70\157\x64\x6f\x63\75\142\56\164\151\x70\x6f\x64\x6f\x63\51\x20\112\x4f\111\x4e\x20\141\162\164\x69\x63\x75\x6c\x6f\40\143\40\x4f\116\40\x62\56\143\157\144\x69\147\157\x3d\x63\x2e\143\157\x64\x69\147\x6f\x20\x57\x48\105\x52\105\40\141\x2e\x64\x6f\x63\165\155\145\156\164\157\x3d\47{$a1}\x27\40\x26\46\40\x61\56\x74\151\x70\157\144\x6f\143\75\47{$a2}\x27\x20\46\x26\40\142\56\143\x6e\x74\144\145\x76\165\x65\154\x74\x3e\x30\40\x26\46\x20\141\56\x74\x69\x70\157\144\157\143\75\47\x46\x41\103\x27\x3b")->result(); $tot = 0; $totsiva = 0; $totimp = 0; $baseimp = 0; $totcosto = 0; $sinimp = 0; ${$totdesc} = 0; $user = $this->session->userdata("\x63\x6f\x64"); $num1 = $this->db->query("\x53\105\x4c\x45\103\124\x20\x4d\x41\130\x28\x64\x6f\143\165\x6d\x65\156\x74\157\x29\53\x31\40\x6e\40\x46\122\x4f\x4d\40\144\x65\166\x6f\154\x74\151\40\127\x48\x45\x52\105\40\164\151\x70\157\144\157\x63\75\47\104\x45\126\x27")->row(); $num1 = str_pad($num1->n, 8, "\x30", STR_PAD_LEFT); $num2 = $this->db->query("\x53\x45\114\105\103\x54\40\111\x46\x28\x4d\101\130\50\144\157\x63\165\x6d\145\x6e\164\x6f\51\x2b\61\x3e\60\x2c\115\101\x58\50\144\x6f\143\x75\x6d\145\x6e\x74\x6f\x29\x2b\x31\x2c\61\51\x20\156\x20\x46\122\x4f\x4d\40\157\160\x65\x72\x74\151\x20\x57\x48\x45\x52\105\x20\x74\x69\160\157\144\157\143\75\x27\x4e\57\x43\47")->row(); $num2 = str_pad($num2->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); foreach ($bd as $dt) { $descu = $dt->dsctoend1; $vend = $dt->vendedor; $rif = $dt->rif; $cli = $dt->codcliente; $nomcli = $dt->nombrecli; $dirr = $dt->direccion; $telf = $dt->telefonos; $diascred = $dt->diascred; $sector = $dt->sector; $antdoc = $dt->antdoc; $subcodigo = $dt->subcodigo; $fechacrea = $dt->fechacrea; $tot += $dt->tot; $totsiva += $dt->totsiva; $totimp += $dt->totimp; $baseimp += $dt->baseimp; $totcosto += $dt->totcosto; $sinimp += $dt->sinimp; $totdesc += $dt->totdesc; $devolmv = array("\151\144\x5f\x65\155\x70\x72\145\x73\141" => "\x44\115\x45\x44\x49\106", "\x61\x67\x65\156\143\151\x61" => "\x30\60\x31", "\164\x69\x70\157\144\157\x63" => "\x44\x45\x56", "\x64\x6f\143\165\x6d\x65\156\x74\157" => $num1, "\147\x72\165\x70\x6f" => $dt->grupo, "\x6f\x72\151\147\145\x6e" => "\x31", "\143\x6f\144\151\147\157" => $dt->codigo, "\160\151\x64" => '' . $pid . '', "\x6e\157\155\142\162\x65" => $dt->nombre, "\x63\157\x73\164\157\165\x6e\x69\164" => $dt->totcosto, "\160\x72\145\143\151\157\x75\x6e\151\164" => $dt->preciounit, "\144\163\x63\x74\x6f\x75\x6e\151\164" => $dt->dsctounit, "\144\163\143\164\x6f\160\x72\143" => $dt->dsctoprc, "\160\162\145\143\x69\157\x66\x69\156" => $dt->preciofin, "\160\x72\x65\143\x69\157\157\x72\x69\147" => $dt->preciooriginal, "\x63\141\156\164\151\x64\141\x64" => $dt->cntdevuelt, "\x63\156\x74\144\x65\x76\x75\x65\154\x74" => $dt->cntdevuelt, "\155\x6f\x6e\x74\x6f\x6e\x65\164\157" => $dt->totsiva, "\x6d\x6f\x6e\x74\x6f\x74\x6f\164\x61\154" => $dt->tot, "\x74\151\155\x70\165\x65\x70\162\143" => $dt->impuesto1, "\x61\154\155\141\x63\x65\x6e" => $dt->almacen, "\160\162\x6f\x76\x65\145\144\157\x72" => $dt->proveedor, "\146\x65\143\150\x61\144\x6f\143" => '' . date("\x59\55\155\55\144") . '', "\x69\155\x70\x75\145\x73\x74\157\61" => "\x30", "\x69\155\160\x75\145\163\164\x6f\62" => "\x30", "\166\x65\156\144\145\144\x6f\x72" => '' . $dt->vendedor . '', "\145\155\x69\x73\157\162" => $user, "\x75\163\x61\x73\x65\162\x69\141\x6c" => "\x32", "\x74\151\160\x6f\160\x72\145\143\x69\157" => "\61", "\x75\156\x69\x64\141\x64" => "\x55\x4e\104", "\x61\x67\162\165\x70\x61\x64\x6f" => "\62", "\143\x6f\155\160\165\x65\163\164\x6f" => "\x32", "\x75\x73\x61\145\170\151\x73\x74" => "\x31", "\141\165\170\61" => "\x31", "\145\x73\164\141\x63\151\157\x6e" => "\60\60\61", "\x75\x64\x69\x6e\141\155\151\143\x61" => "\x31", "\142\x61\x73\x65\151\155\x70\x6f\61" => $dt->baseimp, "\142\x61\163\145\x69\x6d\160\x6f\62" => "\60", "\x6c\x6f\x74\x65" => $dt->lote); $this->db->insert("\x64\145\x76\157\154\155\166", $devolmv); $opermv = array("\x69\144\x5f\145\155\x70\x72\x65\x73\141" => "\x44\x4d\105\104\111\106", "\x61\x67\145\x6e\x63\x69\141" => "\60\x30\x31", "\164\151\x70\x6f\x64\157\x63" => "\116\57\x43", "\x64\x6f\143\165\155\145\156\164\157" => $num2, "\147\x72\165\x70\x6f" => $dt->grupo, "\157\162\x69\147\145\156" => "\61", "\143\157\x64\x69\x67\x6f" => $dt->codigo, "\x70\151\144" => '' . $pid . '', "\x6e\157\x6d\x62\162\x65" => $dt->nombre, "\x63\x6f\x73\x74\x6f\x75\156\151\x74" => $dt->totcosto, "\160\x72\x65\143\x69\x6f\165\x6e\151\x74" => $dt->preciounit, "\x64\163\x63\x74\x6f\165\156\151\164" => $dt->dsctounit, "\144\x73\x63\164\157\x70\x72\143" => $dt->dsctoprc, "\x70\x72\x65\143\x69\157\146\x69\x6e" => $dt->preciofin, "\x70\162\145\x63\151\157\x6f\162\151\147\151\156\x61\x6c" => $dt->preciooriginal, "\x63\141\156\164\151\144\141\x64" => $dt->cntdevuelt, "\143\156\164\x64\x65\166\x75\145\154\x74" => $dt->cntdevuelt, "\x6d\157\x6e\x74\157\x6e\x65\x74\x6f" => $dt->totsiva, "\x6d\x6f\x6e\x74\157\164\157\x74\141\x6c" => $dt->tot, "\x74\x69\x6d\x70\x75\x65\x70\x72\x63" => $dt->impuesto1, "\x61\154\x6d\x61\143\x65\x6e" => $dt->almacen, "\160\x72\157\x76\145\145\144\x6f\x72" => $dt->proveedor, "\x66\x65\143\x68\x61\x64\x6f\143" => '' . date("\131\55\155\x2d\x64") . '', "\151\155\x70\x75\x65\x73\164\x6f\61" => "\60", "\x69\x6d\160\165\145\x73\164\x6f\62" => "\60", "\x76\x65\x6e\x64\x65\x64\157\162" => '' . $dt->vendedor . '', "\x65\x6d\151\x73\157\x72" => $user, "\165\163\141\163\145\162\x69\141\x6c" => "\x32", "\164\x69\160\157\x70\x72\145\143\x69\x6f" => "\61", "\x75\x6e\151\144\141\x64" => "\125\116\x44", "\141\x67\x72\165\x70\141\144\x6f" => "\x32", "\143\x6f\x6d\x70\x75\x65\163\x74\157" => "\62", "\x75\163\x61\145\170\151\163\x74" => "\x31", "\x61\165\170\x31" => "\61", "\x65\x73\164\141\143\x69\x6f\156" => "\x30\x30\61", "\165\144\151\x6e\x61\155\151\143\141" => "\x31", "\142\x61\163\145\151\x6d\160\157\x31" => $dt->baseimp, "\142\141\x73\145\x69\155\x70\157\62" => "\60", "\x6c\157\x74\x65" => $dt->lote, "\x69\144\166\x61\x6c\151\144\x61\x63\151\x6f\x6e" => '', "\x66\x65\143\150\141\x79\x68\x6f\x72\141" => '' . date("\131\55\x6d\x2d\x64\x20\110\x3a\x69\x3a\163") . '', "\x65\156\x76\x69\141\x64\157\x5f\x6b\x6d\x6f\x6e\151\x74\x6f\162" => "\60", "\x73\x74\141\164\165\163" => 1); $this->db->insert("\x6f\160\x65\162\155\x76", $opermv); } $devolti = array("\151\144\x5f\145\155\x70\x72\145\x73\141" => "\x44\x4d\105\x44\111\x46", "\x61\x67\145\156\143\x69\x61" => "\60\x30\x31", "\x74\151\160\157\144\157\143" => "\104\105\x56", "\x6d\x6f\156\145\144\x61" => "\60\x30\x30", "\x64\x6f\x63\165\155\x65\156\x74\157" => $num1, "\143\x6f\x64\x63\x6c\x69\145\x6e\164\145" => $cli, "\156\x6f\155\x62\x72\x65\143\154\x69" => $nomcli, "\143\x6f\x6e\x74\x61\x63\x74\157" => "\116\57\101", "\x72\151\x66" => $rif, "\x64\151\x72\145\x63\x63\x69\x6f\156" => $dirr, "\x74\145\x6c\x65\146\x6f\156\157\x73" => $telf, "\164\x69\x70\157\x70\x72\145\143\151\x6f" => "\61", "\x65\155\151\x73\x69\157\156" => '' . date("\x59\x2d\x6d\55\144") . '', "\162\145\x63\145\x70\143\x69\x6f\x6e" => date("\x59\x2d\155\55\144"), "\x76\x65\x6e\x63\145" => date("\131\55\x6d\55\144"), "\146\x65\143\150\141\x63\x72\x65\x61" => date("\131\x2d\155\x2d\x64"), "\164\157\164\143\x6f\163\164\157" => $totcosto, "\164\x6f\164\142\x72\x75\x74\x6f" => $totsiva, "\x74\157\x74\156\145\164\157" => $totsiva, "\164\x6f\x74\141\154\146\x69\156\141\154" => '' . $tot . '', "\x74\x6f\164\x69\x6d\160\165\x65\163\164" => $totimp, "\164\x6f\x74\144\x65\163\x63\165\145\156" => $totdesc, "\151\155\160\x75\145\163\x74\x6f\61" => "\60", "\151\x6d\160\x75\x65\x73\164\x6f\x32" => "\x30", "\x64\151\141\163\x63\162\145\144" => $diascred, "\x76\x65\x6e\x64\x65\144\x6f\162" => '' . $vend . '', "\x66\141\143\164\157\x72\143\141\x6d\x62" => "\61", "\x75\145\155\x69\x73\x6f\x72" => '' . $vend . '', "\x65\x73\164\141\143\x69\x6f\x6e" => "\x30\60\61", "\x73\151\156\x69\155\160\x75\x65\163\x74" => $sinimp, "\141\154\x6d\141\x63\145\x6e" => "\60\62", "\163\x65\143\x74\157\x72" => '' . $sector . '', "\146\157\162\155\141\x66\151\163" => "\x31", "\141\x6c\137\x6c\151\142\162\157" => "\61", "\x64\x62\143\x72" => "\61", "\x68\157\162\x61\144\157\x63\x75\155" => '' . date("\x48\72\x69\72\163") . '', "\x61\155\x70\x6d" => "\x32", "\145\x73\143\162\145\144\x69\x74\x6f" => "\61", "\x62\x61\x73\145\x69\x6d\x70\x6f\x31" => $baseimp, "\146\145\x63\150\x61\171\x68\x6f\162\x61" => '' . date("\131\x2d\x6d\55\x64\40\110\x3a\151\72\x73") . '', "\162\x65\x66\145\x72\145\156\x63\151\x61" => $a2 . $a1); $this->db->insert("\x64\x65\x76\157\154\x74\x69", $devolti); $tasa = $this->db->query("\x53\105\114\x45\x43\124\40\x6f\x66\x69\143\151\x61\154\x20\156\x20\106\x52\117\115\x20\155\157\156\x65\143\x61\x6d\40\127\110\105\x52\x45\x20\146\x65\x63\x68\x61\x3c\75\47{$fechacrea}\x27\x20\117\122\104\105\122\x20\x42\x59\x20\x66\x65\143\x68\x61\40\x44\x45\123\x43\x20\114\111\x4d\x49\124\x20\x31")->row(); $totald = $tot / $tasa->n; $operti = array("\x69\144\x5f\145\x6d\160\x72\x65\163\141" => "\104\x4d\105\104\111\x46", "\x61\147\x65\x6e\143\x69\x61" => "\60\60\61", "\164\x69\160\x6f\x64\157\143" => "\116\57\x43", "\155\x6f\156\145\144\141" => "\x30\x30\x30", "\144\157\x63\165\x6d\x65\x6e\x74\157" => $num2, "\x63\157\144\143\x6c\x69\145\x6e\164\x65" => $cli, "\x6e\157\155\x62\x72\x65\143\154\151" => $nomcli, "\x63\157\156\x74\141\143\x74\x6f" => "\116\x2f\x41", "\162\151\x66" => $rif, "\x64\x69\162\145\143\143\x69\157\x6e" => $dirr, "\x74\145\x6c\x65\x66\157\x6e\157\x73" => $telf, "\x74\x69\x70\157\x70\162\x65\143\x69\x6f" => "\61", "\145\155\x69\x73\151\157\156" => '' . date("\x59\55\x6d\55\x64") . '', "\162\x65\143\145\x70\143\151\157\156" => date("\x59\x2d\155\55\x64"), "\166\x65\156\x63\145" => date("\x59\55\x6d\55\x64"), "\146\145\143\150\141\143\x72\x65\x61" => date("\131\55\x6d\x2d\x64"), "\164\157\164\x63\x6f\x73\164\157" => $totcosto, "\x74\x6f\164\x62\x72\x75\164\x6f" => $totsiva, "\x74\x6f\x74\156\145\x74\x6f" => $totsiva, "\x74\157\x74\x61\x6c\146\151\156\141\154" => '' . $tot . '', "\164\157\164\151\x6d\x70\165\145\163\164" => $totimp, "\164\157\164\x64\x65\163\143\x75\x65\x6e" => $totdesc, "\151\x6d\160\165\x65\x73\164\157\x31" => "\60", "\151\155\x70\165\x65\163\x74\x6f\62" => "\x30", "\x64\x69\141\x73\x63\x72\145\144" => $diascred, "\166\145\x6e\144\145\144\157\162" => '' . $vend . '', "\146\141\143\164\157\162\143\x61\155\142" => "\61", "\165\x65\155\x69\x73\157\162" => '' . $vend . '', "\145\163\x74\x61\143\151\x6f\x6e" => "\x30\60\x31", "\163\151\x6e\x69\155\x70\x75\x65\163\164" => $sinimp, "\141\154\x6d\141\143\x65\156" => "\x30\62", "\163\145\143\164\x6f\x72" => '' . $sector . '', "\163\165\x62\x63\x6f\144\151\x67\157" => '' . $subcodigo . '', "\146\157\162\x6d\x61\146\151\163" => "\x31", "\141\154\137\x6c\151\x62\x72\x6f" => "\x31", "\144\142\x63\162" => "\61", "\x68\x6f\162\x61\x64\157\143\x75\155" => '' . date("\110\x3a\151\72\x73") . '', "\x61\x6d\x70\x6d" => "\62", "\x65\163\143\162\145\x64\x69\x74\x6f" => "\61", "\142\141\163\x65\x69\155\x70\157\x31" => $baseimp, "\146\x65\x63\x68\141\171\x68\x6f\162\x61" => '' . date("\x59\55\x6d\55\x64\x20\110\72\x69\x3a\163") . '', "\x69\x64\x76\x61\x6c\x69\144\141\143\x69\157\156" => '', "\x64\x6f\143\x75\155\x65\x6e\164\x6f\146\151\163\143\x61\x6c" => "\60\x20\122\145\143\151\x62\x69\x64\x61", "\x63\157\x6d\141\156\144\x61\x5f\x6d\x6f\x76\x69\154" => "\60", "\143\157\x6d\x61\156\x64\x61\137\x6b\155\x6f\x6e\x69\x74\157\x72" => "\x30", "\x6e\157\164\151\x6d\142\x72\141\x72" => "\x31", "\141\x6e\x74\151\x70\x6f" => "\x46\x41\103", "\141\156\x74\144\x6f\x63" => $antdoc, "\x72\x65\x66\x65\162\x65\x6e\x63\x69\x61" => $a2 . $a1, "\x64\x73\143\x74\x6f\x65\156\144\x31" => $descu, "\164\x6f\x74\x61\154\144" => $totald); $this->db->insert("\157\160\x65\x72\164\x69", $operti); $doc[0] = $a1; $this->regncfac($doc, $num2, $cli); $this->db->query("\125\120\104\101\x54\x45\40\x6f\160\145\162\x6d\166\40\x61\40\x53\105\x54\x20\x61\x2e\143\156\x74\x64\145\x76\165\145\154\164\40\x3d\x20\x49\x46\50\x28\x53\105\114\105\103\x54\x20\x53\125\115\x28\141\61\56\x63\x6e\164\x64\x65\166\165\x65\154\164\x29\40\106\122\x4f\x4d\40\x64\x65\x76\x6f\x6c\x6d\x76\x20\x61\x31\x20\112\x4f\x49\116\x20\144\x65\x76\157\154\x74\x69\40\x62\61\x20\117\x4e\x20\x61\x31\56\x64\157\x63\x75\155\x65\156\164\157\75\142\61\x2e\144\x6f\x63\165\x6d\145\x6e\x74\157\x20\127\x48\x45\x52\x45\x20\x62\61\56\162\145\x66\x65\x72\x65\x6e\x63\151\141\75\103\x4f\x4e\103\x41\x54\x28\x61\x2e\x74\x69\x70\157\144\157\x63\x2c\x61\x2e\x64\x6f\143\x75\x6d\x65\156\x74\x6f\x29\x20\46\x26\x20\x61\61\x2e\x61\x6c\155\x61\x63\x65\x6e\x3d\141\x2e\141\154\155\141\x63\x65\156\x20\x26\46\40\141\x31\56\143\x6f\144\x69\x67\x6f\x3d\141\x2e\x63\x6f\x64\x69\147\157\x20\x26\46\x20\x61\61\56\154\x6f\x74\145\x3d\141\56\154\157\164\145\x29\40\x3e\x30\54\12\x20\40\x20\x20\50\123\x45\x4c\x45\x43\x54\40\x53\x55\x4d\x28\141\61\x2e\x63\x6e\x74\x64\x65\x76\165\x65\x6c\x74\x29\x20\x46\122\x4f\115\x20\144\145\x76\157\x6c\155\x76\x20\x61\x31\x20\x4a\117\x49\x4e\40\144\x65\x76\x6f\x6c\164\151\40\142\61\x20\117\116\40\x61\x31\56\144\x6f\x63\x75\155\145\x6e\x74\157\x3d\x62\61\56\x64\x6f\x63\x75\x6d\145\156\164\x6f\x20\x57\x48\105\122\105\x20\40\x62\x31\56\x72\145\146\145\162\x65\156\x63\x69\x61\x3d\103\x4f\x4e\x43\x41\x54\50\141\56\x74\x69\160\157\x64\157\143\x2c\141\x2e\x64\157\x63\x75\x6d\145\156\164\x6f\x29\40\46\46\x20\141\61\x2e\x61\x6c\155\x61\143\x65\x6e\x3d\141\x2e\141\154\x6d\x61\x63\145\x6e\40\46\x26\x20\141\61\56\x63\157\144\x69\x67\x6f\x3d\141\56\143\157\144\151\x67\157\40\46\46\40\141\61\x2e\154\157\164\x65\75\x61\x2e\x6c\x6f\164\145\51\x20\x2c\x30\51\xa\x20\x20\x20\x20\127\110\x45\122\x45\x20\141\56\x74\x69\160\x6f\144\x6f\x63\75\47{$a2}\x27\40\x26\46\x20\144\157\143\x75\x6d\145\x6e\x74\x6f\x3d\47{$a1}\x27"); $this->db->query("\x55\120\104\x41\124\x45\40\x64\x65\166\x6f\x6c\155\166\40\x61\x20\x53\105\124\x20\141\56\x63\156\164\144\145\166\165\x65\x6c\164\75\x61\x2e\143\x61\x6e\x74\151\x64\x61\144\x20\x57\110\x45\122\105\40\x61\x2e\x63\156\x74\144\x65\x76\x75\145\154\x74\x3e\40\x61\56\x63\141\156\164\151\x64\141\x64\73"); $this->db->query("\125\x50\x44\x41\124\105\40\x6f\x70\145\162\155\166\x20\141\40\x53\105\x54\x20\x61\x2e\143\x6e\164\x64\145\x76\165\x65\154\x74\x3d\x61\56\143\141\156\164\151\144\x61\144\x20\x57\x48\x45\x52\x45\x20\x61\56\143\156\164\x64\145\x76\165\145\154\164\x3e\x20\141\56\143\x61\x6e\164\151\144\x61\144\x3b"); $this->loguser("\x44\x65\166\x6f\154\x75\143\151\157\x6e\x20\120\x61\x72\143\151\141\154", "\105\x6c\40\x75\x73\x75\141\162\151\x6f\x20\x61\40\x64\x65\166\165\x65\154\164\157\40\x69\164\145\155\x20\x64\145\40\154\x61\x20\146\141\x63\x74\165\x72\141\40" . $a1 . "\54\x20\x6e\157\164\141\x20\144\145\40\143\x72\x65\144\151\x74\x6f\x20\116\103" . $num2 . ''); } function facnotacred2($doc, $tipodoc) { $val = $this->db->query("\123\105\114\105\x43\124\x20\x4e\125\x4c\114\x20\x46\x52\x4f\x4d\x20\157\x70\x65\x72\x74\151\x20\127\110\105\122\x45\40\162\145\x66\x65\x72\145\x6e\x63\151\141\75\x27" . $tipodoc . $doc . "\47\40\46\46\40\164\x69\160\157\144\x6f\143\75\x27\x4e\57\x43\47\x20\x26\46\40\x65\163\x74\x61\164\165\163\x64\157\143\41\75\x27\130\x27")->num_rows(); if ($val == 0) { $num1 = $this->db->query("\x53\105\114\105\103\124\40\111\106\x28\115\x41\x58\50\144\157\x63\165\155\x65\x6e\164\x6f\x29\53\x31\76\60\x2c\115\101\x58\x28\144\157\x63\x75\155\x65\156\x74\157\x29\53\x31\x2c\x31\51\x20\x6e\x20\x46\122\x4f\x4d\x20\157\x70\145\x72\164\x69\x20\127\x48\105\x52\x45\40\164\x69\x70\157\144\x6f\143\x3d\x27\x4e\x2f\103\x27")->row(); $newdoc = str_pad($num1->n, 8, "\60", STR_PAD_LEFT); $num2 = $this->db->query("\x53\105\114\x45\103\x54\40\x49\106\50\x4d\x41\130\x28\144\157\x63\x75\x6d\145\x6e\164\157\x29\53\x31\x3e\x30\54\x4d\x41\x58\x28\x64\157\x63\x75\155\x65\156\x74\157\51\x2b\61\54\x31\51\x20\x6e\40\x46\122\x4f\115\40\x64\x65\166\x6f\154\164\x69\40\x57\x48\105\122\x45\40\x74\x69\160\x6f\144\x6f\143\75\x27\104\105\x56\47")->row(); $newdoc2 = str_pad($num2->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $this->db->query("\x49\x4e\123\x45\122\x54\40\111\116\x54\x4f\x20\x6f\160\x65\x72\164\151\40\123\x45\x4c\105\103\124\40\x2a\40\106\122\x4f\x4d\40\157\x70\x65\162\x74\x69\x20\x57\110\x45\x52\105\40\144\157\143\x75\x6d\145\x6e\164\x6f\75\47{$doc}\47\40\x26\46\40\x74\151\x70\157\144\157\x63\75\47{$tipodoc}\x27"); $this->db->query("\x55\120\104\101\x54\x45\x20\157\160\x65\162\x74\x69\x20\x53\x45\124\x20\x74\x69\160\x6f\144\157\143\x3d\x27\116\x2f\x43\47\x2c\x64\157\143\165\x6d\x65\x6e\164\x6f\x3d\x27{$newdoc}\x27\54\x72\x65\x66\x65\162\145\x6e\143\x69\x61\75\x27" . $tipodoc . $doc . "\47\54\146\145\x63\x68\x61\143\162\x65\141\75\143\165\x72\144\x61\164\x65\x28\51\54\145\155\x69\x73\x69\157\156\75\x63\165\162\144\x61\164\x65\x28\x29\54\x72\145\143\145\160\x63\151\x6f\x6e\x3d\x63\x75\x72\144\141\x74\145\x28\x29\x2c\x66\145\x63\150\141\171\150\x6f\x72\x61\x3d\x4e\117\127\50\x29\40\xa\x20\x20\x20\40\x20\40\x20\40\x57\110\105\x52\x45\x20\144\x6f\x63\165\155\x65\x6e\x74\157\75\x27{$doc}\47\x20\x26\x26\x20\164\151\x70\157\x64\157\143\x3d\x27{$tipodoc}\x27\x20\x4c\111\115\x49\124\x20\x31"); $v = $this->db->affected_rows(); $fac = $this->db->query("\x53\x45\x4c\105\103\x54\40\x2a\40\x46\122\x4f\115\40\157\160\x65\162\x74\x69\x20\x57\110\105\x52\105\40\x64\157\143\165\155\x65\156\x74\157\75\47{$doc}\47\x20\x26\x26\x20\x74\151\160\x6f\144\157\143\x3d\x27{$tipodoc}\47")->row(); $bd = $this->db->query("\123\x45\x4c\105\x43\124\x20\x2a\x20\x46\122\x4f\x4d\x20\x6f\160\x65\162\155\166\40\127\110\105\x52\105\x20\144\x6f\x63\165\x6d\x65\x6e\x74\157\75\x27{$doc}\x27\x20\x26\46\40\x74\151\x70\x6f\144\x6f\143\75\x27{$tipodoc}\x27")->result(); $devolti = array("\x69\144\137\145\155\160\162\x65\x73\x61" => "\104\x4d\x45\x44\111\x46", "\141\x67\145\156\143\x69\141" => "\60\x30\61", "\x74\151\x70\x6f\144\157\143" => "\104\105\126", "\155\x6f\x6e\x65\x64\x61" => "\x30\60\60", "\144\157\x63\x75\x6d\145\156\164\x6f" => $newdoc2, "\x63\x6f\x64\x63\x6c\x69\145\x6e\164\145" => $fac->codcliente, "\156\157\155\142\x72\145\143\154\151" => $fac->nombrecli, "\x63\157\156\x74\141\x63\x74\157" => "\116\x2f\x41", "\162\151\146" => $fac->rif, "\x64\x69\162\x65\143\143\x69\x6f\x6e" => $fac->direccion, "\164\x65\x6c\x65\x66\x6f\x6e\x6f\163" => $fac->telefonos, "\164\x69\x70\157\x70\162\x65\x63\x69\x6f" => "\61", "\x65\x6d\151\x73\151\x6f\156" => '' . date("\x59\x2d\155\x2d\x64") . '', "\x72\x65\143\145\x70\143\x69\x6f\x6e" => date("\131\55\155\55\x64"), "\166\x65\156\143\x65" => date("\x59\x2d\x6d\55\144"), "\x66\145\x63\x68\x61\x63\x72\x65\x61" => date("\131\55\155\x2d\144"), "\x74\x6f\x74\x63\157\x73\x74\x6f" => $fac->totcosto, "\x74\x6f\164\142\x72\165\164\157" => $fac->totbruto, "\x74\x6f\x74\x6e\145\164\x6f" => $fac->totneto, "\x74\x6f\x74\x61\x6c\146\x69\x6e\141\154" => $fac->totalfinal, "\164\x6f\164\x69\155\x70\x75\145\163\x74" => $fac->totimpuest, "\164\x6f\x74\x64\x65\x73\143\x75\x65\156" => $fac->totdescuen, "\x69\x6d\160\x75\145\163\x74\157\x31" => "\60", "\151\x6d\x70\165\145\163\x74\157\62" => "\x30", "\x64\x69\x61\163\x63\x72\x65\x64" => $fac->diascred, "\166\145\x6e\x64\x65\144\x6f\162" => $fac->vendedor, "\x66\141\143\164\157\x72\143\x61\x6d\142" => "\x31", "\x75\145\155\151\163\157\162" => "\116\57\101", "\145\163\x74\141\143\x69\157\x6e" => "\x30\x30\61", "\163\x69\156\x69\155\x70\x75\145\x73\164" => $fac->sinimpuest, "\141\154\x6d\141\x63\145\x6e" => "\60\x32", "\x73\145\x63\164\157\162" => $fac->sector, "\x66\x6f\x72\x6d\x61\x66\x69\x73" => "\61", "\141\154\137\x6c\x69\142\x72\x6f" => "\61", "\144\142\x63\x72" => "\61", "\x68\x6f\162\x61\x64\x6f\x63\165\x6d" => '' . date("\110\72\x69\72\x73") . '', "\141\155\x70\x6d" => "\x32", "\145\163\x63\x72\145\x64\151\164\x6f" => "\x31", "\142\x61\x73\145\x69\155\x70\157\x31" => $fac->baseimpo1, "\x66\x65\x63\150\x61\171\x68\157\x72\141" => '' . date("\x59\55\x6d\x2d\x64\40\x48\72\x69\x3a\163") . '', "\162\x65\146\145\x72\145\x6e\x63\x69\141" => $tipodoc . $doc); $this->db->insert("\x64\x65\x76\x6f\x6c\x74\x69", $devolti); foreach ($bd as $dtped) { $datos = array("\x69\144\137\x65\x6d\160\162\x65\163\x61" => "\x44\x4d\105\x44\111\x46", "\141\147\x65\x6e\143\151\141" => "\60\60\x31", "\x74\151\160\157\144\x6f\143" => "\x4e\x2f\x43", "\x64\x6f\143\x75\155\x65\x6e\x74\x6f" => $newdoc, "\147\x72\x75\x70\x6f" => '' . $dtped->grupo . '', "\x6f\162\x69\x67\145\x6e" => "\61", "\x63\x6f\144\x69\x67\x6f" => '' . $dtped->codigo . '', "\x70\151\144" => '' . $pid . '', "\156\157\x6d\x62\162\145" => '' . $dtped->nombre . '', "\143\157\163\164\x6f\165\x6e\151\x74" => '' . $dtped->costounit . '', "\160\162\x65\143\x69\157\x75\x6e\x69\x74" => $dtped->preciounit, "\x64\163\x63\164\x6f\165\156\x69\x74" => '' . $dtped->dsctounit . '', "\x64\163\143\x74\x6f\x70\x72\143" => '' . $dtped->dsctoprc . '', "\x64\x73\x63\164\157\x65\156\144\x70" => $dtped->dsctoendp, "\144\163\x63\164\157\145\156\x64\155" => $dtped->dsctoendm, "\x70\162\145\143\x69\x6f\146\x69\x6e" => '' . $dtped->preciofin . '', "\160\x72\145\143\151\157\157\x72\151\x67\x69\x6e\141\154" => '' . $dtped->preciooriginal . '', "\143\x61\x6e\164\151\144\x61\x64" => '' . $dtped->cantidad . '', "\x63\156\x74\144\x65\166\165\x65\x6c\x74" => $dtped->cantidad, "\x6d\x6f\156\x74\x6f\x6e\x65\164\x6f" => '' . $dtped->montoneto . '', "\x6d\x6f\x6e\164\x6f\x74\157\164\141\154" => '' . $dtped->montototal . '', "\164\x69\x6d\160\x75\x65\160\162\x63" => '' . $dtped->timpueprc . '', "\141\154\x6d\x61\x63\x65\156" => $dtped->almacen, "\x70\x72\x6f\166\x65\x65\x64\157\x72" => '' . $dtped->proveedor . '', "\x66\x65\143\150\141\x64\157\143" => '' . date("\x59\55\x6d\x2d\144") . '', "\x69\x6d\160\165\x65\163\164\157\61" => "\x30", "\x69\x6d\x70\x75\145\163\x74\x6f\x32" => "\60", "\166\x65\x6e\x64\x65\x64\x6f\162" => $dtped->vendedor, "\x65\x6d\151\x73\157\x72" => "\x46\101\x43\x54\x55\x52\x41\104", "\165\x73\141\x73\x65\162\151\x61\154" => "\x32", "\164\x69\160\157\160\x72\145\x63\151\x6f" => "\x31", "\165\156\x69\x64\141\144" => "\125\116\x44", "\141\x67\162\165\x70\141\x64\x6f" => "\x32", "\143\157\x6d\x70\x75\145\x73\x74\x6f" => "\62", "\165\163\141\145\170\151\x73\x74" => "\61", "\x61\165\170\61" => '' . $dtped->aux1 . '', "\145\x73\164\x61\143\151\x6f\x6e" => "\60\x30\x31", "\165\x64\151\x6e\141\x6d\x69\143\141" => "\x31", "\142\141\x73\145\x69\x6d\x70\x6f\61" => '' . $dtped->baseimpo1 . '', "\142\x61\x73\145\151\x6d\160\157\x32" => "\60", "\154\157\x74\145" => $dtped->lote, "\x69\144\166\141\x6c\x69\144\141\143\151\x6f\x6e" => '', "\146\145\x63\x68\x61\x79\150\157\162\x61" => '' . date("\x59\55\155\x2d\x64\x20\110\72\x69\x3a\x73") . '', "\x65\x6e\166\x69\x61\x64\x6f\x5f\x6b\155\157\156\x69\x74\157\162" => "\60"); $this->db->insert("\x6f\x70\x65\162\155\x76", $datos); $devolmv = array("\151\144\137\x65\155\160\x72\x65\x73\141" => "\104\x4d\105\x44\x49\x46", "\141\147\145\x6e\143\151\x61" => "\60\60\x31", "\x74\151\x70\x6f\144\x6f\x63" => "\104\105\126", "\x64\157\143\x75\155\x65\156\x74\x6f" => $newdoc2, "\x67\x72\x75\160\157" => $dtped->grupo, "\x6f\162\x69\147\x65\x6e" => "\x31", "\143\x6f\x64\151\x67\x6f" => $dtped->codigo, "\160\x69\x64" => '' . $pid . '', "\x6e\x6f\155\142\x72\x65" => $dtped->nombre, "\143\157\163\164\x6f\165\156\151\x74" => $dtped->costounit, "\x70\162\x65\143\151\x6f\x75\156\x69\164" => $dtped->preciounit, "\144\163\x63\164\x6f\165\156\x69\x74" => $dtped->dsctounit, "\x64\x73\x63\x74\157\x70\x72\x63" => $dtped->dsctoprc, "\160\162\145\143\151\x6f\x66\151\x6e" => $dtped->preciofin, "\160\162\145\x63\151\x6f\x6f\162\151\147" => $dtped->preciooriginal, "\143\141\156\x74\x69\x64\x61\144" => $dtped->cantidad, "\x63\156\164\144\145\166\165\x65\154\164" => $dtped->cantidad, "\x6d\157\156\164\x6f\x6e\145\x74\x6f" => $dtped->montoneto, "\155\157\156\164\x6f\164\x6f\164\141\x6c" => $dtped->montototal, "\x74\x69\155\160\165\145\160\162\143" => $dtped->timpueprc, "\x61\x6c\155\x61\x63\x65\156" => $dtped->almacen, "\160\162\x6f\166\145\145\x64\157\162" => $dtped->proveedor, "\x66\x65\x63\150\x61\x64\157\x63" => '' . date("\131\x2d\155\55\x64") . '', "\151\155\160\x75\145\163\164\157\x31" => "\60", "\151\155\x70\x75\x65\163\164\157\x32" => "\60", "\x76\145\156\144\x65\144\157\162" => '' . $dtped->vendedor . '', "\145\x6d\x69\x73\157\x72" => "\106\101\103\x54\x55\x52\x41\x44", "\x75\163\x61\x73\145\x72\151\141\154" => "\x32", "\x74\151\160\157\160\x72\145\143\151\157" => "\61", "\x75\156\x69\x64\x61\144" => "\x55\116\x44", "\141\147\x72\x75\160\141\x64\x6f" => "\x32", "\143\x6f\x6d\160\x75\145\x73\164\x6f" => "\62", "\165\163\x61\x65\x78\151\163\164" => "\61", "\x61\x75\x78\61" => "\61", "\x65\x73\x74\x61\143\x69\157\x6e" => "\x30\60\x31", "\165\144\x69\x6e\141\155\x69\x63\141" => "\x31", "\142\x61\x73\145\x69\x6d\x70\x6f\61" => $dtped->baseimpo1, "\142\141\163\145\151\x6d\x70\x6f\62" => "\x30", "\154\157\164\145" => $dtped->lote); $this->db->insert("\x64\145\166\x6f\x6c\x6d\x76", $devolmv); } if ($v > 0) { $facnc[0] = $doc; $this->db->query("\x55\x50\x44\x41\124\105\40\x6f\x70\145\x72\x74\151\x20\x73\145\164\40\145\x73\164\141\164\165\163\144\x6f\143\x3d\x27\x58\47\x20\127\110\x45\x52\x45\40\x64\157\x63\x75\155\145\x6e\x74\157\75\47{$doc}\x27\40\x26\x26\40\x74\x69\x70\x6f\144\157\143\75\x27\106\x41\103\47"); $this->db->query("\125\120\104\x41\124\x45\x20\x6f\160\145\162\x6d\x76\x20\123\x45\x54\x20\x63\x6e\x74\x64\x65\166\165\x65\154\164\75\x63\x61\x6e\x74\x69\144\141\x64\x20\x57\110\x45\122\x45\x20\x64\157\x63\165\x6d\x65\156\x74\x6f\75\47{$doc}\x27\40\x26\x26\x20\x74\x69\160\157\144\x6f\143\75\x27\x46\x41\x43\47"); $this->regncfac($facnc, $newdoc, $fac->codcliente); $this->loguser("\104\x65\x76\157\x6c\x75\x63\151\x6f\x6e\x20\124\157\x74\141\154", "\x45\154\40\165\163\165\x61\162\151\x6f\40\141\x20\x64\x65\166\x75\x65\x6c\x74\157\x20\154\x61\x20\x66\x61\x63\164\165\x72\141\40" . $doc . "\54\x20\156\x6f\x74\141\x20\144\x65\x20\x63\x72\x65\144\151\164\x6f\40\x4e\x43" . $newdoc . ''); } return $this->db->affected_rows(); } } function notnotacred($a1, $a2) { $bd = $this->db->query("\123\x45\114\x45\x43\124\x20\143\56\151\x6d\160\x75\145\x73\x74\157\x31\x2c\x62\x2e\x70\162\x65\x63\x69\x6f\157\162\151\147\151\x6e\141\154\x2c\142\x2e\x70\x72\145\x63\x69\157\146\151\156\54\142\56\x63\157\x73\x74\x6f\x75\x6e\151\164\x2c\142\56\x70\x72\x65\143\x69\157\165\x6e\x69\164\54\142\x2e\143\x61\156\x74\151\x64\x61\144\x2c\x62\56\x63\156\164\144\145\166\165\145\x6c\164\x2c\141\56\166\x65\x6e\x64\145\x64\157\x72\54\142\x2e\143\x6f\144\151\x67\157\54\x62\x2e\x6c\x6f\164\145\54\x62\56\156\157\155\142\x72\145\x2c\x61\x2e\162\x69\146\54\x61\56\143\x6f\144\x63\x6c\151\145\156\164\x65\54\xa\x20\40\x20\x20\141\x2e\x6e\x6f\155\x62\x72\145\143\x6c\x69\x2c\x20\141\x2e\144\x69\162\145\143\143\x69\x6f\156\x2c\142\56\x64\163\143\164\157\165\x6e\151\164\54\x62\x2e\144\163\x63\x74\157\160\162\143\54\142\x2e\160\x72\157\166\x65\x65\144\x6f\x72\x2c\141\56\141\156\x74\x64\x6f\x63\54\142\56\x67\x72\165\160\x6f\54\141\56\164\145\x6c\x65\146\157\x6e\x6f\x73\54\141\56\x64\x69\141\x73\143\x72\145\144\54\x61\x2e\x74\x6f\164\144\x65\163\x63\x75\145\x6e\x2c\x62\56\x61\154\x6d\141\143\145\156\x2c\x61\x2e\x66\x65\143\150\141\x63\x72\145\x61\54\x61\56\x73\x65\x63\164\x6f\x72\54\141\x2e\x64\x73\x63\164\157\x65\156\144\61\x2c\xa\x20\x20\x20\x20\40\40\x20\x20\x28\142\x2e\x63\156\x74\144\x65\x76\165\x65\154\x74\52\142\x2e\x70\162\x65\x63\x69\157\x75\x6e\151\x74\51\x20\x74\x6f\164\x73\151\166\141\54\12\x20\x20\x20\40\x20\x20\40\40\x28\142\x2e\143\156\x74\144\145\x76\165\x65\154\164\x2a\x62\56\x70\x72\145\x63\151\157\x66\x69\156\51\40\x74\x6f\164\x2c\12\x20\x20\x20\40\40\40\40\40\50\111\106\x28\x62\56\164\151\x6d\160\165\145\x70\x72\143\76\60\x2c\142\56\160\x72\x65\143\151\157\165\x6e\151\164\x2a\x28\x62\56\164\x69\155\x70\x75\145\x70\x72\143\x2f\x31\x30\x30\x29\54\x30\x29\52\x62\x2e\x63\156\x74\144\145\x76\x75\145\x6c\164\51\40\x74\x6f\164\x69\x6d\x70\54\xa\40\40\40\40\x20\40\40\40\50\x49\106\x28\143\56\x69\155\x70\x75\x65\x73\x74\157\x31\x3e\60\54\142\56\143\x6e\164\x64\x65\x76\x75\145\154\x74\52\x62\56\x70\162\x65\x63\151\157\x75\x6e\151\x74\54\60\51\x29\40\142\141\x73\x65\151\x6d\160\54\12\x20\40\40\40\40\40\40\40\50\111\106\x28\143\56\151\x6d\160\165\145\x73\x74\x6f\x31\75\x30\54\142\56\x63\156\x74\144\x65\x76\x75\x65\154\x74\52\142\x2e\160\162\145\x63\x69\x6f\165\156\x69\x74\x2c\x30\x29\51\40\163\151\x6e\151\x6d\160\54\xa\40\x20\40\x20\40\x20\40\40\x28\x62\56\x63\156\x74\144\145\x76\x75\x65\154\164\x2a\x28\142\x2e\143\157\163\164\157\x75\156\x69\x74\57\x62\56\143\x61\x6e\x74\151\144\141\x64\x29\x29\40\164\x6f\164\x63\x6f\163\164\x6f\54\12\x20\40\40\40\40\40\x20\x20\50\x52\x4f\x55\x4e\104\50\142\56\x64\x73\143\x74\157\x70\162\x63\x2c\62\51\x2a\x62\x2e\143\x6e\x74\144\145\166\165\145\154\x74\51\x20\x74\x6f\x74\144\x65\163\143\xa\40\40\x20\x20\40\x20\x20\40\x46\x52\117\x4d\x20\x6f\160\145\162\x74\151\40\141\x20\112\x4f\111\116\x20\x6f\x70\x65\x72\x6d\166\40\142\40\x4f\x4e\40\50\x61\56\x64\x6f\143\x75\155\145\156\x74\x6f\75\x62\56\144\x6f\x63\165\x6d\x65\156\x74\x6f\x20\46\46\40\141\56\164\151\160\x6f\x64\x6f\143\75\142\56\164\151\x70\x6f\144\x6f\x63\x29\x20\112\117\x49\x4e\40\141\x72\x74\x69\x63\x75\x6c\157\x20\x63\40\x4f\116\x20\142\x2e\x63\x6f\x64\151\147\157\x3d\x63\56\143\x6f\144\151\147\157\x20\x57\110\105\x52\105\x20\x61\x2e\x64\157\x63\165\155\145\156\164\x6f\75\x27{$a1}\47\40\x26\46\40\141\56\x74\x69\160\x6f\x64\157\x63\x3d\x27{$a2}\x27\x20\x26\x26\x20\x62\56\143\156\164\144\x65\166\165\x65\154\164\x3e\60\x20\46\x26\40\141\x2e\164\151\x70\157\144\x6f\143\75\47\x4e\117\124\x27\x3b")->result(); $tot = 0; $totsiva = 0; $totimp = 0; $baseimp = 0; $totcosto = 0; $sinimp = 0; ${$totdesc} = 0; $user = $this->session->userdata("\x63\x6f\144"); $num1 = $this->db->query("\123\x45\x4c\105\x43\124\x20\115\x41\130\x28\144\157\143\x75\155\145\156\x74\x6f\51\x2b\61\40\x6e\40\106\x52\117\115\40\x64\145\x76\157\x6c\x74\x69\40\x57\x48\105\x52\x45\40\164\151\160\157\144\157\143\75\x27\x44\x45\x56\x27")->row(); $num1 = str_pad($num1->n, 8, "\60", STR_PAD_LEFT); $pid = $this->genecod(12); foreach ($bd as $dt) { $vend = $dt->vendedor; $rif = $dt->rif; $cli = $dt->codcliente; $nomcli = $dt->nombrecli; $dirr = $dt->direccion; $telf = $dt->telefonos; $diascred = $dt->diascred; $sector = $dt->sector; $antdoc = $dt->antdoc; $subcodigo = $dt->subcodigo; $fechacrea = $dt->fechacrea; $tot += $dt->tot; $totsiva += $dt->totsiva; $totimp += $dt->totimp; $baseimp += $dt->baseimp; $totcosto += $dt->totcosto; $sinimp += $dt->sinimp; $totdesc += $dt->totdesc; $devolmv = array("\x69\144\137\x65\155\x70\x72\x65\163\141" => "\x44\x4d\105\104\111\106", "\x61\147\145\156\143\151\141" => "\x30\x30\61", "\164\x69\160\x6f\144\157\x63" => "\x44\105\x56", "\144\157\143\165\x6d\x65\156\x74\157" => $num1, "\x67\x72\x75\x70\157" => $dt->grupo, "\157\162\x69\x67\x65\156" => "\61", "\143\x6f\144\x69\147\x6f" => $dt->codigo, "\160\x69\144" => '' . $pid . '', "\x6e\157\155\142\162\145" => $dt->nombre, "\x63\157\x73\x74\x6f\x75\x6e\151\x74" => $dt->totcosto, "\160\162\145\x63\151\157\x75\156\151\164" => $dt->preciounit, "\x64\163\143\x74\x6f\x75\156\151\164" => $dt->dsctounit, "\x64\163\x63\x74\157\x70\162\143" => $dt->dsctoprc, "\160\162\145\143\151\x6f\146\151\x6e" => $dt->preciofin, "\160\162\145\143\x69\x6f\x6f\162\151\147" => $dt->preciooriginal, "\x63\x61\156\164\x69\144\x61\144" => $dt->cntdevuelt, "\x63\x6e\x74\x64\145\x76\x75\145\154\x74" => $dt->cntdevuelt, "\x6d\157\156\164\157\156\x65\x74\x6f" => $dt->totsiva, "\155\157\156\x74\x6f\x74\157\x74\x61\154" => $dt->tot, "\164\151\x6d\x70\x75\145\x70\x72\x63" => $dt->impuesto1, "\x61\154\155\141\143\145\156" => $dt->almacen, "\160\162\x6f\x76\145\x65\x64\157\162" => $dt->proveedor, "\x66\145\x63\150\x61\x64\x6f\x63" => '' . date("\131\x2d\155\x2d\x64") . '', "\x69\x6d\x70\x75\x65\163\164\157\x31" => "\60", "\151\155\160\165\145\x73\164\157\x32" => "\60", "\x76\145\x6e\x64\x65\144\157\x72" => '' . $dt->vendedor . '', "\145\155\151\163\157\162" => $user, "\165\x73\x61\163\145\162\151\141\154" => "\x32", "\164\x69\x70\157\160\x72\x65\143\x69\157" => "\61", "\x75\156\151\x64\x61\144" => "\x55\x4e\104", "\141\147\x72\x75\160\141\144\157" => "\x32", "\x63\157\155\x70\165\145\163\x74\x6f" => "\x32", "\x75\163\141\145\170\151\163\164" => "\61", "\141\x75\170\61" => "\x31", "\x65\163\164\x61\x63\x69\x6f\x6e" => "\x30\x30\61", "\165\x64\x69\x6e\141\x6d\151\143\141" => "\61", "\x62\x61\163\145\x69\155\x70\x6f\61" => $dt->baseimp, "\x62\x61\163\145\151\155\x70\157\62" => "\60", "\x6c\157\x74\x65" => $dt->lote); $this->db->insert("\x64\x65\x76\x6f\x6c\x6d\x76", $devolmv); } $devolti = array("\x69\144\137\145\155\160\x72\x65\163\141" => "\x44\x4d\x45\x44\x49\106", "\x61\147\x65\x6e\143\151\x61" => "\60\60\61", "\x74\x69\160\157\144\x6f\x63" => "\x44\105\126", "\155\157\156\x65\144\141" => "\60\x30\60", "\144\x6f\143\165\155\145\x6e\164\157" => $num1, "\x63\x6f\x64\143\154\151\145\x6e\x74\x65" => $cli, "\156\x6f\155\142\162\x65\x63\x6c\x69" => $nomcli, "\x63\x6f\x6e\x74\x61\143\x74\157" => "\x4e\x2f\101", "\162\151\146" => $rif, "\144\x69\162\145\143\143\151\x6f\x6e" => $dirr, "\164\145\x6c\145\146\157\156\x6f\163" => $telf, "\x74\151\x70\157\x70\x72\145\143\x69\x6f" => "\61", "\x65\155\151\163\151\157\x6e" => '' . date("\x59\55\155\x2d\x64") . '', "\162\145\x63\145\160\143\x69\x6f\156" => date("\x59\x2d\155\x2d\x64"), "\x76\145\156\x63\145" => date("\131\55\155\x2d\144"), "\146\x65\x63\x68\141\x63\x72\145\x61" => date("\131\x2d\155\55\x64"), "\164\157\164\x63\x6f\163\x74\x6f" => $totcosto, "\x74\x6f\164\142\162\165\x74\157" => $totsiva, "\164\157\x74\x6e\145\x74\x6f" => $totsiva, "\164\x6f\x74\141\154\x66\x69\156\x61\x6c" => '' . $tot . '', "\164\x6f\x74\151\155\160\x75\x65\x73\x74" => $totimp, "\x74\x6f\164\144\x65\163\143\x75\145\x6e" => $totdesc, "\x69\x6d\160\x75\145\x73\x74\157\61" => "\x30", "\151\155\160\x75\145\x73\164\x6f\x32" => "\x30", "\144\151\x61\163\x63\x72\145\144" => $diascred, "\166\x65\x6e\x64\145\144\157\162" => '' . $vend . '', "\146\141\x63\164\x6f\162\143\141\x6d\142" => "\x31", "\165\x65\155\151\163\157\162" => '' . $vend . '', "\x65\163\x74\x61\143\x69\x6f\x6e" => "\60\60\x31", "\163\151\x6e\x69\x6d\x70\165\145\x73\x74" => $sinimp, "\x61\x6c\x6d\141\143\145\156" => "\60\62", "\x73\145\x63\164\157\162" => '' . $sector . '', "\146\157\162\x6d\x61\x66\x69\163" => "\61", "\141\x6c\137\154\x69\x62\x72\157" => "\61", "\144\142\x63\162" => "\61", "\150\157\162\141\x64\x6f\x63\x75\x6d" => '' . date("\110\72\151\x3a\x73") . '', "\141\x6d\x70\155" => "\62", "\145\163\x63\162\x65\x64\x69\x74\x6f" => "\61", "\x62\x61\163\x65\x69\155\160\x6f\x31" => $baseimp, "\146\x65\143\150\141\171\x68\157\x72\141" => '' . date("\131\x2d\155\x2d\144\40\x48\x3a\x69\72\x73") . '', "\162\145\146\x65\162\145\x6e\143\x69\141" => $a2 . $a1); $this->db->insert("\x64\x65\x76\157\x6c\164\151", $devolti); $this->db->query("\x55\x50\x44\101\x54\105\40\x6f\x70\x65\162\155\166\40\141\40\123\105\124\40\141\x2e\x63\x6e\x74\x64\x65\x76\165\145\x6c\164\x20\x3d\40\x49\106\x28\50\x53\x45\114\105\103\124\x20\x53\125\115\50\x61\x31\x2e\143\156\x74\144\145\166\165\145\154\x74\x29\x20\106\x52\x4f\115\x20\x64\145\x76\157\x6c\x6d\166\40\x61\x31\40\112\117\x49\x4e\40\144\145\166\157\x6c\164\151\40\142\x31\40\117\x4e\x20\x61\x31\x2e\144\x6f\143\165\155\145\x6e\164\x6f\75\x62\x31\x2e\x64\157\143\x75\155\x65\x6e\x74\x6f\40\127\110\105\122\x45\40\x62\61\56\162\145\146\145\162\x65\156\x63\x69\x61\75\x43\117\x4e\103\x41\x54\x28\x61\x2e\164\x69\x70\x6f\144\157\143\54\x61\x2e\x64\157\x63\x75\155\x65\x6e\x74\157\51\40\46\x26\40\141\61\x2e\x61\154\155\141\143\145\x6e\x3d\141\x2e\141\154\155\x61\143\145\x6e\40\x26\46\40\x61\61\x2e\x63\157\144\x69\x67\x6f\x3d\x61\x2e\143\157\144\x69\x67\x6f\40\46\x26\x20\x61\61\x2e\x6c\157\164\145\75\x61\x2e\x6c\x6f\164\145\x29\x20\x3e\x30\54\12\40\40\x20\x20\40\x20\40\40\50\x53\105\x4c\x45\x43\124\x20\123\x55\115\x28\x61\x31\56\x63\156\164\144\145\x76\165\x65\154\164\51\40\x46\x52\x4f\115\40\144\145\x76\157\x6c\x6d\166\40\x61\61\x20\x4a\117\111\x4e\x20\144\x65\166\x6f\154\x74\x69\40\142\x31\40\117\x4e\40\x61\61\56\144\157\143\165\x6d\x65\x6e\164\x6f\75\x62\x31\56\x64\157\x63\x75\155\145\156\x74\x6f\40\x57\x48\105\x52\105\x20\40\x62\61\x2e\x72\145\146\145\162\145\x6e\143\x69\141\75\x43\117\116\x43\x41\x54\x28\x61\x2e\164\x69\x70\157\144\x6f\143\54\x61\56\x64\x6f\x63\165\155\145\156\x74\x6f\x29\40\x26\46\40\x61\x31\x2e\x61\154\x6d\141\143\x65\156\75\141\56\x61\x6c\155\141\x63\x65\x6e\40\x26\46\40\x61\x31\x2e\143\157\x64\x69\x67\x6f\75\141\x2e\x63\157\144\151\x67\x6f\x20\x26\46\x20\x61\61\56\154\157\164\x65\x3d\x61\56\x6c\157\164\x65\51\x20\x2c\60\51\12\x20\x20\40\40\40\x20\x20\40\127\110\x45\x52\x45\x20\x61\x2e\164\x69\x70\157\x64\157\x63\75\x27{$a2}\47\40\46\46\x20\144\157\143\x75\155\x65\156\164\157\75\x27{$a1}\x27"); $this->db->query("\x55\x50\x44\101\124\105\40\x64\x65\166\x6f\x6c\155\x76\40\x61\40\x53\x45\x54\x20\x61\x2e\143\x6e\164\x64\145\x76\x75\x65\154\164\75\141\56\x63\141\x6e\164\x69\x64\x61\x64\40\127\x48\x45\x52\105\x20\141\56\x63\x6e\x74\144\x65\x76\x75\x65\154\164\x3e\40\141\x2e\143\x61\156\x74\x69\144\x61\144\x3b"); $this->db->query("\x55\x50\x44\x41\x54\x45\40\157\x70\x65\x72\155\x76\40\x61\40\123\x45\x54\x20\141\x2e\143\x6e\164\x64\x65\166\165\145\154\164\75\141\56\143\x61\156\164\151\144\141\x64\40\127\x48\105\x52\x45\40\141\56\x63\156\x74\144\x65\x76\165\x65\x6c\164\76\x20\141\56\x63\x61\x6e\x74\x69\144\x61\x64\73"); $this->loguser("\x44\x65\166\157\154\x75\x63\x69\x6f\x6e\40\120\x61\x72\x63\x69\141\x6c", "\105\x6c\40\x75\x73\x75\141\162\x69\157\40\141\x20\144\145\166\165\x65\x6c\x74\x6f\x20\154\x6f\x73\40\x69\164\x65\155\40\160\141\162\x61\x20\154\x61\x20\156\x6f\164\x61\x20" . $a1 . "\x2c\x20\143\157\155\160\162\x6f\x62\141\156\x74\145\x20\104\x45\126" . $num1 . ''); } function notnotacred2($doc, $tipodoc) { $val = $this->db->query("\123\105\114\x45\x43\124\40\x4e\x55\x4c\114\40\x46\x52\x4f\x4d\40\x64\145\x76\157\154\164\x69\40\127\x48\105\122\105\x20\x72\x65\x66\145\x72\145\x6e\x63\151\141\x3d\x27" . $tipodoc . $doc . "\x27\40\46\46\40\164\151\x70\157\144\157\143\75\47\104\x45\x56\47")->num_rows(); if ($val == 0) { $num2 = $this->db->query("\x53\x45\x4c\105\103\124\x20\111\106\50\115\x41\130\x28\x64\x6f\x63\x75\x6d\145\156\x74\157\x29\53\x31\x3e\x30\54\x4d\x41\130\x28\144\x6f\x63\165\155\x65\x6e\x74\x6f\x29\53\61\x2c\x31\x29\40\156\x20\x46\122\x4f\x4d\x20\x64\x65\x76\x6f\x6c\164\x69\40\127\110\x45\122\105\40\164\151\x70\157\144\157\143\75\x27\x44\x45\126\x27")->row(); $newdoc2 = str_pad($num2->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $fac = $this->db->query("\123\105\x4c\x45\x43\124\x20\x2a\x20\x46\x52\117\x4d\40\x6f\x70\145\x72\164\x69\x20\127\110\105\122\x45\x20\x64\x6f\x63\165\155\x65\156\x74\157\x3d\47{$doc}\47\x20\x26\x26\x20\164\x69\x70\157\x64\157\143\x3d\x27{$tipodoc}\x27")->row(); $bd = $this->db->query("\x53\105\x4c\105\103\x54\40\x2a\x20\x46\x52\117\115\x20\157\x70\145\x72\x6d\166\x20\127\x48\x45\122\x45\x20\144\157\x63\165\x6d\145\156\164\x6f\x3d\x27{$doc}\47\x20\x26\46\40\164\x69\160\157\x64\x6f\x63\75\47{$tipodoc}\47")->result(); $devolti = array("\151\144\x5f\145\x6d\x70\x72\x65\163\141" => "\x44\x4d\x45\104\111\x46", "\x61\147\x65\156\143\x69\141" => "\60\x30\x31", "\164\x69\x70\x6f\x64\157\143" => "\104\x45\x56", "\155\157\156\145\x64\x61" => "\60\x30\x30", "\144\x6f\143\x75\155\x65\156\x74\157" => $newdoc2, "\x63\x6f\144\x63\x6c\151\x65\156\x74\145" => $fac->codcliente, "\x6e\x6f\x6d\x62\162\145\143\154\151" => $fac->nombrecli, "\143\157\x6e\164\141\143\x74\157" => "\116\x2f\x41", "\x72\x69\x66" => $fac->rif, "\x64\151\x72\145\x63\x63\151\157\x6e" => $fac->direccion, "\x74\x65\x6c\x65\x66\157\x6e\x6f\163" => $fac->telefonos, "\x74\151\160\x6f\x70\162\x65\143\151\x6f" => "\61", "\x65\155\151\163\151\157\x6e" => '' . date("\131\x2d\155\x2d\x64") . '', "\162\x65\143\145\x70\x63\x69\157\x6e" => date("\131\55\155\55\144"), "\166\145\156\143\x65" => date("\131\55\155\55\144"), "\x66\x65\x63\150\x61\143\162\145\x61" => date("\x59\55\155\55\x64"), "\x74\x6f\164\143\157\x73\164\157" => $fac->totcosto, "\164\157\164\x62\162\165\x74\x6f" => $fac->totbruto, "\164\157\164\x6e\x65\164\157" => $fac->totneto, "\x74\157\x74\141\x6c\x66\x69\156\x61\154" => $fac->totalfinal, "\x74\x6f\164\151\x6d\x70\x75\145\x73\x74" => $fac->totimpuest, "\x74\x6f\164\x64\145\163\x63\x75\145\156" => $fac->totdescuen, "\x69\155\160\x75\145\163\x74\x6f\x31" => "\x30", "\151\155\x70\165\145\x73\164\x6f\62" => "\x30", "\144\151\x61\x73\143\162\145\144" => $fac->diascred, "\x76\145\156\x64\145\x64\157\x72" => $fac->vendedor, "\x66\141\x63\164\157\162\143\141\155\142" => "\x31", "\165\x65\155\151\x73\x6f\162" => $fac->uemisor, "\145\163\x74\141\x63\151\x6f\x6e" => "\60\60\61", "\x73\151\156\151\155\160\x75\x65\x73\x74" => $fac->sinimpuest, "\141\154\155\x61\143\145\x6e" => "\x30\62", "\x73\x65\143\x74\x6f\x72" => $fac->sector, "\146\x6f\162\x6d\141\x66\x69\x73" => "\61", "\x61\x6c\x5f\x6c\151\142\x72\157" => "\x31", "\144\x62\143\x72" => "\x31", "\150\157\x72\141\x64\157\x63\x75\x6d" => '' . date("\x48\x3a\151\72\163") . '', "\x61\155\x70\x6d" => "\62", "\x65\x73\x63\x72\x65\144\x69\x74\x6f" => "\61", "\142\141\x73\145\x69\155\160\157\61" => $fac->baseimpo1, "\146\x65\x63\150\141\x79\x68\x6f\x72\141" => '' . date("\131\x2d\155\x2d\144\x20\x48\72\151\72\x73") . '', "\162\x65\146\x65\x72\145\x6e\143\151\141" => $tipodoc . $doc); $this->db->insert("\144\145\166\x6f\x6c\164\x69", $devolti); $v = $this->db->affected_rows(); foreach ($bd as $dtped) { $devolmv = array("\x69\144\x5f\x65\x6d\x70\x72\x65\x73\141" => "\x44\115\105\104\111\x46", "\141\147\145\156\143\151\x61" => "\60\60\61", "\x74\x69\x70\x6f\x64\x6f\143" => "\x44\105\x56", "\x64\157\143\x75\x6d\145\156\164\157" => $newdoc2, "\x67\162\x75\160\x6f" => $dtped->grupo, "\157\162\151\x67\145\x6e" => "\x31", "\x63\157\x64\x69\147\157" => $dtped->codigo, "\160\x69\144" => '' . $pid . '', "\156\x6f\155\x62\x72\145" => $dtped->nombre, "\x63\157\x73\164\x6f\165\156\x69\x74" => $dtped->costounit, "\x70\162\145\x63\151\x6f\165\156\151\x74" => $dtped->preciounit, "\x64\163\143\x74\x6f\165\x6e\151\164" => $dtped->dsctounit, "\144\x73\x63\164\x6f\x70\x72\143" => $dtped->dsctoprc, "\x70\162\x65\143\151\157\x66\151\x6e" => $dtped->preciofin, "\x70\x72\x65\143\x69\x6f\x6f\162\x69\147" => $dtped->preciooriginal, "\143\x61\x6e\x74\x69\144\x61\x64" => $dtped->cantidad, "\143\x6e\164\x64\x65\166\165\145\x6c\x74" => $dtped->cantidad, "\x6d\x6f\156\x74\x6f\x6e\x65\164\x6f" => $dtped->montoneto, "\x6d\x6f\x6e\x74\157\x74\x6f\x74\x61\x6c" => $dtped->montototal, "\164\151\155\160\165\x65\x70\162\x63" => $dtped->timpueprc, "\x61\154\155\141\x63\x65\156" => $dtped->almacen, "\x70\162\157\166\145\x65\x64\157\x72" => $dtped->proveedor, "\146\x65\x63\x68\x61\144\157\143" => '' . date("\131\x2d\155\x2d\144") . '', "\151\x6d\x70\x75\x65\x73\164\157\x31" => "\x30", "\151\155\160\165\145\163\164\x6f\62" => "\x30", "\x76\145\x6e\x64\x65\144\157\162" => '' . $dtped->vendedor . '', "\x65\x6d\151\x73\157\162" => "\106\101\103\124\125\122\101\x44", "\165\163\x61\163\145\162\151\x61\154" => "\x32", "\x74\151\x70\x6f\160\x72\145\x63\151\157" => "\x31", "\165\156\151\x64\141\144" => "\125\116\104", "\141\147\x72\x75\160\141\144\x6f" => "\62", "\143\x6f\x6d\160\x75\145\x73\164\157" => "\x32", "\x75\x73\141\145\170\151\163\164" => "\x31", "\x61\165\x78\61" => "\61", "\145\163\164\x61\143\151\157\156" => "\x30\x30\x31", "\x75\x64\x69\156\141\x6d\x69\143\141" => "\x31", "\x62\x61\163\x65\x69\155\160\157\x31" => $dtped->baseimpo1, "\142\141\x73\x65\x69\x6d\160\157\x32" => "\60", "\x6c\x6f\x74\x65" => $dtped->lote); $this->db->insert("\x64\x65\x76\157\154\x6d\x76", $devolmv); } if ($v > 0) { $this->db->query("\125\x50\x44\x41\x54\x45\40\x6f\x70\145\x72\164\151\x20\x73\x65\x74\x20\x65\163\x74\141\164\x75\x73\144\x6f\143\75\x27\x58\47\x20\127\x48\105\x52\x45\40\x64\157\x63\165\155\x65\x6e\164\157\x3d\47{$doc}\x27\x20\x26\x26\40\x74\151\160\x6f\144\x6f\143\x3d\x27\x4e\117\124\x27"); $this->db->query("\x55\120\104\101\x54\x45\x20\157\x70\145\162\x6d\x76\40\x53\x45\x54\x20\143\x6e\x74\x64\145\x76\x75\145\x6c\164\x3d\143\x61\156\x74\151\x64\141\x64\40\127\110\x45\122\x45\x20\144\157\x63\165\155\x65\x6e\x74\157\x3d\47{$doc}\47\40\x26\46\40\164\151\x70\157\144\x6f\x63\x3d\47\x4e\x4f\x54\x27"); $this->loguser("\x44\x65\166\157\x6c\x75\x63\x69\157\156\x20\124\x6f\164\x61\x6c", "\x45\x6c\x20\x75\x73\x75\x61\162\x69\157\40\141\40\144\x65\166\x75\145\154\x74\157\40\154\141\x20\x6e\x6f\164\x61\x20\144\145\40\145\x6e\x74\x72\145\147\x61\40" . $doc . "\54\x20\x63\x6f\155\x70\162\x6f\142\141\156\x74\145\40\x44\x45\126" . $newdoc2 . ''); } return $this->db->affected_rows(); } } public function cobranza($a, $b) { $this->conciliabanc(); $this->load->library("\x74\x61\x62\154\x65"); if ($b != '') { $filter = "\46\46\x20\50\141\56\144\x6f\143\x75\155\x65\156\164\x6f\x3d\x27{$b}\x27\x20\x7c\174\40\141\56\143\157\x64\x63\x6c\151\145\156\164\145\75\x27{$b}\x27\x20\174\174\x20\x61\56\156\x6f\x6d\142\x72\145\x63\x6c\x69\x20\114\x49\x4b\105\x20\47\45{$b}\45\47\40\x7c\x7c\x20\141\x2e\166\x65\x6e\144\145\x64\157\162\40\x6c\151\153\145\40\x27\45{$b}\45\x27\x29"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\114\105\103\x54\40\116\125\114\114\12\x20\40\x20\40\x20\x20\x20\x46\122\117\x4d\x20\157\x70\145\x72\x74\151\x20\x61\12\40\40\40\40\x20\x20\40\x4a\117\x49\116\40\143\157\156\x74\162\x6f\154\137\157\160\145\x72\x74\x69\x20\142\40\x4f\116\40\141\x2e\141\156\x74\144\157\143\75\x62\56\144\x6f\x63\12\40\40\40\40\x20\40\40\127\x48\105\x52\x45\x20\50\141\x2e\164\x69\160\157\144\x6f\x63\75\x27\106\101\x43\47\x20\174\174\40\50\x61\x2e\164\151\160\157\144\157\x63\75\x27\x4e\x4f\x54\47\x20\x26\x26\40\x61\56\145\163\164\141\x74\x75\x73\x64\x6f\x63\41\75\47\x58\47\51\51\40{$filter}\40\46\x26\40\x61\56\164\x6f\164\x61\154\x64\76\60\xa\40\x20\40\40\40\x20\x20\x47\122\117\125\120\x20\102\x59\40\x61\56\x63\x6f\144\143\x6c\151\x65\x6e\164\145")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\x4c\x45\103\x54\40\141\x2e\143\x6f\144\143\154\x69\145\x6e\x74\145\54\122\x4f\125\x4e\x44\x28\x49\x46\x28\123\125\x4d\x28\x61\x2e\164\x6f\164\141\x6c\144\51\x3e\x30\x2c\40\123\x55\x4d\x28\x61\56\x74\157\x74\141\x6c\144\51\54\60\x29\54\x32\x29\x20\x64\x6f\x6c\141\x72\40\106\x52\x4f\x4d\40\157\x70\x65\x72\164\151\40\141\xa\40\40\40\x20\x4a\117\111\116\x20\143\157\x6e\x74\162\157\154\137\157\160\x65\x72\x74\x69\40\x62\x20\117\x4e\40\x61\56\x61\156\164\x64\157\x63\75\142\x2e\x64\157\143\12\x20\x20\40\x20\x57\110\105\x52\105\40\x28\x61\56\x74\151\x70\x6f\144\x6f\x63\x3d\47\106\x41\x43\x27\x20\174\174\40\x28\x61\56\x74\151\160\x6f\144\x6f\143\x3d\47\x4e\117\124\47\40\x26\x26\40\141\x2e\x65\163\164\141\x74\x75\x73\x64\157\143\x21\x3d\x27\x58\x27\51\51\x20{$filter}\xa\x20\40\40\40\x47\122\117\x55\x50\x20\102\131\40\x61\x2e\143\157\x64\143\154\x69\145\156\164\145\x20\x4f\x52\x44\105\x52\40\102\131\40\x64\157\x6c\141\x72\40\104\x45\123\x43\x20\x20\114\x49\115\111\124\40" . ($a - 1) * $mostrar . "\x20\x2c\40" . $mostrar . '')->result(); $html = "\xa\x20\40\40\40\x3c\x74\141\x62\x6c\145\x20\x63\154\x61\x73\x73\75\x22\167\63\x2d\164\x61\142\x6c\145\55\x61\x6c\154\40\167\x33\x2d\150\x6f\x76\145\162\x61\x62\x6c\x65\40\167\x33\x2d\x6c\x65\x66\x74\55\141\154\151\147\x6e\x22\x3e\xa\40\x20\x20\x20\x3c\x74\x72\x3e\x3c\x74\144\40\x63\x6c\x61\163\x73\75\42\x77\x33\55\x66\157\x6e\144\x6f\144\162\x6f\151\144\42\76\102\165\x73\x63\141\162\40\74\151\155\x67\x20\163\162\x63\75\x22" . base_url() . "\151\x6d\x61\x67\x65\x73\x2f\142\165\x73\143\x61\x72\56\160\156\x67\42\40\141\x6c\164\x3d\42\x42\x75\163\x63\141\x72\x22\x20\x74\x69\164\x6c\x65\75\42\x42\x75\x73\x63\x61\x72\x22\40\x73\164\171\154\x65\75\42\167\151\x64\164\x68\x3a\61\x38\160\x78\73\142\157\162\x64\x65\162\x3a\60\x3b\42\x3e\x3c\x2f\x74\144\76\12\40\x20\40\x20\x3c\x74\x64\76\x3c\x69\156\x70\x75\164\x20\x74\171\x70\x65\75\42\x74\x65\170\x74\x22\40\x63\x6c\141\163\x73\x3d\42\x77\63\x2d\x69\156\x70\165\164\x22\x20\160\x6c\141\143\x65\150\x6f\154\x64\x65\x72\75\x22\x49\x6e\x67\x72\145\x73\x65\x20\x73\x75\x20\142\x75\163\x71\x75\x65\x64\141\x22\x20\157\x6e\x63\150\x61\x6e\x67\x65\75\x22\143\157\142\162\x61\156\172\141\50\x29\x3b\42\x20\151\x64\75\x22\x6c\x69\x6b\x65\x66\x61\x63\42\x3e\74\57\164\144\76\xa\x20\x20\x20\40\x3c\164\144\40\143\154\141\163\x73\75\x22\x77\63\x2d\x63\145\156\x74\x65\x72\40\x77\x33\x2d\142\x74\x6e\x22\x3e\x3c\141\x20\157\156\143\154\151\x63\153\75\42\163\x65\x6c\145\143\164\142\x61\156\143\157\163\50\x29\x3b\167\63\x2e\163\150\x6f\167\x28\x27\x23\x6d\x6f\x64\143\x61\162\x67\141\142\141\156\143\x27\51\x3b\42\x3e\x3c\151\155\x67\40\163\162\143\x3d\x22" . base_url() . "\151\x6d\x61\147\x65\x73\x2f\145\170\143\145\x6c\x2e\x70\156\x67\x22\x20\141\154\x74\x3d\42\103\x61\162\147\x61\162\x20\103\157\x6e\x73\x6f\x6c\x69\144\x61\x64\157\x22\x20\164\151\164\x6c\145\75\42\103\141\162\147\x61\162\x20\x43\157\156\x73\x6f\x6c\x69\x64\141\144\x6f\x22\x20\163\x74\171\154\x65\75\42\167\151\x64\164\x68\72\x31\x38\x70\170\73\150\x65\x69\x67\150\x74\72\61\70\x70\x78\73\142\157\x72\144\x65\x72\72\60\x3b\x22\76\74\x2f\x61\x3e\x3c\x2f\164\x64\76\12\x20\x20\40\40\74\x74\x64\40\x63\154\x61\163\163\x3d\42\x77\63\55\x63\x65\x6e\164\x65\x72\x20\167\x33\x2d\x62\164\156\42\x3e\74\x61\40\157\x6e\x63\x6c\x69\x63\153\75\42\x63\x75\x65\x6e\x74\141\x73\x63\x6c\151\50\51\x3b\42\76\74\x69\155\147\40\163\x72\143\75\42" . base_url() . "\151\x6d\x61\147\145\x73\x2f\146\x61\143\164\165\162\x61\x2e\x70\156\147\x22\x20\141\154\164\x3d\42\x45\x73\164\141\x64\157\x20\x43\165\x65\156\164\141\163\42\x20\x74\x69\x74\154\145\x3d\x22\x45\163\x74\141\x64\157\40\x43\x75\x65\156\x74\141\x73\x22\40\163\x74\171\154\145\75\42\x77\x69\144\164\x68\x3a\62\x30\160\x78\x3b\x68\x65\151\x67\150\164\x3a\62\60\160\x78\x3b\142\157\162\x64\x65\162\72\60\73\42\x3e\74\x2f\141\x3e\74\57\x74\x64\x3e\12\40\40\x20\x20\74\x74\x64\40\x63\x6c\141\x73\163\x3d\x22\x77\63\x2d\x63\145\156\x74\x65\162\40\x77\x33\x2d\x62\x74\156\42\x3e\74\141\40\x6f\156\x63\154\151\x63\x6b\75\x22\x72\145\x63\x70\141\147\x6f\x28\x29\73\42\76\x3c\151\x6d\x67\40\x73\x72\143\75\x22" . base_url() . "\151\x6d\x61\x67\x65\163\x2f\x72\145\x63\151\x62\157\x2e\160\156\147\x22\40\141\154\x74\x3d\x22\122\x65\x63\151\142\157\x20\120\141\x67\157\42\40\x74\151\164\154\145\75\42\122\145\x63\151\142\x6f\40\120\x61\147\x6f\x22\40\x73\x74\171\x6c\x65\75\x22\167\151\144\164\x68\72\x31\70\160\x78\73\x68\145\x69\147\x68\x74\x3a\61\x38\x70\170\73\x62\x6f\162\x64\x65\162\x3a\60\x3b\42\x3e\x3c\57\141\x3e\x3c\x2f\164\144\x3e\12\x20\40\x20\x20\74\164\x64\x20\143\154\141\x73\163\x3d\x22\167\63\55\x63\x65\x6e\164\145\162\x20\x77\x33\55\x62\x74\x6e\42\76\x3c\141\40\x6f\x6e\x63\154\151\x63\x6b\x3d\42\x72\145\164\x66\x61\x63\50\x29\x3b\x22\76\74\151\x6d\147\40\x73\162\143\75\42" . base_url() . "\151\155\x61\x67\x65\163\x2f\x72\145\164\145\156\143\151\157\x6e\145\x73\56\160\156\147\42\x20\x61\x6c\x74\75\x22\122\145\143\x69\142\x6f\40\x52\x65\x74\x65\156\143\x69\157\156\x22\40\x74\x69\164\x6c\145\x3d\x22\x52\x65\x63\x69\x62\157\x20\x52\145\x74\145\156\143\151\x6f\156\42\40\x73\164\171\x6c\x65\75\x22\x77\x69\x64\x74\150\72\61\70\160\x78\73\150\x65\151\147\x68\164\x3a\61\x38\x70\170\73\x62\x6f\x72\144\x65\162\x3a\x30\73\x22\x3e\x3c\x2f\x61\76\x3c\x2f\164\144\x3e\12\40\x20\x20\40\x3c\164\x64\x20\143\x6c\x61\163\x73\75\x22\x77\x33\55\143\x65\x6e\164\145\x72\x20\x77\63\x2d\x62\x74\156\42\x3e\74\141\x20\157\x6e\143\154\151\143\153\x3d\x22\x63\x6f\142\162\141\156\172\x61\50\51\x3b\x22\76\x3c\151\x6d\147\40\163\x72\x63\75\42" . base_url() . "\151\x6d\141\x67\145\163\57\162\145\154\157\x61\x64\56\160\x6e\147\42\40\141\x6c\x74\x3d\x22\x52\x65\143\141\162\x67\x61\x72\42\x20\x74\151\x74\x6c\x65\75\x22\122\x65\x63\x61\162\147\x61\162\42\x20\x73\164\x79\x6c\145\75\42\167\151\144\164\150\x3a\x32\60\x70\170\73\x68\145\x69\x67\x68\x74\72\62\x30\160\x78\x3b\142\x6f\x72\144\145\162\x3a\60\x3b\42\x3e\x3c\x2f\141\76\x3c\x2f\164\x64\76\x3c\x2f\x74\162\x3e\12\40\40\40\x20\74\x2f\x74\x61\142\x6c\145\76\74\142\x72\x3e\12\40\40\x20\x20\x3c\164\141\142\154\x65\x20\x69\x64\x3d\x22\x69\x64\60\61\x22\40\143\154\x61\163\x73\x3d\x22\167\63\55\164\141\142\154\145\x2d\x61\154\154\40\167\x33\55\x68\157\x76\x65\162\x61\142\154\145\40\x77\63\55\154\x65\x66\164\x2d\141\154\151\147\156\40\x77\63\x2d\164\x69\x6e\171\42\x3e\74\x74\162\40\x63\x6c\141\163\x73\75\42\167\63\x2d\x66\x6f\x6e\144\x6f\x64\162\x6f\151\x64\40\167\x33\55\x66\151\152\x6f\42\76\74\164\x68\76\x43\x6c\151\145\156\164\145\x3c\57\164\x68\x3e\74\x74\x68\x3e\x4e\x6f\155\142\x72\x65\x3c\57\x74\150\76\x3c\164\150\x3e\x54\x65\154\x66\74\x2f\164\x68\76\x3c\164\150\x3e\124\157\164\141\154\56\102\x73\74\57\164\x68\x3e\74\x74\150\x3e\124\x6f\x74\x61\x6c\x2e\44\74\x2f\164\x68\76\74\x74\150\x3e\120\x61\x67\141\144\157\x3c\57\x74\150\76\x3c\164\x68\76\x44\145\x62\145\74\57\x74\x68\76\x3c\164\150\76\105\163\x74\141\164\x75\163\x3c\x2f\x74\150\76\x3c\57\x74\x72\x3e"; $i = 0; $debe = 0; foreach ($bdfac as $dtfac2) { $i++; $dtfac = $this->db->query("\x53\x45\114\105\103\x54\x20\141\x2e\144\157\x63\x75\x6d\x65\x6e\164\x6f\x2c\x62\x2e\x64\x6f\x63\54\x61\56\x63\157\x64\x63\154\x69\x65\x6e\x74\x65\54\143\56\x6e\x6f\155\x62\162\x65\x2c\x49\x46\50\x63\x2e\x74\x65\154\145\146\157\156\x6f\163\41\75\x27\x27\54\x63\56\x74\x65\154\x65\x66\157\x6e\157\x73\54\x49\x46\50\143\56\x74\145\x6c\x65\146\157\x6e\157\x5f\155\157\x76\x69\154\41\x3d\x27\x27\x2c\143\56\164\145\x6c\145\146\x6f\x6e\x6f\137\x6d\x6f\x76\x69\154\x2c\x27\x4e\x2f\101\x27\51\x29\x20\164\x65\154\146\54\40\122\x4f\125\116\x44\x28\123\125\x4d\x28\141\x2e\164\x6f\x74\141\x6c\146\x69\156\141\154\x29\x2c\64\51\x20\164\x6f\164\141\154\146\x69\x6e\x61\x6c\x2c\xa\x20\x20\x20\40\122\117\125\x4e\104\50\122\117\x55\x4e\104\50\111\106\x28\123\125\115\50\141\x2e\x74\157\x74\x61\x6c\144\x29\76\60\x2c\40\123\x55\115\x28\141\56\164\x6f\164\141\x6c\x64\x29\54\x30\x29\54\x32\51\52\x49\x46\x28\142\x2e\x66\x65\x63\x68\x64\157\x6c\141\162\75\47\x30\60\60\60\x2d\x30\x30\x2d\60\60\47\x2c\x49\x46\50\x43\x55\x52\x44\x41\124\x45\50\51\x3c\75\x44\x41\x54\105\137\101\104\x44\50\x61\56\162\145\143\x65\x70\x63\x69\x6f\x6e\54\x49\x4e\124\x45\122\x56\101\114\x20\x61\56\144\151\141\x73\x69\x6e\144\x65\170\40\x44\x41\131\x29\x2c\50\123\105\x4c\105\103\x54\x20\x6f\x66\151\x63\151\141\154\40\x46\122\x4f\x4d\40\x6d\157\x6e\x65\x63\x61\155\x20\x57\x48\x45\x52\x45\40\146\145\143\x68\141\74\x3d\141\56\146\x65\143\x68\141\x63\162\145\141\40\117\122\104\x45\122\x20\x42\131\x20\146\x65\x63\150\141\x20\104\105\123\x43\40\x4c\111\115\x49\124\40\x31\x29\x2c\x28\123\x45\114\x45\x43\x54\x20\x6f\146\151\x63\151\141\154\x20\106\x52\x4f\x4d\x20\155\157\x6e\x65\x63\x61\155\40\117\x52\104\x45\122\40\x42\x59\40\x66\145\x63\150\x61\40\104\105\x53\x43\40\x4c\111\x4d\x49\124\x20\61\51\51\x2c\50\123\x45\x4c\105\103\124\x20\x6f\x66\x69\143\151\x61\x6c\x20\106\122\117\115\40\155\x6f\156\145\x63\141\155\x20\127\110\105\x52\105\x20\x66\x65\143\150\x61\74\x3d\142\x2e\x66\145\143\150\x64\x6f\154\x61\162\x20\x4f\x52\x44\105\x52\40\x42\x59\40\x66\x65\x63\x68\141\x20\104\x45\123\x43\x20\x4c\111\x4d\111\124\40\x31\51\51\54\62\51\40\x62\x73\x2c\x20\122\117\125\116\104\x28\111\106\x28\x53\x55\x4d\x28\x61\56\164\x6f\x74\x61\x6c\144\x29\76\x30\x2c\40\123\x55\115\50\x61\56\x74\157\x74\x61\x6c\144\51\x2c\60\x29\x2c\x32\51\40\144\x6f\x6c\141\x72\x2c\x20\12\40\40\40\40\x52\117\x55\116\104\x28\x28\x53\x45\x4c\x45\103\124\40\111\106\50\123\x55\x4d\x28\x62\61\x2e\155\157\156\x74\x6f\x29\x3e\60\x2c\40\x53\125\115\x28\142\x31\56\x6d\x6f\156\x74\157\51\54\60\51\40\142\163\40\106\x52\x4f\115\x20\x6f\x70\145\x72\164\151\x20\x61\61\x20\x4a\117\111\116\x20\x6f\x70\145\162\143\x6c\151\x20\142\x31\x20\117\x4e\40\141\x31\56\144\x6f\143\165\x6d\145\156\x74\x6f\75\142\x31\x2e\x69\x64\x66\x61\x63\x20\127\x48\105\122\105\x20\141\61\x2e\x63\x6f\x64\x63\x6c\151\x65\x6e\x74\145\75\141\x2e\143\x6f\x64\143\x6c\x69\145\156\x74\145\40\46\x26\40\x62\61\x2e\x69\x64\143\x6f\156\x73\x62\141\156\143\x20\111\123\40\x4e\117\124\x20\x4e\x55\114\x4c\40\x26\46\x20\x28\141\x31\56\164\x69\x70\157\144\157\143\75\47\106\101\x43\47\40\x7c\174\x20\141\61\56\164\x69\160\x6f\x64\157\x63\75\x27\116\117\124\47\51\x29\x2c\x32\x29\x20\160\142\x73\x2c\40\12\40\40\40\40\x52\117\x55\116\104\50\x28\x53\x45\x4c\x45\x43\x54\40\x49\106\x28\123\125\x4d\50\x62\61\56\155\157\x6e\x74\157\x64\x29\x3e\x30\x2c\x20\x53\125\115\x28\142\x31\x2e\155\157\x6e\164\157\144\x29\54\x30\51\x20\144\157\154\x61\162\x20\106\x52\x4f\x4d\40\157\x70\145\162\x74\151\x20\x61\x31\40\x4a\x4f\111\x4e\40\157\x70\x65\162\143\x6c\x69\40\142\x31\x20\117\x4e\40\x61\x31\x2e\x64\x6f\x63\x75\155\x65\156\x74\x6f\x3d\x62\x31\x2e\x69\144\x66\141\143\40\x57\110\x45\x52\105\x20\x61\x31\56\x63\x6f\x64\143\x6c\x69\145\156\x74\145\x3d\x61\56\143\x6f\x64\143\154\151\x65\x6e\164\x65\x20\46\46\x20\142\61\56\x69\x64\143\x6f\x6e\x73\x62\141\156\x63\40\111\123\40\116\117\124\x20\116\x55\114\x4c\x20\x26\46\40\x28\x61\x31\x2e\x74\151\x70\157\x64\157\x63\75\47\x46\101\x43\47\40\174\x7c\40\141\61\56\x74\151\160\157\144\157\x63\75\x27\x4e\117\x54\x27\x29\51\x2c\x32\x29\40\x70\144\x6f\154\x61\x72\x2c\12\x20\x20\x20\40\x49\x46\50\x62\x2e\146\x65\143\150\x64\x6f\x6c\141\x72\x3d\x27\x30\x30\x30\x30\x2d\x30\60\55\x30\60\47\54\x49\106\x28\103\x55\x52\x44\x41\x54\x45\50\x29\x3c\75\104\101\x54\105\x5f\101\x44\104\x28\x61\56\162\145\x63\x65\160\x63\151\157\156\x2c\111\116\x54\105\x52\126\101\114\x20\141\56\144\x69\141\163\151\156\144\145\x78\x20\x44\101\131\51\54\50\123\105\x4c\x45\103\x54\40\157\x66\151\x63\x69\x61\x6c\40\x46\x52\117\115\40\155\157\156\x65\x63\x61\155\x20\x57\110\105\x52\105\x20\x66\x65\x63\x68\141\x3c\75\141\x2e\x66\145\x63\x68\x61\143\162\x65\141\x20\117\122\104\105\122\40\x42\131\40\146\145\143\150\141\40\104\x45\x53\103\x20\x4c\111\x4d\x49\124\40\x31\51\x2c\50\123\x45\x4c\105\103\124\40\x6f\x66\151\143\151\x61\154\40\106\122\x4f\115\40\155\x6f\x6e\145\x63\141\155\x20\x4f\122\104\105\122\40\x42\131\x20\146\145\x63\x68\141\40\x44\105\123\103\x20\114\x49\x4d\111\x54\40\x31\51\x29\54\x49\x46\50\x62\56\x66\145\143\x68\x64\x6f\x6c\x61\x72\74\75\x44\101\124\x45\x5f\101\104\x44\x28\x61\56\x72\x65\143\x65\160\143\x69\x6f\x6e\x2c\111\x4e\x54\x45\122\x56\101\x4c\x20\x61\56\x64\x69\141\163\151\x6e\x64\x65\170\40\x44\x41\x59\51\54\x28\x53\105\x4c\105\103\124\40\157\146\x69\x63\x69\x61\x6c\40\106\x52\x4f\115\x20\155\x6f\x6e\x65\143\x61\x6d\40\x57\110\x45\x52\105\x20\146\x65\143\150\141\x3c\x3d\x61\56\146\x65\x63\150\x61\x63\x72\x65\141\40\117\122\104\x45\122\x20\102\131\x20\x66\145\x63\150\141\x20\x44\105\x53\103\40\x4c\x49\x4d\111\124\40\x31\x29\x2c\50\123\105\x4c\105\103\x54\x20\x6f\x66\151\143\x69\141\x6c\40\x46\122\x4f\115\x20\x6d\x6f\156\145\143\141\155\x20\127\110\105\x52\x45\40\x66\x65\143\150\x61\74\75\x62\x2e\x66\145\x63\x68\144\157\154\141\162\40\117\x52\x44\105\122\40\102\x59\40\x66\145\x63\150\141\40\x44\x45\x53\x43\40\x4c\x49\x4d\111\124\x20\61\x29\x29\x29\x20\164\x61\x73\x61\12\x20\x20\40\40\x46\x52\117\x4d\x20\157\160\x65\162\164\x69\40\x61\xa\x20\x20\40\40\112\117\111\x4e\40\x63\157\156\164\162\x6f\154\137\x6f\x70\x65\162\164\151\x20\142\40\x4f\x4e\x20\x61\56\x61\156\164\x64\x6f\x63\x3d\x62\56\x64\x6f\143\12\40\x20\x20\40\x4a\117\111\x4e\40\x63\x6c\x69\145\x6d\x70\162\145\x20\143\40\117\116\x20\x61\x2e\143\157\x64\143\154\151\145\x6e\164\145\x3d\143\56\x63\x6f\x64\151\x67\157\xa\x20\40\40\x20\127\110\105\x52\105\40\x28\141\56\x74\x69\x70\157\x64\x6f\x63\75\x27\x46\101\103\x27\40\174\x7c\40\x61\x2e\x74\x69\160\157\144\157\x63\75\47\x4e\117\x54\47\x29\x20\x26\46\40\141\56\143\157\x64\143\154\x69\145\156\x74\x65\x3d\x27{$dtfac2->codcliente}\x27")->row(); $nc = $this->db->query("\x53\105\114\x45\x43\x54\x20\x52\x4f\125\x4e\x44\50\123\125\115\50\141\56\x74\157\164\141\x6c\x64\51\x2c\x32\51\x20\x74\x6f\164\x61\154\x64\x20\x46\x52\117\x4d\x20\141\160\x6c\x69\143\x61\156\x63\40\x61\40\127\x48\105\x52\105\x20\x61\x2e\156\143\x20\x49\x4e\40\x28\123\105\114\x45\x43\x54\x20\x64\x6f\x63\x75\155\145\156\x74\x6f\40\x46\122\117\115\x20\157\160\x65\x72\164\151\x20\141\x20\127\x48\105\x52\105\40\141\56\143\x6f\144\143\x6c\151\145\x6e\x74\145\x3d\x27{$dtfac->codcliente}\47\x20\46\46\x20\x61\x2e\x74\151\160\157\x64\x6f\143\x3d\47\x4e\x2f\x43\x27\51")->row(); $ret = $this->db->query("\x53\105\x4c\105\103\124\40\122\117\125\x4e\x44\50\123\x55\x4d\50\x61\x2e\164\x6f\164\141\154\x66\151\x6e\141\154\x2f\x28\123\x45\114\x45\x43\124\40\157\x66\151\x63\151\141\x6c\x20\x46\122\117\x4d\40\x6d\157\x6e\x65\143\141\155\x20\127\110\105\x52\x45\x20\x66\145\x63\x68\141\74\x3d\x61\x2e\146\x65\143\150\141\143\x72\x65\141\x20\x4f\x52\x44\105\122\x20\102\x59\x20\146\x65\143\x68\141\x20\104\105\x53\103\40\114\111\x4d\111\124\40\x31\x29\51\x2c\x32\51\40\164\157\164\x61\x6c\144\x20\106\x52\x4f\x4d\x20\157\x70\145\x72\164\151\x20\x61\x20\x57\110\105\x52\105\x20\x61\56\x63\157\x64\143\154\151\x65\156\164\x65\x3d\x27{$dtfac->codcliente}\x27\x20\46\x26\40\x61\x2e\164\151\160\157\x64\x6f\143\75\x27\122\105\124\x27")->row(); $debe = ROUND($dtfac->dolar - $nc->totald - $ret->totald - $dtfac->pdolar, 2); $monto = ROUND($debe * $dtfac->tasa, 2); $html .= "\74\164\x72\x20\x69\x64\75\x22\x73\154\145\x63\x74" . $i . "\42\x20\143\x6c\141\163\x73\75\42\151\164\145\x6d\x22\x3e"; if ($debe <= 3) { $status = "\114\151\x73\164\x6f"; $color = "\167\x33\55\x67\x72\x65\x65\156"; } else { $status = "\120\145\x6e\144\x69\x65\156\164\145"; $color = "\x77\63\55\x72\x65\144"; } $html .= "\74\x69\x6e\160\x75\164\40\x74\x79\160\145\75\42\150\151\144\144\145\x6e\42\40\151\x64\75\42\141" . $i . "\42\x20\156\141\155\x65\x3d\42\144\157\143\42\40\166\141\154\x75\x65\x3d\x22" . $dtfac->codcliente . "\42\x3e\12\40\x20\40\40\40\40\x20\x3c\x74\144\76\x3c\151\156\160\165\164\x20\x74\x79\x70\145\x3d\x22\x63\150\145\x63\x6b\x62\x6f\170\42\40\x6f\x6e\x63\x6c\151\x63\x6b\75\42\x77\x33\x2e\164\157\x67\x67\x6c\x65\103\154\141\163\x73\50\47\43\x73\154\145\143\x74" . $i . "\x27\x2c\47\x77\63\55\171\145\154\154\x6f\167\x27\x29\73\x22\40\x63\x6c\141\163\x73\75\42\167\63\55\x63\150\x65\143\x6b\42\40\x6e\x61\x6d\x65\x3d\x22\143\x68\145\143\153\x63\154\151\x22\x3e" . $dtfac->codcliente . "\x3c\x2f\164\144\76\x3c\164\x64\76" . $dtfac->nombre . "\x3c\57\164\144\76\74\164\x64\x3e" . $dtfac->telf . "\74\x2f\x74\x64\x3e\x3c\164\x64\x3e\x3c\x62\x3e\x41\156\164\72\40\x3c\x2f\x62\76" . $dtfac->totalfinal . "\40\x3c\x62\76\x44\145\163\x70\x3a\40\x3c\x2f\x62\76" . $dtfac->bs . "\74\57\164\144\76\x3c\x74\144\76\x3c\142\x3e\124\117\124\x3a\x20\74\x2f\x62\x3e" . $dtfac->dolar . "\40\74\x62\x3e\x4e\57\x43\x3a\40\x3c\x2f\x62\x3e" . $nc->totald . "\x20\x3c\x62\76\x52\x45\x54\x3a\40\x3c\x2f\x62\76" . $ret->totald . "\74\57\164\x64\x3e\x3c\x74\144\x3e" . $dtfac->pbs . "\x20\74\142\76\102\163\74\x2f\142\76\x20" . $dtfac->pdolar . "\40\x3c\x62\x3e\x24\x3c\x2f\x62\76\74\57\x74\144\76\x3c\164\144\x3e" . $monto . "\40\74\142\x3e\102\x73\74\x2f\142\76\x20" . $debe . "\x20\74\x62\76\x24\x3c\57\x62\x3e\74\x2f\x74\x64\76\x3c\164\x64\40\x63\154\x61\x73\163\x3d\42" . $color . "\x22\40\157\156\x63\154\151\x63\x6b\x3d\42\x69\164\x63\157\142\x72\x6f\50\x24\50\47\x23\141" . $i . "\x27\51\56\x76\x61\154\50\x29\51\73\42\40\163\x74\x79\154\x65\75\42\x63\x75\162\163\x6f\x72\x3a\160\157\x69\x6e\164\x65\x72\42\76" . $status . "\74\57\x74\144\x3e\12\x20\40\x20\x20\40\40\x20\x20\x3c\57\164\162\76"; } $html .= "\74\x21\55\55\x3c\164\x72\76\x3c\164\x64\40\x63\x6c\x61\x73\163\x3d\42\x77\63\55\x63\x65\x6e\164\145\162\40\167\63\x2d\146\157\156\x64\157\144\162\x6f\x69\144\x22\40\143\x6f\x6c\163\x70\x61\156\75\x22\61\61\x22\76\x3c\154\x61\x62\x65\x6c\x20\x63\154\141\163\163\75\x22\x77\63\x2d\154\x61\162\x67\145\42\x3e\74\x62\x3e\124\157\x74\141\154\x20\125\156\151\144\141\144\145\x73\72\x20" . $totalreg . "\x3c\x2f\x62\x3e\74\57\x6c\141\142\145\154\76\x3c\x2f\x74\x64\76\74\x2f\164\162\x3e\x2d\x2d\76\x3c\x2f\x74\x61\142\154\145\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\40\x20\40\x20\x20\x20\x20\x3c\x73\x63\x72\x69\160\164\40\x74\171\160\145\75\42\x74\x65\x78\164\x2f\152\x61\166\141\163\143\x72\x69\x70\x74\x22\x3e\xa\40\x20\40\x20\x20\40\40\x20\x66\165\x6e\x63\164\151\157\156\40\x44\x65\x63\x72\145\155\145\x6e\x74\116\x75\155\143\x7a\141\50\x29\x7b\x20\142\x65\146\157\x72\x65\50\x29\73\xa\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\166\141\162\x20\x44\x65\x63\162\x65\155\145\156\x74\116\x75\x6d\x3d\x64\157\x63\x75\155\145\156\164\x2e\x67\x65\x74\105\154\x65\155\x65\x6e\x74\x42\171\x49\x64\x28\42\x44\x65\x63\x72\x65\x6d\145\156\x74\116\165\155\x22\x29\56\x76\141\x6c\165\145\73\12\x20\40\40\x20\40\x20\40\40\x20\40\40\40\x76\x61\x72\x20\153\x65\171\75\42\x64\x72\x6f\x69\x64\x39\x30\x33\x22\73\x20\166\141\x72\40\x6c\x69\153\145\75\x24\50\42\43\x6c\x69\x6b\145\x66\141\x63\42\x29\56\x76\x61\x6c\x28\51\x3b\xa\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\x76\x61\162\x20\144\141\x74\x6f\163\x20\75\x20\x7b\12\40\x20\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\42\x70\x61\147\42\x20\72\x20\x44\x65\143\x72\x65\155\x65\x6e\x74\116\165\x6d\54\12\x20\x20\40\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\40\x20\40\x20\x22\153\x65\x79\42\40\x3a\40\153\x65\x79\xa\40\40\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\40\x7d\73\xa\40\40\40\40\x20\x20\x20\x20\x20\x20\40\12\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\x20\44\56\141\x6a\x61\170\x28\173\12\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x64\x61\164\141\x3a\x20\144\x61\x74\157\x73\54\12\40\40\x20\40\40\x20\40\40\x20\40\40\40\x20\40\40\40\40\x20\x20\x75\x72\x6c\x3a\x20\40\142\141\x73\x65\x75\162\154\53\x22\143\137\x64\x72\x6f\x69\144\57\143\x6f\142\x72\141\x6e\x7a\141\42\x2c\xa\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x74\x79\160\145\72\40\x22\x50\117\123\124\x22\x2c\xa\x20\40\40\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\40\40\40\x20\163\165\143\x63\145\163\163\72\x20\146\x75\156\x63\164\x69\157\156\50\x64\x61\x74\141\x29\40\173\xa\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\40\x20\40\40\40\x20\40\x20\40\44\50\x22\43\142\x6f\x64\x79\42\x29\56\150\164\155\154\50\144\x61\164\141\51\73\x20\44\x28\x22\43\154\x69\153\145\x66\x61\143\42\51\x2e\x76\141\154\50\x6c\151\153\x65\x29\73\40\163\167\141\x6c\x2e\x63\154\157\x73\x65\50\51\73\12\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\175\xa\40\40\x20\40\40\x20\x20\40\x20\x20\x20\12\x20\40\x20\x20\40\40\40\x20\40\40\40\40\40\x20\40\175\51\73\xa\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\x7d\xa\x20\40\x20\40\x20\x20\40\40\xa\x20\40\x20\40\40\40\x20\40\x20\40\x20\146\x75\x6e\143\x74\x69\x6f\x6e\40\x6e\165\x6d\160\141\x67\x63\x7a\x61\x28\x61\51\173\x20\x62\x65\x66\157\162\145\x28\x29\73\12\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x76\141\x72\40\x6b\x65\171\75\x22\144\162\157\x69\x64\x39\x30\x33\x22\73\40\166\x61\x72\40\x6c\x69\153\x65\75\x24\50\42\x23\154\151\153\x65\146\141\143\x22\x29\56\x76\x61\x6c\50\51\x3b\12\40\x20\x20\x20\x20\40\x20\x20\xa\x20\40\40\x20\40\40\40\x20\40\40\40\40\166\x61\x72\x20\x64\x61\x74\x6f\x73\40\x3d\40\x7b\12\40\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\x22\x6b\x65\x79\x22\72\x6b\145\x79\x2c\xa\40\40\x20\40\40\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\40\40\x22\x70\x61\x67\42\x20\72\x20\141\xa\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x7d\x3b\xa\40\40\40\x20\40\40\40\40\40\40\x20\12\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\44\56\x61\x6a\x61\170\50\173\12\x20\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\144\141\x74\x61\x3a\x20\x64\141\164\x6f\x73\x2c\xa\x20\x20\40\40\40\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\165\162\x6c\x3a\x20\x62\x61\x73\x65\x75\162\154\53\42\143\x5f\144\x72\x6f\x69\144\x2f\x63\x6f\142\162\x61\x6e\172\141\42\x2c\12\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\164\x79\160\x65\x3a\x20\42\x50\x4f\x53\x54\42\x2c\12\x20\40\x20\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\163\165\143\x63\x65\163\163\72\40\x66\x75\156\143\x74\151\157\x6e\x28\144\141\x74\141\x29\40\x7b\xa\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\x20\40\44\x28\42\x23\x62\x6f\144\x79\x22\51\x2e\150\164\x6d\x6c\50\144\x61\164\141\x29\x3b\x20\44\x28\42\43\x6c\151\153\x65\146\x61\x63\42\51\x2e\x76\141\154\x28\x6c\x69\153\145\51\x3b\x20\163\167\141\x6c\x2e\143\154\x6f\163\x65\50\x29\x3b\12\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\40\40\40\x20\175\12\40\40\x20\40\x20\x20\40\40\x20\40\x20\xa\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\x7d\51\73\12\40\40\40\40\40\40\x20\x20\40\x20\x20\x7d\12\40\40\x20\x20\x20\40\40\x20\12\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\146\165\156\x63\164\151\x6f\x6e\40\x49\156\x63\162\151\x6d\145\156\164\116\165\x6d\x63\172\141\x28\x29\x7b\40\x62\x65\146\x6f\x72\x65\x28\x29\73\xa\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\166\141\x72\40\x49\x6e\143\162\x69\155\x65\x6e\x74\116\x75\x6d\x3d\144\x6f\143\x75\155\x65\x6e\164\x2e\147\145\x74\105\154\145\155\145\x6e\164\x42\171\x49\x64\x28\x22\x49\156\x63\x72\151\x6d\145\x6e\164\116\x75\x6d\42\x29\56\x76\x61\x6c\x75\145\x3b\12\40\x20\40\40\40\40\x20\40\x20\40\x20\40\x76\x61\162\x20\x6b\145\171\x3d\42\144\162\157\x69\x64\71\60\63\x22\73\x20\x76\141\162\40\154\151\153\145\x3d\x24\x28\42\x23\154\x69\153\145\x66\141\143\42\x29\x2e\166\x61\154\50\x29\73\12\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\166\141\162\40\x64\x61\x74\157\x73\x20\x3d\x20\173\12\x20\40\40\40\40\40\40\x20\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\42\x6b\145\x79\42\x3a\153\145\171\54\12\40\40\40\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\42\x70\141\147\x22\40\72\40\x49\156\143\162\151\x6d\x65\156\x74\116\x75\x6d\12\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\175\x3b\xa\40\x20\40\40\x20\40\x20\x20\x20\x20\40\12\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x24\56\x61\x6a\141\170\50\173\xa\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\40\x20\40\x64\141\x74\x61\x3a\x20\x64\141\164\157\x73\x2c\12\40\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\40\40\40\40\40\40\165\162\154\x3a\40\x20\x62\141\163\x65\165\x72\154\53\42\143\137\x64\162\157\151\x64\x2f\143\x6f\142\x72\x61\x6e\x7a\141\42\54\12\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\40\164\171\160\x65\72\40\x22\x50\x4f\123\x54\42\54\12\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x73\165\143\x63\x65\163\x73\x3a\x20\146\x75\x6e\x63\x74\x69\x6f\x6e\x28\x64\x61\164\141\x29\40\173\xa\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\40\x20\40\x20\x20\40\40\40\40\40\x20\44\x28\42\x23\x62\x6f\144\x79\x22\x29\x2e\150\x74\x6d\x6c\x28\144\x61\164\x61\x29\73\40\x24\50\x22\x23\154\x69\x6b\145\146\x61\143\x22\x29\56\x76\x61\x6c\x28\x6c\x69\x6b\x65\x29\73\x20\x73\167\x61\x6c\x2e\143\154\x6f\163\145\50\x29\73\xa\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\40\40\x20\x20\x20\x7d\12\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\xa\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x7d\x29\73\12\40\40\x20\40\x20\x20\40\40\40\x20\x20\175\12\40\x20\x20\40\x20\x20\x20\x20\74\x2f\163\143\x72\x69\160\164\x3e\xa\40\40\x20\40\40\40\x20\x20\74\144\x69\166\x20\143\x6c\141\x73\x73\x3d\x22\x77\63\55\x62\141\162\x20\x77\63\x2d\142\157\x72\x64\145\x72\40\167\63\x2d\142\x61\x72\162\141\x73\x22\x3e\12\x20\x20\x20\40\x20\x20\x20\x20\x3c\151\156\x70\x75\164\x20\x74\x79\160\x65\75\x22\150\151\144\144\x65\x6e\x22\40\151\x64\75\x22\x44\145\143\x72\x65\155\x65\156\164\x4e\165\155\x22\40\x76\x61\x6c\165\x65\x3d\x22" . $DecrementNum . "\x22\x3e\12\40\40\40\40\x20\x20\x20\40\x3c\x61\x20\x6f\x6e\143\x6c\x69\x63\x6b\x3d\42\x44\x65\x63\162\145\155\145\156\x74\116\x75\x6d\x63\172\x61\50\51\73\x22\40\x63\x6c\x61\x73\x73\75\42\167\63\55\x62\x61\162\x2d\x69\x74\x65\155\40\167\63\55\x62\165\164\x74\157\x6e\42\76\46\x6c\x61\161\165\157\73\x3c\57\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\x70\141\x67\x69\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\x2d\146\x6f\156\144\x6f\144\162\x6f\x69\144"; $html .= "\12\40\40\x20\40\40\x20\x20\x20\74\x69\x6e\x70\165\x74\x20\x74\x79\160\x65\x3d\42\150\x69\144\144\x65\x6e\42\x20\x69\x64\x3d\42" . $id . "\x22\40\x76\141\154\165\145\75\42" . $i . "\42\x3e\xa\40\x20\x20\40\x20\x20\40\40\x3c\141\40\x6f\x6e\x63\154\151\x63\153\x3d\42\x6e\165\x6d\x70\141\x67\143\x7a\x61\50\44\x28\x27\43" . $id . "\x27\51\x2e\166\x61\154\50\x29\x29\73\x22\x20\143\154\x61\163\x73\75\x22\x77\x33\x2d\142\141\x72\55\151\x74\x65\155\x20\167\63\55\142\165\164\x74\x6f\x6e\x20" . $hover . "\x22\76" . $i . "\x3c\57\141\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\x70\165\164\40\164\171\160\x65\75\42\150\x69\144\x64\145\x6e\42\x20\x69\144\x3d\42" . $id . "\x22\x20\166\141\154\x75\x65\75\42" . $i . "\x22\x3e\xa\40\x20\40\x20\40\x20\x20\40\x3c\x61\40\157\156\143\x6c\151\143\153\x3d\x22\156\x75\x6d\160\x61\x67\x63\172\141\50\44\x28\x27\x23" . $id . "\47\51\x2e\166\141\154\50\x29\x29\x3b\42\40\x63\x6c\141\163\x73\75\x22\x77\x33\x2d\x62\141\x72\55\x69\x74\x65\x6d\x20\167\63\55\142\165\164\x74\x6f\156\40" . $hover . "\x22\x3e" . $i . "\x3c\x2f\x61\76"; } } } $html .= "\74\x69\156\x70\165\x74\x20\x74\171\x70\145\75\42\150\x69\x64\x64\x65\x6e\42\x20\151\x64\x3d\x22\111\156\143\x72\151\155\145\156\164\x4e\165\155\x22\x20\166\141\x6c\165\145\75\42" . $IncrimentNum . "\42\76\xa\40\40\x20\40\x20\40\40\x20\74\141\40\157\156\x63\x6c\151\143\153\75\42\x49\156\x63\162\151\155\x65\156\164\116\165\x6d\143\172\x61\x28\x29\x3b\x22\40\143\x6c\141\x73\x73\x3d\x22\x77\x33\55\x62\141\162\x2d\x69\x74\x65\x6d\x20\167\63\55\x62\x75\164\x74\157\x6e\42\x3e\46\x72\141\x71\x75\x6f\73\x3c\57\141\76\12\xa\x20\40\x20\40\x20\x20\x20\x20\74\x2f\x64\x69\166\x3e\x20"; return $html; } public function itcobro($a) { $bditfac = $this->db->query("\x53\x45\x4c\x45\x43\124\x20\141\x2e\164\151\x70\157\x64\157\x63\54\141\56\144\157\143\165\155\145\156\x74\x6f\54\141\56\141\156\164\x64\157\x63\x2c\x61\56\146\145\x63\x68\x61\143\x72\x65\141\54\141\56\x72\145\x63\145\160\x63\x69\157\156\54\141\x2e\x76\145\x6e\143\x65\x2c\141\56\x76\145\x6e\x63\145\x63\x2c\x62\x2e\x64\x6f\x63\x2c\x61\56\x63\157\x64\143\x6c\x69\145\156\x74\145\54\x20\x49\x46\x28\x61\x2e\156\x6f\x74\141\x73\x20\x4c\111\x4b\105\40\x27\x25\120\122\x4f\x4d\117\x25\47\x2c\x27\x53\x27\54\47\116\47\51\x20\160\162\x6f\x6d\x6f\54\xa\40\x20\40\x20\x61\x2e\164\157\x74\141\154\144\40\144\x6f\x6c\141\162\54\x61\56\x74\157\164\141\154\x66\151\x6e\x61\x6c\54\141\56\144\x69\x61\163\x69\x6e\x64\145\170\x2c\xa\x20\x20\x20\x20\50\x53\105\x4c\105\x43\x54\x20\155\x6f\x6e\x65\x64\141\x20\x46\122\x4f\115\40\157\x70\145\x72\143\x6c\x69\40\167\150\145\162\x65\x20\x69\x64\x66\141\x63\x3d\x61\x2e\144\157\143\x75\155\x65\x6e\x74\x6f\40\x67\162\x6f\165\160\40\142\x79\x20\155\157\x6e\145\x64\x61\40\x6c\x69\x6d\x69\164\x20\61\51\x20\164\x69\x70\x6f\160\x61\147\x2c\12\x20\40\x20\x20\x28\x53\105\114\105\103\x54\x20\x6f\x66\x69\x63\151\x61\x6c\40\x46\122\x4f\x4d\x20\x6d\x6f\156\145\x63\x61\x6d\x20\x57\x48\105\x52\105\40\x66\x65\143\150\x61\x3c\75\x61\x2e\146\x65\143\150\141\x63\162\145\x61\40\117\x52\x44\105\122\x20\x42\131\x20\x66\x65\143\150\141\40\104\105\x53\x43\x20\x4c\x49\115\111\124\40\61\51\x20\164\141\163\x61\x6f\x72\147\xa\x20\x20\40\x20\x46\x52\117\115\x20\x6f\x70\145\x72\164\x69\40\x61\12\x20\x20\40\x20\x4a\117\x49\116\x20\x63\157\156\x74\x72\x6f\154\x5f\157\160\x65\x72\x74\x69\x20\x62\x20\x4f\x4e\40\x61\56\141\x6e\x74\x64\157\143\x3d\x62\x2e\144\157\x63\xa\40\x20\x20\x20\x57\x48\105\122\105\40\141\x2e\x63\157\144\143\x6c\151\145\156\164\145\75\47{$a}\x27\40\x26\x26\40\50\x61\x2e\164\151\160\x6f\x64\157\x63\75\x27\x46\x41\x43\x27\40\174\174\40\x28\141\56\164\151\x70\157\144\157\x63\75\x27\x4e\117\124\47\x20\x26\46\x20\141\x2e\x65\x73\164\141\x74\x75\163\x64\x6f\x63\41\x3d\47\130\x27\51\x29\40\46\46\40\141\56\164\157\x74\x61\x6c\x64\76\x30\12\40\40\40\x20\x47\122\117\x55\x50\40\102\x59\x20\141\56\x64\x6f\x63\x75\155\x65\x6e\164\x6f\x20\117\122\104\105\122\x20\102\131\x20\x61\x2e\144\x6f\143\165\x6d\145\156\164\x6f\x20\x44\105\123\103")->result(); $html = "\12\x20\x20\x20\x20\x3c\x64\x69\x76\40\x63\154\x61\x73\163\x3d\x22\x77\63\x2d\x66\x69\152\x6f\42\x3e\xa\x20\x20\40\x20\74\x61\40\157\156\143\x6c\x69\143\153\x3d\42\166\x69\145\x77\x61\165\144\151\164\x61\160\141\x67\50\51\73\42\40\x63\154\x61\x73\x73\x3d\x22\x77\x33\55\x62\164\156\x22\76\x3c\151\x6d\147\40\x73\162\x63\75\x22" . base_url() . "\x69\x6d\x61\x67\145\x73\57\x66\141\x63\164\165\x72\141\56\160\x6e\x67\42\40\141\x6c\x74\75\42\x45\163\164\x61\144\x6f\40\x43\165\145\156\x74\x61\x73\x22\x20\x74\x69\x74\x6c\145\x3d\42\105\x73\x74\141\144\157\x20\x43\165\x65\x6e\164\x61\163\x22\40\163\164\171\x6c\145\75\42\x77\x69\x64\164\150\72\62\60\160\170\x3b\x68\145\151\147\150\x74\x3a\62\x30\160\x78\x3b\x62\157\162\144\x65\162\72\60\x3b\42\x3e\x3c\x2f\141\x3e\12\40\x20\40\x20\74\141\40\x6f\156\x63\x6c\151\x63\x6b\75\42\x67\x65\156\x65\x6e\x64\x66\141\143\x6d\x6f\x6e\x74\x6f\x28\x29\73\42\40\143\x6c\x61\x73\163\x3d\42\167\x33\x2d\x62\164\x6e\42\x3e\x3c\151\x6d\x67\x20\x73\162\x63\75\x22" . base_url() . "\x69\x6d\141\147\x65\x73\57\x6e\x64\56\x70\x6e\147\x22\40\x61\x6c\x74\75\42\107\145\x6e\x65\162\x61\162\40\116\x2f\104\42\40\164\x69\164\x6c\145\x3d\x22\107\145\156\x65\x72\141\x72\x20\x4e\57\x44\x22\x20\x73\164\x79\x6c\x65\x3d\42\x77\x69\144\x74\x68\72\x32\x30\160\x78\x3b\150\145\x69\147\150\x74\x3a\x32\x30\160\170\x3b\142\157\162\x64\145\162\72\60\73\42\76\x3c\x2f\141\x3e\xa\40\x20\x20\40\x3c\141\40\x6f\x6e\143\154\151\x63\153\75\42\162\x65\x67\x66\162\x65\143\145\160\50\51\x3b\x22\40\143\154\141\163\x73\75\x22\x77\x33\x2d\142\164\x6e\42\x3e\x3c\x69\x6d\x67\x20\163\162\143\75\42" . base_url() . "\151\x6d\141\x67\145\x73\57\x66\x72\x65\143\145\x70\x2e\160\x6e\147\x22\40\x61\x6c\x74\x3d\42\122\145\x67\151\163\x74\x72\141\x72\40\x52\x65\x63\x65\160\143\151\x6f\156\x22\40\164\151\164\154\x65\75\42\x52\145\147\151\x73\164\162\141\162\x20\122\x65\143\145\160\143\151\x6f\156\42\40\163\164\x79\x6c\145\75\42\x77\151\x64\x74\150\72\x32\60\x70\x78\73\x68\145\151\x67\x68\164\72\x32\x30\160\170\73\x62\157\x72\x64\145\162\72\x30\73\x22\x3e\x3c\x2f\141\x3e\12\40\x20\x20\40\74\41\55\55\x3c\141\x20\157\x6e\x63\154\151\143\153\x3d\42\x61\x6c\x65\x72\x74\x61\x6e\x6f\x69\x6e\x64\145\170\x28\51\x3b\42\40\143\154\x61\x73\x73\75\42\x77\63\55\x62\x74\156\42\x3e\x3c\x69\155\147\x20\163\x72\x63\x3d\42" . base_url() . "\151\155\141\147\x65\x73\57\x6e\157\151\x6e\144\x65\170\x2e\x70\x6e\x67\42\40\x61\x6c\x74\x3d\42\x4e\157\40\x49\x6e\144\145\170\x22\40\164\x69\164\154\145\75\x22\116\157\x20\111\x6e\144\145\170\x22\x20\x73\x74\171\x6c\x65\75\42\167\151\x64\x74\150\72\x32\x30\x70\x78\73\150\x65\x69\147\x68\164\72\x32\x30\160\x78\x3b\x62\x6f\162\x64\145\162\72\x30\x3b\42\x3e\x3c\57\x61\x3e\55\55\x3e\12\40\40\x20\40\74\x61\x20\x6f\156\143\154\151\143\153\75\42\155\x6f\166\x62\141\156\x63\x28\51\73\42\x3e\74\x69\155\x67\40\163\x72\x63\75\x22" . base_url() . "\x69\155\141\147\145\x73\57\144\151\156\145\x72\157\x2e\x70\156\x67\x22\40\141\154\x74\75\x22\103\x6f\156\x73\x6f\x6c\151\x64\x61\144\x6f\40\102\141\156\143\141\162\x69\x6f\x22\x20\x74\151\x74\x6c\145\x3d\42\103\x6f\x6e\163\x6f\154\x69\144\141\144\x6f\x20\102\141\156\x63\141\162\151\157\42\x20\x73\x74\x79\x6c\145\x3d\x22\x77\x69\144\x74\x68\72\x32\60\x70\170\x3b\150\x65\x69\147\x68\164\x3a\x32\x30\x70\170\x3b\142\x6f\162\144\x65\162\72\x30\x3b\42\76\xa\x20\x20\x20\x20\x3c\x61\x20\157\x6e\143\x6c\x69\143\x6b\75\x22\146\x6f\x72\x6d\160\x61\x67\x6f\163\x28\51\73\42\76\74\151\155\x67\40\x73\x72\x63\x3d\42" . base_url() . "\x69\x6d\141\x67\x65\x73\57\x69\143\157\x6e\160\x61\x67\x32\x2e\160\156\x67\x22\40\141\154\x74\75\42\x52\145\147\x69\163\164\x72\x61\x72\40\120\x61\147\157\x22\x20\164\x69\164\154\x65\x3d\42\x52\145\147\x69\x73\164\x72\141\x72\40\x50\141\147\157\40\x45\x66\x65\x63\x74\151\x76\157\x22\x20\x73\x74\171\x6c\145\75\x22\x77\151\x64\164\x68\72\62\x30\x70\x78\73\x68\x65\151\147\x68\164\x3a\62\60\x70\x78\x3b\x62\157\x72\x64\145\x72\x3a\x30\x3b\42\x3e\12\40\40\40\x20\x3c\41\55\55\74\x61\40\x6f\x6e\x63\x6c\151\143\153\75\42\x61\x6c\x65\162\x74\141\156\157\x69\156\x64\145\170\62\x28\51\x3b\x22\x20\x63\x6c\141\163\163\75\42\x77\x33\55\142\164\156\x22\76\74\x69\x6d\147\x20\163\x72\143\75\42" . base_url() . "\x69\x6d\x61\147\145\x73\57\156\x6f\151\156\x64\x65\x78\x32\56\160\156\147\x22\40\x61\154\164\75\42\x4e\157\x20\x49\156\x64\145\x78\42\40\x74\x69\x74\x6c\x65\75\x22\x4e\157\x20\x49\x6e\x64\x65\170\x22\40\163\x74\171\x6c\x65\x3d\x22\167\x69\144\164\150\x3a\x32\60\x70\x78\x3b\150\x65\x69\147\x68\164\x3a\x32\x30\x70\170\73\142\157\x72\144\145\162\72\x30\73\42\76\74\x2f\x61\x3e\x2d\x2d\76\xa\x20\40\x20\40\x3c\141\x20\x6f\x6e\143\154\151\143\x6b\x3d\x22\x61\152\x75\x73\164\x65\160\x61\147\x6f\163\50\x29\x3b\x22\x20\x63\154\141\x73\x73\75\x22\167\63\55\142\x74\x6e\42\76\74\151\155\147\x20\x73\x72\143\75\42" . base_url() . "\x69\155\141\x67\x65\163\57\x61\152\165\x73\164\x65\x70\x61\x67\157\x73\56\x70\x6e\x67\42\40\141\154\x74\75\x22\x41\152\165\x73\x74\x65\40\x50\x61\147\157\163\42\x20\x74\x69\164\154\x65\75\42\101\152\x75\x73\x74\x65\x20\120\141\147\x6f\163\x22\40\x73\164\x79\154\x65\x3d\x22\x77\x69\144\x74\150\x3a\62\x30\x70\x78\73\150\x65\151\x67\150\x74\72\62\x30\x70\170\73\142\x6f\162\x64\145\x72\72\x30\x3b\42\76\x3c\57\x61\76\xa\40\x20\x20\x20\x3c\x61\40\x6f\156\143\154\x69\x63\153\75\42\164\162\141\156\x73\160\141\147\157\163\50\x29\x3b\42\40\143\x6c\141\x73\x73\x3d\42\167\63\x2d\142\x74\156\42\76\x3c\x69\155\147\x20\163\x72\143\x3d\42" . base_url() . "\x69\x6d\x61\x67\x65\163\x2f\164\x72\141\156\163\155\x6f\x6e\145\x79\56\160\x6e\147\42\x20\x61\x6c\x74\x3d\x22\x54\162\x61\156\x73\146\145\162\x69\162\x20\123\x6f\x62\x72\x61\x6e\x74\x65\42\x20\164\151\x74\154\x65\x3d\42\124\x72\x61\156\163\x66\x65\162\151\162\40\123\157\142\162\141\156\x74\x65\x22\40\163\x74\171\x6c\145\x3d\42\167\151\x64\x74\x68\72\62\60\160\x78\73\150\145\x69\x67\150\x74\x3a\x32\60\160\170\x3b\142\x6f\162\144\x65\162\x3a\x30\73\42\76\74\57\x61\76\xa\40\40\x20\40\74\x61\40\x6f\156\x63\154\151\143\153\75\42\162\145\x67\x72\145\x74\x66\x61\143\50\51\x3b\x22\40\143\x6c\141\163\x73\x3d\x22\167\x33\x2d\142\164\x6e\x22\x3e\74\151\155\x67\40\163\162\x63\75\x22" . base_url() . "\x69\x6d\141\x67\145\163\x2f\162\x65\x74\145\x6e\x63\151\157\x6e\x2e\x70\156\147\x22\40\141\154\164\75\42\x52\145\x67\x69\x73\164\x72\141\162\40\122\x65\x74\x65\x6e\143\151\157\156\x22\40\x74\x69\x74\x6c\145\75\42\122\x65\x67\151\x73\164\x72\141\162\40\122\145\164\x65\x6e\x63\151\157\x6e\x22\x20\x73\x74\x79\154\145\x3d\x22\167\151\x64\x74\150\x3a\62\60\160\x78\x3b\x68\145\x69\147\x68\164\72\x32\x30\160\x78\73\x62\x6f\x72\x64\145\x72\x3a\x30\73\42\x3e\x3c\x2f\141\x3e\12\40\x20\40\x20\74\x61\40\x6f\156\x63\x6c\x69\x63\x6b\x3d\42\x72\x65\147\x6e\x63\x66\x61\x63\x28\51\x3b\x22\40\143\x6c\141\x73\163\75\x22\167\63\x2d\142\164\156\x22\76\x3c\151\x6d\147\x20\x73\x72\x63\x3d\42" . base_url() . "\x69\155\x61\x67\x65\163\x2f\x6e\x63\56\160\156\147\x22\40\141\x6c\164\75\x22\x41\160\154\x69\x63\x61\x72\x20\x4e\x2f\x43\42\40\164\151\x74\x6c\x65\75\x22\101\x70\154\151\x63\x61\x72\x20\116\57\x43\x22\40\163\x74\x79\154\x65\75\42\x77\x69\144\x74\x68\72\x32\60\160\170\73\x68\x65\151\147\x68\164\x3a\x32\60\160\x78\x3b\142\x6f\162\x64\x65\162\72\x30\x3b\42\x3e\x3c\x2f\x61\76\12\40\40\x20\40\74\x61\x20\157\156\143\x6c\x69\x63\x6b\75\x22\147\x65\x6e\x65\x6e\x63\x66\141\x63\50\51\73\42\x20\143\154\x61\163\163\75\x22\x77\x33\x2d\142\x74\156\x22\76\74\x69\155\x67\40\x73\162\x63\75\x22" . base_url() . "\x69\x6d\141\x67\x65\x73\57\x63\162\145\144\151\x74\x6f\56\160\x6e\147\42\40\x61\x6c\164\x3d\42\x47\x65\x6e\145\x72\141\x72\40\x4e\x2f\103\x20\x25\42\40\164\x69\164\x6c\145\75\x22\107\x65\156\145\x72\x61\x72\x20\116\57\x43\40\45\42\x20\163\164\171\x6c\x65\x3d\x22\167\x69\144\x74\x68\x3a\x32\60\x70\x78\x3b\x68\145\x69\x67\x68\x74\72\x32\x30\x70\x78\73\x62\157\162\144\145\162\x3a\60\x3b\42\76\x3c\x2f\x61\x3e\12\40\x20\40\x20\x3c\x61\x20\157\156\x63\154\151\143\153\x3d\x22\x67\145\156\145\156\143\x66\141\x63\x6d\157\x6e\164\x6f\x28\51\x3b\x22\40\143\x6c\x61\163\x73\75\42\x77\63\55\x62\164\156\42\76\x3c\x69\155\x67\40\x73\x72\x63\x3d\x22" . base_url() . "\151\x6d\x61\147\145\x73\57\x6e\x63\155\x6f\156\x74\x6f\x2e\x70\156\147\x22\40\x61\154\164\75\42\x47\x65\x6e\x65\x72\141\162\40\x4e\57\x43\x20\115\157\156\x74\x6f\42\x20\x74\x69\x74\x6c\x65\x3d\42\107\145\156\x65\162\141\162\40\x4e\x2f\x43\40\115\x6f\x6e\x74\157\42\x20\163\x74\x79\x6c\145\75\42\x77\x69\144\164\150\x3a\62\x30\160\x78\x3b\150\145\x69\147\x68\x74\x3a\x32\60\160\x78\73\x62\x6f\162\144\x65\162\72\60\x3b\42\x3e\74\x2f\141\76\12\40\x20\x20\40\74\141\x20\157\156\143\x6c\x69\x63\x6b\x3d\42\145\x6c\151\x6d\x70\x61\x67\157\x28\51\73\x22\40\143\x6c\x61\x73\163\x3d\42\167\x33\x2d\142\164\156\42\76\x3c\x69\x6d\x67\x20\163\x72\x63\75\x22" . base_url() . "\151\155\x61\x67\x65\x73\57\145\x6c\x69\155\160\141\x67\157\x2e\x70\156\147\42\x20\141\154\164\75\42\105\x6c\x69\155\151\x6e\x61\162\40\120\x61\x67\157\x22\40\x74\151\164\x6c\x65\75\x22\x45\x6c\x69\155\151\156\x61\x72\x20\x50\141\147\157\42\40\163\x74\x79\154\x65\x3d\42\x77\x69\144\164\150\72\x32\60\160\x78\x3b\150\x65\151\x67\x68\x74\72\62\x30\160\170\x3b\x62\157\162\144\x65\162\72\x30\73\42\76\x3c\57\x61\x3e\12\x20\40\x20\x20\x3c\x2f\144\x69\166\76\xa\40\40\40\x20\74\x74\x61\142\x6c\x65\x20\143\154\x61\163\x73\75\42\167\63\55\164\141\142\x6c\145\x2d\141\x6c\154\x20\167\63\x2d\150\x6f\x76\x65\162\141\142\x6c\x65\40\x77\x33\55\154\x65\x66\164\x2d\x61\154\151\147\x6e\40\167\63\x2d\x74\151\156\171\42\x20\x73\164\171\x6c\x65\x3d\42\x77\x69\144\x74\150\72\x31\60\60\x25\x3b\x22\76\74\164\x72\40\143\154\141\x73\x73\75\x22\167\x33\55\x66\x6f\x6e\144\x6f\144\x72\x6f\151\144\40\x77\63\55\x66\151\152\157\x22\76\74\x74\x68\76\104\157\x63\165\155\145\156\x74\x6f\x3c\x2f\x74\150\x3e\74\x74\150\x3e\x54\151\x70\x6f\x3c\x2f\164\150\x3e\74\x74\150\x3e\x4e\57\104\x3c\x2f\x74\x68\x3e\x3c\164\x68\76\106\145\143\150\141\74\57\x74\x68\x3e\x3c\164\150\76\122\145\x63\145\160\143\151\157\x6e\x3c\x2f\x74\150\76\x3c\164\x68\76\126\145\x6e\x63\x65\74\x2f\164\x68\x3e\74\164\150\x3e\124\x6f\x74\141\154\x20\x42\163\x3c\x2f\x74\150\x3e\x3c\164\150\x3e\111\156\x64\x65\x78\40\102\163\74\57\x74\x68\76\xa\40\x20\x20\40\x3c\164\x68\x3e\x54\157\x74\141\x6c\40\44\74\x2f\x74\x68\76\x3c\164\x68\x3e\120\x61\x67\x61\144\157\x3c\57\164\x68\76\x3c\164\x68\76\x44\145\x62\145\74\57\164\150\x3e\74\164\150\76\105\163\164\141\164\165\x73\74\x2f\164\x68\76\x3c\x2f\x74\x72\76"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $tasa = $this->db->query("\123\x45\114\105\103\124\40\111\x46\x28\142\x2e\x66\145\143\x68\144\x6f\x6c\x61\162\x3d\47\60\x30\x30\x30\x2d\x30\x30\55\60\60\x27\x2c\x49\x46\x28\103\x55\122\x44\101\124\105\50\51\74\75\104\101\x54\x45\137\101\x44\x44\50\141\x2e\x72\x65\143\x65\x70\x63\x69\x6f\x6e\x2c\x49\116\124\105\x52\x56\101\114\x20\x61\x2e\144\x69\141\163\151\x6e\144\145\170\x20\x44\x41\131\51\x2c\x28\x53\x45\114\x45\103\x54\x20\x6f\146\x69\x63\151\x61\x6c\40\x46\122\x4f\115\40\x6d\x6f\156\145\x63\x61\x6d\40\127\x48\x45\122\x45\40\x66\x65\x63\x68\141\x3c\75\141\56\x66\x65\143\150\x61\143\x72\145\x61\40\117\x52\x44\x45\122\40\x42\131\40\146\145\143\x68\x61\x20\104\x45\123\x43\x20\114\x49\x4d\x49\x54\40\x31\51\x2c\50\x53\105\x4c\105\103\124\40\x6f\x66\151\143\151\x61\x6c\40\106\x52\x4f\115\x20\x6d\157\x6e\145\143\x61\155\40\x4f\122\x44\105\122\40\x42\x59\40\x66\x65\x63\150\141\40\104\x45\123\x43\x20\114\111\x4d\x49\x54\40\61\x29\51\54\x49\x46\50\142\56\146\x65\143\150\144\157\154\141\x72\x3c\x3d\104\x41\124\x45\x5f\x41\104\x44\50\x61\56\x72\145\143\145\160\x63\151\x6f\156\x2c\x49\116\x54\105\122\126\101\114\40\141\x2e\x64\x69\x61\x73\151\156\x64\145\x78\x20\x44\101\x59\51\54\50\x53\x45\114\105\103\124\40\x6f\146\x69\143\x69\141\154\40\106\122\x4f\115\x20\x6d\x6f\x6e\x65\143\141\x6d\x20\127\x48\x45\x52\105\40\146\x65\x63\150\x61\x3c\75\141\56\146\x65\143\150\141\143\162\145\x61\x20\x4f\122\x44\x45\122\40\x42\x59\x20\146\x65\143\150\x61\x20\104\105\123\103\40\x4c\x49\115\111\x54\x20\61\x29\x2c\x28\123\x45\114\105\x43\124\x20\x6f\146\x69\x63\151\141\154\40\x46\122\x4f\x4d\40\155\x6f\x6e\145\x63\x61\x6d\40\127\110\x45\x52\x45\x20\x66\145\143\150\141\74\75\x62\x2e\146\x65\x63\x68\144\x6f\x6c\141\162\x20\x4f\122\104\105\122\40\x42\x59\40\x66\145\x63\x68\141\40\x44\105\123\103\x20\x4c\111\x4d\111\124\x20\61\51\51\x29\x20\156\40\106\x52\117\x4d\40\157\x70\145\x72\x74\151\40\141\40\112\117\x49\116\40\143\157\156\164\162\157\154\x5f\x6f\x70\145\x72\164\x69\40\142\x20\117\116\40\x61\56\141\156\x74\144\157\143\x3d\x62\56\144\157\x63\x20\127\110\x45\x52\x45\x20\141\56\x64\157\143\165\155\145\x6e\164\157\x3d\47{$dtitfac->documento}\x27\x20\x26\46\40\50\141\56\164\151\160\157\x64\x6f\x63\x3d\47\116\x4f\124\47\40\174\174\x20\141\x2e\164\151\160\x6f\144\x6f\x63\x3d\x27\106\101\x43\47\51\40\114\x49\x4d\111\x54\40\x31")->row(); $pagado = $this->db->query("\x53\105\114\105\103\x54\x20\x49\106\x28\x53\125\115\x28\142\61\56\x6d\157\x6e\164\157\x29\76\x30\x2c\40\123\x55\x4d\x28\x62\x31\56\x6d\157\156\x74\x6f\51\54\60\51\40\142\x73\54\x49\106\50\123\x55\x4d\x28\x62\x31\56\x6d\157\156\164\x6f\x64\x29\x3e\x30\x2c\40\123\x55\x4d\x28\142\x31\56\x6d\x6f\x6e\164\x6f\x64\x29\54\60\51\x20\x64\x6f\154\x61\x72\40\x46\122\x4f\x4d\x20\x6f\x70\x65\162\x63\x6c\x69\x20\142\61\x20\x57\x48\x45\x52\x45\40\x62\x31\56\x69\144\146\x61\x63\x3d\x27{$dtitfac->documento}\x27\x20\x26\46\40\142\x31\x2e\x69\144\143\x6f\x6e\163\142\141\x6e\143\x20\x49\123\40\x4e\117\124\40\x4e\125\x4c\114")->row(); $nc = $this->db->query("\x53\105\114\105\103\x54\x20\x69\146\x28\x52\117\x55\x4e\x44\x28\x53\x55\x4d\50\164\157\164\x61\x6c\x64\51\54\62\x29\x3e\x30\x2c\x52\117\x55\x4e\104\50\123\125\x4d\x28\x74\x6f\x74\141\154\144\51\54\x32\x29\54\x30\51\x20\164\x6f\x74\x61\154\144\40\x46\122\117\x4d\x20\141\160\x6c\151\143\x61\156\x63\x20\127\110\x45\x52\105\x20\146\141\x63\x3d\x27{$dtitfac->documento}\47")->row(); $ret = $this->db->query("\x53\x45\x4c\105\103\x54\40\151\x66\x28\x52\x4f\125\116\x44\50\x53\125\x4d\x28\141\x2e\164\157\x74\141\154\146\151\156\x61\154\x2f\x28\x53\105\114\105\103\x54\40\157\146\x69\143\151\x61\154\40\x46\122\117\x4d\40\155\157\156\145\x63\141\155\40\x57\x48\x45\122\105\x20\146\x65\143\150\141\74\75\141\56\146\145\x63\150\141\x63\x72\x65\141\40\117\x52\x44\105\x52\x20\x42\131\40\146\145\143\x68\141\40\x44\105\123\x43\x20\114\x49\115\111\x54\x20\61\51\x29\x2c\62\51\x3e\x30\54\x52\x4f\125\x4e\104\x28\123\125\115\x28\141\56\164\157\x74\x61\x6c\146\151\x6e\x61\154\x2f\x28\123\x45\x4c\x45\103\x54\x20\x6f\146\151\143\x69\141\154\40\106\x52\x4f\115\x20\155\x6f\x6e\145\143\141\x6d\40\127\x48\x45\122\105\40\x66\x65\x63\x68\141\74\75\x61\56\146\145\143\150\141\143\x72\x65\x61\40\117\122\104\105\x52\x20\x42\x59\40\x66\x65\x63\150\141\x20\104\x45\x53\103\x20\x4c\x49\x4d\111\124\x20\61\x29\x29\54\x32\51\54\60\51\40\164\x6f\164\141\154\144\40\106\x52\x4f\x4d\x20\x6f\160\145\162\x74\151\x20\x61\40\127\110\x45\x52\x45\40\x61\56\x61\x6e\164\x64\157\x63\75\47{$dtitfac->antdoc}\x27\40\x26\x26\40\141\56\x74\x69\x70\x6f\x64\x6f\143\x3d\47\122\x45\124\47")->row(); if ($tasa->n < $dtitfac->tasaorg) { $tasa->n = $dtitfac->tasaorg; } $bs = ($dtitfac->dolar - $nc->totald) * $tasa->n; $bsorg = ($dtitfac->dolar - $nc->totald) * $dtitfac->tasaorg; $debe = ROUND($dtitfac->dolar - $nc->totald - $ret->totald - $pagado->dolar, 2); $bdnd = $this->db->query("\x53\105\114\105\103\124\x20\144\x6f\x63\165\155\x65\156\164\x6f\54\122\x4f\x55\x4e\x44\50\x74\x6f\164\x61\154\146\151\156\141\154\54\62\51\40\164\157\x74\141\154\146\x69\156\x61\x6c\40\106\122\x4f\x4d\x20\x6f\160\x65\162\164\x69\x20\x57\x48\105\122\105\40\x61\x6e\x74\x64\x6f\x63\75\x27{$dtitfac->antdoc}\47\40\x26\46\x20\164\x69\160\157\144\x6f\x63\x3d\x27\x4e\x2f\104\47\x20\x26\46\40\50\145\x73\164\141\164\x75\x73\x64\157\143\x3d\x27\61\x27\40\174\x7c\x20\x65\x73\x74\141\164\165\163\144\157\x63\75\47\x30\47\x29")->row(); if ($bdnd->documento > 0) { $nd = $bdnd->documento; $index = $bdnd->totalfinal; } else { $nd = "\116\x2f\x41"; if ($bs > $bsorg) { $index = ROUND($bs - $bsorg, 2); } else { $index = 0; } } if ($debe <= 0.55) { $status = "\114\151\x73\x74\x6f"; $color = "\x77\x33\x2d\x67\162\145\x65\156"; $this->indexfac($dtitfac->antdoc); } else { $status = "\120\145\156\x64\x69\x65\156\x74\145"; $color = "\167\x33\55\x72\145\144"; } if ($dtitfac->promo == "\x53") { $promo = "\143\154\x61\x73\x73\x3d\42\x77\63\x2d\160\x69\156\x6b\42"; } else { $promo = ''; } $monto = ROUND($debe * $tasa->n, 2); $html .= "\74\x74\162\40\x69\x64\x3d\42\x73\x6c\x65\x63\164\x32" . $i . "\x22\76\x3c\151\x6e\x70\x75\x74\x20\164\171\160\x65\x3d\42\x68\151\144\x64\145\x6e\42\x20\156\141\x6d\x65\x3d\42\144\x6f\x63\62\x22\40\x76\141\154\x75\x65\x3d\42" . $dtitfac->documento . "\x22\76\x3c\x69\x6e\x70\x75\164\x20\164\x79\x70\x65\x3d\42\x68\x69\x64\x64\x65\156\42\x20\156\141\x6d\x65\75\x22\x74\x69\160\157\x64\157\x63\42\40\166\x61\x6c\165\x65\x3d\x22" . $dtitfac->tipodoc . "\x22\x3e\xa\x20\x20\x20\x20\40\x20\x20\40\x3c\x69\x6e\x70\165\x74\40\164\171\160\145\x3d\42\150\x69\144\144\x65\x6e\42\x20\156\x61\x6d\145\75\x22\x73\164\x61\x74\165\x73\x22\x20\166\x61\154\165\145\75\42" . $status . "\x22\x3e\74\151\156\160\165\x74\x20\x74\x79\160\x65\x3d\x22\x68\x69\144\x64\145\156\42\40\156\x61\x6d\x65\x3d\x22\x6d\157\x6e\x74\x6f\42\x20\166\x61\154\165\145\x3d\42" . $monto . "\x22\x3e\74\x69\x6e\x70\x75\x74\40\x74\x79\x70\145\75\42\150\x69\144\144\145\x6e\42\x20\156\141\x6d\x65\x3d\x22\144\157\154\141\162\x22\x20\166\x61\154\x75\145\75\42" . $debe . "\42\76\xa\x20\40\x20\x20\x20\40\40\x20\x3c\151\156\160\x75\164\x20\x74\171\160\145\75\42\x68\151\x64\144\145\x6e\42\40\156\x61\x6d\145\75\x22\143\x6c\151\62\42\x20\166\x61\x6c\165\x65\x3d\42" . $dtitfac->codcliente . "\42\x3e\xa\40\40\x20\x20\x20\40\x20\x20\74\164\x64\40" . $promo . "\76\x3c\151\156\160\165\x74\40\x74\171\160\x65\x3d\42\143\x68\145\143\153\142\x6f\x78\42\x20\x6f\156\x63\x6c\x69\143\x6b\x3d\x22\167\63\x2e\164\157\x67\147\154\x65\x43\154\141\163\x73\50\x27\x23\163\154\x65\143\x74\x32" . $i . "\x27\x2c\47\167\63\x2d\x79\x65\x6c\x6c\157\x77\47\x29\73\x22\40\x63\x6c\141\x73\x73\x3d\42\167\63\55\x63\x68\145\143\x6b\x22\40\156\x61\155\x65\x3d\x22\x63\x68\145\x63\x6b\42\x3e" . $dtitfac->documento . "\40\74\x62\x3e\124\x61\x73\141\x3c\57\x62\x3e\x20" . $dtitfac->tasaorg . "\74\57\x74\x64\76\x3c\164\x64\x3e" . $dtitfac->tipodoc . "\74\x2f\x74\x64\76\x3c\164\x64\x3e" . $nd . "\x3c\57\164\x64\76\74\x74\x64\76" . $dtitfac->fechacrea . "\x3c\57\x74\x64\x3e\12\40\x20\x20\x20\x20\40\x20\x20\74\164\x64\76" . $dtitfac->recepcion . "\74\57\x74\144\76\x3c\x74\x64\x3e\x3c\142\x3e\126\56\111\x3a\x20\74\57\142\x3e" . $dtitfac->vence . "\40\74\142\76\126\x2e\x43\72\x20\x3c\57\142\x3e" . $dtitfac->vencec . "\x3c\57\x74\144\x3e\x3c\x74\144\x3e\74\x62\76\101\156\x74\x3a\x20\74\x2f\x62\x3e" . ROUND($bsorg, 2) . "\40\x3c\142\x3e\x44\x65\163\x70\x3a\40\x3c\57\x62\76" . ROUND($bs, 2) . "\x3c\57\164\144\76\74\x74\144\x3e" . $index . "\40\74\142\x3e\124\141\163\141\x3a\74\x2f\x62\x3e\40" . $tasa->n . "\x20\x3c\x62\76\104\141\x79\72\74\x2f\142\x3e\x20" . $dtitfac->diasindex . "\x3c\x2f\x74\x64\x3e\12\40\40\x20\40\40\40\40\x20\x3c\164\x64\76\x3c\x62\76\124\117\x54\72\40\x3c\57\142\x3e" . $dtitfac->dolar . "\x20\x3c\x62\76\116\x2f\103\72\x20\x3c\57\x62\x3e" . $nc->totald . "\40\x3c\142\x3e\122\x45\124\x3a\x20\x3c\x2f\142\76" . $ret->totald . "\74\x2f\x74\144\76\x3c\x74\144\x3e" . $pagado->bs . "\x20\x3c\x62\x3e\102\x73\x3c\x2f\142\76\40" . $pagado->dolar . "\40\x3c\142\76\x24\x3c\x2f\x62\76\74\57\164\x64\x3e\74\x74\x64\x3e" . $monto . "\x20\x3c\x62\76\102\163\74\x2f\142\x3e\x20" . $debe . "\40\x3c\142\x3e\44\74\57\142\x3e\x3c\57\x74\x64\76\12\x20\x20\40\x20\40\40\x20\40\x3c\x74\144\40\143\x6c\141\x73\163\x3d\42" . $color . "\40\x77\63\55\x63\x65\156\164\x65\x72\x22\x3e" . $status . "\x3c\x2f\164\144\76\12\40\40\40\x20\40\x20\x20\x20\x3c\57\164\x72\76"; } $html .= "\x3c\x2f\x74\141\x62\154\x65\76\xa\40\x20\40\x20"; return $html; } public function cuentas_pagar($a, $b) { $this->conciliabanc_pagos(); $this->load->library("\x74\x61\x62\154\x65"); if ($b != '') { $filter = "\x57\110\105\x52\105\40\50\x61\x2e\x64\157\x63\x75\x6d\145\156\x74\x6f\75\47{$b}\x27\x20\174\174\40\x62\x2e\x72\x69\146\75\47{$b}\47\40\174\174\x20\x62\56\x6e\x6f\155\142\162\x65\x20\x4c\x49\113\105\40\47\45{$b}\x25\47\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\x4c\x45\103\x54\40\116\125\x4c\114\12\x20\x20\40\40\x20\40\106\122\117\x4d\40\143\157\x6d\160\x72\141\163\40\141\xa\40\x20\40\40\112\117\x49\x4e\40\160\162\157\x76\x65\x65\x64\40\142\x20\117\116\40\141\56\160\162\x6f\x76\x65\145\144\x3d\x62\56\x69\144\x20{$filter}\12\x20\40\40\x20\40\40\x20\107\x52\117\125\x50\40\x42\131\40\x61\56\143\x6f\144\x63\x6c\151\x65\156\x74\x65")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\x4c\x45\x43\x54\40\142\x2e\162\151\146\x2c\x52\x4f\125\116\x44\x28\x49\x46\50\123\125\x4d\50\141\x2e\164\x6f\164\x61\x6c\144\51\x3e\x30\x2c\40\123\x55\x4d\50\141\x2e\164\x6f\x74\x61\154\x64\51\54\x30\51\54\62\51\40\144\157\x6c\141\x72\x20\106\x52\x4f\x4d\40\143\x6f\155\160\x72\141\x73\40\x61\xa\x20\x20\x20\x20\112\x4f\x49\x4e\40\x70\162\x6f\166\145\x65\144\40\142\x20\x4f\x4e\x20\141\x2e\160\162\157\x76\145\x65\144\x3d\142\x2e\151\x64\x20{$filter}\12\40\40\x20\x20\x47\x52\x4f\x55\x50\40\x42\131\x20\x62\56\162\151\x66\40\117\x52\104\105\x52\x20\102\x59\40\144\x6f\154\x61\x72\40\x44\x45\123\103\x20\x20\x4c\x49\x4d\111\124\40" . ($a - 1) * $mostrar . "\40\x2c\x20" . $mostrar . '')->result(); $html = "\12\x20\x20\x20\x20\74\164\141\142\x6c\145\x20\143\x6c\141\x73\x73\x3d\x22\167\63\x2d\x74\141\x62\x6c\145\55\x61\x6c\x6c\40\x77\63\x2d\x68\x6f\166\x65\x72\x61\142\x6c\145\40\167\x33\x2d\x6c\x65\x66\x74\x2d\x61\x6c\151\x67\x6e\42\x3e\12\40\40\x20\40\74\x74\x72\76\74\x74\x64\40\143\x6c\x61\163\x73\x3d\42\x77\x33\55\x66\157\x6e\x64\157\x64\162\157\151\x64\42\76\102\x75\163\x63\141\162\x20\x3c\151\155\x67\40\x73\x72\x63\x3d\42" . base_url() . "\x69\x6d\141\147\x65\x73\x2f\142\165\163\143\141\x72\x2e\x70\156\147\x22\40\x61\154\164\75\x22\102\165\x73\x63\x61\162\42\x20\x74\x69\164\x6c\145\x3d\x22\x42\165\x73\x63\141\162\x22\40\163\164\x79\x6c\x65\75\42\x77\x69\x64\x74\x68\x3a\x31\70\160\170\73\x62\x6f\162\x64\x65\x72\x3a\60\x3b\42\76\74\x2f\164\x64\76\xa\x20\x20\x20\40\74\x74\144\76\x3c\x69\x6e\160\165\164\40\164\171\x70\145\75\42\164\x65\x78\x74\42\x20\x63\x6c\141\163\x73\x3d\x22\167\x33\x2d\x69\x6e\160\165\x74\x22\40\x70\x6c\141\x63\145\x68\x6f\154\144\145\162\x3d\x22\111\x6e\147\x72\145\x73\x65\40\163\165\x20\x62\x75\163\x71\x75\145\144\x61\42\40\x6f\x6e\143\x68\141\156\x67\145\x3d\x22\143\x75\x65\x6e\164\x61\163\137\160\x61\147\141\x72\50\x29\73\x22\40\151\144\75\x22\154\151\x6b\x65\x66\141\143\42\x3e\x3c\x2f\x74\144\76\xa\40\40\x20\40\74\164\x64\40\x63\154\141\x73\163\75\x22\167\63\55\x63\x65\x6e\x74\145\x72\x20\x77\x33\x2d\142\164\156\42\76\74\141\x20\x6f\x6e\x63\154\151\x63\x6b\x3d\x22\163\x65\154\145\x63\164\142\141\156\x63\x6f\x73\50\x29\x3b\x77\x33\x2e\163\150\x6f\x77\50\47\x23\x6d\157\144\x63\141\162\x67\141\x62\x61\156\143\x27\x29\73\42\x3e\74\x69\155\147\40\x73\x72\x63\75\42" . base_url() . "\x69\155\x61\x67\145\x73\57\145\x78\143\x65\x6c\56\160\x6e\147\x22\x20\x61\x6c\164\75\42\103\141\162\x67\141\x72\40\x43\x6f\156\163\x6f\x6c\151\144\141\x64\157\x22\40\164\x69\x74\x6c\x65\x3d\42\x43\x61\162\147\141\x72\40\x43\157\156\x73\157\x6c\x69\144\x61\144\x6f\42\40\163\x74\171\154\145\75\42\167\x69\x64\x74\x68\x3a\x31\x38\160\170\73\x68\145\x69\147\x68\164\x3a\61\x38\x70\x78\x3b\142\157\x72\144\145\x72\72\x30\73\42\76\x3c\57\x61\76\74\x2f\164\x64\76\12\40\x20\40\x20\74\164\x64\x20\x63\x6c\141\163\163\75\42\167\x33\x2d\x63\145\x6e\x74\145\162\40\167\63\55\x62\164\x6e\x22\x3e\74\x61\x20\x6f\156\143\154\x69\x63\153\x3d\x22\x63\x75\145\156\164\141\163\x5f\160\141\x67\x61\162\x28\51\x3b\x22\76\x3c\x69\x6d\147\40\x73\162\143\75\42" . base_url() . "\x69\x6d\141\147\x65\x73\57\162\x65\x6c\x6f\x61\144\x2e\x70\156\147\x22\x20\141\x6c\x74\x3d\x22\x52\145\x63\141\162\147\x61\x72\x22\40\164\x69\164\154\145\x3d\42\122\x65\x63\141\162\x67\141\162\x22\x20\x73\x74\x79\154\x65\75\x22\x77\x69\144\x74\150\x3a\62\x30\x70\170\73\x68\x65\x69\x67\150\164\72\x32\60\160\170\73\142\157\x72\144\x65\162\x3a\x30\73\x22\x3e\74\57\x61\x3e\74\x2f\164\144\76\x3c\57\x74\162\76\12\x20\x20\40\40\x3c\57\164\141\x62\x6c\145\x3e\74\x62\x72\76\12\40\x20\x20\40\x3c\x74\x61\142\154\145\x20\x69\144\x3d\42\151\144\60\x31\x22\40\143\154\141\163\x73\75\x22\x77\63\55\x74\x61\x62\154\145\x2d\x61\154\154\40\167\63\55\150\x6f\166\145\162\141\142\x6c\145\x20\167\63\55\x6c\x65\146\x74\55\141\x6c\x69\x67\156\x20\x77\x33\55\x74\151\156\171\x22\76\x3c\164\162\x20\x63\154\141\x73\163\75\42\x77\x33\55\x66\157\x6e\x64\157\144\162\157\x69\x64\40\x77\63\55\x66\151\152\157\x22\x3e\74\164\x68\x3e\103\x6c\151\145\x6e\x74\x65\x3c\x2f\x74\x68\x3e\x3c\x74\150\76\116\x6f\155\142\162\145\74\57\164\x68\76\74\x74\x68\76\x54\157\x74\141\x6c\56\x42\163\74\x2f\164\x68\x3e\x3c\x74\150\76\124\157\x74\141\x6c\56\44\74\57\164\150\76\x3c\x74\150\76\x50\x61\x67\x61\144\157\74\x2f\x74\x68\76\x3c\x74\150\x3e\104\145\142\145\x3c\57\x74\x68\76\74\164\150\x3e\x45\x73\x74\141\x74\165\163\74\x2f\164\x68\76\x3c\57\164\162\76"; $i = 0; $debe = 0; foreach ($bdfac as $dtfac2) { $i++; $dtfac = $this->db->query("\x53\105\x4c\105\103\x54\x20\x61\x2e\144\157\x63\x75\155\x65\x6e\x74\157\x2c\142\x2e\x72\151\146\54\142\x2e\x6e\157\155\142\162\x65\x2c\x20\122\117\x55\x4e\104\x28\x53\x55\x4d\50\141\x2e\x74\157\x74\x61\154\x29\x2c\x34\51\x20\x74\157\164\141\x6c\146\x69\x6e\x61\154\x2c\12\x20\x20\40\40\122\117\x55\116\104\50\122\x4f\125\x4e\104\50\x49\x46\x28\123\x55\115\x28\x61\x2e\164\x6f\x74\x61\x6c\x64\x29\76\x30\54\40\x53\x55\115\50\x61\x2e\164\157\x74\141\154\144\x29\54\60\x29\54\x32\51\52\x28\123\x45\x4c\x45\x43\x54\40\x6f\146\151\x63\x69\x61\x6c\40\106\x52\x4f\115\40\155\157\156\145\x63\x61\155\x20\x57\x48\105\122\x45\x20\x66\x65\143\150\x61\74\75\141\x2e\146\145\143\150\x61\x64\157\143\40\117\x52\x44\x45\122\40\x42\x59\x20\146\145\143\150\x61\x20\104\105\x53\103\x20\x4c\x49\115\111\124\x20\61\51\x2c\x32\x29\40\x62\x73\54\x20\122\117\125\116\104\x28\111\106\50\123\125\x4d\x28\x61\56\164\x6f\x74\x61\x6c\x64\x29\x3e\x30\54\x20\x53\125\x4d\50\x61\x2e\164\157\x74\141\154\x64\x29\54\60\51\54\x32\51\40\144\157\x6c\x61\x72\54\40\xa\x20\x20\x20\x20\x52\117\125\x4e\104\x28\x28\x53\105\114\105\103\124\x20\111\106\50\123\x55\115\50\142\x31\56\x6d\157\x6e\164\157\51\76\x30\54\x20\123\125\115\x28\x62\61\56\x6d\157\156\x74\157\x29\54\60\51\40\142\x73\x20\106\x52\117\x4d\40\143\x6f\155\x70\x72\141\x73\x20\141\x31\40\x4a\117\x49\x4e\x20\x70\x72\x6f\166\x65\x65\x64\x20\143\61\40\x4f\116\40\x61\x31\56\160\x72\157\x76\x65\145\x64\75\143\x31\x2e\x69\x64\40\x4a\x4f\111\116\40\x6f\160\x65\x72\160\x72\157\166\x20\142\x31\40\x4f\116\40\141\61\x2e\x64\157\143\165\155\x65\156\164\x6f\75\142\61\56\x69\x64\x66\141\143\40\x57\x48\x45\x52\105\40\x63\61\56\162\x69\146\x3d\142\x2e\x72\151\x66\x20\46\46\x20\x62\x31\x2e\151\x64\143\x6f\156\x73\142\141\x6e\x63\x20\111\x53\40\116\117\x54\40\x4e\x55\114\114\x29\x2c\x32\51\x20\x70\142\x73\54\x20\12\40\40\40\40\x52\117\125\x4e\x44\x28\50\x53\x45\114\105\103\124\40\x49\106\x28\x53\x55\x4d\x28\142\61\56\155\157\156\x74\157\144\51\x3e\x30\54\x20\123\x55\115\x28\x62\x31\x2e\155\x6f\x6e\x74\x6f\x64\51\x2c\60\x29\40\x64\157\154\x61\162\x20\x46\122\117\x4d\40\143\x6f\x6d\160\162\x61\163\x20\x61\x31\40\x4a\x4f\111\x4e\40\160\x72\x6f\166\145\145\144\40\x63\x31\40\x4f\116\x20\x61\61\56\160\162\157\x76\x65\145\x64\x3d\143\x31\56\x69\x64\40\112\117\x49\x4e\x20\x6f\160\145\162\160\162\x6f\x76\40\142\61\x20\117\116\40\141\61\x2e\x64\x6f\x63\165\155\x65\x6e\164\x6f\75\x62\x31\56\x69\x64\x66\141\143\40\127\x48\105\122\x45\40\x63\x31\56\x72\x69\x66\75\142\x2e\x72\151\146\x20\46\x26\40\142\61\56\151\144\143\157\156\x73\x62\141\156\143\40\111\x53\40\116\117\x54\x20\x4e\125\114\x4c\x29\54\62\x29\40\160\x64\157\154\x61\x72\x2c\xa\x20\40\40\40\50\x53\105\114\105\103\124\x20\x6f\146\x69\143\x69\141\x6c\x20\x46\122\117\x4d\40\155\x6f\156\145\143\141\155\40\x57\110\x45\x52\x45\x20\146\x65\143\150\141\74\75\x61\x2e\146\145\143\x68\x61\x64\157\143\40\117\x52\x44\105\x52\40\102\x59\x20\x66\145\x63\x68\x61\40\x44\105\x53\x43\x20\114\x49\115\x49\124\x20\61\51\x20\164\x61\163\x61\12\40\x20\40\x20\x46\122\117\x4d\x20\x63\x6f\x6d\x70\x72\141\163\40\x61\xa\40\40\40\40\112\x4f\x49\x4e\x20\x70\162\157\x76\145\x65\144\x20\142\x20\x4f\116\40\141\x2e\x70\162\x6f\166\145\145\144\75\142\56\x69\144\12\x20\40\40\40\x57\110\105\122\105\x20\142\56\x72\151\x66\x3d\x27{$dtfac2->rif}\x27\40\x26\x26\x20\141\56\164\151\160\157\x64\157\x63\75\x27\x46\x41\x43\x27")->row(); $nc = $this->db->query("\x53\105\x4c\105\103\x54\x20\122\x4f\x55\116\x44\x28\123\125\x4d\50\141\56\164\157\164\x61\154\144\51\x2c\62\x29\40\x74\x6f\x74\141\x6c\144\40\x46\122\x4f\x4d\40\x63\157\x6d\160\162\x61\163\x20\x61\x20\x4a\x4f\111\x4e\40\x70\162\157\x76\145\145\144\x20\142\40\117\x4e\40\141\x2e\160\162\x6f\166\145\145\x64\x3d\142\56\x69\x64\40\x57\110\105\x52\x45\40\x61\x2e\164\151\160\x6f\x64\157\x63\75\x27\x4e\x2f\x43\x27\40\46\x26\x20\142\x2e\162\x69\146\x3d\47{$dtfac2->rif}\x27\51")->row(); $ret = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\x52\x4f\x55\116\x44\50\x53\125\x4d\50\x61\x2e\x74\x6f\x74\x61\154\144\51\54\x32\51\40\164\x6f\x74\x61\154\144\x20\106\x52\117\x4d\40\x63\x6f\155\x70\x72\x61\x73\40\x61\x20\x4a\117\x49\116\40\160\162\x6f\x76\x65\145\x64\x20\x62\x20\117\116\x20\x61\56\x70\x72\157\x76\145\145\144\75\x62\56\x69\x64\x20\127\x48\x45\122\105\40\x61\x2e\164\x69\160\x6f\144\157\143\75\47\x52\x45\x54\x27\40\x26\x26\x20\x62\56\162\151\146\75\x27{$dtfac2->rif}\47\51")->row(); $debe = ROUND($dtfac->dolar - $nc->totald - $ret->totald - $dtfac->pdolar, 2); $monto = ROUND($debe * $dtfac->tasa, 2); $html .= "\74\x74\x72\x20\151\144\x3d\x22\x73\x6c\145\143\164" . $i . "\x22\40\x63\154\141\x73\x73\x3d\42\151\x74\145\x6d\42\76"; if ($debe <= 3) { $status = "\x4c\x69\163\x74\x6f"; $color = "\167\63\x2d\147\162\145\x65\156"; } else { $status = "\x50\145\156\144\151\145\x6e\x74\145"; $color = "\167\x33\55\x72\145\144"; } $html .= "\74\x69\156\x70\165\x74\x20\164\171\x70\145\75\x22\x68\x69\144\144\x65\156\42\x20\151\144\x3d\42\x61" . $i . "\42\x20\x6e\141\155\145\75\x22\x64\x6f\x63\x22\x20\166\141\154\x75\x65\75\x22" . $dtfac->rif . "\42\76\xa\40\x20\x20\40\x20\x20\40\x3c\164\x64\76\74\151\x6e\x70\165\164\x20\x74\x79\x70\145\x3d\x22\x63\x68\x65\143\x6b\142\x6f\x78\x22\40\x6f\x6e\x63\154\x69\143\x6b\75\42\167\x33\56\164\x6f\x67\x67\154\x65\x43\x6c\x61\x73\x73\50\47\x23\163\154\x65\x63\164" . $i . "\x27\54\x27\x77\x33\x2d\171\x65\154\x6c\157\167\47\x29\x3b\42\x20\x63\154\141\x73\x73\75\42\167\63\55\143\x68\x65\x63\153\42\40\156\141\155\145\x3d\x22\143\150\x65\143\x6b\143\x6c\151\42\76" . $dtfac->rif . "\x3c\57\164\x64\x3e\74\x74\x64\x3e" . $dtfac->nombre . "\x3c\57\x74\144\76\x3c\164\x64\x3e\x3c\142\x3e\101\156\164\72\x20\74\57\142\x3e" . $dtfac->totalfinal . "\40\74\x62\x3e\104\x65\163\160\x3a\40\x3c\57\142\76" . $dtfac->bs . "\x3c\57\x74\x64\x3e\x3c\x74\144\x3e\74\x62\76\124\117\124\72\40\74\57\x62\x3e" . $dtfac->dolar . "\x20\74\x62\76\116\57\x43\x3a\40\x3c\57\x62\x3e" . $nc->totald . "\40\74\142\x3e\122\105\124\72\x20\74\57\142\x3e" . $ret->totald . "\74\57\x74\x64\76\x3c\164\x64\x3e" . $dtfac->pbs . "\x20\74\x62\x3e\x42\x73\74\57\x62\x3e\40" . $dtfac->pdolar . "\x20\74\142\x3e\44\74\x2f\142\76\x3c\57\164\144\x3e\x3c\164\x64\x3e" . $monto . "\x20\x3c\x62\76\102\163\74\x2f\x62\76\x20" . $debe . "\x20\x3c\142\76\x24\74\x2f\x62\x3e\74\57\164\x64\76\x3c\164\144\40\x63\154\x61\163\x73\x3d\x22" . $color . "\x22\40\x6f\x6e\143\x6c\x69\143\x6b\x3d\x22\x69\164\x63\165\145\156\164\x61\x73\50\x24\50\x27\43\141" . $i . "\47\x29\x2e\166\141\154\50\x29\x29\x3b\42\x20\163\x74\x79\154\145\75\x22\143\x75\x72\x73\x6f\162\72\x70\157\x69\x6e\x74\x65\162\x22\x3e" . $status . "\74\57\x74\144\76\12\40\x20\40\40\40\x20\x20\40\x3c\x2f\164\x72\76"; } $html .= "\x3c\x21\55\x2d\x3c\x74\x72\76\x3c\x74\144\x20\x63\x6c\141\x73\163\x3d\42\167\x33\55\143\x65\156\x74\x65\162\40\x77\x33\x2d\146\157\x6e\x64\157\144\162\157\x69\x64\x22\x20\143\157\154\x73\160\141\x6e\x3d\42\x31\x31\x22\76\x3c\154\141\142\145\x6c\40\143\x6c\141\163\x73\75\42\167\x33\x2d\x6c\141\162\147\145\42\76\x3c\142\x3e\124\x6f\x74\141\154\x20\125\x6e\x69\x64\141\144\145\x73\x3a\x20" . $totalreg . "\74\x2f\142\x3e\74\x2f\154\x61\x62\145\x6c\76\74\x2f\164\144\76\x3c\57\164\162\76\x2d\x2d\x3e\x3c\57\x74\141\142\x6c\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\40\40\x20\x20\40\x20\74\163\x63\x72\151\x70\x74\x20\x74\x79\160\x65\x3d\42\164\x65\170\164\57\x6a\141\166\141\x73\143\x72\x69\160\164\x22\x3e\12\40\x20\40\40\x20\40\x20\x20\x66\x75\x6e\x63\164\x69\157\156\x20\104\x65\x63\x72\145\155\x65\x6e\164\x4e\x75\155\x63\172\141\x28\x29\173\40\x62\x65\146\157\x72\145\x28\51\73\xa\40\x20\x20\x20\40\40\x20\40\40\40\40\40\x76\141\x72\x20\104\145\x63\162\x65\x6d\x65\156\x74\116\x75\x6d\x3d\x64\x6f\143\165\155\x65\x6e\164\x2e\147\x65\x74\105\x6c\x65\155\145\x6e\164\102\171\x49\x64\x28\42\104\x65\x63\162\145\155\x65\x6e\x74\x4e\x75\155\42\51\x2e\x76\x61\x6c\x75\145\73\xa\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\166\141\x72\40\153\x65\x79\75\x22\x64\x72\157\x69\144\x39\60\x33\42\x3b\40\x76\x61\162\x20\x6c\151\153\145\x3d\44\x28\x22\x23\x6c\x69\153\145\146\141\143\42\51\x2e\x76\x61\x6c\50\x29\73\xa\40\40\x20\x20\40\x20\40\40\x20\40\40\40\x76\141\x72\40\144\x61\164\x6f\x73\x20\75\40\173\xa\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x22\x70\x61\147\x22\40\x3a\x20\x44\x65\143\162\x65\155\145\156\164\116\x75\155\54\12\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x22\153\145\x79\42\40\72\x20\x6b\x65\171\xa\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\x20\40\40\x7d\73\12\40\40\x20\x20\x20\40\40\x20\x20\40\40\xa\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x24\x2e\141\152\x61\170\50\x7b\12\40\x20\40\x20\40\x20\40\40\40\40\40\40\40\x20\40\40\x20\40\40\x64\141\x74\141\72\x20\144\141\x74\157\163\54\12\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\x75\162\154\72\x20\x20\x62\141\x73\x65\165\162\x6c\x2b\42\143\137\x64\x72\157\151\x64\57\143\165\145\x6e\x74\x61\x73\x5f\160\x61\x67\141\162\42\x2c\12\x20\x20\40\40\x20\40\40\40\40\40\x20\40\40\x20\40\x20\x20\40\40\164\x79\x70\x65\72\40\42\x50\117\x53\x54\x22\x2c\12\40\x20\40\40\40\40\x20\40\x20\x20\x20\40\40\40\x20\40\x20\40\40\x73\165\x63\143\145\163\x73\x3a\40\x66\x75\x6e\143\164\x69\157\x6e\50\144\141\164\141\x29\x20\x7b\xa\40\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x20\40\x20\40\x20\40\40\40\44\x28\x22\43\142\x6f\144\171\x22\51\x2e\150\x74\155\x6c\x28\x64\141\164\141\51\73\x20\x24\x28\x22\43\154\x69\153\x65\146\x61\143\x22\51\56\x76\x61\x6c\50\154\x69\153\x65\51\x3b\x20\x73\167\141\154\56\143\154\157\x73\145\x28\x29\73\12\40\40\x20\40\40\x20\x20\40\40\x20\40\40\x20\40\x20\40\40\x20\40\x7d\xa\x20\x20\x20\40\40\x20\40\40\40\x20\40\12\40\40\x20\40\40\x20\40\x20\40\x20\x20\40\x20\40\x20\x7d\51\x3b\12\x20\40\x20\40\40\x20\40\x20\x20\40\x20\175\12\40\40\40\40\40\x20\x20\x20\xa\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x66\x75\x6e\x63\164\x69\x6f\x6e\x20\156\165\x6d\160\x61\x67\143\172\x61\x28\141\x29\173\x20\x62\x65\146\x6f\162\145\x28\51\x3b\xa\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\166\141\162\x20\153\x65\171\x3d\x22\x64\162\x6f\x69\x64\x39\x30\x33\42\73\40\166\141\162\40\154\x69\x6b\x65\x3d\44\x28\42\43\x6c\151\x6b\145\x66\x61\x63\x22\x29\x2e\166\141\154\50\51\x3b\xa\40\40\x20\x20\x20\x20\40\40\xa\x20\40\40\40\40\40\40\40\x20\x20\40\40\166\x61\162\40\x64\x61\164\x6f\163\40\x3d\x20\x7b\xa\40\x20\40\40\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\40\40\40\x20\x22\153\145\x79\x22\72\153\x65\171\x2c\xa\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\x22\x70\x61\x67\42\40\72\40\141\12\x20\x20\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\175\73\xa\40\40\40\40\40\40\40\x20\40\x20\40\xa\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\44\56\x61\x6a\141\x78\50\x7b\xa\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\x64\x61\x74\141\x3a\40\x64\141\164\157\x73\54\xa\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\40\40\40\x20\40\40\x20\x20\165\x72\x6c\72\x20\x62\x61\163\145\x75\x72\x6c\53\x22\x63\137\x64\x72\x6f\151\x64\57\143\165\145\156\x74\141\163\137\160\x61\147\x61\162\x22\x2c\12\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\164\171\x70\145\x3a\x20\42\120\x4f\123\x54\x22\x2c\12\40\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\40\x73\165\x63\x63\x65\163\163\x3a\x20\x66\165\156\x63\x74\151\157\x6e\50\144\x61\x74\141\x29\40\x7b\xa\x20\40\x20\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\x20\40\40\40\x24\50\42\x23\x62\x6f\x64\x79\42\x29\x2e\x68\164\155\x6c\50\x64\141\164\141\x29\x3b\x20\44\x28\x22\43\x6c\x69\153\x65\x66\x61\x63\42\51\56\166\141\x6c\50\x6c\x69\x6b\145\x29\x3b\40\163\x77\141\154\56\x63\x6c\x6f\163\145\x28\x29\x3b\12\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\x20\175\xa\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\xa\40\40\40\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x7d\51\x3b\xa\40\40\40\40\40\40\x20\x20\40\40\40\175\xa\x20\40\x20\40\x20\40\40\40\xa\40\40\x20\x20\40\x20\40\x20\40\x20\40\146\165\x6e\143\164\x69\x6f\x6e\x20\x49\x6e\143\162\151\155\x65\x6e\164\x4e\165\155\143\x7a\141\x28\51\173\x20\142\145\x66\x6f\x72\145\50\x29\x3b\12\40\40\x20\40\x20\x20\x20\40\40\40\x20\x20\166\x61\x72\40\x49\156\143\x72\x69\x6d\145\x6e\x74\x4e\x75\x6d\x3d\144\x6f\143\x75\155\x65\x6e\x74\56\147\x65\x74\105\154\145\155\145\156\164\102\x79\x49\144\x28\42\111\x6e\x63\162\x69\x6d\x65\x6e\164\116\165\155\x22\x29\x2e\x76\141\x6c\165\x65\x3b\12\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x76\x61\162\40\153\x65\171\75\42\144\162\157\151\144\71\60\x33\42\73\x20\x76\141\162\x20\154\151\x6b\145\75\44\x28\42\x23\154\151\153\145\x66\x61\143\x22\x29\x2e\x76\x61\154\50\51\x3b\xa\40\40\40\x20\x20\40\x20\x20\40\40\40\40\166\x61\x72\40\x64\141\164\x6f\163\x20\x3d\x20\173\xa\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\x20\40\x20\40\40\x22\x6b\x65\x79\42\72\153\145\171\x2c\12\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\40\x22\x70\x61\147\42\40\x3a\40\x49\156\x63\x72\x69\155\x65\x6e\x74\x4e\x75\x6d\12\40\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x7d\x3b\12\x20\x20\x20\x20\40\40\40\40\x20\x20\40\12\x20\x20\40\40\x20\40\40\40\40\40\40\x20\x20\x20\40\44\x2e\141\152\141\170\50\173\12\x20\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x64\141\164\x61\x3a\40\144\x61\x74\x6f\163\x2c\xa\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\40\40\165\162\154\x3a\40\40\x62\x61\x73\145\x75\162\154\53\42\x63\137\144\162\x6f\x69\144\x2f\x63\x75\145\x6e\164\x61\x73\137\160\141\x67\x61\162\x22\54\12\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\40\x20\40\40\x20\x74\x79\160\x65\72\x20\42\120\117\123\124\42\54\12\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\40\163\x75\x63\143\145\x73\x73\x3a\40\146\x75\x6e\143\164\x69\x6f\x6e\x28\144\x61\164\141\51\40\173\xa\40\x20\x20\x20\40\x20\40\40\40\40\40\40\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x24\50\x22\x23\x62\x6f\144\171\x22\x29\x2e\x68\x74\155\x6c\x28\x64\x61\x74\141\x29\73\x20\44\x28\42\43\x6c\x69\x6b\x65\x66\141\x63\x22\51\56\166\141\154\50\x6c\151\153\145\x29\x3b\x20\x73\167\x61\x6c\56\143\154\157\x73\145\x28\x29\x3b\xa\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\x7d\xa\x20\40\40\x20\40\x20\40\x20\40\x20\40\12\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\175\x29\x3b\xa\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\x7d\xa\x20\x20\40\40\40\x20\x20\x20\x3c\57\x73\143\x72\x69\160\164\x3e\xa\x20\40\x20\40\x20\x20\40\x20\x3c\x64\x69\x76\x20\x63\154\141\x73\x73\75\42\167\63\55\x62\x61\162\40\x77\63\55\x62\x6f\162\x64\x65\x72\40\167\63\x2d\x62\x61\x72\x72\141\163\x22\76\12\x20\40\x20\40\x20\x20\x20\x20\74\x69\x6e\160\165\164\x20\x74\171\x70\145\x3d\42\x68\x69\144\x64\x65\x6e\42\x20\151\144\x3d\x22\x44\x65\143\162\145\155\x65\156\164\x4e\x75\155\42\x20\x76\x61\154\x75\145\75\42" . $DecrementNum . "\x22\76\xa\x20\40\x20\40\x20\x20\40\x20\74\x61\40\157\156\143\154\x69\143\x6b\75\x22\x44\x65\143\x72\145\155\x65\156\x74\x4e\x75\155\x63\172\x61\50\x29\x3b\42\x20\x63\154\141\163\x73\x3d\42\x77\x33\55\142\x61\x72\x2d\151\x74\145\155\x20\167\x33\x2d\142\x75\164\164\157\x6e\42\76\x26\x6c\x61\161\x75\x6f\x3b\74\57\141\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\x64\160\141\147\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\146\x6f\x6e\144\157\x64\x72\x6f\x69\x64"; $html .= "\xa\40\40\40\40\x20\x20\40\x20\x3c\151\156\x70\x75\164\40\164\x79\160\145\x3d\42\150\151\x64\144\x65\x6e\x22\40\151\144\x3d\x22" . $id . "\42\x20\166\141\154\x75\145\75\x22" . $i . "\x22\76\xa\x20\40\x20\40\40\40\x20\x20\x3c\141\40\x6f\156\143\154\x69\143\153\x3d\42\x6e\165\x6d\x70\141\147\143\172\141\50\44\50\x27\43" . $id . "\47\51\56\x76\x61\154\50\x29\51\73\x22\x20\x63\x6c\x61\x73\163\75\42\x77\x33\55\x62\x61\x72\x2d\x69\164\x65\x6d\40\167\x33\55\x62\x75\x74\164\157\x6e\40" . $hover . "\42\x3e" . $i . "\x3c\x2f\x61\x3e"; } else { $hover = ''; $html .= "\74\x69\156\160\x75\164\40\164\171\160\x65\x3d\42\150\151\x64\x64\x65\x6e\x22\40\x69\144\75\x22" . $id . "\42\x20\x76\x61\154\165\x65\75\42" . $i . "\42\76\xa\40\40\40\40\40\x20\x20\40\74\x61\40\157\156\x63\154\x69\143\153\x3d\x22\x6e\165\155\160\x61\x67\x63\172\x61\x28\x24\50\47\x23" . $id . "\x27\x29\x2e\x76\x61\154\50\51\51\73\x22\x20\143\154\x61\163\163\x3d\x22\167\x33\x2d\x62\x61\162\55\x69\164\145\155\x20\x77\63\x2d\x62\165\x74\x74\157\156\40" . $hover . "\x22\76" . $i . "\x3c\57\x61\76"; } } } $html .= "\74\x69\x6e\160\x75\x74\40\x74\171\x70\x65\75\x22\150\x69\x64\x64\145\156\x22\x20\151\x64\x3d\x22\111\156\x63\162\151\155\145\x6e\x74\116\x75\x6d\42\40\x76\x61\x6c\x75\145\75\x22" . $IncrimentNum . "\x22\76\12\x20\40\x20\40\x20\40\40\40\74\141\x20\157\156\143\154\x69\143\x6b\x3d\x22\111\x6e\143\x72\x69\x6d\145\156\164\x4e\x75\155\143\x7a\141\x28\x29\73\42\40\x63\x6c\x61\163\x73\x3d\42\x77\63\55\142\x61\x72\x2d\x69\x74\145\155\x20\167\63\55\142\x75\164\x74\x6f\156\x22\76\x26\162\141\x71\x75\x6f\73\74\57\x61\x3e\xa\xa\40\40\x20\40\x20\40\x20\x20\x3c\57\144\x69\x76\x3e\40"; return $html; } public function itcuentas($a) { $bditfac = $this->db->query("\x53\x45\x4c\105\103\x54\x20\x61\56\x74\151\x70\157\144\x6f\143\x2c\141\56\x64\157\x63\x75\x6d\x65\x6e\x74\x6f\54\x61\x2e\x66\x65\143\150\x61\x64\157\143\40\x66\x65\143\x68\x61\x63\x72\x65\x61\x2c\x62\56\x72\151\146\x2c\x61\56\x74\157\x74\x61\154\144\40\x64\x6f\154\141\x72\54\x61\x2e\x74\x6f\164\x61\x6c\x66\x69\x6e\141\154\x2c\x28\x53\x45\114\105\x43\124\x20\144\151\141\163\x20\x46\x52\117\x4d\x20\157\x72\144\x63\40\x57\x48\105\x52\x45\x20\x6e\160\162\145\163\75\141\x2e\144\x6f\x63\165\x6d\x65\156\x74\157\40\46\46\40\160\x72\x6f\x76\145\x65\x64\75\142\56\x69\x64\x29\40\144\x69\x61\x73\54\12\40\x20\x20\x20\50\x53\x45\x4c\x45\x43\x54\x20\x6d\x6f\x6e\145\x64\141\40\106\x52\117\x4d\40\157\x70\145\x72\x70\x72\x6f\166\40\167\150\145\162\x65\x20\151\144\x66\x61\143\75\x61\x2e\x64\157\143\x75\x6d\145\156\164\157\x20\147\x72\157\x75\160\40\x62\171\40\x6d\x6f\x6e\145\144\x61\40\x6c\151\x6d\151\x74\x20\x31\x29\40\164\151\160\x6f\160\141\147\x2c\12\x20\x20\40\x20\50\x53\x45\114\x45\103\124\40\x6f\x66\x69\143\x69\x61\154\40\106\x52\x4f\115\40\x6d\157\156\x65\x63\141\x6d\x20\127\x48\105\x52\x45\x20\x66\x65\x63\150\x61\74\75\141\x2e\146\145\143\x68\141\144\157\x63\40\x4f\x52\x44\105\x52\x20\x42\x59\40\x66\x65\x63\150\x61\x20\x44\x45\x53\103\40\x4c\111\115\x49\124\x20\61\x29\40\164\x61\x73\x61\x6f\162\x67\12\x20\40\40\x20\x46\122\x4f\x4d\40\x63\157\x6d\x70\x72\x61\163\40\141\xa\x20\40\x20\x20\x4a\x4f\x49\x4e\40\160\x72\157\x76\145\145\x64\x20\142\x20\x4f\116\40\141\x2e\x70\162\157\166\145\x65\144\x3d\x62\x2e\x69\x64\xa\40\x20\x20\x20\127\x48\x45\x52\x45\x20\142\56\162\x69\146\75\x27{$a}\47\x20\x26\x26\40\141\x2e\164\x69\x70\157\144\x6f\x63\x3d\x27\106\101\x43\47\12\x20\x20\40\40\107\x52\117\125\x50\x20\102\131\40\x61\56\144\157\143\165\x6d\145\156\164\x6f\40\117\x52\x44\105\122\x20\102\x59\x20\x61\x2e\x64\x6f\x63\x75\x6d\145\x6e\164\x6f\x20\104\105\123\x43")->result(); $html = "\12\40\40\40\40\74\144\151\x76\x20\x63\154\141\163\x73\x3d\42\167\63\55\146\x69\x6a\x6f\42\76\12\x20\40\x20\x20\x3c\141\40\157\x6e\143\154\151\x63\153\75\x22\166\151\x65\x77\x61\x75\144\151\164\x61\x70\x61\x67\62\x28\x29\x3b\x22\x20\x63\x6c\141\x73\163\75\x22\x77\x33\55\x62\164\156\x22\76\74\151\x6d\x67\40\163\x72\x63\75\42" . base_url() . "\151\155\x61\147\145\x73\x2f\x66\x61\143\x74\165\162\x61\x2e\x70\156\147\42\40\141\x6c\x74\x3d\42\105\163\164\x61\144\x6f\x20\x43\165\x65\156\164\141\x73\42\x20\164\151\164\154\145\75\x22\105\163\164\141\x64\157\x20\x43\165\145\x6e\164\x61\x73\x22\x20\163\164\x79\154\145\x3d\x22\167\x69\144\x74\150\72\62\60\x70\x78\x3b\x68\145\x69\x67\150\x74\x3a\62\60\160\170\73\x62\x6f\x72\x64\x65\x72\x3a\60\x3b\42\x3e\74\57\141\76\xa\40\x20\x20\x20\74\x61\x20\x6f\156\143\154\151\x63\x6b\75\42\155\157\166\x62\x61\x6e\143\x32\50\x29\x3b\42\x3e\x3c\x69\155\x67\x20\x73\162\143\75\42" . base_url() . "\151\155\141\147\145\x73\x2f\x64\151\x6e\x65\x72\157\56\160\156\x67\x22\40\x61\x6c\164\x3d\x22\x43\157\156\x73\x6f\154\151\144\141\x64\x6f\40\x42\141\156\143\141\162\x69\157\x22\40\x74\151\164\x6c\145\75\x22\103\157\x6e\163\x6f\x6c\x69\x64\141\144\x6f\40\x42\141\x6e\143\x61\162\151\x6f\x22\x20\x73\164\171\x6c\145\x3d\42\167\151\x64\164\150\72\x32\x30\160\x78\73\150\145\151\147\150\x74\x3a\62\x30\160\x78\x3b\x62\x6f\x72\x64\x65\x72\72\x30\73\x22\x3e\xa\40\40\40\x20\74\141\x20\157\x6e\x63\154\151\143\x6b\x3d\42\146\x6f\x72\x6d\160\141\x67\x6f\x73\62\50\51\73\x22\76\x3c\151\155\147\x20\163\162\x63\75\42" . base_url() . "\151\155\x61\147\145\x73\x2f\x69\x63\x6f\x6e\x70\x61\x67\62\56\160\x6e\x67\42\40\141\x6c\x74\75\42\x52\x65\147\151\163\x74\x72\141\x72\x20\x50\x61\147\x6f\x22\x20\164\x69\164\154\x65\75\x22\122\145\147\151\x73\x74\x72\x61\162\40\120\141\147\x6f\x20\x45\x66\x65\x63\164\x69\166\x6f\42\x20\x73\x74\171\x6c\x65\x3d\x22\x77\151\144\x74\x68\x3a\x32\60\x70\170\73\150\x65\151\147\x68\164\x3a\62\x30\160\x78\x3b\x62\157\x72\x64\x65\x72\72\60\x3b\x22\76\12\x20\x20\40\40\x3c\141\x20\157\x6e\143\154\x69\143\x6b\75\42\x65\154\x69\x6d\160\141\x67\157\x28\51\73\42\x20\x63\154\x61\163\163\75\42\x77\x33\x2d\142\x74\x6e\42\x3e\x3c\x69\155\147\40\x73\x72\143\x3d\42" . base_url() . "\151\x6d\141\147\x65\163\x2f\x65\154\151\155\x70\x61\147\157\56\160\156\147\42\40\x61\154\x74\x3d\x22\105\x6c\151\155\151\x6e\141\x72\x20\x50\141\x67\157\x22\40\164\151\164\154\145\75\42\105\x6c\151\x6d\151\x6e\141\162\40\x50\x61\x67\x6f\42\40\163\x74\171\154\x65\x3d\x22\x77\151\144\164\x68\72\x32\60\160\170\x3b\150\145\151\x67\150\x74\72\x32\60\x70\170\73\x62\157\162\x64\145\x72\x3a\x30\73\x22\76\x3c\57\x61\x3e\12\x20\40\40\40\74\x2f\x64\x69\x76\76\12\x20\x20\40\40\x3c\164\141\142\154\145\40\143\x6c\x61\163\x73\x3d\42\167\63\55\x74\x61\x62\154\145\55\141\x6c\154\x20\167\63\55\150\x6f\x76\145\x72\x61\142\154\x65\x20\167\x33\x2d\154\x65\146\164\55\x61\x6c\151\147\156\40\x77\63\x2d\164\151\156\171\42\40\163\x74\x79\154\145\75\x22\x77\x69\x64\x74\150\72\61\60\60\45\73\42\x3e\74\164\x72\x20\x63\154\141\163\163\75\x22\167\63\x2d\146\x6f\156\x64\157\x64\x72\157\151\144\40\x77\63\55\x66\x69\x6a\157\42\x3e\74\164\x68\76\104\157\x63\165\155\x65\156\x74\157\74\x2f\x74\150\x3e\74\164\x68\x3e\x54\x69\160\157\74\x2f\x74\150\76\74\x74\x68\x3e\x4e\57\104\x3c\57\164\150\x3e\74\x74\150\x3e\106\145\143\x68\141\x3c\57\164\x68\76\74\x74\150\x3e\x52\x65\143\145\x70\x63\x69\x6f\156\74\57\x74\150\x3e\74\164\x68\x3e\x56\x65\x6e\143\x65\x3c\x2f\x74\150\76\x3c\x74\x68\x3e\x54\157\x74\141\154\40\x42\x73\74\57\164\150\x3e\74\x74\150\x3e\111\x6e\144\145\x78\x20\102\x73\x3c\57\x74\150\x3e\12\40\40\40\x20\x3c\x74\x68\76\x54\x6f\x74\x61\x6c\40\44\x3c\57\164\150\x3e\74\x74\x68\x3e\x50\x61\147\141\144\x6f\74\x2f\x74\150\x3e\74\164\x68\76\x44\145\142\145\x3c\57\164\x68\x3e\x3c\164\x68\76\105\163\164\x61\x74\x75\163\74\x2f\x74\x68\x3e\74\x2f\164\162\x3e"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $tasa = $this->db->query("\123\x45\114\105\x43\x54\x20\111\106\50\142\56\x66\x65\143\x68\x64\x6f\x6c\141\x72\x3d\47\60\x30\60\x30\x2d\60\60\55\60\x30\47\x2c\111\106\50\x43\125\x52\x44\x41\124\105\x28\51\74\75\x44\x41\x54\x45\x5f\101\x44\x44\50\141\56\162\145\143\145\160\x63\151\x6f\x6e\x2c\111\116\124\x45\x52\126\x41\114\40\141\56\144\151\x61\163\151\156\144\145\x78\40\104\101\131\x29\54\50\x53\105\114\105\x43\124\40\x6f\146\x69\143\151\141\x6c\x20\106\122\x4f\115\40\x6d\x6f\156\x65\143\141\155\x20\127\110\x45\x52\x45\x20\x66\145\x63\x68\141\x3c\75\141\x2e\146\145\x63\150\x61\x63\162\x65\141\40\x4f\x52\x44\x45\x52\x20\x42\131\x20\x66\x65\x63\x68\x61\40\x44\105\123\103\x20\x4c\111\x4d\x49\124\x20\61\x29\x2c\x28\x53\x45\114\105\103\124\40\x6f\146\151\143\x69\x61\154\x20\106\122\x4f\115\x20\155\157\156\145\x63\141\155\x20\x4f\x52\x44\105\x52\x20\x42\x59\x20\146\x65\143\x68\141\40\104\x45\123\x43\x20\114\111\115\111\x54\x20\x31\51\x29\54\x49\x46\50\142\56\146\145\x63\x68\144\157\x6c\141\162\x3c\75\x44\101\x54\x45\137\x41\x44\x44\50\141\56\162\145\143\x65\x70\x63\x69\x6f\156\54\x49\116\x54\105\x52\126\101\114\x20\x61\56\x64\151\x61\163\151\x6e\x64\x65\170\x20\x44\x41\x59\x29\54\x28\x53\105\x4c\105\x43\x54\40\x6f\146\151\x63\151\141\154\x20\x46\122\x4f\x4d\x20\155\x6f\156\x65\x63\141\x6d\x20\x57\110\x45\122\x45\40\146\x65\x63\150\141\x3c\75\x61\56\x66\145\143\150\x61\x63\x72\x65\x61\x20\x4f\122\x44\x45\122\40\x42\131\40\146\145\143\150\141\x20\x44\105\x53\x43\40\114\x49\x4d\111\x54\40\x31\x29\x2c\x28\123\x45\114\x45\103\x54\40\x6f\146\x69\143\x69\141\154\40\x46\x52\117\115\40\155\x6f\156\x65\143\141\x6d\x20\x57\x48\x45\x52\105\40\146\145\x63\x68\141\x3c\x3d\142\x2e\x66\145\x63\150\144\157\x6c\141\162\40\x4f\122\x44\105\122\x20\x42\x59\x20\x66\x65\x63\x68\141\40\104\x45\123\x43\x20\114\111\x4d\x49\124\x20\x31\51\51\51\40\x6e\40\106\x52\x4f\x4d\40\157\x70\x65\x72\x74\x69\x20\141\40\112\x4f\x49\116\40\x63\x6f\x6e\x74\x72\157\x6c\137\157\x70\145\162\x74\x69\40\x62\40\x4f\x4e\40\x61\x2e\x61\x6e\x74\144\157\143\x3d\142\56\x64\x6f\x63\x20\127\110\x45\x52\105\40\141\x2e\144\157\x63\x75\x6d\145\x6e\164\157\x3d\47{$dtitfac->documento}\47\x20\46\46\40\50\x61\x2e\x74\x69\160\x6f\144\x6f\143\x3d\47\x4e\117\124\x27\40\x7c\174\x20\x61\x2e\164\151\160\x6f\x64\157\x63\75\x27\106\101\103\x27\51\x20\x4c\111\x4d\x49\x54\40\61")->row(); $pagado = $this->db->query("\x53\105\x4c\x45\103\x54\x20\x49\106\x28\123\x55\115\x28\142\61\x2e\155\157\156\164\157\51\76\x30\54\x20\x53\x55\115\x28\x62\61\x2e\155\x6f\156\164\157\51\x2c\60\x29\40\142\x73\54\x49\106\x28\123\125\115\x28\x62\x31\x2e\155\x6f\x6e\164\157\144\x29\76\60\54\x20\123\125\115\x28\142\x31\x2e\155\157\x6e\x74\157\144\x29\54\x30\51\40\144\x6f\x6c\x61\162\40\x46\122\117\x4d\40\x6f\x70\145\162\x63\154\151\40\142\x31\x20\x57\x48\105\x52\x45\x20\142\x31\56\x69\x64\146\141\143\75\x27{$dtitfac->documento}\47\x20\46\x26\x20\x62\61\56\x69\x64\x63\x6f\x6e\x73\x62\141\x6e\143\40\111\x53\x20\116\117\124\x20\116\x55\x4c\114")->row(); $nc = $this->db->query("\123\x45\114\x45\x43\124\x20\151\146\x28\x52\x4f\x55\x4e\104\50\123\x55\x4d\x28\164\x6f\x74\x61\x6c\144\51\x2c\x32\51\76\60\x2c\x52\117\125\x4e\x44\x28\x53\125\115\x28\x74\x6f\x74\141\x6c\x64\x29\54\x32\x29\54\x30\x29\x20\164\157\x74\141\x6c\x64\40\x46\122\117\x4d\40\141\160\154\151\143\141\156\x63\x20\x57\110\x45\x52\x45\x20\x66\x61\143\x3d\x27{$dtitfac->documento}\47")->row(); $ret = $this->db->query("\123\x45\x4c\105\x43\x54\40\x69\146\x28\122\117\125\116\104\50\x53\x55\x4d\50\x61\56\x74\157\164\141\x6c\x66\x69\x6e\x61\154\x2f\50\x53\105\x4c\105\x43\124\40\x6f\x66\151\143\151\141\x6c\40\x46\x52\117\x4d\40\x6d\x6f\156\145\143\x61\x6d\40\127\x48\105\122\x45\x20\146\x65\x63\150\141\74\x3d\141\x2e\146\x65\143\150\x61\x63\x72\145\141\x20\x4f\122\104\105\122\40\102\x59\40\x66\145\143\x68\x61\40\x44\105\123\x43\x20\114\x49\115\x49\x54\x20\x31\51\51\54\x32\x29\76\x30\54\x52\117\125\116\104\x28\x53\125\x4d\50\141\x2e\164\x6f\x74\141\154\146\x69\156\141\x6c\57\x28\x53\105\x4c\x45\x43\124\40\x6f\146\x69\x63\151\141\x6c\x20\106\122\x4f\115\x20\155\x6f\156\x65\x63\x61\x6d\40\127\110\105\x52\105\x20\x66\x65\x63\150\141\74\x3d\141\x2e\x66\145\x63\150\x61\x63\x72\145\x61\40\117\122\x44\x45\122\40\102\x59\x20\x66\x65\143\150\x61\x20\x44\x45\x53\x43\40\114\111\115\111\x54\x20\x31\x29\x29\54\62\51\x2c\x30\x29\x20\164\157\x74\141\x6c\144\x20\106\x52\117\115\x20\x6f\160\x65\x72\164\151\40\x61\40\127\110\x45\122\105\x20\141\x2e\141\x6e\164\x64\x6f\x63\x3d\47{$dtitfac->antdoc}\47\40\x26\46\40\x61\x2e\x74\151\x70\157\x64\157\143\x3d\47\x52\105\124\x27")->row(); if ($tasa->n < $dtitfac->tasaorg) { $tasa->n = $dtitfac->tasaorg; } $bs = ($dtitfac->dolar - $nc->totald) * $tasa->n; $bsorg = ($dtitfac->dolar - $nc->totald) * $dtitfac->tasaorg; $debe = ROUND($dtitfac->dolar - $nc->totald - $ret->totald - $pagado->dolar, 2); $bdnd = $this->db->query("\123\105\x4c\x45\103\124\40\x64\157\x63\x75\155\x65\156\164\157\54\x52\117\x55\x4e\x44\x28\164\x6f\164\x61\154\146\x69\156\141\154\x2c\x32\51\40\164\157\x74\x61\154\146\x69\156\x61\154\40\x46\122\x4f\x4d\40\x6f\160\145\x72\x74\x69\x20\x57\110\x45\122\x45\40\x61\156\164\144\157\x63\75\47{$dtitfac->antdoc}\47\40\46\46\40\x74\151\160\157\x64\157\143\75\x27\116\x2f\x44\47\x20\x26\46\40\50\x65\x73\164\141\164\x75\x73\x64\157\x63\x3d\47\x31\x27\x20\174\x7c\x20\x65\x73\x74\141\164\x75\163\144\x6f\143\75\47\x30\x27\51")->row(); if ($bdnd->documento > 0) { $nd = $bdnd->documento; $index = $bdnd->totalfinal; } else { $nd = "\x4e\x2f\101"; if ($bs > $bsorg) { $index = ROUND($bs - $bsorg, 2); } else { $index = 0; } } if ($debe <= 0.55) { $status = "\x4c\x69\163\164\x6f"; $color = "\x77\x33\55\x67\x72\x65\x65\156"; $this->indexfac($dtitfac->antdoc); } else { $status = "\x50\145\156\x64\151\x65\156\164\x65"; $color = "\167\63\55\x72\x65\x64"; } if ($dtitfac->promo == "\x53") { $promo = "\143\x6c\x61\163\163\75\x22\167\x33\55\160\151\x6e\x6b\x22"; } else { $promo = ''; } $monto = ROUND($debe * $tasa->n, 2); $html .= "\74\164\162\x20\x69\x64\75\x22\x73\154\145\x63\x74\x32" . $i . "\42\x3e\x3c\151\x6e\160\x75\164\x20\164\x79\x70\x65\x3d\x22\150\x69\144\x64\x65\x6e\42\40\x6e\x61\x6d\145\x3d\x22\144\157\143\62\42\x20\166\x61\x6c\165\145\x3d\42" . $dtitfac->documento . "\42\76\74\151\x6e\x70\x75\164\x20\164\171\x70\x65\x3d\42\x68\x69\x64\x64\x65\x6e\x22\40\x6e\x61\155\145\75\42\164\x69\x70\157\144\x6f\x63\42\x20\x76\141\154\x75\145\75\42" . $dtitfac->tipodoc . "\x22\x3e\12\x20\x20\x20\x20\x20\x20\40\x20\x3c\151\156\x70\165\164\40\164\x79\x70\x65\x3d\x22\150\151\144\x64\x65\x6e\42\40\156\x61\155\x65\75\x22\x73\x74\x61\164\x75\x73\x22\x20\x76\141\154\165\x65\x3d\x22" . $status . "\x22\76\74\151\156\160\x75\164\x20\164\171\160\145\x3d\x22\x68\x69\144\144\145\156\x22\x20\x6e\141\155\145\x3d\42\x6d\157\x6e\164\x6f\x22\x20\166\x61\x6c\165\x65\x3d\x22" . $monto . "\x22\x3e\x3c\x69\156\160\165\x74\40\164\x79\160\x65\x3d\x22\150\x69\144\144\x65\156\42\40\156\x61\x6d\x65\75\x22\x64\x6f\154\141\x72\42\x20\x76\x61\154\x75\145\x3d\x22" . $debe . "\x22\x3e\xa\40\x20\x20\40\x20\x20\40\x20\x3c\x69\x6e\x70\165\164\40\x74\x79\x70\x65\x3d\42\150\x69\x64\x64\x65\x6e\42\40\156\x61\155\x65\75\x22\x63\154\151\62\x22\40\x76\141\x6c\165\145\x3d\42" . $dtitfac->codcliente . "\42\x3e\xa\x20\40\40\x20\40\40\40\40\x3c\164\x64\x20" . $promo . "\x3e\74\x69\x6e\x70\x75\x74\40\x74\x79\160\145\75\x22\x63\x68\145\143\x6b\x62\157\x78\42\40\157\x6e\143\154\151\143\x6b\x3d\42\167\x33\56\164\157\x67\147\154\x65\103\x6c\141\x73\x73\50\x27\x23\x73\x6c\145\143\x74\62" . $i . "\47\54\x27\167\63\55\171\x65\x6c\x6c\157\167\47\x29\73\42\40\x63\x6c\x61\x73\163\75\x22\167\63\55\143\x68\x65\x63\153\x22\x20\156\x61\x6d\x65\x3d\42\x63\x68\145\143\x6b\x22\x3e" . $dtitfac->documento . "\x20\x3c\142\76\x54\x61\x73\x61\x3c\x2f\x62\x3e\40" . $dtitfac->tasaorg . "\x3c\57\164\x64\x3e\x3c\x74\144\x3e" . $dtitfac->tipodoc . "\x3c\57\164\x64\76\74\x74\144\x3e" . $nd . "\74\x2f\x74\144\76\x3c\164\x64\x3e" . $dtitfac->fechacrea . "\x3c\x2f\164\144\x3e\xa\x20\40\x20\x20\x20\x20\x20\x20\x3c\x74\x64\x3e" . $dtitfac->recepcion . "\74\x2f\x74\x64\x3e\74\x74\144\x3e\x3c\142\76\x56\56\111\72\x20\74\57\x62\76" . $dtitfac->vence . "\40\74\142\x3e\x56\x2e\103\x3a\x20\74\57\x62\x3e" . $dtitfac->vencec . "\74\x2f\x74\144\x3e\74\x74\144\x3e\74\x62\x3e\101\x6e\x74\x3a\40\x3c\x2f\x62\76" . ROUND($bsorg, 2) . "\x20\x3c\x62\x3e\x44\x65\163\x70\72\x20\x3c\57\142\x3e" . ROUND($bs, 2) . "\74\57\x74\x64\76\74\x74\x64\x3e" . $index . "\x20\x3c\x62\x3e\124\141\x73\x61\72\x3c\x2f\x62\x3e\40" . $tasa->n . "\40\74\x62\x3e\104\141\171\72\x3c\57\x62\x3e\x20" . $dtitfac->diasindex . "\x3c\57\164\x64\76\12\40\40\x20\x20\x20\x20\40\x20\x3c\x74\x64\76\x3c\x62\76\124\117\124\x3a\40\x3c\x2f\x62\x3e" . $dtitfac->dolar . "\x20\74\142\76\116\x2f\103\72\40\74\x2f\142\x3e" . $nc->totald . "\x20\74\x62\x3e\122\x45\124\72\40\x3c\57\x62\x3e" . $ret->totald . "\74\x2f\164\144\76\x3c\x74\x64\76" . $pagado->bs . "\40\x3c\142\76\102\x73\74\x2f\x62\x3e\40" . $pagado->dolar . "\40\x3c\142\76\x24\x3c\x2f\x62\76\74\57\164\x64\76\74\164\x64\x3e" . $monto . "\x20\x3c\x62\76\x42\163\x3c\x2f\x62\76\40" . $debe . "\x20\74\142\x3e\x24\74\x2f\x62\x3e\x3c\57\x74\x64\76\12\40\40\40\x20\40\x20\x20\40\x3c\164\144\40\x63\x6c\141\163\x73\x3d\x22" . $color . "\40\167\63\55\x63\145\156\164\145\x72\42\x3e" . $status . "\74\x2f\164\x64\x3e\xa\x20\40\40\40\40\40\x20\40\74\57\164\x72\76"; } $html .= "\74\57\164\141\142\154\145\76\xa\x20\x20\40\x20"; return $html; } public function cobranza_igtf($a, $b) { $this->conciliabanc(); $this->load->library("\x74\141\x62\154\145"); if ($b != '') { $filter = "\46\46\40\x28\x61\x2e\x64\157\x63\x75\155\x65\x6e\x74\157\x3d\x27{$b}\47\40\x7c\174\x20\x61\56\143\x6f\x64\143\x6c\151\145\x6e\x74\x65\75\x27{$b}\x27\40\x7c\174\40\x61\x2e\156\157\155\x62\162\x65\143\154\151\40\114\111\113\105\40\47\45{$b}\x25\47\40\x7c\x7c\40\141\x2e\166\145\x6e\x64\145\144\157\162\x20\154\151\x6b\x65\x20\x27\x25{$b}\x25\x27\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\x4c\x45\103\124\40\x4e\125\x4c\x4c\12\x20\40\x20\x20\x20\40\40\x46\122\x4f\x4d\40\157\x70\145\162\x74\x69\x20\141\12\x20\x20\40\40\x20\40\x20\127\x48\105\122\x45\40\x61\x2e\164\151\160\x6f\144\x6f\143\x3d\x27\x4e\x2f\x44\47\40{$filter}\40\46\x26\x20\x65\x73\164\141\164\x75\x73\144\x6f\143\41\x3d\47\x58\x27\x20\46\46\40\141\x2e\x64\x6f\143\165\x6d\145\156\164\157\146\x69\x73\x63\x61\154\x3d\x27\111\x47\x54\x46\x27\12\40\40\x20\40\40\40\40\107\x52\117\125\120\40\x42\131\40\x61\x2e\x63\157\x64\143\154\151\x65\x6e\x74\x65")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\x45\114\105\x43\x54\40\x61\x2e\x63\157\x64\143\x6c\151\x65\x6e\164\145\54\x52\117\125\116\x44\x28\111\x46\50\123\125\115\x28\141\x2e\x74\157\164\141\x6c\144\51\76\x30\x2c\x20\123\x55\x4d\50\141\56\x74\x6f\164\x61\154\144\51\x2c\x30\x29\54\62\51\40\x64\x6f\x6c\141\162\x20\x46\122\117\x4d\x20\157\x70\145\x72\x74\x69\40\x61\12\x20\40\x20\x20\x4a\117\x49\x4e\40\157\x70\145\162\x6d\x76\40\142\40\x4f\x4e\40\50\x62\x2e\x64\x6f\x63\165\155\x65\x6e\164\157\x3d\x61\x2e\144\x6f\143\165\x6d\145\156\x74\157\x20\x26\x26\x20\x62\56\164\x69\x70\x6f\144\x6f\x63\75\141\x2e\x74\x69\x70\157\x64\x6f\x63\x20\x26\46\x20\142\x2e\156\157\x6d\x62\x72\145\x20\x4c\111\113\x45\x20\x27\x25\x43\157\x62\x72\157\40\x49\107\124\106\45\47\x29\xa\40\40\x20\x20\127\x48\105\122\x45\x20\141\x2e\x74\151\x70\157\144\x6f\143\x3d\x27\x4e\x2f\x44\47\x20" . $filter . "\40\46\x26\x20\x65\x73\x74\141\x74\165\163\144\x6f\143\41\x3d\47\x58\x27\xa\40\x20\40\40\x47\x52\x4f\125\120\40\102\x59\x20\141\x2e\x63\157\x64\143\154\151\x65\x6e\164\x65\x20\x4f\x52\104\x45\122\x20\102\131\40\144\x6f\154\141\162\40\104\105\123\103\x20\x20\114\x49\115\x49\x54\x20" . ($a - 1) * $mostrar . "\40\54\x20" . $mostrar . '')->result(); $html = "\xa\x20\x20\40\x20\x3c\x74\x61\142\154\145\40\x63\154\141\x73\x73\75\x22\167\63\55\x74\x61\142\x6c\x65\x2d\141\x6c\x6c\x20\x77\x33\x2d\150\x6f\x76\145\162\141\x62\154\x65\40\167\x33\55\154\145\146\x74\x2d\x61\154\x69\x67\156\42\76\xa\x20\x20\40\40\x3c\x74\x72\76\x3c\164\144\x20\x63\x6c\x61\163\163\75\x22\167\x33\55\x66\157\156\x64\157\144\x72\x6f\x69\144\x22\x3e\x42\165\163\143\141\x72\40\74\151\x6d\x67\40\163\x72\143\x3d\42" . base_url() . "\x69\155\141\x67\x65\163\57\142\x75\163\x63\141\x72\56\x70\156\x67\42\40\x61\154\x74\x3d\42\102\165\163\x63\x61\162\x22\x20\164\x69\164\154\145\x3d\x22\x42\165\163\143\x61\x72\42\40\x73\164\x79\x6c\x65\75\42\x77\151\144\164\150\72\x31\x38\160\x78\x3b\142\157\162\144\x65\162\72\60\73\x22\x3e\74\57\x74\144\x3e\xa\40\x20\40\x20\74\164\x64\76\x3c\x69\156\x70\165\164\x20\x74\171\x70\145\75\x22\164\x65\170\x74\x22\x20\x63\x6c\x61\x73\163\x3d\x22\x77\63\55\151\x6e\160\165\164\42\40\160\154\141\x63\145\150\157\154\144\145\x72\75\x22\111\156\147\162\145\x73\x65\x20\163\x75\x20\x62\165\x73\161\x75\145\x64\141\42\x20\157\156\x63\x68\x61\x6e\x67\145\x3d\x22\143\x6f\142\162\x61\x6e\x7a\x61\x5f\151\147\164\146\50\x29\x3b\x22\40\151\x64\75\42\154\x69\x6b\145\x66\x61\143\x22\76\x3c\57\x74\x64\x3e\12\40\40\40\x20\74\164\x64\x20\x63\x6c\141\163\x73\75\x22\167\63\55\x63\145\156\164\145\162\x20\x77\x33\x2d\142\x74\x6e\x22\x3e\74\x61\40\x6f\156\x63\x6c\x69\x63\153\75\42\x6d\x6f\x76\142\141\x6e\143\x28\x29\x3b\x22\x3e\x3c\151\155\147\40\x73\x72\x63\x3d\x22" . base_url() . "\x69\x6d\x61\x67\145\x73\57\144\x69\x6e\145\x72\x6f\56\x70\x6e\x67\x22\x20\141\x6c\164\75\42\103\x6f\x6e\x73\157\154\151\144\141\144\x6f\x20\x42\x61\x6e\x63\x61\162\x69\x6f\42\40\x74\151\x74\x6c\x65\75\x22\103\157\x6e\163\x6f\x6c\151\144\x61\x64\157\40\x42\141\x6e\143\x61\x72\151\157\x22\x20\163\164\171\154\145\75\42\x77\151\144\164\150\x3a\62\x30\x70\x78\73\x68\145\151\x67\x68\164\72\62\x30\160\x78\73\142\x6f\162\x64\x65\x72\x3a\60\73\42\76\x3c\x2f\x61\x3e\x3c\x2f\164\144\x3e\12\x20\x20\x20\40\x3c\x74\144\40\x63\154\141\163\163\x3d\42\x77\63\x2d\143\145\x6e\x74\x65\x72\40\x77\x33\55\x62\x74\156\42\x3e\x3c\x61\40\x6f\156\x63\154\x69\x63\153\75\42\143\x6f\142\162\141\x6e\172\141\137\x69\147\164\146\x28\x29\73\x22\76\74\x69\x6d\x67\x20\x73\162\143\75\x22" . base_url() . "\x69\x6d\141\147\145\163\57\x72\145\x6c\x6f\x61\144\x2e\160\x6e\x67\x22\40\141\154\x74\75\x22\x52\145\x63\x61\162\x67\141\162\42\x20\164\151\164\154\145\75\x22\122\145\143\x61\x72\147\141\x72\x22\40\x73\x74\x79\x6c\145\75\42\x77\151\144\164\x68\72\62\60\x70\170\x3b\x68\x65\151\x67\150\164\x3a\62\x30\160\170\x3b\x62\x6f\162\144\x65\x72\72\x30\73\x22\x3e\x3c\x2f\141\76\x3c\x2f\164\x64\x3e\x3c\x2f\164\162\x3e\12\x20\x20\x20\40\x3c\57\164\x61\142\x6c\x65\76\x3c\x62\162\76\xa\x20\x20\x20\x20\x3c\x74\x61\x62\154\x65\40\151\x64\x3d\x22\x69\x64\x30\x31\x22\40\143\154\141\163\x73\75\42\x77\63\x2d\x74\141\142\x6c\x65\55\x61\154\154\40\167\x33\55\150\x6f\166\145\x72\x61\x62\154\x65\x20\167\63\55\x6c\145\146\164\55\141\154\151\147\x6e\x20\167\x33\x2d\x74\151\x6e\171\42\x3e\x3c\x74\x72\x20\143\x6c\x61\163\163\75\42\x77\63\x2d\x66\157\156\x64\157\x64\x72\157\151\x64\x20\167\x33\x2d\x66\151\152\157\42\x3e\74\164\x68\76\x43\x6c\151\x65\x6e\164\145\x3c\x2f\x74\150\x3e\x3c\x74\150\76\116\x6f\155\142\x72\145\74\x2f\x74\x68\76\x3c\x74\x68\x3e\x54\145\154\146\74\x2f\x74\150\x3e\x3c\164\x68\76\x54\157\164\x61\x6c\x2e\102\x73\x3c\57\164\x68\76\74\x74\x68\76\120\x61\147\141\x64\x6f\x3c\57\x74\x68\x3e\x3c\164\150\x3e\104\145\x62\145\x3c\57\x74\x68\x3e\74\x74\150\x3e\105\x73\164\x61\x74\x75\x73\74\57\x74\x68\76\74\57\x74\162\x3e"; $i = 0; $debe = 0; foreach ($bdfac as $dtfac2) { $i++; $dtfac = $this->db->query("\123\x45\114\x45\103\124\x20\141\x2e\144\157\143\165\x6d\x65\x6e\164\x6f\x2c\141\x2e\x63\157\144\143\x6c\x69\x65\156\164\145\x2c\143\56\156\157\155\x62\162\145\x2c\111\106\50\x63\56\164\145\x6c\x65\x66\x6f\x6e\x6f\x73\41\x3d\x27\47\x2c\143\56\164\x65\x6c\x65\x66\x6f\156\157\163\54\111\x46\x28\143\56\164\x65\154\145\x66\x6f\156\157\137\x6d\157\x76\151\154\x21\x3d\47\x27\54\x63\x2e\x74\x65\154\x65\146\157\156\157\137\x6d\157\x76\x69\x6c\x2c\47\116\x2f\101\x27\x29\x29\x20\x74\x65\x6c\x66\54\40\x52\117\125\x4e\x44\50\x53\x55\x4d\x28\x61\x2e\164\157\164\141\154\x66\151\156\x61\x6c\x29\54\64\x29\40\164\x6f\x74\x61\x6c\x66\151\156\x61\154\x2c\40\xa\40\x20\40\x20\x52\x4f\125\116\x44\x28\x28\x53\x45\x4c\x45\103\x54\x20\123\x55\x4d\50\155\157\156\x74\x6f\x29\40\106\122\117\115\40\157\x70\145\x72\x63\154\x69\x20\127\110\105\122\x45\x20\151\x64\146\141\143\75\x61\x2e\x64\157\x63\165\x6d\145\x6e\164\157\51\54\x32\51\x20\160\x62\163\xa\x20\40\x20\x20\x46\x52\x4f\x4d\x20\157\x70\145\x72\164\x69\40\141\12\40\x20\40\40\x4a\x4f\x49\116\40\143\x6c\x69\145\x6d\160\x72\x65\40\143\40\117\116\x20\x61\56\143\157\144\143\154\x69\145\x6e\164\145\x3d\x63\x2e\x63\157\144\x69\147\x6f\12\40\40\40\x20\127\110\x45\x52\x45\x20\x61\56\164\x69\x70\157\144\157\x63\x3d\x27\116\x2f\104\x27\x20\46\46\40\x61\x2e\143\x6f\144\143\x6c\151\x65\156\x74\x65\75\x27{$dtfac2->codcliente}\47\x20\46\46\x20\141\x2e\144\157\143\165\155\145\156\x74\157\x66\151\163\x63\141\154\x3d\x27\111\107\124\x46\47")->row(); $debe = ROUND($dtfac->totalfinal - $dtfac->pbs, 2); $html .= "\74\164\162\40\151\144\75\42\x73\x6c\x65\143\x74" . $i . "\42\x20\x63\154\141\163\163\75\x22\x69\x74\145\x6d\42\x3e"; if ($debe <= 3) { $status = "\x4c\x69\x73\x74\157"; $color = "\167\x33\55\x67\x72\x65\x65\156"; } else { $status = "\120\x65\156\x64\151\145\x6e\x74\145"; $color = "\167\x33\55\162\145\x64"; } $html .= "\74\x69\x6e\160\x75\x74\40\x74\171\160\145\75\x22\x68\151\144\144\145\x6e\42\40\151\x64\x3d\42\x61" . $i . "\x22\40\156\x61\155\145\x3d\x22\x64\x6f\x63\x22\40\166\x61\154\165\x65\75\42" . $dtfac->codcliente . "\42\76\xa\40\40\x20\40\40\x20\x20\74\x74\144\x3e\x3c\x69\156\x70\165\x74\x20\164\x79\x70\145\75\x22\143\x68\x65\143\x6b\x62\157\170\x22\x20\x6f\x6e\x63\x6c\x69\143\153\x3d\x22\167\x33\56\x74\157\147\x67\154\x65\103\x6c\x61\x73\163\50\x27\x23\163\x6c\x65\143\x74" . $i . "\47\54\47\x77\x33\55\x79\x65\x6c\154\157\167\47\51\73\x22\40\x63\x6c\141\163\163\75\42\167\x33\55\x63\150\x65\143\153\x22\40\x6e\141\155\145\75\42\143\x68\145\x63\153\x63\154\x69\42\76" . $dtfac->codcliente . "\x3c\57\x74\144\76\x3c\x74\x64\x3e" . $dtfac->nombre . "\x3c\x2f\164\144\x3e\x3c\x74\x64\76" . $dtfac->telf . "\74\57\x74\144\x3e\74\x74\x64\76" . $dtfac->totalfinal . "\x3c\57\x74\144\x3e\74\x74\144\x3e" . $dtfac->pbs . "\40\x3c\142\76\x42\x73\x3c\x2f\x62\76\40\74\x2f\164\144\x3e\74\164\x64\x3e" . $debe . "\x20\x3c\142\76\x42\x73\74\57\142\x3e\x3c\x2f\x74\x64\x3e\x3c\x74\144\x20\x63\x6c\141\163\163\x3d\42" . $color . "\42\40\157\156\143\x6c\151\143\153\75\42\151\x74\x63\x6f\142\162\x6f\x5f\x69\147\x74\146\50\x24\50\x27\43\141" . $i . "\x27\51\56\166\141\x6c\x28\51\51\x3b\x22\40\x73\x74\x79\x6c\x65\75\x22\143\x75\162\x73\x6f\162\x3a\x70\x6f\x69\x6e\164\145\162\x22\x3e" . $status . "\74\x2f\164\144\76\xa\40\x20\40\x20\x20\x20\x20\x20\74\57\164\162\x3e"; } $html .= "\x3c\x21\55\x2d\x3c\x74\162\76\74\x74\144\40\143\x6c\141\x73\163\x3d\42\x77\x33\x2d\143\x65\x6e\x74\x65\x72\40\x77\63\55\146\157\156\144\x6f\144\162\x6f\x69\144\x22\40\143\x6f\154\x73\x70\141\x6e\75\x22\x31\61\42\76\x3c\154\141\142\x65\154\x20\143\x6c\x61\163\x73\x3d\x22\x77\x33\x2d\154\x61\x72\147\145\x22\76\x3c\142\76\x54\157\164\x61\154\40\125\156\x69\144\141\144\x65\163\x3a\40" . $totalreg . "\x3c\x2f\x62\76\74\x2f\x6c\x61\x62\x65\154\76\74\x2f\x74\144\76\x3c\x2f\x74\162\76\55\55\x3e\74\57\164\x61\142\x6c\145\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\40\40\x20\x20\40\40\x20\x3c\163\x63\x72\x69\160\x74\40\164\171\x70\x65\x3d\42\x74\145\170\164\57\152\x61\166\x61\163\143\x72\151\x70\x74\x22\76\xa\x20\40\x20\x20\x20\x20\x20\x20\146\165\156\143\164\x69\x6f\156\40\104\145\x63\x72\145\x6d\x65\x6e\164\x4e\165\x6d\x63\x7a\x61\50\x29\173\40\142\145\x66\x6f\162\145\50\51\73\12\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\x76\141\162\40\104\145\x63\162\145\x6d\145\156\164\116\165\155\x3d\144\157\143\165\x6d\145\x6e\x74\56\147\145\164\x45\x6c\145\x6d\x65\x6e\164\102\171\111\144\50\42\x44\145\x63\162\145\x6d\145\156\164\x4e\x75\155\x22\x29\x2e\166\141\x6c\x75\x65\73\12\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\166\x61\162\40\x6b\x65\171\75\42\x64\x72\157\x69\144\71\x30\x33\42\x3b\40\166\141\162\x20\154\151\x6b\145\75\x24\x28\x22\x23\154\x69\153\x65\x66\x61\x63\42\x29\56\x76\141\154\x28\x29\73\xa\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\166\141\x72\x20\x64\141\x74\157\163\40\75\x20\x7b\12\40\40\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\42\x70\141\x67\x22\40\x3a\x20\x44\x65\x63\162\145\x6d\x65\x6e\x74\116\165\155\54\12\40\40\40\x20\40\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\40\42\x6b\145\171\42\40\x3a\40\153\145\171\12\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\40\x7d\x3b\xa\40\40\x20\x20\40\40\x20\x20\x20\x20\40\12\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x24\56\141\x6a\141\170\50\173\xa\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\x64\141\164\x61\x3a\40\144\141\164\x6f\x73\x2c\xa\40\40\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\165\x72\154\72\x20\40\142\x61\x73\x65\165\x72\x6c\53\x22\143\x5f\x64\162\157\151\144\x2f\x63\157\142\162\141\156\172\x61\137\x69\x67\x74\146\x22\54\xa\40\40\40\40\40\x20\x20\x20\x20\x20\x20\40\40\40\40\40\x20\x20\40\x74\x79\x70\x65\x3a\40\42\x50\117\x53\x54\42\54\12\40\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\163\165\143\143\x65\x73\163\72\40\146\165\156\143\x74\151\157\x6e\x28\x64\141\x74\x61\51\x20\x7b\xa\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\40\40\x20\40\40\x20\40\40\40\x20\40\x20\x24\x28\42\43\142\x6f\144\x79\x22\51\56\150\x74\155\154\50\x64\141\x74\141\51\x3b\x20\x24\50\42\x23\x6c\x69\x6b\x65\146\x61\x63\42\x29\x2e\166\x61\154\x28\x6c\151\x6b\145\x29\x3b\x20\163\x77\x61\154\56\x63\154\157\x73\145\x28\x29\x3b\12\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\40\40\175\xa\40\x20\x20\x20\40\40\x20\40\40\40\x20\12\40\40\x20\40\x20\x20\x20\40\40\x20\40\x20\40\x20\40\175\51\x3b\12\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x7d\12\40\x20\x20\40\x20\x20\x20\x20\12\40\40\40\40\40\x20\x20\40\40\40\x20\146\165\x6e\x63\164\151\x6f\x6e\x20\156\165\x6d\160\141\147\143\x7a\x61\x28\141\x29\173\40\x62\x65\x66\157\x72\x65\50\x29\x3b\xa\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\166\x61\162\x20\153\145\171\75\42\x64\162\157\x69\144\71\x30\63\x22\x3b\x20\166\x61\162\40\x6c\x69\x6b\145\x3d\x24\x28\x22\x23\x6c\x69\x6b\145\146\141\143\x22\x29\x2e\x76\x61\154\50\x29\x3b\xa\40\x20\40\x20\40\40\40\40\xa\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\x76\141\x72\40\144\x61\164\x6f\x73\40\x3d\x20\x7b\xa\40\40\40\40\40\40\x20\40\x20\40\40\40\40\40\x20\40\40\x20\x20\x20\x22\x6b\145\171\42\x3a\153\145\171\x2c\xa\x20\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\40\x20\40\42\x70\141\x67\x22\40\x3a\40\141\xa\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x7d\x3b\12\40\40\40\40\40\x20\x20\40\x20\40\x20\12\x20\40\40\x20\40\x20\40\40\40\40\40\x20\40\x20\40\44\56\141\152\x61\x78\50\x7b\xa\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\40\144\x61\164\141\x3a\x20\144\141\164\157\163\x2c\xa\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x75\162\154\72\x20\x62\x61\163\x65\165\x72\154\53\x22\x63\x5f\144\162\157\151\144\x2f\143\157\x62\162\141\x6e\x7a\141\137\151\x67\x74\146\x22\54\12\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\164\x79\x70\x65\72\x20\42\x50\x4f\123\124\x22\x2c\12\40\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\40\163\165\143\143\145\163\x73\x3a\x20\146\x75\156\x63\164\151\157\156\x28\144\141\x74\141\x29\40\x7b\xa\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\40\x20\40\40\x24\x28\x22\x23\142\157\144\171\42\51\x2e\150\x74\x6d\154\x28\144\x61\164\141\x29\73\40\x24\50\x22\x23\154\x69\153\x65\146\141\x63\x22\51\x2e\x76\x61\x6c\50\154\x69\x6b\145\51\73\x20\x73\167\141\x6c\56\143\154\157\x73\145\50\51\73\12\40\40\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\175\xa\x20\40\x20\40\x20\40\x20\40\x20\40\40\12\40\x20\40\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x7d\x29\x3b\12\x20\40\40\40\x20\x20\40\x20\40\40\x20\x7d\12\x20\40\x20\40\40\40\40\x20\xa\40\x20\40\x20\x20\40\x20\40\40\x20\x20\146\165\x6e\x63\164\151\x6f\156\x20\x49\156\143\162\x69\x6d\145\156\164\x4e\165\x6d\143\172\x61\50\x29\173\x20\142\145\x66\157\x72\145\x28\x29\73\xa\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\166\141\x72\x20\x49\156\143\x72\x69\x6d\145\156\164\x4e\x75\x6d\x3d\x64\x6f\143\x75\155\145\156\164\x2e\147\145\x74\105\x6c\145\x6d\145\x6e\x74\102\x79\x49\x64\50\42\x49\156\x63\162\151\x6d\145\156\x74\x4e\165\x6d\x22\51\56\166\141\154\x75\x65\x3b\12\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\166\141\x72\x20\x6b\x65\x79\x3d\x22\x64\x72\157\151\x64\71\x30\63\x22\x3b\x20\x76\141\162\x20\x6c\x69\x6b\145\x3d\x24\x28\x22\x23\x6c\x69\x6b\x65\146\x61\x63\x22\x29\56\166\x61\x6c\x28\51\x3b\xa\40\x20\40\x20\x20\40\x20\x20\x20\40\40\40\166\x61\162\40\144\x61\x74\x6f\163\x20\75\40\173\xa\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\x22\153\145\x79\x22\72\153\145\171\54\12\x20\40\40\40\40\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\x20\40\x22\x70\x61\x67\42\40\72\x20\111\156\x63\x72\151\155\145\156\164\116\x75\155\xa\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\175\73\xa\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\12\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x24\x2e\141\x6a\141\x78\50\x7b\12\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\40\40\40\40\x64\141\164\x61\72\40\144\141\164\157\x73\x2c\12\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\x75\x72\154\x3a\40\x20\142\x61\x73\145\165\x72\x6c\53\x22\143\137\x64\162\x6f\151\144\x2f\x63\157\x62\162\x61\156\x7a\141\137\x69\x67\x74\x66\42\54\xa\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\x20\x74\x79\160\x65\x3a\x20\x22\120\117\123\x54\42\54\xa\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x73\x75\x63\143\x65\163\x73\72\40\x66\x75\156\143\x74\151\157\156\x28\x64\141\164\141\x29\x20\173\xa\40\40\40\40\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\40\x20\40\40\40\44\x28\42\x23\142\x6f\144\x79\x22\x29\56\150\164\155\x6c\50\144\x61\x74\141\x29\73\40\44\x28\42\43\x6c\151\153\145\146\141\143\42\51\x2e\166\141\x6c\50\x6c\x69\x6b\145\x29\73\40\x73\x77\141\x6c\x2e\143\x6c\157\x73\145\x28\x29\73\xa\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\175\12\40\40\x20\40\x20\40\40\40\40\40\x20\xa\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\x7d\x29\73\xa\40\40\40\x20\x20\x20\40\x20\x20\40\40\175\xa\40\x20\x20\x20\40\x20\x20\40\74\x2f\x73\143\162\151\160\164\76\12\x20\x20\x20\40\x20\40\x20\40\74\144\151\x76\40\143\154\x61\163\x73\75\x22\x77\63\x2d\142\x61\162\40\167\x33\x2d\x62\x6f\162\144\145\x72\x20\x77\x33\55\142\141\x72\162\141\x73\x22\76\xa\x20\x20\x20\x20\40\x20\40\x20\x3c\151\x6e\160\x75\164\x20\164\171\160\145\75\42\x68\x69\144\x64\x65\156\x22\x20\151\x64\75\42\104\x65\143\x72\145\x6d\145\x6e\x74\x4e\165\155\x22\40\x76\x61\154\165\x65\75\42" . $DecrementNum . "\x22\76\xa\x20\x20\x20\x20\x20\x20\x20\x20\74\x61\x20\x6f\x6e\x63\x6c\151\143\153\x3d\42\x44\x65\x63\162\x65\x6d\x65\156\x74\x4e\x75\155\x63\172\x61\x28\x29\x3b\x22\x20\143\x6c\141\x73\x73\x3d\x22\x77\x33\x2d\142\x61\162\55\x69\x74\x65\155\x20\167\63\x2d\x62\x75\164\164\x6f\x6e\x22\76\x26\x6c\141\x71\x75\157\73\x3c\x2f\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\x70\141\x67\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\63\55\x66\x6f\156\x64\x6f\x64\x72\157\151\x64"; $html .= "\xa\x20\x20\x20\x20\40\40\40\x20\x3c\151\x6e\x70\x75\x74\x20\x74\x79\x70\x65\x3d\x22\150\151\144\144\145\156\42\40\151\x64\75\x22" . $id . "\x22\x20\166\x61\x6c\165\x65\75\x22" . $i . "\x22\x3e\12\x20\40\40\40\40\x20\40\40\74\141\40\157\x6e\x63\x6c\x69\143\x6b\x3d\42\x6e\x75\155\160\x61\147\143\x7a\x61\x28\x24\x28\x27\43" . $id . "\x27\x29\x2e\x76\141\154\x28\x29\51\x3b\42\40\x63\x6c\141\163\163\75\42\x77\x33\55\142\x61\162\55\x69\x74\x65\155\x20\x77\63\55\x62\x75\x74\x74\x6f\156\x20" . $hover . "\x22\76" . $i . "\x3c\57\141\x3e"; } else { $hover = ''; $html .= "\74\151\156\160\165\x74\x20\164\171\x70\x65\x3d\x22\x68\151\x64\x64\x65\x6e\42\40\151\144\x3d\x22" . $id . "\x22\40\166\x61\x6c\165\x65\75\x22" . $i . "\42\76\xa\40\x20\x20\x20\40\x20\40\40\74\x61\x20\157\x6e\x63\154\151\143\153\75\42\x6e\x75\x6d\160\x61\147\143\x7a\x61\x28\x24\x28\47\43" . $id . "\47\51\56\166\141\x6c\50\x29\x29\x3b\x22\x20\x63\154\x61\x73\163\75\42\167\x33\55\x62\141\x72\55\x69\x74\145\155\40\167\63\x2d\142\165\x74\164\157\156\x20" . $hover . "\42\x3e" . $i . "\74\x2f\x61\x3e"; } } } $html .= "\x3c\151\x6e\x70\x75\x74\40\164\x79\160\145\x3d\42\150\x69\x64\144\x65\156\42\x20\151\144\x3d\x22\x49\x6e\x63\x72\x69\x6d\145\156\164\116\165\x6d\42\x20\166\x61\x6c\165\145\x3d\x22" . $IncrimentNum . "\42\76\12\40\x20\x20\40\40\40\x20\40\74\x61\x20\x6f\156\143\154\x69\x63\153\x3d\x22\111\156\x63\162\x69\x6d\145\156\x74\x4e\x75\155\143\172\x61\50\x29\x3b\x22\40\143\x6c\141\163\163\x3d\x22\167\63\x2d\x62\x61\x72\55\x69\x74\x65\x6d\40\167\63\55\142\x75\x74\164\157\156\x22\x3e\x26\x72\x61\x71\x75\157\x3b\74\57\141\x3e\xa\xa\40\40\x20\40\40\x20\x20\40\x3c\57\x64\151\x76\76\40"; return $html; } public function itcobro_igtf($a) { $bditfac = $this->db->query("\123\x45\114\x45\x43\124\x20\x61\56\164\151\x70\x6f\144\x6f\x63\54\141\x2e\x64\157\143\165\155\145\156\x74\157\54\x61\56\x72\145\x66\x65\x72\x65\156\143\151\141\54\x61\56\141\156\x74\144\157\x63\x2c\x61\56\146\145\143\150\x61\143\162\145\141\54\x61\56\x72\145\x63\x65\160\x63\x69\157\156\54\141\x2e\166\x65\156\143\x65\x2c\x61\56\x76\x65\156\x63\145\x63\x2c\x61\56\143\157\x64\x63\154\151\145\156\164\x65\54\xa\40\40\40\x20\x61\x2e\164\157\164\x61\x6c\144\x20\144\x6f\x6c\x61\x72\x2c\x61\x2e\164\157\x74\141\154\x66\x69\x6e\141\x6c\54\141\x2e\x64\x69\x61\163\151\x6e\144\x65\170\54\12\40\x20\x20\40\50\x53\x45\x4c\x45\x43\124\40\155\157\156\x65\x64\x61\40\106\x52\x4f\115\x20\x6f\160\x65\162\143\x6c\151\x20\x77\x68\145\162\145\40\151\144\146\141\x63\75\141\56\144\157\143\x75\x6d\x65\156\164\157\x20\x67\162\157\165\x70\40\x62\x79\40\155\157\156\145\x64\141\40\x6c\x69\x6d\151\x74\40\61\51\x20\164\x69\x70\x6f\x70\x61\147\12\x20\x20\x20\40\106\x52\117\115\x20\157\160\145\x72\x74\x69\x20\141\xa\40\40\40\40\127\110\105\122\x45\40\141\x2e\x63\x6f\144\143\154\x69\145\x6e\164\145\x3d\47{$a}\47\40\x26\46\x20\x61\x2e\x74\151\x70\157\144\157\x63\x3d\x27\116\57\x44\47\40\46\x26\40\141\56\x74\x6f\x74\141\154\x64\76\60\40\x26\46\40\x61\x2e\144\157\x63\165\155\145\x6e\x74\x6f\x66\151\163\x63\x61\154\x3d\47\111\107\x54\x46\47\xa\x20\x20\40\x20\x47\122\x4f\x55\x50\x20\x42\131\x20\x61\56\x64\157\143\165\155\145\156\164\x6f")->result(); $html = "\12\x20\40\x20\x20\x3c\x61\x20\157\156\x63\x6c\151\143\153\x3d\x22\x76\151\145\x77\141\x75\144\151\164\x61\x70\141\147\x28\x29\x3b\42\x20\x63\x6c\141\163\163\75\42\167\x33\x2d\142\164\156\42\x3e\x3c\151\155\x67\x20\163\162\x63\x3d\42" . base_url() . "\151\x6d\141\x67\x65\x73\57\146\141\x63\x74\x75\162\141\x2e\160\x6e\147\x22\x20\x61\154\x74\x3d\42\105\x73\x74\141\144\x6f\40\103\x75\x65\x6e\164\x61\x73\x22\40\164\151\164\154\145\75\42\105\163\164\x61\144\157\40\x43\x75\x65\x6e\x74\141\163\42\40\x73\164\x79\154\145\75\42\167\151\x64\164\x68\x3a\62\60\x70\170\73\150\145\151\x67\150\164\72\x32\60\160\170\x3b\142\x6f\162\144\x65\162\72\60\x3b\42\76\74\57\141\x3e\xa\x20\40\x20\x20\x3c\x61\x20\157\x6e\143\154\151\143\153\75\x22\x6d\x6f\x76\x62\x61\x6e\x63\x28\x29\73\x22\x3e\74\151\155\147\40\163\162\x63\75\x22" . base_url() . "\151\155\x61\147\x65\x73\57\x64\x69\x6e\145\x72\157\x2e\x70\x6e\147\x22\x20\x61\154\x74\x3d\x22\x43\x6f\156\163\x6f\x6c\x69\x64\141\x64\x6f\x20\x42\141\156\x63\x61\x72\x69\157\42\x20\164\x69\x74\x6c\145\x3d\42\103\x6f\156\x73\x6f\x6c\151\144\x61\x64\x6f\40\102\141\156\143\141\x72\x69\157\x22\40\x73\x74\171\x6c\x65\x3d\x22\167\x69\144\x74\x68\x3a\62\x30\160\x78\73\150\145\x69\x67\150\164\72\62\60\160\x78\x3b\x62\157\x72\144\x65\162\x3a\60\73\42\x3e\12\40\40\40\x20\74\x61\x20\157\156\x63\154\x69\143\153\75\x22\146\157\x72\155\x70\x61\147\x6f\163\x28\x29\x3b\42\76\x3c\151\x6d\147\40\x73\x72\143\75\x22" . base_url() . "\x69\x6d\x61\x67\x65\163\57\151\x63\x6f\156\x70\141\x67\x32\x2e\x70\x6e\147\x22\x20\141\154\x74\75\42\x52\145\x67\151\163\164\x72\x61\x72\x20\x50\141\147\157\x22\x20\x74\x69\164\154\x65\x3d\x22\122\145\x67\x69\163\164\x72\141\162\x20\120\141\x67\x6f\40\x45\146\145\x63\x74\x69\x76\x6f\x22\40\x73\x74\171\154\x65\x3d\42\x77\x69\144\x74\150\x3a\62\x30\x70\170\73\x68\x65\x69\x67\x68\164\x3a\x32\x30\160\x78\73\142\x6f\x72\144\145\x72\x3a\x30\73\x22\x3e\xa\40\40\40\x20\74\x61\x20\x6f\156\143\x6c\x69\x63\153\75\x22\x65\x6c\151\155\x70\141\x67\157\50\x29\x3b\x22\40\143\154\x61\163\x73\75\x22\x77\63\55\x62\x74\x6e\42\76\74\x69\x6d\147\40\x73\x72\143\75\42" . base_url() . "\151\x6d\x61\147\x65\x73\x2f\145\154\151\x6d\x70\141\147\157\x2e\x70\x6e\x67\x22\40\141\154\164\x3d\42\105\x6c\x69\x6d\x69\x6e\x61\x72\40\120\x61\x67\157\42\40\164\151\x74\x6c\x65\75\x22\x45\154\x69\155\x69\156\141\x72\40\120\x61\147\x6f\42\40\163\x74\171\154\145\75\42\x77\151\144\x74\150\72\62\60\x70\170\x3b\150\x65\x69\147\150\x74\x3a\62\x30\160\x78\73\142\157\x72\x64\145\162\x3a\x30\x3b\42\x3e\x3c\57\x61\x3e\xa\x20\40\40\x20\74\164\x61\x62\154\145\40\143\154\141\x73\x73\x3d\x22\167\x33\55\164\x61\142\154\x65\55\x61\154\154\x20\x77\63\55\150\x6f\166\x65\x72\141\x62\x6c\145\x20\167\63\x2d\x6c\x65\x66\x74\x2d\x61\154\x69\147\156\40\x77\63\x2d\x74\151\156\171\42\40\163\164\171\x6c\x65\x3d\42\167\x69\x64\x74\150\72\61\x30\60\45\x3b\x22\x3e\74\x74\162\40\143\154\141\163\163\75\x22\167\x33\x2d\x66\157\x6e\x64\x6f\144\x72\157\x69\x64\x20\x77\63\x2d\146\x69\x6a\x6f\42\76\x3c\164\x68\76\104\x6f\x63\165\155\x65\x6e\x74\157\x3c\x2f\164\x68\x3e\74\164\x68\76\122\145\146\145\162\145\156\143\x69\141\74\57\x74\150\76\x3c\164\150\76\124\x69\x70\x6f\x3c\x2f\x74\150\x3e\x3c\164\150\x3e\x46\145\143\150\141\x3c\x2f\164\x68\x3e\x3c\x74\150\76\x54\157\164\x61\x6c\x20\x42\163\x3c\x2f\x74\x68\x3e\xa\40\40\x20\x20\x3c\x74\x68\x3e\x50\x61\147\141\x64\x6f\x3c\57\x74\150\x3e\74\x74\x68\x3e\104\145\x62\x65\x3c\57\164\x68\x3e\x3c\x74\150\76\105\163\164\x61\x74\165\x73\x3c\57\x74\150\76\x3c\x2f\164\x72\76"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $pagado = $this->db->query("\x53\105\114\x45\103\x54\x20\111\106\x28\123\125\x4d\50\142\61\56\x6d\157\x6e\164\x6f\51\76\60\x2c\x20\123\125\115\x28\142\61\56\x6d\x6f\x6e\164\x6f\x29\x2c\x30\51\40\x62\x73\40\x46\x52\117\115\x20\x6f\160\x65\162\143\x6c\151\x20\142\61\x20\x57\x48\105\x52\105\x20\x62\x31\56\151\144\x66\x61\143\75\47{$dtitfac->documento}\47\x20\46\46\x20\x62\x31\x2e\151\x64\143\x6f\x6e\x73\x62\x61\156\143\40\x49\123\x20\x4e\x4f\124\40\x4e\125\114\x4c")->row(); $debe = ROUND($dtitfac->totalfinal - $pagado->bs, 2); if ($debe <= 3) { $status = "\114\x69\163\164\157"; $color = "\x77\63\55\147\x72\145\145\x6e"; } else { $status = "\120\145\x6e\144\x69\145\x6e\164\145"; $color = "\167\x33\55\162\x65\144"; } $html .= "\x3c\164\162\x20\151\144\75\x22\163\154\145\143\164\x32" . $i . "\42\76\x3c\151\156\x70\165\164\40\x74\171\x70\145\75\42\150\151\x64\144\145\156\x22\x20\156\141\155\145\75\x22\x64\157\143\x32\42\x20\166\141\x6c\x75\x65\75\x22" . $dtitfac->documento . "\x22\x3e\x3c\x69\x6e\160\x75\164\40\164\171\160\x65\75\x22\x68\151\144\x64\x65\156\42\x20\x6e\141\x6d\x65\x3d\x22\x74\151\160\x6f\x64\157\x63\x22\x20\166\141\154\x75\145\75\x22" . $dtitfac->tipodoc . "\42\76\12\40\40\x20\x20\x20\40\x20\x20\x3c\x69\156\160\x75\x74\40\x74\x79\x70\x65\75\x22\x68\x69\144\144\x65\x6e\42\x20\x6e\141\x6d\x65\75\x22\163\x74\x61\x74\x75\163\42\40\x76\x61\154\165\x65\75\x22" . $status . "\42\76\x3c\151\x6e\x70\165\164\x20\x74\x79\x70\x65\75\x22\x68\151\144\x64\x65\x6e\42\40\x6e\x61\x6d\x65\x3d\x22\x6d\157\156\164\157\42\x20\x76\141\154\165\x65\75\x22" . $debe . "\42\x3e\74\151\x6e\x70\165\164\40\x74\171\x70\x65\75\42\150\151\144\x64\145\156\42\x20\156\141\x6d\x65\x3d\42\x64\x6f\154\141\x72\x22\x20\166\141\154\x75\145\x3d\42" . $debe . "\x22\76\xa\x20\x20\x20\40\40\40\40\x20\x3c\x69\x6e\x70\x75\164\40\164\x79\x70\x65\75\42\150\x69\144\x64\145\156\42\x20\156\141\x6d\145\x3d\x22\143\154\151\62\42\x20\x76\141\x6c\x75\x65\75\x22" . $dtitfac->codcliente . "\42\76\xa\40\40\40\x20\40\x20\x20\40\x3c\x74\144\76\x3c\151\156\x70\165\164\40\164\x79\x70\x65\75\42\x63\150\x65\x63\153\x62\157\x78\42\x20\x6f\x6e\143\x6c\x69\x63\x6b\75\42\167\63\x2e\164\x6f\x67\x67\x6c\x65\103\154\141\163\163\x28\x27\x23\x73\x6c\x65\143\x74\x32" . $i . "\47\54\47\167\x33\x2d\171\x65\154\x6c\x6f\167\47\51\x3b\x22\x20\x63\x6c\x61\163\x73\x3d\42\167\x33\55\143\x68\x65\x63\153\42\x20\x6e\141\x6d\145\x3d\42\x63\150\x65\143\153\42\x3e" . $dtitfac->documento . "\x3c\x2f\164\144\76\x3c\164\x64\x3e" . $dtitfac->referencia . "\74\57\164\144\76\74\x74\x64\76" . $dtitfac->tipodoc . "\x3c\57\164\144\76\x3c\x74\x64\76" . $dtitfac->fechacrea . "\x3c\x2f\x74\144\x3e\12\x20\x20\x20\x20\x20\40\40\40\x3c\x74\x64\x3e" . $dtitfac->totalfinal . "\40\x3c\x62\76\102\163\74\57\142\76\74\57\x74\x64\76\x3c\x74\x64\x3e" . $pagado->bs . "\x20\x3c\142\x3e\102\x73\x3c\57\142\x3e\74\57\164\x64\x3e\x3c\x74\144\76" . $debe . "\x20\x3c\142\76\102\x73\74\57\x62\x3e\x3c\57\142\76\x3c\x2f\x74\x64\x3e\xa\x20\40\40\40\x20\40\40\40\74\164\144\40\x63\154\141\163\x73\75\x22" . $color . "\40\167\63\x2d\143\145\x6e\164\145\162\42\x3e" . $status . "\x3c\57\164\x64\76\12\40\40\40\40\x20\x20\40\x20\x3c\x2f\164\162\x3e"; } $html .= "\x3c\57\x74\141\142\x6c\145\x3e"; return $html; } function elimpago($id) { if ($id > 0) { $this->db->query("\x44\x45\x4c\x45\124\x45\40\x46\x52\117\115\x20\157\x70\145\x72\143\154\x69\x20\x57\x48\105\x52\105\40\151\144\143\x6f\x6e\x73\142\141\156\x63\75\47{$id}\47\73"); $this->db->query("\125\x50\104\x41\124\x45\40\x63\157\x6e\x73\x62\x61\156\143\x20\x53\105\x54\x20\x53\124\101\x54\125\x53\x3d\x27\116\x27\x20\127\110\105\x52\x45\40\151\144\x3d\47{$id}\47"); if ($this->db->affected_rows() > 0) { $this->loguser("\x41\x6e\165\154\x61\143\151\157\x6e\x20\x50\x61\x67\x6f", "\105\x6c\x20\x75\163\165\141\162\151\x6f\x20\x61\156\x75\x6c\x61\40\x65\x6c\40\160\141\x67\157\x20" . $id . "\x2e"); } return $this->db->affected_rows(); } } function auditapag($doc, $tip) { return $this->db->query("\x53\105\x4c\x45\x43\124\40\x61\56\151\144\146\141\x63\40\106\101\103\x2c\x61\x2e\151\x64\x63\157\x6e\163\142\x61\156\143\40\x49\x44\142\141\156\x63\x2c\x61\x2e\x66\x65\143\150\x20\x46\160\141\x67\157\x2c\x61\56\164\151\160\40\x74\x69\x70\157\54\141\56\155\157\156\145\x64\141\x2c\141\x2e\162\145\x66\x20\162\145\x66\x65\x72\145\156\143\x69\141\x2c\x28\x53\105\x4c\x45\103\124\x20\x6e\157\155\x20\106\x52\x4f\x4d\40\x62\x61\x6e\x6f\x72\x69\40\x57\x48\x45\122\x45\x20\151\144\x3d\141\56\142\141\x6e\143\x6f\162\x69\51\40\x6f\162\151\x67\145\x6e\54\40\50\123\x45\x4c\x45\103\124\x20\156\157\x6d\40\106\122\117\115\40\142\x61\x6e\x64\x65\163\x74\x20\x57\x48\x45\x52\x45\40\151\144\x3d\x61\56\x62\x61\x6e\143\x64\145\x73\164\x29\40\x64\145\x73\x74\151\156\x6f\54\12\40\x20\40\x20\122\x4f\125\x4e\104\50\50\123\x45\x4c\x45\x43\124\x20\157\x66\151\x63\151\141\154\40\106\122\117\x4d\40\x6d\157\x6e\x65\x63\x61\155\x20\127\110\105\x52\105\40\x66\145\143\x68\141\74\75\x28\x53\x45\114\105\x43\x54\40\146\x65\143\150\x61\143\162\x65\x61\x20\x46\122\117\x4d\40\157\160\145\x72\x74\x69\x20\x57\110\x45\122\x45\40\144\157\x63\x75\x6d\x65\x6e\x74\x6f\x3d\x61\x2e\x69\144\x66\x61\143\40\46\x26\40\x74\151\160\x6f\144\157\x63\75\x27{$tip}\47\x29\x20\x4f\x52\x44\x45\x52\x20\x42\131\40\146\x65\143\x68\141\x20\x44\105\123\x43\x20\x4c\111\115\x49\x54\x20\61\x29\x2c\x32\x29\x20\164\141\163\x61\x6f\x72\x67\54\12\40\40\40\x20\x20\x61\x2e\155\x6f\156\x74\157\40\x62\x73\54\40\x61\56\155\x6f\x6e\164\x6f\x64\40\144\157\x6c\141\x72\x2c\x6d\x6f\x6e\164\x6f\x2f\x6d\157\x6e\x74\157\144\x20\x74\141\x73\141\160\x61\x67\157\x2c\40\141\x2e\x6f\x62\163\145\x72\x76\x2c\x20\50\123\145\114\x65\x43\124\x20\156\157\x6d\x61\160\x65\x20\106\x52\x4f\115\40\x74\x72\141\x62\x20\x77\150\x65\x72\145\40\x69\x64\x3d\x61\56\165\163\145\162\x29\x20\x75\163\145\162\54\x20\141\56\146\x72\x65\x67\40\x72\145\x67\151\163\164\162\x6f\x20\x46\122\117\115\40\157\x70\x65\162\x63\154\151\40\141\x20\x57\110\x45\x52\x45\40\x61\x2e\x69\144\146\x61\x63\75\47{$doc}\x27\40\x26\x26\x20\141\x2e\x69\x64\143\157\x6e\163\142\x61\156\143\x20\111\123\40\116\x4f\124\40\116\x55\114\x4c"); } public function movbanc($a, $b) { if ($b != '') { $filter = "\x57\x48\x45\x52\x45\x20\155\157\156\164\x6f\x3e\x30\40\46\x26\40\x28\151\x64\x3d\47{$b}\x27\x20\174\174\40\x6d\x6f\x6e\164\157\x3d\47{$b}\x27\x20\x7c\x7c\40\x64\145\x73\x63\162\151\x70\40\114\x49\113\x45\40\x27\x25{$b}\45\x27\40\174\x7c\40\162\x65\146\x3d\47{$b}\x27\x20\x7c\x7c\x20\146\141\x63\40\x6c\151\x6b\x65\40\x27\45{$b}\x25\x27\x29"; } else { $filter = "\x57\110\105\x52\105\x20\x6d\x6f\156\164\x6f\x3e\x30\40"; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\114\x45\103\124\x20\x69\144\x2c\146\145\143\x68\x2c\162\x65\x66\54\144\x65\x73\143\162\151\x70\54\x6d\157\x6e\164\x6f\x2c\142\141\156\143\157\x2c\107\122\117\x55\120\x5f\x43\117\116\x43\x41\x54\x28\146\141\143\51\x20\x61\160\154\x69\143\x61\40\106\122\117\x4d\40\xa\x20\40\40\40\x20\40\40\50\123\105\114\x45\x43\x54\40\x61\x2e\151\x64\54\141\56\146\145\143\150\54\x61\56\x72\x65\x66\x2c\141\56\x64\x65\163\x63\x72\151\x70\54\x61\56\155\x6f\x6e\x74\x6f\54\50\123\105\114\105\x43\124\x20\156\157\155\40\x46\x52\x4f\115\40\x62\x61\156\x64\145\163\x74\40\127\x48\x45\122\105\x20\151\x64\75\141\56\x62\x61\156\143\x6f\51\x20\142\x61\x6e\x63\x6f\54\40\x62\56\151\144\146\141\x63\x20\146\x61\x63\40\x46\122\x4f\x4d\x20\143\157\x6e\x73\142\141\156\143\x20\141\x20\x4c\x45\106\124\x20\112\x4f\x49\x4e\x20\x6f\x70\145\162\x63\154\151\x20\142\x20\x6f\156\40\141\56\x69\144\x3d\x62\x2e\151\144\143\157\x6e\163\142\141\156\143\x29\x20\xa\x20\40\x20\40\x20\40\x20\x6d\157\x76\x62\141\156\143\x20{$filter}\40\40\x47\x52\117\125\120\x20\x42\x59\x20\151\x64")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\x4c\105\x43\124\40\151\x64\54\x66\x65\x63\x68\54\x72\145\146\54\144\x65\163\143\162\x69\x70\54\x6d\157\156\x74\157\54\142\141\x6e\143\157\x2c\x63\157\x64\142\141\x6e\143\x2c\x47\122\117\x55\120\x5f\x43\117\x4e\103\x41\124\50\146\x61\143\x29\40\141\160\154\151\x63\141\x2c\x73\164\x61\x74\165\163\40\106\x52\117\x4d\40\xa\40\x20\40\x20\x28\123\105\x4c\105\x43\124\x20\x61\56\151\144\54\141\x2e\x66\145\143\x68\x2c\x61\x2e\162\145\146\54\141\x2e\144\x65\163\x63\162\x69\x70\x2c\141\x2e\155\x6f\x6e\164\157\54\x28\x53\x45\x4c\105\103\124\40\156\157\x6d\40\x46\122\x4f\x4d\x20\x62\x61\x6e\x64\145\x73\164\40\127\110\105\122\x45\x20\x69\144\75\x61\56\x62\141\156\x63\157\x29\40\x62\141\156\x63\157\x2c\141\x2e\x62\x61\x6e\x63\x6f\40\x63\x6f\x64\142\141\x6e\x63\x2c\40\x62\x2e\151\144\x66\x61\x63\x20\x66\x61\143\x2c\x20\x61\56\163\x74\141\x74\x75\163\xa\40\40\40\x20\40\106\122\117\x4d\x20\x63\157\156\x73\142\141\x6e\143\x20\x61\40\x4c\x45\106\124\x20\x4a\117\x49\116\x20\x6f\160\x65\162\x63\x6c\x69\x20\142\x20\157\156\40\141\56\151\x64\x3d\142\56\151\144\143\x6f\156\163\142\141\156\143\51\x20\155\157\166\142\x61\x6e\x63\x20{$filter}\x20\x47\122\117\125\x50\40\102\131\x20\151\x64\40\117\x52\x44\105\x52\40\x42\x59\x20\146\145\143\x68\x20\x44\x45\123\x43\x20\x4c\x49\115\111\124\40" . ($a - 1) * $mostrar . "\x20\54\40" . $mostrar . '')->result(); $html = "\12\x20\40\40\40\74\164\141\142\154\x65\40\x63\x6c\x61\163\x73\x3d\42\167\63\x2d\164\141\142\154\145\x2d\141\x6c\154\x20\167\x33\55\x68\157\x76\x65\x72\x61\142\x6c\x65\40\167\63\x2d\154\145\146\x74\x2d\141\x6c\x69\147\156\x22\76\xa\x20\x20\x20\40\74\164\162\x3e\x3c\164\144\x20\143\154\x61\x73\x73\75\x22\167\x33\x2d\x66\x6f\156\x64\x6f\144\x72\x6f\x69\144\40\167\x33\55\x66\151\x6a\x6f\x22\x3e\x42\165\x73\143\141\x72\40\74\x69\155\147\40\163\162\143\x3d\x22" . base_url() . "\151\155\x61\147\145\163\x2f\x62\x75\163\143\x61\x72\56\160\156\x67\x22\x20\141\x6c\164\75\42\x42\165\x73\x63\x61\162\x22\40\164\x69\164\154\x65\75\42\102\165\x73\143\x61\x72\42\40\x73\164\x79\154\145\x3d\42\167\x69\144\164\x68\x3a\61\70\x70\170\x3b\142\x6f\162\x64\145\162\x3a\60\73\42\x3e\x3c\57\x74\144\x3e\12\40\40\40\40\74\x74\144\x3e\x3c\x69\156\x70\165\164\x20\164\171\160\145\x3d\42\164\x65\x78\164\x22\x20\143\x6c\141\163\163\75\x22\167\63\55\151\x6e\x70\x75\x74\x22\40\160\154\141\143\x65\x68\157\154\x64\145\162\75\42\x49\x6e\x67\162\145\x73\145\40\163\x75\40\x62\165\x73\161\x75\145\144\141\x22\x20\x6f\156\x63\150\x61\x6e\x67\145\x3d\42\155\157\x76\142\x61\x6e\143\x28\51\42\40\151\x64\75\x22\x6c\151\153\x65\42\x3e\x3c\x2f\164\144\x3e\xa\40\40\x20\40\x3c\164\144\40\143\x6c\x61\163\163\75\42\x77\x33\x2d\143\145\156\164\x65\162\40\167\x33\x2d\x62\x74\x6e\42\x3e\x3c\141\40\x6f\x6e\143\154\x69\143\x6b\75\42\146\157\x72\155\160\x61\147\x6f\x73\62\50\x29\73\42\x3e\x3c\x69\155\x67\40\x73\162\143\75\x22" . base_url() . "\x69\x6d\x61\x67\145\x73\57\x69\x63\157\156\x70\141\x67\x32\x2e\x70\156\x67\42\x20\141\154\164\75\42\122\145\147\x69\x73\x74\162\x61\162\x20\120\x61\147\x6f\x22\40\x74\151\x74\154\x65\x3d\42\122\x65\x67\x69\163\164\x72\x61\x72\x20\120\141\147\x6f\x22\x20\163\x74\x79\x6c\145\x3d\x22\167\x69\x64\164\150\72\x32\x30\x70\x78\x3b\x68\145\151\x67\x68\164\72\x32\60\x70\170\73\142\x6f\x72\144\x65\x72\72\x30\x3b\x22\76\74\x2f\x61\x3e\x3c\x2f\x74\x64\76\xa\40\x20\40\40\74\164\144\40\143\x6c\x61\163\163\x3d\42\167\63\55\143\x65\156\164\145\x72\40\x77\x33\55\x62\x74\156\x22\76\74\x61\x20\157\x6e\x63\x6c\x69\143\x6b\75\42\x64\145\x73\x62\154\x6f\153\160\x61\147\50\51\x3b\42\76\x3c\151\x6d\147\40\x73\x72\x63\75\42" . base_url() . "\x69\x6d\141\147\x65\x73\x2f\144\x65\x76\157\154\x76\145\x72\x2e\x70\x6e\x67\42\40\x61\x6c\164\75\42\104\145\163\142\154\157\x71\165\x65\x61\x72\x20\x50\141\x67\x6f\x22\40\x74\x69\x74\154\145\x3d\x22\x44\x65\x73\x62\154\x6f\161\165\x65\x61\x72\40\120\141\147\x6f\42\x20\x73\164\x79\x6c\145\75\x22\x77\x69\144\x74\x68\x3a\x32\x30\160\170\x3b\150\145\151\x67\150\x74\72\x32\x30\x70\170\73\x62\157\162\144\x65\162\x3a\x30\73\42\76\x3c\57\x61\x3e\x3c\x2f\164\x64\76\12\x20\40\40\40\74\x74\144\40\x63\x6c\141\163\163\x3d\42\167\x33\x2d\x63\145\x6e\164\145\x72\40\167\63\x2d\x62\x74\x6e\42\x3e\74\141\40\x6f\156\143\154\x69\143\x6b\75\x22\x6d\157\166\142\x61\x6e\x63\50\x29\73\x22\x3e\x3c\x69\155\147\x20\163\162\x63\x3d\x22" . base_url() . "\x69\155\141\x67\x65\x73\x2f\162\x65\x6c\x6f\141\144\x2e\x70\156\147\x22\40\x61\x6c\164\x3d\x22\122\145\x63\x61\x72\147\141\162\42\40\164\151\164\x6c\x65\75\x22\x52\145\143\141\162\147\141\x72\42\40\x73\164\x79\x6c\x65\x3d\x22\x77\151\144\164\150\x3a\62\60\160\170\x3b\150\x65\151\x67\x68\164\x3a\x32\60\160\x78\x3b\142\157\x72\144\145\162\x3a\x30\73\x22\x3e\x3c\x2f\141\76\x3c\57\164\144\x3e\74\57\x74\x72\x3e\xa\x20\x20\40\x20\x3c\57\164\x61\142\x6c\145\x3e\74\x62\162\x3e\xa\40\x20\x20\40\x3c\x74\x61\142\x6c\x65\40\x69\x64\75\x22\151\144\60\61\42\x20\x63\154\x61\163\163\x3d\x22\x77\63\55\x74\x61\x62\x6c\x65\x2d\141\x6c\x6c\40\x77\63\x2d\150\157\166\145\x72\141\142\154\145\40\167\x33\55\x6c\145\146\164\x2d\x61\154\x69\147\156\x20\167\63\x2d\164\151\156\171\42\x3e\74\164\x72\x20\x63\x6c\x61\163\x73\x3d\42\x77\63\x2d\146\157\x6e\x64\x6f\144\162\x6f\151\x64\40\167\63\55\146\151\x6a\157\x22\76\xa\x20\x20\40\40\x3c\164\150\x3e\111\x44\74\57\x74\150\76\74\x74\x68\76\x46\x65\x63\x68\141\74\x2f\164\150\x3e\x3c\x74\x68\x3e\122\x65\x66\145\x72\145\x6e\x63\x69\141\x3c\x2f\x74\150\x3e\x3c\x74\x68\76\x44\x65\x73\x63\x72\151\x70\x3c\57\x74\x68\76\74\164\150\x3e\x6d\157\x6e\164\x6f\74\57\x74\150\76\x3c\x74\150\76\102\x61\156\143\x6f\x3c\57\x74\150\76\x3c\x74\150\x3e\x41\x70\154\151\x63\141\74\57\164\x68\76\x3c\164\150\76\105\163\x74\141\164\165\163\74\x2f\164\x68\76\xa\x20\x20\40\x20\x3c\x2f\164\x72\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->status == "\x53") { $color = "\x63\x6c\141\x73\x73\75\x22\167\63\x2d\x67\162\145\x65\x6e\x22"; $status = "\102\151\145\156"; } else { $color = "\x63\x6c\x61\x73\163\75\x22\167\x33\x2d\162\x65\144\42"; $status = "\x4d\141\154"; } $html .= "\74\x74\x72\x20\x69\144\x3d\x22\x73\154\x65\143\x74\155\x6f\166" . $i . "\x22\40\x63\x6c\x61\163\163\x3d\42\151\164\145\155\42\40\157\156\143\154\x69\143\x6b\75\x22\42\76"; $html .= "\x3c\151\156\x70\165\164\x20\x74\x79\160\x65\x3d\42\150\151\144\x64\145\x6e\x22\40\156\141\155\145\75\42\155\157\166\146\x65\143\150\x22\40\x76\x61\x6c\x75\145\75\x22" . $dtfac->fech . "\x22\76\x3c\x69\156\x70\165\164\40\x74\x79\160\x65\75\x22\x68\151\x64\x64\145\156\x22\40\156\x61\155\x65\75\42\x6d\x6f\x76\x72\145\x66\x22\40\x76\x61\x6c\165\x65\75\42" . $dtfac->ref . "\x22\x3e\x3c\x69\x6e\160\165\164\40\x74\x79\160\x65\75\x22\x68\151\x64\x64\x65\156\42\x20\x6e\x61\x6d\145\x3d\x22\x6d\x6f\x76\151\x64\42\40\166\141\x6c\165\145\x3d\x22" . $dtfac->id . "\x22\76\12\40\40\x20\40\40\x20\x20\40\x3c\151\x6e\160\165\164\x20\x74\x79\160\145\x3d\42\150\151\144\x64\145\x6e\x22\40\x6e\141\155\145\75\42\155\x6f\166\142\141\x6e\143\x6f\x22\40\166\x61\x6c\165\145\75\42" . $dtfac->codbanc . "\x22\x3e\x20\x3c\x69\x6e\160\165\164\x20\x74\x79\160\145\x3d\x22\x68\151\x64\x64\x65\x6e\x22\40\156\141\155\145\x3d\x22\x6d\157\x76\x6d\x6f\x6e\x74\x6f\42\40\x76\141\x6c\165\x65\x3d\42" . $dtfac->monto . "\x22\x3e\x3c\x69\x6e\160\165\x74\x20\164\171\x70\145\x3d\42\x68\151\144\144\x65\156\42\x20\x6e\141\155\145\x3d\42\x6d\157\x76\x73\164\x61\164\165\163\x22\x20\x76\x61\154\165\x65\x3d\x22" . $status . "\42\76\74\151\156\160\165\164\x20\164\171\x70\x65\x3d\42\x68\151\144\x64\145\156\x22\40\156\x61\x6d\x65\x3d\x22\x6d\157\x76\141\160\x6c\x69\x63\x61\42\40\166\141\x6c\165\145\75\x22" . $dtfac->aplica . "\42\x3e\12\x20\40\x20\x20\x20\40\40\40\x3c\164\x64\x3e\74\151\x6e\x70\x75\164\x20\164\171\160\x65\75\42\143\150\x65\x63\153\x62\157\x78\x22\40\x6f\156\143\154\x69\143\x6b\x3d\x22\x77\63\x2e\x74\157\147\147\154\145\x43\x6c\x61\x73\163\x28\x27\x23\163\154\x65\x63\164\x6d\157\x76" . $i . "\47\x2c\x27\167\x33\55\171\x65\154\154\x6f\167\x27\51\x3b\42\x20\x63\154\x61\x73\163\x3d\42\167\x33\55\143\150\145\x63\x6b\42\x20\x6e\x61\x6d\145\x3d\x22\x63\150\x65\143\153\x6d\x6f\166\42\x3e" . $dtfac->id . "\x3c\57\164\x64\76\12\40\x20\40\x20\40\40\x20\40\x3c\164\144\x3e" . $dtfac->fech . "\x3c\57\x74\x64\76\74\x74\x64\76" . $dtfac->ref . "\74\x2f\x74\x64\x3e\74\x74\144\x3e" . $dtfac->descrip . "\74\57\x74\144\x3e\74\164\x64\76" . $dtfac->monto . "\74\x2f\x74\144\x3e\x3c\x74\144\x3e" . $dtfac->banco . "\x3c\x2f\164\x64\76\x3c\x74\x64\x3e" . $dtfac->aplica . "\74\x2f\x74\x64\76\74\x74\144\40" . $color . "\76" . $status . "\x3c\x2f\164\144\x3e\xa\40\x20\40\40\40\40\40\40\x3c\x2f\164\162\x3e"; } $html .= "\x3c\164\x72\x3e\x3c\164\x64\x20\x63\154\141\x73\163\x3d\x22\167\x33\x2d\x63\x65\156\164\x65\x72\x20\167\63\55\146\x6f\x6e\x64\x6f\x64\162\157\x69\144\42\x20\143\x6f\x6c\163\160\141\x6e\75\x22\61\63\42\76\x3c\x6c\x61\x62\145\x6c\x20\x63\x6c\x61\x73\x73\x3d\x22\167\63\x2d\154\141\162\x67\x65\x22\x3e\74\142\x3e\124\x6f\164\141\154\40\115\x6f\166\x69\x6d\x69\145\156\x74\x6f\163\x3a\40" . $totalreg . "\74\57\142\76\x3c\57\x6c\x61\x62\x65\154\76\74\x2f\x74\x64\x3e\74\57\x74\162\76\74\57\164\x61\x62\154\145\76\12\40\x20\40\40\xa\40\40\40\40\xa\40\x20\40\40\74\144\151\166\40\x69\144\75\x22\155\x6f\x64\x72\145\147\160\141\x67\x6f\x32\42\x20\143\154\x61\163\x73\x3d\42\167\63\x2d\155\157\144\141\154\x22\76\12\40\40\x20\x20\40\x20\x20\40\40\x20\74\x64\151\166\x20\x63\x6c\141\163\x73\x3d\42\167\63\55\x6d\157\144\x61\x6c\x2d\143\x6f\x6e\x74\145\156\164\x20\x77\x33\55\x63\141\162\x64\55\64\42\x20\x73\x74\x79\154\145\x3d\x22\x77\151\144\x74\x68\x3a\x20\65\60\x30\160\x78\x3b\x22\x3e\xa\40\x20\40\40\x20\x20\x20\40\40\40\40\x20\x3c\x68\145\x61\x64\x65\162\x20\143\x6c\x61\163\x73\x3d\x22\x77\63\x2d\x63\157\156\164\x61\x69\x6e\145\162\x20\x77\x33\55\146\157\x6e\144\157\144\x72\x6f\x69\144\x20\167\63\55\x70\141\144\144\151\x6e\x67\x2d\154\141\162\x67\145\42\x3e\40\12\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\74\x73\160\141\x6e\40\x6f\156\x63\x6c\x69\x63\153\75\42\x77\63\56\x68\x69\144\145\x28\47\x23\155\157\144\x72\145\x67\x70\x61\x67\x6f\62\47\51\x3b\x22\x20\143\x6c\141\163\163\75\42\167\x33\55\142\165\x74\164\157\x6e\x20\167\x33\55\144\x69\163\160\154\141\x79\x2d\x74\157\x70\x72\x69\x67\150\x74\x22\x3e\46\164\151\x6d\145\163\x3b\x3c\x2f\163\160\x61\x6e\76\xa\40\40\40\x20\40\40\x20\x20\40\x20\40\40\40\x20\x3c\150\63\40\143\x6c\141\163\163\75\42\167\63\x2d\x63\x65\156\x74\x65\162\42\x20\x73\164\x79\154\x65\75\42\x63\157\x6c\x6f\162\72\40\43\146\x66\x66\73\164\145\170\164\55\x73\x68\x61\144\x6f\167\x3a\61\160\170\x20\x31\160\170\40\60\40\x23\x30\60\60\42\76\x3c\142\x3e\x52\145\147\151\x73\x74\x72\141\162\x20\120\141\147\157\x3c\57\x62\x3e\74\x2f\150\x33\x3e\12\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\x3c\x2f\150\x65\141\144\145\162\76\12\40\40\x20\40\40\x20\40\40\40\40\40\40\x3c\x64\x69\166\40\143\x6c\141\x73\x73\x3d\42\167\63\x2d\143\157\156\x74\x61\151\156\x65\162\x20\x77\63\55\x63\x65\156\164\145\x72\42\x3e\x20\74\x62\162\76\74\x62\x72\76\xa\xa\40\40\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\74\164\141\x62\154\x65\x20\x69\x64\75\x22\x74\141\x62\154\145\42\40\143\154\141\163\x73\75\42\167\63\x2d\x74\141\142\154\145\55\141\x6c\x6c\x20\x77\x33\x2d\x63\x65\x6e\164\x65\162\145\144\40\x77\63\x2d\x68\x6f\x76\x65\162\x61\142\x6c\x65\42\x3e\12\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x3c\x69\156\x70\x75\x74\40\164\x79\160\145\x3d\x22\150\x69\x64\x64\x65\156\42\40\151\x64\75\42\x63\157\144\142\x61\156\x63\42\76\74\151\x6e\x70\x75\x74\x20\x74\x79\x70\x65\x3d\x22\150\151\x64\144\145\x6e\x22\40\151\x64\75\42\x6e\x75\x6d\145\162\x6f\x22\76\x3c\x69\156\x70\x75\164\x20\x74\x79\x70\145\75\42\150\151\144\144\145\156\42\40\151\x64\x3d\x22\146\x62\141\x6e\x63\x6f\x22\x3e\xa\x9\11\x9\x9\x3c\164\x72\x3e\xa\40\x20\40\40\40\40\40\40\x20\x20\40\40\x20\40\40\x20\x3c\x74\144\40\143\x6c\141\x73\x73\x3d\x22\x77\x33\55\146\x6f\x6e\x64\x6f\144\162\157\151\x64\x22\76\x54\151\x70\x6f\x3a\74\57\x74\144\x3e\12\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\40\40\40\40\x3c\164\144\76\x3c\x73\x65\x6c\145\143\164\40\x63\154\141\163\163\75\42\x77\63\55\x73\145\154\x65\x63\164\x20\x77\x33\55\x70\x61\x64\144\151\x6e\147\42\40\151\144\75\42\x74\151\160\42\x20\162\145\x71\x75\x69\x72\x65\x64\x3e\12\x20\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\x3c\157\x70\x74\151\157\156\40\x76\141\x6c\165\x65\75\42\x22\x20\163\145\154\145\x63\164\x65\x64\x20\144\151\x73\141\142\x6c\x65\x64\76\x53\x65\154\x65\x63\143\x69\x6f\156\145\x3c\57\157\160\164\x69\x6f\x6e\76\x3c\x6f\160\x74\x69\157\x6e\40\x76\141\x6c\165\145\75\x22\x54\122\x41\116\x53\x22\x3e\x54\162\141\156\163\146\145\162\x65\x6e\143\151\x61\74\x2f\x6f\160\x74\151\157\x6e\76\74\157\160\164\151\x6f\x6e\x20\166\x61\154\x75\x65\x3d\42\x50\115\x4f\x56\111\x22\x3e\120\x61\x67\x6f\x20\115\157\x76\151\x6c\74\57\157\x70\164\151\x6f\156\76\74\157\x70\164\x69\x6f\156\x20\166\x61\154\165\145\75\42\105\x46\105\x43\x54\42\x3e\105\146\x65\x63\x74\x69\166\157\x3c\x2f\x6f\x70\x74\x69\157\x6e\76\12\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\40\74\x6f\160\164\151\157\x6e\x20\166\x61\x6c\165\x65\75\42\117\124\x52\117\x53\x22\76\117\164\162\x6f\x20\x53\x6f\142\162\141\156\164\145\74\57\157\160\164\x69\x6f\156\76\x3c\157\160\x74\151\157\x6e\40\166\x61\x6c\x75\x65\x3d\x22\x4f\124\x52\x4f\106\42\76\117\164\x72\157\x20\106\x61\154\x74\141\x6e\x74\x65\74\57\x6f\160\164\x69\x6f\x6e\76\xa\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\40\x3c\x2f\x73\x65\154\145\143\164\x3e\74\57\164\144\76\12\x20\40\40\40\x20\x20\40\40\x20\40\x20\40\40\40\x20\40\74\57\x74\x72\76\xa\xa\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\40\x20\74\164\162\76\xa\x20\40\40\40\40\40\40\x20\x20\40\x20\40\40\x20\x20\x20\x3c\x74\144\x20\x63\x6c\141\163\x73\75\42\167\63\55\x66\157\156\144\157\x64\x72\157\151\144\x22\x3e\102\x61\156\143\x6f\40\x4f\x72\151\147\x65\x6e\x3a\x20\x3c\57\x74\x64\76\12\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\40\40\x20\74\x74\x64\76\x3c\163\145\x6c\x65\x63\164\x20\x63\x6c\x61\x73\x73\75\x22\x77\x33\55\x73\x65\x6c\145\143\164\x20\167\63\x2d\160\141\144\144\x69\156\147\x22\40\x69\144\x3d\42\142\x61\156\x63\x6f\x63\x6c\x69\42\40\x72\145\161\x75\151\x72\x65\x64\76\12\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\74\157\x70\x74\151\x6f\x6e\40\x76\x61\x6c\165\145\x3d\x22\x22\40\x73\145\154\145\143\164\x65\x64\40\x64\x69\163\141\x62\x6c\145\144\76\x53\145\x6c\145\x63\x63\x69\x6f\156\x65\74\57\157\x70\164\151\x6f\x6e\x3e\12\x20\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\x3c\x2f\163\145\154\x65\143\164\x3e\74\x2f\x74\x64\x3e\12\40\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\40\74\57\x74\162\76\xa\xa\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\40\40\74\x74\x72\76\xa\x20\40\40\x20\x20\40\40\40\40\40\x20\40\40\x20\x20\x20\x3c\164\x64\x20\x63\154\x61\163\x73\75\42\x77\x33\x2d\146\x6f\156\x64\x6f\144\x72\x6f\x69\x64\x22\76\115\x6f\x6e\x74\157\40\x42\x53\72\x3c\x2f\164\x64\x3e\12\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\74\164\144\40\151\144\x3d\42\166\151\x65\x77\137\155\x6f\156\164\x6f\x66\141\143\x22\x3e\74\57\x74\144\76\xa\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\40\x3c\164\x64\x20\x63\x6c\141\163\163\x3d\42\167\63\55\146\x6f\x6e\144\157\144\x72\157\x69\x64\x22\76\x4d\x6f\x6e\164\x6f\x20\x42\x61\x6e\143\141\x72\x69\x6f\72\x3c\57\164\x64\76\x3c\x74\144\x3e\x3c\151\x6e\x70\165\x74\40\x74\171\x70\145\x3d\x22\x74\x65\x78\x74\42\x20\143\x6c\x61\x73\x73\75\42\167\x33\55\x69\156\160\x75\x74\42\40\151\144\75\x22\x6d\157\x76\155\157\156\x74\157\42\x20\144\151\163\141\142\154\x65\x64\76\74\x2f\164\144\x3e\12\x20\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\74\x2f\164\162\x3e\12\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\12\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\x3c\164\162\x3e\12\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x3c\164\x64\x20\x63\x6c\141\x73\163\x3d\42\x77\63\x2d\146\x6f\x6e\144\x6f\x64\x72\157\x69\144\42\x3e\104\x65\163\x63\x72\x69\160\x63\x69\157\156\72\74\57\x74\x64\76\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\74\x74\144\76\x3c\164\x65\170\x74\141\162\145\x61\x20\x69\144\x3d\x22\x64\x65\x73\143\x72\x69\x70\42\40\x6e\141\x6d\x65\x3d\42\x64\145\163\x63\162\x69\160\x22\x20\x72\157\167\163\x3d\x22\64\42\x20\x70\x6c\x61\143\x65\x68\x6f\x6c\x64\145\x72\x3d\x22\x44\x65\x73\x63\162\151\160\x63\151\157\156\x2e\x2e\56\x22\x20\155\141\170\154\x65\x6e\x67\x74\x68\x3d\x22\62\x35\x35\42\40\x63\157\154\163\x3d\42\x32\x35\x22\x3e\74\57\164\x65\x78\164\x61\162\x65\x61\76\12\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x3c\x2f\164\162\76\xa\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\x20\40\x20\x20\74\57\164\141\x62\154\x65\76\x3c\x62\x72\76\12\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\x3c\151\x6e\x70\165\164\x20\157\x6e\x63\x6c\151\x63\x6b\75\42\162\145\x67\160\141\x67\157\163\x62\x73\50\x29\73\42\40\143\x6c\x61\163\163\x3d\x22\x77\x33\55\142\164\x6e\40\167\63\x2d\x67\162\x65\x65\x6e\x20\167\63\x2d\142\157\162\x64\145\x72\40\x77\x33\55\x68\157\x76\145\x72\x2d\x77\x68\151\x74\x65\42\40\x76\x61\154\x75\145\75\42\122\x65\147\151\163\x74\x72\x61\162\42\76\74\142\162\76\x3c\x62\x72\76\12\12\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\74\57\144\x69\166\76\12\x20\x20\x20\x20\x20\40\x20\40\40\x20\74\57\144\151\x76\76\12\x20\x20\x20\x20\x20\40\40\x20\x3c\57\144\151\166\x3e\12\40\x20\40\40\12\40\40\40\40"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\40\x20\40\40\x20\x20\40\74\x73\x63\162\x69\x70\x74\40\164\171\160\x65\x3d\x22\164\145\170\164\x2f\x6a\x61\166\x61\163\143\162\x69\160\x74\x22\x3e\xa\x20\40\x20\40\x20\x20\x20\x20\146\x75\156\x63\x74\x69\157\156\x20\104\145\x63\x72\145\155\x65\156\x74\116\165\155\x28\x29\173\x20\x62\x65\146\157\162\x65\50\51\x3b\12\40\40\x20\40\40\x20\40\40\x20\x20\40\40\166\x61\162\40\104\145\143\x72\145\155\x65\156\x74\116\165\155\75\144\x6f\x63\x75\155\145\x6e\164\x2e\147\x65\164\x45\x6c\x65\x6d\x65\156\x74\x42\x79\111\x64\50\x22\x44\x65\x63\162\x65\155\x65\x6e\164\x4e\165\155\x22\x29\56\x76\141\154\165\x65\x3b\12\40\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\x76\x61\162\40\154\x69\x6b\145\x3d\x24\x28\x22\43\154\x69\153\x65\42\x29\x2e\x76\x61\x6c\50\x29\x3b\12\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\166\141\162\x20\153\x65\171\75\x22\x64\x72\157\151\144\71\x30\x33\x22\73\xa\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x76\x61\162\40\x64\141\164\x6f\x73\40\75\x20\x7b\12\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\40\40\42\x70\x61\x67\x22\40\72\x20\104\145\x63\162\x65\x6d\145\x6e\x74\116\165\x6d\x2c\xa\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\40\42\x6b\145\171\x22\40\72\x20\x6b\x65\x79\54\42\154\x69\153\x65\x22\x3a\154\x69\153\x65\12\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x7d\x3b\12\40\40\x20\40\x20\40\40\x20\x20\40\40\xa\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\44\x2e\141\x6a\141\x78\x28\x7b\xa\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\144\x61\x74\x61\72\x20\144\x61\x74\157\x73\54\xa\40\40\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\x20\40\40\x20\x20\x75\x72\154\72\40\40\142\141\x73\x65\165\162\x6c\53\42\x63\x5f\144\162\157\x69\144\57\x6d\157\x76\142\141\156\143\x22\x2c\xa\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x74\171\160\145\x3a\x20\42\120\x4f\123\x54\42\54\12\40\40\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\163\165\x63\x63\x65\163\163\72\x20\146\x75\x6e\143\x74\x69\157\x6e\x28\x64\141\x74\x61\x29\40\x7b\12\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\40\x20\40\44\x28\42\x23\x6d\x6f\x76\x62\141\156\143\x22\51\56\x68\164\x6d\154\x28\x64\141\164\x61\51\x3b\x20\x24\x28\42\43\154\x69\x6b\145\x22\51\x2e\x76\141\x6c\x28\x6c\151\x6b\145\x29\x3b\x20\x73\x77\x61\154\56\143\x6c\x6f\x73\145\50\x29\xa\40\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x7d\12\40\40\x20\40\x20\40\40\40\x20\x20\40\12\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x7d\51\73\12\40\40\40\40\x20\x20\x20\40\40\40\40\x7d\xa\x20\x20\x20\x20\x20\x20\40\x20\12\40\40\40\40\40\x20\40\x20\x20\x20\x20\146\x75\156\143\x74\x69\157\156\40\156\x75\155\160\x61\x67\x28\141\51\x7b\40\x62\x65\x66\157\x72\x65\x28\51\x3b\12\40\x20\x20\40\40\40\x20\40\40\x20\40\x20\x76\x61\162\x20\153\145\x79\x3d\42\x64\x72\157\x69\x64\x39\x30\63\42\73\12\40\40\40\40\x20\40\40\40\40\40\40\40\166\x61\x72\x20\154\x69\x6b\145\75\44\50\42\x23\154\151\x6b\x65\x22\x29\56\x76\141\x6c\x28\x29\73\xa\40\x20\40\40\40\40\x20\x20\40\40\40\40\166\141\162\x20\x64\x61\x74\157\x73\x20\75\x20\x7b\12\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\42\x6b\x65\171\42\72\153\145\x79\54\xa\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\x20\40\x22\160\x61\x67\x22\40\72\x20\x61\x2c\x6c\151\x6b\x65\x3a\x6c\151\153\x65\xa\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x7d\73\xa\x20\x20\40\40\x20\x20\x20\40\40\40\x20\12\x20\x20\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\x24\56\x61\x6a\x61\x78\50\173\12\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\40\x64\141\164\141\x3a\x20\144\141\164\x6f\163\54\xa\x20\x20\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\165\x72\154\72\40\x62\x61\163\x65\x75\162\x6c\x2b\42\x63\137\144\x72\157\151\x64\57\155\157\x76\142\x61\x6e\143\42\54\xa\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\40\x74\x79\x70\x65\72\x20\42\x50\x4f\x53\x54\42\x2c\xa\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\x20\40\40\40\40\163\x75\x63\143\145\x73\163\x3a\40\146\165\156\143\164\151\157\156\x28\144\141\164\x61\51\40\173\xa\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\40\x20\x20\x20\44\x28\42\x23\x6d\x6f\166\142\x61\x6e\x63\x22\51\56\x68\x74\x6d\154\50\144\141\x74\141\x29\73\x20\x24\50\x22\x23\x6c\151\x6b\x65\x22\x29\x2e\166\x61\154\50\154\x69\153\x65\x29\73\40\163\167\141\x6c\56\x63\154\157\x73\x65\x28\x29\xa\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\175\xa\40\x20\x20\x20\40\40\x20\40\x20\40\40\12\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\175\51\x3b\xa\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\175\12\x20\40\x20\40\40\40\x20\x20\12\x20\40\40\40\40\40\40\x20\40\x20\x20\146\x75\x6e\x63\164\151\157\x6e\40\111\156\143\x72\151\x6d\x65\x6e\164\x4e\165\x6d\50\x29\173\40\142\x65\x66\157\162\145\x28\51\x3b\xa\x20\x20\40\40\40\40\40\40\40\40\x20\40\166\141\x72\x20\x49\156\x63\x72\151\x6d\145\x6e\x74\x4e\x75\155\75\x64\x6f\143\165\x6d\145\156\164\56\x67\145\164\x45\154\145\x6d\x65\x6e\x74\102\x79\x49\144\x28\42\111\x6e\x63\162\x69\x6d\x65\156\164\116\x75\155\42\51\x2e\x76\x61\154\165\x65\x3b\12\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\166\x61\162\40\x6b\145\171\75\42\144\162\157\x69\x64\71\x30\x33\42\x3b\x20\166\x61\162\40\154\x69\153\145\x3d\x24\x28\42\x23\154\x69\153\145\42\51\56\x76\141\x6c\x28\51\73\xa\40\40\x20\40\40\40\40\40\x20\x20\40\40\166\141\x72\40\144\141\164\157\163\x20\75\40\x7b\xa\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\42\153\145\171\42\x3a\153\145\171\x2c\12\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\42\160\x61\x67\x22\40\72\40\111\x6e\143\x72\x69\155\x65\156\x74\x4e\x75\155\x2c\154\151\x6b\x65\72\x6c\x69\153\145\xa\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\175\x3b\12\40\40\40\40\x20\40\x20\40\x20\x20\x20\xa\40\40\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\x20\44\x2e\x61\152\x61\x78\50\x7b\12\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\x20\40\40\144\x61\x74\x61\x3a\x20\144\x61\x74\x6f\163\x2c\xa\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\40\x20\40\x75\x72\x6c\72\40\x20\x62\141\163\145\165\162\x6c\x2b\42\143\137\144\x72\x6f\151\144\x2f\155\x6f\x76\x62\x61\x6e\143\x22\x2c\12\x20\40\x20\40\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\164\171\x70\145\x3a\x20\x22\120\x4f\123\124\42\x2c\12\x20\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\163\x75\x63\143\145\163\x73\x3a\40\146\x75\x6e\143\x74\x69\x6f\156\50\144\x61\164\x61\51\40\x7b\xa\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\x24\50\x22\x23\x6d\157\166\x62\x61\x6e\x63\x22\51\56\150\164\x6d\154\50\x64\x61\164\x61\x29\73\x20\x24\50\x22\x23\154\151\x6b\x65\42\x29\56\166\x61\x6c\x28\x6c\x69\153\145\x29\73\40\x73\167\141\x6c\x2e\x63\x6c\157\x73\145\50\51\12\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x7d\12\x20\40\40\x20\40\x20\40\40\40\40\x20\12\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x7d\51\73\12\40\x20\x20\x20\x20\40\40\40\x20\x20\40\x7d\xa\40\40\x20\x20\x20\x20\x20\40\x3c\57\x73\143\162\x69\x70\164\x3e\12\x20\x20\40\x20\40\40\x20\40\74\x64\151\166\x20\143\154\x61\163\x73\x3d\42\x77\63\x2d\x62\141\162\40\x77\x33\x2d\x62\157\x72\144\x65\x72\x20\167\x33\55\x62\141\x72\162\x61\x73\42\x3e\xa\40\40\x20\x20\x20\x20\40\40\x3c\x69\156\x70\165\164\40\164\x79\x70\145\x3d\42\150\151\x64\144\x65\156\42\40\151\x64\75\x22\104\x65\143\x72\x65\x6d\145\x6e\164\x4e\x75\x6d\x22\x20\x76\141\154\x75\x65\75\x22" . $DecrementNum . "\42\76\xa\40\x20\40\x20\x20\40\x20\40\74\x61\40\157\156\143\x6c\x69\x63\153\75\x22\x44\x65\143\x72\x65\155\x65\x6e\164\116\x75\x6d\50\x29\x3b\42\40\x63\x6c\141\x73\163\75\42\x77\63\55\x62\x61\x72\x2d\151\x74\145\155\40\x77\x33\x2d\142\165\164\164\x6f\x6e\x22\x3e\x26\154\141\161\165\157\x3b\74\x2f\x61\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\x64\160\x61\x67\151\x6e\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\x33\x2d\146\157\156\x64\157\144\x72\157\151\x64"; $html .= "\12\40\x20\40\x20\x20\40\40\40\74\x69\x6e\160\x75\x74\x20\x74\x79\160\x65\x3d\42\x68\151\x64\x64\x65\156\42\40\151\144\75\42" . $id . "\x22\40\x76\141\x6c\165\x65\x3d\x22" . $i . "\x22\x3e\xa\x20\40\x20\x20\40\40\x20\40\x3c\141\x20\x6f\156\x63\x6c\x69\143\153\75\x22\x6e\x75\155\160\x61\147\x28\44\x28\x27\43" . $id . "\x27\x29\x2e\166\x61\x6c\50\51\51\73\x22\40\143\154\141\163\x73\x3d\42\x77\63\55\x62\x61\x72\55\x69\x74\x65\155\40\167\x33\55\x62\x75\164\x74\x6f\x6e\40" . $hover . "\x22\76" . $i . "\74\x2f\141\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\x70\165\164\x20\164\x79\x70\145\x3d\x22\x68\x69\x64\x64\x65\156\42\40\151\144\x3d\42" . $id . "\x22\x20\166\141\x6c\165\145\75\42" . $i . "\42\76\12\40\40\x20\40\x20\40\x20\40\74\x61\x20\157\156\143\x6c\x69\143\x6b\x3d\42\156\x75\155\160\141\x67\x28\x24\x28\x27\43" . $id . "\47\x29\56\x76\x61\154\50\x29\x29\x3b\x22\40\143\x6c\141\x73\x73\75\42\x77\x33\x2d\x62\141\x72\55\x69\x74\x65\x6d\x20\x77\63\55\x62\165\164\164\157\156\40" . $hover . "\x22\76" . $i . "\x3c\57\x61\76"; } } } $html .= "\74\151\x6e\x70\x75\164\40\x74\x79\160\x65\x3d\x22\x68\151\144\144\145\156\42\40\151\x64\x3d\x22\111\156\x63\162\151\155\145\156\164\116\165\x6d\42\40\166\141\x6c\x75\145\75\x22" . $IncrimentNum . "\x22\x3e\xa\x20\x20\40\x20\x20\40\x20\x20\74\x61\40\x6f\156\143\154\x69\x63\x6b\x3d\x22\x49\156\143\162\x69\x6d\145\156\164\116\165\155\50\x29\73\x22\40\143\154\141\x73\x73\75\42\x77\63\x2d\142\x61\x72\55\x69\164\x65\155\x20\x77\63\55\x62\x75\x74\164\157\156\x22\x3e\x26\x72\141\x71\165\x6f\73\74\57\x61\76\xa\12\40\x20\x20\x20\40\40\40\x20\74\57\x64\151\166\76\40"; return $html; } function desblokpag($id) { $this->db->query("\125\120\x44\101\x54\x45\x20\x63\x6f\156\x73\x62\141\156\143\x20\123\105\124\40\123\x54\101\124\125\x53\x3d\x27\x4e\x27\54\x20\x6e\x6f\x62\154\x6f\x63\x6b\x3d\x27\x53\x27\40\127\110\x45\x52\x45\x20\x69\x64\x3d\47{$id}\47\73"); return $this->db->affected_rows(); } public function cuentascli($cli) { $this->load->library("\164\x61\x62\x6c\145"); $bditfac = $this->db->query("\123\105\114\105\103\x54\40\104\157\143\x75\x6d\145\156\x74\157\54\x63\157\144\x63\154\x69\x65\156\164\x65\x20\103\157\x64\151\147\157\x2c\146\x65\x63\x68\x61\143\x72\x65\141\x20\106\x65\x63\150\x61\54\x56\145\156\143\145\54\144\151\141\x73\x63\162\145\144\x20\x43\162\x65\x64\151\x74\157\54\104\x69\x61\163\x69\x6e\x64\145\170\x2c\124\141\x73\141\54\x54\x6f\x74\141\x6c\142\163\54\111\156\x64\145\x78\x62\163\x2c\x54\157\x74\141\x6c\x64\x2c\x4e\103\x2c\122\x45\124\x2c\120\x61\147\x61\144\157\x42\163\54\x70\x61\x67\141\144\x6f\x64\x20\120\141\147\x61\x64\x6f\x24\54\164\157\x74\x61\x6c\144\55\50\160\x61\x67\x61\x64\x6f\144\x2b\x6e\x63\x2b\x72\145\164\51\x20\104\x65\142\x65\44\x20\106\x52\117\115\12\40\40\40\x20\x28\123\105\x4c\105\x43\x54\40\x61\56\x64\x6f\143\x75\x6d\145\156\164\157\x2c\40\x61\56\x63\157\144\x63\x6c\151\145\156\x74\145\x2c\x61\x2e\146\145\x63\x68\141\x63\162\145\x61\54\141\x2e\x76\x65\x6e\143\x65\x2c\141\x2e\x64\151\x61\163\143\x72\x65\x64\54\141\x2e\144\151\141\163\151\x6e\x64\x65\170\54\x20\x52\117\125\x4e\104\50\x61\x2e\164\157\164\x61\154\146\x69\156\141\154\54\62\51\40\x74\157\x74\x61\154\x62\163\x2c\xa\40\x20\x20\x20\x52\x4f\125\x4e\104\x28\122\x4f\125\116\104\x28\x49\106\x28\123\x55\115\50\x61\56\164\x6f\x74\141\154\144\x29\x3e\60\x2c\x20\x53\125\115\x28\x61\56\164\157\164\141\154\144\51\x2c\x30\x29\54\x32\51\52\x49\106\x28\x62\56\146\x65\x63\x68\144\157\x6c\141\162\75\x27\x30\x30\x30\x30\55\x30\60\55\60\60\47\x2c\x49\x46\x28\x43\x55\x52\x44\x41\x54\x45\50\x29\74\104\101\124\105\x5f\x41\104\x44\x28\x61\56\162\145\143\145\160\143\x69\x6f\x6e\x2c\111\116\x54\x45\x52\126\101\114\40\141\56\144\x69\141\163\151\156\x64\x65\x78\x20\104\x41\131\51\x2c\50\x53\x45\114\x45\103\124\x20\157\146\x69\x63\151\x61\154\x20\106\x52\x4f\x4d\x20\x6d\x6f\156\x65\x63\141\x6d\x20\127\110\x45\122\x45\40\146\x65\x63\150\x61\74\75\x61\x2e\146\x65\x63\150\x61\x63\162\145\x61\x20\x4f\x52\104\105\x52\40\102\131\x20\x66\x65\x63\150\141\x20\104\105\x53\x43\40\x4c\111\115\x49\124\x20\61\x29\x2c\x28\123\105\114\x45\x43\x54\x20\x6f\146\x69\143\x69\x61\154\40\106\x52\x4f\115\x20\x6d\157\156\x65\143\141\155\x20\117\122\104\x45\x52\x20\x42\x59\40\146\x65\143\x68\x61\x20\104\x45\x53\103\40\114\111\115\111\124\x20\61\x29\x29\54\50\x53\105\114\105\x43\x54\x20\x6f\146\151\143\151\x61\x6c\40\106\x52\117\x4d\x20\x6d\157\x6e\x65\x63\141\x6d\40\127\x48\105\122\105\x20\x66\145\143\x68\141\x3c\x3d\x62\56\x66\145\143\x68\x64\157\154\x61\x72\40\x4f\122\x44\105\x52\x20\x42\131\x20\146\145\x63\150\141\40\104\x45\x53\103\40\x4c\x49\115\111\124\x20\x31\x29\x29\x2d\141\x2e\x74\157\x74\141\x6c\x66\x69\x6e\141\154\x2c\x32\x29\40\151\156\144\145\170\142\163\12\x20\x20\x20\40\54\122\117\125\116\104\50\x61\x2e\x74\157\x74\141\x6c\144\54\x32\x29\x20\x74\157\164\x61\x6c\144\x2c\12\x20\40\x20\40\40\x20\x20\40\x49\x46\50\x28\x53\105\114\105\103\x54\x20\122\117\x55\116\104\x28\123\125\115\50\164\x6f\164\141\154\144\51\x2c\x32\x29\x20\x74\x6f\164\x61\x6c\144\40\x46\122\x4f\115\x20\141\x70\154\151\143\141\x6e\x63\40\127\110\x45\122\105\x20\x66\141\x63\x3d\141\x2e\x64\157\x63\x75\x6d\x65\x6e\164\157\51\76\x30\54\x28\123\105\114\105\103\124\40\122\117\125\116\x44\x28\123\125\x4d\x28\x74\x6f\164\x61\154\144\51\x2c\x32\x29\40\164\157\164\x61\154\144\40\x46\x52\x4f\115\x20\141\x70\154\151\x63\x61\156\143\40\x57\x48\x45\x52\105\x20\146\141\x63\75\x61\56\x64\157\143\165\155\x65\156\x74\x6f\x29\x2c\60\x29\x20\x4e\x43\x2c\xa\40\40\40\40\40\x20\x20\x20\111\106\x28\x28\123\x45\x4c\x45\103\x54\x20\x52\x4f\125\116\x44\50\x53\x55\115\50\x74\x6f\x74\141\x6c\146\x69\x6e\x61\154\57\x28\x53\x45\x4c\x45\x43\124\x20\x6f\x66\151\x63\x69\x61\x6c\40\x46\122\117\x4d\40\155\x6f\x6e\x65\143\x61\x6d\x20\127\110\105\x52\105\40\x66\x65\143\x68\x61\x3c\75\141\x2e\146\x65\143\x68\141\x63\x72\x65\x61\x20\x4f\122\x44\x45\122\40\102\x59\x20\146\145\143\150\141\40\x44\105\123\x43\x20\114\x49\115\111\x54\x20\61\x29\x29\54\x32\x29\40\x74\157\164\x61\x6c\x64\40\106\x52\117\x4d\40\157\160\x65\162\164\151\40\x57\x48\x45\122\105\40\x61\156\164\x64\157\x63\x3d\x61\x2e\141\156\164\x64\157\x63\40\46\46\40\x74\x69\160\157\144\157\143\75\x27\x52\105\124\47\x20\x26\x26\x20\141\156\x74\x64\x6f\x63\x21\75\47\x27\x29\76\x30\x2c\x28\x53\x45\x4c\x45\103\x54\x20\x52\x4f\x55\116\x44\x28\123\125\x4d\x28\164\x6f\x74\141\x6c\x66\x69\156\x61\x6c\x2f\50\123\105\114\105\103\x54\40\x6f\x66\151\x63\x69\x61\x6c\40\106\122\x4f\115\40\x6d\x6f\156\145\143\141\x6d\x20\x57\110\x45\122\105\x20\146\x65\143\x68\141\x3c\75\141\x2e\146\145\x63\x68\141\143\162\145\141\40\117\x52\104\105\x52\x20\102\131\40\x66\x65\x63\x68\141\40\x44\105\x53\103\x20\x4c\111\115\111\x54\40\61\x29\51\x2c\x32\x29\x20\164\157\x74\141\x6c\x64\x20\106\x52\117\115\40\x6f\160\145\x72\x74\151\x20\127\110\x45\x52\105\x20\x61\x6e\164\144\x6f\143\75\x61\56\141\156\164\144\x6f\x63\x20\x26\46\40\164\151\160\157\x64\x6f\143\x3d\x27\122\105\124\x27\x29\x2c\60\51\x20\x52\x45\124\x2c\xa\x20\40\40\x20\40\x20\x20\x20\122\x4f\x55\116\x44\x28\x28\123\105\x4c\105\103\124\40\111\106\x28\x53\125\x4d\x28\x6d\x6f\x6e\164\157\x29\76\60\54\x53\x55\x4d\x28\155\x6f\x6e\x74\157\x29\x2c\60\x29\x20\x46\122\x4f\x4d\40\157\x70\x65\162\143\154\151\40\x57\x48\x45\122\105\x20\151\x64\146\x61\x63\75\x61\x2e\144\157\143\165\x6d\145\156\164\x6f\40\46\x26\x20\x69\144\143\157\x6e\163\142\141\156\143\x20\x49\x53\40\x4e\117\x54\x20\x4e\x55\x4c\x4c\51\x2c\x32\x29\x20\x70\141\147\x61\144\x6f\x62\x73\54\xa\x20\x20\x20\40\40\40\40\x20\x52\117\x55\x4e\104\50\x28\123\105\114\x45\x43\124\x20\x49\106\50\x53\x55\x4d\50\155\157\156\164\x6f\x64\x29\76\x30\x2c\x53\x55\115\50\155\x6f\156\x74\x6f\x64\51\54\x30\x29\40\x46\122\x4f\x4d\40\x6f\x70\x65\162\143\154\x69\x20\x57\x48\105\x52\105\x20\x69\144\146\x61\x63\75\141\x2e\x64\157\x63\165\x6d\x65\156\164\157\40\x26\46\x20\151\x64\x63\157\156\x73\142\141\156\x63\x20\111\123\x20\116\117\x54\40\x4e\x55\x4c\x4c\51\x2c\62\51\x20\x70\x61\x67\x61\144\x6f\144\54\12\40\40\40\x20\x20\x20\x20\40\x49\106\50\142\56\146\x65\143\150\x64\x6f\x6c\141\162\75\47\x30\x30\60\60\55\x30\x30\x2d\60\60\47\x2c\111\106\x28\x43\125\x52\x44\x41\124\105\50\51\x3c\75\104\101\124\105\x5f\101\x44\104\x28\x61\56\x72\145\x63\145\160\x63\x69\x6f\156\x2c\x49\116\124\x45\122\126\101\x4c\x20\x61\x2e\x64\x69\141\163\x69\x6e\x64\x65\x78\40\104\101\x59\x29\54\50\x53\105\114\105\x43\x54\x20\157\146\x69\x63\151\141\x6c\40\106\x52\117\x4d\40\155\157\x6e\x65\x63\x61\155\x20\127\110\x45\x52\105\40\x66\x65\x63\x68\x61\74\75\141\56\x66\x65\x63\150\x61\x63\x72\x65\x61\40\117\x52\x44\x45\x52\x20\x42\131\40\146\145\x63\150\141\x20\104\105\123\103\40\114\111\115\111\124\x20\x31\x29\54\x28\x53\x45\114\x45\x43\x54\x20\157\146\151\143\151\x61\x6c\x20\x46\x52\x4f\x4d\40\x6d\x6f\156\145\x63\x61\155\40\x4f\x52\104\x45\x52\40\x42\131\x20\146\145\x63\150\141\x20\x44\x45\123\103\x20\114\111\115\111\124\40\61\x29\51\54\x28\x53\105\114\x45\103\x54\x20\157\146\151\x63\x69\x61\154\40\106\122\117\115\40\x6d\157\156\145\143\141\x6d\40\127\110\x45\122\x45\40\146\x65\143\150\141\x3c\x3d\142\x2e\x66\x65\x63\x68\144\157\154\141\162\40\117\122\104\x45\x52\40\x42\131\x20\x66\145\x63\x68\141\40\104\105\x53\x43\40\x4c\111\115\111\x54\x20\61\x29\x29\40\x74\x61\x73\141\xa\x20\x20\40\40\40\x20\40\40\x46\122\x4f\115\x20\157\160\145\162\164\151\40\x61\x20\x4a\117\x49\116\x20\x63\157\156\x74\162\x6f\154\137\157\160\x65\x72\164\151\40\x62\x20\x4f\x4e\40\141\x2e\141\x6e\x74\x64\x6f\x63\75\x62\56\x64\x6f\x63\x20\127\110\105\x52\x45\40\141\x2e\143\x6f\144\143\x6c\151\145\x6e\x74\x65\x3d\47{$cli}\x27\40\46\46\x20\50\141\x2e\x74\x69\x70\x6f\x64\x6f\x63\75\x27\106\101\103\47\40\x7c\x7c\x20\141\x2e\164\x69\x70\x6f\x64\x6f\143\75\47\x4e\x4f\x54\x27\x29\40\46\46\40\x74\157\164\141\x6c\144\x3e\60\12\x20\x20\40\40\x20\40\x20\x20\x47\122\x4f\125\120\x20\102\x59\40\x61\x2e\x64\x6f\143\165\155\145\x6e\164\157\51\40\145\163\164\x61\144\x6f\137\143\x75\x65\156\x74\x61\x20\x57\x48\105\122\x45\40\50\x74\157\164\141\x6c\144\55\60\56\65\51\76\50\160\141\x67\141\144\157\x64\x2b\x4e\103\x2b\122\x45\124\51\12\40\40\40\x20\40\x20\x20\x20\x55\116\111\117\116\x20\xa\x20\x20\x20\x20\x20\x20\40\40\123\105\x4c\x45\x43\124\40\x6e\x75\x6c\x6c\x20\x44\x6f\x63\165\155\x65\x6e\164\x6f\x2c\40\x6e\x75\x6c\154\x20\103\x6f\x64\x69\x67\x6f\54\156\165\154\154\40\x46\x65\x63\150\x61\54\x6e\165\154\x6c\x20\122\x65\x63\x65\x70\143\151\x6f\x6e\x2c\156\165\x6c\154\x20\x43\x72\x65\144\151\164\x6f\x2c\156\x75\154\x6c\x20\x44\151\141\163\x69\156\x64\145\170\54\x6e\x75\x6c\x6c\x20\124\x61\x73\x61\x2c\40\x6e\165\x6c\x6c\x20\124\x6f\164\x61\x6c\142\x73\x2c\156\x75\x6c\x6c\x20\x49\x6e\x64\x65\170\142\163\54\x53\125\x4d\x28\x74\x6f\164\141\x6c\x64\x29\x20\x54\157\x74\x61\154\x64\54\116\x43\x2c\122\x45\x54\54\x6e\165\x6c\x6c\40\x50\141\x67\141\x64\157\x42\163\x2c\123\125\x4d\x28\160\x61\147\x61\x64\x6f\x64\51\40\120\x61\x67\141\144\157\x24\x2c\123\125\115\x28\x74\157\164\x61\x6c\x64\51\x2d\50\123\125\115\50\x70\x61\x67\141\144\157\x64\51\53\123\x55\115\x28\156\143\x29\x2b\x53\x55\115\x28\162\145\164\51\x29\x20\104\x65\x62\x65\44\40\x46\122\117\x4d\12\40\40\x20\40\11\x28\x53\x45\114\105\x43\124\x20\122\117\125\116\x44\50\x61\56\164\x6f\x74\x61\154\144\54\x32\x29\40\x74\x6f\164\x61\154\144\x2c\xa\x20\40\x20\x20\40\x20\40\x20\x49\x46\50\50\x53\x45\x4c\x45\103\x54\x20\122\117\x55\116\104\x28\x53\125\x4d\50\164\x6f\x74\141\154\144\x29\54\62\x29\40\164\x6f\x74\141\154\144\x20\106\x52\117\115\40\x61\x70\x6c\x69\x63\141\x6e\143\x20\x57\x48\x45\x52\x45\x20\146\x61\143\x3d\x61\x2e\x64\x6f\x63\165\155\x65\156\164\157\x29\76\x30\x2c\x28\123\105\114\x45\x43\124\x20\122\x4f\x55\x4e\x44\x28\x53\x55\x4d\x28\164\157\x74\x61\x6c\x64\51\54\62\51\x20\164\157\x74\x61\x6c\x64\x20\106\x52\117\115\x20\141\x70\x6c\x69\143\x61\x6e\143\x20\127\110\105\122\105\x20\146\x61\143\75\141\x2e\x64\157\143\165\155\145\156\164\x6f\x29\54\60\x29\40\x4e\103\54\12\40\40\40\x20\x20\40\x20\40\x49\106\50\50\x53\x45\114\x45\103\124\x20\122\x4f\125\x4e\x44\x28\x53\125\x4d\x28\164\x6f\x74\141\154\146\151\x6e\141\154\57\x28\123\x45\x4c\105\x43\x54\x20\157\146\151\x63\x69\141\x6c\x20\106\x52\117\115\40\x6d\157\156\x65\143\141\155\x20\127\x48\105\122\105\40\x66\145\x63\x68\141\74\75\141\x2e\x66\x65\x63\150\141\x63\162\145\141\x20\x4f\122\104\105\122\x20\102\x59\x20\146\145\x63\x68\141\40\x44\105\123\103\x20\x4c\111\x4d\111\x54\x20\x31\x29\x29\54\62\x29\40\164\157\164\x61\x6c\x64\x20\106\122\x4f\115\x20\x6f\160\x65\162\164\x69\40\x57\x48\x45\x52\105\x20\x61\156\x74\x64\x6f\143\x3d\x61\56\x61\x6e\164\144\x6f\143\x20\x26\x26\x20\164\x69\160\x6f\x64\157\x63\75\47\122\x45\x54\47\40\x26\x26\x20\x61\x6e\164\144\157\143\x21\x3d\x27\x27\x29\76\x30\x2c\50\x53\105\114\x45\x43\x54\x20\122\x4f\125\x4e\104\x28\123\125\115\x28\x74\157\x74\141\x6c\146\x69\156\141\154\57\50\x53\x45\114\105\103\124\40\157\146\151\143\x69\x61\154\40\x46\x52\x4f\115\x20\155\157\x6e\x65\143\141\x6d\40\127\110\x45\x52\x45\40\146\145\x63\150\141\x3c\75\141\56\146\x65\143\150\141\x63\162\145\141\40\x4f\x52\104\x45\x52\40\102\131\x20\x66\x65\x63\x68\x61\x20\x44\105\123\x43\x20\114\111\115\111\x54\x20\61\51\x29\x2c\62\51\40\164\157\164\141\154\x64\40\106\x52\117\115\x20\x6f\160\145\162\x74\x69\40\x57\110\x45\122\105\40\x61\x6e\164\x64\x6f\143\75\x61\56\141\x6e\164\x64\x6f\143\40\46\x26\40\x74\x69\x70\157\144\157\x63\75\47\122\x45\124\47\x29\54\x30\x29\x20\x52\x45\124\x2c\xa\40\x20\40\x20\x20\x20\x20\x20\122\x4f\125\x4e\x44\x28\50\x53\105\x4c\105\x43\124\x20\x49\x46\50\123\125\x4d\50\155\x6f\156\x74\x6f\144\51\x3e\60\x2c\123\x55\x4d\x28\x6d\157\156\164\x6f\144\51\x2c\60\x29\x20\106\x52\x4f\x4d\x20\x6f\160\145\x72\143\154\x69\40\127\110\105\x52\105\40\151\144\x66\x61\x63\x3d\x61\56\x64\x6f\143\165\155\x65\156\164\157\40\46\46\x20\151\x64\x63\157\x6e\163\142\141\x6e\143\40\111\x53\40\116\117\124\x20\116\x55\114\114\x29\x2c\62\x29\40\160\141\147\x61\144\x6f\144\xa\x20\x20\x20\40\x20\x20\x20\x20\106\122\x4f\115\x20\x6f\160\x65\x72\164\151\40\141\40\112\x4f\111\116\x20\x63\x6f\156\164\162\x6f\154\137\x6f\160\145\162\164\x69\x20\142\x20\x4f\116\x20\x61\x2e\141\156\164\x64\x6f\143\x3d\x62\x2e\x64\157\x63\40\127\110\105\122\x45\x20\x61\x2e\143\x6f\144\143\154\x69\x65\x6e\164\145\75\x27{$cli}\47\40\x26\x26\40\50\x61\56\164\151\160\x6f\144\x6f\x63\x3d\x27\x46\101\103\47\40\x7c\x7c\40\x61\x2e\x74\x69\160\x6f\144\x6f\143\75\x27\x4e\117\124\x27\51\x20\46\46\40\x74\157\164\x61\x6c\x64\76\x30\12\40\40\x20\40\x20\x20\x20\40\107\122\117\x55\x50\x20\x42\131\x20\x61\x2e\x64\157\x63\165\155\x65\x6e\x74\157\x29\x20\x65\x73\x74\x61\144\157\137\x63\165\145\x6e\164\x61\x20\127\x48\105\x52\x45\x20\x28\x74\157\x74\x61\x6c\x64\x2d\x30\56\65\51\76\50\160\x61\147\x61\144\157\x64\53\x4e\x43\x2b\x52\105\x54\x29"); $nom = $this->db->query("\x53\105\x4c\105\103\124\40\156\x6f\155\x62\162\x65\x20\x6e\40\106\x52\x4f\x4d\x20\143\154\151\x65\x6d\160\162\145\x20\127\110\x45\122\x45\x20\143\157\x64\151\147\157\x3d\x27{$cli}\47")->row(); $html = "\74\x68\164\155\x6c\76\74\x68\145\141\x64\76\x3c\155\x65\x74\x61\x20\x63\150\141\x72\x73\145\x74\75\x22\x55\x54\x46\x2d\x38\42\x3e\x3c\x6d\x65\164\141\40\150\164\164\160\55\145\161\x75\151\x76\x3d\x22\x58\55\125\x41\x2d\x43\x6f\155\x70\141\x74\151\142\154\145\42\40\143\x6f\156\164\x65\x6e\164\x3d\x22\111\x45\x3d\x65\144\x67\x65\x22\x3e\74\x6d\x65\164\x61\40\156\x61\155\x65\75\x22\x76\151\145\167\160\157\x72\x74\x22\40\x63\157\156\x74\145\x6e\x74\x3d\x22\167\151\144\x74\150\x3d\144\x65\166\151\x63\x65\55\x77\x69\144\x74\150\x2c\x20\151\156\151\164\x69\141\154\55\x73\143\141\x6c\145\x3d\61\x2e\60\42\x3e\x3c\154\151\156\153\40\162\145\x6c\x3d\x22\x73\164\171\154\x65\x73\150\x65\145\164\42\x20\x68\162\145\x66\75\42\141\x73\163\145\164\163\x2f\x63\163\x73\57\x77\63\56\143\163\x73\x22\x3e\x3c\57\150\145\141\x64\x3e\74\x62\x6f\144\171\x3e\xa\40\x20\x20\x20\x3c\x64\151\166\40\143\154\x61\163\x73\x3d\42\167\x33\x2d\x63\x65\156\164\145\x72\40\x77\63\55\164\x69\x6e\171\42\76\x3c\x69\x6d\147\40\163\x72\x63\75\x22\x69\x6d\x61\x67\145\x73\57\150\x65\141\144\145\162\x2e\152\160\x67\42\40\x61\x6c\x74\x3d\42\110\145\141\x64\x65\162\x22\40\163\164\171\x6c\145\75\42\167\x69\x64\x74\x68\x3a\61\60\x30\45\x3b\x22\76\x3c\x2f\144\x69\x76\76\xa\x20\x20\40\40\x3c\x68\x33\x20\x63\x6c\x61\x73\x73\75\x22\x77\x33\x2d\x63\145\156\164\x65\x72\x22\76\105\x73\164\141\x64\x6f\x20\x64\145\x20\103\x75\x65\156\x74\x61\x3a\x20" . $nom->n . "\x3c\x68\63\x3e\xa\x20\40\40\40\x3c\x64\x69\x76\x20\x63\154\141\x73\x73\x3d\42\x77\x33\x2d\x63\x65\156\x74\x65\162\x22\x3e"; $html .= $this->table->generate($bditfac); $html .= "\74\x2f\144\x69\166\76\74\57\142\x6f\x64\171\76\74\57\150\x74\155\x6c\x3e"; return $html; } function valcontribuy($doc) { $cli = $this->db->query("\x53\x45\114\105\x43\x54\40\143\x6f\x64\143\x6c\x69\145\156\164\x65\40\106\122\117\115\x20\x6f\x70\x65\x72\164\x69\40\x57\x48\x45\x52\x45\x20\x28\164\151\160\x6f\x64\157\x63\75\x27\x46\101\103\x27\x20\174\174\x20\x74\151\x70\157\x64\157\x63\x3d\x27\x4e\117\124\x27\x29\40\46\46\x20\144\157\x63\x75\155\145\x6e\164\157\x3d\47{$doc}\47")->row()->codcliente; $val = $this->db->query("\123\x45\114\105\x43\x54\x20\x4e\125\x4c\114\40\106\x52\x4f\x4d\40\157\x70\145\162\x74\x69\x20\127\110\x45\x52\x45\x20\143\x6f\x64\143\154\151\145\156\164\145\75\x27{$cli}\47\x20\46\46\x20\164\x69\x70\x6f\144\x6f\143\x3d\47\122\x45\x54\47")->num_rows(); return $val; } function genendfac($doc, $tip) { $antdoc = $this->db->query("\x53\x45\114\105\x43\124\40\x74\x6f\x74\141\154\144\x2c\141\156\x74\x64\x6f\x63\40\156\x20\x46\x52\117\115\x20\x6f\x70\145\x72\164\151\40\x57\110\105\x52\105\x20\x64\157\143\x75\155\x65\x6e\x74\x6f\75\x27{$doc}\47\40\x26\x26\40\x74\151\160\157\x64\157\143\x3d\47{$tip}\x27")->row(); $fecha = $this->db->query("\123\105\x4c\x45\x43\124\40\111\x46\x28\x6d\141\170\x28\x61\56\146\145\143\150\x29\40\x49\123\x20\116\x4f\124\40\116\x55\x4c\114\54\155\x61\x78\50\141\56\146\145\143\x68\x29\x2c\x63\x75\162\x64\x61\x74\145\50\51\51\x20\x6e\40\x46\x52\117\115\40\157\160\145\162\143\154\151\40\141\40\x4a\x4f\x49\x4e\40\157\x70\145\x72\164\151\40\142\x20\x4f\x4e\40\141\56\x69\x64\x66\x61\x63\x3d\x62\x2e\x64\x6f\143\165\155\145\x6e\164\x6f\40\x57\110\x45\x52\x45\x20\142\56\141\156\x74\144\x6f\x63\x3d\x27{$antdoc->n}\47\x20\46\x26\40\x28\x62\56\x74\x69\x70\x6f\144\x6f\143\x3d\47\106\101\103\47\40\x7c\x7c\x20\142\56\164\x69\x70\x6f\144\157\143\75\47\x4e\117\124\x27\x29\x20\x4c\x49\115\x49\124\x20\x31")->row(); $bd = $this->db->query("\123\x45\114\105\x43\x54\40\x4e\x55\x4c\114\40\x46\122\x4f\x4d\x20\157\160\x65\x72\x74\151\40\x57\110\x45\122\x45\x20\141\x6e\164\144\x6f\x63\75\47{$antdoc->n}\47\40\46\x26\40\164\x69\160\x6f\144\x6f\143\x3d\x27\116\x2f\x44\47\40\x26\x26\40\x28\145\163\x74\x61\x74\x75\163\144\x6f\x63\x3d\x27\60\x27\x20\x7c\x7c\40\145\163\164\x61\164\x75\163\x64\x6f\x63\x3d\x27\61\x27\51")->num_rows(); if ($bd == 0) { $bd2 = $this->db->query("\123\105\x4c\105\103\x54\40\141\x2e\x66\145\143\x68\141\x63\x72\x65\141\x2c\141\x2e\x74\151\x70\157\144\x6f\x63\x2c\x61\x2e\x64\x6f\143\x75\155\145\156\x74\157\x2c\x61\x2e\143\x6f\x64\x63\x6c\151\x65\x6e\164\145\54\141\56\x6e\x6f\155\x62\x72\x65\x63\x6c\x69\54\141\x2e\162\151\x66\54\141\x2e\144\x69\x72\x65\143\143\x69\x6f\x6e\54\141\56\x74\145\x6c\x65\146\x6f\x6e\157\163\x2c\141\x2e\144\151\x61\163\143\x72\x65\x64\54\x61\x2e\166\145\156\x64\145\144\157\162\54\141\56\163\145\x63\x74\157\x72\x2c\x61\x2e\163\165\142\143\157\x64\x69\147\157\54\12\x20\40\40\40\40\x20\40\40\141\x2e\164\x6f\x74\141\x6c\x66\151\x6e\141\154\x2c\x61\56\x74\157\x74\156\145\x74\157\54\141\x2e\142\141\x73\145\151\155\x70\157\61\54\x61\x2e\x74\157\x74\x69\155\x70\x75\x65\163\x74\54\141\56\x73\x69\156\x69\x6d\x70\165\x65\x73\164\54\141\x2e\x74\157\164\x61\x6c\144\54\x52\117\x55\x4e\104\x28\141\56\x74\x6f\164\x61\x6c\x66\151\x6e\141\x6c\x2c\62\51\x20\164\x6f\x74\141\x6c\146\151\x6e\x61\x6c\54\12\40\x20\x20\40\40\40\x20\x20\x49\x46\50\142\x2e\146\145\x63\150\x64\157\154\141\x72\x3d\47\x30\x30\60\x30\x2d\60\x30\x2d\60\x30\47\54\111\106\50\x27{$fecha->n}\47\x3c\x3d\x44\101\124\x45\137\x41\104\x44\50\x61\56\162\x65\143\145\x70\143\x69\x6f\156\x2c\x49\x4e\124\105\x52\x56\101\x4c\40\x61\x2e\144\151\141\163\151\x6e\x64\145\170\40\x44\101\131\x29\54\50\x53\x45\114\105\103\x54\x20\157\146\151\x63\151\x61\x6c\40\x46\122\117\x4d\x20\155\157\156\145\143\x61\155\x20\x57\110\105\x52\105\x20\146\x65\143\x68\x61\74\x3d\141\x2e\146\x65\x63\150\141\x63\162\145\x61\x20\x4f\x52\104\105\x52\40\x42\x59\40\146\145\x63\x68\x61\x20\x44\105\123\x43\40\x4c\x49\x4d\x49\124\x20\61\51\54\50\x53\x45\x4c\x45\103\124\x20\x6f\x66\151\x63\151\x61\154\40\x46\122\x4f\115\x20\x6d\157\x6e\x65\x63\x61\155\40\x4f\x52\104\x45\122\x20\102\x59\40\146\145\143\150\x61\x20\104\x45\123\103\40\x4c\x49\115\x49\x54\x20\x31\51\51\54\x49\x46\50\142\56\146\x65\x63\x68\x64\157\154\141\x72\74\x3d\x44\x41\x54\x45\137\101\x44\104\x28\x61\x2e\162\x65\143\145\160\x63\x69\x6f\x6e\54\x49\116\124\105\122\126\101\114\40\141\x2e\144\151\x61\x73\x69\x6e\144\x65\x78\40\104\101\x59\x29\54\50\123\x45\x4c\x45\x43\x54\x20\157\x66\x69\x63\151\x61\x6c\x20\x46\122\117\115\40\155\x6f\x6e\145\143\x61\155\40\x57\110\105\122\x45\40\x66\145\x63\x68\141\74\x3d\141\x2e\x66\x65\143\150\x61\x63\162\x65\x61\x20\x4f\122\104\x45\122\x20\102\x59\40\146\145\x63\150\141\x20\x44\x45\123\x43\x20\x4c\x49\115\111\124\40\x31\51\x2c\50\x53\x45\x4c\x45\103\124\x20\x6f\146\x69\143\x69\141\x6c\40\x46\x52\x4f\115\x20\155\157\156\x65\143\x61\155\x20\127\110\x45\122\105\x20\x66\x65\x63\x68\141\x3c\x3d\142\56\x66\145\143\150\x64\x6f\x6c\141\162\x20\x4f\122\x44\x45\122\x20\x42\x59\x20\x66\145\143\x68\x61\x20\104\105\x53\103\40\x4c\x49\115\x49\x54\40\x31\x29\51\x29\x20\164\x61\163\x61\x2c\xa\40\40\x20\x20\x20\40\x20\40\x28\x53\105\114\105\103\x54\40\x6f\x66\151\143\151\141\154\40\x46\x52\x4f\x4d\40\155\157\x6e\145\x63\x61\x6d\x20\x57\x48\105\122\105\40\x66\x65\x63\150\141\74\75\141\56\146\x65\143\x68\x61\143\162\145\x61\40\x4f\x52\104\105\x52\x20\x42\x59\x20\146\x65\143\150\141\x20\104\105\x53\x43\x20\x4c\111\115\111\x54\40\61\x29\x20\164\x61\163\141\157\162\x67\xa\x20\40\x20\x20\x20\40\x20\40\40\106\122\117\x4d\x20\x6f\160\x65\x72\x74\151\x20\x61\x20\112\x4f\x49\x4e\40\x63\x6f\156\x74\x72\x6f\154\x5f\157\x70\145\162\164\x69\x20\142\x20\x4f\116\40\141\x2e\141\x6e\x74\x64\157\x63\75\x62\56\144\157\x63\x20\x4a\117\x49\x4e\x20\x63\x6c\151\145\x6d\160\162\x65\40\143\x20\117\x4e\x20\x61\x2e\x63\157\x64\143\154\151\145\156\164\145\75\x63\x2e\x63\x6f\x64\x69\x67\157\40\x57\x48\105\122\x45\x20\141\56\141\156\164\144\157\143\75\x27{$antdoc->n}\x27\x20\x26\46\x20\x28\141\x2e\x74\x69\160\x6f\144\157\143\75\x27\x46\x41\x43\x27\40\x7c\174\40\141\56\164\x69\x70\157\x64\x6f\x63\x3d\x27\116\117\124\47\51\x20\x47\122\x4f\x55\120\x20\x42\131\x20\x61\x2e\x61\x6e\164\144\x6f\x63")->row(); $valpag = $this->db->query("\x53\x45\114\x45\x43\x54\x20\123\125\115\50\x6d\x6f\156\164\157\x64\x29\40\155\x6f\x6e\x74\157\x64\40\106\122\x4f\115\x20\157\x70\x65\162\x63\154\151\x20\x61\40\127\110\105\x52\105\x20\141\x2e\x69\144\146\x61\x63\x3d\x27{$bd2->documento}\47\40\46\46\40\141\56\151\x64\x63\x6f\x6e\x73\142\x61\156\143\x20\x49\x53\x20\116\117\124\40\x4e\x55\114\114\73")->row(); $nc = $this->db->query("\x53\x45\114\105\x43\124\x20\x52\117\125\116\x44\50\123\125\115\50\x74\157\164\x61\154\x64\x29\54\x32\x29\40\164\157\164\x61\x6c\144\x20\x46\122\117\x4d\x20\x61\x70\154\151\x63\x61\156\x63\x20\127\110\x45\122\x45\40\x66\x61\143\x3d\47{$bd2->documento}\x27")->row(); $ret = $this->db->query("\123\105\x4c\105\x43\x54\40\122\117\x55\116\104\x28\123\x55\x4d\50\x61\x2e\164\157\164\x61\x6c\x66\151\x6e\141\154\57\50\123\x45\114\105\x43\124\40\157\x66\151\143\151\x61\154\40\x46\x52\x4f\115\x20\155\x6f\x6e\145\x63\x61\155\x20\127\x48\105\x52\105\x20\x66\x65\x63\150\x61\74\75\141\x2e\146\x65\143\150\x61\143\162\x65\141\40\x4f\x52\104\105\122\x20\102\131\40\x66\145\143\x68\x61\40\104\x45\x53\x43\40\114\111\x4d\x49\124\x20\61\51\51\x2c\62\51\40\164\x6f\164\141\x6c\x64\x20\106\x52\117\x4d\40\157\160\145\162\x74\x69\x20\141\x20\127\110\105\x52\x45\40\x61\56\141\156\x74\x64\157\x63\75\x27{$antdoc->n}\x27\40\46\46\x20\x61\56\x74\151\160\x6f\x64\x6f\x63\x3d\47\x52\x45\x54\x27")->row(); $totald = $bd2->totald - $nc->totald - $ret->totald; $bsorg = $totald * $bd2->tasaorg; if ($valpag->montod - 0.1 <= $totald) { $num = $this->db->query("\123\105\114\x45\103\124\40\111\106\x28\115\101\130\50\144\157\x63\165\155\145\x6e\x74\x6f\51\53\61\x3e\x30\54\x4d\101\x58\x28\144\x6f\143\x75\x6d\145\x6e\x74\157\x29\x2b\61\x2c\x31\x29\x20\x6e\40\x46\x52\117\115\40\x6f\160\145\162\x74\x69\x20\x57\x48\105\x52\x45\40\164\151\x70\x6f\x64\157\x63\x3d\47\x4e\57\x44\47")->row(); $newdoc = str_pad($num->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $bdab = $this->db->query("\123\105\x4c\x45\103\124\40\x61\56\146\x65\x63\x68\x2c\x61\x2e\x6d\x6f\x6e\x74\157\54\x61\x2e\155\157\156\164\157\144\54\50\x53\105\114\105\x43\x54\40\157\146\151\143\x69\141\x6c\40\106\x52\117\x4d\x20\x6d\x6f\x6e\x65\x63\141\x6d\40\127\x48\105\x52\x45\40\x66\x65\143\150\141\x3c\x3d\x61\56\146\145\143\150\40\x4f\x52\x44\105\x52\40\x42\131\40\x66\x65\x63\150\141\x20\x44\x45\123\103\40\114\111\x4d\111\124\40\61\x29\40\164\x61\x73\x61\40\106\x52\x4f\115\x20\157\160\145\162\x63\154\151\x20\141\40\x57\110\x45\x52\105\40\141\56\x69\144\x66\141\x63\75\47{$bd2->documento}\47\x20\x26\46\x20\141\x2e\x69\144\143\x6f\156\x73\x62\141\x6e\143\x20\111\x53\40\116\x4f\x54\40\x4e\125\114\x4c\x3b")->result(); $bs = 0; $dtotneto = ROUND($bd2->totneto / $bd2->tasaorg, 2); $dbaseimpo = ROUND($bd2->baseimpo1 / $bd2->tasaorg, 2); $dtotimpuest = ROUND($bd2->totimpuest / $bd2->tasaorg, 2); $dsinimpuest = ROUND($bd2->sinimpuest / $bd2->tasaorg, 2); $bstotneto2 = $bd2->totneto; $bsbaseimpo2 = $bd2->baseimpo1; $bstotimpuest2 = $bd2->totimpuest; $bssinimpuest2 = $bd2->sinimpuest; if ($nc->totald > 0) { $porcent_nc = ROUND($nc->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } if ($ret->totald > 0) { $porcent_nc = ROUND($ret->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } $bstotneto = 0; $bsbaseimpo = 0; $bstotimpuest = 0; $bssinimpuest = 0; $porcent = 0; foreach ($bdab as $dbab) { $porcent = ROUND($dbab->montod * 100 / $totald, 2); $bstotneto += ROUND($dtotneto * ($porcent / 100) * $dbab->tasa, 2); $bsbaseimpo += ROUND($dbaseimpo * ($porcent / 100) * $dbab->tasa, 2); $bstotimpuest += ROUND($dtotimpuest * ($porcent / 100) * $dbab->tasa, 2); $bssinimpuest += ROUND($dsinimpuest * ($porcent / 100) * $dbab->tasa, 2); } $bs = $bstotneto + $bstotimpuest; if ($bs > $bsorg) { $debe = $bs - $bsorg; $newtotd = $debe / $bd2->tasa; $totneto = $bstotneto - $bstotneto2; $baseimpo = $bsbaseimpo - $bsbaseimpo2; $totimpuest = $bstotimpuest - $bstotimpuest2; $sinimpuest = $bssinimpuest - $bssinimpuest2; $total = $totneto + $totimpuest; $datos = array("\x69\x64\x5f\145\155\x70\x72\145\163\141" => "\104\115\x45\104\x49\x46", "\x61\x67\145\x6e\x63\151\x61" => "\x30\x30\61", "\164\x69\160\157\144\157\143" => "\x4e\57\104", "\144\157\x63\165\155\x65\156\164\x6f" => $newdoc, "\x67\162\165\160\157" => "\116\57\x41", "\x6f\162\151\x67\145\156" => "\x31", "\143\157\x64\151\147\157" => "\116\57\101", "\160\151\x64" => '' . $pid . '', "\x6e\157\155\x62\x72\145" => "\101\x6a\165\163\164\145\40\160\157\x72\x20\x64\151\146\x65\x72\145\x6e\143\x69\x61\x6c\40\143\141\x6d\142\x69\x61\162\151\157\x20\x73\x65\147\x75\x6e\40\106\141\x63\164\x75\x72\141\72\40" . $bd2->documento . "\x20\144\x65\40\x46\x65\x63\x68\141\40" . DateTime::createFromFormat("\x59\55\155\55\x64", $bd2->fechacrea)->format("\x64\x2f\155\57\x59") . "\x20\160\157\x72\40\165\x6e\x20\x4d\157\156\164\x6f\x20" . $bd2->totalfinal . "\x20\102\163\123\x2e", "\x63\x6f\x73\x74\x6f\165\156\x69\x74" => 0, "\x70\x72\x65\x63\151\x6f\x75\x6e\151\x74" => 0, "\x64\163\x63\x74\x6f\x75\x6e\151\164" => 0, "\x64\163\x63\164\157\x70\x72\x63" => 0, "\160\162\145\143\151\157\x66\x69\x6e" => 0, "\x70\x72\145\x63\x69\157\157\x72\x69\147\151\x6e\x61\x6c" => 0, "\143\141\x6e\x74\x69\144\x61\144" => 1, "\155\x6f\x6e\164\x6f\156\145\x74\x6f" => $totneto, "\155\x6f\x6e\164\157\x74\x6f\x74\141\x6c" => $total, "\x74\151\155\160\x75\x65\x70\162\x63" => 0, "\x61\154\x6d\141\x63\145\x6e" => "\60\x32", "\x70\162\x6f\x76\145\x65\144\x6f\162" => "\116\x2f\101", "\x66\x65\x63\150\x61\144\157\x63" => '' . date("\x59\55\x6d\x2d\144") . '', "\151\155\x70\x75\145\163\x74\157\61" => "\60", "\x69\x6d\x70\165\x65\163\x74\x6f\62" => "\60", "\166\x65\156\x64\x65\x64\x6f\x72" => '' . $bd2->vendedor . '', "\145\x6d\151\x73\x6f\162" => "\106\x41\103\x54\x55\122\101\x44", "\x75\x73\141\163\145\162\151\141\154" => "\x32", "\x74\151\160\x6f\x70\162\145\x63\151\x6f" => "\61", "\x75\x6e\x69\144\141\x64" => "\x55\x4e\x44", "\141\x67\162\165\x70\141\x64\x6f" => "\62", "\143\x6f\x6d\x70\x75\x65\x73\x74\x6f" => "\x32", "\x75\x73\141\145\170\x69\163\x74" => "\x31", "\141\165\170\61" => "\x31", "\x65\x73\164\141\143\151\x6f\156" => "\60\x30\61", "\x75\144\151\x6e\141\155\x69\x63\141" => "\61", "\142\141\163\145\151\155\160\x6f\x31" => "\x30", "\142\x61\x73\145\151\x6d\160\157\x32" => "\60", "\x6c\x6f\x74\x65" => "\116\57\x41", "\151\144\x76\x61\154\151\x64\141\143\151\157\x6e" => '', "\x66\145\143\150\141\171\150\157\162\x61" => '' . date("\131\x2d\x6d\55\144\40\x48\72\x69\x3a\163") . '', "\145\x6e\x76\151\x61\144\x6f\x5f\x6b\155\157\156\151\164\157\x72" => "\x30", "\163\x74\141\x74\165\x73" => 1); $this->db->insert("\x6f\x70\145\162\155\x76", $datos); $datos2 = array("\151\144\x5f\145\x6d\x70\162\145\x73\x61" => "\104\x4d\105\x44\x49\106", "\x61\x67\x65\156\143\151\x61" => "\x30\x30\61", "\x74\x69\160\x6f\144\157\143" => "\x4e\57\104", "\x6d\x6f\156\145\x64\141" => "\x30\60\x30", "\x64\157\x63\165\155\x65\x6e\164\157" => $newdoc, "\x63\157\x64\143\154\151\x65\x6e\x74\x65" => '' . $bd2->codcliente . '', "\x6e\157\155\x62\162\145\x63\154\x69" => '' . $bd2->nombrecli . '', "\x63\157\x6e\x74\141\143\164\x6f" => "\116\57\101", "\162\x69\x66" => '' . $bd2->rif . '', "\144\x69\162\x65\x63\143\x69\x6f\156" => '' . $bd2->direccion . '', "\164\145\154\x65\x66\157\x6e\x6f\x73" => '' . $bd2->telefonos . '', "\x74\151\160\x6f\x70\162\x65\x63\x69\x6f" => "\61", "\x65\x6d\151\x73\x69\157\156" => '' . date("\x59\55\x6d\x2d\x64") . '', "\x72\145\x63\x65\x70\x63\151\157\x6e" => '' . date("\131\x2d\x6d\x2d\144") . '', "\x76\145\x6e\x63\x65" => '' . date("\x59\x2d\155\55\x64") . '', "\146\145\x63\x68\141\x63\x72\x65\141" => '' . date("\x59\55\x6d\55\144") . '', "\x74\157\x74\x63\x6f\x73\164\157" => 0, "\x74\x6f\x74\x62\x72\165\x74\x6f" => $totneto, "\x74\x6f\x74\156\x65\x74\x6f" => $totneto, "\164\x6f\164\x61\154\146\151\x6e\141\x6c" => '' . $total . '', "\164\157\x74\x69\x6d\x70\165\145\163\x74" => $totimpuest, "\x74\x6f\x74\144\x65\163\x63\165\x65\156" => 0, "\151\155\x70\x75\x65\163\x74\157\x31" => 0, "\x69\x6d\160\165\x65\163\x74\157\x32" => "\x30", "\x64\x73\143\164\157\x6c\x69\156\145\x61" => 0, "\x64\151\141\163\143\x72\145\144" => $bd2->diascred, "\x76\145\x6e\144\x65\144\x6f\162" => '' . $bd2->vendedor . '', "\146\141\x63\x74\157\162\x63\x61\x6d\x62" => "\x31", "\x75\145\x6d\x69\x73\157\162" => '' . $bd2->vendedor . '', "\x65\163\x74\141\x63\x69\157\156" => "\60\60\x31", "\x73\151\x6e\x69\x6d\x70\x75\x65\x73\x74" => $sinimpuest, "\141\154\155\141\143\145\x6e" => "\x30\x32", "\163\145\x63\164\157\x72" => '' . $bd2->sector . '', "\163\x75\x62\x63\157\x64\x69\x67\157" => '' . $bd2->subcodigo . '', "\146\x6f\x72\x6d\141\x66\151\x73" => "\x31", "\141\154\137\154\x69\x62\162\x6f" => "\61", "\144\x62\143\162" => "\61", "\150\x6f\x72\141\x64\x6f\143\165\x6d" => '' . date("\110\x3a\151\x3a\x73") . '', "\141\155\x70\155" => "\x32", "\x65\x73\x63\x72\145\144\x69\164\157" => "\61", "\x62\x61\163\x65\x69\155\x70\157\61" => $baseimpo, "\146\x65\x63\x68\141\171\x68\157\162\141" => '' . date("\x59\55\155\55\144\x20\110\72\151\72\x73") . '', "\x69\x64\166\x61\x6c\151\x64\141\143\x69\x6f\x6e" => '', "\144\x6f\x63\165\155\x65\x6e\x74\157\146\151\163\x63\x61\x6c" => "\60\x20\122\145\143\x69\x62\151\144\141", "\143\x6f\155\x61\156\x64\x61\x5f\155\x6f\166\x69\154" => "\x30", "\143\157\x6d\x61\156\144\x61\137\153\155\157\x6e\151\164\157\x72" => "\x30", "\x6e\x6f\x74\151\155\142\x72\141\x72" => "\61", "\x61\156\x74\x69\160\157" => "\105\x53\120", "\x61\x6e\164\144\157\143" => $antdoc->n, "\162\145\x66\145\x72\x65\x6e\143\151\141" => $bd2->tipodoc . $bd2->documento, "\164\x6f\164\141\154\144" => $newtotd); $this->db->insert("\157\x70\x65\x72\x74\151", $datos2); $this->db->query("\x55\120\104\x41\x54\x45\x20\143\157\x6e\x74\x72\x6f\x6c\x5f\157\160\x65\162\164\151\x20\x73\145\164\40\146\x65\143\150\144\157\x6c\141\162\75\x27{$fecha->n}\x27\x20\127\110\105\x52\105\40\144\157\143\75\47{$antdoc->n}\x27\x20\x26\x26\40\146\x65\x63\x68\144\x6f\x6c\x61\x72\x3d\47\x30\60\x30\60\55\x30\x30\55\60\x30\x27"); $this->generecpag($antdoc->n); } else { $this->db->query("\125\x50\104\x41\x54\x45\x20\x63\157\x6e\x74\x72\x6f\154\137\x6f\x70\x65\x72\164\x69\x20\163\145\x74\40\x66\x65\143\x68\x64\157\x6c\141\x72\x3d\47{$bd2->fechacrea}\x27\40\127\x48\105\x52\x45\40\144\157\143\x3d\47{$antdoc->n}\x27\40\46\46\40\146\145\x63\x68\x64\157\x6c\141\x72\x3d\47\60\60\60\60\55\60\x30\55\x30\x30\x27"); $this->generecpag($antdoc->n); } } } else { $this->generecpag($antdoc->n); } return 1; } function noindexfac($a) { $bd = $this->db->query("\123\105\114\105\103\x54\40\146\145\143\150\x61\143\162\x65\141\x2c\x61\x6e\x74\144\x6f\143\40\x46\122\117\x4d\40\157\x70\145\162\164\151\x20\x57\110\105\122\145\x20\x64\157\143\165\155\x65\x6e\x74\157\75\47{$a}\x27")->row(); $this->db->query("\125\x50\104\x41\x54\x45\40\143\157\156\164\x72\x6f\154\137\x6f\160\145\162\164\x69\40\163\x65\x74\40\146\145\x63\150\144\x6f\154\141\x72\x3d\47{$bd->fechacrea}\x27\x20\127\x48\x45\x52\105\40\x64\x6f\143\x3d\x27{$bd->antdoc}\47"); $this->loguser("\x4e\x6f\x20\111\116\104\x45\x58", "\x45\154\x20\165\x73\165\141\x72\151\157\x20\156\x6f\x20\151\x6e\x64\x65\170\x61\x20\145\x6c\x20\144\x6f\x63\165\155\x65\156\x74\x6f\x3a" . $a . ''); return $this->db->affected_rows(); } function noindexfac2($a) { $bd = $this->db->query("\123\x45\x4c\x45\x43\x54\40\x66\145\143\x68\x61\143\x72\145\141\54\141\x6e\x74\x64\x6f\x63\x20\x46\122\117\x4d\x20\157\160\x65\x72\164\x69\x20\127\x48\105\x52\145\40\x64\x6f\143\165\x6d\145\156\164\157\x3d\x27{$a}\47")->row(); $this->db->query("\x55\120\104\101\124\x45\40\x6f\x70\x65\162\x63\154\x69\40\141\40\x53\105\124\40\155\157\156\x74\x6f\144\75\x6d\x6f\x6e\x74\x6f\57\x28\123\105\x4c\105\103\124\40\157\146\151\143\x69\141\154\x20\x46\122\x4f\x4d\40\155\x6f\x6e\x65\143\141\x6d\40\x57\110\x45\122\x45\40\146\145\143\150\x61\74\x3d\50\123\x45\114\x45\103\x54\40\146\145\x63\150\141\143\162\x65\141\40\106\122\x4f\115\40\157\160\145\x72\164\151\x20\x57\x48\x45\x52\105\x20\144\157\x63\165\155\145\x6e\x74\157\x3d\141\56\x69\x64\x66\x61\x63\51\40\117\122\x44\x45\122\40\x42\x59\x20\x66\x65\x63\150\x61\40\104\x45\x53\103\x20\114\x49\115\x49\124\40\x31\x29\x20\127\x48\x45\x52\x45\x20\x61\x2e\151\144\146\x61\143\75\x27{$a}\47\73"); $this->db->query("\x55\120\104\x41\x54\105\40\143\x6f\x6e\164\x72\157\154\x5f\157\x70\145\x72\x74\x69\x20\x73\145\x74\x20\146\145\x63\x68\144\157\154\x61\162\x3d\47{$bd->fechacrea}\47\x20\x57\110\105\122\105\x20\144\157\x63\75\x27{$bd->antdoc}\x27"); $this->loguser("\116\157\x20\x49\x4e\x44\105\130", "\x45\x6c\40\165\x73\165\x61\162\x69\157\40\156\157\40\151\x6e\144\x65\x78\141\40\145\154\x20\x64\x6f\143\165\x6d\145\156\164\x6f\72" . $a . ''); return $this->db->affected_rows(); } function ajustepagos($a) { $bd = $this->db->query("\123\x45\114\x45\103\124\x20\x62\56\x66\x65\x63\x68\54\x61\x2e\x61\x6e\x74\x64\x6f\143\x20\x46\122\x4f\x4d\x20\157\160\x65\x72\164\151\40\141\40\x4a\x4f\111\116\40\x6f\x70\x65\x72\143\x6c\x69\x20\x62\40\x4f\x4e\40\x61\x2e\144\157\x63\165\x6d\145\156\x74\x6f\75\x62\56\x69\x64\146\141\143\40\127\x48\105\122\145\x20\x61\x2e\x64\x6f\x63\x75\155\x65\x6e\x74\x6f\75\47{$a}\47\x20\46\46\40\x62\56\151\144\x63\x6f\156\x73\142\141\156\x63\40\111\123\x20\x4e\117\x54\40\116\125\x4c\114\40\117\x52\x44\105\x52\40\x42\x59\x20\142\x2e\146\x65\x63\x68\40\x44\105\123\103\x20\x4c\x49\x4d\111\124\40\x31")->row(); $this->db->query("\125\120\104\x41\x54\x45\40\157\160\x65\162\x63\154\x69\40\141\40\x4a\x4f\x49\x4e\x20\157\x70\x65\x72\x74\x69\x20\142\x20\117\116\40\141\x2e\x69\144\x66\141\143\75\x62\x2e\144\157\143\165\x6d\145\x6e\164\157\x20\xa\x20\x20\40\40\x53\105\124\40\x61\x2e\155\x6f\156\164\x6f\x64\75\141\x2e\x6d\x6f\x6e\164\157\x2f\x49\x46\50\x61\56\146\145\143\150\x3c\75\104\101\x54\105\x5f\x41\104\104\x28\x62\x2e\162\145\x63\145\160\x63\x69\x6f\156\x2c\x49\x4e\x54\105\122\126\101\x4c\x20\142\56\x64\151\x61\x73\151\156\144\145\x78\40\x44\x41\131\51\54\x28\123\105\x4c\105\x43\x54\40\157\146\151\x63\x69\141\154\x20\106\x52\117\x4d\x20\x6d\157\156\x65\x63\x61\x6d\x20\x57\x48\105\x52\x45\x20\146\x65\x63\150\x61\74\75\142\56\146\x65\143\150\141\143\x72\x65\x61\40\117\x52\104\105\x52\40\102\x59\x20\146\x65\x63\150\x61\40\x44\x45\x53\103\x20\x4c\x49\x4d\111\x54\x20\x31\x29\54\xa\40\x20\40\40\x28\123\105\114\105\x43\124\x20\157\146\x69\143\151\x61\154\x20\106\122\117\115\40\155\157\x6e\x65\x63\x61\155\40\127\x48\x45\x52\x45\40\146\x65\x63\x68\x61\x3c\75\x61\56\x66\x65\x63\x68\x20\117\122\104\x45\122\40\102\x59\40\x66\x65\x63\150\x61\40\104\x45\x53\x43\x20\114\x49\x4d\x49\124\x20\61\51\51\40\x57\x48\105\122\x45\40\141\x2e\x69\x64\x66\x61\143\x3d\47{$a}\47\x3b"); $this->db->query("\125\x50\104\101\124\x45\40\143\157\x6e\164\162\157\x6c\x5f\157\x70\x65\x72\164\x69\x20\163\145\164\x20\x66\x65\x63\150\144\x6f\x6c\141\162\75\47{$bd->fech}\47\x20\127\110\x45\x52\105\40\144\x6f\x63\75\x27{$bd->antdoc}\x27"); $this->loguser("\x41\152\165\163\x74\x65\x20\x50\141\x67\x6f\163", "\105\154\x20\x75\x73\165\141\162\151\157\40\x61\x6a\x75\x73\164\x61\x20\154\157\x73\x20\160\141\x67\x6f\x73\40\x70\x61\162\141\40\145\154\x20\x64\157\143\x75\x6d\145\156\164\157\72" . $a . ''); return $this->db->affected_rows(); } function transpagos($doc, $dest, $mont) { $db = $this->db->query("\x53\105\114\x45\x43\x54\40\151\x64\x2c\x69\x64\143\157\156\163\x62\x61\156\143\54\155\x6f\156\164\157\x2c\155\x6f\156\164\157\x64\54\x20\x6d\x6f\156\x74\x6f\x2f\x6d\x6f\x6e\164\157\x64\40\164\141\x73\141\54\x66\x65\143\150\x2c\164\x69\160\x2c\x6d\x6f\156\145\x64\141\54\x72\x65\x66\x2c\142\x61\156\143\157\x72\151\x2c\x62\x61\156\143\x64\x65\x73\164\x2c\x75\x73\x65\162\54\x66\x72\x65\147\40\x46\122\117\x4d\40\157\x70\x65\162\143\x6c\x69\40\127\110\105\x52\105\x20\x69\144\x66\x61\143\x3d\47{$doc}\x27\40\x26\46\40\x69\144\x63\157\x6e\163\x62\141\156\x63\x20\x49\x53\x20\x4e\117\124\40\116\125\x4c\114\x20\x4f\x52\104\105\122\40\x42\131\x20\155\157\156\x74\157\144\40\104\x45\x53\103\x20\x4c\111\115\111\124\x20\61")->row(); $val = $this->db->query("\123\x45\114\105\x43\124\40\141\x2e\x61\156\164\144\157\143\x2c\123\125\115\50\142\56\155\x6f\x6e\x74\157\144\x29\x20\164\x6f\x74\x70\x61\147\x2c\141\x2e\164\x6f\x74\x61\154\x64\x2c\x43\x4f\x55\x4e\124\x28\52\x29\40\x69\164\145\x6d\40\x46\x52\x4f\115\40\x6f\160\145\162\x74\x69\x20\141\x20\112\x4f\x49\x4e\40\157\x70\145\162\143\154\151\40\142\40\x4f\116\40\x61\56\144\x6f\x63\x75\x6d\x65\x6e\x74\x6f\x3d\x62\x2e\151\144\x66\x61\143\x20\x57\x48\105\x52\105\40\141\x2e\144\157\x63\165\155\145\156\164\157\x3d\47{$doc}\x27\40\x26\x26\x20\x62\56\x69\144\x63\157\x6e\163\x62\x61\156\143\40\x49\123\x20\x4e\x4f\x54\40\x4e\125\114\114")->row(); $nc = $this->db->query("\x53\105\x4c\x45\x43\x54\x20\122\x4f\x55\116\x44\50\x53\125\x4d\50\164\157\x74\x61\x6c\144\x29\54\62\51\x20\164\x6f\164\141\154\x64\x20\x46\122\117\x4d\x20\141\x70\154\151\x63\x61\156\143\40\x57\x48\x45\x52\x45\x20\146\141\x63\75\47{$doc}\47")->row(); $ret = $this->db->query("\123\105\114\105\x43\124\40\122\117\125\116\x44\50\x53\x55\x4d\50\141\56\x74\x6f\164\141\154\146\151\156\141\154\x2f\x28\123\105\x4c\105\103\x54\x20\157\146\151\x63\151\141\x6c\x20\106\x52\117\115\x20\x6d\x6f\156\145\143\141\x6d\40\x57\110\x45\x52\105\40\x66\x65\x63\150\141\x3c\75\141\x2e\x66\145\143\150\x61\143\x72\x65\141\40\117\122\x44\105\x52\x20\x42\x59\x20\146\145\x63\150\x61\x20\x44\x45\123\x43\40\x4c\111\115\x49\x54\40\x31\51\x29\54\62\51\x20\164\157\164\x61\x6c\144\40\x46\x52\117\x4d\40\x6f\160\145\162\164\x69\x20\x61\x20\x57\110\105\x52\x45\40\141\x2e\141\x6e\164\x64\x6f\x63\75\x27{$val->antdoc}\47\40\46\x26\40\x61\x2e\164\x69\160\157\x64\x6f\x63\x3d\47\x52\105\x54\47")->row(); $sobra = $val->totpag - ($val->totald - $nc->totald - $ret->totald); if ($val->item > 0 && $sobra >= $mont) { $bs = ROUND($mont * $db->tasa, 2); $val2 = $this->db->query("\x53\105\x4c\105\x43\124\x20\x4e\125\114\x4c\x20\106\122\x4f\115\x20\x6f\160\145\x72\143\x6c\x69\40\127\x48\105\x52\105\40\151\144\x66\x61\143\x3d\x27{$dest}\x27\40\x26\x26\40\x69\144\x63\x6f\156\x73\142\141\156\x63\x3d\x27{$db->idconsbanc}\47\40\46\x26\40\x66\145\x63\150\x3d\x27{$db->fech}\47")->num_rows(); if ($val2 == 0) { $this->db->insert("\x6f\x70\145\x72\143\x6c\151", array("\x69\144" => $db->id, "\151\x64\146\141\143" => $dest, "\151\x64\143\157\x6e\x73\x62\141\x6e\143" => $db->idconsbanc, "\x66\x65\x63\x68" => $db->fech, "\164\x69\x70" => $db->tip, "\155\x6f\156\145\x64\141" => $db->moneda, "\162\x65\x66" => $db->ref, "\142\x61\156\x63\x6f\162\x69" => $db->bancori, "\x62\141\x6e\x63\x64\145\163\x74" => $db->bancdest, "\x6d\157\x6e\x74\x6f" => $bs, "\x6d\x6f\x6e\164\157\144" => $mont, "\157\142\163\x65\162\x76" => "\164\162\x61\x6e\163\146\x65\x72\x65\156\x63\151\141\40\x64\x65\40" . $doc . "\40\160\141\162\x61\40" . $dest, "\x75\163\145\x72" => $db->user, "\x72\145\x63\151\x62\x6f" => 0, "\146\x72\145\147" => $db->freg)); if ($this->db->affected_rows() > 0) { $this->db->query("\125\120\x44\x41\x54\105\40\157\x70\x65\162\143\x6c\x69\40\x73\145\x74\40\x6d\157\x6e\x74\157\75\x6d\157\156\x74\x6f\55{$bs}\x2c\x6d\x6f\x6e\x74\x6f\144\x3d\x6d\157\156\x74\157\x64\x2d{$mont}\x20\x57\110\x45\x52\105\x20\x69\144\x66\141\x63\x3d\47{$doc}\x27\x20\x26\x26\40\151\144\75\47{$db->id}\x27\40\46\46\40\151\144\x63\157\156\163\142\141\156\143\75\x27{$db->idconsbanc}\x27\40\x26\x26\x20\155\x6f\x6e\x74\157\75\x27{$db->monto}\x27\40\x26\46\40\x6d\157\156\164\x6f\x64\x3d\x27{$db->montod}\x27\x20\114\x49\x4d\111\124\40\61"); $this->loguser("\124\162\141\x6e\x73\x20\120\141\x67\x6f\163", "\x45\x6c\40\x75\x73\x75\x61\162\x69\157\x20\x74\162\141\156\163\146\x69\145\x72\145\40" . $mont . "\40\x64\145\x20" . $doc . "\x20\160\x61\162\141\x20" . $dest . ''); return $this->db->affected_rows(); } } else { $this->db->query("\x55\x50\104\101\124\105\40\x6f\160\x65\162\x63\154\x69\x20\x73\x65\164\x20\x6d\x6f\x6e\x74\157\75\x6d\x6f\x6e\x74\157\x2b{$bs}\54\155\x6f\x6e\x74\157\x64\75\155\x6f\x6e\164\157\x64\53{$mont}\40\x57\110\105\122\x45\40\x69\144\146\x61\143\x3d\47{$dest}\x27\40\x26\x26\40\151\144\x63\x6f\x6e\163\142\x61\x6e\x63\x3d\47{$db->idconsbanc}\47\x20\x26\46\40\146\x65\x63\x68\x3d\x27{$db->fech}\x27\x20\x4c\x49\115\111\x54\40\61"); if ($this->db->affected_rows() > 0) { $this->db->query("\125\120\x44\101\124\x45\x20\157\x70\x65\162\x63\154\x69\x20\163\145\164\40\155\157\156\164\x6f\75\x6d\157\x6e\x74\x6f\55{$bs}\x2c\x6d\x6f\156\x74\x6f\144\x3d\x6d\157\156\x74\x6f\144\55{$mont}\40\127\110\105\122\105\40\151\144\x66\141\x63\x3d\x27{$doc}\x27\x20\46\46\x20\x69\x64\75\47{$db->id}\47\x20\46\x26\x20\x69\144\143\x6f\156\x73\142\141\156\x63\75\x27{$db->idconsbanc}\47\x20\x26\46\x20\x6d\157\x6e\164\157\75\47{$db->monto}\47\40\46\x26\x20\155\157\156\164\157\144\75\x27{$db->montod}\47\40\x4c\111\115\x49\x54\40\61"); $this->loguser("\x54\x72\x61\x6e\x73\x20\x50\x61\x67\x6f\x73", "\x45\154\x20\165\x73\165\141\x72\151\x6f\x20\164\162\x61\156\x73\146\151\x65\x72\145\x20" . $mont . "\x20\x64\145\x20" . $doc . "\x20\x70\x61\162\x61\40" . $dest . ''); return $this->db->affected_rows(); } } } } function indexfac($a) { $fecha = $this->db->query("\123\x45\x4c\105\x43\x54\40\x49\106\50\x6d\x61\170\50\141\x2e\x66\145\x63\x68\x29\x20\x49\123\x20\116\117\124\x20\x4e\125\x4c\114\x2c\155\141\170\x28\x61\56\146\145\143\x68\51\x2c\x63\x75\x72\144\141\x74\145\50\x29\51\40\156\x20\106\x52\117\x4d\x20\157\160\x65\162\143\154\x69\x20\x61\40\112\117\x49\116\x20\157\x70\145\162\164\151\x20\142\40\117\116\x20\141\56\151\144\146\x61\x63\75\142\x2e\x64\x6f\143\x75\x6d\145\156\164\157\x20\127\110\x45\x52\x45\40\x62\x2e\x61\156\x74\144\x6f\x63\75\x27{$a}\x27\x20\x26\46\x20\x28\x62\56\x74\x69\160\x6f\x64\x6f\x63\75\x27\x46\101\103\x27\x20\x7c\174\x20\x62\x2e\x74\151\x70\157\x64\157\x63\75\47\x4e\x4f\124\x27\x29\x20\x4c\111\x4d\111\x54\40\61")->row(); $bd = $this->db->query("\123\x45\114\105\103\124\40\x4e\125\x4c\114\40\106\x52\117\115\40\x6f\x70\x65\162\164\151\40\x57\110\105\122\x45\x20\141\x6e\164\x64\x6f\x63\x3d\47{$a}\47\40\46\46\x20\164\x69\160\157\144\x6f\143\75\x27\116\57\x44\x27\40\46\x26\x20\x28\145\163\164\x61\x74\x75\163\144\157\x63\x3d\x27\x30\47\40\x7c\174\40\145\163\164\141\164\165\x73\x64\x6f\143\75\47\x31\x27\51")->num_rows(); if ($bd == 0 && $fecha->n >= "\62\60\x32\63\x2d\60\71\55\x32\x36") { $bd2 = $this->db->query("\x53\x45\114\x45\x43\124\x20\x61\56\146\145\143\x68\141\x63\x72\x65\x61\54\141\56\164\x69\x70\x6f\144\x6f\x63\x2c\141\56\x64\157\143\165\x6d\145\156\x74\157\x2c\141\56\143\157\144\143\154\x69\145\156\164\145\54\x61\x2e\x6e\157\x6d\142\x72\x65\x63\154\151\54\141\x2e\162\151\x66\x2c\141\56\x64\151\x72\x65\143\143\151\x6f\x6e\x2c\x61\x2e\164\x65\x6c\145\146\157\x6e\x6f\163\54\141\x2e\144\x69\x61\x73\x63\x72\145\x64\x2c\x61\56\x76\x65\x6e\144\145\x64\157\162\x2c\141\56\x73\145\x63\164\x6f\162\54\x61\56\x73\x75\142\x63\x6f\144\151\x67\x6f\54\12\40\x20\40\40\x20\x20\40\40\x61\x2e\164\x6f\x74\x61\154\146\x69\x6e\x61\154\54\x61\x2e\x74\x6f\x74\156\x65\x74\x6f\54\141\x2e\142\141\163\145\x69\x6d\x70\157\61\x2c\141\x2e\164\x6f\x74\x69\155\x70\x75\x65\163\x74\x2c\141\x2e\163\x69\x6e\x69\x6d\x70\x75\145\x73\x74\x2c\141\x2e\164\157\164\x61\154\144\x2c\x52\x4f\125\116\x44\50\141\56\x74\157\x74\x61\x6c\x66\x69\x6e\141\x6c\x2c\x32\51\40\x74\157\164\141\x6c\146\151\156\x61\154\x2c\12\40\x20\x20\40\x20\x20\x20\40\111\x46\x28\x62\x2e\x66\x65\143\x68\144\x6f\x6c\x61\x72\x3d\x27\60\x30\x30\x30\x2d\60\x30\x2d\x30\x30\47\54\x49\x46\50\x27{$fecha->n}\47\x3c\75\x44\x41\x54\x45\137\101\104\104\50\141\56\162\x65\143\145\x70\143\x69\x6f\x6e\54\x49\x4e\x54\105\x52\126\101\x4c\x20\141\x2e\144\x69\x61\163\x69\156\144\x65\170\40\x44\101\x59\x29\54\x28\x53\105\x4c\105\x43\124\40\x6f\146\151\x63\151\x61\x6c\x20\x46\x52\x4f\x4d\40\155\157\156\x65\x63\141\x6d\40\x57\x48\x45\122\x45\40\146\145\143\x68\x61\74\x3d\141\x2e\146\x65\x63\150\141\x63\162\x65\141\40\x4f\122\104\105\122\x20\x42\x59\x20\146\x65\x63\x68\141\x20\x44\x45\x53\103\x20\x4c\111\115\x49\x54\x20\61\x29\x2c\x28\x53\105\x4c\x45\103\124\40\x6f\146\x69\143\151\x61\x6c\x20\106\x52\x4f\x4d\40\x6d\x6f\x6e\145\x63\141\x6d\x20\117\x52\104\x45\122\x20\102\x59\40\x66\x65\143\150\x61\40\104\x45\x53\103\x20\x4c\111\115\x49\x54\40\61\51\51\54\111\x46\x28\x62\x2e\x66\x65\143\150\144\x6f\x6c\141\162\x3c\x3d\104\101\124\105\137\x41\104\104\x28\x61\x2e\x72\x65\x63\145\x70\x63\x69\157\156\x2c\x49\116\x54\x45\x52\126\101\x4c\x20\141\56\x64\151\x61\x73\151\x6e\x64\x65\170\x20\104\101\131\51\54\50\123\x45\x4c\105\x43\x54\x20\157\146\151\x63\151\141\x6c\x20\106\x52\x4f\x4d\x20\x6d\x6f\x6e\x65\143\141\155\x20\127\x48\x45\x52\105\x20\x66\145\143\x68\141\74\75\141\56\146\145\143\x68\141\x63\x72\145\141\40\117\x52\104\x45\x52\40\x42\x59\x20\146\x65\143\x68\141\x20\x44\x45\x53\x43\40\114\x49\x4d\x49\x54\40\x31\51\54\50\x53\x45\x4c\x45\103\x54\x20\157\146\x69\143\151\x61\x6c\x20\x46\x52\117\x4d\40\x6d\x6f\156\145\143\141\155\x20\x57\x48\105\x52\x45\40\x66\145\x63\x68\x61\x3c\x3d\x62\x2e\x66\x65\x63\x68\144\157\x6c\x61\x72\40\117\122\x44\x45\x52\40\102\x59\x20\146\145\143\x68\x61\40\104\x45\x53\x43\40\x4c\x49\x4d\x49\x54\40\x31\51\x29\51\x20\164\141\163\141\x2c\xa\x20\40\40\40\40\x20\x20\40\x28\x53\x45\x4c\x45\103\124\x20\157\x66\x69\143\151\x61\154\x20\x46\122\117\x4d\40\x6d\157\156\145\143\x61\x6d\x20\127\x48\x45\x52\105\40\146\x65\143\x68\x61\x3c\x3d\141\56\146\x65\143\x68\x61\x63\x72\145\x61\x20\x4f\122\x44\x45\122\40\102\x59\x20\146\x65\x63\150\141\40\x44\105\123\x43\x20\114\x49\115\111\124\40\x31\51\40\164\141\x73\x61\x6f\x72\147\12\x20\x20\40\40\40\40\x20\40\x20\106\122\117\115\40\x6f\160\145\x72\x74\151\40\141\40\112\117\x49\116\x20\143\x6f\156\x74\x72\x6f\x6c\x5f\157\160\x65\162\164\x69\40\x62\x20\x4f\x4e\40\x61\56\x61\x6e\x74\144\157\x63\x3d\x62\x2e\x64\157\143\x20\x4a\x4f\x49\x4e\40\x63\154\x69\145\155\160\162\145\x20\143\40\117\x4e\x20\x61\56\x63\157\144\143\x6c\151\145\x6e\164\145\x3d\143\56\143\157\144\x69\147\157\x20\x57\110\x45\x52\x45\40\141\56\141\156\164\x64\x6f\x63\75\x27{$a}\47\40\x26\x26\x20\x61\x2e\x74\151\160\x6f\144\x6f\x63\x3d\x27\106\101\103\x27\x20\x47\122\117\125\x50\40\102\x59\40\141\56\141\x6e\x74\x64\157\x63")->row(); $valpag = $this->db->query("\x53\105\x4c\x45\x43\x54\40\123\x55\x4d\x28\155\x6f\x6e\164\157\x64\x29\x20\155\x6f\x6e\164\x6f\144\40\106\x52\x4f\115\x20\157\x70\145\162\143\154\x69\x20\141\40\x57\110\105\122\x45\40\x61\56\x69\144\x66\x61\x63\75\x27{$bd2->documento}\x27\40\x26\46\40\x61\x2e\151\x64\143\157\x6e\x73\142\x61\156\143\x20\111\x53\40\x4e\117\124\x20\116\125\114\114\x3b")->row(); $nc = $this->db->query("\x53\105\x4c\x45\103\x54\40\x52\x4f\x55\116\104\50\x53\125\115\x28\x74\157\164\x61\x6c\x64\x29\x2c\62\51\40\x74\x6f\164\141\154\144\40\x46\x52\x4f\115\40\141\x70\x6c\151\143\141\x6e\143\x20\127\x48\x45\x52\105\40\x66\141\143\x3d\x27{$bd2->documento}\x27")->row(); $ret = $this->db->query("\123\105\x4c\105\x43\x54\40\x52\117\125\x4e\104\50\123\x55\x4d\x28\141\56\x74\157\x74\141\154\x66\151\x6e\141\154\57\50\123\105\114\105\x43\124\x20\x6f\146\151\143\x69\141\154\40\106\x52\x4f\x4d\40\x6d\157\156\145\x63\x61\155\40\127\x48\x45\x52\x45\x20\146\x65\x63\150\141\x3c\75\x61\56\146\x65\x63\150\x61\143\162\x65\141\x20\117\x52\x44\105\122\40\x42\131\40\146\x65\x63\x68\x61\40\104\x45\123\103\x20\x4c\111\115\111\x54\x20\61\51\x29\54\x32\51\x20\164\157\x74\141\154\144\40\106\x52\x4f\115\x20\157\160\145\x72\x74\x69\x20\x61\40\127\x48\x45\x52\105\x20\x61\56\x61\156\x74\144\x6f\x63\75\x27{$a}\x27\x20\x26\x26\x20\x61\56\164\x69\160\x6f\x64\157\x63\x3d\47\x52\105\x54\x27")->row(); if ($bd2->tasa < $bd2->tasaorg) { $bd2->tasa = $bd2->tasaorg; } $totald = $bd2->totald - $nc->totald - $ret->totald; $bsorg = $totald * $bd2->tasaorg; if ($valpag->montod <= $totald) { $num = $this->db->query("\x53\105\114\x45\x43\124\40\x49\x46\50\115\x41\x58\50\144\157\x63\165\x6d\x65\156\164\x6f\51\x2b\x31\76\60\x2c\115\101\130\50\x64\157\x63\165\x6d\x65\x6e\164\x6f\x29\53\x31\x2c\61\51\40\156\40\x46\x52\x4f\115\40\x6f\160\x65\162\164\x69\x20\x57\110\105\x52\x45\40\164\151\160\157\144\157\x63\x3d\x27\116\x2f\104\47")->row(); $newdoc = str_pad($num->n, 8, "\x30", STR_PAD_LEFT); $pid = $this->genecod(12); $bdab = $this->db->query("\123\105\114\x45\103\124\x20\141\x2e\146\x65\x63\x68\54\x61\56\x6d\157\156\164\x6f\x2c\x61\56\x6d\x6f\x6e\164\x6f\x64\54\50\x53\105\x4c\x45\x43\124\40\157\x66\151\x63\151\x61\x6c\40\106\x52\117\115\40\x6d\x6f\x6e\145\x63\x61\x6d\x20\127\x48\x45\x52\105\40\146\145\x63\150\x61\74\x3d\141\56\x66\x65\x63\150\40\x4f\x52\104\105\x52\x20\x42\x59\x20\146\145\x63\x68\141\x20\104\x45\x53\x43\x20\114\111\x4d\x49\x54\40\x31\51\40\164\x61\x73\x61\40\x46\x52\x4f\x4d\40\x6f\160\145\162\143\x6c\151\x20\141\40\x57\110\105\122\x45\40\141\56\x69\x64\146\141\143\75\x27{$bd2->documento}\x27\x20\46\46\x20\141\x2e\x69\144\x63\x6f\x6e\163\x62\141\156\x63\40\x49\x53\40\x4e\117\x54\40\x4e\x55\x4c\x4c\73")->result(); $bs = 0; $dtotneto = ROUND($bd2->totneto / $bd2->tasaorg, 2); $dbaseimpo = ROUND($bd2->baseimpo1 / $bd2->tasaorg, 2); $dtotimpuest = ROUND($bd2->totimpuest / $bd2->tasaorg, 2); $dsinimpuest = ROUND($bd2->sinimpuest / $bd2->tasaorg, 2); $bstotneto2 = $bd2->totneto; $bsbaseimpo2 = $bd2->baseimpo1; $bstotimpuest2 = $bd2->totimpuest; $bssinimpuest2 = $bd2->sinimpuest; if ($nc->totald > 0) { $porcent_nc = ROUND($nc->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } if ($ret->totald > 0) { $porcent_nc = ROUND($ret->totald * 100 / $bd2->totald, 2); $dtotneto = $dtotneto - $dtotneto * ($porcent_nc / 100); $dbaseimpo = $dbaseimpo - $dbaseimpo * ($porcent_nc / 100); $dtotimpuest = $dtotimpuest - $dtotimpuest * ($porcent_nc / 100); $dsinimpuest = $dsinimpuest - $dsinimpuest * ($porcent_nc / 100); $bstotneto2 = $bstotneto2 - $bstotneto2 * ($porcent_nc / 100); $bsbaseimpo2 = $bsbaseimpo2 - $bsbaseimpo2 * ($porcent_nc / 100); $bstotimpuest2 = $bstotimpuest2 - $bstotimpuest2 * ($porcent_nc / 100); $bssinimpuest2 = $bssinimpuest2 - $bssinimpuest2 * ($porcent_nc / 100); } $bstotneto = 0; $bsbaseimpo = 0; $bstotimpuest = 0; $bssinimpuest = 0; $porcent = 0; foreach ($bdab as $dbab) { $porcent = ROUND($dbab->montod * 100 / $totald, 2); $bstotneto += ROUND($dtotneto * ($porcent / 100) * $dbab->tasa, 2); $bsbaseimpo += ROUND($dbaseimpo * ($porcent / 100) * $dbab->tasa, 2); $bstotimpuest += ROUND($dtotimpuest * ($porcent / 100) * $dbab->tasa, 2); $bssinimpuest += ROUND($dsinimpuest * ($porcent / 100) * $dbab->tasa, 2); } $bs = $bstotneto + $bstotimpuest; $dolar = 0.5 * $bd2->tasaorg; if ($bs > $bsorg + $dolar) { $debe = $bs - $bsorg; $newtotd = $debe / $bd2->tasa; $totneto = $bstotneto - $bstotneto2; $baseimpo = $bsbaseimpo - $bsbaseimpo2; $totimpuest = $bstotimpuest - $bstotimpuest2; $sinimpuest = $bssinimpuest - $bssinimpuest2; $total = $totneto + $totimpuest; $datos = array("\151\x64\x5f\x65\155\160\162\x65\x73\141" => "\x44\x4d\x45\x44\x49\106", "\x61\147\x65\156\x63\151\141" => "\x30\x30\x31", "\x74\151\160\157\144\157\x63" => "\x4e\57\x44", "\x64\x6f\x63\x75\155\x65\x6e\x74\157" => $newdoc, "\x67\x72\x75\x70\157" => "\116\x2f\x41", "\x6f\x72\x69\x67\145\156" => "\x31", "\x63\157\x64\x69\x67\157" => "\x4e\57\x41", "\160\151\x64" => '' . $pid . '', "\x6e\x6f\155\x62\162\x65" => "\x41\152\x75\163\164\145\x20\160\x6f\x72\40\144\x69\x66\x65\x72\x65\156\x63\x69\141\154\x20\x63\x61\x6d\142\151\x61\x72\151\x6f\40\x73\x65\x67\x75\156\40\x46\141\x63\164\x75\x72\x61\72\x20" . $bd2->documento . "\40\x64\x65\40\106\145\143\x68\141\40" . DateTime::createFromFormat("\x59\55\x6d\55\x64", $bd2->fechacrea)->format("\x64\57\x6d\x2f\x59") . "\40\160\x6f\162\40\x75\x6e\40\x4d\157\x6e\164\x6f\x20" . $bd2->totalfinal . "\40\x42\x73\x53\56", "\143\157\x73\164\x6f\165\156\151\164" => 0, "\x70\x72\x65\143\x69\x6f\165\156\151\164" => 0, "\x64\163\143\164\x6f\x75\156\151\164" => 0, "\x64\x73\x63\164\x6f\160\162\x63" => 0, "\160\162\145\143\151\x6f\146\x69\x6e" => 0, "\x70\162\145\143\x69\x6f\x6f\x72\151\147\x69\x6e\x61\x6c" => 0, "\x63\x61\156\x74\151\144\141\144" => 1, "\155\157\156\x74\157\156\x65\164\157" => $totneto, "\x6d\x6f\x6e\164\157\164\x6f\164\x61\x6c" => $total, "\x74\x69\x6d\160\x75\x65\160\162\x63" => 0, "\141\x6c\155\141\143\x65\x6e" => "\x30\62", "\160\162\157\166\x65\x65\144\x6f\x72" => "\x4e\x2f\101", "\x66\145\x63\150\141\144\157\x63" => '' . date("\131\x2d\155\x2d\x64") . '', "\151\x6d\160\165\145\x73\164\x6f\61" => "\x30", "\x69\x6d\160\x75\x65\x73\164\x6f\62" => "\x30", "\x76\145\x6e\144\x65\x64\x6f\x72" => '' . $bd2->vendedor . '', "\x65\155\151\163\x6f\x72" => "\x46\x41\x43\124\125\122\x41\104", "\165\163\x61\163\145\x72\151\141\154" => "\x32", "\x74\151\x70\x6f\x70\162\145\x63\151\157" => "\61", "\x75\156\151\144\x61\144" => "\125\x4e\104", "\141\x67\162\x75\x70\x61\x64\157" => "\62", "\143\x6f\155\x70\x75\145\x73\x74\x6f" => "\x32", "\165\163\x61\x65\170\x69\x73\164" => "\x31", "\x61\165\170\61" => "\x31", "\145\x73\x74\x61\x63\x69\157\x6e" => "\x30\x30\61", "\x75\144\x69\156\x61\x6d\151\143\x61" => "\x31", "\x62\141\x73\x65\151\x6d\160\157\x31" => "\x30", "\142\141\x73\x65\151\155\160\x6f\x32" => "\x30", "\x6c\x6f\x74\x65" => "\x4e\57\x41", "\151\144\166\141\154\151\x64\x61\x63\x69\x6f\x6e" => '', "\x66\145\x63\150\x61\171\150\157\162\141" => '' . date("\131\x2d\155\55\144\x20\110\72\x69\72\x73") . '', "\145\156\x76\151\141\144\x6f\137\153\x6d\x6f\156\x69\164\157\x72" => "\60", "\163\164\x61\x74\x75\x73" => 1); $this->db->insert("\x6f\x70\x65\162\155\166", $datos); $datos2 = array("\151\x64\137\145\155\160\x72\145\163\141" => "\x44\x4d\105\104\x49\x46", "\141\147\145\156\x63\x69\x61" => "\60\60\61", "\x74\151\160\x6f\144\157\143" => "\x4e\57\x44", "\x6d\x6f\156\x65\x64\x61" => "\x30\x30\x30", "\x64\157\x63\165\155\x65\x6e\x74\x6f" => $newdoc, "\x63\x6f\x64\143\154\151\x65\x6e\x74\x65" => '' . $bd2->codcliente . '', "\x6e\x6f\x6d\142\162\145\143\x6c\151" => '' . $bd2->nombrecli . '', "\143\x6f\x6e\x74\141\x63\164\157" => "\116\x2f\x41", "\x72\151\x66" => '' . $bd2->rif . '', "\x64\x69\x72\x65\x63\x63\151\x6f\x6e" => '' . $bd2->direccion . '', "\164\145\154\x65\x66\x6f\156\157\x73" => '' . $bd2->telefonos . '', "\x74\151\x70\157\x70\162\145\143\x69\157" => "\x31", "\x65\155\x69\x73\151\x6f\x6e" => '' . date("\131\55\155\x2d\x64") . '', "\162\145\143\145\x70\143\151\x6f\156" => '' . date("\131\55\x6d\55\144") . '', "\166\x65\x6e\x63\x65" => '' . date("\131\55\155\x2d\144") . '', "\146\x65\x63\150\141\143\x72\x65\141" => '' . date("\x59\55\x6d\55\x64") . '', "\x74\x6f\164\143\157\x73\164\157" => 0, "\164\157\x74\x62\x72\165\164\157" => $totneto, "\x74\x6f\164\x6e\145\164\157" => $totneto, "\164\157\164\x61\154\x66\x69\156\x61\x6c" => '' . $total . '', "\x74\157\164\x69\155\x70\165\145\x73\164" => $totimpuest, "\x74\157\x74\x64\x65\x73\143\165\x65\x6e" => 0, "\151\155\x70\165\145\163\x74\x6f\x31" => 0, "\x69\x6d\160\x75\145\x73\164\157\x32" => "\60", "\x64\x73\x63\x74\x6f\x6c\x69\156\x65\141" => 0, "\x64\x69\141\163\143\162\x65\144" => $bd2->diascred, "\x76\145\156\144\x65\144\x6f\x72" => '' . $bd2->vendedor . '', "\146\141\x63\x74\x6f\162\x63\x61\155\142" => "\61", "\x75\x65\155\151\163\157\x72" => '' . $bd2->vendedor . '', "\x65\x73\x74\x61\x63\151\x6f\x6e" => "\x30\x30\61", "\x73\x69\156\151\x6d\x70\x75\145\x73\164" => $sinimpuest, "\x61\x6c\155\x61\x63\145\156" => "\60\62", "\163\x65\143\164\157\162" => '' . $bd2->sector . '', "\163\x75\x62\143\x6f\144\151\x67\x6f" => '' . $bd2->subcodigo . '', "\x66\x6f\x72\155\x61\x66\x69\163" => "\x31", "\141\x6c\137\x6c\151\142\162\x6f" => "\61", "\144\x62\143\162" => "\61", "\150\x6f\162\x61\x64\157\x63\x75\155" => '' . date("\110\72\x69\72\x73") . '', "\141\x6d\160\x6d" => "\62", "\x65\163\x63\x72\145\144\151\164\157" => "\x31", "\x62\x61\x73\145\151\155\160\157\x31" => $baseimpo, "\x66\145\143\x68\x61\171\x68\x6f\162\141" => '' . date("\131\x2d\155\55\144\40\110\72\x69\72\x73") . '', "\151\x64\x76\x61\154\x69\144\141\x63\x69\x6f\156" => '', "\144\x6f\x63\x75\155\x65\156\164\157\x66\151\163\143\x61\x6c" => "\60\40\122\145\x63\x69\142\x69\x64\x61", "\143\157\x6d\141\156\144\x61\x5f\x6d\x6f\x76\151\x6c" => "\60", "\143\x6f\x6d\x61\x6e\x64\x61\137\x6b\x6d\157\x6e\x69\164\x6f\162" => "\x30", "\x6e\x6f\164\x69\155\142\162\141\162" => "\x31", "\x61\x6e\x74\x69\x70\x6f" => "\105\x53\120", "\x61\x6e\x74\x64\x6f\143" => $a, "\x72\x65\146\x65\162\x65\156\143\151\x61" => $bd2->tipodoc . $bd2->documento, "\x74\x6f\x74\141\x6c\x64" => $newtotd); $this->db->insert("\x6f\x70\145\x72\x74\x69", $datos2); $this->db->query("\125\120\x44\101\x54\105\x20\143\x6f\156\164\162\x6f\154\137\x6f\x70\x65\x72\164\x69\40\163\x65\164\x20\146\x65\143\x68\x64\x6f\154\x61\x72\x3d\x27{$fecha->n}\x27\40\x57\x48\x45\x52\x45\40\144\x6f\x63\x3d\x27{$a}\x27\40\x26\46\40\146\145\143\x68\x64\x6f\154\x61\x72\x3d\x27\x30\60\60\60\x2d\x30\60\55\60\x30\47"); $this->generecpag($a); } else { $this->db->query("\x55\x50\x44\101\x54\x45\40\x63\157\156\x74\162\x6f\154\x5f\x6f\x70\145\x72\x74\x69\x20\x73\x65\164\40\x66\145\x63\x68\144\x6f\x6c\141\162\x3d\x27{$bd2->fechacrea}\x27\40\x57\x48\x45\x52\x45\40\x64\157\x63\75\47{$a}\x27\x20\46\x26\x20\146\145\x63\x68\144\157\154\141\162\x3d\x27\60\x30\x30\60\55\60\60\55\60\60\x27"); $this->generecpag($a); } } } else { $this->generecpag($a); } } function igtf($fac, $fpago, $monto) { $bd2 = $this->db->query("\123\105\114\105\x43\124\x20\x2a\x2c\103\117\125\116\x54\50\x2a\51\40\151\x74\145\x6d\x20\x46\x52\117\115\40\157\x70\x65\162\164\151\40\127\x48\x45\122\105\x20\x64\x6f\x63\165\x6d\x65\156\x74\157\75\47{$fac}\x27\40\x26\46\x20\164\x69\160\157\x64\x6f\143\75\x27\x46\x41\103\x27")->row(); if ($bd2->item > 0) { $tasa = $this->db->query("\x53\105\114\105\x43\124\x20\x6f\146\151\143\151\x61\154\40\x46\122\117\x4d\40\x6d\x6f\x6e\145\143\x61\x6d\x20\127\110\x45\122\x45\40\146\145\143\150\x61\x3c\x3d\x27{$fpago}\x27\40\117\x52\x44\x45\122\40\x42\131\40\146\x65\x63\x68\141\x20\x44\x45\123\x43\x20\114\x49\x4d\111\x54\x20\x31")->row()->oficial; $num = $this->db->query("\123\x45\x4c\x45\103\124\40\111\106\x28\115\101\130\50\x64\157\143\x75\x6d\145\x6e\164\157\51\x2b\61\x3e\60\x2c\115\101\130\x28\144\x6f\143\x75\x6d\x65\156\164\157\51\x2b\61\x2c\61\x29\40\x6e\x20\x46\x52\x4f\115\x20\157\160\x65\162\164\151\40\x57\110\105\x52\105\x20\x74\151\160\157\144\157\143\x3d\x27\x4e\x2f\x44\x27")->row(); $newdoc = str_pad($num->n, 8, "\60", STR_PAD_LEFT); $pid = $this->genecod(12); $totald = $monto * 0.03; $total = $totald * $tasa; $datos = array("\x69\144\137\x65\x6d\x70\x72\145\163\x61" => "\x44\x4d\105\x44\x49\x46", "\141\x67\x65\156\x63\x69\141" => "\60\x30\61", "\164\151\160\x6f\x64\157\143" => "\116\x2f\x44", "\144\157\143\x75\x6d\x65\x6e\164\x6f" => $newdoc, "\147\x72\x75\x70\157" => "\116\x2f\x41", "\x6f\x72\x69\147\x65\156" => "\x31", "\143\157\144\151\147\x6f" => "\116\x2f\101", "\x70\151\x64" => '' . $pid . '', "\156\157\155\142\x72\145" => "\103\x6f\142\162\157\x20\x49\107\x54\106\x20\63\x25\40\x65\x6e\x20\x6d\157\156\145\x64\141\x20\x65\x78\164\x72\141\x6e\152\145\x72\141\x20\163\x65\147\x75\x6e\x20\106\141\x63\x74\x75\x72\141\x3a\x20" . $bd2->documento . "\40\x64\x65\x20\106\145\143\150\141\40" . DateTime::createFromFormat("\131\55\x6d\55\144", $bd2->fechacrea)->format("\144\x2f\x6d\x2f\x59") . "\40\x70\157\x72\40\165\x6e\x20\x4d\x6f\156\164\157\x20" . $bd2->totalfinal . "\x20\102\163\123\x2e", "\143\157\x73\164\157\x75\x6e\151\164" => 0, "\160\x72\x65\x63\151\157\x75\156\x69\x74" => 0, "\144\x73\x63\164\x6f\165\156\x69\x74" => 0, "\144\x73\143\x74\x6f\160\162\x63" => 0, "\x70\162\145\143\x69\x6f\x66\x69\x6e" => 0, "\x70\x72\x65\143\x69\157\157\x72\151\x67\151\x6e\141\154" => 0, "\x63\141\156\164\151\x64\x61\144" => 1, "\155\157\x6e\164\x6f\156\145\x74\157" => $total, "\155\157\156\164\157\164\157\x74\141\154" => $total, "\164\x69\x6d\160\165\x65\x70\x72\143" => 0, "\141\154\155\x61\143\145\x6e" => "\60\62", "\x70\162\x6f\x76\145\145\144\x6f\162" => "\x4e\57\101", "\146\x65\x63\x68\141\x64\x6f\x63" => '' . date("\131\x2d\x6d\55\144") . '', "\151\155\160\x75\x65\x73\x74\x6f\x31" => "\60", "\151\x6d\160\x75\145\163\x74\157\x32" => "\60", "\166\145\x6e\144\x65\144\157\x72" => $bd2->vendedor, "\x65\x6d\x69\163\157\162" => "\106\101\x43\x54\x55\122\x41\104", "\165\163\x61\163\x65\x72\x69\x61\x6c" => "\x32", "\164\151\x70\x6f\160\x72\x65\x63\151\x6f" => "\61", "\165\x6e\x69\144\141\144" => "\x55\116\x44", "\x61\x67\162\x75\x70\141\144\157" => "\x32", "\x63\157\155\160\165\145\x73\164\x6f" => "\62", "\x75\x73\141\x65\170\x69\163\164" => "\61", "\141\165\170\61" => "\61", "\145\163\x74\x61\143\151\x6f\156" => "\x30\60\x31", "\x75\144\151\156\141\155\x69\x63\x61" => "\61", "\x62\x61\x73\x65\151\155\x70\157\x31" => "\x30", "\x62\141\163\x65\151\155\160\x6f\62" => "\x30", "\154\x6f\x74\145" => "\x4e\x2f\101", "\151\144\x76\141\x6c\151\144\141\143\x69\x6f\156" => '', "\146\145\x63\150\141\171\150\157\162\x61" => '' . date("\x59\x2d\155\x2d\144\x20\x48\72\x69\72\x73") . '', "\145\156\166\151\x61\x64\x6f\137\x6b\x6d\x6f\156\151\x74\157\162" => "\60", "\x73\x74\x61\x74\165\163" => 1); $this->db->insert("\157\160\x65\x72\x6d\166", $datos); $datos2 = array("\x69\144\x5f\x65\155\160\162\x65\163\141" => "\x44\x4d\x45\x44\111\x46", "\141\147\145\x6e\x63\x69\141" => "\x30\x30\61", "\x74\x69\x70\x6f\x64\157\143" => "\x4e\x2f\x44", "\155\x6f\x6e\x65\144\x61" => "\60\x30\x30", "\x64\x6f\143\165\155\x65\x6e\x74\x6f" => $newdoc, "\x63\157\144\x63\x6c\151\145\156\x74\145" => '' . $bd2->codcliente . '', "\x6e\x6f\155\142\162\x65\x63\154\x69" => '' . $bd2->nombrecli . '', "\x63\x6f\156\164\x61\x63\164\x6f" => "\x4e\x2f\101", "\x72\x69\x66" => '' . $bd2->rif . '', "\144\x69\x72\x65\x63\143\x69\x6f\156" => '' . $bd2->direccion . '', "\164\145\154\x65\146\x6f\x6e\x6f\x73" => '' . $bd2->telefonos . '', "\x74\151\x70\x6f\x70\162\145\x63\151\157" => "\61", "\145\x6d\x69\x73\x69\x6f\156" => '' . date("\x59\55\155\55\144") . '', "\x72\145\x63\x65\x70\143\x69\x6f\x6e" => '' . date("\x59\55\155\55\144") . '', "\166\145\156\143\x65" => '' . date("\x59\55\155\55\144") . '', "\146\145\x63\150\x61\x63\162\x65\141" => '' . date("\131\55\x6d\x2d\144") . '', "\164\157\164\143\157\x73\x74\x6f" => 0, "\x74\157\x74\x62\162\165\164\x6f" => 0, "\x74\157\164\x6e\x65\164\x6f" => 0, "\164\157\164\141\154\146\151\x6e\x61\x6c" => '' . $total . '', "\x74\157\164\151\155\x70\165\145\x73\164" => 0, "\x74\157\x74\x64\145\x73\143\165\x65\156" => 0, "\x69\155\160\165\145\x73\164\157\x31" => 0, "\151\x6d\160\165\145\x73\164\157\62" => "\60", "\x64\x73\143\164\x6f\154\151\156\x65\x61" => 0, "\144\151\x61\163\x63\x72\145\144" => $bd2->diascred, "\166\x65\156\x64\x65\x64\157\x72" => '' . $bd2->vendedor . '', "\x66\141\143\164\157\x72\143\141\155\x62" => "\x31", "\165\x65\x6d\x69\163\x6f\162" => '' . $bd2->vendedor . '', "\145\163\164\x61\x63\151\x6f\x6e" => "\x30\60\61", "\x73\151\156\151\x6d\x70\x75\145\163\x74" => 0, "\141\x6c\x6d\x61\x63\145\156" => "\60\62", "\163\145\x63\x74\x6f\162" => '' . $bd2->sector . '', "\x73\x75\142\143\x6f\x64\151\147\x6f" => '' . $bd2->subcodigo . '', "\x66\x6f\162\155\x61\x66\x69\163" => "\x31", "\x61\154\x5f\x6c\151\x62\x72\x6f" => "\61", "\144\142\143\x72" => "\61", "\150\157\162\x61\144\157\x63\x75\155" => '' . date("\110\72\x69\x3a\x73") . '', "\x61\x6d\160\155" => "\x32", "\x65\163\143\162\145\144\151\x74\157" => "\x31", "\142\x61\163\x65\151\x6d\x70\x6f\61" => 0, "\x66\145\143\x68\x61\x79\150\x6f\x72\141" => '' . date("\x59\55\155\x2d\x64\x20\110\x3a\151\72\x73") . '', "\151\x64\166\x61\154\x69\144\141\x63\x69\157\156" => '', "\144\x6f\143\x75\x6d\145\x6e\x74\157\x66\x69\x73\x63\x61\154" => "\111\107\124\106", "\143\x6f\155\141\x6e\144\x61\137\155\x6f\166\x69\x6c" => "\60", "\143\x6f\155\x61\x6e\x64\141\x5f\153\155\157\156\151\164\157\x72" => "\60", "\x6e\157\x74\151\155\142\x72\x61\x72" => "\x31", "\141\x6e\164\151\x70\x6f" => "\105\123\x50", "\x61\156\x74\x64\x6f\x63" => $bd2->antdoc, "\162\x65\146\x65\162\145\x6e\x63\x69\141" => $bd2->tipodoc . $bd2->documento, "\x74\x6f\x74\x61\x6c\144" => $totald); $this->db->insert("\157\x70\x65\162\x74\x69", $datos2); } } public function mcuenta($bduser) { $bd = $this->db->query("\123\105\114\105\103\124\x20\x69\x64\40\143\x6f\144\x5f\x62\x61\156\143\54\x20\x6e\x6f\155\40\156\x6f\155\x62\137\x62\141\x6e\x63\x20\146\162\x6f\x6d\x20\x62\141\x6e\157\x72\151\x20\x57\x48\x45\x52\x45\40\151\144\40\x4e\117\x54\x20\x49\x4e\40\x28\x35\64\51\x20\157\x72\x64\145\x72\40\142\171\40\156\157\x6d\x20\x61\163\x63"); return $bd->result_array(); } public function bancos() { $bd = $this->db->query("\123\105\x4c\105\x43\124\x20\x69\144\40\x63\157\x64\137\x62\141\x6e\143\54\x20\156\x6f\x6d\x20\x6e\157\155\x62\x5f\x62\x61\x6e\143\40\x66\x72\157\155\x20\142\x61\156\x64\x65\x73\x74\x20\127\x48\105\x52\x45\x20\x6d\157\x6e\145\x64\x61\75\x27\x56\x45\x27\x20\x6f\x72\144\145\162\x20\x62\171\x20\x6e\157\155\40\x61\x73\x63"); return $bd->result_array(); } public function bancos2() { $bd = $this->db->query("\x53\x45\x4c\x45\103\x54\40\x69\144\x20\143\157\x64\137\142\141\x6e\x63\54\40\156\x6f\155\x20\x6e\157\x6d\x62\x5f\142\141\156\x63\40\x66\x72\157\x6d\40\x62\x61\x6e\144\x65\163\x74\x20\127\110\105\x52\x45\40\155\x6f\156\x65\x64\141\75\x27\x55\x53\104\47\x20\157\162\144\x65\162\40\x62\x79\x20\156\x6f\155\40\141\x73\x63"); return $bd->result_array(); } public function selectbancos() { $bd = $this->db->query("\x53\105\x4c\105\x43\124\x20\151\x64\x20\143\x6f\x64\137\x62\x61\156\143\x2c\40\156\x6f\x6d\40\x6e\157\155\x62\x5f\x62\141\x6e\x63\40\146\162\x6f\x6d\40\142\x61\156\x64\145\x73\164"); return $bd->result_array(); } public function selectzona() { $bd = $this->db->query("\123\x45\x4c\x45\103\124\x20\x63\157\156\x63\x61\164\x28\143\157\144\151\147\157\54\x73\165\142\x63\x6f\144\151\147\157\x29\x20\x63\157\144\54\x73\165\x62\x73\145\143\164\x6f\x72\x20\156\x6f\x6d\x20\146\162\157\155\40\163\x75\x62\163\145\x63\x74\157\x72\x65\x73\40\x4f\x52\x44\105\122\x20\x42\x59\40\156\x6f\x6d\40\x41\x53\x43"); return $bd->result(); } function tasabcv($fh) { return $this->db->query("\x53\x45\114\105\103\124\x20\x6f\x66\x69\143\151\141\154\x20\x46\x52\x4f\115\40\x6d\157\156\x65\x63\x61\155\40\x57\110\105\x52\105\x20\x66\x65\143\x68\x61\x3c\75\47{$fh}\x27\x20\x4f\x52\104\x45\x52\40\102\x59\40\x66\x65\x63\150\141\x20\104\x45\123\x43\x20\x4c\111\x4d\111\124\x20\61")->row()->oficial; } public function regpagado($data, $b) { $user = $this->session->userdata("\x63\157\x64"); $rows = count($data["\146\141\x63"]); $fac = $data["\x66\x61\x63"]; $mfac = $data["\155\x66\x61\143"]; $j = 0; $num = $this->db->query("\x53\x45\x4c\x45\x43\x54\40\115\x41\130\x28\151\144\51\53\61\x20\x69\144\x20\x46\122\117\115\x20\x6f\x70\x65\x72\x63\154\151")->row(); $id = $num->id; if ($id == null) { $id = 1; } if ($data["\x74\151\160"] == "\105\106\x45\x43\124" || $data["\164\151\160"] == "\x4f\x54\122\x4f\123" || $data["\164\x69\160"] == "\117\124\122\x4f\106") { $valida = 0; } else { $valida = null; } for ($i = 0; $i < $rows; $i++) { $val1 = $this->db->query("\123\105\x4c\105\103\124\x20\x43\117\125\116\x54\x28\52\x29\40\151\x74\x65\x6d\x20\106\122\x4f\115\x20\157\x70\145\162\164\x69\40\x57\110\x45\x52\x45\x20\144\157\x63\x75\155\x65\x6e\164\157\x3d\47" . $fac[$i] . "\x27\40\46\x26\40\50\x72\145\x63\x65\x70\143\x69\x6f\156\76\146\x65\143\150\x61\x63\162\x65\141\x20\x7c\x7c\40\163\145\143\164\157\162\x3d\x27\x31\60\47\x29\x20")->row()->item; if ($fac[$i] != '' && $val1 > 0) { $dfac = $this->db->query("\123\x45\x4c\105\103\124\x20\x49\106\x28\47" . $data["\x66\142\x61\156\x63\x6f"] . "\47\74\75\x44\x41\x54\x45\x5f\x41\x44\x44\50\141\56\162\145\x63\145\x70\x63\151\x6f\x6e\54\111\x4e\124\105\x52\126\x41\x4c\x20\x61\56\x64\151\x61\x73\x69\156\x64\x65\x78\x20\104\101\x59\51\54\141\x2e\146\x65\x63\150\x61\x63\x72\145\x61\54\x27" . $data["\146\x62\141\x6e\x63\157"] . "\x27\x29\40\146\145\143\150\x61\40\40\106\122\117\x4d\x20\x6f\x70\x65\x72\x74\151\40\x61\40\112\x4f\x49\x4e\40\143\157\156\164\x72\157\154\137\x6f\160\145\162\x74\x69\x20\142\x20\x4f\116\x20\141\x2e\x61\x6e\x74\144\x6f\143\75\x62\x2e\144\x6f\x63\x20\127\x48\x45\x52\x45\40\x61\x2e\144\157\x63\x75\x6d\x65\x6e\x74\157\x3d\x27" . $fac[$i] . "\47\x20\x47\x52\117\x55\x50\x20\x42\x59\x20\141\56\144\157\x63\165\155\145\x6e\164\157")->row(); $tasa = $this->db->query("\x53\105\114\105\103\124\40\x6f\146\151\x63\x69\141\x6c\x20\x46\122\117\x4d\40\x6d\157\x6e\x65\x63\x61\155\40\127\x48\x45\122\105\40\146\145\x63\x68\141\x3c\x3d\47{$dfac->fecha}\47\x20\x4f\x52\104\105\122\40\x42\131\x20\146\x65\143\150\141\x20\x44\x45\x53\103\x20\114\111\x4d\111\124\40\61")->row(); if ($b == "\x56\105") { $totd = $mfac[$i] / $tasa->oficial; $totbs = $mfac[$i]; } else { $totd = $mfac[$i]; $totbs = $mfac[$i] * $tasa->oficial; $this->igtf($fac[$i], $data["\x66\142\141\x6e\x63\x6f"], $mfac[$i]); } $datos = array("\151\144" => $id, "\x69\144\146\x61\143" => $fac[$i], "\151\x64\x63\x6f\x6e\163\x62\141\x6e\143" => $valida, "\x66\145\143\150" => $data["\146\142\x61\156\x63\x6f"], "\164\x69\160" => $data["\164\151\160"], "\155\x6f\156\x65\x64\141" => $b, "\162\145\146" => $data["\156\165\x6d\145\162\157"], "\x62\141\x6e\x63\157\x72\151" => $data["\142\x61\x6e\143\x6f\x63\x6c\x69"], "\x62\x61\156\143\144\145\163\164" => $data["\x63\157\x64\x62\x61\x6e\143"], "\x6d\157\156\164\157" => $totbs, "\x6d\157\x6e\164\157\144" => $totd, "\157\x62\x73\x65\162\x76" => $data["\144\145\163\143\162\x69\160"], "\x75\x73\145\162" => $user, "\x66\x72\145\x67" => date("\x59\x2d\155\x2d\x64")); $this->db->insert("\x6f\160\145\x72\x63\x6c\151", $datos); if ($this->db->affected_rows() > 0) { $j++; if ($valida == 0) { $antdoc = $this->db->query("\x53\105\114\105\x43\124\40\141\156\164\x64\x6f\x63\40\x46\122\x4f\x4d\x20\157\x70\x65\162\x74\x69\x20\x57\110\x45\x52\x45\x20\x64\x6f\x63\165\x6d\x65\156\x74\157\75\x27{$fac[$i]}\47")->row(); $this->generecpag($antdoc->antdoc); $this->loguser("\120\x61\147\x6f", "\105\x6c\40\165\x73\165\x61\162\x69\157\40\x72\145\x67\x69\x73\164\x72\x6f\x20\x75\x6e\x20\160\141\147\x6f\72\40" . $totbs . "\40\x42\x73\x2c\x20" . $totd . "\40\44\x20\x4f\x66\151\x63\151\x61\x6c\x3a\40" . $tasa->oficial . "\x20\106\145\x63\x68\x61\72\40" . $data["\x66\x62\x61\156\143\157"] . "\40\x4d\x6f\x6e\x65\x64\141\x3a\40" . $b . "\40\x70\x61\162\141\x20\x65\154\40\144\157\x63\x75\x6d\145\x6e\x74\x6f\40" . $fac[$i] . ''); } } } } if ($j > 0) { $this->conciliabanc(); } return $j; } function conciliabanc() { $bd = $this->db->query("\x53\x45\x4c\x45\103\124\x20\142\56\x61\x6e\x74\x64\157\143\54\x61\x2e\x69\x64\x2c\x62\x2e\x72\151\x66\54\x61\x2e\x66\145\143\150\x2c\141\56\x72\x65\146\x2c\x61\56\x62\141\156\143\144\145\x73\x74\54\141\x2e\x74\151\160\54\141\x2e\x6d\157\x6e\145\x64\141\x2c\x53\125\x4d\x28\x61\56\155\x6f\156\164\x6f\51\40\x6d\x6f\156\164\157\x2c\x53\125\115\50\141\56\x6d\x6f\x6e\164\157\x64\x29\x20\x6d\157\156\x74\157\144\12\40\x20\x20\40\106\x52\x4f\115\x20\157\x70\x65\x72\143\154\151\x20\x61\xa\x20\40\40\40\112\117\111\x4e\x20\x6f\x70\145\x72\164\151\40\x62\40\x4f\x4e\40\x61\x2e\x69\144\x66\x61\x63\75\x62\56\144\157\x63\x75\155\x65\x6e\x74\157\xa\40\40\x20\40\x57\x48\x45\122\105\x20\141\x2e\x69\x64\143\157\x6e\163\x62\x61\x6e\x63\40\111\x53\40\116\x55\x4c\x4c\40\107\x52\117\x55\x50\x20\102\x59\40\141\x2e\x69\144\54\x62\x2e\x63\x6f\144\143\x6c\151\145\156\164\x65\73"); $i = 0; $rows = $bd->num_rows(); if ($bd->num_rows() > 0) { foreach ($bd->result() as $db) { if ($db->moneda == "\x56\105") { $bd2 = $this->db->query("\x53\105\x4c\x45\103\x54\x20\151\x64\40\106\122\x4f\x4d\40\x62\141\156\144\145\x73\164\x20\x57\x48\x45\x52\105\x20\x6d\x6f\x6e\x65\x64\141\75\x27\x56\105\x27")->result(); foreach ($bd2 as $db2) { if ($db->tip == "\124\122\x41\116\123") { $bd3 = $this->db->query("\123\105\114\105\x43\x54\x20\151\x64\40\106\122\x4f\115\40\143\157\x6e\x73\x62\141\x6e\143\x20\127\110\x45\122\x45\x20\142\x61\156\x63\157\75\x27{$db2->id}\47\x20\x26\x26\x20\163\x74\x61\x74\x75\163\x3d\47\116\x27\x20\x26\46\40\x66\145\143\150\x3d\x27{$db->fech}\x27\40\46\x26\40\50\x64\145\x73\x63\162\x69\x70\x20\114\x49\113\x45\x20\x27\x25{$db->rif}\45\x27\x20\x7c\x7c\40\162\145\146\75\x27{$db->ref}\x27\51\x20\46\46\x20\155\x6f\x6e\x74\x6f\x3d\x27{$db->monto}\47"); } else { if ($db->tip == "\x50\x4d\117\126\111") { $bd3 = $this->db->query("\x53\x45\x4c\105\103\x54\x20\151\x64\40\106\x52\117\x4d\x20\143\157\156\163\142\141\156\x63\40\x57\110\105\122\105\40\x62\x61\156\143\x6f\x3d\47{$db2->id}\x27\x20\46\46\40\x73\164\x61\x74\x75\x73\x3d\x27\x4e\x27\x20\x26\46\40\x66\145\143\x68\75\x27{$db->fech}\x27\40\46\x26\x20\x28\144\145\163\143\162\151\x70\x20\114\111\113\105\x20\x27\45{$db->ref}\45\x27\40\174\174\40\x72\145\146\x3d\x27{$db->ref}\x27\51\x20\x26\x26\40\155\157\156\x74\157\x3d\x27{$db->monto}\x27"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\x50\x44\x41\124\105\x20\157\160\x65\162\143\x6c\151\40\123\105\x54\40\x69\x64\143\157\x6e\x73\x62\141\x6e\143\x3d\x27{$db3->id}\47\40\x57\x48\x45\x52\105\40\x69\x64\75\x27{$db->id}\x27"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\125\120\104\x41\x54\x45\x20\x63\x6f\x6e\163\142\x61\156\x63\40\123\105\124\x20\x73\x74\141\164\x75\x73\75\47\x53\x27\x20\127\110\x45\122\105\x20\x69\144\75\x27{$db3->id}\x27"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "\x54\x52\101\x4e\123") { $bd3 = $this->db->query("\x53\105\114\105\103\124\x20\x69\x64\x20\106\x52\x4f\115\x20\x63\157\156\x73\142\x61\x6e\x63\40\x57\x48\105\x52\105\x20\x62\141\156\x63\x6f\x3d\47{$db2->id}\x27\40\46\46\x20\163\x74\x61\164\x75\x73\75\x27\116\47\40\x26\46\40\146\145\x63\150\x3d\47{$db->fech}\x27\x20\46\x26\x20\x6d\x6f\x6e\x74\x6f\75\47{$db->monto}\x27"); } else { if ($db->tip == "\120\115\117\x56\x49") { $bd3 = $this->db->query("\123\x45\x4c\105\103\x54\40\x69\x64\x20\106\x52\117\x4d\40\x63\x6f\156\163\142\141\x6e\x63\x20\x57\110\105\x52\x45\40\x62\141\156\143\x6f\x3d\47{$db2->id}\x27\x20\46\x26\40\x73\x74\x61\164\x75\163\x3d\47\x4e\x27\40\46\46\40\x66\x65\143\x68\75\x27{$db->fech}\47\40\46\x26\x20\x6d\x6f\x6e\x74\x6f\x3d\x27{$db->monto}\47"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\120\x44\x41\x54\105\40\157\x70\x65\x72\x63\x6c\151\40\x53\x45\124\x20\x69\x64\x63\157\x6e\163\x62\x61\x6e\143\x3d\47{$db3->id}\47\x20\x57\x48\x45\122\x45\x20\x69\144\75\47{$db->id}\x27"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x55\120\104\x41\124\105\x20\143\x6f\156\163\142\141\156\x63\x20\x53\105\x54\x20\163\x74\141\x74\165\x73\75\x27\x53\47\40\x57\110\x45\122\105\x20\151\144\x3d\47{$db3->id}\47"); $this->generecpag($db->antdoc); } } } } } if ($db->moneda == "\x55\123\x44") { $bd2 = $this->db->query("\123\x45\114\x45\x43\x54\x20\151\x64\x20\106\x52\x4f\115\40\x62\x61\156\x64\x65\163\x74\40\127\110\x45\122\x45\40\155\157\156\145\x64\141\75\x27\x55\123\x44\x27")->result(); foreach ($bd2 as $db2) { if ($db->tip == "\124\122\x41\x4e\123") { $bd3 = $this->db->query("\x53\x45\114\105\103\x54\40\x69\x64\40\x46\122\117\x4d\40\143\x6f\156\x73\142\141\x6e\143\40\127\x48\x45\x52\105\40\x62\x61\x6e\143\157\75\x27{$db2->id}\x27\x20\46\46\40\x73\x74\x61\164\x75\163\x3d\x27\x4e\x27\x20\46\x26\40\x66\x65\x63\x68\75\x27{$db->fech}\47\x20\46\x26\x20\50\x64\145\x73\x63\x72\x69\160\x20\114\111\113\x45\40\x27\x25{$db->rif}\45\47\40\x7c\174\x20\162\x65\x66\x3d\47{$db->ref}\47\51\x20\x26\46\x20\x6d\157\x6e\x74\157\75\x27{$db->montod}\x27"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\x50\x44\x41\x54\105\x20\x6f\160\145\162\143\x6c\151\40\x53\x45\124\40\151\144\143\x6f\x6e\163\142\x61\x6e\143\75\47{$db3->id}\47\x20\127\x48\x45\122\105\40\x69\x64\x3d\x27{$db->id}\47"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\125\120\x44\101\124\105\x20\143\157\156\x73\x62\141\x6e\x63\x20\x53\x45\124\x20\x73\x74\x61\164\165\x73\x3d\47\123\47\40\x57\x48\105\x52\x45\x20\x69\144\x3d\x27{$db3->id}\47"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "\x54\x52\x41\x4e\x53") { $bd3 = $this->db->query("\123\x45\114\x45\x43\124\x20\151\144\x20\x46\x52\x4f\115\x20\143\157\x6e\163\142\141\156\143\40\x57\x48\105\122\105\x20\142\141\x6e\x63\x6f\75\x27{$db2->id}\47\40\x26\x26\40\x73\164\141\164\x75\163\x3d\47\x4e\47\40\x26\x26\40\146\x65\x63\x68\x3d\47{$db->fech}\47\40\x26\46\x20\x6d\157\x6e\x74\x6f\75\47{$db->montod}\47"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\x55\x50\104\x41\124\105\40\157\160\x65\162\x63\154\x69\x20\123\x45\124\40\151\144\x63\x6f\x6e\x73\142\141\156\143\75\47{$db3->id}\x27\x20\x57\110\105\122\x45\x20\151\x64\75\47{$db->id}\x27"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x55\x50\x44\x41\x54\x45\x20\143\157\x6e\163\142\x61\x6e\143\x20\x53\105\x54\40\163\164\141\x74\165\163\x3d\47\x53\47\x20\x57\110\105\122\x45\40\x69\x64\x3d\x27{$db3->id}\47"); $this->generecpag($db->antdoc); } } } } } } } if ($rows > $i) { $bd = $this->db->query("\123\x45\114\105\103\124\x20\x61\56\x69\x64\x2c\x61\56\x69\x64\146\x61\143\x2c\142\x2e\x72\x69\146\x2c\141\56\x66\145\x63\150\x2c\x61\x2e\162\145\x66\54\141\x2e\x62\141\156\143\144\145\163\x74\x2c\141\x2e\x74\x69\x70\x2c\x61\56\x6d\x6f\156\x65\x64\x61\x2c\141\56\x6d\157\156\x74\x6f\x2c\141\56\x6d\157\156\164\157\144\x2c\142\x2e\141\x6e\164\x64\x6f\x63\12\x20\40\x20\x20\106\122\117\x4d\x20\x6f\x70\x65\x72\x63\x6c\x69\x20\x61\xa\x20\x20\40\40\x4a\x4f\x49\116\40\157\x70\145\162\x74\x69\x20\x62\40\117\116\x20\141\x2e\x69\144\x66\141\143\75\142\x2e\x64\x6f\143\165\x6d\145\156\x74\x6f\xa\x20\40\40\40\127\110\105\122\x45\x20\141\x2e\x69\x64\143\157\x6e\x73\142\141\156\x63\40\111\x53\x20\x4e\125\114\114"); if ($bd->num_rows() > 0) { foreach ($bd->result() as $db) { if ($db->moneda == "\126\105") { $bd2 = $this->db->query("\123\x45\x4c\105\103\x54\40\x69\144\40\106\122\117\115\40\142\141\156\144\145\163\164\40\127\110\105\x52\105\40\x6d\157\x6e\145\x64\141\75\47\x56\105\x27")->result(); foreach ($bd2 as $db2) { if ($db->tip == "\x54\122\x41\x4e\x53") { $bd3 = $this->db->query("\x53\105\x4c\x45\x43\x54\40\151\144\40\106\122\x4f\115\40\x63\x6f\x6e\163\x62\x61\x6e\x63\40\x57\x48\x45\x52\105\x20\142\x61\x6e\x63\157\x3d\x27{$db2->id}\x27\x20\x26\46\40\x73\x74\x61\x74\165\163\x3d\x27\116\x27\40\46\x26\40\146\x65\143\x68\75\47{$db->fech}\x27\x20\46\x26\40\50\x64\x65\163\143\x72\151\x70\40\114\x49\x4b\x45\40\x27\45{$db->rif}\45\x27\x20\x7c\174\x20\162\x65\146\x3d\47{$db->ref}\x27\51\x20\x26\x26\x20\x6d\157\x6e\164\x6f\x3d\47{$db->monto}\x27"); } else { if ($db->tip == "\120\x4d\x4f\126\x49") { $bd3 = $this->db->query("\123\105\x4c\x45\x43\x54\40\151\144\40\x46\x52\x4f\x4d\x20\143\157\156\163\142\x61\x6e\x63\40\127\110\x45\122\x45\x20\142\141\x6e\x63\x6f\75\47{$db2->id}\47\x20\x26\46\x20\x73\164\x61\164\x75\x73\x3d\x27\116\47\40\x26\46\x20\x66\x65\143\x68\75\47{$db->fech}\47\x20\x26\x26\40\x28\x64\145\163\x63\162\151\x70\x20\x4c\x49\113\x45\x20\47\x25{$db->ref}\45\x27\x20\x7c\x7c\x20\x72\x65\146\x3d\x27{$db->ref}\x27\51\x20\x26\x26\x20\155\157\156\164\x6f\75\47{$db->monto}\x27"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\x55\x50\x44\101\124\105\x20\x6f\x70\145\162\x63\x6c\151\40\x53\105\x54\40\x69\x64\x63\x6f\x6e\x73\142\141\x6e\143\75\47{$db3->id}\x27\40\127\x48\105\122\105\40\x69\144\75\47{$db->id}\x27\40\x26\46\x20\x69\144\x66\x61\x63\x3d\x27{$db->idfac}\47"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x55\120\104\x41\x54\105\40\x63\x6f\156\x73\x62\x61\156\143\40\x53\x45\124\40\x73\164\x61\x74\165\163\75\47\123\47\x20\x57\110\x45\x52\x45\40\151\x64\75\x27{$db3->id}\x27"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "\124\122\101\x4e\123") { $bd3 = $this->db->query("\123\105\x4c\105\103\124\x20\151\x64\x20\106\122\117\115\x20\143\x6f\x6e\x73\142\x61\x6e\143\40\x57\x48\105\x52\105\x20\142\x61\156\x63\x6f\75\47{$db2->id}\x27\x20\x26\46\40\163\x74\x61\164\x75\x73\75\x27\x4e\x27\x20\x26\46\40\146\145\143\150\75\x27{$db->fech}\x27\x20\x26\x26\x20\x6d\x6f\x6e\x74\157\75\47{$db->monto}\x27"); } else { if ($db->tip == "\x50\115\117\x56\x49") { $bd3 = $this->db->query("\x53\105\114\x45\x43\124\x20\x69\144\40\x46\x52\x4f\x4d\x20\143\x6f\x6e\163\142\x61\x6e\143\x20\x57\x48\x45\122\105\40\x62\x61\x6e\143\157\75\47{$db2->id}\47\40\46\x26\40\163\x74\x61\164\165\163\x3d\47\x4e\x27\40\46\46\40\146\145\x63\x68\x3d\x27{$db->fech}\x27\x20\46\x26\x20\x6d\x6f\156\x74\157\75\47{$db->monto}\x27"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\x50\104\101\124\x45\x20\x6f\x70\145\x72\143\154\x69\x20\x53\x45\x54\x20\151\144\x63\157\x6e\163\142\x61\156\x63\x3d\x27{$db3->id}\x27\x20\x57\110\105\x52\105\40\x69\144\x3d\47{$db->id}\47\x20\x26\x26\40\x69\x64\146\141\x63\x3d\47{$db->idfac}\47"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x55\x50\x44\x41\x54\x45\40\x63\157\x6e\163\x62\141\x6e\x63\40\x53\105\124\40\x73\164\x61\164\x75\x73\x3d\47\x53\x27\40\127\110\105\122\105\x20\x69\144\x3d\47{$db3->id}\x27"); $this->generecpag($db->antdoc); } } } } } if ($db->moneda == "\x55\x53\104") { $bd2 = $this->db->query("\123\x45\x4c\105\x43\x54\x20\x69\x64\x20\106\x52\117\x4d\x20\x62\141\x6e\x64\x65\163\164\40\x57\x48\x45\122\105\40\155\157\156\x65\144\141\x3d\x27\x55\123\x44\47")->result(); foreach ($bd2 as $db2) { if ($db->tip == "\x54\x52\x41\x4e\x53") { $bd3 = $this->db->query("\x53\105\x4c\x45\x43\x54\40\x69\x64\40\x46\x52\x4f\x4d\x20\x63\157\x6e\163\142\x61\x6e\143\x20\127\110\105\x52\x45\x20\x62\x61\156\x63\157\x3d\47{$db2->id}\x27\40\46\46\x20\x73\x74\141\x74\x75\x73\75\47\116\47\x20\x26\46\40\146\x65\x63\150\75\x27{$db->fech}\47\x20\x26\x26\40\x28\144\x65\163\143\x72\x69\160\x20\x4c\x49\x4b\x45\x20\x27\x25{$db->rif}\45\47\40\x7c\174\40\x72\145\x66\75\x27{$db->ref}\47\x29\40\x26\x26\x20\x6d\157\x6e\164\157\75\x27{$db->montod}\x27"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\120\x44\101\124\x45\x20\157\x70\x65\162\143\154\151\x20\123\105\124\x20\x69\x64\143\157\x6e\163\x62\141\x6e\x63\75\47{$db3->id}\47\x20\127\110\x45\x52\105\x20\151\144\x3d\47{$db->id}\x27\40\46\x26\x20\x69\x64\146\x61\143\75\x27{$db->idfac}\47"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\125\x50\104\x41\124\x45\x20\x63\x6f\156\x73\142\141\x6e\143\x20\x53\105\x54\x20\163\164\141\164\165\x73\75\x27\x53\x27\x20\127\x48\105\x52\x45\x20\151\x64\x3d\47{$db3->id}\x27"); $this->generecpag($db->antdoc); } } else { if ($db->tip == "\124\122\x41\116\x53") { $bd3 = $this->db->query("\123\105\x4c\x45\103\x54\x20\x69\x64\40\106\122\x4f\x4d\x20\x63\157\x6e\x73\x62\141\x6e\143\x20\127\110\x45\122\105\x20\142\x61\156\143\x6f\75\47{$db2->id}\x27\40\46\46\x20\x73\164\x61\x74\165\x73\x3d\47\116\47\40\x26\46\40\x66\x65\x63\150\x3d\x27{$db->fech}\x27\40\46\46\x20\x6d\x6f\x6e\164\x6f\75\47{$db->montod}\x27"); } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\120\104\x41\124\x45\40\x6f\160\x65\162\x63\154\x69\x20\x53\105\124\x20\x69\144\143\157\x6e\x73\x62\141\x6e\x63\x3d\x27{$db3->id}\x27\x20\127\110\105\x52\x45\x20\151\144\75\47{$db->id}\47\40\46\46\40\x69\144\146\x61\x63\75\x27{$db->idfac}\x27"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x55\120\x44\x41\124\105\40\x63\157\x6e\163\x62\x61\156\x63\x20\123\x45\124\40\163\x74\141\x74\x75\163\x3d\x27\x53\x27\40\x57\110\x45\x52\x45\x20\x69\x64\x3d\47{$db3->id}\x27"); $this->generecpag($db->antdoc); } } } } } } } } $this->db->query("\104\x45\114\x45\124\105\40\x46\122\x4f\115\x20\x6f\160\145\162\x63\x6c\x69\x20\x57\110\x45\x52\x45\40\x66\x72\x65\x67\x3c\75\x44\101\x54\105\x5f\x53\x55\x42\x28\x43\125\122\104\x41\x54\105\50\x29\54\111\x4e\x54\105\122\126\x41\114\x20\x36\x20\104\101\131\x29\x20\40\x26\x26\40\151\144\x63\157\156\163\x62\x61\x6e\143\x20\111\x53\x20\x4e\125\x4c\114"); $this->db->query("\x55\x50\x44\x41\x54\105\x20\143\x6f\x6e\x73\142\x61\156\x63\40\x53\x45\124\40\163\164\x61\164\165\x73\75\x27\123\x27\x20\x57\110\105\122\x45\x20\x66\x65\143\x68\x3c\75\x44\x41\124\105\x5f\x53\x55\102\x28\x43\125\122\104\101\124\x45\x28\x29\54\111\116\124\105\122\x56\101\x4c\x20\x33\x30\x20\x44\x41\x59\x29\x20\x26\46\x20\x73\164\x61\x74\x75\x73\75\x27\116\x27\x20\x26\46\x20\x6e\157\142\x6c\x6f\x63\x6b\x3d\47\x4e\47"); } function conciliabanc_pagos() { $bd = $this->db->query("\123\105\114\x45\x43\124\40\141\56\x69\x64\x2c\x28\123\x45\114\x45\103\124\40\162\151\x66\40\x46\122\x4f\115\x20\x70\162\x6f\166\145\x65\x64\x20\x57\x48\x45\122\x45\40\151\144\x3d\142\x2e\x70\x72\157\x76\x65\145\144\x29\x20\x72\151\x66\54\141\56\146\145\x63\150\54\x61\56\x72\x65\x66\x2c\141\56\x62\x61\156\x63\x64\145\163\164\54\x61\56\x74\151\160\x2c\141\x2e\x6d\x6f\156\145\x64\x61\54\x61\56\x6d\x6f\156\x74\157\xa\x20\40\x20\x20\106\122\117\115\40\157\160\145\162\x70\162\x6f\166\x20\141\xa\40\x20\40\40\x4a\117\111\116\x20\143\x6f\x6d\x70\162\141\163\40\142\x20\x4f\x4e\x20\141\x2e\151\144\x66\141\143\x3d\x62\x2e\144\157\143\165\155\145\156\164\x6f\xa\x20\40\x20\40\x57\110\105\122\105\x20\141\56\151\x64\143\157\156\163\x62\141\156\x63\40\111\x53\x20\116\x55\114\114\40\107\x52\x4f\x55\x50\x20\x42\x59\x20\141\56\x69\144"); $i = 0; $rows = $bd->num_rows(); if ($bd->num_rows() > 0) { foreach ($bd->result() as $db) { if ($db->moneda == "\126\x45") { $bd2 = $this->db->query("\x53\x45\x4c\x45\x43\x54\40\x69\144\40\106\x52\117\115\x20\x62\141\x6e\x64\x65\163\x74\x20\x57\x48\x45\122\105\40\155\x6f\x6e\x65\144\x61\x3d\47\126\105\x27")->result(); foreach ($bd2 as $db2) { if ($db->tip == "\124\x52\x41\x4e\123") { $bd3 = $this->db->query("\123\105\x4c\x45\103\x54\x20\151\x64\x20\x46\122\117\115\x20\x63\x6f\x6e\x73\142\141\156\x63\x20\127\x48\105\122\x45\x20\x62\141\156\143\x6f\x3d\47{$db2->id}\x27\x20\x26\x26\40\163\164\x61\x74\165\163\75\x27\116\47\x20\x26\46\40\x66\145\143\x68\75\47{$db->fech}\x27\x20\x26\x26\40\50\x64\145\163\x63\162\151\160\40\x4c\x49\x4b\105\x20\47\x25{$db->rif}\x25\47\x20\x7c\174\x20\162\x65\146\75\47{$db->ref}\x27\51\40\x26\46\x20\155\x6f\x6e\x74\157\75\x27{$db->monto}\x27"); } else { if ($db->tip == "\x50\115\117\x56\111") { $bd3 = $this->db->query("\123\105\114\105\x43\x54\40\151\144\x20\106\x52\117\115\x20\x63\x6f\x6e\x73\142\x61\156\x63\40\127\110\x45\x52\105\x20\x62\x61\x6e\143\x6f\75\x27{$db2->id}\x27\x20\46\46\x20\x73\x74\141\x74\165\x73\x3d\47\x4e\47\40\46\46\40\x66\x65\143\x68\75\x27{$db->fech}\47\x20\x26\46\x20\50\x64\145\163\x63\x72\x69\160\x20\x4c\111\x4b\x45\x20\x27\45{$db->ref}\45\x27\40\174\174\x20\162\145\146\x3d\x27{$db->ref}\47\x29\40\46\46\x20\x6d\x6f\156\x74\157\75\47{$db->monto}\x27"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\125\x50\x44\101\124\105\40\157\160\x65\162\160\162\157\166\x20\x53\x45\124\40\151\x64\143\x6f\156\163\142\x61\156\143\75\47{$db3->id}\x27\x20\127\110\105\x52\x45\40\151\144\75\x27{$db->id}\x27"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\125\120\104\101\124\x45\x20\143\157\156\x73\x62\x61\x6e\x63\40\123\105\x54\x20\x73\x74\141\164\165\x73\x3d\47\123\47\40\x57\x48\105\x52\x45\x20\151\x64\x3d\47{$db3->id}\47"); } } else { if ($db->tip == "\124\122\101\116\x53") { $bd3 = $this->db->query("\123\105\114\105\103\124\x20\151\144\x20\106\x52\117\x4d\x20\x63\x6f\156\163\142\141\x6e\143\x20\127\110\105\x52\105\40\x62\141\x6e\x63\157\75\47{$db2->id}\47\x20\46\46\x20\x73\164\141\x74\x75\163\75\47\116\47\x20\x26\x26\x20\x66\x65\143\150\x3d\x27{$db->fech}\47\40\46\x26\x20\155\157\x6e\164\157\75\x27{$db->monto}\x27"); } else { if ($db->tip == "\x50\115\117\x56\x49") { $bd3 = $this->db->query("\123\105\114\105\x43\124\40\151\144\40\106\x52\x4f\115\x20\x63\x6f\156\x73\142\x61\156\x63\x20\127\x48\x45\122\105\x20\142\x61\156\x63\x6f\x3d\47{$db2->id}\47\x20\x26\x26\x20\x73\x74\x61\x74\x75\163\x3d\47\116\47\40\46\46\x20\x66\x65\x63\x68\x3d\47{$db->fech}\47\x20\46\x26\40\155\x6f\156\x74\x6f\75\47{$db->monto}\x27"); } } if ($bd3->num_rows() > 0) { $db3 = $bd3->row(); $this->db->query("\x55\120\104\x41\x54\105\40\157\x70\145\x72\x70\162\157\166\x20\x53\x45\124\40\x69\x64\x63\x6f\156\163\x62\x61\156\x63\75\x27{$db3->id}\x27\x20\127\110\x45\x52\105\x20\151\144\75\47{$db->id}\47"); if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\125\x50\104\101\x54\x45\40\143\157\x6e\x73\142\x61\x6e\143\40\123\105\x54\x20\163\x74\x61\164\165\163\x3d\47\x53\47\x20\127\110\105\x52\105\x20\151\x64\x3d\47{$db3->id}\x27"); } } } } } } } $this->db->query("\x44\105\114\105\124\x45\x20\x46\x52\x4f\115\x20\x6f\160\x65\162\160\162\157\x76\x20\127\110\x45\x52\x45\40\146\x72\x65\147\74\x3d\104\101\124\105\137\x53\125\x42\x28\x43\125\x52\104\x41\124\x45\50\x29\54\x49\116\124\105\122\x56\101\114\40\66\40\104\101\x59\x29\40\x20\46\46\x20\x69\144\x63\157\156\163\142\141\156\x63\40\x49\x53\40\116\x55\114\x4c"); $this->db->query("\x55\x50\104\x41\x54\x45\40\143\x6f\x6e\163\x62\141\x6e\x63\x20\123\x45\x54\x20\163\164\x61\x74\165\163\x3d\47\x53\x27\x20\127\x48\105\122\x45\x20\x66\145\x63\x68\x3c\75\x44\x41\124\x45\x5f\123\125\x42\x28\103\x55\x52\104\101\124\105\50\51\x2c\x49\116\x54\105\122\126\x41\x4c\40\63\60\40\x44\x41\131\51\x20\x26\46\x20\163\x74\x61\164\165\163\75\x27\x4e\47\40\46\46\x20\x6e\157\x62\x6c\157\x63\x6b\75\x27\116\x27"); } function excelcban($a, $b, $c, $d, $e) { $val = $this->db->query("\123\x45\x4c\x45\x43\x54\x20\x4e\125\x4c\x4c\40\106\x52\x4f\115\40\x63\157\156\163\142\x61\x6e\x63\x20\127\110\x45\x52\x45\x20\x72\x65\x66\75\47{$b}\47\x20\x26\x26\40\x6d\157\156\164\157\75\47{$d}\x27\40\46\46\40\142\x61\156\x63\x6f\75\47{$e}\47")->num_rows(); if ($val == 0) { $data = array("\146\x65\143\150" => $a, "\x72\x65\146" => $b, "\x64\x65\163\143\x72\151\160" => $c, "\x6d\x6f\x6e\164\x6f" => $d, "\x62\141\156\143\157" => $e); $this->db->insert("\x63\x6f\x6e\163\x62\x61\156\143", $data); return $this->db->affected_rows(); } } function excellote($alm, $cod, $lot, $cant, $tip, $elab, $venc) { $v = 0; if ($alm != '' && $cod != '' && $lot != '' && $cant != '' && $tip != '' && $venc != '') { if ($tip == "\61") { $ajusteinv = array("\x74\x69\x70\x6f" => $tip, "\x63\157\144\x69\x67\x6f" => $cod, "\154\x6f\x74\x65" => $lot, "\144\154\157\164\x65" => $lot, "\141\x6c\x6d" => $alm, "\x64\x61\x6c\155" => $alm, "\143\141\x6e\164" => $cant, "\x66\x65\x63\150" => date("\x59\55\x6d\55\x64")); $this->db->insert("\141\152\x75\163\164\x65\x69\x6e\x76", $ajusteinv); if ($this->db->affected_rows() > 0) { $vallot = $this->db->query("\x53\x45\114\x45\x43\x54\40\x4e\x55\x4c\114\x20\106\122\x4f\115\40\141\162\164\x69\154\157\164\145\163\x20\127\x48\x45\x52\x45\x20\141\154\x6d\x61\x63\145\156\75\x27{$alm}\x27\x20\x26\x26\x20\x63\157\x64\x69\147\157\141\x72\x74\75\47{$cod}\47\x20\46\46\x20\x6c\157\164\145\75\47{$lot}\x27")->num_rows(); if ($vallot > 0) { $this->db->query("\125\x50\x44\101\x54\x45\40\141\x72\164\x69\x6c\157\x74\145\163\x20\163\145\164\x20\143\141\156\164\151\x64\141\x64\75\x63\141\156\x74\151\144\x61\x64\53\47{$cant}\x27\40\127\110\105\x52\105\40\141\154\x6d\141\x63\145\x6e\x3d\x27{$alm}\47\x20\46\x26\40\143\x6f\x64\x69\147\157\x61\162\164\75\47{$cod}\47\x20\x26\x26\x20\154\x6f\164\145\x3d\x27{$lot}\x27"); if ($this->db->affected_rows() > 0) { $v++; $this->loguser("\x41\x6a\x75\163\164\145\x20\111\x6e\166\145\156\x74\x61\162\151\x6f", "\x45\154\40\165\x73\165\141\x72\x69\157\x20\162\145\141\x6c\x69\172\x61\40\145\x6c\x20\160\162\157\143\145\x73\157\72" . $tip . "\x20\x70\141\162\141\40\141\154\x6d\x61\x63\145\156\72" . $alm . "\40\160\162\157\144\x75\143\164\x6f\x3a" . $cod . "\40\x6c\x6f\164\145\x3a" . $lot . "\x20\x65\154\141\142\x3a" . $elab . "\x20\x76\145\156\143\x65\72" . $venc . "\40\143\x61\x6e\x74\72" . $cant . ''); $this->db->query("\125\120\104\101\x54\105\x20\141\162\x74\x69\x63\x75\x6c\157\40\x73\x65\x74\40\145\170\151\x73\x74\145\156\x63\151\x61\75\145\170\151\163\164\x65\x6e\143\x69\141\53\47{$cant}\47\40\127\110\x45\x52\x45\40\x63\x6f\x64\151\147\157\75\47{$cod}\x27"); } } else { $lote = array("\x69\x64\x5f\x65\x6d\x70\x72\x65\163\141" => "\104\115\x45\x44\111\106", "\141\147\x65\156\x63\151\141" => "\x30\60\x31", "\x61\x6c\155\141\143\x65\156" => $alm, "\x63\x6f\144\151\x67\x6f\x61\x72\x74" => $cod, "\x6c\157\x74\x65" => $lot, "\x65\154\x61\142" => $elab, "\x76\x65\156\x63\145" => $venc, "\x63\x61\x6e\x74\151\x64\x61\144" => $cant, "\x72\145\x63\x65\160\143\151\157\156" => date("\x59\x2d\155\55\144")); $this->db->insert("\x61\x72\x74\151\x6c\157\x74\145\163", $lote); if ($this->db->affected_rows() > 0) { $v++; $this->loguser("\101\x6a\x75\x73\x74\145\x20\111\x6e\166\x65\x6e\x74\141\162\151\157", "\x45\154\40\165\x73\x75\141\x72\151\157\40\162\145\141\154\151\x7a\141\x20\x65\154\x20\160\162\x6f\143\x65\163\157\72" . $tip . "\40\x70\141\162\141\40\141\154\155\141\x63\x65\156\72" . $alm . "\x20\160\162\x6f\144\x75\x63\x74\x6f\72" . $cod . "\x20\x6c\157\x74\145\72" . $lot . "\40\x65\154\141\x62\72" . $elab . "\40\166\x65\156\x63\145\x3a" . $venc . "\40\143\x61\x6e\x74\72" . $cant . ''); $this->db->query("\125\120\104\101\124\105\x20\141\162\164\151\x63\165\154\x6f\40\x73\145\164\40\145\170\151\x73\164\145\x6e\x63\151\141\75\145\170\151\163\x74\145\x6e\143\x69\141\53\47{$cant}\x27\40\127\110\x45\x52\x45\x20\143\157\144\151\x67\157\75\x27{$cod}\47"); } } } } else { if ($tip == "\x30") { $vallot = $this->db->query("\123\x45\x4c\x45\x43\x54\x20\116\125\x4c\x4c\x20\106\122\117\115\40\141\162\164\x69\x6c\157\x74\x65\163\40\127\110\105\x52\105\x20\x61\154\x6d\141\x63\145\156\75\47{$alm}\47\40\46\x26\x20\143\157\x64\x69\147\x6f\141\162\x74\x3d\x27{$cod}\47\40\x26\46\x20\154\157\x74\x65\75\47{$lot}\47\40\46\x26\x20\x28\143\141\156\x74\x69\x64\141\144\55\143\x6f\x6e\163\165\155\x69\x64\157\51\x3e\75\x27{$cant}\x27")->num_rows(); if ($vallot > 0) { $ajusteinv = array("\x74\x69\x70\x6f" => $tip, "\x63\x6f\144\x69\147\157" => $cod, "\x6c\x6f\x74\x65" => $lot, "\144\x6c\157\x74\x65" => $lot, "\141\x6c\x6d" => $alm, "\x64\141\154\155" => $alm, "\143\141\156\x74" => $cant, "\146\x65\x63\150" => date("\131\55\155\55\x64")); $this->db->insert("\x61\x6a\x75\163\x74\x65\x69\x6e\x76", $ajusteinv); if ($this->db->affected_rows() > 0) { $this->db->query("\x55\120\104\101\124\x45\x20\141\x72\164\151\x6c\157\164\x65\163\x20\x73\145\x74\40\143\x61\x6e\x74\151\144\141\144\75\x63\x61\x6e\164\x69\144\141\144\55\47{$cant}\47\x20\127\x48\105\122\x45\x20\x61\154\155\141\x63\145\156\x3d\47{$alm}\47\40\46\46\40\143\157\x64\x69\x67\x6f\x61\x72\164\x3d\47{$cod}\47\x20\46\46\x20\x6c\x6f\x74\145\x3d\x27{$lot}\47"); if ($this->db->affected_rows() > 0) { $v++; $this->loguser("\x41\152\165\163\x74\145\x20\x49\156\x76\145\156\164\x61\x72\151\157", "\x45\x6c\40\165\x73\x75\x61\x72\x69\x6f\x20\162\x65\x61\154\x69\x7a\x61\40\x65\x6c\x20\160\162\157\x63\x65\163\x6f\x3a" . $tip . "\x20\x70\x61\x72\x61\x20\x61\x6c\155\141\143\145\x6e\x3a" . $alm . "\40\160\162\x6f\x64\x75\143\164\x6f\72" . $cod . "\40\x6c\157\164\145\x3a" . $lot . "\40\x65\154\141\x62\72" . $elab . "\40\166\x65\x6e\x63\145\x3a" . $venc . "\x20\143\x61\156\164\x3a" . $cant . ''); $this->db->query("\125\x50\104\x41\124\105\x20\141\162\164\151\x63\x75\154\x6f\x20\x73\145\164\40\x65\x78\x69\163\164\x65\156\143\x69\141\x3d\x65\x78\151\163\164\x65\156\143\151\141\55\47{$cant}\47\40\x57\x48\105\x52\x45\x20\x63\157\x64\x69\x67\157\75\x27{$cod}\x27"); } } } } } } return $v; } function limpiadrog($drog) { if ($drog == 1) { $this->db->query("\x54\122\x55\116\103\101\124\x45\x20\144\162\x6f\x63\145\x72\143\x61\73"); } if ($drog == 2) { $this->db->query("\124\122\125\x4e\103\x41\124\105\40\x6d\141\x73\x74\162\x61\156\x74\157\x3b"); } if ($drog == 3) { $this->db->query("\x54\x52\125\x4e\103\x41\x54\105\x20\163\x61\156\164\157\162\x65\155\145\144\x69\157\73"); } if ($drog == 4) { $this->db->query("\x54\122\125\116\103\101\124\x45\40\144\x72\x6f\x6c\141\156\x63\141\73"); } if ($drog == 5) { $this->db->query("\x54\x52\x55\116\x43\x41\x54\x45\40\x64\162\x6f\156\x65\156\x61\73"); } } function exceldrogueria($cod, $barr, $nom, $prc, $drog) { if ($cod != '' && $cod != null) { if ($drog == "\61") { $data = array("\x63\x6f\x64\151\147\157" => $cod, "\142\141\162\x72\141" => $barr, "\x6e\x6f\x6d\x62\162\x65" => $nom, "\x70\162\x65\x63\151\x6f" => $prc); $this->db->insert("\x64\x72\157\x63\x65\162\x63\141", $data); } if ($drog == "\62") { $tasa = $this->db->query("\123\x45\114\x45\103\x54\x20\157\x66\x69\143\x69\141\x6c\40\x6e\40\106\122\117\115\x20\155\157\x6e\x65\x63\141\155\x20\127\x48\x45\x52\145\40\x66\145\143\150\141\40\x49\116\40\x28\x53\105\114\x45\103\x54\40\115\x41\130\50\x46\x45\x43\110\101\x29\40\106\122\117\x4d\x20\x6d\x6f\x6e\x65\x63\141\155\x29")->row(); $precio = $prc * $tasa->n; $cod = $this->db->escape($cod); $nom = $this->db->escape($nom); $data = array("\x63\157\144\x69\147\157" => trim($cod, "\47"), "\142\x61\x72\x72\141" => $barr, "\156\157\155\142\x72\145" => trim($nom, "\x27"), "\160\162\145\x63\151\157" => $precio); $this->db->insert("\x6d\141\x73\x74\162\x61\156\164\x6f", $data); } if ($drog == "\63") { $cod = $this->db->escape($cod); $nom = $this->db->escape($nom); $data = array("\x63\x6f\144\x69\147\x6f" => trim($cod, "\47"), "\x62\141\162\162\141" => $barr, "\156\157\155\142\x72\x65" => trim($nom, "\x27"), "\x70\162\145\143\151\x6f" => $prc); $this->db->insert("\x73\x61\x6e\164\157\x72\145\155\x65\144\x69\x6f", $data); } } return $this->db->affected_rows(); } function inv_drocerca($data) { $this->db->insert("\x64\162\157\x63\145\x72\143\x61", $data); } function inv_drolanca($data) { $this->db->insert("\144\x72\x6f\154\141\x6e\143\x61", $data); } function inv_dronena($data) { $this->db->insert("\x64\x72\157\156\x65\156\x61", $data); } function generecpag($a) { $bd = $this->db->query("\123\x45\114\x45\103\124\x20\x61\x2e\x69\x64\x2c\141\x2e\x69\x64\146\141\x63\54\142\x2e\143\x6f\x64\x63\x6c\x69\145\x6e\x74\x65\54\142\x2e\x6e\x6f\x6d\142\x72\x65\143\154\151\54\x62\56\x72\151\x66\54\x62\56\x64\151\x72\x65\143\x63\x69\157\156\54\x20\x62\56\164\x65\154\x65\x66\x6f\x6e\x6f\163\54\x61\56\155\157\156\164\x6f\x2c\143\x2e\146\x65\143\150\144\x6f\154\x61\x72\x2c\142\x2e\166\145\x6e\x64\145\x64\x6f\x72\54\142\56\163\145\143\x74\157\162\54\142\x2e\x73\165\142\x63\x6f\144\151\147\157\54\xa\x20\x20\40\40\103\x4f\116\x43\101\x54\x28\142\x2e\164\x69\160\157\144\157\x63\54\x62\x2e\x64\157\143\165\x6d\x65\156\164\x6f\51\x20\162\145\x66\145\162\145\156\x63\x69\141\x2c\141\x2e\157\142\163\x65\x72\x76\x20\156\157\164\x61\163\x2c\x28\x53\105\114\x45\103\124\x20\157\146\x69\x63\151\141\x6c\40\x46\122\117\115\40\x6d\x6f\x6e\145\x63\x61\x6d\40\127\x48\x45\122\x45\x20\146\x65\143\150\141\74\75\141\x2e\146\x65\143\x68\x20\117\122\104\105\122\x20\x42\x59\x20\146\x65\143\150\141\40\104\105\123\103\x20\114\x49\115\x49\124\x20\61\51\40\x74\x61\x73\141\x20\106\x52\x4f\115\40\x6f\x70\145\x72\143\154\x69\x20\x61\40\xa\40\40\x20\40\112\x4f\111\116\40\x6f\160\x65\162\164\x69\40\x62\40\117\x4e\x20\141\56\151\x64\x66\141\x63\x3d\142\x2e\x64\x6f\x63\165\x6d\145\x6e\x74\x6f\x20\112\117\x49\116\x20\143\157\x6e\x74\x72\x6f\x6c\x5f\x6f\160\145\x72\x74\x69\40\143\x20\117\x4e\40\142\x2e\x61\x6e\164\x64\x6f\143\x3d\143\x2e\144\x6f\143\40\127\110\x45\x52\105\40\x62\56\x61\156\164\x64\x6f\143\75\47{$a}\x27\40\46\x26\x20\141\56\x69\144\x63\157\x6e\x73\142\141\x6e\143\x20\x49\123\x20\x4e\x4f\x54\x20\x4e\125\114\114\40\x26\x26\40\x61\x2e\x72\x65\143\x69\142\157\75\x30\40\x47\122\117\125\120\40\102\131\x20\x61\x2e\151\x64\54\x61\x2e\x69\144\146\x61\143\73")->result(); $user = $this->session->userdata("\143\157\x64"); foreach ($bd as $db) { $num = $this->db->query("\x53\x45\114\x45\x43\x54\40\x4d\101\x58\x28\x53\125\102\x53\x54\122\50\x64\157\143\x75\155\x65\156\x74\x6f\x2c\x32\54\70\x29\51\53\x31\40\156\x20\x46\122\117\x4d\x20\x6f\x70\x65\x72\x74\151\x20\x57\x48\105\122\105\x20\164\151\x70\157\x64\x6f\x63\x3d\x27\122\x45\103\47")->row(); $newdoc = str_pad($num->n, 7, "\x30", STR_PAD_LEFT); $recibo = array("\151\144\137\x65\x6d\160\162\x65\x73\x61" => "\104\115\105\104\x49\x46", "\x61\x67\145\156\x63\151\x61" => "\60\x30\x31", "\164\x69\x70\x6f\x64\157\143" => "\122\x45\103", "\x6d\157\x6e\x65\144\141" => "\60\60\x30", "\144\157\x63\165\155\x65\x6e\164\x6f" => "\x43" . $newdoc, "\x63\x6f\144\x63\154\x69\x65\156\x74\x65" => '' . $db->codcliente . '', "\156\x6f\155\x62\x72\x65\x63\x6c\x69" => '' . $db->nombrecli . '', "\143\157\x6e\164\x61\143\164\x6f" => "\116\x2f\101", "\162\x69\x66" => '' . $db->rif . '', "\x64\151\x72\x65\143\x63\x69\x6f\x6e" => '' . $db->direccion . '', "\x74\x65\154\x65\146\x6f\156\157\x73" => '' . $db->telefonos . '', "\164\x69\x70\x6f\x70\x72\145\x63\x69\x6f" => "\x31", "\x65\x6d\x69\163\151\157\x6e" => '' . date("\131\55\155\x2d\144") . '', "\x72\145\x63\145\160\x63\x69\157\x6e" => '' . date("\x59\55\x6d\x2d\x64") . '', "\x76\x65\156\x63\145" => '' . date("\x59\55\155\x2d\144") . '', "\146\145\x63\150\141\x63\x72\145\x61" => '' . date("\131\x2d\x6d\x2d\x64") . '', "\x74\157\164\143\157\163\x74\x6f" => 0, "\x74\157\x74\x62\162\165\x74\157" => $db->monto, "\164\157\x74\156\x65\x74\x6f" => $db->monto, "\164\157\x74\141\x6c\x66\x69\156\141\x6c" => $db->monto, "\164\x6f\164\x69\x6d\x70\x75\145\163\164" => "\60", "\164\157\164\x64\x65\163\143\165\x65\x6e" => 0, "\x69\155\160\165\x65\163\164\x6f\x31" => "\60", "\151\155\160\x75\145\x73\164\157\62" => "\60", "\144\163\x63\x74\157\x6c\x69\156\x65\x61" => 0, "\144\151\x61\163\x63\x72\145\144" => '', "\x76\x65\x6e\x64\x65\x64\x6f\x72" => '' . $db->vendedor . '', "\x66\x61\x63\164\157\x72\143\x61\x6d\142" => "\x31", "\165\x65\155\151\163\157\162" => $user, "\x65\163\x74\x61\143\151\157\156" => "\60\60\x31", "\x73\151\x6e\x69\x6d\x70\x75\145\x73\x74" => "\x30", "\x61\x6c\155\x61\x63\145\x6e" => "\x30\62", "\x73\145\x63\164\x6f\x72" => '' . $db->sector . '', "\163\165\x62\143\x6f\144\x69\147\x6f" => '' . $db->subcodigo . '', "\146\x6f\x72\x6d\141\146\151\x73" => "\61", "\141\154\137\154\151\142\162\157" => "\x31", "\144\142\143\x72" => "\x31", "\150\x6f\162\141\x64\x6f\143\165\155" => '' . date("\110\x3a\151\x3a\163") . '', "\x61\x6d\x70\x6d" => "\62", "\x65\x73\x63\x72\145\x64\151\164\x6f" => "\61", "\142\141\163\x65\151\155\x70\157\61" => "\60", "\x66\145\143\x68\141\171\x68\x6f\162\141" => '' . date("\131\55\x6d\x2d\144\x20\110\x3a\x69\72\x73") . '', "\151\x64\166\x61\x6c\151\144\141\143\151\x6f\x6e" => '', "\x64\157\x63\x75\x6d\x65\x6e\x74\157\146\151\x73\143\141\x6c" => "\60\40\x52\145\x63\x69\x62\151\x64\141", "\143\157\155\141\x6e\144\141\137\x6d\157\x76\x69\x6c" => "\60", "\143\x6f\155\141\x6e\144\141\137\x6b\x6d\157\x6e\151\x74\157\162" => "\x30", "\156\x6f\x74\151\x6d\x62\162\x61\162" => "\x31", "\141\156\164\151\160\157" => "\x46\x41\x43", "\x61\x6e\164\x64\157\x63" => $a, "\x72\x65\x66\x65\162\145\x6e\x63\x69\x61" => $db->referencia, "\x6e\157\164\x61\163" => $db->notas); $this->db->insert("\x6f\160\145\162\x74\151", $recibo); if ($this->db->affected_rows() > 0) { $totald = ROUND($db->monto / $db->tasa, 2); $this->db->query("\125\120\104\101\124\105\40\157\160\x65\x72\x74\151\x20\x53\x45\x54\40\164\x6f\x74\141\154\144\75\x27{$totald}\47\x20\x57\x48\105\122\x45\40\x64\157\143\165\155\x65\156\x74\157\x3d\47\x43" . $newdoc . "\x27\40\46\x26\40\164\x69\x70\x6f\x64\157\x63\75\47\122\105\103\x27"); $this->db->query("\125\x50\104\x41\124\x45\40\x6f\160\145\162\x63\154\x69\40\123\x45\x54\40\x72\145\x63\151\142\x6f\x3d\x31\40\x57\x48\105\122\105\40\151\x64\75\47{$db->id}\47\40\x26\46\40\151\x64\146\x61\x63\x3d\47{$db->idfac}\47"); } } } function regretfac($doc, $tip, $ord, $mont) { $val = $this->db->query("\x53\x45\114\105\103\x54\40\116\x55\114\114\x20\x46\122\x4f\x4d\40\x6f\x70\x65\162\164\151\x20\x62\40\127\x48\105\x52\x45\x20\x62\56\x72\145\146\145\x72\x65\156\143\151\x61\75\47" . $tip . $doc . "\47\40\46\46\x20\x62\56\x74\151\160\157\x64\x6f\143\x3d\x27\x52\105\x54\x27")->num_rows(); if ($val == 0) { $db = $this->db->query("\x53\x45\x4c\105\103\x54\40\142\56\x66\145\143\x68\x61\x63\162\145\141\x2c\142\56\143\x6f\x64\143\x6c\x69\145\156\x74\145\x2c\x62\56\x6e\x6f\155\x62\x72\145\143\154\151\x2c\142\x2e\x72\x69\146\x2c\x62\x2e\x64\151\162\x65\x63\x63\151\157\156\54\40\x62\56\x74\145\x6c\145\146\157\x6e\157\x73\x2c\x62\x2e\x76\x65\156\144\145\144\x6f\162\x2c\142\56\x73\x65\143\x74\x6f\162\x2c\x62\x2e\x73\x75\x62\x63\x6f\x64\x69\x67\x6f\54\x62\x2e\141\x6e\x74\x64\157\x63\x2c\xa\40\40\40\40\x43\117\x4e\x43\101\124\x28\x62\x2e\x74\x69\x70\x6f\x64\157\x63\54\x62\56\x64\157\143\x75\155\x65\156\164\157\51\40\162\x65\146\145\162\x65\156\143\x69\x61\x20\106\x52\117\x4d\40\x6f\x70\145\x72\164\x69\x20\142\40\x57\x48\x45\122\105\x20\142\56\144\157\143\x75\x6d\145\156\164\157\x3d\x27{$doc}\x27\40\46\46\x20\x62\56\x74\151\160\157\x64\x6f\x63\75\47{$tip}\x27")->row(); $num = $this->db->query("\123\x45\x4c\x45\x43\x54\x20\111\106\x28\x4d\101\130\x28\x64\157\143\x75\155\x65\156\x74\x6f\51\53\61\x3e\60\54\115\101\x58\x28\x64\157\143\x75\155\x65\x6e\x74\157\x29\53\61\x2c\x31\51\x20\156\40\106\122\117\x4d\x20\x6f\160\x65\x72\x74\151\40\x57\x48\x45\x52\x45\40\x74\151\160\157\x64\x6f\143\x3d\x27\x52\105\x54\x27")->row(); $newdoc = str_pad($num->n, 8, "\x30", STR_PAD_LEFT); $user = $this->session->userdata("\143\x6f\x64"); $ret = array("\151\x64\137\145\155\x70\162\145\x73\x61" => "\x44\115\105\104\x49\x46", "\x61\x67\x65\156\143\x69\141" => "\60\x30\61", "\164\x69\160\x6f\x64\157\x63" => "\x52\x45\x54", "\155\157\156\x65\144\x61" => "\x30\x30\x30", "\144\x6f\143\165\x6d\145\156\164\157" => $newdoc, "\x63\x6f\144\x63\154\151\x65\x6e\164\x65" => '' . $db->codcliente . '', "\x6e\x6f\x6d\x62\162\x65\x63\154\151" => '' . $db->nombrecli . '', "\x63\x6f\156\x74\141\x63\x74\157" => "\116\57\x41", "\162\151\146" => '' . $db->rif . '', "\144\151\x72\145\143\x63\x69\x6f\x6e" => '' . $db->direccion . '', "\x74\145\x6c\x65\x66\157\156\157\163" => '' . $db->telefonos . '', "\164\151\160\x6f\160\162\x65\143\x69\x6f" => "\61", "\145\155\x69\163\x69\157\156" => $db->fechacrea, "\162\145\143\x65\160\143\x69\157\156" => date("\131\55\155\x2d\x64"), "\x76\145\156\143\145" => date("\x59\55\x6d\55\144"), "\146\x65\x63\150\x61\x63\162\145\x61" => date("\131\55\155\55\144"), "\x74\157\x74\x63\157\x73\164\157" => 0, "\x74\157\164\x62\x72\165\x74\x6f" => $mont, "\164\x6f\x74\x6e\x65\164\x6f" => $mont, "\x74\157\x74\x61\x6c\x66\x69\x6e\x61\154" => $mont, "\x74\x6f\164\151\155\160\x75\x65\x73\x74" => "\x30", "\164\157\164\x64\x65\x73\x63\165\145\x6e" => 0, "\151\155\160\165\x65\x73\164\x6f\x31" => "\60", "\151\x6d\160\x75\x65\x73\x74\x6f\62" => "\x30", "\x64\x73\x63\164\157\154\151\x6e\x65\141" => 0, "\x64\151\141\x73\143\162\145\x64" => '', "\166\145\x6e\144\x65\x64\157\x72" => '' . $db->vendedor . '', "\x66\141\143\164\x6f\162\143\141\x6d\x62" => "\x31", "\x75\x65\x6d\x69\163\x6f\162" => $user, "\x65\163\x74\141\143\x69\157\156" => "\x30\60\61", "\x73\x69\x6e\151\155\160\165\145\x73\x74" => "\x30", "\x61\x6c\x6d\141\x63\x65\156" => "\60\62", "\x73\145\x63\x74\157\x72" => '' . $db->sector . '', "\x73\x75\x62\143\157\144\151\x67\157" => '' . $db->subcodigo . '', "\146\x6f\x72\x6d\141\146\x69\x73" => "\61", "\x61\154\x5f\x6c\x69\x62\162\x6f" => "\61", "\144\x62\x63\162" => "\61", "\150\157\162\141\144\157\143\x75\x6d" => '' . date("\110\x3a\151\72\163") . '', "\141\x6d\x70\155" => "\62", "\145\163\x63\162\x65\144\151\164\157" => "\61", "\x62\141\x73\x65\151\x6d\x70\x6f\x31" => "\60", "\146\145\x63\150\141\x79\150\157\x72\141" => '' . date("\x59\x2d\x6d\55\144\40\110\x3a\x69\72\163") . '', "\x69\144\x76\141\154\151\x64\x61\143\x69\157\156" => '', "\144\x6f\143\165\155\x65\x6e\164\157\x66\x69\x73\x63\x61\x6c" => "\60\x20\x52\x65\143\x69\142\x69\144\x61", "\x63\157\155\x61\x6e\144\141\x5f\155\157\x76\151\154" => "\x30", "\x63\x6f\155\x61\156\144\141\x5f\153\155\157\x6e\x69\164\157\162" => "\60", "\156\x6f\x74\x69\x6d\142\162\141\162" => "\61", "\141\156\x74\151\160\x6f" => "\106\101\x43", "\141\156\x74\144\157\x63" => $db->antdoc, "\162\145\x66\x65\162\145\x6e\143\x69\x61" => $db->referencia, "\157\x72\144\x65\x6e" => $ord); $this->db->insert("\157\160\145\x72\164\x69", $ret); $this->loguser("\122\145\164\145\x6e\x63\x69\x6f\156", "\105\x6c\40\x75\x73\x75\x61\162\x69\157\40\x72\x65\x67\x69\x73\164\x72\x61\x20\162\x65\164\145\x6e\x63\151\157\156\x20" . $newdoc . "\x20\160\157\162\x20" . $mont . "\40\x61\x6c\x20\x64\x6f\x63\165\155\145\156\164\157\40" . $doc . ''); return $this->db->affected_rows(); } } function retfac($cli, $fech) { $bd = $this->db->query("\x53\105\x4c\x45\x43\x54\40\52\x20\106\x52\117\115\x20\157\160\x65\x72\164\151\x20\127\x48\105\x52\105\x20\143\157\x64\143\154\151\145\156\164\x65\75\47{$cli}\47\40\x26\46\x20\x74\x69\x70\x6f\144\x6f\143\75\47\122\105\x54\x27\x20\46\46\x20\x66\x65\x63\x68\141\x63\x72\x65\x61\76\x3d\x27{$fech}\47")->result(); $html = "\74\x68\x74\x6d\x6c\76\x3c\x68\145\141\144\76\74\x6d\x65\164\141\40\x63\150\x61\162\x73\x65\164\75\x22\125\x54\106\x2d\x38\42\x3e\74\155\x65\164\x61\x20\150\x74\164\160\55\x65\x71\165\151\166\x3d\x22\130\55\x55\x41\55\103\x6f\155\160\141\164\x69\x62\154\x65\x22\40\x63\157\156\164\x65\x6e\164\x3d\x22\111\105\75\x65\x64\147\x65\x22\x3e\x3c\155\145\164\x61\40\x6e\x61\155\145\x3d\42\x76\151\x65\167\x70\157\162\164\x22\40\143\x6f\x6e\x74\x65\156\x74\x3d\x22\x77\x69\144\x74\x68\x3d\144\x65\x76\x69\x63\145\55\167\151\x64\x74\x68\x2c\40\x69\156\151\x74\151\x61\154\55\163\x63\x61\154\x65\x3d\x31\56\x30\42\x3e\74\x6c\151\156\153\x20\x72\145\x6c\x3d\42\163\x74\171\154\x65\163\x68\x65\145\x74\x22\40\150\162\x65\146\x3d\42\141\163\163\145\x74\x73\57\x63\163\163\57\167\x33\56\143\163\163\42\x3e\x3c\57\150\x65\x61\144\x3e\74\142\157\144\x79\76"; $i = 0; foreach ($bd as $db) { $i++; $j = $i / 2; if (is_int($j)) { $pag = "\167\x33\55\163\141\154\x74\157\x70\141\x67"; } else { $pag = ''; } $vend = $this->db->query("\x53\105\114\x45\103\x54\40\x62\56\156\x6f\155\142\x72\145\x20\x46\122\117\x4d\x20\157\x70\x65\162\x74\x69\40\x61\163\x20\x61\40\x4a\117\x49\116\x20\154\151\163\x74\x76\145\x6e\x64\x20\141\x73\x20\142\40\x4f\116\40\x61\x2e\x76\145\156\x64\x65\x64\157\162\75\142\56\x63\x6f\144\151\147\157\x20\127\110\105\122\105\40\141\56\144\x6f\x63\x75\155\145\156\164\157\x3d\47{$db->documento}\47\40\114\111\x4d\x49\x54\x20\x31")->row(); $html .= "\x3c\x64\x69\166\40\143\x6c\141\x73\163\x3d\x22\x77\x33\x2d\x63\x65\156\164\145\x72\40\x77\63\55\x74\151\156\171\x22\76\x3c\151\x6d\147\x20\163\162\x63\x3d\x22\x69\x6d\141\147\x65\163\57\150\145\141\144\145\162\56\x6a\160\x67\x22\40\x61\x6c\164\x3d\42\110\145\141\x64\145\162\x22\40\163\x74\x79\154\145\75\42\167\x69\144\x74\150\x3a\61\x30\60\x25\73\42\76\x3c\x2f\144\x69\x76\x3e\xa\40\x20\x20\x20\74\150\x33\40\x63\154\141\x73\163\x3d\x22\167\63\x2d\143\145\x6e\x74\x65\x72\42\76\103\157\x6d\x70\162\157\142\x61\156\164\x65\40\144\x65\x20\x52\x65\x74\145\156\x63\x69\157\156\72\x20" . $db->documento . "\74\x68\x33\76\xa\x20\x20\40\40\74\144\151\x76\x20\143\x6c\x61\x73\x73\x3d\x22\x77\63\x2d\143\145\x6e\x74\145\x72\40\x77\x33\x2d\164\151\x6e\171\40" . $pag . "\x22\x3e\12\x20\40\x20\x20\x3c\x74\x61\x62\154\x65\40\x63\x6c\x61\163\x73\x3d\x22\167\x33\55\x74\x61\x62\154\x65\55\141\154\154\40\x77\63\x2d\150\157\x76\x65\162\x61\142\154\145\42\76\x3c\164\x72\76\74\x74\150\76\110\145\155\157\163\x20\x72\x65\143\151\x62\151\144\157\x20\144\x65\x6c\x20\143\154\x69\145\x6e\x74\145\40" . $db->nombrecli . "\x20\x6c\141\x20\143\141\156\164\x69\144\141\x64\x20\x64\145\40" . ROUND($db->totalfinal, 2) . "\40\x42\x6f\154\151\x76\141\162\145\163\74\x2f\x74\150\x3e\x3c\57\164\x72\76\xa\x20\40\40\x20\x3c\164\162\40\x63\x6c\x61\163\x73\x3d\42\x22\x3e\74\x74\x68\76\117\162\x64\x65\156\40\162\x65\147\x69\163\x74\162\x61\144\141\x3a" . $db->orden . "\x3c\x2f\164\150\x3e\x3c\x2f\164\x72\76\xa\x20\40\40\x20\74\x2f\x74\x61\142\x6c\x65\76\x3c\142\x72\x3e\xa\40\x20\40\40\74\x74\141\x62\154\145\40\143\x6c\x61\x73\163\75\x22\167\63\55\164\141\142\x6c\145\x2d\x61\154\154\x20\167\x33\x2d\x68\157\x76\145\x72\x61\142\154\145\42\x3e\74\x74\162\x3e\74\x74\150\76\105\x6d\x69\x73\x69\157\156\74\57\164\x68\76\x3c\x74\x68\76\x54\151\x70\x6f\x3c\x2f\164\x68\76\x3c\x74\150\x3e\104\x6f\x63\x75\x6d\145\156\164\157\74\57\x74\x68\x3e\74\x74\150\76\x43\154\151\145\x6e\x74\x65\74\x2f\x74\x68\x3e\74\x74\x68\x3e\x4d\157\x6e\164\x6f\x20\x72\x65\164\x65\156\151\x64\x6f\x3c\x2f\164\150\x3e\x3c\x2f\164\x72\x3e\xa\x20\x20\x20\40\74\x74\x72\x3e\x3c\x74\144\76" . $db->fechacrea . "\x3c\57\164\x64\x3e\74\164\x64\40\143\x6f\154\x73\160\x61\x6e\x3d\42\62\42\x3e" . $db->referencia . "\74\57\164\144\x3e\x3c\164\x64\76" . $db->nombrecli . "\74\x2f\x74\144\76\74\164\x64\76" . ROUND($db->totalfinal, 2) . "\x3c\57\x74\144\x3e\x3c\57\164\x72\x3e\12\x20\x20\40\40\x3c\x2f\164\141\x62\154\145\76\x3c\x62\x72\76\xa\40\x20\40\x20\x3c\x74\x61\142\x6c\x65\40\143\154\141\x73\x73\x3d\42\167\63\55\x74\x61\142\154\145\x2d\141\x6c\154\x20\167\x33\55\150\x6f\166\x65\162\x61\x62\x6c\x65\42\76\x3c\164\x72\x3e\74\x74\150\76\x56\145\x6e\x64\145\x64\157\162\74\x2f\164\x68\76\74\164\x68\76\x46\151\x72\155\141\x3c\x2f\x74\150\76\x3c\57\164\162\76\xa\40\x20\x20\x20\x3c\x74\x72\76\74\x74\x64\x3e" . $vend->nombre . "\x3c\57\164\144\76\74\164\x64\76\137\x5f\x5f\137\137\137\x5f\137\x5f\137\137\137\x5f\x5f\x5f\137\x5f\137\137\137\x5f\137\137\137\137\137\137\137\x5f\x5f\x5f\137\137\x5f\x5f\137\137\137\137\137\x5f\137\137\x3c\x2f\164\x64\x3e\x3c\x2f\x74\x72\76\xa\40\x20\x20\x20\74\x2f\x74\141\142\x6c\x65\x3e\74\x62\162\76\x3c\142\x72\76\74\150\162\76\xa\x20\x20\x20\x20\74\x2f\x64\151\166\x3e\12\x20\x20\40\x20"; } $html .= "\12\x20\x20\40\x20\xa\40\40\40\40\74\x2f\x62\x6f\x64\171\x3e\12\x20\x20\40\x20\74\x2f\150\x74\x6d\x6c\76\xa"; return $html; } function regncfac($doc, $nc, $cli) { $val = $this->db->query("\123\105\x4c\x45\103\124\x20\116\x55\x4c\114\x20\106\122\117\115\40\157\160\145\162\x74\x69\40\127\110\x45\122\105\40\x64\x6f\143\165\155\x65\156\x74\x6f\75\x27{$nc}\47\40\46\46\40\x74\151\x70\157\x64\x6f\143\75\47\x4e\x2f\103\47\x20\x26\46\40\50\x61\x70\154\151\x63\x61\156\x63\x3d\x27\47\x20\174\x7c\x20\x61\160\154\151\143\x61\156\143\x20\x49\x53\40\x4e\x55\114\114\x29\40\x26\46\40\x65\x73\x74\141\164\165\163\144\157\143\41\x3d\x27\x58\47"); if ($val->num_rows() > 0) { $bdnc = $this->db->query("\x53\x45\x4c\105\103\124\40\164\157\x74\x61\154\144\x20\106\122\117\115\40\157\160\x65\x72\x74\x69\x20\x57\x48\x45\122\105\40\x64\x6f\143\165\x6d\x65\156\164\x6f\x3d\x27{$nc}\47\x20\46\46\x20\x74\x69\x70\157\144\157\143\x3d\47\x4e\x2f\x43\x27")->row(); $row = count($doc); $dolarnc = $bdnc->totald; $num = $this->db->query("\123\105\114\105\x43\124\x20\155\141\170\50\151\144\x29\40\156\40\x46\x52\x4f\x4d\x20\x61\160\x6c\x69\143\x61\x6e\143")->row(); $num = $num->n + 1; $j = 0; for ($i = 0; $i < $row; $i++) { if ($doc[$i] != '') { $fac = $this->db->query("\x53\x45\x4c\105\103\124\40\x64\157\x63\165\x6d\x65\x6e\164\157\x2c\164\x6f\164\141\x6c\x64\40\x46\122\x4f\x4d\40\x6f\160\x65\162\164\x69\x20\127\x48\105\x52\x45\x20\144\157\143\x75\x6d\145\156\x74\x6f\x3d\x27{$doc[$i]}\x27")->row(); if ($dolarnc > $fac->totald) { $j++; $dolarnc -= $fac->totald; $data = array("\151\144" => $num, "\156\143" => $nc, "\146\x61\x63" => $fac->documento, "\x63\154\x69\145\156\x74\x65" => $cli, "\164\x6f\164\141\154\144" => $fac->totald, "\x66\145\x63\150\x61" => date("\131\x2d\x6d\x2d\144\40\x48\72\151\72\163")); $this->db->insert("\x61\160\154\151\x63\x61\156\x63", $data); $this->loguser("\101\160\154\x69\143\x61\x20\116\57\x43", "\105\x6c\40\x75\x73\165\141\x72\151\157\40\x61\160\154\x69\x63\x61\40\x6e\157\164\141\x20\x64\x65\40\x63\162\x65\x64\151\164\x6f\40" . $nc . "\x20\x61\40\x64\157\143\x75\x6d\x65\x6e\164\x6f\40" . $doc[$i] . "\40\160\157\x72\x20" . $fac->totald . ''); } else { $j++; $data = array("\151\144" => $num, "\156\143" => $nc, "\x66\x61\x63" => $fac->documento, "\x63\154\151\x65\x6e\164\145" => $cli, "\x74\157\164\x61\154\144" => $dolarnc, "\146\x65\143\x68\141" => date("\x59\x2d\x6d\x2d\x64\40\110\72\x69\72\x73")); $this->db->insert("\141\x70\154\151\143\141\x6e\143", $data); $this->loguser("\x41\x70\154\x69\143\141\40\x4e\x2f\x43", "\x45\x6c\40\x75\163\165\141\162\x69\x6f\40\141\160\x6c\x69\143\141\x20\156\x6f\164\x61\40\x64\145\x20\143\x72\145\144\151\x74\x6f\40" . $nc . "\x20\x61\40\x64\x6f\143\165\155\x65\x6e\x74\157\x20" . $doc[$i] . "\40\160\x6f\162\40" . $dolarnc . ''); break 1; } } } if ($j > 0) { $this->db->query("\x55\x50\104\x41\x54\x45\40\x6f\160\x65\x72\x74\x69\40\x73\x65\164\x20\x61\160\154\x69\x63\141\156\x63\75\x27{$num}\47\54\164\x6f\x74\x61\154\144\75\x27{$bdnc->totald}\x27\40\127\x48\x45\122\x45\x20\x64\157\143\165\155\145\x6e\x74\157\75\47{$nc}\x27\x20\x26\46\40\164\x69\x70\x6f\144\x6f\143\75\47\x4e\x2f\103\47"); return 1; } } } function regfrecep($doc, $tip, $fech) { $bd = $this->db->query("\x53\105\x4c\x45\x43\124\40\144\151\141\163\x69\156\x64\x65\x78\40\144\151\x61\x73\40\106\122\117\x4d\x20\157\160\x65\162\x74\x69\x20\127\x48\x45\x52\105\40\x64\157\143\x75\155\x65\156\x74\157\x3d\47{$doc}\x27\x20\x26\x26\x20\164\x69\x70\157\144\157\x63\x3d\47{$tip}\x27\x3b")->row(); $bd2 = $this->db->query("\123\x45\x4c\105\103\x54\x20\x64\151\141\163\x63\x72\145\144\40\x64\151\x61\163\40\106\x52\x4f\x4d\x20\x6f\160\145\x72\164\x69\40\127\110\x45\122\x45\x20\x64\x6f\x63\165\155\145\x6e\x74\157\75\47{$doc}\x27\x20\46\46\40\164\151\x70\157\x64\x6f\143\x3d\x27{$tip}\47\73")->row(); $this->db->query("\125\x50\x44\x41\x54\105\x20\x6f\x70\x65\x72\164\151\40\x73\145\x74\40\162\145\x63\x65\160\143\x69\x6f\156\x3d\47{$fech}\x27\x2c\x76\145\156\x63\x65\x3d\x44\x41\124\x45\137\101\x44\x44\50\x27{$fech}\x27\x2c\111\116\x54\x45\x52\x56\101\114\x20\x27{$bd->dias}\x27\x20\104\x41\131\x29\x2c\x76\x65\156\143\145\143\75\x44\101\124\x45\x5f\101\104\x44\50\x27{$fech}\47\x2c\x49\x4e\x54\x45\122\x56\101\114\40\x27{$bd2->dias}\47\40\104\101\131\x29\x20\x20\x57\x48\x45\122\x45\40\144\x6f\143\x75\x6d\145\156\164\x6f\75\x27{$doc}\47\40\x26\46\x20\164\151\160\157\x64\157\x63\x3d\47{$tip}\47"); $this->loguser("\122\x65\143\x65\x70\143\x69\157\x6e", "\x45\154\x20\165\x73\165\141\162\x69\x6f\x20\162\145\x67\151\x73\x74\162\x61\x20\x66\x65\143\x68\141\40\x64\145\40\162\145\143\x65\160\x63\x69\157\x6e\x20" . $fech . "\40\160\x61\162\x61\x20\145\x6c\40\144\x6f\143\165\x6d\x65\156\164\x6f\72" . $doc . ''); return $this->db->affected_rows(); } function recpago($cli, $fech) { $bd = $this->db->query("\123\105\114\x45\x43\x54\x20\x2a\40\x46\x52\x4f\115\40\157\160\145\162\x74\x69\40\127\110\x45\122\105\x20\x63\157\144\x63\154\151\x65\x6e\x74\145\75\x27{$cli}\47\x20\x26\46\40\x74\x69\160\x6f\144\157\143\75\47\x52\x45\x43\47\40\x26\x26\40\x66\x65\x63\150\x61\x63\162\145\x61\76\75\47{$fech}\47")->result(); $html = "\x3c\x68\x74\x6d\x6c\x3e\74\x68\145\141\x64\x3e\x3c\x6d\x65\164\141\40\143\150\141\162\163\x65\164\x3d\42\125\x54\x46\55\x38\42\76\74\x6d\x65\x74\141\40\150\164\164\160\x2d\x65\161\x75\151\166\x3d\x22\x58\55\125\x41\55\x43\x6f\x6d\x70\141\x74\151\142\154\145\42\x20\143\157\x6e\x74\x65\156\164\75\x22\111\105\x3d\145\x64\147\x65\x22\76\74\155\x65\x74\x61\x20\x6e\x61\x6d\145\x3d\42\166\151\145\167\x70\x6f\162\x74\x22\x20\143\x6f\156\x74\145\x6e\164\75\42\x77\x69\x64\x74\150\75\144\145\166\x69\x63\x65\x2d\x77\x69\144\x74\x68\54\x20\151\x6e\x69\x74\x69\x61\154\x2d\163\x63\x61\154\145\x3d\x31\56\x30\x22\x3e\x3c\x6c\x69\156\x6b\40\x72\x65\x6c\75\42\163\164\x79\x6c\145\x73\x68\x65\145\x74\42\x20\x68\x72\145\x66\75\42\141\163\163\145\164\163\57\x63\163\x73\57\167\x33\56\143\x73\163\42\76\x3c\x2f\x68\145\x61\x64\76\74\x62\x6f\x64\x79\x3e"; $i = 0; foreach ($bd as $db) { $i++; $tasa = ROUND($db->totalfinal / $db->totald, 2); $j = $i / 2; if (is_int($j)) { $pag = "\167\x33\x2d\163\141\154\164\157\x70\x61\x67"; } else { $pag = ''; } $vend = $this->db->query("\x53\105\x4c\x45\x43\x54\x20\x62\56\156\157\x6d\142\162\145\40\106\x52\117\115\x20\x6f\x70\x65\162\x74\x69\x20\141\163\40\x61\40\x4a\x4f\x49\x4e\40\154\x69\x73\164\x76\x65\156\x64\40\141\x73\x20\142\x20\x4f\x4e\40\141\56\x76\x65\156\x64\x65\144\157\x72\75\142\x2e\143\157\x64\x69\x67\x6f\x20\127\x48\105\122\105\x20\141\x2e\x64\157\143\x75\x6d\145\x6e\164\157\x3d\47{$db->documento}\47\x20\114\x49\x4d\x49\124\40\61")->row(); $html .= "\x3c\144\x69\x76\40\143\154\141\163\163\75\x22\x77\63\x2d\143\x65\156\x74\145\x72\x20\x77\63\x2d\164\x69\x6e\171\x22\76\74\151\x6d\147\x20\163\162\143\x3d\x22\x69\x6d\141\147\x65\x73\57\150\x65\141\144\145\162\56\152\160\x67\42\40\x61\154\x74\75\x22\110\x65\x61\x64\x65\x72\42\x20\163\164\x79\154\145\x3d\42\x77\x69\x64\164\150\72\x31\60\60\45\x3b\x22\x3e\74\57\x64\151\x76\x3e\12\40\x20\x20\x20\x3c\150\x33\40\x63\x6c\141\x73\x73\x3d\42\167\63\x2d\143\145\x6e\x74\x65\x72\42\76\103\x6f\155\160\x72\157\142\x61\x6e\164\145\40\x64\145\40\x50\141\147\x6f\72\40" . $db->documento . "\74\x68\63\76\12\40\x20\x20\40\74\x64\151\x76\40\x63\154\x61\163\163\x3d\42\167\x33\55\x63\x65\x6e\x74\145\x72\x20\167\x33\55\164\x69\156\171\x20" . $pag . "\x22\76\xa\x20\40\40\40\74\x74\x61\142\154\145\x20\143\x6c\141\x73\x73\x3d\42\x77\63\x2d\164\x61\x62\154\145\55\x61\x6c\154\40\x77\x33\55\150\157\x76\145\x72\x61\142\154\x65\42\76\x3c\x74\x72\x3e\74\x74\150\76\x48\145\155\157\x73\x20\162\x65\x63\x69\x62\151\144\157\x20\x64\x65\154\x20\x63\154\151\x65\x6e\164\x65\40" . $db->nombrecli . "\x3a\40" . ROUND($db->totald, 2) . "\40\44\54\40" . ROUND($db->totalfinal) . "\x20\x42\123\x2c\x20\x42\x43\126\40" . $tasa . "\40\102\x73\74\57\164\150\x3e\x3c\57\164\162\x3e\12\40\40\x20\40\74\164\162\40\143\x6c\141\x73\163\x3d\x22\42\x3e\x3c\x74\150\x3e" . $db->notas . "\74\57\x74\x68\x3e\x3c\57\164\162\76\12\40\40\x20\x20\x3c\x2f\x74\141\142\154\145\x3e\x3c\x62\162\x3e\xa\40\40\40\40\x3c\x74\141\x62\154\145\x20\143\x6c\141\163\x73\x3d\42\167\63\55\x74\141\x62\154\x65\x2d\141\x6c\154\x20\167\x33\x2d\x68\x6f\x76\x65\162\141\142\154\145\x22\76\x3c\x74\x72\x3e\x3c\164\x68\x3e\105\x6d\x69\x73\x69\157\156\x3c\x2f\164\x68\x3e\74\164\150\76\x54\x69\160\157\74\57\164\x68\x3e\74\x74\150\x3e\104\x6f\143\x75\x6d\x65\x6e\164\x6f\74\x2f\x74\x68\x3e\x3c\x74\150\x3e\x43\x6c\x69\x65\x6e\x74\x65\x3c\57\x74\x68\76\74\164\x68\76\x4d\157\x6e\164\157\x20\x61\x62\x6f\156\141\144\x6f\x3c\x2f\x74\x68\76\74\x2f\x74\x72\x3e\xa\40\x20\x20\40\74\x74\x72\76\x3c\164\144\76" . $db->fechacrea . "\x3c\x2f\164\x64\x3e\x3c\x74\x64\40\143\157\x6c\x73\x70\x61\156\x3d\42\62\x22\76" . $db->referencia . "\74\57\x74\144\x3e\x3c\x74\x64\76" . $db->nombrecli . "\x3c\x2f\164\144\76\x3c\164\x64\x3e" . ROUND($db->totalfinal, 2) . "\x3c\x2f\x74\144\76\74\57\x74\x72\76\xa\x20\40\x20\40\74\57\x74\x61\142\154\x65\x3e\x3c\142\162\x3e\12\x20\x20\x20\40\x3c\x74\x61\142\154\145\40\143\154\x61\163\163\x3d\42\x77\63\x2d\x74\x61\x62\x6c\x65\x2d\141\x6c\154\40\x77\63\55\150\x6f\x76\x65\x72\x61\x62\154\x65\x22\76\74\x74\x72\76\74\x74\x68\76\x56\145\x6e\x64\145\144\157\x72\x3c\x2f\x74\150\x3e\74\164\150\76\x46\151\x72\x6d\x61\x3c\57\x74\150\76\x3c\x2f\x74\x72\x3e\12\x20\40\x20\40\x3c\x74\162\x3e\x3c\x74\x64\76" . $vend->nombre . "\x3c\x2f\x74\144\76\x3c\164\144\x3e\x5f\x5f\137\x5f\x5f\137\137\137\x5f\137\137\137\137\137\137\137\137\137\137\x5f\x5f\137\137\137\x5f\137\137\x5f\137\x5f\x5f\x5f\137\137\x5f\x5f\137\137\137\137\x5f\x5f\x5f\74\x2f\164\144\76\x3c\57\x74\162\x3e\12\x20\x20\x20\x20\74\57\x74\141\x62\154\145\76\74\x62\162\76\74\x62\162\x3e\74\150\162\76\12\40\40\x20\x20\74\x2f\144\x69\x76\76\xa\x20\x20\40\x20"; } $html .= "\xa\40\40\40\x20\12\x20\40\x20\40\74\57\x62\157\144\171\x3e\12\x20\x20\40\x20\74\x2f\150\x74\155\154\76\12"; return $html; } public function ordc($a, $b) { $this->load->library("\164\x61\x62\154\145"); if ($b != '') { $filter = "\127\110\x45\x52\105\40\x61\56\x69\144\75\x27{$b}\47\40\174\174\40\143\x2e\x6e\157\x6d\142\162\x65\40\154\x69\x6b\x65\x20\x27\45{$b}\x25\x27\40\x7c\174\40\x61\x2e\x6e\x70\162\145\163\x3d\47{$b}\x27\x20\174\174\40\141\56\x6e\x63\157\x6e\164\x72\157\154\x3d\47{$b}\x27\40\x7c\x7c\40\x62\56\143\157\x64\x69\147\x6f\75\47{$b}\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\114\105\x43\x54\x20\156\x75\154\x6c\12\x20\40\40\40\x20\x20\40\x46\122\x4f\x4d\40\x6f\x72\x64\x63\x20\x61\12\x20\40\x20\40\40\40\40\114\105\106\x54\40\112\117\111\x4e\x20\x69\164\x6f\162\144\143\x20\142\x20\117\116\x20\141\56\151\144\x3d\x62\56\157\x72\x64\x63\12\40\x20\40\40\40\x20\40\x4a\x4f\111\116\40\x70\x72\x6f\166\x65\x65\144\x20\x63\x20\117\116\x20\141\56\x70\x72\157\x76\x65\145\x64\x3d\143\x2e\151\144\x20" . $filter . "\12\40\x20\x20\40\x20\40\40\x47\122\117\125\x50\40\102\x59\x20\141\x2e\151\x64\40\117\x52\104\105\x52\x20\x42\x59\x20\141\56\140\151\144\x60\40\144\x65\163\143")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\114\x45\x43\x54\40\141\56\x69\x64\x2c\x63\56\156\157\x6d\x62\x72\x65\54\x61\x2e\x6e\x70\x72\145\163\54\141\56\x6e\x63\x6f\156\x74\x72\x6f\154\54\x61\56\146\145\x6d\x69\163\54\141\x2e\x66\x72\145\x63\145\160\x2c\123\x55\x4d\50\142\56\x63\x61\156\164\51\x20\165\x6e\x69\x64\54\x49\106\x28\141\56\x74\151\x70\x6f\160\141\147\x3d\60\54\x27\x43\157\x6e\x73\x69\x67\x6e\141\144\157\x27\x2c\111\x46\50\x61\x2e\x74\x69\x70\x6f\160\141\147\x3d\61\54\x27\103\157\x6e\164\x61\x64\x6f\47\54\47\116\x2f\x41\x27\51\51\40\164\151\160\157\160\141\147\54\141\56\140\x73\164\141\x74\165\163\140\54\x61\x2e\x61\154\x6d\141\143\x65\x6e\xa\40\x20\40\40\x46\x52\117\115\40\x6f\162\144\x63\x20\141\xa\x20\40\40\x20\x6c\145\146\x74\x20\x4a\x4f\x49\116\x20\x69\x74\157\162\144\143\40\142\x20\117\116\40\141\56\151\144\75\142\56\x6f\x72\144\x63\xa\x20\x20\40\x20\112\x4f\x49\116\x20\160\162\x6f\166\x65\145\144\40\143\40\x4f\x4e\x20\x61\56\160\x72\157\166\145\x65\x64\x3d\143\56\151\x64\40" . $filter . "\xa\40\40\x20\x20\x47\x52\117\125\120\40\102\x59\40\x61\56\x69\x64\x20\x4f\x52\104\105\x52\40\102\x59\x20\141\56\140\151\144\140\40\x44\x45\x53\x43\x20\x4c\111\115\x49\124\40" . ($a - 1) * $mostrar . "\x20\x2c\x20" . $mostrar . "\73")->result(); $html = "\12\x20\40\40\40\x3c\164\x61\142\154\145\x20\143\154\x61\x73\x73\75\42\167\63\x2d\x74\x61\x62\x6c\x65\x2d\141\x6c\x6c\x20\x77\63\x2d\150\157\x76\x65\162\x61\x62\x6c\x65\40\x77\x33\x2d\x6c\145\146\164\55\141\x6c\151\147\156\42\76\xa\40\40\40\40\x3c\164\x72\x3e\x3c\164\x64\40\x63\x6c\x61\x73\x73\75\42\x77\x33\55\146\157\156\144\x6f\144\162\157\x69\x64\x22\x3e\x42\x75\163\x63\x61\x72\x20\74\x69\155\147\x20\163\x72\143\x3d\42" . base_url() . "\151\x6d\x61\147\145\163\57\x62\x75\163\143\x61\x72\x2e\x70\x6e\147\x22\x20\x61\154\164\x3d\42\x42\165\x73\x63\x61\x72\42\x20\164\151\164\154\x65\75\x22\102\x75\163\x63\141\x72\x22\x20\163\164\x79\x6c\145\x3d\42\x77\151\x64\x74\150\x3a\x31\x38\160\x78\x3b\142\157\162\x64\x65\162\x3a\60\73\x22\76\x3c\57\164\144\76\12\40\40\40\40\74\x74\x64\x3e\x3c\x69\x6e\x70\165\164\40\x74\x79\160\x65\75\42\164\145\x78\x74\42\x20\143\x6c\141\163\x73\75\42\x77\x33\55\x69\156\160\x75\x74\42\40\160\154\x61\143\145\150\x6f\154\144\x65\x72\x3d\42\x49\156\147\162\145\x73\145\x20\163\165\40\x62\165\x73\161\x75\x65\x64\141\42\x20\157\x6e\143\x68\x61\156\x67\145\75\42\x6f\162\x64\143\50\51\42\40\151\144\x3d\x22\x6c\x69\x6b\145\157\162\144\143\x22\76\x3c\57\x74\144\76\12\40\x20\x20\x20\x3c\164\x64\x20\x63\x6c\x61\x73\163\75\x22\167\x33\55\143\145\x6e\x74\145\x72\40\x77\63\55\x62\164\x6e\42\76\74\x61\40\157\156\143\154\151\143\x6b\x3d\x22\167\63\x2e\x73\x68\157\167\50\x27\x23\146\x6f\162\155\157\162\144\143\47\x29\73\42\76\74\x69\x6d\147\x20\163\x72\143\x3d\x22" . base_url() . "\151\155\x61\x67\x65\x73\x2f\162\x65\147\x69\x73\x74\162\x61\162\x2e\160\156\147\42\40\x61\154\x74\75\42\x52\x65\x67\x69\163\164\162\x61\162\40\117\x72\144\x65\156\42\40\164\x69\164\x6c\x65\x3d\42\122\145\x67\x69\163\164\162\x61\162\40\x4f\x72\144\x65\156\x22\40\x73\x74\x79\x6c\145\x3d\42\x77\x69\144\x74\x68\x3a\62\60\160\170\73\x68\145\x69\x67\150\164\72\62\60\160\x78\x3b\x62\157\x72\x64\145\x72\72\60\x3b\42\x3e\x3c\x2f\x61\x3e\x3c\x2f\x74\144\76\xa\x20\x20\40\x20\74\x74\x64\40\143\154\141\x73\x73\75\42\167\x33\x2d\x63\145\x6e\x74\x65\x72\x20\167\x33\x2d\142\x74\156\x22\x3e\x20\74\x61\x20\x6f\x6e\143\154\151\143\x6b\x3d\42\167\63\x2e\163\150\x6f\x77\x28\x27\x23\x66\x6f\x72\x6d\x70\x72\157\x76\x27\x29\73\x22\x3e\74\151\x6d\147\x20\x73\162\143\x3d\x22" . base_url() . "\x69\x6d\141\147\145\x73\x2f\162\145\147\151\x73\x74\162\x61\x72\56\160\156\x67\x22\x20\x61\154\x74\x3d\x22\122\145\x67\x69\163\164\162\141\162\x20\x50\162\x6f\166\42\40\x74\x69\164\154\x65\75\x22\122\x65\x67\151\x73\x74\x72\141\162\40\120\x72\157\166\42\40\163\x74\x79\154\145\x3d\42\167\151\x64\164\x68\x3a\62\60\x70\x78\73\x68\145\x69\147\150\164\x3a\62\60\160\170\x3b\x62\157\x72\x64\145\x72\72\x30\x3b\x22\x3e\74\57\x61\x3e\x3c\57\164\144\x3e\12\40\40\x20\40\74\x74\x64\x20\x63\154\141\163\163\75\42\167\x33\x2d\x63\x65\156\x74\x65\x72\x20\x77\x33\55\142\x74\156\42\76\74\141\40\x6f\156\x63\x6c\x69\143\x6b\x3d\42\x70\144\x66\157\162\144\x65\156\x28\x29\73\x22\76\74\x69\155\x67\40\x73\162\x63\75\42" . base_url() . "\151\155\141\147\145\163\57\151\x6d\160\56\160\x6e\147\x22\x20\141\x6c\x74\x3d\x22\111\x6d\x70\162\151\155\151\x72\x20\117\162\x64\x65\156\x22\x20\x74\151\x74\154\x65\75\42\111\155\160\162\151\x6d\x69\x72\x20\x4f\x72\144\145\x6e\42\40\x73\x74\x79\x6c\145\75\42\167\x69\144\164\x68\x3a\x32\60\x70\x78\73\150\x65\151\x67\150\164\x3a\x32\60\x70\170\x3b\x62\157\162\x64\x65\162\72\60\73\x22\x3e\x3c\x2f\141\x3e\x3c\x2f\x74\x64\76\xa\40\x20\40\x20\x3c\164\x64\x20\x63\x6c\141\x73\163\x3d\42\x77\x33\55\143\x65\x6e\x74\145\162\x20\x77\63\55\142\164\x6e\x22\76\x3c\141\40\x6f\156\x63\154\151\x63\x6b\x3d\x22\145\144\151\x74\x6f\x72\144\143\x28\51\x3b\42\76\x3c\x69\x6d\x67\x20\163\162\x63\x3d\x22" . base_url() . "\x69\x6d\x61\147\145\163\57\x65\x64\x69\164\141\162\x2e\160\156\x67\42\40\x61\x6c\164\x3d\42\105\144\x69\164\x61\162\40\117\162\x64\145\156\42\40\164\x69\x74\154\x65\x3d\x22\x45\x64\151\x74\x61\x72\40\117\x72\x64\x65\156\x22\40\163\164\171\x6c\145\75\x22\x77\x69\x64\164\x68\x3a\62\60\160\x78\x3b\150\145\x69\x67\x68\x74\72\x32\60\x70\170\73\142\157\x72\x64\x65\x72\72\60\x3b\x22\76\74\x2f\x61\x3e\74\x2f\164\x64\76\12\40\x20\40\40\x3c\164\x64\40\143\154\x61\163\x73\x3d\x22\x77\x33\x2d\143\x65\x6e\164\145\x72\x20\x77\63\x2d\x62\x74\156\42\x3e\x3c\x61\x20\x6f\x6e\x63\x6c\151\143\x6b\75\42\157\x72\x64\x63\x28\x29\x3b\42\76\74\x69\x6d\x67\40\x73\162\143\75\42" . base_url() . "\151\155\x61\147\x65\163\57\162\x65\154\x6f\x61\144\56\160\156\147\42\x20\x61\x6c\164\75\42\122\x65\x63\x61\x72\x67\x61\162\42\40\x74\151\x74\154\x65\75\42\122\145\x63\141\x72\x67\x61\162\x22\x20\x73\164\x79\x6c\145\x3d\x22\x77\x69\144\x74\150\72\62\60\160\170\x3b\150\145\x69\147\x68\x74\x3a\62\x30\x70\x78\73\x62\x6f\162\x64\x65\162\x3a\60\x3b\x22\76\x3c\57\141\x3e\74\x2f\164\144\76\xa\x20\x20\x20\x20\74\164\144\40\x63\x6c\x61\163\x73\75\x22\x77\63\x2d\x63\x65\156\x74\145\x72\40\167\63\55\142\x74\x6e\42\x3e\x3c\x61\40\x6f\156\143\154\151\x63\x6b\75\x22\x65\x6c\151\x6d\157\x72\x64\x63\50\x29\x3b\42\x3e\74\151\x6d\x67\40\163\162\143\x3d\42" . base_url() . "\x69\155\141\x67\x65\163\57\142\x6f\162\x72\141\162\56\160\x6e\147\42\40\141\x6c\x74\75\x22\x45\154\151\155\x69\156\x61\162\42\40\x74\x69\x74\x6c\x65\75\x22\x45\154\x69\x6d\151\x6e\x61\x72\42\40\x73\x74\171\x6c\145\75\x22\167\x69\144\x74\150\72\62\60\x70\x78\x3b\150\x65\x69\x67\150\x74\x3a\x32\x30\x70\170\x3b\142\157\x72\144\x65\x72\72\x30\x3b\x22\76\74\57\141\x3e\74\x2f\x74\144\x3e\x3c\x2f\164\x72\76\xa\x20\x20\40\40\74\57\164\141\x62\154\x65\x3e\x3c\142\x72\76\12\40\40\40\x20\74\164\141\142\154\x65\x20\151\x64\75\x22\x69\144\60\x31\x22\40\143\x6c\141\x73\163\75\x22\167\x33\55\164\x61\x62\154\x65\x2d\x61\154\154\40\167\x33\55\150\x6f\x76\x65\x72\x61\142\154\x65\x20\167\x33\x2d\x6c\x65\146\x74\55\141\x6c\x69\x67\156\40\x77\x33\x2d\164\x69\156\x79\42\x3e\74\x74\x72\x20\x63\154\x61\163\x73\75\x22\167\63\x2d\x66\157\156\144\x6f\x64\162\x6f\151\144\42\76\74\x74\150\76\x4e\x2e\x4f\x72\x64\x65\156\x3c\x2f\164\150\x3e\74\164\150\76\x4e\x2e\104\157\x63\74\57\164\150\76\74\x74\150\x3e\x4e\x2e\x43\157\x6e\164\x72\157\x6c\x3c\x2f\164\150\76\x3c\164\x68\x3e\116\x6f\x6d\x62\x72\145\x3c\x2f\x74\x68\x3e\74\164\x68\76\105\x6d\x69\x73\x69\157\x6e\x3c\x2f\x74\150\76\74\x74\150\x3e\122\145\143\145\160\143\x69\x6f\156\74\57\x74\x68\x3e\74\x74\x68\76\x55\156\151\x64\x61\144\x65\163\74\x2f\x74\x68\76\74\164\150\76\x41\x6c\155\x61\x63\145\156\x3c\x2f\x74\150\76\x3c\x74\150\x3e\124\151\x70\157\74\57\164\150\x3e\74\x74\150\x3e\105\x73\164\x61\164\x75\x73\x3c\57\164\x68\76\74\x2f\x74\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\x74\x72\40\x69\x64\75\42\x73\154\145\143\164" . $i . "\42\40\x63\x6c\141\163\x73\75\42\x69\164\145\x6d\x22\40\x6f\156\x63\x6c\x69\x63\x6b\x3d\42\151\164\x6f\162\x64\143\x28\x24\50\47\x23\141" . $i . "\x27\x29\x2e\x76\141\x6c\50\51\x29\x3b\42\76"; if ($dtfac->status == "\x31") { $status = "\x4c\151\x73\x74\x6f"; $color = "\x77\x33\55\x67\x72\145\x65\156"; } elseif ($dtfac->status == "\x30") { $status = "\120\x65\156\144\x69\x65\x6e\x74\x65"; $color = "\167\63\55\x72\145\x64"; } $html .= "\74\x69\x6e\160\x75\164\40\164\171\x70\x65\x3d\42\150\x69\144\x64\x65\x6e\42\x20\151\x64\x3d\x22\141" . $i . "\42\x20\156\x61\x6d\145\x3d\42\x64\157\x63\42\40\x76\141\154\165\145\75\42" . $dtfac->id . "\x22\x3e\x3c\x69\x6e\x70\x75\x74\x20\164\171\160\145\75\42\150\x69\x64\x64\145\x6e\42\x20\x6e\x61\x6d\145\75\x22\163\164\141\x74\x75\163\x22\40\166\141\154\x75\145\75\x22" . $dtfac->status . "\x22\x3e\12\x20\x20\40\x20\x20\x20\x20\40\74\x69\156\x70\165\164\40\164\171\160\145\x3d\x22\x68\151\144\x64\x65\156\42\x20\156\141\x6d\x65\75\42\x6e\x63\157\x6e\x74\162\157\x6c\x22\x20\x76\141\154\165\x65\x3d\42" . $dtfac->ncontrol . "\x22\x3e\xa\x20\40\40\x20\x20\x20\x20\x20\x3c\164\x64\x3e\74\151\x6e\x70\165\x74\x20\164\171\160\x65\x3d\42\x63\150\x65\x63\153\x62\157\170\42\x20\157\x6e\143\x6c\x69\143\x6b\x3d\x22\167\63\56\164\x6f\x67\x67\154\x65\x43\x6c\141\x73\x73\50\47\43\163\154\x65\x63\164" . $i . "\x27\x2c\47\167\63\55\171\145\154\x6c\157\x77\47\x29\73\x22\40\x63\154\141\x73\x73\x3d\x22\167\63\55\x63\x68\x65\143\x6b\x22\x20\x6e\141\x6d\145\x3d\x22\143\x68\x65\x63\153\42\x3e" . $dtfac->id . "\x3c\57\164\x64\x3e\74\164\x64\76" . $dtfac->npres . "\74\x2f\164\x64\76\74\164\x64\76" . $dtfac->ncontrol . "\x3c\x2f\x74\144\76\74\x74\144\x3e" . $dtfac->nombre . "\74\57\x74\x64\76\74\164\144\x3e" . $dtfac->femis . "\x3c\57\164\x64\x3e\x3c\x74\x64\76" . $dtfac->frecep . "\x3c\x2f\164\x64\x3e\74\164\x64\76" . $dtfac->unid . "\74\57\x74\x64\76\x3c\164\144\76" . $dtfac->almacen . "\x3c\57\164\x64\x3e\74\x74\x64\76" . $dtfac->tipopag . "\74\57\x74\144\76\74\x74\x64\x20\143\154\x61\163\x73\x3d\x22" . $color . "\x20\167\x33\x2d\x63\145\156\x74\x65\x72\42\x3e" . $status . "\x3c\57\x74\x64\76\12\40\x20\x20\40\x20\40\40\x20\x3c\x2f\x74\162\76"; } $html .= "\x3c\164\162\76\x3c\164\x64\40\143\x6c\141\x73\163\75\x22\167\x33\55\x63\x65\x6e\x74\145\162\x20\x77\63\55\x66\157\x6e\144\x6f\144\x72\x6f\151\x64\42\40\x63\x6f\154\163\160\141\x6e\x3d\42\x31\63\42\76\x3c\x6c\141\142\145\154\x20\143\154\141\x73\163\75\x22\x77\63\x2d\154\x61\162\x67\x65\42\x3e\x3c\142\76\124\x6f\x74\141\154\40\117\x72\144\x65\156\145\x73\x3a\x20" . $totalreg . "\74\57\142\76\74\57\x6c\141\142\145\x6c\76\74\57\x74\144\x3e\74\x2f\164\162\x3e\x3c\x2f\164\x61\x62\x6c\145\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\40\40\x20\x20\40\40\74\x73\143\x72\151\160\164\x20\164\x79\x70\145\x3d\42\164\x65\170\x74\x2f\x6a\x61\x76\x61\163\x63\162\151\x70\164\x22\x3e\xa\x20\40\40\x20\x20\x20\x20\x20\x66\165\156\143\164\151\157\x6e\x20\104\145\x63\162\145\x6d\x65\156\164\x4e\x75\155\x28\x29\x7b\x20\x62\x65\146\157\x72\x65\50\51\73\xa\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\166\141\162\40\104\145\x63\x72\145\x6d\x65\x6e\x74\x4e\165\155\75\x64\157\x63\165\155\x65\156\164\x2e\147\145\164\x45\154\x65\155\145\156\164\x42\171\111\x64\x28\42\104\x65\143\x72\145\x6d\145\x6e\164\x4e\165\155\42\51\56\x76\141\x6c\x75\145\x3b\12\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\x76\x61\x72\x20\153\x65\x79\x3d\42\x64\x72\157\x69\144\x39\x30\63\x22\73\xa\x20\40\40\x20\40\40\40\40\40\40\x20\x20\166\141\x72\x20\x64\141\x74\x6f\163\40\x3d\40\x7b\xa\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\42\160\x61\x67\x22\x20\x3a\x20\104\145\x63\162\145\155\145\156\x74\x4e\165\155\x2c\12\40\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\42\x6b\x65\x79\x22\40\72\x20\153\145\x79\12\40\x20\40\x20\40\x20\40\40\40\40\40\40\40\x20\40\x7d\73\12\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\xa\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x24\x2e\x61\x6a\141\x78\x28\x7b\12\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\144\x61\x74\x61\72\40\144\x61\164\x6f\x73\x2c\12\40\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\165\x72\154\72\40\x20\x62\x61\x73\145\165\x72\x6c\53\42\x63\x5f\x64\162\157\x69\x64\x2f\157\x72\144\143\42\x2c\xa\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\x20\40\40\x20\x20\40\x74\x79\160\x65\x3a\40\42\120\x4f\123\x54\42\54\xa\40\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\40\40\40\x20\40\163\165\x63\143\145\x73\163\x3a\x20\x66\x75\156\x63\x74\151\x6f\156\50\144\141\164\141\x29\40\x7b\xa\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\44\50\42\43\142\157\x64\171\x22\51\x2e\x68\164\x6d\154\50\144\141\x74\141\x29\73\40\x20\x73\167\x61\154\x2e\143\154\157\163\x65\50\x29\x3b\12\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\40\175\xa\40\40\x20\40\40\x20\40\40\x20\40\x20\12\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\40\x20\x20\x7d\x29\x3b\12\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\x7d\xa\x20\x20\40\x20\40\40\x20\40\xa\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x66\x75\x6e\x63\x74\151\157\156\40\x6e\165\155\x70\x61\x67\x28\x61\x29\x7b\40\x62\x65\146\x6f\162\x65\x28\x29\73\xa\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\x76\x61\162\x20\153\x65\171\x3d\x22\144\x72\x6f\x69\144\x39\60\63\x22\73\xa\x20\40\40\40\40\x20\x20\40\xa\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\166\141\162\40\144\x61\x74\x6f\163\x20\75\x20\173\xa\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\40\42\x6b\x65\x79\42\72\153\x65\171\54\12\x20\x20\40\40\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x22\x70\141\x67\x22\40\x3a\40\141\xa\40\x20\x20\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\x7d\73\12\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\xa\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\44\56\x61\152\141\x78\50\173\12\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\144\141\x74\141\72\40\x64\x61\164\157\163\54\xa\40\x20\40\40\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\40\40\x75\162\154\72\40\x62\141\x73\145\165\162\154\53\42\143\x5f\144\162\x6f\x69\144\x2f\157\x72\x64\143\42\54\12\40\40\x20\40\40\x20\x20\x20\x20\40\x20\40\40\40\40\40\x20\40\x20\164\x79\160\145\x3a\x20\42\x50\117\123\x54\x22\54\xa\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\x73\165\143\143\145\x73\163\x3a\40\146\x75\x6e\143\164\x69\x6f\x6e\50\144\x61\x74\x61\x29\40\173\12\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x20\40\x20\40\40\x20\44\50\x22\x23\x62\157\144\171\x22\x29\x2e\150\x74\x6d\154\50\x64\x61\164\x61\51\x3b\40\40\x73\167\x61\154\x2e\x63\x6c\157\x73\145\x28\x29\x3b\12\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\175\12\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\xa\40\x20\40\40\40\40\40\40\40\x20\40\40\x20\40\40\175\x29\x3b\xa\x20\x20\x20\40\x20\40\40\x20\40\x20\40\175\12\x20\40\40\40\x20\40\x20\x20\xa\x20\40\40\40\40\x20\x20\x20\40\x20\40\x66\x75\156\143\164\151\157\156\40\111\156\143\x72\x69\x6d\145\156\x74\116\165\x6d\x28\x29\x7b\40\142\145\x66\157\x72\x65\50\51\x3b\xa\40\40\40\40\x20\40\x20\40\40\x20\40\x20\x76\x61\x72\40\111\156\143\162\151\x6d\x65\156\x74\x4e\x75\155\75\144\x6f\143\x75\x6d\x65\x6e\164\56\147\x65\x74\x45\154\x65\155\145\156\x74\102\171\111\144\50\x22\x49\x6e\143\162\151\x6d\x65\x6e\164\116\x75\155\x22\51\56\x76\x61\154\165\145\73\12\40\40\x20\40\40\x20\40\x20\40\x20\x20\40\166\141\162\40\x6b\x65\x79\x3d\x22\144\162\x6f\151\144\x39\x30\63\x22\x3b\12\x20\x20\40\x20\40\x20\x20\40\40\40\x20\40\166\x61\162\x20\144\x61\164\157\x73\x20\x3d\40\x7b\xa\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\40\x20\x22\153\145\x79\x22\72\x6b\145\171\x2c\12\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\40\42\x70\141\147\x22\40\x3a\x20\x49\x6e\143\162\151\x6d\x65\x6e\164\x4e\x75\155\12\40\40\40\x20\40\40\40\40\40\40\40\x20\x20\40\40\175\x3b\xa\x20\40\40\40\40\x20\40\x20\x20\x20\x20\12\x20\40\x20\40\40\40\x20\40\40\40\x20\40\40\x20\40\44\x2e\141\152\141\x78\x28\x7b\xa\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\144\x61\164\141\72\40\144\141\x74\157\x73\54\xa\x20\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x75\162\x6c\x3a\40\40\142\141\163\145\165\x72\x6c\53\42\x63\137\144\x72\157\x69\144\57\x6f\x72\144\x63\x22\54\12\40\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\x74\x79\x70\x65\x3a\40\42\120\117\x53\x54\42\x2c\12\x20\40\40\40\x20\x20\40\40\x20\40\40\40\40\x20\40\40\40\40\40\x73\x75\x63\x63\145\163\x73\x3a\40\146\165\x6e\143\x74\x69\x6f\x6e\50\x64\141\x74\141\x29\x20\x7b\12\40\40\x20\40\40\40\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\44\x28\42\43\142\157\x64\x79\42\x29\x2e\150\164\x6d\x6c\x28\144\x61\164\141\x29\73\40\40\x73\167\141\154\56\x63\154\x6f\163\x65\x28\51\73\12\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x7d\xa\x20\40\40\x20\x20\40\x20\40\40\40\x20\12\x20\x20\40\40\40\40\40\x20\x20\40\40\40\x20\40\40\175\x29\73\12\40\x20\40\x20\40\x20\40\x20\40\40\40\175\xa\40\40\x20\40\x20\x20\40\40\x3c\57\163\143\162\151\x70\164\x3e\12\40\40\x20\x20\x20\40\x20\40\74\144\151\x76\40\x63\154\141\163\x73\75\x22\x77\x33\55\142\141\x72\x20\167\x33\x2d\142\157\162\144\145\x72\x20\167\63\x2d\142\x61\162\162\x61\163\42\x3e\xa\40\40\x20\x20\40\40\x20\40\x3c\x69\156\160\165\164\40\x74\x79\160\x65\x3d\x22\150\x69\x64\144\145\x6e\x22\x20\x69\144\75\x22\104\145\143\162\x65\x6d\145\x6e\164\x4e\165\155\42\40\166\x61\154\165\x65\75\x22" . $DecrementNum . "\x22\x3e\12\x20\x20\40\x20\x20\40\x20\40\x3c\141\x20\157\x6e\x63\x6c\151\x63\153\75\x22\x44\145\x63\162\x65\x6d\145\156\x74\116\165\155\50\x29\x3b\x22\x20\143\x6c\141\163\x73\75\42\167\63\x2d\142\141\x72\55\x69\x74\145\x6d\x20\167\63\55\x62\165\x74\164\157\156\42\76\x26\154\x61\x71\x75\x6f\x3b\74\x2f\x61\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\x64\160\x61\x67\x69\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\63\55\146\157\156\x64\x6f\144\x72\157\x69\144"; $html .= "\xa\x20\x20\40\40\x20\40\x20\x20\74\151\156\x70\x75\x74\40\164\x79\x70\145\75\42\150\x69\x64\x64\x65\x6e\x22\40\x69\x64\75\x22" . $id . "\42\x20\166\141\x6c\165\x65\x3d\42" . $i . "\x22\76\12\40\x20\40\40\x20\x20\40\x20\74\141\x20\157\x6e\143\154\x69\143\x6b\x3d\42\x6e\x75\155\160\141\x67\50\x24\50\x27\x23" . $id . "\47\51\56\166\141\x6c\x28\51\51\73\42\40\143\154\141\163\163\75\42\167\x33\x2d\x62\141\162\55\x69\164\x65\155\40\x77\63\55\142\x75\x74\164\x6f\156\40" . $hover . "\42\x3e" . $i . "\x3c\57\141\x3e"; } else { $hover = ''; $html .= "\74\x69\x6e\160\x75\164\40\x74\x79\x70\x65\x3d\x22\150\151\144\x64\x65\x6e\42\40\151\x64\x3d\x22" . $id . "\42\x20\166\x61\154\x75\145\75\x22" . $i . "\42\x3e\12\40\x20\40\x20\x20\40\40\x20\74\x61\40\157\156\143\x6c\x69\143\x6b\75\x22\x6e\165\155\x70\141\x67\50\44\50\47\x23" . $id . "\x27\x29\56\166\x61\154\50\x29\x29\73\x22\x20\143\154\141\163\x73\75\x22\x77\63\x2d\x62\x61\x72\x2d\151\164\145\x6d\40\x77\63\x2d\142\x75\164\x74\x6f\x6e\40" . $hover . "\x22\76" . $i . "\x3c\x2f\x61\76"; } } } $html .= "\x3c\x69\x6e\160\x75\x74\x20\x74\171\160\x65\x3d\x22\x68\x69\144\144\x65\x6e\x22\x20\x69\x64\x3d\42\x49\156\x63\162\x69\x6d\x65\156\x74\x4e\x75\155\x22\x20\x76\141\154\x75\145\75\42" . $IncrimentNum . "\x22\x3e\xa\40\40\40\40\x20\40\x20\40\x3c\141\x20\x6f\156\143\x6c\x69\x63\153\x3d\42\x49\156\143\162\151\x6d\x65\x6e\x74\x4e\x75\155\50\x29\x3b\42\x20\x63\x6c\141\163\x73\x3d\42\167\63\55\142\x61\162\x2d\151\x74\145\x6d\x20\x77\63\55\142\x75\164\x74\x6f\156\x22\76\x26\162\141\161\165\x6f\x3b\x3c\57\141\x3e\xa\xa\x20\x20\40\40\x20\x20\x20\x20\74\57\x64\151\x76\x3e\x20"; return $html; } public function itordc($a) { $this->load->library("\x74\141\x62\154\145"); $bditfac = $this->db->query("\x53\105\114\x45\103\x54\40\141\x2e\143\157\x64\151\x67\x6f\54\x62\x2e\x6e\x6f\155\142\x72\145\54\141\x2e\x6c\x6f\164\145\54\x61\56\x65\x6c\141\142\54\x61\x2e\166\145\156\x63\145\x2c\x61\x2e\143\141\x6e\x74\54\141\x2e\x73\x63\x61\156\54\x61\x2e\143\x6f\x73\164\157\54\141\x2e\143\x6f\x73\164\x6f\162\145\146\54\141\56\x69\x76\141\54\x61\x2e\163\164\x61\164\x75\163\40\x46\122\x4f\115\40\151\164\157\x72\x64\x63\40\x61\x20\x4c\x45\x46\x54\x20\x4a\x4f\111\116\40\x61\x72\164\151\143\165\154\x6f\x20\x62\x20\x4f\116\x20\141\x2e\143\x6f\144\x69\147\157\75\142\56\x63\157\144\151\147\157\40\x57\x48\x45\x52\105\40\x6f\x72\x64\x63\75\x27{$a}\x27\x3b")->result(); $bdarti = $this->db->query("\123\105\x4c\105\103\x54\x20\141\56\143\x6f\144\x69\147\x6f\54\x62\56\x6e\157\155\142\x72\x65\x20\x46\x52\x4f\115\40\141\162\164\151\160\162\x6f\x76\x20\x61\12\x20\40\40\x20\112\x4f\x49\116\40\141\162\164\151\143\165\154\157\x20\142\x20\x4f\116\x20\x61\x2e\x63\x6f\144\x69\x67\157\x3d\x62\56\x63\157\x64\x69\x67\x6f\12\40\x20\x20\40\112\117\x49\116\40\160\162\x6f\x76\x65\145\x64\40\x63\40\x4f\116\x20\143\x2e\x63\x6f\x64\x69\147\x6f\x3d\x61\x2e\160\162\x6f\166\145\x65\144\157\x72\12\40\40\40\40\112\117\111\116\x20\x6f\162\x64\143\40\144\x20\x4f\116\x20\x64\x2e\x70\x72\157\x76\145\145\x64\75\143\x2e\x69\144\40\127\110\105\x52\105\40\144\56\x69\x64\75\x27{$a}\47\12\40\x20\40\40\x4f\x52\104\x45\122\40\x42\x59\40\x62\x2e\156\157\155\142\162\x65\40\x41\x53\103")->result(); $alm = $this->db->query("\x53\x45\114\x45\103\x54\x20\141\x6c\155\x61\x63\x65\156\x20\x6e\x20\106\x52\117\115\40\x6f\162\x64\143\x20\x57\x48\105\x52\x65\40\151\x64\75\x27{$a}\x27")->row(); $art = "\x3c\x69\156\160\x75\164\40\x74\171\x70\x65\x3d\42\x74\x65\170\164\x22\40\x63\x6c\141\163\x73\x3d\42\167\63\x2d\x69\156\160\165\x74\42\x20\x69\x64\x3d\42\143\157\144\x69\x67\157\42\40\154\151\163\164\x3d\x22\154\151\x73\x74\141\162\x74\151\x22\40\160\x6c\x61\143\145\150\157\154\x64\x65\162\x3d\42\x50\162\157\x64\x75\143\164\157\56\56\x2e\42\76\74\144\141\164\x61\154\x69\x73\x74\x20\151\144\x3d\42\x6c\x69\x73\164\141\162\x74\151\x22\76"; foreach ($bdarti as $dbarti) { $art .= "\x3c\x6f\160\164\x69\157\x6e\x20\166\141\154\x75\145\75\x22" . $dbarti->codigo . "\x22\x3e" . $dbarti->nombre . "\x3c\x2f\157\x70\164\x69\157\156\76"; } $art .= "\74\x2f\x64\141\164\141\154\x69\x73\164\76"; $val = $this->db->query("\123\x45\x4c\105\x43\x54\40\x73\164\x61\x74\x75\163\x20\x46\x52\117\115\40\x6f\x72\144\x63\40\x77\150\145\162\x65\40\x69\x64\x3d\47{$a}\47")->row(); if ($val->status == 0) { $btnscan = "\x3c\41\x2d\55\x3c\x69\x6e\160\165\164\x20\x74\x79\x70\x65\x3d\42\163\x75\x62\155\x69\164\x22\x20\143\x6c\141\163\x73\x3d\x22\167\63\x2d\x62\x74\156\40\x77\63\x2d\x67\x72\145\145\156\40\x77\63\55\142\157\162\x64\x65\x72\40\x77\63\55\x68\x6f\166\x65\x72\55\x77\x68\x69\x74\x65\x22\40\166\x61\154\165\x65\75\42\x53\x43\x41\116\42\40\x6f\x6e\x63\154\151\143\153\75\42\x77\x33\56\x68\x69\x64\x65\50\x27\43\x73\x63\141\156\x31\47\51\73\x77\63\56\x73\150\157\167\x28\47\43\x73\x63\141\156\x27\x29\73\42\76\55\x2d\41\76\x3c\151\x6e\x70\x75\164\40\164\x79\x70\145\75\42\163\165\142\155\151\164\42\x20\x63\154\x61\163\163\75\42\167\63\x2d\142\x74\x6e\x20\x77\x33\55\164\x65\141\x6c\40\167\x33\x2d\142\157\162\144\x65\162\40\167\63\55\150\157\166\145\x72\x2d\x77\150\x69\164\145\x22\40\x76\x61\x6c\x75\x65\75\42\x47\165\x61\x72\x64\x61\x72\x22\x20\x6f\x6e\143\154\x69\143\x6b\75\42\166\141\x6c\x6f\162\144\x63\163\x63\x61\156\50\47" . $a . "\x27\51\x3b\x2f\52\x77\63\x2e\150\x69\x64\145\x28\47\x23\x73\x63\141\x6e\47\x29\73\57\x2a\167\x33\x2e\150\151\x64\x65\50\47\43\163\x63\x61\x6e\47\x29\73\x77\x33\x2e\163\150\157\167\x28\x27\43\x73\143\141\156\x31\x27\x29\73\52\x2f\x22\76"; $formreg = "\x3c\164\x72\76\x3c\151\x6e\160\x75\164\x20\x74\171\x70\x65\75\42\150\x69\144\144\145\x6e\42\x20\151\x64\75\x22\157\162\x64\143\42\x20\166\x61\154\165\x65\x3d\42" . $a . "\42\76\74\164\144\x3e" . $art . "\74\57\164\144\x3e\74\164\x64\x3e\x3c\151\156\160\x75\164\x20\x74\171\x70\x65\75\x22\164\x65\170\164\42\40\143\x6c\x61\x73\x73\x3d\x22\x77\x33\x2d\x69\156\x70\165\x74\42\40\x69\144\x3d\42\x6c\x6f\164\x65\42\x20\x70\x6c\x61\x63\145\x68\x6f\x6c\144\145\162\x3d\42\x4c\x6f\x74\x65\56\x2e\x2e\x22\76\74\57\x74\x64\76\74\164\144\76\x3c\151\156\160\165\x74\40\x74\x79\160\145\x3d\42\x64\141\164\145\x22\x20\143\154\141\x73\163\x3d\42\167\x33\x2d\x69\x6e\160\165\164\x22\x20\151\144\x3d\42\145\x6c\141\142\x22\x3e\74\x2f\x74\x64\x3e\xa\x20\x20\x20\x20\x3c\x74\144\76\x3c\151\x6e\160\165\164\40\x74\x79\160\x65\x3d\x22\144\x61\164\x65\x22\x20\143\154\x61\x73\163\75\x22\x77\x33\x2d\151\156\160\x75\164\x22\x20\151\x64\75\42\x76\145\156\143\x65\x22\76\74\x2f\x74\x64\x3e\x3c\x74\x64\x3e\x3c\151\156\160\165\164\x20\x74\x79\x70\145\x3d\x22\x74\x65\170\x74\x22\x20\x63\154\x61\x73\163\x3d\42\167\63\55\151\156\x70\x75\164\x22\40\x69\144\75\x22\143\x61\x6e\164\x22\x20\160\154\141\x63\x65\x68\157\x6c\144\145\x72\x3d\x22\x6e\x22\40\163\x74\x79\x6c\x65\x3d\42\167\x69\144\164\x68\x3a\63\60\160\170\73\42\x3e\74\57\164\144\76\12\40\x20\x20\40\74\164\144\76\116\x2f\x41\x3c\57\x74\144\x3e\x3c\x74\144\x3e\x3c\151\156\160\165\164\x20\164\x79\160\145\75\42\156\165\x6d\142\145\162\42\x20\x63\154\x61\x73\163\x3d\x22\167\63\55\x69\x6e\160\x75\x74\42\x20\x69\x64\x3d\42\151\166\141\42\40\x70\x6c\x61\x63\145\150\157\154\144\x65\162\75\x22\156\x22\40\163\164\171\154\145\x3d\42\x77\151\144\164\x68\72\65\60\160\x78\x3b\x22\76\74\57\x74\144\x3e\74\x74\x64\x3e\x3c\151\x6e\160\x75\164\40\x74\x79\160\x65\75\42\x74\145\x78\164\42\40\143\x6c\141\x73\x73\75\42\x77\63\55\151\156\x70\165\x74\x22\40\151\144\x3d\42\143\x6f\163\164\x6f\x22\40\160\x6c\141\143\145\150\x6f\154\x64\145\x72\x3d\x22\156\42\x20\163\164\x79\x6c\145\75\42\167\151\x64\x74\150\x3a\x35\x30\160\x78\73\x22\76\74\57\x74\x64\76\x3c\x74\x64\76\116\x2f\101\74\57\164\x64\76\xa\40\x20\40\x20\x3c\x74\144\40\x63\154\x61\163\x73\75\42\x77\x33\x2d\x62\164\x6e\x22\76\x3c\141\x20\157\156\143\x6c\x69\x63\x6b\75\x22\x72\x65\x67\151\164\157\x72\144\143\50\51\73\x22\76\x3c\151\155\x67\x20\163\x72\143\75\42" . base_url() . "\151\x6d\x61\x67\x65\x73\57\x72\x65\147\x69\x73\x74\x72\141\x72\56\160\x6e\x67\42\x20\141\x6c\x74\x3d\42\122\x65\147\x69\x73\x74\162\141\x72\40\111\164\145\155\42\40\164\x69\x74\154\x65\75\42\x52\145\147\151\163\164\162\141\162\x20\x49\164\x65\155\x22\40\x73\164\x79\x6c\145\75\42\x77\x69\144\x74\150\x3a\62\60\160\x78\73\x68\x65\151\x67\150\x74\72\x32\60\160\170\73\x62\x6f\x72\x64\x65\x72\x3a\60\73\x22\x3e\x3c\x2f\141\x3e\74\57\x74\144\76\x3c\x2f\164\162\x3e"; } else { $btnscan = ''; $formreg = "\x3c\x69\x6e\160\165\x74\x20\x74\x79\x70\x65\75\42\150\x69\144\x64\145\156\42\40\x69\144\x3d\42\157\162\144\x63\42\x20\x76\141\154\x75\x65\75\x22" . $a . "\42\76\x3c\151\x6e\160\165\x74\x20\x74\171\x70\145\x3d\42\150\x69\x64\144\145\156\42\x20\151\x64\75\42\141\154\x6d\42\x20\x76\x61\154\165\145\x3d\42" . $alm->n . "\42\x3e"; } $subtotal = 0; $excento = 0; $baseimp = 0; $totimpuest = 0; $iva = 0; $total = 0; $tasa = $this->db->query("\123\105\x4c\105\103\x54\x20\50\123\105\114\105\x43\x54\40\157\146\151\143\x69\141\x6c\x20\106\122\117\x4d\x20\x6d\157\x6e\x65\143\x61\x6d\40\x57\x48\x45\x52\x45\x20\x66\145\x63\x68\x61\x3c\75\141\x2e\146\x65\155\151\163\x20\x4f\x52\x44\105\122\40\102\x59\40\146\x65\x63\150\x61\40\x44\x45\x53\103\x20\x4c\111\x4d\x49\124\x20\x31\x29\x20\157\x66\x69\x63\151\141\154\x20\x46\122\x4f\115\x20\x6f\162\144\143\x20\141\40\127\x48\105\x52\105\40\141\56\151\144\x3d\x27{$a}\47")->row()->oficial; $html = "\12\x20\x20\40\40\74\x61\x20\x6f\x6e\143\154\151\x63\153\75\x22\162\145\147\x61\x72\x74\x69\x5f\x6f\x72\144\143\50\51\73\x22\76\x3c\151\x6d\147\x20\163\162\x63\x3d\x22" . base_url() . "\x69\x6d\141\x67\145\x73\57\x72\145\147\x69\x73\x74\x72\141\x72\x2e\x70\156\x67\x22\40\x61\154\164\x3d\42\122\x65\147\151\x73\x74\x72\141\x72\x20\x41\x72\164\x69\x63\165\x6c\x6f\x22\x20\164\x69\164\x6c\145\x3d\42\x52\145\x67\x69\163\164\x72\141\x72\x20\x41\x72\164\151\143\165\x6c\157\42\40\x73\164\171\x6c\145\75\x22\167\151\144\x74\150\x3a\62\x30\160\170\x3b\x68\x65\x69\x67\x68\x74\x3a\x32\60\x70\170\73\142\x6f\162\x64\145\162\72\60\x3b\x22\x3e\x3c\x2f\141\x3e\12\40\x20\x20\x20\x3c\x74\x61\x62\154\145\40\x63\x6c\x61\163\x73\x3d\42\x77\x33\x2d\164\141\142\154\x65\x2d\141\154\x6c\x20\x77\63\55\150\157\x76\x65\x72\x61\x62\x6c\x65\40\x77\x33\x2d\154\x65\x66\x74\55\141\x6c\151\147\156\x20\167\x33\x2d\164\x69\x6e\171\x22\x3e\x3c\164\x72\40\143\154\x61\x73\163\75\x22\167\x33\55\x66\157\x6e\x64\x6f\144\162\157\x69\144\42\76\x3c\164\x68\x3e\120\162\x6f\x64\165\143\x74\157\x3c\57\x74\150\x3e\x3c\x74\150\x3e\114\x6f\164\x65\74\x2f\x74\150\76\74\164\150\76\105\154\x61\142\74\57\x74\150\x3e\74\x74\150\x3e\x56\145\156\143\145\74\57\164\x68\x3e\74\x74\x68\76\103\141\156\164\x69\144\x61\x64\x3c\57\x74\150\76\74\164\150\x3e\x53\x63\x61\156\x3c\57\164\x68\76\74\x74\150\x3e\x49\126\x41\74\57\x74\x68\76\x3c\x74\150\x3e\x43\x6f\163\164\x6f\x3c\57\x74\150\76\x3c\x74\x68\x3e\x45\163\164\141\164\x75\163\74\x2f\x74\x68\76\74\164\x68\x3e\74\x2f\164\x68\x3e\74\x2f\164\162\76"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->iva > 0) { $iva = $dtitfac->costoref * 0.16 * $dtitfac->cant; $totimpuest += $iva; $baseimp += $dtitfac->costoref * $dtitfac->cant; } else { $excento += $dtitfac->costoref * $dtitfac->cant; } if ($val->status == 0) { $status = "\x50\145\x6e\144\151\x65\156\x74\x65"; $color = "\x77\63\x2d\162\x65\144"; $elim = "\74\141\40\x6f\x6e\143\x6c\x69\x63\x6b\75\x22\145\154\x69\x6d\x69\x74\157\162\x64\x63\x28\x27" . $a . "\x27\54\47" . $dtitfac->codigo . "\x27\51\x3b\x22\x3e\74\x69\x6d\x67\x20\x73\x72\143\75\x22" . base_url() . "\151\155\141\147\x65\163\x2f\x62\x6f\162\162\x61\162\x2e\x70\156\147\x22\40\141\x6c\x74\75\x22\x45\154\x69\155\x69\156\141\162\x22\x20\164\151\x74\154\x65\x3d\42\105\154\x69\x6d\151\x6e\x61\162\x22\x20\x73\x74\171\154\x65\x3d\x22\167\x69\144\x74\150\72\62\x30\160\x78\73\x68\x65\151\x67\150\164\72\x32\x30\160\x78\73\142\x6f\x72\144\145\162\x3a\x30\x3b\42\x3e\74\x2f\x61\x3e"; $editprod = ''; } elseif ($val->status == 1) { $status = "\x4c\151\x73\x74\157"; $color = "\x77\63\x2d\147\162\145\x65\156"; $elim = ''; $editprod = ''; } $html .= "\74\x74\162\x20\157\x6e\144\142\154\x63\x6c\x69\143\153\x3d\42\145\144\151\x74\151\x74\x6f\x72\x64\143\50\x27" . $dtitfac->codigo . "\x27\54\47" . $dtitfac->lote . "\x27\54\x27" . $dtitfac->status . "\47\x29\73\x22\x3e\12\x20\x20\x20\x20\x20\x20\x20\x20\74\164\x64\76" . $dtitfac->codigo . "\x20" . $dtitfac->nombre . "\x3c\x2f\164\144\76\x3c\x74\144\76" . $dtitfac->lote . "\74\x2f\164\x64\x3e\74\x74\x64\76" . $dtitfac->elab . "\x3c\x2f\164\144\x3e\74\x74\x64\x3e" . $dtitfac->vence . "\x3c\57\x74\144\76\74\164\x64\x3e" . $dtitfac->cant . "\x3c\x2f\164\144\76\x3c\x74\144\x3e" . $dtitfac->scan . "\x3c\x2f\x74\144\x3e\74\x74\x64\76" . $dtitfac->iva . "\74\x2f\x74\144\76\x3c\164\x64\x3e" . $dtitfac->costo . "\74\x2f\164\x64\76\xa\40\x20\x20\40\x20\x20\x20\40\x3c\164\144\x20\143\154\141\163\163\x3d\x22" . $color . "\x20\167\x33\55\x63\145\x6e\x74\x65\162\42\x3e" . $status . "\x3c\x2f\164\144\76\74\x74\x64\76" . $elim . "\x3c\57\x74\x64\x3e\12\x20\x20\40\40\x20\40\40\40\x3c\x2f\x74\162\x3e"; } $subtotal = ROUND($excento + $baseimp, 2); $total = ROUND($subtotal + $totimpuest, 2); $excento_bs = ROUND($excento * $tasa, 2); $baseimp_bs = ROUND($baseimp * $tasa, 2); $totimpuest_bs = ROUND($totimpuest * $tasa, 2); $subtotal_bs = ROUND($excento_bs + $baseimp_bs, 2); $total_bs = ROUND($subtotal_bs + $totimpuest_bs, 2); $html .= '' . $formreg . "\x3c\57\x74\x61\x62\154\x65\x3e\x3c\x62\162\x3e\74\142\162\76\xa\40\x20\40\x20\x3c\x74\x61\142\x6c\145\40\x63\x6c\141\163\163\75\42\167\x33\x2d\164\141\x62\154\145\x2d\141\x6c\x6c\x20\167\x33\x2d\x68\157\x76\x65\x72\x61\142\154\145\40\x77\63\55\154\145\146\164\55\141\154\x69\x67\156\40\x77\63\x2d\163\x6d\x61\154\x6c\x22\x3e\x3c\164\162\x3e\x3c\x74\x64\x20\143\x6c\x61\163\x73\x3d\42\x77\63\x2d\x66\x6f\156\x64\157\x64\x72\157\151\x64\x22\76\x53\165\x62\164\157\164\141\x6c\74\57\x74\144\76\74\164\x64\76" . $subtotal_bs . "\102\163\x20" . $subtotal . "\x24\x3c\57\x74\144\x3e\74\x74\x64\x20\143\x6c\141\x73\163\75\42\x77\x33\55\x66\157\156\144\x6f\x64\x72\x6f\x69\x64\x22\76\115\157\156\x74\157\40\x45\170\143\x65\156\x74\157\x3c\x2f\164\x64\76\74\164\x64\x3e" . $excento_bs . "\102\163\40" . $excento . "\44\x3c\57\x74\144\76\x3c\x74\x64\40\143\154\x61\163\163\x3d\42\x77\x33\55\x66\157\156\144\157\144\x72\157\151\x64\42\76\102\141\x73\x65\40\151\x6d\x70\157\156\151\142\154\x65\74\x2f\164\144\76\74\164\x64\76" . $baseimp_bs . "\102\x73\40" . $baseimp . "\44\74\57\164\144\76\74\164\144\x20\x63\x6c\x61\x73\x73\75\42\x77\x33\x2d\146\x6f\x6e\x64\157\x64\x72\x6f\151\x64\42\76\x54\x6f\x74\x61\154\40\x49\x6d\x70\165\145\163\x74\157\74\x2f\x74\144\x3e\x3c\x74\144\x3e" . $totimpuest_bs . "\x42\163\x20" . $totimpuest . "\44\74\57\x74\144\76\x3c\164\x64\x20\143\x6c\x61\x73\x73\x3d\42\167\x33\55\146\x6f\156\144\157\x64\x72\157\x69\x64\x22\76\124\157\164\141\x6c\x3c\57\x74\144\x3e\x3c\164\144\76" . $total_bs . "\x42\x73\x20" . $total . "\44\x3c\57\x74\x64\76\74\x2f\x74\162\x3e\x3c\57\164\x61\142\x6c\145\76\x3c\x62\x72\x3e\x3c\x62\x72\76\12\40\x20\40\x20\x3c\x64\x69\x76\x20\163\x74\x79\154\145\75\x22\144\151\163\x70\x6c\141\x79\x3a\x6e\x6f\156\x65\x22\x20\x69\x64\75\x22\163\143\141\156\42\x20\143\154\x61\x73\x73\x3d\x22\167\x33\x2d\143\145\x6e\164\x65\162\42\76\x3c\164\x61\142\154\145\40\143\x6c\x61\163\163\75\x22\167\63\55\x74\141\142\x6c\145\x2d\x61\154\x6c\x20\x77\63\x2d\x68\157\x76\x65\x72\x61\x62\x6c\x65\x22\76\74\x74\x72\x3e\x3c\x74\x64\40\x63\154\x61\x73\x73\x3d\x22\167\x33\55\146\157\x6e\x64\157\x64\162\157\x69\x64\x22\x3e\x4c\157\x74\x65\x3a\x3c\x2f\x74\144\76\74\164\144\76\74\x69\156\160\x75\164\x20\164\171\160\x65\75\42\164\x65\170\x74\x22\x20\x63\154\141\x73\163\75\x22\167\63\x2d\x69\x6e\160\165\164\42\40\x69\x64\75\42\x6c\x6f\x74\157\x72\x64\x63\42\x20\x70\154\x61\143\145\x68\x6f\x6c\144\x65\x72\75\x22\x6c\x6f\164\x65\x2e\56\x2e\42\x20\x73\164\x79\x6c\x65\75\x22\167\151\144\x74\150\x3a\x35\x30\160\170\73\42\x3e\x3c\57\x74\x64\x3e\xa\40\x20\40\40\74\x74\144\40\x63\154\141\x73\x73\75\x22\167\63\55\x66\157\156\x64\x6f\144\162\x6f\x69\x64\42\x3e\102\x61\x72\162\141\x73\72\74\57\x74\x64\x3e\x3c\x74\x64\x3e\x3c\x69\156\160\x75\164\x20\164\x79\x70\x65\75\42\164\145\x78\164\42\x20\x63\154\x61\163\163\75\x22\167\63\x2d\x69\156\x70\x75\164\x22\x20\160\x6c\x61\x63\145\x68\x6f\x6c\x64\x65\162\75\x22\103\157\144\151\147\157\x20\142\141\x72\x72\141\x73\x2e\56\56\x22\40\151\x64\75\x22\143\157\x64\x73\143\141\x6e\42\x20\x6f\x6e\x63\x68\141\x6e\147\x65\x3d\42\157\x72\x64\143\163\143\x61\x6e\x28\51\73\42\76\74\57\164\144\76\74\57\164\162\76\x3c\57\x74\x61\142\154\x65\x3e\x3c\57\144\151\166\76\12\40\x20\x20\x20\x3c\x64\x69\x76\40\163\x74\171\154\x65\75\x22\x64\x69\163\x70\154\141\x79\72\156\157\x6e\x65\42\40\151\x64\x3d\x22\x73\x63\141\x6e\61\42\x20\x63\x6c\x61\x73\163\x3d\42\167\63\x2d\143\x65\x6e\x74\x65\x72\42\x3e\x3c\x74\141\142\x6c\145\40\x63\x6c\141\x73\x73\75\x22\x77\63\55\164\141\142\x6c\145\x2d\141\x6c\x6c\x20\x77\63\55\150\x6f\x76\145\162\141\142\x6c\145\x22\76\x3c\164\162\x3e\74\x74\144\x20\x63\x6c\141\163\163\75\42\x77\x33\55\146\157\x6e\x64\x6f\x64\x72\x6f\151\x64\42\x3e\114\x6f\x74\145\x3a\74\x2f\x74\x64\76\74\164\144\76\x3c\151\x6e\x70\165\x74\x20\x74\x79\x70\x65\75\42\x74\x65\x78\164\42\40\x63\x6c\x61\163\x73\75\x22\x77\x33\55\151\x6e\160\165\x74\x22\40\151\x64\x3d\x22\x6c\157\164\x6f\x72\144\x63\62\x22\x20\160\154\x61\143\x65\x68\x6f\154\x64\145\x72\75\42\154\157\164\145\x2e\x2e\56\42\40\x73\x74\x79\154\145\x3d\42\167\151\x64\x74\150\x3a\x35\60\160\x78\73\x22\76\74\x2f\164\144\76\12\x20\40\x20\40\x3c\164\x64\x20\x63\154\x61\x73\163\75\42\167\63\55\x66\x6f\x6e\x64\x6f\144\162\x6f\x69\144\x22\x3e\103\141\156\164\x3a\x3c\57\164\x64\x3e\x3c\164\x64\76\x3c\151\x6e\160\165\x74\40\164\171\x70\x65\75\42\x74\x65\170\164\42\40\x63\x6c\x61\163\163\75\x22\x77\x33\x2d\151\x6e\x70\165\164\42\x20\x69\x64\x3d\x22\x63\141\156\x74\157\x72\x64\x63\x22\x20\160\154\141\143\x65\x68\x6f\154\x64\145\x72\x3d\42\156\x22\x20\x73\164\x79\154\x65\75\42\167\x69\x64\x74\150\x3a\x33\x30\160\x78\x3b\x22\76\x3c\57\x74\x64\76\12\40\x20\40\40\x3c\x74\x64\40\x63\154\141\163\x73\75\42\167\x33\55\x66\x6f\x6e\x64\157\144\x72\x6f\x69\144\42\76\x42\x61\162\x72\x61\163\x3a\x3c\x2f\164\x64\76\74\x74\144\x3e\x3c\x69\x6e\x70\165\x74\x20\x74\171\160\145\75\x22\x74\x65\x78\x74\x22\40\x63\x6c\x61\163\x73\75\x22\167\x33\55\x69\156\160\x75\164\x22\40\160\154\x61\143\x65\150\157\x6c\x64\145\x72\x3d\x22\x43\x6f\x64\x69\x67\x6f\40\142\x61\x72\x72\141\163\56\56\x2e\42\x20\151\144\75\42\x63\157\144\163\x63\141\156\x31\42\x20\157\x6e\143\x68\141\x6e\147\145\x3d\x22\x6f\162\144\143\163\143\x61\x6e\61\x28\x29\73\42\76\74\57\x74\x64\x3e\x3c\x2f\164\162\76\74\x2f\164\x61\142\x6c\145\76\74\57\x64\151\x76\x3e\x3c\142\x72\x3e\x3c\x62\x72\76\xa\40\40\x20\x20\xa\40\40\x20\x20" . $btnscan . ''; return $html; } public function retencion_compras($a, $b) { $this->load->library("\164\x61\x62\x6c\x65"); $prov = $this->db->query("\123\105\114\x45\103\x54\40\x69\x64\x20\106\122\117\x4d\x20\160\162\157\166\x65\x65\x64\40\x57\x48\x45\x52\105\x20\156\157\155\142\x72\145\x20\x6c\151\153\145\40\47\x25{$b}\45\40\x27")->row()->id; if ($b != '') { $filter = "\x26\46\40\x70\162\x6f\166\145\x65\x64\75\47{$prov}\x27\40\174\x7c\x20\156\162\145\x74\75\47{$b}\x27"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\x45\114\x45\103\x54\40\156\x75\x6c\x6c\xa\x20\x20\40\x20\40\x20\x20\106\122\x4f\x4d\x20\143\157\155\160\162\141\x73\x20\x57\110\105\x52\x45\x20\164\151\160\x6f\144\157\143\x3d\x27\122\x45\124\47\40\46\46\x20\162\145\164\151\x65\x6e\x65\x3e\x30\x20{$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\x45\114\105\103\124\x20\141\56\x66\x65\143\x68\x61\144\x6f\143\x20\x66\145\x63\x68\x61\x2c\x61\56\x64\x6f\143\165\x6d\x65\x6e\164\157\x2c\141\56\162\x65\x66\145\162\x65\x6e\143\x69\x61\54\50\x53\x45\x4c\x45\x43\x54\x20\x72\151\146\40\x46\x52\117\115\40\160\x72\x6f\x76\x65\x65\144\40\x57\x48\105\x52\105\40\151\144\75\141\56\160\x72\157\166\145\x65\x64\51\x20\162\x69\146\x2c\40\x28\x53\105\x4c\x45\103\x54\40\x6e\x6f\155\x62\162\145\x20\x46\122\x4f\115\40\x70\x72\x6f\166\145\x65\144\40\x57\x48\105\122\x45\40\151\144\x3d\141\x2e\x70\162\157\x76\145\145\144\x29\40\156\157\155\142\162\x65\54\40\x43\x4f\x4e\103\x41\x54\50\141\56\x61\x6c\x69\x63\x72\145\x74\x2c\x27\x20\45\x27\x29\40\141\x6c\151\143\x75\x6f\x74\141\x2c\x20\xa\x20\40\40\x20\141\x2e\x72\x65\x74\x69\145\x6e\145\x20\x6d\x6f\156\164\157\54\40\x61\x2e\x6e\162\145\164\54\x20\x61\x2e\164\151\x70\157\162\x65\164\xa\x20\x20\x20\40\40\x46\122\x4f\x4d\x20\143\x6f\155\160\x72\141\163\x20\141\x20\x57\110\105\x52\x45\40\x74\x69\x70\x6f\144\x6f\x63\x3d\47\122\x45\x54\47\40\46\46\x20\162\x65\164\x69\x65\x6e\145\76\60\40{$filter}\40\117\122\x44\x45\x52\40\x42\131\x20\x61\56\x6e\162\145\164\x20\x44\105\123\103\40\x4c\111\115\x49\124\40" . ($a - 1) * $mostrar . "\x20\54\x20" . $mostrar . "\73")->result(); $html = "\xa\x20\x20\x20\40\74\164\141\142\x6c\x65\40\143\x6c\141\163\x73\75\42\x77\x33\x2d\164\x61\x62\x6c\x65\x2d\x61\154\154\40\x77\63\55\150\x6f\166\x65\x72\x61\142\154\x65\40\167\63\55\x6c\x65\146\164\55\141\x6c\x69\x67\x6e\42\x3e\xa\x20\40\x20\40\x3c\164\162\76\74\164\144\40\143\154\141\x73\x73\75\x22\x77\63\x2d\x66\157\x6e\144\x6f\x64\x72\x6f\151\x64\42\x3e\x42\165\x73\143\x61\x72\40\x3c\151\155\x67\40\x73\162\143\75\42" . base_url() . "\151\x6d\141\147\x65\x73\x2f\142\165\x73\143\141\x72\56\160\156\x67\x22\x20\x61\x6c\164\75\42\102\165\163\143\x61\x72\x22\40\164\x69\164\x6c\145\x3d\42\x42\x75\163\x63\141\x72\42\x20\x73\x74\x79\154\x65\75\x22\167\151\144\x74\x68\x3a\61\x38\160\170\73\142\157\x72\x64\x65\x72\72\60\x3b\42\76\74\x2f\x74\x64\x3e\xa\x20\x20\40\x20\74\164\144\76\x3c\x69\x6e\x70\x75\x74\40\164\x79\x70\x65\75\42\164\145\170\x74\42\x20\x63\x6c\x61\x73\x73\x3d\x22\x77\x33\55\x69\x6e\x70\x75\x74\x22\x20\x70\x6c\x61\143\145\x68\157\x6c\144\145\162\x3d\42\x49\156\147\x72\145\163\145\40\163\165\x20\142\x75\163\x71\165\x65\x64\x61\42\x20\157\x6e\x63\150\x61\156\147\145\x3d\x22\162\x65\x74\x65\156\143\151\x6f\x6e\137\143\x6f\x6d\160\162\141\163\x28\x29\42\x20\151\144\75\x22\154\x69\x6b\x65\x22\x3e\74\x2f\164\144\76\12\40\x20\40\x20\74\164\x64\40\143\154\x61\163\x73\75\x22\x77\x33\55\x63\x65\x6e\x74\145\x72\x20\x77\x33\x2d\142\164\156\x22\x3e\x3c\x61\x20\157\156\x63\154\151\143\x6b\x3d\x22\167\63\56\x73\150\x6f\x77\50\47\x23\146\x6f\x72\155\162\x65\x74\143\157\x6d\160\x27\x29\x3b\x22\x3e\x3c\151\x6d\147\x20\163\x72\x63\x3d\42" . base_url() . "\151\155\x61\147\x65\x73\57\162\x65\147\151\x73\164\x72\141\162\56\x70\156\147\42\x20\141\154\164\75\x22\122\x65\147\151\163\164\162\141\162\40\x4f\x72\x64\x65\x6e\x22\40\164\151\x74\x6c\x65\75\x22\x52\x65\x67\x69\x73\164\162\x61\162\x20\117\162\x64\145\156\42\x20\163\x74\x79\154\x65\x3d\x22\167\151\x64\x74\x68\72\x32\x30\160\170\73\x68\x65\x69\x67\x68\164\x3a\62\60\x70\x78\x3b\x62\157\x72\x64\x65\x72\72\x30\x3b\42\x3e\74\x2f\141\76\74\x2f\164\144\76\12\x20\40\40\40\x3c\x74\144\40\x63\x6c\x61\163\x73\x3d\x22\x77\63\x2d\143\145\x6e\164\x65\162\40\x77\x33\55\142\x74\x6e\42\76\74\x61\40\x6f\x6e\x63\x6c\151\x63\x6b\75\42\x72\145\x74\x65\x6e\x63\x69\157\x6e\x5f\x63\157\155\160\162\x61\x73\x28\x29\73\42\x3e\74\151\155\147\40\163\x72\x63\x3d\42" . base_url() . "\151\155\141\147\145\x73\57\162\x65\154\157\x61\144\x2e\x70\156\x67\42\x20\x61\x6c\164\75\x22\x52\145\x63\141\x72\x67\141\x72\42\40\164\151\x74\x6c\145\75\42\x52\145\x63\141\x72\147\141\x72\42\40\x73\x74\171\154\145\75\42\167\x69\144\164\x68\72\62\60\x70\x78\73\150\x65\151\147\x68\164\x3a\x32\60\x70\170\x3b\x62\157\x72\x64\145\162\72\60\x3b\42\x3e\74\x2f\x61\x3e\x3c\57\x74\144\x3e\xa\40\40\x20\x20\74\x74\x64\x20\143\154\x61\163\x73\75\42\x77\x33\x2d\x63\x65\x6e\x74\x65\162\40\x77\63\55\142\164\156\42\76\x3c\141\40\157\156\x63\154\x69\143\153\x3d\x22\145\170\160\x6f\162\x74\145\x78\x63\145\154\x72\x65\x74\x65\156\x63\151\x6f\x6e\145\163\x63\157\x6d\160\50\x29\73\42\76\74\x69\x6d\147\40\x73\x72\143\x3d\x22" . base_url() . "\x69\x6d\x61\147\x65\x73\x2f\170\x6c\163\56\x70\156\x67\x22\x20\141\x6c\164\x3d\42\105\x78\x70\157\162\x74\40\x4c\151\x73\164\42\x20\x74\151\164\x6c\145\75\x22\x45\170\x70\157\x72\164\40\x4c\x69\163\x74\x22\40\x73\x74\171\154\x65\x3d\42\167\x69\x64\x74\x68\72\62\x30\160\170\x3b\x68\145\x69\147\150\x74\72\62\x30\160\x78\73\142\157\162\144\145\x72\x3a\60\73\x22\x3e\x3c\x2f\x61\76\x3c\x2f\164\144\x3e\74\x2f\x74\x72\x3e\xa\x20\40\x20\x20\x3c\57\164\x61\142\154\145\x3e\x3c\x62\162\x3e\12\x20\40\x20\40\x3c\164\x61\142\x6c\145\x20\x69\x64\x3d\x22\151\144\x30\61\x22\x20\x63\154\141\163\x73\x3d\42\167\x33\55\x74\x61\x62\x6c\145\55\x61\x6c\154\x20\167\63\x2d\x68\157\166\x65\x72\x61\142\x6c\145\40\x77\63\x2d\x6c\145\146\x74\x2d\x61\154\151\147\x6e\40\x77\x33\x2d\164\151\156\171\x22\x3e\x3c\x74\162\40\143\154\141\163\163\x3d\x22\x77\63\55\146\x6f\x6e\144\157\144\162\157\151\144\x22\76\x3c\x74\x68\76\x46\145\143\150\x61\74\x2f\x74\x68\76\x3c\x74\150\x3e\x54\x69\160\x6f\74\57\164\x68\76\74\x74\x68\x3e\x44\157\143\x75\155\145\156\164\x6f\x3c\57\x74\150\x3e\x3c\x74\x68\76\101\146\x65\143\x74\x61\74\57\x74\x68\76\74\x74\x68\76\116\56\x43\x6f\x6d\x70\x72\x6f\x62\141\x6e\164\x65\74\57\164\x68\x3e\74\164\x68\76\x52\x69\x66\74\x2f\164\x68\76\12\40\40\x20\40\74\164\150\x3e\x6e\157\x6d\142\162\x65\74\57\x74\x68\x3e\74\x74\x68\x3e\101\154\x69\143\165\157\x74\x61\x3c\x2f\x74\150\76\x3c\x74\150\x3e\x4d\157\x6e\x74\157\74\x2f\x74\150\76\74\x74\150\x3e\x3c\x2f\164\x68\x3e\x3c\x2f\x74\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\164\x72\x20\151\x64\75\42\163\x6c\145\x63\x74" . $i . "\42\x20\x63\154\141\x73\x73\x3d\42\151\x74\145\x6d\x22\76"; $html .= "\x3c\x69\x6e\160\165\164\x20\164\x79\160\x65\75\42\x68\x69\x64\x64\x65\156\x22\40\151\144\x3d\x22\141" . $i . "\x22\40\x6e\141\x6d\x65\x3d\x22\x64\x6f\x63\x22\x20\x76\141\x6c\165\x65\x3d\x22" . $dtfac->nret . "\42\x3e\xa\40\40\x20\40\x20\40\x20\40\x3c\x74\x64\76\74\41\x2d\x2d\x3c\151\x6e\160\x75\x74\40\x74\x79\x70\145\75\42\143\x68\145\x63\x6b\142\157\x78\x22\40\157\156\x63\154\151\x63\x6b\75\42\167\63\x2e\x74\x6f\147\x67\x6c\x65\103\x6c\141\x73\x73\50\x27\43\163\154\145\143\x74" . $i . "\x27\54\47\167\63\55\x79\145\154\x6c\x6f\x77\47\x29\73\42\40\143\154\141\x73\163\75\42\x77\63\x2d\143\x68\145\x63\153\42\x20\x6e\x61\155\x65\75\x22\143\x68\145\x63\x6b\42\76\x2d\55\x3e" . $dtfac->fecha . "\x3c\57\164\144\76\x3c\x74\x64\x3e" . $dtfac->tiporet . "\x3c\57\164\x64\76\74\164\x64\76" . $dtfac->documento . "\x3c\x2f\164\x64\76\74\x74\144\x3e" . $dtfac->referencia . "\74\57\164\x64\76\xa\40\40\40\40\40\x20\40\40\x3c\164\144\x3e" . $dtfac->nret . "\74\x2f\x74\x64\x3e\x3c\x74\x64\76" . $dtfac->rif . "\x3c\57\x74\x64\76\74\x74\x64\x3e" . $dtfac->nombre . "\x3c\x2f\x74\x64\76\x3c\164\x64\x3e" . $dtfac->alicuota . "\74\57\164\x64\x3e\74\x74\144\76" . $dtfac->monto . "\74\57\x74\144\76\12\40\40\40\40\40\x20\40\x20\x3c\x74\144\76\x3c\141\x20\x6f\x6e\143\x6c\151\143\x6b\x3d\x22\160\144\146\162\145\164\x65\x6e\143\x69\x6f\x6e\50" . $dtfac->nret . "\x29\73\42\76\x3c\x69\x6d\x67\40\x73\162\143\x3d\x22" . base_url() . "\x69\155\141\x67\x65\x73\x2f\151\x6d\x70\56\x70\156\x67\x22\x20\x61\154\x74\x3d\42\111\155\160\x72\151\x6d\151\x72\x22\x20\x74\x69\164\154\x65\75\42\111\155\160\x72\x69\x6d\x69\162\x22\x20\x73\x74\171\154\145\75\42\167\151\144\164\150\x3a\62\x30\160\170\73\150\145\x69\x67\150\164\x3a\x32\x30\x70\170\73\x62\x6f\162\x64\x65\x72\72\x30\73\x22\76\74\57\141\x3e\74\x2f\164\144\x3e\xa\x20\x20\x20\40\x20\x20\40\40\x3c\x2f\164\x72\x3e"; } $html .= "\74\164\x72\x3e\74\164\144\40\x63\154\x61\163\x73\75\x22\x77\63\x2d\x63\x65\x6e\x74\x65\162\40\167\x33\55\146\157\x6e\144\157\x64\x72\157\151\144\42\40\x63\157\x6c\x73\x70\141\x6e\75\x22\61\x33\x22\x3e\74\x6c\x61\142\x65\x6c\40\x63\154\141\x73\x73\x3d\x22\167\63\x2d\154\x61\162\x67\x65\x22\76\74\x62\x3e\x54\157\164\141\154\40\x72\145\164\x65\156\143\151\157\156\x65\163\72\40" . $totalreg . "\74\57\x62\76\74\57\x6c\141\x62\145\154\76\74\57\164\144\76\74\57\164\162\x3e\x3c\57\x74\x61\x62\x6c\x65\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\x20\40\40\x20\40\x20\74\163\143\x72\151\x70\164\40\x74\171\160\145\75\42\164\x65\x78\164\57\x6a\141\166\x61\x73\x63\x72\x69\x70\x74\42\76\xa\40\x20\40\x20\40\40\x20\x20\x66\165\x6e\143\x74\151\157\x6e\40\104\145\x63\x72\x65\155\x65\156\x74\116\x75\x6d\50\51\x7b\40\x62\x65\x66\157\162\x65\50\x29\x3b\xa\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\166\x61\x72\x20\x44\145\x63\x72\x65\155\x65\156\164\x4e\165\155\x3d\144\157\x63\x75\155\145\156\164\56\147\145\164\x45\x6c\x65\x6d\x65\x6e\x74\102\x79\x49\144\50\x22\104\x65\143\162\x65\x6d\145\156\164\x4e\165\x6d\x22\51\x2e\x76\x61\x6c\165\x65\x3b\xa\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\x76\141\162\40\x6b\x65\171\75\x22\x64\x72\x6f\151\x64\x39\x30\x33\42\x3b\40\x6c\x69\x6b\145\146\141\x63\x3a\44\50\x22\43\154\151\153\x65\42\x29\56\x76\x61\154\50\x29\x3b\xa\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\x76\x61\162\x20\144\x61\164\x6f\163\40\75\40\173\12\x20\x20\40\40\40\40\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\42\x70\x61\147\42\x20\72\x20\104\x65\143\162\145\x6d\x65\x6e\x74\x4e\x75\x6d\54\xa\40\40\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\x22\x6b\x65\171\x22\40\x3a\x20\153\x65\171\x2c\40\x6c\x69\x6b\145\x66\141\143\x3a\154\151\153\145\x66\x61\x63\12\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x7d\73\12\x20\40\40\40\x20\x20\40\40\x20\40\x20\12\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\44\x2e\141\x6a\x61\x78\50\x7b\12\40\40\40\x20\40\40\40\x20\x20\40\40\40\40\x20\40\40\x20\40\40\x64\141\x74\x61\x3a\x20\144\141\x74\157\x73\x2c\xa\40\x20\40\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\40\40\x20\40\165\162\154\x3a\x20\x20\142\x61\163\x65\x75\162\154\x2b\42\x63\x5f\144\x72\157\x69\x64\x2f\x72\145\x74\x65\x6e\x63\151\x6f\156\x5f\143\x6f\155\x70\x72\141\163\x22\54\12\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\40\40\40\40\x74\171\160\x65\72\x20\42\x50\x4f\x53\x54\42\54\xa\x20\40\40\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\40\x20\x73\165\143\x63\145\x73\x73\72\x20\146\x75\156\143\164\x69\x6f\156\50\x64\x61\164\x61\x29\40\x7b\12\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\40\40\44\x28\42\43\x62\157\144\x79\42\x29\56\150\164\x6d\154\x28\144\x61\x74\x61\51\73\40\40\x73\x77\x61\154\x2e\143\x6c\x6f\x73\145\x28\51\x3b\40\44\x28\42\x23\154\151\x6b\145\42\51\56\x76\x61\154\50\154\151\x6b\145\x66\x61\x63\51\73\12\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x7d\xa\40\40\40\40\x20\40\40\40\x20\x20\x20\12\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x7d\x29\x3b\12\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\175\xa\40\x20\40\x20\x20\40\x20\40\xa\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\146\165\156\143\164\151\x6f\156\40\x6e\x75\x6d\160\x61\x67\x28\x61\51\173\x20\142\145\x66\x6f\162\x65\50\x29\x3b\xa\40\40\40\x20\40\40\40\x20\40\40\40\40\x76\x61\162\40\153\145\x79\75\x22\x64\162\157\151\144\71\60\63\x22\73\40\x6c\151\153\x65\x66\x61\143\x3a\44\50\x22\43\x6c\x69\153\x65\x22\51\56\166\141\x6c\50\51\x3b\12\40\x20\x20\x20\40\x20\40\40\xa\x20\40\x20\40\40\40\x20\40\40\40\x20\40\166\x61\x72\40\144\141\164\157\x73\40\x3d\40\173\xa\x20\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\40\42\153\x65\x79\x22\x3a\153\145\x79\x2c\xa\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\42\x70\141\147\42\x20\x3a\x20\141\54\40\154\x69\x6b\x65\x66\x61\x63\x3a\154\151\153\x65\x66\141\143\12\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x7d\73\12\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\xa\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x24\56\141\x6a\141\x78\x28\173\xa\x20\40\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\x64\141\x74\x61\72\40\x64\x61\164\157\163\x2c\12\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\165\162\154\72\x20\x62\x61\163\145\165\x72\x6c\53\42\143\x5f\x64\162\157\x69\144\57\162\x65\x74\145\x6e\143\151\157\x6e\x5f\x63\157\155\x70\162\141\x73\x22\54\xa\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x74\171\x70\x65\72\40\42\120\x4f\123\124\x22\x2c\xa\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\40\40\163\x75\143\143\x65\163\163\x3a\40\x66\165\x6e\143\x74\151\157\x6e\50\144\141\x74\x61\x29\x20\173\12\40\x20\40\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\44\50\x22\x23\x62\157\x64\171\42\51\x2e\150\x74\155\154\x28\144\x61\x74\141\51\73\40\x20\163\167\141\154\x2e\143\154\x6f\163\145\x28\51\73\40\44\x28\x22\43\x6c\151\153\x65\x22\51\x2e\x76\141\x6c\50\x6c\x69\x6b\145\146\x61\143\51\73\xa\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\x7d\xa\40\40\40\40\40\x20\x20\40\x20\x20\x20\xa\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\40\175\51\x3b\xa\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x7d\xa\40\40\x20\40\40\x20\40\40\12\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\146\x75\x6e\143\x74\x69\x6f\x6e\x20\111\156\x63\x72\x69\155\145\x6e\x74\116\165\155\50\x29\173\40\142\x65\146\x6f\162\x65\50\x29\x3b\xa\x20\x20\40\40\40\40\40\x20\x20\x20\x20\40\166\x61\x72\40\111\156\x63\162\x69\155\145\x6e\x74\x4e\x75\x6d\x3d\x64\x6f\143\165\155\x65\156\164\56\x67\145\164\105\154\x65\x6d\145\156\164\102\x79\111\144\x28\42\x49\x6e\143\162\151\x6d\x65\156\x74\x4e\165\155\42\x29\56\166\x61\154\x75\145\x3b\12\x20\x20\40\x20\x20\40\40\40\40\40\40\x20\x76\141\162\40\153\145\x79\x3d\x22\x64\x72\x6f\x69\x64\x39\60\x33\x22\73\40\154\151\153\145\x66\141\143\72\44\x28\x22\43\154\151\153\145\x22\x29\x2e\166\141\x6c\50\x29\73\xa\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\166\141\162\x20\x64\x61\164\157\163\40\75\40\x7b\xa\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\x22\x6b\145\171\42\x3a\153\x65\171\x2c\12\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x22\160\x61\147\42\40\72\x20\x49\156\x63\162\151\x6d\145\x6e\x74\116\165\155\x2c\x20\x6c\151\153\145\146\x61\143\72\x6c\x69\153\x65\x66\x61\143\xa\x20\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\x20\175\x3b\12\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x24\x2e\x61\152\x61\170\x28\x7b\xa\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\40\144\x61\164\141\72\40\x64\141\164\157\x73\54\12\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\40\165\162\x6c\x3a\40\40\142\x61\163\x65\165\x72\x6c\53\42\x63\137\x64\162\x6f\151\144\57\162\145\x74\x65\x6e\x63\x69\157\156\137\x63\x6f\155\160\162\141\163\x22\54\xa\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\40\40\x20\40\164\171\160\x65\x3a\x20\x22\120\117\x53\124\42\54\12\x20\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\163\165\143\143\x65\x73\x73\x3a\40\146\x75\156\x63\164\151\x6f\156\x28\144\141\164\x61\x29\40\x7b\12\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\44\50\42\x23\x62\x6f\144\171\x22\51\x2e\x68\164\155\154\x28\144\141\164\141\51\73\40\40\163\x77\x61\x6c\56\x63\154\x6f\x73\145\50\x29\x3b\40\x24\x28\42\43\x6c\151\153\x65\x22\51\56\x76\141\x6c\50\154\x69\153\145\146\x61\x63\51\73\xa\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\x7d\xa\40\x20\40\x20\40\x20\40\x20\x20\x20\40\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\175\51\x3b\12\40\40\x20\40\40\40\40\40\40\x20\40\175\12\40\x20\x20\x20\40\40\x20\40\74\57\x73\143\162\x69\x70\x74\x3e\xa\x20\40\40\40\40\x20\x20\40\74\144\x69\166\40\143\154\x61\x73\163\x3d\42\167\63\x2d\x62\141\162\x20\x77\63\x2d\142\x6f\x72\144\x65\x72\40\x77\x33\x2d\x62\x61\x72\162\141\163\x22\x3e\xa\40\40\x20\40\40\40\x20\x20\74\151\156\160\165\164\x20\x74\x79\160\145\x3d\x22\x68\x69\144\144\145\156\42\40\151\144\x3d\42\x44\145\143\x72\x65\x6d\145\x6e\x74\x4e\165\x6d\42\40\166\x61\x6c\x75\145\x3d\42" . $DecrementNum . "\x22\x3e\xa\x20\x20\40\x20\x20\40\x20\40\74\x61\x20\157\x6e\143\154\x69\x63\x6b\75\x22\x44\x65\143\x72\x65\x6d\x65\156\x74\116\x75\155\50\51\x3b\x22\x20\x63\x6c\141\x73\163\75\42\x77\x33\55\x62\141\x72\x2d\x69\x74\x65\x6d\x20\167\x33\x2d\x62\165\x74\x74\x6f\156\x22\x3e\46\154\141\161\165\x6f\x3b\x3c\57\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\x64\160\x61\147\151\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\63\x2d\146\157\x6e\x64\x6f\144\x72\157\x69\144"; $html .= "\12\40\40\40\40\40\x20\x20\x20\x3c\151\156\160\165\164\x20\x74\171\x70\x65\75\x22\x68\x69\x64\x64\145\156\x22\x20\x69\x64\x3d\42" . $id . "\x22\x20\x76\141\154\165\145\x3d\x22" . $i . "\x22\x3e\12\40\x20\40\x20\x20\x20\x20\40\74\141\x20\157\x6e\143\154\151\143\x6b\75\42\x6e\x75\x6d\160\141\x67\x28\44\x28\x27\x23" . $id . "\47\51\x2e\166\141\154\50\x29\51\x3b\42\40\x63\154\x61\163\x73\75\42\x77\63\x2d\142\141\x72\55\x69\164\x65\155\40\x77\x33\55\x62\165\164\164\157\156\40" . $hover . "\x22\76" . $i . "\74\x2f\x61\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\x70\165\164\x20\x74\x79\160\145\75\x22\150\151\144\x64\145\x6e\x22\x20\x69\x64\x3d\x22" . $id . "\x22\x20\166\x61\154\165\145\75\42" . $i . "\42\x3e\12\x20\x20\40\40\40\40\x20\40\74\x61\40\157\156\x63\x6c\x69\143\x6b\x3d\x22\156\x75\x6d\160\x61\x67\50\44\x28\x27\43" . $id . "\x27\51\x2e\x76\x61\154\x28\51\51\73\x22\x20\x63\x6c\141\x73\x73\x3d\x22\167\63\55\x62\x61\x72\x2d\151\164\x65\155\x20\167\63\x2d\142\165\x74\x74\157\x6e\x20" . $hover . "\x22\76" . $i . "\74\x2f\141\76"; } } } $html .= "\74\x69\156\160\165\164\x20\x74\x79\160\x65\x3d\x22\150\x69\144\144\145\x6e\42\40\x69\x64\x3d\x22\x49\x6e\x63\x72\151\155\145\x6e\164\116\x75\x6d\x22\x20\166\x61\154\x75\145\x3d\x22" . $IncrimentNum . "\42\76\12\x20\40\40\x20\40\40\40\40\74\x61\40\x6f\156\x63\154\151\143\153\75\x22\111\156\x63\162\151\155\145\x6e\164\x4e\x75\155\x28\x29\x3b\42\x20\x63\154\141\163\163\x3d\42\x77\63\55\142\141\x72\55\151\164\x65\x6d\40\x77\63\55\142\165\164\x74\x6f\156\42\76\x26\162\141\x71\165\x6f\x3b\74\57\x61\76\xa\12\40\x20\x20\40\x20\40\40\x20\74\57\x64\x69\x76\76\x20"; return $html; } function facprov($prov, $tipdoc) { if ($tipdoc == "\106\101\103") { $fac = $this->db->query("\x53\x45\114\105\x43\124\x20\x64\x6f\143\165\x6d\145\x6e\x74\157\x20\x46\122\x4f\115\40\x63\157\x6d\160\162\x61\163\40\x57\110\x45\x52\x45\x20\x70\162\157\x76\145\145\x64\x3d\x27{$prov}\47\x20\46\x26\40\164\151\x70\x6f\x64\157\143\x3d\47\x46\101\103\47\x20\46\x26\x20\164\157\164\151\x6d\160\165\x65\x73\164\x3e\60")->result(); $html = "\x3c\157\160\x74\151\157\156\x20\166\x61\154\165\x65\75\42\x22\x20\x64\151\x73\141\x62\154\x65\144\40\163\x65\154\145\143\x74\x65\x64\x3e\123\x65\154\145\x63\x63\x69\157\x6e\x65\x3c\57\x6f\160\164\151\157\x6e\76"; foreach ($fac as $dfac) { $html .= "\x3c\157\x70\x74\x69\157\156\40\x76\141\154\165\x65\75\x22" . $dfac->documento . "\42\x3e" . $dfac->documento . "\x3c\x2f\x6f\x70\x74\151\157\156\76"; } } elseif ($tipdoc == "\x4e\x2f\x44") { $fac = $this->db->query("\x53\105\114\105\103\124\40\x64\x6f\x63\x75\155\x65\156\x74\157\40\106\122\x4f\x4d\40\x63\157\x6d\160\x72\x61\163\40\x57\110\x45\x52\x45\40\160\162\157\166\x65\x65\x64\x3d\47{$prov}\x27\x20\x26\46\40\164\151\x70\x6f\144\157\143\x3d\47\116\x2f\x44\x27\40\46\46\x20\164\x6f\x74\x69\x6d\x70\x75\x65\x73\164\x3e\60")->result(); $html = "\x3c\x6f\x70\164\x69\157\x6e\x20\x76\x61\154\x75\145\75\x22\42\x20\144\x69\x73\x61\142\154\x65\144\x20\x73\x65\154\145\143\164\x65\x64\76\123\145\x6c\145\143\143\151\157\156\145\74\x2f\157\160\164\x69\157\156\x3e"; foreach ($fac as $dfac) { $html .= "\74\157\160\x74\x69\x6f\x6e\x20\x76\141\154\165\x65\x3d\42" . $dfac->documento . "\42\76" . $dfac->documento . "\74\57\157\160\x74\151\x6f\156\76"; } } else { $fac = $this->db->query("\123\105\x4c\x45\x43\x54\x20\144\x6f\x63\x75\155\145\156\164\157\40\106\122\x4f\x4d\40\143\157\155\x70\162\141\x73\40\x57\x48\x45\x52\x45\x20\x70\x72\157\166\145\x65\x64\x3d\47{$prov}\47\x20\46\x26\x20\x74\x69\x70\x6f\x64\x6f\143\x3d\47\x4e\57\103\47\x20\46\46\x20\164\x6f\x74\x69\x6d\160\165\145\x73\x74\76\x30")->result(); $html = "\74\157\160\x74\151\157\156\40\166\x61\154\165\x65\75\x22\42\x20\x64\x69\163\x61\x62\x6c\x65\144\40\163\x65\154\x65\143\164\145\144\x3e\123\x65\x6c\x65\x63\143\x69\157\156\x65\x3c\57\x6f\160\x74\x69\157\156\76"; foreach ($fac as $dfac) { $html .= "\74\x6f\160\x74\151\157\x6e\x20\166\141\154\165\x65\75\42" . $dfac->documento . "\42\76" . $dfac->documento . "\x3c\x2f\x6f\160\x74\x69\x6f\x6e\x3e"; } } $retiene = $this->db->query("\x53\105\114\105\103\x54\40\x72\145\x74\151\x65\156\145\x20\106\122\x4f\115\x20\x70\x72\x6f\x76\145\x65\x64\40\127\110\105\122\x45\40\x69\144\x3d\x27{$prov}\47")->row()->retiene; return array("\146\x61\143" => $html, "\141\x6c\151\x63" => $retiene); } function montoret($prov, $doc, $tip) { $db = $this->db->query("\123\105\114\x45\x43\124\x20\x74\157\164\x69\x6d\160\x75\x65\163\164\40\151\166\141\x20\106\x52\117\x4d\x20\x63\x6f\155\160\162\141\163\40\x57\110\105\122\x45\x20\160\162\x6f\x76\x65\x65\144\x3d\47{$prov}\x27\40\46\46\x20\x64\157\x63\x75\x6d\145\x6e\x74\157\x3d\x27{$doc}\x27\40\46\x26\x20\x74\151\x70\157\x64\157\x63\x3d\x27{$tip}\47")->row(); $retiene = $this->db->query("\123\x45\114\x45\103\x54\x20\162\x65\164\151\145\x6e\145\x20\106\122\x4f\x4d\40\160\x72\x6f\x76\145\x65\x64\40\127\110\x45\122\105\x20\x69\144\x3d\x27{$prov}\x27")->row()->retiene; $monto = $db->iva * $retiene / 100; return $monto; } function regretcomp($prov, $fecha, $tipdoc, $doc, $alic, $monto) { $db = $this->db->query("\123\105\114\105\x43\x54\40\141\56\x66\145\x63\x68\x61\144\157\143\x20\106\145\143\150\141\54\50\x53\105\114\x45\103\124\40\x70\x72\x6f\x76\56\162\x69\x66\x20\106\x52\117\x4d\40\160\162\x6f\166\145\145\144\x20\x70\162\157\166\40\127\110\x45\122\105\40\160\162\157\166\56\151\x64\x3d\141\56\x70\162\157\x76\x65\x65\144\51\40\x72\x69\x66\x2c\50\x53\105\x4c\105\103\x54\40\x70\162\x6f\x76\56\156\157\x6d\142\162\x65\x20\x46\x52\117\x4d\x20\160\x72\157\x76\145\145\x64\40\x70\x72\157\x76\x20\127\x48\x45\x52\x45\40\160\x72\x6f\x76\x2e\x69\x64\x3d\141\x2e\160\x72\x6f\166\x65\x65\144\51\40\156\x6f\155\x62\162\x65\54\xa\40\40\40\40\x20\x20\40\40\x61\x2e\x64\x6f\143\165\x6d\145\156\164\157\x2c\x61\x2e\156\x63\157\x6e\x74\x72\x6f\x6c\x2c\x61\x2e\x72\x65\146\145\162\x65\156\143\x69\141\x2c\x61\x2e\x73\165\142\x74\157\x74\x61\154\x2c\141\56\x74\157\164\x61\154\x2c\x20\x61\x2e\x73\x69\x6e\151\155\160\x75\145\163\164\x20\145\x78\143\x65\x6e\164\x6f\x2c\x61\56\x62\x61\163\x65\x69\155\160\x6f\40\x62\141\x73\145\137\151\x6d\x70\157\156\151\142\x6c\145\54\40\x61\x2e\x74\157\164\151\155\160\x75\x65\163\x74\40\151\x76\x61\12\x20\40\40\x20\40\x20\x20\40\106\122\x4f\x4d\40\x63\157\155\160\162\x61\x73\40\141\x20\12\x20\40\40\x20\40\40\40\40\127\110\105\x52\105\x20\40\141\x2e\144\x6f\143\165\x6d\x65\156\164\x6f\x3d\x27{$doc}\x27\40\46\46\40\x74\151\160\157\x64\157\x63\75\47{$tipdoc}\47\40\x26\46\x20\141\x2e\160\162\x6f\166\145\x65\144\75\x27{$prov}\47")->row(); $num = $this->db->query("\x53\x45\114\105\103\x54\40\111\106\50\115\x41\130\50\x53\125\102\123\x54\122\x28\x6e\162\x65\x74\54\67\x2c\61\64\51\x29\x2b\x31\76\60\54\x4d\x41\130\x28\x53\x55\x42\123\x54\122\x28\x6e\x72\145\164\x2c\67\x2c\x31\x34\51\51\x2b\61\x2c\x31\51\40\156\40\x46\x52\x4f\x4d\x20\x63\x6f\x6d\x70\162\141\163\x20\x57\110\x45\122\105\x20\164\x69\x70\x6f\x64\157\143\75\x27\x52\x45\x54\47")->row(); $num = str_pad($num->n, 8, "\60", STR_PAD_LEFT); $nret = DATE("\x59\x6d") . $num; if ($tipdoc == "\106\x41\x43") { $tiporet = "\60\61"; $ref = ''; } elseif ($tipdoc = "\116\x2f\104" || ($tipdoc = "\116\57\x43")) { if ($tipdoc = "\116\57\104") { $tiporet = "\x30\62"; } else { $tiporet = "\x30\63"; } $ref = $db->referencia; } $this->db->insert("\143\157\155\160\x72\141\x73", array("\160\162\x6f\x76\x65\x65\x64" => $prov, "\x66\x65\x63\150\141\x64\157\x63" => $fecha, "\x74\x69\160\x6f\x64\x6f\x63" => "\x52\105\x54", "\144\x6f\143\165\x6d\145\x6e\x74\157" => $doc, "\156\x72\x65\x74" => $nret, "\x6e\x63\x6f\156\x74\162\157\154" => $db->ncontrol, "\146\145\143\x68\141\171\x68\x6f\x72\141" => date("\x59\x2d\x6d\55\144\x20\110\72\x69\x3a\x73"), "\x72\x65\146\x65\162\145\x6e\143\151\x61" => $ref, "\x61\154\151\143\162\145\164" => $alic, "\163\x75\x62\164\157\x74\x61\154" => $db->subtotal, "\x73\151\156\151\155\160\x75\x65\163\x74" => $db->excento, "\x62\141\163\x65\x69\155\160\x6f" => $db->base_imponible, "\164\157\164\x69\155\160\x75\x65\x73\164" => $db->iva, "\x74\157\164\141\154" => $db->total, "\x72\145\x74\151\x65\156\x65" => $monto, "\144\145\x73\143\x72\151\160" => "\123\x45\40\x72\145\164\x69\x65\156\145\40\x65\x6c\40" . $monto . "\40\x70\141\162\x61\40\145\x6c\x20\x64\x6f\143\x75\x6d\145\156\x74\x6f\x20" . $tipdoc . $doc . '', "\164\x69\160\157\x72\145\x74" => $tiporet, "\x66\x65\x63\x68\141\x72\145\164" => date("\131\55\x6d\55\144"))); if ($this->db->affected_rows() > 0) { return 1; } } function pdfretencion($a) { $db = $this->db->query("\x53\x45\x4c\105\103\124\40\160\x72\x6f\x76\x65\145\144\x2c\40\144\141\164\x65\x5f\x66\157\x72\155\141\164\50\x66\x65\143\x68\141\x64\157\x63\x2c\x20\x27\45\x64\55\45\x6d\55\x25\131\47\x29\x66\145\x63\x68\x61\144\x6f\143\x2c\144\x61\164\145\x5f\x66\x6f\x72\x6d\141\x74\x28\146\145\x63\150\141\x72\145\x74\x2c\40\47\45\x64\x2d\x25\155\55\x25\131\x27\51\146\x65\143\x68\x61\162\145\x74\x2c\40\x49\x46\x28\x74\x69\160\x6f\x72\x65\164\x3d\x27\x30\x31\x27\x2c\x64\x6f\x63\x75\155\x65\x6e\x74\157\x2c\60\60\x29\x20\146\x61\x63\164\165\x72\x61\54\40\x6e\143\157\x6e\x74\162\x6f\154\54\x20\111\x46\50\164\151\160\x6f\x72\x65\164\x3d\x27\x30\62\47\54\144\157\x63\165\155\145\x6e\164\157\54\x30\x30\51\x20\x6e\x64\x2c\40\x49\106\x28\164\151\160\x6f\x72\145\164\75\x27\60\63\47\54\144\x6f\x63\165\155\x65\156\x74\x6f\54\60\x30\x29\40\156\143\x2c\40\111\x46\50\164\151\160\157\x72\x65\x74\75\47\x30\62\x27\40\174\x7c\40\164\x69\x70\x6f\x72\x65\x74\75\x27\x30\x33\47\54\x72\145\x66\x65\x72\145\x6e\143\x69\141\54\60\x30\x29\x20\146\141\143\137\x61\146\x65\x63\x74\x61\x64\141\x2c\12\x20\x20\x20\40\164\151\x70\x6f\x72\145\x74\x2c\122\x4f\x55\x4e\104\x28\164\157\x74\141\x6c\x2c\x32\51\164\x6f\x74\141\154\x2c\x52\x4f\125\x4e\x44\x28\163\x69\156\x69\155\x70\165\145\163\164\54\62\51\163\x69\156\x69\155\160\165\x65\163\x74\54\x52\117\x55\116\x44\x28\x62\141\x73\x65\151\x6d\x70\157\x2c\62\51\x62\141\163\145\151\x6d\x70\x6f\54\47\61\x36\x25\47\x20\141\x6c\x69\x63\165\x6f\x74\141\x2c\x52\117\x55\116\104\x28\x74\157\x74\151\155\x70\x75\x65\163\x74\x2c\x32\51\164\157\x74\x69\155\x70\x75\x65\x73\x74\54\141\154\151\143\162\x65\x74\54\122\117\125\116\x44\x28\x72\x65\164\x69\x65\x6e\x65\54\x32\x29\162\x65\x74\151\145\156\x65\x20\x46\122\117\115\x20\x63\157\x6d\160\x72\x61\x73\x20\127\x48\x45\x52\x45\x20\156\x72\x65\x74\x3d\47{$a}\47")->row(); $sujeto = $this->db->query("\x53\105\114\x45\103\x54\x20\156\x6f\x6d\142\x72\x65\54\x72\151\x66\40\x46\122\117\115\40\x70\x72\x6f\166\x65\x65\144\x20\127\110\105\122\x45\40\x69\144\75\47{$db->proveed}\47")->row(); $totfin = $db->total - $db->retiene; $html = "\74\154\151\156\x6b\40\x72\x65\x6c\75\42\163\164\171\x6c\145\x73\x68\x65\145\164\42\x20\150\162\x65\146\x3d\42\141\x73\163\145\164\163\x2f\x63\163\163\57\167\63\56\143\x73\x73\x3f\166\x3d\x34\42\76\74\x68\x74\155\x6c\76\x3c\x64\151\x76\x20\x63\x6c\x61\x73\163\x3d\42\167\63\55\x63\x65\156\164\145\162\x20\167\x33\x2d\164\x65\x78\164\x70\144\x66\x22\40\163\164\x79\154\x65\75\42\x6d\x61\162\x67\x69\x6e\55\164\157\x70\x3a\62\x2e\65\x25\73\x6d\141\x72\147\x69\x6e\x2d\x6c\x65\x66\164\x3a\x32\x2e\65\x25\x22\x20\76"; $html .= "\xa\40\40\40\x20\74\x64\x69\x76\x20\x63\x6c\x61\163\x73\75\42\167\63\55\x72\x6f\167\x2d\x70\141\144\144\151\x6e\x67\x22\x3e\xa\40\40\x20\40\x3c\x64\x69\166\x20\143\x6c\141\x73\163\75\x22\x77\x33\x2d\143\x6f\154\x20\x73\66\x20\x77\x33\x2d\154\x65\x66\x74\55\141\x6c\151\x67\156\x22\x3e\x3c\x68\61\40\x63\x6c\x61\x73\x73\75\x22\167\63\x2d\x74\151\156\171\x22\x3e\x3c\x62\x3e\x43\x4f\x4d\120\x52\117\102\x41\116\x54\105\40\x52\x45\x54\x45\116\103\x49\117\116\40\111\126\x41\x3c\57\x62\x3e\x3c\57\x68\61\76\12\x20\40\x20\x20\74\160\x3e\x4c\145\171\40\111\x56\x41\40\101\162\x74\56\x20\x31\61\72\40\114\141\40\101\144\x6d\x69\x6e\x69\163\x74\x72\x61\x63\x69\xc3\263\x6e\x20\x54\162\x69\142\x75\164\x61\162\x69\141\40\x70\157\144\162\xc3\241\40\x64\x65\163\x69\147\x6e\141\x72\x20\x63\157\155\157\x20\x72\x65\163\x70\157\x6e\163\141\x62\x6c\145\163\x20\x64\145\154\40\160\141\x67\x6f\40\144\145\x6c\x20\151\x6d\160\165\x65\163\x74\157\x2c\40\x65\x6e\40\x63\141\x6c\151\144\x61\144\40\144\x65\40\x61\147\x65\x6e\164\145\x73\40\x64\145\x20\162\145\x74\x65\156\143\x69\303\263\156\54\x20\141\40\161\x75\x69\x65\x6e\x65\163\40\x70\157\162\40\x73\x75\163\40\x66\x75\x6e\x63\x69\x6f\x6e\x65\x73\x20\x70\xc3\272\x62\x6c\151\x63\141\x73\x20\x6f\40\160\157\162\40\162\141\172\303\263\156\40\x64\x65\40\163\x75\x73\40\x61\143\x74\x69\x76\151\x64\141\x64\x65\x73\40\160\162\151\166\x61\144\141\163\40\x69\x6e\164\x65\x72\166\x65\x6e\x67\141\156\40\145\x6e\40\x6f\x70\x65\162\x61\x63\x69\157\x6e\x65\163\40\x67\162\141\x76\141\x64\141\163\x20\x63\x6f\156\x20\145\x6c\x20\151\155\x70\x75\145\163\x74\x6f\x20\145\x73\x74\x61\x62\x6c\x65\143\151\144\157\x20\x65\156\x20\145\163\x74\x61\x20\114\x65\x79\x2e\x3c\160\76\12\40\40\x20\40\x3c\x70\x3e\x3c\x62\x3e\120\162\157\x76\151\x64\x65\156\x63\x69\x61\40\x41\144\x6d\151\x6e\x69\163\164\162\x61\x74\151\166\141\40\116\302\260\x20\x53\x4e\x41\124\x2f\x32\60\x31\x35\x2f\x30\60\64\x39\40\x64\145\x6c\40\61\60\x2f\x30\x38\57\62\x30\x31\x35\x3c\x2f\142\76\74\x2f\x70\76\12\40\40\40\x20\74\x2f\x64\151\x76\76\xa\x20\40\40\40\x3c\144\x69\166\40\143\154\x61\x73\x73\75\x22\x77\x33\x2d\x63\157\x6c\x20\x73\x36\x22\x3e\xa\x20\x20\40\x20\74\164\141\142\154\x65\40\143\x6c\141\163\x73\75\x22\x77\63\x2d\x74\x61\x62\x6c\x65\x2d\141\x6c\x6c\x22\76\xa\40\40\40\40\x3c\x74\162\x20\143\154\x61\163\x73\x3d\x22\x77\x33\x2d\x6c\151\147\150\164\55\147\162\x65\171\x22\x3e\74\164\x68\x3e\116\x52\117\56\103\x4f\115\x50\x52\117\x42\x41\116\x54\105\x3c\x2f\164\x68\76\74\x74\150\x3e\x46\105\x43\110\101\74\x2f\x74\150\76\74\57\164\x72\76\12\40\40\40\x20\74\164\162\x3e\74\x74\144\x3e" . $a . "\74\x2f\164\x64\76\74\164\144\x3e" . $db->fecharet . "\74\57\164\x64\76\74\x2f\164\162\x3e\xa\x20\x20\40\40\74\x2f\164\x61\x62\154\145\76\40\xa\x20\40\x20\x20\74\x2f\x64\151\166\x3e\xa\12\40\x20\x20\x20\74\x2f\x64\151\x76\x3e\x3c\142\162\76\xa\xa\x20\x20\x20\40\x3c\164\x61\x62\x6c\x65\40\143\x6c\x61\x73\163\x3d\x22\x77\63\55\164\x61\142\x6c\x65\55\141\x6c\x6c\40\167\x33\x2d\154\x65\146\164\55\141\154\151\x67\x6e\x22\76\12\x20\x20\40\40\x3c\164\162\x20\143\x6c\141\163\163\x3d\42\x77\x33\55\x6c\x69\147\x68\x74\x2d\x67\162\145\x79\x22\x3e\x3c\164\150\x3e\116\x4f\115\x42\122\105\40\x4f\40\122\101\132\x4f\116\40\x53\117\103\111\101\114\40\x44\105\114\40\x41\x47\x45\x4e\x54\x45\40\x44\x45\x20\122\x45\124\x45\x4e\103\111\117\116\x3c\x2f\x74\150\x3e\74\x74\x68\x3e\122\105\107\x49\123\124\122\x4f\x20\x44\105\x20\x49\x4e\106\117\122\115\x41\x43\x49\x4f\116\x20\x46\x49\123\103\101\x4c\x20\x44\105\x4c\40\x41\107\105\x4e\124\105\40\x44\x45\40\122\105\124\x45\116\x43\x49\117\x4e\74\x2f\x74\150\x3e\74\57\x74\x72\76\xa\40\x20\x20\40\x3c\164\162\x3e\x3c\164\x64\76\115\x45\x44\x49\x46\x41\x52\x20\x53\x41\114\x55\104\x20\x43\x2e\x41\x3c\57\164\144\76\x3c\x74\x64\x3e\112\x2d\64\x30\x38\63\x34\x32\x34\66\x2d\x34\x3c\57\164\x64\x3e\x3c\x2f\x74\x72\x3e\xa\40\x20\40\x20\74\x2f\164\141\x62\x6c\x65\76\x20\74\x62\162\76\xa\xa\x20\40\40\x20\x20\x3c\x74\x61\x62\154\145\40\143\154\x61\x73\x73\75\x22\167\x33\x2d\164\x61\x62\x6c\x65\x2d\141\154\x6c\40\167\63\55\154\145\x66\164\x2d\x61\x6c\x69\147\x6e\x22\x3e\xa\x20\x20\40\x20\74\164\x72\40\x63\154\x61\x73\x73\75\x22\x77\x33\55\154\151\x67\x68\164\x2d\147\x72\145\x79\42\76\74\164\150\76\x44\111\x52\105\103\x43\x49\117\x4e\x20\106\111\123\x43\x41\114\x20\x44\x45\114\40\x41\x47\105\116\x54\x45\x20\x44\x45\40\x52\105\124\x45\x4e\x43\111\x4f\116\74\x2f\164\150\x3e\x3c\x74\150\76\120\105\122\111\x4f\104\x4f\x20\x46\111\x53\103\101\x4c\74\57\164\x68\76\x3c\x2f\x74\x72\x3e\xa\x20\x20\x20\x20\74\x74\162\76\74\x74\144\76\103\x41\x4c\x4c\x45\40\x48\x41\x4c\114\x45\131\40\x45\x44\x49\x46\x20\115\105\104\x49\106\101\x52\40\x53\x41\x4c\x55\104\54\40\x4c\117\103\x41\114\40\x33\x2d\x33\x38\x20\x53\105\103\124\x4f\x52\x20\123\101\x4e\40\x42\105\x4e\x49\x54\117\40\126\x55\105\114\124\101\x20\x44\x45\x20\x4c\117\114\x41\x20\x4d\x45\122\111\x44\x41\40\x45\x44\117\x20\115\x45\122\x49\x44\x41\x3c\x2f\164\144\x3e\74\x74\144\x3e\x41\303\221\x4f\72" . date("\131") . "\x20\x4d\x45\x53\72" . date("\x6d") . "\x3c\57\x74\144\x3e\74\x2f\x74\162\76\xa\40\40\40\40\74\x2f\164\x61\142\x6c\145\x3e\40\74\142\162\x3e\xa\12\x20\40\40\x20\x20\74\164\141\142\154\x65\x20\143\x6c\141\x73\x73\x3d\42\x77\x33\x2d\164\141\x62\x6c\x65\x2d\141\154\154\40\x77\63\x2d\154\x65\146\164\x2d\141\154\151\x67\x6e\x22\76\xa\40\40\x20\x20\74\164\162\x20\x63\154\141\163\x73\75\x22\x77\63\55\154\x69\x67\x68\164\x2d\147\162\145\x79\42\76\x3c\164\x68\76\116\x4f\115\102\122\x45\40\117\x20\x52\x41\132\x4f\x4e\x20\x53\117\103\x49\x41\x4c\40\104\x45\114\40\x53\125\x4a\x45\x54\117\x20\x52\x45\x54\105\116\x49\x44\117\74\x2f\164\150\x3e\x3c\x74\x68\76\122\105\107\111\123\x54\122\x4f\40\x44\105\x20\111\x4e\x46\x4f\x52\115\x41\x43\111\117\x4e\x20\106\x49\x53\103\101\x4c\x20\104\105\x4c\40\101\x47\x45\x4e\124\105\x20\122\105\x54\x45\x4e\111\104\117\x3c\57\x74\x68\76\x3c\57\x74\162\x3e\xa\40\x20\40\40\x3c\x74\x72\x3e\x3c\164\144\x3e" . $sujeto->nombre . "\x3c\57\x74\144\76\x3c\164\x64\76" . $sujeto->rif . "\x3c\57\164\144\76\74\x2f\x74\x72\x3e\xa\x20\x20\40\x20\x3c\57\x74\x61\142\x6c\x65\x3e\40\x3c\142\x72\76\12\xa\40\x20\x20\x20\74\164\141\x62\x6c\x65\x20\143\x6c\141\x73\x73\x3d\x22\x77\x33\x2d\164\141\142\x6c\x65\55\x61\154\154\x20\167\63\55\x6c\x65\x66\164\x2d\141\x6c\x69\x67\x6e\x22\76\12\x20\x20\40\40\x3c\x74\162\x20\143\154\x61\163\163\x3d\42\x77\63\x2d\154\x69\147\x68\164\55\x67\162\x65\171\42\x3e\74\x74\x68\x3e\117\160\x65\162\x2e\x4e\x72\x6f\74\57\x74\150\76\x3c\164\x68\x3e\106\x65\x63\150\141\40\144\x65\40\106\x61\x63\164\165\162\141\40\x4e\104\57\x4e\x43\74\x2f\164\x68\x3e\74\x74\x68\76\x4e\x75\x6d\x65\x72\x6f\40\144\x65\x20\106\141\x63\164\x75\162\141\x3c\x2f\x74\x68\76\x3c\x74\x68\76\x4e\165\x6d\145\x72\x6f\x20\144\x65\40\x43\x6f\156\164\x72\x6f\154\x20\x64\145\x20\106\141\143\x74\x75\x72\141\x2f\x44\303\251\x62\x69\164\x6f\x3c\x2f\x74\x68\x3e\x3c\164\x68\76\116\165\x6d\145\162\x6f\40\144\145\x20\x4e\x6f\x74\141\40\144\x65\x20\104\303\xa9\x62\151\x74\x6f\x3c\x2f\x74\x68\x3e\74\x74\x68\76\x4e\x75\x6d\145\162\157\40\144\145\40\x4e\157\164\x61\40\x64\145\x20\103\162\303\xa9\x64\x69\164\x6f\74\x2f\x74\x68\x3e\74\x74\150\x3e\x4e\x75\x6d\x65\x72\x6f\x20\144\x65\40\106\141\143\x74\165\162\x61\40\101\x66\x65\x63\56\x3c\57\x74\150\x3e\74\164\150\76\x54\x69\x70\x6f\x20\x64\x65\40\x54\x72\x61\x6e\163\141\143\x63\151\303\263\x6e\x3c\x2f\x74\x68\x3e\74\164\x68\76\124\157\164\141\x6c\40\x43\157\155\160\x72\141\163\40\x49\156\143\154\165\171\145\x6e\144\x6f\x20\x49\126\101\x3c\x2f\164\x68\76\x3c\164\x68\76\103\157\x6d\x70\162\141\x73\x20\123\151\x6e\x20\104\x65\162\x65\143\x68\x6f\x20\x61\x20\x43\162\303\xa9\x64\151\164\x6f\x20\x49\x56\x41\x3c\x2f\164\150\76\x3c\164\150\x3e\x42\141\x73\145\40\111\155\160\x6f\x6e\x69\142\154\145\74\x2f\164\x68\76\x3c\x74\x68\76\x25\40\101\154\151\x63\165\x6f\164\141\x3c\57\x74\x68\76\74\x74\x68\x3e\x49\x6d\160\x75\145\x73\x74\157\x3c\x2f\164\x68\76\x3c\x74\x68\76\120\x6f\162\x63\x65\156\x74\x61\x6a\x65\40\x52\145\164\x65\x6e\151\144\x6f\x3c\x2f\x74\x68\x3e\x3c\164\150\x3e\111\126\101\x20\122\x65\164\145\x6e\x69\x64\157\74\x2f\x74\150\x3e\x3c\x2f\x74\162\76\12\x20\x20\x20\40\x3c\x74\162\76\74\x74\144\76\x31\x3c\x2f\164\x64\x3e\x3c\x74\144\x3e" . $db->fechadoc . "\74\57\x74\144\76\x3c\x74\x64\x3e" . $db->factura . "\74\x2f\164\144\76\74\x74\144\x3e" . $db->ncontrol . "\x3c\x2f\x74\x64\x3e\x3c\x74\x64\x3e" . $db->nd . "\x3c\57\x74\x64\x3e\x3c\164\144\x3e" . $db->nc . "\74\x2f\x74\x64\76\74\x74\x64\76" . $db->fac_afectada . "\x3c\57\164\x64\x3e\74\164\x64\x3e" . $db->tiporet . "\74\x2f\164\x64\x3e\x3c\164\144\76" . $db->total . "\x3c\57\x74\x64\76\74\164\144\76" . $db->sinimpuest . "\74\57\164\144\76\x3c\164\x64\x3e" . $db->baseimpo . "\74\x2f\x74\144\x3e\74\164\144\x3e" . $db->alicuota . "\x3c\57\164\x64\x3e\x3c\164\144\x3e" . $db->totimpuest . "\74\57\x74\144\x3e\x3c\164\144\x3e" . $db->alicret . "\74\57\x74\144\76\74\164\x64\76" . $db->retiene . "\74\x2f\x74\x64\x3e\74\x2f\x74\x72\x3e\12\x20\40\x20\40\x3c\x74\x72\40\143\154\x61\x73\163\x3d\x22\x77\x33\x2d\x6c\x69\147\150\164\55\x67\162\x65\171\x22\x3e\74\164\144\x20\143\x6f\x6c\163\160\x61\x6e\75\x22\70\x22\40\143\x6c\141\163\x73\x3d\42\x77\x33\x2d\x63\x65\x6e\x74\145\162\42\76\x3c\142\x3e\124\157\x74\141\154\145\163\x3c\57\142\x3e\x3c\x2f\x74\x64\76\x3c\164\x64\x3e" . $db->total . "\x3c\x2f\164\x64\x3e\74\164\x64\x3e\74\x2f\164\x64\76\74\x74\144\76" . $db->baseimpo . "\74\57\164\144\76\74\x74\x64\76" . $db->alicuota . "\74\x2f\164\144\x3e\74\164\144\x3e\74\57\x74\144\x3e\x3c\x74\144\x3e\x3c\x2f\x74\144\76\74\x74\x64\x3e" . $db->retiene . "\x3c\x2f\164\144\x3e\74\164\162\76\xa\40\40\x20\40\74\57\x74\141\142\154\145\76\74\142\x72\76\xa\12\40\40\x20\40\74\x64\x69\x76\x20\143\154\141\x73\x73\x3d\x22\x77\x33\55\162\157\167\55\160\141\x64\144\151\x6e\x67\x22\76\12\40\40\40\x20\74\x64\151\166\x20\143\154\141\163\163\75\42\x77\63\55\143\x6f\x6c\40\x73\x34\40\167\63\55\x6c\145\146\x74\55\141\154\x69\x67\156\x22\x3e\x3c\x70\76\x3c\x62\76\122\145\143\151\142\x69\144\x6f\40\120\157\x72\x3a\x3c\57\x62\76\74\x2f\x70\x3e\74\142\162\76\x3c\x62\x72\76\74\142\x72\x3e\12\40\x20\40\40\x3c\160\x3e\x4e\157\155\x62\162\x65\x20\x79\40\101\x70\x65\x6c\x6c\x69\x64\x6f\x3a\74\x2f\160\76\12\x20\40\40\40\74\x70\x3e\106\151\x72\155\x61\x3a\74\x2f\160\x3e\12\40\x20\40\x20\x3c\x70\76\x43\111\72\x3c\57\160\x3e\xa\x20\40\40\40\74\160\x3e\106\145\x63\150\141\72\74\x2f\160\76\xa\40\x20\x20\x20\74\x2f\144\151\166\76\x20\12\40\x20\x20\74\x64\x69\x76\40\x63\154\x61\x73\x73\x3d\42\167\x33\x2d\x63\x6f\x6c\40\x73\64\x22\76\12\x20\40\40\74\160\x3e\x3c\142\76\101\x47\105\x4e\124\x45\x20\x44\x45\40\122\105\124\x45\x4e\103\111\117\116\x3c\x2f\x62\76\74\x2f\x70\x3e\xa\40\x20\x20\x3c\x70\76\50\123\x65\154\154\x6f\x2c\x20\106\x65\x63\150\141\x20\x79\x20\106\x69\x72\155\141\51\x3c\x2f\x70\76\x3c\142\162\x3e\xa\x20\x20\40\x3c\151\155\x67\40\163\x72\x63\x3d\42\x69\x6d\141\147\x65\163\x2f\x66\x69\x72\x6d\141\137\x6d\x65\144\x69\146\x61\x72\56\x70\x6e\x67\x22\x20\x61\x6c\x74\x3d\42\x48\145\x61\x64\145\162\x22\x20\x73\164\x79\154\145\x3d\42\x77\x69\144\164\150\x3a\x36\60\x25\73\42\x3e\xa\x20\40\x20\x3c\x2f\x64\x69\x76\76\40\12\40\40\40\40\x3c\144\151\166\x20\x63\x6c\141\x73\x73\x3d\x22\x77\63\x2d\143\157\154\40\163\64\42\x3e\x3c\160\76\74\142\x3e\124\117\124\x41\x4c\x20\x41\x20\x50\101\x47\101\122\x20\x42\x53\56\x2e\56\x20\x20\40\40\40" . $totfin . "\x3c\57\142\x3e\x3c\x2f\160\x3e\x3c\57\144\x69\x76\x3e\40\xa\x20\x20\x20\x20\x3c\x2f\144\x69\166\76\74\142\162\76\xa\40\x20\40\x20\xa\40\x20\40"; $html .= "\74\x2f\144\151\166\x3e\74\57\x68\164\155\x6c\76"; return $html; } public function compras($a, $b) { $this->load->library("\x74\141\142\154\x65"); $prov = $this->db->query("\123\105\x4c\105\103\x54\40\151\144\40\x46\122\117\x4d\x20\160\162\x6f\x76\145\x65\144\40\x57\x48\105\122\x45\x20\x6e\157\x6d\x62\x72\x65\x20\x6c\x69\153\145\x20\47\45{$b}\45\x20\x27")->row()->id; if ($b != '') { $filter = "\x26\46\40\160\162\157\166\x65\145\144\x3d\47{$prov}\x27\x20\174\174\x20\x64\x6f\x63\165\x6d\x65\156\x74\x6f\x3d\x27{$b}\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\114\x45\x43\124\x20\156\x75\154\154\12\40\40\x20\x20\40\x20\x20\106\x52\x4f\x4d\x20\143\157\155\160\x72\141\x73\40\x57\110\x45\122\x45\x20\x28\164\x69\x70\x6f\144\x6f\143\75\x27\x46\x41\x43\x27\x20\174\174\40\164\x69\x70\x6f\144\x6f\143\x3d\x27\116\57\x44\x27\40\174\x7c\40\x74\151\160\157\x64\157\143\75\x27\x4e\57\x43\x27\x29\x20{$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\x4c\105\103\x54\x20\x61\x2e\146\145\x63\x68\x61\144\x6f\143\x20\x66\x65\x63\x68\x61\x2c\x61\x2e\x74\x69\160\x6f\x64\x6f\143\54\141\x2e\144\157\x63\165\x6d\x65\156\x74\157\x2c\141\56\156\x63\157\x6e\x74\x72\157\x6c\54\50\x53\x45\114\x45\x43\124\40\x72\x69\x66\x20\106\x52\x4f\x4d\x20\x70\x72\157\166\x65\x65\144\40\x57\110\105\x52\x45\x20\151\144\75\141\56\160\162\x6f\166\145\x65\144\51\x20\x72\x69\146\54\40\50\x53\x45\x4c\x45\x43\124\x20\156\157\155\142\x72\x65\40\106\x52\117\x4d\40\160\162\157\166\x65\x65\144\x20\x57\110\x45\122\x45\40\x69\144\75\x61\x2e\x70\x72\157\166\x65\x65\x64\51\40\156\157\x6d\142\162\x65\x2c\40\x61\x2e\x72\145\146\x65\162\x65\x6e\143\151\141\54\12\40\40\x20\x20\x61\56\x73\x75\x62\164\x6f\164\x61\154\x2c\x61\56\163\151\156\151\x6d\160\165\145\163\x74\54\x61\x2e\142\x61\x73\x65\x69\155\160\157\x2c\141\x2e\x74\x6f\x74\151\155\x70\x75\145\163\164\54\x61\56\x74\157\164\x61\x6c\x2c\103\117\x4e\x43\x41\124\x28\x61\x2e\x70\162\x6f\x76\145\145\x64\x2c\141\56\x74\151\160\x6f\x64\157\143\54\x61\x2e\x64\x6f\x63\165\x6d\145\x6e\164\157\51\x20\x69\x64\143\x6f\x6d\160\12\x20\40\40\x20\40\x46\122\x4f\115\x20\x63\157\x6d\160\162\141\163\x20\141\40\x20\x57\x48\x45\122\105\40\x28\164\x69\160\157\144\x6f\x63\75\47\x46\101\103\x27\x20\x7c\174\40\164\x69\x70\x6f\x64\x6f\x63\x3d\x27\x4e\57\104\47\x20\x7c\x7c\40\164\x69\x70\x6f\144\157\x63\75\47\116\57\103\47\51\x20{$filter}\x20\117\122\104\105\x52\40\x42\x59\x20\141\x2e\146\145\x63\150\141\x64\157\x63\40\x4c\x49\x4d\111\124\40" . ($a - 1) * $mostrar . "\x20\54\x20" . $mostrar . "\73")->result(); $html = "\xa\x20\40\40\40\x3c\x74\x61\x62\x6c\x65\x20\x63\x6c\x61\x73\x73\x3d\42\167\63\x2d\164\x61\142\154\x65\55\x61\154\154\40\x77\x33\55\x68\x6f\x76\x65\162\141\142\154\145\x20\x77\63\55\154\x65\x66\164\55\x61\154\151\x67\156\42\x3e\xa\x20\40\x20\x20\74\164\162\76\x3c\x74\x64\40\143\154\x61\x73\x73\75\x22\167\x33\x2d\146\x6f\156\x64\157\144\x72\x6f\x69\144\42\76\102\165\x73\x63\141\x72\40\x3c\151\155\x67\40\x73\162\143\x3d\x22" . base_url() . "\x69\155\x61\147\x65\x73\x2f\x62\x75\x73\x63\x61\x72\56\160\x6e\147\42\40\141\x6c\164\75\x22\102\165\163\x63\x61\162\42\x20\x74\x69\164\x6c\145\75\42\x42\165\x73\x63\x61\x72\42\x20\x73\x74\171\x6c\145\75\x22\x77\151\144\164\x68\x3a\61\70\x70\170\73\x62\157\x72\x64\145\162\72\x30\73\x22\x3e\x3c\x2f\x74\x64\x3e\12\x20\x20\40\40\74\x74\144\x3e\x3c\x69\156\x70\165\164\x20\x74\x79\x70\145\75\x22\x74\x65\170\164\x22\x20\143\154\x61\163\163\x3d\42\167\63\x2d\x69\x6e\x70\x75\x74\42\40\160\154\x61\143\145\x68\157\154\x64\x65\162\75\x22\111\x6e\147\162\x65\163\x65\x20\163\x75\x20\142\165\163\161\x75\x65\x64\141\42\x20\157\x6e\143\x68\x61\x6e\x67\x65\75\42\x63\157\x6d\160\x72\141\163\x28\51\42\x20\x69\x64\x3d\x22\154\x69\153\145\42\x3e\74\x2f\x74\144\76\12\40\40\x20\40\74\164\144\x20\143\154\141\163\x73\x3d\x22\167\x33\x2d\x63\145\x6e\x74\145\162\40\167\63\x2d\142\164\x6e\x22\76\x3c\x61\40\x6f\156\143\154\x69\143\x6b\75\42\167\63\56\163\x68\x6f\167\50\x27\x23\146\x6f\162\x6d\143\x6f\x6d\x70\47\x29\x3b\42\76\x3c\151\x6d\147\40\163\162\143\75\42" . base_url() . "\151\155\141\147\145\163\x2f\162\x65\147\151\163\164\x72\141\162\56\160\156\147\x22\x20\x61\x6c\x74\x3d\x22\x52\x65\x67\151\163\x74\x72\x61\x72\x20\103\x6f\x6d\160\x72\141\42\x20\x74\x69\164\x6c\x65\x3d\x22\x52\x65\x67\x69\x73\x74\162\141\162\x20\x43\x6f\155\160\x72\141\42\40\x73\x74\171\x6c\x65\x3d\42\x77\x69\144\x74\x68\x3a\x32\60\x70\170\x3b\x68\145\x69\x67\150\x74\72\62\60\x70\x78\73\142\157\x72\x64\x65\162\72\60\x3b\42\76\x3c\x2f\141\76\x3c\57\x74\144\x3e\xa\40\x20\x20\40\74\164\x64\40\143\x6c\141\x73\x73\75\42\167\x33\x2d\x63\145\156\164\145\162\40\x77\63\55\x62\164\x6e\x22\x3e\74\141\40\157\156\x63\154\x69\143\153\x3d\42\143\x6f\155\x70\162\x61\x73\x28\x29\73\42\x3e\74\151\x6d\147\40\163\x72\143\x3d\x22" . base_url() . "\151\155\141\147\x65\163\x2f\162\145\x6c\157\141\144\56\x70\x6e\x67\42\40\141\x6c\x74\75\x22\x52\x65\x63\x61\x72\147\x61\x72\x22\40\164\x69\164\x6c\x65\x3d\42\x52\x65\143\141\x72\x67\141\x72\x22\x20\163\164\x79\154\x65\x3d\42\167\151\x64\x74\x68\x3a\62\60\160\x78\73\150\x65\151\x67\150\164\72\62\x30\x70\x78\73\142\x6f\x72\x64\145\162\x3a\x30\x3b\42\76\74\x2f\x61\76\x3c\x2f\x74\144\76\74\57\x74\162\76\12\x20\40\x20\40\x3c\x2f\164\141\x62\154\x65\x3e\74\142\162\76\12\40\x20\40\x20\x3c\x74\141\142\154\x65\x20\151\144\x3d\x22\151\144\x30\61\42\40\x63\154\141\163\163\75\42\x77\x33\x2d\164\141\142\x6c\145\55\141\154\x6c\x20\167\63\x2d\150\x6f\166\x65\x72\141\x62\x6c\x65\x20\x77\x33\x2d\x6c\145\x66\164\55\x61\x6c\x69\x67\x6e\x20\x77\x33\x2d\164\x69\x6e\x79\42\x3e\x3c\164\162\x20\143\x6c\x61\x73\x73\x3d\42\167\63\x2d\x66\x6f\156\x64\x6f\144\162\x6f\x69\144\x22\x3e\74\164\x68\76\x46\145\143\150\141\x3c\57\x74\150\x3e\74\164\x68\76\124\151\160\157\74\57\164\x68\76\74\164\x68\x3e\x44\x6f\x63\x75\155\145\x6e\164\157\74\57\x74\150\x3e\74\x74\x68\76\116\x2e\103\x6f\156\164\162\x6f\x6c\74\57\164\150\x3e\x3c\164\x68\x3e\x41\x66\x65\143\x74\x61\x3c\x2f\x74\150\76\74\x74\x68\x3e\x52\111\106\74\57\164\150\x3e\x3c\164\x68\76\116\x6f\155\142\x72\145\x3c\57\x74\150\76\74\x74\150\x3e\x53\x75\142\x74\157\x74\x61\154\x3c\57\164\x68\76\xa\40\40\40\40\x3c\x74\150\x3e\x45\x78\x63\x65\x6e\x74\157\74\x2f\164\x68\76\x3c\164\x68\76\x42\x61\x73\x65\56\111\x6d\x70\157\156\151\x62\154\x65\74\57\x74\x68\76\x3c\164\x68\x3e\x49\126\x41\74\57\164\x68\76\74\x74\x68\x3e\x54\x6f\x74\141\x6c\x3c\x2f\164\x68\76\74\x74\144\x3e\74\x2f\164\144\x3e\xa\40\x20\40\40\x3c\x2f\x74\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\164\x72\x20\151\x64\75\42\x73\x6c\x65\x63\164" . $i . "\x22\40\x63\154\141\163\163\x3d\x22\151\164\x65\x6d\42\x3e"; $html .= "\x3c\151\x6e\x70\x75\x74\x20\164\171\x70\145\75\x22\x68\151\144\x64\x65\x6e\42\x20\151\144\75\42\x61" . $i . "\x22\x20\x6e\141\x6d\x65\x3d\x22\144\x6f\143\42\x20\166\x61\154\x75\145\75\42" . $dtfac->documento . "\x22\76\xa\x20\40\x20\40\x20\x20\40\x20\74\x74\x64\76\74\x21\x2d\x2d\x3c\151\x6e\160\165\x74\x20\164\171\160\x65\x3d\x22\x63\150\x65\x63\x6b\x62\157\x78\42\40\157\x6e\x63\x6c\151\143\x6b\x3d\x22\167\63\x2e\164\x6f\x67\147\154\x65\103\x6c\x61\x73\163\50\x27\x23\163\154\145\x63\x74" . $i . "\x27\x2c\x27\167\x33\55\x79\145\x6c\x6c\x6f\167\x27\x29\x3b\42\x20\x63\154\141\163\163\x3d\42\x77\x33\55\x63\x68\x65\x63\x6b\x22\40\x6e\141\x6d\x65\x3d\42\143\150\145\143\x6b\x22\x3e\55\55\76" . $dtfac->fecha . "\x3c\x2f\164\x64\x3e\74\x74\144\76" . $dtfac->tipodoc . "\74\57\164\144\76\x3c\164\x64\76" . $dtfac->documento . "\x3c\57\164\x64\x3e\x3c\x74\144\x3e" . $dtfac->ncontrol . "\74\57\164\144\x3e\xa\x20\x20\40\x20\x20\40\x20\40\74\164\144\76" . $dtfac->referencia . "\x3c\x2f\x74\x64\76\74\x74\144\x3e" . $dtfac->rif . "\74\57\x74\x64\x3e\74\164\x64\x3e" . $dtfac->nombre . "\x3c\57\164\x64\76\x3c\164\x64\x3e" . $dtfac->subtotal . "\x3c\57\x74\144\x3e\74\164\144\76" . $dtfac->sinimpuest . "\x3c\57\164\x64\76\x3c\x74\x64\76" . $dtfac->baseimpo . "\x3c\x2f\164\144\76\74\x74\144\76" . $dtfac->totimpuest . "\74\57\164\x64\x3e\74\x74\144\x3e" . $dtfac->total . "\74\x2f\x74\144\x3e\12\x20\x20\40\40\40\40\x20\x20\x3c\x74\144\76\74\x61\40\x6f\156\143\154\x69\143\153\75\42\x66\x6f\x72\x6d\145\x64\151\x74\143\157\x6d\x70\x28\x27" . $dtfac->idcomp . "\47\51\73\42\76\74\151\x6d\x67\x20\163\162\x63\75\42" . base_url() . "\x69\x6d\141\147\145\x73\x2f\x65\x64\x69\164\141\162\56\x70\x6e\x67\x22\x20\x61\154\x74\75\x22\105\x64\x69\164\x61\162\x22\40\x74\x69\x74\x6c\145\x3d\x22\105\x64\x69\164\141\162\x22\x20\163\164\171\154\145\75\x22\167\151\x64\164\x68\72\62\60\160\x78\73\x68\145\151\x67\x68\x74\72\x32\x30\160\x78\x3b\x62\x6f\162\144\x65\162\x3a\60\x3b\x22\76\x3c\x2f\x61\x3e\74\x2f\x74\144\x3e\12\40\40\x20\40\40\x20\40\40\74\x2f\164\162\x3e"; } $html .= "\74\164\162\x3e\74\x74\144\x20\x63\x6c\x61\163\163\x3d\x22\167\63\x2d\143\145\156\164\145\x72\x20\167\63\55\146\157\x6e\x64\157\x64\162\157\151\x64\x22\x20\143\x6f\x6c\163\x70\x61\156\75\x22\x31\63\42\76\74\154\x61\142\x65\x6c\40\143\154\141\163\163\75\x22\167\x33\55\154\x61\x72\147\145\42\x3e\x3c\x62\x3e\124\157\164\141\x6c\x20\x44\x6f\x63\165\155\145\x6e\164\x6f\x73\x3a\40" . $totalreg . "\x3c\x2f\142\x3e\74\57\x6c\141\x62\145\x6c\76\74\57\164\x64\76\74\57\x74\162\76\x3c\x2f\164\141\x62\154\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\x20\x20\40\x20\40\40\x20\x3c\x73\143\162\151\x70\x74\40\164\x79\x70\x65\x3d\42\164\145\170\x74\x2f\152\x61\166\x61\x73\143\x72\x69\160\x74\42\76\12\40\x20\x20\40\x20\40\x20\40\x66\x75\156\143\x74\151\157\x6e\40\x44\x65\143\x72\x65\x6d\x65\156\x74\116\x75\155\x28\51\173\40\142\145\146\157\x72\x65\50\51\73\12\40\40\40\x20\x20\x20\40\40\x20\x20\40\40\166\x61\x72\40\104\x65\x63\162\x65\155\145\x6e\x74\x4e\x75\155\x3d\144\x6f\143\165\155\x65\x6e\x74\56\147\x65\164\x45\x6c\145\x6d\145\156\164\102\x79\x49\144\50\x22\104\x65\143\162\145\155\145\156\x74\x4e\165\x6d\x22\x29\56\x76\141\x6c\165\145\73\12\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\166\141\x72\x20\x6b\x65\171\75\x22\144\162\157\x69\x64\x39\x30\x33\42\x3b\x20\x6c\x69\x6b\x65\x66\x61\x63\72\x24\x28\42\x23\154\x69\x6b\145\42\x29\56\x76\x61\154\50\51\73\12\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\166\141\162\40\144\141\x74\157\163\40\75\40\173\12\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\42\x70\x61\x67\42\40\72\40\x44\145\143\x72\x65\155\145\x6e\164\x4e\x75\x6d\54\12\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\42\153\x65\x79\x22\40\x3a\40\153\145\171\x2c\x20\x6c\151\x6b\145\x66\x61\143\72\154\151\x6b\145\146\x61\143\xa\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x7d\x3b\12\40\40\x20\x20\40\40\40\x20\x20\x20\x20\12\40\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\x24\56\141\152\x61\x78\50\x7b\xa\x20\40\x20\40\40\40\x20\40\40\40\40\x20\40\40\x20\40\40\x20\x20\144\x61\x74\141\72\40\x64\x61\164\157\x73\x2c\xa\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\x20\40\x75\x72\x6c\72\40\x20\x62\141\163\145\x75\x72\x6c\x2b\x22\143\137\x64\x72\x6f\151\x64\x2f\143\157\x6d\160\x72\x61\163\x22\x2c\12\x20\40\x20\40\40\40\x20\40\40\40\40\40\40\x20\40\40\40\x20\40\x74\x79\160\145\x3a\40\42\x50\x4f\x53\124\42\x2c\xa\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\40\40\40\163\x75\143\x63\x65\x73\163\72\x20\146\165\x6e\143\x74\x69\x6f\156\50\144\x61\164\x61\51\x20\173\xa\40\40\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\40\40\40\40\40\40\x20\40\x24\50\x22\x23\142\x6f\x64\171\x22\x29\56\150\164\155\x6c\x28\x64\x61\164\x61\x29\73\40\40\163\x77\141\154\x2e\x63\x6c\x6f\163\x65\x28\x29\x3b\x20\44\x28\x22\x23\154\151\153\x65\42\51\x2e\166\x61\x6c\50\x6c\151\x6b\145\146\141\143\51\73\xa\40\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\x7d\12\40\x20\x20\x20\40\40\40\40\40\x20\x20\12\x20\40\40\40\40\40\40\40\40\x20\40\x20\40\x20\40\175\51\x3b\12\x20\40\40\40\40\40\x20\x20\40\40\40\175\12\x20\x20\x20\40\x20\x20\40\x20\12\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x66\165\x6e\x63\x74\x69\x6f\x6e\40\156\165\x6d\x70\x61\147\50\141\x29\x7b\40\142\x65\x66\157\x72\x65\x28\x29\x3b\12\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x76\141\x72\x20\x6b\x65\171\75\42\144\x72\x6f\x69\144\71\x30\x33\x22\73\40\x6c\151\153\x65\146\141\x63\x3a\x24\50\x22\43\154\x69\153\x65\x22\x29\56\x76\141\x6c\x28\x29\73\xa\x20\40\40\40\40\x20\x20\40\xa\40\x20\x20\40\x20\40\x20\40\x20\40\40\x20\166\141\162\40\x64\141\x74\157\163\40\x3d\x20\173\xa\x20\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\40\40\40\x20\40\40\40\42\x6b\145\x79\42\x3a\153\145\171\x2c\12\x20\40\40\40\40\40\x20\40\40\40\40\x20\40\x20\x20\x20\40\40\40\42\160\141\147\42\40\x3a\40\x61\x2c\40\154\x69\x6b\x65\146\141\x63\x3a\x6c\151\x6b\145\x66\141\143\xa\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\175\x3b\xa\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\12\40\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x24\x2e\x61\x6a\x61\x78\50\173\xa\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\40\40\x20\40\40\x20\144\141\164\141\x3a\x20\x64\141\x74\157\x73\54\12\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\165\x72\154\x3a\x20\142\x61\x73\x65\165\162\154\x2b\42\x63\137\x64\x72\x6f\x69\144\x2f\143\x6f\x6d\160\x72\141\x73\42\54\12\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\164\x79\x70\145\72\40\42\120\x4f\123\124\x22\x2c\12\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\163\165\x63\x63\145\163\163\x3a\x20\146\165\x6e\143\164\151\x6f\156\50\x64\x61\164\x61\x29\x20\x7b\xa\40\x20\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\40\40\44\50\42\43\142\x6f\144\171\x22\51\x2e\x68\x74\x6d\x6c\50\144\141\x74\x61\51\x3b\40\x20\x73\x77\x61\x6c\x2e\x63\154\x6f\163\x65\50\51\x3b\x20\44\x28\42\x23\x6c\x69\153\x65\42\51\x2e\166\x61\x6c\50\154\x69\x6b\145\146\141\x63\x29\x3b\12\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\175\xa\40\40\40\40\x20\x20\x20\40\x20\40\40\12\x20\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\x7d\x29\x3b\xa\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x7d\12\x20\40\40\x20\40\x20\x20\40\12\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x66\x75\156\x63\x74\151\157\x6e\x20\x49\x6e\143\162\151\155\x65\x6e\164\x4e\x75\x6d\x28\x29\173\x20\142\x65\146\157\x72\x65\x28\x29\x3b\12\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x76\x61\x72\x20\111\x6e\143\162\x69\155\145\x6e\x74\x4e\165\x6d\x3d\144\157\x63\165\x6d\x65\x6e\164\x2e\x67\145\x74\105\154\x65\x6d\145\x6e\x74\102\171\111\x64\50\42\x49\x6e\x63\x72\151\x6d\x65\x6e\164\x4e\165\155\x22\51\56\166\x61\x6c\x75\145\x3b\12\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\166\x61\162\40\153\x65\x79\75\42\x64\x72\157\x69\144\x39\x30\63\x22\73\x20\x6c\151\x6b\x65\x66\141\143\x3a\44\50\x22\x23\x6c\x69\x6b\145\42\51\56\x76\141\x6c\50\51\x3b\xa\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\166\x61\162\x20\144\141\x74\157\x73\40\x3d\40\173\12\40\x20\40\40\x20\40\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\x20\x22\153\145\x79\42\72\x6b\145\x79\54\xa\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\42\x70\x61\x67\42\x20\72\x20\111\x6e\143\x72\151\x6d\x65\156\x74\x4e\x75\x6d\x2c\40\154\151\x6b\145\x66\141\143\x3a\x6c\x69\153\145\x66\141\143\12\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\175\73\xa\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\12\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\x24\56\141\152\x61\170\x28\x7b\12\x20\40\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\144\x61\x74\141\x3a\40\144\x61\164\x6f\x73\54\xa\40\40\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\40\x75\x72\x6c\72\40\40\x62\x61\163\145\165\x72\154\53\x22\x63\137\x64\162\x6f\x69\x64\57\x63\x6f\155\x70\x72\x61\x73\42\54\xa\40\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\x20\164\x79\x70\145\x3a\40\x22\120\117\123\x54\x22\x2c\12\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x73\x75\x63\143\145\163\163\72\40\x66\x75\156\x63\x74\x69\157\x6e\x28\144\x61\164\141\51\x20\173\12\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\44\50\42\43\142\157\144\x79\x22\51\x2e\150\164\155\154\50\144\x61\x74\141\x29\73\x20\40\163\167\141\x6c\56\143\x6c\x6f\163\x65\x28\51\73\x20\x24\50\42\x23\154\x69\x6b\x65\42\x29\56\166\141\x6c\50\154\151\x6b\145\146\x61\143\x29\73\xa\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x7d\xa\40\x20\40\x20\40\x20\40\x20\40\x20\40\12\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\x20\x20\40\175\51\73\xa\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\175\12\x20\40\x20\x20\x20\40\40\x20\74\57\x73\x63\162\151\x70\x74\x3e\12\40\x20\40\40\x20\40\x20\40\x3c\x64\x69\x76\40\143\x6c\141\163\163\75\42\167\63\55\x62\141\x72\40\x77\x33\x2d\x62\x6f\x72\144\145\162\40\x77\63\x2d\142\x61\x72\x72\x61\163\42\76\12\40\40\40\x20\x20\40\40\40\x3c\x69\x6e\160\165\164\40\164\171\160\x65\75\x22\150\x69\x64\x64\145\156\x22\40\x69\x64\x3d\x22\x44\145\143\x72\145\155\145\156\x74\116\x75\155\42\x20\x76\x61\x6c\165\x65\75\x22" . $DecrementNum . "\42\x3e\12\x20\x20\40\40\40\x20\40\40\x3c\x61\x20\x6f\x6e\x63\154\x69\143\x6b\x3d\42\x44\x65\x63\x72\x65\155\x65\156\164\x4e\x75\155\50\51\73\x22\x20\x63\154\141\163\163\x3d\42\167\63\x2d\142\141\x72\x2d\151\164\145\155\40\x77\x33\55\142\165\x74\164\157\x6e\x22\76\x26\x6c\141\x71\x75\157\73\x3c\57\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\x64\160\141\x67\x69\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\x33\x2d\x66\157\x6e\x64\x6f\x64\162\x6f\151\144"; $html .= "\xa\x20\x20\x20\x20\x20\40\40\40\74\x69\156\x70\x75\164\40\164\x79\x70\145\x3d\42\x68\x69\144\x64\x65\156\x22\x20\151\144\x3d\x22" . $id . "\x22\40\166\x61\x6c\x75\x65\x3d\x22" . $i . "\x22\x3e\12\x20\x20\40\40\x20\40\40\40\x3c\x61\x20\157\156\x63\x6c\x69\x63\x6b\75\42\156\165\155\x70\141\x67\50\x24\x28\x27\43" . $id . "\47\x29\x2e\166\x61\x6c\50\x29\51\73\42\x20\143\154\x61\163\x73\75\42\x77\63\x2d\x62\x61\x72\x2d\x69\x74\145\x6d\40\x77\x33\x2d\x62\165\164\x74\x6f\x6e\x20" . $hover . "\42\x3e" . $i . "\74\57\141\76"; } else { $hover = ''; $html .= "\x3c\151\156\160\x75\x74\40\x74\x79\x70\x65\x3d\x22\x68\x69\144\x64\x65\156\42\40\x69\144\75\42" . $id . "\42\x20\166\141\x6c\x75\145\75\x22" . $i . "\x22\76\12\40\40\x20\x20\x20\x20\x20\x20\x3c\x61\40\x6f\156\143\154\151\x63\x6b\x3d\42\x6e\165\x6d\x70\x61\x67\50\x24\50\47\43" . $id . "\x27\x29\x2e\166\141\154\x28\51\51\x3b\42\40\143\154\141\163\163\x3d\42\x77\63\55\142\141\x72\x2d\151\x74\x65\x6d\40\167\x33\55\x62\x75\x74\x74\x6f\156\40" . $hover . "\x22\76" . $i . "\x3c\x2f\x61\x3e"; } } } $html .= "\x3c\x69\156\160\x75\x74\40\164\x79\x70\x65\75\42\x68\x69\144\144\x65\156\x22\40\x69\144\x3d\x22\111\156\143\162\151\x6d\x65\x6e\164\116\165\155\x22\40\x76\x61\154\x75\145\75\42" . $IncrimentNum . "\x22\x3e\xa\x20\x20\40\x20\40\40\x20\x20\x3c\x61\40\157\156\143\154\151\143\153\75\x22\111\x6e\143\x72\x69\155\145\x6e\164\x4e\x75\x6d\x28\51\73\x22\40\143\154\141\163\x73\x3d\42\x77\63\x2d\142\x61\x72\55\151\x74\145\x6d\x20\x77\63\x2d\x62\165\164\164\157\156\x22\x3e\46\162\x61\x71\165\157\73\74\57\141\x3e\xa\xa\40\x20\40\x20\40\40\x20\40\74\x2f\144\151\166\76\x20"; return $html; } function afectafac($prov) { $fac = $this->db->query("\x53\x45\x4c\105\103\x54\40\144\x6f\x63\165\x6d\x65\156\x74\157\x20\x46\122\117\115\40\143\157\155\x70\162\141\163\40\127\x48\x45\122\x45\x20\x74\151\160\x6f\x64\157\x63\75\x27\106\101\103\x27\x20\x26\x26\x20\160\162\x6f\x76\145\145\144\x3d\x27{$prov}\47")->result(); $html = "\74\x69\x6e\160\165\x74\x20\164\x79\160\145\x3d\x22\164\145\x78\164\x22\x20\143\x6c\x61\x73\x73\x3d\42\167\63\x2d\x69\156\x70\x75\x74\x22\40\151\x64\75\x22\151\x64\141\146\x65\x63\x74\x61\146\x61\x63\42\x20\x70\154\x61\143\x65\150\x6f\154\144\x65\162\x3d\x22\146\x61\143\x74\x75\162\x61\x20\141\x66\x65\143\x74\141\x64\x61\x2e\x2e\x2e\x22\40\x6c\151\163\164\75\42\146\141\143\42\x3e\x3c\x64\x61\164\x61\x6c\151\163\x74\x20\151\x64\75\x22\146\141\x63\x22\x3e"; foreach ($fac as $dfac) { $html .= "\74\157\x70\x74\151\157\156\40\x76\x61\x6c\165\x65\75\x22" . $dfac->documento . "\x22\x3e" . $dfac->documento . "\x3c\x2f\x6f\x70\x74\x69\157\x6e\x3e"; } $html .= "\74\x2f\144\x61\164\141\x6c\x69\163\x74\76"; return $html; } function regcompra($prov, $fecha, $tipodoc, $ncontrol, $doc, $ref, $excento, $baseimp, $iva, $total) { $i = 0; $tasa = $this->db->query("\x53\x45\114\105\103\x54\x20\x6f\x66\151\x63\x69\x61\x6c\40\x46\122\x4f\115\x20\x6d\x6f\156\145\x63\141\x6d\40\x57\110\x45\x52\x45\40\x66\145\143\150\141\74\75\47{$fecha}\47\40\117\122\104\x45\x52\40\102\131\40\146\145\143\150\x61\x20\104\x45\123\103\40\x4c\x49\x4d\x49\124\x20\x31")->row()->oficial; $subtotal = $excento + $baseimp; $totald = $total / $tasa; $this->db->insert("\143\x6f\155\160\x72\x61\x73", array("\160\x72\157\166\x65\x65\x64" => $prov, "\x74\151\160\157\144\157\x63" => $tipodoc, "\x64\157\143\165\155\145\x6e\164\x6f" => $doc, "\x6e\143\157\x6e\164\x72\x6f\154" => $ncontrol, "\x72\145\146\x65\x72\145\x6e\x63\x69\x61" => $ref, "\144\145\163\143\162\151\x70" => '', "\x73\x75\142\164\x6f\164\141\154" => $subtotal, "\163\x69\x6e\151\155\160\165\x65\x73\x74" => $excento, "\142\141\x73\145\151\x6d\160\x6f" => $baseimp, "\x74\x6f\x74\151\x6d\160\x75\145\163\164" => $iva, "\164\157\164\x61\154" => $total, "\x74\x6f\164\x61\154\x64" => $totald, "\x66\x65\x63\x68\141\x64\x6f\x63" => $fecha, "\146\145\x63\150\141\171\x68\157\x72\x61" => date("\131\x2d\x6d\55\x64\x20\x48\x3a\x69\72\x73"))); if ($this->db->affected_rows() > 0) { $i++; } if ($i > 0 && $iva > 0) { $alic = $this->db->query("\123\x45\114\105\103\124\40\162\145\x74\x69\145\x6e\145\x20\x46\122\x4f\x4d\40\x70\x72\157\166\x65\145\x64\40\x57\x48\x45\x52\x45\40\151\x64\x3d\47{$prov}\47")->row()->retiene; if ($alic > 0) { $retiene = $iva * ($alic / 100); $this->regretcomp($prov, $fecha, $tipodoc, $doc, $alic, $retiene); } } return $i; } function editcompra($id, $excento, $baseimp, $iva, $total) { $i = 0; $tasa = $this->db->query("\123\105\114\x45\x43\124\40\x28\123\105\x4c\x45\x43\124\x20\157\x66\151\143\x69\141\154\40\106\122\117\x4d\x20\x6d\157\x6e\x65\x63\141\x6d\40\x57\110\105\x52\x45\40\x66\145\143\x68\141\x3c\x3d\141\56\146\x65\143\x68\x61\x64\x6f\x63\40\x4f\x52\104\x45\122\40\102\131\x20\146\145\143\150\x61\x20\x44\105\123\x43\40\x4c\x49\115\x49\124\x20\x31\x29\40\157\x66\151\143\151\x61\x6c\x20\106\122\x4f\x4d\40\143\157\x6d\x70\x72\141\x73\40\141\x20\x57\110\105\x52\x45\40\103\x4f\x4e\x43\101\x54\50\x61\56\x70\162\157\166\x65\x65\x64\x2c\x61\56\x74\x69\x70\157\144\x6f\143\54\x61\56\x64\x6f\143\x75\155\x65\x6e\164\157\51\x3d\47{$id}\47")->row()->oficial; $subtotal = $excento + $baseimp; $totald = $total / $tasa; $this->db->where("\103\x4f\x4e\103\101\x54\x28\160\x72\x6f\x76\145\x65\x64\x2c\164\151\x70\157\x64\157\143\x2c\x64\157\143\165\155\145\156\164\x6f\51\x3d\47{$id}\x27")->update("\143\157\155\160\x72\x61\163", array("\163\x69\156\x69\x6d\160\x75\145\x73\x74" => $excento, "\142\x61\x73\x65\151\155\x70\x6f" => $baseimp, "\164\x6f\x74\151\x6d\160\165\145\x73\x74" => $iva, "\164\157\164\141\154" => $total, "\x74\x6f\x74\141\154\144" => $totald)); if ($this->db->affected_rows() > 0) { $i++; } if ($i > 0 && $iva > 0) { $alic = $this->db->query("\123\105\x4c\x45\103\x54\40\x62\x2e\x69\x64\x2c\x62\56\162\145\164\x69\145\156\x65\x2c\141\56\164\x69\160\x6f\x64\x6f\x63\x2c\x61\x2e\144\x6f\x63\x75\x6d\145\156\x74\x6f\x20\106\x52\x4f\x4d\40\143\157\x6d\160\x72\141\163\40\141\x20\x4a\x4f\111\x4e\40\160\162\x6f\166\145\x65\x64\x20\142\x20\x4f\x4e\40\x61\56\160\x72\x6f\166\x65\x65\x64\x3d\142\x2e\151\x64\40\127\110\x45\122\x45\x20\103\117\x4e\x43\101\x54\x28\141\56\160\x72\157\166\145\145\x64\x2c\x61\56\x74\151\x70\157\144\x6f\x63\54\x61\56\144\x6f\x63\x75\x6d\x65\x6e\x74\x6f\51\75\47{$id}\47")->row(); if ($alic->retiene > 0) { $retiene = $iva * ($alic->retiene / 100); $this->editretcomp($alic->id, $alic->documento, $excento, $baseimp, $iva, $total, $totald, $retiene); } } return $i; } function editretcomp($prov, $doc, $excento, $base, $iva, $total, $totald, $monto) { $this->db->query("\125\x50\x44\101\x54\x45\x20\143\x6f\155\160\162\x61\163\40\123\x45\x54\x20\163\151\x6e\151\x6d\x70\x75\145\x73\x74\75\x27{$excento}\x27\54\142\x61\x73\145\151\155\160\157\x3d\47{$base}\x27\x2c\164\157\x74\x69\x6d\x70\165\145\x73\x74\x3d\47{$iva}\47\x2c\x74\x6f\164\141\x6c\75\47{$total}\47\x2c\x74\157\x74\x61\154\x64\75\x27{$totald}\x27\x2c\x20\x72\145\x74\x69\145\x6e\x65\75\47{$monto}\x27\xa\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\x57\x48\x45\x52\x45\x20\x70\162\x6f\166\x65\x65\144\75\x27{$prov}\47\x20\x26\x26\x20\x74\151\x70\x6f\144\157\x63\75\47\x52\105\124\x27\40\46\46\x20\144\x6f\x63\x75\155\145\x6e\164\x6f\x3d\47{$doc}\x27"); } public function combo($a, $b) { $this->load->library("\164\x61\x62\154\x65"); if ($b != '') { $filter = "\x57\x48\x45\122\x45\40\156\157\x6d\x3d\47{$b}\x27"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\105\114\x45\x43\x54\40\x20\52\x20\x46\x52\117\x4d\x20\143\157\155\142\x6f\x3b")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\114\105\x43\x54\x20\52\x20\106\x52\x4f\x4d\40\143\157\x6d\x62\157\40{$filter}\x20\x4c\111\x4d\111\x54\40" . ($a - 1) * $mostrar . "\x20\x2c\40" . $mostrar . "\73")->result(); $html = "\12\40\x20\40\40\74\x74\x61\142\x6c\x65\x20\143\x6c\x61\x73\x73\75\42\x77\63\x2d\x74\x61\142\x6c\x65\x2d\x61\x6c\154\x20\167\x33\x2d\x68\x6f\x76\145\162\x61\142\154\x65\x20\x77\x33\x2d\154\145\x66\164\x2d\141\x6c\x69\x67\156\42\x3e\12\40\x20\40\40\74\164\x72\76\74\x74\144\40\x63\154\141\163\x73\75\42\x77\63\55\146\x6f\x6e\144\157\x64\x72\157\x69\144\42\76\102\165\163\143\141\162\40\x3c\151\155\147\40\163\162\x63\x3d\42" . base_url() . "\x69\x6d\x61\x67\x65\x73\57\142\x75\x73\143\141\x72\x2e\160\x6e\147\42\40\x61\154\x74\x3d\x22\x42\165\163\x63\141\x72\x22\x20\164\x69\x74\x6c\x65\x3d\x22\102\x75\163\143\141\x72\x22\x20\163\x74\x79\154\x65\x3d\x22\167\x69\x64\x74\x68\x3a\61\70\160\x78\x3b\x62\157\162\144\145\162\x3a\60\73\42\x3e\74\57\x74\144\76\12\x20\40\40\40\74\x74\x64\76\x3c\151\x6e\x70\165\164\40\x74\171\160\x65\x3d\x22\164\145\170\x74\42\40\x63\x6c\x61\163\163\75\x22\167\x33\55\x69\156\160\165\164\x22\40\x70\x6c\141\x63\145\150\157\x6c\144\x65\162\75\x22\111\156\x67\162\145\x73\145\40\x73\x75\x20\142\x75\x73\x71\x75\x65\x64\x61\x22\40\x6f\x6e\143\150\141\156\147\x65\75\42\x6f\162\144\x63\x28\51\42\40\x69\144\x3d\x22\154\151\x6b\145\157\162\x64\143\42\x3e\x3c\x2f\x74\x64\x3e\12\40\40\x20\40\x3c\164\144\40\143\x6c\x61\163\x73\x3d\42\x77\x33\x2d\x63\x65\x6e\x74\145\162\x20\x77\63\x2d\x62\164\x6e\42\x3e\74\141\x20\x6f\156\x63\154\151\x63\153\75\x22\x77\63\56\x73\150\x6f\x77\50\47\x23\x66\157\162\x6d\x63\x6f\x6d\x62\157\x27\x29\x3b\x22\x3e\74\x69\x6d\x67\x20\x73\x72\x63\x3d\42" . base_url() . "\151\155\141\147\145\163\57\x72\x65\147\151\163\164\x72\x61\x72\56\x70\x6e\147\42\x20\141\154\164\75\x22\x52\x65\x67\x69\x73\x74\162\141\162\40\x43\157\x6d\142\157\42\40\164\x69\164\154\x65\x3d\x22\122\145\147\x69\163\x74\162\x61\x72\x20\x43\x6f\155\x62\x6f\x22\40\163\164\x79\154\x65\x3d\42\167\151\144\164\150\x3a\62\x30\160\170\x3b\150\145\x69\x67\150\164\x3a\62\60\x70\x78\73\142\x6f\162\144\145\162\x3a\60\73\x22\76\74\57\141\x3e\x3c\57\164\x64\x3e\12\40\x20\40\40\x3c\164\144\x20\x63\154\x61\163\x73\75\x22\x77\63\x2d\x63\x65\156\x74\145\x72\x20\167\x33\x2d\x62\164\x6e\x22\76\74\x61\x20\x6f\x6e\x63\x6c\x69\x63\153\75\42\x63\x6f\x6d\x62\x6f\x28\x29\73\x22\x3e\74\151\155\147\40\x73\162\143\x3d\x22" . base_url() . "\x69\155\141\x67\145\163\57\162\x65\154\x6f\141\x64\56\160\x6e\147\x22\x20\x61\154\x74\75\42\122\145\143\141\x72\x67\x61\x72\42\x20\x74\x69\164\x6c\x65\x3d\x22\x52\x65\x63\141\162\147\141\162\x22\x20\163\164\171\154\x65\75\42\167\151\144\x74\x68\x3a\x32\x30\160\x78\73\x68\145\x69\147\150\164\72\x32\x30\x70\170\x3b\142\157\x72\144\x65\162\x3a\60\x3b\42\x3e\x3c\57\141\76\74\57\x74\144\76\12\40\x20\x20\x20\74\x74\144\40\x63\154\x61\x73\x73\x3d\x22\167\63\55\143\x65\x6e\x74\x65\162\40\x77\x33\x2d\x62\164\x6e\42\76\x3c\x61\40\x6f\x6e\x63\x6c\151\x63\x6b\75\x22\x65\154\151\x6d\x63\x6f\x6d\x62\x6f\x28\51\73\x22\76\74\151\x6d\147\40\163\162\x63\75\x22" . base_url() . "\151\x6d\141\147\145\x73\57\x62\x6f\162\162\x61\x72\56\x70\156\x67\42\x20\141\154\164\x3d\x22\105\x6c\151\x6d\x69\156\x61\162\x22\40\164\151\164\154\145\x3d\42\x45\x6c\151\155\151\156\x61\x72\x22\40\x73\x74\x79\x6c\145\75\42\167\x69\x64\164\150\72\62\60\x70\170\73\x68\145\151\147\150\164\x3a\62\x30\x70\x78\x3b\x62\157\162\144\x65\x72\x3a\60\x3b\42\x3e\74\x2f\x61\x3e\74\x2f\x74\144\x3e\x3c\57\164\162\76\12\40\40\x20\40\74\x2f\164\141\x62\154\x65\76\74\x62\x72\76\12\x20\x20\x20\40\74\164\141\142\154\145\x20\151\144\75\x22\151\x64\60\61\42\40\143\x6c\x61\x73\163\75\x22\167\x33\x2d\x74\x61\x62\x6c\145\x2d\141\x6c\x6c\40\x77\63\55\150\157\166\x65\x72\x61\142\154\145\x20\167\63\x2d\154\x65\146\164\x2d\141\154\151\147\x6e\40\167\63\x2d\x74\x69\x6e\171\x22\76\74\x74\162\40\x63\154\141\163\163\75\x22\167\63\55\x66\x6f\156\x64\x6f\144\162\x6f\151\144\x22\76\x3c\164\x68\76\x49\144\74\57\164\x68\76\74\164\x68\x3e\116\157\x6d\142\162\145\x3c\x2f\x74\150\x3e\x3c\164\150\x3e\120\162\145\143\x69\x6f\74\x2f\x74\x68\76\74\x2f\x74\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\164\162\40\x69\x64\75\x22\x73\x6c\145\x63\x74" . $i . "\x22\x20\157\156\143\154\151\x63\153\x3d\x22\x69\x74\143\x6f\x6d\142\157\50" . $dtfac->id . "\51\x3b\x22\x3e\74\x69\x6e\x70\165\164\40\164\171\x70\145\75\42\x68\151\144\144\145\x6e\42\x20\x6e\141\x6d\x65\75\x22\151\x64\143\x6f\x6d\x62\157\42\x20\166\x61\154\165\x65\x3d\42" . $dtfac->id . "\42\76\12\x20\40\40\x20\x20\x20\40\74\164\144\x3e\74\x69\x6e\x70\x75\164\x20\164\x79\160\x65\75\42\x63\x68\x65\x63\x6b\142\157\x78\42\x20\x63\x6c\x61\x73\163\75\x22\167\63\55\x63\150\145\x63\153\42\x20\156\x61\x6d\x65\x3d\42\x63\150\145\143\x6b\x63\157\155\x62\157\x22\40\x6f\x6e\143\x6c\151\143\x6b\x3d\42\x77\x33\56\x74\157\147\147\x6c\x65\x43\x6c\141\163\x73\50\x27\43\163\x6c\x65\143\164" . $i . "\x27\x2c\47\167\x33\55\x79\x65\x6c\x6c\157\x77\47\51\73\x22\76" . $dtfac->id . "\74\x2f\x74\x64\x3e\x20\74\164\x64\x3e" . $dtfac->nom . "\x3c\57\x74\144\76\74\164\144\x3e" . $dtfac->precio . "\x3c\x2f\164\144\x3e\12\x20\40\40\40\40\40\40\74\57\x74\x72\x3e"; } $html .= "\74\164\x72\76\74\164\x64\x20\143\x6c\x61\163\x73\x3d\42\x77\63\55\143\x65\156\x74\145\162\40\167\x33\55\146\157\x6e\144\157\144\162\x6f\151\144\x22\x20\143\157\x6c\163\x70\x61\156\x3d\42\62\x22\x3e\x3c\x6c\141\x62\x65\x6c\40\x63\x6c\x61\x73\x73\75\42\167\63\55\154\x61\x72\x67\x65\42\76\74\142\x3e\124\x6f\x74\141\154\x20\103\x6f\155\x62\x6f\x73\72\x20" . $totalreg . "\74\57\142\76\74\57\x6c\x61\142\145\x6c\x3e\74\57\x74\144\x3e\x3c\x2f\x74\162\76\74\57\x74\141\x62\154\x65\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\40\40\40\x20\40\40\x20\x3c\163\x63\162\151\160\164\x20\164\171\160\145\75\x22\x74\145\170\164\57\x6a\141\x76\x61\x73\143\162\x69\x70\164\x22\x3e\12\40\x20\x20\40\40\40\x20\x20\146\x75\156\x63\x74\151\x6f\x6e\40\104\145\x63\162\145\155\145\x6e\x74\116\165\155\x28\x29\x7b\x20\142\145\x66\157\162\145\50\51\73\xa\40\x20\x20\40\40\40\40\40\40\40\x20\x20\x76\141\162\x20\x44\145\143\162\x65\x6d\145\x6e\164\x4e\165\155\75\144\157\x63\x75\x6d\145\156\x74\x2e\x67\145\x74\x45\x6c\145\x6d\145\156\164\x42\171\x49\x64\50\42\104\145\143\162\x65\155\145\x6e\164\116\165\155\42\51\56\x76\141\154\x75\145\x3b\12\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\166\x61\x72\x20\153\145\x79\75\x22\144\x72\x6f\x69\x64\71\60\x33\42\73\xa\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\166\141\x72\40\144\x61\164\x6f\163\40\x3d\x20\173\xa\40\40\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\42\160\141\x67\x22\x20\72\40\x44\x65\143\162\x65\155\145\156\x74\x4e\165\155\54\xa\40\x20\40\40\40\40\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\x22\153\145\171\42\40\72\x20\x6b\145\x79\xa\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\40\175\x3b\12\40\x20\x20\40\40\40\40\x20\x20\x20\40\12\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x24\x2e\141\x6a\x61\170\50\x7b\12\x20\40\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\40\144\x61\164\x61\x3a\x20\144\x61\164\157\163\x2c\12\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x75\x72\x6c\72\40\x20\142\x61\x73\x65\165\162\154\53\42\x63\137\x64\x72\157\151\x64\57\x63\x6f\x6d\142\x6f\42\54\12\40\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\40\x74\171\x70\145\x3a\x20\x22\x50\117\x53\x54\x22\54\xa\40\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x73\165\x63\x63\x65\x73\163\72\40\x66\x75\156\143\x74\x69\x6f\x6e\50\x64\141\164\x61\51\40\x7b\xa\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\x24\50\42\x23\142\x6f\x64\171\42\x29\x2e\150\164\x6d\x6c\x28\x64\141\x74\x61\51\73\12\40\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\40\40\40\x20\x20\40\175\12\40\40\40\x20\x20\x20\40\x20\x20\40\x20\12\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\175\x29\73\12\x20\40\40\40\40\40\40\x20\40\40\40\x7d\xa\40\x20\40\40\x20\x20\40\40\12\40\x20\40\x20\40\40\x20\x20\40\x20\40\x66\x75\156\143\164\x69\157\x6e\x20\156\165\155\x70\141\x67\50\x61\x29\173\40\142\x65\x66\157\x72\x65\x28\51\x3b\xa\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x76\141\162\40\153\145\171\75\x22\144\x72\x6f\151\x64\x39\x30\63\x22\x3b\12\x20\x20\x20\x20\40\40\x20\x20\xa\40\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x76\x61\162\x20\144\141\164\157\x73\40\x3d\40\173\xa\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x22\153\145\x79\x22\x3a\x6b\145\x79\x2c\12\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\42\x70\x61\147\x22\x20\x3a\x20\141\12\x20\40\x20\x20\40\40\40\40\40\x20\40\40\x20\40\40\175\73\12\40\40\x20\x20\x20\40\x20\40\x20\40\40\12\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\44\56\x61\x6a\141\x78\50\x7b\xa\40\40\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x64\141\x74\x61\x3a\x20\x64\141\164\x6f\163\x2c\xa\x20\x20\40\x20\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x75\162\x6c\x3a\40\x62\x61\163\145\165\x72\154\x2b\42\x63\x5f\x64\x72\157\151\x64\x2f\x63\x6f\155\142\157\42\54\xa\x20\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\x74\x79\160\145\x3a\40\x22\x50\117\123\x54\42\x2c\12\40\40\40\x20\x20\x20\40\40\x20\40\40\40\40\40\x20\40\40\x20\40\163\x75\x63\x63\x65\x73\x73\x3a\40\146\165\156\143\x74\x69\157\156\50\x64\x61\164\x61\51\40\173\xa\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\44\50\x22\x23\142\x6f\x64\171\42\x29\x2e\x68\164\155\x6c\x28\144\x61\x74\141\x29\x3b\12\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\175\12\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\12\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\x7d\51\x3b\12\40\x20\x20\40\x20\x20\x20\40\x20\40\40\x7d\12\40\40\40\40\40\40\40\x20\12\x20\x20\40\40\40\x20\40\x20\x20\x20\40\146\165\156\x63\164\x69\157\156\x20\x49\156\143\162\x69\x6d\145\x6e\164\x4e\x75\x6d\x28\51\173\x20\142\x65\146\x6f\x72\145\x28\x29\x3b\12\x20\40\40\40\40\40\x20\40\40\40\40\x20\x76\x61\x72\x20\111\x6e\x63\162\151\x6d\x65\156\164\116\x75\155\x3d\144\157\x63\165\x6d\x65\156\x74\56\147\145\x74\x45\x6c\x65\155\145\156\x74\x42\171\x49\x64\x28\42\x49\x6e\143\x72\151\155\145\x6e\164\116\x75\x6d\42\x29\x2e\166\141\x6c\165\145\73\xa\40\x20\x20\x20\x20\40\40\x20\40\40\40\40\x76\x61\x72\x20\x6b\145\x79\75\x22\144\162\x6f\x69\x64\x39\60\x33\42\x3b\xa\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\166\141\162\x20\x64\141\x74\157\163\x20\75\40\x7b\12\40\x20\40\40\40\40\40\40\40\x20\x20\40\40\40\x20\x20\40\40\40\40\42\153\x65\171\42\72\x6b\x65\171\54\12\40\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\42\x70\x61\x67\42\40\x3a\x20\111\156\143\x72\151\155\145\x6e\x74\x4e\165\x6d\12\x20\x20\40\x20\40\40\x20\x20\40\40\x20\40\40\x20\x20\x7d\x3b\xa\x20\40\x20\x20\40\x20\x20\40\40\40\x20\xa\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x24\56\141\152\141\x78\x28\x7b\12\x20\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\144\141\164\x61\x3a\40\144\x61\164\x6f\163\54\12\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x75\162\154\72\40\40\x62\141\163\145\x75\x72\x6c\x2b\42\143\x5f\144\x72\x6f\x69\144\57\143\x6f\x6d\x62\x6f\x22\x2c\xa\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\x74\171\160\145\x3a\40\x22\x50\x4f\123\124\x22\x2c\12\40\x20\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x20\40\163\x75\143\x63\x65\163\163\72\x20\x66\165\156\x63\164\x69\x6f\x6e\x28\144\141\164\x61\51\40\173\xa\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\44\x28\42\43\x62\x6f\x64\171\42\x29\x2e\150\164\x6d\x6c\50\x64\x61\164\141\51\x3b\12\40\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\175\12\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\xa\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x7d\51\x3b\xa\40\40\x20\40\x20\40\x20\x20\40\40\40\175\xa\x20\40\x20\x20\40\x20\x20\x20\x3c\57\163\143\x72\x69\160\164\x3e\xa\x20\x20\40\x20\x20\40\x20\x20\74\x64\x69\166\x20\143\x6c\141\x73\x73\75\x22\167\x33\x2d\142\x61\x72\x20\167\63\x2d\142\x6f\162\x64\145\162\40\167\x33\55\142\141\162\162\x61\x73\x22\76\12\x20\40\40\x20\40\40\40\40\x3c\151\156\x70\165\164\40\x74\171\x70\145\75\42\150\151\144\144\145\156\42\40\151\144\75\42\104\x65\x63\162\145\x6d\x65\156\x74\x4e\165\155\x22\40\x76\141\154\x75\145\x3d\42" . $DecrementNum . "\42\76\12\x20\40\40\40\40\40\40\x20\x3c\x61\40\x6f\x6e\x63\x6c\x69\x63\x6b\75\42\x44\x65\x63\162\145\155\145\156\x74\x4e\x75\155\50\x29\73\x22\40\x63\154\141\x73\163\75\x22\167\x33\x2d\x62\141\162\x2d\x69\x74\x65\155\x20\167\63\x2d\142\x75\164\x74\x6f\x6e\42\76\x26\x6c\141\x71\165\157\73\x3c\x2f\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\144\160\141\x67\x69\x6e\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\63\55\146\x6f\x6e\x64\x6f\144\162\157\151\144"; $html .= "\12\x20\40\x20\40\x20\40\x20\x20\x3c\151\x6e\x70\165\164\40\x74\171\160\145\x3d\42\x68\151\x64\x64\145\x6e\x22\x20\151\x64\75\x22" . $id . "\x22\x20\166\141\x6c\x75\x65\x3d\x22" . $i . "\42\x3e\xa\40\x20\x20\40\x20\40\40\40\x3c\141\40\157\156\x63\154\151\x63\x6b\x3d\x22\x6e\165\x6d\x70\141\x67\x28\44\x28\47\x23" . $id . "\x27\51\56\x76\x61\154\x28\51\x29\x3b\x22\40\x63\154\141\163\163\x3d\x22\x77\63\x2d\x62\x61\x72\55\x69\x74\145\x6d\40\167\x33\x2d\142\165\164\x74\x6f\x6e\x20" . $hover . "\42\76" . $i . "\x3c\x2f\x61\76"; } else { $hover = ''; $html .= "\74\151\156\160\165\164\x20\164\x79\x70\x65\x3d\42\150\151\x64\x64\x65\156\x22\x20\151\144\75\42" . $id . "\x22\40\166\x61\x6c\165\145\x3d\42" . $i . "\42\76\xa\x20\40\40\x20\x20\40\x20\x20\x3c\x61\x20\x6f\x6e\x63\x6c\x69\143\153\75\42\x6e\165\155\x70\x61\147\x28\44\x28\47\43" . $id . "\47\51\x2e\x76\141\154\x28\51\51\x3b\x22\x20\143\154\141\163\163\x3d\42\167\x33\x2d\x62\141\x72\55\151\x74\x65\155\x20\x77\x33\55\142\x75\164\164\x6f\x6e\40" . $hover . "\42\x3e" . $i . "\74\57\141\x3e"; } } } $html .= "\74\151\x6e\160\x75\164\40\x74\171\x70\x65\75\x22\150\x69\x64\x64\145\x6e\42\40\x69\144\x3d\42\111\x6e\143\x72\151\155\145\x6e\164\116\165\155\42\x20\166\141\154\x75\145\75\42" . $IncrimentNum . "\x22\x3e\12\x20\40\x20\x20\x20\40\40\x20\74\141\x20\157\x6e\143\x6c\151\x63\153\75\42\x49\156\143\x72\x69\x6d\x65\x6e\164\116\165\155\50\51\73\42\40\143\x6c\x61\x73\x73\x3d\x22\167\x33\55\x62\x61\x72\x2d\x69\164\145\155\x20\167\x33\x2d\x62\x75\164\164\x6f\x6e\42\76\x26\162\141\161\165\x6f\x3b\x3c\x2f\x61\76\12\12\40\40\40\40\40\40\40\x20\74\57\x64\151\166\x3e\40"; return $html; } public function itcombo($a) { $this->load->library("\164\141\142\154\x65"); $bditfac = $this->db->query("\x53\x45\114\x45\x43\124\x20\x61\x2e\x69\144\x63\157\155\x62\157\54\x61\56\143\157\x64\151\x67\x6f\x2c\x62\56\x6e\x6f\155\x62\162\x65\54\141\x2e\x63\x61\x6e\164\x69\x64\x61\144\40\x46\122\117\x4d\x20\x69\x74\x63\x6f\x6d\142\157\x20\141\x20\112\x4f\x49\x4e\40\x61\162\x74\151\x63\x75\x6c\x6f\x20\x62\x20\117\x4e\x20\141\56\x63\x6f\x64\x69\147\157\x3d\142\56\143\157\144\x69\147\x6f\40\x57\x48\x45\x52\105\40\141\x2e\151\144\143\x6f\155\x62\157\75\47{$a}\x27\73")->result(); $bdarti = $this->db->query("\123\x45\114\x45\x43\124\x20\141\x2e\143\x6f\x64\151\147\157\54\141\x2e\156\157\155\x62\x72\145\x20\x46\122\x4f\x4d\40\x61\162\164\x69\x63\165\x6c\x6f\40\141\40\127\110\105\x52\x45\x20\141\x2e\x65\x78\x69\x73\164\145\156\x63\x69\x61\76\x30")->result(); $art = "\74\x69\x6e\160\165\x74\40\x74\171\x70\x65\75\x22\164\x65\170\164\x22\40\143\154\x61\163\163\75\42\x77\x33\55\151\156\160\165\x74\x22\x20\151\144\x3d\x22\143\x6f\144\151\147\157\x22\40\154\x69\x73\164\x3d\42\x6c\151\x73\164\141\x72\x74\151\42\x20\x70\x6c\x61\143\x65\x68\x6f\154\144\145\x72\75\x22\x50\x72\x6f\144\165\143\x74\157\56\x2e\x2e\42\x3e\74\x64\x61\164\x61\154\151\163\x74\40\x69\x64\x3d\x22\x6c\151\x73\x74\141\162\x74\x69\42\x3e"; foreach ($bdarti as $dbarti) { $art .= "\74\x6f\x70\x74\x69\157\156\x20\166\x61\154\165\x65\x3d\x22" . $dbarti->codigo . "\x22\x3e" . $dbarti->nombre . "\x3c\x2f\x6f\160\x74\x69\157\156\76"; } $art .= "\74\57\144\x61\164\141\154\151\163\164\76"; $formreg = "\74\164\x72\x3e\x3c\x69\x6e\160\165\x74\40\164\x79\x70\x65\75\x22\x68\151\x64\x64\145\x6e\x22\40\151\144\x3d\42\143\x6f\x6d\x62\x6f\x22\40\x76\141\x6c\x75\145\x3d\42" . $a . "\x22\x3e\x3c\x74\144\x3e" . $art . "\x3c\x2f\164\144\76\x3c\x74\144\x3e\116\57\x41\74\57\164\144\76\74\x74\144\x3e\x3c\151\x6e\160\x75\x74\x20\x74\171\x70\x65\x3d\x22\164\x65\x78\164\x22\x20\143\x6c\x61\163\x73\x3d\x22\167\x33\55\x69\x6e\160\x75\164\x22\x20\x69\x64\75\x22\x63\x61\x6e\x74\x22\40\x70\154\141\x63\145\150\x6f\x6c\144\145\x72\75\x22\x6e\42\x20\163\164\x79\154\x65\x3d\x22\167\151\144\x74\x68\x3a\63\60\160\170\x3b\42\x3e\x3c\x2f\x74\x64\76\xa\x20\40\x20\40\74\x74\144\x20\x63\154\x61\x73\163\75\x22\x77\x33\x2d\142\x74\156\42\76\x3c\x61\40\x6f\156\x63\154\151\x63\x6b\x3d\42\x72\145\147\x69\x74\x63\157\155\x62\x6f\50\51\x3b\x22\76\x3c\x69\x6d\147\40\163\x72\143\x3d\x22" . base_url() . "\x69\x6d\x61\x67\145\x73\57\x72\145\x67\x69\163\x74\x72\x61\162\56\160\156\x67\x22\40\x61\154\x74\x3d\42\x52\145\x67\x69\163\164\162\x61\162\x20\x49\164\x65\x6d\42\x20\164\151\x74\154\x65\x3d\42\x52\x65\x67\151\x73\x74\x72\x61\x72\x20\111\x74\145\x6d\x22\40\x73\164\x79\x6c\x65\x3d\42\167\151\x64\164\x68\72\62\x30\x70\x78\73\x68\x65\151\x67\150\x74\72\62\60\160\x78\x3b\x62\157\x72\144\x65\x72\x3a\60\x3b\42\x3e\x3c\x2f\x61\76\x3c\57\164\x64\76\74\x2f\x74\162\76"; $html = "\12\x20\40\40\40\74\164\141\x62\x6c\145\40\143\x6c\141\163\163\x3d\42\167\63\55\x74\x61\142\154\x65\55\x61\154\x6c\40\x77\x33\x2d\x68\157\166\x65\162\141\142\154\x65\x20\167\63\x2d\x6c\145\x66\x74\x2d\x61\x6c\151\147\x6e\40\167\x33\55\x74\x69\156\x79\42\x3e\x3c\x74\162\x20\143\154\x61\163\x73\75\42\167\63\55\146\x6f\156\x64\x6f\144\x72\x6f\151\144\x22\76\74\x74\x68\x3e\103\157\144\x69\147\157\x3c\x2f\164\x68\76\x3c\164\x68\76\116\x6f\x6d\142\x72\x65\74\x2f\164\x68\x3e\74\x74\x68\76\103\x61\156\164\x69\x64\141\144\74\x2f\x74\150\76\74\x74\150\x3e\74\57\x74\x68\76\x3c\57\x74\162\x3e"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; $html .= "\x3c\x74\x72\76\12\x20\x20\x20\x20\40\40\40\40\x3c\x74\144\x3e" . $dtitfac->codigo . "\74\57\x74\x64\x3e\x3c\x74\x64\x3e" . $dtitfac->nombre . "\x3c\x2f\164\144\x3e\x3c\x74\144\76" . $dtitfac->cantidad . "\74\57\x74\x64\76\74\164\x64\x3e\x3c\x61\x20\157\156\x63\154\151\x63\x6b\x3d\42\x65\154\x69\x6d\x69\x74\x63\157\x6d\142\157\50\x27" . $a . "\47\54\x27" . $dtitfac->codigo . "\x27\x29\x3b\x22\x3e\74\x69\x6d\147\40\x73\x72\143\x3d\42" . base_url() . "\x69\x6d\x61\x67\145\163\57\x62\157\162\x72\x61\162\56\160\x6e\x67\42\40\141\x6c\x74\75\x22\105\x6c\x69\155\151\156\141\162\x22\40\x74\151\164\x6c\x65\75\42\x45\154\x69\155\151\x6e\141\162\42\x20\163\x74\x79\x6c\x65\x3d\42\167\x69\x64\164\x68\72\62\x30\160\x78\x3b\150\x65\151\147\150\164\x3a\62\60\160\170\x3b\x62\x6f\162\144\145\162\72\60\73\x22\76\74\57\141\x3e\x3c\x2f\164\144\76\12\x20\x20\40\40\40\x20\x20\x20\x3c\57\164\162\76"; } $html .= '' . $formreg . "\74\57\x74\x61\142\x6c\145\x3e\x3c\142\x72\x3e\x3c\142\162\x3e"; return $html; } function editordc($a, $b, $c, $d) { $this->db->query("\x55\120\104\101\124\x45\x20\x6f\162\x64\x63\x20\x53\x45\124\x20\156\x70\162\145\163\75\47{$b}\47\x2c\156\143\157\x6e\x74\x72\157\154\x3d\x27{$c}\47\x2c\x66\145\x6d\x69\163\75\x27{$d}\x27\x20\127\110\105\x52\x45\x20\x69\x64\x3d\x27{$a}\47"); $i = 0; if ($this->db->affected_rows() > 0) { $i++; $this->db->query("\x55\x50\x44\101\124\x45\x20\151\164\157\162\144\143\x20\123\x45\124\x20\143\x6f\163\x74\157\162\x65\146\75\x52\x4f\125\x4e\104\x28\143\157\163\x74\157\57\x28\123\105\114\105\x43\x54\x20\157\x66\151\x63\151\141\x6c\x20\x46\122\x4f\x4d\x20\155\x6f\156\145\x63\x61\x6d\40\127\x48\x45\x52\105\x20\x66\x65\x63\x68\x61\x3c\75\x27{$d}\47\40\117\122\104\x45\122\40\x42\131\40\146\x65\x63\150\141\40\x44\105\x53\x43\x20\114\111\x4d\x49\x54\40\61\x29\54\64\x29\x20\x57\x48\105\122\105\40\157\162\x64\x63\75\x27{$a}\47"); if (substr($c, 0, 3) == "\x30\x30\55") { $fac = $this->db->query("\x53\105\x4c\x45\103\124\x20\x61\x2e\x70\162\157\x76\x65\x65\x64\x2c\40\x61\x2e\x66\x65\155\x69\x73\x20\x66\145\143\x68\x61\x2c\47\x46\x41\103\47\x20\x74\151\160\157\144\157\x63\54\x61\x2e\156\x63\157\x6e\164\162\157\154\x2c\141\x2e\x6e\x70\x72\x65\x73\40\144\157\143\x2c\123\x55\x4d\50\111\106\50\x62\56\151\166\x61\75\x30\x2c\142\x2e\x63\157\x73\164\x6f\x2a\142\56\143\x61\156\x74\54\x30\51\x29\x20\x65\x78\x63\x65\156\x74\x6f\x2c\12\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x53\125\115\50\111\x46\x28\142\56\151\166\x61\x3e\x30\54\x62\56\x63\x6f\163\x74\x6f\52\x62\56\x63\x61\156\164\x2c\x30\x29\x29\x20\x62\141\x73\145\x69\155\x70\54\123\125\115\x28\111\106\x28\142\x2e\151\x76\141\76\60\54\50\x62\x2e\143\157\x73\164\x6f\52\142\56\143\x61\x6e\x74\x29\x2c\x30\51\51\52\x28\x62\x2e\x69\166\x61\x2f\x31\x30\x30\x29\40\151\x76\141\xa\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x46\122\x4f\x4d\40\157\162\144\143\x20\x61\40\x4a\117\x49\116\40\x69\164\x6f\162\144\x63\x20\x62\40\117\116\40\x61\56\151\x64\x3d\x62\56\157\162\x64\x63\x20\x57\110\x45\x52\x45\40\141\x2e\x69\x64\x3d\47{$a}\47\x20\x47\122\x4f\x55\x50\40\x42\131\40\141\56\151\x64")->row(); $total = $fac->excento + $fac->baseimp + $fac->iva; $this->regcompra($fac->proveed, $fac->fecha, $fac->tipodoc, $fac->ncontrol, $fac->doc, '', $fac->excento, $fac->baseimp, $fac->iva, $total); } } return $i; } function formedititordc($ordc, $cod, $lote) { $bd = $this->db->query("\x53\105\x4c\105\x43\124\x20\145\154\x61\142\54\166\145\156\x63\x65\x2c\x6c\x6f\x74\145\54\143\x61\156\x74\54\x63\x6f\163\x74\x6f\x2c\163\164\141\x74\165\163\40\106\122\x4f\x4d\40\x69\x74\157\x72\x64\x63\x20\x57\110\105\x52\145\x20\x6f\162\x64\143\x3d\47{$ordc}\47\40\46\x26\40\x63\x6f\x64\151\147\157\x3d\x27{$cod}\47\40\x26\46\x20\154\157\x74\x65\x3d\x27{$lote}\47")->row(); return json_encode(array("\x65\x6c\141\x62" => $bd->elab, "\x76\145\x6e\x63\145" => $bd->vence, "\x63\x61\156\x74" => $bd->cant, "\x6c\x6f\164\145" => $bd->lote, "\143\x6f\x73\164" => $bd->costo, "\x73\164\141\x74\x75\x73" => $bd->status)); } function edititordc($ordc, $cod, $elab, $venc, $lot, $dlot, $cant, $cost, $stat, $alm) { $v = 0; $j = 0; $tasa = $this->db->query("\123\105\114\x45\x43\x54\x20\x28\x53\105\114\x45\x43\124\40\157\146\151\143\x69\141\154\40\x46\122\x4f\115\x20\x6d\x6f\156\145\x63\x61\155\x20\127\x48\105\122\x45\40\146\145\x63\150\x61\74\x3d\141\56\146\x65\x6d\x69\163\x20\x4f\122\x44\x45\122\x20\x42\131\x20\146\145\143\x68\141\x20\x44\x45\x53\x43\x20\114\x49\x4d\111\x54\x20\x31\x29\40\157\x66\151\143\151\x61\154\x20\x46\122\117\x4d\x20\x6f\162\144\143\x20\x61\x20\x57\x48\x45\x52\105\x20\x61\x2e\151\x64\75\x27{$ordc}\x27")->row()->oficial; $costoref = $cost / $tasa; $this->db->query("\x55\120\x44\x41\124\105\40\151\164\x6f\162\144\x63\40\x53\x45\124\40\145\x6c\141\x62\75\47{$elab}\x27\54\166\x65\156\x63\145\x3d\47{$venc}\47\x2c\x6c\157\x74\x65\75\x27{$dlot}\47\54\x63\x61\156\x74\75\47{$cant}\x27\x2c\163\x63\141\x6e\75\x27{$cant}\47\54\x63\157\x73\x74\x6f\x3d\47{$cost}\47\x2c\143\157\x73\164\157\x72\145\146\x3d\x27{$costoref}\47\40\127\x48\x45\122\x45\40\157\162\144\143\x3d\x27{$ordc}\x27\40\46\x26\40\143\x6f\x64\151\147\x6f\x3d\47{$cod}\47\40\46\46\40\x6c\x6f\x74\145\75\47{$lot}\47"); if ($this->db->affected_rows() > 0) { $v++; } if ($stat == 1 && $v > 0) { $val = $this->db->query("\x53\x45\114\105\x43\x54\x20\116\125\x4c\x4c\x20\106\122\x4f\115\40\x61\x72\x74\x69\x6c\x6f\x74\145\163\x20\x57\x48\105\x52\x65\x20\143\157\x64\151\x67\157\x61\162\164\x3d\47{$cod}\47\x20\46\x26\40\154\x6f\164\145\x3d\47{$lot}\47\40\x26\x26\x20\141\154\155\141\x63\x65\x6e\x3d\47{$alm}\47")->num_rows(); if ($val > 0) { $this->db->query("\125\x50\x44\x41\x54\105\40\141\x72\164\151\154\157\164\145\163\40\x73\145\x74\40\154\157\164\145\x3d\x27{$dlot}\47\x2c\145\154\x61\142\x3d\x27{$elab}\47\54\166\x65\156\143\x65\75\x27{$venc}\47\40\x57\x48\x45\122\105\40\x63\x6f\144\x69\147\x6f\141\x72\164\75\47{$cod}\47\40\46\46\x20\154\x6f\164\x65\75\x27{$lot}\47\40\46\46\x20\141\154\x6d\141\x63\145\x6e\x3d\x27{$alm}\47"); if ($this->db->affected_rows() > 0) { $j++; } } } $this->loguser("\x4d\157\x64\x69\146\151\x63\141\162\40\117\x72\x64\x65\156", "\x45\154\40\165\163\165\x61\x72\151\x6f\40\x6d\x6f\144\151\146\151\x63\x61\x20\x65\154\40" . $cod . "\40\x70\141\162\x61\x20\x6c\x61\x20\x6f\162\144\x65\x6e\x20" . $ordc . "\54\x20\154\157\x74\145\x20" . $lot . "\40\160\141\x72\141\x20" . $dlot . "\x2c\x20\x65\x78\x69\164\157\40\x6f\x72\144\145\x6e\x3a\x20" . $v . "\54\145\x78\x69\x74\157\x20\x61\x72\164\x69\154\157\x74\x65\x3a\x20" . $j . ''); return $v; } function pdforden($a) { $db = $this->db->query("\123\105\x4c\105\x43\124\x20\x2a\x20\x46\122\x4f\x4d\40\x6f\162\144\143\40\141\x20\x4a\117\x49\x4e\40\x70\x72\157\x76\145\x65\x64\x20\142\40\117\116\x20\141\56\160\x72\157\166\145\x65\x64\x3d\142\56\x69\x64\40\127\x48\x45\x52\105\40\x61\x2e\x69\144\75\47{$a}\x27")->row(); $db2 = $this->db->query("\123\x45\x4c\x45\x43\124\40\141\56\x2a\x2c\142\x2e\156\157\155\x62\162\145\54\141\56\143\x6f\x73\x74\x6f\x2a\x61\56\x63\x61\x6e\x74\40\x74\x6f\x74\x61\154\x20\x46\x52\x4f\x4d\40\151\x74\x6f\162\144\x63\x20\141\x20\x4a\117\x49\x4e\x20\141\162\164\x69\x63\165\154\x6f\40\142\40\x4f\x4e\40\141\56\x63\x6f\x64\x69\147\x6f\75\x62\x2e\x63\x6f\x64\151\x67\157\40\x57\110\x45\x52\x45\x20\141\x2e\x6f\x72\x64\143\75\x27{$a}\47")->result(); $html = "\74\x6c\151\x6e\153\x20\162\145\154\75\42\163\164\x79\154\145\x73\x68\x65\145\164\x22\40\150\162\x65\x66\x3d\x22\141\163\163\x65\x74\163\x2f\x63\163\163\57\167\63\x2e\143\163\163\77\x76\75\x34\x22\x3e\x3c\150\164\x6d\x6c\76\74\x64\x69\166\x20\x63\x6c\x61\x73\x73\x3d\x22\167\63\x2d\143\x65\x6e\164\x65\162\42\40\x73\164\171\x6c\145\x3d\42\x6d\x61\162\x67\151\x6e\x2d\x74\157\160\72\62\45\x22\x20\76\74\x69\x6d\x67\x20\x73\162\x63\x3d\42\151\155\x61\x67\x65\x73\x2f\x68\x65\x61\144\145\x72\x2e\152\x70\147\x22\40\141\154\164\x3d\x22\110\145\x61\144\x65\x72\42\x20\x73\164\x79\x6c\145\x3d\42\167\151\144\164\150\x3a\x31\60\60\45\73\x22\x3e\x3c\x62\x72\76"; $i = 0; $tot = 0; $unid = ''; $html .= "\74\x74\x61\x62\x6c\x65\x20\143\x6c\141\163\x73\75\42\x77\63\55\x74\x61\x62\x6c\145\40\x77\63\x2d\x6d\x65\x64\x69\x75\x6d\42\x3e\74\164\162\76\x3c\164\x64\x3e\x3c\x62\x3e\117\x72\144\145\156\x20\x64\x65\40\103\x6f\155\x70\x72\141\72\40\x3c\x2f\x62\x3e" . $a . "\74\57\164\x64\76\x3c\x74\144\x3e\x3c\x62\76\x46\145\143\x68\141\x20\x64\x65\40\105\x6d\151\163\x69\303\263\156\72\x20\x3c\x2f\142\x3e" . DateTime::createFromFormat("\131\55\155\55\144", $db->femis)->format("\144\x2f\155\x2f\x59") . "\x3c\57\x74\144\76\x3c\57\164\x72\76\74\57\164\141\x62\x6c\145\76"; $html .= "\74\x74\x61\142\x6c\x65\x20\x63\154\141\163\163\75\42\x77\x33\55\x74\x61\x62\154\x65\40\167\x33\x2d\x74\151\156\x79\x22\x3e\74\x74\162\76\x3c\x74\144\76\74\142\x3e\120\162\x6f\166\145\x65\x64\x6f\x72\x3a\40\x3c\x2f\142\76" . $db->nombre . "\x3c\x2f\x74\x64\x3e\x3c\164\144\x3e\74\142\76\x52\56\111\56\x46\72\x20\74\x2f\142\x3e" . $db->rif . "\x3c\x2f\x74\144\x3e\74\164\144\76\74\142\76\116\56\120\162\145\163\165\x70\165\x65\163\164\157\x3a\40\74\x2f\x62\x3e" . $db->npres . "\x3c\x2f\164\144\x3e\74\164\x64\76\74\142\x3e\116\56\103\x6f\x6e\x74\x72\x6f\154\72\x20\74\x2f\142\76" . $db->ncontrol . "\74\57\x74\x64\x3e\74\57\x74\x72\76\74\x2f\164\141\142\154\145\x3e\x3c\142\162\x3e"; $html .= "\x3c\164\x61\x62\x6c\145\40\x63\154\x61\163\x73\x3d\42\167\63\x2d\x74\141\142\x6c\145\x2d\x61\x6c\x6c\x20\x77\63\55\150\157\x76\x65\162\x61\142\x6c\145\40\x77\63\x2d\164\x65\x78\164\x70\x64\146\x22\40\163\164\x79\x6c\145\75\42\167\x69\144\164\x68\72\61\60\x30\x25\x22\76\74\164\x72\x3e\74\164\x68\x3e\x49\164\145\x6d\x3c\x2f\164\x68\76\74\164\x68\76\103\x61\156\x74\74\x2f\x74\x68\76\x3c\x74\x68\76\114\157\x74\145\x3c\x2f\164\150\x3e\74\x74\150\x3e\104\x65\x73\143\162\151\x70\x63\x69\xc3\xb3\x6e\x20\144\x65\x6c\x20\x41\x72\164\x69\x63\x75\154\157\74\x2f\x74\x68\76\x3c\x74\x68\76\105\x6c\x61\142\74\x2f\x74\x68\x3e\74\x74\x68\76\106\x2e\x56\x2e\x3c\57\164\150\76\x3c\x74\x68\x3e\120\162\x65\x63\x69\157\74\57\164\x68\76\x3c\164\x68\76\124\157\164\141\154\74\x2f\x74\x68\x3e\74\57\164\x72\76"; $i = 0; foreach ($db2 as $item) { $i++; $unid += $item->cant; $tot += $item->total; $html .= "\74\x74\x72\76\x3c\x74\144\76" . $i . "\74\57\x74\144\x3e\74\x74\x64\76" . $item->cant . "\74\x2f\x74\144\76\74\x74\x64\x3e" . $item->lote . "\x3c\57\x74\144\76\74\164\x64\76" . $item->nombre . "\x3c\x2f\x74\x64\x3e\74\164\x64\76" . $item->elab . "\74\x2f\x74\144\x3e\74\x74\144\x3e" . $item->vence . "\74\57\x74\x64\x3e\74\x74\x64\76" . round($item->costo, 2) . "\74\x2f\164\x64\x3e\74\x74\x64\76" . $item->total . "\74\x2f\164\x64\76\x3c\x2f\x74\162\x3e"; } $html .= "\x3c\164\141\142\154\x65\40\143\x6c\x61\163\x73\x3d\42\x77\x33\x2d\x74\141\142\x6c\145\x2d\x61\x6c\154\x20\167\x33\55\164\x65\x78\164\160\x64\146\x22\x20\x73\x74\171\154\x65\75\42\167\151\144\164\150\72\61\x30\x30\45\x22\76\xa\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\74\164\x64\40\x63\154\141\163\163\x3d\42\x77\63\55\154\x69\147\x68\x74\55\x67\162\x65\x79\x22\x3e\x3c\x62\x3e\x54\157\x74\141\154\x20\x55\156\151\x64\72\74\x2f\x62\76\74\57\164\x64\76\x3c\164\x64\76" . round($unid, 0) . "\74\57\164\x64\x3e\74\164\x64\x20\x63\154\141\x73\x73\75\x22\167\x33\x2d\x6c\151\x67\150\164\x2d\147\x72\x65\x79\42\76\74\142\x3e\124\157\164\141\x6c\x20\141\40\x70\141\147\x61\162\x3a\x3c\57\142\x3e\74\57\164\144\x3e\74\x74\x64\x3e" . round($tot, 2) . "\74\x2f\164\x64\76\x3c\x2f\164\162\76\xa\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x3c\x2f\164\x61\x62\x6c\x65\x3e\74\142\162\76"; return $html; } function prov() { $bd = $this->db->query("\123\x45\114\x45\103\x54\x20\x69\x64\54\x20\x6e\x6f\x6d\142\x72\x65\40\106\122\x4f\x4d\40\160\162\157\x76\145\x65\144\x20\117\x52\x44\105\x52\40\x42\131\x20\x6e\x6f\155\142\162\145\x20\101\x53\x43")->result(); $html = "\74\151\x6e\x70\165\164\x20\x74\x79\160\x65\75\x22\164\145\170\164\x22\40\143\x6c\141\x73\x73\75\x22\167\x33\x2d\151\x6e\x70\x75\164\42\x20\x69\x64\75\42\160\162\x6f\166\x22\x20\x6c\151\x73\164\75\42\144\141\164\141\x70\162\157\166\x22\x3e\x3c\x64\x61\x74\x61\x6c\x69\x73\x74\40\x69\144\x3d\42\144\x61\x74\x61\x70\162\157\166\x22\76"; foreach ($bd as $db) { $html .= "\74\x6f\x70\x74\x69\157\156\x20\166\141\x6c\x75\x65\x3d\x22" . $db->id . "\x22\76" . $db->nombre . "\74\x2f\157\160\164\x69\x6f\x6e\x3e"; } $html .= "\74\57\x64\x61\x74\141\x6c\151\x73\x74\76"; return $html; } function formeditprov($idprov) { $bd = $this->db->query("\123\x45\x4c\x45\103\x54\x20\x69\x64\54\x20\x6e\157\155\x62\162\145\40\106\x52\x4f\115\40\x70\x72\157\166\145\x65\144\40\117\122\x44\105\122\40\x42\x59\40\156\157\x6d\x62\x72\145\40\101\123\103")->result(); $prov = "\x3c\151\156\160\165\164\40\x74\171\160\x65\75\x22\164\145\170\164\x22\40\x63\154\x61\163\x73\x3d\x22\x77\x33\55\x69\156\x70\x75\x74\x22\x20\151\144\x3d\x22\151\x64\x70\162\x6f\x76\42\40\x6c\x69\x73\x74\x3d\42\x64\x61\x74\x61\160\x72\157\x76\x22\x20\x6f\x6e\x63\150\141\x6e\147\x65\75\42\160\162\157\166\x65\145\144\50\51\73\x22\40\x76\x61\x6c\165\145\75\x22" . $idprov . "\x22\76\x3c\x64\141\x74\x61\x6c\x69\163\x74\40\x69\x64\75\42\144\141\164\141\160\x72\157\x76\x22\76"; foreach ($bd as $db) { $prov .= "\x3c\x6f\x70\x74\151\x6f\x6e\40\166\x61\154\x75\x65\x3d\x22" . $db->id . "\x22\76" . $db->nombre . "\x3c\x2f\x6f\x70\x74\x69\x6f\x6e\x3e"; } $prov .= "\x3c\x2f\144\x61\164\141\x6c\151\163\164\x3e"; $datos = $this->db->query("\123\105\x4c\105\x43\x54\x20\x2a\x20\x46\x52\117\x4d\x20\160\x72\157\166\145\145\x64\40\x57\x48\x45\x52\x65\40\151\x64\75\47{$idprov}\x27")->row(); return array("\151\x64" => $prov, "\156\x6f\x6d\142\x72\145" => $datos->nombre, "\x72\151\x66" => $datos->rif, "\x74\145\154\145\146\x6f\156\157" => $datos->telefono, "\x64\x69\162\x65\x63\x63\x69\x6f\156" => $datos->direccion, "\x6e\157\155\142\162\145\x5f\x63\x6f\156\164\141\143\x74\157" => $datos->nombre_contacto, "\x74\145\x6c\x65\x66\157\156\157\x5f\x63\x6f\156\164\141\x63\x74\157" => $datos->telefono_contacto, "\x64\151\x61\x73" => $datos->dias, "\x69\x6e\151\143\151\157" => $datos->inicio, "\146\151\156\141\x6c" => $datos->final, "\144\151\x61\163\160\162\x6f\155\x6f" => $datos->diaspromo, "\x6d\147\141\x6e\x61\x6e" => $datos->mganan, "\x64\x65\163\x63\165" => $datos->descu, "\162\145\x74\151\x65\x6e\145" => $datos->retiene, "\x69\163\154\162\x5f\x6a" => $datos->islr_j); } function almacen() { $db = $this->db->query("\123\105\114\105\103\x54\x20\x61\x2e\x63\x6f\144\151\147\157\54\x61\x2e\156\157\x6d\x62\x72\145\x20\106\x52\x4f\115\40\141\154\x6d\x61\x63\145\156\x65\x20\141\x20\127\110\105\122\x45\40\x61\x2e\143\x6f\x64\x69\147\x6f\40\116\x4f\124\x20\111\x4e\40\50\x30\x36\x29")->result(); $html = "\74\x73\145\154\x65\x63\x74\40\x63\x6c\x61\163\163\75\42\x77\63\x2d\x73\x65\154\x65\143\x74\42\40\151\x64\75\42\x61\154\155\x22\x3e\x3c\x6f\x70\164\x69\x6f\x6e\x20\166\x61\154\x75\x65\75\x22\x22\40\x64\x69\163\141\142\x6c\x65\x64\40\163\x65\154\145\143\x74\x65\x64\x3e\123\x65\x6c\145\x63\x63\151\x6f\156\x65\74\57\157\160\x74\x69\x6f\x6e\x3e"; foreach ($db as $db) { $html .= "\x3c\x6f\160\164\x69\157\156\40\x76\x61\154\x75\x65\x3d\x22" . $db->codigo . "\42\x3e" . $db->nombre . "\74\x2f\157\x70\164\x69\x6f\156\76"; } $html .= "\74\57\x73\145\154\x65\143\164\x3e"; return $html; } function regordc($a, $b, $c, $d, $dias) { $data = array("\160\x72\157\x76\x65\x65\x64" => $a, "\x66\x65\x6d\x69\x73" => $b, "\x74\x69\160\157\160\141\x67" => $c, "\x61\154\155\x61\143\145\x6e" => TRIM($d), "\144\151\141\163" => $dias); $this->db->insert("\157\x72\144\143", $data); $this->loguser("\x4f\162\144\145\156", "\x45\154\x20\x75\163\x75\x61\162\151\157\40\x67\145\156\x65\162\141\40\x6f\162\144\145\x6e\40\160\x61\162\141\40\x65\x6c\40\x70\x72\x6f\166\145\145\144\x3a\40" . $a . "\x20\105\x6d\151\164\151\144\157\72\40" . $b . "\x20\x54\x69\x70\157\160\141\x67\72\40" . $c . "\40\101\154\x6d\141\143\x65\x6e\x3a\40" . $d . ''); return $this->db->affected_rows(); } function regcombo($a, $b) { $data = array("\x6e\x6f\155" => $a, "\x70\x72\145\x63\151\157" => $b); $this->db->insert("\143\157\155\x62\x6f", $data); $this->loguser("\x52\x65\147\x69\x73\x74\162\157\40\103\x6f\155\x62\x6f", "\x45\x6c\x20\x75\x73\x75\141\x72\x69\x6f\40\162\145\x67\151\x73\164\x72\x61\x20\x20\x63\x6f\x6d\x62\157\x20" . $a . "\56"); return $this->db->affected_rows(); } function regitordc($a, $b, $c, $f, $g, $d, $iva, $e) { $tasa = $this->db->query("\123\x45\114\105\x43\x54\40\50\123\105\x4c\x45\103\124\40\157\146\x69\x63\151\141\x6c\40\106\122\117\x4d\x20\155\157\156\x65\x63\141\x6d\40\127\x48\105\122\x45\40\146\x65\x63\150\141\x3c\75\x61\x2e\x66\x65\155\151\x73\40\x4f\x52\x44\105\x52\40\x42\x59\x20\x66\x65\143\150\x61\x20\104\x45\x53\103\40\x4c\111\115\111\124\40\61\x29\40\x6f\146\x69\143\x69\x61\x6c\x20\x46\x52\x4f\115\x20\157\x72\x64\x63\40\141\40\127\x48\x45\x52\x45\40\141\x2e\151\x64\75\47{$a}\x27")->row(); $costoref = $e / $tasa->oficial; $this->db->query("\x55\x50\x44\101\124\x45\x20\x61\x72\164\151\x63\165\x6c\157\40\163\x65\x74\40\151\155\160\165\145\163\164\x6f\x31\x3d\x27{$iva}\x27\x20\x57\110\x45\122\x45\x20\143\x6f\144\x69\147\x6f\x3d\x27{$b}\47"); $data = array("\x6f\162\144\x63" => $a, "\143\157\144\x69\x67\x6f" => TRIM($b), "\154\157\164\x65" => TRIM($c), "\145\154\x61\x62" => "\x30\x30\60\60\x2d\60\60\x2d\60\60", "\166\x65\156\x63\145" => $g, "\x63\x61\156\164" => $d, "\x73\x63\141\x6e" => $d, "\163\164\x61\x74\x75\x73" => 1, "\151\x76\141" => $iva, "\143\157\x73\164\157" => $e, "\x63\157\163\164\x6f\162\x65\146" => $costoref); $this->db->insert("\x69\164\157\162\x64\143", $data); $this->loguser("\x49\x74\145\x6d\x20\117\x72\144\145\x6e", "\105\154\40\x75\x73\165\141\162\x69\157\40\x61\147\162\x65\147\141\x20\160\162\157\x64\165\143\164\x6f\x3a\x20" . $b . "\54\x20\x6c\x6f\x74\x65\x3a\40" . $c . "\x2c\40\x65\154\x61\x62\x3a" . $f . "\40\x76\145\156\x63\145\72" . $g . "\40\x63\x61\x6e\164\72" . $d . "\x2c\x20\x63\x6f\x73\164\157\72" . $e . "\40\160\x61\x72\141\40\x6c\141\40\157\162\x64\145\156\40" . $a . ''); return $this->db->affected_rows(); } function regitcombo($a, $b, $c) { $data = array("\151\x64\x63\x6f\x6d\x62\x6f" => $a, "\143\x6f\144\151\147\157" => $b, "\x63\141\x6e\x74\x69\144\141\144" => $c); $this->db->insert("\151\x74\143\x6f\155\142\x6f", $data); $this->loguser("\122\145\147\x69\x73\x74\x72\x6f\40\111\164\145\155\x20\103\157\155\x62\157", "\x45\x6c\x20\x75\x73\165\141\162\151\157\x20\x61\x67\x72\x65\x67\x61\x20\160\162\157\144\165\143\x74\x6f\x3a\40" . $b . "\54\x20\143\141\x6e\x74\x3a" . $c . "\x2e"); return $this->db->affected_rows(); } function elimordc($a) { $rows = count($a); $j = 0; for ($i = 0; $i < $rows; $i++) { if ($a[$i] > 0) { $this->db->where("\x6f\x72\144\x63", $a[$i])->delete("\x69\x74\x6f\162\x64\x63"); $this->db->where("\x69\x64", $a[$i])->delete("\x6f\x72\144\x63"); } if ($this->db->affected_rows() > 0) { $j++; } } $this->loguser("\105\x6c\151\x6d\151\156\141\x72", "\x45\x6c\40\x75\x73\165\x61\162\x69\x6f\x20\x65\x6c\x69\x6d\151\x6e\x61\x20\x6c\141\x20\x6f\162\144\145\156\x20" . $a . "\x2e"); return $j; } function elimcombo($a) { $rows = count($a); $j = 0; for ($i = 0; $i < $rows; $i++) { if ($a[$i] > 0) { $this->db->where("\x69\144\x63\x6f\155\142\x6f", $a[$i])->delete("\151\x74\x63\x6f\x6d\142\x6f"); $this->db->where("\151\x64", $a[$i])->delete("\143\x6f\x6d\142\x6f"); } if ($this->db->affected_rows() > 0) { $j++; } } $this->loguser("\x45\x6c\x69\x6d\151\156\x61\x72", "\105\154\x20\x75\x73\165\x61\x72\x69\x6f\40\x65\154\x69\x6d\x69\x6e\141\40\145\x6c\x20\x63\x6f\155\142\157\x20" . $a . "\x2e"); return $j; } function elimitordc($a, $b) { $this->db->query("\104\105\114\x45\x54\x45\x20\x46\x52\117\x4d\40\x69\x74\x6f\162\144\143\40\x57\x48\105\122\105\40\x6f\x72\144\x63\75\47{$a}\x27\x20\46\46\40\143\157\x64\151\147\x6f\x3d\x27{$b}\47"); $this->loguser("\x45\154\x69\x6d\151\156\141\x72", "\x45\x6c\40\x75\x73\x75\141\162\151\157\x20\145\x6c\x69\x6d\151\156\141\x20\x65\154\40\151\x74\x65\x6d\40" . $b . "\40\x70\x61\x72\x61\x20\154\141\x20\x6f\162\x64\x65\x6e\x20" . $a . "\x2e"); return $this->db->affected_rows(); } function elimitcombo($a, $b) { $this->db->query("\x44\105\114\105\124\x45\x20\106\x52\117\115\40\x69\164\143\x6f\x6d\x62\x6f\40\x57\x48\105\122\x45\40\151\x64\143\157\155\142\157\x3d\47{$a}\47\x20\x26\46\40\x63\157\x64\151\x67\157\x3d\x27{$b}\47"); $this->loguser("\x45\154\151\x6d\x69\x6e\141\162", "\x45\154\x20\165\x73\x75\x61\x72\151\x6f\x20\x65\154\151\x6d\151\x6e\x61\40\145\x6c\x20\x69\164\145\155\x20" . $b . "\40\x70\x61\162\141\40\x65\x6c\x20\x63\x6f\155\142\x6f\40" . $a . "\56"); return $this->db->affected_rows(); } function formaggcombo() { $bd = $this->db->query("\x53\105\114\105\103\x54\40\x69\x64\54\40\x6e\157\155\40\x46\122\x4f\115\x20\x63\157\x6d\142\157")->result(); $html = "\x3c\x73\x65\154\x65\143\x74\40\143\x6c\x61\163\163\x3d\42\x77\x33\x2d\x73\x65\154\145\x63\x74\x22\x20\x69\x64\x3d\42\151\144\143\157\x6d\x62\x6f\42\x3e\74\157\160\x74\x69\157\x6e\40\x76\141\x6c\165\x65\75\x22\x22\40\x64\x69\x73\141\142\x6c\x65\x64\40\x73\145\154\145\x63\x74\x65\144\x3e\123\x65\154\x65\x63\x63\x69\x6f\x6e\x65\74\57\x6f\160\164\151\x6f\x6e\76"; foreach ($bd as $db) { $html .= "\74\x6f\160\164\151\157\156\40\166\x61\154\x75\x65\x3d\42" . $db->id . "\42\76" . $db->nom . "\x3c\57\157\x70\164\x69\x6f\x6e\x3e"; } $html .= "\x3c\x2f\163\x65\154\145\143\164\76"; return $html; } function aggcombo($a, $b) { $bd = $this->db->query("\x53\x45\114\x45\x43\x54\x20\141\56\143\157\x64\151\x67\x6f\x2c\x20\142\56\x6e\x6f\x6d\x62\162\145\54\141\x2e\x63\141\156\x74\151\x64\x61\x64\54\142\x2e\x67\162\x75\160\x6f\x2c\x62\x2e\x63\x6f\x6d\160\x72\157\x6d\145\164\151\x64\157\54\x62\56\x70\162\x65\x63\x69\157\61\x2c\142\x2e\x70\162\x65\143\x69\x6f\x66\x69\156\61\x20\106\122\x4f\x4d\x20\x69\x74\x63\x6f\x6d\x62\x6f\x20\x61\40\x4a\117\111\116\x20\x61\x72\x74\151\x63\x75\x6c\157\40\142\40\x4f\x4e\x20\x61\x2e\x63\x6f\x64\x69\147\157\x3d\142\56\143\x6f\x64\x69\x67\157\x20\x57\110\x45\122\105\40\x69\144\x63\x6f\x6d\x62\157\75\47{$b}\x27\x20\x47\122\x4f\125\120\40\x42\131\40\141\x2e\143\x6f\144\x69\147\x6f")->result(); $v = 0; $usaprc = $this->db->query("\x53\105\114\x45\x43\124\x20\x70\x72\145\x63\151\157\x20\156\x20\106\122\x4f\115\40\x63\x6f\155\142\157\40\127\110\x45\x52\105\40\151\x64\x3d\47{$b}\x27")->row(); foreach ($bd as $db) { if ($usaprc->n == "\x53") { $prcorg = $db->precio1; $prcfin = $db->preciofin1; } else { $prcorg = 0; $prcfin = 0; } $bdlot = $this->db->query("\x53\105\x4c\105\103\x54\x20\x63\x2e\x61\x6c\x6d\x61\x63\x65\x6e\x2c\143\x2e\154\157\164\145\x2c\x28\x63\x2e\143\x61\x6e\x74\151\x64\x61\x64\55\143\x2e\143\x6f\x6e\163\x75\x6d\x69\144\x6f\x29\40\x65\x78\x69\x73\164\54\x20\143\56\145\x6c\x61\x62\54\x20\143\56\x76\145\156\143\x65\x20\106\x52\x4f\x4d\x20\141\162\164\151\154\157\164\145\163\x20\x41\x53\40\143\x20\12\40\x20\40\x20\x20\x20\x20\40\127\110\x45\122\x45\40\143\56\x63\x6f\144\151\147\x6f\x61\x72\x74\x3d\47{$db->codigo}\x27\x20\x26\46\40\x63\56\x63\x61\156\164\x69\x64\141\144\76\143\x2e\143\157\156\x73\165\x6d\151\x64\x6f\40\x26\46\40\x63\56\141\154\155\141\x63\x65\x6e\40\116\x4f\124\x20\x49\x4e\x20\50\60\x31\54\x30\65\54\60\66\x29\x20\x4f\x52\x44\105\122\x20\102\131\x20\x63\56\141\154\x6d\141\x63\x65\156\40\x41\x53\103\54\x20\x28\143\x2e\143\141\156\x74\151\144\141\144\55\x63\x2e\143\157\x6e\163\x75\x6d\x69\x64\157\x29\40\101\123\x43\x20\114\111\115\x49\x54\40\61")->row(); if ($bdlot->almacen == '' || $bdlot->almacen == null) { $alm = "\x30\62"; } else { $alm = $bdlot->almacen; } $datos = array("\151\x64\137\145\155\x70\162\x65\163\141" => "\x44\x4d\105\x44\x49\x46", "\x61\147\x65\x6e\x63\151\x61" => "\x30\x30\61", "\x74\x69\160\157\x64\x6f\143" => "\x45\x53\120", "\144\157\x63\x75\x6d\145\156\x74\157" => '' . $a . '', "\x67\162\165\x70\157" => '' . $db->grupo . '', "\x6f\x72\151\x67\145\156" => "\x31", "\x63\x6f\144\151\x67\157" => '' . $db->codigo . '', "\x70\151\x64" => "\x63\157\x6d\142\x6f", "\x6e\157\155\142\x72\145" => '' . $db->nombre . '', "\x63\157\x73\164\157\165\x6e\151\164" => "\60", "\x70\162\x65\143\151\157\165\x6e\151\164" => 0, "\x64\x73\143\x74\157\x75\156\x69\164" => 0, "\x64\x73\143\x74\x6f\x70\162\x63" => 0, "\144\x73\143\164\x6f\145\156\144\x70" => 0, "\144\163\143\x74\x6f\x65\x6e\144\155" => 0, "\x70\162\145\x63\151\x6f\x66\151\156" => $prcfin, "\160\x72\145\x63\151\157\x6f\162\x69\x67\151\x6e\x61\154" => $prcorg, "\x63\141\x6e\164\x69\x64\x61\144" => '' . $db->cantidad . '', "\155\157\x6e\164\x6f\x6e\145\x74\x6f" => 0, "\x6d\x6f\156\164\x6f\164\x6f\x74\x61\x6c" => 0, "\164\x69\155\160\165\x65\160\162\143" => 0, "\141\154\155\x61\143\x65\x6e" => $alm, "\x70\162\x6f\x76\x65\145\144\157\x72" => "\156\57\141", "\146\145\143\x68\x61\144\x6f\143" => '' . date("\x59\55\x6d\x2d\144") . '', "\151\155\x70\165\x65\163\x74\x6f\61" => "\60", "\151\x6d\x70\x75\x65\x73\x74\x6f\x32" => "\x30", "\x76\145\156\144\x65\x64\x6f\162" => '', "\145\155\x69\163\x6f\x72" => "\x46\101\x43\x54\x55\122\101\x44", "\165\163\141\163\145\x72\151\x61\x6c" => "\62", "\164\151\160\157\160\x72\145\143\x69\x6f" => "\x31", "\x75\156\151\144\x61\x64" => "\125\116\x44", "\141\x67\x72\x75\160\141\x64\157" => "\x32", "\x63\157\155\x70\165\x65\x73\164\157" => "\62", "\165\x73\x61\145\x78\151\163\x74" => "\x31", "\x61\x75\x78\x31" => '' . $db->cantidad . '', "\x65\163\x74\x61\143\151\x6f\x6e" => "\x30\x30\61", "\x75\144\x69\156\x61\x6d\151\143\x61" => "\61", "\142\141\x73\145\x69\x6d\160\157\x31" => 0, "\142\141\x73\x65\x69\155\x70\x6f\62" => "\60", "\x6c\x6f\164\x65" => $bdlot->lote, "\x69\x64\166\141\x6c\x69\x64\x61\x63\x69\x6f\x6e" => '', "\146\x65\143\150\x61\171\150\x6f\x72\x61" => '' . date("\131\55\155\55\144\x20\110\x3a\151\x3a\x73") . '', "\145\156\x76\151\x61\x64\157\x5f\153\x6d\157\x6e\151\x74\x6f\162" => "\x30"); $this->db->insert("\x6f\x70\x65\162\x6d\166", $datos); if ($this->db->affected_rows() > 0) { $v++; $newcomp = $db->cantidad + $db->comprometido; $dato3 = array("\143\x6f\155\160\162\157\155\145\164\151\144\x6f" => $newcomp); $this->db->where("\x63\x6f\144\x69\x67\157", $db->codigo)->update("\141\x72\164\151\x63\x75\x6c\157", $dato3); } } return $v; } function ordcscan($a, $b, $c) { $bd = $this->db->query("\x53\105\114\x45\x43\x54\40\124\x52\x49\115\x28\x63\157\144\151\x67\x6f\x29\x20\143\157\144\x69\x67\x6f\40\106\x52\117\115\x20\x69\x6e\166\143\157\x64\141\154\x74\145\162\x6e\141\164\x69\x76\x6f\x20\127\110\x45\122\x45\40\x28\143\157\x64\141\154\164\145\x72\x6e\x61\x74\x69\x76\157\75\x27{$b}\x27\40\x7c\174\40\x63\157\x64\151\x67\x6f\75\x27{$b}\47\x29"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("\x53\x45\x4c\x45\x43\124\40\x63\141\x6e\164\x2c\40\163\143\141\x6e\40\106\122\117\x4d\x20\x69\x74\x6f\162\144\x63\x20\x57\x48\x45\122\x45\x20\157\x72\144\x63\75\47{$a}\47\40\46\46\40\143\x6f\144\x69\147\x6f\75\x27{$db->codigo}\47\40\x26\x26\40\154\157\x74\x65\x3d\47{$c}\47")->row(); if ($bd2->cant > $bd2->scan) { $new = $bd2->scan + 1; $this->db->query("\x55\120\104\x41\x54\x45\x20\x69\164\x6f\162\144\x63\40\x73\x65\164\x20\163\143\141\156\75\x27{$new}\x27\x20\127\110\x45\122\105\40\x6f\x72\x64\143\75\x27{$a}\47\x20\46\46\x20\x63\157\144\151\147\x6f\75\47{$db->codigo}\47\40\46\x26\x20\154\157\164\x65\75\47{$c}\47"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("\125\120\104\101\124\105\x20\151\x74\x6f\x72\144\x63\40\163\x65\164\40\163\x74\141\x74\x75\163\x3d\61\x20\x57\110\105\x52\x45\40\157\162\x64\143\75\x27{$a}\x27\40\46\x26\x20\x63\x6f\x64\151\147\157\75\47{$db->codigo}\x27\40\46\46\x20\154\x6f\x74\145\75\x27{$c}\47"); $i = 2; $this->valordcscan($a); } else { $i = 1; } } } else { $i = 2; $this->valordcscan($a); } } else { $i = 0; } return $i; } function ordcscan1($a, $b, $c, $d) { $bd = $this->db->query("\x53\105\114\x45\103\124\x20\x54\122\x49\x4d\50\x63\157\x64\x69\x67\157\x29\x20\143\157\144\x69\147\157\x20\x46\x52\117\115\x20\x69\x6e\x76\143\157\144\x61\154\x74\145\162\156\x61\x74\x69\166\157\40\x57\110\105\x52\105\40\50\x63\x6f\x64\x61\154\x74\145\162\x6e\x61\x74\151\166\157\75\x27{$b}\x27\40\x7c\174\x20\143\x6f\144\x69\x67\x6f\x3d\x27{$b}\47\51"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("\x53\x45\114\x45\103\x54\x20\143\x61\156\164\x2c\x20\163\x63\141\x6e\x20\x46\x52\x4f\x4d\x20\151\164\x6f\162\x64\143\40\127\x48\x45\122\x45\x20\x6f\162\x64\x63\75\47{$a}\47\x20\46\x26\40\143\x6f\144\151\147\x6f\x3d\x27{$db->codigo}\x27\40\46\x26\40\x6c\157\x74\x65\x3d\47{$c}\x27")->row(); if ($bd2->cant > $bd2->scan) { if ($d <= $bd2->cant) { $new = $d; $this->db->query("\x55\120\104\101\x54\x45\40\151\x74\x6f\162\144\x63\40\x73\x65\x74\40\163\143\x61\156\75\x27{$new}\x27\x20\x57\x48\x45\122\105\40\x6f\162\x64\x63\75\x27{$a}\x27\x20\x26\x26\40\143\x6f\x64\151\x67\x6f\x3d\47{$db->codigo}\47\40\46\46\x20\x6c\x6f\164\145\x3d\47{$c}\47"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("\x55\x50\x44\x41\124\x45\x20\151\x74\157\x72\144\x63\40\163\x65\164\40\163\x74\141\x74\165\x73\x3d\x31\x20\127\110\x45\x52\x45\40\157\162\x64\143\x3d\47{$a}\x27\40\46\46\x20\143\x6f\x64\x69\x67\x6f\x3d\47{$db->codigo}\47\40\46\46\x20\154\157\x74\145\x3d\x27{$c}\47"); $i = 2; $this->valordcscan($a); } else { $i = 1; } } } else { $i = 3; } } else { $i = 2; $this->valordcscan($a); } } else { $i = 0; } return $i; } public function valordcscan($a) { $db = $this->db->query("\123\105\114\105\x43\124\40\116\125\114\114\x20\x46\122\117\x4d\40\x69\x74\x6f\162\144\143\40\x57\110\105\x52\105\x20\x6f\x72\144\143\x3d\x27{$a}\x27")->num_rows(); $db2 = $this->db->query("\x53\105\114\105\103\x54\x20\116\125\x4c\x4c\40\106\122\117\x4d\x20\151\164\157\162\144\143\40\127\110\x45\x52\105\x20\x6f\162\144\143\x3d\47{$a}\47\40\46\x26\x20\143\141\156\164\x3d\163\x63\141\x6e")->num_rows(); if ($db == $db2) { $this->db->query("\x55\x50\104\x41\124\x45\x20\x6f\162\144\143\x20\123\x45\x54\40\x66\162\145\x63\x65\160\75\103\x55\122\104\x41\124\x45\x28\51\54\x73\x74\141\164\x75\163\75\61\40\x57\x48\105\x52\105\40\x69\144\x3d\47{$a}\47"); if ($this->db->affected_rows() > 0) { $bd3 = $this->db->query("\x53\105\x4c\x45\103\x54\x20\x61\56\143\157\x64\151\147\157\x2c\x61\56\154\x6f\164\x65\54\141\56\x65\154\141\x62\54\x61\56\166\145\156\143\x65\54\x61\x2e\143\141\x6e\164\54\141\x2e\x63\x6f\x73\x74\x6f\54\x62\x2e\x61\x6c\x6d\141\x63\145\156\54\x62\x2e\x70\x72\x6f\166\145\x65\x64\x20\x46\122\117\115\40\x69\x74\x6f\x72\144\x63\x20\x61\40\x4a\x4f\111\116\x20\x6f\x72\x64\143\40\x62\40\x4f\x4e\x20\141\x2e\x6f\162\x64\143\x3d\142\56\x69\x64\40\x57\x48\x45\122\105\40\141\56\157\162\144\x63\75\47{$a}\x27")->result(); foreach ($bd3 as $db3) { $this->ajusteordcinv($db3->codigo, $db3->lote, $db3->elab, $db3->vence, $db3->cant, $db3->costo, $db3->almacen, $db3->proveed); } } } } function ajusteordcinv($cod, $lot, $elab, $venc, $cant, $cost, $alm, $prov) { $vallote = $this->db->query("\123\x45\114\x45\103\124\40\116\125\114\x4c\40\x46\x52\117\x4d\x20\141\162\164\151\x6c\x6f\x74\145\x73\40\x57\110\x45\122\105\40\x63\157\144\x69\147\x6f\x61\162\x74\75\47{$cod}\x27\x20\x26\46\40\x61\x6c\x6d\x61\143\x65\x6e\x3d\47{$alm}\x27\x20\46\x26\x20\154\x6f\164\x65\75\47{$lot}\x27\x20\46\x26\x20\162\x65\143\145\160\143\x69\x6f\156\x3c\x3d\143\x75\162\x64\141\x74\x65\50\51")->num_rows(); if ($vallote > 0) { $this->db->query("\x55\120\104\x41\x54\x45\40\141\162\164\151\154\157\164\x65\163\x20\123\105\124\x20\x63\141\x6e\x74\x69\144\141\x64\x3d\143\x61\156\x74\x69\144\141\144\53{$cant}\x2c\x72\145\143\145\160\143\x69\157\156\x3d\143\x75\162\x64\x61\x74\x65\x28\51\x2c\143\x6f\163\x74\157\x3d\47{$cost}\47\x20\127\x48\105\122\x45\40\x63\x6f\x64\x69\x67\x6f\141\x72\164\x3d\x27{$cod}\47\40\x26\x26\40\x61\x6c\x6d\141\143\145\156\75\47{$alm}\x27\40\x26\x26\40\154\x6f\x74\x65\75\47{$lot}\47"); if ($this->db->affected_rows() > 0) { $this->db->query("\125\x50\104\x41\124\105\40\141\x72\x74\x69\143\x75\x6c\157\40\123\x45\124\40\x65\170\151\x73\164\x65\156\x63\x69\x61\x3d\145\x78\x69\x73\x74\x65\x6e\x63\x69\141\x2b{$cant}\40\x57\x48\x45\x52\x45\40\x63\157\x64\151\x67\157\75\x27{$cod}\47"); } } else { $this->db->query("\111\x4e\123\105\x52\x54\x20\111\116\x54\x4f\x20\x60\141\x72\x74\151\x6c\x6f\x74\145\x73\x60\40\x28\140\151\144\137\145\155\x70\x72\x65\163\141\x60\54\40\x60\x61\147\x65\x6e\143\x69\x61\140\x2c\40\x60\x6c\157\164\145\x60\x2c\40\x60\x63\157\144\151\x67\x6f\141\x72\x74\x60\x2c\x20\140\x61\154\x6d\141\x63\x65\156\x60\54\x20\140\151\x6e\141\143\164\151\x76\157\x60\x2c\40\x60\x65\x6c\141\x62\140\x2c\40\x60\x76\x65\156\x63\145\140\x2c\40\140\x63\141\x6e\x74\x69\x64\141\144\x60\54\x20\140\x63\x6f\x6e\x73\x75\x6d\x69\x64\x6f\140\54\x20\140\143\157\x6d\x70\162\x6f\155\145\164\151\144\157\x60\54\x20\x60\143\x6f\163\x74\x6f\x60\x2c\x20\140\x72\145\143\x65\160\x63\x69\x6f\x6e\140\x2c\x20\x60\x70\162\x65\143\151\157\61\140\54\x20\x60\160\162\145\x63\151\x6f\62\140\x2c\xa\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\40\x20\40\140\x70\x72\x65\143\x69\x6f\x33\140\x2c\40\140\160\162\145\x63\x69\x6f\x34\x60\54\40\140\x70\162\145\143\x69\157\x35\x60\x2c\x20\x60\160\162\145\x63\151\x6f\66\x60\54\40\x60\x70\x72\x65\x63\151\x6f\67\140\54\x20\x60\160\x72\x65\x63\151\157\70\140\x2c\40\x60\x70\x72\145\143\x69\157\x66\x69\156\x31\140\54\40\x60\160\x72\x65\143\x69\x6f\146\x69\x6e\x32\140\x2c\40\x60\160\162\x65\143\x69\x6f\x66\151\156\63\140\x2c\40\140\x70\162\145\x63\151\157\x66\x69\156\64\x60\54\x20\x60\x70\x72\x65\x63\151\157\x66\151\x6e\x35\x60\x2c\x20\140\160\162\x65\143\x69\157\146\151\156\66\x60\x2c\40\140\160\162\x65\x63\x69\157\146\x69\156\x37\140\54\40\x60\x70\162\x65\143\151\x6f\146\x69\156\x38\140\54\40\140\160\x72\x65\x63\x69\157\x31\x67\162\x70\x60\54\x20\x60\160\162\145\x63\x69\x6f\62\147\162\160\x60\x2c\40\140\160\x72\x65\x63\151\157\63\x67\162\x70\140\54\40\12\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\140\x70\162\145\143\x69\157\x34\x67\x72\x70\x60\x2c\x20\140\x70\162\145\143\x69\x6f\x35\147\x72\160\x60\x2c\40\x60\160\x72\x65\143\x69\x6f\x36\x67\x72\160\140\54\40\x60\x70\x72\x65\143\x69\x6f\67\x67\x72\160\140\x2c\x20\140\160\x72\x65\143\151\x6f\70\147\162\160\140\54\40\140\146\141\143\x74\157\162\154\157\164\x65\140\54\40\x60\156\165\x6d\x6c\x6f\164\145\140\x29\x20\126\101\x4c\125\105\x53\x20\50\47\x44\x4d\x45\104\x49\106\47\x2c\40\x27\60\60\61\x27\x2c\40\47{$lot}\47\x2c\40\x27{$cod}\x27\x2c\x20\x27{$alm}\x27\x2c\40\x30\x2c\x20\x27{$elab}\47\54\x20\x27{$venc}\47\x2c\40\x27{$cant}\x27\54\x20\x30\56\60\x2c\x20\x30\56\x30\x2c\x20\47{$cost}\47\x2c\40\xa\40\x20\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\103\125\x52\x44\101\x54\105\x28\51\x2c\40\60\x2c\x20\x30\56\x30\54\x20\x30\56\60\x2c\40\x30\x2e\60\x2c\x20\x30\56\60\54\40\60\56\60\54\40\x30\x2e\x30\x2c\x20\60\x2e\60\54\x20\60\x2c\x20\60\x2e\x30\54\x20\60\x2e\60\x2c\40\60\56\60\x2c\x20\60\x2e\60\54\40\60\56\x30\x2c\x20\60\56\x30\x2c\x20\x30\x2e\x30\x2c\40\x30\56\60\54\x20\x30\56\60\x2c\x20\60\56\x30\x2c\40\60\x2e\60\x2c\40\xa\40\x20\40\40\x20\40\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\x20\x30\56\x30\54\40\x30\x2e\x30\x2c\40\x30\x2e\x30\54\40\60\56\60\x2c\40\60\56\x30\54\40\47{$lot}\x27\51\73"); if ($this->db->affected_rows() > 0) { $this->db->query("\125\120\104\101\x54\105\40\141\x72\164\x69\143\165\x6c\x6f\x20\x53\x45\124\40\x65\x78\151\x73\x74\x65\x6e\143\151\x61\x3d\145\x78\x69\163\x74\x65\x6e\143\151\x61\x2b{$cant}\40\127\x48\x45\x52\105\x20\143\157\x64\151\147\x6f\75\x27{$cod}\x27"); } } } public function artilist($a, $b) { $this->load->library("\164\x61\142\154\x65"); if ($b != '') { $filter = "\x57\x48\x45\x52\x45\40\141\56\143\157\144\151\x67\x6f\75\47{$b}\47\x20\174\174\x20\142\56\156\157\x6d\142\x72\x65\x20\154\151\153\x65\40\47\x25{$b}\45\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\x4c\x45\103\124\40\141\x2e\52\54\142\56\x6e\157\155\x62\162\x65\40\106\122\x4f\x4d\x20\x61\x72\x74\x69\x6c\x69\x73\x74\40\x61\x20\x4a\117\x49\116\40\x61\162\x74\x69\x63\165\154\157\x20\x62\40\117\156\x20\141\x2e\143\157\144\151\147\157\x3d\x62\x2e\x63\x6f\144\x69\x67\x6f\40" . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\114\105\103\124\40\141\56\52\54\x62\x2e\x6e\157\x6d\x62\x72\145\x20\x46\x52\117\115\x20\141\x72\164\x69\x6c\151\x73\164\40\141\40\x4a\x4f\111\x4e\40\141\x72\x74\x69\143\165\x6c\157\40\142\40\117\x6e\x20\x61\x2e\143\157\144\151\147\157\x3d\x62\56\x63\157\144\x69\x67\x6f\40" . $filter . "\40\40\x4c\111\x4d\111\124\x20" . ($a - 1) * $mostrar . "\40\54\x20" . $mostrar . "\x3b")->result(); $hora = $this->db->query("\x53\x45\x4c\105\x43\x54\40\111\106\x28\164\x69\x6d\x65\50\x4e\117\x57\50\51\x29\x3e\x3d\x27\61\63\x3a\60\x30\x3a\60\60\x27\54\47\123\47\x2c\x27\x4e\x27\x29\x20\x6e")->row(); if ($hora->n == "\123") { $ajusteprc = "\x3c\164\144\x20\143\154\141\x73\163\75\x22\167\63\x2d\x63\x65\x6e\164\145\162\x20\167\x33\55\x62\164\156\x22\x3e\74\x61\x20\x6f\156\x63\x6c\x69\x63\x6b\75\42\x61\154\x65\162\x74\141\x61\152\x75\163\164\x65\x6c\x69\x73\x74\x28\x29\x3b\x22\x3e\x3c\151\x6d\147\40\163\162\143\x3d\42" . base_url() . "\151\155\141\147\x65\163\57\x62\x6e\x2e\160\156\x67\x22\x20\141\x6c\164\x3d\x22\x45\x6a\x65\x63\165\x74\141\162\42\40\x74\x69\164\x6c\145\x3d\42\105\x6a\145\143\x75\164\x61\162\x22\x20\x73\164\171\154\x65\x3d\42\167\151\144\164\x68\72\62\x30\160\x78\73\150\145\x69\147\x68\164\x3a\62\x30\160\170\73\x62\157\x72\x64\x65\162\72\x30\73\42\76\x3c\57\x61\76\x3c\57\164\x64\76"; } else { $ajusteprc = ''; } $html = "\xa\x20\x20\x20\40\74\164\141\x62\x6c\145\x20\143\x6c\x61\163\163\75\42\167\63\x2d\x74\141\142\154\x65\x2d\141\154\154\x20\167\63\x2d\150\157\166\x65\162\x61\x62\x6c\x65\x20\167\x33\x2d\x6c\x65\146\164\55\141\154\x69\147\156\42\x3e\xa\x20\40\40\x20\74\164\162\76\x3c\x74\144\40\143\154\x61\163\163\x3d\x22\167\x33\x2d\x66\157\156\144\157\144\162\x6f\151\x64\42\x3e\x42\165\163\x63\141\162\40\74\x69\x6d\x67\x20\163\x72\143\75\42" . base_url() . "\x69\x6d\141\147\145\163\x2f\142\x75\x73\143\141\x72\x2e\160\156\147\42\40\x61\154\x74\x3d\42\102\x75\x73\143\x61\162\x22\40\x74\151\164\154\145\75\x22\x42\165\x73\143\141\162\42\40\x73\x74\171\154\x65\x3d\42\x77\x69\144\x74\x68\72\x31\x38\x70\170\73\x62\157\x72\x64\x65\162\x3a\x30\73\x22\76\x3c\57\x74\144\x3e\12\40\40\40\x20\74\x74\x64\76\74\151\x6e\x70\x75\x74\40\x74\171\x70\x65\75\x22\164\x65\x78\x74\x22\x20\143\154\141\x73\163\75\x22\167\63\55\x69\x6e\x70\x75\164\42\x20\x70\x6c\x61\143\x65\x68\x6f\x6c\x64\x65\x72\75\42\x49\156\x67\162\x65\163\145\40\x73\x75\40\142\x75\163\x71\x75\x65\x64\141\x22\x20\x6f\x6e\143\x68\141\156\147\145\75\42\141\162\164\151\154\151\163\164\50\51\42\x20\x69\144\x3d\x22\x6c\x69\x6b\145\x22\76\x3c\x2f\x74\x64\76\xa\x20\40\x20\x20\x3c\x74\x64\40\x63\x6c\141\x73\x73\x3d\42\167\x33\x2d\x63\x65\156\164\145\162\40\167\x33\55\142\164\156\x22\x3e\x3c\x61\40\157\156\143\x6c\151\x63\153\x3d\x22\x77\63\x2e\163\150\x6f\x77\50\47\43\155\x6f\144\145\x78\x63\145\x6c\x6c\x69\163\164\x27\51\x3b\42\76\x3c\151\x6d\x67\x20\163\x72\143\x3d\x22" . base_url() . "\x69\x6d\x61\x67\145\x73\57\145\170\x63\x65\154\x2e\160\156\147\42\40\x61\154\x74\75\42\x43\141\x72\x67\141\40\x4c\151\163\164\x22\40\164\x69\x74\154\145\x3d\x22\x43\x61\162\x67\x61\40\114\151\x73\164\x22\x20\163\164\171\x6c\x65\75\42\167\151\144\164\150\x3a\x32\60\160\x78\x3b\x68\x65\x69\147\x68\x74\72\x32\x30\160\170\x3b\x62\157\x72\x64\145\x72\72\60\x3b\x22\76\x3c\x2f\141\x3e\74\57\164\x64\76\12\40\x20\x20\40\x3c\164\144\40\x63\154\x61\x73\163\x3d\42\x77\63\55\143\x65\156\164\x65\x72\x20\x77\63\x2d\x62\x74\156\x22\76\74\141\40\x6f\x6e\143\154\x69\143\153\x3d\x22\x65\x78\160\157\162\164\145\x78\x63\x65\154\x61\x72\164\x69\x28\x29\x3b\42\x3e\x3c\x69\x6d\x67\x20\x73\x72\x63\x3d\x22" . base_url() . "\151\155\141\147\x65\163\57\170\x6c\x73\x2e\160\x6e\147\x22\40\x61\x6c\164\75\42\105\170\x70\157\162\164\x20\114\x69\x73\164\42\x20\x74\x69\x74\x6c\145\x3d\42\x45\170\160\x6f\x72\x74\40\114\151\x73\164\x22\x20\163\x74\x79\x6c\145\x3d\42\x77\x69\x64\164\x68\72\62\x30\x70\x78\x3b\x68\x65\x69\x67\150\x74\x3a\62\60\160\170\x3b\142\157\162\x64\x65\162\x3a\x30\x3b\x22\76\x3c\x2f\x61\76\74\57\x74\144\x3e\12\40\x20\40\x20\74\x74\x64\40\143\x6c\x61\163\163\75\42\x77\x33\55\143\145\x6e\x74\145\x72\x20\x77\63\55\x62\164\156\42\76\74\x61\x20\x6f\156\x63\154\x69\143\x6b\75\42\x61\x6a\165\163\x74\145\160\x72\x6f\x64\x28\51\x3b\42\76\74\151\155\147\x20\x73\162\143\x3d\x22" . base_url() . "\x69\155\141\147\x65\163\x2f\141\152\x75\x73\x74\x65\x73\56\x70\x6e\x67\42\x20\x61\x6c\x74\x3d\x22\x41\152\165\163\x74\145\40\120\162\157\x64\x75\143\164\x6f\42\x20\x74\x69\x74\x6c\x65\75\x22\x41\152\x75\163\164\x65\x20\120\x72\x6f\144\165\143\164\157\42\40\163\164\171\x6c\145\75\42\x77\151\144\x74\150\72\x32\60\x70\170\x3b\150\x65\x69\x67\150\164\x3a\x32\60\x70\170\73\142\157\162\144\145\162\72\60\x3b\42\76\x3c\57\x61\76\x3c\57\x74\144\76\xa\40\x20\x20\x20" . $ajusteprc . "\xa\40\40\40\40\x3c\164\x64\40\x63\154\141\x73\x73\75\x22\167\63\x2d\143\145\x6e\x74\145\x72\40\167\x33\x2d\142\x74\156\42\x3e\74\x61\x20\157\156\x63\154\x69\143\153\75\42\141\x72\x74\x69\154\x69\163\x74\50\51\73\42\76\74\x69\x6d\147\40\163\x72\x63\x3d\x22" . base_url() . "\x69\x6d\141\147\145\163\57\162\145\154\x6f\x61\144\x2e\x70\x6e\147\x22\40\141\154\x74\x3d\x22\x52\145\143\x61\x72\147\141\162\42\x20\164\151\x74\x6c\x65\x3d\x22\122\145\x63\x61\x72\x67\141\162\42\x20\163\x74\x79\x6c\145\75\x22\x77\151\144\x74\x68\72\62\60\160\170\x3b\150\145\x69\x67\x68\164\72\x32\60\160\170\x3b\x62\x6f\x72\x64\145\x72\x3a\x30\x3b\42\x3e\74\57\141\x3e\x3c\x2f\x74\144\x3e\xa\x20\x20\40\x20\x3c\57\x74\162\76\x3c\57\164\x61\x62\154\x65\76\74\x62\162\76\xa\x20\40\40\x20\x3c\x74\141\142\154\x65\x20\151\144\75\42\x69\x64\x30\x31\x22\40\x63\154\141\x73\163\x3d\x22\x77\x33\55\164\141\x62\154\x65\55\141\x6c\154\x20\167\x33\55\x68\x6f\x76\145\x72\141\x62\x6c\145\40\x77\x33\55\x6c\145\146\x74\55\x61\x6c\151\x67\156\40\167\x33\x2d\x74\151\156\x79\42\76\74\x74\162\40\143\154\141\163\163\x3d\x22\167\x33\55\x66\157\156\x64\x6f\144\x72\x6f\x69\x64\x22\x3e\74\x74\150\x3e\x4d\157\156\145\144\141\x3c\x2f\x74\150\x3e\74\x74\x68\76\120\x72\157\144\165\143\164\157\x3c\x2f\x74\150\76\74\x74\150\76\x41\156\x74\x2e\x43\157\163\164\x6f\x3c\x2f\x74\x68\x3e\74\164\x68\76\104\x65\163\x70\x2e\103\x6f\x73\x74\x6f\x3c\x2f\x74\150\x3e\x3c\164\x68\76\101\156\164\56\120\162\145\143\x69\x6f\x31\x3c\57\x74\150\x3e\x3c\164\150\76\x44\145\163\160\56\120\x72\145\143\x69\x6f\61\74\57\x74\150\76\x3c\164\x68\x3e\x41\156\x74\56\120\x72\x65\x63\151\157\x66\151\x6e\x31\x3c\57\164\150\76\74\164\x68\x3e\x44\145\x73\x70\x2e\120\162\x65\x63\151\157\146\151\x6e\x31\74\57\x74\150\76\x3c\164\150\76\x45\x73\x74\x61\x74\x75\x73\74\x2f\x74\x68\76\x3c\x2f\164\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\164\x72\76"; if ($dtfac->apreciofin1 < $dtfac->dpreciofin1) { $status = "\115\x61\171\157\162"; $color = "\x77\63\55\147\162\145\145\x6e"; } else { if ($dtfac->apreciofin1 == $dtfac->dpreciofin1) { $status = "\111\147\165\141\154"; $color = "\x77\x33\55\x62\x6c\165\x65"; } else { $status = "\115\145\x6e\x6f\x72"; $color = "\x77\63\55\162\145\144"; } } $html .= "\74\x69\x6e\x70\165\164\40\164\x79\160\x65\75\x22\150\x69\144\x64\145\156\x22\40\x69\x64\75\x22\141" . $i . "\42\40\x6e\141\155\x65\x3d\42\x64\157\x63\x22\40\x76\141\154\x75\x65\75\x22" . $dtfac->id . "\42\76\xa\40\40\x20\x20\40\x20\40\x20\x3c\x74\144\x3e" . $dtfac->moneda . "\74\57\164\144\76\74\164\144\x3e" . $dtfac->codigo . "\x20" . $dtfac->nombre . "\x3c\x2f\x74\x64\76\74\x74\x64\x3e" . $dtfac->acosto . "\x3c\57\164\x64\76\x3c\164\x64\76" . $dtfac->dcosto . "\74\57\164\144\76\74\164\144\x3e" . $dtfac->aprecio1 . "\74\57\164\x64\76\x3c\164\144\x3e" . $dtfac->dprecio1 . "\74\x2f\x74\x64\76\x3c\164\144\76" . $dtfac->apreciofin1 . "\x3c\57\164\x64\76\x3c\x74\x64\76" . $dtfac->dpreciofin1 . "\x3c\x2f\164\144\76\x3c\x74\144\x20\x63\x6c\x61\x73\x73\x3d\x22" . $color . "\x20\x77\63\55\x63\x65\x6e\x74\145\162\x22\76" . $status . "\x3c\x2f\x74\144\76\12\40\x20\40\x20\x20\40\40\40\74\x2f\x74\162\76"; } $html .= "\x3c\41\x2d\x2d\x3c\x74\162\x3e\x3c\x74\144\40\143\x6c\x61\163\x73\75\42\x77\63\x2d\x63\145\x6e\x74\x65\162\40\167\x33\55\x66\x6f\156\x64\157\x64\162\157\151\x64\42\40\x63\x6f\154\x73\160\141\x6e\x3d\x22\61\x33\42\76\x3c\x6c\x61\142\145\154\x20\x63\154\x61\163\163\x3d\x22\x77\x33\x2d\154\x61\x72\x67\x65\42\76\74\x62\x3e\124\157\x74\141\x6c\x20\x52\x65\147\151\163\x74\x72\157\163\72\x20" . $totalreg . "\74\x2f\x62\x3e\x3c\57\x6c\141\x62\x65\154\x3e\74\x2f\164\144\x3e\74\x2f\x74\x72\x3e\x2d\x2d\76\74\57\x74\x61\142\154\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\40\x20\x20\40\40\x20\x20\x20\74\163\143\162\x69\160\164\x20\164\x79\x70\x65\75\x22\x74\x65\x78\x74\57\x6a\x61\x76\x61\x73\x63\x72\151\160\x74\x22\76\12\x20\40\x20\x20\40\40\x20\x20\x66\165\x6e\143\164\151\x6f\156\x20\104\x65\143\162\145\x6d\x65\x6e\x74\116\x75\x6d\x28\x29\x7b\40\x62\x65\146\157\x72\x65\50\x29\73\xa\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x76\x61\162\x20\x44\145\x63\x72\145\x6d\x65\156\x74\x4e\x75\155\75\x64\157\143\x75\x6d\x65\x6e\x74\56\x67\x65\x74\x45\x6c\x65\x6d\145\156\x74\x42\171\111\144\50\42\x44\145\143\x72\145\x6d\x65\x6e\x74\x4e\165\x6d\x22\51\56\x76\x61\154\165\x65\73\xa\x20\40\40\40\40\x20\x20\40\40\40\x20\40\166\x61\x72\x20\x6b\x65\x79\x3d\42\144\x72\157\x69\x64\71\60\63\x22\73\12\40\40\40\40\40\40\x20\40\40\x20\x20\40\x76\141\162\x20\x64\141\x74\x6f\x73\40\x3d\x20\173\12\40\x20\40\x20\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\42\x70\x61\x67\42\x20\72\x20\x44\x65\x63\x72\x65\155\145\x6e\164\x4e\165\155\x2c\12\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\40\x22\153\145\171\x22\40\x3a\x20\153\145\x79\xa\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x7d\73\12\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\12\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\x24\56\x61\152\x61\170\50\173\12\40\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\144\x61\x74\x61\72\x20\x64\x61\164\x6f\163\54\xa\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\40\x75\162\154\72\40\40\x62\x61\163\145\x75\162\154\x2b\42\143\137\144\162\x6f\x69\x64\57\141\162\164\151\x6c\x69\x73\x74\42\54\12\40\x20\40\40\x20\40\40\40\40\40\40\40\40\x20\40\x20\40\x20\x20\164\171\160\145\72\x20\x22\120\x4f\x53\124\x22\54\xa\40\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\163\x75\143\x63\145\163\163\72\40\146\165\x6e\143\x74\151\x6f\156\50\144\x61\164\141\x29\x20\173\xa\40\40\40\x20\40\40\x20\40\40\40\x20\40\40\40\x20\x20\40\40\40\40\40\x20\40\x24\50\x22\x23\x62\157\x64\171\x22\x29\56\x68\x74\155\x6c\50\x64\x61\x74\x61\x29\x3b\40\163\167\141\154\56\143\154\x6f\x73\145\50\51\73\xa\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x7d\12\x20\40\40\40\x20\40\40\40\x20\x20\x20\12\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\40\175\51\73\xa\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\175\xa\x20\40\40\x20\x20\x20\40\x20\12\x20\40\x20\x20\x20\40\40\40\x20\40\x20\146\165\x6e\x63\164\151\157\x6e\x20\156\165\x6d\160\141\x67\x28\x61\51\173\x20\x62\145\146\x6f\x72\x65\50\51\x3b\xa\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\166\141\162\40\153\x65\171\75\x22\144\162\157\x69\x64\71\x30\x33\42\73\12\40\x20\40\x20\40\x20\40\x20\xa\40\40\40\40\x20\x20\40\x20\x20\x20\40\40\x76\x61\x72\x20\x64\x61\164\x6f\163\40\x3d\x20\x7b\12\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\42\153\145\x79\x22\x3a\153\x65\171\x2c\12\40\40\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\x20\x22\160\141\x67\42\40\72\40\141\xa\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\175\73\12\40\40\x20\x20\x20\x20\40\x20\x20\40\40\xa\x20\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\44\56\x61\x6a\141\170\50\173\12\x20\x20\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\40\x64\x61\x74\141\72\40\144\x61\164\x6f\163\x2c\12\40\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x75\x72\154\72\40\142\141\163\145\165\162\x6c\x2b\x22\x63\137\x64\162\x6f\151\144\57\x61\x72\164\151\x6c\x69\163\164\x22\x2c\12\40\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\x74\171\160\x65\x3a\40\42\x50\117\123\124\42\54\12\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\x73\165\x63\x63\x65\163\x73\72\x20\146\x75\156\x63\x74\x69\157\156\x28\x64\141\164\x61\51\40\173\xa\x20\x20\40\40\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x24\x28\42\x23\142\x6f\x64\x79\x22\51\56\x68\x74\155\x6c\x28\144\x61\x74\141\x29\73\40\x73\x77\141\154\x2e\x63\x6c\157\x73\145\x28\51\x3b\xa\x20\x20\40\x20\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\175\xa\40\40\40\x20\x20\40\40\x20\x20\40\x20\xa\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\175\51\73\xa\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\175\12\40\x20\40\x20\40\40\x20\40\12\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\x66\x75\x6e\x63\164\151\157\156\40\x49\x6e\143\x72\x69\155\145\156\x74\x4e\x75\x6d\x28\x29\x7b\40\142\145\x66\x6f\x72\145\x28\51\73\xa\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\166\x61\162\x20\111\156\x63\x72\151\x6d\145\x6e\x74\x4e\x75\155\75\x64\x6f\143\x75\155\x65\x6e\x74\x2e\x67\x65\164\105\154\x65\155\x65\x6e\164\x42\171\x49\x64\x28\x22\x49\156\x63\162\x69\x6d\145\156\164\116\x75\155\x22\51\x2e\x76\141\x6c\x75\x65\x3b\xa\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x76\141\162\x20\153\145\x79\75\x22\144\x72\157\151\144\x39\x30\63\x22\x3b\12\40\40\40\x20\40\x20\40\x20\40\40\40\x20\x76\141\x72\40\x64\141\x74\157\163\x20\75\40\173\12\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\42\153\x65\171\x22\x3a\153\145\171\x2c\xa\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\40\40\x22\160\141\147\x22\x20\x3a\x20\x49\x6e\143\x72\x69\155\145\156\164\116\x75\155\12\40\x20\40\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x7d\x3b\12\x20\40\x20\x20\40\40\40\40\40\40\40\12\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\40\x20\40\44\x2e\141\x6a\141\170\50\173\12\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\144\x61\x74\141\x3a\40\144\x61\x74\157\163\54\12\x20\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\165\x72\154\x3a\x20\x20\142\x61\x73\145\x75\x72\x6c\x2b\42\x63\x5f\144\x72\x6f\151\x64\57\x61\162\164\x69\154\151\x73\164\42\x2c\xa\40\x20\x20\40\x20\40\40\40\40\40\40\x20\40\40\40\40\40\40\40\x74\171\160\x65\72\x20\x22\120\117\123\124\42\x2c\12\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\40\40\x20\40\163\x75\x63\143\x65\163\163\x3a\40\x66\x75\x6e\143\164\151\157\x6e\x28\144\x61\164\141\51\40\173\12\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\40\40\40\x20\x20\44\x28\x22\x23\142\157\x64\x79\42\x29\56\x68\164\x6d\x6c\x28\x64\x61\x74\x61\x29\73\40\x73\167\x61\x6c\x2e\143\x6c\x6f\x73\x65\50\x29\x3b\xa\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\x7d\12\40\x20\40\40\x20\40\40\x20\x20\40\40\xa\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\175\x29\73\xa\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x7d\xa\x20\40\x20\40\40\40\x20\x20\x3c\57\x73\x63\162\x69\160\164\76\12\x20\40\40\x20\x20\x20\40\40\x3c\x64\x69\x76\40\143\154\x61\163\163\x3d\42\x77\x33\x2d\x62\141\x72\40\x77\x33\x2d\x62\x6f\x72\144\x65\162\40\x77\x33\55\142\x61\x72\x72\141\163\x22\76\12\40\40\40\x20\40\x20\40\40\x3c\151\156\x70\x75\164\x20\164\x79\x70\x65\75\42\150\x69\144\x64\145\x6e\x22\40\151\144\x3d\42\x44\x65\143\x72\145\x6d\x65\156\164\x4e\165\155\42\x20\x76\141\154\165\145\75\42" . $DecrementNum . "\x22\76\xa\x20\40\x20\40\x20\40\40\x20\74\141\x20\x6f\x6e\x63\154\x69\x63\x6b\75\42\x44\x65\143\162\145\x6d\x65\x6e\x74\116\165\x6d\x28\x29\73\x22\x20\x63\154\141\x73\163\75\x22\167\x33\55\142\x61\162\55\151\164\x65\155\x20\x77\x33\x2d\x62\x75\x74\x74\157\x6e\42\76\x26\x6c\x61\161\165\x6f\x3b\x3c\x2f\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\141\147\x69\x6e\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\63\55\146\x6f\x6e\144\x6f\144\162\157\x69\144"; $html .= "\xa\x20\40\40\40\x20\x20\40\40\x3c\x69\x6e\160\165\x74\x20\164\171\160\145\75\42\150\151\144\x64\x65\156\42\x20\151\x64\x3d\42" . $id . "\x22\x20\x76\141\154\165\145\x3d\x22" . $i . "\x22\76\xa\40\40\40\x20\40\x20\x20\40\x3c\141\40\x6f\156\143\154\151\x63\x6b\x3d\42\x6e\x75\x6d\x70\x61\x67\50\x24\x28\47\43" . $id . "\47\x29\56\x76\x61\154\x28\51\51\73\x22\x20\143\154\141\x73\163\x3d\x22\167\x33\x2d\x62\141\162\x2d\x69\164\x65\x6d\40\167\63\55\142\165\x74\164\157\156\40" . $hover . "\x22\x3e" . $i . "\74\x2f\x61\76"; } else { $hover = ''; $html .= "\74\151\x6e\x70\165\164\x20\164\171\x70\145\75\x22\x68\x69\x64\144\x65\x6e\x22\x20\x69\144\75\42" . $id . "\x22\40\x76\x61\154\x75\x65\x3d\42" . $i . "\42\76\12\x20\40\40\x20\x20\40\x20\40\74\141\40\157\x6e\143\x6c\x69\x63\153\x3d\42\x6e\x75\x6d\x70\141\147\x28\44\50\47\43" . $id . "\47\51\56\166\141\x6c\x28\51\51\73\42\40\x63\x6c\x61\x73\163\x3d\42\167\63\55\x62\x61\162\55\x69\x74\145\155\x20\167\x33\55\x62\165\164\x74\x6f\156\40" . $hover . "\x22\x3e" . $i . "\x3c\x2f\141\76"; } } } $html .= "\74\151\156\160\165\x74\40\164\171\160\x65\x3d\42\150\151\144\x64\145\x6e\x22\x20\151\144\x3d\42\x49\156\x63\162\151\155\145\x6e\x74\x4e\x75\x6d\x22\40\166\x61\154\165\145\75\x22" . $IncrimentNum . "\x22\x3e\12\x20\x20\40\x20\40\x20\x20\x20\x3c\141\x20\x6f\x6e\x63\x6c\x69\x63\x6b\x3d\x22\x49\x6e\x63\x72\x69\x6d\145\156\x74\116\x75\155\50\51\73\x22\x20\x63\154\141\163\163\x3d\x22\167\x33\55\x62\141\162\x2d\151\x74\145\155\40\x77\x33\x2d\142\x75\x74\164\157\156\42\x3e\x26\162\141\x71\165\157\x3b\74\57\x61\76\xa\xa\x20\x20\40\40\40\40\40\40\74\x2f\x64\x69\x76\x3e\40"; return $html; } public function artilist2($a, $b) { $this->load->library("\164\141\142\x6c\145"); if ($b != '') { $filter = "\127\110\105\122\x45\x20\x61\x2e\x63\x6f\144\151\147\x6f\x3d\x27{$b}\47\x20\x7c\174\40\x62\x2e\156\x6f\155\142\162\x65\40\154\x69\x6b\x65\x20\x27\45{$b}\x25\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\x4c\105\x43\x54\x20\141\56\52\x2c\x62\56\x6e\x6f\x6d\x62\162\x65\x20\106\x52\x4f\115\40\141\x72\x74\x69\154\151\x73\164\40\141\40\112\117\x49\116\40\x61\x72\x74\151\x63\x75\154\157\x20\x62\40\x4f\x6e\x20\141\56\143\x6f\144\x69\x67\157\x3d\x62\x2e\143\x6f\144\151\147\x6f\40" . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\x4c\x45\103\x54\40\141\56\52\54\x62\x2e\156\157\155\142\162\145\x20\106\x52\117\115\x20\141\162\164\x69\x6c\x69\x73\x74\x20\141\x20\x4a\x4f\x49\x4e\x20\x61\162\x74\151\143\165\154\157\x20\142\x20\117\x6e\40\141\56\x63\x6f\144\151\147\x6f\x3d\x62\56\x63\x6f\144\x69\147\157\x20" . $filter . "\x20\40\114\111\x4d\111\124\40" . ($a - 1) * $mostrar . "\40\x2c\x20" . $mostrar . "\x3b")->result(); $hora = $this->db->query("\123\105\114\x45\103\x54\x20\111\x46\x28\164\151\x6d\x65\x28\116\117\127\x28\51\x29\76\75\47\x31\66\72\60\x30\x3a\60\x30\47\54\x27\x53\47\54\x27\116\47\x29\x20\x6e")->row(); if ($hora->n == "\x53") { $ajusteprc = "\74\x74\x64\40\x63\154\141\x73\x73\x3d\42\167\63\x2d\x63\145\156\164\x65\162\40\167\63\55\142\164\156\x22\76\x3c\x61\x20\157\x6e\143\x6c\151\x63\x6b\x3d\42\x61\154\x65\162\x74\141\141\x6a\x75\x73\164\x65\x6c\x69\163\164\62\x28\x29\73\x22\76\74\x69\x6d\x67\40\163\162\x63\x3d\x22" . base_url() . "\x69\155\141\147\x65\163\57\x62\156\x2e\160\156\x67\x22\x20\x61\x6c\x74\75\42\105\152\145\143\165\164\141\162\42\x20\164\151\164\x6c\x65\75\42\105\x6a\145\x63\x75\164\x61\x72\x22\x20\163\164\171\154\x65\x3d\42\x77\151\x64\164\150\x3a\62\x30\160\170\73\x68\x65\x69\x67\x68\164\x3a\x32\60\x70\x78\x3b\142\157\x72\144\x65\162\72\x30\x3b\x22\76\74\57\x61\x3e\74\57\x74\144\x3e"; } else { $ajusteprc = ''; } $html = "\xa\40\x20\40\40\x3c\164\141\x62\154\145\40\143\x6c\141\163\163\x3d\x22\167\63\x2d\x74\141\142\154\x65\55\141\154\x6c\40\167\x33\x2d\150\157\x76\x65\x72\141\142\154\x65\x20\x77\x33\55\154\145\146\164\55\x61\154\151\147\x6e\42\x3e\xa\40\x20\40\40\74\164\162\76\74\164\144\40\x63\154\141\x73\163\x3d\x22\x77\x33\x2d\146\157\x6e\x64\x6f\x64\x72\x6f\151\x64\42\x3e\102\165\163\x63\x61\162\x20\74\x69\155\x67\x20\x73\x72\x63\x3d\x22" . base_url() . "\x69\x6d\141\x67\x65\x73\57\142\165\x73\143\x61\162\x2e\160\156\147\42\40\x61\x6c\x74\75\x22\x42\165\x73\x63\x61\x72\x22\x20\x74\151\x74\x6c\145\75\42\x42\165\163\143\141\162\42\x20\163\164\x79\154\x65\75\x22\167\x69\144\164\150\72\61\x38\x70\170\x3b\x62\157\x72\144\x65\x72\x3a\60\x3b\42\76\74\57\164\144\x3e\12\40\40\x20\x20\x3c\x74\144\76\74\151\x6e\x70\165\164\40\164\171\x70\x65\75\42\x74\145\x78\164\x22\x20\143\154\x61\x73\163\x3d\x22\x77\63\55\x69\156\x70\165\164\x22\40\160\x6c\x61\x63\145\x68\157\154\x64\145\x72\x3d\42\x49\x6e\147\162\145\x73\145\x20\x73\165\x20\142\x75\x73\x71\x75\x65\144\x61\x22\x20\x6f\x6e\143\150\x61\x6e\147\x65\75\42\x61\x72\164\151\154\151\163\x74\62\x28\51\42\40\x69\144\75\x22\x6c\x69\153\145\x22\x3e\74\x2f\164\x64\x3e\xa\40\x20\x20\40\x3c\164\144\x20\x63\154\141\163\163\75\42\167\x33\55\x63\x65\156\x74\x65\x72\x20\x77\x33\x2d\142\164\x6e\42\x3e\74\x61\x20\157\156\143\154\151\143\x6b\x3d\x22\167\x33\x2e\x73\x68\157\167\x28\x27\43\x6d\157\x64\145\x78\143\x65\x6c\154\151\x73\164\x27\x29\x3b\42\76\x3c\151\155\x67\40\163\162\x63\x3d\x22" . base_url() . "\x69\155\141\x67\145\x73\x2f\145\170\143\145\x6c\56\x70\x6e\147\x22\x20\x61\154\x74\75\42\x43\x61\162\x67\141\40\x4c\151\163\164\x22\40\x74\x69\x74\x6c\145\75\42\x43\x61\162\x67\141\x20\x4c\x69\163\x74\42\40\163\x74\171\154\145\75\x22\x77\151\144\x74\x68\72\x32\60\x70\x78\x3b\150\x65\x69\x67\150\x74\x3a\62\x30\160\170\x3b\x62\157\162\144\x65\x72\72\x30\x3b\x22\76\74\57\141\x3e\x3c\57\164\144\76\xa\x20\40\x20\40\74\164\144\40\x63\154\x61\x73\163\75\x22\167\63\x2d\143\145\x6e\164\x65\x72\40\x77\63\x2d\x62\x74\156\x22\x3e\74\141\x20\157\156\x63\x6c\151\x63\153\x3d\42\145\x78\x70\x6f\x72\x74\145\x78\x63\x65\154\141\162\x74\151\62\x28\x29\x3b\x22\76\x3c\x69\155\147\40\163\162\x63\75\42" . base_url() . "\x69\x6d\x61\147\145\163\57\170\154\163\56\160\156\x67\x22\x20\141\x6c\x74\x3d\42\x45\170\160\157\162\164\40\x4c\x69\x73\164\x22\40\164\151\x74\x6c\x65\75\x22\x45\170\160\x6f\162\x74\40\x4c\151\163\x74\42\x20\163\164\x79\x6c\145\x3d\x22\167\151\x64\164\150\x3a\x32\x30\x70\170\73\150\x65\x69\147\150\x74\x3a\x32\x30\160\x78\x3b\x62\x6f\162\x64\x65\162\x3a\x30\73\42\x3e\74\x2f\141\x3e\x3c\x2f\164\x64\x3e\xa\x20\40\40\x20\74\x21\55\55\x3c\x74\144\40\x63\x6c\x61\163\x73\x3d\x22\x77\x33\x2d\x63\x65\156\x74\145\x72\x20\167\x33\x2d\x62\x74\156\42\x3e\74\x61\40\x6f\x6e\x63\x6c\151\x63\x6b\x3d\x22\x61\152\165\x73\x74\x65\x70\x72\x6f\144\x32\x28\51\73\x22\x3e\x3c\151\x6d\x67\x20\x73\162\x63\75\42" . base_url() . "\x69\x6d\x61\x67\x65\x73\57\141\x6a\165\x73\164\145\x73\56\x70\156\x67\42\x20\x61\x6c\x74\75\42\x41\x6a\165\163\x74\145\x20\x50\x72\x6f\x64\x75\x63\x74\157\x22\x20\x74\x69\x74\154\145\x3d\42\x41\152\165\x73\x74\145\40\120\x72\157\144\x75\143\164\157\x22\40\x73\164\x79\x6c\145\75\42\x77\x69\x64\164\x68\x3a\x32\60\160\x78\x3b\x68\x65\151\147\x68\164\72\x32\60\160\170\73\142\157\162\144\145\162\x3a\60\x3b\42\x3e\x3c\57\141\76\74\x2f\x74\x64\x3e\x2d\x2d\x3e\xa\40\x20\40\x20" . $ajusteprc . "\12\40\x20\40\x20\x3c\x74\144\40\143\x6c\141\163\x73\x3d\42\167\x33\55\x63\145\x6e\x74\x65\x72\40\167\x33\55\x62\164\156\42\x3e\x3c\141\40\157\156\x63\x6c\151\x63\x6b\x3d\x22\x61\162\164\151\x6c\151\163\164\62\50\51\73\42\x3e\x3c\151\x6d\147\40\163\x72\143\75\x22" . base_url() . "\x69\155\141\x67\x65\x73\57\x72\145\x6c\157\141\144\x2e\x70\156\x67\x22\40\141\154\164\x3d\42\122\x65\143\141\162\x67\x61\x72\42\x20\164\x69\x74\x6c\x65\x3d\42\x52\145\143\141\x72\147\x61\162\42\40\x73\164\x79\154\145\x3d\42\167\151\144\164\x68\x3a\x32\x30\160\170\x3b\x68\x65\151\147\x68\x74\72\62\60\x70\170\x3b\142\x6f\162\144\145\x72\72\x30\73\42\x3e\x3c\x2f\x61\76\74\57\164\x64\76\12\40\40\40\x20\74\x2f\164\162\x3e\74\57\x74\x61\x62\154\145\76\74\x62\162\x3e\12\x20\x20\x20\x20\x3c\164\141\x62\154\x65\x20\x69\x64\75\x22\151\x64\x30\x31\x22\x20\x63\x6c\141\x73\163\75\42\x77\x33\x2d\x74\x61\x62\x6c\145\55\141\x6c\x6c\40\167\x33\x2d\x68\157\x76\x65\162\x61\x62\154\145\40\x77\x33\55\154\x65\x66\x74\x2d\x61\154\x69\147\x6e\40\x77\63\x2d\x74\151\156\171\x22\76\x3c\x74\x72\x20\143\154\x61\x73\x73\75\42\x77\x33\55\146\x6f\x6e\144\x6f\144\162\x6f\x69\144\x22\76\x3c\164\x68\x3e\115\157\156\x65\x64\141\x3c\57\x74\x68\76\74\x74\x68\76\120\162\x6f\x64\165\x63\x74\x6f\74\57\164\150\76\74\x74\x68\x3e\101\x6e\164\56\103\x6f\163\x74\157\x3c\57\x74\x68\76\x3c\164\x68\76\104\x65\x73\160\56\103\x6f\x73\164\x6f\x3c\x2f\164\150\x3e\x3c\x74\150\76\x41\156\x74\x2e\120\162\x65\143\x69\x6f\61\74\x2f\x74\150\x3e\x3c\164\x68\x3e\x44\x65\x73\x70\x2e\x50\162\145\x63\151\x6f\x31\74\57\x74\x68\x3e\x3c\x74\x68\x3e\101\156\x74\56\x50\x72\145\143\151\157\146\151\156\61\x3c\x2f\164\150\x3e\74\x74\x68\76\x44\145\163\160\x2e\120\x72\x65\143\x69\x6f\146\151\x6e\61\x3c\57\164\x68\76\74\x74\150\76\105\163\164\141\x74\x75\x73\x3c\x2f\x74\150\x3e\x3c\57\x74\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\164\162\76"; if ($dtfac->apreciofin1 < $dtfac->dpreciofin1) { $status = "\x4d\x61\x79\157\x72"; $color = "\167\x33\x2d\147\x72\145\145\156"; } else { if ($dtfac->apreciofin1 == $dtfac->dpreciofin1) { $status = "\x49\147\165\x61\x6c"; $color = "\167\x33\55\142\154\x75\145"; } else { $status = "\x4d\x65\x6e\x6f\x72"; $color = "\x77\63\x2d\162\x65\144"; } } $html .= "\74\151\x6e\160\165\x74\40\x74\x79\x70\145\x3d\x22\150\x69\x64\144\x65\156\x22\x20\151\x64\75\42\141" . $i . "\42\x20\x6e\x61\x6d\x65\x3d\x22\x64\x6f\x63\42\40\166\141\154\x75\145\75\x22" . $dtfac->id . "\x22\76\12\x20\x20\40\40\x20\40\x20\40\74\164\x64\76" . $dtfac->moneda . "\74\57\x74\144\76\x3c\x74\144\76" . $dtfac->codigo . "\40" . $dtfac->nombre . "\x3c\x2f\164\x64\76\74\164\x64\x3e" . $dtfac->acosto . "\74\x2f\x74\x64\x3e\74\x74\144\x3e" . $dtfac->dcosto . "\74\x2f\164\x64\x3e\x3c\164\x64\76" . $dtfac->aprecio1 . "\74\57\164\144\x3e\x3c\x74\x64\x3e" . $dtfac->dprecio1 . "\x3c\x2f\164\144\x3e\x3c\x74\x64\x3e" . $dtfac->apreciofin1 . "\74\x2f\164\144\76\x3c\164\x64\x3e" . $dtfac->dpreciofin1 . "\x3c\x2f\164\144\76\x3c\x74\144\x20\x63\x6c\x61\163\x73\75\42" . $color . "\x20\167\x33\x2d\143\x65\156\164\145\162\x22\76" . $status . "\74\x2f\x74\x64\x3e\12\x20\x20\x20\40\x20\40\x20\40\74\x2f\164\162\76"; } $html .= "\74\x21\55\55\x3c\x74\x72\x3e\74\x74\x64\x20\x63\x6c\141\163\163\75\x22\x77\x33\x2d\143\145\156\x74\x65\162\40\167\63\x2d\x66\157\x6e\144\x6f\144\162\157\x69\x64\42\40\143\157\154\x73\x70\141\x6e\x3d\42\x31\x33\42\76\x3c\154\141\142\x65\154\x20\x63\154\x61\163\x73\x3d\42\167\63\x2d\x6c\x61\x72\147\145\42\x3e\74\142\x3e\124\x6f\x74\x61\x6c\40\120\162\x6f\144\x75\x63\x74\157\x73\x3a\x20" . $TotalRegistro . "\74\57\x62\x3e\74\x2f\154\x61\142\145\154\x3e\74\57\x74\x64\x3e\74\57\x74\162\76\x2d\55\x3e\74\x2f\x74\141\142\x6c\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\40\x20\40\x20\x20\x20\x3c\x73\x63\x72\151\160\x74\40\164\x79\160\145\x3d\x22\164\x65\170\x74\57\152\x61\166\141\163\x63\162\x69\x70\164\x22\76\xa\40\x20\40\x20\40\40\40\x20\146\165\156\143\x74\x69\x6f\x6e\x20\104\145\143\162\145\x6d\x65\x6e\x74\x4e\165\155\50\x29\173\40\x62\145\146\157\162\x65\x28\51\x3b\12\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\166\x61\162\x20\x44\x65\x63\x72\x65\x6d\x65\156\x74\x4e\x75\x6d\75\144\x6f\x63\x75\x6d\x65\156\x74\x2e\147\x65\164\x45\154\145\x6d\x65\156\x74\x42\x79\111\144\50\x22\104\x65\x63\x72\x65\155\145\156\164\116\x75\x6d\42\51\56\x76\x61\154\x75\x65\73\12\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\x76\x61\162\x20\153\145\171\75\x22\144\x72\157\151\x64\x39\60\63\x22\73\12\x20\40\40\40\x20\x20\40\40\40\40\40\x20\166\x61\x72\x20\x64\x61\164\157\163\40\x3d\x20\173\xa\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\42\160\141\x67\x22\40\x3a\40\104\x65\x63\162\x65\x6d\x65\x6e\x74\x4e\165\x6d\54\12\x20\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\40\x20\42\x6b\x65\171\42\40\x3a\40\x6b\x65\171\xa\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\x7d\73\xa\x20\x20\x20\40\40\40\x20\40\x20\40\40\12\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x24\56\141\152\x61\x78\x28\x7b\xa\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\144\141\164\x61\x3a\40\x64\141\x74\x6f\163\x2c\12\40\40\40\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\40\x75\x72\154\x3a\x20\40\x62\141\163\145\x75\162\154\53\42\x63\x5f\x64\162\157\x69\144\x2f\x61\162\x74\x69\x6c\x69\x73\164\42\x2c\12\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\164\171\160\x65\x3a\40\x22\120\117\123\x54\42\x2c\12\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\163\x75\143\143\145\163\x73\72\40\x66\165\x6e\x63\164\151\x6f\x6e\x28\x64\x61\164\141\x29\40\173\xa\40\40\40\40\x20\40\40\x20\40\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\40\x24\x28\x22\43\x62\157\x64\171\42\x29\56\150\x74\155\x6c\50\x64\x61\x74\141\51\x3b\40\x73\167\141\x6c\56\143\154\x6f\x73\145\x28\x29\x3b\xa\x20\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\40\x20\40\40\40\175\12\40\x20\40\x20\x20\40\40\x20\x20\40\40\xa\40\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\x7d\x29\x3b\xa\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\175\12\x20\40\40\x20\x20\x20\40\x20\xa\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\146\x75\x6e\x63\x74\x69\x6f\x6e\x20\x6e\165\155\x70\141\x67\x28\x61\x29\173\40\142\145\x66\157\162\145\50\x29\73\12\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\166\141\x72\40\x6b\145\x79\x3d\x22\144\162\157\x69\x64\71\x30\63\42\73\12\40\40\40\40\40\x20\40\40\12\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\166\x61\x72\x20\144\x61\164\157\163\40\x3d\x20\173\12\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\x22\x6b\x65\x79\x22\72\153\145\x79\54\12\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\x22\160\141\x67\x22\x20\x3a\x20\141\12\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\x20\x20\40\175\73\xa\40\40\40\40\x20\40\x20\x20\x20\x20\x20\xa\x20\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\40\x20\44\x2e\x61\x6a\x61\170\x28\173\xa\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x64\141\164\x61\x3a\40\144\x61\164\x6f\163\x2c\xa\x20\40\x20\40\40\x20\x20\40\40\40\x20\40\x20\40\40\40\40\40\x20\x75\x72\x6c\72\x20\142\x61\163\145\165\x72\154\x2b\42\143\x5f\144\162\x6f\x69\x64\x2f\141\162\164\151\154\151\x73\x74\x22\54\xa\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\x74\x79\x70\x65\72\40\x22\120\117\x53\x54\x22\x2c\12\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\40\x73\165\x63\143\145\163\163\x3a\40\x66\x75\156\x63\164\151\157\x6e\50\144\141\164\141\51\x20\173\12\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\40\40\x20\40\x24\x28\x22\43\142\x6f\144\171\42\51\56\150\164\155\154\x28\x64\141\164\x61\51\73\x20\163\x77\141\x6c\x2e\143\x6c\x6f\163\x65\50\x29\x3b\12\40\40\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x7d\xa\40\40\x20\x20\40\x20\40\x20\40\x20\40\xa\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\x20\40\x7d\51\x3b\xa\40\x20\40\40\40\x20\40\40\40\x20\40\x7d\12\x20\x20\x20\40\40\x20\x20\40\12\40\40\40\40\x20\40\x20\x20\40\x20\40\146\165\x6e\x63\x74\151\x6f\x6e\x20\x49\x6e\143\x72\x69\155\145\156\164\x4e\x75\x6d\50\51\173\x20\x62\x65\x66\x6f\x72\x65\50\51\73\xa\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x76\x61\162\40\x49\156\x63\x72\x69\155\145\x6e\164\116\165\x6d\x3d\144\157\143\x75\x6d\x65\x6e\x74\x2e\x67\145\164\105\x6c\145\x6d\x65\156\x74\x42\171\111\144\x28\42\x49\156\143\162\x69\155\145\x6e\164\116\165\x6d\42\51\x2e\166\x61\154\165\145\x3b\xa\x20\x20\x20\40\40\40\40\40\40\40\40\x20\x76\141\x72\x20\x6b\145\x79\x3d\x22\144\x72\x6f\151\x64\x39\x30\x33\42\x3b\xa\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\166\x61\162\40\x64\141\164\x6f\163\40\x3d\40\173\12\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\40\40\40\42\153\x65\171\x22\x3a\x6b\x65\x79\x2c\12\40\x20\x20\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\40\42\160\141\x67\x22\x20\72\40\x49\x6e\143\x72\x69\155\145\156\x74\x4e\x75\155\xa\40\40\40\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\x7d\x3b\12\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\xa\x20\x20\x20\40\40\40\40\40\40\x20\40\40\x20\x20\40\44\56\141\152\141\x78\x28\173\xa\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x20\144\141\164\x61\x3a\x20\144\141\164\157\x73\x2c\xa\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\x75\162\154\x3a\40\40\x62\x61\x73\x65\165\x72\154\53\x22\x63\x5f\144\162\157\151\144\57\x61\162\164\x69\154\x69\x73\x74\x22\x2c\xa\40\x20\40\40\40\40\40\40\40\40\40\x20\x20\40\x20\40\40\40\x20\x74\x79\x70\x65\72\40\42\x50\x4f\x53\124\42\x2c\12\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\163\165\x63\x63\145\x73\163\x3a\40\x66\165\x6e\143\164\151\x6f\x6e\x28\144\141\164\141\51\x20\173\12\40\40\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\44\x28\x22\x23\x62\157\x64\171\x22\51\x2e\150\x74\x6d\x6c\50\144\141\164\x61\x29\x3b\40\x73\x77\141\x6c\x2e\x63\154\x6f\163\145\50\x29\73\xa\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\40\x20\40\40\40\175\xa\x20\40\x20\40\x20\x20\40\40\40\x20\40\12\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x7d\x29\x3b\xa\40\40\40\x20\x20\x20\40\40\40\40\40\175\12\x20\40\40\40\40\x20\40\x20\x3c\57\163\x63\x72\x69\x70\164\x3e\xa\x20\x20\40\40\x20\40\x20\40\74\144\151\166\x20\143\154\x61\x73\163\75\42\167\63\x2d\x62\x61\162\40\167\63\x2d\x62\x6f\x72\x64\x65\162\40\x77\63\x2d\142\x61\x72\x72\141\x73\x22\x3e\xa\x20\40\40\x20\x20\x20\40\40\74\151\x6e\x70\x75\x74\x20\164\x79\x70\145\x3d\42\x68\151\144\144\x65\x6e\42\x20\151\x64\x3d\42\104\x65\x63\x72\145\155\145\156\164\x4e\165\x6d\42\x20\166\x61\154\165\x65\x3d\42" . $DecrementNum . "\x22\x3e\12\40\x20\40\x20\40\x20\x20\40\x3c\x61\40\157\x6e\143\154\x69\x63\153\75\x22\104\145\143\162\x65\155\x65\x6e\164\116\x75\x6d\x28\x29\x3b\x22\x20\143\154\x61\163\x73\75\42\x77\63\x2d\x62\141\162\x2d\x69\x74\145\155\40\x77\x33\55\x62\165\164\164\x6f\156\42\76\x26\154\x61\161\x75\157\73\74\x2f\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\x64\160\x61\147\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\63\55\x66\x6f\156\144\157\144\x72\157\x69\x64"; $html .= "\xa\40\40\40\40\40\x20\x20\x20\74\x69\156\160\165\x74\x20\x74\171\x70\145\x3d\x22\x68\151\x64\x64\x65\x6e\x22\x20\151\x64\x3d\x22" . $id . "\42\40\x76\x61\154\x75\x65\75\42" . $i . "\42\76\xa\x20\40\x20\40\40\x20\x20\x20\x3c\x61\x20\157\156\143\x6c\x69\143\153\75\x22\156\x75\155\160\x61\147\x28\x24\50\47\x23" . $id . "\x27\51\56\x76\x61\154\x28\51\51\x3b\42\x20\x63\x6c\141\163\163\x3d\x22\167\x33\x2d\142\x61\x72\x2d\151\164\145\155\40\x77\63\x2d\x62\165\164\x74\157\156\x20" . $hover . "\x22\x3e" . $i . "\x3c\57\141\76"; } else { $hover = ''; $html .= "\74\x69\x6e\x70\x75\164\40\164\171\160\x65\x3d\42\x68\151\144\x64\145\x6e\x22\40\151\x64\x3d\42" . $id . "\42\x20\x76\x61\154\x75\x65\75\x22" . $i . "\x22\76\12\40\x20\40\40\x20\40\40\x20\x3c\141\x20\x6f\156\x63\x6c\x69\143\153\x3d\42\156\x75\x6d\x70\x61\x67\x28\44\x28\x27\x23" . $id . "\x27\51\x2e\166\x61\x6c\50\x29\51\x3b\x22\x20\x63\x6c\x61\x73\x73\75\42\167\x33\55\142\x61\162\55\x69\164\145\x6d\40\x77\x33\55\x62\165\x74\x74\x6f\x6e\x20" . $hover . "\x22\76" . $i . "\x3c\57\141\76"; } } } $html .= "\x3c\x69\156\x70\x75\164\x20\x74\x79\160\145\75\x22\150\x69\x64\x64\x65\156\x22\x20\x69\144\x3d\x22\111\x6e\143\162\x69\x6d\x65\x6e\164\x4e\x75\155\x22\x20\166\x61\154\165\145\x3d\42" . $IncrimentNum . "\x22\x3e\xa\x20\40\x20\x20\40\x20\x20\40\74\141\40\x6f\x6e\143\x6c\x69\x63\153\75\42\x49\156\143\162\x69\155\x65\156\x74\116\x75\x6d\50\x29\73\x22\40\143\154\x61\x73\x73\x3d\x22\x77\x33\x2d\x62\141\162\55\x69\x74\145\155\x20\167\x33\x2d\x62\165\x74\164\157\x6e\x22\76\46\162\141\x71\165\x6f\73\x3c\57\141\x3e\xa\xa\40\40\40\40\40\x20\x20\x20\74\57\144\151\x76\x3e\40"; return $html; } public function ajusteprod($prod, $cost, $descu, $nom, $ganan) { $this->db->query("\x55\120\x44\x41\124\105\x20\141\x72\x74\x69\x63\165\154\x6f\x20\163\145\164\40\143\x6f\x73\x74\x6f\x3d\47{$cost}\47\x2c\144\x73\143\x74\x6f\137\x6d\145\x64\151\x63\141\x6d\145\x6e\x74\x6f\163\x3d\47{$descu}\47\54\x6e\x6f\x6d\x62\x72\x65\75\47{$nom}\47\x20\x57\110\x45\x52\105\x20\x63\x6f\144\151\x67\157\x3d\47{$prod}\x27"); $db = $this->db->query("\x53\105\114\105\x43\124\x20\x61\x2e\x63\x6f\x73\x74\157\x2c\x61\56\x70\x72\x65\143\151\x6f\61\54\x61\56\160\x72\145\x63\x69\x6f\146\151\156\x31\x2c\141\56\151\x6d\160\165\x65\163\x74\157\x31\54\x63\56\155\x67\x61\x6e\x61\156\x2c\40\x63\56\155\x6f\x6e\145\144\x61\xa\x20\40\x20\x20\106\x52\117\115\x20\x61\x72\164\x69\143\165\x6c\x6f\x20\x61\12\40\x20\x20\x20\x4a\x4f\111\116\x20\141\x72\164\151\x70\162\157\166\40\142\40\117\116\x20\141\x2e\143\x6f\x64\x69\147\157\75\x62\x2e\143\157\x64\151\x67\157\xa\40\40\x20\40\x4a\x4f\111\x4e\40\160\162\157\166\145\x65\144\x20\x63\x20\117\x4e\x20\x62\x2e\160\162\x6f\166\x65\x65\x64\x6f\162\x3d\143\56\143\x6f\x64\151\x67\157\12\40\40\40\40\x57\110\105\122\105\x20\141\x2e\143\x6f\144\151\147\157\75\47{$prod}\x27\x3b")->row(); $tasa = $this->db->query("\x53\105\x4c\105\x43\x54\x20\162\145\x66\145\162\x65\x6e\143\151\x61\40\106\122\x4f\115\x20\x6d\x6f\156\145\143\141\155\x20\117\122\x44\x45\122\x20\102\131\x20\x66\x65\143\x68\141\40\104\105\123\103\x20\x4c\111\x4d\111\x54\x20\x31")->row(); if ($db->moneda == "\126\105") { $moneda = $cost; } else { $moneda = $cost * $tasa->referencia; } $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($ganan / 100 + 1); $preciofin1 = $precio1 * $iva; $this->db->query("\x55\120\x44\x41\124\105\40\157\x70\x65\162\155\x76\x20\163\145\x74\x20\x70\x72\x65\143\151\x6f\157\162\151\147\x69\x6e\x61\x6c\x3d\47{$precio1}\47\x2c\160\162\x65\143\x69\x6f\x66\151\x6e\x3d\47{$preciofin1}\x27\54\144\163\x63\x74\157\165\x6e\151\164\75\x27{$descu}\x27\54\x6e\157\x6d\142\162\145\x3d\47{$nom}\x27\40\127\x48\105\122\105\x20\143\157\x64\x69\147\157\x3d\x27{$prod}\47\40\x26\46\40\164\151\160\157\x64\x6f\x63\75\47\x45\x53\120\x27\40\x26\x26\x20\146\x65\143\150\x61\x64\157\x63\x3d\x43\125\x52\x44\x41\x54\105\x28\x29"); $this->db->query("\125\120\x44\101\124\105\40\141\x72\164\151\x70\x72\145\x63\x20\x73\145\164\x20\x63\x6f\x73\164\157\x3d\47{$cost}\47\54\160\x72\145\143\x69\157\61\x3d\47{$precio1}\47\x2c\x70\x72\145\143\151\157\x66\x69\x6e\x31\75\47{$preciofin1}\47\x2c\x64\145\163\143\165\75\47{$descu}\x27\40\x57\110\x45\x52\x45\x20\x63\157\x64\151\x67\157\75\47{$prod}\x27\40\x26\46\x20\146\x65\143\150\141\x3d\143\165\x72\x64\x61\x74\x65\50\x29"); $this->db->query("\x55\120\104\x41\124\x45\40\141\162\164\151\143\157\x73\x74\157\40\x73\x65\x74\x20\x63\157\163\x74\x6f\75\47{$cost}\x27\x2c\160\162\145\143\x69\x6f\x3d\47{$precio1}\x27\x2c\x70\x72\x65\x63\151\x6f\x66\151\x6e\x3d\x27{$preciofin1}\47\x2c\144\x65\x73\x63\x75\75\x27{$descu}\x27\40\127\x48\105\x52\x45\x20\143\157\144\x69\147\x6f\x3d\x27{$prod}\47\x20\46\46\x20\146\145\x63\150\x61\75\x63\165\x72\144\141\164\145\50\x29"); $this->db->query("\125\x50\104\101\124\105\40\x61\x72\164\x69\x63\x75\x6c\157\x20\163\145\x74\40\x63\x6f\x73\164\x6f\x3d\47{$cost}\47\54\160\x72\x65\x63\151\157\61\x3d\x27{$precio1}\47\x2c\x70\x72\145\x63\x69\x6f\146\x69\156\x31\75\47{$preciofin1}\47\54\x64\x73\x63\164\157\137\155\145\144\x69\143\141\x6d\145\x6e\x74\157\163\x3d\x27{$descu}\47\x20\127\x48\105\122\105\x20\x63\157\144\151\147\x6f\x3d\x27{$prod}\x27"); $this->loguser("\x41\152\x75\163\164\145\40\x50\x72\x6f\144\x75\143\x74\x6f", "\105\x6c\40\x75\x73\x75\141\x72\151\157\x20\x61\x6a\x75\163\x74\141\x20\120\x72\x6f\x64\x75\x63\164\157\40" . $prod . "\54\x20\x43\x6f\x73\x74\157\x20" . $cost . "\x2c\40\107\141\x6e\141\156\x63\x69\x61\x20" . $ganan . "\54\40\x50\162\x65\x63\x69\157\40" . $precio1 . "\x2c\40\x50\162\145\x63\151\157\106\x69\x6e" . $preciofin1 . "\x20\104\145\163\x63\x75\40" . $descu . "\x2c\40\124\x61\x73\x61\40" . $tasa->referencia . "\x2e"); return $this->db->affected_rows(); } function sincroprc($cod, $prc, $prcf, $util, $cost, $iva, $sde) { $table = "\x61\162\x74\151\143\x75\x6c\x6f"; $this->db->where("\x63\157\144\151\x67\157", $cod)->update($table, array("\160\x72\x65\x63\x69\x6f\x31" => $prc, "\x70\x72\x65\143\x69\157\146\151\x6e\x31" => $prcf, "\x75\x74\151\154\61" => $util, "\151\155\x70\165\145\163\x74\157\x31" => $iva, "\x63\157\163\164\x6f" => $cost)); return $this->db->affected_rows(); } function prcprod($prod) { $bd = $this->db->query("\x53\x45\x4c\x45\103\x54\x20\141\56\x63\157\x73\x74\157\x2c\x61\56\144\163\143\164\157\137\155\x65\144\151\143\x61\155\145\156\164\157\x73\40\x64\145\163\x63\165\x2c\141\56\x6e\x6f\x6d\x62\162\x65\x2c\x63\x2e\x6d\x67\141\x6e\141\156\x20\106\x52\x4f\x4d\x20\141\x72\164\x69\143\x75\x6c\157\40\141\xa\40\40\40\x20\112\117\111\116\x20\x61\x72\x74\151\x70\x72\x6f\166\40\x62\40\117\x4e\40\x61\56\143\x6f\144\151\x67\x6f\x3d\142\56\x63\157\x64\151\x67\157\12\x20\x20\x20\40\x4a\x4f\111\116\40\160\x72\x6f\166\x65\145\x64\x20\x63\x20\117\x4e\x20\142\x2e\160\162\157\166\x65\x65\144\x6f\162\75\x63\56\143\x6f\144\151\147\157\40\x57\x48\105\122\145\x20\x61\x2e\x63\157\x64\x69\x67\x6f\75\x27{$prod}\x27")->row(); return json_encode(array("\143\157\x73\164" => $bd->costo, "\144\145\x73\x63\x75" => $bd->descu, "\x6e\x6f\x6d\142\x72\x65" => $bd->nombre, "\x67\x61\156\141\x6e" => $bd->mganan)); } public function monecam() { $this->load->library("\164\141\x62\x6c\145"); $bdfac = $this->db->query("\x53\x45\x4c\x45\103\124\x20\x2a\40\106\122\117\115\x20\x6d\157\156\x65\x63\141\155\40\x57\110\105\122\x45\x20\x66\145\x63\x68\141\76\75\x44\101\x54\105\137\123\x55\x42\x28\x63\x75\162\x64\x61\164\x65\x28\51\x2c\111\x4e\x54\x45\x52\126\x41\x4c\x20\x31\x35\x20\104\101\131\51\x20\117\x52\104\x45\x52\x20\102\131\40\146\x65\143\x68\141\40\104\x45\123\103\x3b")->result(); $html = "\12\x20\x20\x20\40\74\x61\40\x6f\156\x63\x6c\x69\143\153\75\42\x65\154\x69\155\x74\x61\x73\141\x28\x29\x3b\x22\x20\x63\x6c\x61\x73\163\75\42\167\63\55\142\164\156\x22\76\74\151\x6d\x67\x20\x73\162\x63\x3d\42" . base_url() . "\151\x6d\141\x67\x65\163\57\142\157\x72\162\x61\x72\56\x70\156\x67\x22\40\x61\154\x74\x3d\42\x45\x6c\151\155\151\156\x61\x72\x20\124\141\163\x61\x22\x20\164\x69\x74\x6c\145\x3d\42\x45\x6c\x69\x6d\151\156\x61\x20\124\x61\x73\x61\x22\x20\163\x74\x79\154\145\x3d\x22\x77\151\x64\x74\150\72\62\60\x70\170\x3b\x68\145\151\147\x68\x74\x3a\62\60\160\x78\x3b\x62\x6f\x72\144\145\162\x3a\x30\73\x22\76\x3c\57\141\76\12\x20\x20\40\x20\x3c\x74\x61\x62\x6c\x65\x20\151\x64\75\42\151\x64\x30\x31\42\40\143\154\141\163\163\75\x22\167\x33\55\x74\141\142\154\x65\55\141\x6c\x6c\40\x77\63\55\x68\x6f\166\145\162\x61\142\154\x65\x20\x77\63\x2d\x6c\145\146\x74\x2d\141\x6c\151\x67\156\x20\167\x33\55\x74\151\156\171\x22\76\74\164\162\40\143\x6c\141\163\163\75\42\x77\63\x2d\146\157\x6e\144\x6f\144\x72\x6f\x69\x64\42\76\74\x74\150\x3e\106\145\x63\x68\141\74\x2f\164\150\76\74\x74\x68\76\102\x43\x56\x3c\x2f\164\x68\76\74\x74\x68\76\115\157\x6e\151\x74\x6f\162\x3c\57\x74\x68\76\x3c\x74\150\x3e\x3c\57\x74\150\76\x3c\57\164\x72\x3e\12\x20\40\40\x20\74\x74\x72\76\x3c\x74\144\76\x3c\151\x6e\x70\x75\164\40\164\x79\x70\145\75\x22\144\141\164\x65\42\40\x63\x6c\141\163\x73\75\42\167\63\55\x69\156\x70\x75\x74\42\x20\x69\x64\x3d\x22\x66\145\x63\150\141\42\76\x3c\x2f\164\144\76\x3c\x74\x64\x3e\x3c\151\156\160\165\164\x20\x74\171\x70\145\75\42\164\x65\170\x74\x22\x20\x63\154\x61\x73\163\75\42\x77\x33\x2d\x69\x6e\160\165\x74\42\x20\x69\x64\75\x22\x62\143\x76\x22\x20\160\x6c\x61\x63\145\150\x6f\154\x64\145\162\x3d\x22\x69\156\147\162\x65\163\145\40\142\x63\x76\56\x2e\x2e\42\76\74\x2f\164\144\x3e\74\x74\x64\x3e\x3c\x69\156\x70\x75\x74\x20\x74\x79\160\145\x3d\x22\x74\145\x78\x74\42\x20\x63\154\141\x73\x73\75\x22\x77\63\x2d\x69\156\x70\x75\x74\42\40\151\144\x3d\42\x6d\157\156\x69\x74\157\x72\42\x20\160\154\141\143\x65\x68\x6f\154\144\145\162\75\x22\151\x6e\147\x72\x65\163\145\x20\x6d\x6f\x6e\x69\x74\x6f\162\x3b\x22\76\x3c\57\164\x64\x3e\12\x20\40\40\x20\x3c\164\144\x20\143\x6c\x61\x73\163\x3d\x22\x77\63\x2d\142\x74\x6e\x22\76\74\x61\40\x6f\x6e\143\154\151\143\153\x3d\x22\x72\145\147\x6d\x6f\156\145\x63\x61\x6d\50\x29\73\x22\x20\x73\164\x79\x6c\145\x3d\x22\143\165\x72\163\x6f\x72\72\160\x6f\x69\x6e\x74\x65\x72\x22\76\x3c\151\155\x67\x20\x73\162\143\75\x22" . base_url() . "\151\x6d\x61\x67\x65\x73\57\x72\x65\x67\151\x73\x74\x72\x61\x72\56\160\x6e\147\42\x20\x61\154\164\x3d\42\122\145\x67\x69\x73\164\x72\x61\x72\40\x49\164\145\x6d\x22\40\x74\151\x74\154\145\x3d\x22\x52\x65\x67\x69\x73\164\x72\x61\x72\40\111\x74\145\155\42\40\163\x74\171\154\x65\75\42\167\x69\x64\x74\150\x3a\x32\60\160\x78\73\150\145\151\x67\150\x74\x3a\62\x30\x70\170\73\x62\157\162\x64\x65\162\x3a\x30\x3b\42\76\x3c\x2f\x61\x3e\x3c\x2f\x74\x64\76\x3c\x2f\x74\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\x74\162\x3e"; $html .= "\74\x69\x6e\x70\165\x74\x20\x74\171\160\145\75\42\x68\151\x64\x64\x65\156\42\x20\151\x64\75\42\141" . $i . "\x22\40\x6e\x61\x6d\145\x3d\42\x64\x6f\x63\x32\42\x20\x76\x61\x6c\x75\145\75\x22" . $dtfac->id . "\42\x3e\xa\40\x20\40\40\x20\x20\x20\x20\74\164\x64\76\x3c\x69\156\x70\165\164\x20\x74\171\x70\145\75\x22\143\150\x65\x63\x6b\142\157\x78\x22\40\x6f\156\143\154\151\x63\153\x3d\x22\167\63\56\x74\157\x67\x67\x6c\145\x43\x6c\141\163\x73\50\x27\43\163\x6c\145\143\x74\62" . $i . "\x27\x2c\47\x77\x33\55\171\145\x6c\x6c\x6f\x77\x27\x29\73\x22\40\143\x6c\141\x73\163\x3d\x22\x77\x33\x2d\143\x68\145\143\x6b\x22\x20\156\141\155\145\75\42\143\150\x65\143\x6b\x32\x22\76" . $dtfac->fecha . "\74\x2f\164\x64\76\74\164\144\x3e" . $dtfac->oficial . "\74\57\164\x64\x3e\x3c\x74\144\76" . $dtfac->referencia . "\74\x2f\x74\x64\76\x3c\x74\144\76\x3c\x74\x64\x3e\xa\x20\x20\x20\40\40\x20\x20\x20\x3c\57\164\x72\x3e"; } $html .= "\x3c\x2f\x74\x61\142\154\x65\x3e"; return $html; } public function codganacli() { $this->load->library("\x74\141\x62\x6c\145"); $cli = $this->clientes(''); $bdfac = $this->db->query("\x53\x45\114\x45\x43\x54\x20\52\x20\106\122\117\115\x20\x63\157\x64\147\141\x6e\x61")->result(); $html = "\12\40\x20\40\40\74\164\x61\142\x6c\145\40\x69\144\x3d\42\x69\144\x30\61\x22\40\143\x6c\x61\163\163\x3d\x22\167\x33\x2d\x74\141\142\x6c\x65\55\x61\x6c\x6c\40\167\63\55\150\x6f\x76\145\x72\x61\142\154\x65\x20\x77\x33\x2d\x6c\145\x66\x74\55\x61\154\x69\x67\x6e\x20\x77\63\55\164\x69\156\x79\x22\76\74\164\x72\40\x63\x6c\141\163\x73\x3d\x22\167\63\x2d\x66\x6f\x6e\144\x6f\144\162\x6f\x69\x64\42\76\74\x74\x68\76\x43\x6c\151\x65\156\x74\x65\x3c\x2f\164\150\x3e\x3c\164\150\76\x43\x6f\144\x69\147\x6f\x3c\x2f\x74\x68\x3e\74\x74\x68\x3e\x50\162\x65\x6d\x69\x6f\74\57\164\150\76\x3c\164\x68\76\105\155\151\x74\151\x64\x6f\x3c\57\x74\x68\76\x3c\x74\150\76\122\145\143\x65\x70\143\151\303\263\x6e\x3c\x2f\x74\x68\76\74\164\x68\76\x3c\x2f\164\x68\x3e\74\x74\x68\76\74\x2f\164\150\x3e\74\57\164\x72\x3e\12\x20\40\40\40\74\x74\x64\x3e" . $cli . "\x3c\57\164\x64\x3e\x3c\x74\x64\76\74\x2f\x74\144\x3e\74\x74\x64\x3e\x3c\x69\x6e\x70\165\164\x20\164\171\160\x65\x3d\x22\x74\145\170\x74\42\40\x63\154\141\163\163\75\x22\x77\x33\x2d\x69\x6e\x70\x75\x74\x22\x20\x69\x64\x3d\42\x70\162\145\155\x69\x6f\x22\40\x70\x6c\x61\143\x65\x68\157\154\144\145\x72\75\42\x64\145\x73\x63\162\x69\160\40\x70\x72\145\x6d\x69\x6f\x22\x3e\74\57\164\x64\x3e\x3c\164\x64\x3e\74\x2f\164\x64\x3e\x3c\x74\144\76\x3c\x2f\164\x64\76\xa\40\x20\x20\x20\74\164\x64\40\143\x6c\x61\x73\163\x3d\x22\x77\63\x2d\142\164\156\x22\76\74\141\40\x6f\156\x63\154\151\143\153\x3d\x22\162\x65\x67\143\x6f\144\x67\141\x6e\141\50\x29\x3b\x22\x3e\74\151\155\147\40\163\162\143\75\42" . base_url() . "\151\x6d\141\147\145\163\57\162\x65\x67\x69\163\x74\162\141\x72\56\160\x6e\147\42\40\x61\154\x74\x3d\x22\x52\x65\147\151\163\164\162\x61\162\40\111\164\x65\155\42\x20\x74\151\164\154\x65\x3d\42\122\145\147\151\163\x74\x72\x61\x72\x20\x49\x74\145\x6d\x22\x20\x73\164\x79\x6c\145\x3d\42\167\151\x64\164\x68\x3a\x32\60\160\x78\73\150\145\x69\147\x68\x74\x3a\x32\x30\x70\x78\73\142\x6f\x72\x64\x65\162\72\60\73\x22\x3e\x3c\x2f\141\76\x3c\x2f\164\144\76\12\x20\x20\x20\x20\74\164\144\40\143\x6c\x61\163\163\75\42\167\x33\x2d\143\145\156\164\x65\162\40\167\63\55\x62\x74\156\x22\x3e\74\x61\x20\x6f\156\x63\x6c\x69\143\153\75\42\x73\150\157\167\x63\x6f\x64\x67\x61\156\141\x28\x29\73\42\76\x3c\151\x6d\147\40\x73\x72\x63\x3d\x22" . base_url() . "\151\155\x61\x67\x65\x73\57\x69\155\160\x2e\x70\x6e\147\42\x20\x61\x6c\x74\x3d\42\111\x6d\160\162\151\155\151\x72\40\x50\x72\145\155\x69\x6f\x22\40\x74\x69\x74\x6c\145\x3d\x22\111\155\x70\x72\x69\x6d\x69\x72\x20\117\x72\144\x65\156\42\40\x73\x74\171\x6c\x65\75\x22\x77\x69\x64\164\x68\x3a\62\60\160\170\73\150\x65\x69\x67\150\164\x3a\62\60\160\170\x3b\x62\157\x72\x64\145\x72\x3a\60\x3b\x22\x3e\74\x2f\x61\x3e\x3c\57\x74\x64\76\xa\x20\40\x20\x20\x3c\x74\144\x20\143\x6c\x61\163\x73\75\x22\167\63\55\142\164\x6e\x22\76\x3c\x61\x20\157\x6e\x63\154\x69\x63\x6b\75\x22\143\x6f\144\x67\141\x6e\x61\143\x6c\151\x28\x29\73\42\76\74\151\155\x67\40\163\x72\x63\x3d\42" . base_url() . "\x69\155\x61\x67\145\163\57\x72\x65\x6c\x6f\141\144\x2e\160\x6e\x67\x22\x20\141\x6c\164\75\x22\101\143\164\165\x61\x6c\151\172\x61\x72\x20\115\x6f\x64\165\154\x6f\x22\40\x74\151\164\154\x65\75\42\x41\143\164\x75\x61\154\x69\x7a\141\x72\40\111\164\145\155\x22\x20\x73\x74\171\x6c\x65\75\x22\x77\x69\144\164\x68\72\x32\60\x70\170\73\150\x65\x69\x67\150\x74\72\x32\x30\160\x78\73\142\x6f\x72\x64\x65\162\x3a\60\x3b\x22\x3e\x3c\x2f\x61\x3e\74\57\164\144\76\74\x2f\x74\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->frecep != null) { $color = "\167\x33\x2d\147\162\x65\x65\156"; } else { $color = "\x77\x33\x2d\162\x65\x64"; } $html .= "\74\x74\x72\40\x69\x64\x3d\x22\163\x6c\145\x63\164" . $i . "\x22\76"; $html .= "\xa\x20\x20\40\x20\40\40\x20\40\74\151\156\x70\x75\x74\x20\164\171\160\x65\75\42\150\x69\x64\x64\x65\156\x22\40\x6e\141\155\145\x3d\42\143\x6c\x69\145\156\164\145\42\x20\166\x61\x6c\x75\145\75\x22" . $dtfac->cliente . "\x22\76\74\x69\156\x70\x75\x74\x20\x74\x79\160\145\x3d\42\150\151\x64\144\x65\156\x22\x20\x6e\x61\x6d\x65\x3d\x22\143\157\x64\147\x61\x6e\141\x22\40\166\141\x6c\x75\145\x3d\42" . $dtfac->codgana . "\42\x3e\xa\40\x20\40\40\40\x20\x20\x20\x3c\164\x64\x3e\x3c\x69\x6e\160\165\x74\40\164\x79\x70\x65\75\x22\x63\150\145\x63\x6b\x62\157\x78\x22\40\157\x6e\143\x6c\x69\143\153\75\x22\x77\x33\x2e\164\x6f\147\x67\154\145\103\x6c\x61\x73\163\x28\47\43\163\154\x65\x63\164" . $i . "\47\54\47\x77\x33\55\171\x65\x6c\x6c\x6f\x77\47\x29\x3b\42\x20\x63\x6c\x61\163\x73\x3d\42\x77\63\x2d\143\150\x65\x63\153\x22\x20\x6e\x61\155\x65\x3d\42\x63\x68\x65\143\153\42\x3e" . $dtfac->cliente . "\74\x2f\x74\x64\x3e\74\164\144\76" . $dtfac->codgana . "\x3c\57\164\144\x3e\74\164\x64\x3e" . $dtfac->premio . "\74\57\164\x64\x3e\x3c\x74\144\x3e" . $dtfac->femi . "\x3c\x2f\164\144\x3e\74\164\144\x20\x63\x6c\x61\163\163\75\x22" . $color . "\x22\76" . $dtfac->frecep . "\x3c\57\164\x64\76\x3c\164\144\76\74\x2f\x74\x64\x3e\xa\x20\x20\x20\40\x20\40\x20\40\x3c\x2f\x74\x72\x3e"; } $html .= "\74\x2f\164\x61\142\x6c\x65\x3e"; return $html; } function regcodgana($cli, $prem) { $cod = $this->genecod("\70"); $this->db->insert("\x63\157\x64\147\x61\x6e\141", array("\x63\154\151\145\x6e\164\x65" => $cli, "\x63\x6f\144\x67\x61\x6e\x61" => $cod, "\x70\162\145\155\x69\x6f" => $prem, "\146\x65\x6d\x69" => date("\x59\55\155\55\x64"))); return $this->db->affected_rows(); } function val_codgana($cod) { $db = $this->db->query("\x53\x45\x4c\x45\x43\x54\40\x70\162\x65\x6d\151\157\x20\106\x52\x4f\x4d\40\x63\x6f\x64\147\x61\x6e\141\40\x57\x48\105\122\105\40\x63\x6f\x64\147\x61\156\x61\75\x27{$cod}\47"); $row = $db->num_rows(); if ($row > 0) { $db = $db->row(); $this->db->query("\125\120\x44\101\124\x45\x20\143\x6f\144\147\141\156\141\x20\x53\x45\124\x20\146\162\x65\x63\145\x70\75\x63\165\162\144\x61\164\x65\x28\51\x20\x57\x48\105\x52\105\x20\143\x6f\x64\x67\x61\156\x61\x3d\47{$cod}\47"); $prem = $db->premio; } return json_encode(array("\x72\x6f\167" => $row, "\x70\x72\145\x6d\x69\157" => $prem)); } function regmonecam($a, $b, $c) { $data = array("\x6d\x6f\156\x65\157\162\147" => "\126\x45", "\x6d\157\156\145\144\x61" => "\125\x53\x44", "\146\145\x63\x68\x61" => $a, "\157\146\x69\x63\x69\x61\154" => $b, "\162\x65\146\x65\x72\x65\x6e\x63\x69\x61" => $c); $this->db->insert("\155\157\156\145\x63\x61\155", $data); if ($this->db->affected_rows() > 0) { $this->cambiodolar(); $this->loguser("\x54\x61\163\x61\40\104\157\154\141\162", "\x45\x6c\x20\165\163\x75\141\x72\151\x6f\x20\x72\x65\x67\x69\x73\164\x72\141\x20\117\x66\151\x63\151\x61\x6c\x20" . $b . "\x2c\40\122\145\x66\x65\x72\x65\x6e\143\151\141\40" . $c . "\56"); return 1; } } function elimtasa($id) { $bd = $this->db->query("\x53\105\114\105\103\124\x20\x2a\x20\106\x52\x4f\115\x20\155\157\x6e\145\x63\141\155\40\x57\110\105\122\145\40\151\x64\x3d\x27{$id}\47")->row(); $this->db->query("\x44\105\x4c\x45\124\x45\40\106\x52\117\x4d\40\155\x6f\156\145\x63\x61\x6d\x20\127\x48\105\x52\x45\40\151\144\x3d\x27{$id}\x27"); $this->loguser("\x45\154\x69\x6d\151\156\141\x72", "\x45\x6c\x20\x75\x73\x75\141\x72\x69\x6f\x20\145\154\151\155\x69\156\141\x20\x6c\x61\40\164\x61\x73\x61\x20\117\146\x69\143\151\x61\154\x20" . $bd->oficial . "\x2c\40\x52\x65\x66\145\x72\145\x6e\x63\x69\x61\x20" . $bd->referenca . "\40\160\x61\x72\141\40\145\x6c\x20" . $bd->fecha . "\56"); return $this->db->affected_rows(); } function cambiodolar() { $this->respaldoprec(); $bd = $this->db->query("\x53\x45\114\105\x43\x54\40\x61\56\x63\x6f\x64\151\147\157\54\x61\56\143\x6f\x73\x74\157\54\141\x2e\x70\162\x65\x63\151\x6f\61\x2c\141\x2e\x65\170\x69\163\x74\x65\156\143\x69\x61\54\141\56\x70\162\145\x63\151\x6f\146\151\156\61\54\141\x2e\151\155\x70\x75\145\x73\164\157\x31\x2c\x63\x2e\x6d\x67\x61\156\x61\x6e\54\40\x63\56\x6d\x6f\x6e\x65\x64\x61\xa\x20\x20\40\40\x46\122\117\x4d\x20\141\162\x74\x69\143\165\154\157\x20\141\xa\x20\x20\40\40\112\117\x49\x4e\x20\x61\162\x74\151\160\162\157\166\x20\142\40\117\x4e\x20\x61\56\143\x6f\x64\x69\147\x6f\x3d\142\56\x63\x6f\x64\x69\x67\x6f\xa\40\x20\x20\x20\x4a\117\111\116\x20\x70\x72\157\x76\x65\145\144\x20\x63\40\117\116\x20\x62\x2e\160\x72\157\x76\x65\145\144\157\162\75\x63\x2e\x63\x6f\x64\x69\147\157\xa\40\40\x20\40\127\110\x45\x52\x45\40\x61\56\x65\x78\151\163\x74\x65\x6e\x63\x69\141\x3e\x30\x20\x47\122\x4f\125\x50\x20\102\131\x20\x61\56\x63\157\x64\x69\x67\157")->result(); $i = 0; foreach ($bd as $db) { $tasa = $this->db->query("\123\105\x4c\105\x43\124\40\x72\x65\146\145\162\x65\x6e\x63\151\x61\40\106\x52\117\x4d\40\x6d\x6f\x6e\145\143\141\155\x20\x57\x48\105\x52\105\x20\x66\x65\x63\x68\141\x20\x69\x6e\x20\50\x53\105\x4c\105\103\x54\x20\x4d\x41\x58\50\146\x65\143\x68\141\x29\x20\106\122\x4f\115\x20\x6d\x6f\x6e\x65\143\x61\x6d\x29")->row(); if ($db->moneda == "\x56\105") { $moneda = $db->costo; } else { $moneda = $db->costo * $tasa->referencia; } $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($db->mganan / 100 + 1); $preciofin1 = $precio1 * $iva; $this->db->query("\x55\120\x44\x41\124\x45\40\x61\162\x74\x69\x63\165\154\x6f\40\x53\105\x54\40\x70\162\x65\143\x69\x6f\61\x3d\47{$precio1}\47\x2c\x70\162\145\143\151\x6f\146\x69\156\61\75\x27{$preciofin1}\47\40\127\110\x45\x52\x45\x20\x63\x6f\x64\x69\x67\157\x3d\x27{$db->codigo}\47"); if ($this->db->affected_rows()) { $i++; } } return $i; } function truncateartilist() { $this->db->query("\124\122\x55\116\103\x41\x54\x45\x20\x61\162\164\151\154\x69\x73\164\73"); } function excellistcost($a, $b, $c, $d, $e, $f, $promo, $descu2) { $this->db->query("\x55\120\104\x41\x54\105\40\x61\162\x74\151\x63\165\x6c\x6f\x20\123\x45\124\40\144\x73\143\x74\157\137\x6d\145\144\151\x63\141\x6d\145\156\164\x6f\163\x3d\x27{$d}\x27\x2c\x64\x73\143\164\x6f\137\155\145\144\151\143\141\155\145\156\x74\157\163\x32\75\x27{$descu2}\47\x2c\x20\x69\155\x70\x75\145\x73\x74\x6f\x31\x3d\x27{$c}\x27\x2c\x64\151\x61\163\151\x6e\x64\x65\170\x3d\x27{$e}\x27\54\x64\x69\141\x73\143\162\145\x64\75\47{$f}\x27\x20\x57\110\105\x52\105\40\x63\x6f\144\151\147\157\75\x27{$a}\47"); $this->db->query("\125\120\104\x41\x54\x45\40\141\162\164\x69\160\162\x6f\x76\40\123\x45\x54\x20\155\x61\162\x63\x61\75\x27{$promo}\x27\40\127\x48\x45\x52\x45\40\143\157\144\151\147\157\75\x27{$a}\47"); if ($a != null && $a != '') { $db = $this->db->query("\123\105\114\105\x43\x54\40\141\56\x63\157\144\x69\147\157\54\141\56\x63\157\x73\x74\157\x2c\141\x2e\x70\162\x65\x63\x69\157\61\x2c\x61\56\x65\170\151\163\164\x65\x6e\143\151\x61\54\x61\x2e\160\162\x65\x63\x69\157\146\151\156\x31\54\141\56\x69\x6d\160\165\145\x73\x74\x6f\x31\x2c\x63\x2e\x6d\147\x61\x6e\141\x6e\x2c\40\x63\x2e\155\x6f\x6e\x65\144\141\xa\40\40\x20\40\106\x52\x4f\x4d\x20\141\162\164\151\143\165\154\x6f\40\141\12\40\x20\x20\40\114\105\x46\124\x20\x4a\117\x49\116\40\x61\x72\x74\x69\x70\162\x6f\166\40\142\x20\117\116\40\141\56\x63\x6f\x64\x69\147\157\x3d\142\x2e\x63\x6f\x64\151\147\157\12\x20\x20\40\x20\114\105\106\124\40\x4a\x4f\111\x4e\40\x70\162\157\x76\145\145\x64\40\x63\40\117\x4e\40\142\x2e\x70\x72\x6f\x76\145\x65\x64\157\x72\x3d\x63\56\x63\157\144\151\x67\x6f\xa\x20\x20\x20\x20\127\110\105\122\x45\x20\x61\56\143\x6f\144\x69\x67\157\x3d\47{$a}\47\73")->row(); $tasa = $this->db->query("\x53\x45\x4c\x45\x43\124\x20\162\145\146\x65\162\145\x6e\143\x69\x61\x20\106\x52\117\x4d\40\155\x6f\x6e\x65\x63\141\155\40\x4f\x52\104\x45\122\40\x42\x59\x20\x66\145\143\150\141\40\x44\105\123\x43\40\x4c\111\x4d\111\x54\40\61")->row(); if ($db->moneda == "\126\105") { $moneda = $b; } else { $moneda = $b * $tasa->referencia; } $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($db->mganan / 100 + 1); $preciofin1 = $precio1 * $iva; $art = array("\x63\x6f\x64\151\147\x6f" => $db->codigo, "\155\157\x6e\x65\x64\x61" => $db->moneda, "\x61\x63\157\163\x74\x6f" => $db->costo, "\144\x63\157\163\164\157" => $b, "\x61\x70\162\145\143\151\x6f\61" => $db->precio1, "\144\x70\162\145\x63\151\x6f\x31" => $precio1, "\x61\160\162\145\x63\151\x6f\x66\x69\156\61" => $db->preciofin1, "\144\x70\x72\145\x63\x69\157\x66\x69\x6e\61" => $preciofin1); $this->db->insert("\141\162\x74\x69\154\151\x73\164", $art); return $this->db->affected_rows(); } } function excellistcost2($a, $nom, $b, $c, $d, $descu, $descu2) { if ($a != null && $a != '') { $db = $this->db->query("\x53\x45\x4c\105\103\x54\x20\x61\x2e\x63\x6f\144\151\147\157\54\141\56\x63\157\x73\164\157\54\122\x4f\125\x4e\x44\50\x61\56\160\162\x65\143\x69\x6f\61\x2c\x32\x29\40\x70\162\x65\143\x69\x6f\61\x2c\x61\x2e\145\170\x69\x73\164\x65\x6e\143\x69\141\54\141\56\x70\162\145\x63\x69\157\146\x69\156\61\54\x61\56\x69\155\x70\x75\145\163\x74\157\x31\54\x52\x4f\125\116\104\x28\141\56\x75\x74\151\154\61\x2c\62\x29\x20\x6d\x67\141\156\141\156\x2c\40\x63\56\x6d\x6f\x6e\145\144\141\xa\40\x20\40\40\x46\x52\117\x4d\40\x61\x72\x74\x69\x63\165\x6c\157\x20\141\12\40\x20\40\x20\x4c\105\106\124\40\x4a\117\111\116\40\141\x72\x74\151\x70\162\x6f\x76\x20\142\x20\x4f\x4e\x20\141\56\143\157\144\x69\x67\157\x3d\142\56\x63\157\x64\x69\147\157\12\40\40\40\40\114\x45\106\x54\40\112\117\111\x4e\x20\x70\x72\157\166\x65\x65\x64\x20\143\x20\117\116\x20\142\x2e\160\162\x6f\x76\145\x65\144\157\x72\75\143\x2e\143\157\x64\151\x67\x6f\12\x20\40\40\40\x57\110\105\122\105\40\x61\x2e\x63\157\144\x69\147\x6f\x3d\x27{$a}\47\73")->row(); if ($db->codigo != '') { $this->db->query("\x55\120\104\x41\x54\x45\40\x61\162\x74\x69\143\165\x6c\157\x20\x73\x65\164\x20\144\x73\x63\164\x6f\x5f\155\x65\144\x69\143\x61\x6d\x65\156\164\157\x73\x3d\47{$descu}\47\54\144\x73\x63\x74\x6f\x5f\x6d\145\144\151\x63\x61\155\x65\156\x74\157\163\x32\75\47{$descu2}\47\40\x57\x48\x45\x52\105\40\143\157\x64\151\147\157\75\47{$a}\x27"); if ($b > 0) { if ($db->mganan != $d) { $mganan = $d; $this->db->query("\x55\x50\x44\x41\124\x45\40\x61\x72\x74\151\143\x75\154\x6f\x20\x73\145\164\40\165\x74\151\x6c\61\75\x27{$d}\47\40\x57\x48\x45\x52\105\40\143\x6f\144\x69\147\157\75\x27{$a}\x27"); } else { $mganan = $db->mganan; } if ($c > 0) { $mganan = $c * 100 / $b - 100; $this->db->query("\125\x50\104\101\124\105\x20\141\x72\x74\x69\x63\x75\154\x6f\40\x73\145\x74\40\x75\164\151\154\61\x3d\47{$mganan}\x27\40\127\x48\105\122\x45\40\143\157\x64\x69\x67\157\75\47{$a}\47"); } $tasa = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\157\x66\x69\x63\151\x61\x6c\40\106\122\x4f\x4d\x20\x6d\x6f\x6e\145\143\x61\x6d\40\x4f\x52\104\105\122\x20\102\131\x20\146\x65\x63\x68\141\x20\x44\x45\123\x43\40\x4c\111\115\111\124\40\61")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($mganan / 100 + 1); $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "\x56\105"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("\x63\157\x64\151\x67\x6f" => $db->codigo, "\x6d\x6f\x6e\145\144\141" => $tipom, "\141\x63\x6f\163\x74\x6f" => $db->costo, "\x64\143\x6f\163\x74\157" => $moneda, "\x61\x70\162\x65\143\151\x6f\61" => $db->precio1, "\144\x70\x72\x65\x63\151\157\61" => $precio1, "\141\x70\x72\145\x63\x69\x6f\146\151\156\x31" => $db->preciofin1, "\x64\x70\162\x65\143\151\x6f\146\151\x6e\61" => $preciofin1, "\x61\x75\x74\151\154\61" => $db->mganan, "\x75\164\151\154\61" => $mganan); $this->db->insert("\x61\162\164\x69\x6c\151\x73\164", $art); } else { if ($c > 0) { $mganan = $c * 100 / $db->costo - 100; $this->db->query("\125\x50\104\x41\124\x45\x20\x61\162\x74\151\x63\x75\154\157\40\x73\145\x74\x20\x75\x74\151\154\x31\x3d\47{$mganan}\47\x20\x57\110\105\x52\105\x20\143\x6f\x64\151\147\157\x3d\47{$a}\x27"); } $tasa = $this->db->query("\x53\x45\114\105\103\124\40\157\x66\151\x63\151\x61\154\x20\x46\x52\x4f\x4d\40\155\x6f\156\x65\x63\141\x6d\x20\x4f\x52\104\x45\x52\40\102\x59\40\x66\145\143\x68\141\x20\104\x45\x53\x43\40\x4c\x49\x4d\111\x54\x20\61")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $c; $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "\x56\105"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("\x63\x6f\x64\151\x67\157" => $db->codigo, "\155\x6f\156\x65\x64\141" => $tipom, "\x61\x63\x6f\163\x74\157" => $db->costo, "\144\x63\x6f\163\x74\157" => $db->costo, "\x61\x70\162\x65\x63\151\x6f\61" => $db->precio1, "\144\160\162\145\x63\151\x6f\61" => $precio1, "\x61\160\162\x65\143\151\157\x66\x69\156\61" => $db->preciofin1, "\144\160\162\145\143\151\157\x66\151\156\61" => $preciofin1, "\141\165\x74\x69\154\61" => $db->mganan, "\x75\164\151\x6c\x31" => $mganan); $this->db->insert("\x61\162\164\x69\154\151\x73\x74", $art); } } else { $db = $this->db->query("\x53\x45\114\105\103\x54\x20\141\56\143\x6f\144\x69\147\157\54\x61\56\143\157\163\x74\x6f\54\x52\117\125\x4e\x44\x28\141\x2e\x70\x72\x65\x63\151\x6f\x31\x2c\x32\x29\40\x70\162\145\x63\151\x6f\x31\x2c\141\x2e\x65\170\151\163\x74\x65\156\143\151\x61\54\141\x2e\x70\x72\x65\143\x69\157\x66\x69\x6e\61\x2c\141\x2e\x69\155\160\x75\145\163\164\157\61\54\x52\117\x55\x4e\104\x28\x61\x2e\165\x74\151\x6c\x31\54\x32\51\x20\x6d\147\x61\156\141\x6e\x2c\x20\143\x2e\x6d\157\156\145\x64\141\xa\x20\x20\40\x20\106\x52\117\115\40\x61\x72\164\151\143\x75\154\x6f\40\x61\12\x20\40\x20\40\114\x45\x46\x54\x20\x4a\x4f\111\116\40\x61\162\164\x69\x70\x72\x6f\166\40\142\x20\x4f\116\40\x61\x2e\143\157\x64\x69\147\157\75\142\x2e\x63\x6f\x64\151\147\157\12\40\40\x20\x20\114\105\106\x54\40\x4a\x4f\x49\x4e\40\x70\162\157\x76\x65\145\x64\x20\143\x20\x4f\116\40\142\56\x70\x72\157\x76\x65\x65\144\x6f\162\x3d\143\56\143\x6f\144\151\147\157\12\x20\40\40\40\127\x48\x45\122\x45\40\x61\56\156\x6f\x6d\x62\162\x65\x3d\47{$nom}\47\x3b")->row(); if ($db->codigo != '') { $this->db->query("\125\x50\x44\x41\x54\105\x20\141\x72\164\151\143\165\x6c\x6f\40\163\x65\x74\x20\x64\x73\143\x74\157\x5f\155\145\144\151\143\x61\155\145\x6e\164\x6f\x73\x3d\47{$descu}\x27\x2c\x64\163\x63\164\x6f\137\x6d\145\144\x69\x63\x61\155\x65\x6e\x74\157\x73\62\75\47{$descu2}\47\40\x57\110\105\x52\105\40\x63\157\x64\x69\147\x6f\x3d\x27{$db->codigo}\x27"); if ($b > 0) { if ($db->mganan != $d) { $mganan = $d; $this->db->query("\125\120\104\x41\124\105\40\x61\x72\164\x69\x63\165\154\157\40\x73\145\x74\x20\165\x74\x69\154\61\75\47{$d}\x27\40\127\x48\105\x52\x45\40\x63\x6f\144\x69\147\157\75\47{$db->codigo}\47"); } else { $mganan = $db->mganan; } if ($c > 0) { $mganan = $c * 100 / $b - 100; $this->db->query("\125\x50\104\x41\124\x45\40\x61\x72\164\x69\x63\165\154\157\40\163\x65\x74\40\165\164\x69\x6c\61\x3d\x27{$mganan}\x27\x20\127\110\105\122\105\40\x63\157\144\151\x67\157\x3d\x27{$db->codigo}\x27"); } $tasa = $this->db->query("\x53\105\x4c\105\103\124\x20\x6f\x66\151\143\x69\x61\x6c\40\x46\x52\117\115\40\x6d\x6f\x6e\x65\x63\141\x6d\40\x4f\122\x44\105\122\x20\102\131\x20\146\145\x63\150\x61\x20\104\x45\123\103\40\114\111\115\111\124\x20\61")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $moneda * ($mganan / 100 + 1); $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "\126\x45"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("\143\157\x64\151\x67\157" => $db->codigo, "\x6d\x6f\156\145\144\141" => $tipom, "\141\x63\x6f\163\164\157" => $db->costo, "\144\143\x6f\x73\164\157" => $moneda, "\x61\160\x72\x65\143\x69\157\61" => $db->precio1, "\144\x70\162\145\143\151\x6f\61" => $precio1, "\141\160\x72\x65\143\x69\157\146\x69\x6e\61" => $db->preciofin1, "\144\160\x72\x65\143\151\157\x66\x69\x6e\x31" => $preciofin1, "\x61\165\x74\x69\154\x31" => $db->mganan, "\x75\x74\x69\x6c\x31" => $mganan); $this->db->insert("\141\x72\x74\x69\x6c\151\x73\x74", $art); } else { if ($c > 0) { $mganan = $c * 100 / $db->costo - 100; $this->db->query("\125\120\x44\101\x54\105\x20\141\162\164\151\143\x75\x6c\x6f\40\163\145\x74\40\x75\x74\x69\154\x31\x3d\47{$mganan}\x27\40\x57\x48\x45\122\x45\40\143\x6f\144\x69\x67\157\x3d\47{$db->codigo}\x27"); } $tasa = $this->db->query("\x53\x45\x4c\105\x43\x54\x20\x6f\146\151\x63\x69\141\x6c\40\x46\122\117\115\40\155\157\x6e\x65\143\x61\155\x20\117\x52\104\105\x52\x20\102\131\x20\x66\145\143\150\141\x20\104\105\x53\x43\x20\x4c\x49\115\111\124\x20\x31")->row(); $moneda = $b; $iva = $db->impuesto1 / 100 + 1; $precio1 = $c; $precio1 = $precio1 * $tasa->oficial; $preciofin1 = $precio1 * $iva; if ($db->moneda == null) { $tipom = "\x56\x45"; } else { $tipom = $db->moneda; } if (is_infinite($mganan)) { $mganan = 0; } $art = array("\143\157\144\151\147\157" => $db->codigo, "\155\x6f\x6e\x65\144\141" => $tipom, "\x61\x63\157\x73\x74\x6f" => $db->costo, "\144\143\x6f\163\164\x6f" => $db->costo, "\141\160\x72\145\x63\x69\157\61" => $db->precio1, "\144\x70\162\x65\x63\151\x6f\61" => $precio1, "\141\x70\162\x65\143\x69\x6f\146\x69\156\x31" => $db->preciofin1, "\144\160\x72\145\143\x69\157\146\x69\x6e\x31" => $preciofin1, "\x61\165\164\151\x6c\61" => $db->mganan, "\x75\x74\151\x6c\61" => $mganan); $this->db->insert("\x61\x72\164\x69\x6c\151\x73\164", $art); } } } return $this->db->affected_rows(); } } function excellistdescucli($a, $b, $tipo, $clase) { if ($a != null && $a != '') { $this->db->where("\143\x6f\144\x69\x67\157", $a)->update("\x63\x6c\x69\x65\155\x70\x72\x65", array("\x64\145\x73\143\x75\x65\x6e\164\x6f" => $b, "\x74\151\x70\157" => $tipo, "\163\165\x62\x64\x69\x76\x69\x73\151\157\156" => $clase)); return $this->db->affected_rows(); } } function ajustelistinv() { $this->corteconsig(); $this->respaldoprec(); $bd = $this->db->query("\x53\105\114\x45\x43\x54\x20\x61\x2e\143\x6f\x64\151\x67\157\x2c\141\x2e\141\x63\x6f\x73\164\157\54\x61\x2e\x64\143\x6f\x73\x74\x6f\54\x61\56\x61\x70\x72\145\143\151\x6f\61\x2c\141\x2e\x64\x70\x72\145\143\x69\157\61\x2c\x61\x2e\x61\x70\x72\x65\x63\x69\157\146\151\156\61\x2c\141\56\144\160\x72\x65\x63\151\157\x66\151\x6e\61\x2c\143\56\155\157\x6e\x65\144\x61\54\x63\x2e\x6e\x6f\155\x62\x72\145\x2c\143\56\155\147\141\x6e\x61\156\40\x46\x52\117\115\x20\141\162\x74\151\154\151\163\164\40\141\40\112\117\x49\x4e\x20\x61\162\164\151\x70\x72\157\x76\40\x62\40\117\x4e\x20\141\56\x63\x6f\144\x69\x67\x6f\75\142\56\x63\x6f\144\x69\147\x6f\xa\x20\40\x20\x20\40\x20\40\x20\112\x4f\111\x4e\40\160\x72\x6f\166\x65\x65\x64\x20\x63\x20\157\156\40\143\56\x63\157\x64\151\147\x6f\75\x62\x2e\160\162\157\x76\145\145\x64\x6f\162\40\x47\122\117\x55\x50\x20\102\x59\40\141\56\143\x6f\x64\x69\147\157")->result(); $i = 0; $tasa = $this->db->query("\123\x45\114\105\103\124\40\x72\x65\146\145\162\x65\156\143\151\x61\40\106\x52\117\115\40\x6d\x6f\156\145\x63\x61\x6d\x20\x4f\x52\x44\x45\122\40\x42\x59\40\146\x65\143\x68\x61\x20\104\x45\123\103\x20\x4c\x49\115\x49\x54\40\61")->row(); foreach ($bd as $db) { $descu = $this->db->query("\x53\x45\114\x45\103\124\x20\x61\56\x64\163\x63\x74\157\x5f\x6d\145\x64\151\x63\141\x6d\145\x6e\x74\157\163\40\156\x20\106\122\x4f\115\x20\x61\162\164\151\x63\x75\154\157\x20\141\x20\x57\110\105\122\105\x20\141\56\x63\157\x64\151\147\x6f\x3d\x27{$db->codigo}\x27")->row(); $valcopy = $this->db->query("\123\105\x4c\x45\x43\x54\x20\116\x55\x4c\114\40\x46\122\x4f\x4d\40\x61\162\x74\151\143\157\163\x74\x6f\x20\127\x48\x45\122\x45\x20\143\x6f\144\151\x67\x6f\75\47{$db->codigo}\x27\40\46\46\40\x66\145\143\x68\141\75\x63\165\162\144\141\x74\x65\50\x29\40\46\x26\x20\x63\x6f\x73\164\157\75\47{$db->acosto}\x27")->num_rows(); if ($valcopy == 0) { $copyart = array("\143\157\144\x69\x67\x6f" => $db->codigo, "\x66\x65\143\x68\141" => date("\131\x2d\155\x2d\x64"), "\x63\x6f\x73\x74\157" => $db->acosto, "\144\145\163\143\x75" => $descu->n, "\155\x6f\156\x65\x64\x61" => $db->moneda, "\x70\162\x65\x63\x69\x6f" => $db->aprecio1, "\x70\162\145\143\151\x6f\146\x69\156" => $db->apreciofin1); $this->db->insert("\141\162\x74\151\x63\x6f\x73\x74\x6f", $copyart); } if ($this->db->affected_rows() > 0) { $this->db->query("\x55\120\104\x41\124\x45\40\141\162\164\x69\x63\x75\154\157\40\x53\105\x54\40\143\157\163\164\x6f\75\47{$db->dcosto}\x27\x2c\160\162\145\x63\x69\157\x31\75\x27{$db->dprecio1}\x27\x2c\x70\x72\x65\143\x69\157\x66\151\x6e\x31\75\x27{$db->dpreciofin1}\47\40\x57\110\x45\x52\x45\x20\x63\x6f\x64\151\x67\x6f\x3d\47{$db->codigo}\47"); if ($this->db->affected_rows()) { $i++; $this->loguser("\101\152\x75\x73\x74\x65\x20\x50\162\145\x63\x69\157\163", "\x45\x6c\x20\165\x73\x75\141\x72\x69\157\40\x61\152\x75\163\164\x61\40\x70\162\145\143\151\x6f\x73\40\x50\162\157\x76\x65\x65\144\157\x72\x20" . $db->nombre . "\x2c\x20\x50\162\157\144\x75\143\164\157\x20" . $db->codigo . "\x2c\40\x43\157\x73\x74\x6f\x20" . $db->dcosto . "\x2c\40\x47\141\156\141\156\x63\151\x61\40" . $db->mganan . "\54\120\162\x65\143\151\x6f\40" . $db->dprecio1 . "\54\40\120\162\x65\143\x69\x6f\x46\x69\x6e\x20" . $db->dpreciofin1 . "\40\x54\x61\163\x61\40" . $tasa->referencia . "\56"); } } } if ($i > 0) { $this->truncateartilist(); } return $i; } function ajustelistinv2() { $this->corteconsig(); $this->respaldoprec(); $bd = $this->db->query("\x53\105\114\105\103\124\x20\x61\x2e\x63\157\144\x69\147\x6f\x2c\141\56\141\143\157\163\x74\157\x2c\141\x2e\144\x63\157\x73\x74\x6f\54\141\56\x61\160\x72\145\x63\151\157\61\54\x61\56\144\160\162\x65\143\151\x6f\x31\x2c\x61\x2e\141\160\162\145\143\151\157\x66\151\x6e\61\54\x61\x2e\144\160\x72\x65\143\151\157\x66\x69\156\x31\x2c\x63\56\x6d\157\x6e\x65\x64\141\x2c\x63\56\x6e\x6f\155\142\162\x65\54\x61\56\165\164\x69\154\x31\x20\x6d\x67\x61\x6e\x61\156\40\106\x52\117\115\40\x61\x72\x74\x69\x6c\x69\163\164\x20\141\40\112\117\x49\x4e\40\141\162\164\x69\160\162\157\166\x20\142\40\x4f\116\x20\x61\56\x63\157\x64\x69\147\x6f\75\142\56\x63\157\144\151\x67\x6f\xa\x20\x20\40\40\x4a\117\x49\x4e\x20\x70\x72\x6f\166\145\x65\144\40\143\40\x6f\156\x20\x63\56\x63\157\x64\151\x67\x6f\x3d\x62\56\x70\x72\157\166\145\145\x64\157\x72\40\x47\122\117\x55\120\40\102\x59\40\141\x2e\x63\x6f\144\x69\147\x6f")->result(); $i = 0; $tasa = $this->db->query("\x53\105\114\x45\103\x54\40\x72\145\146\145\x72\145\x6e\143\x69\141\x20\x46\122\x4f\115\40\x6d\x6f\156\145\143\141\x6d\x20\117\x52\x44\105\122\40\102\x59\x20\x66\x65\143\x68\x61\x20\104\105\x53\x43\x20\114\111\x4d\111\124\x20\61")->row(); foreach ($bd as $db) { $valcopy = $this->db->query("\123\x45\x4c\x45\103\124\40\116\x55\114\x4c\x20\x46\122\117\x4d\x20\x61\162\164\x69\x63\157\x73\x74\157\40\127\x48\105\x52\x45\x20\x63\157\x64\151\x67\157\75\x27{$db->codigo}\x27\x20\46\46\x20\146\145\x63\x68\x61\x3d\x63\165\162\x64\x61\x74\x65\50\51\x20\46\46\40\x63\x6f\163\164\x6f\x3d\x27{$db->acosto}\47")->num_rows(); if ($valcopy == 0) { $copyart = array("\143\x6f\144\x69\147\157" => $db->codigo, "\146\x65\143\150\x61" => date("\131\x2d\x6d\55\x64"), "\x63\x6f\x73\x74\x6f" => $db->acosto, "\x64\145\163\x63\165" => 0, "\155\157\156\145\x64\x61" => $db->moneda, "\160\x72\x65\x63\x69\x6f" => $db->aprecio1, "\x70\162\x65\x63\x69\157\x66\x69\156" => $db->apreciofin1); $this->db->insert("\x61\x72\164\151\143\157\163\164\x6f", $copyart); } if ($this->db->affected_rows() > 0) { $this->db->query("\x55\x50\x44\x41\x54\x45\x20\x61\x72\x74\151\143\x75\154\x6f\x20\x53\105\x54\40\143\x6f\163\x74\157\75\47{$db->dcosto}\47\54\160\x72\x65\143\151\157\x31\75\47{$db->dprecio1}\x27\x2c\160\162\145\143\x69\x6f\146\x69\156\61\75\x27{$db->dpreciofin1}\x27\x2c\165\x74\x69\x6c\61\75\x27{$db->mganan}\x27\40\x57\110\105\122\105\40\x63\157\x64\151\x67\157\75\47{$db->codigo}\x27"); if ($this->db->affected_rows()) { $i++; $this->loguser("\x41\x6a\x75\x73\164\145\40\120\x72\x65\143\151\x6f\163", "\x45\154\40\165\x73\165\141\162\x69\157\40\x61\152\165\x73\164\x61\x20\160\162\x65\x63\x69\x6f\163\40\120\162\157\144\x75\143\164\157\163\x20" . $db->nombre . "\54\x20\120\162\157\144\165\143\164\x6f\40" . $db->codigo . "\54\40\103\x6f\163\x74\157\x20" . $db->dcosto . "\x2c\40\107\141\x6e\x61\x6e\143\151\x61\40" . $db->mganan . "\54\120\162\x65\143\151\157\40" . $db->dprecio1 . "\x2c\x20\x50\162\x65\x63\151\157\106\151\156\40" . $db->dpreciofin1 . "\x20\124\141\x73\141\x20" . $tasa->referencia . "\x2e"); } } } if ($i > 0) { $this->truncateartilist(); } return $i; } function respaldoprec() { $val = $this->db->query("\123\105\114\x45\103\x54\x20\x4e\125\x4c\x4c\x20\x46\x52\117\x4d\40\141\x72\164\151\x70\162\x65\x63\40\x57\110\x45\x52\x45\x20\x66\145\x63\150\141\75\x63\165\x72\144\x61\x74\x65\x28\x29")->num_rows(); if ($val == 0) { $art = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\x63\157\144\x69\x67\x6f\54\40\156\x6f\x6d\x62\162\x65\x2c\147\162\x75\x70\157\x2c\x63\x6f\163\164\157\54\x70\162\x65\143\x69\157\x31\54\40\160\162\145\143\x69\157\146\x69\156\x31\54\151\x6d\x70\165\x65\163\164\157\x31\54\x64\x69\141\163\151\x6e\x64\x65\x78\54\144\x69\141\x73\x63\x72\x65\x64\x20\x46\122\x4f\115\x20\141\x72\164\x69\x63\165\154\x6f\x20\x57\110\x45\122\105\x20\145\x78\x69\x73\x74\x65\156\x63\x69\x61\76\x30")->result(); foreach ($art as $dart) { $tasa = $this->db->query("\123\x45\x4c\x45\x43\x54\40\x6f\x66\151\143\x69\141\x6c\40\x46\x52\117\115\x20\155\x6f\x6e\145\x63\x61\155\x20\x57\x48\105\122\x45\x20\x66\145\x63\x68\141\74\x3d\103\125\122\104\x41\124\105\x28\x29\x20\117\122\x44\105\x52\x20\x42\x59\40\146\145\143\x68\x61\40\x44\x45\x53\103\40\114\x49\115\111\x54\40\x31")->row()->oficial; $costobs = $dart->costo * $tasa; $data = array("\x66\145\143\150\141" => date("\131\55\155\x2d\x64"), "\156\157\x6d\x62\162\x65" => $dart->nombre, "\147\162\165\160\157" => $dart->grupo, "\143\157\163\164\x6f" => $dart->costo, "\143\x6f\144\x69\x67\157" => $dart->codigo, "\x70\x72\145\143\151\x6f\61" => $dart->precio1, "\160\x72\x65\x63\x69\157\146\151\156\61" => $dart->preciofin1, "\151\x6d\160\x75\145\x73\x74\x6f\61" => $dart->impuesto1, "\143\x6f\x73\164\157\x62\x73" => $costobs); $this->db->insert("\141\162\x74\x69\x70\x72\x65\x63", $data); } } } function exportexcelarti($a) { return $this->db->query("\x53\105\x4c\105\x43\124\x20\x74\x72\151\155\50\x61\x2e\143\x6f\144\x69\x67\x6f\51\x20\x63\157\144\151\x67\157\54\141\56\x6e\157\x6d\142\162\145\x2c\x64\x2e\156\x6f\155\x62\x72\x65\x20\x6c\141\x62\x2c\x64\x2e\155\157\x6e\145\144\x61\54\x62\56\141\154\155\141\x63\x65\x6e\x2c\122\x4f\125\116\104\50\x61\x2e\x63\157\x73\x74\x6f\x2c\x32\x29\143\157\163\164\157\x2c\12\40\x20\x20\40\x52\x4f\125\x4e\104\x28\141\56\x69\x6d\160\x75\x65\x73\164\x6f\x31\x2c\60\x29\40\x69\x76\x61\x2c\141\56\x64\163\143\x74\x6f\137\155\145\144\151\x63\141\x6d\145\156\x74\x6f\163\x20\144\x65\x73\143\165\x2c\x61\56\x64\x69\x61\x73\x69\x6e\x64\x65\170\54\x61\x2e\x64\x69\141\x73\143\162\145\144\x2c\x63\x2e\x6d\x61\162\x63\141\x20\x70\x72\157\155\157\x5f\160\162\157\x76\54\x61\x2e\x64\163\143\x74\x6f\137\x6d\x65\x64\x69\143\x61\x6d\145\156\x74\x6f\x73\x32\40\144\x65\x73\143\x75\62\54\x52\x4f\x55\x4e\x44\50\x61\x2e\145\x78\151\x73\x74\145\156\143\151\141\x2c\x30\51\40\x65\x78\x69\163\x74\x65\x6e\xa\x20\x20\40\40\106\122\x4f\x4d\x20\141\162\164\151\x63\x75\x6c\157\40\x61\xa\x20\x20\40\x20\114\x45\x46\x54\40\112\117\x49\116\40\x61\162\x74\x69\154\x6f\164\x65\x73\40\142\x20\x4f\116\40\141\56\x63\x6f\x64\151\x67\x6f\75\142\56\x63\157\144\151\x67\157\x61\162\x74\xa\40\x20\x20\x20\x4a\117\111\116\x20\141\162\164\151\x70\162\x6f\166\40\143\x20\x4f\116\40\x61\x2e\143\x6f\x64\151\x67\157\75\143\x2e\143\x6f\144\x69\x67\x6f\xa\40\x20\x20\x20\x4a\117\x49\x4e\40\160\x72\157\166\x65\x65\144\40\144\40\x4f\116\40\x63\x2e\160\x72\157\x76\145\x65\x64\157\x72\75\x64\x2e\143\157\144\151\147\157\xa\x20\x20\x20\x20\127\110\x45\x52\105\x20\144\56\151\144\x3d\47{$a}\x27\12\40\40\40\40\107\x52\117\x55\x50\40\x42\131\40\x61\56\x63\x6f\144\151\x67\157\x20\x4f\x52\x44\105\x52\40\102\x59\40\141\56\143\157\x64\151\147\x6f\x20\101\123\x43"); } function exportexcelarti2($a) { if ($a == "\124\x6f\x64\x6f") { return $this->db->query("\123\105\x4c\105\x43\124\x20\164\162\151\x6d\50\x61\56\x63\157\x64\x69\x67\x6f\x29\40\x63\157\x64\151\147\x6f\x2c\x61\56\x6e\157\155\142\x72\145\x2c\122\117\125\116\x44\50\141\x2e\143\x6f\163\164\x6f\54\62\51\143\x6f\163\x74\157\x2c\xa\40\40\x20\40\x20\40\x20\x20\122\x4f\x55\x4e\x44\x28\x61\56\160\x72\x65\143\151\157\x31\57\50\123\105\114\x45\x43\124\x20\157\x66\151\143\151\x61\x6c\x20\106\122\117\115\40\155\x6f\156\x65\143\x61\x6d\x20\117\122\104\105\122\x20\x42\131\40\x66\x65\x63\x68\141\x20\144\145\163\143\x20\114\111\115\111\124\x20\61\51\x2c\62\51\x20\160\x72\x65\x63\151\x6f\x2c\x52\117\125\116\x44\x28\x61\x2e\x75\x74\x69\154\61\x2c\62\x29\x20\x75\x74\151\154\151\x64\x61\x64\x2c\x64\x73\x63\x74\157\x5f\x6d\x65\x64\151\143\x61\x6d\145\x6e\x74\157\x73\40\144\145\x73\x63\x75\x2c\x64\163\x63\x74\x6f\x5f\155\x65\x64\151\x63\141\155\x65\156\164\157\x73\62\40\x64\x65\163\143\165\x32\54\40\x52\x4f\x55\116\x44\x28\141\56\145\170\151\163\164\x65\156\143\151\x61\51\40\145\x78\151\163\x74\x65\156\12\x20\x20\x20\x20\x20\40\40\40\x46\122\117\115\x20\141\162\x74\151\x63\x75\154\x6f\x20\x61\x20\167\x68\145\162\x65\40\141\x2e\x65\x78\151\x73\x74\145\156\143\151\x61\x3e\x30\73"); } else { return $this->db->query("\x53\105\114\x45\103\124\x20\x74\162\151\x6d\x28\141\x2e\143\157\x64\x69\x67\157\51\40\143\x6f\x64\151\x67\x6f\x2c\x61\56\156\x6f\155\142\162\145\54\x52\x4f\x55\x4e\104\50\141\x2e\143\157\163\164\x6f\x2c\62\51\143\157\x73\x74\157\x2c\12\x20\x20\x20\40\122\117\125\116\104\x28\141\56\x70\x72\x65\x63\x69\x6f\x31\57\x28\123\105\x4c\105\103\x54\40\x6f\x66\x69\143\x69\x61\x6c\40\106\122\x4f\x4d\x20\x6d\x6f\x6e\x65\x63\x61\155\40\x4f\x52\104\x45\122\x20\102\x59\40\146\145\143\x68\141\x20\x64\145\x73\x63\40\114\x49\x4d\x49\x54\40\x31\x29\x2c\62\x29\40\160\x72\145\x63\x69\x6f\x2c\122\x4f\125\116\x44\x28\141\x2e\x75\x74\x69\x6c\x31\54\62\51\x20\x75\x74\x69\154\151\144\x61\144\54\x64\x73\143\164\157\x5f\x6d\145\x64\x69\x63\x61\x6d\x65\156\x74\x6f\x73\40\144\x65\163\x63\165\54\144\x73\x63\x74\x6f\137\x6d\x65\144\151\x63\141\155\x65\x6e\x74\x6f\163\x32\x20\144\145\163\143\165\x32\x2c\x20\x52\x4f\125\116\104\50\141\x2e\145\x78\151\163\164\x65\156\x63\x69\x61\51\x20\145\170\x69\x73\x74\145\156\xa\40\40\40\x20\x46\122\117\115\40\x61\x72\x74\x69\x63\x75\154\x6f\40\x61\x20\167\150\x65\x72\145\40\x61\56\147\162\165\160\157\75\47{$a}\x27\40\46\x26\40\141\x2e\145\170\x69\163\x74\x65\156\143\151\x61\x3e\60\x3b"); } } function tipoartilist() { $bd = $this->db->query("\x53\105\x4c\x45\x43\x54\40\x63\157\144\151\147\157\54\x6e\x6f\155\142\x72\145\x20\x46\x52\117\x4d\x20\x67\162\165\x70\x6f\x73\x3b")->result(); $html = ''; foreach ($bd as $db) { $html .= "\74\157\x70\164\x69\157\x6e\40\x76\x61\x6c\x75\145\75\42" . $db->codigo . "\x22\76" . $db->nombre . "\74\57\157\x70\x74\x69\157\156\76"; } return $html; } function corteconsig() { $bd = $this->db->query("\123\x45\x4c\105\x43\x54\40\141\x2e\x70\x72\x6f\x76\x65\145\x64\157\162\40\106\122\117\115\40\x61\162\164\x69\160\162\x6f\166\x20\141\40\112\117\111\x4e\x20\141\162\x74\151\x6c\x69\163\x74\x20\142\40\157\x6e\x20\x61\56\x63\x6f\x64\151\x67\157\75\x62\56\143\x6f\x64\151\147\157\x20\x47\122\x4f\125\120\40\x42\x59\40\x61\x2e\x70\162\157\166\145\x65\144\x6f\x72")->result(); foreach ($bd as $db) { $bd2 = $this->db->query("\123\x45\114\x45\x43\124\40\x61\56\151\144\x2c\x61\x2e\x66\162\145\143\x65\160\54\xa\40\x20\x20\x20\x20\40\40\x20\50\x53\105\114\x45\103\124\40\x49\x46\x28\123\x55\115\x28\143\141\x6e\164\x29\x3e\x30\54\123\125\x4d\50\x63\x61\x6e\x74\x29\54\60\x29\x20\x46\x52\x4f\x4d\x20\x69\164\x6f\162\x64\143\40\127\x48\105\122\x45\x20\157\x72\x64\143\x3d\141\56\151\x64\51\40\x63\x61\x6e\164\54\12\x20\40\x20\40\x20\40\40\x20\x28\123\x45\x4c\105\x43\x54\x20\x49\106\x28\123\125\115\x28\x63\x6f\x6e\163\165\x6d\151\144\x6f\51\x3e\x30\x2c\123\125\115\x28\143\x6f\156\x73\x75\155\x69\x64\157\51\x2c\x30\x29\x20\106\x52\x4f\115\40\x63\x6f\156\x73\151\x67\x6f\162\144\x63\40\127\110\x45\x52\105\x20\157\x72\144\143\x3d\x61\x2e\151\144\x29\40\x63\x6f\x6e\163\40\xa\40\40\40\x20\x20\x20\x20\40\106\122\117\x4d\x20\157\162\144\x63\40\141\40\x4a\117\111\x4e\x20\160\162\157\x76\145\145\x64\40\142\40\157\x6e\x20\141\x2e\160\162\x6f\166\x65\145\144\75\x62\x2e\151\x64\40\xa\x20\x20\x20\40\40\40\x20\x20\127\110\x45\122\105\40\x62\x2e\143\x6f\x64\151\147\157\x3d\47{$db->proveedor}\47\40\46\46\x20\x61\56\x74\151\x70\157\x70\x61\147\75\47\x30\x27\x20\x26\x26\40\141\x2e\x73\164\x61\x74\x75\x73\75\47\61\x27")->result(); foreach ($bd2 as $db2) { if ($db2->cons < $db2->cant) { $bd3 = $this->db->query("\x53\105\114\105\x43\124\x20\x69\x64\54\x63\157\x64\151\x67\x6f\x2c\x6c\x6f\x74\x65\x20\x46\122\x4f\115\x20\x69\164\x6f\162\x64\143\40\x57\x48\105\122\105\40\157\x72\x64\x63\x3d\47{$db2->id}\47")->result(); $bd4 = $this->db->query("\123\x45\x4c\x45\x43\x54\40\146\145\143\x68\141\40\x46\122\x4f\x4d\x20\143\x6f\x6e\163\x69\x67\157\x72\144\x63\40\127\110\105\x52\105\40\157\162\x64\143\x3d\x27{$db2->id}\x27\x20\x4f\122\x44\105\122\x20\102\131\x20\146\145\x63\x68\141\40\x44\105\123\103\x20\114\111\115\x49\x54\x20\61"); if ($bd4->num_rows() > 0) { $db4 = $bd4->row(); $fech = $db4->fecha; } else { $fech = $db2->frecep; } foreach ($bd3 as $db3) { $bd5 = $this->db->query("\123\105\114\105\103\x54\40\123\125\x4d\x28\x61\56\143\x61\156\x74\x69\144\141\x64\51\40\x63\157\x6e\163\x2c\123\125\115\x28\x61\56\143\x6e\x74\144\145\x76\x75\145\154\x74\51\40\144\x65\x76\40\x46\x52\x4f\x4d\x20\157\160\145\x72\155\166\40\141\40\x4a\x4f\111\116\40\157\160\x65\x72\x74\x69\x20\142\40\x4f\x4e\40\x61\x2e\144\x6f\143\165\x6d\x65\x6e\x74\x6f\x3d\x62\x2e\x64\x6f\x63\165\x6d\145\x6e\x74\157\x20\x57\110\x45\122\105\40\x61\56\143\157\144\151\x67\157\x3d\x27{$db3->codigo}\x27\40\x26\x26\40\x61\x2e\x6c\157\164\145\x3d\x27{$db3->lote}\x27\x20\x26\x26\40\x61\56\x66\x65\x63\x68\141\144\157\143\x3e\x27{$fech}\x27\x20\x26\x26\x20\50\142\56\164\151\160\x6f\144\x6f\x63\75\47\106\101\103\x27\40\x7c\174\40\x62\56\164\x69\x70\x6f\x64\157\143\x3d\x27\116\117\124\47\51\40\x47\122\x4f\125\120\x20\102\x59\40\141\56\x63\x6f\144\x69\147\157\x2c\141\56\154\x6f\x74\x65"); $db6 = $this->db->query("\x53\x45\x4c\x45\103\124\40\x61\x63\157\x73\164\157\40\x46\x52\117\x4d\x20\x61\162\164\x69\154\151\163\x74\x20\x57\110\105\122\105\x20\x63\157\x64\151\147\157\75\47{$db3->codigo}\x27")->row(); $cost = $db6->acosto; if ($cost == null) { $cost = 0; } if ($bd5->num_rows() > 0) { $db5 = $bd5->row(); $consig = array("\157\162\x64\x63" => $db2->id, "\x69\164\157\162\144\x63" => $db3->id, "\146\145\143\x68\x61" => date("\131\x2d\155\55\x64"), "\143\157\x6e\x73\165\x6d\x69\144\157" => $db5->cons, "\144\x65\166\165\x65\x6c\164\x61" => $db5->dev, "\x63\x6f\163\164\157" => $cost); $this->db->insert("\x63\157\x6e\x73\151\147\x6f\162\144\143", $consig); } } } } } } public function proveed($a, $b) { $this->load->library("\x74\x61\x62\x6c\145"); if ($b != '') { $filter = "\127\x48\x45\122\105\x20\143\x6f\144\x69\147\157\x3d\47{$b}\47\x20\x7c\174\x20\156\157\155\142\162\x65\x20\154\151\153\145\40\47\x25{$b}\45\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\x63\157\x64\151\147\x6f\54\x6e\157\x6d\x62\x72\145\54\x72\151\x66\54\x64\x69\141\x73\54\x69\156\x69\x63\x69\x6f\x2c\x66\x69\x6e\x61\x6c\54\144\x69\x61\163\x70\x72\157\x6d\x6f\x2c\40\x6d\157\156\145\x64\141\x2c\x6d\147\x61\x6e\x61\156\54\144\x65\x73\x63\165\x2c\x76\x6f\x6c\40\x46\x52\x4f\x4d\x20\160\162\x6f\x76\x65\x65\144\x20" . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\114\x45\103\x54\40\x63\157\x64\151\x67\157\54\x6e\x6f\x6d\x62\x72\x65\54\162\151\x66\x2c\x64\151\x61\x73\54\x69\x6e\x69\x63\x69\157\54\x66\x69\156\x61\x6c\x2c\x64\x69\141\x73\160\162\x6f\x6d\x6f\54\40\155\157\156\x65\x64\x61\54\x6d\147\141\156\141\x6e\x2c\144\145\163\143\165\54\x76\x6f\154\x2c\x64\145\163\143\x75\62\x2c\x76\x6f\154\62\x2c\144\x65\163\x63\x75\63\x2c\166\157\154\63\x2c\144\x65\163\x63\165\64\54\166\x6f\x6c\64\x2c\x64\145\163\x63\x75\x35\54\166\157\154\65\54\x72\x65\164\x69\x65\x6e\x65\x20\x46\122\117\115\x20\160\162\157\166\145\x65\144\x20" . $filter . "\40\117\122\104\105\x52\x20\x42\x59\40\x6e\x6f\155\142\x72\x65\40\101\123\x43\40\114\111\x4d\x49\x54\40" . ($a - 1) * $mostrar . "\40\x2c\x20" . $mostrar . "\x3b")->result(); $html = "\12\40\40\x20\x20\x3c\164\x61\x62\154\x65\x20\143\154\x61\163\163\75\x22\x77\x33\x2d\x74\x61\x62\x6c\x65\x2d\x61\154\154\x20\x77\x33\x2d\x68\157\166\145\162\x61\142\x6c\145\x20\x77\63\x2d\x6c\145\146\164\x2d\141\x6c\151\147\156\42\x3e\12\40\40\x20\x20\x3c\164\162\x3e\x3c\x74\x64\x20\x63\154\141\x73\163\75\42\167\63\55\x66\157\x6e\x64\x6f\144\x72\157\x69\x64\x22\x3e\x42\x75\x73\x63\141\162\40\x3c\151\155\x67\x20\x73\162\x63\x3d\x22" . base_url() . "\151\155\141\147\x65\x73\57\x62\165\163\x63\141\162\56\160\156\147\x22\40\x61\154\x74\75\42\x42\165\x73\143\141\162\x22\40\164\x69\164\x6c\145\75\x22\x42\x75\163\x63\141\x72\x22\x20\x73\x74\x79\154\x65\x3d\42\167\x69\144\164\x68\x3a\61\70\160\x78\73\142\157\x72\144\145\162\72\x30\x3b\42\x3e\x3c\57\x74\144\x3e\xa\40\x20\x20\40\x3c\164\x64\x3e\x3c\x69\x6e\x70\165\x74\40\164\171\x70\145\x3d\42\164\x65\170\164\42\40\x63\x6c\x61\x73\163\x3d\x22\167\63\x2d\x69\156\x70\x75\x74\42\40\x70\154\141\x63\x65\150\157\x6c\144\x65\162\75\42\x49\156\x67\162\145\163\x65\x20\x73\x75\40\x62\165\x73\x71\165\145\144\141\42\x20\x6f\156\x63\150\x61\x6e\147\145\x3d\42\160\162\157\166\x65\x65\x64\50\x29\x22\x20\151\144\75\x22\154\x69\x6b\x65\42\x3e\74\57\164\x64\76\xa\40\x20\x20\40\x3c\x74\x64\40\x63\154\x61\x73\163\x3d\x22\x77\63\55\143\145\156\164\145\162\x20\x77\63\x2d\142\164\x6e\42\x3e\74\141\x20\157\x6e\143\x6c\151\x63\153\75\x22\x77\63\x2e\x73\150\157\167\50\47\x23\x6d\x6f\144\145\x78\x63\x65\x6c\x70\x72\157\x76\47\51\x3b\42\76\x3c\151\x6d\x67\x20\163\x72\143\75\x22" . base_url() . "\x69\155\x61\x67\145\x73\57\145\170\143\145\154\x2e\x70\x6e\x67\x22\x20\141\154\164\75\42\103\141\162\x67\141\x20\x4c\151\x73\x74\42\x20\x74\x69\164\x6c\x65\75\42\103\141\x72\147\x61\x20\114\x69\163\x74\x22\x20\x73\164\171\x6c\x65\x3d\x22\167\x69\x64\x74\x68\72\62\x30\x70\x78\x3b\x68\x65\151\147\x68\164\x3a\x32\60\160\170\73\142\x6f\x72\144\145\x72\72\60\x3b\42\x3e\x3c\x2f\x61\76\74\57\x74\x64\76\xa\x20\40\x20\x20\x3c\164\x64\40\x63\x6c\141\x73\x73\x3d\x22\x77\x33\x2d\x63\145\x6e\164\x65\162\x20\x77\63\55\x62\x74\x6e\x22\76\x3c\x61\40\x6f\x6e\143\154\151\143\153\x3d\x22\145\170\160\157\x72\x74\145\170\143\145\x6c\154\x69\163\164\x70\162\x6f\166\x28\x29\73\x22\76\x3c\x69\x6d\x67\40\x73\162\143\x3d\x22" . base_url() . "\151\x6d\141\147\x65\163\57\x78\154\x73\56\160\156\x67\42\40\x61\x6c\164\75\x22\x45\170\160\x6f\162\164\40\114\x69\163\164\x22\40\164\x69\164\x6c\145\75\42\x45\170\160\157\x72\164\x20\x4c\151\x73\164\42\40\163\164\171\154\145\75\x22\x77\x69\144\164\150\x3a\x32\x30\160\170\73\150\x65\x69\147\150\164\x3a\62\x30\160\x78\73\x62\157\x72\144\x65\162\x3a\x30\73\x22\76\74\x2f\141\76\74\57\164\x64\76\xa\x20\x20\x20\x20\74\164\144\x20\x63\x6c\141\163\163\x3d\x22\x77\63\x2d\x63\145\x6e\x74\x65\x72\x20\167\63\x2d\142\x74\x6e\x22\76\74\141\40\x6f\x6e\x63\154\151\x63\x6b\x3d\x22\167\x33\56\163\x68\x6f\167\x28\x27\x23\x66\x6f\162\155\160\162\157\x76\x27\51\x3b\42\x3e\x3c\x69\155\147\40\163\162\143\x3d\42" . base_url() . "\151\155\x61\x67\145\x73\x2f\162\x65\147\x69\x73\164\162\141\x72\x2e\160\x6e\x67\42\x20\x61\154\x74\75\x22\122\x65\147\151\163\164\x72\x61\x72\40\x50\x72\157\x76\42\x20\x74\x69\164\x6c\145\x3d\x22\x52\145\x67\151\163\x74\162\x61\162\40\x50\162\157\166\x22\40\163\164\171\154\x65\75\42\x77\x69\x64\164\150\x3a\x32\x30\x70\x78\x3b\x68\145\x69\147\150\164\72\62\60\x70\170\x3b\142\157\x72\144\145\162\x3a\60\x3b\42\x3e\x3c\57\141\x3e\74\x2f\164\144\x3e\xa\x20\x20\40\40\74\164\144\40\x63\154\141\163\x73\x3d\42\167\63\55\x63\x65\156\164\145\x72\x20\167\x33\x2d\x62\164\156\x22\76\74\x61\40\157\x6e\x63\x6c\x69\143\x6b\x3d\42\167\63\56\x73\150\157\x77\x28\47\x23\146\x6f\x72\x6d\x65\144\151\x74\160\x72\157\166\47\51\73\42\76\x3c\x69\155\147\x20\x73\x72\143\75\x22" . base_url() . "\151\x6d\141\147\x65\x73\x2f\145\144\x69\x74\x61\x72\56\160\156\147\42\40\x61\154\164\x3d\42\x45\144\151\164\x61\x72\x20\120\x72\x6f\x76\x65\x65\x64\x6f\162\x22\x20\x74\151\164\x6c\145\75\x22\105\144\x69\x74\141\x72\x20\120\x72\157\x76\x65\145\144\x6f\x72\x22\x20\x73\164\x79\154\145\x3d\42\167\x69\x64\164\x68\72\x32\x30\160\x78\x3b\150\x65\151\147\x68\x74\72\62\x30\x70\170\73\142\157\162\x64\x65\162\72\60\73\x22\76\74\57\x61\x3e\x3c\57\164\144\x3e\xa\40\40\x20\x20\74\164\144\40\143\154\141\163\x73\75\42\x77\63\x2d\143\145\156\x74\145\x72\40\167\63\55\142\164\156\x22\76\x3c\141\40\x6f\156\143\154\151\143\x6b\75\x22\160\162\157\166\145\145\x64\50\x29\x3b\42\76\74\151\x6d\x67\40\163\162\x63\x3d\x22" . base_url() . "\151\155\141\147\145\163\57\162\x65\x6c\x6f\x61\144\x2e\160\x6e\147\42\40\x61\154\x74\x3d\x22\122\x65\x63\x61\x72\147\x61\x72\x22\x20\164\151\164\x6c\x65\75\42\122\145\x63\141\162\x67\141\x72\42\40\163\164\171\x6c\x65\x3d\x22\x77\151\x64\x74\150\72\62\60\160\170\x3b\x68\x65\151\147\x68\x74\72\x32\60\160\170\x3b\142\x6f\162\x64\x65\x72\x3a\60\73\x22\x3e\x3c\57\x61\76\x3c\x2f\164\x64\76\74\x2f\164\x72\x3e\12\40\40\x20\x20\74\57\164\x61\142\154\145\x3e\x3c\142\x72\x3e\12\x20\40\40\x20\74\x74\141\x62\154\145\x20\x69\x64\x3d\42\x69\144\60\61\42\40\143\154\141\163\x73\x3d\42\167\x33\x2d\x74\141\142\154\x65\55\141\x6c\154\40\x77\x33\55\x68\x6f\x76\x65\x72\x61\x62\154\x65\40\x77\63\55\x6c\145\146\164\55\x61\x6c\x69\x67\156\x20\x77\63\x2d\x74\151\x6e\171\x22\76\x3c\164\x72\x20\143\154\141\163\163\x3d\42\167\63\x2d\x66\x6f\x6e\144\x6f\144\x72\157\x69\x64\x22\x3e\74\x74\x68\76\x43\x6f\144\x69\147\157\74\x2f\x74\x68\76\x3c\164\x68\x3e\116\157\155\x62\x72\145\74\x2f\164\x68\76\x3c\164\150\x3e\x52\151\x66\74\57\x74\150\76\x3c\x74\150\x3e\115\x6f\156\x65\x64\141\x3c\x2f\x74\x68\76\74\x74\x68\x3e\x47\141\x6e\x61\156\x63\x69\x61\74\57\164\150\x3e\74\x74\150\76\x44\x69\x61\x73\x3c\57\164\150\76\x3c\x74\x68\x3e\104\x65\x73\143\x75\x3c\57\x74\150\76\x3c\164\150\76\126\x6f\154\x3c\x2f\164\150\x3e\74\x74\150\x3e\104\145\x73\x63\x75\x32\74\x2f\x74\x68\76\74\164\x68\x3e\x56\x6f\x6c\62\x3c\x2f\x74\x68\76\74\x74\x68\x3e\x44\145\163\143\165\x33\74\x2f\x74\150\x3e\x3c\164\150\76\x56\157\x6c\x33\74\57\x74\x68\76\74\164\150\x3e\104\145\163\143\x75\64\74\57\x74\150\x3e\x3c\164\150\76\126\157\154\x34\x3c\x2f\x74\150\76\74\x74\x68\76\x44\145\x73\143\165\65\x3c\x2f\x74\150\x3e\x3c\164\x68\76\126\x6f\x6c\x35\74\x2f\x74\150\76\x3c\164\x68\76\x49\x6e\151\143\151\x6f\x3c\57\164\x68\x3e\x3c\x74\x68\x3e\x46\151\156\141\154\74\57\164\150\76\x3c\164\x68\x3e\x44\151\x61\x73\x20\x50\162\157\155\x6f\74\57\x74\150\x3e\74\164\x68\76\122\145\164\151\145\x6e\x65\x3c\57\x74\x68\x3e\x3c\57\164\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($this->session->userdata("\x74\x69\160") == 8 || $this->session->userdata("\x74\x69\160") == 2) { $mganan = $dtfac->mganan; } else { $mganan = ''; } $html .= "\74\164\x72\x20\151\x64\75\42\x73\x6c\x65\143\x74" . $i . "\42\x20\x63\154\x61\163\163\x3d\x22\x69\164\x65\155\x22\40\157\x6e\143\x6c\151\143\x6b\x3d\42\x69\x74\x70\x72\157\166\50\44\50\47\43\141" . $i . "\47\51\56\166\x61\154\x28\51\51\x3b\x22\x3e"; $html .= "\x3c\x69\x6e\x70\165\x74\x20\x74\x79\x70\145\x3d\42\x68\x69\x64\x64\145\156\x22\x20\x69\x64\x3d\42\x61" . $i . "\x22\x20\156\x61\155\x65\75\x22\143\157\144\151\147\157\42\40\x76\141\154\165\x65\75\x22" . $dtfac->codigo . "\x22\76\12\x20\x20\x20\40\40\40\x20\x20\74\x74\x64\76" . $dtfac->codigo . "\74\x2f\164\144\x3e\74\164\144\76" . $dtfac->nombre . "\x3c\57\164\x64\x3e\x3c\x74\144\x3e" . $dtfac->rif . "\74\57\164\x64\x3e\x3c\164\x64\76" . $dtfac->moneda . "\74\57\x74\x64\76\74\x74\144\x3e" . $mganan . "\x3c\x2f\164\x64\76\x3c\164\x64\76" . $dtfac->dias . "\x3c\x2f\164\144\76\x3c\164\x64\x3e" . $dtfac->descu . "\74\57\x74\x64\76\74\x74\x64\76" . $dtfac->vol . "\x3c\57\x74\x64\76\x3c\x74\144\x3e" . $dtfac->descu2 . "\74\57\x74\x64\76\x3c\x74\x64\x3e" . $dtfac->vol2 . "\x3c\x2f\164\144\x3e\74\164\144\x3e" . $dtfac->descu3 . "\x3c\x2f\164\x64\76\74\164\144\76" . $dtfac->vol3 . "\x3c\57\164\144\76\x3c\x74\x64\76" . $dtfac->descu4 . "\74\x2f\164\144\76\74\164\144\76" . $dtfac->vol4 . "\x3c\57\x74\x64\x3e\74\164\x64\76" . $dtfac->descu5 . "\x3c\x2f\x74\144\76\74\164\x64\x3e" . $dtfac->vol5 . "\x3c\x2f\x74\144\x3e\74\164\144\x3e" . $dtfac->inicio . "\74\57\x74\144\x3e\x3c\164\144\x3e" . $dtfac->final . "\74\57\x74\144\76\74\x74\x64\76" . $dtfac->diaspromo . "\x3c\x2f\164\x64\76\12\x20\40\x20\40\40\x20\x20\x20\x3c\164\144\76" . $dtfac->retiene . "\x3c\57\x74\x64\x3e\12\x20\x20\40\x20\40\40\40\x20\x3c\57\164\162\76"; } $html .= "\x3c\41\55\55\x3c\164\x72\x3e\x3c\164\x64\x20\x63\x6c\141\163\163\75\42\x77\x33\x2d\x63\145\156\164\145\x72\40\x77\x33\55\x66\157\x6e\144\x6f\x64\x72\157\x69\144\x22\40\x63\x6f\x6c\x73\160\141\x6e\75\x22\x31\x33\x22\x3e\74\x6c\141\x62\145\154\x20\143\x6c\141\163\x73\75\x22\x77\63\55\154\141\162\x67\x65\x22\76\74\x62\x3e\124\x6f\x74\141\154\40\162\145\x67\x69\163\x74\162\x6f\163\72\40" . $totalreg . "\x3c\57\142\76\x3c\57\x6c\x61\x62\x65\x6c\76\x3c\57\164\x64\76\x3c\x2f\x74\x72\76\x2d\55\76\74\x2f\x74\x61\142\x6c\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\x20\x20\40\40\x20\x20\40\x3c\163\143\162\151\x70\x74\x20\164\x79\160\145\75\42\164\145\170\164\57\152\141\x76\x61\x73\143\x72\x69\x70\164\x22\76\12\x20\40\40\40\x20\x20\40\40\146\165\x6e\x63\x74\x69\157\x6e\40\x44\145\143\x72\x65\x6d\x65\x6e\164\x4e\165\x6d\x28\x29\173\40\x62\x65\x66\x6f\x72\x65\50\x29\73\12\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x76\x61\x72\40\104\x65\x63\x72\x65\x6d\x65\156\x74\116\165\155\x3d\144\x6f\x63\165\155\145\x6e\164\x2e\147\145\x74\x45\x6c\x65\155\145\156\164\x42\171\111\144\x28\x22\x44\145\x63\x72\145\155\145\156\x74\x4e\165\155\x22\x29\x2e\166\x61\154\x75\145\x3b\xa\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x76\141\x72\x20\153\145\x79\x3d\x22\144\x72\x6f\x69\x64\71\60\63\42\x3b\xa\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\166\141\x72\40\x64\141\164\157\163\x20\75\40\x7b\xa\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\42\x70\x61\x67\x22\x20\72\x20\x44\x65\143\162\x65\x6d\145\156\164\x4e\165\155\54\12\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\40\40\x22\x6b\x65\x79\42\40\x3a\40\x6b\x65\x79\12\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\40\175\73\12\40\40\x20\40\x20\40\x20\x20\40\40\x20\xa\x20\40\x20\x20\40\x20\x20\40\40\40\40\x20\40\40\x20\44\x2e\141\x6a\x61\170\x28\x7b\xa\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\x64\x61\x74\141\72\40\144\141\x74\x6f\163\x2c\xa\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\165\162\x6c\72\40\40\x62\141\163\145\x75\162\x6c\x2b\42\143\137\144\x72\x6f\151\144\57\x70\162\157\166\145\145\144\42\x2c\xa\40\40\40\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\40\40\164\x79\x70\145\72\x20\42\120\x4f\x53\124\x22\x2c\12\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x73\165\x63\x63\145\x73\163\x3a\40\x66\x75\156\x63\x74\151\x6f\156\50\x64\141\x74\x61\x29\40\173\xa\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\44\x28\42\43\142\157\144\x79\42\x29\56\x68\164\155\x6c\50\x64\x61\164\x61\x29\x3b\12\x20\40\40\x20\40\40\40\40\40\40\x20\x20\40\40\x20\40\x20\40\40\x7d\xa\40\40\40\x20\x20\x20\40\x20\40\x20\x20\xa\x20\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\40\x20\175\51\73\12\40\40\x20\40\40\x20\x20\x20\40\40\x20\175\12\x20\x20\40\40\x20\40\x20\x20\xa\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x66\x75\x6e\143\x74\x69\x6f\x6e\40\x6e\165\x6d\160\141\x67\x28\x61\x29\x7b\40\x62\x65\146\157\162\x65\50\x29\73\xa\x20\40\x20\x20\40\40\x20\x20\40\x20\40\x20\x76\141\162\40\x6b\x65\x79\75\x22\144\x72\x6f\x69\144\71\x30\x33\x22\73\12\x20\40\x20\x20\40\x20\40\40\12\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\166\x61\x72\x20\144\141\164\x6f\x73\40\x3d\40\173\xa\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x22\x6b\145\x79\42\72\x6b\x65\171\54\12\40\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\x22\x70\141\x67\42\40\72\x20\141\12\40\40\x20\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\175\73\xa\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\12\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\40\x24\x2e\141\152\141\x78\50\173\12\40\x20\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\144\x61\164\x61\72\x20\144\141\164\x6f\x73\x2c\xa\40\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\165\162\x6c\x3a\x20\x62\141\x73\x65\x75\162\154\x2b\42\x63\x5f\144\x72\x6f\151\144\57\160\x72\157\x76\145\145\144\42\x2c\12\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\40\x74\171\x70\x65\x3a\40\42\120\117\x53\x54\42\54\xa\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\x73\x75\x63\143\x65\x73\x73\72\40\146\165\x6e\x63\x74\x69\157\156\x28\144\141\164\141\51\40\x7b\12\40\40\40\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x24\x28\x22\x23\x62\157\144\171\x22\x29\x2e\150\x74\155\154\50\144\x61\164\x61\x29\73\xa\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x7d\xa\40\40\x20\40\40\x20\40\40\x20\40\x20\12\x20\40\x20\x20\40\40\40\40\40\x20\40\40\x20\x20\x20\175\x29\73\12\40\40\40\x20\40\40\x20\x20\40\40\x20\175\xa\x20\40\40\x20\x20\40\40\40\xa\40\40\40\40\40\x20\x20\x20\x20\x20\x20\146\165\156\x63\164\151\x6f\x6e\x20\111\156\x63\x72\151\155\145\156\164\x4e\x75\155\x28\x29\173\40\142\145\146\157\162\x65\50\51\x3b\xa\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\166\x61\162\x20\111\156\x63\162\x69\x6d\x65\156\164\116\165\155\x3d\x64\x6f\143\x75\x6d\145\156\x74\56\147\145\x74\x45\154\145\155\x65\x6e\164\x42\171\111\x64\50\42\111\156\x63\162\151\x6d\x65\x6e\x74\x4e\x75\x6d\42\51\56\x76\141\x6c\165\x65\x3b\xa\40\x20\40\40\40\x20\40\x20\40\x20\40\x20\166\x61\162\x20\153\145\x79\x3d\42\144\162\x6f\151\x64\x39\60\x33\42\73\12\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\166\x61\x72\40\x64\141\x74\157\x73\x20\x3d\40\x7b\xa\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\42\153\145\171\x22\72\153\x65\x79\x2c\12\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\x20\42\160\141\147\42\40\72\x20\x49\x6e\x63\162\151\x6d\x65\156\164\x4e\x75\x6d\xa\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\175\x3b\xa\40\40\x20\40\40\x20\x20\40\40\x20\x20\xa\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\x24\56\x61\152\141\170\x28\173\xa\40\40\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\144\x61\164\x61\72\40\x64\141\x74\x6f\163\54\12\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\40\40\40\165\x72\x6c\72\x20\40\142\141\163\x65\165\x72\x6c\53\42\x63\137\144\x72\x6f\x69\x64\x2f\x70\x72\157\166\x65\x65\144\x22\x2c\xa\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x74\x79\160\145\72\40\x22\120\x4f\123\124\x22\54\xa\x20\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\40\40\40\x20\x20\40\163\165\143\x63\x65\x73\163\72\x20\x66\x75\x6e\143\x74\x69\157\156\50\x64\x61\164\x61\x29\x20\173\12\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\44\x28\x22\43\x62\x6f\144\x79\42\x29\x2e\x68\164\x6d\x6c\50\144\141\x74\141\x29\73\xa\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\40\40\40\40\40\x7d\xa\x20\x20\40\40\40\40\x20\x20\40\x20\40\12\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x7d\51\x3b\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\175\12\40\x20\40\x20\x20\40\x20\40\74\57\163\143\162\x69\160\164\x3e\12\x20\x20\40\40\x20\40\x20\x20\74\144\151\x76\x20\x63\x6c\x61\x73\163\75\x22\167\63\55\x62\141\x72\40\167\x33\55\x62\x6f\x72\x64\x65\x72\x20\167\63\55\142\141\x72\x72\x61\163\42\76\xa\40\x20\40\x20\x20\40\x20\x20\x3c\151\156\160\x75\x74\x20\x74\171\x70\x65\x3d\x22\x68\151\144\x64\x65\156\x22\40\151\x64\x3d\42\104\145\x63\162\145\155\145\x6e\164\116\165\x6d\x22\x20\x76\141\x6c\165\145\x3d\42" . $DecrementNum . "\x22\x3e\xa\40\x20\40\40\x20\40\x20\40\74\141\40\x6f\156\143\154\x69\x63\153\x3d\42\104\x65\143\x72\145\155\x65\156\x74\x4e\x75\x6d\x28\x29\x3b\x22\x20\143\x6c\x61\x73\x73\75\x22\167\63\55\142\x61\162\x2d\x69\164\145\155\40\167\x33\x2d\142\x75\164\164\157\156\42\76\46\x6c\x61\161\165\157\x3b\x3c\57\x61\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\x61\x67\x69\156\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\146\x6f\x6e\x64\x6f\x64\x72\157\x69\x64"; $html .= "\xa\x20\x20\40\40\x20\40\40\x20\x3c\151\156\160\x75\x74\x20\x74\x79\160\145\75\x22\150\151\x64\144\x65\156\42\40\x69\144\x3d\x22" . $id . "\42\x20\166\x61\154\165\x65\75\42" . $i . "\42\x3e\xa\x20\x20\40\40\x20\40\40\40\74\141\40\x6f\x6e\x63\154\151\x63\153\75\x22\156\165\x6d\160\x61\x67\50\44\50\x27\43" . $id . "\47\51\x2e\166\141\154\50\51\x29\73\x22\40\x63\x6c\x61\x73\x73\75\x22\167\x33\x2d\142\x61\x72\x2d\151\164\x65\x6d\x20\x77\63\x2d\x62\x75\164\x74\x6f\x6e\40" . $hover . "\x22\76" . $i . "\74\x2f\x61\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\x70\165\164\x20\x74\171\x70\x65\x3d\42\150\x69\x64\144\145\x6e\42\x20\x69\x64\x3d\x22" . $id . "\x22\x20\x76\141\x6c\x75\145\75\42" . $i . "\x22\76\12\40\40\40\40\40\x20\40\x20\74\x61\x20\x6f\x6e\143\x6c\x69\x63\153\75\42\156\x75\155\160\x61\147\50\x24\x28\47\x23" . $id . "\47\51\x2e\166\x61\154\x28\51\x29\x3b\42\40\x63\154\141\x73\x73\75\42\167\x33\55\142\x61\162\55\151\x74\145\155\x20\167\63\55\142\165\x74\x74\157\x6e\x20" . $hover . "\42\76" . $i . "\x3c\x2f\141\76"; } } } $html .= "\74\x69\x6e\160\x75\x74\x20\164\x79\160\145\75\x22\150\151\144\144\x65\x6e\x22\40\x69\144\75\42\111\156\143\162\151\x6d\145\156\164\116\x75\155\x22\x20\x76\141\154\x75\x65\x3d\42" . $IncrimentNum . "\42\x3e\12\x20\40\x20\x20\40\x20\x20\40\x3c\141\40\x6f\156\143\154\151\x63\153\75\42\x49\156\x63\x72\x69\x6d\x65\x6e\164\x4e\165\x6d\50\51\x3b\x22\x20\x63\x6c\141\163\163\75\x22\167\x33\55\x62\141\x72\x2d\x69\x74\145\x6d\40\x77\63\x2d\142\x75\x74\x74\157\156\42\x3e\x26\162\141\x71\165\157\x3b\74\x2f\x61\76\12\12\x20\40\x20\x20\x20\40\x20\x20\74\x2f\x64\x69\166\76\40"; return $html; } public function itprov($a) { $this->load->library("\164\141\x62\x6c\145"); $bdfac = $this->db->query("\123\105\x4c\x45\103\x54\40\x61\56\143\x6f\x64\151\147\157\54\x62\56\x6e\x6f\x6d\x62\x72\145\40\x46\122\117\x4d\x20\x61\162\164\151\160\162\157\x76\40\141\40\x4a\x4f\111\116\40\x61\x72\x74\151\143\x75\x6c\x6f\40\142\x20\x6f\156\40\x61\56\143\x6f\144\151\x67\x6f\x3d\x62\56\x63\x6f\144\x69\147\x6f\40\127\x48\x45\122\x45\x20\x61\x2e\x70\162\x6f\x76\145\x65\x64\x6f\x72\75\x27{$a}\x27\x20\x4f\x52\x44\105\122\x20\x42\131\x20\142\56\156\x6f\x6d\x62\x72\x65\40\101\x53\103\x3b")->result(); $html = "\12\40\x20\x20\x20\x20\40\x20\40\x3c\x74\141\142\x6c\x65\40\x69\x64\75\x22\x69\x64\60\61\x22\x20\x63\x6c\141\163\163\x3d\42\167\63\55\164\141\142\x6c\145\55\x61\x6c\x6c\x20\167\63\x2d\150\157\166\145\162\x61\x62\154\145\40\x77\63\x2d\x6c\145\x66\164\x2d\141\x6c\x69\x67\156\40\x77\63\55\x74\x69\x6e\171\x22\x3e\x3c\x74\x72\40\143\154\x61\163\163\75\42\x77\x33\55\x66\x6f\156\144\x6f\x64\162\157\x69\x64\x22\x3e\x3c\164\150\76\x43\x6f\x64\151\147\157\x3c\57\x74\150\76\74\x74\x68\76\116\157\x6d\x62\x72\x65\74\x2f\164\x68\76\74\x2f\164\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\164\x72\x3e"; $html .= "\74\x69\x6e\x70\x75\x74\x20\164\x79\x70\x65\x3d\x22\150\x69\144\x64\x65\x6e\x22\x20\151\x64\75\42\141" . $i . "\x22\x20\156\141\x6d\145\x3d\42\x64\x6f\x63\42\x20\x76\141\154\x75\x65\x3d\x22" . $dtfac->id . "\x22\x3e\xa\x20\40\x20\x20\40\40\x20\40\x20\40\40\40\74\x74\x64\76" . $dtfac->codigo . "\74\57\x74\x64\x3e\74\x74\x64\76" . $dtfac->nombre . "\x3c\x2f\164\x64\x3e\xa\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\74\57\164\162\76"; } $html .= "\x3c\57\x74\x61\x62\154\145\x3e"; return $html; } function excellistprov($id, $a, $b, $c, $d, $e, $f, $g, $h, $desc, $vol, $desc2, $vol2, $desc3, $vol3, $desc4, $vol4, $desc5, $vol5, $ret, $islr) { $cod = str_pad($id, 4, "\60", STR_PAD_LEFT); $data = array("\156\x6f\x6d\142\162\x65" => $a, "\x72\x69\146" => $b, "\x64\151\x61\163" => $c, "\x69\x6e\x69\x63\151\157" => $d, "\x66\x69\156\141\154" => $e, "\144\151\x61\163\x70\x72\157\x6d\157" => $f, "\155\x6f\x6e\145\144\x61" => $g, "\x6d\147\x61\156\x61\156" => $h, "\x64\145\163\143\165" => $desc, "\166\x6f\154" => $vol, "\144\145\x73\x63\x75\x32" => $desc2, "\x76\157\x6c\62" => $vol2, "\x64\145\x73\143\165\63" => $desc3, "\166\x6f\x6c\x33" => $vol3, "\x64\x65\163\143\165\64" => $desc4, "\166\157\x6c\64" => $vol4, "\144\145\x73\x63\x75\65" => $desc5, "\x76\157\154\x35" => $vol5, "\x72\145\x74\x69\145\x6e\145" => $ret, "\x69\x73\154\x72\x5f\152" => $islr); $this->db->where("\143\x6f\x64\151\x67\x6f", $cod)->update("\160\x72\157\x76\x65\x65\144", $data); return $this->db->affected_rows(); } function excellistprov2($id, $a, $b, $c, $d, $e, $f, $g, $desc, $vol, $desc2, $vol2, $desc3, $vol3, $desc4, $vol4, $desc5, $vol5, $ret, $islr) { $cod = str_pad($id, 4, "\x30", STR_PAD_LEFT); $data = array("\x6e\157\155\142\162\x65" => $a, "\x72\x69\146" => $b, "\x64\x69\141\163" => $c, "\151\156\x69\143\151\x6f" => $d, "\x66\x69\x6e\141\154" => $e, "\144\x69\141\163\160\162\x6f\155\x6f" => $f, "\155\x6f\156\x65\144\x61" => $g, "\144\145\163\x63\x75" => $desc, "\166\157\x6c" => $vol, "\144\x65\163\143\x75\x32" => $desc2, "\166\157\x6c\62" => $vol2, "\144\145\163\143\165\x33" => $desc3, "\166\157\154\x33" => $vol3, "\x64\x65\163\x63\165\64" => $desc4, "\x76\x6f\154\x34" => $vol4, "\144\145\x73\143\x75\65" => $desc5, "\166\x6f\154\x35" => $vol5, "\x72\x65\x74\x69\x65\156\x65" => $ret, "\x69\x73\x6c\162\x5f\152" => $islr); $this->db->where("\143\x6f\x64\151\x67\x6f", $cod)->update("\160\162\157\166\x65\x65\144", $data); return $this->db->affected_rows(); } function regprov($a, $b, $c, $d, $e, $f, $g, $h, $i, $telf, $dirr, $nomcontac, $telfcontac, $retiene, $islr) { $num = $this->db->query("\123\105\114\x45\x43\x54\40\115\x41\x58\50\x63\x6f\144\x69\x67\157\x29\x2b\x31\40\x6e\40\106\122\x4f\x4d\40\x70\x72\157\166\145\x65\x64")->row(); $newcod = str_pad($num->n, 4, "\x30", STR_PAD_LEFT); $data = array("\143\x6f\x64\151\147\157" => $newcod, "\x6e\x6f\155\x62\x72\x65" => $a, "\x72\151\x66" => $b, "\144\151\x61\163" => $c, "\151\x6e\x69\143\x69\x6f" => $d, "\146\x69\x6e\x61\154" => $e, "\144\x69\141\163\x70\162\157\155\157" => $f, "\155\157\156\x65\x64\x61" => $g, "\155\147\x61\x6e\141\x6e" => $h, "\x64\145\163\143\165" => $i, "\164\x65\154\x65\x66\x6f\x6e\x6f" => $telf, "\x64\x69\x72\145\143\x63\151\x6f\x6e" => $dirr, "\156\x6f\x6d\x62\162\x65\x5f\x63\x6f\156\164\x61\x63\164\157" => $nomcontac, "\x74\145\154\145\146\x6f\x6e\157\137\x63\157\156\164\141\x63\x74\x6f" => $telfcontac, "\162\x65\164\151\x65\156\145" => $retiene, "\x69\163\154\162\137\x6a" => $islr); $this->db->insert("\160\162\x6f\166\145\x65\144", $data); $this->loguser("\x43\162\145\x61\40\120\x72\x6f\x76\145\145\x64", "\x45\154\40\165\x73\165\141\162\x69\x6f\40\143\162\x65\x61\x20\145\154\40\160\162\x6f\x76\x65\x65\x64\157\x72\x3a" . $a . "\40\143\x6f\144\x69\x67\x6f\x3a" . $newcod . "\40\162\151\146\x3a" . $b . "\40\x64\x69\x61\163\x3a" . $c . "\x20\x6d\157\156\145\144\x61\x3a" . $g . "\40\144\145\163\x63\165\72" . $i . ''); return $this->db->affected_rows(); } function editproveed($id, $a, $b, $c, $d, $e, $f, $g, $h, $i, $telf, $dirr, $nomcontac, $telfcontac, $retiene, $islr) { $num = $this->db->query("\123\x45\114\x45\103\124\40\115\x41\x58\x28\x63\157\144\151\x67\157\51\53\61\x20\x6e\40\x46\122\117\x4d\40\x70\x72\157\x76\145\x65\144")->row(); $newcod = str_pad($num->n, 4, "\x30", STR_PAD_LEFT); $data = array("\x63\x6f\x64\151\x67\x6f" => $newcod, "\156\x6f\155\x62\x72\145" => $a, "\162\151\146" => $b, "\144\x69\x61\163" => $c, "\151\156\x69\143\x69\157" => $d, "\x66\x69\x6e\141\x6c" => $e, "\x64\x69\141\163\160\162\157\x6d\157" => $f, "\x6d\x6f\x6e\145\144\141" => $g, "\155\147\x61\156\141\156" => $h, "\x64\145\x73\143\165" => $i, "\x74\145\154\x65\x66\157\x6e\x6f" => $telf, "\x64\x69\x72\145\143\x63\151\x6f\x6e" => $dirr, "\x6e\157\x6d\142\162\145\x5f\143\157\x6e\x74\x61\x63\x74\157" => $nomcontac, "\x74\145\x6c\145\146\157\156\157\x5f\x63\157\156\164\x61\143\x74\157" => $telfcontac, "\x72\x65\164\x69\x65\156\x65" => $retiene, "\x69\163\x6c\162\137\x6a" => $islr); $this->db->where("\x69\144\x3d\47{$id}\x27")->update("\x70\x72\157\166\145\145\x64", $data); $this->loguser("\x45\x64\151\164\x61\40\x50\x72\x6f\x76\x65\x65\x64", "\105\x6c\40\x75\x73\x75\x61\x72\x69\x6f\x20\x65\144\151\x74\141\40\x65\x6c\x20\160\x72\x6f\x76\x65\145\144\x6f\162\x3a" . $a . "\x20\143\x6f\144\x69\147\157\x3a" . $newcod . "\40\162\151\x66\x3a" . $b . "\40\x64\151\141\x73\x3a" . $c . "\x20\x6d\x6f\156\x65\x64\x61\72" . $g . "\40\x64\x65\163\x63\165\72" . $i . ''); return $this->db->affected_rows(); } function exportexcellistprov() { if ($this->session->userdata("\x74\x69\160") == 8 || $this->session->userdata("\164\x69\160") == 2) { return $this->db->query("\x53\x45\114\105\x43\x54\40\x63\x6f\x64\x69\147\x6f\54\x6e\x6f\x6d\142\162\x65\x2c\162\151\146\54\x64\151\x61\163\54\151\x6e\x69\143\151\157\x2c\x66\151\x6e\141\x6c\x2c\144\151\x61\163\x70\162\157\x6d\x6f\54\155\x6f\156\145\144\x61\x2c\155\x67\x61\x6e\x61\156\x2c\144\145\163\143\165\54\166\x6f\154\x2c\144\x65\x73\x63\165\62\54\x76\x6f\x6c\x32\x2c\x64\x65\x73\x63\x75\63\x2c\x76\157\154\x33\x2c\x64\x65\x73\143\165\64\x2c\x76\157\154\64\54\144\x65\163\x63\x75\x35\x2c\166\x6f\x6c\x35\54\162\145\164\151\145\x6e\x65\x2c\x69\x73\x6c\x72\x5f\x6a\x20\106\122\117\115\40\160\x72\157\166\145\145\144\x20\117\122\x44\105\122\40\x42\x59\x20\x6e\157\155\x62\162\x65\x20\101\123\103"); } else { return $this->db->query("\x53\105\x4c\105\x43\x54\40\143\x6f\x64\151\147\x6f\x2c\x6e\x6f\155\x62\x72\x65\x2c\x72\151\146\54\x64\151\141\163\x2c\x69\156\151\x63\x69\157\x2c\146\x69\156\x61\154\54\x64\x69\x61\x73\x70\162\157\155\157\54\x6d\157\156\145\x64\141\54\x27\x30\47\x20\x6d\147\141\156\x61\156\54\144\145\x73\x63\165\54\x76\x6f\x6c\54\x64\x65\x73\143\x75\62\54\166\157\x6c\x32\x2c\144\145\163\x63\165\x33\54\x76\x6f\x6c\63\x2c\144\x65\x73\143\x75\x34\54\x76\157\154\64\54\144\145\163\143\165\65\x2c\x76\x6f\x6c\x35\54\x72\x65\164\151\x65\156\x65\54\151\163\154\x72\137\152\x20\106\122\x4f\115\x20\160\162\157\x76\x65\145\144\40\x4f\122\104\x45\x52\40\x42\x59\40\156\x6f\x6d\x62\162\145\x20\101\123\103"); } } public function consigordc($a, $b) { $this->load->library("\x74\x61\142\154\145"); if ($b != '') { $filter = "\127\x48\x45\x52\105\x20\x61\x2e\157\x72\x64\143\x3d\x27{$b}\47\40\x7c\x7c\40\143\x2e\156\157\155\142\x72\x65\x20\x6c\151\153\145\x20\47\x25{$b}\x25\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\x45\x4c\x45\x43\x54\40\x4e\x55\114\114\40\x46\x52\117\x4d\x20\x63\x6f\156\163\x69\147\157\162\144\x63\40\141\40\xa\40\x20\x20\40\40\x20\40\x20\x20\40\40\112\x4f\x49\x4e\x20\157\162\144\x63\40\x62\x20\117\x4e\x20\141\56\157\x72\144\143\75\x62\x2e\x69\144\40\x4a\117\111\116\40\160\162\157\166\145\x65\x64\40\x63\x20\117\116\40\142\x2e\160\162\157\x76\x65\x65\144\x3d\x63\x2e\151\144\40" . $filter . "\x20\107\x52\117\x55\x50\x20\x42\131\x20\141\56\157\162\144\143\x2c\x61\x2e\146\145\143\x68\x61\40\x4f\122\104\105\x52\40\102\x59\40\x61\56\x6e\x63\157\156\x74\x72\x6f\154\54\141\x2e\146\x65\143\150\141\40\x44\105\x53\103")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\x4c\x45\x43\124\x20\141\x2e\x6f\162\144\143\54\x61\56\146\145\x63\150\141\x2c\143\x2e\156\157\155\142\x72\145\54\x20\x63\56\x6d\157\x6e\x65\x64\x61\x2c\x53\x55\115\50\141\x2e\x63\157\156\163\x75\155\x69\x64\x6f\x29\x20\x63\x6f\156\x73\x2c\x49\x46\50\141\x2e\156\143\157\156\x74\x72\157\154\x3e\x30\x2c\x61\x2e\156\x63\157\x6e\x74\x72\157\154\54\x27\116\x2f\x41\x27\51\x20\156\143\157\x6e\164\x72\x6f\x6c\40\106\122\x4f\x4d\40\143\x6f\156\163\151\147\x6f\x72\144\x63\x20\x61\40\12\x20\x20\40\x20\40\40\40\40\x4a\x4f\x49\116\40\x6f\x72\144\143\x20\142\x20\117\x4e\x20\x61\56\157\x72\144\x63\75\x62\x2e\151\x64\x20\112\x4f\x49\x4e\40\160\x72\x6f\x76\x65\145\144\40\x63\x20\x4f\x4e\x20\142\x2e\160\x72\x6f\x76\x65\x65\144\x3d\143\56\x69\144\40" . $filter . "\40\107\x52\x4f\125\120\40\x42\131\40\x61\x2e\x6f\162\144\143\x2c\x61\56\146\145\143\x68\x61\40\x4f\122\x44\105\x52\x20\x42\x59\40\141\x2e\x6e\x63\x6f\156\164\162\157\x6c\x2c\x61\56\x66\145\143\x68\141\40\x44\x45\123\x43\40\x4c\111\115\111\x54\x20" . ($a - 1) * $mostrar . "\40\54\x20" . $mostrar . "\x3b")->result(); $html = "\xa\40\40\x20\x20\x20\x20\40\40\x3c\164\x61\142\154\145\x20\x63\154\x61\x73\163\x3d\x22\x77\x33\x2d\164\x61\142\x6c\x65\55\141\154\x6c\x20\x77\63\55\150\x6f\166\145\x72\x61\142\154\x65\x20\x77\63\55\154\x65\146\x74\x2d\141\154\x69\x67\156\42\x3e\xa\40\x20\x20\40\40\40\40\40\x3c\164\x72\76\x3c\164\x64\40\x63\x6c\141\163\x73\x3d\42\x77\x33\x2d\x66\x6f\156\x64\x6f\x64\x72\157\151\x64\42\76\x42\x75\x73\143\x61\162\x20\74\x69\155\147\40\x73\162\x63\75\x22" . base_url() . "\x69\155\x61\147\145\x73\57\142\x75\163\x63\x61\x72\x2e\x70\156\x67\x22\40\141\x6c\x74\x3d\x22\x42\165\x73\x63\141\162\x22\x20\164\151\164\x6c\x65\75\x22\102\165\163\x63\x61\162\42\40\163\164\x79\154\145\x3d\x22\x77\151\x64\164\x68\72\61\x38\160\x78\73\142\x6f\162\x64\x65\162\x3a\60\73\42\76\74\x2f\164\144\x3e\12\x20\40\x20\x20\x20\40\40\x20\74\164\144\x3e\74\151\156\x70\165\164\x20\164\x79\160\145\x3d\42\164\145\x78\x74\42\40\x63\x6c\141\x73\x73\x3d\x22\x77\x33\55\151\x6e\160\165\x74\42\40\160\154\141\x63\145\150\157\x6c\x64\x65\162\x3d\x22\111\x6e\x67\162\x65\163\145\40\x73\165\x20\142\x75\163\161\x75\145\x64\x61\42\40\157\156\x63\x68\x61\x6e\147\x65\75\x22\x63\157\156\x73\x69\x67\157\x72\144\143\x28\x29\42\x20\151\144\75\x22\x6c\x69\153\x65\x22\76\x3c\57\x74\x64\76\12\40\x20\x20\x20\x20\40\40\40\x3c\x74\144\x20\x63\154\x61\163\163\x3d\x22\167\x33\55\x63\145\156\164\145\x72\40\x77\x33\55\142\164\156\x22\76\x3c\141\40\157\156\x63\154\x69\x63\153\75\42\x65\170\x70\x6f\x72\x74\145\x78\143\145\x6c\x63\157\156\x73\x69\x67\x28\x29\73\x22\x3e\74\151\155\147\x20\x73\x72\x63\75\x22" . base_url() . "\x69\155\141\147\145\x73\57\x78\x6c\x73\56\160\156\x67\x22\x20\141\154\164\x3d\x22\x45\x78\x70\x6f\162\164\x20\x4c\x69\x73\x74\42\40\164\x69\x74\x6c\145\x3d\42\x45\170\160\x6f\162\164\40\114\x69\163\164\x22\40\x73\164\171\154\x65\x3d\42\167\x69\x64\164\x68\72\62\60\x70\170\73\150\145\151\147\x68\x74\72\x32\x30\160\170\73\x62\x6f\x72\x64\x65\162\72\x30\x3b\x22\76\74\x2f\141\x3e\74\x2f\x74\144\x3e\xa\40\x20\x20\x20\40\40\40\40\74\164\x64\40\143\154\x61\x73\163\x3d\42\167\x33\x2d\x63\145\156\x74\145\162\x20\x77\63\55\x62\164\x6e\x22\x3e\74\141\40\157\156\x63\x6c\x69\143\153\75\42\x72\145\x67\156\143\157\156\164\x72\157\x6c\50\51\x3b\x22\76\x3c\x69\155\147\40\163\x72\x63\75\x22" . base_url() . "\x69\155\x61\147\x65\x73\57\x72\x65\x67\x69\x73\x74\162\141\x72\56\x70\156\x67\x22\40\x61\154\x74\75\42\122\x65\147\x69\x73\164\162\x61\162\40\x43\x6f\156\164\x72\157\154\42\x20\164\151\x74\154\x65\x3d\x22\x52\x65\x67\x69\x73\x74\162\x61\x72\40\103\x6f\156\164\x72\x6f\154\42\x20\x73\164\171\x6c\145\75\42\x77\151\x64\164\150\x3a\x32\60\160\170\x3b\150\x65\151\x67\x68\164\72\x32\x30\x70\170\73\x62\x6f\x72\144\145\162\x3a\x30\73\x22\x3e\x3c\x2f\x61\76\74\57\164\x64\x3e\12\x20\x20\40\40\x20\x20\40\x20\x3c\164\144\40\143\154\x61\163\163\75\x22\x77\63\x2d\143\x65\156\164\145\162\40\167\x33\55\142\164\x6e\x22\76\x3c\141\40\x6f\156\x63\x6c\x69\143\x6b\75\x22\x63\x6f\x6e\163\x69\147\x6f\x72\x64\x63\50\x29\73\42\x3e\74\151\x6d\147\x20\x73\x72\x63\x3d\42" . base_url() . "\151\x6d\141\147\145\163\57\x72\x65\x6c\x6f\x61\x64\x2e\x70\x6e\x67\x22\x20\141\x6c\x74\75\x22\122\145\143\141\x72\x67\141\162\x22\40\x74\151\164\x6c\x65\75\x22\122\145\143\141\162\147\141\x72\42\x20\x73\x74\171\x6c\x65\x3d\42\x77\151\x64\x74\150\x3a\62\60\x70\x78\x3b\150\145\x69\x67\150\164\x3a\62\x30\160\x78\x3b\x62\157\x72\x64\145\x72\x3a\x30\73\42\x3e\x3c\57\141\76\x3c\57\x74\144\x3e\x3c\x2f\164\x72\76\12\40\x20\x20\x20\40\x20\x20\40\x3c\57\x74\141\142\x6c\145\76\74\x62\x72\x3e\12\x20\40\40\x20\x20\x20\40\x20\74\164\141\142\x6c\145\40\151\144\x3d\42\x69\x64\60\61\x22\40\x63\x6c\141\163\163\75\x22\x77\63\55\x74\x61\142\x6c\x65\x2d\141\x6c\x6c\x20\167\x33\55\150\x6f\x76\145\162\141\x62\154\145\x20\167\63\55\x6c\145\146\164\55\x61\154\x69\147\x6e\x20\x77\x33\55\x74\151\156\171\42\76\74\164\162\40\143\x6c\141\163\x73\x3d\42\x77\x33\x2d\x66\157\x6e\x64\x6f\x64\x72\157\151\144\42\76\x3c\164\x68\76\117\162\x64\x65\156\74\57\164\150\76\74\x74\150\x3e\x43\x6f\162\164\145\74\57\164\150\76\x3c\x74\x68\76\116\x6f\155\142\162\145\74\57\164\x68\76\74\x74\150\x3e\115\x6f\156\x65\x64\141\74\x2f\x74\150\x3e\x3c\164\x68\x3e\103\157\x6e\x73\165\x6d\x69\144\157\74\x2f\164\150\x3e\x3c\x74\150\76\124\x6f\164\141\154\x3c\x2f\164\x68\76\74\x74\150\x3e\116\x63\x6f\156\x74\x72\157\154\x3c\x2f\164\150\76\74\164\x68\76\105\x73\164\141\x74\165\x73\x3c\57\164\150\x3e\74\57\x74\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $bd = $this->db->query("\123\x45\x4c\x45\103\124\x20\123\125\115\50\x63\x6f\x6e\163\165\x6d\x69\x64\x6f\x2a\143\157\163\164\x6f\51\40\x74\157\x74\141\x6c\40\x46\x52\117\115\40\x63\x6f\x6e\x73\x69\147\x6f\162\x64\x63\40\127\x48\x45\x52\x45\x20\157\x72\144\143\75\x27{$dtfac->ordc}\x27\40\x26\x26\40\x66\x65\x63\x68\x61\75\47{$dtfac->fecha}\47\40\x47\122\117\125\x50\40\x42\131\40\x69\164\157\x72\x64\143")->result(); $tot = 0; foreach ($bd as $dt) { $tot += $dt->total; } if ($dtfac->ncontrol == "\116\x2f\101") { $color = "\143\154\141\163\x73\x3d\42\167\63\55\162\x65\144\42"; $status = "\x50\x65\x6e\x64\x69\145\x6e\164\145"; } else { $color = "\x63\x6c\141\163\x73\75\x22\x77\63\x2d\x67\162\145\x65\x6e\x22"; $status = "\114\151\163\x74\x6f"; } $html .= "\x3c\x74\162\40\x69\x64\x3d\x22\163\154\x65\x63\164" . $i . "\42\x20\x63\154\x61\163\163\75\x22\x69\x74\x65\x6d\x22\40\x6f\x6e\x63\x6c\x69\x63\153\x3d\42\151\164\x63\157\156\x73\x69\147\x28\x24\50\47\43\141" . $i . "\47\x29\x2e\166\x61\154\x28\51\x2c\44\x28\x27\x23\142" . $i . "\47\51\x2e\166\141\x6c\x28\x29\x29\x3b\42\76"; $html .= "\74\x69\156\160\x75\x74\x20\x74\171\160\x65\75\x22\x68\151\144\144\x65\156\x22\x20\x69\144\75\42\x61" . $i . "\x22\40\156\141\155\x65\75\x22\157\162\x64\145\156\42\x20\166\141\x6c\165\x65\75\x22" . $dtfac->ordc . "\42\x3e\x3c\151\156\160\165\164\40\x74\171\160\x65\75\x22\x68\151\x64\144\145\156\42\40\151\144\75\42\142" . $i . "\x22\40\x6e\141\155\145\x3d\x22\x63\157\x72\164\145\x22\40\x76\141\x6c\165\145\75\x22" . $dtfac->fecha . "\42\x3e\xa\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\40\74\164\x64\x3e\74\151\156\160\x75\x74\40\164\171\160\x65\x3d\x22\143\x68\x65\143\153\142\157\170\x22\x20\157\x6e\143\154\x69\x63\x6b\x3d\42\167\x33\56\x74\157\x67\147\x6c\x65\x43\x6c\x61\163\163\50\47\43\163\154\x65\x63\x74" . $i . "\x27\54\47\x77\63\55\171\x65\154\x6c\157\167\47\x29\x3b\42\x20\x63\154\141\x73\163\x3d\42\x77\x33\x2d\x63\150\x65\143\x6b\42\x20\x6e\x61\155\145\x3d\x22\x63\150\145\143\153\x22\x3e" . $dtfac->ordc . "\74\x2f\x74\x64\x3e\74\164\144\76" . $dtfac->fecha . "\74\57\164\144\x3e\74\x74\x64\76" . $dtfac->nombre . "\x3c\57\x74\144\x3e\74\164\144\76" . $dtfac->moneda . "\x3c\x2f\x74\x64\x3e\x3c\164\144\76" . $dtfac->cons . "\x3c\x2f\x74\x64\x3e\74\164\x64\x3e" . $tot . "\x3c\57\164\144\76\x3c\164\x64\x3e" . $dtfac->ncontrol . "\x3c\x2f\x74\144\x3e\x3c\164\144\x20" . $color . "\x3e" . $status . "\74\57\x74\x64\76\xa\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\74\57\x74\x72\x3e"; } $html .= "\x3c\x2f\x74\x61\x62\x6c\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\40\x20\40\40\x20\40\x20\40\40\x20\40\74\x73\x63\162\151\160\x74\x20\164\x79\x70\x65\75\42\164\145\170\164\57\x6a\x61\x76\141\x73\143\x72\x69\160\164\42\x3e\12\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\146\165\156\143\x74\151\x6f\x6e\x20\104\x65\143\x72\145\x6d\145\x6e\164\x4e\x75\x6d\x28\51\x7b\40\142\145\146\x6f\x72\145\50\51\73\xa\40\40\40\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x76\x61\x72\x20\x44\145\143\162\x65\x6d\x65\x6e\164\116\165\x6d\x3d\144\157\143\x75\x6d\145\156\164\x2e\x67\x65\x74\105\154\145\155\145\156\x74\x42\x79\111\x64\x28\x22\104\145\x63\162\145\155\145\x6e\x74\x4e\x75\x6d\x22\x29\56\166\141\154\165\145\x3b\12\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x76\141\162\40\x6b\x65\x79\75\x22\x64\162\157\151\144\71\60\x33\x22\73\xa\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\166\141\162\40\x64\141\x74\x6f\x73\x20\75\40\x7b\12\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\42\160\x61\x67\x22\40\72\40\x44\145\143\162\x65\155\145\156\164\116\x75\x6d\x2c\12\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\40\x20\40\x22\x6b\x65\171\42\40\72\x20\x6b\145\x79\12\40\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x7d\x3b\xa\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\12\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x24\56\x61\152\141\x78\x28\173\xa\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\x64\141\x74\x61\72\x20\144\x61\164\157\x73\x2c\xa\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x75\162\154\x3a\x20\40\142\x61\163\145\165\x72\154\53\x22\143\137\x64\162\157\151\144\x2f\143\157\156\x73\151\147\157\162\144\143\x22\x2c\12\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\40\40\164\x79\x70\x65\72\40\42\120\x4f\x53\x54\42\54\xa\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\x73\x75\143\143\x65\163\x73\72\x20\146\x75\x6e\x63\164\151\157\156\50\144\141\x74\141\51\x20\x7b\12\x20\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x24\50\x22\x23\x62\157\x64\x79\x22\51\x2e\x68\164\155\154\50\x64\x61\164\141\x29\x3b\40\x73\167\x61\x6c\56\x63\154\x6f\163\x65\50\x29\73\12\x20\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\40\175\xa\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\12\40\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\40\x7d\x29\x3b\12\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\x7d\xa\x20\x20\x20\x20\x20\40\40\40\40\40\x20\x20\xa\x20\x20\40\40\40\40\40\x20\40\x20\x20\40\x20\40\40\146\x75\x6e\x63\x74\x69\x6f\156\40\156\x75\x6d\160\141\x67\x28\141\x29\173\40\x62\x65\x66\157\x72\145\x28\51\73\xa\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\x76\141\162\40\x6b\145\171\75\42\x64\162\157\151\144\x39\60\63\x22\x3b\xa\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\xa\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\166\x61\162\40\144\x61\x74\157\163\40\x3d\x20\x7b\xa\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\42\153\145\171\42\x3a\x6b\x65\171\x2c\12\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\x20\x20\x20\42\160\141\x67\42\x20\x3a\x20\x61\12\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x7d\x3b\12\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\xa\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x24\56\x61\152\141\x78\x28\x7b\12\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\144\141\x74\141\72\40\x64\141\x74\x6f\x73\54\12\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\165\x72\x6c\72\40\142\x61\x73\145\165\x72\154\x2b\42\x63\x5f\x64\162\x6f\x69\144\57\143\x6f\x6e\x73\151\x67\157\x72\144\143\42\x2c\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\40\40\164\171\160\x65\x3a\x20\42\120\117\x53\x54\42\x2c\12\40\40\40\40\40\40\x20\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x73\x75\x63\143\x65\x73\x73\72\x20\146\x75\x6e\x63\164\x69\157\x6e\x28\x64\x61\164\141\51\x20\173\xa\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\44\x28\x22\43\x62\x6f\x64\171\x22\x29\x2e\x68\x74\155\x6c\50\144\x61\x74\x61\x29\73\40\163\167\x61\x6c\56\x63\154\157\x73\x65\50\x29\x3b\12\40\40\x20\x20\40\40\40\40\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\175\12\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\12\40\x20\40\40\40\40\x20\40\40\40\40\40\x20\x20\x20\40\40\x20\40\x7d\51\73\xa\x20\40\x20\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\x7d\12\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\12\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\146\165\x6e\x63\164\151\x6f\x6e\40\x49\156\143\162\151\155\145\x6e\x74\x4e\165\155\x28\x29\x7b\40\142\145\x66\x6f\162\x65\50\51\73\xa\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\40\166\x61\x72\x20\111\x6e\x63\x72\x69\155\x65\x6e\164\x4e\165\x6d\x3d\x64\157\143\165\155\x65\x6e\164\56\x67\x65\x74\105\154\145\155\x65\x6e\x74\102\x79\x49\144\x28\42\111\156\x63\162\151\155\145\156\x74\x4e\x75\155\x22\x29\x2e\166\141\x6c\x75\145\73\xa\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\40\166\x61\x72\40\153\145\171\x3d\42\x64\x72\157\151\144\x39\x30\63\42\x3b\xa\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\166\141\x72\x20\x64\141\164\157\163\40\75\x20\x7b\12\40\40\x20\x20\40\x20\40\40\x20\40\40\40\40\x20\40\40\40\40\40\x20\40\x20\40\40\42\153\145\171\42\x3a\153\x65\x79\x2c\xa\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\42\160\x61\x67\x22\40\x3a\x20\111\x6e\x63\x72\x69\155\145\156\164\116\x75\155\xa\x20\40\40\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\40\40\175\x3b\12\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\40\40\12\40\40\40\x20\x20\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x24\56\141\x6a\141\x78\x28\173\xa\x20\x20\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\x64\141\164\141\72\40\x64\x61\164\x6f\x73\x2c\12\x20\40\40\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x75\x72\154\x3a\x20\40\x62\x61\163\x65\x75\x72\154\53\x22\x63\x5f\x64\x72\x6f\x69\144\x2f\143\157\156\x73\151\x67\x6f\162\144\143\42\x2c\12\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\40\164\x79\x70\x65\72\40\42\120\x4f\x53\x54\42\54\xa\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\40\x20\x20\40\x73\165\x63\x63\145\163\163\72\40\146\x75\x6e\143\164\151\x6f\156\50\144\141\x74\141\x29\x20\x7b\xa\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\40\40\x20\40\44\50\x22\x23\142\157\144\x79\x22\x29\x2e\150\x74\x6d\x6c\50\144\x61\164\x61\x29\x3b\x20\x73\167\141\154\x2e\143\154\x6f\x73\x65\50\51\73\12\40\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\175\12\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\40\12\40\40\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x7d\51\73\xa\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x7d\xa\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\74\57\x73\x63\162\x69\x70\x74\x3e\xa\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\74\x64\x69\x76\x20\143\x6c\141\163\x73\75\42\x77\x33\55\142\141\x72\40\x77\63\55\x62\x6f\x72\x64\145\x72\x20\x77\63\55\x62\x61\162\162\141\x73\42\76\xa\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x3c\x69\156\x70\x75\164\x20\164\171\x70\145\75\x22\150\x69\x64\x64\x65\x6e\x22\x20\151\x64\75\x22\104\145\x63\x72\145\x6d\x65\x6e\164\x4e\165\x6d\x22\x20\166\141\154\x75\145\75\x22" . $DecrementNum . "\x22\x3e\12\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\74\141\x20\157\156\143\154\x69\143\x6b\75\42\x44\145\x63\x72\145\155\145\x6e\164\x4e\x75\155\x28\51\x3b\x22\40\x63\x6c\x61\x73\x73\75\x22\x77\63\x2d\142\x61\x72\55\x69\x74\x65\155\40\x77\x33\55\142\165\164\164\x6f\x6e\x22\x3e\x26\x6c\x61\161\165\157\x3b\74\57\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\144\x70\141\147\151\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\63\x2d\x66\x6f\x6e\x64\x6f\144\162\157\151\x64"; $html .= "\12\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\x3c\151\156\x70\x75\x74\x20\x74\x79\x70\x65\x3d\42\x68\x69\x64\144\x65\156\x22\40\x69\x64\75\42" . $id . "\42\x20\x76\x61\154\165\145\x3d\x22" . $i . "\42\x3e\xa\x20\x20\40\40\x20\40\40\40\40\40\x20\x20\74\x61\x20\157\x6e\143\x6c\151\143\x6b\75\42\x6e\x75\x6d\x70\x61\x67\50\x24\50\47\43" . $id . "\47\51\56\x76\141\154\x28\x29\51\x3b\x22\x20\x63\x6c\141\163\163\x3d\42\x77\x33\55\x62\x61\162\55\x69\164\145\x6d\x20\167\x33\55\x62\165\x74\x74\157\156\40" . $hover . "\x22\76" . $i . "\74\57\x61\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\160\x75\x74\40\x74\171\x70\145\x3d\x22\150\151\144\144\145\156\42\40\x69\144\75\x22" . $id . "\x22\40\x76\141\x6c\165\145\75\x22" . $i . "\x22\x3e\xa\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\74\x61\40\157\156\x63\x6c\x69\x63\153\x3d\x22\x6e\165\155\x70\141\147\50\44\50\47\43" . $id . "\47\51\x2e\166\141\x6c\50\51\x29\73\42\x20\143\154\141\x73\163\75\42\x77\x33\55\x62\x61\x72\x2d\151\x74\145\155\x20\x77\63\x2d\142\165\164\164\157\x6e\40" . $hover . "\42\x3e" . $i . "\74\57\141\76"; } } } $html .= "\74\x69\156\160\x75\164\40\164\171\160\145\75\x22\x68\151\144\144\145\x6e\42\40\x69\144\x3d\42\x49\x6e\143\x72\151\x6d\x65\x6e\164\x4e\x75\x6d\x22\x20\166\x61\154\x75\145\x3d\42" . $IncrimentNum . "\42\76\12\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x3c\x61\x20\x6f\156\143\154\151\x63\153\x3d\x22\x49\156\x63\x72\151\155\145\x6e\x74\116\165\x6d\50\51\x3b\42\40\143\154\141\x73\163\75\42\x77\63\55\142\x61\x72\x2d\151\x74\x65\x6d\x20\167\x33\55\142\165\x74\x74\x6f\156\x22\x3e\x26\162\141\161\165\157\x3b\x3c\57\141\76\xa\x20\x20\40\40\12\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\74\x2f\x64\x69\166\76\x20"; return $html; } public function itconsig($a, $b) { $this->load->library("\x74\141\142\154\x65"); $bdfac = $this->db->query("\x53\105\114\x45\103\x54\40\142\56\143\x6f\144\151\147\157\x2c\x62\56\154\x6f\164\145\54\x62\x2e\143\x61\156\x74\54\x61\x2e\143\157\156\163\165\155\x69\144\157\x2c\141\x2e\x64\x65\166\165\145\x6c\164\141\x2c\x61\56\x63\x6f\163\164\x6f\54\x28\141\x2e\x63\x6f\156\163\x75\x6d\151\144\157\52\141\56\x63\x6f\x73\x74\157\51\40\x74\x6f\164\141\154\40\106\x52\x4f\x4d\x20\143\157\x6e\x73\x69\147\157\x72\144\143\40\x61\x20\112\x4f\x49\x4e\x20\151\x74\157\x72\x64\x63\x20\142\40\x4f\x4e\40\141\x2e\x69\x74\x6f\x72\x64\143\x3d\142\56\151\x64\40\127\x48\105\122\105\x20\x61\56\x6f\162\144\143\75\47{$a}\x27\x20\x26\46\x20\x61\56\146\x65\x63\150\141\75\47{$b}\47\x20\107\122\x4f\125\x50\40\102\131\40\141\x2e\151\x74\157\162\x64\143")->result(); $html = "\xa\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\40\74\164\x61\142\x6c\145\x20\x69\144\75\42\x69\x64\x30\x31\x22\x20\143\154\141\x73\163\75\42\x77\63\55\x74\141\142\154\x65\55\141\154\154\40\x77\x33\x2d\x68\x6f\x76\145\162\x61\142\x6c\145\x20\167\63\55\154\x65\146\164\x2d\141\154\x69\x67\x6e\40\167\63\x2d\x74\151\156\x79\x22\76\74\x74\x72\40\x63\154\x61\x73\x73\75\x22\167\63\55\x66\x6f\x6e\144\x6f\144\162\x6f\151\x64\x22\x3e\x3c\164\x68\x3e\x43\x6f\x64\x69\147\157\74\57\x74\150\x3e\x3c\164\150\76\x4c\x6f\x74\x65\74\x2f\164\x68\76\74\164\150\76\x43\141\156\x74\151\144\x61\144\x3c\x2f\164\150\x3e\74\x74\150\76\x43\x6f\156\x73\x75\155\x69\144\x6f\74\57\164\x68\76\74\164\x68\76\x44\x65\166\x75\x65\154\x74\x61\74\57\164\150\76\x3c\x74\150\x3e\x43\x6f\x73\x74\x6f\x3c\57\x74\150\76\74\x74\x68\x3e\124\x6f\164\141\154\74\57\x74\150\76\x3c\57\x74\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\x74\162\76"; $html .= "\74\151\x6e\160\x75\164\40\x74\x79\x70\145\x3d\42\150\x69\144\x64\x65\156\x22\40\151\144\75\42\141" . $i . "\x22\x20\x6e\x61\x6d\145\x3d\x22\144\x6f\x63\42\x20\x76\141\154\165\145\75\42" . $dtfac->id . "\42\76\12\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x3c\x74\144\x3e" . $dtfac->codigo . "\74\x2f\x74\144\76\74\164\144\x3e" . $dtfac->lote . "\74\57\164\x64\x3e\x3c\x74\x64\76" . $dtfac->cant . "\74\x2f\x74\x64\x3e\74\x74\144\76" . $dtfac->consumido . "\x3c\x2f\164\144\x3e\74\164\144\76" . $dtfac->devuelta . "\x3c\57\164\144\x3e\74\x74\x64\x3e" . $dtfac->costo . "\74\57\x74\144\76\74\x74\x64\x3e" . $dtfac->total . "\74\57\x74\x64\76\xa\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\74\57\164\162\76"; } $html .= "\x3c\57\164\x61\x62\x6c\145\x3e"; return $html; } public function regncontrol($a, $b, $c) { $this->db->query("\x55\120\104\x41\124\105\40\143\x6f\156\x73\151\x67\157\x72\144\143\x20\163\x65\x74\x20\x6e\x63\x6f\156\164\x72\x6f\154\x3d\x27{$c}\47\40\x57\x48\105\x52\105\40\x6f\162\x64\143\x3d\47{$a}\47\x20\x26\x26\x20\x66\145\143\x68\x61\75\x27{$b}\47"); return $this->db->affected_rows(); } function exportexcelconsig($a, $b) { return $this->db->query("\x53\x45\114\105\x43\124\40\142\56\143\x6f\144\x69\x67\157\x2c\x62\x2e\154\157\x74\x65\x2c\x62\56\143\141\156\164\x2c\x61\x2e\143\x6f\156\163\165\155\x69\x64\x6f\54\x61\x2e\144\145\x76\165\x65\x6c\164\141\x2c\x64\56\x6d\x6f\x6e\145\144\141\54\141\x2e\143\x6f\x73\164\157\54\50\141\x2e\143\x6f\156\x73\165\155\x69\x64\157\52\x61\x2e\x63\157\x73\164\x6f\x29\40\164\x6f\164\x61\154\x20\x46\122\x4f\x4d\x20\x63\x6f\x6e\163\x69\x67\157\x72\144\x63\40\x61\x20\xa\x20\40\x20\40\40\x20\40\40\40\x20\40\40\x4a\x4f\111\116\x20\x69\x74\x6f\162\x64\x63\40\x62\40\117\x4e\x20\x61\56\x69\x74\x6f\162\144\143\x3d\x62\x2e\151\144\40\112\x4f\x49\x4e\40\157\x72\144\x63\x20\143\x20\117\116\40\143\56\151\144\x3d\141\56\x6f\162\144\143\x20\x4a\x4f\x49\x4e\40\x70\x72\157\x76\x65\x65\x64\x20\x64\40\x4f\116\40\144\x2e\151\x64\x3d\143\56\x70\162\x6f\166\145\145\x64\xa\x20\x20\40\40\x20\40\40\40\x20\x20\40\x20\x57\110\x45\x52\x45\40\x61\56\157\x72\144\143\75\x27{$a}\x27\x20\46\x26\40\x61\x2e\146\x65\143\x68\141\x3d\x27{$b}\47\x20\107\122\117\x55\x50\40\102\131\40\141\x2e\x69\x74\157\162\x64\143"); } public function kardex($a, $b) { $this->load->library("\x74\141\x62\154\x65"); if ($b != '') { $filter = "\x57\x48\105\122\x45\x20\50\x61\x2e\x63\157\144\x69\x67\157\141\x72\x74\75\x27{$b}\x27\x20\x7c\x7c\x20\x62\x2e\156\157\x6d\142\x72\145\40\x6c\151\153\145\40\47\x25{$b}\x25\47\x29"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\114\105\x43\x54\40\x4e\x55\x4c\x4c\40\x46\x52\x4f\x4d\x20\50\x53\105\114\105\103\124\x20\x4e\x55\114\x4c\x20\x46\122\117\x4d\x20\x61\x72\164\x69\x6c\157\x74\145\x73\x20\x61\x20\x4a\117\x49\116\40\x61\162\164\151\143\165\154\x6f\x20\x62\x20\117\x4e\40\x61\x2e\143\157\144\151\147\157\141\x72\164\x3d\x62\x2e\x63\x6f\144\151\x67\x6f\40" . $filter . "\x29\x20\153\x61\162\144\145\170\40")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\x4c\105\x43\x54\x20\141\154\x6d\x61\x63\x65\x6e\54\x63\x6f\x64\x69\147\157\141\162\164\54\156\157\x6d\x62\x72\x65\54\x6c\157\x74\x65\x2c\x63\x61\x72\147\x6f\53\143\141\x72\x67\157\62\40\143\141\162\x67\157\54\x64\145\163\x63\x61\x72\x67\x6f\x2b\x64\145\x73\x63\x61\162\147\157\62\40\144\x65\163\143\141\162\x67\x6f\54\151\x6e\x67\x72\145\163\x6f\54\145\x67\162\x65\163\157\x2c\144\x65\166\x75\145\x6c\x74\141\x2c\x20\x49\106\x28\50\x63\x61\162\x67\157\53\x63\141\162\x67\157\62\55\144\x65\x73\143\x61\x72\x67\157\x2d\x64\145\x73\143\141\x72\147\x6f\x32\x2b\x69\x6e\x67\x72\145\x73\157\55\x65\147\x72\145\163\157\53\144\x65\166\165\x65\x6c\164\141\51\76\x30\54\x28\x63\141\162\x67\x6f\x2b\x63\x61\x72\147\157\62\55\x64\145\x73\143\x61\x72\147\x6f\55\x64\x65\x73\x63\141\x72\x67\157\62\x2b\x69\156\x67\x72\x65\163\x6f\x2d\145\x67\x72\145\x73\x6f\53\144\x65\166\165\x65\x6c\164\141\51\54\60\51\x20\x65\x78\151\x73\x74\145\x6e\x20\106\x52\x4f\x4d\40\50\xa\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\123\x45\x4c\105\103\124\40\x61\x2e\141\154\155\141\143\x65\x6e\x2c\x61\56\x63\x6f\144\151\147\157\141\x72\164\54\x62\56\156\x6f\x6d\x62\x72\x65\x2c\141\x2e\154\x6f\164\145\54\xa\40\40\40\x20\x20\40\40\40\40\40\40\x20\111\x46\x28\50\123\x45\x4c\105\103\x54\x20\x53\125\x4d\50\143\141\x6e\164\x29\40\x46\122\x4f\115\x20\x61\x6a\x75\x73\164\x65\151\x6e\166\x20\x57\110\x45\x52\105\40\144\141\154\155\75\141\x2e\141\x6c\x6d\x61\143\145\156\x20\46\x26\x20\143\x6f\144\151\x67\x6f\x3d\x61\x2e\x63\x6f\144\x69\147\157\141\162\164\x20\x26\x26\x20\144\154\157\x74\145\75\141\56\154\x6f\x74\x65\40\46\x26\x20\164\x69\x70\x6f\x3d\x31\x20\46\46\40\146\145\143\150\76\x27\62\60\x32\x33\x2d\x31\62\55\62\71\x27\x29\x3e\x30\54\50\x53\x45\x4c\x45\x43\x54\40\123\x55\115\x28\143\x61\156\164\51\x20\x46\x52\x4f\x4d\x20\141\x6a\165\x73\x74\x65\151\156\x76\40\127\110\105\x52\x45\40\x64\x61\x6c\155\75\141\56\141\154\x6d\141\143\x65\156\x20\46\x26\x20\143\157\144\151\147\x6f\x3d\141\56\x63\157\x64\151\x67\157\x61\162\164\40\46\46\x20\x64\x6c\x6f\164\x65\x3d\141\56\x6c\x6f\x74\x65\x20\x26\x26\40\x74\x69\x70\157\x3d\61\x20\46\x26\x20\x66\x65\x63\x68\x3e\47\x32\60\x32\x33\55\x31\62\x2d\62\x39\47\x29\x2c\60\51\x20\x63\x61\162\x67\x6f\x2c\xa\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x49\106\x28\x28\123\x45\x4c\105\x43\x54\x20\123\x55\115\x28\x63\x61\x6e\164\51\x20\106\122\x4f\x4d\40\141\152\x75\x73\164\x65\151\156\166\x20\x57\x48\105\x52\x45\x20\144\141\154\x6d\75\x61\56\x61\x6c\155\141\x63\145\x6e\x20\x26\x26\40\143\x6f\x64\x69\x67\x6f\x3d\x61\x2e\143\157\x64\151\147\157\141\162\x74\x20\x26\x26\40\x64\154\x6f\x74\x65\x3d\x61\56\154\x6f\164\145\40\46\46\x20\164\151\160\157\x3d\x33\x20\46\46\x20\146\x65\x63\150\76\47\62\60\x32\63\x2d\61\62\x2d\x32\71\x27\x29\x3e\x30\x2c\50\x53\x45\x4c\x45\103\124\40\123\125\x4d\50\143\141\156\x74\x29\40\x46\x52\x4f\115\40\141\x6a\165\163\x74\x65\151\x6e\x76\x20\x57\x48\x45\x52\x45\40\x64\x61\x6c\155\75\141\56\x61\154\x6d\x61\x63\145\156\x20\x26\46\x20\143\157\144\151\147\x6f\x3d\141\x2e\x63\x6f\x64\x69\x67\x6f\x61\162\x74\40\x26\x26\x20\144\154\157\x74\x65\75\141\x2e\154\x6f\164\x65\40\46\46\x20\164\151\160\157\75\x33\x20\x26\46\x20\146\145\x63\150\x3e\x27\62\x30\62\63\x2d\61\x32\x2d\62\x39\x27\51\54\60\x29\x20\x63\x61\x72\147\157\x32\x2c\12\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\111\106\x28\x28\x53\x45\x4c\x45\103\x54\40\123\x55\115\50\x63\141\156\x74\51\x20\106\x52\117\115\40\x61\x6a\165\163\164\x65\151\x6e\166\x20\127\x48\x45\x52\105\x20\x64\x61\154\x6d\x3d\141\x2e\141\154\155\141\x63\145\x6e\40\46\46\x20\x63\x6f\144\x69\x67\157\x3d\x61\56\143\157\144\151\x67\157\141\x72\164\40\46\46\40\144\154\157\x74\145\x3d\141\56\154\x6f\x74\x65\x20\x26\x26\40\x74\x69\160\x6f\75\x30\x20\46\x26\40\146\x65\x63\150\x3e\x27\x32\60\62\x33\55\x31\62\55\x32\x39\x27\51\x3e\60\x2c\x28\x53\x45\114\105\103\x54\40\x53\125\x4d\50\x63\x61\x6e\164\51\x20\106\x52\117\x4d\40\141\x6a\x75\163\164\x65\x69\156\166\40\127\110\105\122\105\x20\x64\141\154\x6d\75\141\56\141\x6c\x6d\x61\x63\x65\156\x20\46\46\x20\x63\157\144\151\x67\x6f\75\x61\56\143\x6f\x64\x69\147\157\x61\162\x74\40\46\46\x20\144\x6c\x6f\164\x65\75\141\56\x6c\157\x74\x65\40\x26\x26\x20\164\x69\x70\157\75\x30\x20\x26\x26\x20\146\145\x63\150\x3e\47\x32\x30\x32\x33\x2d\x31\62\55\x32\71\x27\x29\x2c\60\x29\40\x64\x65\163\143\x61\162\147\157\x2c\12\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\x49\x46\50\50\x53\105\114\x45\x43\124\40\x53\x55\x4d\50\143\141\156\x74\x29\x20\106\122\x4f\x4d\40\x61\x6a\165\x73\164\145\151\x6e\x76\x20\127\x48\105\122\x45\40\141\x6c\x6d\75\x61\56\x61\x6c\155\141\143\x65\x6e\x20\46\46\x20\x63\x6f\144\151\147\x6f\75\141\x2e\143\x6f\x64\151\147\157\x61\x72\164\x20\x26\46\x20\154\157\164\145\75\x61\x2e\154\157\164\x65\40\46\46\x20\164\151\x70\157\75\x33\40\x26\46\40\146\x65\x63\150\x3e\47\x32\60\x32\x33\x2d\x31\x32\55\x32\x39\47\x29\76\x30\x2c\50\123\105\x4c\x45\x43\x54\40\x53\x55\x4d\50\143\x61\x6e\164\x29\x20\106\x52\x4f\x4d\40\141\152\165\163\x74\145\x69\x6e\166\40\x57\x48\105\x52\105\40\x61\x6c\x6d\x3d\x61\56\141\x6c\155\141\143\145\156\40\x26\x26\40\143\157\x64\151\147\x6f\x3d\141\x2e\x63\x6f\x64\x69\x67\x6f\141\x72\164\x20\46\46\x20\x6c\157\164\x65\x3d\x61\x2e\154\x6f\x74\145\40\x26\x26\x20\164\x69\x70\x6f\75\x33\40\46\46\x20\146\145\143\x68\x3e\47\x32\60\62\x33\55\61\x32\55\62\71\47\x29\x2c\60\51\x20\x64\x65\x73\x63\x61\x72\x67\x6f\x32\54\xa\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\111\x46\x28\50\x53\105\114\x45\x43\124\40\x53\x55\115\50\143\141\x6e\164\51\40\106\x52\x4f\115\40\151\164\157\x72\x64\143\40\141\61\x20\112\117\111\116\x20\157\x72\x64\x63\x20\142\61\x20\117\116\x20\x61\61\56\x6f\x72\x64\143\75\x62\x31\x2e\x69\144\x20\127\x48\x45\122\105\x20\142\x31\x2e\141\x6c\155\x61\143\145\156\x3d\x61\56\x61\154\155\141\x63\145\x6e\x20\46\46\40\x61\61\x2e\143\x6f\x64\x69\x67\157\75\141\x2e\x63\x6f\x64\151\147\157\141\x72\x74\x20\x26\46\40\154\157\164\x65\75\x61\x2e\154\157\x74\x65\40\46\x26\40\x62\61\x2e\146\162\x65\143\145\160\76\x27\62\60\62\63\x2d\61\x32\x2d\62\x39\x27\40\x26\x26\x20\x62\x31\56\163\164\141\164\165\x73\x3d\47\x31\47\51\76\x30\54\x28\123\x45\114\105\103\124\40\123\x55\x4d\50\x63\x61\156\x74\51\40\x46\x52\x4f\x4d\x20\x69\x74\157\x72\144\143\40\x61\x31\x20\112\117\x49\116\40\x6f\x72\x64\143\x20\142\61\x20\x4f\116\40\141\61\56\x6f\162\144\143\75\x62\61\56\151\144\x20\127\110\x45\122\x45\x20\142\x31\x2e\141\154\x6d\141\x63\x65\156\x3d\141\56\141\x6c\x6d\141\x63\145\x6e\40\x26\x26\40\141\x31\56\x63\x6f\144\151\147\157\x3d\x61\56\143\157\144\151\147\x6f\141\162\x74\x20\46\46\x20\x6c\157\x74\x65\x3d\x61\x2e\154\x6f\164\145\x20\46\x26\40\x62\61\x2e\x66\162\145\143\x65\x70\x3e\47\62\x30\62\x33\55\61\x32\55\x32\71\47\40\x26\46\40\x62\x31\x2e\x73\x74\141\x74\x75\163\75\x27\x31\47\51\x2c\x30\51\x20\x69\x6e\x67\162\145\163\157\54\12\40\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\x52\x4f\x55\x4e\x44\x28\x49\106\50\x28\x53\105\114\105\103\124\x20\123\125\x4d\x28\143\141\156\x74\151\144\x61\x64\51\40\106\122\x4f\115\x20\x6f\160\x65\x72\155\x76\x20\127\x48\105\x52\x45\40\141\x6c\155\x61\143\145\x6e\x3d\141\x2e\141\x6c\x6d\x61\143\x65\x6e\x20\x26\46\x20\143\x6f\x64\x69\x67\x6f\75\141\x2e\143\157\x64\x69\147\157\141\x72\164\40\x26\x26\40\154\x6f\x74\x65\x3d\141\56\154\x6f\164\x65\x20\x26\x26\40\x28\x74\x69\x70\157\144\157\x63\75\x27\x46\x41\103\47\40\x7c\x7c\x20\x74\151\160\x6f\144\x6f\143\75\x27\x4e\117\x54\47\51\40\46\46\x20\146\145\x63\x68\x61\x64\157\143\x3e\47\x32\60\x32\x33\x2d\61\x32\55\62\71\x27\51\76\x30\x2c\50\123\105\x4c\x45\x43\124\x20\123\125\x4d\x28\x63\x61\156\164\x69\144\141\x64\x29\x20\106\122\x4f\x4d\x20\x6f\160\145\x72\x6d\166\40\x57\x48\x45\x52\105\40\141\154\x6d\141\143\145\156\x3d\x61\56\141\x6c\x6d\x61\143\145\156\40\x26\x26\x20\143\x6f\x64\x69\147\x6f\x3d\x61\x2e\143\x6f\x64\151\147\x6f\x61\162\164\40\x26\x26\40\x6c\157\164\145\75\x61\56\154\157\x74\x65\x20\x26\x26\x20\50\164\x69\160\x6f\144\157\x63\75\x27\x46\101\x43\x27\x20\174\x7c\x20\x74\x69\160\157\144\x6f\143\75\47\116\x4f\124\47\x29\40\x26\46\x20\x66\145\x63\x68\x61\144\x6f\x63\x3e\x27\62\x30\62\63\x2d\x31\62\x2d\x32\71\x27\51\x2c\60\51\54\60\x29\40\x65\147\x72\145\163\157\x2c\xa\x20\x20\40\x20\x20\40\x20\40\40\40\40\40\122\117\x55\x4e\x44\50\x49\106\x28\50\x53\105\x4c\105\x43\x54\40\123\125\x4d\50\143\x6e\164\144\145\x76\165\145\154\164\x29\x20\106\122\117\x4d\40\x64\145\166\x6f\154\155\x76\40\x57\x48\x45\122\x45\x20\x61\x6c\155\x61\x63\145\156\75\x61\56\x61\x6c\155\x61\x63\145\x6e\x20\46\x26\40\x63\x6f\144\x69\x67\x6f\x3d\141\x2e\x63\x6f\x64\x69\x67\157\x61\x72\164\x20\x26\46\x20\x6c\157\164\145\75\141\56\154\157\164\145\x20\46\46\40\x74\151\160\x6f\x64\x6f\143\x3d\x27\104\x45\x56\47\40\x26\x26\x20\146\145\143\x68\x61\x64\x6f\143\x3e\x27\x32\x30\62\x33\x2d\x31\x32\55\x32\71\47\51\x3e\60\54\x28\123\x45\114\x45\103\x54\40\123\x55\x4d\50\143\156\x74\144\x65\x76\x75\x65\154\164\x29\x20\106\122\x4f\115\x20\144\x65\166\x6f\154\155\166\x20\127\110\105\x52\105\40\141\x6c\155\141\x63\145\156\x3d\x61\x2e\141\154\x6d\x61\x63\145\156\x20\46\46\x20\143\157\x64\x69\x67\x6f\x3d\x61\x2e\143\157\144\151\x67\157\141\x72\x74\40\46\46\40\x6c\x6f\164\x65\x3d\x61\x2e\x6c\x6f\x74\145\x20\x26\46\x20\164\x69\160\x6f\x64\157\x63\x3d\x27\x44\x45\x56\x27\40\x26\x26\40\x66\x65\x63\x68\141\144\157\x63\76\x27\62\x30\62\x33\x2d\x31\62\x2d\x32\x39\x27\x29\x2c\x30\51\x2c\x30\x29\40\x64\145\x76\x75\x65\154\164\x61\40\12\40\x20\x20\40\40\40\40\40\x20\40\40\40\x46\x52\x4f\115\x20\x61\x72\164\151\154\157\164\145\163\40\141\x20\112\117\x49\116\40\x61\x72\164\x69\143\x75\154\x6f\40\142\x20\117\x4e\40\x61\56\x63\157\x64\x69\x67\157\141\162\164\75\142\56\x63\x6f\144\151\147\157\x20" . $filter . "\x20\x47\122\117\x55\120\40\102\131\40\141\x2e\x61\154\155\141\143\x65\x6e\54\x61\x2e\x63\157\x64\151\147\x6f\141\162\164\54\x61\x2e\154\157\164\145\51\40\x6b\141\x72\x64\x65\170\40\x20\x4c\111\115\111\124\40" . ($a - 1) * $mostrar . "\40\54\40" . $mostrar . "\73")->result(); $html = "\xa\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\40\74\x74\141\142\154\x65\x20\143\154\x61\163\x73\x3d\42\167\x33\x2d\x74\141\x62\154\x65\x2d\141\x6c\154\x20\x77\63\55\x68\157\x76\x65\x72\x61\142\x6c\145\x20\167\63\x2d\154\145\x66\164\55\x61\x6c\151\x67\x6e\42\76\xa\40\40\40\x20\40\x20\x20\40\40\x20\x20\40\x3c\x74\162\76\74\x74\x64\x20\143\x6c\141\x73\163\x3d\42\167\63\55\x66\157\156\144\157\x64\x72\x6f\x69\x64\42\x3e\x42\x75\163\143\141\x72\x20\74\x69\x6d\x67\40\x73\x72\x63\75\x22" . base_url() . "\x69\x6d\141\x67\x65\x73\x2f\x62\x75\x73\143\x61\x72\x2e\160\156\x67\42\x20\x61\154\164\75\42\102\x75\163\143\x61\x72\42\40\164\x69\164\x6c\145\75\x22\102\165\x73\x63\141\x72\42\40\163\x74\x79\x6c\145\75\42\x77\x69\x64\x74\x68\72\x31\x38\x70\x78\x3b\x62\x6f\x72\x64\x65\x72\x3a\60\73\42\x3e\74\57\164\x64\76\12\x20\40\x20\x20\x20\x20\40\40\40\40\40\40\x3c\x74\144\76\x3c\151\156\x70\x75\164\40\164\171\x70\145\x3d\42\164\145\170\x74\x22\x20\x63\x6c\x61\x73\163\x3d\42\x77\63\x2d\x69\x6e\160\x75\x74\x22\40\x70\154\x61\143\x65\x68\157\x6c\x64\145\x72\75\x22\x49\156\147\162\x65\x73\145\x20\x73\165\x20\x62\165\163\x71\165\x65\144\141\42\x20\x6f\x6e\x63\x68\141\156\x67\145\75\42\153\x61\162\144\x65\x78\50\51\42\x20\x69\x64\x3d\42\154\151\153\x65\x22\x3e\74\57\x74\144\76\xa\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\74\x21\55\x2d\x3c\164\144\76\x3c\151\x6e\x70\165\x74\40\x74\171\160\x65\x3d\x22\144\141\x74\145\x22\x20\x63\154\141\163\x73\x3d\x22\x77\63\55\151\156\160\165\164\42\40\151\144\x3d\x22\146\x64\145\x73\x64\145\42\76\x3c\x69\x6e\x70\165\x74\x20\x74\x79\160\145\75\x22\x64\141\164\x65\x22\40\x63\x6c\x61\x73\163\75\x22\167\63\x2d\151\x6e\160\165\x74\x22\40\x69\144\x3d\42\x66\150\141\x73\164\141\42\76\x3c\57\164\144\x3e\55\x2d\76\12\x20\40\40\x20\40\40\40\40\40\40\40\x20\x3c\x74\x64\40\x63\x6c\x61\163\163\75\42\x77\x33\x2d\x63\145\x6e\164\x65\162\40\167\63\55\142\164\156\42\76\74\141\40\157\x6e\x63\x6c\151\x63\x6b\75\x22\153\x61\162\x64\x65\170\50\x29\73\x22\76\x3c\x69\x6d\147\40\163\x72\x63\x3d\42" . base_url() . "\x69\155\141\x67\145\163\x2f\162\145\x6c\x6f\141\x64\56\x70\156\x67\x22\40\141\x6c\x74\x3d\42\122\145\143\141\x72\x67\141\162\x22\x20\x74\x69\164\154\x65\x3d\42\x52\145\x63\x61\162\x67\x61\x72\x22\40\163\x74\x79\x6c\145\75\x22\x77\151\x64\164\x68\72\x32\60\160\170\x3b\150\x65\151\x67\x68\x74\72\x32\x30\160\x78\73\142\x6f\162\144\x65\162\72\60\73\42\x3e\74\57\141\x3e\74\57\x74\144\76\xa\40\x20\x20\40\40\x20\40\40\x20\40\40\40\74\57\x74\162\76\x3c\x2f\x74\141\142\x6c\145\76\74\142\x72\x3e\12\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\74\164\x61\142\x6c\x65\40\151\144\75\x22\x69\x64\60\x31\42\x20\x63\154\141\x73\163\x3d\42\x77\x33\55\x74\x61\142\154\x65\x2d\x61\x6c\154\x20\167\63\x2d\x68\157\x76\145\162\141\142\x6c\145\40\167\x33\x2d\154\145\146\x74\x2d\141\x6c\x69\147\156\40\x77\63\x2d\164\151\156\x79\x22\x3e\x3c\x74\162\x20\x63\154\x61\x73\163\x3d\42\x77\63\x2d\x66\157\x6e\x64\157\x64\x72\157\x69\144\x22\76\x3c\164\x68\x3e\x41\154\x6d\141\x63\x65\x6e\74\57\164\x68\x3e\x3c\164\150\x3e\x43\x6f\144\x69\x67\x6f\74\57\164\x68\76\x3c\x74\x68\76\x4e\x6f\x6d\142\162\145\x3c\x2f\x74\150\76\x3c\164\150\76\114\157\164\145\x3c\x2f\x74\150\x3e\x3c\164\150\x3e\103\141\x72\147\157\x3c\x2f\x74\150\x3e\x3c\x74\x68\76\x44\x65\x73\x63\x61\162\x67\x6f\x3c\x2f\164\x68\76\74\x74\150\x3e\x49\156\x67\x72\x65\x73\x6f\74\57\164\150\x3e\12\x20\x20\40\40\40\40\40\x20\x20\x20\x20\40\74\x74\x68\76\105\x67\x72\x65\163\x6f\x3c\x2f\x74\x68\x3e\x3c\x74\150\x3e\x44\x65\166\x75\145\154\x74\141\74\x2f\x74\x68\76\x3c\x74\150\76\x45\x78\151\x73\164\x65\x6e\x3c\x2f\x74\x68\76\x3c\57\x74\x72\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\x74\162\x3e"; if ($dtfac->existen > 0) { $color = "\167\x33\x2d\147\x72\145\145\x6e"; } else { $color = "\x77\63\55\162\x65\144"; } $html .= "\x3c\x69\x6e\x70\x75\164\40\x74\x79\x70\145\75\42\x68\151\144\144\145\156\x22\40\151\144\x3d\42\141" . $i . "\42\40\156\141\155\x65\75\x22\143\x6f\x64\x69\x67\157\x22\x20\x76\141\x6c\x75\x65\x3d\42" . $dtfac->codigoart . "\42\x3e\x20\x3c\x69\x6e\160\x75\164\40\164\x79\x70\x65\75\42\x68\151\x64\144\145\x6e\42\x20\x69\144\75\42\141" . $i . "\42\x20\156\141\155\145\x3d\42\141\x6c\155\x61\x63\145\156\x22\x20\166\141\154\x75\x65\x3d\x22" . $dtfac->almacen . "\x22\76\xa\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x3c\x69\x6e\160\x75\164\40\x74\171\160\x65\x3d\x22\x68\x69\144\144\x65\x6e\42\x20\x69\144\x3d\x22\141" . $i . "\42\40\156\x61\155\145\x3d\42\x6c\x6f\164\x65\x22\40\166\x61\x6c\165\x65\x3d\42" . $dtfac->lote . "\42\x3e\12\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x3c\164\x64\76" . $dtfac->almacen . "\74\57\164\x64\x3e\74\x74\x64\x3e" . $dtfac->codigoart . "\x3c\x2f\x74\x64\76\74\164\144\x3e" . $dtfac->nombre . "\74\57\164\x64\x3e\x3c\164\x64\76" . $dtfac->lote . "\74\57\164\144\x3e\74\164\144\40\163\164\x79\154\x65\75\42\143\165\162\163\x6f\162\72\x70\157\151\156\164\145\x72\73\x22\40\x6f\156\x63\x6c\x69\x63\153\75\42\x69\x74\x6b\141\x72\x64\145\x78\50" . $i . "\x2c\x31\51\73\x22\76" . $dtfac->cargo . "\x3c\x2f\164\144\76\74\x74\x64\40\163\x74\x79\154\x65\75\x22\x63\x75\x72\x73\157\x72\72\x70\157\151\x6e\164\145\162\x3b\x22\x20\x6f\156\143\x6c\x69\143\153\75\x22\x69\164\x6b\x61\x72\x64\145\170\x28" . $i . "\54\62\51\x3b\x22\76" . $dtfac->descargo . "\74\x2f\164\x64\x3e\12\x20\40\x20\x20\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\x3c\x74\144\40\x73\x74\x79\x6c\x65\75\42\x63\x75\162\163\x6f\162\72\160\x6f\151\x6e\164\x65\x72\x3b\x22\40\157\x6e\x63\154\x69\143\153\x3d\x22\x69\164\153\141\162\144\x65\x78\x28" . $i . "\54\63\51\x3b\42\x3e" . $dtfac->ingreso . "\74\57\164\x64\x3e\74\x74\144\x20\x73\164\171\154\145\x3d\x22\143\165\162\163\x6f\162\72\160\x6f\151\x6e\164\x65\x72\73\42\x20\157\156\143\154\x69\143\153\75\42\151\164\153\x61\x72\x64\145\x78\x28" . $i . "\x2c\64\51\x3b\42\x3e" . $dtfac->egreso . "\74\x2f\x74\x64\76\x3c\164\144\x20\163\164\x79\154\145\x3d\42\143\x75\162\x73\x6f\x72\72\x70\x6f\151\156\x74\x65\162\73\42\x20\157\156\143\154\x69\x63\x6b\75\x22\x69\x74\153\x61\162\x64\x65\170\x28" . $i . "\x2c\65\x29\x3b\x22\76" . $dtfac->devuelta . "\x3c\x2f\164\144\76\x3c\x74\144\x20\143\x6c\141\x73\163\x3d\x22" . $color . "\42\x3e" . $dtfac->existen . "\x3c\57\x74\144\76\12\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\x3c\57\164\x72\x3e"; } $html .= "\74\57\164\141\142\154\x65\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\x3c\163\143\162\151\160\x74\40\x74\x79\x70\x65\75\x22\164\145\170\x74\57\152\141\166\x61\x73\x63\x72\151\160\164\42\76\12\40\40\40\40\40\40\x20\40\x20\40\40\40\40\40\x20\x20\146\x75\156\x63\164\x69\157\156\40\x44\145\143\162\x65\155\145\x6e\164\x4e\165\x6d\x28\51\173\40\142\145\x66\157\x72\x65\x28\x29\73\12\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\166\x61\162\40\104\145\x63\162\145\155\145\x6e\164\116\165\155\75\144\157\143\x75\x6d\145\156\x74\x2e\x67\145\x74\x45\154\x65\x6d\145\156\164\x42\x79\x49\x64\50\42\104\x65\143\x72\145\x6d\x65\x6e\164\x4e\165\x6d\42\x29\x2e\x76\141\x6c\165\145\x3b\x20\166\x61\162\40\154\x69\x6b\145\x3d\x24\x28\x22\43\x6c\x69\153\145\42\x29\x2e\x76\141\154\50\51\x3b\12\40\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\40\x20\40\x76\x61\162\40\153\x65\171\75\42\144\x72\x6f\151\144\x39\60\63\42\73\xa\x20\40\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\40\40\40\166\x61\162\x20\x64\141\164\157\163\40\75\40\173\12\40\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x22\160\x61\147\x22\x20\x3a\x20\x44\x65\x63\x72\x65\x6d\x65\156\x74\116\165\x6d\54\12\x20\40\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x22\x6b\x65\x79\42\40\72\x20\x6b\145\171\xa\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\40\40\40\40\40\40\x20\x20\40\40\x7d\x3b\12\x20\40\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\12\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\44\56\141\152\141\x78\50\x7b\12\40\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\144\x61\164\141\x3a\40\x64\141\164\x6f\x73\54\xa\x20\x20\x20\40\40\40\40\40\x20\x20\x20\40\40\40\40\40\40\40\40\40\x20\x20\40\x20\x20\x20\x20\x75\x72\154\x3a\x20\40\142\x61\x73\145\165\162\154\x2b\x22\143\x5f\x64\162\x6f\x69\x64\x2f\x6b\141\162\x64\145\x78\42\54\xa\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\40\40\x20\40\x20\x74\171\160\x65\72\x20\42\120\x4f\123\x54\42\54\xa\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x73\165\x63\x63\x65\x73\163\72\40\146\x75\156\x63\164\x69\157\156\50\144\141\164\141\51\x20\173\12\40\40\40\40\40\x20\x20\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\44\50\42\x23\x62\157\144\171\x22\51\56\x68\x74\x6d\x6c\x28\144\x61\164\x61\51\73\40\x24\x28\42\x23\x6c\151\x6b\x65\x22\x29\x2e\166\141\154\x28\154\x69\153\145\51\x3b\40\163\x77\141\154\56\143\154\x6f\163\x65\50\51\12\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\40\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\175\12\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\xa\x20\40\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\40\40\x20\175\x29\x3b\xa\x20\40\40\40\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x7d\12\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\12\40\40\40\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\x66\165\156\x63\x74\151\157\156\40\156\x75\x6d\160\x61\147\x28\x61\x29\173\x20\x62\145\146\x6f\162\145\50\51\x3b\12\40\40\40\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\40\40\x20\x20\166\x61\x72\40\153\145\x79\x3d\42\x64\x72\157\x69\144\x39\x30\x33\x22\x3b\x20\x76\x61\x72\x20\154\x69\153\x65\x3d\x24\x28\x22\x23\x6c\151\x6b\145\42\x29\56\x76\141\x6c\50\x29\x3b\xa\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\x20\40\xa\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\166\x61\x72\40\x64\141\164\157\x73\x20\75\x20\x7b\12\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x22\x6b\145\171\42\x3a\x6b\x65\171\54\xa\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\42\x70\x61\147\x22\x20\x3a\x20\141\12\40\40\40\40\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\175\73\xa\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\x20\x20\40\x20\x20\xa\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\x24\56\x61\x6a\141\170\50\x7b\12\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\144\x61\x74\x61\x3a\40\144\x61\x74\x6f\x73\54\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\x20\40\40\x75\162\x6c\72\40\142\141\x73\x65\165\162\154\53\x22\143\x5f\x64\x72\157\151\144\57\153\141\x72\144\x65\170\42\54\12\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\x74\x79\x70\x65\x3a\40\42\x50\117\x53\124\42\x2c\12\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\40\40\x20\40\40\x73\x75\x63\143\x65\x73\163\x3a\x20\x66\x75\156\x63\x74\x69\157\x6e\50\144\x61\164\141\x29\40\173\xa\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x24\x28\x22\43\142\157\x64\171\42\x29\56\x68\x74\x6d\x6c\50\x64\141\x74\141\51\73\40\x24\x28\x22\x23\154\x69\153\x65\x22\51\x2e\166\141\x6c\x28\154\151\x6b\x65\x29\73\x20\x73\167\x61\x6c\x2e\143\x6c\x6f\163\145\x28\51\12\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\40\40\40\40\40\x20\40\40\175\xa\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\xa\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\x7d\x29\73\12\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\175\12\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\12\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\146\165\156\x63\164\x69\157\156\x20\x49\156\143\x72\x69\x6d\x65\x6e\164\116\165\155\x28\51\173\40\x62\x65\146\x6f\x72\145\x28\51\73\xa\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\40\40\x20\x76\141\x72\40\x49\x6e\x63\x72\x69\x6d\x65\x6e\x74\x4e\165\x6d\75\x64\157\143\165\x6d\145\156\164\x2e\x67\x65\164\x45\154\145\155\145\156\x74\102\x79\111\144\50\42\x49\156\143\162\x69\155\x65\x6e\x74\x4e\x75\x6d\42\51\56\166\x61\154\165\145\x3b\12\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\x76\141\162\x20\153\x65\x79\75\x22\144\x72\157\x69\x64\71\60\x33\x22\x3b\x20\x76\x61\162\x20\154\x69\153\x65\75\44\50\x22\x23\x6c\x69\153\x65\42\51\x2e\166\141\154\50\51\73\xa\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\40\166\x61\162\40\144\141\164\157\163\40\x3d\x20\173\12\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\42\153\145\171\42\72\153\x65\171\54\12\40\40\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\40\x20\40\42\160\x61\x67\42\x20\72\x20\111\156\143\x72\151\x6d\145\x6e\x74\x4e\165\x6d\12\40\40\40\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\x7d\x3b\xa\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\40\40\40\x20\40\x20\12\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x24\56\x61\x6a\141\170\x28\x7b\12\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\x20\x20\x20\x64\x61\164\141\x3a\x20\144\141\x74\x6f\163\x2c\xa\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\40\x20\x20\165\162\154\x3a\40\40\142\x61\163\145\165\162\154\53\x22\x63\137\x64\x72\x6f\x69\x64\x2f\153\x61\x72\x64\x65\x78\42\x2c\12\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\164\171\160\x65\x3a\x20\42\x50\117\x53\x54\42\x2c\12\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\40\40\40\x20\x20\40\40\x20\40\x20\163\165\143\x63\x65\x73\x73\x3a\40\x66\x75\156\143\x74\151\x6f\x6e\50\x64\x61\164\141\51\x20\x7b\12\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\40\x20\x20\40\44\x28\42\x23\x62\157\x64\171\x22\x29\56\150\164\x6d\154\50\144\141\x74\x61\x29\x3b\40\44\x28\x22\43\154\151\x6b\145\x22\x29\56\x76\x61\x6c\x28\154\151\x6b\145\51\73\40\x73\x77\141\x6c\x2e\x63\154\x6f\163\x65\x28\51\12\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\40\x7d\12\40\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\x20\40\40\x20\12\x20\x20\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\40\x7d\x29\73\xa\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\175\xa\40\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x3c\x2f\163\x63\x72\x69\x70\164\76\12\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\74\144\151\166\40\x63\x6c\141\163\x73\x3d\x22\167\63\55\x62\141\162\40\x77\x33\x2d\142\157\x72\144\145\x72\x20\x77\x33\x2d\x62\x61\162\x72\141\x73\42\76\xa\x20\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\74\151\x6e\x70\165\164\40\164\171\160\145\x3d\x22\x68\x69\144\144\145\x6e\x22\40\151\x64\x3d\x22\x44\x65\143\162\x65\155\145\156\x74\116\165\x6d\x22\x20\x76\x61\154\x75\x65\x3d\42" . $DecrementNum . "\x22\x3e\12\40\40\40\40\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\x3c\x61\40\x6f\x6e\143\154\x69\x63\x6b\75\42\104\145\143\162\145\155\x65\156\164\116\x75\155\x28\51\x3b\42\40\x63\x6c\141\163\163\75\42\167\63\x2d\142\141\162\x2d\x69\164\145\155\40\167\63\x2d\142\165\164\164\157\x6e\x22\x3e\46\x6c\x61\161\165\x6f\73\74\x2f\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\144\x70\141\x67\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\x66\x6f\x6e\144\x6f\144\x72\x6f\151\144"; $html .= "\12\x20\40\x20\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\74\x69\x6e\x70\165\164\x20\164\x79\160\x65\x3d\x22\x68\x69\144\144\145\x6e\42\x20\151\x64\75\42" . $id . "\42\40\x76\x61\154\165\145\x3d\x22" . $i . "\42\76\12\40\40\40\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x3c\x61\x20\x6f\x6e\143\x6c\151\x63\153\75\42\156\x75\x6d\x70\x61\147\50\x24\x28\x27\43" . $id . "\47\51\56\166\x61\x6c\50\51\51\x3b\42\x20\x63\x6c\141\x73\x73\x3d\x22\167\x33\x2d\x62\141\x72\55\151\x74\145\155\x20\167\63\x2d\142\x75\x74\164\157\x6e\x20" . $hover . "\x22\76" . $i . "\x3c\57\x61\76"; } else { $hover = ''; $html .= "\74\151\x6e\160\165\164\40\x74\x79\160\145\75\x22\150\151\144\144\x65\x6e\x22\40\x69\x64\x3d\42" . $id . "\x22\x20\x76\141\154\x75\x65\75\x22" . $i . "\42\x3e\12\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\40\74\x61\40\157\x6e\x63\154\151\x63\x6b\75\42\x6e\x75\x6d\x70\141\x67\50\x24\50\47\x23" . $id . "\x27\x29\56\166\x61\x6c\x28\x29\51\73\42\40\x63\154\141\x73\x73\x3d\42\167\x33\55\x62\x61\162\x2d\x69\164\x65\155\x20\167\x33\55\142\x75\x74\164\157\x6e\x20" . $hover . "\x22\76" . $i . "\74\57\x61\76"; } } } $html .= "\74\x69\156\x70\x75\x74\40\164\171\x70\145\x3d\x22\x68\151\144\x64\145\x6e\x22\x20\151\x64\75\42\111\x6e\x63\x72\x69\155\145\x6e\x74\x4e\165\155\x22\x20\166\x61\x6c\x75\145\75\x22" . $IncrimentNum . "\x22\76\12\40\x20\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x3c\x61\40\157\x6e\143\154\151\x63\x6b\x3d\42\111\x6e\x63\162\151\155\145\156\164\x4e\165\x6d\x28\x29\73\x22\40\143\154\141\163\x73\75\x22\x77\63\x2d\x62\141\x72\55\x69\164\145\155\40\x77\63\55\142\x75\164\x74\157\x6e\x22\x3e\x26\x72\x61\x71\165\157\73\74\57\141\76\xa\x20\40\40\x20\x20\x20\40\40\12\40\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\74\x2f\x64\x69\166\x3e\x20"; return $html; } public function itkardex($alm, $cod, $lot, $fdesde, $fhasta, $cons) { $this->load->library("\164\x61\x62\x6c\145"); if ($cons == 1) { $bdfac = $this->db->query("\123\x45\x4c\105\x43\x54\x20\151\x64\x20\x64\x6f\143\x2c\47\x4d\105\123\x59\123\124\x27\x20\143\154\151\x65\x6e\164\x65\x2c\x64\x61\x6c\x6d\x20\141\154\x6d\141\x63\x65\156\54\x63\x6f\144\x69\147\x6f\54\x64\x6c\157\164\x65\x20\154\x6f\x74\x65\x2c\143\141\x6e\x74\54\146\145\143\x68\x20\146\x65\143\150\141\40\x46\x52\117\115\x20\x61\152\165\163\x74\145\151\x6e\x76\40\x61\40\x57\110\105\122\105\40\141\56\x64\141\154\155\75\x27{$alm}\x27\40\x26\46\x20\141\x2e\143\157\x64\x69\x67\x6f\x3d\47{$cod}\47\x20\x26\46\40\141\56\x64\154\x6f\x74\x65\75\x27{$lot}\47\40\x26\46\40\x28\x61\x2e\x74\151\160\157\75\61\x20\x7c\174\x20\x61\56\164\x69\160\x6f\x3d\x33\51\x20\46\x26\40\141\x2e\x66\145\x63\x68\x3e\47\x32\x30\x32\63\55\x31\x32\55\62\71\x27\xa\x20\40\40\40\x20\40\40\40\x20\40\40\40\40\40\x20\x20\x55\116\111\117\116\40\12\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x53\x45\114\105\103\124\x20\x6e\x75\x6c\154\54\x6e\165\154\154\54\156\165\154\x6c\x2c\x4e\x55\x4c\114\54\47\74\142\x3e\124\x6f\164\141\154\74\57\142\x3e\x27\x2c\x53\x55\115\x28\x63\141\156\x74\x29\x2c\156\x75\x6c\154\40\106\x52\x4f\x4d\x20\x61\x6a\165\x73\164\145\x69\x6e\166\40\141\40\127\x48\x45\x52\x45\40\141\56\x64\141\x6c\x6d\75\x27{$alm}\47\40\x26\46\x20\141\x2e\143\x6f\144\x69\x67\157\75\47{$cod}\x27\x20\46\46\40\x61\x2e\x64\x6c\157\x74\x65\75\47{$lot}\47\x20\46\x26\x20\50\141\56\x74\x69\160\x6f\x3d\x31\x20\174\174\x20\x61\56\x74\x69\x70\x6f\x3d\x33\x29\40\46\x26\x20\141\56\x66\145\143\150\76\47\x32\60\62\63\55\x31\62\55\x32\x39\x27\x3b")->result(); } if ($cons == 2) { $bdfac = $this->db->query("\x53\x45\114\x45\x43\x54\40\x69\x64\x20\x64\157\143\x2c\x27\115\x45\x53\131\123\x54\47\x20\143\154\151\x65\156\x74\x65\54\x61\154\155\x20\141\x6c\x6d\141\143\145\156\x2c\143\157\144\151\147\157\x2c\x6c\157\x74\145\x2c\143\x61\156\164\54\x66\x65\x63\150\40\x66\x65\x63\150\141\x20\106\122\x4f\x4d\x20\x61\152\x75\x73\164\x65\151\x6e\166\x20\141\40\127\110\x45\122\105\x20\141\x2e\x61\154\155\75\x27{$alm}\x27\x20\x26\x26\40\141\x2e\143\x6f\x64\151\x67\x6f\x3d\x27{$cod}\x27\x20\x26\46\40\x61\56\154\157\164\x65\75\47{$lot}\47\40\46\46\40\x28\x61\x2e\x74\x69\160\x6f\75\60\40\x7c\174\40\x61\x2e\x74\151\160\157\x3d\63\51\40\46\x26\x20\x61\56\x66\x65\x63\150\x3e\47\62\x30\x32\x33\55\x31\62\55\x32\71\x27\12\40\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\x20\40\40\x55\x4e\111\117\x4e\40\xa\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\123\105\114\105\x43\x54\40\x6e\x75\x6c\154\54\x6e\165\154\x6c\54\x4e\x55\114\114\54\156\165\x6c\x6c\54\x27\74\142\x3e\x54\x6f\x74\141\154\x3c\x2f\x62\x3e\47\x2c\x53\125\x4d\x28\143\141\x6e\164\51\54\156\x75\154\154\x20\x46\x52\117\115\x20\x61\152\x75\163\x74\x65\x69\156\166\x20\x61\x20\x57\x48\x45\122\x45\40\x61\56\x61\x6c\x6d\x3d\47{$alm}\47\x20\46\x26\40\141\56\143\157\x64\x69\147\x6f\x3d\47{$cod}\47\x20\46\46\x20\x61\56\x6c\157\164\145\75\x27{$lot}\47\x20\46\46\40\x28\141\56\164\151\160\x6f\x3d\x30\x20\x7c\174\x20\x61\x2e\x74\x69\160\157\x3d\x33\51\40\46\x26\x20\141\x2e\x66\145\x63\x68\76\47\x32\60\x32\x33\x2d\61\x32\x2d\x32\71\x27\x3b")->result(); } if ($cons == 3) { $bdfac = $this->db->query("\123\x45\x4c\x45\103\x54\x20\x61\x2e\x6f\162\x64\143\40\144\x6f\x63\54\x27\115\x45\x53\131\x53\x54\47\40\x63\154\151\145\x6e\x74\x65\x2c\x62\56\141\154\x6d\x61\x63\x65\156\x2c\x61\x2e\x63\157\x64\151\x67\x6f\x2c\141\x2e\x6c\x6f\164\x65\54\x61\x2e\143\x61\156\x74\54\x62\x2e\x66\162\x65\x63\x65\160\x20\146\x65\x63\x68\141\x20\x46\122\117\115\40\x69\x74\157\x72\144\143\x20\x61\x20\x4a\117\x49\116\40\157\162\x64\x63\40\x62\x20\117\116\40\141\x2e\x6f\162\x64\x63\x3d\142\56\151\x64\40\x57\110\105\122\105\x20\142\x2e\x61\154\x6d\141\143\145\x6e\x3d\47{$alm}\x27\x20\46\46\x20\141\56\x63\157\x64\x69\147\157\x3d\x27{$cod}\x27\40\x26\x26\40\141\x2e\154\x6f\164\x65\75\47{$lot}\x27\x20\x26\46\40\142\56\146\x72\145\x63\145\160\x3e\47\x32\60\x32\63\55\61\x32\55\62\x39\47\xa\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x55\116\x49\117\x4e\40\xa\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x53\x45\x4c\x45\103\x54\40\x6e\x75\154\154\x2c\156\x75\x6c\154\54\x6e\165\154\x6c\54\116\125\114\x4c\x2c\x27\x3c\142\76\x74\157\x74\141\x6c\74\x2f\x62\x3e\x27\x2c\x53\125\x4d\50\x61\56\x63\141\x6e\x74\x29\x20\x63\141\x6e\164\x2c\156\165\154\x6c\x20\106\x52\x4f\x4d\40\x69\164\x6f\162\x64\x63\x20\x61\40\x4a\117\x49\116\x20\157\x72\x64\143\x20\x62\40\x4f\x4e\x20\x61\x2e\157\x72\144\x63\x3d\x62\x2e\x69\x64\x20\x57\x48\105\x52\105\40\x62\56\141\x6c\x6d\x61\143\145\156\75\x27{$alm}\47\x20\46\46\40\141\56\x63\x6f\144\151\147\157\x3d\x27{$cod}\x27\x20\46\46\40\141\56\x6c\x6f\x74\145\x3d\47{$lot}\47\40\x26\x26\x20\x62\56\146\162\145\x63\x65\160\x3e\x27\x32\60\x32\63\55\61\x32\x2d\x32\x39\x27")->result(); } if ($cons == 4) { $bdfac = $this->db->query("\123\x45\114\105\103\124\x20\x61\x2e\x64\157\x63\x75\x6d\145\x6e\164\x6f\40\x64\157\143\x2c\x63\x6f\156\x63\x61\164\50\x62\56\x63\x6f\144\x63\x6c\151\x65\156\164\x65\x2c\142\56\x6e\x6f\x6d\142\162\145\143\154\x69\x29\40\143\154\x69\x65\156\x74\145\54\141\56\x61\x6c\155\x61\x63\x65\x6e\54\141\56\x63\157\144\x69\147\x6f\x2c\x61\56\x6c\x6f\164\145\54\x52\x4f\125\x4e\x44\x28\141\x2e\x63\141\156\x74\x69\144\141\144\54\60\x29\x20\x63\141\156\164\x2c\x62\x2e\x66\145\x63\x68\x61\143\x72\x65\141\x20\146\145\x63\x68\141\x20\x46\x52\117\115\40\157\160\145\162\155\166\40\x61\40\112\x4f\111\116\x20\x6f\x70\x65\162\164\151\40\142\x20\117\x4e\x20\50\x61\56\x64\x6f\x63\165\155\145\x6e\x74\157\75\142\56\x64\157\143\165\x6d\x65\x6e\x74\x6f\x20\x26\46\x20\141\x2e\164\151\x70\157\x64\157\x63\x3d\x62\x2e\x74\151\160\x6f\x64\x6f\143\51\x20\127\x48\x45\x52\x45\x20\x61\x2e\x61\154\155\x61\x63\x65\156\x3d\47{$alm}\x27\40\46\x26\40\x61\x2e\x63\x6f\x64\x69\x67\x6f\x3d\x27{$cod}\x27\x20\x26\x26\40\141\x2e\154\157\x74\x65\x3d\47{$lot}\47\x20\46\x26\x20\x28\x61\x2e\164\151\160\x6f\x64\x6f\143\x3d\x27\x46\101\103\x27\40\174\x7c\40\x61\x2e\x74\x69\160\x6f\144\157\x63\75\x27\x4e\x4f\124\x27\x29\x20\46\46\x20\x62\56\146\145\143\x68\141\143\162\x65\141\x3e\47\x32\60\62\63\55\x31\x32\x2d\x32\71\47\40\x47\x52\x4f\125\x50\40\102\131\40\x61\x2e\x64\157\x63\x75\155\145\x6e\x74\x6f\x2c\x61\56\x61\154\x6d\141\x63\x65\156\x2c\141\x2e\x63\157\x64\x69\147\157\54\141\56\x6c\x6f\164\x65\12\40\x20\40\40\40\40\x20\40\40\40\40\40\40\40\40\40\125\x4e\111\x4f\x4e\40\xa\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x53\x45\x4c\105\103\124\40\x6e\x75\x6c\154\54\x6e\x75\154\x6c\x2c\x6e\165\154\x6c\x2c\116\x55\114\114\x2c\x27\x3c\142\76\x74\x6f\x74\141\154\x3c\x2f\x62\x3e\47\x2c\122\x4f\x55\x4e\104\50\x53\125\x4d\x28\x61\x2e\143\x61\x6e\164\151\x64\x61\144\51\54\x30\x29\40\143\141\156\164\54\156\165\154\154\40\x46\x52\x4f\115\x20\x6f\x70\145\162\155\x76\40\141\x20\x4a\x4f\111\116\x20\x6f\x70\145\x72\164\151\40\142\x20\117\116\40\x28\141\56\x64\x6f\143\x75\155\145\x6e\x74\157\x3d\x62\56\x64\157\x63\x75\x6d\x65\x6e\164\157\40\x26\x26\40\x61\56\x74\151\160\157\x64\x6f\143\x3d\142\x2e\x74\151\160\157\x64\x6f\x63\x29\40\127\110\x45\x52\105\x20\x61\x2e\141\x6c\x6d\x61\x63\x65\156\75\x27{$alm}\x27\x20\46\46\x20\141\56\x63\157\x64\x69\147\157\x3d\x27{$cod}\x27\40\x26\x26\x20\141\x2e\x6c\x6f\164\x65\75\47{$lot}\x27\x20\46\x26\40\x28\141\x2e\x74\x69\160\x6f\x64\x6f\x63\x3d\x27\106\101\x43\x27\x20\174\x7c\x20\141\56\x74\x69\160\157\x64\x6f\143\x3d\x27\116\117\124\x27\x29\40\46\x26\x20\142\56\146\x65\x63\150\x61\143\x72\x65\x61\x3e\x27\x32\60\62\63\x2d\61\62\x2d\62\71\47\x20\x47\122\117\x55\x50\40\x42\131\x20\141\x2e\141\154\155\x61\x63\145\156\x2c\x61\x2e\143\x6f\x64\x69\x67\x6f\54\141\56\154\x6f\x74\145")->result(); } if ($cons == 5) { $bdfac = $this->db->query("\x53\105\x4c\105\x43\124\x20\x61\x2e\144\x6f\143\165\x6d\x65\156\164\157\x20\144\x6f\x63\x2c\143\x6f\156\x63\x61\164\x28\x62\x2e\143\157\144\143\x6c\151\x65\156\164\145\x2c\x62\56\156\157\155\x62\162\x65\143\154\x69\51\40\143\154\x69\145\156\x74\145\x2c\x61\x2e\x61\x6c\155\141\x63\145\x6e\x2c\141\x2e\x63\x6f\x64\151\147\157\x2c\x61\56\154\x6f\164\145\54\x52\117\x55\x4e\104\x28\x61\56\x63\156\164\144\145\x76\x75\145\154\164\54\60\x29\40\143\x61\156\x74\54\142\x2e\x66\145\143\x68\x61\x63\x72\x65\141\40\x66\145\x63\x68\x61\40\106\122\117\115\40\144\145\x76\x6f\154\x6d\166\x20\x61\x20\x4a\x4f\x49\x4e\40\x64\x65\166\x6f\154\x74\151\40\142\40\117\x4e\40\x28\141\x2e\144\157\143\x75\x6d\145\156\164\x6f\75\142\x2e\x64\x6f\x63\x75\155\x65\x6e\164\157\40\46\46\x20\141\x2e\164\151\x70\x6f\x64\x6f\x63\75\x62\x2e\x74\x69\x70\x6f\144\157\x63\x29\x20\127\x48\105\122\x45\40\141\56\x61\x6c\155\141\x63\145\x6e\75\47{$alm}\47\x20\46\x26\x20\141\56\143\157\x64\151\147\x6f\x3d\47{$cod}\x27\x20\x26\x26\40\x61\56\154\x6f\x74\145\75\47{$lot}\47\40\x26\46\x20\141\x2e\x63\156\x74\144\145\166\x75\145\x6c\164\x3e\60\x20\x26\46\40\x61\x2e\164\x69\160\157\x64\157\x63\75\x27\x44\x45\x56\x27\x20\x26\x26\40\142\x2e\x66\x65\x63\x68\141\x63\x72\145\141\x3e\47\x32\60\x32\63\55\61\62\55\62\71\47\40\x47\122\117\x55\x50\x20\x42\131\40\x61\56\x64\157\x63\165\155\145\156\164\x6f\54\x61\56\141\154\x6d\x61\143\x65\156\54\x61\x2e\143\157\144\151\x67\157\54\x61\56\154\157\164\145\12\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\40\40\x20\40\40\x55\x4e\x49\x4f\116\x20\xa\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\x53\x45\x4c\105\x43\x54\x20\156\165\x6c\154\54\x6e\165\154\154\x2c\x6e\165\154\x6c\54\x4e\125\114\114\54\47\74\x62\x3e\164\x6f\x74\x61\x6c\74\57\x62\76\x27\x2c\x52\117\125\x4e\104\50\123\x55\115\x28\141\56\143\x6e\164\x64\x65\166\x75\x65\154\x74\51\54\x30\x29\40\143\x61\156\164\54\x6e\x75\x6c\x6c\x20\x46\x52\x4f\115\40\x64\145\x76\157\x6c\x6d\x76\40\x61\x20\x4a\117\111\116\40\144\x65\166\157\x6c\164\x69\40\142\40\x4f\116\40\50\x61\56\x64\157\x63\x75\155\145\156\164\x6f\75\x62\56\x64\x6f\x63\165\x6d\x65\x6e\x74\x6f\x20\46\46\40\141\x2e\164\x69\x70\x6f\x64\x6f\x63\x3d\x62\56\x74\151\160\x6f\x64\x6f\x63\51\x20\127\110\105\122\105\x20\141\x2e\141\x6c\155\x61\x63\x65\x6e\75\x27{$alm}\x27\x20\46\46\40\x61\56\x63\x6f\x64\x69\147\x6f\75\47{$cod}\x27\x20\x26\x26\x20\x61\x2e\x6c\157\164\145\75\47{$lot}\x27\40\x26\46\40\x61\56\x63\156\x74\144\x65\166\165\x65\x6c\x74\76\60\x20\x26\46\40\x61\56\x74\x69\160\157\144\157\143\x3d\x27\x44\105\x56\47\40\46\46\40\142\x2e\x66\x65\143\x68\141\x63\x72\145\x61\76\x27\62\60\62\63\x2d\61\62\55\x32\71\47\x20\107\x52\x4f\x55\x50\x20\102\131\x20\141\56\141\x6c\x6d\x61\x63\x65\156\54\x61\56\x63\157\x64\151\147\x6f\x2c\141\x2e\x6c\x6f\x74\x65")->result(); } $html = "\12\x20\40\40\40\x20\x20\40\40\40\40\40\x20\x3c\164\x61\x62\154\145\x20\151\144\75\42\x69\x64\x30\x31\42\40\143\x6c\x61\x73\x73\x3d\x22\x77\x33\x2d\x74\x61\142\154\x65\x2d\141\x6c\x6c\40\x77\63\55\x68\x6f\166\145\x72\x61\142\154\145\40\x77\x33\x2d\x6c\145\x66\x74\55\141\x6c\151\x67\156\40\x77\x33\55\164\151\x6e\171\x22\x3e\x3c\164\162\x20\x63\x6c\141\x73\x73\75\42\167\x33\x2d\x66\x6f\156\144\x6f\x64\x72\157\151\x64\42\76\x3c\164\x68\76\x44\157\143\x75\x6d\x65\x6e\164\x6f\74\57\164\x68\x3e\x3c\x74\150\x3e\103\154\x69\145\156\x74\145\x3c\x2f\x74\150\76\74\x74\150\76\101\x6c\x6d\141\x63\145\x6e\x3c\x2f\x74\150\76\x3c\x74\150\76\x43\157\144\x69\147\157\74\57\164\x68\76\x3c\164\x68\76\x4c\x6f\x74\x65\x3c\57\164\x68\76\x3c\x74\150\x3e\103\141\x6e\164\151\144\141\x64\74\x2f\x74\150\76\x3c\164\x68\76\x46\x65\143\150\141\x3c\57\164\150\76\74\57\164\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\x74\x72\x3e\12\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\74\164\144\76" . $dtfac->doc . "\74\57\x74\x64\76\40\x3c\x74\144\x3e" . $dtfac->cliente . "\74\x2f\164\144\76\x20\74\164\x64\76" . $dtfac->almacen . "\74\57\x74\x64\76\x20\x3c\x74\x64\x3e" . $dtfac->codigo . "\x3c\x2f\164\x64\x3e\40\x3c\164\x64\76" . $dtfac->lote . "\x3c\57\x74\144\x3e\40\x3c\x74\144\x3e" . $dtfac->cant . "\x3c\x2f\x74\x64\x3e\x20\x3c\x74\144\x3e" . $dtfac->fecha . "\74\x2f\164\144\76\12\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\74\57\164\162\x3e"; } $html .= "\x3c\x2f\x74\x61\142\154\145\76"; return $html; } function activaart($cod) { $row = count($cod); $j = 0; for ($i = 0; $i < $row; $i++) { if ($cod[$i] != '' && $cod[$i] != null) { $bd = $this->db->query("\x53\x45\x4c\105\x43\x54\40\x70\141\162\x61\137\x77\145\142\40\106\x52\x4f\115\40\141\x72\164\151\x63\x75\154\x6f\x20\127\x48\x45\x52\x45\x20\143\157\144\151\x67\157\75\x27{$cod[$i]}\47")->row(); if ($bd->para_web == 1) { $new = 0; } else { $new = 1; } $this->db->query("\x55\x50\104\101\124\105\x20\x61\162\x74\151\x63\165\x6c\x6f\x20\163\x65\164\40\x70\x61\x72\x61\137\x77\x65\142\75\x27{$new}\47\x20\127\110\105\122\x45\x20\x63\x6f\x64\151\147\157\x3d\47{$cod[$i]}\47"); if ($this->db->affected_rows() > 0) { $j++; $this->loguser("\101\x63\164\x69\x76\x61\57\104\x65\x73\x61\143\164\151\166\141\x20\x41\162\164\151\x63\165\154\x6f", "\x45\x6c\40\165\163\x75\141\x72\x69\x6f\x20\x61\x63\x74\151\166\141\x5c\x64\x65\163\141\x63\x74\x69\x76\x61\x2c\x20\160\x72\157\x63\x65\163\x6f\x3a\x20" . $new . "\x2c\40\160\141\x72\x61\40\x65\154\40\160\162\157\144\x75\x63\x74\x6f\x20" . $cod[$i] . "\x2e"); } } } return $j; } public function articulo($a, $b) { $this->load->library("\x74\x61\x62\x6c\x65"); if ($b != '') { $filter = "\x57\110\105\x52\105\x20\x28\141\56\x63\x6f\x64\151\x67\157\75\x27{$b}\x27\40\x7c\174\40\141\x2e\156\157\155\x62\162\145\x20\x6c\x69\x6b\x65\40\x27\45{$b}\45\47\x20\40\x7c\x7c\x20\141\x2e\155\x61\162\x63\141\40\x6c\x69\x6b\145\40\x27\x25{$b}\x25\x27\x7c\x7c\x20\x64\56\x6e\x6f\155\142\162\145\x20\x6c\151\153\145\40\47\45{$b}\45\x27\x20\174\x7c\x20\144\56\x63\x6f\x64\x69\x67\x6f\75\x27{$b}\47\x29"; if ($b == "\76\60") { $filter = "\127\110\x45\x52\x45\x20\141\x2e\143\157\155\160\x72\157\x6d\x65\164\151\x64\157\76\x30"; } } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\114\105\103\124\40\116\x55\x4c\114\12\40\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\106\x52\117\115\40\141\162\x74\x69\143\165\x6c\x6f\x20\141\12\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\40\x4c\105\x46\x54\x20\x4a\117\x49\x4e\40\141\x72\x74\x69\160\x72\157\166\x20\143\40\117\x4e\x20\x61\x2e\143\157\x64\151\147\157\x3d\x63\56\143\x6f\144\x69\x67\x6f\12\x20\40\40\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\114\x45\106\x54\40\x4a\x4f\111\116\x20\x70\162\157\x76\145\145\x64\x20\x64\40\117\x4e\x20\x63\56\x70\x72\157\x76\145\x65\x64\157\162\75\144\x2e\x63\157\144\151\x67\157\12\40\x20\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\40" . $filter . "\xa\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\107\x52\117\x55\120\40\x42\x59\40\x61\x2e\143\157\x64\151\x67\157\x20\117\122\104\105\x52\x20\102\131\x20\141\x2e\x63\x6f\x64\x69\x67\157\x20\101\123\x43")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\114\x45\103\x54\40\x61\x2e\143\x6f\x64\x69\147\157\54\103\x4f\x4e\x43\101\124\x28\124\122\111\115\x28\x61\56\143\157\x64\151\147\x6f\51\x2c\47\x20\x27\x2c\141\56\x6e\157\x6d\142\x72\x65\51\x20\x70\x72\157\x64\165\143\54\141\x2e\162\145\x66\x65\x72\x65\156\x63\151\x61\x2c\x61\56\155\141\162\143\141\x20\x6c\141\x62\x2c\x52\x4f\x55\x4e\104\x28\x61\56\x70\x72\x65\x63\151\x6f\x31\x2c\x32\x29\160\x72\x65\x63\151\x6f\x31\x2c\x52\117\125\x4e\x44\x28\141\56\160\x72\x65\x63\x69\157\x66\x69\x6e\x31\54\62\51\160\x72\145\143\x69\x6f\146\151\x6e\61\x2c\xa\x20\40\x20\40\x20\40\40\40\40\x20\40\122\x4f\125\x4e\104\x28\141\x2e\151\x6d\160\165\x65\x73\x74\157\x31\x2c\60\x29\40\151\166\x61\54\x52\x4f\x55\116\x44\x28\141\56\145\x78\x69\x73\x74\x65\x6e\x63\x69\x61\55\x28\x61\56\x63\x6f\155\160\x72\157\x6d\145\x74\x69\x64\157\x2b\50\x53\105\x4c\105\103\124\40\x49\x46\x28\x53\125\x4d\50\x63\141\156\x74\x3e\60\51\x2c\x53\125\x4d\x28\143\x61\x6e\x74\51\x2c\60\51\x20\x46\122\x4f\x4d\40\x74\x65\x6d\137\160\x65\x64\151\x64\x6f\x20\127\x48\105\122\105\40\143\157\x64\x5f\x6d\145\144\75\x61\x2e\143\x6f\x64\x69\147\157\51\x29\54\60\51\x20\145\x78\151\x73\x74\145\156\54\144\56\155\x6f\156\x65\144\141\54\x52\117\125\116\x44\x28\141\x2e\x63\x6f\x6d\160\x72\x6f\x6d\145\164\x69\x64\x6f\x2b\50\123\x45\x4c\x45\103\124\x20\x49\106\50\123\125\x4d\50\143\141\x6e\x74\x3e\x30\x29\x2c\123\125\x4d\50\143\x61\x6e\164\x29\54\60\51\x20\x46\x52\117\x4d\x20\164\x65\155\137\x70\x65\x64\x69\144\x6f\x20\127\110\x45\x52\105\x20\143\157\144\x5f\x6d\x65\144\75\141\56\x63\x6f\144\x69\147\157\51\54\60\x29\40\143\157\x6d\160\x2c\141\x2e\x63\x6f\156\x74\162\157\x6c\x61\144\x6f\x2c\x61\x2e\160\141\162\141\137\167\x65\x62\54\141\x2e\x64\151\x61\x73\151\x6e\x64\x65\x78\x2c\141\x2e\x64\151\141\x73\x63\x72\x65\x64\xa\40\40\x20\40\40\x20\40\x20\40\40\40\x20\106\122\x4f\x4d\x20\x61\162\164\x69\143\x75\154\157\x20\141\12\40\x20\40\40\40\40\x20\40\x20\x20\40\40\x4c\x45\x46\124\x20\x4a\117\111\116\40\141\x72\x74\x69\x70\162\157\166\40\x63\40\117\x4e\x20\x61\x2e\x63\x6f\x64\x69\147\x6f\75\143\56\x63\157\144\x69\x67\157\12\40\x20\40\40\40\40\x20\x20\x20\x20\x20\40\114\105\x46\124\x20\112\x4f\x49\x4e\x20\160\x72\157\x76\x65\145\x64\x20\144\40\117\116\40\143\56\x70\x72\x6f\166\145\x65\x64\157\162\75\x64\x2e\x63\157\144\x69\x67\x6f\12\40\x20\40\40\40\x20\x20\40\40\40\40\x20" . $filter . "\12\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\x47\x52\117\125\120\x20\x42\131\40\x61\x2e\x63\x6f\144\151\x67\x6f\x20\x4f\x52\x44\x45\x52\x20\x42\131\x20\x65\170\x69\163\164\145\156\x20\104\x45\123\x43\x2c\x61\x2e\143\x6f\144\151\147\x6f\x20\x41\123\x43\x20\x4c\x49\115\x49\x54\x20" . ($a - 1) * $mostrar . "\x20\54\40" . $mostrar . "\73")->result(); $html = "\xa\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x3c\x74\141\x62\154\x65\x20\143\x6c\x61\x73\163\75\x22\x77\x33\x2d\164\141\x62\154\145\55\x61\x6c\x6c\x20\167\x33\55\x68\x6f\166\x65\x72\x61\142\x6c\x65\x20\167\63\55\154\x65\146\164\55\x61\x6c\151\147\x6e\x22\76\12\40\x20\x20\40\40\40\x20\x20\x20\40\40\40\74\x74\162\x3e\x3c\164\x64\x20\x63\154\x61\163\163\x3d\x22\x77\x33\55\146\x6f\156\x64\x6f\x64\162\157\151\144\42\76\102\x75\163\143\x61\x72\40\74\x69\155\x67\40\x73\162\143\75\42" . base_url() . "\x69\x6d\x61\x67\145\x73\x2f\x62\x75\163\143\141\162\x2e\x70\156\x67\42\40\x61\x6c\164\75\42\x42\x75\x73\143\x61\x72\x22\40\164\x69\164\x6c\x65\75\x22\x42\x75\x73\x63\x61\162\42\x20\x73\164\x79\154\x65\x3d\42\167\x69\x64\x74\150\x3a\x31\70\x70\170\73\x62\157\162\x64\x65\x72\x3a\x30\x3b\x22\76\74\x2f\164\144\x3e\xa\40\x20\40\40\40\x20\x20\40\40\x20\40\40\x3c\x74\144\76\x3c\151\x6e\160\x75\164\40\164\171\160\145\x3d\x22\164\x65\x78\x74\x22\x20\x63\154\141\163\163\x3d\42\x77\x33\55\151\156\x70\x75\x74\42\x20\x70\154\141\x63\x65\150\157\154\x64\145\162\75\x22\111\156\x67\162\x65\x73\145\40\x73\165\40\x62\x75\x73\161\165\145\x64\141\x22\x20\157\x6e\143\x68\x61\x6e\147\145\75\42\141\x72\x74\x69\x63\165\x6c\157\x28\51\42\x20\x69\144\x3d\42\154\x69\153\x65\42\76\x3c\x2f\x74\x64\76\xa\x20\x20\40\x20\x20\40\40\x20\40\40\40\x20\74\164\x64\40\x63\x6c\141\163\163\x3d\42\167\x33\x2d\143\x65\156\164\145\162\x20\x77\x33\x2d\x62\164\156\x22\x3e\x3c\141\x20\x6f\156\x63\154\151\x63\x6b\75\x22\167\63\x2e\163\150\x6f\167\50\47\43\155\157\x64\x63\x61\162\x67\x61\154\157\164\145\47\51\73\x22\x3e\x3c\151\155\x67\x20\163\x72\x63\x3d\x22" . base_url() . "\151\x6d\141\147\x65\x73\57\x65\170\x63\x65\154\56\160\x6e\147\x22\x20\141\154\164\75\42\x43\141\162\x67\141\x72\40\101\x6a\165\x73\164\x65\42\x20\164\151\164\154\145\x3d\x22\103\x61\x72\x67\141\x72\x20\x41\x6a\x75\x73\164\145\42\40\163\164\171\154\x65\x3d\42\167\151\x64\164\150\72\61\70\160\170\x3b\x68\x65\151\x67\150\x74\x3a\x31\x38\160\x78\x3b\x62\157\x72\144\145\x72\72\x30\73\42\76\74\x2f\x61\x3e\74\x2f\164\144\x3e\xa\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x3c\164\x64\40\143\154\141\x73\x73\x3d\42\167\63\55\x63\145\x6e\x74\x65\x72\x20\x77\63\55\x62\164\x6e\42\76\x3c\x61\40\x6f\x6e\x63\154\x69\x63\153\x3d\42\x61\152\x75\163\x74\145\143\x61\156\x74\50\51\73\42\76\x3c\151\x6d\147\x20\x73\x72\x63\x3d\x22" . base_url() . "\151\x6d\141\x67\x65\163\57\x61\152\x75\163\x74\x65\x63\141\x6a\141\56\160\x6e\x67\x22\x20\141\154\x74\75\42\x41\x6a\165\x73\164\x65\x20\103\x61\162\147\x6f\57\104\x65\x73\143\141\162\x67\157\42\x20\x74\x69\x74\x6c\145\x3d\x22\x41\x6a\x75\163\164\x65\40\103\141\162\x67\x6f\57\104\x65\163\143\x61\162\147\157\x22\x20\163\164\x79\x6c\145\75\x22\x77\151\144\164\x68\x3a\62\60\160\x78\73\150\145\x69\147\x68\164\x3a\x32\x30\160\x78\x3b\142\x6f\162\144\145\x72\x3a\x30\x3b\42\76\74\57\x61\x3e\x3c\x2f\164\x64\x3e\12\40\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\74\164\x64\x20\x63\x6c\141\163\x73\75\42\x77\x33\55\143\145\156\x74\145\x72\x20\x77\63\x2d\142\x74\156\x22\76\x3c\x61\40\157\156\143\154\x69\143\153\75\42\x74\162\141\x6e\146\x61\x6c\155\50\x29\73\x22\x3e\x3c\x69\155\147\x20\163\x72\x63\75\x22" . base_url() . "\x69\155\141\147\x65\x73\x2f\x74\x72\141\x6e\146\141\154\x6d\x2e\x70\156\x67\42\x20\x61\154\x74\75\42\103\x61\162\147\141\162\x20\x54\x72\x61\x6e\163\x61\146\x65\x72\145\156\143\151\141\x22\x20\x74\151\164\x6c\145\x3d\42\103\141\x72\147\x61\x72\40\124\x72\x61\x6e\x73\x61\146\145\x72\145\156\x63\x69\141\42\40\163\x74\171\154\x65\x3d\x22\x77\151\144\164\150\72\x31\70\160\x78\73\150\145\x69\147\x68\x74\x3a\x31\x38\x70\170\x3b\x62\x6f\x72\x64\x65\162\x3a\x30\73\42\x3e\x3c\x2f\x61\x3e\74\x2f\164\x64\x3e\12\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x3c\164\x64\40\143\154\x61\x73\163\x3d\x22\167\x33\x2d\143\145\156\x74\x65\x72\40\167\63\x2d\142\164\156\42\76\x3c\x61\x20\x6f\x6e\143\x6c\151\x63\x6b\75\42\145\x78\160\x6f\x72\x74\145\x78\x63\x65\x6c\x61\162\164\151\x74\x6f\x64\x6f\50\x29\x3b\42\76\x3c\151\155\x67\40\x73\x72\143\75\42" . base_url() . "\151\155\141\x67\145\x73\x2f\x78\154\163\56\x70\156\x67\42\40\141\x6c\x74\75\42\x45\170\160\x6f\x72\164\x20\114\151\163\x74\x22\40\x74\151\x74\x6c\145\75\42\x45\x78\x70\x6f\x72\164\40\x4c\151\163\x74\x22\x20\x73\164\171\154\145\x3d\x22\x77\x69\144\164\150\72\62\x30\x70\x78\x3b\x68\145\x69\147\150\164\x3a\x32\60\160\170\x3b\x62\157\x72\144\x65\x72\72\60\x3b\x22\76\x3c\x2f\x61\76\x3c\x2f\164\144\x3e\xa\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\40\74\164\144\40\143\154\x61\163\x73\x3d\x22\x77\x33\x2d\x63\x65\x6e\x74\x65\x72\x20\x77\63\x2d\x62\164\156\x22\76\74\141\40\x6f\156\x63\x6c\x69\143\x6b\x3d\x22\145\x78\160\157\162\164\145\170\x63\145\x6c\x61\162\164\151\x6d\157\x76\x69\x6c\50\51\x3b\42\x3e\74\x69\x6d\x67\x20\163\162\143\x3d\42" . base_url() . "\x69\155\141\147\x65\163\57\170\154\163\56\x70\x6e\147\x22\40\141\x6c\164\75\x22\105\170\160\x6f\162\164\x20\x4c\x69\163\x74\40\x4d\157\166\151\154\x22\40\x74\x69\164\x6c\x65\75\x22\x45\170\160\157\162\164\40\x4c\x69\163\x74\40\x4d\157\166\x69\154\42\x20\x73\164\x79\154\x65\x3d\x22\x77\151\x64\x74\150\72\62\60\160\x78\x3b\150\145\x69\x67\x68\164\72\x32\x30\160\170\x3b\142\x6f\162\144\145\x72\72\60\x3b\x22\76\x3c\x2f\x61\76\74\57\164\x64\x3e\12\40\x20\40\x20\x20\40\40\x20\x20\40\40\x20\74\x74\x64\x20\143\154\x61\163\x73\x3d\x22\x77\x33\x2d\143\x65\156\x74\x65\162\40\x77\x33\x2d\x62\164\x6e\42\76\x3c\141\x20\157\156\x63\x6c\151\x63\153\75\42\x72\145\147\x61\162\x74\151\50\51\x3b\42\76\74\151\155\x67\x20\x73\x72\143\x3d\x22" . base_url() . "\x69\155\141\147\x65\163\x2f\x72\x65\147\x69\x73\x74\162\x61\x72\x2e\x70\156\x67\42\x20\x61\x6c\x74\75\x22\x52\x65\147\151\163\164\162\141\162\40\101\x72\x74\151\x63\x75\154\x6f\42\40\164\151\164\154\145\x3d\x22\x52\145\147\x69\x73\164\x72\x61\x72\x20\101\162\x74\x69\143\165\x6c\x6f\x22\x20\163\164\x79\x6c\145\x3d\42\x77\x69\144\164\x68\72\x32\60\160\x78\73\x68\x65\x69\x67\150\164\72\62\x30\x70\170\73\x62\x6f\x72\144\x65\x72\72\60\x3b\42\76\74\x2f\141\x3e\74\x2f\x74\x64\76\12\40\x20\40\x20\40\40\40\40\40\40\x20\40\x3c\164\144\x20\143\x6c\141\163\x73\75\x22\x77\x33\55\143\145\156\x74\x65\x72\40\167\63\55\142\x74\156\42\76\74\141\x20\x6f\x6e\x63\x6c\x69\x63\153\75\42\x65\x64\x69\164\x61\x72\x74\151\x28\51\73\42\76\x3c\x69\155\x67\x20\x73\162\x63\75\42" . base_url() . "\151\155\141\147\145\163\57\145\144\151\164\x61\162\x2e\x70\156\x67\42\40\x61\x6c\x74\x3d\x22\x45\x64\151\x74\141\162\x20\x41\x72\x74\151\x63\165\154\157\42\40\164\151\164\x6c\x65\75\x22\105\x64\151\164\x61\162\40\101\x72\x74\151\x63\x75\x6c\x6f\42\x20\x73\164\171\x6c\145\75\x22\167\x69\x64\x74\150\x3a\62\60\x70\x78\73\x68\x65\x69\147\150\x74\x3a\x32\x30\x70\170\x3b\142\x6f\162\x64\x65\162\72\x30\73\42\76\74\57\x61\76\74\57\164\x64\x3e\12\x20\x20\x20\40\40\40\40\40\40\x20\x20\40\x3c\164\x64\40\x63\154\141\163\163\x3d\x22\167\63\55\143\145\x6e\x74\145\x72\x20\x77\63\x2d\142\x74\156\x22\76\x3c\x61\40\157\x6e\x63\154\x69\x63\x6b\x3d\42\141\x63\164\151\x76\x61\141\x72\x74\x28\51\x3b\42\x3e\74\151\155\x67\40\163\x72\x63\75\42" . base_url() . "\151\x6d\141\147\x65\x73\x2f\141\152\x75\x73\164\145\x73\x2e\160\156\x67\x22\40\x61\x6c\164\75\x22\x41\x63\164\x69\x76\x61\x72\x2f\111\156\141\x63\x74\x69\x76\x61\x72\x22\x20\164\x69\x74\x6c\x65\75\42\101\143\164\151\x76\141\x72\x2f\x49\156\141\143\x74\x69\x76\x61\x72\42\x20\x73\x74\x79\154\x65\x3d\x22\167\x69\x64\x74\x68\x3a\62\x30\x70\170\x3b\150\x65\151\147\150\164\72\62\x30\x70\170\73\x62\157\162\x64\145\162\72\60\73\x22\76\x3c\x2f\141\x3e\74\57\x74\x64\76\12\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\74\164\144\40\143\154\141\163\x73\x3d\42\167\x33\x2d\x63\x65\156\x74\145\162\40\x77\63\55\142\164\156\42\x3e\74\141\40\157\156\143\x6c\151\143\153\x3d\x22\x61\152\x75\163\164\x65\x61\x72\164\151\x28\51\73\42\x3e\74\151\x6d\x67\x20\x73\x72\143\75\42" . base_url() . "\x69\155\141\x67\145\x73\57\141\152\x75\x73\164\x65\x2e\x70\x6e\x67\x22\40\x61\154\164\x3d\42\101\152\x75\x73\x74\x61\x72\x20\x49\156\x76\x65\x6e\164\x61\x72\x69\x6f\42\40\x74\x69\x74\x6c\145\x3d\42\101\152\x75\163\x74\x61\162\40\111\156\x76\145\x6e\x74\x61\162\x69\157\x22\40\163\164\171\154\145\75\42\x77\x69\x64\x74\150\72\x32\60\x70\170\73\x68\145\x69\147\x68\x74\x3a\x32\x30\x70\170\73\142\157\x72\144\x65\x72\72\x30\x3b\42\76\74\57\x61\76\x3c\57\x74\x64\76\xa\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\74\164\x64\40\143\154\x61\163\x73\x3d\42\x77\x33\x2d\x63\145\156\x74\145\x72\40\167\x33\x2d\x62\164\x6e\x22\76\74\x61\x20\x6f\156\x63\154\151\x63\153\75\42\141\162\164\x69\143\x75\154\157\50\x29\x3b\42\x3e\x3c\x69\155\147\x20\163\162\x63\x3d\42" . base_url() . "\x69\x6d\141\x67\145\163\x2f\x72\x65\x6c\157\x61\x64\56\x70\x6e\x67\x22\x20\141\154\x74\75\x22\x52\x65\143\141\162\x67\x61\x72\x22\40\164\151\x74\154\145\x3d\42\x52\x65\x63\x61\x72\147\141\162\42\40\163\164\171\154\x65\75\42\167\x69\144\164\x68\72\62\60\160\x78\x3b\150\145\x69\x67\x68\x74\x3a\62\60\x70\x78\x3b\x62\157\162\144\145\x72\x3a\x30\73\42\76\74\57\141\x3e\74\57\164\144\x3e\74\57\x74\x72\76\12\x20\x20\40\40\40\40\x20\x20\40\x20\x20\40\74\57\164\141\x62\x6c\x65\76\74\142\162\x3e\12\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x3c\164\141\x62\x6c\x65\40\x69\144\75\x22\x69\144\60\61\x22\x20\x63\x6c\x61\163\163\x3d\x22\167\63\x2d\164\x61\x62\154\x65\55\x61\x6c\154\x20\167\63\x2d\x68\157\x76\145\x72\x61\x62\x6c\145\40\167\x33\x2d\x6c\x65\x66\x74\x2d\141\x6c\x69\147\x6e\40\167\63\x2d\164\x69\x6e\x79\42\x3e\74\164\162\x20\143\x6c\141\163\x73\x3d\x22\x77\x33\55\x66\x6f\x6e\144\x6f\x64\162\x6f\151\144\40\167\x33\x2d\x66\151\x6a\157\x22\x3e\74\x74\150\x3e\120\162\x6f\x64\x75\x63\x74\x6f\x3c\x2f\x74\150\76\74\164\150\x3e\120\x72\x69\x6e\x63\x69\160\x69\157\74\x2f\x74\150\x3e\x3c\x74\x68\76\115\x61\x72\x63\141\74\x2f\164\150\76\74\x74\150\x3e\115\x6f\156\x65\144\x61\x3c\57\x74\150\x3e\x3c\164\150\x3e\104\x69\x61\x73\56\x49\x3c\57\x74\150\x3e\x3c\x74\x68\x3e\104\x69\x61\163\x2e\103\74\57\164\150\x3e\x3c\164\150\x3e\x50\162\145\143\151\157\x31\74\x2f\164\150\x3e\x3c\x74\150\76\x49\126\101\x3c\x2f\164\x68\76\x3c\164\150\76\x50\162\x65\x63\151\x6f\x66\x69\156\x31\74\57\164\150\76\12\x20\40\40\40\x20\x20\40\40\40\x20\40\40\x3c\164\150\x3e\x45\170\151\x73\164\x65\156\x3c\57\164\150\x3e\74\x74\x68\x3e\103\x6f\155\x70\x3c\57\164\x68\x3e\x3c\164\x68\76\105\x73\x74\141\x74\x75\163\x3c\57\x74\x68\x3e\74\x2f\164\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->controlado == 1) { $leg = "\x63\154\141\x73\163\x3d\42\x77\x33\55\160\151\156\x6b\42"; } else { $leg = ''; } if ($dtfac->existen > 0) { $color2 = "\143\x6c\141\x73\163\75\x22\167\x33\x2d\147\162\x65\145\156\x22"; } else { $color2 = "\143\154\141\x73\x73\75\x22\167\63\x2d\162\x65\x64\x22"; } if ($dtfac->para_web > 0) { $color = "\x63\x6c\x61\163\x73\75\x22\167\63\55\147\162\145\x65\156\x22"; $status = "\101\x63\x74\x69\166\157"; } else { $color = "\x63\154\141\163\x73\x3d\42\x77\63\55\x72\145\144\42"; $status = "\111\x6e\x61\143\x74\x69\166\x6f"; } if ($dtfac->moneda == "\126\105") { $monen = "\x20\x42\163"; } else { $monen = "\40\44"; } $html .= "\x3c\x74\x72\40\151\x64\x3d\x22\x73\154\x65\x63\x74" . $i . "\x22\40\x63\154\x61\163\x73\x3d\x22\x69\x74\145\x6d\42\40\157\x6e\x63\x6c\151\143\x6b\75\42\151\164\141\162\164\50\44\50\x27\43\x61" . $i . "\47\51\56\166\141\154\x28\51\51\x3b\x22\76"; $html .= "\x3c\151\156\x70\x75\x74\40\164\171\x70\145\x3d\42\x68\x69\x64\x64\145\156\x22\x20\151\x64\x3d\42\x61" . $i . "\x22\x20\156\141\x6d\x65\75\42\x63\157\144\x69\x67\x6f\42\40\x76\141\x6c\165\x65\x3d\x22" . $dtfac->codigo . "\42\76\xa\40\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\40\x20\x3c\x74\144\40" . $leg . "\x3e\x3c\151\x6e\160\x75\x74\40\x74\x79\160\x65\75\x22\x63\x68\145\x63\153\x62\157\170\42\40\157\x6e\x63\x6c\151\143\x6b\75\x22\x77\x33\x2e\x74\157\147\x67\x6c\145\x43\x6c\x61\163\x73\x28\47\43\163\154\145\x63\x74" . $i . "\47\54\x27\167\63\x2d\x79\145\154\154\157\x77\x27\51\x3b\42\x20\143\154\141\x73\163\x3d\42\x77\x33\x2d\x63\150\x65\143\x6b\42\40\156\141\155\145\x3d\x22\x63\x68\x65\x63\153\42\76" . $dtfac->produc . "\74\x2f\x74\x64\x3e\74\164\x64\x3e" . $dtfac->referencia . "\x3c\57\x74\144\76\74\x74\x64\76" . $dtfac->lab . "\x3c\57\x74\x64\76\x3c\x74\144\76" . $monen . "\x3c\x2f\x74\144\x3e\x3c\x74\x64\x3e" . $dtfac->diasindex . "\74\x2f\x74\x64\76\74\x74\144\76" . $dtfac->diascred . "\x3c\57\x74\144\x3e\xa\40\40\40\x20\x20\40\40\40\40\40\40\40\40\x20\x20\x20\x3c\x74\144\x3e" . $dtfac->precio1 . "\74\x2f\164\144\76\74\x74\144\x3e" . $dtfac->iva . "\74\57\164\x64\x3e\74\164\x64\76" . $dtfac->preciofin1 . "\x3c\57\x74\144\x3e\74\x74\x64\x20" . $color2 . "\76" . $dtfac->existen . "\74\57\x74\144\76\x3c\164\x64\x3e" . $dtfac->comp . "\74\x2f\x74\144\x3e\74\x74\144\x20" . $color . "\x3e" . $status . "\74\x2f\x74\144\x3e\xa\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\74\x2f\164\162\76"; } $html .= "\74\164\x72\x3e\74\x74\x64\40\143\154\x61\x73\163\75\x22\x77\63\55\x63\145\156\164\145\x72\40\x77\x33\x2d\x66\157\156\x64\x6f\x64\162\x6f\151\144\42\x20\x63\157\x6c\x73\160\x61\156\75\x22\61\x33\x22\x3e\74\x6c\x61\x62\x65\x6c\x20\x63\x6c\141\x73\x73\x3d\42\167\63\55\x6c\141\x72\x67\145\x22\x3e\74\x62\x3e\x54\x6f\164\x61\154\40\x50\162\x6f\144\x75\x63\164\x6f\x3a\x20" . $totalreg . "\x3c\x2f\142\76\x3c\x2f\x6c\x61\142\x65\x6c\x3e\74\x2f\164\144\x3e\x3c\x2f\164\162\76\x3c\57\x74\x61\x62\x6c\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\40\40\40\40\40\x20\x20\x20\40\40\x20\x20\40\x20\40\74\163\x63\x72\x69\x70\x74\40\164\x79\160\145\x3d\42\164\x65\170\x74\x2f\152\141\166\x61\x73\143\162\151\160\x74\x22\x3e\xa\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x66\x75\156\x63\x74\x69\x6f\156\40\x44\x65\143\162\x65\x6d\x65\156\164\x4e\x75\155\50\51\x7b\x20\x62\x65\146\x6f\x72\x65\x28\x29\x3b\xa\40\x20\x20\40\40\40\40\40\40\40\40\x20\x20\40\40\40\x20\x20\40\x20\x76\141\x72\x20\104\x65\143\162\x65\x6d\145\x6e\x74\x4e\x75\155\75\144\157\x63\165\155\145\x6e\164\x2e\147\145\x74\x45\x6c\145\x6d\x65\x6e\x74\x42\x79\111\x64\50\42\x44\145\x63\x72\x65\x6d\x65\156\x74\x4e\165\155\42\x29\56\x76\x61\154\x75\145\x3b\xa\40\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\40\x20\40\40\40\40\166\x61\162\40\x6b\145\171\75\42\x64\162\x6f\x69\144\x39\60\x33\x22\x3b\x20\x76\141\162\40\x6c\x69\153\x65\x3d\x24\50\x22\x23\154\x69\153\145\42\x29\x2e\166\x61\x6c\50\x29\x3b\xa\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\40\40\40\x76\141\x72\40\144\141\164\157\x73\40\x3d\40\x7b\xa\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\40\x20\40\40\42\160\141\x67\x22\x20\x3a\x20\x44\x65\143\162\145\x6d\x65\x6e\x74\x4e\x75\x6d\x2c\12\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\x22\153\145\171\42\40\72\x20\153\145\171\x2c\154\151\153\x65\72\154\x69\x6b\x65\xa\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\40\40\x7d\73\12\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\xa\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\x24\x2e\141\152\x61\x78\x28\173\12\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x64\141\x74\141\72\x20\144\141\164\x6f\163\54\12\40\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x75\x72\154\72\40\40\x62\141\x73\145\165\162\x6c\x2b\x22\x63\x5f\144\162\157\x69\x64\57\x61\162\164\x69\x63\x75\x6c\157\42\x2c\12\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x74\171\x70\x65\72\x20\x22\x50\117\x53\124\42\54\xa\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x73\x75\x63\143\x65\x73\x73\x3a\x20\146\x75\156\143\x74\151\x6f\156\x28\x64\141\164\141\x29\x20\x7b\xa\40\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\40\x20\44\50\42\x23\142\157\x64\171\42\x29\56\150\x74\x6d\x6c\50\144\141\164\141\x29\x3b\40\x24\50\x22\43\x6c\151\153\145\42\51\56\166\141\154\50\154\151\x6b\145\51\x3b\40\x73\167\x61\154\56\x63\x6c\157\163\145\x28\51\12\40\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\x7d\12\x20\40\40\x20\40\40\40\40\40\x20\40\40\x20\40\x20\x20\40\x20\40\12\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\40\175\51\x3b\xa\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x7d\12\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\12\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x66\x75\156\x63\x74\151\x6f\x6e\40\156\165\155\160\141\x67\50\141\51\173\40\142\x65\146\x6f\x72\145\50\51\x3b\xa\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x76\x61\x72\40\153\145\171\x3d\42\x64\162\x6f\x69\x64\x39\60\63\x22\73\12\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x76\x61\162\40\x6c\151\x6b\145\75\44\x28\x22\x23\154\151\x6b\145\42\x29\56\x76\141\154\x28\x29\x3b\12\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\40\40\x20\40\166\x61\x72\40\144\141\164\x6f\163\x20\75\40\173\12\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\42\153\145\x79\x22\x3a\x6b\x65\x79\54\xa\40\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\x22\160\141\x67\x22\x20\72\x20\x61\54\154\151\x6b\x65\x3a\x6c\x69\153\145\12\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\40\40\x20\40\x20\x20\40\x7d\73\12\x20\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\xa\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\x24\x2e\x61\152\141\170\x28\x7b\xa\40\40\40\x20\40\40\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\x20\x20\x64\141\164\x61\x3a\x20\x64\x61\x74\x6f\163\x2c\12\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\40\x20\165\162\154\72\x20\142\x61\163\145\165\162\154\x2b\42\x63\x5f\144\x72\x6f\151\x64\57\x61\x72\164\151\143\165\154\157\42\x2c\12\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\164\x79\x70\x65\72\40\x22\120\117\123\x54\x22\54\xa\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\40\40\40\x20\40\40\40\40\x20\40\x20\x20\x20\x73\x75\x63\x63\x65\x73\163\72\x20\146\165\x6e\x63\164\x69\x6f\x6e\x28\144\x61\x74\x61\x29\40\173\12\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\x20\40\40\44\50\x22\x23\142\x6f\x64\171\42\x29\x2e\150\x74\x6d\x6c\50\144\141\164\x61\51\x3b\40\44\x28\x22\43\154\151\153\145\x22\51\x2e\x76\141\x6c\x28\154\x69\x6b\x65\51\73\40\x73\167\x61\x6c\56\x63\x6c\x6f\x73\145\50\51\xa\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\175\12\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\xa\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\x7d\x29\73\xa\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x7d\12\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\12\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\146\165\156\x63\x74\x69\x6f\156\x20\x49\x6e\x63\x72\x69\x6d\145\x6e\x74\116\x75\155\50\x29\x7b\x20\142\145\146\x6f\162\145\x28\51\x3b\xa\40\40\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\166\x61\x72\x20\x49\156\x63\162\151\155\x65\156\x74\x4e\165\155\75\x64\x6f\x63\x75\155\x65\x6e\164\x2e\x67\145\164\x45\x6c\x65\x6d\x65\x6e\164\x42\x79\111\144\50\x22\111\156\143\162\151\x6d\145\156\164\116\x75\x6d\x22\x29\56\x76\x61\154\165\x65\73\12\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\40\166\141\x72\40\x6b\145\x79\x3d\x22\x64\x72\x6f\151\x64\x39\60\63\42\73\40\x76\141\162\40\154\x69\153\145\x3d\x24\50\x22\x23\x6c\151\x6b\x65\42\51\x2e\x76\x61\154\x28\x29\73\xa\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\40\40\40\166\x61\x72\40\x64\141\164\157\163\x20\x3d\x20\173\xa\x20\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x22\153\145\x79\42\72\x6b\145\171\x2c\xa\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x22\160\141\x67\x22\x20\72\x20\x49\156\x63\162\x69\155\x65\156\164\x4e\165\x6d\x2c\154\151\x6b\145\x3a\x6c\151\x6b\x65\12\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\x7d\x3b\xa\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\12\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\44\x2e\141\152\141\x78\50\173\xa\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\40\x20\40\40\40\40\x64\141\164\141\72\40\144\x61\164\x6f\x73\x2c\12\40\x20\40\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x75\162\x6c\72\40\40\142\141\163\x65\x75\162\154\x2b\x22\x63\x5f\144\x72\157\151\x64\57\141\x72\x74\x69\x63\x75\x6c\157\42\x2c\xa\x20\40\x20\40\x20\40\x20\40\40\40\40\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\164\171\160\145\72\x20\x22\x50\x4f\x53\x54\42\x2c\xa\40\x20\40\x20\x20\40\40\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\40\40\x73\x75\x63\x63\x65\163\x73\72\40\146\165\x6e\x63\x74\151\x6f\156\50\x64\x61\x74\x61\51\x20\173\12\40\40\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\x24\50\x22\x23\142\157\x64\x79\42\x29\56\150\x74\155\154\x28\144\x61\x74\x61\51\x3b\x20\44\x28\x22\x23\x6c\151\x6b\x65\x22\x29\x2e\x76\x61\x6c\50\154\151\153\x65\51\x3b\40\x73\x77\x61\154\56\143\x6c\157\x73\145\x28\x29\xa\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\175\xa\40\40\x20\x20\40\x20\x20\40\x20\40\40\40\40\40\40\x20\40\40\40\12\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x7d\51\73\12\40\x20\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\175\12\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\74\x2f\163\143\162\x69\160\x74\76\12\x20\x20\x20\x20\40\40\x20\40\40\x20\40\40\40\x20\x20\x20\74\x64\x69\x76\x20\x63\x6c\x61\163\x73\75\42\167\63\x2d\142\x61\x72\x20\x77\63\x2d\x62\x6f\x72\x64\145\162\40\x77\63\55\142\141\x72\162\141\x73\x22\76\xa\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x3c\151\156\x70\165\x74\40\x74\x79\x70\145\75\42\x68\x69\x64\144\x65\x6e\42\x20\151\144\x3d\42\104\x65\143\162\145\155\145\x6e\x74\x4e\165\x6d\x22\40\x76\x61\154\x75\x65\75\42" . $DecrementNum . "\42\x3e\12\x20\40\40\40\40\40\x20\x20\40\x20\40\40\40\x20\40\40\74\141\x20\x6f\x6e\x63\x6c\x69\143\153\75\x22\104\x65\x63\x72\145\155\145\156\x74\x4e\165\x6d\50\51\x3b\42\x20\143\x6c\141\x73\x73\x3d\42\167\x33\55\x62\x61\162\x2d\151\x74\145\155\x20\167\x33\x2d\x62\165\164\x74\x6f\156\x22\76\46\154\141\161\165\x6f\x3b\x3c\57\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\141\147\151\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\63\55\146\157\156\x64\157\144\162\157\151\144"; $html .= "\xa\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\x3c\x69\x6e\x70\165\164\x20\164\171\x70\145\75\42\150\x69\144\144\145\x6e\x22\40\x69\x64\x3d\x22" . $id . "\x22\40\166\x61\154\165\145\x3d\x22" . $i . "\42\x3e\12\40\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\40\40\x3c\141\40\157\x6e\x63\154\151\x63\x6b\x3d\42\156\165\155\x70\141\147\50\x24\50\47\x23" . $id . "\47\51\56\x76\x61\154\x28\x29\x29\73\x22\40\143\154\x61\x73\x73\x3d\42\x77\63\55\x62\x61\x72\x2d\151\164\145\x6d\x20\x77\63\55\x62\165\x74\164\x6f\156\x20" . $hover . "\42\76" . $i . "\74\57\x61\76"; } else { $hover = ''; $html .= "\x3c\x69\156\x70\165\x74\40\164\x79\x70\145\75\42\150\x69\x64\x64\145\156\x22\x20\151\144\75\42" . $id . "\x22\40\166\141\154\165\145\x3d\x22" . $i . "\x22\x3e\xa\x20\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\40\40\74\x61\x20\157\x6e\x63\154\151\x63\153\75\x22\x6e\165\x6d\x70\x61\x67\50\x24\50\47\x23" . $id . "\47\51\56\166\141\154\50\x29\51\73\x22\40\x63\x6c\x61\163\163\75\42\x77\x33\55\x62\141\x72\55\151\x74\145\x6d\x20\167\63\x2d\142\x75\x74\x74\157\x6e\x20" . $hover . "\x22\x3e" . $i . "\x3c\x2f\x61\x3e"; } } } $html .= "\x3c\x69\x6e\160\x75\164\x20\164\x79\x70\145\75\42\150\151\x64\144\x65\x6e\x22\x20\151\x64\75\x22\111\x6e\143\x72\151\x6d\x65\x6e\164\x4e\165\x6d\x22\x20\x76\x61\154\x75\x65\x3d\x22" . $IncrimentNum . "\x22\76\12\40\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\74\141\x20\157\156\x63\x6c\x69\143\153\75\42\x49\156\143\x72\x69\155\x65\x6e\x74\116\x75\155\50\51\73\42\40\x63\x6c\x61\163\x73\75\42\x77\x33\x2d\x62\x61\x72\x2d\x69\x74\x65\x6d\x20\167\63\55\142\165\x74\164\157\156\x22\76\46\x72\141\161\165\x6f\x3b\x3c\x2f\141\76\xa\x20\40\40\x20\40\x20\x20\40\12\40\x20\40\40\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\74\x2f\144\151\x76\x3e\x20"; return $html; } public function itart($a) { $this->load->library("\x74\x61\142\154\145"); $bdfac = $this->db->query("\123\x45\x4c\105\x43\124\40\143\x6f\x64\x69\147\157\x61\x72\x74\x2c\x61\154\x6d\x61\x63\145\156\54\x72\x65\143\145\160\143\x69\x6f\x6e\x2c\x6c\x6f\x74\145\54\145\x6c\141\x62\x2c\166\x65\x6e\x63\145\x2c\x75\142\151\x63\x61\54\x52\117\x55\116\x44\50\x63\141\x6e\164\151\x64\141\x64\54\60\x29\x20\143\141\156\x74\151\144\x61\x64\54\x52\x4f\x55\116\104\x28\x63\157\156\x73\165\155\151\144\x6f\54\60\x29\40\143\x6f\156\163\x75\x6d\x69\144\x6f\54\x52\117\x55\x4e\x44\x28\143\141\156\x74\151\144\x61\144\55\x63\157\x6e\x73\165\155\151\x64\157\x2c\60\x29\x20\145\x78\151\x73\164\x65\156\40\106\x52\x4f\x4d\x20\x61\162\164\151\x6c\157\164\x65\x73\x20\127\110\x45\x52\105\x20\x63\x6f\144\151\x67\x6f\141\x72\x74\75\x27{$a}\47")->result(); $html = "\12\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x3c\141\40\x6f\x6e\x63\154\x69\143\153\x3d\x22\145\144\151\x74\154\157\164\x65\50\51\73\x22\x20\143\154\x61\163\163\75\x22\x77\x33\55\142\x74\156\x22\76\x3c\x69\x6d\x67\40\163\x72\x63\75\x22" . base_url() . "\151\155\141\x67\145\x73\x2f\145\144\x69\164\x61\x72\x2e\x70\x6e\x67\x22\x20\141\x6c\x74\x3d\x22\x45\x64\x69\164\141\x72\40\114\x6f\164\x65\x22\x20\x74\151\x74\154\145\x3d\x22\x45\144\151\164\x61\x72\x20\x4c\157\x74\x65\x22\x20\x73\x74\171\154\x65\75\x22\167\151\x64\164\x68\72\62\60\160\x78\73\x68\145\x69\x67\x68\164\72\x32\60\x70\x78\73\x62\157\162\144\145\x72\72\x30\x3b\x22\76\x3c\57\141\x3e\12\40\x20\40\x20\40\40\40\x20\40\40\40\x20\40\40\x20\x20\x3c\164\141\142\x6c\145\40\x69\x64\x3d\x22\151\144\60\61\x22\x20\x63\x6c\141\x73\x73\75\42\167\63\x2d\x74\x61\x62\154\145\55\141\154\154\40\167\63\x2d\x68\x6f\x76\x65\162\141\x62\154\x65\40\x77\x33\55\154\x65\x66\x74\x2d\141\x6c\151\147\x6e\40\167\63\x2d\x74\151\156\171\42\x3e\x3c\164\162\x20\x63\x6c\141\163\x73\x3d\x22\167\x33\55\146\157\156\x64\x6f\x64\x72\x6f\x69\x64\x22\x3e\74\164\150\76\x41\x6c\155\141\x63\x65\x6e\x3c\57\164\150\76\x3c\164\150\76\122\145\143\145\160\x63\151\x6f\156\74\57\x74\x68\x3e\x3c\x74\150\76\114\157\164\x65\x3c\x2f\164\150\x3e\74\164\150\x3e\x45\x6c\x61\x62\x3c\x2f\x74\150\x3e\x3c\x74\150\x3e\x56\145\x6e\x63\x65\74\57\164\x68\x3e\x3c\164\150\x3e\125\142\x69\x63\x61\74\57\164\x68\x3e\x3c\x74\x68\x3e\x43\x61\x6e\164\x69\144\x61\144\74\57\164\x68\x3e\x3c\164\150\x3e\143\x6f\x6e\x73\x75\155\151\144\x6f\74\x2f\x74\150\x3e\x3c\x74\x68\76\x45\x78\151\x73\x74\x65\156\x3c\x2f\x74\x68\76\74\57\x74\162\76"; $i = 0; $tot = 0; foreach ($bdfac as $dtfac) { $i++; $tot += $dtfac->existen; $html .= "\x3c\164\162\x20\x69\x64\x3d\x22\x73\x6c\x65\143\164" . $i . "\x22\x3e"; $html .= "\74\x69\x6e\x70\165\x74\x20\x74\x79\160\x65\75\x22\150\151\x64\144\145\156\x22\40\x6e\x61\x6d\x65\75\x22\x61\x6c\155\141\x63\145\156\x22\x20\x76\141\x6c\165\x65\75\42" . $dtfac->almacen . "\42\x3e\x20\x3c\x69\x6e\160\x75\164\x20\x74\x79\x70\x65\75\42\x68\x69\144\144\145\156\x22\40\x6e\141\155\x65\75\42\143\x6f\144\151\x67\x6f\x61\162\x74\x22\x20\166\x61\154\165\145\x3d\42" . $dtfac->codigoart . "\42\x3e\40\x3c\151\x6e\160\165\x74\x20\164\x79\160\145\x3d\x22\x68\x69\144\x64\x65\x6e\42\40\156\141\x6d\145\x3d\x22\154\157\x74\x65\x22\40\x76\141\154\165\x65\75\42" . $dtfac->lote . "\x22\x3e\12\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\40\x20\40\x20\x3c\151\x6e\x70\x75\164\x20\x74\171\160\145\75\42\x68\x69\x64\144\145\156\42\40\x6e\x61\x6d\145\75\42\x65\x6c\141\142\42\x20\166\x61\154\x75\x65\75\x22" . $dtfac->elab . "\x22\x3e\40\x3c\x69\x6e\x70\165\164\40\164\x79\x70\145\x3d\x22\150\x69\x64\144\145\x6e\42\40\x6e\x61\155\x65\x3d\x22\166\145\156\x63\x65\x22\x20\166\x61\154\165\x65\75\42" . $dtfac->vence . "\x22\x3e\74\x69\x6e\160\165\x74\40\x74\x79\x70\x65\x3d\42\x68\x69\144\x64\145\156\x22\x20\156\141\x6d\145\75\42\x75\x62\151\x63\141\x22\x20\x76\x61\x6c\165\x65\x3d\42" . $dtfac->ubica . "\42\x3e\xa\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x3c\x74\144\76\74\x69\156\x70\x75\x74\40\x74\x79\x70\145\75\x22\143\150\x65\x63\x6b\142\x6f\x78\42\x20\x6e\141\x6d\145\75\x22\162\157\x77\x69\164\141\x72\x74\42\x20\143\x6c\x61\x73\163\75\42\x77\x33\55\143\150\x65\x63\153\42\40\157\156\143\x6c\151\143\153\x3d\42\x77\63\56\164\x6f\147\x67\x6c\145\x43\154\x61\x73\x73\50\x27\x23\163\x6c\145\143\164" . $i . "\x27\54\x27\x77\x33\55\x79\x65\x6c\x6c\157\x77\x27\x29\x3b\x22\x3e" . $dtfac->almacen . "\74\x2f\x74\144\76\74\x74\x64\76" . $dtfac->recepcion . "\74\x2f\164\x64\x3e\x3c\164\144\x3e" . $dtfac->lote . "\x3c\x2f\164\x64\x3e\74\x74\144\x3e" . $dtfac->elab . "\74\57\x74\x64\76\74\164\144\76" . $dtfac->vence . "\x3c\x2f\x74\x64\x3e\74\x74\x64\x3e" . $dtfac->ubica . "\x3c\x2f\x74\144\x3e\74\x74\144\76" . $dtfac->cantidad . "\x3c\x2f\x74\x64\x3e\74\164\144\x3e" . $dtfac->consumido . "\74\57\x74\144\x3e\x3c\164\x64\x3e" . $dtfac->existen . "\74\57\164\144\76\xa\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x3c\x2f\164\x72\76"; } $html .= "\x3c\x74\162\x20\x63\154\141\163\163\75\42\167\63\x2d\146\157\x6e\144\x6f\144\162\x6f\151\144\40\167\x33\x2d\x6d\x65\x64\151\x75\x6d\x22\x3e\74\x74\x64\40\143\x6f\x6c\x73\x70\x61\156\75\x22\70\42\x20\x63\x6c\x61\x73\x73\x3d\42\x77\63\x2d\143\145\x6e\164\x65\x72\42\76\x20\x3c\x62\x3e\124\x6f\x74\x61\x6c\40\x45\x78\151\163\164\x65\x6e\143\x69\x61\x3a\x3c\x2f\x62\76\x20\74\57\164\x64\76\x3c\164\x64\76" . $tot . "\74\57\x74\x64\x3e\74\57\x74\162\x3e\74\x2f\164\141\x62\x6c\145\76"; return $html; } public function conteo($a, $b) { $this->load->library("\x74\141\142\154\145"); if ($b != '') { $filter = "\127\x48\x45\122\105\40\142\56\x6e\x6f\155\x62\162\145\x20\154\151\153\145\40\47\45{$b}\45\47\40\174\174\40\x63\56\156\157\x6d\141\x70\x65\40\x6c\x69\x6b\145\40\47\45{$b}\x25\47\x20\x26\46\x20\x61\x2e\146\162\x65\147\76\x27\62\x30\x32\x33\x2d\61\x32\x2d\x32\x39\x27"; } else { $filter = "\127\110\105\122\105\x20\141\56\x66\162\145\x67\x3e\x27\x32\60\x32\x33\55\x31\62\55\x32\x39\x27"; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\x4c\105\x43\x54\x20\x4e\x55\114\114\x20\x46\x52\x4f\x4d\x20\x63\x6f\x6e\x74\x65\x6f\x20\x61\xa\x20\40\40\40\40\x20\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\x20\x4a\117\111\116\40\160\162\x6f\x76\x65\145\x64\40\x62\x20\x20\x4f\x4e\40\141\x2e\x70\x72\157\166\75\x62\x2e\x69\x64\40\114\x45\x46\x54\x20\x4a\117\x49\116\40\x74\x72\x61\x62\x20\x63\40\117\x4e\40\x63\56\151\x64\75\141\56\164\x72\141\x62\x20{$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\x45\114\x45\x43\x54\40\x61\56\151\x64\54\x62\56\156\157\155\x62\162\145\40\x70\x72\x6f\166\54\x20\x61\56\x66\162\x65\x67\x2c\x20\x61\56\146\141\163\x69\x67\54\x20\x61\x2e\x66\x74\x65\162\155\54\12\40\40\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\143\x2e\x6e\157\155\141\160\145\x20\164\x72\x61\142\54\40\x61\56\x66\x72\145\x67\62\54\x61\56\146\x61\x73\151\147\x32\x2c\141\56\146\x74\145\162\155\62\54\141\56\141\x6a\x63\157\156\164\54\141\x2e\163\x74\141\x74\x75\163\x20\106\122\117\115\40\x63\157\156\164\x65\157\x20\x61\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x4a\117\111\116\40\160\x72\x6f\166\145\x65\144\40\x62\40\x20\x4f\116\x20\x61\x2e\x70\162\157\166\x3d\142\56\151\x64\40\x4c\105\106\x54\x20\x4a\117\111\116\40\164\x72\141\142\x20\x63\40\x4f\x4e\x20\143\56\x69\144\x3d\x61\56\x74\x72\x61\x62\40{$filter}\x20\x4f\x52\x44\x45\x52\x20\102\131\x20\x61\x2e\x69\x64\x20\104\x45\123\103\40\114\x49\x4d\x49\124\x20" . ($a - 1) * $mostrar . "\40\x2c\40" . $mostrar . "\x3b")->result(); $bdtrab = $this->db->query("\x53\105\114\x45\103\x54\40\x64\56\x69\144\54\40\x64\x2e\156\157\155\x61\160\145\x20\106\122\117\115\x20\164\x72\141\142\40\x41\123\40\x64\40\127\110\x45\122\105\40\x64\x2e\164\151\x70\x3d\x27\63\x27")->result(); $trab = "\x3c\x6f\x70\x74\151\157\x6e\x20\166\141\154\165\145\75\x22\x22\x20\x73\x65\x6c\x65\143\164\145\144\x20\144\151\x73\x61\x62\x6c\145\144\76\x53\x65\154\x65\x63\x63\151\x6f\x6e\x65\x3c\57\157\160\x74\151\x6f\156\76"; foreach ($bdtrab as $dttrab) { $trab .= "\74\157\x70\x74\x69\157\x6e\40\166\x61\x6c\x75\x65\x3d\x22" . $dttrab->id . "\42\76" . $dttrab->nomape . "\74\57\157\x70\164\151\x6f\156\76"; } $html = "\xa\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x3c\x74\x61\x62\x6c\145\x20\143\154\141\163\163\x3d\x22\x77\63\55\x74\141\142\154\145\x2d\141\154\x6c\40\167\x33\55\x68\157\166\145\162\141\142\154\x65\40\x77\63\x2d\154\x65\x66\164\55\141\154\x69\x67\x6e\42\76\12\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\40\x3c\164\162\76\x3c\164\x64\x20\143\154\141\163\163\75\42\167\63\x2d\146\157\x6e\x64\x6f\144\162\157\x69\144\42\x3e\102\165\x73\x63\x61\162\x20\74\151\155\x67\40\163\162\x63\x3d\x22" . base_url() . "\x69\155\x61\147\x65\163\57\x62\165\x73\x63\141\162\x2e\x70\156\x67\x22\x20\x61\x6c\164\x3d\42\x42\x75\x73\x63\141\162\x22\x20\164\151\x74\x6c\145\x3d\42\102\x75\x73\x63\x61\x72\x22\40\x73\164\x79\154\145\75\42\167\151\144\x74\x68\72\x31\x38\x70\170\73\142\x6f\x72\144\145\162\x3a\60\x3b\42\76\x3c\57\164\144\76\12\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\74\164\144\x3e\x3c\x69\x6e\x70\x75\164\x20\x74\x79\x70\x65\75\x22\164\x65\x78\164\x22\x20\143\154\141\x73\163\75\42\x77\x33\x2d\x69\x6e\x70\x75\x74\42\x20\x70\154\x61\x63\145\150\157\154\144\x65\162\x3d\x22\111\156\147\162\x65\163\145\40\x73\165\40\x62\165\x73\x71\x75\x65\x64\141\42\40\x6f\156\x63\x68\141\x6e\147\145\x3d\x22\x63\x6f\156\164\145\x6f\x28\x29\42\x20\x69\144\x3d\42\154\x69\153\145\x22\76\74\x2f\164\x64\76\xa\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\74\x74\x64\76\74\163\x65\x6c\145\143\164\40\x63\154\141\163\163\75\x22\x77\63\x2d\163\145\154\x65\x63\x74\x22\x20\151\144\x3d\x22\151\144\x5f\164\162\x61\x62\42\76" . $trab . "\x3c\x2f\163\145\154\x65\x63\x74\x3e\x3c\57\x74\144\76\12\40\40\40\x20\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\74\x74\x64\x3e\x3c\x73\145\154\145\143\x74\40\143\x6c\141\x73\x73\75\42\x77\63\x2d\x73\x65\154\x65\143\x74\42\x20\x69\x64\75\42\x74\151\x70\x22\x3e\74\x6f\160\164\151\157\156\40\166\x61\x6c\x65\75\x22\42\x20\144\151\x73\141\142\154\145\x64\x20\163\x65\154\x65\143\164\145\144\x3e\123\x65\154\x65\143\143\x69\x6f\x6e\x65\74\x2f\157\x70\164\x69\x6f\x6e\76\74\157\x70\x74\x69\157\156\x20\166\x61\154\165\x65\x3d\x22\61\x22\x3e\61\145\162\40\x43\157\x6e\164\145\157\x3c\57\x6f\160\x74\151\157\x6e\76\74\x6f\x70\x74\151\157\156\40\x76\x61\x6c\165\x65\75\x22\x32\42\x3e\x32\144\x6f\40\103\x6f\156\164\x65\157\74\x2f\157\160\x74\x69\157\156\x3e\x3c\57\x73\145\154\145\x63\x74\x3e\74\57\164\144\76\xa\x20\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\40\74\164\144\40\x63\154\x61\163\x73\x3d\x22\x77\63\x2d\x63\x65\156\164\x65\x72\40\x77\63\x2d\142\x74\156\x22\x3e\x3c\x61\x20\x6f\156\143\x6c\151\x63\153\75\x22\x61\x73\151\147\x63\x6f\156\x74\x65\157\x28\x29\x22\x3e\x3c\x69\x6d\x67\40\163\x72\x63\x3d\x22" . base_url() . "\x69\x6d\141\147\145\163\57\x62\156\56\x70\x6e\x67\x22\x20\x61\x6c\164\x3d\42\101\163\151\147\x6e\x61\x72\x22\x20\164\x69\x74\154\x65\x3d\42\x41\163\x69\147\156\141\x72\x22\x20\x73\x74\x79\x6c\x65\75\42\x77\151\x64\164\150\x3a\x32\60\160\x78\x3b\150\145\151\x67\x68\164\x3a\x32\x30\x70\x78\73\142\x6f\x72\144\145\x72\x3a\60\x3b\x22\76\x3c\x2f\x61\x3e\74\x2f\x74\144\x3e\xa\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x3c\x74\x64\x20\143\x6c\141\x73\x73\x3d\x22\x77\x33\55\x63\x65\x6e\164\x65\x72\40\167\63\x2d\x62\x74\156\42\76\74\141\x20\157\x6e\x63\154\151\143\153\x3d\x22\141\x6a\165\163\x74\145\143\x6f\x6e\164\x65\x6f\x28\x29\73\42\x3e\74\x69\155\147\40\163\x72\143\75\42" . base_url() . "\151\x6d\x61\147\x65\163\x2f\x61\152\x75\163\x74\145\x73\x2e\x70\x6e\147\x22\x20\141\x6c\x74\x3d\x22\x41\x6a\165\x73\x74\141\x72\40\x49\156\x76\x65\x6e\x74\x61\162\151\x6f\x22\x20\164\x69\x74\154\145\x3d\x22\101\x6a\165\x73\164\141\x72\x20\x49\156\x76\145\x6e\x74\141\x72\x69\157\42\x20\x73\x74\x79\154\x65\x3d\x22\x77\151\144\x74\x68\x3a\62\x30\x70\170\73\x68\145\x69\147\x68\x74\x3a\62\60\160\170\x3b\x62\x6f\x72\x64\145\x72\72\x30\73\42\x3e\x3c\57\x61\x3e\74\57\x74\x64\x3e\xa\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\x20\x20\74\x74\144\40\143\154\x61\163\163\75\42\x77\x33\55\143\x65\x6e\x74\145\162\x20\167\x33\55\x62\164\x6e\x22\76\x3c\x61\40\157\156\143\154\151\143\153\x3d\x22\x72\145\x67\143\x6f\156\164\145\x6f\x28\51\x3b\x22\x3e\74\x69\155\x67\x20\x73\162\x63\x3d\x22" . base_url() . "\151\155\x61\147\145\163\57\162\x65\x67\151\x73\x74\x72\x61\162\56\x70\156\147\42\x20\141\x6c\164\75\42\x52\145\147\151\163\164\x72\141\x72\40\x43\x6f\156\164\145\157\x22\x20\x74\151\x74\154\x65\x3d\x22\x52\x65\x67\x69\x73\x74\162\141\x72\40\x43\157\x6e\x74\x65\x6f\42\40\163\164\x79\154\x65\x3d\x22\x77\151\144\x74\x68\x3a\x32\60\160\x78\73\150\x65\151\147\x68\164\72\62\x30\x70\x78\x3b\x62\x6f\162\144\x65\162\x3a\x30\73\42\x3e\x3c\57\141\x3e\74\57\x74\144\76\xa\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\x20\x20\40\x3c\164\144\40\143\x6c\141\x73\163\x3d\x22\167\x33\x2d\x63\145\x6e\x74\145\x72\x20\167\63\x2d\x62\x74\x6e\42\x3e\x3c\141\40\157\x6e\143\154\x69\x63\x6b\75\x22\x63\x6f\x6e\164\145\x6f\50\51\73\42\x3e\74\151\x6d\x67\x20\163\162\x63\x3d\42" . base_url() . "\x69\x6d\141\147\145\163\x2f\162\145\x6c\157\x61\144\56\x70\156\147\x22\x20\x61\x6c\164\x3d\42\x52\145\143\141\162\147\x61\162\x22\40\x74\151\164\x6c\x65\x3d\x22\122\x65\x63\141\x72\147\x61\x72\42\x20\x73\164\x79\x6c\x65\x3d\x22\x77\x69\144\x74\x68\72\62\60\160\170\73\150\x65\x69\147\150\x74\72\62\60\x70\170\73\142\x6f\x72\x64\x65\x72\72\x30\73\x22\76\74\57\x61\x3e\74\57\x74\x64\76\12\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x3c\164\x64\40\143\154\x61\163\163\75\x22\167\x33\55\143\145\x6e\x74\145\162\40\167\63\55\x62\164\x6e\x22\x3e\x3c\x61\x20\x6f\156\143\154\x69\143\x6b\75\42\145\x6c\x69\155\143\x6f\156\x74\145\x6f\x28\x29\x3b\x22\76\74\151\x6d\x67\x20\163\x72\x63\x3d\42" . base_url() . "\151\155\141\x67\x65\x73\57\142\157\x72\162\141\162\x2e\160\156\147\x22\40\141\x6c\164\75\42\x45\x6c\151\155\x69\x6e\141\162\x22\x20\164\151\164\x6c\145\75\x22\105\x6c\x69\x6d\151\x6e\141\x72\42\40\163\x74\171\154\145\x3d\x22\167\x69\144\x74\x68\72\x32\60\160\170\x3b\x68\145\x69\147\x68\164\72\x32\x30\160\x78\x3b\142\x6f\162\144\x65\x72\x3a\60\73\42\76\x3c\x2f\x61\x3e\x3c\57\x74\x64\76\x3c\x2f\x74\162\x3e\xa\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\40\x20\x20\74\57\x74\141\142\x6c\x65\x3e\x3c\142\x72\76\12\40\40\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\74\164\141\x62\x6c\x65\x20\151\x64\x3d\42\x69\144\x30\61\42\40\143\154\141\x73\163\x3d\x22\x77\63\55\164\x61\x62\154\145\55\141\x6c\x6c\40\x77\x33\55\x68\x6f\166\x65\x72\141\142\154\x65\40\x77\63\x2d\154\145\146\x74\55\x61\x6c\x69\x67\156\x20\x77\63\x2d\x74\x69\x6e\x79\x22\76\x3c\164\x72\x20\x63\154\x61\x73\163\75\42\167\x33\x2d\x66\157\x6e\x64\157\x64\x72\157\x69\x64\x22\76\x3c\x74\x68\76\x49\144\74\x2f\164\x68\x3e\x3c\x74\150\76\120\162\157\166\145\145\144\x6f\x72\x3c\x2f\x74\x68\76\x3c\x74\x68\76\122\145\x67\151\x73\x74\162\x6f\74\57\164\150\76\x3c\x74\x68\76\x41\x73\x69\147\x6e\141\74\57\164\x68\76\74\x74\150\76\x54\145\162\x6d\151\156\141\x3c\57\x74\x68\x3e\x3c\x74\150\x3e\125\x73\165\x61\162\x69\x6f\74\x2f\x74\x68\76\x3c\164\x68\x3e\x52\145\x67\151\163\x74\162\x6f\62\74\57\164\150\x3e\xa\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\74\164\150\x3e\101\x73\151\147\x6e\141\62\74\x2f\164\x68\x3e\74\x74\x68\76\x54\x65\162\x6d\x69\156\141\62\74\x2f\164\x68\76\x3c\x74\x68\x3e\x45\163\164\x61\x74\165\163\74\57\164\x68\x3e\74\57\164\x72\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->status == 1) { $color = "\x77\63\55\147\162\x65\145\x6e"; $status = "\114\x69\x73\x74\x6f\x20" . $dtfac->ajcont; } elseif ($dtfac->status == 2) { $color = "\167\x33\x2d\160\x61\x6c\x65\x2d\147\x72\x65\x65\x6e"; $status = "\x41\x6a\x75\x73\x74\141\162"; } else { $color = "\167\63\55\x72\145\x64"; $status = "\x50\x65\x6e\144\x69\x65\156\164\145"; } $html .= "\x3c\164\x72\x20\151\144\x3d\42\x73\x6c\x65\x63\x74" . $i . "\42\40\143\154\x61\x73\x73\75\x22\151\164\x65\x6d\x22\x20\x6f\x6e\x63\x6c\151\x63\x6b\x3d\42\x69\164\x63\157\156\x74\x65\x6f\x28\x24\50\x27\43\141" . $i . "\47\x29\x2e\166\141\154\50\51\51\73\42\x3e"; $html .= "\x3c\x69\156\160\x75\x74\x20\164\171\160\145\75\x22\x68\151\144\x64\x65\x6e\42\40\x69\x64\75\x22\141" . $i . "\x22\x20\x6e\141\x6d\145\75\x22\151\x64\42\x20\x76\141\154\165\145\75\42" . $dtfac->id . "\42\x3e\40\74\151\156\x70\165\164\40\164\x79\160\145\75\42\150\x69\x64\144\x65\156\x22\40\x6e\141\155\145\75\42\163\164\x61\x74\x75\x73\x22\40\x76\141\x6c\x75\x65\75\42" . $dtfac->status . "\x22\76\xa\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\40\40\x20\74\164\x64\x3e\74\151\x6e\x70\165\164\40\164\171\160\145\75\x22\143\150\x65\143\x6b\142\157\170\x22\40\157\x6e\x63\x6c\x69\143\x6b\75\42\167\x33\56\164\157\x67\147\x6c\145\x43\x6c\141\x73\x73\x28\47\x23\163\154\x65\143\x74" . $i . "\47\54\47\x77\x33\55\x79\145\154\x6c\157\x77\x27\51\x3b\42\x20\143\154\x61\x73\163\75\x22\x77\x33\x2d\143\x68\145\143\153\x22\40\x6e\x61\x6d\145\75\x22\143\150\145\143\x6b\42\76" . $dtfac->id . "\x3c\x2f\x74\144\76\74\164\144\76" . $dtfac->prov . "\x3c\57\x74\x64\x3e\x3c\164\144\76" . $dtfac->freg . "\74\57\164\x64\76\x3c\x74\x64\76" . $dtfac->fasig . "\74\57\x74\144\76\x3c\164\144\x3e" . $dtfac->fterm . "\x3c\x2f\164\144\x3e\74\x74\144\x3e" . $dtfac->trab . "\x3c\x2f\164\144\x3e\x3c\x74\x64\x3e" . $dtfac->freg2 . "\x3c\57\x74\x64\76\x3c\164\144\76" . $dtfac->fasig2 . "\74\x2f\x74\x64\x3e\xa\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x3c\x74\144\x3e" . $dtfac->fterm2 . "\x3c\57\x74\x64\76\74\164\144\x20\x63\x6c\x61\x73\x73\75\x22" . $color . "\x22\x3e" . $status . "\x3c\x2f\x74\x64\76\xa\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\x3c\x2f\x74\162\76"; } $html .= "\74\164\162\x3e\x3c\x74\x64\40\143\x6c\x61\x73\x73\x3d\x22\x77\x33\x2d\143\x65\x6e\164\x65\162\x20\x77\x33\x2d\x66\157\156\x64\x6f\x64\x72\x6f\x69\144\42\x20\x63\x6f\154\163\160\141\156\75\42\x31\63\42\76\74\x6c\141\x62\145\x6c\40\x63\154\141\163\x73\x3d\x22\x77\x33\x2d\154\141\162\147\x65\42\76\x3c\x62\76\124\157\x74\x61\154\x20\x50\x72\157\144\165\143\164\x6f\72\x20" . $totalreg . "\x3c\57\x62\x3e\74\x2f\x6c\141\142\145\x6c\76\x3c\57\x74\144\x3e\74\x2f\x74\x72\76\x3c\x2f\164\141\142\x6c\145\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\40\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x3c\163\143\x72\151\x70\x74\x20\164\x79\160\x65\x3d\x22\x74\x65\170\x74\57\x6a\141\x76\x61\x73\x63\162\x69\160\x74\42\x3e\xa\40\x20\40\x20\x20\40\40\40\40\40\40\x20\x20\40\40\x20\40\x20\40\x20\146\x75\x6e\x63\164\x69\157\x6e\x20\x44\145\x63\162\x65\x6d\145\x6e\x74\x4e\x75\155\50\x29\173\x20\142\x65\146\x6f\162\x65\x28\51\x3b\xa\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\40\x20\40\x76\141\x72\40\104\145\x63\162\145\x6d\x65\x6e\x74\116\x75\155\75\x64\157\143\165\155\145\x6e\x74\x2e\x67\145\x74\x45\154\145\155\x65\156\164\102\171\111\144\x28\x22\104\x65\x63\162\x65\x6d\145\156\x74\116\x75\x6d\42\51\x2e\166\x61\154\x75\x65\73\xa\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x76\141\x72\x20\153\145\x79\x3d\x22\144\x72\x6f\151\x64\x39\60\x33\42\x3b\40\x76\x61\162\40\x6c\x69\153\145\x3d\x24\50\x22\x23\154\151\153\145\x22\x29\x2e\x76\x61\154\x28\x29\x3b\12\40\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\40\40\40\x76\x61\x72\x20\x64\141\x74\x6f\x73\40\75\x20\173\xa\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x22\160\141\147\42\40\72\40\x44\145\x63\x72\145\x6d\145\156\x74\116\x75\155\x2c\xa\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\x22\153\x65\171\x22\40\72\x20\153\x65\171\54\154\x69\x6b\x65\x3a\x6c\151\x6b\145\12\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x7d\73\xa\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\xa\40\40\40\x20\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\44\56\141\152\x61\x78\x28\173\xa\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\x64\x61\164\x61\72\40\x64\x61\x74\157\x73\54\12\x20\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\165\x72\x6c\x3a\x20\x20\142\141\x73\x65\x75\162\x6c\x2b\42\143\x5f\144\x72\157\x69\144\57\143\157\156\x74\145\x6f\x22\x2c\12\40\40\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\164\171\x70\145\72\40\x22\x50\117\x53\x54\42\x2c\xa\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x20\x20\x73\165\143\x63\145\163\163\x3a\x20\146\x75\156\x63\x74\x69\x6f\156\50\x64\x61\164\x61\51\x20\x7b\12\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\44\50\42\43\x62\157\144\171\42\x29\56\150\164\x6d\x6c\50\144\x61\x74\141\51\73\40\x24\x28\x22\43\x6c\151\x6b\x65\42\x29\x2e\x76\141\154\50\x6c\151\x6b\145\51\x3b\40\163\167\141\x6c\56\143\154\x6f\163\x65\50\x29\xa\40\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\x20\40\175\12\40\40\40\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\xa\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\175\51\x3b\12\x20\40\x20\40\40\40\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x7d\12\40\x20\40\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\12\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\146\x75\156\143\164\x69\157\156\x20\156\165\x6d\x70\141\x67\x28\x61\51\x7b\x20\142\x65\146\157\162\x65\50\51\x3b\xa\x20\x20\40\40\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x76\141\162\40\x6b\145\171\75\42\x64\x72\157\151\x64\x39\60\x33\42\x3b\12\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\166\x61\162\40\154\x69\x6b\145\75\x24\50\42\x23\x6c\x69\153\145\42\x29\x2e\166\x61\x6c\50\51\73\12\40\40\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x76\x61\162\40\144\x61\x74\x6f\x73\40\x3d\40\173\12\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\40\40\x20\x20\40\x22\153\145\x79\x22\72\x6b\x65\x79\x2c\12\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\x20\40\40\x20\40\40\40\40\42\160\x61\147\42\40\x3a\x20\x61\x2c\154\x69\x6b\145\x3a\x6c\x69\x6b\145\xa\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x7d\73\12\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\40\40\x20\xa\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\x20\x20\x24\56\x61\152\141\170\x28\x7b\xa\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\40\40\144\141\164\141\x3a\40\144\141\164\157\163\x2c\xa\40\x20\40\40\40\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\165\162\154\72\x20\x62\x61\163\145\x75\x72\x6c\53\42\x63\137\144\162\x6f\x69\144\57\143\x6f\x6e\x74\145\157\x22\54\12\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\164\171\160\x65\72\x20\42\x50\117\x53\124\42\54\xa\x20\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\40\x20\40\x73\165\x63\143\145\x73\x73\72\40\146\165\156\x63\164\x69\157\156\50\x64\x61\164\x61\51\40\x7b\xa\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\40\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\40\x20\x20\40\40\x20\44\50\42\x23\142\157\x64\171\x22\51\x2e\x68\x74\x6d\154\x28\x64\x61\164\x61\x29\x3b\40\44\x28\42\43\x6c\x69\153\145\x22\x29\56\x76\141\x6c\50\154\151\x6b\x65\51\73\x20\x73\167\141\x6c\x2e\x63\154\157\x73\145\x28\x29\xa\40\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\175\12\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\12\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\175\x29\73\xa\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\40\40\x20\40\40\x20\40\175\xa\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\12\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x66\165\x6e\x63\164\151\x6f\156\x20\x49\156\143\162\151\x6d\145\x6e\164\x4e\165\155\50\51\x7b\x20\142\145\146\157\x72\x65\x28\x29\73\xa\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\40\40\x20\x20\40\x76\x61\x72\40\x49\x6e\x63\x72\x69\155\145\x6e\164\116\165\155\x3d\144\157\143\x75\x6d\x65\x6e\164\x2e\x67\145\164\x45\154\x65\155\145\x6e\x74\x42\171\x49\144\50\42\111\x6e\143\162\151\x6d\x65\x6e\x74\x4e\x75\x6d\x22\51\x2e\x76\x61\x6c\x75\x65\x3b\12\40\40\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\x76\x61\162\40\153\145\x79\x3d\x22\x64\162\157\x69\144\71\60\63\x22\x3b\40\x76\141\162\40\154\x69\x6b\145\75\44\50\42\43\x6c\151\x6b\145\42\51\x2e\x76\x61\x6c\x28\51\73\12\x20\40\x20\40\x20\40\x20\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\166\141\x72\40\x64\x61\164\157\163\40\x3d\x20\173\xa\40\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\40\42\x6b\145\x79\x22\72\x6b\145\x79\54\xa\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\x20\40\40\x20\40\x20\x20\x20\40\42\160\141\x67\42\40\72\40\111\x6e\143\x72\x69\x6d\145\156\164\116\x75\x6d\54\154\x69\x6b\145\72\x6c\x69\153\x65\xa\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\40\175\x3b\12\x20\x20\40\40\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\12\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\44\x2e\x61\x6a\x61\170\50\x7b\xa\40\40\x20\40\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x64\141\164\141\x3a\x20\144\x61\x74\x6f\x73\x2c\12\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\40\x20\x75\162\154\x3a\40\40\142\x61\163\x65\x75\162\x6c\x2b\42\x63\137\x64\162\157\151\x64\57\143\157\156\164\x65\157\x22\x2c\xa\x20\40\40\40\40\40\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x74\x79\x70\145\72\40\x22\120\117\123\124\42\x2c\xa\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\40\163\x75\x63\143\x65\163\163\x3a\40\x66\165\x6e\x63\x74\151\157\156\50\x64\141\x74\x61\x29\x20\173\12\40\40\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x24\50\x22\x23\x62\157\x64\x79\x22\51\56\150\x74\x6d\x6c\50\x64\x61\x74\x61\51\x3b\x20\x24\x28\42\43\154\151\x6b\x65\x22\x29\x2e\x76\x61\154\x28\154\x69\153\x65\x29\73\40\163\167\x61\x6c\56\x63\x6c\157\163\145\x28\51\12\40\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\40\40\x20\40\40\x20\40\175\xa\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\xa\x20\x20\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\x7d\x29\73\12\x20\40\40\x20\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\x20\x20\x20\x20\40\40\175\xa\x20\x20\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x3c\x2f\163\x63\x72\x69\x70\164\76\12\40\40\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x3c\144\151\166\x20\143\154\141\x73\x73\x3d\x22\167\63\x2d\142\141\x72\x20\x77\x33\55\142\x6f\162\144\145\x72\x20\x77\x33\x2d\x62\141\x72\162\x61\163\x22\x3e\xa\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\74\151\156\160\165\164\40\164\x79\x70\145\75\42\x68\x69\144\144\x65\156\x22\40\151\144\75\42\104\145\x63\x72\145\x6d\145\x6e\x74\x4e\165\x6d\42\40\166\x61\154\x75\145\75\x22" . $DecrementNum . "\42\x3e\12\40\40\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\141\x20\157\x6e\x63\154\151\143\153\75\x22\x44\x65\x63\x72\145\x6d\145\x6e\164\116\165\155\50\x29\73\42\x20\x63\154\x61\163\x73\75\x22\x77\63\55\x62\x61\x72\55\x69\164\x65\x6d\x20\x77\63\55\142\x75\x74\x74\x6f\x6e\x22\76\x26\x6c\x61\x71\165\157\x3b\x3c\57\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\x64\x70\x61\x67\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\146\x6f\156\144\x6f\144\x72\157\x69\x64"; $html .= "\xa\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\40\x20\x3c\x69\156\x70\x75\164\40\164\171\x70\145\75\42\x68\x69\x64\x64\145\x6e\42\x20\151\x64\x3d\x22" . $id . "\42\40\166\141\x6c\165\x65\x3d\x22" . $i . "\42\x3e\12\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\74\141\x20\x6f\156\x63\154\151\x63\x6b\75\x22\156\x75\155\x70\141\147\x28\44\x28\x27\x23" . $id . "\x27\x29\56\166\x61\154\x28\x29\51\73\x22\x20\x63\154\x61\x73\163\75\42\x77\63\55\142\x61\162\x2d\151\164\x65\x6d\x20\x77\x33\55\142\165\164\164\157\156\x20" . $hover . "\42\x3e" . $i . "\74\x2f\x61\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\160\165\164\x20\x74\x79\160\145\75\x22\150\x69\x64\144\x65\156\42\40\x69\144\x3d\x22" . $id . "\x22\40\166\141\x6c\x75\x65\75\x22" . $i . "\42\76\xa\40\40\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\74\141\40\x6f\x6e\143\154\x69\x63\x6b\x3d\42\x6e\x75\x6d\x70\141\147\50\44\x28\x27\x23" . $id . "\47\51\56\x76\141\154\50\x29\x29\x3b\42\40\143\154\141\x73\163\75\42\167\63\x2d\142\x61\162\55\151\164\x65\x6d\x20\167\x33\55\142\x75\164\x74\157\156\x20" . $hover . "\42\76" . $i . "\x3c\57\x61\76"; } } } $html .= "\x3c\x69\x6e\x70\165\x74\40\x74\171\x70\x65\75\42\150\x69\x64\144\145\156\42\x20\151\x64\75\x22\111\x6e\143\x72\151\155\145\156\x74\x4e\x75\x6d\42\x20\x76\141\154\x75\145\75\42" . $IncrimentNum . "\42\76\xa\40\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\74\141\x20\157\156\143\x6c\151\x63\x6b\x3d\42\111\x6e\143\x72\x69\155\x65\156\164\x4e\165\x6d\50\x29\x3b\x22\40\143\154\141\163\163\x3d\42\167\x33\x2d\142\x61\x72\55\x69\164\x65\155\x20\x77\x33\55\x62\x75\x74\x74\157\156\x22\76\46\x72\x61\161\x75\x6f\73\x3c\57\141\x3e\12\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\xa\x20\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\74\x2f\144\151\166\x3e\x20"; return $html; } public function itconteo($a) { $this->load->library("\164\141\142\154\x65"); $this->db->query("\x55\x50\x44\x41\x54\x45\40\x69\164\143\157\156\x74\145\x6f\x20\x61\40\112\117\x49\x4e\x20\143\157\x6e\x74\145\x6f\x20\143\x20\117\116\40\50\141\56\143\x6f\x6e\164\145\157\75\x63\x2e\151\x64\x20\46\x26\40\x63\x2e\x73\164\x61\x74\x75\163\x3d\60\51\40\x4a\x4f\x49\116\x20\141\x72\164\x69\x6c\157\x74\x65\163\x20\142\x20\x4f\x4e\40\50\141\x2e\x63\x6f\x64\75\x62\x2e\x63\x6f\x64\x69\147\157\141\162\x74\x20\46\46\40\x61\56\154\157\x74\x65\75\142\56\154\157\x74\x65\x20\46\x26\x20\x61\56\141\x6c\x6d\x3d\x62\x2e\x61\154\x6d\141\143\x65\x6e\51\40\123\105\124\40\141\56\143\141\x6e\x74\x6f\x72\147\75\50\x62\x2e\x63\141\156\164\151\x64\x61\144\55\x62\x2e\x63\x6f\156\163\x75\155\x69\144\157\x29\40\x57\110\x45\x52\x45\x20\x61\56\143\x6f\x6e\164\x65\x6f\x3d\x27{$a}\47"); $bdfac = $this->db->query("\x53\105\114\105\103\x54\40\141\x2e\52\54\142\x2e\156\157\155\x62\162\x65\40\x46\x52\x4f\115\40\151\164\143\x6f\x6e\164\x65\157\x20\x61\x20\x4a\117\x49\x4e\40\x61\x72\x74\151\143\165\154\157\40\142\x20\x4f\116\x20\141\56\143\157\x64\x3d\x62\x2e\x63\157\144\151\147\157\40\x57\x48\105\x52\x45\x20\141\x2e\x63\157\156\x74\x65\x6f\x3d\x27{$a}\47")->result(); $html = "\12\x20\40\40\40\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\40\x20\74\x61\40\x6f\156\143\x6c\151\143\153\x3d\x22\x65\144\151\x74\x63\157\x6e\164\145\157\x28\51\x3b\42\x20\143\154\141\163\x73\x3d\x22\167\63\55\142\164\156\x22\x3e\x3c\x69\155\147\40\x73\x72\143\75\42" . base_url() . "\x69\155\x61\147\145\x73\x2f\x65\x64\151\x74\x61\x72\56\x70\156\147\42\40\x61\154\x74\x3d\x22\x45\x64\151\164\x61\x72\x20\x43\157\x6e\164\x65\157\x22\x20\164\151\164\154\145\x3d\x22\x45\x64\151\164\141\x72\x20\103\157\156\164\x65\x6f\42\40\x73\x74\171\154\x65\x3d\x22\167\151\144\x74\x68\x3a\62\x30\160\170\x3b\150\x65\x69\147\x68\x74\72\x32\60\x70\170\x3b\x62\x6f\162\144\145\162\x3a\60\x3b\42\x3e\74\x2f\141\x3e\xa\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\40\74\x61\40\157\156\x63\x6c\151\143\x6b\x3d\42\145\x6c\151\x6d\151\164\143\x6f\x6e\x74\145\157\x28\51\73\x22\x20\x63\x6c\141\163\163\x3d\42\167\63\x2d\x62\x74\x6e\x22\x3e\x3c\x69\x6d\x67\40\163\162\x63\75\x22" . base_url() . "\151\x6d\x61\x67\x65\163\57\142\x6f\162\162\141\162\56\160\156\147\42\40\141\x6c\164\x3d\x22\105\154\151\x6d\151\x6e\x61\x72\40\x50\162\157\x64\165\143\x74\157\x22\x20\x74\x69\164\154\145\x3d\x22\x45\154\151\155\151\x6e\141\x20\120\162\x6f\x64\165\143\164\157\42\40\x73\x74\x79\x6c\145\75\42\167\151\x64\164\x68\x3a\62\60\160\170\x3b\150\x65\x69\x67\150\164\x3a\62\x30\x70\170\73\x62\x6f\x72\144\x65\162\72\60\x3b\x22\x3e\x3c\57\141\76\xa\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\40\40\40\x20\x3c\164\141\x62\154\145\x20\x69\144\x3d\42\x69\x64\60\x31\x22\40\143\154\x61\x73\163\x3d\42\x77\63\55\164\x61\x62\154\x65\x2d\141\154\x6c\x20\x77\63\x2d\150\157\166\145\x72\141\x62\154\145\x20\167\63\x2d\x6c\x65\146\164\55\x61\x6c\151\147\156\x20\167\x33\x2d\x74\x69\x6e\x79\42\x3e\x3c\x74\x72\x20\x63\154\x61\163\163\x3d\x22\x77\63\x2d\x66\157\156\x64\x6f\x64\x72\157\x69\x64\x22\76\12\x20\40\x20\40\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x3c\x74\150\76\74\x69\x6e\x70\x75\164\40\164\x79\160\145\x3d\x22\x63\150\x65\143\x6b\142\x6f\170\42\40\156\x61\155\145\x3d\x22\x6f\x70\x74\x63\x68\x65\143\153\x22\40\143\154\141\163\163\75\x22\x77\63\55\143\x68\x65\x63\153\x22\x20\x6f\x6e\x63\154\x69\x63\153\x3d\42\x73\145\154\145\x63\164\x6f\144\x6f\50\x27\162\157\x77\151\164\143\157\x6e\x74\x27\51\73\x22\x3e\101\x6c\x6d\141\x63\x65\x6e\x3c\57\164\x68\x3e\74\164\x68\x3e\120\x72\157\144\165\143\x74\x6f\74\57\164\x68\76\x3c\x74\150\76\x4c\157\164\x65\x3c\x2f\x74\150\x3e\74\164\150\76\x43\x61\156\164\117\162\x67\x3c\57\x74\150\x3e\x3c\x74\x68\x3e\x31\x65\x72\x20\103\x6f\x6e\x74\145\x6f\x3c\57\164\x68\76\x3c\x74\x68\76\x32\x64\157\40\x43\157\156\164\x65\x6f\x3c\57\x74\150\x3e\x3c\x74\x68\76\x45\x73\x74\141\164\165\163\74\x2f\164\150\76\74\x2f\x74\x72\x3e"; $i = 0; $tot = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->cantorg != $dtfac->cant && $dtfac->cantorg != $dtfac->cant2) { $color = "\167\63\x2d\x72\145\144"; $status = "\x4d\141\x6c"; } else { $color = "\167\63\x2d\147\x72\145\x65\156"; $status = "\102\151\x65\x6e"; } $html .= "\x3c\x74\162\x20\151\x64\75\x22\163\154\145\143\164\x32" . $i . "\42\40\156\x61\155\x65\75\42\x73\x65\154\145\x63\42\x3e"; $html .= "\74\x69\156\160\165\164\x20\164\x79\x70\x65\x3d\42\x68\x69\144\144\145\156\42\40\x6e\x61\x6d\x65\x3d\42\x69\x64\62\42\40\166\x61\x6c\165\x65\x3d\42" . $dtfac->conteo . "\x22\x3e\74\x69\x6e\160\165\164\x20\164\x79\x70\145\75\42\150\x69\144\144\x65\156\x22\40\x6e\x61\155\x65\75\x22\x61\154\155\42\x20\166\x61\154\x75\145\x3d\42" . $dtfac->alm . "\42\76\x3c\151\156\160\165\164\40\164\x79\x70\x65\75\42\x68\x69\144\x64\145\x6e\x22\x20\156\141\155\145\x3d\x22\143\141\156\164\62\x22\x20\x76\x61\x6c\165\x65\x3d\42" . $dtfac->cant2 . "\42\x3e\12\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x3c\x69\156\160\x75\x74\x20\x74\x79\160\145\x3d\42\150\151\144\144\x65\156\42\x20\x6e\x61\x6d\145\x3d\x22\x63\157\x64\42\x20\166\x61\154\165\x65\x3d\x22" . $dtfac->cod . "\x22\76\x3c\151\x6e\160\165\x74\x20\164\x79\160\x65\75\x22\150\x69\144\144\145\156\x22\40\x6e\x61\x6d\x65\x3d\x22\x6c\157\x74\x22\x20\x76\x61\154\165\145\x3d\42" . $dtfac->lote . "\x22\x3e\x3c\x69\156\160\x75\164\x20\164\x79\160\x65\x3d\x22\x68\x69\x64\x64\x65\x6e\42\40\x6e\x61\x6d\x65\75\x22\143\x61\x6e\164\42\x20\166\141\x6c\165\x65\75\x22" . $dtfac->cant . "\x22\x3e\12\40\x20\40\40\x20\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x3c\164\144\x3e\74\151\x6e\x70\x75\x74\40\164\171\x70\x65\x3d\x22\x63\x68\145\x63\x6b\x62\x6f\170\x22\40\156\141\155\x65\x3d\42\x72\157\167\151\164\143\157\x6e\164\x22\40\143\154\141\x73\x73\75\42\167\63\x2d\143\150\x65\x63\153\x22\40\x6f\x6e\143\x6c\x69\x63\153\x3d\x22\167\x33\x2e\x74\x6f\x67\147\x6c\x65\x43\x6c\141\x73\x73\50\x27\x23\163\154\x65\x63\x74\x32" . $i . "\x27\x2c\47\167\x33\x2d\171\x65\x6c\x6c\x6f\x77\x27\x29\x3b\42\76" . $dtfac->alm . "\x3c\57\x74\x64\x3e\74\x74\x64\76" . $dtfac->cod . "\40" . $dtfac->nombre . "\74\57\x74\x64\76\x3c\x74\144\76" . $dtfac->lote . "\x3c\57\x74\144\76\x3c\164\x64\76" . $dtfac->cantorg . "\74\57\x74\x64\76\xa\x20\40\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\x20\x3c\164\144\x3e" . $dtfac->cant . "\74\x2f\x74\x64\x3e\x3c\x74\144\76" . $dtfac->cant2 . "\x3c\57\164\144\x3e\74\164\x64\40\143\154\141\x73\x73\75\x22" . $color . "\x22\76" . $status . "\x3c\57\164\144\x3e\xa\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x3c\57\164\162\76"; } $html .= "\x3c\57\164\x61\x62\154\145\76"; return $html; } function regconteo($prov) { $data = array("\160\162\157\166" => $prov, "\x66\x72\145\x67" => date("\x59\55\x6d\x2d\x64\x20\110\72\151\72\163")); $this->db->insert("\143\x6f\x6e\x74\x65\157", $data); $i = 0; if ($this->db->affected_rows() > 0) { $i++; $id = $this->db->query("\x53\x45\114\x45\103\124\40\x6d\x61\x78\50\151\144\51\x20\x6e\x20\x46\x52\117\x4d\40\143\157\156\164\145\157")->row(); $bd = $this->db->query("\123\105\114\x45\103\124\40\143\56\x61\x6c\x6d\x61\x63\x65\x6e\x2c\x63\x2e\143\157\144\x69\x67\x6f\x61\162\x74\x20\143\x6f\x64\151\x67\x6f\54\x20\x63\x2e\x6c\157\x74\145\54\x20\122\117\x55\x4e\x44\50\143\56\143\141\x6e\164\151\144\141\144\55\143\56\143\157\156\163\x75\x6d\151\144\157\54\60\51\x20\143\141\x6e\164\40\x46\122\117\x4d\40\x70\162\x6f\x76\x65\145\144\40\141\x20\x4a\117\111\116\x20\141\x72\164\151\x70\x72\x6f\166\40\142\x20\117\x4e\40\141\56\143\x6f\144\151\x67\157\75\142\x2e\x70\162\157\x76\145\145\144\x6f\162\x20\112\117\x49\x4e\40\141\162\x74\151\x6c\x6f\164\145\x73\40\143\x20\117\116\x20\143\56\143\x6f\144\151\x67\157\x61\x72\x74\75\x62\56\143\157\x64\151\x67\157\40\127\110\x45\x52\x45\40\x61\56\151\144\x3d\47{$prov}\47\12\40\x20\x20\x20\x20\40\40\40\40\40\40\40\40\40\x20\x20\40\x20\40\40\x20\x20\40\40\107\122\117\x55\x50\40\102\x59\x20\143\56\x61\x6c\155\x61\143\x65\156\x2c\143\56\143\157\144\151\147\157\x61\162\x74\x2c\x63\x2e\154\157\164\x65")->result(); foreach ($bd as $db) { $data2 = array("\143\x6f\156\164\x65\157" => $id->n, "\x61\154\155" => $db->almacen, "\143\x6f\144" => $db->codigo, "\154\157\164\x65" => $db->lote, "\x63\141\x6e\x74\157\x72\x67" => $db->cant); $this->db->insert("\151\x74\143\157\156\164\145\x6f", $data2); $this->db->where("\143\x6f\144\x69\x67\x6f", $db->codigo)->update("\x61\162\164\x69\x63\x75\154\157", array("\x70\x61\x72\141\137\167\145\x62" => 0)); } } if ($i > 0) { $this->loguser("\103\157\x6e\x74\x65\157", "\x45\x6c\x20\x75\x73\x75\141\x72\x69\x6f\x20\162\x65\x67\x69\x73\x74\x72\x61\40\x65\x6c\40\x63\157\156\x74\x65\157\x20\160\x61\162\141\40\145\154\40\x70\162\x6f\x76\145\x65\144\x6f\x72\x20" . $prov . "\x2e"); } return $i; } function asigconteo($id, $trab, $tip) { if ($tip == 1) { $ctrab = "\164\x72\141\x62"; $fasig = "\146\x61\163\151\x67"; } else { $ctrab = "\x74\162\x61\142"; $fasig = "\x66\x61\x73\151\x67\x32"; } $this->db->query("\125\x50\x44\x41\124\105\x20\x63\157\x6e\x74\145\x6f\x20\123\105\x54\40{$ctrab}\75\47{$trab}\47\54{$fasig}\75\x4e\x4f\127\x28\x29\x2c\163\x74\141\x74\x75\163\75\47\60\x27\x20\x57\x48\105\x52\x45\40\x69\x64\x3d\x27{$id}\47"); return $this->db->affected_rows(); } function ajusteconteo($id, $tip) { $bd = $this->db->query("\x53\x45\114\105\103\124\40\x2a\40\106\122\x4f\115\40\151\164\143\x6f\156\164\x65\x6f\x20\127\x48\x45\122\105\x20\x63\x6f\156\164\x65\157\x3d\x27{$id}\x27")->result(); $j = 0; foreach ($bd as $db) { $exit = $this->db->query("\x53\105\114\x45\103\124\40\122\117\x55\x4e\104\50\x63\141\x6e\x74\x69\x64\141\144\55\x63\157\x6e\x73\165\155\151\x64\157\x2c\60\51\x20\156\x20\x46\122\x4f\x4d\40\x61\162\x74\x69\154\157\x74\x65\x73\40\127\110\105\x52\x45\x20\x61\x6c\155\141\143\145\x6e\75\47{$db->alm}\x27\x20\x26\x26\x20\x63\x6f\x64\x69\x67\157\x61\162\x74\x3d\47{$db->cod}\47\40\46\x26\x20\x6c\x6f\x74\x65\75\47{$db->lote}\47")->row(); if ($tip == 1) { $cont = $db->cant; } else { $cont = $db->cant2; } if ($cont > $exit->n) { $real = $cont - $exit->n; $this->db->query("\x55\x50\104\x41\124\105\x20\141\162\164\151\154\157\164\145\163\x20\163\145\164\40\x63\x61\156\x74\151\144\x61\144\75\143\x61\156\164\151\x64\141\144\x2b\47{$real}\47\40\127\x48\105\x52\105\40\141\154\x6d\141\143\145\x6e\75\47{$db->alm}\x27\x20\46\x26\x20\x63\x6f\x64\x69\x67\157\141\x72\164\x3d\x27{$db->cod}\x27\x20\46\x26\x20\x6c\157\x74\x65\x3d\x27{$db->lote}\47"); if ($this->db->affected_rows() > 0) { $j++; $this->db->where("\x63\157\144\x69\147\157", $db->cod)->update("\x61\162\x74\151\x63\x75\x6c\x6f", array("\x70\141\162\141\137\167\145\142" => 1)); } $ajusteinv = array("\x74\151\x70\157" => "\61", "\x63\x6f\144\151\147\x6f" => $db->cod, "\154\x6f\164\145" => $db->lote, "\144\x6c\157\164\145" => $db->lote, "\141\154\x6d" => $db->alm, "\144\141\154\x6d" => $db->alm, "\143\141\x6e\x74" => $real, "\x66\x65\143\x68" => date("\x59\x2d\155\x2d\x64")); $this->db->insert("\141\152\165\163\164\x65\x69\156\166", $ajusteinv); $this->loguser("\101\152\x75\163\x74\145\40\x49\156\x76\x65\156\164\x61\162\151\157", "\x45\x6c\x20\165\x73\165\141\162\151\157\x20\x72\145\x61\154\151\x7a\x61\x20\145\x6c\x20\x70\x72\x6f\143\145\x73\157\x3a\40\61\x20\x70\141\162\141\40\x61\154\x6d\141\143\145\156\x3a" . $db->alm . "\x20\x70\x72\157\x64\x75\x63\x74\157\x3a" . $db->cod . "\40\x6c\157\x74\x65\x3a" . $db->lote . "\x20\x63\x61\156\164\x3a" . $real . ''); } elseif ($cont < $exit->n) { $real = $exit->n - $cont; $this->db->query("\125\120\x44\x41\x54\105\40\141\162\164\x69\154\157\x74\x65\x73\40\163\x65\x74\x20\143\141\x6e\x74\151\144\x61\x64\x3d\143\141\x6e\x74\x69\x64\141\x64\55\47{$real}\x27\x20\x57\110\x45\122\x45\40\x61\x6c\155\141\143\145\x6e\x3d\x27{$db->alm}\47\x20\x26\x26\x20\143\x6f\144\x69\147\x6f\141\x72\x74\x3d\x27{$db->cod}\47\x20\x26\46\40\154\x6f\164\145\x3d\47{$db->lote}\x27"); if ($this->db->affected_rows() > 0) { $j++; $this->db->where("\x63\x6f\144\x69\147\x6f", $db->cod)->update("\x61\x72\164\x69\143\165\x6c\x6f", array("\160\141\162\x61\x5f\x77\x65\x62" => 1)); } $ajusteinv = array("\x74\151\x70\x6f" => "\60", "\x63\x6f\x64\151\x67\157" => $db->cod, "\x6c\x6f\164\145" => $db->lote, "\144\154\157\164\x65" => $db->lote, "\141\x6c\x6d" => $db->alm, "\144\141\x6c\155" => $db->alm, "\x63\x61\x6e\x74" => $real, "\146\x65\143\150" => date("\131\55\x6d\x2d\144")); $this->db->insert("\x61\x6a\x75\x73\164\145\x69\x6e\166", $ajusteinv); $this->loguser("\101\152\165\163\164\145\40\111\156\166\145\156\164\x61\x72\151\x6f", "\x45\154\x20\x75\163\x75\x61\x72\151\x6f\x20\x72\x65\x61\x6c\151\172\x61\x20\x65\154\40\160\162\x6f\143\145\x73\157\72\x20\60\x20\160\x61\x72\141\40\x61\154\x6d\141\143\145\156\72" . $db->alm . "\40\160\162\x6f\144\165\x63\x74\157\x3a" . $db->cod . "\40\154\157\x74\145\72" . $db->lote . "\40\x63\x61\156\164\72" . $real . ''); } else { $j++; } } if ($j > 0) { $this->db->query("\x55\120\x44\101\124\105\x20\143\157\x6e\164\145\157\x20\123\x45\124\x20\x73\x74\x61\164\165\x73\75\x31\x2c\x61\152\143\157\156\164\x3d\x27{$tip}\47\x20\x57\x48\x45\122\105\40\151\x64\75\x27{$id}\47"); } return $j; } function editconteo($id, $alm, $cod, $lot, $cant, $cant2) { $this->db->query("\x55\120\104\101\x54\105\40\151\x74\x63\157\x6e\x74\145\x6f\40\x53\105\x54\40\143\141\156\x74\x3d\47{$cant}\47\54\143\x61\156\x74\x32\75\x27{$cant2}\x27\40\x57\x48\105\122\x45\40\x63\x6f\x6e\x74\x65\x6f\x3d\x27{$id}\x27\x20\x26\x26\x20\141\154\x6d\75\47{$alm}\47\x20\x26\46\x20\143\x6f\x64\75\x27{$cod}\x27\40\x26\x26\40\154\x6f\164\x65\75\47{$lot}\x27"); return $this->db->affected_rows(); } function elimconteo($id) { $row = count($id); $j = 0; for ($i = 0; $i < $row; $i++) { if ($id[$i] != '') { $this->db->query("\x44\105\114\105\x54\105\x20\x46\x52\x4f\x4d\40\x63\157\x6e\x74\145\157\x20\x57\110\x45\122\105\x20\x69\144\x3d\x27{$id[$i]}\47"); if ($this->db->affected_rows() > 0) { $j++; $bd = $this->db->query("\123\105\114\105\x43\x54\40\143\x6f\x64\x20\x46\x52\x4f\x4d\40\151\x74\143\157\x6e\x74\145\x6f\x20\127\110\x45\x52\x45\x20\x63\x6f\x6e\164\145\157\x3d\x27{$id[$i]}\x27")->result(); foreach ($bd as $db) { $this->db->where("\143\157\x64\x69\x67\x6f", $db->cod)->update("\141\162\x74\x69\x63\x75\x6c\157", array("\x70\141\162\x61\x5f\167\x65\x62" => 1)); } } } } return $j; } function elimitconteo($id, $alm, $cod, $lot) { $row = count($id); $j = 0; $html = ''; for ($i = 0; $i < $row; $i++) { if ($id[$i] != '') { $this->db->query("\x44\105\114\105\124\105\40\x46\x52\117\115\40\x69\164\143\157\x6e\164\145\157\40\127\x48\x45\122\x45\x20\x63\157\x6e\164\x65\157\75\47{$id[$i]}\x27\40\x26\x26\40\141\x6c\155\x3d\47{$alm[$i]}\47\40\46\x26\x20\x63\157\x64\75\47{$cod[$i]}\47\x20\46\x26\x20\x6c\x6f\164\x65\75\x27{$lot[$i]}\47"); $html .= $id[$i] . "\40" . $alm[$i] . "\x20" . $cod[$i] . "\40" . $lot[$i]; if ($this->db->affected_rows() > 0) { $j++; $this->db->where("\143\157\x64\151\x67\x6f", $cod[$i])->update("\141\162\x74\x69\x63\165\x6c\x6f", array("\x70\141\162\141\x5f\167\x65\x62" => 1)); } } } return $j; } function lotcod($cod) { $bd = $this->db->query("\123\105\114\105\103\124\x20\x6c\x6f\x74\145\x2c\x63\157\156\x63\141\x74\x28\141\154\x6d\141\143\x65\x6e\54\47\40\x27\x2c\154\x6f\164\145\54\47\x20\x27\54\143\x61\x6e\164\x69\144\141\x64\x2d\x63\x6f\156\163\x75\x6d\x69\x64\x6f\51\x20\156\x6f\155\142\x72\145\40\x46\x52\x4f\x4d\40\x61\162\164\x69\x6c\157\164\145\x73\40\x57\110\105\x52\x45\40\143\157\144\x69\x67\x6f\141\162\x74\75\x27{$cod}\47\40\46\x26\x20\x28\x63\x61\156\x74\151\144\x61\144\55\143\157\x6e\x73\x75\155\x69\144\x6f\x29\76\x30")->result(); $html = ''; foreach ($bd as $db) { $html .= "\x3c\x6f\160\164\x69\157\156\40\x76\x61\x6c\x75\145\75\42" . $db->lote . "\x22\76" . $db->nombre . "\74\x2f\x6f\160\164\151\157\x6e\76"; } return $html; } function tranfalm($cod, $alm, $lot, $dalm, $dlot, $dcant) { $this->db->query("\x49\x4e\123\105\x52\124\x20\111\116\124\117\40\x60\141\x6a\x75\163\164\145\x69\156\x76\140\x20\50\140\x74\x69\x70\157\140\x2c\x20\x60\143\157\144\151\x67\157\x60\x2c\x20\140\x6c\x6f\164\145\140\x2c\40\140\144\x6c\x6f\x74\145\140\x2c\40\140\x61\154\155\x60\54\40\x60\144\x61\x6c\155\x60\54\40\140\143\141\x6e\164\x60\x2c\x20\x60\146\x65\143\x68\140\x29\x20\126\x41\x4c\x55\x45\x53\x20\50\63\x2c\x20\x27{$cod}\x27\54\x20\47{$lot}\x27\x2c\x20\47{$dlot}\47\x2c\x20\x27{$alm}\47\x2c\40\47{$dalm}\x27\54\40\47{$dcant}\x27\54\x20\x63\x75\x72\144\x61\164\145\50\x29\x29\73"); $this->db->query("\125\x50\104\101\x54\x45\40\x61\162\164\x69\x6c\157\164\x65\163\40\163\145\x74\x20\x63\x61\156\x74\x69\x64\141\x64\75\x63\x61\156\x74\x69\144\x61\144\x2d\x27{$dcant}\47\40\x57\110\105\122\x45\x20\143\157\x64\151\x67\157\x61\x72\164\75\x27{$cod}\x27\x20\46\46\40\x61\x6c\155\141\x63\x65\156\x3d\47{$alm}\47\40\x26\x26\40\x6c\157\164\145\x3d\47{$lot}\47"); $val = $this->db->query("\x53\105\x4c\x45\103\x54\40\x4e\125\x4c\114\x20\106\122\117\115\40\x61\162\164\151\x6c\157\164\x65\x73\40\x57\110\x45\122\105\40\143\x6f\144\x69\147\x6f\141\x72\164\x3d\x27{$cod}\47\40\x26\x26\x20\141\x6c\155\x61\143\x65\x6e\75\x27{$dalm}\47\40\x26\x26\40\154\157\x74\x65\x3d\47{$dlot}\x27")->num_rows(); if ($val > 0) { $this->db->query("\125\x50\104\x41\124\x45\x20\141\162\x74\151\x6c\x6f\x74\145\x73\x20\x73\x65\x74\x20\x63\x61\156\x74\151\x64\x61\144\x3d\x63\x61\156\164\151\144\x61\x64\x2b\x27{$dcant}\x27\x20\x57\x48\105\122\105\x20\143\x6f\144\151\x67\x6f\141\162\x74\x3d\47{$cod}\47\x20\46\x26\40\x61\154\155\141\143\145\x6e\x3d\x27{$dalm}\47\x20\46\x26\40\154\157\x74\x65\x3d\47{$dlot}\47"); } else { $data = array("\143\x6f\144\x69\147\157\x61\162\164" => $cod, "\143\x61\x6e\x74\x69\x64\141\144" => $dcant, "\x6c\x6f\x74\145" => $dlot, "\x61\x6c\x6d\x61\x63\145\x6e" => $dalm, "\145\x6c\141\x62" => "\x30\x30\60\60\55\60\x30\x2d\60\x30", "\166\145\156\143\x65" => "\x30\60\60\60\x2d\x30\60\55\x30\x30", "\162\145\x63\145\160\143\x69\x6f\x6e" => date("\131\55\155\55\144")); $this->db->insert("\x61\162\x74\151\x6c\157\x74\x65\x73", $data); } $this->loguser("\124\x72\x61\x6e\x73\x66\145\162\145\x6e\143\151\x61", "\x45\x6c\40\x75\163\165\x61\x72\151\x6f\x20\x68\x61\x20\164\x72\141\156\163\x66\x65\162\x69\144\157\40" . $dcant . "\40\x75\156\151\144\141\144\x65\x73\x2c\40\x61\154\155\x61\143\x65\x6e\x3a" . $alm . "\54\154\x6f\x74\x65\72\x20" . $lot . "\x2c\x20\x70\141\162\141\x20\x65\154\40\141\x6c\155\x61\143\145\x6e\72" . $dalm . "\54\x6c\x6f\164\x65\72" . $dlot . ''); return $this->db->affected_rows(); } function formtranfalm($cod) { $alm = $this->db->query("\123\105\114\x45\103\x54\x20\x43\117\x4e\103\101\x54\50\x27\x41\154\x6d\x61\143\145\156\x3a\x20\47\54\141\154\155\141\x63\145\156\54\47\40\114\157\x74\145\72\40\47\54\154\157\x74\145\54\47\40\x43\x61\x6e\x74\x69\x64\141\144\72\47\x2c\122\x4f\x55\x4e\104\50\x63\141\156\164\151\144\141\x64\55\x63\157\156\x73\165\x6d\151\x64\157\x29\51\40\x6e\x6f\155\142\x72\x65\54\40\x61\154\155\141\143\x65\x6e\x20\106\x52\x4f\x4d\x20\141\162\x74\151\x6c\157\x74\x65\163\40\127\x48\105\x52\x45\x20\x63\x6f\x64\151\x67\157\141\x72\x74\75\47{$cod}\47")->result(); $lot = $this->db->query("\123\105\x4c\x45\103\124\x20\x43\117\116\x43\x41\x54\x28\x27\101\x6c\x6d\141\143\x65\x6e\72\40\x27\x2c\x61\154\155\141\x63\x65\x6e\x2c\47\x20\x4c\157\164\x65\x3a\40\47\54\x6c\157\164\145\54\47\40\103\141\156\x74\x69\x64\x61\144\72\47\x2c\x52\x4f\x55\116\104\x28\143\x61\156\164\x69\x64\x61\144\55\143\157\156\x73\165\155\151\x64\x6f\x29\51\40\156\157\155\x62\x72\x65\x2c\40\154\x6f\164\x65\x20\x46\x52\117\115\x20\141\162\x74\x69\154\x6f\164\145\x73\40\127\x48\105\122\x45\x20\143\157\144\151\x67\157\141\162\164\75\47{$cod}\47")->result(); $optalm = "\74\x6f\x70\164\x69\157\x6e\x20\x76\141\x6c\x75\145\x3d\42\x22\x20\144\151\x73\x61\x62\x6c\x65\144\x20\163\x65\x6c\145\x63\x74\145\x64\x3e\x53\x65\x6c\145\x63\143\x69\157\156\145\x3c\x2f\157\x70\x74\x69\x6f\156\76"; $optlot = "\x3c\157\x70\x74\151\157\x6e\x20\166\x61\x6c\165\145\75\x22\x22\x20\144\x69\163\141\x62\154\x65\x64\40\163\145\x6c\145\x63\164\145\144\x3e\x53\145\x6c\x65\x63\143\151\157\x6e\145\x3c\57\157\x70\164\151\157\156\76"; foreach ($alm as $dalm) { if ($dalm->almacen != '') { $optalm .= "\x3c\157\x70\164\151\x6f\156\x20\x76\141\154\x75\x65\75\42" . $dalm->almacen . "\42\x3e" . $dalm->nombre . "\x3c\x2f\x6f\x70\164\151\157\156\x3e"; } } foreach ($lot as $dlot) { if ($dlot->lote != '') { $optlot .= "\74\157\x70\x74\x69\157\x6e\x20\166\x61\154\x75\145\x3d\x22" . $dlot->lote . "\42\76" . $dlot->nombre . "\74\x2f\x6f\160\164\x69\157\156\x3e"; } } return array("\x61\x6c\x6d" => $optalm, "\x6c\157\164" => $optlot); } function formajustecant() { $bdarti = $this->db->query("\x53\x45\114\x45\103\124\40\x63\157\x64\x69\147\157\x2c\156\x6f\x6d\142\x72\x65\40\106\122\x4f\115\x20\141\162\164\151\x63\x75\154\157")->result(); $art = "\x3c\x69\156\x70\165\x74\x20\164\x79\x70\145\75\x22\x74\x65\170\164\42\x20\x63\x6c\141\x73\x73\x3d\42\x77\63\55\x69\156\160\x75\164\42\40\151\144\75\42\143\x6f\x64\x69\147\x6f\42\40\154\151\x73\164\75\x22\154\x69\163\x74\x61\162\x74\151\x22\40\160\154\x61\143\x65\150\157\x6c\144\x65\x72\x3d\x22\120\162\157\144\x75\143\164\x6f\56\x2e\x2e\42\x20\x6f\x6e\143\x68\141\156\x67\145\x3d\42\x66\157\x72\155\141\x6c\155\x6c\x6f\x74\50\51\73\42\x3e\74\144\x61\x74\141\x6c\151\x73\x74\x20\151\x64\75\x22\154\x69\163\164\141\162\164\x69\x22\76"; foreach ($bdarti as $dbarti) { $art .= "\74\x6f\x70\164\x69\157\156\40\166\x61\154\x75\x65\x3d\x22" . $dbarti->codigo . "\x22\76" . $dbarti->nombre . "\x3c\57\x6f\x70\164\151\x6f\x6e\x3e"; } $art .= "\74\57\x64\x61\x74\141\154\x69\163\x74\x3e"; return array("\160\162\x6f\x64" => $art); } function exportexcelartitodo() { return $this->db->query("\x53\105\x4c\105\103\x54\40\x53\125\102\123\124\x52\50\141\56\x63\157\144\x69\x67\x6f\54\x31\x2c\x33\51\40\x63\x61\x74\145\147\157\x72\x69\141\54\x28\123\105\114\x45\103\x54\x20\156\157\155\142\162\x65\40\146\x72\x6f\x6d\40\147\x72\165\x70\x6f\x73\x20\x77\150\145\x72\x65\40\x63\x6f\144\151\147\157\x3d\141\56\x67\162\165\x70\157\x29\x20\x73\x75\142\143\x61\164\145\x67\x6f\x72\x69\141\x2c\x74\x72\x69\x6d\50\141\56\x63\x6f\144\151\147\x6f\51\x20\143\157\144\x69\x67\157\x2c\141\x2e\x6e\x6f\x6d\142\x72\x65\54\141\x2e\x72\145\146\x65\x72\145\156\x63\x69\141\54\122\x4f\125\x4e\x44\50\x61\x2e\x65\170\x69\163\x74\145\x6e\143\x69\141\x2c\60\x29\40\x65\x78\151\163\x74\145\156\54\x52\117\125\x4e\x44\x28\x61\56\x70\x72\145\x63\x69\157\x31\54\62\x29\x70\162\x65\x63\x69\157\x2c\x52\x4f\x55\116\x44\x28\141\56\x70\x72\145\x63\151\x6f\x31\57\x28\123\105\x4c\x45\x43\x54\x20\x6f\146\x69\143\151\x61\154\x20\106\122\117\115\x20\155\x6f\156\x65\x63\141\155\40\117\122\104\x45\122\40\x42\131\x20\146\145\143\150\x61\40\104\105\x53\x43\40\x4c\111\115\111\x54\40\61\51\54\x32\51\40\144\160\x72\145\x63\151\157\x2c\xa\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\122\117\125\116\104\x28\141\x2e\160\x72\145\x63\151\157\x66\x69\156\61\x2d\50\141\x2e\160\x72\145\143\151\157\x66\x69\156\61\52\50\141\56\144\163\x63\x74\x6f\x5f\x6d\x65\x64\x69\143\x61\x6d\x65\x6e\x74\x6f\x73\x2f\61\x30\x30\x29\51\x2c\x32\x29\160\162\x65\x63\151\x6f\x66\151\156\54\x52\x4f\125\x4e\104\50\50\141\56\x70\x72\x65\x63\x69\x6f\146\151\156\x31\x2d\50\141\x2e\160\162\x65\143\151\157\x66\151\x6e\x31\52\x28\x61\56\144\x73\143\164\157\137\155\x65\x64\x69\x63\x61\155\x65\156\164\x6f\163\x2f\61\x30\x30\51\51\51\x2f\x28\x53\x45\114\105\x43\x54\x20\157\x66\x69\143\151\x61\x6c\40\106\122\117\x4d\40\155\x6f\156\145\143\x61\155\x20\x4f\122\x44\105\x52\x20\102\131\x20\x66\x65\143\150\141\x20\104\x45\123\x43\40\114\x49\x4d\111\x54\40\61\x29\54\x32\51\x20\144\x70\x72\x65\x63\x69\x6f\x66\151\156\54\x61\x2e\155\141\162\143\141\x2c\12\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x28\123\105\x4c\x45\103\x54\40\x76\x65\156\143\145\40\106\x52\x4f\115\x20\141\162\164\151\x6c\x6f\164\145\163\40\x57\x48\105\122\105\x20\143\x6f\x64\x69\x67\157\141\162\x74\75\x61\56\x63\x6f\x64\151\147\x6f\40\x26\x26\x20\x63\141\x6e\164\x69\144\x61\144\x3e\x63\157\156\x73\165\155\x69\x64\x6f\x20\117\x52\x44\105\122\40\x42\131\40\x76\145\156\143\145\40\x41\123\103\40\x4c\111\115\111\x54\40\x31\51\x20\166\145\156\143\x65\54\xa\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\122\117\125\116\104\50\141\x2e\x69\x6d\x70\165\145\x73\164\x6f\61\x2c\60\51\40\x69\166\x61\54\141\56\x64\163\x63\x74\x6f\x5f\x6d\145\144\151\x63\x61\x6d\x65\x6e\164\x6f\x73\40\144\x65\x73\x63\x75\x2c\12\11\x9\x9\x9\x43\117\x4e\x43\101\x54\x28\x69\x66\50\x28\123\x45\114\x45\x43\124\x20\x43\117\125\116\124\50\x2a\51\40\106\x52\117\115\x20\x61\x72\164\x69\154\x6f\164\x65\x73\x20\127\x48\x45\x52\x45\x20\143\157\144\151\147\x6f\141\162\x74\75\141\x2e\x63\x6f\144\x69\147\157\40\x26\x26\x20\x72\x65\x63\145\160\143\151\x6f\x6e\76\75\104\x41\124\x45\x5f\123\x55\102\50\103\x55\122\104\x41\x54\105\x28\x29\x2c\x49\116\124\105\122\x56\x41\x4c\x20\x35\40\x44\x41\x59\51\51\x3e\x30\54\x27\x4e\x55\105\x56\117\41\47\54\x27\47\x29\54\x49\106\x28\141\x2e\x64\163\143\x74\157\137\x6d\x65\x64\151\143\x61\x6d\145\156\164\157\x73\x3e\60\54\103\117\116\x43\101\124\50\47\x3c\142\x20\x63\x6c\141\x73\x73\x3d\x22\x77\63\55\x67\162\145\x65\x6e\x22\76\xc2\xa1\x50\x52\x4f\x4d\x4f\x43\111\x4f\x4e\x20\47\54\x61\56\144\x73\143\164\157\x5f\155\145\144\x69\x63\x61\155\x65\156\x74\157\x73\x2c\47\x25\x21\x27\54\x27\74\57\142\76\x27\51\x2c\47\47\51\51\x20\156\165\x65\x76\x6f\x2c\xa\40\40\x20\40\40\40\40\40\x20\40\40\40\40\40\40\40\111\x46\50\x28\123\105\x4c\105\x43\x54\40\143\157\x64\x61\154\164\x65\x72\x6e\141\x74\151\x76\157\x20\x46\122\117\x4d\40\x69\156\166\x63\157\144\x61\x6c\164\x65\162\x6e\141\164\x69\x76\157\40\x57\110\105\x52\105\40\143\x6f\x64\x69\147\x6f\75\141\x2e\143\x6f\x64\x69\147\157\x20\114\x49\x4d\x49\x54\40\61\x29\41\75\47\x27\54\50\123\105\x4c\105\x43\x54\40\143\x6f\144\x61\x6c\164\145\162\156\141\x74\151\166\x6f\40\106\122\x4f\115\x20\x69\x6e\x76\x63\157\x64\x61\x6c\164\145\162\156\x61\164\151\x76\157\x20\x57\x48\105\122\x45\40\143\157\x64\x69\147\x6f\75\x61\56\143\157\x64\x69\x67\x6f\x20\x4c\111\x4d\x49\124\40\x31\x29\x2c\47\x4e\57\x41\x27\x29\x20\142\x61\x72\x72\x61\x2c\12\40\40\40\40\40\40\40\40\40\40\40\40\40\40\x20\x20\50\123\x45\114\105\103\x54\40\156\157\x6d\142\x72\x65\40\106\x52\x4f\115\40\141\x72\164\151\x70\162\157\166\40\127\110\105\122\105\x20\143\x6f\x64\x69\147\x6f\75\x61\x2e\x63\x6f\x64\x69\x67\x6f\40\x4c\111\115\111\x54\x20\x31\51\40\160\x72\157\x76\x65\145\x64\x6f\x72\12\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\106\x52\x4f\x4d\x20\141\162\164\x69\x63\165\x6c\157\40\141\40\x4a\117\111\x4e\x20\x61\x72\164\151\x6c\x6f\x74\x65\163\x20\144\40\x4f\116\40\144\x2e\x63\157\144\151\x67\157\141\162\164\75\141\x2e\x63\x6f\x64\151\147\157\40\x26\x26\x20\x28\x64\x2e\x61\154\155\x61\143\x65\x6e\x3d\x30\x32\x20\174\x7c\x20\144\x2e\141\154\x6d\141\143\x65\156\75\x30\67\x29\40\x26\46\x20\144\x2e\x63\141\x6e\x74\x69\x64\141\x64\x2d\144\56\x63\157\x6e\163\x75\x6d\x69\x64\157\76\x30\xa\40\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\127\x48\x45\x52\105\x20\50\x61\56\x65\170\151\x73\164\x65\x6e\x63\x69\x61\55\141\x2e\143\x6f\x6d\x70\162\157\x6d\x65\x74\x69\x64\x6f\x29\76\60\40\x26\x26\x20\141\56\160\x61\162\x61\x5f\167\145\x62\x3d\x27\x31\47\40\x20\46\x26\x20\141\x2e\147\x72\165\x70\157\40\116\x4f\124\x20\x49\116\40\50\60\x36\54\x30\67\51\12\40\40\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x47\x52\x4f\x55\x50\x20\x42\x59\x20\141\x2e\x63\157\x64\151\x67\157\x20\x4f\122\x44\105\122\40\102\131\x20\141\x2e\143\x6f\x64\151\x67\157\40\101\123\103"); } function exportexcelartimovil() { return $this->db->query("\x53\x45\114\105\x43\124\40\123\125\102\123\124\x52\50\x61\x2e\143\x6f\144\151\x67\157\x2c\x31\54\x33\51\x20\143\141\x74\145\147\157\x72\151\141\x2c\x28\123\x45\114\105\103\124\40\156\157\x6d\142\162\145\x20\x66\x72\x6f\155\x20\x67\162\x75\160\x6f\163\40\167\x68\145\162\x65\x20\143\157\x64\x69\147\157\75\141\56\x67\162\x75\160\x6f\x29\40\x73\x75\142\143\141\164\145\x67\x6f\x72\x69\141\54\x28\123\105\x4c\x45\x43\124\x20\156\157\x6d\142\x72\145\40\106\x52\x4f\x4d\40\141\162\x74\151\x70\162\157\166\x20\x57\110\105\x52\x45\40\143\157\144\x69\147\157\x3d\141\56\143\x6f\144\x69\x67\x6f\40\x4c\x49\x4d\x49\x54\40\61\51\40\x70\x72\x6f\166\145\x65\144\x6f\162\54\103\x4f\x4e\103\101\124\x28\164\162\x69\x6d\x28\x61\x2e\x63\x6f\x64\x69\x67\157\x29\x2c\x27\40\x27\54\x61\56\156\x6f\155\142\162\x65\x29\x20\160\x72\157\144\165\x63\x74\157\x2c\x20\103\x4f\116\x43\x41\124\x28\47\x3c\142\x3e\122\x65\146\x3a\x3c\x2f\x62\76\x20\x27\x2c\x61\56\x72\x65\x66\x65\x72\145\x6e\x63\151\141\54\47\x20\x3c\x62\x3e\x4d\141\162\x63\141\72\x3c\x2f\x62\x3e\40\x27\x2c\x61\56\155\x61\162\143\141\x2c\47\x20\74\x62\76\x50\x72\x65\143\x69\x6f\40\163\151\156\x20\151\x76\x61\72\74\x2f\142\x3e\40\x27\x2c\122\x4f\125\116\104\50\141\56\x70\162\145\x63\151\x6f\x31\x2c\x32\51\160\162\x65\x63\x69\157\x2c\47\40\x3c\142\76\120\162\145\x63\x69\x6f\x20\x63\x6f\x6e\40\151\166\x61\x3a\74\x2f\142\76\40\x27\x2c\122\117\x55\116\x44\50\141\x2e\160\x72\145\x63\x69\x6f\146\151\x6e\61\x2d\x28\141\x2e\x70\x72\145\x63\x69\x6f\146\x69\156\x31\52\x28\x61\56\144\163\143\164\x6f\137\155\x65\144\x69\x63\x61\x6d\x65\x6e\164\x6f\x73\x2f\61\60\60\x29\x29\54\62\51\x70\162\145\x63\151\x6f\146\151\x6e\54\xa\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x27\40\x3c\x62\x3e\120\x72\x65\x63\x69\x6f\x20\44\x3a\74\x2f\142\x3e\x20\x27\x2c\x52\x4f\125\116\104\x28\x28\141\x2e\x70\162\145\143\151\157\x66\151\x6e\61\55\50\x61\56\x70\x72\145\143\x69\157\146\x69\x6e\61\x2a\50\x61\56\144\x73\143\164\x6f\137\x6d\x65\144\x69\x63\x61\155\x65\156\x74\x6f\x73\x2f\61\60\x30\x29\x29\x29\x2f\50\123\x45\114\105\103\x54\40\157\146\151\x63\x69\x61\154\40\x46\x52\117\115\x20\155\x6f\x6e\145\143\x61\x6d\x20\x4f\x52\104\105\x52\40\x42\131\40\146\x65\143\150\x61\x20\x44\x45\123\103\40\x4c\111\x4d\x49\x54\x20\61\51\x2c\62\51\x70\x72\x65\143\x69\157\x66\151\x6e\54\47\40\74\142\x3e\x44\145\163\x63\x75\x65\x6e\164\x6f\72\x3c\x2f\142\x3e\40\x27\54\x52\x4f\125\116\x44\50\x61\x2e\144\163\143\x74\157\x5f\155\145\x64\x69\143\141\x6d\x65\x6e\x74\157\x73\x2c\x30\51\x2c\x27\40\x3c\142\x3e\x45\170\151\x73\x74\x65\156\72\x3c\57\142\76\x20\x27\54\122\x4f\x55\116\104\x28\141\56\x65\170\151\163\164\x65\156\x63\x69\141\x2c\60\x29\51\x20\144\145\164\x61\x6c\x6c\145\x73\54\12\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\50\123\x45\114\x45\103\124\x20\166\145\156\x63\145\40\106\x52\x4f\x4d\x20\141\x72\x74\x69\154\x6f\164\x65\163\x20\127\110\105\x52\x45\x20\143\x6f\x64\x69\x67\157\141\162\164\75\141\x2e\x63\x6f\144\x69\147\x6f\40\x26\x26\x20\143\141\156\164\151\144\141\x64\x3e\143\157\x6e\x73\x75\155\151\144\x6f\40\x4f\x52\104\x45\x52\x20\102\x59\x20\166\145\156\x63\x65\40\101\x53\x43\x20\114\111\115\x49\124\40\61\51\x20\x76\x65\156\x63\x65\54\xa\40\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\40\151\146\x28\50\123\x45\x4c\105\x43\x54\40\103\x4f\x55\116\124\x28\x2a\51\x20\x46\122\117\115\x20\141\x72\x74\151\154\x6f\164\x65\x73\40\127\110\x45\122\105\x20\x63\157\x64\x69\x67\157\x61\x72\x74\75\141\56\143\157\x64\151\x67\157\x20\46\x26\40\x72\x65\x63\145\x70\143\x69\x6f\x6e\76\x3d\x44\x41\124\x45\137\123\x55\x42\x28\x43\x55\x52\x44\101\x54\105\50\51\x2c\111\x4e\x54\x45\122\x56\101\114\x20\x35\40\104\101\131\x29\51\76\60\54\47\74\x62\76\116\x55\x45\126\117\41\74\57\142\x3e\x27\x2c\x27\47\x29\40\156\165\x65\166\x6f\54\12\x20\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\x20\x20\122\117\x55\x4e\x44\50\141\x2e\x70\x72\x65\x63\151\x6f\146\x69\x6e\61\x2c\62\x29\x20\160\x72\145\x63\x69\x6f\146\151\x6e\x2c\122\x4f\x55\x4e\104\50\x61\x2e\160\x72\145\x63\151\x6f\146\x69\156\x31\57\x28\123\105\114\x45\103\x54\x20\157\x66\x69\143\x69\141\154\x20\x46\122\117\x4d\40\155\x6f\x6e\145\143\141\x6d\40\117\x52\x44\x45\x52\40\102\x59\40\146\145\x63\x68\141\40\x44\x45\123\x43\40\x4c\x49\115\111\x54\40\x31\x29\x2c\62\x29\x20\x70\x72\x65\x63\x69\x6f\144\54\x52\117\125\x4e\x44\x28\141\x2e\x64\x73\x63\x74\157\137\155\x65\x64\151\143\x61\x6d\145\156\164\157\163\x2c\x30\x29\x20\144\x65\x73\143\165\54\141\x2e\x6e\x6f\155\142\162\145\12\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\106\122\x4f\115\x20\141\162\x74\x69\143\165\154\x6f\x20\x61\40\112\x4f\x49\x4e\x20\x61\x72\x74\x69\x6c\x6f\x74\145\163\40\144\40\x4f\x4e\x20\144\x2e\143\x6f\x64\151\147\x6f\x61\x72\x74\75\x61\56\x63\x6f\144\151\x67\x6f\40\46\x26\40\x28\x64\x2e\x61\x6c\x6d\x61\x63\145\156\75\x30\62\x20\174\x7c\x20\x64\56\141\154\155\x61\x63\x65\156\x3d\60\x37\x29\40\x26\46\x20\x64\56\143\x61\156\x74\x69\x64\x61\x64\x2d\x64\x2e\143\x6f\156\163\165\155\x69\144\x6f\76\60\xa\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\40\40\40\127\x48\105\x52\105\40\50\141\x2e\145\170\151\x73\164\145\156\143\151\x61\55\x61\56\143\x6f\x6d\x70\162\157\155\x65\164\x69\x64\x6f\x29\76\x30\x20\46\46\x20\141\56\x70\141\162\x61\x5f\167\x65\x62\x3d\x27\x31\x27\x20\40\x26\46\x20\x61\56\147\x72\x75\x70\x6f\x20\x4e\x4f\124\40\111\116\40\x28\60\x36\x2c\60\x37\x29\xa\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\x47\x52\117\x55\120\x20\x42\x59\x20\x61\56\x63\157\144\x69\x67\157\40\x4f\x52\x44\x45\122\40\102\x59\40\x61\56\143\157\144\151\147\x6f\x20\x41\123\x43"); } function exportexcelcli() { return $this->db->query("\x53\105\x4c\105\x43\124\40\x61\56\163\x75\143\x75\162\163\x61\x6c\x2c\x61\x2e\x74\x69\160\x6f\54\x61\56\163\165\142\144\x69\166\x69\x73\151\157\x6e\40\x63\154\x61\x73\x65\54\x61\56\x63\x6f\x64\x69\x67\157\x2c\x61\x2e\156\157\155\x62\x72\x65\54\141\x2e\x6e\x72\x6f\x72\x69\146\40\162\151\146\54\124\122\x49\115\x28\141\56\x63\141\155\160\157\61\51\40\163\151\x63\155\54\x54\122\x49\115\50\x61\x2e\143\141\155\160\x6f\x33\51\x20\163\x69\x63\x61\x2c\x54\122\111\x4d\x28\x61\x2e\164\145\x6c\145\x66\x6f\x6e\x6f\163\51\40\164\145\154\x66\x2c\x54\x52\111\115\50\x61\x2e\164\145\154\x65\x66\x6f\x6e\157\137\155\x6f\166\x69\154\51\x20\164\145\154\x66\62\54\x62\x2e\x6e\x6f\x6d\x62\162\x65\40\x76\x65\156\x64\x65\x64\x6f\x72\54\12\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\x54\x52\x49\x4d\50\141\56\144\151\162\145\143\143\151\157\x6e\x29\x20\x64\151\162\145\x63\54\x54\122\x49\115\x28\141\56\144\x69\162\x65\143\145\x6e\x76\151\x6f\51\40\x64\x69\162\x65\x63\145\156\166\x2c\143\56\172\157\156\141\54\144\56\x73\x75\142\163\x65\143\164\157\162\x2c\x54\122\x49\x4d\50\x61\56\x63\141\155\160\157\x34\51\40\x68\157\x72\141\x72\x69\x6f\54\x64\x69\x61\163\x2c\141\56\x66\x65\x63\150\x61\x20\x66\151\156\x67\162\x65\x73\157\x2c\141\56\x65\x6d\x61\x69\x6c\54\141\x2e\x70\x65\162\x73\143\x6f\156\x74\x20\x63\x6f\x6e\164\141\143\x2c\122\117\x55\116\x44\50\x61\56\x64\145\163\143\165\x65\x6e\164\x6f\51\40\144\x65\163\143\x75\145\x6e\164\157\54\x49\106\50\x61\x2e\x73\164\141\x74\165\163\x3e\x30\54\x27\x41\x63\164\x69\x76\x6f\47\x2c\x27\x49\156\141\143\x74\151\x76\x6f\x27\51\40\105\x73\x74\x61\x74\x75\x73\12\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x46\x52\x4f\x4d\40\143\154\151\x65\x6d\160\x72\x65\x20\141\40\114\x45\x46\x54\40\112\x4f\111\x4e\40\154\151\163\164\166\145\156\x64\x20\x62\x20\117\x4e\40\141\56\x76\x65\156\144\x65\x64\157\x72\75\x62\x2e\143\x6f\144\x69\147\157\12\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\x4c\105\106\x54\x20\112\x4f\x49\x4e\x20\x73\x65\x63\164\157\162\145\x73\x20\x63\x20\117\116\x20\x61\x2e\163\145\x63\x74\x6f\x72\75\x63\x2e\143\x6f\144\151\x67\x6f\xa\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x4c\105\106\124\x20\x4a\x4f\x49\x4e\x20\163\x75\x62\163\145\x63\164\x6f\162\145\163\x20\x64\40\x4f\x4e\40\x28\x61\x2e\x73\x65\x63\x74\x6f\162\75\x64\56\x63\157\x64\151\x67\157\40\x26\46\x20\141\x2e\163\165\x62\143\157\x64\151\147\157\x3d\x64\x2e\x73\x75\x62\x63\x6f\x64\x69\x67\157\51\40\x47\x52\x4f\125\120\40\102\131\x20\x61\x2e\x63\x6f\144\x69\x67\157"); } function exportexcelvend() { return $this->db->query("\123\x45\x4c\x45\103\x54\x20\143\157\144\151\147\x6f\54\156\x6f\155\x62\x72\145\54\143\x65\x64\165\x6c\141\x2c\x74\145\x6c\x65\x66\157\x6e\x6f\163\54\x65\x6d\141\151\x6c\54\x73\145\x63\164\157\x72\x2c\x73\165\x62\x63\157\x64\x69\x67\x6f\x20\x73\x75\142\163\145\143\x74\x6f\162\40\x46\122\x4f\x4d\40\x6c\151\x73\x74\x76\145\156\x64"); } function formarti() { $this->db->query("\x53\x45\x54\x20\x43\110\101\122\x53\105\x54\40\x75\x74\x66\70"); $prov = $this->db->query("\123\x45\114\105\103\x54\40\143\x6f\x64\x69\147\x6f\54\156\x6f\155\142\x72\145\x20\106\122\117\115\x20\160\x72\157\166\x65\x65\x64\40\x47\x52\x4f\125\x50\40\102\x59\40\x6e\157\x6d\142\162\x65\x20\117\122\x44\105\122\40\102\131\40\156\x6f\155\x62\x72\145\40\x41\123\103")->result(); $cod = $this->db->query("\x53\x45\114\105\x43\124\40\123\125\x42\123\x54\122\50\x63\x6f\x64\151\147\157\x2c\61\x2c\63\x29\40\164\151\160\x20\106\122\x4f\x4d\x20\x61\162\164\x69\x63\165\154\157\x20\x47\122\x4f\125\120\40\102\131\x20\x74\x69\x70\40\x4f\122\104\x45\122\40\x42\x59\40\164\x69\x70\40\101\x53\103")->result(); $group = $this->db->query("\123\x45\114\x45\103\124\x20\x63\157\x64\151\x67\x6f\54\156\157\x6d\142\162\145\40\106\122\x4f\115\40\x67\162\165\160\157\163\40\x4f\122\104\x45\x52\x20\x42\x59\x20\156\157\155\x62\x72\145\x20\101\x53\x43")->result(); $optprov = "\x3c\x64\x61\x74\141\x6c\x69\x73\164\x20\151\x64\x3d\42\144\x61\164\141\x70\162\157\166\42\x3e"; $optcod = ''; $optgroup = ''; foreach ($prov as $dprov) { $optprov .= "\x3c\157\160\x74\151\157\156\x20\x76\141\x6c\x75\x65\75\x22" . $dprov->codigo . "\42\76" . $dprov->nombre . "\x3c\57\x6f\x70\x74\x69\157\156\76"; } $optprov .= "\x3c\57\144\141\164\x61\154\x69\163\x74\x3e"; foreach ($cod as $dcod) { $optcod .= "\74\157\x70\x74\x69\157\156\40\x76\x61\154\165\145\x3d\x22" . $dcod->tip . "\42\x3e" . $dcod->tip . "\x3c\x2f\x6f\x70\x74\x69\x6f\156\x3e"; } foreach ($group as $dgroup) { $optgroup .= "\74\x6f\x70\x74\151\157\x6e\x20\x76\x61\x6c\165\x65\75\x22" . $dgroup->codigo . "\x22\x3e" . $dgroup->nombre . "\x3c\x2f\x6f\160\x74\x69\157\x6e\76"; } return array("\x70\162\157\x76\143\x6f\144" => $optprov, "\x74\151\160\x63\x6f\x64" => $optcod, "\147\162\x75\x70\x6f" => $optgroup); } function formartiedit($cod) { $bd = $this->db->query("\123\x45\x4c\x45\x43\124\x20\x61\x2e\156\x6f\155\x62\x72\x65\54\x61\56\x6d\141\162\143\x61\x2c\x61\56\x72\145\x66\145\x72\145\x6e\143\151\141\40\x72\145\146\x2c\x62\56\x63\157\x64\x61\x6c\164\145\x72\x6e\141\164\151\x76\x6f\40\142\141\x72\162\141\x2c\x61\x2e\143\x6f\156\x74\162\157\154\x61\x64\157\x2c\x49\x46\x28\x61\56\x63\157\156\x74\162\157\154\x61\144\x6f\75\x31\54\47\x53\111\x27\54\x27\116\117\x27\51\40\156\x6f\155\143\x6f\156\164\162\x6f\154\54\141\56\x67\162\x75\x70\157\54\144\56\156\157\x6d\x62\162\x65\40\156\x6f\x6d\147\162\165\160\x2c\x63\x2e\x70\x72\157\x76\145\145\x64\x6f\x72\x2c\x63\56\x6e\157\x6d\x62\x72\145\x20\x6e\157\155\160\162\157\x76\x2c\141\x2e\x69\x6d\160\165\x65\x73\164\157\61\x20\106\122\117\x4d\x20\x61\162\x74\151\143\x75\x6c\157\40\x61\x20\x6c\x65\x66\164\40\112\117\111\116\40\x69\x6e\166\143\157\144\x61\x6c\164\145\x72\x6e\141\164\151\166\x6f\x20\x62\40\x4f\x4e\x20\141\x2e\x63\157\x64\151\147\157\75\x62\56\x63\157\144\151\147\157\xa\x20\40\40\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\x6c\x65\146\x74\40\x4a\x4f\111\x4e\40\x61\162\164\x69\x70\162\157\166\40\x63\x20\117\x4e\x20\x61\56\143\x6f\144\x69\x67\157\x3d\143\56\x63\157\144\x69\147\157\40\112\117\x49\116\x20\147\x72\165\x70\x6f\163\40\x64\x20\x4f\x4e\40\x64\56\143\x6f\x64\151\x67\x6f\75\x61\56\x67\x72\165\x70\157\40\127\110\105\x52\105\40\x61\x2e\x63\157\144\x69\147\157\x3d\x27{$cod}\x27")->row(); return array("\x6e\x6f\155" => $bd->nombre, "\142\x61\x72\x72" => $bd->barra, "\x6c\145\147\x61\x6c" => $bd->controlado, "\x6e\157\155\x6c\145\147\141\154" => $bd->nomcontrol, "\x67\x72\165\x70" => $bd->grupo, "\x6e\157\x6d\147\x72\x75\x70" => $bd->nomgrup, "\160\x72\x6f\x76" => $bd->proveedor, "\x6e\157\x6d\x70\162\x6f\166" => $bd->nomprov, "\151\x76\141" => $bd->impuesto1, "\x6d\141\x72\143\141" => $bd->marca, "\x72\x65\x66" => $bd->ref); } function formcli() { $vend = $this->db->query("\123\x45\114\105\103\124\x20\143\157\x64\x69\x67\x6f\x2c\156\x6f\x6d\142\162\x65\x2c\x74\145\154\145\146\x6f\x6e\x6f\x73\x20\106\x52\x4f\115\x20\154\x69\x73\x74\166\145\x6e\x64\x20\107\x52\x4f\125\x50\x20\x42\x59\x20\156\157\x6d\142\162\145\x20\117\122\104\105\122\40\102\x59\40\156\x6f\x6d\x62\162\145\x20\101\x53\103")->result(); $sec = $this->db->query("\123\x45\114\x45\x43\x54\x20\x63\157\144\151\147\157\54\172\157\x6e\x61\x20\x46\122\x4f\115\x20\x73\145\x63\164\x6f\162\x65\x73\40\x4f\x52\x44\x45\122\x20\x42\x59\40\x7a\157\x6e\x61\x20\101\123\x43")->result(); $zon = $this->db->query("\x53\105\114\105\103\124\40\163\165\x62\143\157\144\x69\147\x6f\54\x73\165\x62\x73\x65\143\164\157\x72\x20\x46\x52\117\x4d\x20\163\x75\x62\163\145\143\164\157\162\x65\x73\40\117\x52\x44\105\x52\40\102\131\x20\x73\165\x62\x73\x65\x63\164\x6f\162\40\101\123\x43")->result(); $optprov = ''; $optcod = ''; $optgroup = ''; foreach ($vend as $dvend) { $optprov .= "\74\x6f\x70\x74\x69\157\156\x20\166\x61\154\165\x65\x3d\x22" . $dvend->codigo . "\x22\76" . $dvend->nombre . "\x3c\57\x6f\160\x74\x69\157\x6e\76"; } foreach ($sec as $dsec) { $optcod .= "\x3c\157\160\164\151\157\156\40\x76\x61\x6c\x75\145\75\x22" . $dsec->codigo . "\42\76" . $dsec->zona . "\x3c\x2f\157\160\164\x69\x6f\x6e\x3e"; } foreach ($zon as $dzon) { $optgroup .= "\x3c\x6f\x70\164\x69\157\156\x20\x76\x61\x6c\165\145\75\42" . $dzon->subcodigo . "\42\76" . $dzon->subsector . "\x3c\x2f\x6f\160\164\x69\x6f\x6e\x3e"; } return array("\166\x65\x6e\x64" => $optprov, "\163\x65\143" => $optcod, "\172\157\156" => $optgroup); } function formcliedit($cli) { $db = $this->db->query("\123\105\114\105\x43\x54\40\141\x2e\x63\x6f\144\x69\147\x6f\x2c\x61\56\x6e\157\155\x62\162\145\54\x61\x2e\156\x72\157\x72\151\x66\x20\162\151\146\x2c\124\122\111\115\x28\x61\x2e\143\141\x6d\160\x6f\61\x29\40\163\x69\143\155\x2c\x54\x52\111\115\x28\x61\56\143\141\x6d\x70\x6f\x33\51\x20\x73\151\143\141\x2c\124\122\111\x4d\x28\x61\56\x74\x65\154\145\x66\x6f\x6e\x6f\163\x29\40\x74\x65\x6c\146\x2c\124\122\x49\x4d\50\x61\x2e\164\145\154\x65\x66\x6f\156\157\x5f\x6d\x6f\x76\151\x6c\x29\40\x74\x65\154\146\x32\x2c\x62\x2e\x6e\x6f\x6d\x62\x72\x65\x20\x6e\x6f\x6d\166\145\156\144\54\141\56\166\145\x6e\144\x65\144\x6f\162\54\xa\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x54\122\111\115\50\141\56\x64\151\x72\x65\x63\x63\x69\157\156\51\x20\144\x69\162\145\143\x2c\x54\x52\x49\x4d\50\x61\56\x64\x69\162\x65\x63\x65\x6e\166\151\157\x29\40\144\x69\x72\145\143\x65\156\166\54\143\x2e\x7a\x6f\x6e\141\54\144\x2e\x73\165\142\163\x65\x63\x74\157\162\54\124\122\111\x4d\50\141\x2e\x63\141\x6d\160\157\x34\x29\40\150\x6f\162\141\x72\151\x6f\54\144\x69\x61\x73\x2c\x61\x2e\163\x65\x63\164\157\x72\x2c\x61\x2e\163\x75\142\143\157\144\151\147\157\x2c\141\x2e\x65\155\141\x69\x6c\x2c\x61\x2e\x73\165\x63\165\162\163\141\154\x2c\x61\56\x70\145\162\163\143\157\x6e\164\x20\x63\x6f\x6e\x74\x61\143\x74\157\12\x20\40\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x46\122\117\115\x20\143\154\x69\145\155\x70\x72\145\x20\x61\x20\x4c\105\x46\124\40\112\x4f\111\x4e\40\x6c\151\x73\x74\x76\x65\156\144\40\142\x20\x4f\116\x20\x61\x2e\166\x65\156\144\145\144\x6f\x72\x3d\x62\x2e\x63\157\144\x69\147\157\xa\x20\x20\x20\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\114\x45\106\x54\40\x4a\117\x49\x4e\x20\163\145\143\164\x6f\x72\145\x73\40\x63\40\117\116\40\x61\56\x73\145\143\164\x6f\x72\75\x63\56\143\x6f\x64\151\147\157\xa\x20\40\40\40\40\x20\40\x20\40\40\40\40\40\x20\x20\40\x4c\105\106\124\40\x4a\117\x49\116\x20\x73\165\142\x73\145\x63\x74\x6f\162\145\x73\40\x64\x20\x4f\116\x20\50\141\56\163\x65\x63\164\157\162\75\x64\x2e\x63\157\144\151\x67\157\x20\x26\46\40\x61\x2e\163\165\x62\x63\157\x64\x69\x67\157\x3d\144\56\163\x75\142\143\157\144\151\147\157\x29\x20\127\110\x45\122\145\40\141\56\x63\x6f\x64\x69\147\157\75\47{$cli}\x27\x20\x47\122\x4f\125\x50\40\102\x59\x20\141\56\143\157\x64\151\x67\x6f")->row(); $data = array("\x72\x61\172\x6f\156" => $db->nombre, "\x72\151\146" => $db->rif, "\163\x69\x63\x6d" => $db->sicm, "\x73\x69\x63\x61" => $db->sica, "\x74\145\x6c\146" => $db->telf, "\164\x65\x6c\146\62" => $db->telf2, "\166\x65\156\x64" => $db->vendedor, "\x6e\157\x6d\x76\145\156\x64" => $db->nomvend, "\144\x69\x72\x72\146" => $db->direc, "\x64\151\162\x72\145" => $db->direcenv, "\163\x65\x63\x74\x6f\x72" => $db->sector, "\x73\x75\x62\143\157\x64\x69\147\x6f" => $db->subcodigo, "\x7a\157\156\x61" => $db->zona, "\x73\x75\x62\172\157\x6e\141" => $db->subsector, "\150\157\x72\x72" => $db->horario, "\144\x69\x61\163" => $db->dias, "\145\x6d\x61\151\154" => $db->email, "\x73\x75\143\165\x72\163\141\154" => $db->sucursal, "\143\157\156\164\x61\143\164\x6f" => $db->contacto); return mb_convert_encoding($data, "\x55\124\106\55\70", "\x55\124\x46\55\x38"); } function regarti($prov, $tip, $grup, $nom, $barr, $iva, $leg, $marca, $ref) { $nom = strtoupper($nom); $nomprov = $this->db->query("\x53\105\x4c\x45\103\x54\x20\x6e\x6f\x6d\142\x72\x65\40\106\122\x4f\x4d\40\x70\162\x6f\166\145\145\144\40\x57\x48\105\122\105\40\143\x6f\x64\151\147\x6f\x3d\47{$prov}\x27")->row(); $user = $this->session->userdata("\143\157\x64"); $num = $this->db->query("\x53\105\x4c\x45\103\124\40\115\x41\130\x28\123\125\x42\123\124\122\x28\x63\157\x64\x69\x67\157\54\x34\54\67\51\51\x2b\x31\x20\x6e\x20\x46\x52\x4f\115\x20\141\x72\164\151\x63\165\154\157\40\x57\x48\x45\x52\x45\40\x53\x55\x42\123\124\122\50\x63\x6f\144\x69\x67\x6f\x2c\61\54\x33\51\x3d\47{$tip}\47\x3b")->row(); $newcod = str_pad($num->n, 4, "\x30", STR_PAD_LEFT); $artprov = array("\x69\x64\x5f\x65\155\x70\x72\x65\163\141" => "\104\x4d\105\104\x49\106", "\x61\x67\145\x6e\x63\x69\141" => "\60\x30\61", "\x63\x6f\x64\x69\x67\157" => '' . $tip . $newcod . '', "\160\x72\157\x76\x65\x65\144\157\x72" => $prov, "\x6e\157\155\x62\162\x65" => $nomprov->nombre, "\146\145\x63\150\x61\154\151\163\x74\x61" => date("\131\x2d\155\55\x64")); $art = array("\151\144\137\x65\155\x70\x72\145\x73\x61" => "\x44\x4d\105\104\111\106", "\x61\x67\x65\x6e\143\x69\x61" => "\x30\x30\61", "\143\x6f\x64\x69\147\x6f" => '' . $tip . $newcod . '', "\x67\162\x75\x70\157" => $grup, "\x6e\157\x6d\x62\162\145" => $nom, "\155\x61\x72\143\x61" => $marca, "\162\145\x66\x65\x72\145\156\143\151\x61" => $ref, "\143\x72\145\141\x64\157\160\157\x72" => $user, "\x6d\x6f\x64\x69\x66\160\157\x72" => "\116\x2f\x41", "\146\x65\x63\x68\x61\x63\162\x65\141" => date("\131\55\155\55\x64"), "\151\x6d\160\165\145\x73\164\x6f\x31" => $iva, "\x63\157\x6e\164\x72\x6f\154\x61\x64\157" => $leg, "\160\141\x72\141\137\167\x65\142" => 0); if ($barr == "\x4e\x2f\x41" || $barr == '') { $barras = '' . $tip . $newcod . ''; } else { $barras = $barr; } $dtbarr = array("\x69\144\137\x65\x6d\160\162\145\x73\141" => "\x44\x4d\x45\104\x49\106", "\x61\x67\x65\156\x63\x69\x61" => "\x30\x30\x31", "\143\x6f\x64\x69\147\157" => '' . $tip . $newcod . '', "\143\x6f\x64\x61\x6c\x74\x65\162\156\x61\x74\x69\x76\157" => $barras); $this->db->insert("\141\x72\x74\151\x70\162\157\166", $artprov); $this->db->insert("\x61\x72\x74\151\x63\x75\x6c\x6f", $art); $this->db->insert("\x69\156\166\x63\x6f\x64\x61\x6c\x74\145\x72\x6e\141\x74\x69\166\157", $dtbarr); $this->loguser("\x43\x72\x65\x61\40\120\x72\x6f\144\x75\x63\164\x6f", "\105\x6c\x20\165\x73\x75\x61\x72\151\x6f\x20\143\162\x65\141\40\x65\154\x20\160\x72\157\x64\165\143\164\157\x20" . $tip . $newcod . "\x2c\x20\147\x72\x75\160\x6f\x3a" . $grup . "\x2c\160\162\x6f\x76\x3a" . $prov . "\54\40\156\157\155\142\162\145\72" . $nom . "\54\142\x61\162\x72\x61\72" . $barr . "\x2c\x69\x76\x61\x3a" . $iva . "\x2c\154\145\x67\72" . $leg . ''); return $this->db->affected_rows(); } function editarti($cod, $nom, $barr, $prov, $grup, $leg, $iva, $marca, $ref) { $nomprov = $this->db->query("\x53\x45\114\105\103\124\x20\x6e\x6f\x6d\x62\162\x65\40\x46\x52\x4f\115\x20\160\x72\157\166\x65\145\144\x20\127\110\x45\122\145\40\143\157\144\x69\x67\157\75\x27{$prov}\x27")->row(); $user = $this->session->userdata("\x63\157\x64"); $art = array("\156\157\x6d\x62\x72\x65" => $nom, "\x67\162\x75\160\x6f" => $grup, "\143\x6f\156\x74\x72\x6f\x6c\141\144\157" => $leg, "\151\x6d\x70\165\x65\x73\164\x6f\61" => $iva, "\155\x6f\144\151\146\160\x6f\x72" => $user, "\155\x61\162\143\141" => $marca, "\x72\x65\x66\145\x72\145\x6e\143\x69\x61" => $ref); $dtbarr = array("\143\x6f\x64\141\154\164\145\162\x6e\x61\x74\151\x76\157" => $barr); $artprov = array("\160\162\157\x76\x65\145\144\x6f\162" => $prov, "\x6e\x6f\155\x62\x72\145" => $nomprov->nombre); $this->db->where("\143\157\x64\151\147\x6f", $cod)->update("\x61\x72\164\x69\x63\165\154\157", $art); $this->db->where("\x63\157\144\151\147\x6f", $cod)->update("\x69\x6e\x76\143\157\144\141\154\x74\145\162\156\141\x74\x69\166\157", $dtbarr); $this->db->where("\x63\157\x64\x69\147\157", $cod)->update("\141\162\x74\x69\160\162\157\166", $artprov); $this->loguser("\115\x6f\144\x69\x66\151\x63\141\x72", "\x45\x6c\40\x75\x73\x75\141\162\151\x6f\x20\150\141\40\155\x6f\x64\x69\146\151\x63\x61\x64\157\x20\x6c\141\x20\x66\151\x63\x68\141\x20\x64\x65\x6c\40\x61\162\x74\151\x63\165\154\x6f\x20" . $cod . "\40\160\x6f\x72\x20\156\x6f\155\72" . $nom . "\54\x62\x61\x72\162\x61\x3a" . $barr . "\x2c\160\162\157\166\72" . $prov . "\x2c\147\162\165\160\72" . $grup . "\54\154\x65\147\72" . $leg . "\54\151\166\141\72" . $iva, ''); return $this->db->affected_rows(); } function editlote($cod, $alm, $lot, $elab, $venc, $ubic) { $art = array("\145\x6c\141\142" => $elab, "\166\145\156\x63\145" => $venc, "\165\x62\x69\143\x61" => $ubic); $this->db->where("\103\117\116\x43\101\124\50\x63\157\x64\151\x67\157\x61\162\x74\54\154\x6f\164\145\51\x3d\x27{$cod}\47\x20\46\46\x20\141\154\155\x61\x63\145\156\x3d\47{$alm}\47")->update("\x61\x72\164\x69\154\x6f\164\x65\163", $art); $this->loguser("\x4d\157\x64\x69\146\x69\x63\x61\162", "\x45\154\x20\x75\163\x75\x61\162\151\157\x20\150\x61\x20\155\157\x64\151\146\x69\143\141\144\157\40\x6c\141\x20\146\151\x63\x68\141\x20\x64\145\154\x20\154\x6f\164\x65\x20" . $lot . "\x20\160\x61\x72\x61\x20\145\x6c\40\160\x72\x6f\144\165\x63\164\x6f\40" . $cod . "\x20\x70\x6f\162\40\x6c\x6f\164\x3a" . $lot . "\54\141\x6c\x6d\x3a" . $alm . "\x2c\x65\154\141\142\72" . $elab . "\54\x76\145\x6e\x63\72" . $venc . "\54\x75\142\x69\143\x61\x3a" . $ubic . "\56"); return $this->db->affected_rows(); } function regcli($razon, $rif, $sicm, $sica, $telf, $telf2, $vend, $dirrf, $dirre, $sector, $zona, $horr, $dias, $email, $tip, $sucursal, $contac, $tipo, $segmento) { if ($tip == 1) { $num = $this->db->query("\123\105\114\x45\103\124\x20\x4d\x41\130\50\x53\125\x42\x53\124\122\50\x63\x6f\144\x69\147\x6f\54\x33\54\x36\x29\51\53\61\40\156\40\106\x52\x4f\115\x20\143\x6c\x69\x65\155\160\162\145\40\127\110\x45\122\x45\40\123\125\x42\x53\x54\122\50\x63\x6f\144\151\x67\x6f\54\61\54\62\x29\75\x27\x4d\106\x27\73")->row(); $newcod = str_pad($num->n, 4, "\x30", STR_PAD_LEFT); $newcod = "\x4d\106" . $newcod; } else { $num = $this->db->query("\x53\105\x4c\x45\103\124\x20\115\101\130\x28\x53\125\x42\123\124\x52\x28\x63\x6f\x64\151\147\157\x2c\64\x2c\67\51\x29\x2b\61\x20\x6e\x20\106\122\x4f\115\x20\x63\x6c\151\x65\155\160\x72\145\40\127\x48\105\x52\105\x20\x53\125\102\123\124\122\x28\x63\157\x64\x69\147\157\54\x31\54\63\51\x3d\47\x49\x4e\x54\47\x3b")->row(); $newcod = str_pad($num->n, 4, "\60", STR_PAD_LEFT); $newcod = "\111\116\x54" . $newcod; } $cli = array("\x63\157\144\x69\147\157" => $newcod, "\x6e\x6f\x6d\x62\162\x65" => $razon, "\x6e\x72\157\162\151\x66" => $rif, "\x63\x61\155\160\157\61" => $sicm, "\143\141\x6d\x70\157\x33" => $sica, "\x74\145\x6c\x65\146\x6f\156\x6f\x73" => $telf, "\x74\145\154\145\146\157\156\157\x5f\x6d\x6f\x76\151\154" => $telf2, "\x76\x65\156\x64\x65\x64\x6f\x72" => $vend, "\x64\x69\162\x65\143\143\x69\x6f\156" => $dirrf, "\144\x69\x72\x65\143\145\156\x76\151\x6f" => $dirre, "\x73\145\x63\x74\x6f\x72" => trim($sector), "\163\165\x62\x63\157\x64\x69\147\157" => trim($zona), "\143\x61\155\160\x6f\x34" => $horr, "\x64\x69\x61\163" => $dias, "\x65\x6d\x61\151\154" => $email, "\x73\165\x63\165\162\x73\141\154" => $sucursal, "\160\145\162\x73\x63\x6f\x6e\164" => $contac, "\x74\151\x70\x6f" => $tipo, "\163\x75\x62\x64\151\166\151\x73\151\157\x6e" => $segmento, "\146\145\143\x68\141" => date("\131\x2d\155\55\144")); $this->db->insert("\x63\154\151\x65\x6d\x70\x72\x65", $cli); $this->loguser("\x52\145\147\x69\x73\164\162\x6f\x20\x43\154\x69\x65\x6e\164\145", "\x45\154\x20\x75\163\x75\141\162\x69\157\40\x72\x65\147\x69\x73\164\162\x61\40\x61\x6c\40\143\154\151\x65\156\164\x65\40\115\x46" . $newcod . "\x2e"); return $this->db->affected_rows(); } function editcli($cod, $razon, $rif, $sicm, $sica, $telf, $telf2, $vend, $dirrf, $dirre, $sector, $zona, $horr, $dias, $email, $sucursal, $contac, $tipo, $segmento) { $cli = array("\156\157\155\x62\162\x65" => $razon, "\x6e\162\157\x72\x69\x66" => $rif, "\x63\141\x6d\x70\x6f\x31" => $sicm, "\x63\x61\155\x70\x6f\x33" => $sica, "\164\145\154\145\146\x6f\x6e\x6f\x73" => $telf, "\x74\145\x6c\145\146\157\156\157\x5f\155\157\166\x69\x6c" => $telf2, "\x76\x65\156\144\x65\144\157\162" => $vend, "\x64\x69\x72\x65\143\x63\x69\157\x6e" => $dirrf, "\144\151\x72\145\x63\145\x6e\166\x69\x6f" => $dirre, "\163\x65\143\164\157\x72" => $sector, "\x73\165\x62\x63\157\x64\151\x67\x6f" => $zona, "\x63\141\155\160\x6f\x34" => $horr, "\144\x69\x61\x73" => $dias, "\145\x6d\x61\x69\154" => $email, "\163\x75\x63\165\162\163\x61\x6c" => $sucursal, "\x70\145\162\163\x63\157\x6e\164" => $contac, "\164\x69\x70\x6f" => $tipo, "\163\165\x62\144\x69\166\x69\x73\151\157\156" => $segmento); $this->db->where("\x63\x6f\144\x69\x67\x6f", $cod)->update("\x63\x6c\x69\x65\155\160\162\x65", $cli); $this->loguser("\115\157\144\x69\x66\x69\x63\141\x72", "\x45\x6c\x20\x75\x73\x75\x61\x72\x69\157\x20\155\x6f\144\x69\x66\x69\x63\x61\40\141\x6c\40\143\x6c\151\145\156\164\145\x20" . $cod . "\40\154\x6f\163\x20\144\x61\x74\x6f\163\x20\144\145\40\x73\x75\x20\x66\x69\x63\150\x61\56"); return $this->db->affected_rows(); } public function devol($a, $b) { $this->load->library("\164\x61\142\x6c\x65"); if ($b != '') { $filter = "\x26\x26\x20\x28\141\56\x72\x65\146\145\x72\145\x6e\x63\x69\x61\40\154\151\x6b\x65\40\47\45{$b}\x25\47\x20\x7c\174\x20\141\56\x63\x6f\144\x63\x6c\151\145\x6e\x74\x65\x3d\x27{$b}\47\x20\x7c\x7c\x20\x61\56\x6e\x6f\155\x62\x72\145\143\x6c\x69\40\114\x49\113\x45\x20\47\45{$b}\45\47\x20\x7c\174\40\x61\56\x76\x65\x6e\144\x65\x64\x6f\x72\x20\x6c\x69\x6b\x65\x20\47\45{$b}\45\x27\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\114\105\103\x54\40\x61\56\x64\x6f\143\x75\155\x65\x6e\x74\x6f\54\xa\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x61\56\x72\x65\x66\145\x72\145\x6e\143\151\x61\x2c\x61\x2e\x74\x69\x70\157\x64\157\x63\x2c\x61\56\146\x65\143\150\141\x63\x72\145\x61\54\141\x2e\166\145\156\143\x65\54\40\141\56\x63\x6f\x64\143\x6c\151\x65\x6e\164\x65\x2c\x20\141\x2e\x6e\157\x6d\x62\x72\145\x63\x6c\x69\x2c\40\141\56\164\x65\154\x65\146\x6f\x6e\x6f\x73\x2c\40\x61\x2e\163\x65\143\164\x6f\x72\x2c\x61\56\x76\x65\x6e\144\145\144\x6f\162\x2c\x20\xa\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x52\x4f\x55\x4e\104\50\x53\125\115\50\142\x2e\143\x61\156\x74\151\x64\x61\144\x29\x2d\40\x53\x55\x4d\x28\x62\56\x63\156\164\144\145\x76\165\145\154\x74\51\x2c\60\51\x20\x75\156\x69\144\141\144\145\163\x2c\40\x61\x2e\163\x74\141\164\x75\163\xa\x20\40\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x46\122\117\115\40\x64\x65\x76\x6f\154\x74\x69\x20\x41\123\40\141\40\x4a\117\x49\116\x20\x64\145\x76\x6f\x6c\155\166\x20\x41\x53\x20\142\x20\x4f\116\40\141\x2e\x64\x6f\143\165\x6d\145\x6e\x74\x6f\75\142\56\x64\157\143\x75\155\145\x6e\x74\157\12\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\x57\x48\105\122\x45\x20\x61\56\x74\151\160\x6f\144\x6f\143\x3d\x27\x44\x45\x56\x27\40" . $filter . "\xa\x20\40\40\40\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x47\x52\117\125\120\40\x42\x59\40\x61\x2e\x64\x6f\x63\165\155\x65\156\x74\157")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\x45\x4c\x45\103\x54\40\141\56\x64\157\x63\165\155\x65\x6e\164\157\54\xa\40\x20\x20\x20\x20\40\x20\40\40\40\x20\40\x20\40\x20\40\x61\x2e\162\145\x66\x65\x72\x65\156\143\x69\x61\x2c\x61\56\x74\151\160\157\x64\x6f\x63\54\141\x2e\x66\x65\143\x68\141\143\x72\x65\x61\x2c\x61\x2e\x76\x65\156\143\x65\x2c\40\x61\x2e\x63\157\x64\x63\154\151\x65\156\x74\145\54\40\141\x2e\156\157\155\142\162\145\143\x6c\x69\x2c\40\141\56\x74\x65\x6c\145\146\157\x6e\157\x73\54\40\x61\x2e\x73\x65\x63\x74\x6f\x72\x2c\x61\x2e\x76\145\156\144\x65\x64\157\x72\54\40\12\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\122\117\125\x4e\104\50\x53\125\x4d\x28\x62\56\x63\141\156\164\x69\x64\141\144\x29\55\x20\123\125\x4d\50\142\56\x63\156\x74\x64\145\166\x75\x65\x6c\164\x29\54\x30\x29\40\165\156\x69\144\141\x64\145\x73\54\40\x61\56\x73\164\141\x74\x75\x73\xa\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\x46\x52\117\115\x20\x64\145\166\157\154\x74\x69\40\x41\x53\x20\141\x20\x4a\x4f\x49\x4e\40\144\145\166\x6f\154\x6d\x76\x20\x41\x53\x20\142\x20\117\x4e\x20\x61\56\144\157\x63\165\x6d\145\156\x74\157\x3d\142\x2e\144\x6f\143\165\155\145\x6e\x74\x6f\12\x20\40\x20\40\40\x20\40\40\x20\x20\40\40\40\x20\40\x20\40\127\110\x45\x52\105\x20\x61\x2e\x74\x69\160\x6f\x64\157\143\75\47\104\x45\126\47\x20" . $filter . "\12\40\40\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x47\122\x4f\125\x50\40\102\x59\40\x61\x2e\144\x6f\x63\165\155\145\156\164\157\40\117\122\x44\x45\122\x20\x42\x59\40\x61\56\x73\164\141\164\165\163\x20\x41\123\103\x2c\141\56\x64\x6f\x63\x75\x6d\145\156\x74\157\x20\x44\105\123\x43\x20\114\x49\x4d\x49\124\40" . ($a - 1) * $mostrar . "\40\54\x20" . $mostrar . "\x3b")->result(); $html = "\12\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x3c\164\141\x62\154\x65\x20\x63\x6c\141\163\163\75\x22\x77\63\55\x74\141\x62\x6c\x65\x2d\x61\154\x6c\x20\167\x33\x2d\150\157\166\x65\162\141\x62\x6c\145\x20\x77\63\x2d\154\145\x66\164\x2d\141\x6c\x69\x67\x6e\42\76\xa\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x3c\x74\x72\x3e\74\x74\x64\x20\143\x6c\x61\x73\163\x3d\x22\x77\63\55\x66\157\x6e\144\x6f\x64\162\157\151\144\x22\76\102\165\x73\143\141\x72\40\74\151\155\x67\40\x73\x72\143\x3d\42" . base_url() . "\151\155\x61\x67\x65\x73\x2f\x62\165\x73\143\x61\x72\x2e\x70\156\x67\x22\x20\141\x6c\x74\x3d\x22\102\x75\x73\143\x61\162\x22\x20\x74\151\164\154\x65\75\42\102\x75\x73\143\x61\x72\x22\x20\x73\164\x79\x6c\x65\75\42\x77\151\x64\164\x68\72\61\70\160\170\73\x62\x6f\x72\x64\145\x72\72\60\73\42\76\74\x2f\164\x64\76\12\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x3c\164\144\x3e\x3c\x69\156\160\x75\164\x20\164\x79\x70\145\75\x22\164\x65\170\x74\42\x20\x63\x6c\x61\163\x73\75\42\167\63\x2d\x69\x6e\160\165\x74\42\x20\x70\154\141\143\x65\x68\x6f\x6c\x64\145\x72\75\42\111\156\147\x72\145\163\x65\40\163\x75\40\x62\165\163\161\165\x65\x64\x61\x22\40\x6f\156\143\x68\141\156\x67\x65\x3d\x22\144\x65\x76\x6f\154\50\x29\42\x20\x69\144\x3d\42\154\151\153\145\x22\76\x3c\x2f\164\144\76\xa\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\74\x74\x64\x20\x63\154\141\163\163\x3d\42\167\63\55\143\145\156\x74\x65\162\40\167\63\55\142\x74\x6e\x22\76\x3c\141\x20\x6f\x6e\x63\154\151\x63\x6b\75\x22\160\x72\x65\146\x61\x63\62\x28\x29\73\x22\76\x3c\151\155\x67\x20\x73\162\143\x3d\42" . base_url() . "\151\155\x61\147\x65\x73\57\146\x61\143\x74\165\x72\x61\56\160\x6e\147\42\x20\141\x6c\164\75\x22\x46\x61\143\x74\165\162\141\x72\x22\40\164\x69\164\x6c\x65\75\42\106\141\143\164\165\162\x61\x72\x22\x20\163\x74\171\154\145\x3d\x22\x77\151\144\164\x68\x3a\62\x30\x70\170\x3b\x68\x65\151\x67\x68\164\x3a\62\x30\160\x78\73\142\157\x72\x64\x65\162\x3a\x30\73\x22\76\74\57\141\76\74\x2f\164\x64\76\12\40\x20\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\74\x74\144\x20\x63\x6c\x61\163\x73\75\42\167\63\55\x63\145\156\164\145\x72\x20\x77\63\x2d\142\x74\156\42\76\x3c\141\40\157\x6e\143\154\151\x63\153\x3d\42\x61\x75\x74\144\145\x76\157\154\x28\51\73\x22\x3e\74\x69\155\147\x20\x73\x72\x63\75\x22" . base_url() . "\151\x6d\141\x67\x65\163\57\142\x6e\56\x70\x6e\147\x22\x20\x61\x6c\164\x3d\x22\x41\x75\x74\157\162\x69\x7a\141\x72\42\x20\164\x69\164\x6c\145\x3d\42\x41\165\x74\x6f\x72\151\172\141\x72\42\40\x73\164\171\154\x65\75\x22\x77\x69\x64\164\150\x3a\x32\x30\x70\170\73\150\x65\x69\147\x68\x74\x3a\x32\60\x70\x78\73\x62\157\162\144\x65\162\x3a\x30\73\42\x3e\74\57\141\76\x3c\x2f\x74\144\x3e\xa\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\x20\40\74\x74\x64\40\x63\154\x61\x73\x73\x3d\x22\167\63\x2d\x63\145\x6e\x74\145\x72\40\x77\x33\55\142\x74\x6e\x22\76\x3c\141\40\x6f\x6e\143\x6c\x69\x63\153\x3d\42\x63\x75\x61\144\x65\166\157\x6c\x28\x29\73\x22\x3e\x3c\x69\155\147\40\163\162\x63\75\42" . base_url() . "\x69\155\x61\x67\145\x73\57\x63\x75\141\162\x65\x6e\164\145\x6e\141\56\x70\156\x67\x22\x20\x61\154\164\x3d\42\103\x75\141\162\145\156\164\x65\x6e\141\42\x20\x74\151\x74\154\x65\75\42\103\x75\141\x72\145\x6e\x74\x65\x6e\141\42\x20\163\164\171\154\145\75\42\167\x69\x64\x74\x68\x3a\62\x30\x70\170\73\150\x65\151\147\x68\164\x3a\x32\x30\160\170\73\x62\157\162\x64\x65\x72\x3a\60\x3b\42\x3e\x3c\57\141\x3e\74\57\x74\144\76\xa\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\74\x74\144\40\143\154\141\163\163\x3d\x22\167\63\x2d\x63\x65\156\164\x65\x72\40\167\x33\55\142\x74\156\42\x3e\x3c\x61\40\157\x6e\x63\154\x69\143\153\75\42\x64\145\166\x6f\x6c\50\x29\x3b\x22\x3e\x3c\151\155\x67\40\163\162\143\75\x22" . base_url() . "\x69\x6d\141\x67\145\x73\x2f\x72\x65\x6c\x6f\x61\x64\56\x70\x6e\147\42\40\141\x6c\x74\x3d\x22\x52\x65\143\141\x72\x67\141\x72\42\40\x74\151\164\x6c\x65\x3d\x22\x52\145\x63\x61\x72\147\x61\162\x22\x20\x73\x74\x79\154\x65\x3d\42\167\x69\144\164\x68\x3a\x32\x30\160\x78\73\x68\145\151\147\150\x74\72\62\60\x70\x78\x3b\142\x6f\x72\x64\x65\162\x3a\x30\73\42\x3e\74\57\141\x3e\x3c\57\164\x64\x3e\12\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\40\40\x20\40\x3c\x21\55\55\x3c\x74\144\40\x63\x6c\x61\x73\163\x3d\x22\x77\63\55\x63\x65\156\164\x65\x72\40\167\63\x2d\142\x74\156\x22\x3e\74\141\x20\157\156\x63\x6c\151\143\153\x3d\42\145\154\x69\x6d\x66\x61\143\50\51\x3b\x22\76\74\151\155\x67\x20\163\x72\x63\75\42" . base_url() . "\x69\x6d\x61\147\145\x73\57\x62\157\162\162\x61\162\x2e\x70\156\x67\x22\40\141\x6c\x74\x3d\x22\105\154\151\x6d\151\x6e\141\x72\x22\40\164\x69\164\154\x65\75\x22\105\x6c\151\x6d\151\x6e\141\x72\x22\x20\163\x74\171\154\145\75\x22\167\151\144\164\x68\x3a\x32\x30\x70\x78\73\150\145\151\x67\x68\x74\72\x32\x30\x70\x78\x3b\142\x6f\162\x64\145\x72\72\x30\x3b\x22\x3e\x3c\x2f\141\x3e\x3c\x2f\164\x64\x3e\x2d\x2d\x3e\x3c\x2f\164\162\76\12\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x3c\x2f\164\141\x62\x6c\x65\x3e\74\142\162\x3e\xa\x20\40\40\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x3c\x74\x61\142\154\145\x20\151\x64\75\x22\151\x64\x30\x31\42\40\x63\x6c\x61\163\x73\x3d\x22\167\x33\55\164\x61\x62\154\x65\x2d\x61\154\154\x20\167\x33\55\x68\157\166\145\162\x61\x62\154\x65\40\167\63\x2d\x6c\x65\146\164\x2d\x61\x6c\x69\x67\156\x20\167\x33\55\x74\x69\x6e\171\42\76\x3c\x74\162\x20\x63\154\x61\163\163\75\x22\x77\x33\55\x66\x6f\156\144\157\x64\162\157\x69\144\42\76\x3c\164\x68\x3e\x4e\74\x2f\x74\x68\76\x3c\164\150\76\124\151\x70\157\74\57\x74\x68\x3e\74\164\x68\x3e\x44\157\x63\x3c\57\x74\x68\x3e\x3c\x74\150\x3e\122\145\146\145\x72\145\x6e\x63\x69\x61\x3c\x2f\164\x68\x3e\x3c\164\x68\x3e\x43\x6f\x64\151\x67\157\x3c\57\164\x68\x3e\x3c\164\150\76\x4e\157\155\x62\x72\x65\x3c\57\164\150\x3e\74\164\150\76\106\x65\x63\x68\141\74\x2f\x74\x68\x3e\x3c\164\150\x3e\126\x65\x6e\143\x65\74\x2f\164\x68\76\74\164\150\76\x53\145\143\164\x6f\x72\x3c\x2f\164\x68\76\74\164\x68\76\126\x65\x6e\144\145\x64\x6f\x72\x3c\57\164\150\x3e\74\x74\150\x3e\x55\156\x69\144\x61\144\x65\163\74\57\164\150\76\74\164\x68\76\106\56\x41\x75\164\x6f\x72\151\x7a\141\74\x2f\164\150\x3e\x3c\164\150\76\x46\56\101\x73\151\x67\x6e\141\x3c\x2f\x74\150\76\74\164\x68\x3e\x46\56\105\155\x70\74\57\x74\x68\76\x3c\x74\150\x3e\105\x73\164\x61\x74\165\163\74\x2f\x74\x68\76\x3c\x2f\x74\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $oper = $this->db->query("\x53\105\114\x45\103\x54\x20\142\x2e\x6e\x6f\155\142\162\145\x2c\141\56\x61\156\164\x64\x6f\143\54\143\x2e\x74\151\155\x65\141\163\x69\x67\x2c\143\x2e\x74\151\x6d\x65\145\155\160\54\x63\56\x74\x69\155\145\x61\165\x74\40\106\122\x4f\115\x20\157\x70\145\x72\164\x69\40\141\163\40\141\40\112\x4f\111\116\x20\154\x69\x73\164\166\x65\156\144\40\x61\x73\x20\142\x20\117\116\40\x61\56\x76\x65\156\x64\x65\x64\x6f\x72\75\142\56\143\157\144\151\147\x6f\40\xa\x20\x20\40\40\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\40\40\x20\x20\x4c\105\106\124\40\112\x4f\x49\x4e\40\143\x6f\x6e\164\x72\157\154\x5f\157\x70\x65\162\164\x69\40\x63\x20\117\x4e\40\x63\56\x64\157\143\x3d\141\56\141\156\164\144\x6f\x63\xa\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\40\127\x48\x45\x52\x45\x20\103\117\x4e\x43\101\124\x28\141\56\164\x69\160\x6f\x64\157\x63\54\141\x2e\x64\x6f\x63\165\155\145\x6e\164\x6f\51\75\47{$dtfac->referencia}\47\x20\107\x52\x4f\x55\120\x20\x42\x59\x20\141\56\144\157\x63\x75\x6d\x65\156\164\x6f")->row(); $html .= "\x3c\x74\x72\40\151\x64\x3d\42\x73\x6c\145\143\164" . $i . "\x22\40\143\154\x61\x73\x73\x3d\x22\151\164\x65\x6d\42\40\157\156\143\154\x69\143\153\75\42\x69\x74\144\145\166\157\154\x28\44\x28\x27\x23\141" . $i . "\x27\x29\56\166\x61\x6c\50\x29\x2c\44\x28\x27\x23\x62" . $i . "\x27\x29\56\166\x61\154\x28\51\51\73\42\76"; if ($dtfac->status == "\x30") { $status = "\120\145\x6e\x64\x69\x65\156\164\x65"; $color = "\x77\63\x2d\162\x65\144"; } elseif ($dtfac->status == "\x31") { $status = "\x4c\x69\163\164\157"; $color = "\x77\x33\55\x67\162\x65\145\156"; } $html .= "\74\x69\x6e\x70\165\x74\x20\x74\171\160\x65\75\x22\150\151\x64\144\145\156\42\40\x69\144\75\42\x61" . $i . "\x22\x20\156\141\155\145\x3d\x22\x64\157\143\42\x20\166\141\154\x75\145\75\42" . $dtfac->documento . "\42\76\x3c\151\156\x70\x75\164\40\x74\x79\160\x65\75\42\x68\151\x64\x64\x65\156\42\x20\x69\144\x3d\x22\142" . $i . "\x22\x20\x6e\x61\155\x65\75\42\x74\151\160\x6f\144\157\143\x22\x20\x76\x61\154\165\145\x3d\x22" . $dtfac->tipodoc . "\42\76\12\40\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x3c\151\156\x70\165\x74\40\164\171\160\145\x3d\42\150\151\144\x64\x65\x6e\x22\x20\x6e\x61\x6d\x65\x3d\42\x61\156\x74\x64\157\x63\42\x20\x76\141\x6c\165\x65\75\x22" . $dtfac->antdoc . "\x22\76\74\151\x6e\160\165\x74\x20\x74\x79\x70\145\75\42\x68\x69\x64\144\x65\x6e\42\40\x6e\x61\155\x65\75\x22\x73\x74\x61\x74\165\163\42\x20\166\x61\154\165\145\75\x22" . $dtfac->status . "\42\76\12\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\40\74\x74\x64\76" . $i . "\74\57\x74\x64\x3e\74\x74\x64\x3e\x3c\151\156\160\165\x74\x20\x74\x79\x70\x65\75\x22\x63\150\145\143\x6b\x62\157\x78\x22\x20\157\x6e\143\x6c\151\x63\x6b\x3d\x22\x77\x33\x2e\164\x6f\x67\x67\154\x65\103\x6c\x61\x73\x73\x28\47\x23\163\154\145\x63\164" . $i . "\47\54\x27\167\63\x2d\x79\x65\154\x6c\157\x77\x27\51\73\42\x20\x63\154\x61\163\163\x3d\x22\167\63\55\x63\x68\145\143\153\x22\40\156\141\x6d\145\75\x22\143\x68\x65\x63\x6b\x22\76" . $dtfac->tipodoc . "\x3c\57\164\x64\x3e\xa\40\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\40\x20\74\164\144\x3e" . $dtfac->documento . "\x3c\x2f\x74\144\x3e\74\164\x64\x3e" . $dtfac->referencia . "\74\x2f\x74\144\76\x3c\x74\x64\x3e" . $dtfac->codcliente . "\74\57\x74\144\x3e\74\164\x64\76" . $dtfac->nombrecli . "\74\x2f\164\144\x3e\74\x74\x64\76" . $dtfac->fechacrea . "\x3c\57\164\x64\x3e\12\40\x20\40\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\40\x3c\x74\144\76" . $dtfac->vence . "\x3c\x2f\164\144\x3e\74\164\144\76" . $dtfac->sector . "\x3c\x2f\164\144\76\x3c\164\x64\76" . $oper->nombre . "\74\57\164\x64\76\x3c\164\x64\76" . $dtfac->unidades . "\x3c\57\x74\x64\x3e\74\164\x64\76" . $oper->timeaut . "\x3c\57\164\x64\x3e\74\164\144\x3e" . $oper->timeasig . "\x3c\x2f\164\x64\76\xa\x20\40\40\40\40\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\40\x20\40\x3c\x74\144\x3e" . $oper->timeemp . "\74\57\164\144\x3e\74\x74\144\x20\143\154\x61\x73\163\75\42" . $color . "\x20\167\x33\x2d\143\x65\x6e\x74\145\162\x22\76" . $status . "\x3c\57\164\144\x3e\xa\x20\40\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\40\74\x2f\x74\x72\x3e"; } $html .= "\74\x74\x72\76\x3c\164\x64\x20\x63\154\141\163\x73\75\42\x77\63\x2d\x63\x65\156\x74\145\x72\x20\x77\x33\x2d\146\157\x6e\144\x6f\144\x72\157\x69\144\42\40\x63\x6f\154\163\160\141\x6e\x3d\x22\61\63\x22\x3e\74\154\141\x62\145\x6c\x20\x63\154\x61\x73\163\x3d\42\167\x33\x2d\x6c\x61\x72\147\x65\x22\x3e\74\142\x3e\124\x6f\x74\141\154\40\125\156\151\x64\x61\x64\145\x73\72\40" . $totalreg . "\x3c\x2f\x62\x3e\x3c\57\x6c\x61\x62\145\154\x3e\74\x2f\164\144\76\x3c\57\164\162\76\x3c\x2f\164\x61\142\154\x65\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\40\40\x3c\x73\143\162\x69\160\x74\x20\164\x79\x70\145\75\42\164\145\x78\164\57\152\141\166\x61\x73\143\x72\151\x70\x74\42\x3e\12\x20\40\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\40\40\40\x20\146\x75\x6e\143\x74\151\157\x6e\40\x44\145\143\x72\145\x6d\x65\x6e\x74\116\165\x6d\x66\141\143\50\51\x7b\xa\40\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\166\x61\162\x20\104\145\143\x72\145\155\x65\156\x74\116\165\155\75\144\157\x63\165\x6d\145\156\164\56\x67\145\x74\x45\x6c\x65\155\x65\x6e\164\102\171\111\x64\50\x22\x44\x65\x63\162\x65\x6d\x65\x6e\164\x4e\165\x6d\x22\x29\56\x76\141\154\x75\x65\x3b\12\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\x76\x61\x72\x20\153\x65\x79\x3d\42\x64\x72\157\151\x64\x39\60\63\42\x3b\xa\40\40\x20\x20\x20\x20\40\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x76\141\162\40\x64\141\x74\157\163\x20\75\40\173\xa\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\40\x20\42\x70\141\x67\42\40\x3a\40\x44\x65\x63\162\145\x6d\x65\156\164\116\165\x6d\x2c\12\40\40\x20\x20\40\40\40\40\40\40\40\x20\40\40\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\42\x6b\145\x79\x22\40\x3a\x20\153\145\171\xa\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x7d\x3b\xa\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\12\x20\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\40\x20\40\x24\x2e\141\152\x61\170\x28\173\12\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\x64\x61\x74\141\72\x20\x64\141\164\x6f\163\54\12\40\40\40\x20\40\x20\x20\40\40\40\40\40\x20\x20\x20\40\40\x20\40\40\40\40\40\40\x20\40\40\40\x20\x20\x20\x75\162\x6c\x3a\x20\x20\142\141\x73\145\165\162\154\53\42\143\137\x64\162\157\x69\144\57\x64\145\x76\157\x6c\x22\54\xa\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x74\171\x70\x65\x3a\40\42\x50\x4f\123\x54\x22\x2c\12\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\40\40\40\40\40\x73\x75\x63\143\145\163\163\x3a\40\146\165\156\x63\x74\151\157\156\x28\144\141\x74\x61\51\40\173\12\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\x24\x28\42\x23\x62\157\x64\171\42\x29\x2e\x68\x74\x6d\x6c\x28\144\x61\x74\x61\51\x3b\xa\x20\x20\40\40\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\x7d\12\40\x20\40\40\40\40\40\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\xa\40\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\175\x29\x3b\xa\x20\40\40\x20\40\40\x20\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\40\x20\40\x20\x7d\xa\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\12\40\40\x20\40\40\40\x20\40\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\146\165\156\x63\164\x69\157\x6e\x20\x6e\x75\x6d\x70\141\147\x66\x61\x63\x28\x61\51\173\12\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\166\141\162\40\x6b\x65\171\x3d\42\144\x72\157\151\144\71\x30\x33\42\73\12\x20\x20\x20\40\40\x20\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\xa\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\40\40\40\40\40\x20\40\x20\x20\40\40\40\x76\141\162\40\x64\141\x74\x6f\163\x20\75\40\173\xa\40\40\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x22\x6b\x65\171\42\72\153\145\171\x2c\12\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\40\40\42\x70\x61\147\x22\40\72\x20\x61\xa\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\x7d\x3b\xa\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\12\40\x20\40\40\40\x20\x20\40\40\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\40\x20\x24\x2e\141\152\141\170\x28\x7b\12\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\x64\x61\x74\x61\72\40\144\x61\164\x6f\x73\x2c\12\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x75\x72\154\72\40\x62\x61\x73\145\x75\x72\154\x2b\x22\x63\x5f\x64\x72\157\151\x64\57\144\145\x76\x6f\154\x22\54\12\40\40\x20\40\x20\40\40\x20\40\40\x20\x20\40\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\164\171\160\145\72\40\x22\x50\117\x53\124\x22\x2c\12\40\40\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x20\x20\40\163\165\143\x63\x65\x73\x73\72\40\146\165\x6e\x63\164\151\x6f\x6e\50\x64\x61\164\141\51\x20\x7b\xa\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\44\x28\x22\x23\142\157\144\x79\x22\x29\56\150\164\155\154\50\x64\x61\164\x61\x29\73\xa\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\175\xa\x20\40\40\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\xa\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\40\x20\x20\x7d\x29\73\12\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\x20\x7d\12\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\12\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\146\165\156\x63\x74\151\x6f\x6e\40\x49\x6e\143\162\151\155\x65\x6e\x74\x4e\x75\155\146\x61\x63\50\x29\x7b\12\x20\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\x76\x61\162\x20\x49\x6e\x63\x72\x69\155\145\x6e\164\116\165\155\75\x64\x6f\x63\165\x6d\145\156\x74\x2e\147\145\x74\105\154\x65\x6d\x65\x6e\x74\102\x79\111\x64\50\x22\111\x6e\x63\162\151\155\x65\156\x74\116\x75\x6d\x22\x29\56\166\141\154\165\x65\73\12\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\166\x61\x72\x20\153\x65\x79\75\42\x64\x72\157\x69\x64\x39\x30\63\x22\73\xa\40\x20\x20\40\x20\x20\40\40\40\40\40\40\40\40\40\40\40\x20\40\40\x20\x20\x20\x20\166\x61\162\x20\x64\x61\x74\x6f\163\x20\75\x20\173\12\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\40\40\40\40\40\x20\40\40\x20\40\x20\x20\x20\42\x6b\145\171\x22\x3a\x6b\145\171\54\12\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\40\x20\x20\x22\x70\141\147\x22\40\72\x20\x49\156\143\x72\x69\155\145\x6e\x74\x4e\x75\x6d\12\x20\x20\40\x20\40\40\40\x20\40\40\40\40\40\40\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\40\x7d\x3b\12\x20\40\40\40\40\40\40\40\40\x20\40\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\12\x20\x20\40\40\40\x20\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\44\56\x61\x6a\x61\170\50\173\12\40\x20\40\x20\x20\40\x20\40\40\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\144\141\x74\141\x3a\40\144\x61\164\157\163\x2c\12\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x75\x72\x6c\72\40\x20\142\141\x73\145\x75\x72\x6c\x2b\42\x63\x5f\x64\162\157\x69\x64\x2f\x64\x65\x76\x6f\154\42\x2c\xa\40\x20\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\164\x79\x70\x65\x3a\x20\x22\x50\x4f\123\124\x22\x2c\12\x20\40\40\x20\40\40\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\40\163\x75\143\143\145\163\x73\72\40\146\165\156\143\x74\x69\x6f\156\x28\x64\141\164\141\x29\40\x7b\xa\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x24\50\x22\43\142\157\144\x79\x22\51\56\x68\x74\155\x6c\x28\x64\141\164\141\51\73\xa\40\x20\x20\40\40\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\x20\175\xa\40\40\40\x20\40\40\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\x20\xa\40\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\175\x29\x3b\12\40\40\40\40\x20\40\x20\x20\40\40\x20\40\40\40\40\40\40\x20\40\x20\40\x20\x20\x7d\12\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x3c\57\x73\x63\162\x69\x70\x74\76\12\40\40\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\40\x3c\144\151\x76\40\x63\154\x61\163\x73\75\42\167\x33\x2d\x62\141\162\40\167\63\x2d\142\x6f\162\x64\145\162\40\167\63\55\x62\141\x72\x72\141\x73\42\76\12\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x3c\x69\156\x70\x75\x74\40\x74\171\160\145\75\x22\150\151\144\144\x65\156\42\x20\151\x64\x3d\42\x44\145\x63\x72\x65\x6d\145\x6e\x74\x4e\x75\155\42\x20\x76\x61\154\x75\145\75\x22" . $DecrementNum . "\42\x3e\xa\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\x20\40\40\x20\40\x20\40\40\x3c\141\x20\x6f\156\x63\x6c\151\143\153\75\x22\x44\145\x63\162\x65\x6d\x65\x6e\x74\x4e\x75\155\106\141\x63\50\x29\73\42\x20\143\x6c\x61\163\163\x3d\42\167\x33\x2d\x62\x61\x72\x2d\x69\164\145\155\x20\167\63\55\142\165\164\164\157\156\42\x3e\x26\x6c\141\161\165\x6f\x3b\74\x2f\141\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\144\x70\141\x67\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\x66\x6f\x6e\x64\157\144\x72\157\x69\144"; $html .= "\xa\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\40\x20\40\x20\40\x20\74\151\156\160\x75\x74\40\x74\171\160\145\x3d\x22\x68\151\x64\144\145\156\x22\x20\151\144\x3d\42" . $id . "\42\x20\x76\141\x6c\x75\145\x3d\42" . $i . "\42\76\12\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\x3c\x61\x20\x6f\x6e\143\x6c\151\143\x6b\75\42\x6e\165\155\x70\141\147\x66\x61\143\x28\x24\x28\x27\43" . $id . "\47\x29\x2e\x76\141\x6c\50\51\51\73\x22\x20\x63\x6c\141\163\163\x3d\42\x77\63\55\142\141\x72\x2d\151\x74\x65\155\40\167\x33\x2d\x62\x75\164\x74\x6f\x6e\40" . $hover . "\42\x3e" . $i . "\74\57\141\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\x70\x75\x74\40\164\x79\x70\x65\75\42\x68\151\144\x64\x65\x6e\42\x20\151\144\75\42" . $id . "\42\40\166\x61\154\165\x65\75\42" . $i . "\x22\x3e\12\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\74\141\x20\157\156\x63\154\x69\143\153\x3d\x22\x6e\165\155\x70\x61\x67\146\141\x63\50\x24\x28\x27\x23" . $id . "\47\x29\x2e\166\x61\x6c\50\x29\51\73\42\40\143\154\141\163\x73\x3d\x22\167\x33\x2d\142\x61\162\55\151\x74\145\155\40\167\63\x2d\x62\165\164\164\x6f\x6e\40" . $hover . "\42\76" . $i . "\x3c\x2f\x61\x3e"; } } } $html .= "\74\151\x6e\160\x75\164\40\164\x79\x70\145\x3d\42\x68\151\144\x64\x65\x6e\42\40\151\144\x3d\x22\111\x6e\x63\162\x69\x6d\x65\x6e\x74\x4e\x75\x6d\42\40\x76\141\154\x75\x65\x3d\x22" . $IncrimentNum . "\x22\x3e\xa\x20\40\40\x20\40\x20\40\40\40\40\40\x20\40\40\x20\x20\40\40\x20\x20\x3c\141\x20\x6f\x6e\x63\154\151\143\x6b\75\x22\x49\156\x63\162\x69\x6d\145\156\164\x4e\165\155\x66\141\143\50\x29\x3b\42\x20\x63\x6c\x61\163\x73\x3d\42\167\63\55\x62\x61\162\55\151\164\x65\155\x20\x77\63\55\x62\x75\x74\x74\157\156\x22\x3e\46\162\141\x71\x75\x6f\x3b\x3c\x2f\x61\x3e\xa\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\xa\x20\40\40\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\x3c\x2f\x64\151\x76\x3e\x20"; return $html; } public function itdevol($a, $b) { $this->load->library("\164\141\142\x6c\145"); $bditfac = $this->db->query("\x53\x45\x4c\105\x43\124\x20\143\x2e\x63\157\x64\x69\147\157\x2c\x20\143\x2e\x6e\157\x6d\x62\162\x65\x2c\x20\143\56\x6c\x6f\164\x65\x2c\122\x4f\125\x4e\104\x28\x63\56\143\x61\x6e\x74\151\144\x61\144\54\x30\x29\40\x63\x61\x6e\x74\151\144\141\x64\x2c\122\117\x55\116\104\x28\143\56\143\x6e\x74\144\x65\166\165\145\154\164\x2c\60\51\x20\x64\145\x76\x75\x65\154\x74\141\x2c\x63\x2e\x73\143\x61\156\54\x20\124\x52\x49\115\x28\x63\x2e\154\157\x74\x65\51\54\40\x63\56\163\164\141\x74\165\x73\40\106\x52\117\115\40\144\x65\166\x6f\154\155\166\x20\x41\123\40\143\x20\x57\x48\x45\122\x45\x20\x63\56\144\x6f\x63\165\155\x65\x6e\164\157\x3d\47{$a}\47\x20\x26\x26\40\x63\x2e\164\x69\x70\x6f\x64\x6f\143\x3d\x27{$b}\47\73")->result(); $nom = $this->db->query("\x53\x45\x4c\105\103\x54\x20\x6e\x6f\x6d\x61\160\145\40\x46\122\117\x4d\40\x74\x72\141\x62\x20\x61\163\x20\141\40\x4a\x4f\x49\116\40\143\157\x6e\164\162\157\154\137\x6f\160\145\x72\164\151\x20\x61\x73\40\142\40\x4f\x4e\40\141\x2e\x69\144\x3d\142\x2e\x74\162\141\x62\145\x6d\160\x61\161\x20\127\110\x45\x52\105\40\x62\56\x64\157\143\75\47{$a}\47")->row(); $vend = $this->db->query("\x53\x45\x4c\105\x43\124\40\142\56\156\157\x6d\x62\162\145\x20\106\122\x4f\115\x20\157\160\145\x72\164\x69\x20\x61\x73\40\141\x20\x4a\x4f\x49\116\x20\154\x69\163\164\166\x65\x6e\x64\40\x61\x73\x20\x62\x20\117\x4e\40\x61\x2e\x76\145\x6e\144\x65\144\157\x72\x3d\142\x2e\143\157\x64\x69\x67\157\40\127\x48\105\x52\105\40\141\x2e\x64\157\x63\165\x6d\145\156\164\x6f\x3d\x27{$a}\x27\x20\x4c\111\115\111\x54\x20\61")->row(); $val = $this->db->query("\123\x45\x4c\105\x43\124\x20\x73\x74\141\x74\x75\163\40\106\x52\x4f\115\x20\144\x65\166\x6f\154\x74\151\x20\167\150\x65\162\x65\x20\x64\x6f\143\x75\x6d\x65\156\164\x6f\x3d\x27{$a}\x27\40\x26\46\40\164\151\x70\157\x64\x6f\x63\x3d\47{$b}\47")->row(); if ($val->status == 0) { $btnscan = "\74\151\x6e\160\x75\x74\40\x74\x79\160\x65\x3d\x22\150\x69\x64\144\145\156\x22\40\151\x64\75\x22\144\x6f\143\42\40\x76\x61\154\165\145\75\x22" . $a . "\x22\76\x3c\x69\x6e\160\x75\x74\x20\164\171\x70\x65\75\42\163\165\x62\x6d\x69\x74\42\40\143\154\x61\163\x73\75\42\167\63\x2d\142\164\x6e\x20\x77\63\55\147\x72\145\145\156\x20\x77\x33\x2d\142\157\162\x64\x65\x72\40\167\x33\55\x68\x6f\x76\145\162\x2d\167\x68\x69\x74\145\42\x20\166\141\154\x75\x65\x3d\x22\123\103\x41\116\42\40\157\x6e\143\154\x69\x63\153\x3d\42\x77\63\56\150\x69\x64\x65\50\47\43\x73\143\x61\156\x31\x27\x29\73\x77\x33\56\163\150\157\x77\x28\47\x23\163\143\141\x6e\x27\x29\x3b\42\x3e\74\x69\156\x70\165\164\40\x74\171\160\x65\x3d\x22\x73\x75\142\x6d\151\x74\42\x20\143\154\141\x73\x73\x3d\42\x77\63\55\142\x74\156\x20\167\63\55\x74\145\141\154\x20\167\63\55\142\x6f\162\x64\x65\162\x20\x77\x33\55\150\157\166\x65\162\55\x77\150\151\x74\145\x22\40\x76\x61\154\x75\x65\75\42\x31\123\103\101\116\x22\x20\x6f\x6e\x63\154\151\143\153\x3d\x22\167\63\x2e\x68\x69\x64\145\x28\47\43\x73\143\x61\156\47\51\x3b\167\63\x2e\x73\150\x6f\167\x28\x27\43\x73\143\141\156\x31\47\51\73\42\76"; } else { $btnscan = ''; } $html = "\xa\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\40\40\x3c\164\x61\x62\x6c\145\40\143\154\x61\x73\x73\75\42\167\63\x2d\x74\141\142\154\145\55\x61\154\x6c\40\x77\63\55\150\157\166\x65\162\141\142\154\145\40\167\x33\x2d\x6c\145\x66\x74\x2d\141\154\151\147\156\40\x77\x33\x2d\x74\151\156\x79\x22\x3e\x3c\164\162\x20\x63\x6c\141\163\x73\x3d\42\167\x33\x2d\x66\x6f\x6e\x64\x6f\x64\x72\x6f\x69\x64\x22\x3e\x3c\x74\x68\76\103\x6f\x64\x69\147\157\74\57\164\x68\76\74\164\150\x3e\x4e\x6f\155\x62\162\145\x3c\57\x74\150\x3e\74\x74\x68\76\x43\x61\x6e\164\x69\x64\x61\144\x3c\57\164\x68\76\x3c\164\150\x3e\104\x65\166\165\145\154\164\141\74\x2f\164\x68\76\x3c\x74\x68\76\122\145\143\x69\142\151\144\141\x3c\x2f\164\x68\x3e\74\x74\x68\x3e\x4c\157\164\145\74\57\164\150\76\74\x74\x68\76\105\x73\x74\141\164\165\x73\x3c\57\x74\150\76\x3c\57\x74\162\x3e\xa\x20\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\74\x69\x6e\160\x75\x74\x20\164\171\160\145\75\42\150\x69\x64\x64\x65\156\42\40\x69\x64\x3d\x22\x64\x6f\143\42\x20\166\141\x6c\x75\145\75\x22" . $a . "\42\x3e\74\x69\156\x70\x75\x74\40\164\x79\160\x65\75\x22\x68\x69\144\144\x65\x6e\42\x20\151\144\75\42\x74\151\160\x64\157\143\42\40\x76\141\x6c\165\145\x3d\x22" . $b . "\x22\x3e"; $i = 0; foreach ($bditfac as $dtitfac) { $i++; if ($dtitfac->status == 0) { $status = "\x50\x65\x6e\x64\x69\x65\156\164\145"; $color = "\x77\63\x2d\162\x65\x64"; } elseif ($dtitfac->status == 1) { $status = "\114\151\x73\164\157"; $color = "\167\63\55\147\162\x65\145\156"; } $html .= "\x3c\164\162\76\xa\40\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\x3c\x74\144\76" . $dtitfac->codigo . "\x3c\57\x74\144\x3e\x3c\164\144\x3e" . $dtitfac->nombre . "\x3c\x2f\x74\144\76\x3c\164\144\x3e" . $dtitfac->cantidad . "\x3c\x2f\164\x64\x3e\74\164\144\x3e" . $dtitfac->devuelta . "\74\x2f\x74\x64\76\74\164\144\76" . $dtitfac->scan . "\x3c\x2f\164\144\x3e\74\164\x64\76" . $dtitfac->lote . "\x3c\57\x74\x64\x3e\x3c\164\144\40\143\154\141\163\x73\75\42" . $color . "\40\167\x33\x2d\143\145\x6e\164\x65\x72\x22\76" . $status . "\74\57\164\144\x3e\xa\x20\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\74\x2f\x74\x72\x3e"; } $html .= "\74\57\x74\141\x62\x6c\x65\76\74\x62\x72\x3e\x3c\142\162\x3e\12\40\x20\40\40\12\x20\x20\x20\40\x20\40\40\x20\x20\40\40\40\40\40\40\x20\74\x64\x69\x76\x20\163\164\x79\154\145\75\42\x64\x69\163\160\x6c\x61\x79\72\156\157\156\145\x22\40\151\144\75\x22\163\x63\x61\x6e\x22\40\143\154\x61\163\163\75\42\x77\x33\x2d\143\x65\x6e\164\x65\x72\x22\x3e\74\x74\141\142\x6c\145\40\143\x6c\x61\x73\163\75\x22\167\x33\x2d\x74\141\142\x6c\145\x2d\x61\x6c\154\x20\x77\63\55\150\x6f\166\145\x72\141\142\x6c\145\42\x3e\74\x74\x72\x3e\74\164\144\x20\143\x6c\141\163\x73\75\42\167\x33\x2d\146\x6f\x6e\x64\x6f\x64\x72\157\151\144\x22\76\x4c\x6f\x74\145\72\74\x2f\164\x64\76\x3c\164\144\76\74\x69\x6e\x70\165\x74\40\164\x79\x70\x65\75\x22\164\145\170\x74\x22\40\x63\154\x61\x73\x73\x3d\x22\x77\63\x2d\x69\156\160\165\164\x22\x20\x69\x64\75\42\154\157\x74\x64\x65\166\x22\40\x70\154\x61\143\x65\150\157\x6c\x64\145\x72\x3d\x22\x6c\x6f\164\x65\x2e\56\56\x22\x20\x73\164\171\x6c\x65\x3d\42\x77\x69\144\164\150\x3a\65\60\160\170\73\42\76\74\57\164\x64\76\12\40\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\40\74\x74\x64\x20\143\154\x61\x73\163\x3d\42\x77\63\55\146\157\x6e\144\157\x64\162\x6f\x69\144\42\76\x42\141\x72\x72\141\x73\x3a\x3c\x2f\x74\x64\76\74\164\x64\76\74\x69\156\x70\165\x74\40\164\171\160\x65\75\x22\164\145\x78\x74\42\40\143\x6c\141\x73\x73\x3d\x22\x77\x33\x2d\151\156\x70\165\164\x22\x20\x70\154\141\143\145\150\x6f\x6c\144\145\x72\x3d\x22\103\157\x64\151\x67\157\40\x62\x61\162\162\x61\163\56\56\x2e\42\x20\151\x64\x3d\x22\x63\157\144\x73\x63\x61\x6e\42\40\157\156\x63\x68\141\x6e\x67\x65\75\42\144\x65\166\x6f\x6c\x73\x63\x61\x6e\50\x29\73\42\76\x3c\x2f\x74\x64\76\74\57\x74\162\x3e\x3c\x2f\164\141\x62\154\x65\76\74\57\144\x69\166\76\12\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x3c\144\151\166\40\x73\x74\171\154\x65\x3d\x22\144\151\163\160\x6c\141\171\72\x6e\157\x6e\x65\x22\x20\x69\144\75\x22\163\x63\x61\x6e\61\x22\x20\143\154\x61\x73\163\x3d\42\x77\63\x2d\x63\x65\x6e\x74\x65\x72\42\x3e\x3c\164\x61\x62\154\x65\40\x63\x6c\x61\163\x73\75\42\167\x33\55\164\141\142\x6c\x65\55\141\x6c\154\x20\x77\x33\x2d\150\157\166\x65\162\141\142\x6c\145\x22\76\74\x74\162\x3e\74\164\144\x20\143\x6c\141\163\163\x3d\x22\167\63\x2d\x66\157\156\144\157\x64\x72\157\151\x64\42\x3e\x4c\x6f\164\145\72\74\57\164\144\x3e\74\x74\144\76\x3c\x69\156\x70\x75\164\40\x74\171\x70\x65\75\x22\x74\145\x78\x74\x22\x20\x63\154\141\x73\163\75\42\167\63\55\x69\x6e\x70\165\164\42\x20\151\x64\x3d\42\154\x6f\x74\144\x65\x76\x32\x22\40\x70\154\x61\143\145\x68\157\154\x64\145\162\x3d\42\154\x6f\164\x65\x2e\56\56\42\x20\163\164\171\154\x65\x3d\x22\167\151\144\164\150\72\x35\x30\160\170\x3b\x22\x3e\x3c\x2f\164\x64\76\12\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\74\x74\144\x20\x63\154\141\163\163\x3d\x22\x77\63\55\x66\x6f\x6e\x64\157\x64\162\x6f\151\144\x22\76\103\141\x6e\x74\72\74\x2f\164\x64\x3e\74\164\x64\x3e\74\151\156\x70\x75\x74\40\164\171\x70\145\x3d\42\x74\x65\x78\x74\x22\x20\x63\x6c\x61\163\163\75\x22\x77\x33\55\151\x6e\x70\x75\164\42\x20\151\x64\x3d\x22\143\141\156\x74\144\x65\166\x22\x20\160\x6c\141\x63\145\x68\x6f\154\x64\x65\162\75\x22\x6e\42\x20\163\164\x79\154\145\75\42\x77\151\x64\164\150\72\63\x30\160\x78\73\x22\x3e\74\57\x74\144\76\12\x20\x20\x20\x20\40\40\40\40\40\x20\x20\40\40\40\40\x20\74\x74\144\40\x63\154\141\163\163\75\x22\167\63\x2d\x66\157\x6e\x64\x6f\144\162\157\x69\144\42\76\102\x61\162\162\x61\x73\72\x3c\x2f\164\x64\76\74\164\x64\76\74\151\x6e\160\165\164\x20\164\171\160\x65\75\x22\164\145\170\164\x22\40\143\154\x61\163\163\75\x22\167\63\x2d\x69\x6e\x70\165\164\42\x20\160\x6c\x61\x63\145\x68\x6f\x6c\144\145\162\x3d\x22\x43\157\144\151\147\x6f\x20\142\141\162\162\x61\x73\x2e\56\x2e\x22\x20\x69\x64\75\42\143\x6f\144\x73\143\141\x6e\61\x22\x20\x6f\x6e\x63\x68\x61\156\x67\x65\75\42\144\x65\166\x6f\x6c\x73\143\x61\156\x31\x28\51\73\42\76\74\x2f\164\x64\x3e\x3c\57\164\x72\76\74\57\x74\141\142\154\145\76\x3c\57\144\x69\x76\x3e\x3c\142\162\76\74\142\162\x3e\xa\40\40\x20\40\40\40\40\40\40\40\40\x20\x20\40\x20\x20\12\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\x20\40\40" . $btnscan . ''; return $html; } function devolscan($a, $b, $c) { $bd = $this->db->query("\x53\x45\114\x45\x43\x54\x20\143\x6f\x64\151\147\157\40\x46\122\117\x4d\40\151\x6e\x76\143\157\144\x61\x6c\x74\145\x72\x6e\141\x74\x69\x76\157\40\127\x48\105\x52\x45\x20\143\157\x64\141\x6c\x74\145\x72\x6e\x61\x74\151\166\157\75\47{$b}\47\40\x7c\x7c\40\x63\157\144\x69\x67\x6f\x3d\47{$b}\47"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("\123\105\114\105\103\124\x20\143\156\164\144\x65\166\x75\x65\x6c\164\40\143\x61\x6e\x74\54\x20\x73\143\x61\156\40\x46\122\x4f\115\x20\144\145\x76\x6f\x6c\x6d\166\x20\x57\x48\x45\122\105\x20\144\157\x63\x75\x6d\x65\156\x74\x6f\x3d\x27{$a}\x27\40\x26\46\x20\x63\x6f\x64\151\147\157\75\x27{$db->codigo}\x27\40\x26\46\40\154\x6f\164\x65\75\47{$c}\47")->row(); if ($bd2->cant > $bd2->scan) { $new = $bd2->scan + 1; $this->db->query("\x55\x50\104\101\124\105\x20\144\x65\166\157\154\155\166\x20\163\x65\164\40\x73\x63\141\156\x3d\47{$new}\x27\x20\x57\110\x45\x52\x45\x20\x64\157\x63\x75\155\x65\x6e\x74\157\x3d\47{$a}\x27\x20\46\x26\40\143\157\x64\x69\147\157\75\47{$db->codigo}\47\x20\46\x26\x20\x6c\157\x74\145\x3d\x27{$c}\x27"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("\125\x50\104\x41\x54\x45\40\144\145\x76\157\x6c\155\x76\x20\163\145\x74\40\163\164\141\164\x75\x73\x3d\x31\40\127\110\x45\x52\x45\40\144\157\143\165\155\x65\156\164\157\x3d\47{$a}\47\40\x26\46\x20\x63\157\144\151\x67\157\x3d\x27{$db->codigo}\x27\x20\46\46\40\154\x6f\x74\x65\x3d\47{$c}\47"); $i = 2; } else { $i = 1; } } } else { $i = 2; } } else { $i = 0; } return $i; } function devolscan1($a, $b, $c, $d) { $bd = $this->db->query("\123\105\x4c\x45\103\x54\40\x63\x6f\x64\x69\x67\157\x20\106\x52\117\115\x20\151\x6e\x76\x63\157\x64\141\154\164\145\162\156\141\x74\151\x76\x6f\40\127\110\x45\x52\x45\40\x63\x6f\144\141\x6c\164\x65\x72\156\141\x74\151\x76\x6f\x3d\x27{$b}\47\x20\174\174\40\143\157\x64\151\x67\157\75\47{$b}\47"); $i = 0; if ($bd->num_rows() > 0) { $db = $bd->row(); $bd2 = $this->db->query("\123\105\114\105\103\124\x20\x63\x6e\x74\144\x65\166\x75\145\x6c\x74\x20\x63\x61\x6e\164\x2c\x20\163\x63\141\156\x20\x46\122\x4f\x4d\x20\144\x65\166\x6f\x6c\155\166\x20\x57\110\x45\x52\x45\x20\144\x6f\143\165\155\x65\x6e\164\157\x3d\x27{$a}\47\40\x26\46\40\x63\157\x64\151\x67\x6f\x3d\47{$db->codigo}\x27\x20\46\x26\40\154\x6f\x74\145\x3d\47{$c}\47")->row(); if ($bd2->cant > $bd2->scan) { if ($d <= $bd2->cant) { $new = $d; $this->db->query("\x55\x50\104\x41\124\x45\40\x64\145\x76\x6f\x6c\x6d\x76\40\x73\145\x74\x20\163\x63\141\x6e\75\x27{$new}\x27\40\127\110\x45\122\105\x20\x64\157\143\165\155\145\x6e\x74\x6f\75\47{$a}\47\40\x26\46\x20\143\157\144\x69\x67\x6f\75\x27{$db->codigo}\47\x20\46\x26\x20\x6c\x6f\x74\x65\x3d\47{$c}\47"); if ($this->db->affected_rows() > 0) { if ($bd2->cant == $new) { $this->db->query("\x55\x50\x44\x41\x54\x45\x20\x64\145\x76\157\x6c\x6d\x76\x20\163\x65\164\x20\163\164\x61\164\165\163\75\x31\x20\127\110\x45\122\105\40\144\x6f\143\x75\155\145\x6e\x74\x6f\x3d\x27{$a}\47\40\46\x26\40\143\157\144\x69\147\157\75\x27{$db->codigo}\x27\x20\46\46\x20\x6c\157\164\145\x3d\47{$c}\47"); $i = 2; } else { $i = 1; } } } else { $i = 3; } } else { $i = 2; } } else { $i = 0; } return $i; } function ajustdevolinv($a, $b) { $db = $this->db->query("\123\x45\x4c\105\103\124\x20\x4e\125\x4c\x4c\40\x46\x52\117\x4d\40\144\145\166\x6f\x6c\155\166\40\x57\x48\105\x52\x45\x20\x64\x6f\x63\165\x6d\x65\156\164\157\75\x27{$a}\x27\40\x26\46\x20\143\x6e\x74\144\145\166\165\145\154\x74\x3e\x30")->num_rows(); $db2 = $this->db->query("\x53\x45\x4c\x45\103\124\40\x4e\x55\114\x4c\40\x46\122\x4f\x4d\40\144\145\166\157\154\155\x76\40\x57\110\105\x52\x45\40\144\157\x63\x75\x6d\x65\156\164\x6f\x3d\x27{$a}\47\x20\46\46\x20\x63\x6e\164\x64\145\166\x75\145\154\164\76\60\x20\46\46\40\143\x6e\x74\x64\145\x76\165\x65\x6c\x74\75\163\143\x61\156")->num_rows(); if ($db == $db2) { $this->db->query("\125\x50\104\101\124\105\x20\144\x65\166\157\154\x74\151\x20\123\x45\x54\40\x73\x74\141\x74\165\x73\x3d\61\40\x57\110\x45\122\105\40\x64\157\x63\165\x6d\145\x6e\x74\x6f\x3d\47{$a}\47"); if ($this->db->affected_rows() > 0) { $i = 0; $bd = $this->db->query("\123\x45\114\x45\x43\x54\x20\x61\x6c\155\141\143\145\156\x2c\40\x63\x6f\x64\x69\x67\157\x2c\x6c\157\x74\145\x2c\x67\162\x75\160\157\x2c\143\156\x74\x64\x65\x76\165\x65\154\164\x20\x63\141\x6e\x74\x20\x46\x52\x4f\x4d\x20\x64\145\166\157\154\155\x76\40\x57\110\105\x52\105\x20\x64\157\143\165\x6d\145\x6e\x74\x6f\x3d\47{$a}\47")->result(); foreach ($bd as $dt) { if ($b == '') { $lot = $this->db->query("\x53\x45\x4c\105\103\124\x20\143\x6f\156\x73\165\155\x69\x64\x6f\x20\x46\122\117\115\40\x61\x72\x74\x69\x6c\157\164\x65\x73\x20\x57\110\x45\x52\x45\x20\141\x6c\x6d\x61\x63\x65\156\75\x27{$dt->almacen}\x27\40\46\46\x20\143\x6f\x64\x69\147\x6f\141\x72\164\x3d\x27{$dt->codigo}\47\x20\x26\46\x20\154\157\x74\x65\x3d\47{$dt->lote}\47")->row(); $art = $this->db->query("\x53\x45\x4c\105\x43\124\40\145\170\x69\x73\x74\145\x6e\143\151\141\x20\106\x52\117\x4d\40\141\x72\164\151\143\x75\x6c\157\40\x57\x48\x45\x52\x45\40\x63\157\x64\x69\x67\157\75\47{$dt->codigo}\x27")->row(); $conslot = $lot->consumido - $dt->cant; $existart = $art->existencia + $dt->cant; $this->db->query("\125\x50\104\101\x54\x45\x20\x61\x72\164\151\x6c\x6f\164\145\163\40\x53\105\124\x20\x63\157\x6e\163\x75\x6d\151\x64\157\75\47{$conslot}\47\40\x57\110\x45\x52\105\40\x61\x6c\155\141\x63\x65\156\x3d\x27{$dt->almacen}\47\x20\46\x26\x20\143\157\x64\151\147\157\141\162\164\75\x27{$dt->codigo}\x27\x20\46\x26\40\154\x6f\164\x65\x3d\x27{$dt->lote}\47"); $this->db->query("\125\x50\104\101\124\105\40\141\x72\164\151\143\165\154\x6f\40\123\105\124\x20\145\x78\151\163\x74\145\156\143\x69\x61\75\x27{$existart}\x27\40\127\110\105\122\x45\x20\x63\x6f\144\151\x67\x6f\75\47{$dt->codigo}\47"); if ($this->db->affected_rows() > 0) { $i++; } } else { $lot = $this->db->query("\123\105\114\x45\x43\124\x20\160\x72\x65\143\x69\x6f\146\151\x6e\x31\54\160\162\x65\x63\x69\x6f\x31\54\145\154\x61\142\54\x76\145\156\x63\x65\x2c\143\x6f\163\x74\157\x20\x46\x52\117\x4d\x20\x61\162\x74\x69\154\157\164\145\163\40\127\110\105\122\x45\40\x61\154\155\141\143\145\156\75\47{$dt->almacen}\47\40\46\x26\40\x63\x6f\x64\x69\x67\x6f\x61\x72\x74\75\x27{$dt->codigo}\47\x20\x26\46\x20\154\x6f\x74\x65\75\x27{$dt->lote}\x27")->row(); $art = $this->db->query("\123\105\x4c\x45\x43\124\x20\x65\x78\x69\163\164\x65\x6e\x63\151\141\40\x46\x52\x4f\x4d\40\x61\x72\164\151\143\165\x6c\x6f\40\127\x48\x45\x52\105\40\143\x6f\144\x69\x67\x6f\x3d\47{$dt->codigo}\x27")->row(); $this->db->query("\x49\x4e\x53\105\x52\x54\x20\x49\116\124\117\40\x60\141\x72\x74\x69\154\157\x74\145\163\x60\x20\x28\140\151\x64\137\145\155\160\162\x65\x73\141\140\54\x20\x60\x61\147\x65\156\143\151\x61\140\54\40\140\x6c\x6f\164\145\x60\x2c\40\140\x63\157\144\151\147\157\x61\x72\164\140\x2c\x20\x60\x61\154\x6d\x61\x63\x65\x6e\140\x2c\x20\140\151\156\x61\x63\164\151\166\157\x60\54\40\140\x65\154\x61\x62\140\54\40\x60\x76\x65\x6e\143\145\x60\x2c\40\140\x63\x61\156\164\x69\144\x61\x64\140\54\40\x60\x63\157\x6e\x73\165\x6d\151\x64\x6f\140\54\x20\140\x63\x6f\155\x70\x72\x6f\155\145\164\151\x64\x6f\x60\x2c\x20\x60\143\x6f\163\164\157\140\54\40\140\162\x65\x63\x65\160\x63\151\x6f\x6e\x60\54\x20\140\x70\162\145\x63\151\157\61\140\54\40\x60\x70\x72\145\x63\x69\x6f\x32\140\x2c\12\40\x20\40\40\40\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\x20\40\40\40\40\x20\40\40\x20\40\x20\40\140\160\x72\x65\143\x69\157\x33\140\54\40\x60\160\162\x65\x63\x69\157\x34\140\x2c\40\140\x70\x72\x65\x63\151\157\x35\140\54\x20\x60\160\x72\x65\143\x69\157\x36\x60\x2c\x20\x60\x70\162\x65\143\x69\157\67\140\x2c\x20\140\160\x72\x65\x63\151\157\x38\x60\x2c\x20\140\x70\x72\145\143\x69\x6f\x66\151\156\61\x60\54\x20\x60\160\162\x65\143\x69\157\x66\x69\156\x32\140\54\40\140\x70\162\145\143\x69\x6f\146\x69\156\x33\140\x2c\40\140\x70\162\145\x63\x69\x6f\146\x69\x6e\x34\x60\x2c\x20\x60\x70\162\x65\x63\x69\157\x66\x69\x6e\65\140\x2c\40\140\160\x72\145\143\151\x6f\146\151\156\x36\140\54\x20\140\x70\x72\x65\x63\x69\x6f\146\x69\156\x37\x60\x2c\40\x60\160\162\145\x63\x69\x6f\146\151\156\70\x60\x2c\40\x60\x70\162\145\x63\x69\157\61\x67\x72\160\x60\54\40\140\160\162\x65\143\151\157\x32\x67\x72\x70\140\x2c\x20\140\160\x72\145\x63\151\157\63\x67\x72\160\x60\54\x20\12\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\x20\40\x20\x20\x20\140\x70\162\145\143\151\x6f\64\x67\162\160\140\x2c\40\140\x70\x72\x65\x63\x69\x6f\65\x67\x72\160\140\x2c\40\x60\x70\162\145\143\x69\157\x36\147\162\x70\140\54\40\x60\x70\162\x65\143\151\x6f\67\147\162\x70\x60\54\x20\140\160\x72\145\143\151\157\x38\x67\x72\x70\140\x2c\40\x60\x66\141\x63\164\x6f\x72\x6c\157\x74\145\140\54\x20\x60\156\x75\155\154\x6f\x74\x65\140\51\40\x56\101\114\x55\x45\x53\40\x28\x27\104\115\105\104\x49\x46\47\54\40\47\x30\60\61\x27\54\40\x27{$dt->lote}\x27\x2c\40\47{$dt->codigo}\47\x2c\x20\47{$b}\47\54\x20\60\54\x20\x27{$lot->elab}\x27\x2c\x20\x27{$lot->vence}\x27\54\40\47{$dt->cant}\x27\x2c\x20\60\56\60\54\40\60\x2e\60\x2c\40\x27{$lot->costo}\47\54\x20\12\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x43\125\x52\x44\101\124\105\x28\51\x2c\40{$lot->precio1}\x2c\40\60\x2e\x30\x2c\x20\60\x2e\60\x2c\40\60\x2e\x30\54\40\x30\x2e\60\54\40\x30\56\x30\54\x20\60\x2e\x30\x2c\x20\x30\56\x30\x2c\40{$lot->preciofin1}\54\40\x30\x2e\x30\x2c\x20\x30\56\60\54\x20\60\56\x30\54\x20\60\x2e\x30\54\40\60\x2e\x30\54\x20\60\x2e\x30\54\x20\x30\56\x30\x2c\40\x30\x2e\x30\x2c\40\60\x2e\x30\54\x20\60\x2e\60\54\40\x30\x2e\x30\54\x20\xa\x20\x20\40\40\x20\40\40\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\x30\56\x30\54\x20\60\56\60\54\40\x30\x2e\60\x2c\x20\60\x2e\60\54\x20\x30\x2e\60\x2c\40\47{$dt->lote}\x27\x29\73\xa\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\x20"); $existart = $art->existencia + $dt->cant; $this->db->query("\x55\120\104\101\124\x45\40\x61\x72\x74\151\x63\x75\x6c\157\x20\x53\105\x54\x20\145\x78\x69\x73\x74\x65\156\x63\x69\141\75\47{$existart}\47\40\127\x48\105\122\x45\x20\x63\157\144\151\x67\157\75\47{$dt->codigo}\47"); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } } } public function compara($a, $b) { $this->load->library("\x74\x61\142\154\x65"); if ($b != '') { $filter = "\x57\110\105\x52\x45\40\50\x61\56\143\157\x64\151\147\157\75\x27{$b}\x27\x20\174\x7c\x20\x61\x2e\x6e\157\x6d\142\162\145\40\154\x69\153\145\x20\x27\x25{$b}\45\47\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\105\114\105\103\124\40\116\125\114\x4c\x20\106\122\x4f\115\x20\x28\12\40\40\40\40\x20\40\x20\x20\40\40\40\40\x20\40\40\x20\40\40\x20\x53\x45\x4c\x45\103\x54\x20\x6e\x75\x6c\154\xa\40\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x46\122\x4f\x4d\40\141\x72\164\x69\x63\165\154\x6f\x20\x61\x20\x4a\x4f\111\x4e\x20\x69\156\x76\x63\157\x64\x61\154\164\145\x72\x6e\141\164\151\x76\x6f\x20\142\x20\x4f\x4e\40\141\x2e\143\157\144\x69\x67\x6f\75\142\56\x63\157\144\x69\x67\157\12\40\40\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\x20\x20{$filter}\12\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\51\x20\143\x6f\155\160\x61\162\x61")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\105\114\105\x43\x54\x20\143\x6f\x64\151\147\157\x2c\x62\x61\162\x72\x61\x2c\x6e\x6f\155\x62\162\145\54\155\x65\144\151\146\x61\162\x2c\144\x72\157\x63\x65\162\143\141\54\x64\x72\157\154\141\156\143\141\x2c\x64\x72\157\x6e\x65\x6e\141\x20\x46\x52\117\115\x20\50\12\x20\40\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\123\x45\x4c\105\x43\x54\x20\141\56\143\x6f\x64\151\147\157\54\x62\x2e\143\x6f\x64\141\154\164\x65\x72\x6e\x61\x74\x69\x76\x6f\40\x62\141\162\162\141\54\x61\56\x6e\157\x6d\142\162\x65\x2c\122\117\x55\x4e\104\x28\x61\x2e\x70\162\145\x63\x69\157\x66\151\x6e\x31\54\x32\51\x20\155\145\x64\x69\x66\141\162\54\xa\x20\40\40\40\40\40\40\x20\40\x20\40\x20\40\40\40\x20\50\x53\105\114\x45\103\x54\x20\x4d\111\116\x28\151\146\x28\x61\61\x2e\x4f\146\145\x72\x74\141\74\x20\x61\x31\x2e\x50\162\145\143\x69\x6f\54\122\x4f\x55\116\104\x28\141\x31\56\117\x66\145\x72\x74\x61\54\62\51\54\x52\117\x55\116\104\50\x61\61\56\x50\162\x65\143\151\x6f\54\x32\x29\51\51\40\x46\122\x4f\x4d\40\x64\162\x6f\143\x65\x72\x63\x61\40\x61\x31\x20\127\110\105\122\105\40\141\x31\56\x63\x6f\x64\142\x61\x72\162\x61\163\75\142\56\x63\157\x64\141\154\164\x65\x72\x6e\141\x74\x69\166\157\51\40\x64\x72\157\x63\x65\162\143\141\54\xa\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x28\123\x45\114\x45\x43\124\40\115\x49\116\50\x69\x46\x28\141\x32\x2e\151\166\x61\x3e\60\x2c\122\117\x55\116\x44\50\141\x32\56\120\x72\x65\143\151\157\x2a\x31\56\x31\66\x2c\x32\x29\x2c\x52\117\x55\x4e\x44\50\141\62\x2e\120\x72\145\x63\x69\157\54\x32\51\x29\51\x20\106\122\117\x4d\40\144\x72\157\154\x61\156\x63\141\40\141\62\x20\127\x48\105\122\105\x20\x61\x32\56\x63\157\144\142\x61\x72\x72\141\x73\x3d\142\x2e\x63\x6f\x64\141\x6c\x74\x65\x72\156\141\164\x69\x76\x6f\51\40\144\x72\x6f\x6c\141\156\143\x61\x2c\12\40\40\x20\40\x20\40\40\x20\40\x20\40\40\x20\x20\40\x20\50\123\x45\x4c\x45\103\124\40\x4d\111\116\x28\x61\63\x2e\160\x72\x65\143\x69\x6f\x29\x20\x46\x52\117\x4d\40\144\162\157\154\141\156\143\x61\x20\141\63\x20\x57\x48\105\x52\105\40\x61\63\56\x63\157\144\142\x61\x72\162\x61\163\x3d\142\56\143\x6f\144\141\x6c\x74\x65\162\x6e\141\x74\x69\x76\x6f\51\x20\x64\x72\x6f\x6e\x65\156\x61\xa\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\106\x52\117\115\x20\x61\x72\x74\x69\x63\x75\x6c\x6f\x20\x61\x20\x4a\x4f\111\x4e\40\151\156\166\x63\x6f\x64\141\154\x74\145\x72\x6e\141\164\151\166\x6f\x20\142\40\x4f\x4e\x20\x61\x2e\x63\157\144\x69\147\157\x3d\x62\56\x63\157\x64\x69\x67\157\12\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\40\40{$filter}\12\40\x20\x20\40\40\x20\x20\40\40\x20\x20\40\40\x20\x20\40\51\x20\143\x6f\155\x70\x61\162\141\40\x4f\122\104\105\122\40\x42\131\40\156\157\x6d\142\162\145\x20\101\123\x43\x20\114\111\x4d\111\124\40" . ($a - 1) * $mostrar . "\x20\54\40" . $mostrar . "\40")->result(); $html = "\12\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\74\164\141\x62\154\145\40\143\x6c\x61\163\163\75\x22\x77\63\55\164\141\142\154\x65\55\141\154\154\40\x77\x33\55\x68\157\x76\145\162\141\x62\x6c\x65\x20\x77\63\55\154\x65\x66\164\x2d\141\x6c\151\x67\156\x22\x3e\12\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\74\164\162\x3e\74\x74\x64\x20\x63\x6c\141\x73\163\x3d\x22\167\x33\x2d\146\157\156\144\157\x64\x72\157\151\x64\x22\76\x42\165\x73\143\141\x72\x20\x3c\151\x6d\147\x20\163\162\x63\75\42" . base_url() . "\x69\155\141\x67\x65\163\57\142\x75\x73\143\141\162\56\x70\156\147\42\x20\141\154\164\75\42\x42\165\x73\143\141\162\42\x20\164\151\x74\x6c\145\x3d\42\x42\165\x73\x63\141\x72\42\x20\163\x74\171\154\145\75\42\x77\151\x64\164\x68\72\61\x38\160\x78\73\142\157\162\x64\x65\x72\72\60\73\x22\x3e\74\57\164\144\76\12\x20\40\40\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x3c\164\x64\x3e\x3c\x69\x6e\x70\165\164\40\x74\x79\x70\x65\75\42\164\145\170\164\42\x20\143\x6c\x61\163\163\x3d\x22\x77\x33\x2d\x69\156\160\x75\x74\42\40\160\154\x61\143\x65\150\157\x6c\144\x65\x72\75\42\x49\x6e\147\x72\145\x73\x65\x20\x73\x75\x20\x62\x75\x73\161\x75\145\x64\141\x22\x20\157\x6e\x63\x68\x61\156\147\x65\75\42\143\157\155\160\x61\162\x61\x28\x29\x22\x20\x69\x64\x3d\42\154\x69\x6b\x65\x22\76\x3c\x2f\164\144\x3e\12\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\x3c\x21\55\x2d\x3c\x74\x64\x20\x63\154\x61\x73\x73\x3d\x22\x77\63\x2d\143\145\156\x74\x65\162\x20\167\x33\55\x62\x74\156\42\x3e\x3c\141\40\x6f\156\143\154\151\x63\x6b\75\x22\x65\170\x63\x65\x6c\x64\x72\157\x67\165\x65\x72\x69\x61\50\x29\73\x22\x3e\x3c\151\155\147\40\x73\x72\143\75\x22" . base_url() . "\151\x6d\x61\147\x65\x73\57\x65\x78\143\145\154\x2e\160\x6e\x67\x22\x20\x61\154\164\x3d\x22\103\x61\162\147\x61\40\114\151\x73\164\x22\x20\x74\151\164\x6c\145\75\x22\x43\141\x72\x67\141\x20\114\x69\163\x74\42\x20\x73\164\171\154\145\75\42\167\151\x64\164\x68\x3a\x32\x30\160\170\73\x68\145\x69\x67\150\164\72\62\60\160\170\x3b\x62\x6f\162\144\145\x72\72\x30\73\x22\76\74\57\141\76\x3c\57\164\144\76\x2d\x2d\76\12\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\x20\40\x20\74\x74\x64\x20\x63\154\x61\x73\163\x3d\42\x77\63\55\x63\x65\x6e\x74\145\x72\40\167\63\55\142\164\x6e\42\76\74\x61\40\x6f\156\143\x6c\x69\x63\x6b\75\42\x64\x61\164\141\146\x74\x70\50\x29\x3b\x22\x3e\x3c\151\155\147\x20\163\162\x63\x3d\42" . base_url() . "\x69\155\x61\x67\x65\163\57\x64\x61\x74\x61\x2e\160\156\x67\42\40\x61\154\164\x3d\42\x41\x63\164\x75\x61\154\x69\x7a\141\x20\120\x52\105\x43\111\117\123\42\40\x74\151\164\154\x65\75\42\101\x63\x74\165\141\x6c\x69\x7a\x61\40\x50\x52\x45\x43\x49\117\123\42\x20\x73\164\171\154\145\75\42\167\x69\x64\x74\x68\72\x32\60\160\170\73\x68\x65\151\147\x68\x74\72\62\x30\x70\170\73\142\157\162\144\x65\162\72\60\x3b\42\76\74\x2f\141\76\74\x2f\164\x64\x3e\xa\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\x3c\x74\x64\40\x63\154\x61\x73\163\x3d\x22\167\63\55\x63\x65\156\164\x65\x72\x20\167\63\x2d\x62\x74\156\x22\76\74\x61\x20\x6f\156\143\x6c\151\143\153\x3d\x22\143\x6f\x6d\160\x61\162\141\50\51\x3b\42\76\74\x69\x6d\147\40\x73\x72\143\75\x22" . base_url() . "\x69\155\141\147\x65\163\x2f\x72\145\x6c\157\x61\x64\56\x70\156\x67\42\40\x61\154\164\75\42\x52\145\x63\x61\162\x67\x61\162\42\40\164\151\x74\x6c\145\75\x22\122\145\143\141\x72\147\x61\162\42\40\x73\164\x79\154\145\x3d\42\167\x69\x64\x74\x68\x3a\62\x30\160\170\73\x68\145\151\147\x68\x74\72\62\x30\x70\170\x3b\142\157\x72\144\145\162\x3a\60\x3b\x22\x3e\74\x2f\x61\x3e\x3c\57\164\x64\x3e\74\57\x74\x72\x3e\xa\x20\40\40\40\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\x3c\x2f\x74\141\x62\154\145\x3e\74\142\162\x3e\12\40\x20\40\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\40\74\164\141\x62\154\145\x20\x69\144\75\42\x69\144\60\61\x22\x20\143\154\141\163\163\x3d\42\167\x33\55\164\141\x62\x6c\145\55\141\x6c\154\40\167\x33\x2d\150\x6f\166\145\162\141\x62\x6c\145\x20\x77\63\55\x6c\145\146\164\x2d\x61\x6c\151\x67\156\x20\167\63\55\164\151\156\171\42\x3e\x3c\x74\162\x20\x63\x6c\x61\163\x73\75\42\x77\63\x2d\146\x6f\x6e\144\x6f\144\x72\x6f\151\x64\42\76\74\164\150\x3e\103\157\144\151\x67\157\x3c\x2f\164\x68\x3e\x3c\x74\x68\x3e\x42\x61\162\162\x61\x3c\57\164\150\76\74\164\150\x3e\x4e\157\x6d\142\x72\145\x3c\x2f\x74\x68\76\x3c\x74\x68\76\115\x65\144\151\x66\x61\162\x3c\57\164\150\x3e\12\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\74\164\150\76\x44\162\x6f\x63\x65\x72\x63\x61\x3c\x2f\164\150\76\x3c\164\150\76\104\x72\x6f\x6c\x61\x6e\x63\x61\x3c\x2f\x74\x68\x3e\x3c\x74\x68\76\x44\x72\x6f\156\x65\x6e\141\x3c\x2f\164\150\x3e\74\164\x68\x3e\x43\157\142\145\x63\141\x3c\57\x74\x68\76\x3c\x2f\164\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $col1 = "\167\63\x2d\160\x61\154\145\x2d\x72\x65\144"; $col2 = "\167\x33\55\160\x61\x6c\145\x2d\162\145\x64"; $col3 = "\167\63\x2d\160\141\154\x65\x2d\162\x65\144"; $col4 = "\x77\x33\55\160\x61\x6c\145\x2d\x72\x65\x64"; if ($dtfac->dronena > 0) { $dronena = $dtfac->dronena; } else { $dronena = 999999; } if ($dtfac->drocerca > 0) { $drocerca = $dtfac->drocerca; } else { $drocerca = 999999; } if ($dtfac->drolanca > 0) { $drolanca = $dtfac->drolanca; } else { $drolanca = 999999; } $val = min($dtfac->medifar, $dronena, $drocerca, $drolanca); if ($val == $dtfac->medifar) { $col1 = "\x77\63\x2d\x70\x61\x6c\145\x2d\x67\162\x65\145\156"; } if ($val == $dtfac->dronena && $dtfac->dronena > 0) { $col4 = "\x77\x33\55\160\141\x6c\145\x2d\147\x72\145\x65\156"; } if ($val == $dtfac->drocerca && $dtfac->drocerca > 0) { $col2 = "\167\x33\x2d\160\x61\x6c\x65\x2d\x67\x72\145\145\x6e"; } if ($val == $dtfac->drolanca && $dtfac->drolanca > 0) { $col3 = "\x77\x33\x2d\160\x61\154\x65\55\147\162\x65\145\156"; } $html .= "\x3c\x74\162\40\151\x64\x3d\x22\x73\x6c\145\143\x74" . $i . "\x22\x20\143\x6c\141\163\163\x3d\42\x69\x74\145\155\x22\40\x6f\156\x63\154\x69\x63\x6b\x3d\42\42\x3e"; $html .= "\74\151\156\160\165\164\40\164\x79\x70\145\x3d\x22\x68\151\144\144\145\156\42\x20\151\x64\75\42\x61" . $i . "\x22\x20\x6e\141\x6d\145\x3d\42\143\157\144\151\x67\157\42\40\x76\141\x6c\165\x65\75\42" . $dtfac->codigo . "\42\x3e\12\40\40\40\40\40\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\74\164\x64\x3e" . $dtfac->codigo . "\74\x2f\164\144\x3e\x3c\164\144\x3e" . $dtfac->barra . "\74\x2f\164\144\x3e\x3c\164\144\76" . $dtfac->nombre . "\74\x2f\164\144\x3e\74\164\144\x20\x63\x6c\141\x73\x73\75\x22" . $col1 . "\42\x3e" . $dtfac->medifar . "\x3c\57\164\x64\76\xa\40\40\40\40\40\x20\40\40\40\40\40\x20\40\40\x20\40\40\40\40\40\x3c\164\144\40\x63\x6c\x61\163\163\75\x22" . $col2 . "\x22\x3e" . $dtfac->drocerca . "\x3c\57\x74\x64\x3e\74\x74\144\40\143\154\141\x73\163\x3d\42" . $col3 . "\x22\76" . $dtfac->drolanca . "\74\57\164\144\76\74\164\x64\x20\143\x6c\x61\163\163\75\x22" . $col4 . "\42\76" . $dtfac->dronena . "\x3c\x2f\x74\x64\76\74\164\144\x3e\x3c\57\164\144\x3e\xa\40\40\x20\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\74\57\164\x72\76"; } $html .= "\74\x74\x72\x3e\74\164\x64\x20\x63\154\x61\x73\163\x3d\x22\x77\x33\x2d\143\145\x6e\164\x65\x72\40\167\x33\55\146\157\156\144\157\144\162\157\151\144\x22\40\x63\157\154\x73\160\141\x6e\75\x22\61\63\x22\x3e\74\x6c\141\x62\x65\154\x20\x63\x6c\141\163\163\75\42\167\63\55\154\141\162\x67\x65\42\76\x3c\x62\76\x54\157\164\141\x6c\x20\x50\x72\157\144\165\x63\164\157\x73\72\x20" . $totalreg . "\74\x2f\142\76\x3c\57\x6c\141\x62\145\x6c\76\x3c\x2f\164\x64\x3e\x3c\x2f\164\x72\x3e\x3c\57\164\x61\x62\x6c\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x3c\x73\143\162\x69\x70\164\x20\164\x79\x70\145\x3d\x22\x74\x65\x78\x74\x2f\152\x61\166\x61\x73\x63\162\x69\x70\164\x22\76\xa\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\40\40\x66\x75\x6e\143\x74\151\157\156\40\x44\x65\x63\162\x65\x6d\145\x6e\164\116\165\155\50\51\x7b\x20\142\145\146\x6f\x72\x65\x28\x29\x3b\40\xa\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\40\x20\x20\40\40\166\x61\162\40\x44\x65\143\162\x65\155\145\x6e\x74\116\x75\155\75\x64\x6f\143\x75\x6d\x65\x6e\x74\56\147\x65\x74\105\x6c\145\x6d\145\x6e\x74\102\171\111\x64\50\x22\x44\145\x63\x72\145\x6d\x65\x6e\x74\116\165\155\42\51\56\166\141\154\165\x65\x3b\12\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\166\x61\162\x20\x6c\x69\153\x65\x3d\x24\x28\x22\43\x6c\151\x6b\x65\42\51\x2e\166\141\154\50\51\x3b\12\x20\40\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x76\141\x72\40\x6b\145\171\x3d\x22\x64\x72\157\151\x64\x39\60\x33\x22\x3b\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\40\x20\166\x61\x72\x20\144\x61\x74\157\x73\x20\75\x20\173\xa\40\x20\40\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x22\x70\141\147\x22\40\72\x20\x44\x65\143\x72\145\155\145\x6e\x74\116\x75\x6d\54\xa\x20\x20\40\x20\40\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\42\x6b\145\x79\x22\x20\72\x20\x6b\x65\171\x2c\42\154\151\153\x65\x22\x3a\x6c\151\x6b\x65\12\40\40\x20\40\40\x20\40\40\x20\x20\40\40\40\40\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\175\x3b\xa\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\12\40\x20\40\40\40\40\40\x20\x20\40\40\40\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\44\x2e\141\152\141\x78\x28\173\12\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\x64\141\164\141\72\x20\x64\x61\x74\x6f\x73\54\12\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\165\162\x6c\x3a\x20\x20\x62\141\x73\x65\x75\x72\x6c\53\42\x63\137\144\x72\x6f\x69\x64\57\143\157\x6d\x70\141\x72\x61\42\x2c\xa\x20\40\40\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\40\40\40\40\40\40\x20\40\40\x20\164\171\160\x65\x3a\40\42\120\x4f\x53\x54\42\54\xa\40\x20\40\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x73\x75\x63\x63\145\163\x73\72\40\x66\x75\156\143\x74\151\157\156\50\x64\141\164\141\x29\40\173\12\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\44\50\x22\x23\x62\x6f\x64\x79\42\51\56\x68\164\155\x6c\50\x64\141\x74\141\51\73\40\x24\50\42\x23\x6c\151\153\145\42\51\56\x76\141\154\x28\154\151\x6b\145\x29\x3b\40\163\x77\x61\154\x2e\x63\154\157\163\x65\x28\51\12\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\40\175\12\40\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\40\40\40\x20\x20\xa\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\175\x29\x3b\xa\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\40\40\40\40\40\40\175\xa\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\x20\12\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\40\40\146\165\x6e\x63\164\x69\157\156\x20\156\x75\x6d\x70\x61\147\x28\x61\x29\173\x20\142\145\146\157\x72\145\50\51\x3b\40\12\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x76\x61\x72\x20\153\x65\171\x3d\x22\x64\162\x6f\x69\144\71\60\x33\x22\x3b\12\x20\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\40\x20\166\141\x72\x20\x6c\x69\x6b\x65\75\44\50\x22\43\154\x69\153\x65\42\x29\x2e\166\x61\x6c\50\x29\x3b\xa\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\x76\x61\x72\x20\x64\141\164\157\163\40\x3d\x20\x7b\12\40\40\x20\40\40\40\40\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x22\153\145\x79\x22\72\x6b\x65\x79\x2c\12\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x22\x70\x61\147\x22\40\72\x20\x61\x2c\154\x69\153\145\x3a\154\x69\153\x65\12\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\40\40\40\40\40\40\175\73\xa\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\xa\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x24\56\x61\152\x61\170\x28\x7b\12\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\40\x20\x20\x64\x61\164\141\x3a\40\x64\141\164\x6f\163\54\12\40\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\165\x72\x6c\72\x20\x62\x61\163\145\165\162\154\53\42\143\137\x64\162\157\x69\x64\57\x63\157\155\160\141\x72\141\x22\x2c\xa\x20\40\x20\40\40\40\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\40\40\40\x20\x20\164\171\x70\145\72\40\x22\x50\117\123\124\x22\x2c\12\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\163\165\x63\x63\145\163\x73\72\x20\146\165\156\x63\x74\x69\157\x6e\50\x64\141\164\x61\x29\x20\173\xa\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\40\40\40\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\40\40\x20\44\50\42\x23\142\157\x64\171\x22\51\56\x68\164\155\154\x28\x64\141\x74\x61\x29\x3b\x20\44\x28\42\43\154\151\153\145\x22\51\x2e\x76\141\x6c\50\154\151\153\x65\51\x3b\x20\163\167\141\154\56\x63\154\157\163\145\x28\51\x20\12\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x7d\12\x20\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\12\x20\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\175\51\x3b\12\40\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\x20\40\40\x7d\xa\40\40\40\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\40\x20\x20\12\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\40\x66\165\156\x63\x74\x69\x6f\156\x20\111\x6e\x63\162\151\155\145\156\x74\x4e\165\155\50\51\x7b\x20\142\145\146\157\x72\x65\x28\x29\x3b\12\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x76\141\162\40\111\156\143\162\x69\x6d\145\x6e\164\x4e\x75\155\75\x64\157\x63\x75\x6d\145\156\x74\56\147\145\x74\105\154\145\x6d\x65\x6e\164\102\171\111\x64\50\x22\x49\156\x63\162\151\155\x65\156\x74\116\x75\155\x22\51\x2e\x76\141\x6c\165\x65\73\12\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\40\40\x20\166\141\x72\x20\153\x65\x79\x3d\42\144\162\x6f\151\144\x39\x30\63\42\73\40\166\141\162\x20\154\x69\153\x65\x3d\44\50\x22\43\x6c\151\153\145\42\51\56\x76\141\x6c\x28\x29\73\xa\40\40\40\x20\40\40\40\40\x20\40\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\166\141\162\40\x64\141\x74\x6f\163\x20\75\x20\173\12\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\42\x6b\145\x79\42\x3a\153\x65\171\x2c\12\40\40\40\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\40\x22\x70\x61\147\x22\40\72\40\x49\156\x63\162\151\x6d\x65\156\x74\x4e\x75\x6d\54\154\x69\x6b\x65\x3a\154\x69\x6b\145\12\x20\x20\x20\40\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\175\x3b\xa\40\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\12\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\40\x24\x2e\141\x6a\x61\x78\x28\x7b\12\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\40\40\40\144\x61\164\141\72\x20\144\x61\164\x6f\163\54\xa\40\x20\x20\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\40\165\x72\x6c\x3a\40\40\142\141\x73\145\165\x72\154\x2b\42\x63\x5f\144\x72\x6f\151\x64\57\143\157\x6d\x70\141\x72\x61\42\54\xa\40\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\x74\171\160\x65\x3a\x20\42\120\x4f\x53\124\x22\54\xa\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\163\165\143\x63\145\x73\163\x3a\x20\146\165\x6e\143\x74\151\x6f\156\50\x64\141\x74\141\51\40\173\xa\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\40\x24\x28\x22\x23\142\x6f\x64\171\42\51\56\x68\x74\155\154\x28\144\x61\x74\141\x29\x3b\40\44\x28\x22\43\154\x69\x6b\145\42\x29\x2e\166\x61\154\x28\154\151\x6b\x65\x29\x3b\40\x73\x77\141\x6c\x2e\143\x6c\x6f\163\x65\50\x29\x20\12\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\175\xa\40\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\12\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\175\x29\x3b\12\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\40\x7d\12\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\74\x2f\x73\143\162\x69\x70\x74\76\xa\40\40\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\74\x64\x69\166\x20\143\154\x61\163\163\75\x22\167\x33\55\x62\141\x72\40\x77\x33\55\142\157\x72\144\145\162\x20\x77\63\x2d\x62\141\x72\x72\141\163\42\x3e\xa\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\x3c\151\156\160\165\x74\40\x74\171\x70\145\75\42\x68\151\144\144\x65\156\42\40\x69\144\75\42\104\145\143\162\145\155\x65\156\x74\116\x75\155\x22\40\x76\x61\154\165\145\75\x22" . $DecrementNum . "\42\x3e\xa\40\40\x20\40\40\40\40\40\40\40\x20\x20\40\40\x20\40\40\x20\40\x20\x3c\141\40\157\156\x63\x6c\x69\x63\x6b\75\42\x44\145\x63\x72\x65\155\145\156\x74\116\x75\x6d\x28\51\73\42\40\x63\x6c\x61\x73\163\75\x22\167\63\x2d\142\x61\x72\55\x69\x74\x65\155\40\167\x33\x2d\142\x75\164\x74\157\156\x22\76\x26\154\x61\x71\x75\x6f\x3b\74\x2f\141\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\x70\141\147\x69\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\63\x2d\146\157\156\144\157\144\x72\157\151\x64"; $html .= "\12\40\40\x20\40\40\x20\40\40\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\x3c\x69\x6e\160\x75\x74\40\164\171\x70\x65\x3d\42\x68\x69\x64\x64\x65\x6e\x22\40\151\144\75\42" . $id . "\x22\x20\166\x61\154\x75\x65\x3d\42" . $i . "\x22\x3e\12\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\40\x20\74\x61\x20\x6f\156\143\154\x69\143\153\75\x22\x6e\165\x6d\160\x61\147\x28\x24\x28\47\43" . $id . "\x27\x29\x2e\x76\141\154\50\51\51\x3b\x22\40\143\154\x61\x73\163\75\x22\x77\x33\55\142\x61\x72\x2d\151\164\145\x6d\40\x77\63\x2d\142\165\x74\x74\x6f\x6e\40" . $hover . "\42\x3e" . $i . "\74\57\141\76"; } else { $hover = ''; $html .= "\74\151\x6e\x70\165\164\x20\x74\171\160\x65\75\x22\150\x69\144\x64\x65\156\42\x20\151\x64\x3d\42" . $id . "\x22\40\x76\141\x6c\x75\145\75\x22" . $i . "\42\x3e\xa\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\x3c\141\40\157\x6e\143\154\151\x63\x6b\x3d\42\x6e\x75\x6d\160\x61\x67\x28\44\50\x27\43" . $id . "\47\51\56\166\141\x6c\x28\51\x29\73\42\x20\x63\154\141\x73\x73\x3d\x22\x77\x33\55\x62\141\x72\x2d\151\164\x65\x6d\40\x77\63\55\142\x75\164\164\x6f\x6e\40" . $hover . "\42\x3e" . $i . "\74\x2f\141\x3e"; } } } $html .= "\74\151\156\x70\165\x74\x20\x74\171\160\145\75\x22\x68\151\x64\144\x65\156\42\40\151\144\75\42\111\156\x63\x72\x69\x6d\x65\x6e\x74\x4e\x75\155\x22\x20\x76\141\x6c\165\145\x3d\42" . $IncrimentNum . "\42\76\xa\40\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x3c\141\40\157\x6e\143\154\151\143\x6b\75\x22\111\156\143\x72\151\x6d\x65\x6e\x74\x4e\165\155\x28\x29\73\x22\x20\143\x6c\141\x73\x73\75\42\x77\63\x2d\x62\141\162\55\151\164\145\155\40\167\63\x2d\142\165\x74\x74\157\x6e\42\76\x26\162\141\161\x75\157\x3b\x3c\x2f\x61\76\12\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\xa\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\40\74\57\x64\x69\x76\x3e\40"; return $html; } public function cliempre($a, $b) { $this->load->library("\x74\x61\142\154\x65"); if ($b != '') { $filter = "\x57\x48\x45\122\x45\x20\x28\141\56\143\157\144\151\x67\x6f\x3d\47{$b}\x27\40\x7c\174\40\x61\x2e\x6e\x6f\155\x62\x72\145\x20\x6c\151\x6b\x65\40\47\x25{$b}\x25\47\x20\x7c\174\40\141\x2e\x65\155\x61\151\x6c\40\x6c\x69\x6b\145\x20\x27\45{$b}\x25\x27\x20\x7c\174\40\142\x2e\x6e\157\155\x62\x72\x65\x20\154\x69\x6b\145\x20\47\45{$b}\x25\47\40\x7c\174\40\141\56\156\162\157\162\x69\146\x3d\x27\x25{$b}\45\47\40\174\174\x20\141\56\164\x65\154\x65\146\157\x6e\157\x5f\x6d\157\166\151\x6c\40\154\x69\153\x65\40\47\45{$b}\45\x27\40\x7c\174\40\141\x2e\x74\145\154\145\146\157\156\157\x73\x20\x6c\x69\153\x65\x20\x27\x25{$b}\x25\x27\x29"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\x4c\x45\x43\x54\40\116\x55\114\x4c\12\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\106\122\x4f\115\x20\x63\x6c\x69\145\155\160\162\145\x20\x61\40\114\x45\x46\x54\x20\x4a\x4f\111\116\x20\154\x69\x73\164\166\145\156\144\x20\142\40\117\116\40\141\56\x76\145\156\144\x65\144\x6f\162\75\x62\56\143\x6f\144\151\147\x6f\12\40\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x4c\105\x46\124\x20\112\117\x49\x4e\40\x73\145\x63\x74\157\162\145\x73\x20\x63\40\117\116\40\141\x2e\163\145\x63\164\157\162\x3d\x63\x2e\x63\x6f\144\151\x67\157\12\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x4c\105\x46\124\x20\x4a\x4f\x49\116\40\163\165\x62\163\145\x63\164\x6f\x72\x65\163\40\x64\x20\117\x4e\40\50\141\x2e\x73\x65\143\164\157\x72\75\x64\56\143\x6f\144\x69\x67\x6f\x20\46\x26\x20\x61\x2e\163\x75\x62\x63\x6f\144\x69\147\x6f\75\144\56\x73\165\x62\x63\x6f\144\x69\147\x6f\x29\40\107\122\117\x55\120\x20\102\131\40\141\x2e\143\157\x64\151\147\157")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\114\105\x43\124\40\141\x2e\143\157\x64\151\x67\x6f\54\x61\x2e\x6e\157\155\142\x72\145\x2c\141\x2e\156\162\157\x72\x69\x66\x20\x72\151\x66\54\x54\x52\111\x4d\x28\x61\x2e\x63\141\x6d\160\157\61\x29\x20\x73\x69\x63\155\54\x54\122\x49\x4d\x28\x61\x2e\143\141\x6d\160\x6f\63\51\40\163\151\x63\141\x2c\124\x52\111\x4d\50\141\56\164\x65\154\145\x66\x6f\x6e\x6f\163\x29\40\x74\x65\154\146\x2c\x54\x52\x49\x4d\50\141\56\164\x65\154\x65\146\157\156\x6f\x5f\155\x6f\x76\x69\x6c\51\x20\x74\145\154\x66\62\54\x62\56\x6e\157\x6d\142\x72\x65\x20\166\x65\156\144\x65\144\157\x72\x2c\x61\x2e\163\165\x63\165\x72\163\x61\154\x2c\xa\40\x20\40\x20\40\x20\40\40\40\40\40\40\40\40\40\x20\124\x52\111\x4d\50\141\56\x64\151\x72\145\x63\143\x69\x6f\156\x29\x20\144\x69\162\x65\x63\54\x54\x52\111\115\x28\x61\x2e\x64\151\x72\145\x63\145\156\166\x69\157\51\x20\x64\151\162\x65\x63\x65\x6e\x76\x2c\143\x2e\172\x6f\x6e\x61\x2c\144\x2e\163\165\142\163\145\143\164\x6f\162\54\124\x52\x49\115\x28\x61\56\143\141\155\x70\x6f\x34\51\40\150\x6f\x72\141\x72\151\x6f\x2c\141\56\144\x69\x61\163\54\x61\56\x65\155\141\151\154\54\x61\56\160\145\x72\x73\x63\157\156\164\x2c\x61\56\x66\x65\x63\150\141\54\141\x2e\163\x74\141\164\x75\x73\x2c\x72\157\165\156\144\50\141\56\144\x65\163\x63\x75\x65\x6e\164\157\51\x20\x64\x65\x73\x63\165\54\x61\x2e\x70\145\x72\163\143\x6f\156\x74\x20\x63\157\x6e\x74\141\143\x2c\x61\x2e\164\x69\160\x6f\x2c\141\x2e\163\x75\142\x64\151\x76\151\163\151\157\x6e\12\40\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\40\40\x46\122\117\x4d\40\143\154\x69\145\x6d\160\162\145\40\x61\x20\x4c\x45\106\x54\40\x4a\x4f\x49\x4e\x20\154\x69\x73\164\166\x65\156\144\40\x62\40\x4f\116\x20\x61\x2e\166\145\x6e\x64\145\x64\157\x72\x3d\142\x2e\x63\157\x64\151\x67\157\xa\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\114\105\x46\124\40\112\117\x49\116\40\x73\x65\143\x74\x6f\162\145\163\40\x63\40\117\116\x20\141\56\x73\x65\143\164\157\162\x3d\x63\x2e\143\157\x64\151\x67\x6f\xa\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x4c\x45\106\124\40\x4a\x4f\111\116\40\163\165\x62\x73\145\x63\164\157\x72\145\x73\40\144\40\117\116\x20\50\141\x2e\x73\x65\x63\x74\157\x72\x3d\x64\x2e\143\x6f\144\x69\147\x6f\x20\x26\46\40\141\56\x73\165\142\x63\157\144\x69\x67\x6f\x3d\144\56\163\165\x62\143\157\x64\151\147\x6f\51\40" . $filter . "\x20\107\122\x4f\x55\x50\40\x42\x59\40\141\56\143\x6f\x64\151\x67\157\40\x4f\122\104\105\122\40\x42\x59\x20\141\56\156\157\155\x62\162\145\x20\114\111\x4d\111\124\40" . ($a - 1) * $mostrar . "\x20\54\x20" . $mostrar . "\40")->result(); $html = "\12\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\x3c\x74\x61\142\154\x65\40\x63\x6c\x61\x73\x73\x3d\x22\x77\63\55\164\141\142\x6c\x65\55\x61\154\x6c\x20\x77\x33\x2d\150\157\166\x65\162\x61\x62\x6c\145\40\x77\63\55\154\x65\146\x74\55\141\x6c\x69\x67\156\42\76\xa\40\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\x3c\x74\162\76\74\x74\144\40\x63\154\141\163\163\x3d\42\x77\63\x2d\x66\x6f\x6e\144\x6f\x64\x72\157\151\144\x20\167\x33\x2d\x66\x69\152\157\x22\x3e\102\x75\x73\x63\141\162\40\x3c\151\155\147\40\x73\162\x63\x3d\x22" . base_url() . "\x69\x6d\x61\147\145\163\57\x62\x75\x73\143\141\162\56\160\156\x67\x22\40\x61\154\164\75\x22\102\x75\163\143\x61\x72\42\40\164\x69\x74\154\x65\75\42\x42\x75\x73\x63\x61\162\42\40\x73\x74\171\x6c\x65\x3d\42\x77\151\x64\164\150\72\x31\70\x70\x78\73\x62\157\x72\x64\x65\162\x3a\x30\73\x22\x3e\x3c\x2f\164\x64\x3e\xa\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x3c\164\x64\76\x3c\x69\156\160\x75\164\40\164\x79\x70\x65\x3d\42\x74\145\x78\x74\x22\40\x63\x6c\x61\x73\163\75\42\167\x33\55\151\x6e\x70\165\164\42\40\x70\x6c\x61\x63\x65\150\157\154\144\145\162\x3d\42\x49\156\x67\x72\x65\163\145\40\163\x75\40\x62\165\x73\161\165\x65\144\141\x22\x20\157\156\x63\150\141\x6e\x67\145\75\42\x63\154\151\x65\155\160\x72\145\50\x29\42\x20\x69\144\x3d\42\x6c\x69\153\x65\42\x3e\x3c\x2f\x74\x64\76\12\40\x20\40\40\40\40\40\40\40\x20\x20\40\x20\40\x20\40\x3c\164\x64\40\143\x6c\141\x73\163\x3d\x22\x77\63\55\x63\145\x6e\164\145\162\40\167\x33\55\x62\164\x6e\x22\x3e\74\x61\40\x6f\x6e\143\x6c\x69\143\x6b\x3d\x22\167\63\x2e\x73\x68\x6f\167\50\47\43\143\141\x72\147\144\x65\x73\x63\165\47\51\73\x22\76\x3c\151\x6d\x67\40\163\162\x63\75\x22" . base_url() . "\151\x6d\141\x67\145\x73\x2f\145\170\x63\x65\x6c\x2e\160\x6e\x67\x22\x20\x61\154\164\x3d\42\103\141\x72\147\x61\40\x44\x61\x74\x61\x22\x20\164\151\x74\x6c\145\x3d\x22\x43\x61\x72\147\x61\40\104\x61\x74\x61\x22\x20\163\164\171\154\145\x3d\42\x77\151\x64\x74\x68\72\62\x30\x70\170\x3b\150\145\151\x67\x68\x74\72\x32\x30\x70\170\73\142\157\x72\x64\x65\162\72\60\x3b\x22\76\x3c\57\141\x3e\x3c\x2f\x74\144\76\xa\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\40\74\x74\144\x20\x63\154\x61\163\163\75\42\x77\x33\55\x63\x65\x6e\164\x65\x72\x20\167\x33\55\x62\164\x6e\x22\76\x3c\141\x20\x6f\156\x63\154\151\143\153\75\42\x65\x78\160\x6f\x72\x74\x65\x78\143\145\154\143\154\151\50\51\x3b\42\x3e\74\x69\x6d\147\x20\x73\x72\143\x3d\x22" . base_url() . "\x69\155\141\x67\145\163\57\170\x6c\163\56\160\x6e\x67\42\40\x61\154\164\75\42\x45\170\160\157\162\x74\40\x4c\x69\x73\164\42\40\164\x69\164\154\x65\75\x22\105\x78\160\157\x72\x74\x20\114\151\x73\164\42\40\x73\x74\171\154\145\75\x22\167\x69\144\x74\150\x3a\x32\x30\x70\170\x3b\x68\x65\x69\147\150\164\72\62\60\x70\170\x3b\x62\x6f\x72\x64\145\x72\x3a\x30\x3b\x22\76\74\x2f\x61\x3e\74\57\x74\x64\x3e\xa\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\40\40\x20\40\74\164\x64\x20\x63\x6c\141\x73\x73\x3d\x22\167\x33\55\x63\145\x6e\164\x65\162\x20\167\x33\55\142\x74\x6e\42\76\x3c\x61\40\157\x6e\x63\154\x69\143\x6b\75\42\x72\145\147\x63\x6c\x69\50\x29\73\42\76\74\151\x6d\x67\x20\163\x72\x63\x3d\42" . base_url() . "\151\155\x61\x67\x65\x73\57\x72\x65\x67\x69\x73\164\x72\141\162\56\x70\156\x67\x22\40\141\154\164\x3d\x22\122\x65\147\x69\x73\x74\162\x61\x72\x20\x43\x6c\x69\x65\156\x74\x65\x22\x20\x74\x69\164\154\x65\75\x22\122\x65\x67\151\163\164\x72\x61\x72\x20\103\154\151\145\x6e\x74\145\x22\40\x73\164\x79\154\145\x3d\x22\167\151\x64\x74\150\x3a\x32\x30\160\x78\73\x68\x65\151\x67\150\x74\72\x32\60\x70\x78\73\142\x6f\162\144\145\x72\x3a\60\x3b\42\76\74\x2f\x61\76\74\x2f\164\144\76\12\x20\x20\x20\40\40\40\40\x20\40\40\40\x20\40\x20\x20\x20\74\x74\x64\40\143\154\x61\x73\163\x3d\42\167\63\55\x63\x65\x6e\x74\145\162\40\x77\x33\x2d\x62\164\x6e\42\x3e\x3c\141\40\x6f\156\143\x6c\151\143\x6b\x3d\x22\x65\144\151\x74\x63\x6c\151\50\51\73\x22\x3e\74\x69\x6d\x67\40\x73\162\x63\x3d\x22" . base_url() . "\x69\155\141\x67\x65\x73\x2f\145\144\151\164\141\x72\56\160\156\x67\x22\40\141\154\164\75\x22\x45\144\151\164\x61\162\40\x43\x6c\x69\x65\x6e\x74\x65\x22\x20\164\151\164\x6c\x65\75\42\105\x64\151\x74\x61\162\40\103\x6c\x69\x65\156\x74\145\x22\x20\163\x74\x79\154\145\x3d\x22\x77\x69\144\x74\150\72\62\60\x70\x78\x3b\x68\145\151\147\x68\x74\x3a\x32\x30\160\170\x3b\x62\157\x72\144\x65\x72\x3a\60\x3b\42\x3e\74\57\141\x3e\74\x2f\x74\144\x3e\12\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\74\164\144\x20\x63\x6c\x61\163\x73\75\x22\167\x33\55\143\x65\x6e\164\145\x72\40\167\63\x2d\x62\x74\x6e\x22\76\x3c\141\40\157\156\143\x6c\x69\143\x6b\x3d\x22\x61\143\x74\x69\x76\141\x63\x6c\x69\50\51\73\42\x3e\74\x69\x6d\147\40\x73\x72\x63\75\42" . base_url() . "\151\155\x61\x67\145\163\x2f\x61\x6a\165\163\164\145\163\56\x70\156\147\x22\40\x61\154\x74\x3d\42\x41\x63\x74\151\x76\141\x72\x2f\111\x6e\141\x63\x74\x69\x76\x61\162\42\x20\x74\x69\x74\154\x65\x3d\42\101\143\x74\151\166\141\x72\x2f\x49\x6e\x61\x63\164\151\166\x61\x72\x22\40\163\164\x79\154\x65\75\42\167\x69\144\164\150\x3a\x32\x30\x70\x78\x3b\150\x65\151\x67\x68\x74\x3a\x32\60\x70\x78\x3b\142\157\162\x64\145\162\72\60\x3b\42\x3e\x3c\x2f\141\76\x3c\57\164\144\76\xa\x20\40\x20\x20\40\40\x20\40\40\x20\40\40\40\40\40\x20\x3c\x74\144\x20\x63\x6c\x61\163\x73\x3d\x22\x77\x33\55\x63\145\x6e\x74\x65\x72\40\167\x33\x2d\x62\x74\156\x22\x3e\74\141\40\157\156\x63\154\151\143\x6b\x3d\x22\143\x6c\x69\x65\x6d\160\x72\145\50\51\x3b\42\76\74\x69\155\147\40\x73\162\143\x3d\42" . base_url() . "\151\155\141\x67\x65\163\x2f\162\145\x6c\x6f\x61\x64\x2e\160\156\147\x22\40\x61\154\164\x3d\x22\122\x65\143\141\162\147\x61\x72\x22\40\164\x69\164\154\145\75\x22\x52\x65\143\x61\x72\x67\x61\162\42\40\163\x74\x79\x6c\x65\75\x22\167\151\x64\164\x68\x3a\x32\x30\160\170\73\150\145\151\147\150\164\x3a\62\x30\160\170\x3b\x62\x6f\x72\x64\x65\x72\x3a\x30\x3b\42\76\x3c\57\141\76\74\x2f\164\x64\76\x3c\57\x74\x72\76\12\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\74\57\164\141\142\x6c\x65\76\74\142\x72\76\12\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x20\74\x74\141\x62\x6c\145\x20\x69\144\x3d\x22\151\144\60\x31\42\x20\x63\x6c\x61\x73\x73\x3d\42\x77\63\x2d\x74\x61\x62\x6c\145\x2d\x61\154\x6c\x20\x77\x33\x2d\x68\x6f\x76\x65\x72\x61\142\x6c\145\x20\167\63\x2d\x6c\x65\x66\x74\55\141\154\x69\x67\x6e\x20\x77\63\55\x74\151\x6e\171\42\x3e\74\x74\162\40\x63\154\141\x73\x73\75\42\x77\63\55\146\x6f\156\x64\157\144\x72\157\x69\144\40\167\x33\55\x66\x69\152\157\42\x3e\74\164\x68\x3e\x43\154\x69\x65\x6e\164\145\74\x2f\164\x68\76\x3c\164\150\x3e\123\165\x63\165\162\163\x61\154\74\57\164\150\76\x3c\164\150\x3e\124\151\x70\157\x3c\x2f\x74\x68\76\74\164\150\76\103\x6c\x61\163\x65\74\x2f\x74\150\x3e\x3c\x74\x68\76\x4e\x6f\155\x62\x72\145\x3c\57\x74\x68\x3e\x3c\x74\150\76\x52\x69\146\x3c\x2f\164\x68\76\74\164\150\76\105\155\x61\x69\x6c\74\57\164\150\76\74\164\150\x3e\123\111\103\115\x3c\57\164\150\x3e\74\164\150\x3e\123\x49\103\101\74\x2f\164\150\76\74\x74\150\x3e\x44\x69\141\x73\74\57\164\x68\x3e\74\x74\x68\76\104\x65\x73\143\165\x3c\57\164\x68\x3e\x3c\x74\150\76\x54\145\x6c\x66\x3c\57\x74\x68\76\12\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\74\x74\x68\76\x54\x65\x6c\146\62\74\x2f\164\x68\x3e\x3c\164\150\76\103\157\156\164\141\x63\x74\157\x3c\x2f\164\150\76\x3c\164\x68\x3e\126\145\156\144\145\144\x6f\162\74\57\x74\150\x3e\74\x74\x68\76\104\151\x72\x72\56\x46\x69\x73\x63\141\x6c\x3c\57\x74\150\x3e\x3c\x74\150\76\104\x69\x72\x72\x2e\105\x6e\x76\x69\x6f\x3c\57\164\150\76\74\164\x68\76\x5a\x6f\x6e\x61\x3c\x2f\164\x68\x3e\x3c\x74\150\76\x53\x65\143\164\157\162\x3c\57\x74\150\76\74\x74\x68\76\103\x6f\x6e\164\141\143\x3c\57\x74\x68\x3e\74\x74\x68\76\x48\x6f\x72\141\x72\x69\x6f\x3c\57\164\150\76\x3c\x74\150\x3e\x49\x6e\x67\162\145\x73\157\74\57\164\150\x3e\x3c\164\x68\76\x45\x73\x74\x61\164\x75\163\74\57\x74\x68\76\74\x2f\x74\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; if ($dtfac->status == 1) { $color = "\143\154\x61\163\163\x3d\x22\167\x33\55\x67\x72\x65\x65\156\42"; $status = "\x41\143\164\x69\x76\157"; } else { $color = "\x63\x6c\141\163\163\x3d\42\x77\x33\x2d\162\x65\144\x22"; $status = "\x49\156\x61\143\164\x69\x76\x6f"; } if ($dtfac->descu > 0) { $color2 = "\x63\x6c\x61\163\163\x3d\x22\167\x33\x2d\147\x72\145\x65\x6e\42"; } else { $color2 = "\x63\154\x61\x73\x73\x3d\42\x77\x33\55\x72\x65\x64\42"; } $html .= "\74\x74\162\40\151\x64\x3d\x22\x73\154\x65\x63\164" . $i . "\x22\x20\143\154\141\163\163\75\x22\151\164\x65\x6d\42\40\x6f\156\x63\x6c\x69\x63\153\x3d\x22\42\x3e"; $html .= "\x3c\x69\x6e\x70\165\x74\40\x74\x79\x70\x65\75\x22\x68\151\144\x64\145\x6e\42\x20\151\144\x3d\x22\141" . $i . "\42\x20\x6e\141\x6d\145\x3d\42\x63\x6f\144\x69\x67\x6f\x22\40\x76\x61\x6c\165\145\75\x22" . $dtfac->codigo . "\42\76\12\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\x3c\164\x64\x3e\x3c\151\x6e\x70\165\164\40\x74\171\x70\x65\75\42\x63\150\x65\143\x6b\x62\x6f\x78\42\x20\157\x6e\143\x6c\151\x63\x6b\x3d\x22\x77\x33\x2e\x74\x6f\x67\147\x6c\145\x43\x6c\x61\163\x73\50\47\x23\x73\x6c\145\x63\164" . $i . "\x27\x2c\47\x77\63\55\x79\x65\x6c\x6c\x6f\167\x27\51\73\42\40\143\154\x61\x73\x73\75\x22\x77\x33\55\143\x68\x65\x63\x6b\x22\40\x6e\x61\155\145\75\42\x63\x68\x65\143\153\x22\x3e" . $dtfac->codigo . "\x3c\x2f\x74\x64\76\xa\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\40\40\x3c\164\144\76" . $dtfac->sucursal . "\74\57\x74\144\x3e\x3c\164\144\76" . $dtfac->tipo . "\x3c\57\164\144\76\x3c\x74\x64\76" . $dtfac->subdivision . "\x3c\57\x74\x64\x3e\x3c\x74\x64\76" . $dtfac->nombre . "\x3c\57\x74\x64\x3e\74\x74\144\76" . $dtfac->rif . "\x3c\57\x74\x64\76\74\x74\144\x3e" . $dtfac->email . "\74\57\164\x64\x3e\x3c\x74\x64\x3e" . $dtfac->sicm . "\74\57\164\144\76\74\x74\x64\x3e" . $dtfac->sica . "\74\57\164\144\x3e\x3c\x74\144\76" . $dtfac->dias . "\x3c\57\164\x64\x3e\74\164\144\x20" . $color2 . "\76" . $dtfac->descu . "\x3c\x2f\x74\144\x3e\x3c\x74\x64\x3e" . $dtfac->telf . "\74\57\x74\144\x3e\74\164\144\x3e" . $dtfac->telf2 . "\x3c\x2f\164\x64\x3e\xa\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\x3c\164\x64\x3e" . $dtfac->perscont . "\74\x2f\164\144\76\x3c\x74\x64\76" . $dtfac->vendedor . "\x3c\57\164\x64\76\74\x74\x64\x3e" . $dtfac->direc . "\x3c\57\164\x64\76\x3c\x74\x64\x3e" . $dtfac->direcenv . "\74\57\164\x64\x3e\x3c\x74\x64\x3e" . $dtfac->zona . "\x3c\57\x74\x64\x3e\x3c\164\144\x3e" . $dtfac->subsector . "\x3c\x2f\164\144\x3e\74\164\144\x3e" . $dtfac->contac . "\74\x2f\164\x64\x3e\x3c\x74\144\x3e" . $dtfac->horario . "\74\57\164\x64\76\x3c\164\144\76" . $dtfac->fecha . "\74\57\164\x64\76\x3c\164\144\40" . $color . "\76" . $status . "\x3c\57\164\x64\76\xa\40\40\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\40\x20\x20\74\57\x74\x72\76"; } $html .= "\x3c\x74\162\x3e\74\x74\144\x20\143\154\x61\x73\x73\75\42\x77\63\55\x63\x65\156\164\145\162\x20\167\x33\x2d\x66\157\156\x64\157\144\162\157\x69\144\42\x20\143\157\154\x73\x70\141\156\75\42\x31\x33\x22\76\74\x6c\141\142\x65\154\40\143\x6c\x61\x73\163\x3d\x22\167\x33\55\154\141\162\147\145\x22\x3e\74\x62\x3e\x54\157\x74\141\154\40\103\154\151\145\x6e\164\145\x73\72\x20" . $totalreg . "\x3c\57\142\76\x3c\x2f\x6c\x61\x62\145\154\76\x3c\x2f\x74\x64\76\x3c\57\164\x72\x3e\x3c\x2f\164\141\142\x6c\x65\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x3c\163\143\162\x69\x70\x74\40\164\171\160\145\x3d\x22\x74\145\170\x74\x2f\152\141\166\141\x73\x63\x72\x69\x70\164\x22\x3e\xa\x20\40\x20\40\40\40\40\40\40\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x66\x75\x6e\143\x74\x69\157\156\40\x44\145\143\x72\145\x6d\x65\x6e\x74\116\x75\x6d\50\51\173\x20\x62\145\x66\x6f\x72\x65\x28\x29\73\xa\40\x20\40\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\166\x61\162\40\x44\145\143\x72\x65\155\145\156\164\116\x75\155\x3d\144\157\143\x75\155\145\x6e\164\x2e\147\x65\164\105\154\145\155\145\156\164\x42\171\111\144\50\x22\104\x65\x63\162\x65\155\x65\x6e\164\116\x75\155\x22\51\x2e\166\141\154\165\145\73\12\40\40\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\166\141\x72\x20\x6c\151\153\x65\x3d\x24\x28\x22\x23\154\x69\x6b\145\x22\51\x2e\166\141\154\50\x29\x3b\12\40\40\40\40\40\x20\40\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\40\40\40\x20\x20\166\141\x72\x20\x6b\x65\x79\75\42\144\162\157\151\144\71\x30\63\x22\x3b\12\40\x20\40\40\40\40\40\40\x20\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\x20\40\x20\x76\141\162\x20\144\141\164\157\163\x20\x3d\40\173\12\40\40\40\40\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\40\42\x70\141\147\42\x20\x3a\40\104\x65\x63\x72\145\x6d\145\x6e\x74\x4e\x75\155\54\xa\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\40\x22\x6b\145\x79\x22\40\x3a\x20\153\x65\x79\x2c\x22\x6c\x69\153\x65\x22\72\x6c\151\153\145\xa\40\x20\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\x20\40\40\40\40\x20\x7d\73\12\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\x20\40\12\40\x20\x20\40\40\40\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x24\56\141\x6a\141\x78\x28\173\12\40\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\x64\141\164\141\72\x20\144\x61\x74\x6f\163\54\xa\x20\40\x20\x20\40\x20\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x75\162\x6c\72\40\x20\142\141\x73\x65\x75\162\154\x2b\42\143\x5f\144\x72\157\151\144\x2f\x63\x6c\x69\x65\155\x70\x72\x65\42\54\xa\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x74\x79\x70\x65\x3a\x20\x22\120\117\x53\124\42\x2c\12\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\x20\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x73\165\143\143\x65\x73\163\x3a\40\x66\x75\156\143\x74\151\x6f\156\50\144\141\164\x61\51\x20\x7b\xa\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\40\40\40\40\x20\x20\40\40\x20\40\40\x24\50\42\43\142\x6f\x64\171\42\51\56\150\x74\155\x6c\x28\144\x61\164\141\51\73\40\x24\50\x22\43\x6c\151\x6b\145\x22\x29\x2e\x76\141\x6c\50\x6c\x69\x6b\x65\x29\73\40\163\x77\x61\154\x2e\x63\x6c\x6f\x73\x65\50\x29\12\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x7d\12\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\12\x20\40\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\x20\175\51\x3b\12\40\x20\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\40\40\40\x20\x20\40\x20\x7d\12\40\40\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\12\40\x20\40\40\40\40\40\40\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\146\x75\156\x63\164\151\x6f\156\x20\x6e\x75\155\x70\141\147\50\x61\x29\173\x20\142\145\146\x6f\x72\145\x28\x29\73\12\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\40\40\166\141\162\x20\153\145\x79\x3d\x22\x64\x72\x6f\x69\144\71\x30\63\x22\x3b\12\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\x20\166\x61\x72\40\154\x69\153\x65\x3d\44\x28\42\x23\154\x69\153\145\42\x29\56\166\x61\x6c\x28\51\73\xa\x20\40\40\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x76\141\x72\x20\144\x61\x74\157\163\x20\x3d\x20\x7b\12\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\42\153\145\x79\x22\x3a\153\x65\171\54\12\x20\40\40\40\x20\40\x20\40\40\x20\40\40\40\40\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\40\x20\40\x22\160\141\147\42\40\x3a\x20\x61\54\154\151\x6b\145\72\x6c\151\153\x65\xa\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\40\175\73\12\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\12\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\x20\40\40\x24\x2e\141\152\x61\x78\50\x7b\12\x20\x20\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\144\141\x74\141\72\x20\144\141\x74\157\163\x2c\12\40\x20\40\40\x20\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x75\x72\154\x3a\x20\142\x61\163\x65\x75\x72\x6c\x2b\42\143\137\x64\162\x6f\x69\x64\x2f\143\x6c\151\x65\155\x70\162\x65\x22\x2c\12\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\40\x74\171\x70\x65\x3a\x20\42\120\117\123\x54\x22\54\xa\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\40\40\x20\x20\x73\x75\143\x63\145\163\x73\72\x20\x66\165\156\x63\164\x69\157\x6e\x28\144\x61\x74\x61\51\x20\173\12\40\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\x24\x28\42\43\142\x6f\x64\x79\42\x29\x2e\150\x74\x6d\x6c\50\x64\141\x74\x61\x29\x3b\x20\44\x28\x22\x23\154\151\153\145\x22\51\56\166\141\154\x28\154\151\153\x65\x29\73\x20\x73\167\141\x6c\56\x63\x6c\x6f\x73\145\50\x29\xa\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\x7d\xa\x20\40\40\40\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\40\x20\40\40\12\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\40\x20\40\40\x20\x20\40\40\40\40\40\40\x20\x20\40\x7d\51\73\xa\40\40\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\40\40\x20\40\x20\175\12\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\40\x20\40\40\40\40\x20\x20\12\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\40\40\x20\40\40\x20\40\40\40\40\40\x66\165\156\x63\164\151\157\156\x20\x49\156\x63\x72\x69\x6d\145\x6e\164\116\165\x6d\x28\x29\173\40\x62\145\x66\x6f\162\x65\x28\x29\x3b\xa\40\x20\40\40\40\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\40\166\x61\x72\40\111\156\x63\162\151\x6d\x65\156\x74\116\165\x6d\75\144\157\143\165\155\145\x6e\x74\56\147\145\x74\x45\x6c\x65\155\x65\156\164\102\x79\x49\144\x28\x22\x49\156\143\x72\151\155\x65\x6e\164\116\x75\155\42\51\56\x76\x61\x6c\165\x65\x3b\xa\40\40\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x76\141\162\40\x6b\x65\x79\x3d\x22\x64\162\157\x69\144\x39\60\63\42\73\40\166\x61\162\40\x6c\x69\x6b\x65\x3d\x24\x28\x22\43\x6c\151\x6b\x65\42\51\56\166\x61\x6c\x28\51\73\xa\40\40\x20\40\x20\40\40\40\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\40\40\166\141\162\40\x64\x61\x74\157\163\x20\x3d\x20\x7b\12\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\42\x6b\145\x79\42\72\x6b\x65\171\x2c\12\40\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\40\40\40\x20\40\40\40\40\x20\40\40\40\40\x22\160\141\x67\x22\x20\x3a\40\x49\x6e\x63\162\151\x6d\x65\x6e\x74\x4e\165\x6d\54\x6c\151\153\145\72\x6c\151\153\145\xa\40\40\40\40\40\40\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\40\40\40\40\x20\40\x20\40\x7d\73\xa\40\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\x20\40\40\xa\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\44\56\x61\x6a\x61\170\50\x7b\12\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\x20\x20\144\141\164\141\x3a\40\144\x61\164\157\x73\54\xa\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\x20\40\40\x20\x20\40\40\40\x20\40\x20\40\40\40\40\40\x20\40\165\x72\154\72\x20\x20\142\141\x73\145\x75\x72\x6c\53\42\x63\137\x64\x72\157\x69\144\x2f\x63\154\151\x65\155\160\162\x65\42\54\12\40\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x74\x79\x70\145\72\40\42\x50\x4f\123\x54\x22\x2c\12\40\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\40\x20\40\40\x20\40\x73\165\143\143\145\x73\163\72\40\x66\x75\156\x63\x74\151\157\156\50\144\x61\164\141\x29\40\x7b\12\40\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\44\50\x22\43\x62\157\x64\x79\42\51\56\x68\x74\x6d\x6c\50\x64\x61\164\141\51\73\40\x24\x28\x22\43\154\x69\x6b\145\x22\51\x2e\x76\x61\x6c\x28\154\151\x6b\x65\51\73\x20\x73\167\x61\x6c\x2e\143\x6c\x6f\163\x65\50\51\12\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x7d\xa\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\xa\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\x7d\51\73\12\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x7d\xa\40\x20\40\x20\x20\x20\40\40\40\40\40\x20\40\40\40\x20\40\40\x20\40\74\x2f\163\143\162\x69\x70\164\76\xa\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\x3c\144\151\x76\x20\143\154\x61\163\x73\x3d\x22\167\63\x2d\142\141\162\x20\167\x33\x2d\142\157\162\x64\x65\x72\40\x77\63\x2d\x62\x61\x72\x72\x61\x73\x22\76\12\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x3c\151\x6e\x70\x75\164\x20\x74\171\x70\x65\75\42\x68\151\144\x64\145\156\x22\40\151\144\75\42\x44\145\x63\x72\x65\155\x65\156\164\x4e\x75\x6d\x22\40\166\x61\154\165\x65\x3d\x22" . $DecrementNum . "\42\x3e\xa\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\40\x3c\141\40\x6f\x6e\143\154\x69\143\153\x3d\42\104\x65\143\162\x65\155\x65\x6e\164\x4e\x75\x6d\50\51\73\42\x20\x63\154\141\163\163\75\42\x77\x33\x2d\142\141\162\55\151\164\x65\155\40\x77\63\55\142\x75\x74\x74\x6f\156\x22\x3e\46\x6c\x61\161\x75\x6f\x3b\74\x2f\x61\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\x64\x70\141\x67\151\156\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\63\x2d\146\157\156\x64\157\x64\x72\157\x69\x64"; $html .= "\xa\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x3c\x69\156\x70\x75\x74\x20\164\x79\x70\145\x3d\x22\150\x69\x64\x64\x65\156\x22\x20\x69\144\x3d\42" . $id . "\x22\40\166\141\x6c\165\145\x3d\x22" . $i . "\x22\76\12\40\x20\x20\40\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\40\74\x61\x20\157\156\x63\x6c\x69\143\x6b\x3d\42\156\165\155\x70\x61\147\x28\44\50\47\43" . $id . "\x27\51\x2e\x76\141\154\50\51\x29\73\x22\40\143\x6c\x61\x73\163\75\x22\x77\x33\x2d\142\141\162\x2d\151\x74\145\x6d\40\167\x33\55\142\x75\164\164\157\156\x20" . $hover . "\42\x3e" . $i . "\x3c\x2f\141\76"; } else { $hover = ''; $html .= "\74\x69\x6e\160\165\164\x20\x74\171\160\x65\75\42\x68\151\144\144\145\x6e\x22\x20\x69\144\75\42" . $id . "\42\40\x76\141\154\x75\x65\x3d\x22" . $i . "\42\x3e\xa\x20\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x3c\x61\x20\x6f\x6e\x63\154\x69\143\x6b\x3d\x22\156\165\155\x70\141\147\x28\x24\x28\47\43" . $id . "\47\51\56\166\x61\x6c\50\x29\51\73\x22\40\143\x6c\x61\163\163\75\x22\x77\x33\x2d\142\141\162\x2d\x69\164\145\155\40\x77\x33\x2d\x62\165\x74\164\x6f\x6e\x20" . $hover . "\x22\x3e" . $i . "\x3c\x2f\141\x3e"; } } } $html .= "\x3c\151\x6e\x70\x75\x74\40\x74\x79\160\x65\75\42\x68\x69\x64\144\145\x6e\42\40\151\144\75\x22\111\156\x63\162\151\155\145\x6e\164\116\x75\155\42\40\166\x61\154\165\145\x3d\42" . $IncrimentNum . "\42\x3e\12\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\x20\40\74\141\40\157\156\143\x6c\x69\x63\x6b\75\x22\x49\x6e\x63\x72\151\155\145\156\x74\x4e\165\x6d\50\x29\73\x22\x20\x63\154\141\163\x73\x3d\x22\167\63\55\142\x61\x72\x2d\151\164\145\155\x20\x77\x33\x2d\142\165\x74\164\157\156\x22\x3e\x26\x72\x61\161\x75\157\73\74\57\x61\76\xa\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\xa\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\40\x3c\x2f\144\151\166\x3e\x20"; return $html; } function activacli($cod) { $row = count($cod); $j = 0; for ($i = 0; $i < $row; $i++) { if ($cod[$i] != '' && $cod[$i] != null) { $bd = $this->db->query("\x53\105\x4c\x45\103\x54\x20\163\x74\141\164\x75\x73\x20\106\122\x4f\x4d\x20\143\x6c\x69\145\x6d\x70\x72\145\x20\127\110\x45\122\x45\40\x63\x6f\x64\151\147\x6f\75\x27{$cod[$i]}\x27")->row(); if ($bd->status == 1) { $new = 0; } else { $new = 1; } $this->db->query("\125\120\x44\101\x54\105\40\143\154\151\x65\x6d\x70\x72\x65\40\x73\145\x74\x20\x73\x74\141\x74\x75\x73\x3d\47{$new}\x27\40\127\x48\x45\x52\x45\40\143\157\144\x69\147\157\x3d\47{$cod[$i]}\x27"); if ($this->db->affected_rows() > 0) { $j++; $this->loguser("\x41\143\164\x69\x76\x61\x2f\104\145\x73\x61\x63\164\x69\166\x61\x20\x43\x6c\151\x65\155\160\162\145", "\105\x6c\40\x75\163\x75\x61\x72\151\x6f\x20\141\x63\164\x69\166\x61\134\144\145\163\141\x63\x74\151\166\x61\54\x20\x70\x72\157\143\145\x73\157\72\40" . $new . "\54\x20\x70\141\x72\x61\x20\x65\154\40\143\x6c\151\x65\156\164\145\x20" . $cod[$i] . "\56"); } } } return $j; } public function viewloguser($a, $b) { $this->load->library("\x74\x61\x62\x6c\x65"); if ($b != '') { $filter = "\x57\110\105\122\105\40\x28\x62\x2e\156\157\x6d\x61\160\145\40\x6c\151\x6b\x65\x20\x27\45{$b}\x25\47\x20\174\174\x20\x61\x2e\x6d\x6f\x64\165\x6c\x6f\40\154\151\153\x65\x20\47\45{$b}\45\x27\40\174\174\x20\141\56\144\145\163\x63\x72\x69\160\40\154\151\153\145\x20\x27\45{$b}\x25\47\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\114\x45\x43\124\x20\x2a\40\106\x52\x4f\x4d\40\x6c\x6f\x67\x75\x73\x65\162\40\x61\x20\x4a\x4f\x49\x4e\40\x74\162\141\x62\40\x62\40\x4f\116\x20\x61\x2e\x69\x64\165\163\x65\x72\75\142\x2e\x69\x64\x20" . $filter . '')->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\x45\114\105\103\x54\x20\52\x20\x46\x52\117\115\40\x6c\157\x67\165\163\145\x72\x20\141\x20\112\117\111\116\x20\x74\162\x61\x62\x20\142\40\117\116\40\141\56\151\144\x75\163\x65\162\75\x62\x2e\151\144\x20" . $filter . "\x20\x4f\x52\104\x45\x52\x20\102\x59\x20\x61\56\x66\x63\150\x61\40\x44\x45\123\103\x20\x4c\111\x4d\x49\124\40" . ($a - 1) * $mostrar . "\x20\x2c\x20" . $mostrar . "\x20")->result(); $html = "\12\40\x20\40\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\40\74\164\x61\142\x6c\x65\40\143\154\x61\x73\x73\75\x22\167\63\55\164\x61\x62\x6c\x65\x2d\141\x6c\x6c\x20\167\x33\x2d\x68\x6f\x76\x65\x72\x61\x62\x6c\145\x20\167\63\55\154\x65\x66\x74\x2d\141\x6c\151\147\156\42\x3e\12\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\74\164\162\x3e\x3c\x74\x64\x20\x63\154\141\163\x73\75\42\x77\x33\x2d\146\x6f\156\144\157\144\x72\x6f\151\x64\x22\76\x42\x75\163\x63\x61\x72\x20\x3c\151\155\147\40\163\162\x63\75\x22" . base_url() . "\x69\155\141\147\x65\163\x2f\142\x75\x73\143\x61\162\x2e\160\x6e\147\x22\40\x61\154\164\75\42\102\x75\x73\x63\141\x72\x22\x20\x74\x69\164\x6c\x65\75\42\102\165\163\143\141\162\x22\40\x73\x74\171\x6c\145\x3d\42\167\151\144\164\150\72\x31\70\160\x78\x3b\x62\157\162\144\145\162\72\x30\73\42\x3e\74\x2f\x74\144\x3e\12\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\x3c\x74\144\76\x3c\x69\156\160\x75\164\40\164\x79\160\145\75\42\164\x65\170\x74\42\x20\x63\x6c\x61\x73\163\x3d\x22\x77\63\x2d\x69\x6e\160\x75\164\42\40\160\154\x61\x63\145\x68\x6f\154\x64\145\162\75\42\x49\156\147\162\x65\x73\x65\40\163\x75\40\142\x75\x73\x71\x75\x65\x64\141\x22\x20\x6f\156\143\150\x61\156\147\145\x3d\42\x6c\x6f\147\x75\163\145\x72\x28\x29\42\x20\151\144\75\x22\x6c\x69\x6b\145\x22\x3e\x3c\57\164\x64\x3e\xa\40\40\40\40\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\x3c\164\x64\40\x63\x6c\141\x73\x73\75\x22\x77\x33\x2d\x63\x65\156\x74\x65\162\x20\167\x33\x2d\x62\x74\156\42\76\x3c\x61\x20\x6f\x6e\x63\154\x69\x63\153\75\42\145\x78\160\157\x72\x74\154\157\147\165\x73\145\x72\x28\51\x3b\42\x3e\74\151\x6d\147\40\x73\x72\x63\75\42" . base_url() . "\x69\155\141\x67\145\163\57\170\154\163\56\160\156\x67\42\x20\x61\154\x74\x3d\42\x45\x78\x70\x6f\162\164\40\x45\x78\143\145\x6c\42\40\164\151\164\x6c\x65\75\x22\x45\170\160\x6f\x72\164\x20\x45\170\143\145\154\x22\40\163\x74\171\x6c\x65\75\x22\x77\151\x64\x74\x68\x3a\62\x30\x70\x78\73\150\x65\151\x67\150\x74\72\x32\60\x70\170\73\142\x6f\162\144\x65\162\x3a\x30\73\x22\x3e\74\57\141\76\74\57\x74\144\76\12\x20\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\74\164\144\40\x63\154\x61\163\163\x3d\42\x77\x33\x2d\143\x65\x6e\164\x65\x72\x20\x77\63\x2d\142\x74\156\x22\x3e\74\x61\x20\157\156\x63\x6c\x69\x63\x6b\75\42\154\x6f\x67\x75\163\x65\x72\x28\51\x3b\42\76\74\151\155\147\40\x73\162\143\x3d\x22" . base_url() . "\x69\x6d\141\147\145\x73\x2f\x72\x65\x6c\157\x61\x64\56\160\156\147\42\40\x61\x6c\164\75\x22\122\145\143\x61\x72\147\141\162\x22\x20\x74\151\x74\x6c\145\x3d\42\x52\x65\x63\141\162\147\141\x72\x22\40\x73\164\171\x6c\145\75\42\x77\151\144\x74\150\x3a\62\x30\160\170\73\x68\145\x69\x67\150\164\x3a\62\60\160\x78\x3b\142\x6f\x72\144\x65\162\72\x30\73\42\76\x3c\57\141\x3e\x3c\x2f\164\x64\76\74\57\164\x72\76\xa\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\x20\40\40\40\74\x2f\x74\141\x62\154\x65\76\74\x62\162\x3e\xa\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\74\164\141\x62\x6c\145\x20\151\144\x3d\x22\x69\x64\x30\x31\42\40\143\154\x61\x73\x73\75\x22\167\63\x2d\164\x61\142\154\x65\55\141\154\x6c\x20\x77\x33\x2d\x68\x6f\166\145\162\141\142\154\x65\40\x77\63\55\154\145\x66\164\x2d\x61\x6c\x69\147\156\x20\167\63\x2d\164\151\156\171\42\76\74\x74\162\x20\143\x6c\141\x73\x73\x3d\42\167\x33\x2d\146\157\x6e\144\x6f\144\x72\x6f\151\x64\x20\167\63\55\146\151\152\157\42\x3e\x3c\164\x68\76\115\x6f\144\165\154\x6f\74\x2f\x74\150\76\74\x74\150\x3e\116\x6f\155\142\162\x65\74\57\x74\150\x3e\x3c\x74\x68\76\x43\x65\144\x75\154\141\x3c\57\x74\x68\x3e\74\164\x68\x3e\104\x65\x73\x63\x72\x69\160\143\151\157\x6e\x3c\57\164\x68\x3e\74\x74\150\76\106\x65\x63\150\x61\74\57\x74\x68\76\74\57\164\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\164\162\x20\151\x64\75\42\x73\x6c\145\x63\164" . $i . "\x22\40\x63\154\x61\x73\163\x3d\x22\151\164\145\x6d\x22\x20\x6f\156\143\154\x69\x63\153\75\42\42\76"; $html .= "\x3c\151\x6e\x70\165\164\x20\x74\x79\160\145\x3d\42\150\151\144\x64\x65\x6e\x22\40\x6e\141\x6d\145\x3d\42\x63\157\144\151\147\x6f\x22\x20\x76\x61\154\165\145\75\x22" . $dtfac->id . "\x22\x3e\12\40\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\x20\40\x20\x20\40\74\164\x64\x3e\74\x21\55\x2d\x3c\151\x6e\x70\165\x74\x20\x74\x79\x70\145\75\x22\x63\x68\145\143\153\x62\x6f\170\x22\x20\x6f\x6e\143\154\x69\x63\x6b\x3d\42\167\x33\x2e\x74\x6f\147\147\x6c\145\x43\154\141\x73\x73\50\x27\43\163\x6c\145\x63\x74" . $i . "\x27\54\47\x77\x33\x2d\171\145\x6c\154\157\167\47\x29\73\x22\40\x63\154\x61\x73\163\75\42\167\x33\x2d\143\150\145\x63\153\42\40\156\x61\x6d\145\x3d\42\143\150\145\143\153\x22\76\55\x2d\x3e" . $dtfac->modulo . "\x20\x3c\164\x64\76" . $dtfac->nomape . "\74\57\x74\x64\x3e\x20\74\164\x64\76" . $dtfac->cedula . "\x3c\57\x74\144\x3e\40\xa\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\x3c\164\144\x3e" . $dtfac->descrip . "\74\57\164\144\x3e\x20\74\x74\x64\x3e" . $dtfac->fcha . "\74\57\164\x64\76\12\40\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\74\x2f\164\x72\x3e"; } $html .= "\x3c\x74\162\x3e\74\x74\144\40\x63\154\x61\163\163\x3d\42\x77\x33\55\x63\x65\x6e\164\145\x72\x20\x77\x33\x2d\146\157\156\144\x6f\x64\162\157\x69\x64\42\x20\x63\x6f\x6c\x73\x70\141\x6e\75\42\61\x33\x22\76\74\154\x61\142\x65\x6c\40\143\154\141\x73\163\x3d\x22\167\63\x2d\154\x61\x72\x67\145\x22\x3e\74\142\76\124\x6f\164\141\154\40\115\157\166\151\x6d\x69\145\x6e\164\157\163\72\40" . $totalreg . "\74\x2f\142\x3e\x3c\57\x6c\141\x62\x65\154\76\x3c\x2f\164\144\x3e\74\57\x74\x72\x3e\x3c\x2f\164\141\x62\x6c\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\74\163\143\x72\151\x70\164\x20\164\x79\160\x65\75\42\x74\145\x78\x74\x2f\152\x61\x76\x61\x73\143\162\151\160\164\x22\x3e\12\40\40\x20\40\40\x20\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\146\165\156\143\x74\151\157\156\40\x44\145\143\x72\145\x6d\145\156\164\116\x75\x6d\x28\x29\173\40\142\145\x66\x6f\x72\x65\50\51\x3b\xa\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\x76\x61\162\40\104\x65\x63\x72\x65\x6d\145\x6e\164\x4e\x75\x6d\75\144\157\143\x75\x6d\145\x6e\x74\56\x67\145\x74\x45\x6c\x65\x6d\145\x6e\164\x42\x79\111\144\50\x22\x44\x65\x63\x72\x65\155\145\x6e\164\116\165\x6d\x22\x29\56\166\x61\154\x75\145\73\xa\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\x76\141\x72\x20\x6c\151\153\145\x3d\44\50\x22\x23\x6c\x69\153\145\42\x29\x2e\x76\141\154\50\51\x3b\xa\x20\40\40\40\40\40\40\40\40\x20\40\40\x20\40\40\40\40\40\x20\x20\x20\40\40\40\x20\40\40\x20\x76\x61\162\40\x6b\x65\171\x3d\x22\144\x72\157\151\144\x39\x30\63\x22\x3b\xa\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\40\x20\40\40\40\x20\x76\141\162\x20\x64\141\x74\157\163\40\75\40\173\12\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\40\40\40\40\40\42\x70\141\147\42\40\72\40\x44\145\x63\162\145\x6d\x65\x6e\164\116\x75\x6d\54\12\40\40\x20\x20\40\40\x20\x20\40\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\42\x6b\145\171\x22\40\72\x20\x6b\x65\x79\54\x22\154\151\x6b\x65\x22\72\x6c\151\x6b\x65\xa\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x20\40\40\40\40\40\175\x3b\12\x20\40\40\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\12\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\40\x24\56\x61\x6a\141\x78\x28\173\12\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x64\141\x74\x61\72\40\144\141\x74\157\x73\54\12\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\x75\x72\154\72\x20\40\x62\141\163\x65\x75\x72\x6c\53\42\x63\137\x64\162\157\x69\144\x2f\x6c\x6f\x67\165\x73\x65\x72\x22\x2c\12\40\40\40\40\40\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\164\171\x70\x65\72\x20\x22\x50\117\x53\124\42\x2c\12\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x73\165\143\143\145\x73\x73\x3a\40\x66\x75\156\143\164\151\x6f\156\50\x64\x61\164\141\51\40\x7b\xa\x20\x20\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\44\50\42\43\x62\157\144\x79\x22\51\x2e\150\x74\155\154\50\x64\x61\x74\141\x29\73\40\44\50\42\x23\154\151\153\145\42\51\x2e\166\x61\x6c\x28\x6c\x69\153\x65\51\73\x20\x73\167\x61\x6c\56\x63\154\157\x73\145\x28\51\xa\40\40\x20\40\40\40\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\175\12\40\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\40\40\x20\40\x20\40\40\x20\40\x20\xa\40\x20\40\40\40\40\x20\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\x20\x7d\51\73\xa\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\40\175\xa\40\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\12\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x66\165\156\143\164\x69\157\156\x20\156\165\x6d\x70\x61\147\50\x61\51\173\x20\x62\x65\146\x6f\162\x65\x28\51\x3b\xa\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\166\x61\x72\40\153\x65\x79\75\42\x64\162\x6f\151\144\71\60\63\42\x3b\xa\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\166\x61\x72\x20\154\x69\153\x65\75\44\50\x22\x23\154\151\153\x65\42\x29\x2e\x76\141\154\50\x29\73\12\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x76\141\x72\x20\144\141\164\x6f\x73\40\75\40\x7b\12\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\40\x20\40\40\40\x22\153\145\171\x22\72\153\x65\x79\54\xa\40\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x22\x70\141\x67\x22\x20\x3a\x20\x61\54\x6c\x69\x6b\145\72\154\x69\x6b\145\12\40\40\40\x20\40\40\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\40\x20\40\40\x7d\73\xa\40\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\xa\x20\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x24\x2e\x61\x6a\141\170\x28\x7b\xa\40\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\40\x20\40\x64\x61\164\x61\x3a\40\144\141\x74\157\163\x2c\xa\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\165\x72\x6c\72\x20\142\141\163\x65\x75\x72\154\53\x22\143\x5f\x64\162\157\151\144\57\x6c\157\147\165\163\x65\x72\x22\x2c\12\x20\x20\40\40\40\x20\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\164\x79\160\145\72\40\x22\x50\x4f\123\x54\42\54\12\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x73\165\x63\143\x65\x73\163\x3a\40\146\165\x6e\143\164\151\157\x6e\x28\144\141\164\141\x29\x20\x7b\12\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\40\x20\40\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\x24\50\x22\43\x62\157\x64\x79\42\51\x2e\150\x74\155\x6c\50\144\141\164\x61\51\73\40\x24\x28\42\x23\x6c\x69\153\145\42\51\56\166\141\x6c\50\x6c\x69\x6b\145\51\73\x20\x73\x77\141\x6c\56\x63\154\x6f\x73\x65\x28\51\xa\40\40\40\40\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\40\x7d\xa\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\40\12\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x7d\x29\73\xa\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\175\xa\40\x20\x20\x20\40\40\40\40\x20\40\40\x20\40\40\40\40\x20\40\40\x20\x20\40\x20\40\12\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\146\x75\156\x63\x74\151\x6f\156\40\111\x6e\143\x72\x69\155\x65\156\x74\x4e\x75\155\50\x29\x7b\x20\142\x65\146\157\x72\145\50\x29\73\xa\x20\40\40\40\x20\x20\40\40\x20\x20\40\40\40\40\x20\x20\40\40\40\x20\40\40\40\40\40\x20\x20\40\166\x61\x72\x20\111\x6e\x63\x72\151\x6d\145\156\164\116\x75\155\x3d\144\x6f\143\x75\155\145\156\164\x2e\147\145\164\105\154\x65\155\145\x6e\164\102\x79\x49\144\x28\x22\111\x6e\143\x72\x69\x6d\145\x6e\164\116\165\155\x22\x29\x2e\166\x61\154\x75\x65\73\12\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\x76\141\162\x20\x6b\x65\x79\x3d\x22\144\x72\157\151\x64\71\60\63\42\73\40\166\x61\162\40\154\151\153\x65\x3d\x24\50\42\x23\x6c\151\x6b\145\42\x29\x2e\166\141\x6c\x28\x29\x3b\12\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x76\141\162\x20\x64\141\164\157\163\40\75\40\173\12\40\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\x22\x6b\x65\x79\42\72\x6b\145\171\x2c\12\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\40\40\x20\x20\40\40\x20\40\x20\x20\42\x70\141\147\x22\x20\72\40\x49\x6e\143\162\151\x6d\145\x6e\164\x4e\165\155\54\x6c\x69\153\145\x3a\x6c\151\153\x65\12\x20\40\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x7d\73\xa\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\12\x20\40\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\44\x2e\x61\x6a\x61\170\x28\x7b\12\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x64\x61\164\141\72\40\144\141\x74\157\x73\x2c\xa\40\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x75\x72\x6c\x3a\x20\x20\x62\x61\163\x65\x75\162\154\x2b\x22\x63\137\x64\x72\157\151\144\57\154\157\x67\x75\163\x65\x72\x22\x2c\12\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\40\164\x79\160\145\72\x20\x22\120\117\123\124\42\54\12\40\x20\40\x20\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\x73\165\143\x63\x65\x73\163\72\40\x66\165\156\143\x74\x69\157\x6e\x28\x64\x61\x74\141\51\x20\x7b\xa\x20\x20\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\40\x20\x24\50\42\43\142\x6f\x64\171\42\51\x2e\150\x74\x6d\x6c\x28\x64\x61\x74\x61\51\x3b\40\44\50\x22\43\x6c\x69\153\x65\42\x29\56\x76\x61\x6c\x28\154\x69\153\145\51\x3b\x20\x73\167\141\154\x2e\143\154\x6f\x73\x65\50\x29\xa\40\x20\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\175\xa\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\40\40\40\40\40\40\x20\x20\x20\40\x20\12\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x7d\x29\73\xa\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\175\12\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\40\x20\40\40\40\x20\x20\74\57\163\x63\x72\151\160\164\x3e\xa\x20\40\40\x20\x20\40\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x3c\144\x69\166\40\x63\x6c\141\x73\163\75\42\x77\x33\x2d\142\141\162\40\167\x33\x2d\142\x6f\x72\x64\x65\x72\40\167\x33\55\x62\x61\x72\162\141\163\42\x3e\xa\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\74\x69\x6e\x70\x75\164\x20\164\171\160\145\75\x22\x68\x69\x64\x64\145\x6e\x22\x20\151\x64\75\x22\104\145\143\162\x65\x6d\145\156\x74\116\x75\155\42\40\166\141\x6c\x75\145\x3d\x22" . $DecrementNum . "\x22\x3e\12\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\x3c\141\x20\x6f\x6e\143\x6c\x69\143\153\x3d\x22\x44\x65\143\x72\x65\155\x65\x6e\164\116\165\155\x28\51\x3b\42\x20\x63\154\x61\163\x73\75\42\167\x33\55\142\x61\162\55\x69\164\145\x6d\40\167\63\55\142\x75\x74\164\x6f\156\x22\76\46\154\x61\161\165\157\x3b\74\x2f\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\x61\x67\151\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\146\x6f\x6e\x64\x6f\144\x72\157\x69\144"; $html .= "\xa\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\x20\x20\40\x3c\151\156\160\165\x74\x20\164\x79\160\145\x3d\42\150\x69\144\144\x65\156\x22\x20\151\x64\75\x22" . $id . "\42\x20\x76\x61\x6c\165\x65\x3d\x22" . $i . "\x22\76\12\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\74\141\x20\157\x6e\x63\154\x69\143\153\x3d\x22\x6e\x75\x6d\160\141\147\x28\44\50\x27\x23" . $id . "\x27\x29\x2e\x76\141\154\x28\x29\x29\73\42\x20\x63\154\141\x73\x73\75\x22\x77\x33\x2d\142\x61\x72\x2d\151\164\145\155\x20\167\63\55\x62\x75\x74\164\157\x6e\40" . $hover . "\42\x3e" . $i . "\x3c\57\x61\x3e"; } else { $hover = ''; $html .= "\74\151\156\x70\165\164\40\164\171\x70\145\x3d\x22\x68\x69\144\144\x65\x6e\x22\x20\151\144\75\42" . $id . "\42\40\x76\141\154\165\x65\x3d\x22" . $i . "\42\76\xa\x20\40\40\40\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\x3c\x61\40\x6f\x6e\143\154\x69\x63\153\x3d\x22\156\165\x6d\160\141\147\50\x24\x28\x27\x23" . $id . "\x27\51\56\166\141\154\50\x29\51\x3b\42\x20\143\x6c\x61\163\x73\75\x22\x77\63\55\x62\141\x72\x2d\x69\164\145\x6d\x20\x77\63\55\x62\165\164\164\157\156\40" . $hover . "\42\76" . $i . "\x3c\57\141\x3e"; } } } $html .= "\x3c\151\x6e\x70\x75\x74\40\x74\x79\x70\x65\x3d\42\x68\151\x64\x64\145\156\42\x20\151\x64\75\42\x49\156\x63\162\151\x6d\x65\156\164\x4e\165\155\x22\40\x76\x61\154\165\145\x3d\x22" . $IncrimentNum . "\x22\76\12\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\74\141\x20\157\156\x63\x6c\x69\143\153\x3d\x22\111\156\143\162\x69\155\x65\x6e\x74\116\165\x6d\x28\51\73\42\x20\143\x6c\x61\163\x73\x3d\42\167\x33\55\142\x61\x72\x2d\151\164\x65\x6d\x20\x77\x33\55\x62\165\164\164\x6f\x6e\42\76\46\x72\x61\161\165\x6f\x3b\74\57\141\x3e\xa\40\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\x20\xa\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\74\57\144\x69\x76\76\x20"; return $html; } function exportloguser($desde, $hasta) { return $this->db->query("\x53\x45\114\x45\103\x54\40\141\56\155\157\x64\165\x6c\157\54\142\56\x6e\x6f\x6d\x61\160\x65\x2c\142\x2e\x63\145\x64\x75\x6c\141\x2c\x61\56\144\145\x73\143\162\x69\x70\54\x61\x2e\x66\143\150\x61\40\106\122\117\115\40\x6c\157\x67\x75\x73\145\x72\40\141\x20\112\117\x49\116\x20\x74\x72\141\x62\x20\142\x20\117\116\x20\x61\x2e\x69\144\165\x73\x65\x72\75\142\x2e\x69\144\x20\x57\x48\105\122\x45\x20\x61\x2e\x66\x63\x68\141\x3e\75\x27{$desde}\47\40\46\x26\40\141\56\146\143\150\x61\74\x3d\47{$hasta}\x27\x20\117\122\104\105\122\40\102\131\40\141\x2e\146\143\x68\141\x20\x44\105\123\103"); } public function trabuser($a, $b) { $this->load->library("\164\141\x62\154\x65"); if ($b != '') { $filter = "\x57\110\105\122\105\x20\x61\x2e\x6e\157\155\141\160\x65\40\154\x69\153\x65\x20\47\x25{$b}\x25\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\x4c\x45\103\124\40\x6e\x75\154\x6c\40\x46\122\117\x4d\40\x74\x72\141\x62\x20\x61\x20\xa\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\40\40\40\40\40\x20\40\40\x20\40\40\x4c\105\106\x54\40\x4a\x4f\111\116\x20\x74\x72\x61\x62\x64\162\x6f\151\144\40\x62\x20\117\116\x20\x61\56\151\x64\x3d\142\56\x69\x64\x5f\164\162\141\x62\x20" . $filter . "\x20\x47\122\117\125\x50\40\x42\131\40\141\56\151\x64")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\x45\114\105\x43\x54\40\141\x2e\x69\144\x2c\141\56\x6e\157\x6d\x61\x70\x65\x2c\x61\56\x63\145\144\x75\x6c\x61\x2c\x61\x2e\x74\145\x6c\x65\x66\157\156\157\x2c\141\56\x75\x75\x69\x64\x2c\142\x2e\x75\x73\x65\162\x2c\x62\56\160\x61\163\163\54\141\56\x74\x69\x70\x20\x46\x52\x4f\x4d\x20\164\162\141\x62\40\x61\40\12\40\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\x4c\x45\x46\124\x20\x4a\117\111\116\x20\x74\162\141\142\144\x72\x6f\x69\144\40\x62\40\117\x4e\x20\x61\x2e\x69\x64\x3d\x62\56\151\x64\x5f\164\162\141\x62\x20" . $filter . "\12\x20\40\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\107\x52\117\x55\120\40\102\x59\40\141\56\151\144\x20\117\122\104\x45\122\x20\x42\x59\40\x61\x2e\164\151\x70\54\x61\x2e\x6e\x6f\155\141\160\x65\40\x4c\x49\115\111\124\40" . ($a - 1) * $mostrar . "\40\x2c\x20" . $mostrar . "\40")->result(); $html = "\xa\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\74\x74\141\142\154\145\x20\x63\x6c\141\x73\x73\x3d\x22\167\x33\x2d\x74\x61\x62\x6c\145\x2d\x61\x6c\x6c\x20\167\x33\55\150\157\166\145\x72\141\x62\x6c\145\40\x77\x33\55\154\x65\x66\x74\x2d\141\x6c\x69\x67\x6e\x22\76\12\40\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\40\x20\x20\40\40\40\40\40\x20\74\164\162\76\74\164\x64\40\x63\x6c\141\x73\x73\x3d\42\167\63\x2d\x66\157\x6e\x64\x6f\x64\x72\157\151\x64\42\76\x42\x75\x73\x63\141\x72\40\x3c\x69\x6d\x67\40\163\x72\143\x3d\42" . base_url() . "\x69\155\x61\x67\145\163\57\x62\x75\163\143\x61\x72\x2e\160\x6e\x67\x22\40\x61\x6c\x74\x3d\x22\102\x75\163\143\x61\162\x22\40\164\151\x74\154\x65\x3d\x22\x42\165\163\143\141\x72\42\x20\x73\x74\x79\154\145\x3d\42\167\151\x64\164\150\72\x31\70\x70\x78\x3b\142\x6f\162\144\145\x72\x3a\x30\73\x22\x3e\74\x2f\164\144\x3e\xa\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\74\164\x64\76\x3c\151\156\160\165\164\x20\x74\171\160\x65\x3d\x22\164\145\170\164\42\40\x63\x6c\x61\163\x73\x3d\42\167\x33\55\151\x6e\x70\165\x74\42\40\160\154\141\x63\145\150\157\154\x64\x65\162\75\x22\x49\x6e\147\162\x65\x73\x65\x20\163\165\40\142\x75\163\x71\165\x65\x64\141\42\x20\x6f\156\143\x68\x61\x6e\147\145\x3d\x22\164\162\x61\142\165\x73\145\162\x28\51\x22\x20\151\x64\x3d\42\x6c\151\x6b\x65\42\x3e\x3c\57\164\144\76\xa\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\x20\x20\74\x74\144\40\143\154\141\163\x73\x3d\x22\x77\x33\x2d\143\x65\x6e\x74\145\162\40\167\63\55\142\164\156\42\76\74\141\x20\157\156\143\x6c\151\143\x6b\75\x22\162\145\x67\164\x72\141\142\x28\x29\73\42\x3e\74\x69\x6d\147\40\163\162\143\75\42" . base_url() . "\x69\155\x61\147\x65\163\x2f\x72\x65\147\151\x73\164\162\141\162\x2e\160\156\x67\42\40\141\x6c\x74\75\42\x52\x65\147\x69\163\164\162\141\x72\42\x20\164\x69\x74\154\x65\75\x22\x52\145\x67\151\x73\x74\162\x61\x72\x22\40\x73\x74\x79\154\145\75\x22\x77\151\144\164\x68\x3a\x32\x30\x70\x78\x3b\150\145\x69\147\x68\x74\72\62\x30\160\170\x3b\142\x6f\x72\144\x65\162\x3a\60\x3b\42\76\74\x2f\141\x3e\x3c\x2f\164\x64\76\xa\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\x3c\164\x64\40\143\x6c\x61\163\163\75\42\167\x33\55\x63\x65\156\164\145\x72\x20\167\63\x2d\142\164\156\42\76\x3c\x61\40\x6f\156\143\154\x69\x63\x6b\x3d\42\145\x64\151\x74\164\x72\x61\x62\50\51\73\x22\x3e\x3c\151\x6d\147\40\x73\162\x63\x3d\42" . base_url() . "\x69\x6d\x61\x67\x65\163\57\145\144\x69\x74\141\x72\x2e\160\x6e\147\42\40\141\x6c\164\75\42\105\144\x69\x74\x61\x72\x22\x20\164\x69\x74\x6c\x65\75\42\105\144\151\x74\x61\162\42\40\x73\164\171\154\145\x3d\42\167\151\144\164\150\x3a\62\60\x70\x78\73\150\x65\151\147\x68\x74\x3a\62\x30\160\170\73\x62\x6f\x72\x64\x65\162\72\60\x3b\x22\x3e\74\57\x61\76\74\57\x74\x64\76\12\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x3c\164\x64\40\x63\x6c\x61\163\x73\75\x22\x77\63\x2d\x63\x65\x6e\x74\145\162\40\x77\x33\55\x62\x74\x6e\42\76\x3c\x61\40\x6f\156\x63\154\151\143\x6b\x3d\x22\164\x72\x61\x62\x75\163\145\162\x28\x29\x3b\42\76\x3c\x69\x6d\147\40\x73\x72\143\x3d\42" . base_url() . "\x69\155\141\x67\145\x73\x2f\x72\145\x6c\157\141\x64\56\x70\156\147\42\40\141\x6c\164\75\42\x52\145\143\x61\162\x67\x61\162\42\40\164\x69\164\x6c\145\75\x22\122\145\143\141\x72\x67\141\x72\42\40\163\x74\171\154\145\x3d\x22\167\151\144\164\x68\72\x32\60\160\x78\73\150\145\x69\147\150\x74\x3a\62\60\x70\170\x3b\x62\157\x72\x64\x65\x72\x3a\x30\x3b\x22\x3e\x3c\x2f\x61\76\x3c\57\x74\144\76\74\x2f\164\162\x3e\xa\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x3c\57\164\x61\142\x6c\x65\x3e\74\x62\162\x3e\12\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\40\40\x20\x20\74\164\x61\x62\x6c\x65\40\151\x64\75\42\151\144\60\x31\x22\x20\x63\x6c\x61\163\x73\x3d\x22\x77\x33\x2d\164\141\x62\154\145\55\x61\154\x6c\40\167\63\55\x68\157\166\x65\162\x61\x62\154\x65\40\x77\63\x2d\154\145\x66\x74\55\141\154\151\x67\x6e\x20\x77\x33\x2d\x74\151\156\171\42\x3e\x3c\x74\162\x20\x63\x6c\141\163\x73\x3d\42\167\x33\x2d\x66\x6f\156\x64\157\144\x72\x6f\151\144\x22\x3e\74\164\150\76\x49\144\x3c\x2f\x74\150\76\x3c\164\x68\x3e\x4e\x6f\155\142\162\145\x3c\x2f\164\150\x3e\74\x74\x68\76\x43\145\144\x75\154\141\74\57\164\150\76\74\x74\x68\76\124\145\154\145\146\x6f\156\x6f\74\57\164\150\76\x3c\164\x68\x3e\101\120\120\x3c\57\x74\150\76\x3c\164\150\76\125\163\165\141\162\151\157\74\x2f\164\150\x3e\x3c\x74\150\76\103\154\x61\x76\x65\x3c\57\x74\150\x3e\74\164\x68\x3e\x43\141\162\147\157\x3c\57\164\150\x3e\74\x2f\x74\162\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $cargo = ''; if ($dtfac->tip == 1) { $cargo = "\103\150\x6f\146\x65\162"; } elseif ($dtfac->tip == 0) { $cargo = "\x49\x6e\141\x63\164\151\166\x6f"; } elseif ($dtfac->tip == 2) { $cargo = "\x41\144\x6d\x69\x6e"; } elseif ($dtfac->tip == 3) { $cargo = "\x41\154\x6d\x61\x63\145\156"; } elseif ($dtfac->tip == 4) { $cargo = "\106\141\143\164\x75\x72\x61\x63\x69\x6f\156"; } elseif ($dtfac->tip == 5) { $cargo = "\114\x6f\147\151\163\x74\x69\x63\141"; } elseif ($dtfac->tip == 6) { $cargo = "\123\165\x70\x65\x72\x76\x69\x73\x6f\x72\40\x56\145\156\x74\141"; } elseif ($dtfac->tip == 7) { $cargo = "\x56\145\x6e\164\x61\163"; } elseif ($dtfac->tip == 8) { $cargo = "\123\165\160\x65\x72\x76\151\163\157\162\x20\103\x6f\x6d\x70\x72\141"; } elseif ($dtfac->tip == 9) { $cargo = "\103\x6f\155\x70\162\141\163"; } elseif ($dtfac->tip == 10) { $cargo = "\x43\x6f\x62\x72\141\156\x7a\x61"; } elseif ($dtfac->tip == 11) { $cargo = "\105\163\x74\141\144\x69\x73\164\141"; } elseif ($dtfac->tip == 12) { $cargo = "\x52\145\147\145\x6e\x74\145"; } elseif ($dtfac->tip == 13) { $cargo = "\x43\141\x6c\x69\144\141\144"; } elseif ($dtfac->tip == 14) { $cargo = "\103\157\x6e\164\x61\142\151\x6c\151\x64\141\144"; } $html .= "\74\x74\x72\x20\x69\x64\75\x22\x73\154\x65\x63\164" . $i . "\x22\40\x63\x6c\141\x73\163\x3d\42\151\x74\x65\155\42\40\x6f\x6e\x63\x6c\151\x63\153\75\x22\x22\x3e"; $html .= "\74\x69\x6e\x70\x75\164\x20\x74\171\160\x65\75\x22\150\151\144\x64\145\x6e\x22\x20\156\x61\155\x65\x3d\x22\151\x64\x22\40\x76\x61\154\x75\145\x3d\42" . $dtfac->id . "\x22\x3e\74\x69\156\160\165\x74\x20\164\171\x70\x65\x3d\x22\x68\151\x64\x64\x65\x6e\x22\40\156\x61\x6d\145\75\42\x6e\157\x6d\x62\162\145\x22\40\x76\x61\x6c\165\x65\x3d\42" . $dtfac->nomape . "\42\x3e\74\151\x6e\160\165\x74\40\164\x79\160\145\x3d\x22\150\151\x64\x64\145\x6e\42\x20\x6e\141\155\145\x3d\42\143\145\144\165\154\141\x22\40\166\x61\154\165\x65\x3d\42" . $dtfac->cedula . "\42\76\12\40\x20\40\40\40\40\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\74\151\x6e\x70\x75\x74\x20\x74\x79\x70\145\75\42\x68\151\x64\144\x65\156\42\40\x6e\x61\155\145\x3d\42\164\x65\154\x65\146\157\156\157\42\40\x76\x61\x6c\x75\x65\x3d\42" . $dtfac->telefono . "\x22\76\x3c\151\x6e\160\x75\x74\40\164\171\x70\x65\x3d\42\150\151\x64\144\x65\156\x22\x20\x6e\141\x6d\x65\x3d\42\165\x75\151\144\x22\40\166\x61\x6c\x75\x65\x3d\x22" . $dtfac->uuid . "\x22\x3e\x3c\x69\156\160\165\x74\40\164\x79\160\145\x3d\42\150\x69\x64\144\145\x6e\x22\x20\156\141\x6d\145\x3d\42\x75\x73\145\162\x22\x20\166\x61\x6c\x75\145\x3d\x22" . $dtfac->user . "\42\x3e\xa\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\74\x69\x6e\x70\x75\x74\40\164\x79\160\145\75\x22\x68\x69\144\x64\x65\x6e\x22\x20\156\x61\155\145\75\x22\x70\141\x73\163\x22\40\x76\141\154\x75\x65\x3d\x22" . $dtfac->pass . "\x22\x3e\74\151\x6e\160\x75\x74\40\164\171\x70\x65\x3d\x22\150\151\144\x64\x65\156\x22\40\x6e\x61\x6d\145\75\x22\x74\x69\x70\x22\x20\x76\x61\154\165\x65\x3d\42" . $dtfac->tip . "\x22\x3e\xa\x20\40\x20\40\40\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x3c\164\144\x3e\74\151\x6e\x70\x75\164\x20\164\171\160\x65\x3d\42\x63\150\x65\143\x6b\142\x6f\x78\42\40\x6f\x6e\143\x6c\x69\x63\153\75\42\x77\x33\56\x74\157\147\147\x6c\x65\x43\x6c\x61\163\163\x28\47\43\163\154\145\x63\x74" . $i . "\47\x2c\x27\x77\63\x2d\x79\145\154\x6c\x6f\167\x27\51\x3b\42\x20\x63\154\141\x73\x73\x3d\42\167\63\55\x63\x68\145\143\153\x22\x20\156\x61\155\145\x3d\42\x63\150\145\x63\x6b\42\76" . $dtfac->id . "\x20\74\164\x64\x3e" . $dtfac->nomape . "\x3c\x2f\x74\x64\x3e\74\x74\x64\76" . $dtfac->cedula . "\74\57\x74\144\x3e\x20\xa\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x3c\164\144\x3e" . $dtfac->telefono . "\74\x2f\164\x64\76\74\x74\x64\x3e" . $dtfac->uuid . "\74\x2f\164\x64\76\x3c\164\144\x3e" . $dtfac->user . "\74\57\164\x64\76\74\164\x64\x3e" . $dtfac->pass . "\x3c\57\x74\144\x3e\x3c\164\x64\x3e" . $cargo . "\74\57\164\144\x3e\12\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\74\57\x74\162\76"; } $html .= "\74\x74\x72\76\x3c\x74\x64\40\143\154\141\163\x73\75\42\167\x33\55\143\145\156\164\x65\x72\40\x77\63\55\x66\x6f\156\x64\157\x64\162\x6f\x69\x64\42\x20\x63\157\x6c\x73\160\141\x6e\75\x22\66\42\76\x3c\154\x61\x62\145\x6c\40\x63\x6c\x61\163\163\x3d\x22\x77\63\x2d\154\x61\x72\x67\x65\x22\x3e\74\142\76\x54\157\x74\141\154\40\x54\162\141\142\141\152\x61\144\157\x72\x65\x73\x3a\x20" . $totalreg . "\74\x2f\142\76\x3c\57\x6c\141\x62\x65\154\76\74\57\164\x64\x3e\74\57\x74\x72\76\74\x2f\164\x61\x62\x6c\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x3c\x73\x63\x72\x69\x70\164\x20\x74\x79\x70\x65\x3d\x22\x74\145\170\x74\57\x6a\141\x76\141\163\143\x72\151\x70\x74\x22\x3e\12\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\x66\165\x6e\x63\x74\151\157\156\x20\x44\145\143\162\x65\x6d\x65\x6e\164\x4e\165\x6d\x28\51\173\40\142\145\x66\x6f\162\145\50\x29\73\xa\40\x20\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\x20\x20\40\40\x20\166\141\x72\40\x44\x65\143\162\145\x6d\145\156\164\116\165\155\x3d\x64\157\x63\165\155\x65\156\x74\56\147\145\164\x45\154\x65\155\145\156\164\102\x79\x49\144\50\x22\x44\x65\143\162\x65\155\145\156\x74\x4e\165\x6d\42\51\x2e\166\141\154\165\145\x3b\xa\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\40\40\40\40\40\x20\40\40\x20\x20\40\40\40\x20\40\166\141\x72\40\x6c\151\153\x65\75\44\x28\x22\x23\154\x69\153\145\42\51\x2e\x76\141\x6c\x28\x29\x3b\xa\x20\40\40\40\40\40\40\x20\40\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\40\40\40\40\x20\40\x20\40\x76\x61\162\x20\x6b\145\x79\75\x22\x64\x72\157\151\x64\x39\60\x33\x22\73\12\x20\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\166\141\162\x20\144\x61\164\x6f\x73\40\75\x20\x7b\12\40\x20\x20\x20\40\40\40\40\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\40\40\40\40\x20\40\40\42\160\141\147\42\x20\x3a\x20\104\x65\x63\x72\145\x6d\x65\156\164\x4e\x75\x6d\x2c\12\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\x22\x6b\145\171\42\x20\72\40\x6b\x65\171\54\x22\x6c\x69\153\145\x22\x3a\154\x69\153\145\xa\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\x20\175\x3b\12\40\40\40\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\40\40\40\x20\xa\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\40\40\x20\40\x20\40\40\40\40\44\56\141\152\x61\170\x28\173\12\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\144\x61\164\141\72\40\x64\x61\164\157\x73\x2c\12\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\x75\x72\x6c\72\x20\40\142\x61\163\145\165\162\154\53\42\143\x5f\x64\x72\157\151\144\57\164\x72\141\x62\x75\163\x65\x72\x22\x2c\xa\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\40\40\x20\40\40\x20\40\40\40\164\171\x70\145\x3a\40\x22\120\x4f\x53\x54\x22\54\12\x20\40\40\40\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\40\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\163\165\x63\x63\x65\163\x73\x3a\40\146\x75\x6e\143\x74\x69\x6f\156\50\144\141\164\141\x29\x20\x7b\12\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x24\50\x22\x23\x62\x6f\144\171\42\x29\x2e\150\164\x6d\x6c\50\x64\x61\164\141\51\x3b\x20\44\50\x22\43\x6c\x69\x6b\x65\42\x29\x2e\x76\x61\154\50\x6c\x69\153\x65\51\73\40\x73\x77\141\x6c\x2e\143\x6c\157\163\x65\50\x29\xa\x20\40\40\40\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x7d\12\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\xa\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\40\x20\40\40\40\x20\x20\40\40\x20\40\40\40\x7d\x29\73\12\x20\x20\x20\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\175\xa\40\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\xa\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x66\x75\156\x63\x74\x69\x6f\156\40\156\165\x6d\160\141\x67\x28\x61\51\173\x20\x62\145\146\x6f\x72\x65\50\x29\73\xa\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\40\x20\166\x61\x72\40\x6b\x65\171\75\42\144\162\x6f\151\x64\71\x30\63\42\x3b\12\x20\x20\40\x20\40\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x76\141\x72\x20\x6c\x69\x6b\x65\75\x24\50\42\x23\154\x69\153\x65\x22\51\x2e\166\141\154\x28\x29\73\12\40\40\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\166\x61\x72\x20\144\141\x74\x6f\x73\40\x3d\x20\x7b\12\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x22\x6b\x65\x79\42\72\x6b\x65\x79\x2c\xa\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\40\40\x20\40\x20\40\42\160\x61\147\42\x20\72\40\141\54\x6c\x69\153\x65\x3a\x6c\151\x6b\x65\12\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\40\175\73\xa\40\x20\40\40\40\40\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\40\40\40\40\x20\40\x20\x20\40\40\40\x20\xa\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\x20\44\56\x61\152\x61\170\x28\173\12\x20\x20\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\144\x61\164\141\72\40\144\x61\164\x6f\163\x2c\12\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\40\40\x20\x75\162\x6c\72\x20\142\x61\x73\x65\x75\x72\154\x2b\x22\143\137\144\x72\x6f\x69\144\x2f\x74\x72\141\x62\x75\x73\145\162\42\x2c\xa\40\40\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\40\164\x79\160\x65\72\40\x22\120\117\x53\124\42\x2c\12\40\40\40\x20\x20\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\x20\40\40\40\40\40\40\40\x20\40\x20\40\x20\x73\x75\143\x63\145\x73\x73\72\40\x66\165\x6e\143\x74\151\x6f\156\x28\x64\x61\x74\x61\51\x20\x7b\xa\x20\40\40\x20\x20\40\40\40\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x24\50\x22\43\142\x6f\x64\x79\x22\51\56\x68\164\155\x6c\x28\144\141\164\x61\x29\73\40\44\x28\42\x23\x6c\x69\x6b\145\x22\51\56\x76\x61\154\50\x6c\151\x6b\x65\51\73\x20\x73\167\x61\154\x2e\143\x6c\157\x73\x65\50\x29\xa\40\40\x20\x20\40\40\40\40\x20\40\40\x20\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\x7d\12\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\40\12\40\40\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x7d\51\73\xa\x20\x20\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\x7d\xa\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\xa\40\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\40\x20\x20\40\40\x20\40\40\146\x75\156\143\164\151\157\156\40\x49\156\143\162\x69\155\x65\x6e\x74\116\165\x6d\50\51\173\x20\x62\145\x66\157\x72\x65\x28\x29\73\xa\40\40\40\40\40\40\40\40\40\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\166\141\x72\40\111\x6e\143\162\x69\x6d\x65\x6e\164\x4e\x75\155\75\x64\x6f\x63\x75\x6d\145\x6e\x74\56\x67\145\164\x45\154\145\x6d\145\x6e\164\x42\171\x49\144\x28\x22\x49\156\143\162\151\155\x65\x6e\x74\x4e\165\155\42\x29\56\166\141\154\x75\145\x3b\xa\x20\x20\x20\40\40\40\40\40\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\166\141\x72\40\x6b\x65\x79\x3d\x22\x64\162\157\x69\144\x39\60\x33\x22\x3b\40\166\x61\162\x20\x6c\151\x6b\145\75\44\50\42\x23\154\151\x6b\x65\x22\51\56\x76\141\x6c\x28\x29\73\xa\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x76\141\162\40\144\141\x74\157\163\x20\75\x20\x7b\xa\x20\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\40\x20\40\42\153\x65\171\42\x3a\x6b\x65\x79\54\xa\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\x20\x20\40\x22\x70\141\147\42\40\72\x20\x49\x6e\x63\x72\151\x6d\145\x6e\164\116\165\x6d\x2c\154\151\153\x65\x3a\154\151\153\x65\12\x20\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\175\x3b\12\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\40\x20\12\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x24\x2e\141\x6a\x61\x78\x28\x7b\12\40\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\40\144\x61\164\141\x3a\x20\144\x61\164\157\163\54\12\x20\40\x20\40\40\40\x20\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\x75\162\x6c\72\x20\40\142\141\x73\145\x75\162\154\x2b\x22\143\137\x64\162\x6f\151\x64\x2f\x74\162\x61\x62\x75\x73\x65\x72\x22\54\xa\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x74\171\160\145\x3a\40\x22\x50\117\x53\x54\x22\x2c\xa\x20\x20\x20\40\40\x20\40\40\40\40\x20\40\x20\40\40\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x73\165\143\143\145\163\163\x3a\x20\146\x75\156\x63\x74\x69\x6f\156\x28\x64\141\x74\x61\x29\40\173\xa\x20\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\40\40\x24\x28\42\x23\142\x6f\x64\x79\x22\x29\x2e\x68\164\x6d\x6c\x28\144\141\164\141\x29\x3b\x20\x24\50\42\43\154\x69\153\145\42\x29\x2e\x76\x61\154\50\x6c\x69\x6b\145\51\73\40\x73\x77\141\x6c\x2e\x63\x6c\x6f\163\x65\50\51\xa\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\40\40\x20\x20\175\12\40\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\12\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\51\x3b\xa\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\40\40\x20\175\xa\40\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\40\x3c\x2f\x73\x63\x72\x69\160\164\x3e\xa\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\x20\74\144\x69\166\x20\x63\154\141\x73\163\75\42\x77\63\x2d\142\x61\162\40\x77\x33\x2d\x62\x6f\162\x64\x65\162\40\x77\63\55\142\141\162\x72\x61\x73\x22\76\12\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\40\x20\40\40\40\x20\40\40\40\x3c\151\156\x70\165\x74\40\x74\x79\160\145\75\x22\150\x69\144\x64\145\156\x22\40\151\144\75\x22\x44\x65\x63\162\x65\x6d\145\x6e\164\x4e\x75\x6d\42\40\x76\x61\154\x75\145\75\x22" . $DecrementNum . "\42\x3e\xa\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x3c\141\x20\157\x6e\143\154\151\143\x6b\x3d\42\x44\145\143\162\145\155\145\x6e\x74\x4e\x75\155\x28\x29\x3b\42\x20\x63\154\141\163\x73\75\42\167\63\55\142\141\x72\55\151\x74\145\x6d\40\167\x33\55\x62\x75\x74\164\x6f\x6e\x22\76\x26\154\x61\x71\165\x6f\x3b\74\x2f\141\x3e"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\x61\x67\151\156\x61" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\x77\x33\x2d\x66\x6f\156\x64\157\x64\x72\157\x69\x64"; $html .= "\xa\40\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\40\x20\x20\x3c\151\156\x70\165\x74\x20\x74\x79\160\x65\75\x22\x68\151\x64\144\145\x6e\x22\x20\x69\144\75\42" . $id . "\42\40\166\x61\x6c\165\x65\x3d\42" . $i . "\x22\76\xa\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\74\x61\40\157\156\x63\154\x69\x63\x6b\x3d\x22\x6e\x75\x6d\x70\x61\147\50\44\x28\47\43" . $id . "\47\x29\x2e\x76\141\154\x28\x29\x29\x3b\42\x20\x63\154\x61\163\x73\75\42\x77\63\x2d\142\141\162\55\x69\x74\145\155\x20\x77\63\55\x62\165\164\x74\x6f\156\x20" . $hover . "\42\x3e" . $i . "\74\57\x61\76"; } else { $hover = ''; $html .= "\74\x69\156\160\x75\164\40\164\171\x70\x65\x3d\42\x68\x69\x64\x64\145\156\42\x20\x69\144\75\x22" . $id . "\x22\x20\x76\x61\154\x75\145\75\42" . $i . "\x22\76\xa\40\40\x20\x20\40\40\40\40\40\x20\40\x20\40\x20\40\40\40\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x3c\141\40\157\x6e\x63\154\x69\x63\x6b\x3d\x22\156\x75\x6d\x70\141\x67\50\44\50\x27\x23" . $id . "\x27\x29\x2e\x76\141\154\x28\51\51\73\x22\x20\143\154\x61\x73\163\x3d\x22\167\63\x2d\x62\x61\162\55\151\x74\x65\x6d\40\x77\x33\x2d\142\x75\x74\164\x6f\156\x20" . $hover . "\x22\76" . $i . "\x3c\57\x61\x3e"; } } } $html .= "\x3c\x69\x6e\160\x75\x74\x20\164\171\x70\145\x3d\x22\x68\x69\144\x64\x65\x6e\42\40\x69\144\75\42\x49\156\143\162\x69\155\x65\x6e\x74\x4e\165\x6d\x22\40\166\x61\x6c\x75\145\75\x22" . $IncrimentNum . "\x22\76\12\40\x20\40\40\40\40\40\40\40\40\40\40\x20\40\40\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\x3c\141\40\157\x6e\143\154\151\x63\x6b\75\x22\111\156\x63\162\x69\155\145\x6e\164\116\165\x6d\50\x29\73\42\x20\x63\154\141\x73\163\75\x22\167\x33\55\142\141\162\x2d\x69\x74\x65\x6d\x20\x77\x33\55\142\x75\x74\x74\x6f\x6e\42\76\46\x72\141\x71\x75\157\73\74\57\141\x3e\xa\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\xa\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\74\57\144\x69\166\x3e\x20"; return $html; } public function regtrab($ci, $nom, $telf, $tip, $user, $pass) { $trab = array("\143\145\144\x75\x6c\141" => $ci, "\x6e\157\155\141\160\145" => $nom, "\164\145\154\x65\146\157\x6e\x6f" => $telf, "\164\151\x70" => $tip); $this->db->insert("\164\x72\141\x62", $trab); $id = $this->db->query("\123\105\114\x45\x43\x54\40\115\101\130\50\x69\144\x29\40\x6e\x20\106\122\x4f\115\x20\x74\162\141\142")->row(); $trabdroid = array("\x69\144\137\164\x72\141\x62" => $id->n, "\165\x73\145\162" => $user, "\x70\x61\x73\x73" => $pass, "\x74\x69\x70" => $tip); $this->db->insert("\x74\x72\x61\x62\144\162\x6f\x69\144", $trabdroid); return $this->db->affected_rows(); } public function edittrab($id, $ci, $nom, $telf, $uuid, $tip, $user, $pass) { $trabdroid = array("\165\163\145\x72" => $user, "\x70\141\163\163" => $pass, "\x74\x69\x70" => $tip); $i = 0; $this->db->where("\151\x64\x5f\164\162\141\142", $id)->update("\164\162\x61\x62\x64\x72\157\151\144", $trabdroid); if ($this->db->affected_rows() == 0) { $val = $this->db->query("\123\105\114\105\103\x54\40\x4e\125\x4c\114\x20\106\122\x4f\115\x20\164\x72\x61\x62\144\162\x6f\x69\144\40\127\110\105\x52\x45\x20\151\144\137\x74\162\141\x62\x3d\x27{$id}\47")->num_rows(); if ($user != '' && $pass != '' && $val == 0) { $i++; $trabdroid2 = array("\151\144\x5f\164\162\x61\x62" => $id, "\x75\x73\145\x72" => $user, "\160\141\163\163" => $pass, "\164\151\160" => $tip); $this->db->insert("\164\162\141\x62\144\162\x6f\x69\144", $trabdroid2); } } else { $i++; } $trab = array("\x63\145\x64\165\154\141" => $ci, "\156\157\x6d\141\160\x65" => $nom, "\164\145\154\x65\146\157\156\x6f" => $telf, "\165\x75\151\x64" => $uuid, "\x74\x69\x70" => $tip); $this->db->where("\x69\x64", $id)->update("\164\162\x61\x62", $trab); if ($this->db->affected_rows() > 0) { $i++; } return $i; } public function vehi($a, $b) { $this->load->library("\164\141\142\154\145"); if ($b != '') { $filter = "\127\x48\105\x52\105\40\141\56\x6e\x6f\155\141\160\x65\40\x6c\x69\x6b\145\x20\47\x25{$b}\45\x27"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\x53\x45\114\105\x43\124\40\116\125\114\x4c\x20\106\x52\x4f\115\x20\166\x65\x68\x69\x63")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\105\114\x45\103\124\x20\52\x20\x46\122\x4f\115\x20\x76\x65\150\x69\x63\x20\x4c\111\x4d\111\124\40" . ($a - 1) * $mostrar . "\x20\x2c\x20" . $mostrar . "\x20")->result(); $html = "\xa\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\74\164\x61\142\154\x65\x20\x63\x6c\141\163\x73\75\42\167\x33\x2d\x74\x61\142\x6c\145\55\x61\x6c\154\x20\167\63\x2d\150\x6f\x76\x65\x72\x61\142\x6c\145\40\167\63\x2d\154\x65\146\164\55\x61\154\x69\x67\x6e\x22\76\12\40\x20\x20\x20\40\40\40\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\74\164\x72\76\74\164\x64\40\143\154\141\x73\x73\x3d\42\x77\63\x2d\x66\157\x6e\x64\157\144\x72\157\x69\x64\x22\x3e\x42\x75\163\143\x61\162\x20\x3c\151\x6d\x67\40\x73\x72\143\75\42" . base_url() . "\151\155\141\x67\x65\163\57\x62\x75\x73\143\x61\x72\x2e\160\x6e\147\x22\40\141\x6c\164\75\x22\102\x75\163\143\141\x72\42\x20\164\x69\164\154\x65\75\42\x42\x75\163\143\141\162\x22\x20\x73\x74\x79\154\x65\x3d\x22\167\151\144\x74\150\72\x31\x38\x70\170\x3b\x62\x6f\162\x64\145\x72\72\60\73\42\x3e\x3c\x2f\164\144\x3e\12\40\40\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x3c\x74\x64\x3e\x3c\x69\156\160\165\x74\x20\x74\171\160\145\75\42\164\x65\x78\164\x22\x20\143\154\x61\x73\163\x3d\42\x77\63\55\151\156\x70\x75\x74\42\40\160\154\x61\143\145\150\157\154\144\x65\x72\x3d\x22\111\x6e\x67\162\145\163\145\40\163\165\40\x62\165\163\x71\165\145\x64\141\x22\x20\x6f\x6e\143\150\x61\x6e\x67\x65\75\x22\166\145\150\x69\x28\x29\x22\x20\151\x64\75\x22\x6c\151\x6b\x65\x22\76\74\57\164\x64\76\xa\x20\40\40\40\40\x20\40\40\x20\40\40\40\x20\x20\40\40\40\40\x20\40\74\x74\x64\40\x63\154\x61\x73\163\x3d\42\x77\63\x2d\143\x65\156\x74\x65\162\x20\167\63\x2d\142\164\156\42\x3e\74\141\40\x6f\x6e\x63\x6c\151\x63\x6b\75\x22\162\x65\x67\166\145\x68\151\x28\51\x3b\42\76\x3c\151\x6d\147\x20\163\162\143\75\x22" . base_url() . "\x69\x6d\141\147\145\163\x2f\162\x65\147\151\x73\164\162\141\162\56\x70\x6e\x67\x22\40\x61\154\x74\x3d\x22\122\145\x67\x69\x73\164\162\141\162\42\x20\164\x69\164\x6c\x65\75\x22\x52\x65\147\151\x73\x74\162\141\x72\x22\x20\163\164\x79\154\145\x3d\x22\167\151\x64\x74\x68\x3a\62\x30\x70\x78\x3b\150\145\x69\147\150\164\72\x32\x30\x70\x78\x3b\142\x6f\x72\x64\145\162\72\x30\x3b\x22\76\x3c\57\141\x3e\74\57\164\x64\76\xa\x20\40\40\40\x20\x20\40\40\40\40\40\40\x20\x20\40\40\40\x20\40\x20\74\164\144\40\143\154\x61\163\x73\75\x22\x77\x33\55\143\x65\x6e\164\145\x72\40\x77\63\x2d\x62\x74\156\x22\x3e\74\x61\40\x6f\x6e\x63\154\151\x63\153\75\42\145\x64\x69\x74\166\x65\150\151\50\51\73\42\x3e\74\151\x6d\147\x20\x73\x72\x63\75\x22" . base_url() . "\x69\x6d\x61\147\x65\x73\x2f\x65\x64\x69\x74\141\162\56\x70\156\x67\x22\x20\141\x6c\164\75\x22\x45\x64\x69\x74\x61\162\42\x20\164\x69\x74\154\145\75\x22\x45\x64\x69\164\141\162\x22\x20\x73\x74\171\x6c\x65\x3d\x22\167\x69\x64\x74\x68\x3a\62\60\160\x78\73\150\x65\151\147\150\x74\72\62\x30\160\x78\x3b\142\157\162\144\x65\x72\x3a\60\x3b\x22\76\74\57\141\76\x3c\x2f\164\144\x3e\12\x20\x20\40\40\40\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\74\164\144\x20\143\x6c\x61\163\163\x3d\42\167\63\55\143\x65\156\164\145\162\x20\167\x33\55\x62\x74\x6e\42\x3e\x3c\141\40\x6f\156\143\x6c\x69\x63\x6b\x3d\42\x76\145\150\151\x28\x29\73\x22\x3e\x3c\151\x6d\x67\40\163\x72\143\x3d\x22" . base_url() . "\x69\155\141\x67\x65\163\57\162\145\x6c\157\141\x64\x2e\x70\x6e\147\x22\40\x61\154\164\75\42\x52\145\143\141\162\x67\x61\162\42\x20\x74\x69\x74\x6c\x65\x3d\42\122\145\143\x61\x72\147\x61\x72\x22\40\163\164\171\154\x65\x3d\42\x77\x69\x64\x74\x68\72\62\60\x70\170\x3b\x68\145\x69\x67\150\164\x3a\62\x30\160\x78\x3b\x62\x6f\x72\x64\145\x72\72\x30\x3b\42\x3e\74\57\141\76\x3c\x2f\164\x64\76\x3c\x2f\x74\162\x3e\xa\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\40\x20\x3c\57\164\141\142\154\145\76\x3c\142\x72\76\xa\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\40\40\x20\x3c\x74\141\x62\154\x65\40\x69\144\75\42\x69\144\x30\x31\x22\x20\x63\x6c\141\163\163\75\42\167\x33\x2d\164\x61\142\x6c\145\55\x61\154\x6c\x20\167\x33\x2d\x68\x6f\166\145\162\x61\x62\154\x65\x20\x77\63\x2d\x6c\145\x66\x74\55\141\x6c\151\x67\x6e\40\x77\x33\55\164\x69\156\x79\x22\x3e\x3c\x74\162\x20\143\x6c\x61\163\163\x3d\x22\x77\x33\x2d\x66\157\156\x64\x6f\x64\162\x6f\151\x64\x22\x3e\74\164\x68\x3e\x49\144\74\57\x74\x68\x3e\74\x74\x68\x3e\120\154\x61\143\x61\74\57\x74\150\76\x3c\x74\x68\x3e\104\145\163\143\x72\151\x70\x63\151\157\x6e\74\x2f\x74\150\x3e\74\164\x68\76\115\x61\162\x63\x61\x3c\57\x74\150\x3e\x3c\x74\x68\76\x4d\157\x64\145\154\x6f\x3c\57\164\x68\x3e\74\164\150\76\x45\163\164\141\164\x75\163\74\x2f\x74\150\76\74\57\164\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $cargo = ''; if ($dtfac->status == "\x53") { $status = "\101\143\x74\151\x76\157"; $color = "\143\154\x61\163\163\x3d\42\x77\x33\x2d\x67\162\145\x65\156\42"; } elseif ($dtfac->status == "\116") { $status = "\x49\156\141\143\164\151\x76\x6f"; $color = "\143\x6c\x61\163\163\75\42\x77\63\x2d\162\x65\x64\42"; } $html .= "\x3c\x74\x72\40\x69\x64\x3d\42\163\x6c\145\x63\164" . $i . "\42\40\143\154\141\x73\163\75\x22\x69\x74\x65\x6d\42\40\157\156\x63\154\x69\143\x6b\x3d\x22\x22\76"; $html .= "\74\151\156\x70\x75\x74\40\164\171\x70\145\x3d\x22\x68\151\144\x64\x65\x6e\42\x20\x6e\141\x6d\145\x3d\x22\x69\x64\x22\40\166\x61\154\165\x65\x3d\x22" . $dtfac->id . "\42\76\74\151\x6e\160\x75\164\x20\164\x79\160\x65\x3d\x22\150\x69\x64\x64\145\156\42\x20\x6e\x61\155\145\75\x22\160\154\141\x63\x61\x22\x20\x76\141\x6c\165\x65\x3d\42" . $dtfac->placa . "\42\x3e\x3c\151\156\x70\165\164\x20\164\x79\x70\145\75\x22\150\x69\x64\x64\145\x6e\42\x20\156\141\x6d\x65\x3d\42\144\145\x73\x63\162\151\160\42\x20\166\x61\154\x75\145\75\42" . $dtfac->descrip . "\x22\x3e\12\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\74\x69\x6e\160\x75\x74\40\x74\171\x70\145\75\x22\x68\x69\144\x64\145\156\42\x20\x6e\141\x6d\145\75\42\x6d\x61\x72\143\141\42\x20\x76\141\154\x75\145\75\42" . $dtfac->marca . "\42\x3e\74\151\156\160\165\x74\40\164\x79\x70\145\75\x22\x68\151\x64\x64\145\156\42\x20\x6e\141\155\x65\75\x22\x6d\x6f\144\x65\x6c\x6f\42\x20\166\x61\x6c\x75\145\x3d\x22" . $dtfac->modelo . "\x22\x3e\x3c\x69\x6e\x70\165\164\x20\x74\171\x70\x65\75\42\x68\x69\144\x64\x65\156\x22\40\156\x61\x6d\145\x3d\42\163\x74\x61\x74\x75\163\x22\x20\x76\141\154\165\145\75\x22" . $dtfac->status . "\42\76\12\40\40\40\x20\40\x20\40\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x3c\164\x64\76\x3c\151\156\160\165\164\x20\164\x79\160\x65\75\42\143\x68\x65\143\x6b\x62\157\x78\x22\40\157\x6e\x63\154\151\x63\153\x3d\x22\x77\x33\56\164\x6f\147\x67\x6c\145\103\154\141\x73\163\50\47\x23\163\154\145\x63\x74" . $i . "\x27\54\47\167\x33\x2d\171\x65\x6c\154\157\167\x27\x29\x3b\x22\40\x63\154\x61\163\163\75\x22\x77\63\x2d\x63\x68\x65\x63\x6b\x22\x20\x6e\141\155\145\x3d\42\143\x68\145\143\x6b\x22\76" . $dtfac->id . "\40\74\164\x64\76" . $dtfac->placa . "\x3c\57\x74\x64\x3e\74\164\x64\x3e" . $dtfac->descrip . "\x3c\x2f\x74\144\76\x20\xa\x20\40\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\x3c\164\144\76" . $dtfac->marca . "\x3c\57\164\144\x3e\x3c\164\x64\76" . $dtfac->modelo . "\74\57\x74\144\x3e\74\164\x64\40" . $color . "\76" . $status . "\x3c\57\x74\x64\x3e\xa\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\40\40\x3c\x2f\x74\162\76"; } $html .= "\74\x74\162\76\74\164\144\x20\143\154\141\163\163\x3d\42\167\63\55\x63\145\156\x74\145\x72\x20\x77\x33\55\x66\157\156\144\x6f\144\162\157\151\144\42\x20\x63\157\154\163\x70\141\156\x3d\42\66\x22\76\x3c\x6c\141\142\145\x6c\x20\x63\x6c\141\163\163\75\x22\x77\x33\55\x6c\x61\x72\147\x65\x22\x3e\x3c\x62\76\x54\x6f\x74\141\x6c\x20\126\x65\150\151\143\x75\154\x6f\x73\72\40" . $totalreg . "\x3c\57\x62\76\x3c\x2f\154\141\x62\x65\x6c\x3e\x3c\x2f\x74\x64\76\74\x2f\x74\162\76\74\x2f\x74\141\142\x6c\145\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\74\163\143\162\x69\160\x74\x20\164\x79\160\x65\75\x22\164\145\x78\164\57\152\x61\166\141\163\143\162\x69\x70\164\42\76\xa\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\40\x66\x75\x6e\143\164\x69\x6f\156\40\x44\145\143\x72\x65\155\x65\156\164\116\165\x6d\50\x29\x7b\40\x62\145\x66\x6f\x72\x65\50\51\x3b\12\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x76\x61\x72\40\104\145\143\162\x65\155\x65\x6e\x74\x4e\x75\x6d\75\144\157\x63\x75\155\x65\x6e\x74\x2e\147\x65\x74\x45\x6c\145\x6d\x65\x6e\164\x42\x79\111\144\50\x22\104\x65\x63\162\145\x6d\x65\156\x74\x4e\165\155\x22\x29\56\x76\x61\x6c\x75\145\73\12\40\x20\40\x20\x20\40\x20\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\40\40\40\x76\141\x72\40\154\151\x6b\145\75\44\50\x22\x23\154\151\x6b\145\42\x29\56\166\x61\154\x28\51\73\xa\40\x20\x20\40\x20\40\40\x20\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\40\40\x20\x76\141\162\40\x6b\x65\171\x3d\x22\144\x72\157\x69\144\x39\x30\x33\42\x3b\xa\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\x20\40\40\x20\x20\x76\141\x72\x20\144\141\164\x6f\163\40\x3d\x20\173\xa\40\40\40\x20\x20\x20\40\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\42\x70\141\x67\x22\x20\72\x20\x44\145\x63\162\145\155\x65\x6e\164\116\165\155\x2c\xa\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x22\x6b\145\x79\42\x20\x3a\40\x6b\x65\x79\x2c\x22\154\151\x6b\x65\42\72\154\x69\x6b\x65\xa\40\x20\40\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\x7d\73\xa\40\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\xa\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\40\40\40\40\40\40\40\40\40\x20\x20\x20\40\40\40\44\x2e\x61\152\141\170\50\173\xa\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\40\40\40\40\x20\40\40\40\x20\40\40\40\40\x20\40\40\x20\40\40\x20\144\x61\x74\x61\x3a\x20\144\x61\164\x6f\x73\x2c\xa\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\165\x72\154\x3a\40\x20\x62\x61\x73\145\165\162\x6c\x2b\x22\x63\x5f\144\162\157\x69\x64\57\166\151\145\167\x76\145\150\151\x22\54\12\40\40\40\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x74\x79\x70\145\72\40\42\x50\x4f\123\x54\42\x2c\xa\40\40\x20\40\40\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x73\x75\143\x63\145\163\163\72\40\x66\x75\156\x63\164\x69\x6f\156\x28\x64\141\x74\141\51\40\173\xa\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\40\40\44\x28\x22\x23\x62\157\144\171\42\x29\x2e\150\164\155\154\x28\144\141\x74\x61\x29\x3b\40\x24\x28\42\x23\x6c\151\153\x65\x22\x29\x2e\166\141\x6c\x28\x6c\x69\x6b\145\51\73\40\163\x77\141\154\56\x63\x6c\157\x73\x65\50\51\xa\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\x20\40\40\x7d\xa\40\x20\40\40\40\40\40\40\40\40\x20\40\x20\40\40\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\12\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\175\51\x3b\12\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\x20\40\x7d\xa\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\x20\40\12\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\40\x20\146\165\x6e\143\x74\x69\157\156\x20\156\x75\155\x70\141\x67\50\x61\x29\173\40\x62\145\x66\x6f\162\x65\x28\51\73\xa\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\166\x61\x72\40\x6b\x65\171\75\x22\x64\x72\157\151\x64\71\60\x33\42\73\12\40\40\x20\40\40\40\40\40\x20\x20\40\40\40\x20\40\40\x20\40\40\40\40\40\40\x20\40\40\40\x20\x76\141\x72\40\154\151\153\145\75\x24\50\42\43\154\151\x6b\145\42\51\56\166\x61\154\x28\51\x3b\12\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\40\166\x61\162\x20\144\141\164\x6f\163\x20\75\40\173\12\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\42\153\145\171\x22\x3a\153\x65\171\x2c\12\40\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\42\160\x61\x67\42\40\72\x20\141\x2c\x6c\151\153\145\x3a\x6c\151\x6b\145\xa\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x7d\73\xa\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\40\40\xa\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\40\40\40\40\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\x24\x2e\141\152\141\170\x28\x7b\xa\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\x64\141\x74\x61\x3a\40\x64\x61\164\x6f\163\x2c\12\40\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x75\162\x6c\x3a\x20\x62\141\x73\x65\x75\x72\154\53\42\143\x5f\x64\x72\157\x69\x64\57\166\151\145\167\166\145\150\x69\42\54\xa\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\164\x79\160\145\72\x20\42\x50\117\x53\124\42\54\12\x20\x20\x20\40\40\40\40\40\40\x20\40\40\40\40\x20\40\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\163\x75\143\143\x65\163\x73\x3a\x20\146\165\x6e\x63\164\151\x6f\156\x28\144\x61\164\x61\x29\x20\x7b\xa\x20\x20\40\x20\40\40\x20\40\40\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\44\x28\x22\43\142\157\x64\x79\42\x29\56\150\164\155\154\x28\x64\141\164\x61\x29\x3b\x20\x24\x28\42\x23\x6c\x69\153\145\42\x29\x2e\x76\141\154\x28\154\x69\153\x65\x29\73\40\163\x77\x61\154\56\x63\x6c\x6f\163\x65\50\51\12\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\175\xa\40\40\x20\40\40\40\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\12\40\40\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x7d\51\73\12\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\175\12\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\xa\40\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\146\x75\156\143\164\151\x6f\156\x20\x49\x6e\x63\x72\x69\x6d\x65\156\x74\116\x75\155\x28\x29\173\x20\142\145\146\x6f\162\x65\x28\x29\73\12\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\40\166\141\x72\40\111\156\143\162\151\x6d\145\x6e\x74\x4e\x75\155\x3d\144\x6f\143\x75\x6d\x65\x6e\x74\x2e\x67\x65\x74\x45\x6c\145\x6d\145\156\x74\102\x79\111\x64\50\42\111\156\x63\x72\151\x6d\145\156\x74\116\165\155\42\51\56\x76\x61\154\165\145\x3b\12\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\x20\40\166\x61\162\40\153\145\171\75\x22\144\x72\x6f\151\144\71\60\63\x22\x3b\40\166\x61\162\40\x6c\151\x6b\145\x3d\x24\x28\42\x23\154\151\153\x65\42\51\56\x76\x61\154\x28\51\x3b\xa\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\40\40\x20\x76\x61\162\x20\x64\141\x74\157\163\40\x3d\x20\173\xa\40\40\40\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x22\x6b\145\x79\42\x3a\x6b\x65\171\54\12\x20\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\42\160\141\x67\42\40\x3a\x20\x49\156\x63\162\x69\155\x65\x6e\164\x4e\x75\155\54\x6c\151\x6b\x65\x3a\x6c\x69\x6b\x65\12\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x7d\x3b\xa\40\x20\40\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\40\xa\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\40\x20\40\44\56\141\152\x61\x78\50\x7b\12\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\x20\x64\x61\x74\141\x3a\40\x64\141\x74\157\x73\x2c\12\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\40\165\162\x6c\72\x20\40\x62\141\163\x65\x75\x72\154\53\42\143\x5f\144\x72\157\x69\144\57\166\151\x65\167\x76\145\150\151\x22\x2c\12\x20\x20\40\x20\x20\x20\40\40\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x74\171\x70\145\72\x20\x22\x50\117\123\124\42\x2c\12\40\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\163\165\x63\x63\145\x73\x73\x3a\x20\146\x75\156\x63\164\151\x6f\156\50\144\141\164\141\51\x20\x7b\12\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\44\x28\x22\43\142\x6f\x64\x79\x22\51\56\150\164\x6d\x6c\x28\144\141\x74\141\51\x3b\x20\x24\50\x22\x23\154\x69\153\145\x22\x29\56\x76\141\x6c\x28\x6c\151\x6b\x65\x29\73\40\x73\x77\x61\x6c\56\x63\x6c\x6f\x73\x65\x28\51\xa\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\175\12\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\40\40\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\40\x20\12\x20\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\175\51\x3b\xa\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\40\40\40\40\40\40\x20\40\40\40\40\40\x20\x20\x20\175\xa\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\40\x20\x3c\x2f\x73\x63\x72\x69\160\164\76\12\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\40\40\40\x3c\x64\151\x76\x20\143\154\141\163\x73\75\x22\167\x33\55\x62\141\x72\40\x77\x33\55\142\157\x72\x64\x65\x72\40\x77\63\55\142\141\162\162\141\x73\x22\76\xa\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x3c\151\x6e\x70\165\x74\x20\x74\x79\160\x65\x3d\x22\x68\151\x64\144\x65\x6e\42\x20\151\144\x3d\42\x44\x65\x63\x72\x65\155\145\x6e\x74\116\165\x6d\x22\40\x76\141\154\x75\x65\75\x22" . $DecrementNum . "\x22\76\12\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\74\x61\x20\x6f\x6e\x63\x6c\x69\x63\153\75\42\104\x65\143\x72\145\x6d\145\x6e\x74\116\x75\155\50\x29\x3b\x22\40\143\154\x61\x73\x73\x3d\42\x77\x33\55\x62\141\162\55\151\x74\145\x6d\40\167\63\55\142\165\164\164\157\156\x22\x3e\x26\x6c\141\161\165\157\x3b\x3c\57\141\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\x64\x70\141\x67\151\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\x2d\146\x6f\156\144\x6f\x64\162\157\151\x64"; $html .= "\xa\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\40\40\x3c\x69\156\x70\x75\164\x20\x74\171\160\145\75\x22\x68\151\144\x64\x65\x6e\x22\40\x69\x64\x3d\42" . $id . "\x22\x20\x76\x61\154\x75\145\75\x22" . $i . "\42\76\xa\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\40\x20\40\40\40\40\x3c\141\40\157\x6e\143\154\x69\x63\x6b\x3d\42\x6e\x75\155\x70\x61\147\x28\x24\50\47\x23" . $id . "\x27\51\56\x76\x61\154\50\x29\x29\73\42\x20\x63\154\141\163\x73\75\42\167\63\55\142\x61\x72\x2d\x69\164\x65\155\40\x77\x33\55\x62\165\x74\x74\157\156\x20" . $hover . "\42\x3e" . $i . "\x3c\x2f\141\x3e"; } else { $hover = ''; $html .= "\x3c\x69\x6e\160\165\164\40\164\171\160\x65\75\x22\x68\x69\144\x64\145\156\x22\40\x69\144\x3d\x22" . $id . "\x22\40\x76\141\154\165\x65\x3d\42" . $i . "\x22\x3e\xa\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\74\141\40\x6f\x6e\143\154\151\x63\x6b\x3d\42\x6e\165\155\x70\x61\147\50\44\x28\x27\43" . $id . "\x27\x29\56\166\x61\154\50\51\51\73\x22\40\143\x6c\141\163\163\x3d\42\x77\63\55\142\141\x72\x2d\151\x74\145\155\40\167\63\x2d\142\165\164\164\x6f\156\x20" . $hover . "\x22\76" . $i . "\x3c\x2f\x61\76"; } } } $html .= "\74\151\x6e\x70\x75\x74\x20\x74\x79\160\145\75\x22\150\x69\x64\144\x65\156\x22\40\x69\144\75\x22\x49\x6e\x63\x72\x69\155\145\156\x74\x4e\x75\x6d\x22\x20\x76\x61\x6c\165\145\x3d\42" . $IncrimentNum . "\42\x3e\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x3c\x61\40\157\156\143\x6c\x69\x63\x6b\75\x22\x49\x6e\143\x72\151\x6d\x65\156\x74\x4e\165\155\x28\x29\x3b\x22\40\x63\x6c\141\x73\163\75\42\167\x33\55\142\x61\162\55\151\x74\145\x6d\40\x77\x33\x2d\x62\165\x74\164\x6f\156\x22\x3e\x26\x72\141\x71\165\157\x3b\74\57\141\76\12\40\40\40\x20\40\x20\40\x20\x20\40\x20\40\40\40\40\x20\12\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\x3c\57\x64\x69\166\76\x20"; return $html; } public function regvehi($placa, $descrip, $marca, $modelo, $status) { $trab = array("\160\154\x61\x63\x61" => $placa, "\144\x65\163\143\162\151\160" => $descrip, "\x6d\x61\x72\143\x61" => $marca, "\x6d\x6f\x64\x65\x6c\x6f" => $modelo, "\163\x74\x61\164\165\163" => $status); $this->db->insert("\x76\145\150\151\x63", $trab); return $this->db->affected_rows(); } public function editviewvehi($id, $placa, $descrip, $marca, $modelo, $status) { $vehic = array("\x70\x6c\x61\x63\141" => $placa, "\x64\x65\163\x63\x72\x69\x70" => $descrip, "\x6d\x61\162\143\x61" => $marca, "\x6d\157\144\145\x6c\x6f" => $modelo, "\x73\x74\x61\164\x75\163" => $status); $this->db->where("\151\144", $id)->update("\x76\x65\150\x69\143", $vehic); return $this->db->affected_rows(); } public function listvend($a, $b) { $this->load->library("\x74\x61\142\154\145"); if ($b != '') { $filter = "\x57\x48\105\x52\105\x20\50\141\x2e\x63\x6f\x64\151\147\x6f\75\47{$b}\47\40\174\174\40\x61\56\x6e\x6f\155\x62\162\145\x20\154\151\153\145\x20\47\45{$b}\x25\47\x20\174\174\x20\x61\x2e\145\155\x61\151\154\x20\x6c\151\x6b\145\x20\47\45{$b}\45\x27\40\174\x7c\40\141\x2e\143\145\144\x75\154\141\x3d\47\x25{$b}\x25\x27\40\x7c\x7c\40\141\56\164\145\154\x65\x66\x6f\156\157\137\155\157\166\151\x6c\40\x6c\x69\153\145\40\47\45{$b}\45\47\x20\174\x7c\40\x61\x2e\x74\145\x6c\x65\146\157\x6e\157\163\40\x6c\x69\153\x65\40\x27\45{$b}\45\x27\51"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\x4c\x45\x43\x54\40\x4e\125\x4c\x4c\xa\40\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\40\106\122\117\x4d\40\x6c\151\x73\164\x76\145\156\x64\40\x61\40" . $filter . "\40\x47\122\117\125\x50\40\102\131\40\x61\56\143\x6f\144\x69\147\x6f\40\117\x52\104\x45\122\40\x42\131\x20\141\x2e\156\x6f\x6d\142\x72\x65")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\x53\x45\x4c\x45\103\x54\40\x63\x6f\x64\151\x67\x6f\x2c\x6e\x6f\x6d\x62\162\145\x2c\143\x65\144\x75\x6c\141\x2c\x64\x69\x72\x65\143\x63\x69\157\156\54\50\123\105\114\105\103\x54\40\x7a\157\x6e\141\40\x46\x52\x4f\x4d\x20\x73\x65\x63\x74\157\x72\x65\x73\40\x57\110\x45\122\105\40\x63\x6f\x64\151\147\157\x3d\x61\56\163\x65\143\164\x6f\162\51\40\172\x6f\156\x61\54\x28\x53\105\114\x45\x43\124\x20\x73\x75\x62\x73\145\143\x74\x6f\162\40\x46\x52\117\115\40\x73\165\142\x73\x65\x63\x74\x6f\162\145\163\x20\127\x48\105\x52\105\x20\x63\157\144\151\x67\x6f\x3d\x61\56\x73\145\143\164\157\x72\40\46\46\40\x73\165\142\143\157\x64\151\x67\x6f\x3d\x61\x2e\163\165\x62\143\x6f\144\151\x67\157\51\40\x73\x75\x62\172\x6f\x6e\141\xa\x20\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\40\x2c\124\x52\111\x4d\x28\141\x2e\x74\145\x6c\145\x66\157\156\x6f\163\51\40\164\x65\154\x66\x2c\40\x54\x52\111\115\50\141\x2e\164\x65\154\x65\146\x6f\156\157\x5f\155\157\x76\x69\154\51\40\164\x65\x6c\x66\x32\54\141\56\145\155\141\x69\154\54\141\56\163\145\x63\x74\157\162\x2c\x61\x2e\163\165\x62\x63\x6f\144\x69\x67\x6f\x2c\141\x2e\146\x65\143\150\141\12\40\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\106\x52\x4f\115\40\x6c\151\x73\x74\166\x65\x6e\144\40\141\x20" . $filter . "\40\40\x47\x52\x4f\x55\x50\40\102\131\x20\x61\56\143\x6f\x64\151\147\157\x20\x4f\x52\104\105\x52\x20\102\x59\40\141\x2e\x6e\157\x6d\x62\162\145\40\x4c\x49\115\111\124\40" . ($a - 1) * $mostrar . "\40\54\40" . $mostrar . "\x20")->result(); $html = "\xa\40\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\74\x74\x61\142\154\145\40\143\154\x61\x73\163\x3d\x22\x77\x33\x2d\164\141\x62\x6c\x65\x2d\141\154\x6c\40\167\63\x2d\x68\x6f\x76\145\x72\x61\142\x6c\x65\40\167\x33\x2d\x6c\x65\146\164\55\141\154\x69\x67\x6e\42\x3e\12\40\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\74\164\162\x3e\74\x74\x64\x20\x63\x6c\141\x73\x73\x3d\42\167\63\x2d\x66\157\156\144\x6f\144\x72\x6f\x69\x64\42\76\102\165\163\x63\x61\x72\40\74\x69\155\147\40\x73\x72\x63\x3d\x22" . base_url() . "\x69\x6d\x61\147\x65\163\57\x62\x75\x73\x63\141\x72\56\x70\x6e\x67\42\40\141\154\x74\x3d\x22\102\165\163\x63\x61\162\x22\40\164\151\164\154\x65\75\x22\x42\x75\x73\143\141\x72\42\x20\163\x74\171\154\145\x3d\42\x77\x69\x64\x74\x68\72\x31\70\x70\170\73\142\x6f\x72\144\145\162\72\60\x3b\42\x3e\74\57\164\x64\76\12\x20\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x3c\x74\x64\76\x3c\x69\x6e\x70\165\x74\40\x74\171\x70\145\x3d\42\x74\145\170\x74\42\40\143\x6c\x61\x73\163\75\42\167\x33\55\x69\156\160\x75\164\x22\x20\160\154\141\143\145\150\x6f\x6c\x64\145\x72\75\x22\111\156\x67\162\145\163\x65\x20\x73\165\x20\142\x75\163\161\x75\145\144\141\x22\x20\x6f\156\x63\150\141\x6e\147\x65\x3d\42\x6c\151\163\x74\x76\145\x6e\x64\x28\51\x22\40\x69\x64\x3d\42\x6c\x69\x6b\x65\x22\76\x3c\x2f\x74\144\76\12\x20\x20\40\x20\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\x3c\164\x64\40\143\154\x61\163\x73\75\42\x77\63\x2d\x63\145\x6e\164\145\x72\40\167\63\x2d\x62\x74\156\42\76\74\141\x20\x6f\156\143\154\151\x63\x6b\x3d\42\x72\145\x67\x76\145\156\x64\50\51\73\42\76\x3c\151\155\x67\40\163\x72\143\x3d\x22" . base_url() . "\151\x6d\141\147\x65\x73\x2f\x72\145\x67\151\x73\x74\x72\141\162\x2e\160\x6e\147\x22\x20\x61\x6c\x74\x3d\42\122\x65\147\x69\x73\164\162\141\162\x20\126\x65\156\144\145\144\x6f\x72\x65\x73\42\40\x74\x69\x74\x6c\x65\75\42\122\x65\147\x69\163\x74\162\x61\162\x20\x56\x65\x6e\144\145\144\x6f\162\x65\163\42\40\163\164\x79\154\145\75\x22\167\151\144\164\x68\72\62\x30\160\170\x3b\150\145\x69\x67\x68\x74\72\62\x30\x70\x78\x3b\x62\x6f\162\x64\x65\x72\x3a\x30\x3b\x22\76\x3c\x2f\141\x3e\x3c\57\x74\x64\x3e\xa\x20\40\40\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\40\40\x3c\164\x64\x20\x63\154\141\163\163\75\x22\167\63\x2d\143\x65\156\164\x65\x72\40\x77\x33\x2d\x62\x74\x6e\42\x3e\74\141\40\157\x6e\x63\x6c\x69\x63\x6b\75\x22\x65\x78\x70\x6f\x72\164\145\170\x63\x65\x6c\166\145\x6e\144\50\x29\x3b\x22\x3e\74\151\x6d\147\40\163\x72\143\x3d\42" . base_url() . "\151\x6d\x61\147\x65\x73\x2f\x78\154\163\56\160\156\x67\x22\40\x61\x6c\x74\x3d\x22\x45\x78\x70\157\x72\x74\40\x4c\x69\x73\x74\x22\x20\164\x69\x74\154\145\75\42\105\x78\160\x6f\x72\164\40\114\151\163\x74\42\x20\x73\x74\x79\x6c\145\75\x22\x77\x69\144\x74\150\x3a\x32\x30\160\x78\73\150\145\x69\x67\x68\x74\72\x32\x30\x70\170\73\142\x6f\x72\144\x65\162\72\60\x3b\42\x3e\x3c\x2f\141\76\x3c\57\x74\144\76\xa\40\40\40\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x3c\164\144\40\x63\154\141\x73\x73\x3d\42\167\x33\55\143\x65\x6e\x74\x65\162\40\167\63\x2d\142\164\x6e\x22\76\x3c\x61\x20\x6f\x6e\143\154\151\x63\153\x3d\42\145\x64\151\x74\x76\x65\156\x64\50\51\73\42\76\x3c\x69\x6d\x67\40\x73\162\x63\75\x22" . base_url() . "\151\155\141\x67\x65\x73\x2f\x65\x64\x69\164\141\x72\56\x70\x6e\x67\x22\40\141\x6c\164\75\42\x45\x64\151\x74\x61\162\40\126\145\x6e\x64\x22\40\164\x69\x74\154\145\x3d\x22\105\x64\151\164\141\162\x20\126\145\x6e\x64\42\x20\163\164\171\x6c\145\75\x22\x77\x69\x64\x74\x68\72\62\60\x70\170\x3b\x68\145\x69\x67\150\164\72\62\x30\x70\170\73\142\157\162\144\x65\x72\72\60\73\42\76\x3c\x2f\141\x3e\74\x2f\x74\x64\76\12\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\74\x74\x64\40\143\154\141\163\163\75\42\167\63\x2d\143\x65\x6e\164\145\162\x20\167\x33\x2d\142\x74\x6e\42\x3e\74\x61\x20\x6f\x6e\x63\x6c\151\x63\153\75\x22\x6c\x69\x73\x74\x76\x65\156\x64\50\x29\73\42\76\74\151\155\147\x20\x73\162\x63\75\x22" . base_url() . "\151\x6d\141\147\x65\163\57\162\x65\x6c\157\x61\144\56\x70\156\147\42\40\141\x6c\x74\x3d\42\122\145\143\141\x72\147\141\162\x22\x20\x74\x69\164\x6c\x65\x3d\42\x52\145\x63\141\162\x67\141\162\42\x20\163\164\x79\x6c\x65\75\42\167\151\x64\x74\150\x3a\62\60\x70\x78\73\150\145\151\x67\150\x74\x3a\62\x30\x70\170\73\142\x6f\162\144\145\162\x3a\60\x3b\42\76\74\57\x61\x3e\x3c\x2f\x74\x64\76\x3c\x2f\x74\x72\x3e\12\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\74\57\164\141\142\154\145\x3e\x3c\142\162\x3e\xa\x20\40\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x3c\164\x61\x62\x6c\x65\40\151\144\x3d\42\151\144\60\x31\42\x20\143\x6c\141\163\163\75\42\x77\x33\55\164\x61\x62\154\145\x2d\141\x6c\x6c\x20\x77\x33\55\150\157\166\x65\x72\x61\x62\x6c\145\40\167\63\55\x6c\x65\x66\164\x2d\x61\x6c\151\x67\x6e\x20\x77\63\55\x74\x69\156\x79\x22\x3e\74\164\x72\40\143\154\141\163\163\x3d\x22\167\63\55\x66\x6f\x6e\144\x6f\x64\x72\x6f\x69\144\x20\167\63\x2d\x66\151\152\157\42\x3e\74\164\x68\76\103\157\x64\151\x67\x6f\x3c\57\x74\x68\x3e\74\164\x68\76\116\x6f\155\x62\162\x65\x3c\57\164\x68\76\x3c\x74\x68\x3e\103\x65\x64\165\154\141\x3c\x2f\x74\x68\x3e\74\164\150\x3e\x44\x69\x72\145\x63\x63\x69\x6f\156\x3c\x2f\164\x68\x3e\74\x74\x68\76\132\157\156\141\x3c\57\164\150\x3e\74\x74\x68\76\x53\x75\142\40\132\157\156\141\74\x2f\x74\150\x3e\x3c\164\150\x3e\124\145\x6c\146\74\57\164\150\76\74\x74\x68\x3e\x54\145\x6c\x66\62\x3c\57\164\x68\x3e\xa\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x3c\x74\x68\76\x45\x6d\141\151\154\x3c\x2f\x74\150\x3e\74\x74\150\x3e\106\x69\156\147\162\145\163\x6f\x3c\57\164\150\x3e\74\57\164\x72\x3e"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\74\x74\162\40\151\x64\x3d\42\163\154\145\143\x74" . $i . "\42\x20\143\154\x61\163\x73\x3d\x22\151\164\x65\x6d\x22\x20\157\156\x63\x6c\x69\143\153\x3d\x22\42\76"; $html .= "\74\x69\156\x70\165\164\x20\x74\171\160\145\75\42\x68\x69\144\144\x65\156\42\x20\x6e\141\x6d\x65\75\x22\x63\157\144\x69\x67\x6f\42\x20\166\141\154\x75\145\75\x22" . $dtfac->codigo . "\x22\x3e\x3c\x69\x6e\x70\165\164\x20\x74\x79\160\x65\x3d\x22\150\151\x64\x64\x65\156\42\x20\x6e\141\155\145\75\42\156\157\x6d\x62\162\145\42\x20\166\x61\154\165\x65\x3d\42" . $dtfac->nombre . "\x22\x3e\x3c\151\x6e\x70\x75\x74\40\x74\171\160\x65\75\42\x68\151\144\x64\x65\156\x22\40\156\x61\x6d\x65\75\42\143\145\x64\x75\x6c\141\42\x20\x76\141\154\165\145\75\42" . $dtfac->cedula . "\42\76\12\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\x3c\151\x6e\x70\x75\164\x20\x74\x79\x70\x65\x3d\x22\150\x69\144\144\145\x6e\x22\x20\156\141\x6d\145\x3d\x22\x73\x65\x63\x74\x6f\x72\42\x20\166\x61\154\165\x65\75\42" . $dtfac->sector . "\x22\x3e\x3c\151\x6e\x70\165\164\40\164\x79\160\145\x3d\x22\x68\x69\144\x64\145\x6e\42\40\x6e\x61\x6d\145\75\x22\172\x6f\156\x61\42\x20\x76\141\x6c\x75\145\75\42" . $dtfac->zona . "\42\x3e\74\x69\x6e\160\x75\x74\x20\x74\x79\160\145\75\42\x68\151\x64\x64\x65\x6e\42\x20\x6e\141\155\145\75\x22\163\x75\x62\143\157\144\x69\147\x6f\42\40\166\141\x6c\x75\x65\x3d\42" . $dtfac->subcodigo . "\x22\76\12\40\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\74\x69\156\160\165\164\x20\x74\171\160\145\75\42\150\151\x64\x64\145\156\x22\x20\x6e\x61\155\x65\75\x22\x73\x75\142\x7a\157\x6e\141\42\x20\166\141\x6c\165\145\75\42" . $dtfac->subzona . "\x22\x3e\x3c\151\x6e\160\x75\x74\40\164\171\160\145\x3d\42\150\x69\x64\144\145\x6e\x22\x20\156\x61\x6d\145\75\x22\x65\x6d\141\151\x6c\42\40\x76\141\154\x75\145\75\42" . $dtfac->email . "\x22\76\74\x69\156\160\165\x74\40\164\171\160\145\75\x22\x68\x69\x64\x64\145\156\x22\x20\x6e\141\x6d\145\75\42\x74\x65\x6c\x66\x22\x20\x76\x61\154\x75\145\75\x22" . $dtfac->telf . "\42\x3e\74\151\x6e\160\x75\164\40\x74\x79\160\145\75\42\x68\x69\144\144\x65\156\42\40\x6e\141\x6d\x65\x3d\x22\x66\x69\156\147\42\x20\x76\141\154\x75\145\75\42" . $dtfac->fecha . "\x22\76\40\xa\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\74\164\144\x3e\x3c\x69\x6e\160\x75\x74\x20\164\x79\x70\x65\x3d\x22\143\150\x65\x63\x6b\142\x6f\170\42\40\x6f\156\143\154\151\x63\153\75\x22\x77\63\x2e\164\157\x67\147\x6c\145\103\154\141\163\163\50\47\43\163\x6c\x65\143\164" . $i . "\47\x2c\47\167\63\55\171\145\x6c\154\157\167\47\x29\73\x22\40\x63\x6c\x61\163\x73\x3d\x22\167\x33\55\143\x68\x65\x63\x6b\x22\40\x6e\x61\155\x65\x3d\42\x63\x68\x65\x63\x6b\42\x3e" . $dtfac->codigo . "\x20\74\164\144\76" . $dtfac->nombre . "\74\x2f\164\x64\x3e\x20\x3c\164\144\76" . $dtfac->cedula . "\74\57\x74\144\76\40\12\40\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\74\x74\144\76" . $dtfac->direccion . "\74\57\x74\x64\76\x20\x3c\164\144\76" . $dtfac->zona . "\x3c\x2f\x74\x64\x3e\x20\x3c\164\144\76" . $dtfac->subzona . "\x3c\x2f\164\144\x3e\40\x3c\164\144\76" . $dtfac->telf . "\74\x2f\164\x64\x3e\x20\12\x20\40\40\x20\40\x20\40\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x3c\164\144\76" . $dtfac->telf2 . "\x3c\x2f\x74\144\x3e\74\x74\144\x3e" . $dtfac->email . "\x3c\x2f\164\144\76\74\x74\x64\76" . $dtfac->fecha . "\x3c\x2f\164\x64\x3e\xa\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\74\x2f\x74\x72\76"; } $html .= "\74\164\x72\76\74\x74\144\x20\143\x6c\141\163\163\x3d\42\167\x33\x2d\x63\x65\x6e\x74\x65\162\40\x77\x33\55\146\157\x6e\x64\157\x64\162\157\151\x64\x22\40\x63\x6f\x6c\x73\x70\x61\x6e\75\x22\x31\63\42\x3e\74\154\x61\142\145\154\40\143\154\141\x73\163\x3d\x22\167\x33\x2d\154\141\162\x67\145\x22\x3e\74\x62\76\x54\x6f\x74\141\154\x20\x56\x65\x6e\x64\145\x64\x6f\x72\x65\x73\x3a\x20" . $totalreg . "\x3c\x2f\x62\76\74\x2f\154\x61\x62\x65\154\x3e\74\57\x74\x64\76\74\x2f\164\162\x3e\74\x2f\164\x61\x62\154\145\76"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\xa\x20\40\40\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\x3c\x73\x63\x72\x69\160\x74\x20\x74\x79\x70\145\x3d\x22\x74\145\170\164\57\x6a\x61\166\141\163\x63\x72\151\160\x74\42\76\xa\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\40\146\x75\156\x63\x74\151\x6f\156\40\104\x65\x63\162\x65\155\x65\156\164\116\165\x6d\50\x29\173\x20\142\x65\146\157\162\145\50\x29\x3b\xa\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\x76\x61\162\x20\x44\145\143\x72\x65\x6d\145\x6e\x74\116\x75\x6d\75\144\x6f\x63\165\x6d\145\x6e\164\56\147\145\164\105\154\145\x6d\145\156\x74\102\x79\111\x64\50\42\x44\145\x63\x72\145\155\x65\x6e\164\x4e\165\x6d\x22\51\56\166\x61\x6c\x75\x65\x3b\xa\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\40\166\141\x72\40\x6c\151\153\145\x3d\44\50\x22\43\154\151\153\x65\x22\x29\56\166\141\154\50\x29\x3b\xa\40\40\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\166\141\x72\x20\153\x65\171\x3d\x22\x64\162\157\x69\144\x39\x30\x33\x22\x3b\12\x20\40\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\166\x61\x72\x20\144\141\x74\157\163\40\x3d\x20\173\12\40\40\40\40\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\x20\x20\40\x20\x20\x20\42\160\x61\147\42\x20\72\x20\104\x65\143\162\145\x6d\x65\156\164\x4e\165\x6d\x2c\12\40\40\40\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\x22\x6b\145\x79\42\40\72\40\153\x65\x79\54\42\x6c\151\x6b\145\x22\72\x6c\151\153\x65\12\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\175\73\xa\40\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\40\x20\x20\40\x20\40\40\40\x20\x20\12\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\40\x24\x2e\141\152\141\x78\x28\173\12\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\x20\x20\x20\x20\40\144\x61\164\141\x3a\x20\144\x61\164\x6f\163\54\12\40\x20\40\x20\40\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\40\40\x20\x20\x20\x20\40\x20\165\162\154\x3a\40\40\142\x61\163\x65\165\162\x6c\53\x22\x63\137\x64\162\157\151\144\x2f\154\151\x73\x74\x76\145\x6e\x64\x22\54\xa\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\x20\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\x74\x79\160\145\x3a\x20\42\x50\117\x53\x54\x22\x2c\xa\x20\x20\x20\40\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\163\x75\x63\143\145\x73\x73\x3a\40\146\x75\156\x63\164\x69\x6f\156\x28\144\x61\164\x61\51\40\173\xa\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\40\40\40\40\44\50\42\43\x62\x6f\144\171\x22\51\x2e\x68\164\x6d\x6c\50\144\141\x74\141\51\73\x20\44\x28\42\43\x6c\x69\153\145\x22\x29\56\166\x61\154\50\154\151\x6b\145\51\x3b\40\163\167\141\x6c\x2e\143\x6c\x6f\x73\145\50\x29\xa\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\40\40\40\x20\x20\x7d\12\40\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\40\xa\40\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\x7d\51\73\12\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\40\40\40\40\40\40\40\x20\40\40\40\40\40\x7d\12\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\40\xa\x20\40\x20\x20\40\x20\40\40\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\40\40\x66\x75\156\143\164\151\x6f\x6e\40\x6e\165\x6d\x70\x61\x67\50\x61\x29\173\x20\x62\x65\146\157\x72\145\x28\51\73\12\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\x76\141\162\x20\x6b\145\x79\75\42\144\x72\x6f\x69\x64\x39\60\63\42\x3b\xa\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\x20\40\166\141\x72\x20\x6c\x69\x6b\x65\x3d\44\x28\x22\x23\x6c\151\153\x65\42\51\x2e\x76\x61\x6c\x28\51\73\xa\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\166\141\x72\x20\144\141\164\157\x73\40\x3d\x20\173\12\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\40\40\40\x20\x20\40\x20\x20\40\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\x22\x6b\145\x79\42\x3a\x6b\145\x79\x2c\xa\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\42\160\141\147\x22\40\x3a\x20\x61\54\154\151\153\145\x3a\x6c\x69\x6b\145\xa\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\40\40\40\x20\40\40\40\40\40\40\40\40\40\40\40\40\40\x20\175\x3b\xa\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\12\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x24\56\x61\152\x61\170\x28\173\xa\x20\40\x20\40\40\40\40\40\40\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\x20\40\x20\x20\144\x61\164\141\72\40\x64\141\x74\x6f\x73\54\xa\40\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\165\x72\154\x3a\x20\142\141\163\145\165\162\154\x2b\x22\143\x5f\x64\162\157\151\144\57\154\x69\x73\164\166\x65\156\144\x22\x2c\xa\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\40\40\40\40\40\40\40\40\x20\40\x20\40\40\x20\40\x74\171\x70\x65\72\x20\x22\120\x4f\123\124\x22\54\12\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\40\40\40\40\40\40\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\x20\40\163\165\143\143\x65\x73\163\72\40\x66\165\x6e\x63\x74\x69\157\156\x28\x64\x61\x74\141\51\40\x7b\xa\x20\40\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\44\x28\42\43\x62\157\144\x79\42\x29\x2e\x68\164\155\x6c\50\144\141\164\x61\51\73\x20\44\x28\42\x23\154\x69\153\145\x22\x29\56\166\x61\154\50\154\x69\x6b\x65\x29\73\40\x73\167\141\154\56\143\154\157\x73\145\x28\51\12\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x20\175\xa\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\xa\40\40\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\40\x7d\51\73\xa\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\x7d\xa\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\xa\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\40\146\x75\x6e\x63\x74\x69\157\156\40\111\x6e\143\162\x69\155\x65\x6e\x74\116\x75\x6d\50\x29\173\40\x62\145\146\x6f\x72\x65\50\x29\73\12\x20\40\40\40\40\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\40\x76\x61\162\x20\111\x6e\143\x72\x69\155\x65\x6e\x74\x4e\165\x6d\75\144\157\x63\165\x6d\x65\x6e\x74\56\x67\x65\x74\105\x6c\x65\155\145\156\164\x42\171\x49\x64\x28\42\111\156\143\162\x69\155\145\156\164\x4e\x75\155\x22\x29\x2e\x76\141\154\165\145\x3b\xa\40\40\40\40\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\166\x61\x72\x20\153\145\171\75\x22\x64\162\x6f\x69\144\71\60\63\42\x3b\x20\x76\141\x72\x20\x6c\x69\x6b\x65\x3d\x24\50\42\43\154\151\x6b\145\x22\x29\x2e\166\141\154\50\51\x3b\12\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\40\x20\x20\x20\40\x20\40\x20\40\x76\x61\162\x20\144\141\164\157\x73\x20\x3d\40\173\12\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\40\40\x22\x6b\145\171\42\x3a\x6b\x65\x79\x2c\xa\x20\x20\40\x20\40\40\40\40\40\x20\x20\40\40\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\x20\40\40\40\40\40\40\x20\40\42\x70\x61\x67\x22\40\72\x20\x49\156\x63\162\x69\155\145\156\x74\x4e\x75\155\x2c\154\x69\x6b\145\72\x6c\x69\153\145\xa\40\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x7d\x3b\xa\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\40\40\12\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\44\56\x61\152\x61\170\50\173\xa\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\40\40\40\144\141\164\x61\72\x20\144\x61\x74\x6f\163\x2c\xa\40\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\165\x72\x6c\x3a\x20\40\x62\x61\163\x65\x75\x72\x6c\x2b\42\x63\x5f\144\x72\157\151\x64\x2f\154\x69\x73\x74\166\x65\156\144\42\x2c\xa\x20\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\x74\x79\x70\x65\72\x20\42\x50\117\123\x54\x22\x2c\12\x20\40\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\40\x20\40\x20\40\40\40\40\x20\40\40\x20\40\x73\165\x63\x63\145\163\x73\x3a\40\146\165\156\143\164\151\x6f\x6e\x28\144\x61\x74\141\51\40\173\xa\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\40\40\x20\44\50\x22\x23\142\x6f\144\x79\x22\51\56\x68\x74\155\154\50\x64\x61\164\x61\51\x3b\40\x24\50\x22\43\x6c\x69\x6b\145\x22\51\56\166\141\x6c\50\x6c\x69\153\x65\51\x3b\x20\x73\167\141\x6c\x2e\143\x6c\x6f\x73\145\x28\51\xa\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\175\xa\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\xa\40\40\40\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\175\x29\x3b\12\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\x20\175\xa\40\x20\x20\40\40\x20\40\40\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\74\57\x73\143\x72\151\160\164\76\12\40\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x3c\x64\x69\166\40\143\x6c\141\x73\163\75\42\x77\63\x2d\142\141\162\40\167\63\55\x62\x6f\162\x64\145\162\40\x77\x33\55\x62\x61\162\x72\141\163\42\76\12\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\74\x69\156\x70\165\164\40\164\171\x70\145\75\42\x68\151\x64\144\x65\x6e\42\x20\x69\144\x3d\42\104\145\143\162\145\155\145\156\x74\116\x75\155\42\x20\x76\x61\154\165\145\75\x22" . $DecrementNum . "\42\76\xa\40\x20\x20\40\40\40\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x3c\141\x20\157\156\143\x6c\151\x63\x6b\x3d\42\104\145\143\x72\145\155\x65\156\164\116\165\x6d\50\x29\73\x22\x20\143\154\x61\163\x73\75\42\167\x33\55\x62\x61\162\55\151\x74\x65\x6d\x20\x77\x33\x2d\142\165\x74\164\x6f\x6e\42\76\46\x6c\x61\161\x75\157\x3b\x3c\57\x61\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\151\144\x70\141\x67\x69\x6e\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\63\55\146\157\156\144\157\144\162\x6f\x69\x64"; $html .= "\xa\x20\x20\40\40\40\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\x20\40\40\40\40\x20\40\74\x69\x6e\x70\165\x74\x20\164\x79\x70\x65\75\42\x68\151\144\144\145\x6e\42\x20\x69\144\x3d\42" . $id . "\x22\x20\x76\141\x6c\x75\x65\75\x22" . $i . "\42\x3e\12\x20\40\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\x3c\141\40\157\x6e\143\x6c\151\x63\153\x3d\42\156\x75\x6d\160\x61\147\50\44\x28\x27\x23" . $id . "\47\51\x2e\166\x61\154\50\51\x29\x3b\x22\40\143\154\x61\163\x73\x3d\x22\x77\63\x2d\142\141\x72\55\x69\x74\x65\x6d\40\x77\63\55\x62\165\x74\x74\x6f\156\40" . $hover . "\x22\76" . $i . "\74\57\x61\76"; } else { $hover = ''; $html .= "\74\151\156\x70\165\x74\x20\164\x79\x70\x65\75\x22\x68\151\144\x64\x65\156\42\x20\151\144\x3d\x22" . $id . "\x22\40\166\141\x6c\165\x65\75\x22" . $i . "\x22\x3e\12\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x3c\141\40\157\156\143\154\x69\x63\x6b\75\42\156\x75\155\x70\141\x67\x28\44\x28\x27\x23" . $id . "\47\51\56\x76\x61\x6c\50\x29\x29\73\42\x20\x63\x6c\141\163\163\75\42\167\63\55\x62\141\162\x2d\151\164\x65\155\40\167\x33\x2d\x62\x75\164\x74\x6f\156\x20" . $hover . "\x22\76" . $i . "\74\x2f\141\x3e"; } } } $html .= "\74\x69\x6e\160\165\x74\40\x74\171\x70\145\75\42\150\151\144\x64\145\x6e\42\x20\x69\x64\x3d\42\x49\156\143\x72\151\x6d\x65\x6e\x74\x4e\x75\x6d\x22\x20\166\x61\154\x75\145\x3d\42" . $IncrimentNum . "\x22\76\xa\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x3c\x61\40\157\156\x63\154\151\x63\153\x3d\x22\111\156\x63\162\151\155\x65\x6e\x74\116\x75\x6d\x28\x29\x3b\x22\x20\143\154\x61\x73\163\75\x22\167\x33\55\142\141\x72\x2d\x69\164\x65\x6d\40\x77\63\x2d\x62\x75\164\x74\x6f\x6e\x22\76\x26\x72\x61\x71\165\157\x3b\x3c\57\x61\76\xa\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\12\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\40\40\40\x20\40\x20\x20\40\40\40\74\x2f\144\x69\x76\76\40"; return $html; } function editvend($cod, $nom, $ci, $sec, $sub, $email, $telf, $fing) { $data = array("\156\x6f\x6d\142\x72\145" => $nom, "\x63\x65\x64\165\x6c\141" => $ci, "\163\x65\143\164\157\162" => $sec, "\x73\165\142\143\157\144\151\x67\x6f" => $sub, "\x65\155\x61\151\154" => $email, "\x74\x65\x6c\x65\146\x6f\156\x6f\x73" => $telf, "\146\x65\143\150\x61" => $fing); $this->db->where("\x63\157\144\151\147\x6f", $cod)->update("\154\151\x73\164\x76\145\x6e\144", $data); $this->loguser("\115\157\144\151\146\151\x63\x61\x72", "\x45\154\40\x75\x73\x75\x61\162\x69\157\x20\155\x6f\x64\x69\146\x69\x63\x61\40\154\x61\40\146\151\x63\150\x61\x20\141\154\x20\x76\x65\x6e\144\x65\144\x6f\x72\x20" . $cod . "\56"); return $this->db->affected_rows(); } function sectores($zona) { $bd = $this->db->query("\123\105\114\x45\103\124\x20\x73\165\x62\143\x6f\x64\151\x67\x6f\54\x73\x75\x62\x73\x65\143\164\157\x72\40\106\122\117\x4d\40\163\x75\x62\x73\x65\x63\x74\157\x72\145\163\40\127\x48\x45\122\x45\40\143\x6f\x64\x69\147\x6f\x3d\x27{$zona}\47\40\117\122\104\x45\x52\40\102\x59\x20\x73\x75\142\163\145\x63\164\157\x72\x20\101\x53\x43"); $html = ''; foreach ($bd->result() as $db) { $html .= "\74\157\160\164\151\x6f\x6e\x20\166\x61\154\x75\x65\75\42" . $db->subcodigo . "\42\x3e" . $db->subsector . "\x3c\x2f\x6f\x70\164\151\x6f\x6e\x3e"; } return $html; } function regvend($cod, $nom, $ci, $sec, $sub, $email, $telf, $fing) { $data = array("\143\x6f\x64\151\x67\157" => $cod, "\156\157\155\142\x72\x65" => $nom, "\x63\x65\144\x75\154\x61" => $ci, "\163\145\143\x74\x6f\x72" => $sec, "\163\x75\142\x63\x6f\x64\x69\147\x6f" => $sub, "\145\155\141\151\x6c" => $email, "\x74\145\x6c\x65\146\x6f\x6e\x6f\x73" => $telf, "\146\145\x63\150\141" => $fing); $this->db->insert("\x6c\151\163\164\166\145\156\144", $data); $this->loguser("\x52\145\x67\x69\163\x74\162\x6f\40\x56\x65\156\144\145\x64\x6f\162", "\x45\x6c\x20\x75\163\x75\141\x72\x69\x6f\40\162\145\147\x69\163\164\x72\141\40\x61\x6c\40\x76\145\x6e\x64\145\x64\157\162\40" . $cod . "\56\x20\x64\x65\40" . $nom . "\40\x79\x20" . $ci . ''); return $this->db->affected_rows(); } public function pedweb() { $bd = $this->db->query("\123\105\114\105\x43\124\x20\x61\x2e\x2a\x20\x46\122\117\x4d\40\x6f\x70\145\x72\x74\151\x20\x61\40\112\117\111\116\x20\143\x6f\156\x74\x72\157\x6c\137\157\160\145\x72\164\x69\x20\x62\40\117\116\40\141\56\144\x6f\143\x75\x6d\145\x6e\164\157\x3d\142\x2e\x64\x6f\x63\x20\127\x48\105\122\105\40\x61\x2e\x66\x65\x63\150\x61\143\x72\x65\x61\76\x3d\104\x41\x54\105\x5f\x41\x44\x44\x28\x43\125\x52\104\101\124\105\x28\51\x2c\x20\111\116\x54\105\x52\x56\x41\114\x20\55\x31\x30\x20\x44\x41\x59\x29\x20\x26\46\x20\x62\56\x73\x74\x61\x74\x75\163\x3d\47\60\x27\40\107\x52\x4f\125\x50\x20\x42\131\x20\x61\x2e\x64\x6f\x63\165\x6d\145\x6e\164\x6f\x3b"); return $bd->result_array(); } public function cargapedweb($a) { foreach ($a as $b) { $val = $this->db->query("\x53\x45\x4c\105\103\x54\x20\x4e\x55\114\x4c\x20\x46\122\117\x4d\x20\x6f\x70\145\x72\x74\151\x20\127\110\x45\x52\x45\x20\50\x64\x6f\x63\165\x6d\x65\x6e\164\157\75\47" . $b["\x64\157\x63\165\x6d\x65\156\x74\x6f"] . "\47\x20\174\174\40\141\156\164\144\157\x63\x3d\47" . $b["\x64\157\143\165\155\x65\x6e\x74\x6f"] . "\x27\51")->num_rows(); if ($val == 0) { $bd = $this->db->insert("\157\160\145\x72\x74\151", $b); $control = array("\144\x6f\143" => $b["\144\157\x63\165\x6d\145\x6e\164\157"], "\x73\x74\141\164\x75\x73" => "\x30"); $this->db->insert("\143\157\156\164\x72\157\x6c\x5f\157\160\145\162\x74\151", $control); } } return $bd; } public function ped2web() { $bd = $this->db->query("\x53\x45\x4c\105\103\124\x20\141\56\x2a\x20\106\x52\x4f\x4d\x20\x6f\x70\145\x72\155\166\40\141\163\x20\141\40\114\105\x46\124\40\x4a\x4f\111\116\40\x6f\x70\145\162\x74\x69\x20\x61\163\40\142\x20\x4f\116\x20\x61\x2e\x64\157\143\x75\x6d\x65\156\x74\x6f\75\142\56\x64\x6f\x63\165\155\145\156\x74\x6f\40\x4a\117\x49\x4e\x20\x63\x6f\x6e\x74\x72\x6f\x6c\137\x6f\x70\145\162\164\x69\40\141\163\40\143\40\117\x4e\x20\142\56\144\157\x63\165\155\145\x6e\x74\157\x3d\x63\56\x64\157\x63\40\x57\x48\x45\x52\105\40\x62\x2e\146\x65\x63\x68\141\x63\162\x65\141\x3e\75\x44\x41\x54\105\137\x41\104\104\50\x43\125\x52\x44\101\x54\x45\50\51\54\40\x49\116\124\x45\x52\126\101\x4c\x20\x2d\61\x30\40\104\101\x59\51\x20\x26\x26\x20\143\56\x73\x74\141\164\x75\163\x3d\47\x30\47\73"); return $bd->result_array(); } public function cargaped2web($a) { foreach ($a as $b) { $val = $this->db->query("\x53\x45\x4c\105\103\124\x20\x4e\x55\114\x4c\40\106\x52\117\x4d\x20\x6f\160\145\162\155\166\40\127\110\105\122\x45\40\x64\157\x63\165\155\x65\x6e\164\x6f\x3d\47" . $b["\x64\x6f\x63\x75\155\x65\x6e\164\x6f"] . "\x27\x20\46\x26\x20\x63\157\144\151\x67\x6f\x3d\47" . $b["\143\x6f\x64\151\147\157"] . "\47")->num_rows(); if ($val == 0) { $bd = $this->db->insert("\157\160\x65\162\x6d\x76", $b); $art = $this->db->query("\123\105\114\x45\103\124\40\143\157\155\x70\x72\x6f\155\x65\x74\x69\144\x6f\x20\106\x52\117\115\x20\x61\x72\164\151\143\165\154\157\x20\127\x48\105\x52\105\x20\x63\157\144\151\x67\x6f\75\x27" . $b["\143\157\x64\x69\x67\157"] . "\x27")->row(); $newcomp = $b["\x63\141\156\164\151\x64\x61\x64"] + $art->comprometido; $dato3 = array("\143\x6f\x6d\x70\x72\x6f\155\145\164\x69\x64\157" => $newcomp); $this->db->where("\143\157\144\x69\147\157", $b["\143\x6f\144\151\147\157"])->update("\141\162\x74\151\x63\165\x6c\157", $dato3); } } return $bd; } public function confi4web() { $bd = $this->db->query("\x53\105\114\x45\103\x54\x20\x64\157\143\x75\155\145\x6e\164\157\40\106\122\117\115\x20\157\x70\145\x72\164\x69\40\101\123\x20\x61\x20\112\x4f\111\x4e\x20\143\157\x6e\x74\x72\157\154\x5f\x6f\160\x65\162\164\151\x20\141\x73\40\142\40\x4f\116\40\x61\x2e\144\157\x63\x75\155\145\x6e\x74\x6f\x3d\142\x2e\144\x6f\143\40\127\110\x45\x52\105\40\141\x2e\146\145\143\150\141\x63\x72\145\x61\76\x3d\104\101\124\x45\137\101\x44\104\50\x43\x55\x52\x44\x41\x54\105\x28\51\54\40\111\116\124\x45\x52\126\x41\x4c\x20\55\x31\60\40\x44\101\x59\51\40\46\x26\x20\142\x2e\163\164\x61\x74\165\163\75\x27\x30\x27\x3b"); if ($bd->num_rows() > 0) { foreach ($bd->result() as $dt) { $datos = array("\163\x74\x61\164\x75\163" => "\x34"); $bd2 = $this->db->where("\x64\x6f\143", $dt->documento)->update("\143\157\x6e\164\162\157\154\137\x6f\x70\x65\x72\x74\151", $datos); } } return $bd2; } public function confi1web($a) { $datos = array("\163\164\x61\x74\165\163" => "\61"); $bd = $this->db->where("\144\x6f\143", $a)->update("\143\157\x6e\164\162\157\154\137\x6f\x70\x65\x72\164\x69", $datos); return $bd; } public function editvehi($a, $b) { $datos = array("\166\x65\150\x69\143\165\x6c\157" => $b); $sql = "\151\x64\x3d\47{$a}\x27\40\x26\x26\40\163\164\141\164\165\x73\75\x27\60\x27"; $bd = $this->db->where($sql)->update("\x72\145\160\x61\x72\x74\x6f", $datos); return $bd; } public function editchof($a, $b, $c) { if ($c == 1) { $datos = array("\x63\150\x6f\x66\x65\162\x31" => $b); } else { $datos = array("\x63\150\157\146\x65\x72\62" => $b); } $sql = "\x69\x64\x3d\47{$a}\47\40\x26\46\x20\163\x74\141\164\x75\x73\x3d\47\60\x27"; $bd = $this->db->where($sql)->update("\x72\x65\x70\141\162\x74\157", $datos); return $bd; } public function mencuest() { $bd1 = $this->db->query("\x53\105\114\x45\x43\124\x20\52\x20\106\122\x4f\115\x20\x65\x6e\143\165\x65\163\x74"); $bd2 = $this->db->query("\x53\105\x4c\x45\103\x54\x20\52\x20\106\122\117\115\40\x70\162\x65\x67\145\156\143\165\145\x73\164"); $bd3 = $this->db->query("\123\x45\114\105\103\x54\40\x2a\40\106\x52\117\115\x20\x72\145\163\160\x65\x6e\143\x75\x65\163\x74"); $stitle = "\74\x6f\160\164\151\157\156\40\x76\141\154\x75\145\75\42\x22\x20\163\145\x6c\145\143\164\145\x64\x20\x64\x69\163\x61\142\x6c\145\144\x3e\123\145\x6c\145\x63\x63\x69\157\x6e\x65\x3c\57\x6f\x70\x74\151\x6f\156\76"; $title = "\x3c\164\141\x62\x6c\145\40\151\144\x3d\42\164\x61\142\x6c\x65\x22\40\143\x6c\x61\x73\163\75\42\167\x33\x2d\x74\141\142\154\x65\x2d\x61\x6c\154\x20\x77\x33\x2d\x68\x6f\x76\145\x72\x61\142\x6c\145\x20\167\63\55\143\145\x6e\164\145\x72\x65\144\x22\76\74\x74\x72\40\143\154\x61\x73\x73\75\42\x77\x33\55\146\x6f\156\144\x6f\144\162\157\151\x64\x22\76\x3c\x74\150\76\x49\104\x3c\x2f\x74\150\76\x3c\164\x68\x3e\x54\x69\164\x75\x6c\x6f\74\x2f\164\x68\76\74\x74\x68\x3e\x3c\x2f\x74\x68\76\74\57\164\x72\x3e"; $preg = "\x3c\164\141\142\x6c\x65\x20\x69\x64\x3d\x22\x74\141\x62\x6c\145\x22\x20\x63\154\x61\163\x73\x3d\x22\x77\63\55\164\x61\x62\x6c\x65\x2d\141\154\154\x20\167\63\x2d\150\157\x76\x65\x72\141\x62\x6c\x65\40\x77\x33\55\143\145\x6e\164\x65\x72\145\x64\42\76\x3c\164\162\40\143\154\141\x73\x73\75\42\167\63\55\146\x6f\x6e\144\x6f\144\162\157\151\x64\x22\x3e\74\164\150\76\x49\x44\x3c\x2f\x74\x68\x3e\74\x74\150\76\105\156\143\x75\x65\x73\x74\141\74\x2f\x74\x68\x3e\74\x74\x68\76\x50\162\x65\x67\x75\156\x74\141\x3c\57\x74\150\x3e\x3c\164\x68\x3e\74\x2f\x74\x68\76\x3c\57\164\162\x3e"; $resp = "\74\x74\x61\142\154\145\40\151\144\x3d\42\x74\141\x62\154\145\x22\x20\x63\x6c\x61\x73\x73\75\42\x77\x33\x2d\x74\141\142\154\x65\55\x61\154\154\40\x77\x33\x2d\150\157\x76\145\x72\x61\x62\x6c\x65\40\x77\63\55\143\x65\x6e\164\145\x72\145\x64\x22\76\74\x74\x72\x20\x63\154\141\163\163\x3d\x22\167\63\x2d\x66\157\x6e\144\157\144\162\157\x69\x64\x22\x3e\x3c\164\150\76\111\x44\74\x2f\x74\150\x3e\74\x74\150\x3e\122\x65\x73\x70\165\145\x73\x74\x61\x3c\x2f\x74\150\x3e\x3c\x74\x68\76\x3c\x2f\x74\150\76\74\x2f\164\162\x3e"; $i = 1; foreach ($bd1->result() as $dt1) { $i++; $stitle .= "\x3c\x6f\160\164\x69\x6f\156\40\x76\x61\154\165\145\x3d\x22" . $dt1->id . "\42\x3e" . $dt1->title . "\74\157\160\x74\x69\x6f\156\x3e"; $title .= "\74\x74\x72\76\x3c\164\144\76" . $dt1->id . "\74\57\164\x64\x3e\x3c\164\x64\x3e" . $dt1->title . "\74\x2f\164\x64\x3e\x3c\164\x64\76\x3c\57\x74\144\76\x3c\x2f\164\x72\x3e"; } $title .= "\74\164\162\76\74\164\x64\76" . $i . "\74\x2f\x74\144\76\x3c\x74\x64\76\74\151\x6e\160\165\164\x20\x74\171\160\145\75\42\164\145\170\x74\42\x20\x63\x6c\141\x73\163\75\x22\167\x33\55\x69\156\x70\165\x74\x22\40\151\x64\75\x22\x61\42\x20\x70\x6c\141\x63\145\x68\157\x6c\x64\145\162\x3d\x22\x74\151\164\165\x6c\157\42\x3e\74\57\x74\144\76\x3c\164\144\x20\x63\154\141\x73\163\x3d\x22\167\63\x2d\142\164\x6e\42\x3e\x3c\141\x20\157\x6e\x63\x6c\x69\143\x6b\x3d\x22\x72\145\147\x74\151\x74\x6c\145\50\44\50\x27\x23\141\x27\51\56\166\x61\x6c\x28\51\x29\42\x3e\x3c\x69\x6d\x67\40\163\162\x63\x3d\42" . base_url() . "\151\155\141\x67\145\x73\57\x72\145\147\151\x73\164\x72\141\162\x2e\160\x6e\x67\42\40\x61\154\x74\x3d\x22\x52\145\x67\151\163\164\162\x61\162\42\x20\x73\x74\x79\154\x65\x3d\x22\x77\x69\x64\164\x68\72\x31\66\x70\x78\42\x3e\x3c\x2f\141\x3e\x3c\57\x74\144\76\x3c\57\x74\x72\x3e\74\x2f\164\141\x62\x6c\145\76"; $b = 1; foreach ($bd2->result() as $dt2) { $b++; $preg .= "\x3c\x74\x72\x3e\x3c\164\x64\76" . $dt2->id . "\x3c\57\x74\144\x3e\x3c\x74\144\76" . $dt2->id_encuest . "\x3c\57\164\x64\76\74\x74\x64\x3e" . $dt2->pregunta . "\x3c\x2f\x74\x64\x3e\74\164\x64\76\x3c\x2f\164\x64\76\x3c\57\x74\x72\76"; } $preg .= "\x3c\x74\x72\x3e\74\x74\144\x3e" . $b . "\74\x2f\164\x64\x3e\74\x74\144\76\74\x73\x65\x6c\145\x63\x74\x20\143\154\x61\163\x73\75\x22\167\x33\55\x73\145\154\145\143\x74\x22\x20\x69\x64\x3d\42\x63\x22\76" . $stitle . "\x3c\x73\x65\x6c\x65\x63\x74\76\74\57\x74\x64\x3e\74\x74\x64\x3e\x3c\151\156\x70\x75\164\40\164\x79\160\145\x3d\42\x74\x65\170\x74\42\40\x63\x6c\141\x73\163\x3d\x22\x77\x33\55\x69\156\160\165\x74\x22\x20\151\144\75\x22\x62\x22\x20\160\x6c\141\x63\145\x68\x6f\154\144\x65\x72\75\42\x70\162\x65\147\165\x6e\164\141\42\76\x3c\57\164\x64\76\x3c\164\144\40\x63\154\x61\163\x73\75\x22\x77\x33\55\x62\164\x6e\x22\76\x3c\x61\x20\x6f\156\143\154\x69\143\153\x3d\42\162\x65\x67\x70\x72\x65\147\x28\x24\x28\47\43\x63\47\51\x2e\x76\x61\154\50\x29\54\x24\50\x27\43\142\x27\x29\x2e\x76\x61\x6c\50\x29\x29\x22\76\74\x69\155\x67\x20\x73\162\143\75\42" . base_url() . "\151\x6d\141\147\145\x73\57\162\x65\x67\151\163\x74\162\x61\x72\56\x70\x6e\x67\x22\x20\x61\x6c\164\x3d\x22\122\x65\x67\151\x73\164\162\141\x72\x22\x20\x73\164\x79\154\x65\x3d\42\167\x69\144\x74\150\72\x31\x36\160\x78\42\76\74\x2f\x61\x3e\74\57\x74\144\x3e\74\x2f\x74\162\76\74\x2f\164\141\x62\154\145\76"; $c = 1; foreach ($bd3->result() as $dt3) { $c++; $resp .= "\74\x74\x72\x3e\74\164\144\x3e" . $dt3->id . "\74\57\x74\144\x3e\x3c\164\144\x3e" . $dt3->respuesta . "\74\x2f\x74\144\x3e\74\x74\x64\76\74\57\x74\x64\x3e\74\57\164\x72\76"; } $resp .= "\74\164\162\76\x3c\164\x64\x3e" . $c . "\x3c\57\164\144\x3e\x3c\164\144\x3e\74\151\x6e\x70\165\x74\x20\x74\171\160\x65\75\x22\164\x65\x78\164\42\40\143\x6c\141\x73\x73\75\42\x77\63\x2d\x69\x6e\160\165\164\42\40\x69\144\x3d\x22\144\x22\40\x70\154\x61\143\x65\150\157\x6c\x64\x65\162\75\42\x72\145\x73\x70\x75\x65\163\x74\141\x22\76\x3c\57\x74\x64\x3e\x3c\164\x64\40\x63\154\x61\x73\163\75\42\167\63\55\x62\x74\156\42\x3e\x3c\141\40\x6f\156\x63\154\151\143\153\x3d\42\162\x65\x67\x72\x65\163\x70\50\x24\50\47\43\x64\47\x29\56\166\x61\x6c\x28\51\51\x22\76\x3c\x69\155\x67\40\x73\x72\143\75\42" . base_url() . "\151\x6d\x61\147\x65\163\x2f\x72\x65\147\151\163\164\162\x61\162\56\160\x6e\147\42\40\x61\154\x74\75\42\122\x65\x67\151\x73\x74\162\x61\162\x22\x20\163\x74\x79\x6c\145\75\42\167\x69\144\x74\150\x3a\61\x36\160\x78\42\76\x3c\x2f\x61\76\x3c\x2f\164\x64\x3e\74\57\x74\162\x3e\x3c\57\x74\141\142\x6c\145\76"; $data = array("\x74\x69\164\x6c\x65" => $title, "\160\x72\x65\147" => $preg, "\162\145\163\x70" => $resp); return $data; } public function zonaencuest() { $bd = $this->db->query("\x53\x45\114\x45\103\x54\x20\151\x64\x2c\x20\164\x69\164\x6c\x65\40\106\x52\117\x4d\x20\x65\x6e\x63\x75\x65\x73\164\x20\x47\122\117\125\x50\x20\x42\x59\x20\164\x69\x74\x6c\x65\40\117\122\104\x45\x52\x20\102\x59\40\164\x69\164\154\x65"); $data = array("\145\x6e\143\165\145\x73\x74" => $bd->result_array(), "\x72\x6f\167\x73" => $bd->num_rows()); return $data; } public function verencuest($a) { $bd = $this->db->query("\123\x45\114\x45\x43\x54\40\x69\144\x2c\x70\162\145\x67\165\156\164\141\40\106\122\x4f\x4d\40\x70\162\x65\x67\145\156\143\x75\x65\x73\x74\40\x57\110\x45\122\105\x20\x69\x64\x5f\x65\156\143\x75\x65\163\x74\x3d\47{$a}\47\40\x4f\x52\x44\x45\x52\x20\102\x59\x20\160\162\x65\x67\x75\156\164\x61"); $bd2 = $this->db->query("\x53\x45\x4c\x45\103\x54\x20\x69\144\54\x72\145\x73\x70\165\x65\x73\164\x61\x20\x46\x52\x4f\115\40\x72\145\163\160\x65\156\x63\x75\x65\163\164\40\x4f\x52\104\105\122\x20\x42\x59\40\162\145\163\160\165\x65\x73\164\x61"); $data = array("\160\x72\145\x67" => $bd->result_array(), "\x72\145\x73\x70" => $bd2->result_array()); return $data; } function vend() { $bd = $this->db->query("\123\105\114\105\103\124\40\x63\x6f\144\151\147\157\x2c\156\x6f\155\142\x72\x65\x20\x46\122\117\x4d\40\x6c\151\163\164\166\145\x6e\144\x20\x47\x52\x4f\x55\x50\40\x42\131\x20\143\x6f\x64\x69\x67\157")->result(); $html = "\74\151\x6e\160\165\x74\40\x74\x79\160\145\x3d\x22\164\x65\x78\x74\x22\40\x63\154\x61\163\163\x3d\x22\167\63\55\151\x6e\x70\165\x74\x22\x20\x69\144\75\42\x69\x64\166\145\x6e\x64\42\40\x6c\x69\x73\164\75\42\x6c\151\163\x74\166\145\156\144\42\40\x70\154\x61\143\145\x68\157\x6c\144\x65\162\75\x22\x56\x65\156\144\145\x64\157\x72\x2e\56\x2e\42\x20\x76\x61\x6c\165\x65\x3d\x22\x22\40\57\76\xa\x20\40\x20\x20\x3c\144\141\x74\141\x6c\x69\x73\x74\40\151\x64\75\42\x6c\x69\x73\164\166\x65\x6e\x64\x22\76"; foreach ($bd as $dt) { $html .= "\74\x6f\160\164\x69\x6f\x6e\x20\x76\141\154\165\145\x3d\42" . $dt->codigo . "\42\x3e" . $dt->nombre . "\74\x2f\x6f\x70\164\x69\157\156\x3e"; } $html .= "\x3c\57\x64\141\164\x61\x6c\x69\163\x74\x3e"; return $html; } function formeditfac($doc) { $db = $this->db->query("\x53\x45\114\x45\103\x54\x20\x76\x65\156\x64\145\144\x6f\162\40\x63\157\144\x2c\157\x72\144\145\156\x2c\40\x64\x69\x61\163\x63\x72\145\x64\40\x64\x69\141\x73\143\54\40\x64\x69\x61\163\x69\x6e\x64\x65\170\40\144\151\141\163\x20\x46\122\117\x4d\40\x6f\x70\145\x72\x74\151\x20\x57\110\105\x52\x45\40\144\x6f\143\x75\x6d\145\x6e\164\157\75\x27{$doc}\47")->row(); $bd = $this->db->query("\x53\105\114\105\103\x54\40\143\x6f\144\151\147\x6f\x2c\156\x6f\155\x62\x72\145\x20\106\122\x4f\x4d\40\154\151\163\164\166\x65\156\x64\40\x47\122\117\125\x50\40\102\x59\40\143\157\144\151\147\x6f")->result(); $html = "\x3c\164\x61\142\x6c\145\x3e\x3c\164\x72\76\74\164\x64\x3e\x56\x65\x6e\x64\145\x64\157\162\x3a\74\x74\144\x3e\74\164\x64\76\x3c\x69\156\160\165\x74\40\x74\171\160\145\75\x22\164\x65\170\164\x22\x20\143\x6c\141\x73\x73\x3d\42\167\x33\x2d\151\x6e\160\x75\x74\42\x20\151\144\x3d\x22\x69\144\x76\145\x6e\144\x22\x20\154\151\x73\x74\75\42\154\x69\x73\x74\166\x65\x6e\144\x22\40\166\141\154\165\145\75\42" . $db->cod . "\x22\x20\x70\154\x61\x63\x65\150\157\154\144\x65\162\75\42\x56\145\156\x64\145\144\x6f\x72\x2e\56\x2e\42\40\166\141\154\165\145\75\42\x22\40\x2f\x3e\74\x2f\x74\x3e\x3c\57\164\x72\76\xa\40\x20\x20\x20\74\x64\141\164\x61\x6c\151\163\164\x20\151\144\75\x22\154\151\x73\x74\x76\x65\x6e\x64\42\x3e"; foreach ($bd as $dt) { $html .= "\74\x6f\160\164\151\157\156\x20\x76\141\154\165\145\x3d\x22" . $dt->codigo . "\x22\x3e" . $dt->nombre . "\74\57\x6f\160\164\151\157\156\x3e"; } $html .= "\74\57\144\x61\164\x61\x6c\151\x73\164\x3e\12\x20\40\x20\40\x3c\164\162\x3e\x3c\164\144\76\x44\151\x61\x73\40\103\x72\x65\x64\151\164\x6f\72\74\x74\144\76\74\x74\144\76\74\x69\x6e\160\165\x74\x20\x74\171\160\x65\75\42\x74\x65\170\164\42\40\x63\x6c\141\163\x73\x3d\x22\x77\x33\55\151\156\x70\165\164\x22\40\x69\x64\75\x22\163\x77\144\x69\141\x73\143\x22\x20\166\x61\x6c\165\x65\75\x22" . $db->diasc . "\42\40\x70\154\x61\x63\x65\150\x6f\x6c\x64\x65\162\75\42\x64\x69\141\x73\42\x3e\x3c\57\164\x3e\x3c\57\x74\x72\x3e\12\x20\x20\40\40\x3c\164\x72\76\74\x74\x64\76\x44\x69\x61\x73\40\x49\156\144\145\170\72\x3c\164\x64\76\74\x74\144\x3e\74\x69\156\160\x75\164\40\x74\171\160\x65\x3d\42\164\x65\170\164\42\40\x63\154\x61\x73\x73\75\42\x77\63\55\151\x6e\x70\165\164\42\x20\x69\144\x3d\42\x73\167\x64\151\141\163\42\40\x76\x61\x6c\x75\145\x3d\42" . $db->dias . "\x22\x20\160\154\x61\143\x65\150\157\154\144\145\x72\x3d\42\144\x69\x61\163\x22\76\x3c\x2f\164\76\74\57\x74\x72\x3e\12\x20\x20\x20\40\74\x74\x72\x3e\74\164\144\76\116\x2e\103\157\156\164\x72\157\154\x3a\74\164\x64\76\x3c\164\144\76\74\151\156\160\x75\164\40\x74\x79\160\145\x3d\x22\x74\145\x78\164\42\x20\143\x6c\141\163\x73\75\x22\x77\x33\55\151\156\160\x75\x74\x22\x20\151\144\75\42\x73\x77\x6e\143\x6f\156\164\x72\157\154\42\40\166\x61\x6c\x75\x65\x3d\42" . $db->orden . "\x22\40\160\154\141\143\145\x68\x6f\x6c\x64\145\x72\75\42\x6e\x75\155\x20\143\x6f\x6e\x74\162\x6f\154\x2e\x2e\x2e\42\76\74\57\164\76\x3c\x2f\164\162\76\x3c\x2f\164\x61\x62\x6c\145\76"; return $html; } public function regtitle($a) { $datos = array("\164\x69\164\154\x65" => $a); $bd = $this->db->insert("\145\x6e\x63\x75\x65\x73\x74", $datos); return $bd; } public function regpreg($a, $b) { $datos = array("\151\144\137\x65\x6e\x63\x75\x65\163\164" => $a, "\x70\x72\145\147\165\x6e\164\141" => $b); $bd = $this->db->insert("\x70\162\x65\x67\x65\x6e\143\x75\x65\x73\164", $datos); return $bd; } public function regresp($a) { $datos = array("\162\145\x73\x70\165\145\163\x74\141" => $a); $bd = $this->db->insert("\162\x65\163\x70\145\156\143\165\145\x73\164", $datos); return $bd; } public function regencuest($a, $b, $c, $d) { $bcli = $this->db->query("\x53\x45\114\105\x43\124\x20\x63\x6f\144\x69\x67\157\40\106\122\117\x4d\40\143\x6c\x69\x65\x6d\160\x72\145\x20\127\110\x45\122\105\x20\156\157\155\142\162\145\x20\x6c\151\x6b\145\40\47\x25{$d}\x25\x27"); if ($bcli->num_rows() > 0) { $dcli = $bcli->row(); $datos = array("\151\x64\x5f\145\156\x63\x75\145\x73\x74" => $a, "\151\144\137\x70\162\145\147" => $b, "\x69\x64\137\x72\x65\163\160" => $c, "\143\154\x69\145\x6e\164\x65" => $dcli->codigo, "\x66\x65\x63\x68" => date("\131\55\x6d\x2d\x64")); $bd = $this->db->insert("\143\154\151\145\x6e\x63\x75\145\163\x74", $datos); } return $bd; } public function searchcli($a) { $bd = $this->db->query("\123\x45\x4c\105\x43\124\x20\141\x2e\x63\157\144\x69\x67\x6f\40\x46\122\x4f\115\40\143\x6c\x69\145\155\x70\x72\x65\x20\x41\x53\40\x61\40\x57\x48\105\122\x45\x20\x61\56\x6e\157\x6d\142\162\145\75\x27{$a}\47")->row(); return $bd->codigo; } public function loguser($a, $b) { if ($this->session->userdata("\x63\157\144") == null || $this->session->userdata("\x63\x6f\144") == '') { $cod = 0; } else { $cod = $this->session->userdata("\x63\157\x64"); } $datos = array("\x69\144\x75\x73\x65\x72" => $cod, "\155\157\x64\165\x6c\157" => $a, "\x64\x65\x73\x63\x72\151\x70" => $b, "\146\x63\150\x61" => date("\131\55\155\x2d\x64\x20\x48\72\151\72\x73")); $this->db->insert("\x6c\x6f\147\165\x73\x65\x72", $datos); } public function admruleta() { $item = $this->itruleta(); $html = ''; $part = $this->db->query("\123\x45\x4c\105\x43\x54\x20\52\40\106\x52\x4f\115\x20\147\x6e\162\165\x6c\145\164\x61")->result_array(); $html .= "\xa\40\40\40\40\74\x64\x69\x76\x20\151\x64\x3d\42\x6f\x76\145\x72\x66\x6c\x6f\167\61\42\40\x63\154\141\x73\x73\75\42\x77\63\x2d\x63\x6f\154\x20\x73\x36\40\x77\63\55\162\x65\x73\x70\157\x6e\x73\151\x76\x65\40\x77\x33\55\163\x6f\155\x62\x72\x61\x22\x3e\12\11\74\x74\141\142\154\145\x20\143\x6c\141\x73\163\75\42\x77\x33\x2d\164\x61\142\154\x65\x2d\x61\154\x6c\40\x77\x33\x2d\x68\157\166\x65\162\141\142\154\145\x20\x77\63\55\143\x65\156\164\145\x72\145\x64\42\x20\151\x64\75\42\x74\x61\x62\x6c\x65\42\76\xa\11\74\164\162\x20\143\x6c\x61\x73\x73\x3d\x22\x77\x33\55\x62\141\x72\x72\141\x73\x22\76\x3c\x74\150\76\111\x44\x3c\x2f\164\150\x3e\74\164\x68\x3e\111\x54\105\x4d\x53\x3c\x2f\x74\150\76\x3c\x74\150\76\74\57\x74\x68\x3e\74\x2f\x74\x72\76"; $i = 0; foreach ($item as $ditem) { $id = $ditem["\151\144"]; $max = $id + 1; $i++; $html .= "\x3c\x74\x72\x3e\74\151\156\160\165\164\x20\164\x79\x70\x65\x3d\42\x68\x69\144\144\x65\156\x22\x20\151\144\x3d\x22\151\x74\145\x6d" . $i . "\x22\40\166\141\x6c\x75\145\75\x22" . $ditem["\151\144"] . "\42\76\74\x74\144\x3e" . $ditem["\151\x64"] . "\74\x2f\164\x64\76\x3c\164\144\x3e" . $ditem["\151\164\145\x6d"] . "\74\57\164\144\x3e\74\164\x64\76\74\141\x20\x6f\156\x63\154\x69\143\153\x3d\42\145\x6c\x6d\x69\164\x72\x75\x6c\50\44\50\x27\43\151\164\145\155" . $i . "\x27\51\x2e\166\x61\x6c\50\51\x29\x3b\162\145\164\x75\x72\x6e\x20\x66\141\154\x73\x65\73\x22\76\74\x69\155\147\x20\163\x72\x63\75\x22" . base_url() . "\x69\x6d\x61\147\x65\x73\x2f\x62\157\162\162\x61\x72\56\x70\156\147\42\x20\x61\154\164\75\42\x45\x6c\151\155\151\156\x61\162\x22\x20\x74\x69\164\154\145\75\42\105\154\x69\155\x69\156\141\x72\x22\x20\x73\x74\x79\154\x65\x3d\42\167\x69\144\164\150\72\x31\x36\x70\x78\x3b\150\145\151\x67\150\x74\72\x31\x36\160\x78\73\142\157\x72\x64\x65\x72\72\x30\x3b\x22\x3e\x3c\x2f\141\76\74\x2f\x74\x64\76\x3c\x2f\164\x72\x3e"; } $html .= "\74\x74\x72\76\x3c\x74\144\76" . $max . "\x3c\x2f\164\144\76\74\164\144\x3e\x3c\x69\x6e\160\x75\164\40\164\171\x70\145\75\x22\164\145\x78\164\42\40\x69\x64\x3d\x22\156\145\167\x69\164\145\x6d\x22\40\x63\154\x61\163\x73\75\42\167\x33\x2d\x69\x6e\x70\x75\x74\x22\x20\x70\x6c\141\x63\145\150\157\154\x64\x65\162\x3d\42\x6e\145\167\x2e\x2e\x2e\42\76\74\x2f\x74\x64\x3e\x3c\x74\144\76\74\x61\40\157\x6e\143\154\x69\x63\x6b\75\x22\x72\145\x67\151\x74\162\165\x6c\x28\51\x3b\x72\145\x74\x75\162\156\40\146\141\x6c\x73\x65\x3b\x22\x3e\x3c\x69\x6d\x67\x20\x73\162\x63\x3d\x22" . base_url() . "\151\x6d\x61\x67\145\163\x2f\162\x65\147\x69\163\x74\162\141\162\x2e\160\156\x67\42\x20\x61\154\164\x3d\42\122\145\x67\151\x73\x74\x72\141\162\x22\x20\164\151\x74\x6c\x65\x3d\42\122\x65\147\151\163\164\x72\141\x72\x22\40\163\x74\x79\x6c\145\x3d\x22\167\x69\144\x74\x68\x3a\x31\66\x70\x78\x3b\150\x65\x69\x67\x68\x74\x3a\x31\66\160\170\73\142\157\x72\144\x65\162\72\x30\73\x22\76\x3c\57\x61\x3e\74\57\x74\144\x3e\74\x2f\164\x72\x3e\12\x9\x3c\57\x74\x61\142\154\x65\76\12\x9\x3c\57\x64\151\x76\76\xa\xa\40\x20\40\x20\74\144\x69\166\40\x69\x64\x3d\42\x6f\166\x65\162\146\154\x6f\167\62\42\40\x63\154\141\163\163\75\x22\x77\x33\55\143\x6f\154\x20\x73\x36\x20\x77\63\55\162\x65\x73\160\157\156\163\x69\166\145\40\167\x33\55\163\x6f\155\142\x72\141\42\x3e\xa\11\x3c\x74\x61\142\x6c\x65\40\x63\154\141\163\163\75\x22\x77\63\x2d\x74\141\x62\154\145\55\141\154\154\40\x77\63\x2d\150\x6f\x76\x65\162\141\142\x6c\145\40\x77\x33\55\x63\145\156\164\145\x72\x65\x64\42\40\151\144\x3d\x22\164\x61\x62\154\x65\42\76\12\11\x3c\x74\x72\x20\x63\154\141\163\x73\75\42\x77\x33\55\142\x61\x72\162\x61\163\42\x3e\74\164\150\x3e\111\x44\74\57\164\x68\76\x3c\x74\150\x3e\107\141\x6e\x61\144\x6f\x72\x3c\x2f\x74\x68\x3e\x3c\164\x68\76\x46\145\x63\x68\x61\x3c\57\x74\x68\x3e\74\164\150\76\74\57\164\150\76\74\164\x68\x3e\74\x2f\164\x68\x3e\74\57\x74\162\76"; $i = 0; foreach ($part as $dpart) { $id = $dpart["\151\x64"]; $max = $id + 1; $i++; $nom = $this->db->query("\123\x45\114\105\x43\x54\40\156\x6f\155\142\x72\145\x20\146\162\x6f\x6d\40\x63\x6c\x69\x65\155\x70\x72\145\x20\127\110\x45\122\105\40\x6e\x72\x6f\162\x69\x66\x3d\47" . $dpart["\x69\x64\x65\156\x74\x79"] . "\x27"); if ($nom->num_rows() == 0) { $nom = $this->db->query("\123\x45\114\x45\103\124\40\156\157\155\x61\x70\x65\x20\146\x72\x6f\x6d\x20\x74\162\x61\x62\40\127\110\x45\122\105\40\143\145\144\x75\154\141\x3d\x27" . $dpart["\x69\x64\145\x6e\164\x79"] . "\x27"); if ($nom->num_rows() > 0) { $dnom = $nom->row(); $nombre = $dnom->nomape; } else { $nombre = $dpart["\151\144\x65\x6e\164\171"]; } } else { $dnom = $nom->row(); $nombre = $dnom->nombre; } $orgDate = $dpart["\146\145\x63\150\141"]; $newDate = date("\131\x6d\x64", strtotime($orgDate)); $urlimg = $dpart["\x69\x64\145\x6e\164\171"] . "\137" . $newDate; $html .= "\74\164\162\x3e\74\x69\x6e\160\x75\x74\x20\164\171\160\x65\x3d\42\x68\x69\x64\144\145\x6e\x22\x20\166\x61\154\x75\x65\75\x22" . $urlimg . "\42\x20\x69\x64\x3d\42\x62" . $i . "\42\76\74\151\156\x70\165\x74\40\x74\171\160\145\75\42\x68\151\x64\144\x65\x6e\42\x20\x69\144\75\x22\141" . $i . "\42\x20\166\x61\x6c\x75\145\75\x22" . $dpart["\x69\144"] . "\x22\76\x3c\x74\144\76" . $dpart["\151\x64"] . "\74\57\164\x64\76\74\x74\144\76" . $nombre . "\x3c\57\164\144\76\x3c\164\x64\x3e" . $dpart["\146\145\x63\150\x61"] . "\74\57\164\x64\x3e\x3c\x74\x64\76\74\141\x20\157\x6e\143\154\x69\143\153\x3d\42\x65\154\155\147\x6e\x72\165\154\50\44\x28\x27\x23\141" . $i . "\47\x29\56\166\141\x6c\x28\51\x29\x3b\162\145\164\165\162\156\x20\x66\x61\x6c\x73\x65\x3b\x22\x3e\x3c\x69\155\147\x20\163\x72\x63\75\x22" . base_url() . "\x69\155\x61\x67\x65\x73\x2f\x62\x6f\162\x72\141\x72\56\160\156\147\x22\x20\141\x6c\164\x3d\42\x45\x6c\x69\x6d\x69\156\141\162\x22\x20\x74\151\164\x6c\145\x3d\x22\105\154\x69\155\x69\156\x61\x72\x22\x20\x73\164\171\x6c\x65\x3d\x22\167\151\144\164\150\x3a\61\x36\160\x78\73\150\x65\x69\x67\150\164\x3a\x31\x36\160\x78\73\142\157\162\144\x65\162\72\x30\73\x22\x3e\x3c\x2f\x61\76\x3c\57\164\144\76\74\x74\144\x3e\x3c\141\40\x6f\156\143\x6c\x69\143\153\75\42\166\145\162\x67\x6e\x72\165\154\50\x24\50\47\43\142" . $i . "\x27\x29\x2e\166\x61\154\50\x29\x29\73\162\x65\164\165\x72\156\x20\x66\141\154\163\x65\73\x22\76\74\151\x6d\x67\x20\163\162\x63\x3d\42" . base_url() . "\x69\155\141\147\x65\163\x2f\x62\165\x73\x63\141\162\x2e\160\x6e\147\x22\40\141\x6c\x74\75\x22\126\145\x72\x22\40\164\151\x74\154\x65\75\x22\x56\145\162\42\40\x73\x74\171\x6c\x65\75\x22\167\151\x64\164\x68\x3a\x31\x36\160\x78\73\150\x65\151\147\150\x74\x3a\61\x36\160\170\73\142\x6f\x72\x64\x65\x72\72\60\73\x22\76\74\57\141\x3e\x3c\57\x74\144\x3e\74\x2f\164\162\76"; } $html .= "\xa\x9\74\x2f\x74\x61\x62\x6c\x65\x3e\12\x20\x20\40\40\74\x2f\144\151\x76\76\xa\xa\xa\40\40\x20\x20"; return $html; } public function itruleta() { $bd = $this->db->query("\123\x45\114\x45\103\x54\40\x69\x64\x2c\40\x69\x74\x65\155\x20\x46\x52\117\x4d\x20\x69\x74\x72\x75\x6c\145\164\x61\40\117\x52\104\105\x52\40\x42\x59\40\x69\x64")->result_array(); return $bd; } public function regitrul($a) { $data = array("\151\x74\x65\155" => $a); $this->db->insert("\x69\164\162\165\x6c\x65\164\x61", $data); return $this->db->affected_rows(); } public function elmitrul($a) { $this->db->query("\104\105\x4c\105\x54\x45\40\106\x52\117\x4d\40\151\164\162\x75\x6c\145\x74\141\40\x57\x48\105\122\105\x20\x69\x64\75\47{$a}\x27"); return $this->db->affected_rows(); } public function elmgnrul($a) { $this->db->query("\x44\105\114\105\x54\105\40\106\x52\x4f\x4d\x20\147\x6e\x72\165\154\145\x74\141\40\x57\110\x45\x52\105\x20\151\x64\x3d\x27{$a}\47"); return $this->db->affected_rows(); } public function valgnrul($a) { $bd = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\x4e\125\114\x4c\x20\106\x52\117\115\40\x67\156\x72\165\x6c\x65\x74\141\x20\x57\110\x45\x52\x45\40\151\144\145\x6e\164\171\x3d\47{$a}\47"); return $bd->num_rows(); } public function reggnrul($a) { $this->db->insert("\x67\x6e\162\165\x6c\x65\x74\x61", $a); } function reportvtagrup($inic, $fin, $grup) { if ($grup == "\124\x4f\124") { $sql = ''; } else { $sql = "\x26\46\40\123\125\x42\123\x54\x52\x28\141\56\143\157\144\151\x67\x6f\54\x31\x2c\x33\x29\75\x22" . $grup . "\42"; } return $this->db->query("\123\105\x4c\x45\x43\124\x20\x61\x2e\143\157\x64\151\147\157\54\x61\x2e\156\x6f\155\142\x72\x65\54\x20\122\117\125\x4e\x44\x28\x53\125\115\x28\141\56\x63\x61\156\164\151\x64\141\144\x2d\x61\x2e\x63\156\x74\144\145\x76\x75\x65\154\164\51\54\62\51\40\x75\x6e\x69\x64\x61\x64\145\163\x2c\x20\x52\x4f\125\116\x44\50\123\125\x4d\50\x49\106\50\141\x2e\x74\x69\x70\x6f\144\x6f\143\75\47\x4e\57\x43\47\x2c\141\x2e\155\157\156\164\x6f\x74\x6f\164\141\154\52\x2d\61\x2c\141\56\155\157\x6e\164\157\164\x6f\x74\x61\154\51\x29\x2c\62\x29\x20\142\x73\x2c\122\117\125\x4e\104\x28\x53\125\115\50\x49\106\x28\x61\56\x74\x69\x70\x6f\144\x6f\143\75\x27\116\57\x43\47\x2c\x61\56\155\x6f\156\164\x6f\x74\x6f\x74\141\154\x2f\x28\x53\105\x4c\105\x43\x54\40\x6f\146\x69\x63\151\x61\x6c\40\x46\122\117\x4d\x20\155\x6f\156\x65\143\x61\x6d\40\x57\x48\105\122\105\40\x66\145\x63\150\x61\74\x3d\141\56\146\145\x63\x68\141\x64\157\x63\40\x4f\122\x44\105\122\40\102\x59\40\146\145\143\x68\x61\40\104\105\123\103\40\x4c\x49\x4d\x49\124\x20\x31\51\52\55\x31\54\141\x2e\x6d\157\156\164\157\164\157\x74\141\154\57\x28\x53\x45\114\105\x43\x54\x20\157\x66\x69\x63\x69\x61\x6c\x20\x46\122\117\x4d\x20\155\157\x6e\x65\143\x61\x6d\x20\127\x48\105\122\105\x20\146\145\143\x68\141\x3c\x3d\x61\56\146\145\143\x68\141\144\x6f\143\x20\117\122\x44\x45\x52\40\x42\131\x20\146\145\143\x68\x61\40\x44\x45\123\103\40\x4c\x49\x4d\111\124\x20\61\51\x29\51\54\x32\x29\40\144\157\154\141\162\x20\106\122\x4f\115\x20\x6f\x70\x65\162\x6d\x76\x20\141\xa\40\40\x20\40\127\x48\105\122\x45\x20\x61\x2e\146\145\143\150\x61\x64\x6f\x63\x3e\x3d\47{$inic}\x27\x20\46\x26\40\x61\x2e\146\x65\x63\150\x61\144\x6f\x63\x3c\x3d\47{$fin}\x27\x20\46\46\40\x28\x61\x2e\164\x69\160\x6f\x64\x6f\x63\75\x27\106\x41\x43\x27\40\174\174\40\x61\56\x74\x69\x70\x6f\x64\157\x63\x3d\x27\x4e\x4f\124\x27\x20\x7c\174\x20\141\56\x74\151\x70\x6f\144\157\x63\x3d\47\116\57\103\47\51\x20" . $sql . "\40\40\107\122\x4f\125\x50\40\102\x59\40\x61\56\143\x6f\144\151\147\x6f\xa\40\x20\40\x20\x55\x4e\111\x4f\116\xa\40\40\40\40\x53\x45\x4c\105\x43\x54\40\x6e\x75\154\154\54\x6e\x75\154\154\x2c\x52\x4f\125\116\104\x28\123\x55\115\50\x61\x2e\x63\141\156\x74\x69\144\141\x64\x2d\x61\x2e\143\x6e\x74\144\x65\166\165\145\154\x74\51\54\62\51\40\x75\156\151\x64\141\x64\145\163\x2c\x20\x52\117\125\116\x44\50\x53\x55\x4d\x28\111\x46\x28\x61\x2e\x74\x69\x70\x6f\x64\x6f\x63\x3d\47\116\x2f\x43\x27\x2c\141\x2e\x6d\157\156\x74\x6f\164\x6f\164\x61\x6c\x2a\55\x31\54\141\56\155\157\x6e\164\157\x74\x6f\164\141\x6c\51\51\54\62\x29\40\142\163\x2c\x52\x4f\x55\116\x44\50\x53\x55\x4d\x28\x49\x46\50\141\56\164\151\x70\157\144\157\x63\75\47\x4e\57\x43\x27\x2c\141\x2e\155\157\x6e\164\x6f\164\157\164\x61\x6c\x2f\50\123\105\114\x45\103\124\40\x6f\146\x69\143\x69\141\154\40\106\122\117\115\x20\155\157\156\145\143\x61\155\40\x57\110\x45\122\105\40\x66\x65\x63\150\x61\x3c\75\141\x2e\x66\145\143\150\141\x64\157\143\x20\117\122\104\x45\122\40\x42\131\40\146\x65\143\150\x61\40\104\105\123\x43\40\114\x49\115\x49\124\x20\x31\51\52\55\x31\54\141\56\155\x6f\156\164\157\x74\x6f\164\x61\154\57\50\123\105\x4c\x45\x43\x54\x20\x6f\146\x69\143\151\141\x6c\x20\106\122\117\115\40\155\157\156\145\143\x61\155\40\127\x48\105\122\105\x20\146\145\143\150\141\x3c\x3d\141\56\146\x65\143\x68\x61\x64\157\x63\40\x4f\x52\104\105\122\40\102\x59\x20\146\x65\x63\150\x61\40\x44\x45\x53\x43\40\114\111\x4d\111\124\x20\61\x29\x29\51\54\x32\51\x20\144\x6f\154\141\x72\x20\x46\122\117\115\x20\157\x70\145\x72\155\166\40\141\xa\40\40\x20\40\x57\110\x45\122\105\x20\141\x2e\x66\x65\x63\150\x61\x64\157\x63\x3e\75\x27{$inic}\x27\40\46\46\40\x61\56\146\145\143\150\x61\x64\157\x63\74\x3d\47{$fin}\47\40\x26\x26\x20\x28\x61\x2e\164\x69\160\157\x64\157\143\75\x27\106\101\103\x27\x20\x7c\174\x20\141\56\x74\x69\160\157\x64\157\x63\75\47\x4e\x4f\124\x27\x20\174\174\x20\141\x2e\x74\151\160\x6f\144\157\x63\x3d\x27\x4e\57\x43\47\51\x20" . $sql . ''); } function reportcobroefectivo($inic, $fin) { return $this->db->query("\x53\105\x4c\x45\x43\x54\x20\x76\145\156\x64\x65\144\x6f\x72\x2c\x73\x65\143\164\157\x72\54\163\165\142\163\145\x63\x74\157\162\x2c\x65\x6d\151\163\x69\157\x6e\54\x72\145\x63\145\x70\143\x69\x6f\x6e\54\166\x65\156\x63\x65\40\x76\x5f\x69\x6e\144\x65\x78\54\40\166\x65\156\143\x65\x63\x20\x76\137\x63\162\145\x64\x69\164\157\54\144\151\x61\x73\x63\162\x65\x64\x2c\144\151\x61\x73\x69\x6e\144\145\x78\54\x66\x70\141\147\157\54\146\x72\x65\147\x2c\143\x6f\144\143\154\151\145\x6e\164\145\x2c\156\157\155\142\162\x65\143\154\151\x2c\x64\x6f\143\x75\x6d\145\156\164\x6f\x2c\x52\x4f\125\116\x44\x28\x74\x6f\164\x6e\145\x74\157\x2c\62\x29\164\157\164\x6e\x65\164\157\54\122\x4f\125\116\104\50\x74\157\x74\x6e\145\x74\x6f\x2f\x74\x61\163\141\x2c\x32\51\x20\164\157\x74\x6e\x65\x74\x6f\x64\54\x52\x4f\125\x4e\x44\x28\x74\157\x74\151\155\160\x75\145\163\164\54\x32\x29\164\x6f\164\151\155\160\165\x65\x73\x74\54\xa\40\40\40\x20\x52\x4f\125\116\x44\50\x74\157\x74\141\154\146\151\156\x61\154\x2c\x32\x29\x74\x6f\x74\141\x6c\x66\x69\156\x61\154\x62\x73\x2c\122\117\125\x4e\104\x28\x69\x6e\x64\x65\170\156\x64\54\x32\51\151\156\144\145\x78\156\x64\54\x52\x4f\125\116\104\x28\x74\157\164\x61\154\146\151\x6e\141\x6c\x24\x2c\x32\x29\x20\x74\157\164\x61\154\x66\x69\x6e\x61\154\x24\x2c\156\143\x2c\x52\x4f\125\x4e\104\50\x72\145\164\57\x74\x61\163\x61\54\62\51\40\162\x65\164\54\111\x46\50\164\x69\x70\157\160\x61\x67\x6f\75\x27\x55\123\x44\47\54\160\141\x67\141\x64\x6f\x64\x2c\160\x61\x67\x61\144\x6f\x62\x73\51\x20\160\x61\147\141\144\157\x2c\164\x69\x70\x6f\160\x61\147\157\x2c\x6d\x6f\144\x6f\160\x61\147\x6f\x2c\142\x61\x6e\143\157\x2c\x72\x65\146\x65\162\145\156\x63\151\141\xa\40\40\40\40\x46\122\x4f\x4d\40\50\12\40\x20\x20\x20\x53\105\114\x45\103\124\x20\x28\x53\105\114\x45\103\x54\40\x6e\157\x6d\x62\162\145\40\106\x52\x4f\x4d\x20\154\151\163\164\x76\145\x6e\x64\x20\127\x48\105\122\105\40\143\157\144\x69\x67\x6f\x3d\x61\x2e\x76\x65\x6e\144\145\144\157\x72\40\114\x49\115\x49\x54\40\61\x29\x20\166\x65\156\x64\x65\x64\157\x72\54\xa\40\40\x20\40\x28\123\105\x4c\x45\103\124\40\x7a\x6f\156\141\40\106\122\117\115\x20\163\145\143\x74\157\162\x65\163\40\x57\x48\x45\122\x45\x20\x63\157\144\x69\147\157\75\141\56\x73\145\143\164\157\162\x20\x4c\x49\x4d\111\x54\x20\61\51\x20\163\x65\x63\x74\157\x72\54\xa\x20\x20\x20\40\x28\123\x45\114\105\103\x54\x20\163\165\142\x73\145\143\164\x6f\x72\x20\x46\122\x4f\x4d\40\x73\x75\x62\163\x65\x63\x74\157\x72\x65\163\40\x57\x48\x45\x52\x45\x20\143\157\x64\151\x67\157\75\x61\56\163\x65\x63\x74\x6f\162\x20\x26\46\40\x73\165\x62\143\157\144\x69\147\x6f\75\x61\56\163\165\142\143\x6f\x64\151\x67\157\x20\x4c\111\115\x49\x54\x20\x31\51\x20\163\165\142\x73\145\143\x74\157\x72\54\x20\12\40\x20\40\40\141\x2e\145\x6d\x69\x73\x69\157\156\54\x61\x2e\x72\145\x63\145\160\143\151\157\156\54\x61\56\x76\x65\x6e\143\145\54\141\56\166\145\156\143\x65\x63\x2c\141\x2e\x64\x69\x61\163\x63\162\x65\x64\54\141\x2e\144\151\141\163\151\x6e\144\x65\170\x2c\142\56\146\145\x63\150\40\x66\160\141\147\157\x2c\x62\x2e\x66\162\x65\x67\x2c\x61\x2e\143\x6f\x64\x63\154\151\x65\x6e\x74\x65\x2c\x61\x2e\156\157\155\142\x72\145\143\x6c\151\x2c\x61\56\144\157\x63\165\x6d\145\x6e\x74\157\54\x61\56\164\x6f\x74\156\x65\x74\157\54\141\56\x74\x6f\164\151\x6d\160\x75\145\x73\x74\54\141\56\164\157\x74\141\x6c\146\151\x6e\x61\154\54\141\x2e\x74\x6f\164\141\x6c\144\40\164\157\x74\141\x6c\146\x69\x6e\x61\x6c\44\x2c\12\40\x20\x20\40\111\106\x28\x28\123\x45\x4c\x45\103\x54\x20\x74\x6f\x74\x61\154\x66\x69\x6e\x61\x6c\40\x46\x52\117\115\40\157\160\145\x72\x74\x69\x20\127\x48\105\122\x45\x20\162\145\x66\145\162\x65\x6e\143\x69\x61\75\x43\x4f\116\103\x41\124\50\x61\x2e\164\x69\160\x6f\144\x6f\143\x2c\141\x2e\x64\x6f\143\165\x6d\145\x6e\164\x6f\51\40\x26\x26\x20\x74\151\x70\157\144\x6f\143\x3d\47\x4e\57\x44\x27\x20\x26\46\40\145\163\x74\141\x74\x75\x73\x64\157\x63\41\75\47\130\x27\40\x4c\111\x4d\111\124\x20\61\x29\x3e\60\x2c\50\123\105\x4c\x45\103\124\40\164\157\164\x61\x6c\x66\x69\156\x61\x6c\40\106\122\x4f\x4d\40\157\x70\x65\x72\164\151\40\127\110\x45\122\105\x20\162\145\146\145\162\145\156\x63\151\141\75\103\x4f\116\x43\x41\124\50\x61\56\x74\x69\x70\x6f\x64\157\x63\54\x61\56\x64\x6f\143\165\x6d\x65\156\x74\x6f\x29\x20\x26\x26\40\x74\x69\x70\157\x64\x6f\143\x3d\47\116\x2f\104\47\40\46\46\x20\145\x73\x74\141\164\x75\163\x64\x6f\143\41\75\x27\x58\47\40\x4c\x49\x4d\x49\x54\x20\x31\x29\54\x30\51\x20\151\x6e\x64\x65\170\156\x64\x2c\12\40\40\x20\x20\x49\106\x28\x28\123\x45\114\105\x43\x54\x20\123\125\115\50\164\157\164\x61\x6c\x64\51\x20\x46\122\x4f\115\40\141\x70\154\x69\x63\141\x6e\143\40\x57\x48\105\122\x45\x20\x66\141\143\x3d\x61\56\144\157\x63\x75\x6d\145\x6e\164\157\51\76\x30\54\x28\x53\105\114\x45\x43\124\x20\x53\125\115\x28\164\x6f\x74\x61\x6c\144\51\x20\x46\122\117\115\x20\x61\x70\x6c\151\x63\141\156\x63\x20\127\x48\x45\122\105\40\x66\x61\x63\x3d\x61\x2e\144\157\143\165\155\x65\x6e\x74\157\51\54\x30\51\x20\x6e\x63\54\xa\40\x20\x20\x20\x49\x46\x28\50\123\105\114\x45\x43\124\x20\164\157\164\x61\x6c\x66\151\x6e\x61\154\x20\x46\122\117\x4d\40\157\160\145\x72\164\x69\x20\x57\x48\105\122\x45\40\164\151\x70\157\x64\x6f\x63\75\47\122\x45\x54\47\x20\x26\46\x20\x72\145\146\145\x72\145\156\x63\x69\141\75\103\117\x4e\103\101\124\50\x61\x2e\164\x69\160\x6f\x64\x6f\x63\x2c\x61\x2e\144\157\143\165\155\x65\156\x74\x6f\x29\x29\x3e\60\x2c\50\x53\x45\x4c\105\x43\x54\40\x74\157\x74\141\154\x66\x69\156\x61\x6c\40\x46\122\x4f\115\x20\x6f\160\145\162\164\x69\x20\127\x48\x45\122\x45\x20\164\151\x70\157\x64\x6f\x63\x3d\x27\122\105\x54\x27\40\x26\x26\40\x72\x65\146\145\162\145\156\x63\151\141\x3d\103\117\x4e\103\x41\124\50\x61\x2e\164\x69\160\x6f\144\x6f\x63\54\141\x2e\144\157\x63\165\155\145\156\164\x6f\51\x29\54\60\51\x20\162\145\x74\x2c\12\x20\x20\40\40\50\123\x45\x4c\105\103\124\40\155\157\x6e\145\144\x61\x20\106\122\117\x4d\40\157\160\x65\x72\143\154\x69\x20\167\150\x65\162\145\x20\151\144\146\x61\143\75\x61\x2e\x64\x6f\x63\x75\x6d\145\156\x74\x6f\x20\x4f\x52\104\105\122\40\102\x59\40\146\162\145\x67\x20\x44\x45\123\103\40\154\x69\155\x69\164\x20\61\51\x20\164\151\160\x6f\160\141\147\x6f\x2c\12\x20\40\x20\x20\107\x52\117\125\120\137\x43\x4f\x4e\103\101\x54\x28\142\56\164\x69\x70\x29\x20\x6d\157\144\157\160\x61\147\157\54\xa\x20\x20\x20\40\x47\122\117\125\120\x5f\x43\x4f\116\103\x41\124\50\x28\123\x45\114\x45\x43\x54\x20\156\x6f\x6d\x20\x46\x52\x4f\x4d\x20\x62\x61\156\144\145\x73\x74\x20\127\110\x45\122\x45\40\151\144\x3d\x62\56\x62\141\x6e\143\144\145\163\164\x29\51\x20\x62\141\156\x63\x6f\54\12\x20\40\40\x20\107\x52\x4f\x55\120\137\103\117\x4e\x43\101\124\x28\x62\x2e\x72\145\146\51\x20\162\145\x66\145\x72\145\156\143\151\x61\54\xa\40\40\x20\x20\50\123\x45\114\x45\x43\x54\40\123\125\x4d\x28\143\56\155\x6f\156\x74\x6f\x29\x20\106\x52\117\115\40\x6f\x70\x65\162\x63\x6c\x69\x20\x63\x20\127\110\105\x52\x45\40\x63\56\x69\x64\x66\x61\143\x3d\x61\x2e\x64\157\x63\x75\x6d\145\156\x74\x6f\x20\x26\x26\40\143\x2e\151\144\x63\157\156\163\142\141\156\x63\40\111\x53\40\116\117\x54\x20\x4e\x55\x4c\114\x29\40\x70\141\x67\x61\144\x6f\x62\163\54\xa\x20\40\x20\40\50\x53\105\114\105\x43\x54\40\123\125\x4d\50\143\x2e\x6d\x6f\x6e\164\x6f\144\x29\x20\106\x52\x4f\115\x20\x6f\x70\145\x72\x63\x6c\x69\x20\143\40\127\110\x45\122\105\40\x63\56\151\x64\146\141\143\x3d\x61\x2e\144\157\x63\x75\x6d\x65\156\164\x6f\x20\x26\x26\x20\143\x2e\151\x64\143\x6f\156\163\x62\x61\x6e\143\40\111\123\40\x4e\117\x54\40\116\x55\x4c\114\x29\x20\x70\141\147\x61\x64\157\x64\x2c\12\40\x20\x20\40\50\123\105\114\x45\103\124\40\157\146\151\x63\x69\x61\x6c\40\106\122\117\115\40\x6d\157\x6e\145\x63\141\155\40\x57\x48\105\x52\x45\x20\x66\145\143\x68\x61\74\x3d\x61\56\146\x65\x63\x68\x61\143\162\x65\141\40\x4f\122\104\105\122\x20\x42\x59\40\x66\x65\x63\150\x61\40\104\105\x53\103\40\114\x49\115\111\124\40\x31\x29\x20\164\x61\x73\x61\12\x20\40\40\x20\x46\x52\x4f\x4d\40\157\160\145\162\164\151\40\x61\x20\112\117\x49\116\x20\157\x70\145\x72\143\154\x69\x20\142\x20\117\x4e\40\x28\x61\56\144\157\x63\x75\x6d\145\156\164\157\x3d\x62\x2e\151\x64\x66\x61\143\40\x26\x26\40\x62\56\x66\x72\x65\147\x3e\75\47{$inic}\47\51\12\40\x20\x20\x20\127\110\105\x52\x45\40\142\56\x66\x72\x65\x67\x3e\75\47{$inic}\x27\40\46\x26\x20\142\56\x66\x72\145\x67\74\75\47{$fin}\47\40\x26\x26\x20\50\x61\x2e\x74\151\x70\x6f\x64\x6f\143\75\47\106\101\x43\47\40\174\x7c\40\x61\x2e\164\x69\x70\x6f\x64\x6f\143\75\47\x4e\117\124\x27\51\40\46\x26\40\142\56\151\144\x63\157\156\163\142\x61\x6e\x63\40\111\123\x20\116\x4f\x54\40\x4e\125\114\x4c\x20\46\46\40\50\123\x55\102\x53\x54\122\x28\x61\x2e\143\157\x64\x63\x6c\151\145\156\164\145\x2c\61\x2c\x33\51\x21\x3d\47\x49\x4e\x54\47\x20\x26\46\40\141\x2e\x63\157\x64\x63\154\151\x65\156\164\145\x21\75\47\115\x46\60\x30\60\x30\x27\x29\xa\40\x20\40\40\x47\x52\x4f\125\x50\x20\x42\131\40\x61\x2e\144\157\x63\165\155\x65\x6e\x74\157\x29\40\143\x6f\142\162\x61\156\x7a\141\x65\x66\145\143\164\x69\166\x61\40\127\x48\105\122\x45\x20\160\141\147\x61\144\x6f\x64\53\x6e\143\x2b\x28\x72\x65\164\57\164\x61\x73\141\x29\76\x3d\x28\164\157\x74\141\154\x66\151\x6e\141\x6c\44\55\60\56\x35\51\40\117\x52\104\x45\x52\40\102\131\40\144\x6f\x63\x75\155\145\x6e\164\157\40\x41\x53\103\73"); } function reportcierrecaja($ini, $fin) { return $this->db->query("\x53\x45\x4c\105\103\124\40\x61\x2e\146\x65\x63\150\40\146\145\x63\150\x61\54\50\x53\105\114\105\103\124\x20\x43\x4f\x4e\103\101\x54\50\x63\x6f\x64\x63\154\151\x65\156\164\145\x2c\x27\x20\47\54\x6e\x6f\x6d\142\x72\145\143\154\151\x29\40\106\122\117\115\x20\157\x70\145\x72\x74\151\x20\127\110\105\x52\x45\x20\144\x6f\x63\x75\x6d\x65\x6e\164\x6f\75\x61\56\151\x64\146\x61\x63\x20\46\46\40\40\50\x74\x69\x70\157\144\157\143\75\x27\x4e\x4f\124\47\x20\174\x7c\x20\x74\151\160\x6f\144\157\143\x3d\x27\x46\x41\x43\47\x29\x20\114\x49\115\111\x54\x20\x31\x29\x20\x63\x6c\x69\145\x6e\164\x65\54\x47\122\117\x55\120\137\x43\117\116\x43\x41\124\50\x69\x64\x66\x61\x63\x20\123\x45\120\x41\122\x41\124\117\x52\40\47\55\x27\51\40\146\141\x63\164\x75\162\141\x2c\40\164\151\x70\x20\x74\151\160\x6f\x5f\x70\x61\x67\157\x2c\x20\x6d\157\156\145\144\141\54\40\x72\145\146\x20\x72\145\x66\145\x72\x65\156\x63\151\x61\x2c\12\40\x20\40\40\50\x53\105\114\105\x43\x54\x20\x6e\x6f\155\x20\106\x52\117\115\x20\142\x61\156\x6f\162\x69\x20\x57\x48\105\x52\105\40\151\x64\75\141\56\142\141\x6e\x63\x6f\x72\151\x29\40\x62\141\156\x63\157\137\157\162\151\x67\145\156\54\xa\x20\40\x20\40\x28\x53\105\x4c\x45\x43\x54\40\156\x6f\x6d\x20\x46\x52\x4f\115\x20\142\x61\x6e\x64\145\163\164\40\127\110\x45\122\105\x20\151\144\75\x61\x2e\x62\141\x6e\143\x64\x65\x73\x74\51\40\x62\x61\x6e\x63\157\137\144\145\x73\x74\x69\x6e\157\54\40\123\x55\115\50\x61\56\155\157\x6e\x74\x6f\51\x20\142\x73\54\x53\x55\115\50\141\x2e\155\x6f\156\164\157\x64\51\x20\44\54\xa\x20\40\40\40\x28\x53\105\x4c\105\x43\x54\40\156\157\x6d\x61\x70\x65\40\x46\122\117\115\x20\164\162\x61\x62\x20\127\x48\105\122\105\40\151\x64\x3d\141\x2e\x60\x75\163\145\x72\x60\51\x20\165\163\165\x61\162\x69\x6f\x20\xa\x20\40\x20\x20\40\x46\122\x4f\x4d\x20\x6f\160\145\x72\x63\x6c\x69\x20\141\40\x57\x48\x45\x52\x45\x20\141\x2e\x69\x64\x63\157\156\163\142\x61\x6e\x63\x20\111\123\x20\x4e\117\x54\x20\116\x55\114\x4c\40\46\46\x20\x61\x2e\151\144\x63\x6f\156\x73\142\141\x6e\143\76\x30\40\46\46\40\141\56\146\x65\x63\x68\x3e\x3d\x27{$ini}\x27\x20\46\x26\40\141\56\x66\x65\143\150\74\x3d\x27{$fin}\x27\12\40\x20\x20\x20\40\x47\122\x4f\125\x50\x20\102\131\40\141\56\151\x64\143\157\156\x73\x62\x61\x6e\x63\12\40\x20\x20\40\40\x55\116\111\x4f\116\xa\x20\x20\40\40\40\x53\105\x4c\105\103\x54\x20\x61\x2e\x66\x65\143\150\40\146\145\x63\x68\141\x2c\x28\123\x45\x4c\x45\x43\124\x20\103\117\116\103\101\124\50\x63\x6f\144\143\154\151\145\156\x74\145\x2c\47\40\47\x2c\x6e\x6f\x6d\142\162\x65\x63\x6c\151\x29\40\106\122\x4f\x4d\40\157\x70\145\162\x74\x69\40\127\110\x45\x52\x45\40\144\157\143\x75\x6d\x65\156\x74\157\x3d\141\56\151\144\146\141\x63\x20\x26\46\40\x20\50\164\x69\x70\157\x64\x6f\143\75\47\116\x4f\x54\x27\x20\x7c\x7c\x20\x74\x69\x70\157\144\x6f\143\75\x27\x46\101\x43\47\x29\40\114\x49\x4d\x49\124\40\61\x29\x20\143\x6c\151\x65\156\164\145\54\107\x52\x4f\125\120\137\103\117\116\103\x41\x54\50\x69\x64\x66\141\x63\x20\x53\x45\x50\x41\122\x41\124\117\122\x20\47\55\47\x29\40\x66\x61\143\164\165\162\x61\54\40\164\x69\x70\x20\164\x69\160\157\x5f\x70\x61\147\x6f\54\x20\155\157\156\x65\x64\x61\x2c\x20\x72\x65\x66\x20\x72\145\x66\x65\x72\145\156\143\x69\x61\54\xa\x20\x20\x20\40\50\x53\105\114\x45\x43\x54\40\156\x6f\x6d\40\x46\122\x4f\115\40\142\141\156\157\x72\x69\x20\127\110\105\x52\x45\40\151\x64\x3d\x61\x2e\142\x61\156\143\x6f\x72\151\51\40\142\141\x6e\143\157\x5f\x6f\162\151\147\x65\156\54\12\40\x20\40\x20\50\123\105\114\105\103\x54\40\x6e\x6f\155\x20\x46\x52\117\115\40\142\141\156\x64\x65\x73\x74\40\127\x48\x45\122\105\40\151\x64\x3d\141\x2e\142\141\x6e\x63\144\145\163\x74\51\x20\142\x61\x6e\x63\x6f\137\x64\x65\163\164\x69\x6e\x6f\54\x20\x61\x2e\x6d\157\x6e\x74\157\40\x62\163\x2c\x61\x2e\155\157\x6e\164\157\x64\40\x24\54\xa\40\40\40\x20\x28\x53\x45\114\105\x43\x54\x20\156\157\155\141\160\145\40\x46\122\x4f\x4d\x20\164\162\x61\142\40\x57\x48\105\122\105\40\151\x64\x3d\x61\56\x60\165\x73\145\162\140\x29\40\x75\163\x75\x61\x72\x69\157\x20\12\40\40\x20\40\40\106\122\117\115\x20\157\160\145\162\143\x6c\x69\40\x61\x20\127\x48\105\x52\x45\x20\x61\x2e\x69\x64\143\157\156\x73\x62\141\x6e\x63\40\x49\123\40\116\117\124\40\x4e\x55\114\x4c\x20\x26\x26\x20\141\56\x69\x64\x63\x6f\x6e\163\142\x61\x6e\143\x3d\60\x20\x26\x26\x20\141\56\146\145\x63\x68\x3e\x3d\x27{$ini}\x27\x20\x26\x26\40\x61\x2e\146\145\x63\150\74\x3d\x27{$fin}\47"); } function reportreparto($inic, $fin) { return $this->db->query("\123\105\114\105\x43\124\40\142\56\x72\145\160\141\x72\164\157\54\x61\56\x72\165\x74\x61\x2c\143\x2e\x64\157\143\165\155\x65\156\164\x6f\x2c\143\56\143\x6f\x64\x63\154\x69\145\x6e\164\x65\54\143\x2e\x6e\x6f\155\x62\x72\x65\x63\154\x69\54\x28\123\x45\114\105\x43\124\x20\156\157\155\x61\x70\145\x20\106\x52\117\115\40\164\162\141\x62\40\127\x48\105\x52\105\x20\x69\x64\x3d\141\56\x63\150\157\146\x65\162\x31\51\40\143\x68\157\146\145\x72\61\x2c\50\x53\105\x4c\105\x43\x54\40\156\x6f\155\141\160\145\40\x46\122\117\x4d\40\164\162\x61\x62\40\127\x48\105\x52\x45\x20\151\x64\75\141\x2e\x63\x68\157\x66\x65\x72\x32\51\x20\143\x68\x6f\146\x65\162\x32\54\50\x53\105\x4c\x45\x43\124\40\103\x4f\125\x4e\124\x28\151\144\x29\x20\106\122\x4f\115\x20\x62\165\x6c\x74\x6f\x73\40\x57\x48\x45\122\x45\x20\144\x6f\143\x3d\x63\56\x61\x6e\164\x64\157\x63\40\x47\122\x4f\125\120\x20\102\131\40\x64\157\143\51\40\x62\165\x6c\164\157\163\54\x52\x4f\125\x4e\x44\50\x28\x53\105\x4c\x45\103\124\40\x53\x55\x4d\50\x63\141\156\164\151\144\x61\x64\x2d\143\x6e\x74\x64\145\166\165\145\x6c\164\51\40\106\122\x4f\x4d\x20\157\160\145\162\x6d\166\40\x57\x48\105\122\105\40\164\x69\x70\x6f\x64\157\x63\x3d\x63\56\164\x69\160\x6f\x64\157\143\40\46\46\40\144\x6f\143\x75\155\145\x6e\164\x6f\x3d\x63\x2e\x64\x6f\x63\165\x6d\x65\156\164\x6f\x29\51\40\x55\x6e\151\144\54\141\56\146\x65\143\x68\40\x63\141\162\x67\141\x64\x6f\54\141\x2e\x65\x6e\x74\162\145\x67\x61\144\157\xa\x20\x20\40\40\x46\x52\x4f\x4d\40\162\145\x70\x61\x72\x74\x6f\x20\141\40\112\117\111\x4e\x20\143\x6f\x6e\x74\x72\x6f\154\137\x6f\160\x65\162\164\151\x20\142\40\x4f\116\40\x61\x2e\151\x64\x3d\142\x2e\162\x65\160\141\x72\x74\157\40\x4a\x4f\x49\116\x20\x6f\160\145\162\164\151\x20\143\40\117\116\x20\142\x2e\144\x6f\x63\x3d\143\56\141\156\164\x64\157\x63\40\x26\x26\40\x28\143\x2e\x74\x69\x70\157\x64\157\143\x3d\x27\x46\x41\x43\47\x20\x7c\174\x20\143\56\x74\x69\160\157\x64\157\x63\75\x27\x4e\x4f\124\x27\x29\xa\x20\x20\x20\40\x57\110\x45\x52\105\40\141\56\x66\x65\x63\x68\x3e\75\x27{$inic}\x27\x20\46\x26\x20\x61\56\146\145\x63\x68\x3c\75\47{$fin}\47\x20\x4f\x52\104\x45\x52\x20\x42\x59\40\142\56\x72\x65\x70\141\162\x74\157\40\x41\123\x43"); } function reportbackorder($inic, $fin) { $datos = $this->db->query("\123\105\114\x45\103\124\x20\141\x2e\143\x6f\144\x69\147\157\54\x28\x53\x45\114\105\x43\124\40\156\x6f\155\142\162\x65\x20\106\122\x4f\x4d\40\x61\x72\164\x69\143\x75\154\x6f\x20\167\x68\x65\162\x65\x20\x63\157\x64\x69\147\157\x3d\141\x2e\x63\157\144\151\x67\x6f\x29\x20\156\x6f\x6d\142\x72\145\x2c\x53\125\115\x28\141\x2e\x63\141\x6e\x74\x6f\162\x67\51\x20\160\x65\144\x69\x64\x6f\54\x53\125\x4d\50\x61\x2e\x63\141\156\x74\146\151\x6e\x29\40\160\162\x6f\x63\145\163\x61\144\157\54\123\125\x4d\x28\141\56\143\141\x6e\164\157\x72\147\51\55\x53\x55\115\x28\x61\56\x63\x61\x6e\x74\x66\x69\x6e\51\x20\x70\x65\156\144\151\145\156\x74\145\40\x46\122\x4f\x4d\40\142\141\x63\x6b\157\162\144\145\162\40\x61\x20\xa\40\40\x20\40\112\117\111\x4e\x20\x6f\160\145\162\x74\x69\x20\142\40\117\116\x20\50\x61\56\144\157\143\75\142\x2e\x61\156\x74\144\x6f\143\x20\x26\46\40\x62\x2e\x66\x65\x63\x68\141\143\162\145\141\x3e\x3d\47{$inic}\47\40\46\x26\x20\142\x2e\x66\x65\143\x68\141\x63\162\x65\141\74\75\x27{$fin}\47\51\x20\127\110\x45\x52\105\x20\x44\x41\124\105\50\141\56\x66\x65\x63\x68\141\x29\x3e\x3d\47{$inic}\47\40\46\46\x20\104\x41\x54\105\50\x61\x2e\x66\x65\143\150\x61\51\74\75\x27{$fin}\x27\12\x20\x20\x20\x20\x26\46\40\141\56\x63\x6f\x64\x69\147\x6f\40\111\116\x20\50\123\105\114\105\103\124\40\x63\x6f\x64\x69\x67\157\x20\x46\x52\x4f\115\x20\x6f\160\145\x72\155\166\40\127\110\x45\x52\105\40\164\x69\160\157\144\157\x63\75\142\x2e\x74\151\160\x6f\144\157\143\x20\x26\46\40\x64\157\x63\x75\x6d\x65\x6e\164\157\x3d\x62\56\x64\x6f\x63\165\155\x65\156\164\x6f\40\x26\46\x20\143\x6f\144\x69\x67\x6f\75\141\x2e\x63\x6f\x64\151\147\x6f\51\xa\x20\x20\x20\x20\107\122\117\125\x50\40\102\x59\40\141\x2e\x63\157\x64\151\x67\x6f\x3b"); $totped = 0; $totpro = 0; $totpend = 0; $total = "\74\x74\x61\142\x6c\x65\40\x63\x6c\x61\x73\163\75\42\167\x33\x2d\x74\x61\142\x6c\145\55\141\x6c\x6c\40\x77\63\x2d\150\157\x76\145\x72\x61\142\x6c\x65\x20\167\63\55\x63\x65\x6e\x74\145\x72\x65\x64\x22\x3e\74\164\x72\76\74\x74\x64\40\x63\154\x61\x73\163\75\42\x77\x33\55\146\x6f\x6e\x64\157\144\x72\x6f\x69\144\x22\76\x50\145\x64\151\x64\157\74\x2f\x74\144\x3e\x3c\164\144\76" . $totped . "\x3c\57\164\x64\76\74\164\144\x20\143\154\141\x73\163\75\42\x77\x33\55\x66\157\x6e\144\157\144\x72\x6f\151\144\42\x3e\x50\162\x6f\x63\145\163\x61\144\157\x3c\x2f\x74\x64\76\x3c\x74\x64\76" . $totpro . "\x3c\57\x74\144\76\x3c\x74\x64\x20\143\x6c\141\163\x73\75\x22\167\x33\x2d\x66\x6f\x6e\144\157\144\x72\x6f\151\144\x22\x3e\120\145\x6e\144\x69\x65\156\164\x65\x3c\57\164\x64\76\x3c\x74\144\76" . $totpend . "\x3c\x2f\x74\144\76\74\57\164\162\76\74\57\164\x61\x62\x6c\x65\x3e"; return array("\144\x61\164\157\x73" => $datos, "\164\x6f\164\x61\154" => $total); } function reportbackorder2($inic, $fin) { $datos = $this->db->query("\123\105\x4c\x45\103\x54\x20\x62\x2e\x63\157\x64\x63\154\x69\145\156\x74\145\54\x62\x2e\156\x6f\155\142\x72\145\143\154\x69\x2c\141\56\x63\157\x64\x69\x67\157\54\50\x53\105\x4c\105\103\124\x20\x6e\x6f\155\142\x72\x65\40\x46\x52\x4f\x4d\x20\x61\162\164\x69\143\x75\x6c\x6f\40\167\150\145\x72\x65\40\x63\x6f\x64\151\147\157\75\x61\56\x63\157\x64\x69\147\x6f\51\40\156\x6f\x6d\x62\162\145\54\123\125\115\50\x61\x2e\143\x61\x6e\x74\157\x72\147\x29\x20\x70\x65\144\151\144\157\54\x53\125\x4d\50\141\56\143\141\x6e\x74\x66\x69\156\51\x20\x70\162\157\143\x65\x73\141\x64\157\54\123\x55\115\50\141\56\143\x61\156\x74\157\x72\x67\51\x2d\x53\x55\x4d\50\x61\56\143\141\x6e\164\x66\151\156\x29\x20\160\x65\156\144\x69\145\156\x74\145\x20\x46\122\117\x4d\x20\x62\141\x63\153\x6f\x72\x64\145\162\40\141\x20\12\x20\x20\40\40\112\x4f\x49\116\40\x6f\x70\145\x72\164\151\40\x62\40\x4f\x4e\40\50\141\x2e\144\157\x63\75\x62\56\141\156\x74\x64\x6f\143\x20\x26\46\x20\x62\56\146\x65\x63\150\141\143\162\145\141\x3e\75\x27{$inic}\47\40\x26\x26\40\x62\x2e\x66\145\143\x68\141\143\x72\145\x61\74\75\x27{$fin}\47\51\40\x57\x48\x45\x52\x45\x20\104\101\124\105\50\141\56\146\145\x63\x68\x61\51\x3e\x3d\47{$inic}\47\x20\x26\46\x20\x44\x41\124\x45\50\x61\56\146\145\143\150\x61\51\74\x3d\x27{$fin}\47\12\40\40\40\40\46\46\x20\141\x2e\x63\x6f\x64\151\x67\x6f\x20\111\116\40\50\123\105\114\105\103\124\x20\143\157\144\151\x67\157\x20\106\122\117\x4d\x20\157\160\x65\162\155\166\x20\127\110\x45\x52\105\x20\164\x69\160\157\144\x6f\143\75\142\x2e\x74\x69\160\x6f\x64\157\143\x20\46\x26\x20\144\157\x63\165\155\145\x6e\x74\157\x3d\142\x2e\x64\157\x63\x75\x6d\x65\x6e\164\x6f\40\46\46\40\x63\157\x64\x69\x67\x6f\x3d\141\x2e\143\157\144\x69\147\157\51\xa\40\x20\x20\x20\x47\122\x4f\x55\120\x20\102\131\x20\142\x2e\143\x6f\144\143\154\x69\145\156\x74\x65\54\141\x2e\x63\157\x64\x69\x67\157\x3b"); $totped = 0; $totpro = 0; $totpend = 0; foreach ($datos->result() as $db) { $totped += $db->pedido; $totpro += $db->procesado; $totpend += $db->pendiente; } $total = "\74\x74\x61\x62\x6c\145\x20\143\x6c\141\x73\163\75\x22\x77\x33\x2d\x74\141\142\154\145\55\141\x6c\x6c\40\167\63\55\x68\x6f\x76\145\162\x61\142\x6c\x65\40\167\x33\x2d\143\x65\x6e\x74\145\162\145\x64\x22\x3e\74\x74\162\x3e\x3c\164\144\x20\143\x6c\x61\163\163\x3d\42\x77\x33\x2d\x66\x6f\156\x64\157\x64\162\x6f\x69\144\x22\x3e\x50\x65\144\x69\x64\x6f\x3c\57\164\x64\x3e\74\164\144\76" . $totped . "\74\57\x74\x64\76\74\164\144\x20\143\154\141\163\x73\75\x22\167\63\x2d\x66\x6f\x6e\144\157\144\162\x6f\151\144\x22\76\120\162\x6f\x63\x65\163\x61\144\157\74\x2f\x74\144\x3e\x3c\164\x64\76" . $totpro . "\74\x2f\164\144\76\74\164\x64\x20\143\x6c\x61\x73\x73\x3d\42\x77\x33\x2d\x66\x6f\156\144\x6f\x64\162\157\151\144\x22\76\120\145\x6e\x64\151\x65\156\x74\145\x3c\57\164\144\76\74\164\144\x3e" . $totpend . "\x3c\57\164\144\76\74\x2f\x74\x72\x3e\74\x2f\164\x61\142\x6c\145\x3e"; return array("\x64\x61\164\157\163" => $datos, "\164\x6f\164\141\154" => $total); } function reportventadetallada($inic, $fin) { return $this->db->query("\123\105\114\105\x43\x54\x20\x62\56\x63\x6f\x64\x63\154\x69\x65\x6e\x74\145\x2c\142\56\x76\x65\156\x63\x65\40\x76\137\151\x6e\144\145\170\x2c\x62\x2e\x6e\x6f\x6d\x62\162\145\x63\x6c\151\x2c\142\x2e\146\x65\143\x68\141\143\x72\145\x61\x20\145\x6d\x69\x73\x69\157\x6e\x2c\x62\56\x64\157\143\165\x6d\145\x6e\164\157\x2c\x52\x4f\125\x4e\x44\x28\141\56\x70\162\x65\143\151\x6f\165\x6e\x69\x74\x2c\x32\51\40\x70\162\x65\143\151\157\x75\156\151\164\x2c\141\x2e\141\x6c\x6d\x61\143\x65\156\54\122\117\x55\x4e\x44\50\123\125\x4d\50\x61\x2e\143\141\x6e\x74\x69\144\x61\144\x29\54\60\x29\40\x63\141\156\164\x69\x64\141\144\54\122\x4f\x55\116\104\50\123\125\115\x28\141\x2e\x63\x6e\164\144\x65\166\165\145\154\x74\51\x2c\x30\51\40\143\x6e\x74\144\x65\166\165\145\154\x74\54\122\117\x55\x4e\104\x28\x61\x2e\x6d\157\156\x74\x6f\156\x65\x74\x6f\x2c\x32\51\x20\155\157\x6e\x74\x6f\x6e\145\164\x6f\54\122\x4f\125\x4e\104\50\x61\x2e\155\157\156\x74\x6f\x74\x6f\164\141\154\54\62\51\40\155\x6f\x6e\164\x6f\x74\157\164\x61\x6c\x2c\xa\x20\x20\x20\x20\162\157\165\x6e\144\50\x61\x2e\155\157\156\164\x6f\156\x65\x74\x6f\x2f\x28\x53\x45\x4c\x45\103\x54\40\x6f\x66\x69\x63\151\141\154\40\106\122\x4f\x4d\40\x6d\x6f\156\145\x63\141\x6d\x20\x57\110\105\122\x45\x20\146\145\x63\150\141\x3c\75\141\56\x66\x65\143\x68\x61\x64\157\x63\x20\x4f\x52\104\105\x52\40\x42\131\x20\146\145\143\x68\x61\x20\104\x45\123\x43\40\x4c\111\115\111\124\40\x31\x29\54\62\x29\40\155\x6f\156\164\157\x6e\x65\x74\157\x64\x2c\x20\xa\x20\x20\x20\x20\x72\x6f\165\x6e\144\50\141\x2e\x6d\157\x6e\164\157\x74\157\x74\141\154\57\x28\x53\105\x4c\105\x43\x54\40\157\x66\151\x63\x69\141\x6c\40\x46\122\x4f\x4d\40\x6d\x6f\x6e\x65\x63\141\x6d\x20\127\110\105\x52\105\40\146\145\143\x68\x61\x3c\x3d\x61\56\146\x65\x63\x68\141\x64\x6f\x63\40\x4f\x52\104\105\x52\40\102\131\x20\146\145\x63\x68\x61\x20\x44\105\123\x43\40\x4c\x49\115\x49\124\x20\x31\x29\x2c\x32\51\40\155\x6f\x6e\x74\x6f\156\164\157\164\x61\x6c\144\x2c\xa\x20\40\x20\x20\141\56\x63\157\144\x69\147\157\54\x61\56\x6c\157\164\145\x2c\x61\56\156\x6f\155\142\162\145\x2c\40\x28\x53\x45\x4c\105\103\x54\40\156\157\x6d\x62\x72\145\40\106\122\117\x4d\40\141\162\164\x69\x70\x72\x6f\166\x20\x57\110\x45\122\105\40\143\x6f\144\x69\147\x6f\75\x61\x2e\x63\x6f\x64\x69\x67\x6f\x20\114\111\115\111\124\40\61\51\x20\x70\162\157\x76\x65\x65\144\x6f\x72\x2c\40\x62\56\166\x65\156\144\x65\x64\157\x72\x20\143\x6f\x64\166\x65\156\x64\54\x20\x61\56\x64\163\143\x74\x6f\x75\x6e\x69\x74\54\141\56\144\x73\143\164\157\145\156\144\x70\x20\144\163\143\x74\x6f\x70\x72\x6f\x6d\157\x2c\12\40\x20\40\40\x28\123\x45\114\105\x43\124\40\156\x6f\155\x62\162\x65\x20\106\122\117\115\40\154\x69\163\164\166\145\x6e\x64\40\127\110\x45\x52\105\40\x63\x6f\x64\x69\x67\x6f\x3d\142\x2e\166\x65\156\x64\145\x64\x6f\x72\40\114\x49\x4d\x49\x54\40\x31\x29\x20\x6e\x6f\155\x76\145\x6e\144\x2c\xa\40\x20\x20\x20\x28\123\105\114\x45\x43\124\40\155\141\x72\143\141\40\106\122\x4f\x4d\40\x61\162\164\x69\x63\165\x6c\x6f\40\127\110\105\122\105\40\x63\x6f\x64\x69\x67\x6f\x3d\x61\x2e\143\x6f\x64\151\147\157\51\40\x6d\141\x72\143\141\54\12\40\x20\x20\x20\x28\123\x45\x4c\x45\103\124\40\x73\165\x62\x73\145\x63\x74\x6f\162\x20\x46\122\117\x4d\40\163\x75\x62\163\x65\x63\164\157\162\145\163\x20\x57\110\105\x52\105\x20\143\x6f\x64\x69\147\157\x3d\142\56\163\x65\x63\x74\x6f\x72\40\46\46\40\x73\165\x62\x63\x6f\144\x69\x67\157\x3d\x62\56\x73\x75\142\x63\157\x64\151\x67\x6f\40\114\x49\x4d\x49\124\40\x31\x29\40\x7a\x6f\156\141\xa\x20\40\x20\x20\x46\x52\117\x4d\40\157\x70\x65\162\x6d\166\x20\141\40\112\117\111\x4e\x20\157\x70\145\x72\164\151\40\x62\40\x4f\x4e\40\x28\141\x2e\x64\x6f\143\165\x6d\145\156\x74\157\75\x62\56\144\157\143\165\x6d\x65\156\x74\157\40\x26\46\40\x61\56\164\x69\x70\x6f\144\x6f\143\75\x62\56\164\x69\x70\x6f\x64\157\143\51\x20\x57\x48\x45\x52\105\40\141\x2e\x66\145\x63\150\x61\144\x6f\x63\x3e\75\x27{$inic}\47\40\46\46\40\x61\56\x66\x65\143\x68\x61\144\157\143\74\75\47{$fin}\47\x20\46\x26\x20\x28\x61\x2e\164\x69\160\x6f\144\157\x63\75\47\x4e\x4f\124\47\x20\174\x7c\40\x61\x2e\x74\151\160\157\144\x6f\143\x3d\x27\106\x41\x43\47\51\x20\46\46\40\123\x55\102\x53\x54\x52\x28\x61\56\x63\x6f\144\x69\x67\157\54\61\x2c\x33\x29\41\75\47\116\x2f\x41\x27\x20\107\x52\x4f\x55\x50\40\102\x59\x20\x61\x2e\x64\x6f\143\165\155\x65\156\x74\157\x2c\x61\56\143\x6f\144\151\x67\157\54\141\x2e\154\x6f\x74\145"); } function reportventadetallada2($inic, $fin) { return $this->db->query("\123\x45\114\105\103\x54\x20\142\x2e\x63\x6f\144\143\x6c\x69\145\156\x74\x65\x2c\x62\56\x76\x65\x6e\x63\x65\40\x76\x5f\x69\156\144\145\x78\54\142\x2e\x6e\157\x6d\x62\x72\145\x63\154\x69\x2c\142\56\x66\x65\x63\150\x61\x63\162\145\141\40\x65\x6d\x69\163\151\157\x6e\x2c\142\56\x64\157\143\165\x6d\x65\x6e\x74\x6f\x2c\x52\117\125\x4e\104\x28\141\x2e\143\x6f\163\164\157\x75\x6e\151\x74\54\x32\51\x20\143\x6f\163\164\x6f\x24\54\122\x4f\125\x4e\x44\x28\141\x2e\143\x6f\x73\x74\x6f\x75\x6e\x69\164\52\x28\x53\x45\x4c\x45\103\124\40\157\x66\151\143\x69\141\x6c\x20\x46\122\x4f\115\40\x6d\157\156\145\x63\141\155\40\127\x48\105\x52\x45\40\x66\145\143\x68\x61\74\x3d\x61\x2e\x66\x65\x63\x68\141\x64\x6f\143\40\x4f\122\104\105\122\x20\102\131\40\146\x65\x63\x68\x61\40\x44\x45\x53\103\x20\114\111\115\111\x54\x20\x31\x29\x2c\x32\51\40\x63\x6f\163\164\x6f\x62\x73\54\x52\117\x55\116\x44\50\x61\56\160\x72\145\x63\151\x6f\x6f\162\151\147\151\x6e\141\x6c\x2f\50\x53\x45\x4c\105\103\124\x20\157\x66\151\143\151\x61\x6c\40\x46\x52\x4f\115\x20\155\157\x6e\x65\x63\141\155\x20\127\x48\105\122\x45\x20\x66\145\x63\x68\x61\74\75\x61\x2e\146\x65\143\x68\x61\144\157\143\40\x4f\122\104\105\122\x20\102\131\x20\x66\x65\143\150\x61\40\x44\105\123\x43\40\x4c\111\115\x49\x54\40\x31\51\x2c\x32\51\x20\x70\x72\x65\x63\151\x6f\x6f\x72\151\147\151\156\141\x6c\44\54\x52\117\125\116\x44\x28\141\x2e\x70\162\145\143\x69\157\157\162\151\x67\151\x6e\141\154\54\62\x29\40\x70\x72\145\143\x69\x6f\x6f\x72\151\147\151\156\141\x6c\x42\163\x2c\141\56\x61\154\x6d\141\143\145\x6e\x2c\122\117\x55\116\104\50\x53\x55\x4d\50\x61\x2e\x63\x61\x6e\x74\151\x64\141\x64\x29\x2c\x30\51\40\x63\141\156\164\x69\x64\141\x64\54\122\117\125\x4e\x44\50\123\125\115\x28\x61\x2e\x63\156\x74\144\x65\166\165\x65\x6c\164\x29\x2c\x30\x29\40\143\x6e\x74\x64\x65\x76\x75\145\154\x74\54\122\117\x55\x4e\x44\50\141\56\x6d\157\156\164\x6f\x6e\145\164\157\x2c\62\51\x20\x6d\157\156\164\157\x6e\x65\164\157\x2c\122\x4f\x55\116\104\50\x61\x2e\155\157\x6e\164\157\x74\x6f\x74\141\154\x2c\62\51\x20\155\157\156\164\x6f\x74\x6f\164\x61\154\54\12\x20\40\x20\40\x72\157\x75\x6e\144\x28\141\x2e\155\157\x6e\164\x6f\x6e\145\164\x6f\57\x28\123\x45\114\105\x43\124\40\157\x66\x69\x63\151\x61\x6c\x20\x46\x52\117\115\x20\155\x6f\156\145\x63\141\x6d\40\x57\x48\105\x52\x45\40\x66\145\143\150\141\x3c\x3d\141\x2e\146\x65\143\150\x61\144\157\x63\x20\x4f\x52\104\105\x52\40\x42\x59\x20\146\145\143\x68\141\40\x44\x45\123\x43\40\114\x49\115\x49\124\x20\61\51\x2c\x32\x29\40\x6d\x6f\156\164\157\x6e\145\x74\x6f\144\x2c\40\xa\40\40\40\40\x72\x6f\165\156\x64\x28\141\x2e\x6d\x6f\x6e\164\157\164\x6f\x74\141\x6c\57\x28\123\x45\114\x45\x43\124\40\x6f\x66\x69\x63\x69\141\x6c\x20\106\122\117\x4d\x20\x6d\157\156\145\143\141\x6d\40\x57\x48\x45\122\x45\x20\x66\145\143\x68\141\74\75\141\x2e\x66\x65\x63\x68\x61\144\157\x63\x20\x4f\x52\x44\105\122\40\x42\131\40\x66\x65\x63\150\141\40\104\105\123\x43\x20\114\111\x4d\x49\x54\40\61\51\54\x32\51\x20\155\157\156\x74\x6f\x6e\164\157\164\x61\154\144\x2c\12\x20\x20\x20\x20\141\x2e\x63\157\144\151\x67\x6f\x2c\141\x2e\154\157\164\x65\x2c\x61\56\x6e\157\155\x62\162\x65\54\x20\50\123\105\114\x45\x43\x54\40\156\157\x6d\142\x72\145\x20\106\122\117\x4d\x20\x61\x72\164\x69\x70\x72\x6f\x76\40\x57\110\x45\122\x45\40\143\x6f\144\x69\147\x6f\75\141\x2e\x63\157\144\x69\147\157\40\114\111\x4d\x49\x54\x20\x31\51\40\160\x72\x6f\x76\145\x65\144\x6f\162\54\40\142\x2e\166\145\156\x64\x65\144\x6f\162\40\x63\157\x64\166\x65\156\x64\x2c\x20\x61\x2e\x64\163\143\164\157\x75\156\x69\164\x2c\141\56\x64\163\143\x74\157\145\156\x64\160\x20\x64\x73\x63\x74\157\160\162\157\x6d\x6f\54\xa\x20\x20\40\x20\50\123\105\114\105\x43\x54\x20\156\157\x6d\x62\x72\145\x20\106\x52\117\x4d\40\154\151\163\x74\x76\x65\156\x64\x20\x57\x48\105\122\x45\40\x63\x6f\x64\151\147\x6f\x3d\142\56\166\145\x6e\144\145\144\157\x72\40\x4c\x49\115\x49\124\x20\61\51\x20\x6e\x6f\x6d\166\x65\x6e\144\x2c\xa\x20\x20\x20\40\x28\123\105\114\105\103\x54\40\x6d\x61\x72\143\x61\x20\106\x52\117\x4d\x20\x61\x72\164\151\x63\165\154\157\40\x57\110\105\x52\x45\x20\x63\157\x64\151\x67\x6f\x3d\141\x2e\143\x6f\144\x69\147\157\51\x20\155\x61\162\143\141\54\xa\x20\40\x20\x20\x28\123\x45\x4c\105\103\124\40\163\165\x62\x73\x65\x63\164\x6f\x72\x20\x46\x52\117\115\x20\163\x75\142\163\x65\x63\x74\157\x72\x65\x73\40\x57\x48\105\122\105\x20\x63\157\144\151\147\157\x3d\x62\x2e\x73\x65\x63\164\x6f\162\x20\x26\46\x20\163\165\142\x63\x6f\x64\x69\147\157\x3d\x62\x2e\163\165\142\143\157\144\151\x67\x6f\x20\x4c\x49\x4d\111\x54\x20\61\51\40\172\157\x6e\141\12\40\x20\x20\x20\106\x52\x4f\115\40\157\x70\145\162\155\166\x20\x61\40\x4a\117\x49\116\x20\157\160\x65\162\164\151\40\142\40\x4f\x4e\40\x28\x61\x2e\x64\x6f\143\x75\x6d\x65\156\164\157\75\142\x2e\x64\157\143\x75\x6d\x65\x6e\x74\x6f\x20\46\46\40\x61\56\164\151\x70\x6f\144\157\143\x3d\x62\x2e\x74\x69\x70\x6f\144\x6f\x63\x29\x20\127\x48\x45\x52\105\x20\x61\56\146\145\143\x68\141\x64\x6f\x63\x3e\x3d\x27{$inic}\47\x20\x26\x26\40\x61\x2e\146\145\143\x68\141\144\x6f\143\74\x3d\47{$fin}\x27\x20\x26\x26\40\x28\141\56\x74\x69\x70\x6f\144\157\x63\75\47\116\x4f\x54\47\x20\174\x7c\40\x61\56\x74\151\160\x6f\x64\x6f\143\x3d\47\x46\101\x43\x27\x29\40\107\122\117\125\120\x20\x42\131\40\141\x2e\144\157\143\x75\x6d\x65\x6e\x74\x6f\x2c\141\56\143\157\144\151\x67\x6f\x2c\141\56\154\x6f\164\x65"); } function reportventaprov($ini, $fin, $prov) { $codprov = $this->db->query("\123\x45\114\105\103\124\x20\143\x6f\144\x69\147\x6f\x20\156\x20\x46\x52\x4f\x4d\x20\x70\162\157\166\x65\x65\x64\x20\x57\110\x45\x52\105\x20\151\144\75\47{$prov}\47")->row(); return $this->db->query("\x53\105\x4c\x45\x43\x54\40\141\154\155\x61\143\x65\156\x2c\143\157\144\x69\x67\157\54\x6e\x6f\155\x62\162\145\54\x6c\157\164\x65\54\122\117\125\116\x44\x28\143\x6f\x73\x74\157\x2c\62\x29\x63\x6f\x73\x74\x6f\x2c\122\x4f\x55\x4e\x44\50\x65\x78\151\x73\164\x5f\x69\156\151\x63\151\x61\154\x29\x65\x78\x69\x73\x74\x5f\x69\x6e\151\143\x69\x61\154\54\122\x4f\x55\x4e\104\x28\x63\x61\x6e\x74\51\x63\141\156\x74\54\122\x4f\125\116\104\50\144\x65\x76\x29\144\x65\x76\x2c\122\x4f\125\x4e\x44\50\x65\x78\151\x73\x74\137\x69\x6e\x69\x63\151\x61\154\55\143\141\x6e\164\53\144\145\166\51\x20\145\x78\151\x73\x74\x5f\x66\x69\x6e\141\154\40\x46\122\117\115\40\12\40\40\x20\x20\50\123\x45\x4c\x45\x43\124\40\x61\x2e\141\x6c\155\x61\143\145\x6e\x2c\141\x2e\x63\157\144\151\147\157\x61\162\164\40\x63\x6f\144\x69\x67\157\54\143\56\156\157\155\x62\162\145\54\x61\56\154\x6f\x74\145\x2c\40\x28\123\x45\114\105\x43\x54\40\x63\x6f\163\x74\157\x75\156\x69\164\x20\106\122\117\115\x20\x6f\160\145\x72\155\166\x20\127\x48\105\x52\x45\x20\x63\157\x64\151\x67\157\x3d\141\x2e\143\x6f\144\151\147\157\141\162\x74\40\x26\46\x20\x66\145\x63\150\141\144\x6f\x63\74\x3d\x27{$fin}\x27\x20\x4f\x52\104\105\x52\x20\102\131\40\x66\145\143\x68\x61\144\x6f\143\x20\x44\x45\123\103\x20\x4c\111\115\111\x54\x20\61\51\40\x63\157\x73\164\157\54\12\x20\40\40\x20\x49\106\x28\x28\123\x45\x4c\105\103\124\x20\x53\x55\x4d\x28\143\x61\x6e\164\151\144\141\144\55\143\x6e\164\x64\x65\x76\x75\x65\x6c\x74\51\x20\x46\122\x4f\115\x20\x6f\x70\145\x72\155\166\40\127\x48\105\122\x45\40\x63\x6f\144\x69\147\157\75\x61\x2e\x63\x6f\x64\x69\x67\x6f\x61\162\164\40\46\46\x20\x6c\x6f\x74\145\75\x61\x2e\x6c\x6f\164\145\40\x26\x26\40\x61\154\x6d\x61\x63\x65\156\75\x61\x2e\x61\154\x6d\141\x63\x65\156\40\46\46\40\50\164\151\x70\157\x64\157\143\x3d\47\106\101\103\x27\x20\x7c\x7c\40\x74\151\x70\x6f\x64\157\143\x3d\47\116\117\x54\x27\51\40\x26\x26\x20\x66\145\x63\150\141\144\157\x63\74\47{$ini}\47\x29\x3e\x30\x2c\x61\x2e\143\x61\156\164\151\144\x61\x64\55\x28\123\x45\114\x45\x43\x54\40\x53\125\115\x28\143\141\x6e\x74\x69\144\141\144\x2d\143\x6e\164\144\x65\166\x75\145\154\x74\51\x20\106\x52\x4f\x4d\x20\157\160\145\x72\155\166\x20\x57\110\x45\122\x45\40\143\x6f\144\151\147\x6f\75\141\56\143\x6f\144\x69\x67\x6f\x61\162\x74\x20\46\x26\40\x6c\x6f\x74\x65\x3d\141\x2e\x6c\x6f\x74\x65\40\46\46\40\141\x6c\155\141\143\145\156\75\141\56\x61\154\155\x61\143\x65\156\x20\46\x26\40\50\164\151\x70\x6f\x64\x6f\143\x3d\47\106\x41\x43\x27\x20\x7c\174\x20\164\x69\x70\157\144\157\x63\x3d\47\116\x4f\x54\47\x29\40\46\x26\40\x66\x65\143\150\x61\x64\157\x63\74\47{$ini}\x27\51\54\x61\56\143\x61\x6e\164\x69\144\141\x64\51\40\145\x78\x69\163\x74\137\x69\156\151\143\x69\x61\154\x2c\xa\40\x20\40\x20\111\x46\50\50\123\x45\x4c\105\103\124\x20\123\x55\115\50\143\141\x6e\164\151\144\x61\x64\51\x20\106\122\117\x4d\x20\x6f\160\145\162\x6d\166\40\127\x48\105\122\x45\x20\x63\157\144\x69\147\157\x3d\141\x2e\x63\157\144\151\x67\x6f\141\162\x74\x20\x26\46\x20\x6c\x6f\x74\x65\x3d\x61\56\154\x6f\x74\145\x20\x26\x26\x20\x61\154\155\x61\143\145\x6e\75\x61\x2e\141\x6c\x6d\x61\143\145\x6e\40\46\x26\40\50\164\x69\x70\157\x64\x6f\x63\75\x27\x46\101\103\47\40\174\174\x20\x74\x69\x70\157\x64\157\x63\75\47\x4e\117\x54\x27\51\40\46\x26\x20\x66\x65\143\150\x61\144\x6f\143\x3e\x3d\x27{$ini}\47\40\46\x26\x20\x66\145\143\x68\x61\x64\157\143\74\x3d\47{$fin}\47\51\x3e\60\x2c\x28\123\x45\114\x45\x43\x54\40\123\x55\x4d\50\143\x61\x6e\164\151\144\141\144\51\x20\x46\x52\117\x4d\x20\x6f\160\x65\162\x6d\166\40\x57\x48\105\122\x45\x20\x63\157\144\x69\147\157\x3d\141\56\x63\x6f\144\x69\x67\157\141\162\164\x20\x26\46\x20\154\x6f\x74\145\x3d\141\56\154\157\164\x65\40\46\x26\x20\x61\154\x6d\141\143\145\156\x3d\141\x2e\x61\x6c\x6d\x61\143\x65\x6e\40\x26\x26\x20\50\164\151\x70\x6f\144\157\143\75\x27\106\101\103\47\x20\174\174\x20\x74\151\160\157\x64\157\143\75\47\116\x4f\x54\x27\x29\x20\x26\46\x20\x66\x65\x63\x68\141\144\x6f\143\x3e\x3d\x27{$ini}\47\40\46\x26\x20\x66\145\x63\x68\141\144\x6f\x63\x3c\x3d\47{$fin}\x27\x29\x2c\60\51\40\x63\141\156\164\54\xa\40\x20\40\40\x49\106\50\50\x53\x45\x4c\105\x43\124\40\123\x55\115\x28\143\x6e\164\x64\145\166\x75\145\x6c\164\x29\40\x46\x52\x4f\x4d\40\x6f\x70\145\162\x6d\x76\40\x57\110\105\x52\105\x20\143\x6f\144\151\x67\x6f\75\x61\x2e\143\x6f\144\x69\x67\157\141\162\x74\x20\x26\46\40\154\x6f\x74\145\75\141\x2e\154\157\164\x65\x20\x26\46\40\x61\154\x6d\x61\x63\145\156\x3d\141\56\141\154\155\x61\x63\145\156\40\x26\46\x20\x28\164\151\x70\157\144\x6f\x63\x3d\x27\106\101\103\47\40\x7c\x7c\x20\164\151\x70\157\x64\157\x63\x3d\47\116\117\x54\x27\x29\40\x26\46\x20\x66\x65\143\x68\x61\144\x6f\x63\x3e\75\47{$ini}\47\x20\46\46\40\x66\145\x63\x68\x61\144\x6f\x63\74\x3d\47{$fin}\47\x29\x3e\x30\x2c\x28\x53\105\x4c\105\x43\x54\40\123\125\x4d\50\x63\x6e\164\x64\x65\x76\x75\145\x6c\164\x29\40\x46\122\117\115\x20\157\160\x65\x72\x6d\x76\40\127\x48\105\x52\105\x20\143\157\x64\151\x67\x6f\75\141\56\x63\157\144\151\147\x6f\x61\162\x74\x20\x26\46\x20\154\157\164\145\x3d\x61\56\x6c\157\164\x65\40\46\x26\40\141\x6c\x6d\141\143\145\156\x3d\x61\x2e\141\x6c\x6d\141\143\145\156\40\46\46\40\50\x74\x69\x70\157\144\x6f\x63\x3d\47\106\101\x43\47\x20\x7c\x7c\x20\164\151\160\157\x64\157\143\75\x27\116\x4f\124\x27\x29\40\x26\x26\40\146\x65\x63\150\x61\144\157\x63\76\75\47{$ini}\47\x20\x26\46\40\146\145\x63\x68\141\x64\x6f\x63\74\75\47{$fin}\47\x29\x2c\60\51\40\144\145\x76\xa\x20\40\x20\40\106\122\x4f\x4d\40\141\x72\x74\x69\x6c\157\164\145\x73\40\141\40\112\117\x49\116\x20\x61\x72\x74\151\x70\162\157\x76\40\x62\40\x4f\x4e\40\141\x2e\143\x6f\144\x69\x67\157\x61\x72\164\75\x62\x2e\143\x6f\144\x69\147\157\xa\x20\x20\x20\40\x4a\x4f\111\x4e\x20\x61\x72\x74\x69\143\165\x6c\157\x20\x63\x20\x4f\x4e\40\x62\x2e\143\157\x64\151\x67\157\x3d\x63\56\143\157\144\x69\147\x6f\xa\40\x20\x20\40\x57\110\105\x52\105\x20\142\56\x70\x72\x6f\166\x65\145\x64\x6f\162\75\47{$codprov->n}\47\40\x26\46\x20\141\x2e\141\x6c\x6d\x61\x63\x65\x6e\x20\x4e\117\124\40\111\116\40\x28\x30\x31\54\60\x35\x2c\x30\66\x29\12\40\x20\40\x20\107\x52\117\125\x50\40\102\131\40\x61\56\x63\x6f\144\151\147\157\141\x72\164\54\141\x2e\141\x6c\155\x61\143\145\x6e\x2c\x61\56\154\x6f\x74\145\51\x20\x76\x65\x6e\x74\141\160\162\157\x76\12\x20\x20\40\x20\125\116\111\x4f\116\xa\x20\x20\40\x20\123\x45\x4c\105\x43\124\40\156\x75\x6c\x6c\x20\141\154\x6d\x61\x63\145\156\x2c\x6e\165\x6c\x6c\x20\x63\x6f\144\151\147\x6f\54\x6e\165\154\154\40\156\x6f\155\142\162\145\54\x6e\165\154\x6c\40\x6c\157\x74\x65\54\122\117\x55\116\104\50\x53\x55\x4d\x28\143\x6f\x73\x74\x6f\51\x2c\x32\51\143\157\x73\x74\157\x2c\122\x4f\125\116\x44\50\123\125\x4d\50\x65\x78\x69\163\164\x5f\x69\156\151\143\x69\x61\154\x29\51\x65\x78\x69\x73\x74\137\151\156\151\x63\x69\141\154\54\x52\x4f\x55\116\x44\x28\x53\x55\x4d\50\x63\x61\x6e\164\x29\51\x63\141\156\164\x2c\x52\x4f\125\x4e\x44\50\x53\125\x4d\x28\144\x65\x76\51\51\x64\145\x76\54\x52\117\x55\116\104\50\123\x55\x4d\50\145\170\151\x73\164\137\x69\156\x69\143\151\141\154\55\x63\x61\x6e\164\53\x64\145\166\51\x29\x20\x65\170\151\163\164\137\146\151\x6e\141\154\x20\106\122\x4f\115\40\12\x20\40\x20\x20\x28\x53\x45\114\x45\x43\124\40\x61\56\141\x6c\x6d\141\x63\145\x6e\54\141\56\143\x6f\x64\151\147\157\x61\x72\x74\40\143\157\x64\151\147\x6f\54\143\x2e\156\x6f\155\142\162\x65\54\x61\56\154\x6f\164\x65\54\40\50\x53\x45\114\105\x43\124\40\143\157\x73\164\x6f\x75\x6e\151\x74\x20\x46\x52\x4f\x4d\40\157\160\x65\x72\x6d\x76\x20\127\110\105\122\105\40\x63\157\144\x69\x67\x6f\x3d\141\x2e\x63\157\144\151\147\x6f\x61\x72\x74\40\x26\x26\x20\x66\x65\x63\x68\141\144\x6f\x63\x3c\x3d\x27{$fin}\x27\40\117\x52\104\x45\122\x20\102\x59\x20\x66\x65\143\x68\141\144\x6f\143\x20\x44\x45\x53\103\40\x4c\111\x4d\111\124\x20\x31\x29\40\x63\157\x73\x74\x6f\54\12\x20\40\x20\40\111\106\50\50\x53\x45\114\x45\x43\124\x20\123\125\115\x28\x63\141\x6e\164\x69\144\x61\144\55\143\156\164\x64\145\166\x75\x65\x6c\x74\x29\x20\106\x52\117\115\x20\x6f\160\145\162\x6d\x76\40\x57\110\105\122\x45\40\143\157\x64\151\x67\157\75\141\x2e\143\157\x64\x69\x67\x6f\x61\162\164\x20\46\x26\x20\x6c\157\x74\145\75\x61\56\x6c\x6f\164\x65\x20\46\x26\40\x61\x6c\x6d\141\143\x65\x6e\75\141\56\141\154\155\141\x63\x65\156\40\46\46\x20\x28\x74\151\x70\157\144\157\143\75\47\106\101\103\47\x20\x7c\x7c\x20\x74\151\x70\x6f\144\157\143\x3d\47\x4e\117\124\x27\51\40\x26\46\40\146\145\143\150\x61\x64\x6f\143\74\47{$ini}\x27\x29\x3e\x30\x2c\141\x2e\x63\141\156\x74\151\144\141\x64\x2d\50\123\105\x4c\105\103\x54\40\123\x55\115\50\143\141\x6e\164\151\x64\141\144\55\143\156\164\144\x65\x76\x75\x65\x6c\164\x29\x20\106\122\x4f\x4d\40\157\160\x65\x72\x6d\166\40\x57\110\x45\x52\105\x20\x63\157\x64\151\147\x6f\x3d\141\56\x63\157\144\x69\147\157\141\162\x74\x20\46\46\x20\x6c\x6f\x74\x65\x3d\141\x2e\x6c\x6f\164\x65\40\46\x26\40\x61\154\155\141\x63\145\156\75\x61\x2e\141\x6c\x6d\141\x63\145\156\40\x26\x26\x20\x28\x74\x69\160\157\144\157\x63\x3d\x27\x46\101\x43\x27\x20\x7c\x7c\x20\x74\151\x70\x6f\144\157\x63\x3d\47\x4e\117\124\47\x29\40\46\46\x20\x66\145\x63\x68\x61\144\157\143\x3c\x27{$ini}\x27\51\54\x61\56\143\141\x6e\164\151\144\141\x64\x2d\x61\x2e\x63\157\x6e\x73\165\x6d\x69\144\x6f\x29\40\145\x78\151\163\164\x5f\x69\x6e\x69\143\x69\x61\154\x2c\12\x20\40\40\x20\x49\106\50\x28\x53\105\x4c\x45\x43\x54\x20\123\x55\115\x28\143\141\156\164\x69\x64\x61\144\x29\40\106\122\x4f\115\40\x6f\x70\x65\x72\x6d\166\40\127\x48\105\122\x45\x20\143\x6f\144\151\x67\x6f\x3d\141\x2e\143\157\144\151\x67\x6f\141\162\164\x20\46\46\40\154\157\164\145\75\141\x2e\x6c\x6f\164\x65\x20\x26\46\x20\x61\x6c\x6d\141\x63\145\156\75\x61\56\141\154\155\141\143\x65\156\x20\x26\46\40\50\164\x69\160\x6f\x64\x6f\x63\x3d\x27\x46\x41\x43\x27\40\x7c\x7c\40\164\x69\x70\x6f\x64\x6f\143\75\x27\x4e\x4f\124\47\x29\40\46\x26\x20\x66\x65\143\150\141\x64\x6f\x63\76\x3d\47{$ini}\47\x20\46\46\x20\x66\x65\143\150\x61\144\x6f\143\74\75\47{$fin}\47\x29\76\60\54\50\123\105\114\105\x43\x54\x20\123\x55\115\x28\x63\x61\x6e\164\x69\x64\141\144\51\x20\x46\122\x4f\x4d\40\x6f\160\145\162\x6d\166\40\x57\110\105\x52\105\x20\x63\157\144\x69\x67\x6f\75\x61\56\x63\x6f\144\151\x67\x6f\x61\x72\164\x20\x26\46\40\x6c\x6f\164\x65\75\141\x2e\154\x6f\164\145\x20\x26\46\x20\141\154\155\141\x63\x65\156\x3d\141\x2e\x61\x6c\155\141\x63\x65\x6e\x20\x26\46\40\50\x74\x69\x70\157\144\x6f\143\x3d\47\106\x41\x43\47\40\x7c\174\x20\164\151\x70\157\144\157\x63\75\47\116\117\124\47\x29\x20\x26\46\x20\x66\145\x63\150\141\144\x6f\x63\x3e\x3d\47{$ini}\x27\40\x26\x26\x20\x66\x65\x63\150\x61\144\157\143\74\x3d\47{$fin}\47\x29\54\60\x29\40\x63\141\x6e\x74\x2c\12\40\x20\40\40\x49\x46\x28\x28\x53\105\114\105\103\124\x20\123\x55\115\50\143\156\x74\144\x65\166\x75\x65\154\164\x29\40\x46\x52\x4f\115\x20\x6f\160\x65\x72\x6d\x76\40\127\110\105\122\105\x20\143\x6f\x64\x69\147\x6f\75\x61\x2e\x63\157\144\151\x67\157\141\x72\x74\x20\x26\x26\40\154\x6f\x74\145\75\x61\56\154\x6f\x74\145\x20\x26\46\x20\141\154\x6d\141\143\145\x6e\x3d\x61\x2e\141\154\155\x61\x63\x65\156\40\x26\x26\40\50\164\151\x70\x6f\144\x6f\143\75\x27\x46\x41\103\x27\40\x7c\x7c\x20\x74\x69\x70\157\144\x6f\x63\x3d\x27\x4e\x4f\x54\47\51\x20\46\x26\x20\x66\x65\143\x68\x61\x64\157\143\76\x3d\47{$ini}\47\40\46\x26\x20\x66\145\x63\150\x61\x64\x6f\x63\x3c\x3d\x27{$fin}\47\51\x3e\x30\54\50\x53\105\x4c\x45\103\x54\40\x53\125\115\50\143\156\x74\x64\x65\166\x75\145\154\x74\51\x20\x46\122\117\x4d\40\x6f\160\x65\x72\x6d\166\40\127\x48\x45\122\105\40\x63\157\x64\x69\x67\x6f\75\x61\x2e\143\157\144\151\x67\x6f\x61\x72\164\x20\x26\46\40\154\x6f\164\145\x3d\141\56\x6c\157\164\145\40\46\x26\40\x61\154\155\x61\x63\145\156\x3d\x61\x2e\x61\x6c\155\x61\143\145\x6e\x20\x26\46\40\x28\x74\151\x70\x6f\144\157\x63\75\x27\x46\x41\x43\x27\x20\174\174\40\164\151\160\x6f\x64\157\143\x3d\47\116\x4f\x54\x27\51\x20\x26\46\40\x66\145\x63\150\x61\x64\x6f\143\x3e\75\x27{$ini}\47\x20\46\x26\x20\146\x65\x63\150\x61\x64\157\143\x3c\75\47{$fin}\47\x29\54\x30\51\x20\x64\x65\x76\xa\40\x20\x20\40\106\122\117\x4d\40\x61\x72\164\x69\154\x6f\164\x65\163\40\141\x20\x4a\x4f\x49\x4e\40\141\162\164\151\x70\x72\x6f\x76\40\142\x20\x4f\116\40\x61\x2e\x63\x6f\x64\151\147\157\141\x72\164\x3d\x62\56\143\x6f\144\151\x67\157\xa\x20\40\x20\x20\112\117\x49\116\x20\141\x72\164\x69\143\165\154\157\x20\x63\x20\117\116\x20\x62\56\x63\157\x64\x69\x67\157\x3d\x63\56\x63\x6f\144\151\x67\157\xa\x20\x20\x20\x20\127\110\x45\122\105\x20\142\56\x70\162\157\166\x65\145\144\157\162\75\x27{$codprov->n}\47\40\46\46\x20\x61\56\x61\154\155\141\143\145\156\40\x4e\117\124\40\x49\116\40\50\x30\61\x2c\60\x35\x2c\x30\66\51\xa\x20\40\40\40\107\x52\x4f\125\x50\x20\x42\131\x20\141\x2e\x63\x6f\x64\x69\x67\x6f\x61\162\x74\54\x61\x2e\x61\154\155\141\143\x65\156\x2c\141\56\x6c\x6f\164\x65\51\x20\166\145\156\x74\x61\x70\162\x6f\x76"); } function reportventaprovcli($ini, $fin, $prov) { return $this->db->query("\x53\105\x4c\105\x43\124\x20\x61\56\146\x65\143\x68\141\x64\157\x63\x2c\x62\56\144\x6f\x63\165\x6d\x65\x6e\164\157\x2c\142\x2e\156\x6f\x6d\142\x72\145\143\154\x69\54\141\56\x63\157\x64\x69\147\x6f\54\141\x2e\x6e\x6f\x6d\x62\162\145\54\x20\x52\x4f\x55\x4e\x44\50\123\125\x4d\x28\x61\56\143\141\156\164\151\x64\x61\x64\x29\x29\40\x76\145\x6e\144\151\x64\x61\x73\x2c\x52\x4f\x55\x4e\104\x28\x53\x55\115\x28\x61\56\x63\156\x74\144\145\x76\x75\x65\154\x74\x29\51\40\144\145\166\165\x65\x6c\x74\x61\x73\x2c\122\117\x55\x4e\104\x28\141\x2e\143\x6f\163\x74\157\165\x6e\151\x74\x2c\x32\51\x20\143\157\163\164\157\x2c\122\117\x55\116\104\50\141\56\160\x72\145\143\151\157\x75\156\x69\x74\54\62\x29\x20\x70\x72\x65\x63\x69\x6f\xa\40\40\x20\x20\x46\122\117\115\x20\157\x70\145\x72\x6d\x76\x20\141\xa\40\40\40\x20\112\117\x49\x4e\40\157\x70\145\x72\164\x69\40\x62\x20\117\x4e\x20\50\141\56\144\157\x63\165\155\x65\156\x74\157\75\x62\56\x64\157\x63\165\155\x65\156\x74\x6f\40\x26\x26\x20\x61\x2e\x74\x69\x70\x6f\144\157\143\x3d\142\x2e\164\151\160\157\x64\157\143\51\xa\x20\40\x20\x20\x4a\117\x49\116\x20\141\162\164\151\x70\x72\x6f\x76\x20\143\x20\x4f\x4e\x20\x61\56\143\157\144\151\x67\x6f\75\143\56\x63\157\x64\151\x67\157\xa\x20\x20\40\x20\112\x4f\111\116\40\160\162\157\166\145\145\144\40\x64\40\117\x4e\x20\x63\56\160\x72\157\166\145\x65\144\x6f\x72\x3d\x64\56\143\x6f\x64\151\147\x6f\12\40\40\x20\40\127\110\105\122\105\x20\141\x2e\146\145\x63\150\141\144\157\x63\x3e\x3d\47{$ini}\x27\40\46\x26\x20\x20\141\56\x66\x65\x63\150\141\x64\157\143\x3c\x3d\47{$fin}\47\40\x26\46\x20\x64\56\x69\144\75\47{$prov}\x27\12\x20\40\40\40\107\x52\x4f\x55\x50\x20\102\131\x20\x62\56\x64\157\143\x75\155\x65\x6e\164\157\x2c\x62\56\143\157\144\143\x6c\x69\x65\x6e\164\x65\x2c\x61\x2e\x63\157\x64\x69\x67\x6f\x20\x4f\122\x44\105\122\x20\102\x59\x20\141\x2e\x66\x65\x63\150\x61\144\x6f\143\40\101\x53\x43"); } function reportventaprov2($ini, $fin, $prov) { return $this->db->query("\x53\105\114\105\x43\x54\x20\142\x2e\x64\157\x63\x75\x6d\145\x6e\164\x6f\54\x62\x2e\x6e\157\155\142\162\x65\143\x6c\x69\54\141\56\143\157\x64\151\147\x6f\x2c\x61\56\156\157\155\x62\x72\x65\x2c\x20\122\x4f\x55\x4e\x44\x28\123\x55\115\x28\141\56\x63\x61\x6e\164\151\x64\x61\144\51\x29\40\x75\x6e\x69\x64\x61\x64\x65\x73\54\122\117\x55\116\104\x28\x61\x2e\x64\163\143\x74\157\x65\x6e\x64\160\51\x20\x70\157\162\x63\x65\156\164\x2c\122\117\x55\116\x44\x28\141\x2e\160\x72\x65\143\151\x6f\157\162\x69\x67\151\x6e\141\x6c\x2c\x32\x29\40\x70\162\x65\x63\x69\x6f\157\x72\151\x67\151\x6e\141\154\x2c\122\x4f\125\x4e\104\x28\x61\56\x64\x73\x63\164\157\x65\156\144\155\x2c\62\x29\x20\144\x65\x73\x63\x75\54\x52\117\125\116\104\50\x61\56\160\162\x65\143\151\x6f\x75\x6e\151\x74\x2c\62\x29\x20\x74\157\164\141\x6c\54\122\117\x55\116\x44\x28\x61\x2e\x64\163\143\x74\157\x65\156\144\155\52\x53\x55\115\50\141\x2e\143\141\x6e\x74\x69\144\141\x64\51\x2c\x32\x29\x20\164\157\164\x61\154\x64\145\x73\x63\165\12\x20\40\x20\x20\106\x52\117\115\40\x6f\x70\x65\162\155\x76\x20\141\xa\40\x20\40\x20\112\x4f\x49\x4e\x20\157\x70\x65\x72\164\151\40\x62\x20\117\x4e\x20\50\141\x2e\x64\x6f\143\x75\155\145\156\x74\x6f\x3d\142\56\144\x6f\x63\165\x6d\x65\x6e\x74\157\x20\x26\x26\x20\x61\x2e\x74\151\x70\x6f\x64\157\x63\x3d\x62\56\x74\x69\x70\157\144\x6f\143\x29\xa\x20\x20\x20\40\x4a\x4f\x49\x4e\40\x61\162\164\x69\160\x72\157\166\x20\x63\x20\x4f\x4e\x20\x61\x2e\x63\x6f\x64\x69\x67\x6f\75\143\56\x63\157\144\151\147\157\12\x20\40\40\x20\x4a\117\111\116\40\x70\x72\157\166\145\x65\144\40\144\40\x4f\x4e\40\143\x2e\160\x72\157\x76\x65\145\144\157\x72\x3d\144\x2e\x63\157\x64\151\x67\157\xa\40\x20\40\x20\x57\110\105\122\105\x20\141\x2e\x66\145\x63\150\x61\x64\x6f\x63\x3e\75\x27{$ini}\x27\x20\x26\46\40\x20\x61\56\x66\x65\143\150\x61\144\157\x63\x3c\x3d\x27{$fin}\47\40\46\x26\x20\x61\56\x64\x73\x63\164\x6f\x65\156\144\x70\76\60\40\46\x26\40\x64\x2e\151\x64\x3d\x27{$prov}\x27\12\x20\x20\40\x20\x47\x52\117\x55\120\40\102\x59\x20\x62\56\x64\157\143\x75\x6d\x65\156\164\x6f\x2c\x62\x2e\x63\x6f\x64\143\154\151\x65\x6e\x74\x65\x2c\x61\56\143\157\x64\x69\147\x6f\x2c\141\x2e\144\163\x63\164\157\145\x6e\144\160"); } function reportventavend($ini, $fin, $vend) { $totcli = $this->db->query("\x53\x45\114\x45\103\124\40\116\x55\114\x4c\x20\x46\122\x4f\x4d\40\157\160\145\x72\164\x69\40\x57\110\105\122\x45\40\x66\x65\143\150\x61\143\162\x65\x61\x3e\75\x27{$ini}\x27\x20\x26\x26\x20\x66\145\143\x68\x61\143\x72\x65\141\x3c\75\47{$fin}\47\40\x26\x26\x20\166\x65\x6e\144\145\x64\x6f\162\75\x27{$vend}\47\x20\46\x26\40\50\164\x69\160\x6f\144\x6f\143\75\x27\x46\x41\103\x27\40\174\x7c\x20\164\151\x70\x6f\x64\x6f\143\75\x27\x4e\117\124\47\x29\40\107\122\117\x55\x50\x20\x42\131\40\143\157\144\x63\x6c\151\x65\x6e\164\145")->num_rows(); $totins = $this->db->query("\123\105\114\x45\103\124\40\x52\117\125\x4e\x44\x28\123\125\x4d\50\x63\141\x6e\x74\x69\x64\141\144\x2d\143\x6e\164\144\145\x76\165\145\x6c\x74\x29\x2c\x32\51\40\156\x20\106\x52\x4f\x4d\40\157\x70\145\x72\155\x76\40\x61\x20\112\x4f\111\x4e\x20\x6f\x70\x65\x72\164\151\x20\142\40\x4f\116\x20\x28\141\56\144\x6f\x63\x75\155\145\156\164\x6f\x3d\142\x2e\144\x6f\x63\165\155\145\x6e\164\157\x20\46\46\x20\141\56\164\x69\x70\x6f\144\157\x63\75\x62\56\x74\x69\x70\157\x64\x6f\x63\51\40\127\110\x45\x52\x45\40\141\56\x66\145\x63\x68\141\x64\157\143\76\x3d\47{$ini}\47\40\x26\x26\x20\x61\x2e\146\145\143\150\141\144\x6f\143\74\75\x27{$fin}\47\40\x26\x26\x20\142\56\x76\x65\156\x64\145\144\x6f\162\x3d\x27{$vend}\47\40\x26\x26\x20\x28\x61\x2e\x74\151\x70\x6f\144\x6f\x63\75\47\106\x41\103\47\40\174\x7c\40\x61\x2e\164\151\160\x6f\x64\157\x63\75\x27\116\x4f\x54\x27\x29\x20\46\46\x20\x73\165\x62\x73\164\162\x28\x61\x2e\143\x6f\144\x69\x67\157\x2c\61\54\63\51\x3d\47\x49\116\123\47")->row(); $totalm = $this->db->query("\x53\105\x4c\x45\x43\124\40\122\117\x55\x4e\x44\x28\x53\125\115\50\143\x61\156\x74\x69\x64\141\x64\55\x63\156\164\144\145\166\165\145\154\x74\x29\x2c\62\x29\40\156\x20\x46\122\117\115\40\x6f\160\145\162\155\166\40\141\40\112\x4f\111\116\x20\157\x70\145\x72\164\x69\40\x62\40\x4f\x4e\40\50\x61\56\x64\x6f\143\165\155\x65\156\164\x6f\x3d\x62\x2e\144\x6f\x63\x75\155\145\x6e\164\x6f\40\46\x26\x20\141\x2e\x74\151\160\157\144\x6f\x63\x3d\142\x2e\164\151\160\157\144\157\143\x29\x20\x57\110\105\x52\105\x20\141\56\146\145\x63\x68\141\144\157\x63\x3e\x3d\47{$ini}\x27\x20\46\x26\x20\x61\56\146\145\143\x68\x61\144\157\143\x3c\x3d\47{$fin}\47\x20\x26\46\x20\142\56\166\145\156\144\145\144\157\162\75\47{$vend}\x27\40\x26\x26\40\x28\x61\56\x74\151\x70\157\x64\x6f\x63\x3d\x27\x46\x41\103\47\x20\174\x7c\x20\x61\56\164\151\160\157\144\157\143\75\47\x4e\117\124\x27\x29\x20\x26\x26\x20\x73\x75\142\163\x74\162\x28\141\56\143\x6f\144\x69\x67\157\54\61\54\63\x29\x3d\47\x41\114\x4d\x27")->row(); $totmed = $this->db->query("\x53\x45\114\x45\103\124\x20\x52\117\x55\116\x44\50\x53\125\115\50\143\x61\156\164\151\144\x61\x64\55\143\156\x74\144\145\x76\165\145\x6c\x74\x29\54\62\x29\x20\156\40\106\x52\x4f\115\40\157\160\145\162\155\x76\x20\x61\40\x4a\117\111\x4e\40\x6f\160\145\162\x74\x69\40\x62\40\117\x4e\x20\50\x61\x2e\144\157\x63\x75\155\145\x6e\164\157\75\142\56\x64\157\143\x75\155\145\x6e\x74\157\40\x26\46\40\141\56\164\x69\160\x6f\x64\x6f\143\x3d\142\x2e\164\151\160\x6f\144\x6f\x63\51\40\x57\110\x45\x52\x45\40\x61\56\x66\x65\143\x68\141\x64\157\143\x3e\75\x27{$ini}\47\x20\46\x26\x20\141\x2e\x66\x65\143\x68\141\x64\157\143\74\75\47{$fin}\47\40\x26\x26\x20\142\x2e\x76\x65\x6e\144\x65\x64\x6f\x72\x3d\47{$vend}\47\x20\x26\46\40\50\x61\56\164\x69\x70\x6f\x64\157\x63\x3d\x27\106\101\x43\x27\x20\174\174\40\x61\x2e\x74\151\x70\157\144\157\x63\75\47\116\117\x54\x27\x29\40\46\x26\40\163\x75\142\x73\x74\162\x28\141\56\143\x6f\x64\x69\147\157\x2c\61\54\x33\51\75\x27\x4d\x45\104\47")->row(); $totmis = $this->db->query("\123\x45\114\x45\x43\x54\40\x52\x4f\125\x4e\x44\x28\x53\125\x4d\x28\x63\x61\156\164\x69\x64\x61\x64\55\143\x6e\164\x64\x65\x76\165\145\x6c\164\51\54\62\51\40\156\x20\x46\122\x4f\x4d\40\157\160\145\x72\155\x76\x20\x61\40\x4a\x4f\x49\116\x20\157\160\145\162\x74\151\x20\x62\40\x4f\x4e\40\50\141\56\144\157\143\x75\x6d\x65\x6e\164\x6f\75\142\x2e\144\x6f\x63\165\155\145\156\x74\x6f\x20\x26\46\x20\x61\56\164\x69\x70\x6f\144\157\x63\75\x62\x2e\164\x69\x70\x6f\144\x6f\143\51\40\127\110\105\122\x45\40\141\x2e\x66\145\x63\x68\141\x64\157\143\76\75\47{$ini}\47\40\46\x26\x20\141\56\146\x65\x63\150\141\144\157\143\x3c\x3d\47{$fin}\47\x20\x26\x26\40\142\56\166\x65\156\x64\145\x64\x6f\162\75\47{$vend}\47\40\x26\46\40\50\x61\x2e\x74\x69\x70\x6f\144\157\143\75\x27\x46\101\x43\47\x20\174\174\40\x61\56\x74\x69\x70\157\x64\x6f\143\x3d\47\x4e\x4f\x54\x27\51\40\x26\46\40\x73\x75\x62\x73\164\162\50\x61\x2e\x63\x6f\x64\151\x67\157\54\x31\54\x33\x29\x3d\47\x4d\111\x53\x27")->row(); return $this->db->query("\x53\x45\114\105\x43\x54\40\x28\x53\105\x4c\x45\103\x54\x20\156\x6f\x6d\x62\x72\x65\40\106\x52\x4f\115\x20\154\151\163\x74\x76\x65\x6e\144\40\x57\x48\105\x52\105\x20\143\157\144\151\147\x6f\75\x61\x2e\x76\145\x6e\144\x65\144\157\162\51\x76\145\156\x64\x65\144\157\x72\54\141\56\164\151\x70\x6f\x64\x6f\x63\54\141\x2e\x64\157\143\x75\x6d\x65\156\x74\x6f\54\141\x2e\x63\x6f\x64\143\154\151\145\x6e\x74\x65\x2c\141\56\156\x6f\x6d\142\x72\145\143\154\x69\54\142\x2e\x63\x6f\x64\151\x67\x6f\x2c\142\x2e\x6e\x6f\x6d\x62\162\x65\x2c\122\117\125\116\x44\x28\x53\x55\x4d\x28\142\x2e\143\x61\x6e\x74\151\x64\x61\x64\55\x62\56\143\156\164\x64\x65\x76\x75\145\154\x74\51\54\x30\51\x20\143\141\x6e\164\151\144\x61\144\x2c\xa\40\x20\40\x20\122\117\x55\116\x44\50\x53\x55\x4d\x28\142\x2e\155\x6f\x6e\x74\157\164\x6f\164\x61\154\51\x2c\62\51\x20\164\157\x74\141\x6c\54\x28\x53\105\114\105\x43\124\40\172\x6f\x6e\x61\x20\106\122\117\115\40\163\145\143\x74\157\x72\145\x73\40\x57\x48\x45\x52\145\40\143\x6f\144\x69\147\157\x3d\x61\x2e\x73\x65\x63\x74\157\162\x29\163\x65\x63\x74\x6f\x72\x2c\50\x53\x45\114\105\x43\124\40\x73\x75\142\163\145\143\x74\x6f\162\x20\106\122\117\x4d\40\x73\x75\x62\163\145\x63\164\157\162\145\x73\x20\127\110\x45\122\105\x20\x63\x6f\x64\x69\147\157\x3d\141\56\163\x65\x63\164\157\x72\x20\x26\x26\x20\163\x75\x62\143\157\x64\151\x67\x6f\75\141\x2e\163\x75\142\x63\x6f\x64\151\x67\x6f\x29\163\165\142\x73\x65\x63\x74\157\162\x20\106\122\x4f\x4d\x20\157\160\145\162\155\166\40\x62\40\112\x4f\x49\x4e\x20\x6f\160\145\x72\x74\151\x20\x61\40\x4f\x4e\x20\50\141\56\x64\157\x63\165\x6d\x65\156\x74\157\x3d\x62\x2e\x64\157\143\x75\155\x65\156\164\x6f\40\x26\46\40\x61\x2e\164\151\160\157\144\x6f\x63\x3d\x62\56\164\x69\160\157\144\157\x63\x29\40\12\x20\x20\x20\40\x57\x48\x45\x52\x45\40\141\56\146\145\x63\x68\x61\143\162\x65\141\x3e\75\x27{$ini}\x27\40\x26\x26\x20\x61\x2e\146\x65\143\150\x61\143\x72\145\141\x3c\x3d\x27{$fin}\x27\x20\x26\46\40\x61\x2e\x76\145\x6e\144\x65\144\157\x72\x3d\x27{$vend}\47\40\x26\x26\40\50\141\x2e\x74\x69\160\x6f\144\157\143\75\47\x46\101\103\47\40\174\x7c\x20\x61\56\164\x69\160\157\144\157\143\75\47\x4e\117\x54\47\x29\12\40\40\40\40\x47\x52\117\x55\x50\x20\102\x59\x20\x61\56\x64\x6f\x63\x75\155\x65\x6e\x74\157\x2c\142\x2e\x63\x6f\144\151\x67\x6f\xa\x20\x20\40\40\x55\x4e\111\117\116\12\40\40\x20\x20\123\x45\114\105\x43\x54\40\47\x3c\x62\76\x54\x6f\x74\141\154\x20\x43\154\x69\x65\156\164\145\x73\x3c\57\142\76\40{$totcli}\x27\x2c\47\74\142\x3e\x54\157\x74\141\154\40\x41\x4c\115\74\x2f\142\x3e\x20{$totalm->n}\x27\54\x27\x3c\142\76\x54\x6f\x74\141\x6c\40\115\x45\104\x3c\x2f\142\76\40{$totmed->n}\x27\54\47\x3c\142\76\124\x6f\x74\141\x6c\40\x49\x4e\x53\x3c\x2f\x62\x3e\40{$totins->n}\47\x2c\47\74\x62\x3e\124\157\164\141\x6c\40\x4d\x49\x53\74\57\142\x3e\x20{$totmis->n}\47\x2c\x43\117\x4e\103\x41\x54\x28\47\x3c\142\76\124\x6f\164\141\154\40\x55\156\x69\144\74\x2f\x62\x3e\47\54\47\40\47\54\x52\x4f\x55\x4e\x44\x28\123\x55\115\50\x62\x2e\x63\x61\x6e\x74\x69\144\141\144\x2d\x62\56\x63\156\x74\x64\x65\166\165\145\x6c\164\x29\54\60\51\x29\x20\x63\x61\x6e\x74\x69\144\141\144\54\xa\40\x20\40\40\103\117\x4e\x43\101\124\50\47\x3c\142\76\124\x6f\164\x61\154\x20\x42\x73\74\57\142\x3e\47\54\47\x20\47\x2c\x52\x4f\125\x4e\x44\50\x53\125\115\x28\142\56\x6d\157\156\x74\x6f\164\157\x74\x61\x6c\51\54\x32\51\51\x20\x74\157\x74\141\x6c\x2c\156\x75\154\154\54\156\165\x6c\154\x2c\x6e\x75\x6c\x6c\54\156\165\154\154\x20\x46\122\117\115\x20\157\160\145\162\155\166\40\142\x20\x4a\117\x49\116\40\x6f\x70\145\162\164\x69\40\x61\40\x4f\116\40\x28\x61\56\144\x6f\143\x75\x6d\145\x6e\164\x6f\x3d\x62\56\144\x6f\x63\x75\155\x65\x6e\164\x6f\40\46\46\x20\141\56\164\151\x70\157\144\157\x63\75\x62\x2e\164\x69\x70\x6f\x64\157\143\x29\x20\12\40\40\40\x20\127\x48\105\122\x45\40\141\56\146\145\143\x68\x61\x63\x72\145\x61\76\x3d\47{$ini}\47\40\x26\x26\x20\x61\56\146\x65\x63\150\141\143\x72\x65\141\74\75\47{$fin}\x27\40\46\x26\40\141\56\166\x65\x6e\144\145\144\157\x72\x3d\x27{$vend}\47\x20\x26\x26\x20\50\x61\56\164\151\x70\x6f\x64\x6f\x63\75\47\x46\x41\x43\x27\40\174\x7c\x20\141\x2e\164\x69\160\x6f\144\x6f\x63\75\x27\116\x4f\x54\x27\x29"); } function reportventacli($ini, $fin, $cli) { return $this->db->query("\x53\x45\x4c\105\x43\124\40\52\40\x20\106\x52\117\115\40\x28\40\x53\105\114\x45\x43\124\40\x61\x2e\146\x65\x63\x68\141\x63\162\145\141\x20\146\x65\143\150\141\x2c\x62\56\143\x6f\144\x69\147\x6f\x2c\40\142\x2e\x6e\157\x6d\x62\x72\145\x2c\x20\122\117\x55\116\104\50\123\125\115\50\x62\56\x63\x61\156\x74\151\144\141\144\51\x2c\60\51\40\143\x61\x6e\x74\151\x64\x61\144\x20\x46\122\117\115\x20\x6f\160\145\162\164\151\40\x61\40\112\117\x49\x4e\40\x6f\160\x65\x72\x6d\166\x20\142\40\x4f\x4e\x20\141\56\x64\157\143\165\155\145\x6e\x74\157\75\142\x2e\x64\157\143\x75\x6d\x65\156\164\x6f\x20\x57\110\105\x52\x45\x20\x61\56\x63\157\x64\143\154\x69\x65\x6e\x74\x65\75\x27{$cli}\47\40\46\46\x20\141\x2e\x66\145\143\150\x61\x63\x72\145\x61\x3e\75\47{$ini}\x27\x20\46\46\x20\x61\x2e\146\x65\143\150\141\143\162\x65\x61\x3c\x3d\x27{$fin}\47\xa\40\x20\x20\40\107\122\x4f\125\x50\40\102\131\40\x62\56\143\157\x64\151\147\x6f\12\x20\x20\40\40\x55\116\x49\x4f\116\40\12\x20\x20\40\40\x53\105\114\x45\103\x54\x20\156\x75\154\154\54\156\165\154\x6c\x2c\x20\x27\x3c\142\x3e\124\x6f\164\141\x6c\x20\x55\156\151\x64\141\x64\145\x73\74\x2f\142\x3e\x27\x2c\x20\x52\117\125\116\x44\50\x53\x55\x4d\50\x62\56\x63\x61\x6e\x74\x69\144\x61\x64\x29\x2c\60\51\x20\143\141\156\164\151\144\x61\x64\x20\x46\122\x4f\115\40\157\160\145\x72\164\151\x20\141\40\x4a\117\111\x4e\40\157\x70\145\x72\x6d\x76\40\x62\x20\117\x4e\40\x61\x2e\x64\x6f\x63\165\x6d\x65\x6e\x74\157\75\142\56\x64\x6f\143\x75\155\145\156\164\157\40\127\110\105\x52\x45\40\x61\56\143\x6f\x64\143\x6c\151\x65\x6e\x74\145\75\47{$cli}\47\40\x26\46\x20\141\56\x66\145\x63\150\x61\143\x72\145\141\76\75\x27{$ini}\47\40\46\x26\40\x61\x2e\146\145\143\x68\x61\x63\x72\x65\x61\74\75\x27{$fin}\47\xa\x20\x20\40\x20\x47\122\x4f\x55\x50\x20\x42\x59\x20\141\x2e\143\x6f\x64\x63\x6c\x69\x65\x6e\x74\x65\40\51\x20\x76\145\x6e\x74\141\x63\154\151\x20\x4f\x52\x44\x45\x52\40\x42\131\x20\x63\x61\x6e\x74\151\x64\x61\144\40\104\x45\123\103"); } function reportrecepcion($ini, $fin) { return $this->db->query("\x53\x45\x4c\x45\x43\124\x20\141\56\x69\x64\40\x6f\x72\x64\145\156\x2c\x61\x2e\146\145\x6d\151\x73\x20\145\x6d\x69\x73\x69\157\x6e\54\x61\56\146\162\145\x63\x65\x70\x20\162\x65\x63\x65\x70\x63\x69\x6f\x6e\54\50\x53\x45\114\x45\x43\124\x20\x6e\x6f\155\x62\x72\145\40\106\x52\x4f\115\40\x70\162\x6f\x76\145\145\x64\x20\127\x48\x45\122\x45\40\x69\144\x3d\x61\56\x70\162\x6f\x76\x65\145\144\x29\40\160\x72\x6f\166\54\x61\56\141\154\x6d\141\x63\x65\x6e\54\142\x2e\x63\x6f\x64\151\x67\x6f\x2c\12\40\x20\x20\40\x28\x53\105\114\x45\x43\124\40\x6e\157\155\x62\162\x65\x20\x46\122\x4f\x4d\40\141\x72\x74\x69\x63\165\x6c\x6f\40\127\110\105\122\105\x20\143\157\144\x69\147\157\75\x62\56\143\157\144\151\x67\157\x29\x20\156\x6f\155\142\162\x65\x2c\x62\x2e\x6c\x6f\x74\145\x2c\x62\x2e\x65\x6c\x61\142\54\142\x2e\x76\x65\x6e\143\x65\54\142\56\x63\141\x6e\164\x2c\142\56\143\x6f\163\x74\157\xa\x20\40\x20\x20\x20\x46\x52\117\115\40\x6f\x72\x64\x63\40\141\x20\112\117\111\116\40\x69\x74\157\162\144\x63\x20\x62\x20\117\116\x20\141\56\x69\x64\75\142\56\157\x72\144\x63\x20\127\110\105\122\105\40\141\x2e\146\162\x65\x63\x65\x70\76\x3d\47{$ini}\47\x20\46\x26\x20\141\56\x66\x72\x65\143\x65\x70\x3c\x3d\47{$fin}\47\40\x26\x26\40\x61\56\x60\x73\164\x61\164\x75\163\140\75\x31\40\x26\46\40\142\x2e\140\163\x74\141\x74\x75\163\140\x3d\61"); } function reportcobranza($ini, $fin) { return $this->db->query("\x53\105\x4c\105\103\x54\40\50\x53\x45\x4c\x45\103\x54\x20\x6e\x6f\155\x62\162\x65\40\106\x52\x4f\x4d\40\x6c\x69\x73\164\166\x65\156\144\x20\127\x48\105\x52\105\x20\x63\x6f\x64\151\x67\157\x3d\141\x2e\166\145\156\x64\145\x64\x6f\x72\40\x4c\111\115\111\x54\40\61\51\x20\166\145\156\144\145\x64\x6f\162\54\141\x2e\x64\x6f\143\165\155\145\156\x74\x6f\x2c\12\40\40\x20\x20\x28\x53\x45\x4c\x45\103\x54\40\163\165\142\x73\145\x63\x74\157\x72\40\x46\122\x4f\115\40\x73\x75\142\163\145\143\x74\x6f\x72\145\x73\x20\127\x48\105\122\105\40\x63\x6f\x64\x69\x67\x6f\75\x61\x2e\163\x65\x63\164\157\162\40\x26\46\40\x73\165\x62\143\x6f\x64\x69\147\157\75\x61\56\x73\x75\142\x63\x6f\x64\151\147\157\40\51\x20\172\157\156\x61\54\141\56\143\157\144\x63\x6c\x69\145\156\164\x65\x2c\12\40\40\x20\40\x61\x2e\146\145\x63\x68\x61\143\162\x65\x61\x2c\x61\56\x6e\x6f\x6d\x62\162\x65\x63\154\151\54\x52\x4f\125\x4e\x44\50\x61\x2e\x74\157\164\141\154\146\151\156\x61\154\x2c\62\51\40\x74\x6f\x74\141\x6c\x66\x69\x6e\141\154\x2c\122\117\x55\x4e\104\x28\141\x2e\x74\157\x74\x69\155\160\x75\145\163\x74\x2c\62\x29\40\164\157\164\151\x6d\160\165\145\163\164\54\122\x4f\x55\x4e\x44\50\141\x2e\164\x6f\x74\156\x65\x74\157\54\x32\51\x20\164\x6f\164\156\x65\164\157\54\x52\117\125\x4e\x44\x28\x61\x2e\x74\157\x74\x61\154\144\x2c\62\51\x20\x74\x6f\x74\x61\154\x64\x2c\12\x20\40\x20\x20\111\106\50\50\123\x45\114\x45\x43\124\40\122\x4f\125\x4e\x44\x28\123\125\115\x28\164\157\x74\141\154\144\x29\54\x32\x29\40\x74\x6f\164\x61\154\144\40\106\x52\x4f\115\40\x61\x70\x6c\151\143\141\156\143\x20\127\x48\x45\122\105\x20\146\x61\x63\x3d\x61\56\144\157\143\x75\x6d\145\156\164\x6f\51\76\60\54\x28\x53\x45\114\x45\103\x54\x20\122\x4f\x55\116\x44\x28\123\125\x4d\x28\164\157\x74\141\x6c\144\x29\x2c\62\51\40\164\x6f\x74\141\x6c\144\40\x46\x52\x4f\115\40\141\x70\154\151\x63\141\156\x63\40\127\x48\105\122\x45\x20\146\x61\x63\75\x61\56\x64\157\x63\165\155\145\156\164\157\x29\54\x30\x29\40\116\103\54\12\x20\40\40\x20\x49\106\50\50\123\105\x4c\x45\x43\124\x20\x52\117\x55\x4e\x44\x28\x53\125\x4d\x28\164\x6f\x74\141\x6c\146\151\x6e\x61\154\x2f\x28\x53\105\114\x45\x43\124\40\157\x66\151\x63\151\141\x6c\x20\106\x52\x4f\x4d\x20\155\x6f\156\x65\143\x61\x6d\x20\127\110\x45\x52\x45\x20\146\x65\x63\x68\x61\x3c\x3d\141\56\x66\145\143\x68\x61\143\x72\145\141\x20\117\x52\x44\x45\122\40\102\x59\40\146\x65\143\150\x61\x20\104\105\x53\103\x20\x4c\x49\115\111\x54\40\61\x29\x29\x2c\x32\51\x20\164\157\x74\x61\x6c\144\x20\x46\122\117\x4d\x20\x6f\x70\145\162\164\151\x20\x57\110\x45\122\x45\40\141\x6e\164\x64\x6f\x63\75\x61\56\x61\156\x74\x64\x6f\x63\x20\46\x26\x20\164\151\x70\157\x64\x6f\x63\75\x27\x52\x45\x54\47\x20\46\46\40\141\156\x74\x64\157\143\41\x3d\47\47\51\x3e\x30\54\x28\123\x45\x4c\x45\x43\124\40\122\117\125\x4e\x44\x28\x53\125\115\50\x74\157\x74\141\x6c\x66\x69\x6e\x61\x6c\57\50\x53\x45\x4c\x45\103\124\40\157\x66\x69\143\151\x61\x6c\x20\x46\122\x4f\x4d\x20\x6d\x6f\x6e\145\143\141\155\x20\127\110\105\x52\x45\40\x66\x65\x63\150\141\74\x3d\141\x2e\x66\145\143\x68\141\x63\162\145\141\40\117\122\x44\105\122\x20\x42\x59\x20\146\145\143\150\x61\40\x44\105\123\103\40\114\111\x4d\111\124\x20\x31\51\51\54\x32\51\40\x74\x6f\x74\x61\x6c\144\40\x46\122\x4f\x4d\40\157\x70\x65\162\x74\151\40\x57\110\105\122\105\x20\141\156\x74\144\x6f\143\75\x61\56\x61\156\x74\144\157\143\40\46\46\40\x74\151\x70\157\x64\x6f\143\x3d\47\x52\105\x54\x27\x29\54\x30\x29\x20\x52\x45\x54\x2c\12\x20\40\40\x20\x28\x53\x45\114\105\x43\x54\40\107\122\117\125\x50\x5f\x43\x4f\x4e\x43\x41\x54\50\x6d\157\156\x74\157\x29\40\106\122\117\x4d\x20\157\x70\x65\162\143\x6c\x69\40\x57\x48\105\x52\x45\x20\x69\144\146\x61\143\75\141\56\144\x6f\x63\x75\x6d\x65\156\164\x6f\40\46\x26\x20\151\x64\x63\157\x6e\x73\x62\141\156\x63\40\111\x53\40\116\117\124\x20\x4e\x55\114\114\40\x47\122\x4f\125\120\40\102\x59\40\151\144\146\141\143\x29\40\x61\x62\x6f\x6e\157\142\x73\x2c\12\40\40\x20\40\50\x53\105\114\x45\103\x54\40\107\x52\117\125\x50\x5f\x43\117\x4e\103\x41\124\50\155\x6f\x6e\164\157\x64\51\40\106\122\117\x4d\40\x6f\x70\145\x72\x63\154\x69\40\127\110\105\122\x45\40\151\144\146\x61\143\x3d\141\x2e\x64\x6f\x63\165\155\x65\x6e\164\x6f\x20\46\46\x20\151\144\143\157\x6e\163\142\141\x6e\143\x20\111\x53\x20\x4e\117\124\x20\x4e\x55\114\114\x20\107\x52\117\x55\x50\40\102\131\40\151\x64\146\x61\143\x29\40\x61\142\x6f\x6e\157\x24\x2c\xa\x20\x20\40\x20\x52\x4f\x55\x4e\104\x28\50\x53\105\x4c\105\103\x54\x20\111\x46\50\123\125\x4d\x28\155\x6f\x6e\x74\157\51\76\60\x2c\x53\x55\115\x28\x6d\157\x6e\164\x6f\x29\x2c\x30\51\40\106\122\117\x4d\x20\x6f\160\x65\162\143\154\x69\x20\x57\110\x45\122\x45\40\x69\x64\146\141\143\x3d\x61\56\x64\157\x63\x75\x6d\145\156\164\157\40\46\46\40\x69\x64\x63\x6f\156\163\142\141\156\143\x20\111\x53\x20\x4e\x4f\x54\x20\x4e\x55\x4c\x4c\51\54\x32\51\x20\x70\141\147\x61\x64\x6f\142\163\54\12\40\x20\40\40\122\117\125\116\104\x28\50\123\x45\x4c\105\103\124\x20\111\106\50\123\x55\x4d\x28\155\x6f\x6e\x74\x6f\x64\51\x3e\x30\x2c\x53\x55\115\50\155\x6f\x6e\x74\157\x64\x29\54\x30\x29\40\x46\122\x4f\115\x20\x6f\x70\145\x72\143\154\151\40\127\110\x45\x52\x45\40\x69\x64\x66\x61\143\75\141\x2e\x64\157\x63\165\x6d\x65\x6e\164\x6f\x20\46\x26\x20\x69\144\x63\157\156\163\142\141\156\143\x20\x49\123\40\116\x4f\124\x20\116\125\114\114\x29\54\62\51\40\160\141\147\x61\x64\x6f\144\x2c\122\117\125\x4e\x44\x28\x61\x2e\164\x6f\164\x70\x61\x67\x6f\x73\x2c\62\51\40\x70\141\147\x6f\x73\137\160\163\153\x63\x6c\157\165\x64\x2c\x61\x2e\162\x65\x63\x65\160\x63\x69\x6f\x6e\54\141\56\144\151\141\163\143\x72\145\x64\12\x20\40\x20\40\106\x52\117\115\x20\x6f\x70\x65\x72\164\151\x20\141\40\x57\x48\x45\x52\x45\40\x61\x2e\x66\145\x63\x68\141\x63\x72\x65\141\x3e\x3d\47{$ini}\x27\x20\x26\x26\x20\x61\56\x66\145\x63\x68\x61\x63\162\145\141\74\x3d\x27{$fin}\x27\40\46\46\x20\50\x61\56\x74\x69\160\157\144\157\143\75\x27\106\x41\x43\47\x20\x7c\x7c\40\141\56\164\151\160\x6f\144\x6f\x63\75\x27\x4e\117\124\47\x29\x20\x26\46\x20\50\123\125\x42\x53\x54\x52\x28\x61\x2e\x63\157\x64\143\154\151\x65\x6e\x74\x65\x2c\61\x2c\x33\51\x21\75\x27\x49\x4e\x54\47\40\46\x26\x20\x61\56\x63\157\144\x63\154\151\x65\x6e\164\x65\41\75\47\x4d\x46\60\x30\x30\x30\x27\51"); } function reportcobranzazona($zona) { return $this->db->query("\x53\105\114\105\103\x54\x20\x76\145\156\x64\x65\144\x6f\x72\54\144\157\143\x75\155\145\156\164\157\x2c\172\x6f\x6e\x61\54\143\x6f\144\x63\x6c\151\145\x6e\x74\145\54\40\146\145\143\150\141\143\x72\x65\141\x2c\166\x65\156\x63\x65\x20\x76\137\151\x6e\144\x65\x78\x2c\166\145\156\143\x65\x63\x20\x76\137\143\x72\x65\144\x69\x74\x6f\x2c\156\157\x6d\x62\162\x65\x63\154\x69\54\x74\157\164\141\x6c\x66\151\x6e\141\154\x2c\x74\157\164\151\155\160\165\145\x73\164\54\164\157\164\156\145\x74\157\x2c\x74\x6f\x74\141\154\x64\54\x6e\143\54\162\145\x74\x2c\x61\x62\x6f\156\157\142\x73\x2c\x61\x62\x6f\x6e\157\x24\x2c\x70\141\147\141\x64\x6f\x62\163\54\x70\x61\147\141\144\157\x64\x2c\x70\141\x67\157\x73\x5f\x70\x73\x6b\143\154\157\x75\144\x2c\x28\x74\157\x74\141\x6c\144\55\50\x70\141\147\x61\x64\x6f\x64\53\156\143\53\162\x65\x74\51\x29\40\x64\145\142\145\x24\x2c\x72\x65\x63\145\160\x63\151\157\156\54\144\151\x61\163\x63\x72\145\144\x20\x46\122\x4f\x4d\x20\50\xa\40\x20\x20\x20\x53\105\x4c\105\x43\x54\40\50\123\x45\114\x45\x43\x54\40\156\x6f\155\142\x72\x65\x20\x46\x52\117\x4d\40\154\x69\x73\164\x76\x65\156\x64\x20\127\x48\105\122\x45\40\x63\x6f\144\x69\x67\157\75\x61\56\166\145\x6e\x64\145\144\x6f\162\40\x4c\111\115\111\124\40\x31\51\x20\166\145\156\144\x65\x64\x6f\162\54\141\56\x64\x6f\x63\165\155\x65\x6e\x74\x6f\54\xa\40\x20\x20\x20\50\x53\x45\x4c\x45\103\x54\40\x73\x75\142\x73\145\143\164\x6f\162\x20\106\x52\117\115\x20\163\x75\142\163\145\143\x74\157\162\145\163\40\127\x48\x45\x52\105\x20\x63\157\144\x69\147\x6f\75\x61\56\163\145\x63\164\157\x72\40\46\x26\40\163\165\142\x63\x6f\x64\x69\x67\x6f\x3d\141\x2e\163\165\142\x63\x6f\x64\151\147\157\40\x29\40\x7a\157\156\x61\x2c\x61\x2e\143\157\x64\143\154\x69\145\x6e\x74\x65\54\xa\40\40\x20\40\x61\x2e\x66\145\x63\x68\141\x63\162\145\x61\x2c\x61\56\x76\145\156\143\x65\54\141\x2e\166\145\x6e\143\145\x63\x2c\x61\x2e\156\x6f\x6d\x62\162\145\x63\x6c\x69\54\122\117\125\116\104\x28\141\56\164\x6f\164\141\154\146\x69\156\x61\154\54\62\51\x20\164\x6f\x74\141\154\146\x69\x6e\x61\154\54\122\x4f\x55\x4e\104\x28\141\x2e\164\157\x74\151\155\x70\x75\145\163\x74\x2c\62\51\x20\x74\x6f\x74\151\155\160\165\x65\x73\x74\54\122\x4f\x55\116\x44\50\141\x2e\164\x6f\164\x6e\145\x74\157\x2c\62\51\x20\164\157\164\x6e\x65\x74\x6f\54\122\x4f\125\116\x44\50\141\x2e\x74\x6f\164\x61\154\144\54\62\x29\x20\x74\157\164\141\x6c\x64\54\12\40\40\x20\40\x49\106\50\x28\123\105\x4c\105\103\124\x20\122\117\x55\x4e\104\50\x53\125\x4d\50\164\x6f\x74\x61\x6c\x64\51\x2c\x32\x29\40\164\x6f\x74\x61\x6c\144\x20\106\122\x4f\115\x20\x61\x70\x6c\x69\x63\x61\156\x63\x20\x57\x48\x45\x52\105\40\x66\141\x63\x3d\141\x2e\x64\x6f\x63\165\155\145\x6e\x74\x6f\x29\76\60\x2c\50\x53\105\114\105\x43\124\x20\122\x4f\x55\116\x44\50\x53\x55\115\x28\164\x6f\x74\x61\154\144\x29\x2c\62\x29\x20\x74\x6f\164\141\x6c\x64\40\106\122\117\115\40\141\160\x6c\x69\143\x61\x6e\x63\x20\x57\110\105\122\105\x20\146\x61\143\75\141\56\x64\x6f\x63\x75\155\145\156\x74\157\x29\54\60\x29\40\116\x43\54\12\40\40\x20\40\111\106\x28\50\x53\x45\x4c\x45\x43\124\40\x52\117\125\116\104\50\x53\x55\115\50\164\x6f\164\x61\x6c\146\151\156\x61\154\x2f\x28\123\105\114\x45\x43\124\x20\157\146\151\x63\x69\141\x6c\40\x46\122\x4f\115\x20\155\157\x6e\x65\x63\141\155\x20\127\110\x45\x52\105\x20\146\x65\x63\x68\141\x3c\x3d\141\x2e\146\x65\x63\150\x61\x63\x72\145\141\x20\x4f\x52\104\105\122\x20\x42\x59\x20\146\145\x63\x68\141\x20\x44\x45\x53\x43\40\114\111\115\111\124\40\61\x29\x29\54\x32\51\x20\164\157\164\x61\x6c\144\x20\x46\x52\x4f\115\40\x6f\x70\145\162\164\151\40\x57\x48\105\122\105\40\x61\156\x74\x64\157\143\75\x61\x2e\141\156\164\x64\x6f\143\40\x26\46\x20\x74\151\x70\x6f\144\x6f\x63\75\47\x52\x45\x54\x27\x20\x26\46\x20\141\x6e\x74\x64\x6f\x63\x21\75\x27\47\x29\x3e\x30\x2c\x28\123\105\x4c\x45\x43\124\x20\x52\x4f\x55\x4e\x44\50\123\125\115\50\x74\x6f\164\141\154\146\151\x6e\141\154\x2f\x28\123\105\x4c\x45\103\124\x20\157\x66\x69\x63\151\141\154\40\106\122\x4f\115\x20\x6d\157\x6e\x65\143\x61\155\40\x57\x48\x45\x52\x45\x20\x66\x65\143\x68\x61\74\x3d\141\x2e\x66\x65\x63\150\141\x63\x72\145\x61\40\x4f\122\x44\x45\x52\40\x42\131\x20\146\145\x63\150\141\x20\104\x45\123\x43\40\x4c\111\x4d\111\124\40\x31\51\x29\x2c\x32\51\40\x74\157\x74\141\154\144\40\x46\x52\117\115\40\x6f\x70\x65\x72\164\151\x20\127\110\105\122\x45\40\x61\156\x74\144\157\143\75\x61\x2e\141\x6e\164\144\157\x63\40\x26\46\40\164\x69\x70\x6f\x64\x6f\x63\75\x27\122\105\x54\x27\51\54\60\51\x20\122\x45\124\54\12\x20\40\x20\40\50\x53\105\114\105\x43\x54\40\x47\122\117\x55\x50\137\x43\x4f\x4e\x43\x41\x54\x28\x6d\157\x6e\x74\157\40\123\x45\120\x41\122\101\124\117\122\x20\x27\x3b\47\51\40\x46\122\117\115\40\157\160\x65\x72\x63\154\151\x20\127\110\x45\122\105\x20\151\x64\x66\x61\143\75\141\x2e\144\x6f\143\x75\x6d\x65\156\x74\157\40\46\x26\x20\151\x64\x63\x6f\156\163\142\x61\156\143\40\x49\x53\x20\116\x4f\124\x20\x4e\x55\114\x4c\x20\107\122\117\x55\120\40\x42\x59\x20\x69\144\x66\x61\x63\x29\x20\141\x62\157\156\157\142\x73\54\xa\x20\x20\x20\x20\x28\x53\105\114\x45\103\x54\x20\x47\x52\x4f\125\x50\137\103\117\x4e\103\x41\124\50\x6d\157\x6e\x74\157\x64\x20\x53\105\120\x41\x52\101\124\x4f\122\x20\x27\73\x27\51\40\106\122\x4f\115\40\x6f\x70\145\162\143\x6c\x69\x20\x57\x48\105\122\x45\40\151\144\146\141\x63\75\x61\56\144\x6f\x63\x75\155\145\x6e\164\x6f\x20\46\46\40\151\x64\x63\157\x6e\x73\x62\141\156\x63\x20\111\123\x20\x4e\117\x54\40\116\125\x4c\x4c\x20\x47\122\x4f\125\120\x20\x42\x59\x20\151\144\146\x61\x63\51\x20\x61\142\157\x6e\x6f\x24\x2c\xa\40\x20\40\40\122\x4f\x55\116\x44\50\50\123\x45\x4c\105\x43\124\40\x49\106\50\123\x55\x4d\x28\155\157\x6e\x74\x6f\51\x3e\60\54\123\125\115\x28\155\x6f\x6e\164\x6f\x29\54\60\x29\x20\106\x52\117\115\40\x6f\x70\145\x72\143\154\151\x20\x57\x48\x45\122\x45\40\x69\x64\146\141\143\75\x61\56\x64\x6f\x63\165\x6d\145\x6e\x74\157\x20\46\x26\40\151\x64\x63\x6f\x6e\163\142\141\156\x63\40\111\123\x20\x4e\117\124\40\116\125\114\114\x29\x2c\62\51\40\x70\x61\x67\141\144\x6f\x62\163\x2c\xa\x20\x20\x20\40\122\x4f\125\116\x44\50\x28\123\x45\x4c\x45\103\124\x20\x49\106\50\x53\125\x4d\x28\155\x6f\x6e\x74\x6f\144\x29\x3e\x30\x2c\x53\125\115\x28\x6d\157\x6e\164\x6f\144\x29\x2c\x30\x29\40\x46\122\x4f\115\x20\x6f\x70\x65\x72\x63\x6c\x69\40\x57\110\105\x52\105\40\x69\144\146\x61\143\x3d\x61\x2e\x64\x6f\x63\165\x6d\x65\x6e\x74\157\40\x26\x26\40\x69\144\143\157\x6e\x73\x62\141\156\x63\40\x49\123\x20\116\117\124\x20\x4e\x55\114\x4c\x29\54\62\x29\x20\160\141\147\x61\144\x6f\x64\54\122\x4f\125\x4e\x44\50\x61\x2e\x74\157\164\x70\x61\147\x6f\x73\x2c\x32\x29\40\x70\141\x67\157\x73\137\160\x73\153\x63\x6c\157\165\144\x2c\141\x2e\162\145\x63\x65\x70\x63\151\x6f\x6e\x2c\x61\56\x64\x69\141\x73\143\x72\x65\144\xa\x20\x20\40\x20\106\122\117\x4d\40\157\x70\x65\x72\x74\151\x20\141\40\x57\110\105\x52\x45\40\x43\117\x4e\x43\101\124\x28\141\56\x73\x65\x63\164\x6f\162\x2c\141\56\x73\x75\142\143\x6f\144\151\147\x6f\51\75\x27{$zona}\47\x20\x26\46\40\50\141\56\x74\x69\160\x6f\144\x6f\x63\x3d\x27\106\101\103\x27\40\x7c\x7c\40\x61\56\x74\x69\x70\x6f\x64\157\x63\75\x27\116\117\x54\x27\51\x20\46\x26\40\50\x53\125\102\x53\x54\122\50\x61\56\x63\x6f\144\x63\154\151\x65\x6e\164\x65\54\61\x2c\63\51\41\75\47\111\x4e\124\47\x20\x26\x26\40\x61\x2e\x63\x6f\x64\x63\x6c\151\x65\156\164\145\x21\x3d\x27\115\x46\x30\x30\x30\60\x27\x29\x29\40\x63\157\142\x72\141\x6e\x7a\141\172\157\156\141\40\110\x41\126\111\116\107\x20\160\x61\147\x61\144\x6f\x64\x2b\x6e\143\x2b\x72\145\164\x3c\x28\164\157\164\141\x6c\x64\55\x30\56\65\x29"); } function reportcobranzazonatodo($ini, $fin) { return $this->db->query("\123\x45\114\105\103\124\40\x76\x65\156\x64\145\144\157\162\54\172\157\156\x61\x2c\x64\157\143\165\155\145\156\x74\157\x2c\145\x6d\151\x73\151\157\x6e\54\x72\145\143\145\x70\143\151\157\156\54\x64\x69\141\163\143\162\x65\x64\x2c\x76\x65\156\143\x65\137\151\156\x64\145\170\54\166\x65\156\143\x65\x5f\x63\162\x65\x64\x69\x74\x6f\54\143\x6f\x64\143\154\151\145\x6e\164\145\x2c\156\x6f\155\142\162\x65\143\154\151\54\x74\157\x74\x61\x6c\x62\163\x2c\164\157\x74\141\154\44\x2c\111\x46\50\160\x61\x67\141\x64\x6f\x24\76\60\54\x70\141\x67\141\144\157\x24\54\x30\51\x20\x70\141\x67\141\x64\157\x24\54\x20\x49\x46\50\116\103\76\60\54\116\103\x2c\x30\x29\x20\x4e\103\x2c\111\x46\50\x52\105\x54\x3e\x30\x2c\x52\105\x54\x2c\60\x29\40\122\105\x54\40\106\122\117\115\40\12\x20\x20\40\40\x28\40\12\x20\40\40\x20\123\x45\114\x45\x43\124\40\50\x53\105\x4c\105\x43\x54\40\156\157\x6d\142\162\x65\x20\x46\x52\117\115\40\154\151\163\164\x76\x65\156\x64\40\127\110\x45\x52\x45\40\143\157\x64\x69\147\157\x3d\141\56\166\x65\156\144\x65\144\x6f\162\x20\114\x49\115\111\124\40\61\x29\x20\166\x65\156\x64\145\x64\x6f\162\54\xa\40\40\x20\40\x20\x20\x20\50\123\x45\114\105\x43\124\x20\163\x75\142\163\x65\143\x74\x6f\162\x20\106\x52\x4f\115\40\163\x75\x62\x73\145\x63\x74\157\x72\x65\x73\40\x57\110\105\122\x45\40\143\157\144\151\147\157\x3d\x61\x2e\x73\x65\x63\x74\x6f\162\40\46\46\40\x73\165\x62\x63\157\144\x69\x67\157\x3d\x61\56\163\x75\x62\143\157\x64\151\147\157\40\x29\x20\x7a\157\x6e\x61\x2c\xa\40\40\40\x20\x20\40\40\x61\x2e\144\157\143\x75\155\145\156\x74\157\54\x61\x2e\x66\x65\x63\x68\141\x63\162\145\141\40\x65\155\151\163\x69\157\x6e\x2c\x61\x2e\x72\145\143\x65\160\x63\x69\157\x6e\x2c\141\56\x64\151\141\163\x63\162\145\144\x2c\x44\101\124\x45\137\x41\x44\104\x28\x61\56\162\145\143\145\160\143\151\157\x6e\x2c\111\x4e\x54\105\122\x56\101\114\40\x61\56\x64\151\141\x73\x69\156\144\x65\170\x20\104\101\x59\51\x20\166\x65\x6e\x63\145\137\x69\x6e\144\145\170\x2c\12\40\40\40\40\40\x20\x20\x44\x41\x54\x45\x5f\101\104\104\50\141\56\x72\x65\x63\x65\x70\143\151\157\156\54\111\x4e\124\105\x52\x56\x41\x4c\x20\141\x2e\x64\x69\x61\163\x63\162\x65\x64\40\104\101\131\51\x20\166\x65\x6e\x63\145\x5f\143\162\x65\x64\151\x74\x6f\54\x61\56\x63\x6f\144\143\x6c\151\145\156\164\145\54\141\56\156\x6f\155\x62\162\x65\143\x6c\x69\x2c\122\x4f\125\116\x44\50\x61\56\x74\157\x74\x61\x6c\146\x69\x6e\141\x6c\x2c\62\x29\x20\x74\x6f\x74\x61\154\142\163\54\122\117\x55\x4e\104\50\x53\x55\115\50\141\56\164\x6f\x74\x61\154\144\51\54\x32\51\40\164\x6f\164\141\154\44\x2c\12\40\x20\40\x20\x20\x20\x20\122\x4f\x55\116\x44\50\50\123\x45\x4c\105\x43\x54\40\x49\x46\50\123\125\115\x28\x6d\157\x6e\x74\x6f\144\51\76\x30\x2c\x53\x55\x4d\x28\x6d\x6f\x6e\164\x6f\144\51\54\60\x29\x20\106\x52\x4f\x4d\40\157\x70\x65\162\143\x6c\151\x20\x57\x48\105\122\x45\x20\x69\144\x66\x61\143\x3d\141\x2e\144\157\x63\165\155\x65\156\164\x6f\40\x26\46\x20\x69\x64\143\x6f\x6e\163\142\x61\156\x63\x20\x49\123\x20\116\x4f\x54\x20\x4e\125\114\114\x29\54\x32\51\x20\160\141\147\x61\x64\x6f\x24\x2c\12\x20\40\40\x20\x20\x20\40\x28\123\x45\x4c\105\103\124\x20\122\117\x55\116\x44\x28\123\125\x4d\50\164\157\164\141\154\144\x29\54\x32\51\40\x74\157\x74\x61\154\144\x20\106\x52\117\x4d\40\141\x70\154\151\x63\x61\x6e\x63\x20\127\110\x45\122\105\40\x66\x61\x63\x3d\141\56\x64\157\143\x75\x6d\x65\x6e\164\x6f\x29\x20\x4e\x43\54\xa\x20\40\40\40\40\x20\x20\x28\x53\105\x4c\x45\x43\x54\x20\x52\117\x55\x4e\x44\x28\x53\x55\x4d\x28\x74\157\x74\141\x6c\x66\x69\156\x61\x6c\57\50\x53\105\114\x45\x43\124\x20\x6f\146\x69\x63\x69\x61\154\40\x46\122\x4f\115\40\x6d\157\156\145\x63\141\155\40\x57\x48\x45\x52\x45\x20\x66\x65\143\x68\x61\x3c\x3d\141\x2e\x66\145\x63\150\141\143\x72\x65\141\40\117\122\104\x45\x52\40\102\131\40\146\x65\x63\150\141\x20\104\105\x53\103\x20\114\111\x4d\111\x54\x20\x31\51\51\x2c\x32\51\x20\164\157\x74\141\x6c\x64\40\106\x52\x4f\115\40\157\x70\x65\x72\x74\151\40\x57\110\105\122\105\x20\141\156\x74\x64\157\x63\x3d\x61\56\x61\156\164\x64\x6f\x63\40\x26\x26\40\x74\x69\160\157\x64\x6f\143\75\x27\122\105\124\47\40\46\x26\x20\x61\156\164\x64\x6f\143\41\75\x27\x27\51\x20\x52\x45\124\xa\40\40\40\40\40\40\x20\x46\122\117\115\x20\x6f\x70\145\x72\x74\x69\40\x61\xa\x20\x20\40\40\40\40\x20\x57\110\105\122\x45\40\x28\141\x2e\164\151\x70\x6f\x64\157\x63\75\x27\x46\101\103\47\x20\174\174\x20\141\56\164\x69\x70\x6f\x64\x6f\x63\75\x27\116\x4f\124\47\51\40\x26\46\40\x61\56\164\x6f\x74\141\154\144\76\60\x20\x26\x26\x20\141\x2e\x65\163\x74\x61\164\x75\163\x64\x6f\x63\x21\x3d\47\130\47\40\x26\x26\x20\x28\123\x55\102\x53\124\x52\x28\x61\56\x63\157\x64\143\x6c\151\x65\156\x74\x65\x2c\61\x2c\x33\51\41\x3d\x27\x49\x4e\x54\x27\x20\x26\46\x20\x61\x2e\x63\157\x64\143\x6c\151\x65\156\164\145\41\x3d\x27\x4d\106\x30\x30\60\60\x27\51\x20\x26\x26\x20\x28\x61\56\146\x65\x63\150\x61\x63\162\x65\x61\76\75\47{$ini}\x27\40\x26\46\40\x61\56\146\x65\143\150\141\143\x72\x65\x61\74\75\47{$fin}\x27\51\12\x20\40\x20\x20\40\x20\40\x47\x52\117\x55\x50\x20\102\131\40\141\56\x64\157\143\165\x6d\x65\156\x74\157\x20\xa\x20\40\x20\x20\51\x20\xa\x20\40\40\x20\160\145\x6e\144\x69\145\156\x74\x65\x20\x48\101\126\x49\116\x47\x20\x70\141\147\141\144\157\x24\x2b\116\103\53\122\105\124\x3c\x28\164\x6f\x74\x61\x6c\44\x2d\60\56\65\x29\40\117\122\x44\x45\x52\x20\x42\131\40\144\157\x63\x75\x6d\145\156\x74\x6f\x20\101\x53\x43"); } function reportcobranzazonatodobs($ini, $fin) { return $this->db->query("\123\105\x4c\x45\103\x54\40\166\145\x6e\x64\x65\144\x6f\x72\54\172\x6f\x6e\141\54\x64\x6f\143\165\x6d\145\x6e\164\x6f\x2c\x65\x6d\151\x73\151\x6f\156\x2c\x72\x65\143\145\x70\143\x69\x6f\x6e\x2c\x64\151\141\163\143\162\x65\144\x2c\166\x65\156\x63\x65\x5f\151\156\144\x65\170\x2c\x76\145\x6e\143\x65\137\x63\162\x65\144\x69\x74\157\54\143\157\144\x63\154\151\145\156\164\145\x2c\156\x6f\x6d\142\x72\145\143\x6c\151\x2c\x74\x6f\164\x61\x6c\142\x73\x2c\x74\x6f\x74\141\x6c\x24\54\x49\106\x28\160\141\x67\x61\144\x6f\44\76\x30\x2c\160\x61\x67\141\144\157\x24\x2c\x30\x29\x20\160\141\147\x61\144\x6f\44\x2c\40\x49\106\x28\x4e\103\76\x30\54\x4e\103\54\60\x29\x20\x4e\103\x2c\111\x46\50\x52\x45\124\76\60\x2c\122\105\x54\54\60\x29\x20\122\105\x54\40\106\x52\x4f\x4d\x20\12\40\x20\x20\x20\x28\x20\xa\40\40\40\x20\x53\105\x4c\105\103\124\40\50\x53\x45\x4c\105\103\124\40\x6e\x6f\155\142\162\145\40\x46\122\x4f\x4d\40\x6c\151\x73\x74\166\145\x6e\144\40\127\x48\x45\122\105\40\143\157\x64\151\147\x6f\75\141\x2e\x76\145\156\144\x65\144\157\162\x20\x4c\111\115\x49\124\x20\x31\x29\40\x76\145\x6e\x64\145\x64\157\x72\54\xa\40\x20\40\40\40\40\x20\50\123\105\x4c\x45\103\x54\40\x73\x75\x62\x73\145\x63\x74\x6f\162\x20\106\x52\117\115\40\163\x75\142\x73\145\143\x74\x6f\x72\x65\x73\40\127\110\x45\x52\105\40\143\157\144\151\147\x6f\75\141\x2e\163\x65\143\164\x6f\162\x20\46\x26\40\x73\165\142\143\x6f\144\151\x67\157\x3d\x61\56\163\165\x62\143\x6f\x64\151\x67\157\x20\x29\40\x7a\x6f\x6e\141\x2c\xa\x20\x20\x20\x20\x20\40\40\x61\56\144\157\143\x75\155\145\x6e\164\157\54\141\x2e\146\x65\143\x68\141\143\x72\145\141\40\x65\x6d\x69\163\151\x6f\156\54\141\x2e\x72\x65\143\145\x70\x63\x69\157\156\x2c\141\56\x64\x69\x61\163\143\162\145\x64\x2c\x44\x41\x54\x45\x5f\x41\x44\104\50\x61\56\162\x65\x63\145\160\143\151\157\156\54\111\116\x54\x45\x52\126\101\x4c\x20\141\56\x64\151\x61\163\x69\156\144\x65\x78\40\104\101\x59\51\40\166\145\x6e\143\x65\137\x69\156\x64\x65\x78\54\12\40\40\x20\40\x20\40\x20\104\101\x54\x45\x5f\101\104\104\50\x61\56\x72\145\143\145\x70\143\151\157\x6e\x2c\111\x4e\x54\105\x52\126\101\x4c\x20\141\x2e\144\x69\x61\x73\143\x72\x65\144\x20\x44\x41\131\x29\x20\x76\145\156\x63\145\x5f\x63\x72\x65\x64\x69\164\x6f\54\x61\56\x63\157\x64\143\154\x69\x65\x6e\164\145\x2c\141\x2e\156\157\155\142\162\x65\x63\x6c\x69\x2c\x52\x4f\125\x4e\104\50\141\56\x74\x6f\x74\141\x6c\x66\151\x6e\x61\x6c\x2c\x32\51\x20\x74\157\x74\141\154\142\x73\54\xa\40\x20\40\x20\x20\40\x20\x52\x4f\125\116\104\50\x28\x53\105\114\105\x43\124\40\x49\106\x28\123\125\115\x28\x6d\x6f\156\164\x6f\144\51\x3e\60\54\123\125\x4d\x28\155\x6f\156\x74\157\x64\51\x2c\60\x29\40\x46\122\117\x4d\x20\157\160\145\x72\x63\x6c\x69\40\x57\110\105\122\105\40\x69\x64\x66\x61\143\75\x61\x2e\x64\157\x63\165\x6d\145\156\x74\x6f\40\x26\x26\40\151\x64\x63\157\156\163\x62\141\x6e\x63\x20\111\x53\x20\116\x4f\124\40\x4e\x55\114\x4c\x29\x2c\x32\51\40\x70\141\147\x61\x64\157\44\54\12\40\x20\40\x20\40\40\40\x28\x53\105\114\x45\x43\124\x20\x52\117\x55\x4e\x44\x28\123\125\115\x28\164\157\164\141\154\x64\51\54\x32\51\x20\164\x6f\x74\141\154\x64\40\106\122\x4f\115\40\141\x70\154\x69\143\x61\x6e\x63\40\x57\110\105\122\x45\40\146\141\x63\75\141\x2e\x64\157\x63\x75\155\x65\156\x74\x6f\51\40\x4e\x43\x2c\xa\x20\x20\40\x20\40\x20\40\x28\123\105\114\105\103\x54\40\122\x4f\x55\116\104\50\x53\125\x4d\50\x74\x6f\x74\141\154\x66\151\x6e\x61\x6c\x2f\x28\123\105\114\105\x43\124\40\157\146\x69\x63\x69\x61\x6c\40\x46\122\117\115\40\155\157\x6e\x65\143\141\155\x20\127\x48\105\122\x45\x20\146\x65\x63\150\141\74\75\141\x2e\x66\145\x63\x68\x61\x63\162\x65\141\40\x4f\122\104\105\122\40\102\x59\40\146\145\x63\x68\141\x20\x44\105\x53\x43\40\x4c\111\x4d\111\124\x20\x31\51\51\54\62\51\x20\164\157\164\141\154\x64\x20\x46\x52\x4f\115\40\157\x70\x65\162\164\x69\x20\x57\110\x45\122\105\x20\x61\x6e\x74\x64\157\x63\75\141\56\141\156\164\144\x6f\143\40\x26\x26\40\164\151\160\157\x64\157\143\x3d\x27\122\x45\124\47\x20\x26\46\x20\x61\x6e\x74\x64\157\143\x21\75\47\47\x29\40\122\105\x54\xa\x20\x20\40\40\x20\40\x20\x46\122\117\115\40\157\160\x65\162\164\x69\40\141\12\x20\x20\40\x20\x20\x20\40\x57\110\105\122\105\40\50\141\56\164\x69\160\x6f\x64\x6f\143\x3d\47\106\x41\x43\47\40\x7c\x7c\40\x61\56\164\151\x70\157\144\x6f\143\x3d\x27\116\x4f\x54\47\x29\x20\x26\46\40\141\56\164\157\164\141\154\144\76\x30\40\46\x26\40\x61\56\145\x73\164\141\164\x75\x73\144\x6f\x63\x21\75\47\130\47\x20\x26\46\40\x28\123\x55\x42\x53\124\122\50\x61\x2e\143\157\x64\143\154\151\145\156\x74\145\x2c\61\54\63\51\41\75\47\x49\x4e\x54\47\40\x26\x26\x20\x61\56\x63\157\x64\x63\x6c\151\145\156\x74\x65\41\x3d\x27\115\106\x30\x30\60\x30\x27\x29\x20\x26\x26\x20\50\x61\x2e\x66\x65\x63\x68\141\x63\x72\145\141\x3e\x3d\x27{$ini}\x27\40\x26\46\40\x61\x2e\x66\x65\143\x68\141\x63\162\145\x61\74\x3d\x27{$fin}\x27\x29\xa\x20\40\40\40\x20\40\40\107\x52\117\x55\x50\x20\x42\131\x20\141\56\144\157\x63\165\x6d\x65\x6e\164\x6f\x20\xa\40\40\x20\40\x29\x20\xa\x20\x20\40\40\160\x65\156\144\151\x65\156\x74\x65\x20\110\101\126\x49\116\x47\x20\x70\141\x67\x61\x64\x6f\44\x2b\x4e\103\53\x52\105\124\74\x28\x74\157\164\141\154\x24\55\x30\56\65\51\x20\117\x52\104\x45\x52\x20\102\131\40\144\157\x63\x75\155\x65\156\164\157\40\x41\x53\103"); } function reportdiasvenc($ini, $fin) { return $this->db->query("\123\105\x4c\x45\x43\x54\x20\x61\x2e\144\x6f\x63\x75\x6d\x65\x6e\164\x6f\54\141\56\143\x6f\144\x63\154\x69\x65\x6e\164\145\x2c\141\56\x6e\157\155\x62\x72\145\143\154\x69\54\40\141\56\166\x65\x6e\x63\145\54\40\x4d\x41\130\x28\x62\56\146\x65\x63\x68\51\x20\146\160\141\x67\157\54\144\141\164\145\x44\111\x46\106\x28\142\56\x66\145\x63\x68\54\x61\x2e\166\145\156\x63\x65\51\x20\x64\x69\141\163\xa\40\40\x20\40\106\x52\x4f\115\x20\157\x70\145\x72\x74\x69\40\x61\x20\12\x20\40\40\40\112\x4f\x49\116\x20\157\x70\145\x72\x63\x6c\x69\x20\142\40\x4f\x4e\x20\141\56\x64\x6f\143\x75\x6d\x65\x6e\164\x6f\75\x62\56\151\144\x66\141\143\x20\x26\46\x20\142\56\x69\x64\143\x6f\156\x73\142\x61\156\143\40\x49\123\40\116\x4f\x54\40\116\125\114\x4c\12\x20\x20\x20\x20\127\x48\x45\x52\x45\x20\x61\56\146\x65\x63\x68\x61\143\x72\x65\141\x3e\x3d\x27{$ini}\47\40\46\46\40\x61\56\x66\x65\x63\150\141\x63\162\x65\x61\74\75\47{$fin}\x27\40\46\46\40\x28\141\56\x74\151\160\157\x64\157\143\75\x27\106\101\x43\47\40\174\174\40\x61\x2e\x74\151\x70\x6f\x64\x6f\143\x3d\x27\x4e\x4f\x54\47\x29\40\x26\46\40\123\x55\x42\123\124\x52\50\x61\56\x63\157\144\143\x6c\151\145\x6e\164\145\x2c\x31\x2c\63\x29\41\75\47\111\116\x54\47\xa\x20\x20\x20\40\x47\122\117\x55\x50\x20\102\x59\40\x61\x2e\x64\157\x63\165\155\x65\156\164\157"); } function reportconcibanc() { return $this->db->query("\x53\x45\x4c\x45\x43\124\40\x74\x72\151\155\50\141\x2e\x63\157\144\x69\147\x6f\51\143\157\144\x69\147\157\54\x61\56\x6e\x6f\x6d\x62\162\145\x2c\50\x53\x45\114\x45\103\124\x20\156\x6f\155\x62\162\145\x20\106\x52\117\x4d\x20\x6c\151\163\164\166\145\156\x64\x20\x57\x48\x45\122\105\x20\x63\157\144\x69\147\157\75\x61\56\x76\145\156\144\145\144\x6f\x72\51\x20\x76\x65\x6e\144\145\x64\157\x72\54\12\x20\40\40\x20\124\x52\x49\x4d\50\x61\x2e\x74\x65\154\x65\146\x6f\156\x6f\163\51\164\x65\154\145\x66\x6f\156\157\163\54\x54\x52\x49\115\x28\x61\56\164\145\x6c\x65\x66\157\x6e\x6f\x5f\155\x6f\166\x69\x6c\51\164\145\x6c\x65\x66\x6f\156\157\x5f\155\157\166\x69\154\54\142\56\146\x65\x63\x68\x20\146\142\x61\x6e\143\157\x2c\142\56\x72\x65\146\54\x62\56\144\145\x73\x63\162\151\160\x2c\x62\56\x6d\157\156\164\x6f\x2c\x20\50\123\105\x4c\105\x43\x54\40\x64\157\x63\x75\x6d\145\x6e\164\157\40\106\x52\x4f\115\x20\x6f\x70\145\162\164\x69\40\x57\x48\105\x52\x45\x20\x63\x6f\144\143\154\151\145\x6e\164\x65\x3d\141\x2e\x63\x6f\x64\151\147\157\x20\x26\46\40\164\x6f\x74\x61\154\146\x69\156\141\154\x3d\x62\x2e\155\x6f\156\164\x6f\40\46\x26\x20\x28\164\x69\x70\x6f\144\157\x63\x3d\47\x46\x41\103\x27\x20\x7c\x7c\40\164\151\160\157\x64\x6f\x63\x3d\x27\116\x4f\x54\x27\51\51\40\106\x41\x43\xa\x20\40\x20\x20\x46\122\x4f\115\x20\143\x6c\151\x65\155\x70\162\145\x20\141\40\x4a\x4f\x49\x4e\x20\143\x6f\156\163\x62\141\156\143\40\x62\x20\117\x4e\40\142\x2e\x64\145\x73\x63\162\x69\x70\x20\x4c\111\113\x45\x20\103\117\116\x43\101\124\50\47\45\47\54\x61\x2e\x6e\x72\x6f\162\x69\x66\x2c\47\45\47\51\x20\127\110\x45\122\x45\x20\x62\56\140\x73\164\x61\x74\165\x73\x60\75\x27\116\47\xa\40\40\x20\x20\107\x52\x4f\125\x50\40\102\131\x20\141\56\x63\x6f\x64\151\147\157\x2c\142\56\151\x64\40\x48\x41\126\x49\116\107\x20\x6d\157\156\x74\x6f\76\60\x3b"); } function reportdesempeno($ini, $fin) { return $this->db->query("\123\105\x4c\x45\103\x54\x20\141\x2e\144\x6f\143\165\x6d\x65\x6e\164\x6f\54\x61\x2e\156\157\155\x62\x72\x65\143\154\x69\x2c\x28\123\x45\114\105\103\x54\x20\156\157\x6d\x61\x70\145\x20\x46\x52\x4f\115\40\164\x72\x61\142\40\127\110\x45\122\x65\x20\x69\x64\75\x62\56\164\x72\141\x62\x65\x6d\x70\x61\x71\x29\40\141\x72\155\141\144\x6f\x72\x2c\x28\x53\105\114\105\103\124\x20\x6e\x6f\155\x61\x70\145\40\x46\x52\117\x4d\40\164\162\x61\x62\40\127\x48\105\x52\x65\40\151\x64\x3d\142\56\x74\x72\x61\x62\145\155\160\141\161\x33\x29\40\166\145\162\151\146\151\x63\141\x64\x6f\162\54\40\x28\x53\x45\x4c\x45\103\124\40\156\x6f\x6d\141\x70\x65\x20\106\x52\x4f\115\40\164\x72\x61\142\x20\x57\x48\x45\x52\145\40\x69\x64\x3d\x61\x2e\165\x65\x6d\x69\163\157\x72\x29\40\146\141\x63\164\165\x72\x61\x64\157\162\x2c\12\40\40\x20\x20\x28\x53\x45\x4c\x45\x43\x54\40\x6e\157\155\x61\160\x65\x20\x46\x52\x4f\115\40\164\x72\141\142\x20\x57\x48\x45\x52\x65\40\151\144\x3d\142\56\164\x72\141\x62\145\155\160\x61\x71\62\51\40\x65\x6d\160\141\143\141\x64\x6f\162\x2c\xa\40\x20\40\40\x28\x53\x45\x4c\x45\x43\x54\40\x43\117\125\116\x54\50\x2a\x29\40\x46\x52\x4f\115\x20\157\x70\145\162\155\x76\40\127\x48\x45\122\105\x20\x74\x69\x70\x6f\x64\x6f\143\75\141\x2e\x74\151\160\x6f\144\x6f\x63\40\46\46\40\144\157\x63\165\x6d\x65\x6e\164\x6f\x3d\141\x2e\x64\157\143\165\155\145\x6e\x74\157\x29\x20\x69\164\145\x6d\54\122\x4f\x55\x4e\x44\x28\50\x53\x45\x4c\x45\103\124\40\123\125\x4d\x28\x63\x61\x6e\x74\151\x64\141\144\51\40\106\x52\x4f\115\40\x6f\x70\x65\162\x6d\166\40\127\110\x45\122\x45\40\x74\x69\160\x6f\x64\x6f\x63\75\x61\x2e\x74\151\160\157\x64\x6f\x63\40\46\46\40\144\157\143\165\x6d\x65\x6e\x74\x6f\x3d\141\56\x64\x6f\x63\x75\x6d\x65\x6e\164\x6f\x29\54\60\51\40\x55\156\x69\144\54\12\x20\x20\40\x20\50\123\x45\x4c\105\103\x54\40\123\125\115\50\x6e\165\x6d\51\40\x46\x52\117\x4d\x20\x62\165\x6c\164\157\163\x20\x57\110\105\x52\x45\x20\x64\x6f\x63\75\141\x2e\x61\x6e\164\144\x6f\143\51\x20\x62\165\x6c\164\x6f\163\54\x20\50\123\105\114\105\103\x54\x20\x72\145\146\x67\x20\x46\122\x4f\x4d\40\x62\165\154\164\157\x73\40\127\x48\x45\x52\x45\40\144\x6f\x63\x3d\x61\56\141\156\164\x64\x6f\x63\40\x4c\111\x4d\111\124\40\61\51\x20\146\162\x69\x6f\x2c\xa\x20\x20\40\x20\124\111\115\105\123\x54\x41\115\120\x44\x49\x46\106\x28\115\111\x4e\x55\x54\105\54\142\x2e\164\x69\x6d\145\x61\x75\x74\x2c\x61\56\146\x65\143\x68\141\171\x68\x6f\162\141\x29\x20\155\x69\x6e\x75\164\x6f\x73\54\142\56\x74\151\x6d\145\141\165\x74\40\141\x75\164\157\x72\x69\172\x61\x64\x6f\x2c\x62\56\x74\151\155\x65\141\x73\151\147\x20\164\x6f\x6d\141\144\x6f\137\141\162\x6d\141\144\157\54\x62\x2e\x74\x69\155\145\141\162\155\40\141\x72\x6d\141\x64\157\54\x62\56\x74\151\155\145\141\x73\151\147\x33\40\x74\x6f\155\141\x64\x6f\x5f\166\145\162\151\x66\x69\x63\141\x72\54\12\40\x20\40\x20\142\x2e\x74\151\x6d\x65\166\x65\162\151\146\40\x76\145\x72\x69\146\151\143\141\144\x6f\x2c\x61\56\x66\x65\x63\150\x61\171\150\x6f\162\141\40\146\141\143\164\x75\x72\x61\x64\157\54\142\56\x74\151\155\145\141\163\151\147\62\x20\164\x6f\x6d\x61\144\x6f\137\x65\x6d\x70\141\143\x61\162\54\x62\x2e\164\x69\x6d\x65\145\155\x70\40\145\x6d\x70\141\x63\141\144\x6f\40\xa\x20\x20\x20\x20\106\x52\x4f\115\40\157\x70\x65\162\164\x69\x20\141\40\112\117\111\116\40\x63\157\x6e\164\162\157\x6c\x5f\x6f\160\145\x72\x74\151\40\142\40\117\116\40\x61\x2e\x61\x6e\x74\144\x6f\143\x3d\142\56\144\157\143\x20\x57\110\x45\x52\105\x20\141\56\146\145\x63\150\141\143\x72\x65\141\76\75\47{$ini}\47\x20\x26\46\x20\141\x2e\146\x65\x63\x68\x61\x63\x72\145\x61\74\75\x27{$fin}\x27\40\46\x26\x20\50\141\x2e\x74\x69\x70\x6f\144\x6f\143\x3d\47\x46\101\x43\x27\x20\174\x7c\x20\141\x2e\x74\x69\160\x6f\x64\x6f\x63\75\x27\x4e\117\124\47\x29\x3b"); } function reportvtacontrol($ini, $fin) { return $this->db->query("\x53\x45\x4c\x45\x43\x54\40\141\56\x74\151\x70\x6f\x64\x6f\x63\54\141\x2e\144\x6f\143\165\x6d\x65\156\164\157\54\x28\123\105\114\105\103\124\x20\156\x6f\x6d\x62\162\145\143\154\151\x20\x46\122\x4f\x4d\40\x6f\160\x65\x72\164\x69\40\127\110\x45\x52\145\40\x64\157\x63\x75\x6d\145\x6e\x74\x6f\75\x61\x2e\x64\x6f\x63\x75\155\145\156\x74\x6f\x20\x4c\111\115\x49\x54\40\61\51\40\x6e\x6f\x6d\142\x72\145\x63\x6c\x69\54\141\x2e\146\x65\x63\150\x61\x64\157\143\40\x66\145\x63\150\141\54\x61\56\143\157\x64\151\x67\157\x2c\x61\x2e\156\157\x6d\x62\162\145\54\xa\x20\40\40\x20\122\x4f\x55\116\x44\50\111\106\x28\50\123\105\x4c\x45\103\124\40\x53\125\115\x28\x63\141\156\164\x69\144\x61\144\x2d\143\x6f\156\163\x75\x6d\x69\144\157\x29\x20\106\122\x4f\x4d\x20\x61\x72\164\x69\x6c\x6f\164\145\163\40\127\110\105\122\x45\40\x63\157\x64\x69\x67\x6f\141\162\164\75\141\56\143\157\x64\151\x67\157\40\46\46\x20\141\154\x6d\141\x63\x65\156\40\x4e\x4f\x54\40\111\116\40\x28\x30\x31\54\x30\65\x2c\x30\66\x29\51\x20\111\123\x20\x4e\117\124\40\116\125\x4c\114\54\x28\x53\x45\114\x45\x43\x54\x20\x53\125\x4d\x28\143\141\156\x74\x69\x64\x61\x64\x2d\143\x6f\156\x73\x75\x6d\151\x64\x6f\51\x20\x46\122\x4f\115\40\x61\162\x74\151\154\157\164\145\163\40\x57\110\105\122\x45\40\143\x6f\x64\151\x67\x6f\141\x72\x74\x3d\141\x2e\143\157\144\x69\147\x6f\40\46\46\x20\141\x6c\x6d\x61\x63\x65\156\40\116\117\124\40\111\116\x20\50\x30\x31\54\60\65\54\60\x36\51\x29\54\x62\56\145\170\151\163\164\145\156\143\x69\141\x29\x2c\x30\x29\40\145\170\151\x73\164\x65\x6e\x2c\xa\40\40\x20\x20\x52\117\x55\116\x44\x28\123\x55\x4d\50\x61\56\x63\x61\156\164\151\144\141\x64\51\x2c\x30\51\40\x76\x65\x6e\x64\x69\x64\141\x73\54\x20\x52\117\x55\116\104\x28\x53\125\x4d\50\143\x6e\164\144\145\166\165\x65\154\164\x29\x2c\x30\x29\40\x64\145\166\165\145\154\164\x61\x73\x20\106\x52\117\115\40\x6f\160\145\x72\x6d\x76\40\x61\40\112\117\x49\116\x20\141\x72\164\151\143\x75\154\157\x20\x62\40\x4f\x4e\x20\x61\x2e\143\x6f\144\x69\147\x6f\75\142\56\143\157\144\x69\x67\157\x20\12\40\x20\x20\x20\x57\x48\105\x52\x45\40\142\56\143\157\156\x74\x72\x6f\x6c\x61\144\157\x3d\61\40\x26\46\x20\50\141\56\164\151\160\x6f\x64\x6f\143\x3d\x27\106\101\x43\x27\x20\174\174\x20\141\56\x74\x69\160\157\x64\x6f\143\x3d\x27\x4e\x4f\x54\x27\x29\40\x26\x26\x20\141\56\146\145\143\x68\x61\144\157\143\76\75\47{$ini}\47\40\x26\46\40\141\x2e\146\x65\x63\x68\x61\144\157\x63\x3c\x3d\47{$fin}\47\x20\107\x52\117\x55\x50\x20\x42\131\40\x61\56\x64\157\143\x75\155\x65\156\164\157\x2c\x61\x2e\143\157\144\x69\147\x6f"); } function reportvtaregula($ini, $fin) { return $this->db->query("\123\105\x4c\x45\x43\124\40\141\56\164\151\x70\x6f\144\157\143\54\x61\x2e\144\x6f\x63\165\155\145\156\164\157\x2c\50\123\x45\114\x45\x43\x54\40\156\x6f\x6d\142\162\145\x63\x6c\x69\x20\106\122\117\x4d\x20\157\x70\x65\162\x74\151\x20\x57\x48\105\122\x65\40\144\x6f\x63\165\x6d\145\x6e\x74\157\x3d\x61\x2e\x64\x6f\143\x75\x6d\145\x6e\164\157\40\114\x49\115\111\x54\40\61\x29\40\x6e\157\155\x62\x72\145\x63\x6c\x69\54\141\x2e\146\x65\143\150\141\144\x6f\143\x20\x66\145\143\x68\141\x2c\x61\56\x63\x6f\144\151\147\157\54\x61\x2e\156\157\155\x62\162\x65\54\xa\x20\x20\x20\40\122\117\125\116\x44\50\111\x46\x28\50\123\105\x4c\105\x43\x54\x20\x53\125\x4d\50\143\x61\156\x74\151\x64\x61\144\x2d\143\x6f\156\x73\x75\x6d\151\x64\157\x29\40\x46\x52\117\x4d\40\x61\x72\164\151\154\157\x74\145\163\40\127\x48\105\x52\x45\40\x63\157\x64\151\x67\157\141\x72\x74\x3d\141\56\x63\x6f\144\151\147\157\x20\x26\x26\x20\141\154\155\141\x63\145\156\40\x4e\117\x54\40\111\x4e\40\50\60\61\x2c\60\x35\54\60\x36\51\51\x20\111\123\40\x4e\x4f\124\40\x4e\125\x4c\x4c\x2c\50\x53\x45\x4c\x45\103\x54\40\123\x55\115\50\143\x61\156\x74\151\x64\x61\144\x2d\x63\x6f\156\163\165\x6d\x69\144\157\51\x20\x46\122\117\x4d\40\x61\x72\164\151\x6c\157\164\x65\x73\x20\127\110\105\122\105\x20\143\x6f\144\x69\147\157\x61\162\x74\75\141\x2e\143\157\144\151\x67\157\40\x26\x26\x20\x61\154\155\141\x63\145\156\x20\x4e\x4f\x54\40\111\x4e\x20\50\60\61\x2c\x30\65\x2c\x30\x36\51\x29\x2c\x62\x2e\x65\x78\151\x73\x74\145\x6e\x63\x69\141\x29\54\x30\51\x20\x65\170\x69\x73\164\145\156\x2c\xa\x20\40\x20\x20\x52\117\x55\x4e\104\50\123\125\x4d\50\141\56\143\x61\x6e\x74\x69\x64\141\x64\x29\54\x30\51\40\166\x65\x6e\144\x69\x64\x61\163\54\40\122\117\125\116\104\x28\x53\125\115\50\x63\156\164\x64\x65\166\165\145\x6c\x74\x29\x2c\x30\51\40\144\x65\166\x75\145\154\x74\x61\x73\40\106\122\117\115\x20\x6f\x70\x65\162\x6d\166\40\x61\40\x4a\x4f\111\x4e\40\141\162\164\x69\143\x75\154\157\x20\142\40\x4f\116\40\141\x2e\143\x6f\x64\x69\x67\x6f\75\142\56\143\157\144\151\147\x6f\12\40\x20\40\40\x57\x48\105\x52\105\x20\142\x2e\156\x6f\155\142\162\145\40\122\x45\107\x45\x58\120\40\47\x61\x7a\151\x74\162\x6f\x6d\151\143\x69\x6e\x61\174\x63\145\x66\x69\170\x69\155\x61\x7c\143\145\146\157\164\x61\x78\x69\155\141\174\143\145\146\164\x61\172\x69\x64\151\155\141\x7c\x63\x65\146\x74\x72\151\141\x78\157\x6e\141\x7c\143\x69\160\x72\157\x66\154\157\170\x61\x63\x69\x6e\x61\x7c\x63\x6c\141\x72\x69\x74\x72\157\155\x69\x63\151\x6e\141\x7c\x6c\145\166\x6f\146\x6c\x6f\170\x61\x63\151\156\141\x7c\154\x69\x6e\x63\x6f\155\151\143\x69\156\x61\174\151\156\x73\165\x6c\151\156\x61\47\40\x26\46\x20\x28\x61\56\x74\151\160\157\x64\x6f\x63\75\x27\106\101\103\x27\40\174\174\x20\141\56\164\x69\160\157\144\x6f\x63\x3d\x27\x4e\117\124\x27\x29\x20\46\46\x20\141\x2e\x66\x65\143\x68\141\144\x6f\x63\x3e\x3d\x27{$ini}\47\40\46\x26\40\x61\56\x66\x65\x63\x68\141\x64\157\143\74\75\47{$fin}\47\40\107\x52\x4f\125\120\40\102\x59\x20\141\56\144\157\x63\165\155\145\x6e\x74\157\54\x61\56\143\x6f\x64\151\x67\157\x3b"); } function reportfacvencidas($ini, $fin) { return $this->db->query("\x53\x45\x4c\105\103\x54\x20\x61\x2e\144\157\143\165\155\145\x6e\164\157\x2c\141\56\143\x6f\144\143\x6c\151\x65\x6e\x74\145\x2c\141\56\x6e\157\155\142\162\145\x63\154\x69\x2c\x61\x2e\146\145\x63\150\x61\x63\162\x65\141\x2c\x61\x2e\162\x65\x63\145\x70\x63\151\157\x6e\54\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\12\40\40\40\40\104\101\x54\x45\x5f\101\104\x44\50\x61\56\162\145\143\x65\x70\x63\x69\x6f\156\x2c\x49\116\124\x45\122\126\x41\114\40\x61\x2e\144\151\141\x73\143\162\x65\144\x20\104\101\131\51\40\x76\145\x6e\x63\x65\54\x20\x44\101\124\105\x44\111\x46\x46\x28\103\x55\122\x44\101\x54\105\x28\x29\x2c\x44\101\124\x45\x5f\x41\104\104\x28\141\x2e\162\x65\x63\145\160\x63\151\x6f\156\54\x49\116\124\105\x52\126\x41\x4c\40\x61\56\144\x69\x61\163\x63\x72\145\x64\40\104\x41\x59\x29\x29\40\144\x69\141\x73\40\40\x20\40\40\40\x20\x20\12\40\x20\40\x20\106\x52\117\x4d\x20\157\x70\145\x72\x74\x69\x20\x61\x20\x57\x48\x45\122\105\40\141\56\146\145\143\150\141\x63\x72\145\x61\x3e\x3d\x27{$ini}\47\40\46\46\40\141\56\x66\x65\x63\x68\141\143\162\x65\x61\74\x3d\x27{$fin}\x27\40\x26\x26\x20\x61\56\x74\x6f\164\160\141\x67\x6f\163\x3d\60\40\46\46\x20\x61\x2e\x74\151\x70\x6f\x64\157\143\75\x27\x46\x41\x43\47\40\x26\46\40\141\56\x64\157\143\165\155\145\x6e\164\157\40\x4e\117\124\x20\x49\116\x20\x28\x53\x45\x4c\x45\x43\124\x20\151\x64\x66\141\143\x20\106\x52\x4f\115\x20\x6f\160\145\x72\143\x6c\x69\40\107\x52\x4f\x55\x50\40\102\131\40\x69\x64\146\141\x63\51\x20\x48\101\126\x49\116\107\40\144\x69\x61\163\76\x30\73"); } function reportarti() { return $this->db->query("\x53\105\114\105\x43\124\40\142\56\x61\x6c\x6d\x61\143\x65\156\54\x61\x2e\x63\157\144\151\147\x6f\54\x61\x2e\x6e\x6f\x6d\142\162\x65\x2c\142\56\x6c\x6f\x74\145\54\x20\50\123\105\x4c\105\x43\124\40\x6e\157\x6d\142\162\145\x20\106\x52\117\115\40\141\162\164\x69\x70\162\157\x76\x20\x57\x48\105\x52\105\x20\143\157\144\151\x67\157\x3d\x61\56\x63\x6f\144\151\x67\157\40\x4c\x49\115\x49\124\40\x31\x29\40\160\162\x6f\x76\x65\x65\x64\157\x72\54\141\56\155\141\x72\x63\x61\54\12\40\40\x20\x20\x28\123\105\x4c\x45\103\124\x20\x63\157\144\x61\x6c\x74\x65\162\x6e\x61\x74\x69\166\x6f\x20\106\122\117\115\x20\x69\156\x76\143\157\144\141\x6c\164\145\x72\156\x61\164\x69\166\157\40\127\110\105\122\x45\x20\x63\x6f\144\x69\147\157\75\141\x2e\143\x6f\144\151\147\x6f\x20\114\111\x4d\111\124\x20\61\x29\x20\x62\141\162\x72\141\x2c\x62\56\165\142\x69\x63\x61\54\151\x66\x28\x28\x62\56\143\x61\156\x74\x69\x64\141\x64\55\142\x2e\143\157\156\x73\165\x6d\151\x64\x6f\x29\76\60\54\122\x4f\125\116\x44\x28\x61\x2e\145\170\x69\x73\164\x65\x6e\x63\151\x61\x29\54\x30\x29\40\145\x78\151\163\164\141\x72\164\x69\x2c\40\x4d\111\x4e\50\x62\56\166\x65\x6e\143\145\51\40\166\x65\x6e\143\x65\54\12\40\x20\x20\x20\x20\40\40\40\x52\117\125\x4e\104\50\x62\x2e\x63\x61\x6e\164\x69\144\141\144\x2d\x62\x2e\143\157\x6e\163\165\155\151\x64\x6f\54\x30\x29\40\145\x78\x69\163\x74\x6c\157\x74\145\x20\x46\122\117\115\40\141\162\x74\151\x63\165\x6c\x6f\x20\141\x20\xa\x20\40\40\x20\x20\40\x20\x20\114\105\x46\124\x20\x4a\117\x49\116\40\x61\162\164\x69\x6c\157\x74\x65\163\40\142\x20\x4f\116\40\x61\56\x63\x6f\144\x69\x67\157\75\142\56\143\x6f\x64\151\x67\157\141\x72\164\xa\40\40\x20\x20\x20\x20\40\40\x57\x48\105\x52\105\40\x61\x2e\x65\170\151\x73\164\145\156\143\x69\x61\76\x30\x20\46\x26\40\x28\142\x2e\143\141\156\164\x69\x64\x61\144\40\55\40\142\x2e\x63\x6f\x6e\x73\165\155\151\x64\157\51\76\60\40\46\46\x20\141\56\x70\141\162\x61\137\167\x65\142\75\x31\xa\40\40\x20\40\40\40\40\x20\x47\x52\117\125\120\x20\x42\x59\x20\x61\56\x63\x6f\x64\151\147\157\54\142\56\x6c\157\x74\x65"); } function reportartrota($ini, $fin) { return $this->db->query("\x53\105\x4c\x45\103\124\40\143\x6f\x64\x69\x67\x6f\54\x6e\x6f\155\142\x72\x65\x2c\x6d\x61\x72\x63\x61\54\x70\x72\157\155\144\141\x79\54\x72\157\164\141\143\x69\x6f\x6e\54\x73\164\157\143\x6b\54\x52\117\125\116\104\50\111\106\50\x28\162\157\164\141\143\151\x6f\x6e\x2d\x73\164\x6f\x63\153\51\x3e\x30\54\x28\162\x6f\x74\141\x63\151\x6f\156\x2d\163\x74\157\143\153\x29\x2c\x30\51\51\x20\163\x75\x67\x65\162\151\x64\x6f\54\x72\x6f\165\156\x64\50\50\x73\164\157\x63\153\x2f\x70\162\157\155\x64\x61\x79\x29\x2f\x37\x2c\x32\51\40\144\x69\x73\x70\x6f\156\151\x62\154\145\137\x73\x65\x6d\141\156\141\x6c\40\106\122\117\115\x20\x28\xa\x20\40\40\40\x20\40\40\x20\40\x20\x20\40\123\105\x4c\x45\x43\x54\x20\x61\x2e\143\x6f\144\x69\x67\157\x2c\x61\56\x6e\157\x6d\x62\x72\145\54\141\x2e\155\141\x72\143\x61\x2c\x52\117\125\116\104\x28\x53\x55\x4d\x28\141\56\143\x61\x6e\x74\x69\144\x61\144\x29\57\104\x41\x54\105\104\x49\106\106\x28\47{$fin}\x27\x2c\x27{$ini}\47\x29\x2c\x32\51\40\160\162\157\x6d\144\x61\171\x2c\12\x20\x20\40\40\40\40\x20\x20\40\x20\40\x20\x20\x52\117\125\x4e\x44\50\x53\125\115\x28\x61\x2e\143\141\x6e\x74\x69\x64\141\x64\51\x29\x20\x72\x6f\164\x61\143\151\157\x6e\x2c\40\x52\x4f\125\x4e\104\50\x28\123\x45\x4c\105\103\124\40\145\x78\x69\163\164\x65\x6e\143\x69\x61\40\106\x52\117\115\40\141\162\164\x69\x63\165\154\x6f\x20\x57\110\x45\x52\105\x20\x63\157\144\x69\147\x6f\75\141\56\x63\x6f\144\x69\147\x6f\x29\51\40\163\164\157\143\x6b\12\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x46\122\x4f\115\40\157\160\x65\162\x6d\166\40\141\x20\x57\x48\105\122\105\40\x61\56\x66\145\143\x68\x61\144\x6f\143\x3e\x3d\47{$ini}\x27\40\46\x26\40\141\x2e\x66\145\143\150\141\x64\157\x63\x3c\x3d\x27{$fin}\47\x20\x26\x26\40\x61\56\143\x6f\x64\151\147\x6f\41\x3d\47\x4e\x2f\101\47\40\107\122\117\x55\120\40\x42\131\40\141\56\x63\x6f\144\151\147\x6f\40\xa\40\40\40\40\x20\x20\x20\40\40\40\40\40\x20\51\x20\162\x6f\164\x61\x63\x69\x6f\156\40\x4f\122\x44\x45\122\x20\x42\131\40\163\165\147\145\x72\x69\144\x6f\40\x44\105\x53\x43"); } function reportarticero() { return $this->db->query("\123\x45\x4c\x45\103\124\40\x61\x2e\143\x6f\144\151\x67\x6f\54\x61\56\x6e\x6f\x6d\x62\x72\x65\54\40\50\x53\x45\114\x45\103\124\40\x6e\x6f\155\x62\162\145\40\x46\x52\x4f\115\x20\x61\x72\164\x69\160\x72\x6f\166\40\x57\110\105\x52\105\x20\x63\x6f\144\151\147\157\x3d\141\56\x63\157\144\x69\x67\x6f\40\x4c\x49\x4d\x49\124\x20\x31\x29\40\x70\162\x6f\166\x65\x65\144\x6f\x72\x2c\x61\x2e\x6d\141\x72\x63\x61\x2c\x52\x4f\125\116\104\50\145\170\x69\163\x74\145\x6e\x63\151\x61\51\x20\145\x78\151\163\164\145\x6e\x20\106\122\117\x4d\40\x61\x72\x74\x69\x63\165\x6c\157\x20\141\x20\x20\127\110\x45\122\105\40\141\56\145\170\x69\x73\x74\145\x6e\143\x69\x61\x3d\60\x20\x47\122\117\125\120\x20\102\131\x20\x61\56\143\x6f\144\x69\147\x6f"); } function reportarti02() { return $this->db->query("\123\x45\114\105\103\x54\40\x53\x55\x42\x53\x54\122\x28\x61\x2e\x63\157\x64\151\147\x6f\x2c\61\54\63\51\40\x74\x69\x70\x6f\54\x61\56\143\157\x64\x69\147\x6f\x2c\141\56\x6e\157\x6d\142\162\145\x2c\x62\x2e\141\x6c\x6d\x61\x63\x65\x6e\x2c\122\x4f\x55\x4e\x44\x28\141\x2e\x63\x6f\x73\164\157\x2a\x28\x53\105\114\105\103\x54\40\x6f\146\x69\x63\x69\x61\x6c\x20\x46\122\x4f\x4d\x20\x6d\x6f\156\x65\x63\141\x6d\x20\x4f\x52\104\105\x52\x20\102\x59\x20\146\145\143\x68\x61\40\x44\x45\x53\103\40\114\x49\115\111\x54\x20\61\51\54\x32\x29\40\x63\157\x73\164\x6f\54\x52\x4f\125\x4e\104\x28\x28\x53\105\114\105\103\124\x20\x6f\x66\151\x63\x69\141\154\40\x46\x52\x4f\x4d\40\155\157\x6e\x65\x63\x61\x6d\x20\x4f\122\x44\x45\122\x20\x42\131\x20\x66\x65\x63\x68\141\x20\104\x45\123\103\40\x4c\111\x4d\x49\124\40\x31\51\x2c\x32\51\x20\x42\103\x56\x2c\x52\117\125\116\x44\x28\x53\125\115\x28\x62\56\143\141\156\x74\x69\144\x61\144\x29\55\x53\x55\115\x28\x62\56\143\x6f\156\163\x75\x6d\x69\144\157\x29\51\x20\145\x78\x69\163\164\x65\x6e\54\40\122\x4f\x55\x4e\104\50\x28\141\x2e\x63\x6f\163\x74\157\52\50\x53\105\x4c\105\x43\124\40\x6f\146\x69\x63\151\141\154\x20\106\122\x4f\115\40\155\157\156\145\x63\141\x6d\x20\117\122\x44\x45\122\40\x42\x59\x20\x66\145\x63\150\x61\40\104\105\123\103\x20\x4c\x49\x4d\x49\x54\x20\61\x29\51\52\50\x53\x55\x4d\x28\x62\56\x63\x61\156\164\151\144\x61\x64\51\55\x53\125\x4d\x28\x62\56\143\157\x6e\x73\x75\x6d\151\144\x6f\x29\51\x2c\x32\x29\x20\164\x6f\x74\x61\154\40\106\122\117\115\x20\141\x72\164\151\143\x75\154\157\x20\141\x20\xa\x20\40\40\x20\x4a\117\x49\116\x20\x61\162\164\151\x6c\x6f\x74\x65\163\x20\x62\40\x4f\116\40\50\x61\x2e\x63\x6f\144\x69\147\157\75\142\56\x63\157\144\x69\x67\157\141\162\x74\40\46\x26\x20\142\56\141\154\155\141\x63\x65\x6e\75\60\62\51\12\x20\x20\40\x20\107\122\x4f\x55\120\x20\102\x59\40\x61\x2e\x63\157\144\151\147\x6f\40\110\101\126\x49\x4e\107\40\x65\x78\x69\x73\x74\x65\x6e\x3e\60\11\12\40\40\x20\40"); } function reportartioff() { return $this->db->query("\123\105\114\x45\x43\x54\40\x62\56\x61\154\x6d\141\x63\x65\x6e\x2c\x61\x2e\143\157\x64\x69\x67\157\54\141\56\x6e\x6f\155\142\162\x65\x2c\x62\x2e\x6c\x6f\x74\x65\54\40\x28\x53\x45\x4c\x45\x43\x54\40\x6e\157\x6d\x62\x72\x65\x20\106\122\x4f\115\x20\x61\x72\164\151\160\162\x6f\x76\40\127\110\105\x52\105\x20\x63\x6f\x64\151\147\157\x3d\x61\56\x63\x6f\x64\151\147\157\x20\x4c\111\x4d\111\x54\x20\x31\x29\x20\x70\162\x6f\166\x65\x65\144\157\162\x2c\x61\56\155\141\x72\143\x61\54\xa\x20\x20\x20\40\50\x53\x45\x4c\x45\103\x54\x20\x63\157\x64\141\154\x74\145\x72\156\141\164\151\x76\x6f\40\106\x52\117\115\x20\x69\156\x76\143\x6f\144\141\x6c\x74\145\162\156\141\x74\151\166\157\x20\127\110\105\x52\x45\x20\143\157\144\151\x67\157\75\x61\56\143\x6f\144\151\147\157\40\114\x49\115\111\124\x20\x31\x29\x20\x62\x61\x72\x72\141\54\142\x2e\165\x62\151\x63\141\54\x69\x66\50\50\142\56\143\x61\156\164\x69\144\141\144\55\x62\x2e\x63\157\156\163\165\155\151\144\157\51\76\x30\x2c\x52\x4f\x55\116\x44\x28\141\x2e\x65\170\x69\163\164\x65\156\143\151\141\x29\x2c\x30\x29\x20\145\170\x69\x73\x74\x61\x72\x74\x69\x2c\40\x4d\111\x4e\50\x62\56\166\x65\x6e\143\x65\x29\x20\166\x65\156\x63\x65\x2c\12\x20\x20\x20\40\40\x20\40\40\x52\117\x55\x4e\x44\x28\x62\x2e\143\x61\x6e\164\x69\144\141\144\x2d\x62\x2e\143\x6f\156\163\x75\x6d\151\x64\x6f\54\60\x29\x20\x65\x78\x69\x73\x74\154\157\164\x65\40\x46\x52\117\115\40\141\x72\x74\151\143\165\x6c\x6f\x20\141\x20\xa\x20\x20\40\x20\x20\40\40\x20\x4c\x45\106\x54\x20\x4a\x4f\x49\116\40\x61\x72\164\x69\x6c\157\164\145\163\40\142\40\x4f\116\40\x61\x2e\x63\157\144\x69\147\157\x3d\142\56\143\x6f\144\x69\x67\157\141\x72\164\12\40\40\40\x20\x20\x20\40\40\127\x48\x45\x52\x45\40\141\56\x65\x78\x69\x73\164\145\x6e\143\151\141\76\60\40\x26\46\x20\x28\142\56\143\x61\x6e\x74\x69\144\141\144\x20\x2d\x20\x62\56\143\157\156\163\x75\x6d\151\x64\x6f\x29\x3e\x30\40\46\46\x20\x61\x2e\160\x61\162\x61\x5f\x77\x65\x62\x3d\x30\xa\40\40\x20\40\40\x20\40\40\107\122\x4f\x55\x50\40\x42\x59\x20\141\x2e\143\x6f\144\151\x67\x6f\54\x62\56\154\157\x74\145"); } function reportartivence($ini, $fin) { return $this->db->query("\123\105\x4c\x45\x43\x54\40\x61\56\143\x6f\x64\x69\147\157\54\x61\56\156\157\155\142\162\x65\x2c\x62\x2e\x61\154\x6d\141\x63\x65\x6e\54\142\56\x6c\x6f\x74\145\54\142\x2e\166\x65\x6e\143\145\40\x46\122\x4f\115\x20\x61\162\x74\151\143\x75\154\x6f\40\141\40\112\117\x49\x4e\40\x61\162\x74\x69\x6c\157\164\x65\x73\40\x62\x20\117\x4e\40\141\x2e\143\157\144\151\x67\x6f\x3d\x62\x2e\x63\157\144\151\x67\157\x61\x72\x74\40\127\x48\x45\122\105\40\x62\56\x76\145\x6e\x63\x65\76\75\x27{$ini}\47\40\x26\46\40\142\56\166\x65\x6e\143\145\x3c\x3d\x27{$fin}\47\40\x47\x52\x4f\x55\120\40\x42\131\40\x61\x2e\x63\x6f\144\151\147\x6f\x3b"); } function graficas() { $opt = "\74\x6f\160\x74\x69\x6f\x6e\x20\x76\141\154\165\145\75\x22\42\40\144\x69\163\x61\x62\154\145\144\40\x73\145\154\x65\x63\x74\x65\144\x3e\123\145\154\145\x63\x63\x69\157\156\145\x3c\x2f\157\x70\164\151\157\x6e\x3e\12\40\x20\x20\40\74\x6f\160\164\151\x6f\x6e\x20\166\x61\x6c\165\x65\75\42\x31\42\76\126\x65\x6e\164\141\x20\x47\162\165\x70\157\74\57\x6f\160\164\x69\x6f\156\x3e\12\x20\x20\x20\x20\x3c\x6f\x70\x74\151\x6f\156\40\166\141\154\165\x65\75\x22\62\x22\76\126\x65\x6e\x74\x61\40\x56\x65\156\144\145\x64\x6f\x72\145\x73\x3c\x2f\157\x70\164\x69\x6f\x6e\x3e\74\157\x70\x74\151\157\156\x20\x76\141\x6c\165\x65\x3d\x22\x37\x22\x3e\126\x65\x6e\164\x61\x20\132\157\x6e\141\x3c\57\157\160\x74\x69\x6f\x6e\x3e\12\x20\40\40\40\x3c\x6f\x70\x74\x69\157\156\40\166\141\154\165\x65\75\x22\65\42\x3e\x56\145\x6e\x74\x61\x20\x43\154\x69\x65\x6e\164\x65\74\57\x6f\x70\x74\x69\157\x6e\x3e\x3c\x6f\160\x74\x69\157\156\40\x76\x61\154\165\x65\x3d\42\66\x22\x3e\x56\x65\156\x74\141\x20\120\162\x6f\x64\165\x63\x74\157\163\x3c\57\157\x70\164\151\x6f\156\76"; if ($this->session->userdata("\164\x69\x70") == 2 || $this->session->userdata("\164\x69\x70") == 10 || $this->session->userdata("\164\x69\160") == 11) { $opt .= "\x3c\157\160\164\151\x6f\x6e\40\166\x61\154\165\x65\75\42\x33\x22\76\x43\x6f\142\162\141\156\x7a\x61\40\x70\x6f\x72\40\104\x69\x61\x73\74\x2f\157\x70\164\151\157\x6e\x3e\12\40\40\x20\x20\x3c\157\x70\164\x69\157\156\40\166\141\x6c\165\x65\x3d\x22\70\x22\76\x43\x6f\142\162\x61\x6e\x7a\x61\40\x70\157\162\40\115\145\163\74\57\157\x70\x74\151\x6f\x6e\76\xa\40\40\x20\40\x3c\157\x70\164\x69\x6f\x6e\x20\166\x61\x6c\x75\x65\x3d\x22\64\42\76\x43\x6f\x62\x72\141\x6e\x7a\141\x20\160\157\x72\40\132\x6f\156\141\74\57\x6f\160\164\151\x6f\x6e\x3e\12\40\40\x20\40"; } $html = "\74\x62\x72\x3e\x3c\142\162\x3e\12\x20\40\x20\40\x3c\144\x69\x76\x20\143\154\141\163\163\x3d\x22\167\63\55\x68\x69\144\x65\55\x73\155\x61\x6c\154\x22\76\12\x20\40\40\40\74\x74\141\x62\x6c\x65\x20\143\x6c\x61\163\x73\75\42\x77\63\x2d\x74\x61\142\154\145\55\141\154\x6c\x20\167\x33\55\x68\157\x76\x65\x72\x61\x62\x6c\145\42\76\xa\40\x20\x20\x20\74\x74\x72\76\x3c\164\144\x20\143\x6c\x61\x73\x73\x3d\x22\x77\x33\55\x66\157\156\x64\x6f\144\162\157\x69\144\42\76\x44\145\x73\x64\145\x3c\57\164\x64\x3e\74\x74\x64\76\x3c\151\156\x70\x75\x74\40\164\x79\x70\145\75\x22\x64\x61\164\x65\x22\x20\x63\154\x61\x73\163\75\42\x77\x33\55\x69\156\x70\x75\164\x22\x20\x69\x64\x3d\x22\x64\145\163\144\x65\x22\76\x3c\57\164\x64\76\xa\x20\x20\40\40\x3c\x74\144\40\x63\154\141\x73\163\x3d\x22\x77\x33\x2d\x66\x6f\x6e\x64\x6f\144\162\x6f\151\x64\42\76\110\141\163\x74\141\74\57\164\x64\76\74\164\x64\x3e\x3c\151\156\x70\x75\164\40\164\x79\160\145\75\42\x64\x61\164\145\42\40\143\154\141\x73\x73\75\42\x77\63\55\151\x6e\x70\165\x74\42\40\151\144\75\42\150\141\163\x74\141\42\76\x3c\57\164\144\x3e\xa\x20\x20\x20\40\74\164\144\x20\x63\154\141\x73\163\x3d\42\x77\x33\55\x66\x6f\156\x64\157\x64\162\157\151\x64\x22\x3e\115\157\x64\141\x6c\x69\x64\x61\x64\74\57\164\144\x3e\74\x74\144\x3e\74\163\x65\154\x65\143\x74\40\151\144\75\x22\164\151\x70\x6f\42\40\143\154\x61\163\163\x3d\42\x77\63\55\163\x65\154\145\143\164\x22\76" . $opt . "\74\x2f\x73\145\154\145\x63\164\76\x3c\x2f\x74\x64\76\xa\x20\40\40\40\x3c\x74\x64\40\143\x6c\x61\163\163\x3d\x22\167\x33\55\142\x74\x6e\42\x3e\74\141\x20\x6f\x6e\x63\154\151\143\x6b\75\42\x6f\x70\164\x67\x72\x61\146\x69\143\x61\163\50\x29\x3b\42\76\x3c\151\x6d\147\40\x73\162\x63\75\x22" . base_url() . "\151\155\141\147\145\163\57\142\156\56\x70\156\x67\x22\x20\141\154\164\x3d\42\x41\165\x74\x6f\x72\x69\x7a\x61\162\42\x20\x74\x69\164\x6c\145\75\42\x41\x75\164\157\162\x69\x7a\141\x72\42\x20\x73\164\171\x6c\x65\75\42\x77\x69\144\x74\150\72\x32\60\x70\x78\73\x68\x65\x69\x67\150\x74\72\62\x30\x70\170\x3b\x62\x6f\x72\x64\x65\162\72\60\x3b\42\x3e\74\57\141\76\x3c\x74\x64\76\12\x20\x20\x20\x20\x3c\x2f\x74\162\76\xa\40\40\40\x20\74\x2f\164\x61\x62\154\145\x3e\xa\40\x20\40\40\x3c\x2f\144\151\166\x3e\74\x62\x72\76\x3c\142\162\x3e\12\xa\40\40\x20\x20\74\144\151\166\40\x63\154\141\x73\x73\75\x22\167\63\x2d\150\x69\x64\145\x2d\x6c\141\162\147\x65\x20\167\x33\x2d\x68\x69\144\145\x2d\155\x65\144\x69\x75\x6d\42\76\12\40\x20\40\40\x3c\x74\141\x62\x6c\145\40\143\x6c\x61\163\x73\x3d\x22\167\63\x2d\x74\141\142\x6c\145\55\141\x6c\x6c\40\x77\x33\55\150\157\x76\145\x72\x61\142\154\145\42\76\xa\40\40\x20\x20\74\164\162\x3e\74\164\144\40\x63\154\141\163\x73\75\42\x77\x33\55\146\x6f\156\x64\x6f\x64\162\x6f\x69\x64\42\x3e\x44\x65\163\x64\145\74\x2f\164\144\76\74\x74\x64\76\74\151\156\x70\165\x74\x20\x74\171\160\145\75\x22\144\141\164\145\42\x20\143\x6c\141\x73\163\x3d\42\x77\x33\55\x69\x6e\x70\x75\x74\42\x20\x69\144\75\42\x64\x65\163\x64\x65\x32\x22\76\x3c\57\164\x64\76\12\x20\x20\40\40\x3c\164\x64\x20\143\154\x61\x73\x73\x3d\42\167\x33\x2d\146\157\x6e\144\157\x64\x72\x6f\x69\144\x22\x3e\x48\x61\163\164\x61\74\x2f\164\x64\x3e\x3c\x74\x64\x3e\74\x69\156\x70\x75\x74\40\x74\x79\x70\145\x3d\42\x64\x61\x74\x65\x22\40\143\x6c\x61\x73\163\x3d\42\167\63\x2d\x69\156\160\165\164\42\40\x69\144\x3d\x22\x68\141\x73\x74\141\62\x22\x3e\74\57\164\144\x3e\12\40\x20\40\40\74\164\162\76\74\164\144\40\143\x6c\141\x73\163\x3d\42\x77\63\x2d\x66\x6f\x6e\144\157\144\x72\157\x69\x64\42\76\x4d\157\x64\141\x6c\151\x64\x61\144\x3c\x2f\164\144\76\x3c\164\x64\x3e\x3c\x73\145\x6c\x65\143\x74\x20\151\144\x3d\42\x74\151\160\157\62\x22\40\143\x6c\141\163\163\75\42\x77\63\x2d\x73\145\x6c\x65\143\x74\42\76" . $opt . "\74\57\163\x65\154\x65\143\164\76\74\x2f\164\144\x3e\xa\x20\x20\40\40\x3c\x74\x64\40\x63\x6c\141\163\x73\x3d\x22\167\x33\x2d\142\x74\156\42\76\74\x61\x20\x6f\x6e\x63\154\151\143\x6b\75\42\157\160\164\x67\162\141\x66\x69\x63\141\x73\x32\50\51\73\x22\x3e\74\x69\155\x67\40\x73\x72\x63\75\x22" . base_url() . "\151\155\141\147\x65\163\57\x62\x6e\56\x70\x6e\x67\x22\40\141\154\x74\x3d\x22\x41\165\x74\x6f\x72\151\x7a\141\162\42\x20\x74\151\164\x6c\145\x3d\42\101\165\164\157\x72\x69\172\141\162\x22\40\x73\164\x79\x6c\x65\75\42\x77\x69\x64\x74\150\x3a\x32\x30\x70\x78\73\x68\145\151\147\x68\164\x3a\62\x30\160\x78\73\142\x6f\x72\x64\145\x72\72\60\73\x22\76\x3c\x2f\141\76\x3c\x74\x64\x3e\x3c\x2f\164\x72\x3e\xa\40\40\x20\40\74\x2f\x74\162\76\12\x20\40\40\40\74\57\x74\141\142\x6c\145\76\xa\x20\x20\40\x20\x3c\57\x64\151\x76\76\74\142\162\x3e\xa\x20\x20\40\x20\x3c\x64\x69\166\40\151\x64\75\x22\162\145\160\157\x72\x74\145\42\40\143\154\x61\163\x73\75\42\167\x33\x2d\x72\145\163\x70\157\x6e\x73\x69\166\x65\42\x20\163\164\171\x6c\x65\75\42\167\x69\x64\164\x68\x3a\x39\65\x25\73\x68\x65\x69\147\x68\x74\72\66\60\x30\x70\x78\42\x3e\74\x2f\144\x69\166\x3e\xa\40\x20\40\40\x3c\x64\151\166\40\x69\x64\75\42\x72\145\x70\157\x72\x74\x65\x32\x22\76\74\x2f\x64\x69\x76\x3e\74\x62\162\76\x3c\x62\162\76\xa\x20\x20\x20\x20"; return $html; } function optgraficas($tip, $desde, $hasta) { $html = ''; if ($tip == 1) { $html = $this->db->query("\x53\105\114\x45\103\x54\40\156\x2c\155\x65\163\x2c\x53\x55\x4d\x28\111\106\x28\x67\162\165\160\157\75\47\101\114\115\x27\x2c\x75\x6e\151\144\141\144\145\x73\54\x30\51\51\x20\141\x6c\155\x2c\123\x55\x4d\x28\x49\106\x28\x67\x72\x75\160\x6f\x3d\x27\115\x45\104\x27\54\165\x6e\x69\144\141\x64\x65\163\x2c\x30\51\51\x20\x6d\x65\x64\54\123\125\x4d\50\x49\x46\x28\147\x72\165\x70\x6f\75\x27\111\x4e\x53\x27\x2c\x75\x6e\151\x64\141\x64\x65\x73\x2c\60\51\x29\x20\x69\156\x73\x2c\x20\123\125\115\50\111\x46\50\x67\162\x75\x70\x6f\x3d\x27\x4d\111\123\47\x2c\x75\x6e\151\144\x61\144\x65\163\54\x30\x29\51\40\155\x69\x73\54\x53\125\x4d\x28\165\x6e\x69\144\141\x64\x65\163\51\40\x74\157\164\x61\154\x20\106\x52\x4f\115\12\40\x20\40\40\40\x20\40\40\x28\x53\x45\114\105\103\124\40\115\x4f\116\124\x48\x28\141\56\146\x65\143\150\141\144\157\143\51\x20\156\x2c\12\40\40\40\40\x20\40\x20\x20\111\106\50\115\x4f\116\x54\110\x28\141\56\x66\x65\143\x68\x61\x64\x6f\143\x29\x3d\x31\54\x27\x45\116\105\x27\54\x49\x46\x28\x4d\x4f\116\124\x48\50\x61\x2e\146\x65\143\150\x61\x64\x6f\143\x29\x3d\62\54\x27\x46\x45\102\x27\x2c\111\x46\x28\115\117\x4e\x54\110\x28\x61\56\x66\145\143\150\141\144\157\143\51\75\63\x2c\x27\115\x41\x52\47\54\x49\106\50\115\x4f\116\x54\x48\x28\141\x2e\146\x65\143\x68\x61\x64\x6f\x63\x29\x3d\x34\54\x27\101\x42\x52\x27\54\111\x46\50\115\117\x4e\124\110\50\141\x2e\x66\145\x63\x68\x61\x64\157\x63\51\x3d\65\54\47\x4d\x41\131\47\x2c\x49\106\x28\x4d\117\x4e\x54\110\50\141\56\x66\145\143\150\141\144\x6f\143\51\x3d\66\54\x27\x4a\125\x4e\47\54\12\40\x20\x20\40\x20\40\x20\40\111\x46\x28\x4d\x4f\116\x54\x48\50\141\x2e\146\x65\x63\x68\x61\144\x6f\x63\51\x3d\x37\54\x27\112\125\114\x27\x2c\111\106\x28\x4d\x4f\116\x54\x48\x28\x61\56\146\x65\x63\150\x61\144\x6f\x63\51\75\x38\x2c\x27\101\x47\x4f\47\54\x49\106\50\115\x4f\x4e\124\110\50\141\x2e\146\x65\x63\150\141\x64\x6f\143\x29\75\x39\x2c\x27\x53\105\x50\47\54\111\106\50\x4d\117\x4e\124\110\x28\x61\x2e\146\145\x63\150\141\144\157\x63\51\x3d\x31\x30\x2c\47\x4f\103\x54\47\x2c\x49\106\x28\115\117\x4e\124\x48\x28\141\x2e\146\x65\143\150\141\144\x6f\x63\51\x3d\61\61\54\47\x4e\x4f\126\47\x2c\111\106\x28\x4d\x4f\116\x54\110\x28\x61\56\146\145\x63\150\x61\144\x6f\x63\51\x3d\x31\x32\x2c\x27\104\111\x43\47\54\x27\47\x29\x29\51\51\x29\51\x29\51\51\51\x29\x29\40\x6d\145\x73\54\40\123\x55\102\x53\x54\x52\x28\x61\x2e\143\157\144\151\147\157\x2c\61\54\x33\x29\40\147\x72\x75\x70\x6f\x2c\xa\40\40\x20\40\x20\40\x20\x20\122\117\125\x4e\104\x28\111\106\x28\x4d\117\x4e\124\x48\x28\x61\56\x66\x65\143\150\141\144\x6f\143\51\x3d\61\x2c\123\125\x4d\x28\x61\56\143\x61\x6e\x74\x69\144\x61\144\x2d\141\x2e\143\x6e\x74\144\x65\166\165\145\x6c\x74\x29\x2c\111\106\50\115\117\x4e\124\x48\50\141\x2e\146\x65\143\150\141\144\157\x63\51\x3d\x32\x2c\x53\125\115\50\x61\56\x63\x61\x6e\x74\151\x64\141\144\x2d\x61\x2e\x63\x6e\164\x64\x65\x76\x75\145\x6c\x74\51\54\111\106\x28\115\117\116\x54\110\50\141\x2e\146\x65\143\x68\141\x64\157\143\51\x3d\63\x2c\x53\x55\115\50\141\56\143\x61\156\164\151\x64\x61\x64\x2d\141\x2e\x63\156\x74\x64\145\x76\165\x65\154\x74\51\54\111\x46\x28\x4d\x4f\x4e\x54\110\x28\141\56\x66\145\143\150\141\x64\x6f\143\51\75\x34\x2c\123\125\115\50\x61\56\x63\141\156\x74\151\x64\x61\x64\55\141\56\143\156\x74\144\x65\x76\165\x65\x6c\x74\x29\x2c\12\40\x20\x20\x20\x20\40\x20\40\111\106\50\115\117\x4e\x54\110\x28\141\x2e\146\x65\143\x68\141\x64\x6f\143\51\75\65\x2c\123\125\115\x28\x61\56\143\x61\156\x74\x69\144\141\144\55\141\x2e\143\156\164\144\145\166\165\145\x6c\x74\x29\x2c\x49\x46\x28\x4d\x4f\116\x54\x48\x28\x61\x2e\146\145\x63\x68\141\x64\157\143\51\75\x36\54\x53\125\115\x28\141\56\143\x61\156\x74\x69\x64\x61\x64\55\x61\x2e\143\156\x74\144\x65\x76\x75\x65\x6c\164\x29\54\111\106\50\x4d\117\x4e\124\x48\50\x61\56\146\x65\143\150\x61\144\157\x63\51\x3d\67\x2c\123\x55\x4d\50\141\x2e\143\x61\x6e\164\x69\x64\x61\x64\55\141\x2e\143\156\164\x64\x65\x76\165\145\154\164\x29\x2c\111\106\50\x4d\x4f\x4e\124\110\x28\x61\x2e\146\x65\143\x68\x61\144\157\x63\x29\75\70\x2c\x53\125\115\x28\141\56\143\141\x6e\x74\x69\144\x61\x64\55\x61\x2e\x63\x6e\x74\144\145\x76\165\145\154\x74\51\54\xa\40\x20\40\x20\x20\x20\x20\40\x49\106\x28\x4d\117\x4e\x54\x48\x28\x61\x2e\146\145\x63\150\141\144\x6f\143\x29\75\x39\54\123\125\x4d\x28\141\56\x63\141\x6e\164\x69\x64\141\144\x2d\141\56\x63\156\164\x64\x65\x76\165\x65\x6c\x74\x29\x2c\111\106\x28\x4d\117\x4e\124\x48\50\x61\56\x66\x65\x63\x68\141\144\x6f\143\x29\x3d\x31\x30\x2c\x53\125\115\50\141\x2e\143\x61\156\164\151\x64\x61\144\x2d\141\56\143\156\x74\x64\145\x76\x75\145\x6c\164\51\54\x49\106\x28\115\x4f\x4e\124\110\50\141\56\x66\x65\x63\x68\x61\x64\157\143\x29\75\x31\x31\x2c\123\x55\x4d\50\x61\56\143\x61\x6e\x74\151\x64\141\144\55\141\x2e\143\156\x74\x64\x65\166\165\x65\154\164\51\x2c\x49\x46\50\x4d\117\116\x54\x48\50\x61\x2e\x66\145\x63\x68\141\144\x6f\143\51\x3d\61\62\54\x53\x55\115\50\x61\x2e\x63\141\x6e\x74\x69\144\x61\x64\x2d\141\x2e\x63\x6e\164\144\145\166\x75\x65\154\x74\51\x2c\x30\x29\x29\51\51\x29\x29\51\x29\x29\x29\x29\51\x2c\x30\51\40\x75\156\151\x64\x61\x64\145\163\12\x20\x20\x20\x20\x20\x20\40\40\106\x52\x4f\115\40\x6f\x70\145\x72\155\x76\x20\x61\xa\40\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\40\40\127\x48\x45\122\x45\40\x61\56\x66\x65\x63\150\x61\144\x6f\x63\76\x3d\47{$desde}\47\40\46\x26\x20\141\56\x66\x65\x63\x68\x61\x64\x6f\143\74\75\47{$hasta}\47\40\46\46\x20\50\141\56\x74\x69\x70\157\144\157\143\x3d\47\106\101\103\x27\40\174\x7c\40\141\x2e\x74\151\160\x6f\144\157\x63\x3d\47\116\117\x54\47\x29\x20\46\46\40\123\125\102\123\124\x52\50\x61\x2e\x63\157\x64\151\147\157\x2c\x31\x2c\x33\51\41\75\x27\x4e\x2f\x41\x27\x20\xa\40\40\40\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x47\122\117\125\x50\x20\102\131\x20\x4d\x4f\x4e\x54\x48\50\x61\56\x66\145\143\x68\x61\x64\x6f\x63\x29\54\123\125\102\123\x54\122\x28\141\x2e\x63\157\x64\151\147\157\54\61\54\63\x29\51\x20\x76\145\156\x74\141\147\x72\x75\x70\157\x20\107\x52\117\x55\120\x20\x42\x59\x20\155\145\163\x20\x4f\122\104\105\122\40\x42\131\40\x6e")->result(); } if ($tip == 2) { $html = $this->db->query("\123\105\114\105\x43\124\40\166\145\x6e\x64\x65\x64\157\x72\54\156\x6f\x6d\142\x72\x65\54\x63\141\x6e\164\x2c\x64\145\x76\54\x75\x6e\x69\144\40\x46\122\x4f\115\x20\x28\x53\x45\114\x45\x43\124\x20\x62\56\x76\145\156\144\145\144\x6f\x72\x2c\x63\56\x6e\157\x6d\142\x72\145\54\x52\x4f\x55\x4e\104\50\123\125\x4d\50\x61\x2e\143\x61\x6e\x74\151\x64\141\x64\x29\x2c\62\51\x20\143\x61\156\x74\x2c\x52\117\x55\116\104\x28\123\125\x4d\50\141\56\143\156\164\x64\x65\x76\x75\x65\154\164\51\x2c\62\x29\x20\x64\x65\x76\x2c\x20\12\40\40\x20\40\40\x20\40\40\122\117\x55\x4e\104\50\x53\x55\x4d\50\141\56\x63\141\x6e\x74\151\x64\141\144\x29\x2d\x53\x55\115\50\141\56\143\156\x74\x64\x65\166\x75\x65\x6c\x74\51\54\x30\51\x20\165\x6e\151\144\xa\40\40\x20\x20\x20\x20\x20\x20\x46\x52\117\x4d\40\x6f\160\x65\162\155\166\40\x61\40\xa\x20\x20\40\x20\x20\x20\x20\x20\x4a\117\x49\116\40\157\x70\x65\162\x74\x69\x20\x62\x20\117\116\40\x28\141\56\144\157\143\165\x6d\x65\156\164\157\x3d\142\x2e\144\157\x63\165\x6d\x65\156\x74\x6f\x20\46\x26\x20\x61\x2e\x74\151\x70\x6f\144\x6f\x63\x3d\142\56\x74\x69\160\x6f\x64\157\x63\51\xa\40\x20\40\x20\40\40\40\x20\x4a\117\x49\116\x20\154\151\163\164\166\145\156\x64\x20\143\x20\117\x4e\40\x63\56\143\x6f\144\151\147\x6f\75\x62\56\x76\145\x6e\144\x65\x64\x6f\162\12\40\40\x20\40\40\40\40\x20\40\127\x48\x45\x52\x45\x20\x61\56\x66\145\143\x68\x61\x64\x6f\143\76\75\47{$desde}\x27\40\x26\46\x20\x61\x2e\x66\145\x63\x68\x61\144\157\143\x3c\x3d\47{$hasta}\x27\x20\x26\x26\x20\50\141\x2e\x74\x69\160\x6f\x64\x6f\143\75\x27\x46\x41\x43\x27\x20\174\174\40\141\x2e\x74\x69\x70\157\144\x6f\143\x3d\47\x4e\x4f\124\x27\x29\12\x20\40\x20\x20\40\x20\40\40\107\x52\117\x55\x50\x20\102\131\x20\x62\x2e\166\x65\156\x64\145\144\157\162\x20\x29\40\x76\x65\x6e\144\145\x64\x6f\x72\145\163\x20\x4f\x52\104\105\x52\40\x42\x59\40\165\x6e\151\144\x20\x44\105\x53\103")->result(); } if ($tip == 3) { $bd = $this->db->query("\x53\x45\114\105\x43\124\x20\x6e\x75\x6c\x6c\40\x64\x69\x61\163\x2c\x43\117\116\103\x41\124\x28\47\x3c\142\76\124\157\164\x61\x6c\x3c\x2f\x62\76\40\47\x2c\122\117\x55\116\x44\x28\144\157\x6c\141\x72\x2c\x32\51\51\x20\x64\157\x6c\141\162\54\103\117\x4e\x43\101\124\x28\x27\74\142\76\124\x6f\164\x61\154\74\x2f\142\x3e\40\47\x2c\122\117\x55\116\104\x28\160\141\147\141\x64\x6f\x2c\x32\x29\x29\x70\141\147\x61\144\x6f\54\x43\x4f\x4e\103\x41\x54\50\x27\x3c\142\x3e\x54\x6f\x74\x61\x6c\x3c\x2f\142\76\x20\x27\x2c\x52\117\125\x4e\104\50\116\103\54\x32\51\51\116\x43\x2c\103\117\x4e\103\101\124\x28\x27\x3c\x62\76\x54\157\x74\141\x6c\74\x2f\142\76\x20\47\54\12\40\40\40\x20\40\x20\x20\x20\x52\117\125\x4e\x44\x28\122\105\x54\x2c\x32\x29\x29\x52\x45\x54\54\103\x4f\x4e\103\101\x54\x28\x27\x3c\142\x3e\x54\157\164\141\x6c\74\57\x62\76\40\47\54\x52\x4f\x55\x4e\104\50\x64\157\154\x61\x72\x2d\x28\160\x61\147\141\x64\157\x2b\x6e\x63\x2b\162\145\164\x29\54\x32\51\51\144\145\x62\145\54\x43\117\116\x43\x41\124\50\47\74\142\76\x54\157\x74\x61\154\74\57\142\x3e\40\47\54\x52\x4f\125\x4e\x44\x28\x28\x28\x70\141\x67\141\x64\x6f\x2b\156\x63\53\162\x65\x74\51\x2a\61\60\60\x29\x2f\x64\x6f\154\141\x72\x2c\x32\51\51\x20\143\165\155\160\x6c\151\x64\x6f\x20\106\x52\x4f\x4d\40\xa\x20\40\x20\x20\x20\40\x20\x20\50\x53\x45\x4c\105\103\x54\40\x53\x55\x4d\x28\x74\157\x74\141\154\x64\51\x20\x64\157\154\141\162\54\40\x28\x53\105\114\x45\x43\x54\40\x53\x55\x4d\x28\155\x6f\x6e\x74\157\144\x29\x20\x46\x52\x4f\115\x20\157\160\x65\162\143\154\151\40\x57\110\x45\x52\x45\x20\x69\x64\x63\157\156\163\x62\x61\x6e\x63\x20\111\123\40\116\117\124\40\116\125\114\114\51\x20\160\x61\x67\141\144\x6f\x2c\12\40\x20\40\x20\40\x20\40\40\x49\106\50\50\123\x45\114\x45\103\124\40\x52\x4f\x55\x4e\104\x28\123\x55\x4d\x28\x74\157\164\141\x6c\x64\51\54\x32\51\x20\164\157\x74\x61\x6c\x64\x20\x46\122\117\x4d\40\x61\x70\154\x69\143\x61\x6e\143\51\76\60\54\50\x53\105\114\x45\103\x54\40\122\117\125\116\x44\x28\x53\125\115\50\164\x6f\164\141\x6c\x64\x29\x2c\x32\51\40\x74\157\x74\141\x6c\x64\40\x46\122\x4f\115\x20\x61\x70\154\151\x63\141\156\143\x29\54\x30\51\x20\116\x43\x2c\xa\x20\40\40\40\40\x20\x20\x20\111\106\50\x28\x53\105\114\x45\103\x54\40\122\x4f\x55\x4e\x44\50\x53\125\x4d\x28\x74\x6f\164\x61\154\146\x69\x6e\141\154\x2f\x28\x53\105\x4c\x45\x43\x54\40\157\146\151\x63\151\x61\154\x20\106\x52\x4f\115\40\155\157\156\x65\143\x61\155\x20\x57\x48\x45\122\x45\x20\146\145\x63\150\x61\x3c\75\x66\x65\143\150\141\143\162\x65\141\40\117\122\x44\105\x52\x20\x42\131\40\146\145\143\150\141\x20\104\105\x53\103\40\x4c\111\115\111\x54\40\x31\51\51\x2c\62\x29\40\164\157\x74\x61\154\x64\x20\x46\x52\x4f\x4d\40\x6f\x70\x65\x72\164\151\x20\x57\x48\105\122\105\40\x74\x69\x70\157\x64\x6f\143\x3d\47\x52\x45\124\47\x29\76\60\54\x28\123\105\x4c\105\103\x54\40\122\117\x55\116\x44\50\x53\x55\x4d\50\x74\157\x74\x61\154\146\151\156\x61\x6c\57\x28\x53\x45\114\105\103\x54\x20\157\146\x69\x63\151\141\x6c\40\106\122\117\115\40\155\157\156\145\x63\x61\155\40\x57\110\x45\122\105\40\x66\145\x63\150\141\x3c\x3d\146\x65\143\x68\x61\x63\162\145\141\40\x4f\x52\104\105\x52\x20\x42\x59\x20\x66\x65\143\x68\141\40\x44\x45\123\x43\40\114\x49\115\111\124\40\61\51\51\54\62\x29\x20\x74\x6f\164\x61\154\144\x20\x46\122\x4f\115\x20\157\x70\x65\162\x74\151\x20\x57\x48\105\122\105\40\x74\x69\x70\157\x64\x6f\x63\75\47\122\x45\x54\47\x29\x2c\x30\x29\40\122\105\124\12\40\40\40\40\40\40\x20\40\106\122\x4f\115\40\x6f\160\x65\162\x74\151\40\x61\40\x57\110\x45\x52\105\x20\x74\x69\x70\157\x64\x6f\x63\75\47\106\x41\103\x27\40\174\174\x20\164\151\x70\157\144\157\143\75\x27\116\x4f\x54\47\40\x26\46\x20\164\x6f\x74\x61\x6c\x64\76\60\x20\46\x26\x20\x65\163\x74\141\164\x75\x73\x64\157\143\41\x3d\x27\x58\47\40\x26\46\x20\x28\x53\x55\102\x53\124\122\50\141\x2e\x63\x6f\144\x63\x6c\x69\x65\156\164\145\x2c\61\54\x33\51\x21\75\x27\x49\x4e\124\47\40\46\x26\40\x61\x2e\x63\x6f\x64\x63\154\151\x65\x6e\x74\145\x21\75\47\x4d\x46\x30\x30\x30\60\x27\x29\x20\51\x20\x74\x6f\164\141\x6c\12\x20\40\40\40\x20\40\x20\40\x55\116\111\x4f\116\xa\40\x20\x20\x20\40\x20\40\x20\x53\105\114\105\103\x54\40\x64\x69\141\x73\x2c\40\122\117\125\116\x44\x28\x53\x55\x4d\50\x64\157\x6c\141\x72\51\54\x32\x29\x20\x64\157\154\141\x72\x2c\x20\x52\117\125\116\x44\x28\x53\x55\115\50\x70\x61\147\141\x64\x6f\51\54\62\51\40\160\x61\x67\x61\x64\157\54\122\x4f\x55\116\x44\x28\x53\125\115\x28\x4e\103\x29\54\x32\51\40\x4e\x43\x2c\x52\117\125\116\104\x28\123\125\x4d\50\x52\105\124\x29\54\x32\x29\x20\122\x45\x54\54\40\122\x4f\125\x4e\x44\50\x53\x55\115\50\x64\157\154\x61\162\x29\55\x28\123\x55\x4d\50\160\x61\147\141\x64\x6f\51\53\x53\125\x4d\50\x4e\103\51\53\123\x55\x4d\x28\122\x45\124\51\x29\x2c\62\x29\x20\144\x65\x62\145\54\122\x4f\125\116\x44\x28\50\x28\x53\125\x4d\x28\x70\x61\x67\x61\144\x6f\x29\53\x53\x55\x4d\50\x4e\103\x29\53\x53\125\115\x28\122\105\124\x29\51\52\61\x30\x30\51\x2f\x53\125\115\50\144\157\154\141\162\51\x2c\x32\51\x20\x63\165\x6d\160\154\x69\144\x6f\40\x46\x52\x4f\115\12\x20\40\40\40\x20\40\40\40\50\x53\x45\x4c\105\x43\x54\x20\x44\x41\x54\x45\104\111\106\106\x28\x44\101\x54\105\x5f\x41\104\x44\50\x61\x2e\162\145\143\145\x70\x63\x69\157\156\x2c\x49\x4e\124\105\x52\126\101\x4c\x20\141\56\144\151\x61\163\x63\162\145\144\40\104\101\131\x29\x2c\103\125\122\104\x41\x54\x45\x28\x29\x29\40\144\x69\x61\x73\x2c\x20\123\125\115\50\x61\56\x74\x6f\164\141\x6c\x64\x29\40\144\x6f\x6c\141\x72\54\xa\x20\x20\40\x20\x20\x20\x20\x20\x28\123\105\x4c\105\x43\124\x20\123\x55\x4d\x28\x6d\x6f\156\x74\x6f\144\51\40\106\x52\117\115\40\157\x70\x65\162\143\x6c\x69\x20\127\110\x45\122\105\x20\151\x64\146\x61\x63\75\141\x2e\144\x6f\143\x75\155\145\x6e\164\x6f\40\x26\46\x20\x69\x64\x63\157\156\x73\x62\x61\x6e\143\40\x49\123\x20\116\x4f\x54\x20\x4e\125\x4c\114\51\40\x70\x61\x67\x61\144\157\54\xa\40\x20\40\x20\x20\x20\x20\x20\x49\x46\x28\x28\x53\105\114\105\x43\x54\40\122\117\x55\x4e\104\x28\x53\125\115\50\164\x6f\x74\x61\154\144\51\54\62\x29\x20\164\157\x74\141\154\144\40\106\122\117\x4d\x20\141\160\154\151\143\141\x6e\143\x20\x57\x48\105\x52\x45\40\x66\141\x63\x3d\x61\x2e\x64\x6f\143\165\155\145\x6e\164\x6f\51\76\x30\54\50\x53\105\114\x45\x43\124\x20\122\117\x55\x4e\104\x28\123\125\115\50\164\157\x74\141\154\x64\51\54\x32\51\40\164\x6f\164\x61\154\144\40\x46\x52\117\115\40\141\160\154\151\143\141\x6e\143\x20\x57\x48\105\x52\x45\x20\x66\141\x63\75\x61\x2e\144\x6f\x63\165\x6d\x65\x6e\164\x6f\51\54\x30\51\x20\x4e\103\54\xa\40\40\40\40\40\x20\40\40\111\106\x28\x28\x53\105\114\105\103\x54\x20\x52\x4f\x55\x4e\104\x28\x53\125\115\50\164\x6f\x74\x61\x6c\146\151\x6e\141\x6c\57\x28\x53\x45\114\105\x43\x54\x20\157\x66\151\x63\x69\x61\x6c\40\106\122\x4f\115\x20\x6d\x6f\x6e\x65\143\141\155\40\127\110\x45\x52\105\40\x66\x65\x63\150\141\x3c\x3d\x61\56\146\145\x63\x68\x61\x63\x72\x65\141\40\117\122\104\105\x52\x20\x42\x59\40\x66\145\143\150\141\x20\104\105\123\103\40\114\x49\x4d\111\x54\x20\61\x29\x29\54\x32\51\x20\x74\157\164\141\x6c\x64\40\106\x52\x4f\x4d\40\157\160\x65\x72\x74\x69\x20\127\x48\x45\122\x45\x20\x61\x6e\164\x64\x6f\143\75\141\x2e\141\x6e\x74\144\157\x63\40\46\x26\40\x74\x69\160\157\144\157\x63\x3d\x27\122\x45\x54\47\x20\x26\46\40\x61\156\164\x64\157\x63\x21\x3d\47\47\x29\x3e\60\54\50\x53\x45\114\105\x43\x54\40\x52\x4f\125\116\104\x28\x53\125\x4d\50\164\157\164\141\154\x66\151\156\141\x6c\57\50\123\105\114\x45\103\124\40\x6f\146\151\x63\x69\x61\x6c\x20\106\x52\117\x4d\x20\155\157\156\x65\143\x61\x6d\x20\x57\x48\105\122\x45\40\146\x65\143\150\x61\x3c\x3d\141\x2e\x66\x65\143\x68\141\x63\x72\x65\141\40\x4f\x52\104\105\x52\40\102\x59\x20\x66\x65\x63\150\x61\40\x44\105\123\103\x20\x4c\x49\115\x49\124\40\x31\x29\51\54\x32\51\x20\164\157\x74\x61\x6c\144\x20\106\x52\117\x4d\x20\x6f\160\145\x72\164\151\40\x57\x48\105\x52\x45\40\x61\x6e\x74\x64\157\x63\x3d\x61\56\x61\x6e\164\144\157\143\x20\x26\46\40\x74\151\160\157\144\157\143\x3d\47\x52\105\124\47\x29\54\60\x29\x20\x52\105\124\xa\40\40\x20\x20\40\x20\40\x20\106\x52\117\x4d\40\157\160\145\162\x74\x69\40\x61\40\x57\110\105\x52\x45\x20\50\x61\56\164\151\160\x6f\144\157\143\75\47\106\x41\x43\x27\40\x7c\174\x20\x61\x2e\x74\151\160\157\x64\x6f\x63\x3d\x27\116\117\124\x27\x29\x20\46\x26\40\141\x2e\x74\x6f\164\x61\x6c\x64\76\x30\40\46\x26\x20\x61\56\x65\x73\164\x61\x74\x75\163\144\x6f\143\x21\75\x27\x58\x27\40\x26\46\x20\x28\123\125\102\123\124\x52\50\141\56\x63\157\144\x63\x6c\151\145\x6e\x74\x65\x2c\61\x2c\63\x29\x21\75\47\111\x4e\x54\x27\x20\46\x26\40\x61\56\143\x6f\x64\143\x6c\151\145\x6e\164\145\41\75\47\115\106\60\60\x30\x30\47\x29\xa\40\40\x20\40\40\40\x20\x20\x47\x52\117\125\120\x20\x42\x59\x20\x61\56\x64\x6f\143\165\x6d\x65\x6e\164\157\x29\x20\x63\x6f\142\x72\x61\156\172\141\x64\x69\x61\x20\107\122\x4f\x55\x50\40\x42\131\x20\144\151\141\x73\x20")->result(); $html .= "\x3c\164\x61\142\154\x65\x20\x63\x6c\141\163\x73\75\x22\167\x33\x2d\164\141\142\154\x65\55\141\x6c\154\x20\x77\x33\55\150\x6f\166\145\x72\141\x62\154\145\x22\x3e\x3c\164\162\x20\x63\x6c\141\163\x73\x3d\x22\167\x33\55\146\157\x6e\x64\x6f\x64\x72\x6f\151\x64\x20\167\x33\55\x66\x69\x6a\157\42\x3e\x3c\x74\150\76\126\145\x6e\x63\x65\74\57\164\150\x3e\x3c\x74\150\x3e\104\157\154\141\x72\x3c\x2f\x74\x68\76\74\x74\x68\x3e\120\141\147\141\144\157\74\57\164\150\x3e\x3c\x74\150\76\x4e\103\x3c\x2f\x74\x68\x3e\x3c\164\150\x3e\122\x45\124\x3c\57\164\x68\x3e\74\164\x68\76\104\145\x62\145\74\x2f\164\150\76\x3c\x74\150\x3e\x43\165\155\160\x6c\x69\x64\157\74\57\x74\150\x3e\x3c\57\164\162\76"; $i = 0; foreach ($bd as $db) { $i++; if ($db->cumplido <= 50) { $color = "\167\x33\x2d\x72\x65\x64"; } elseif ($db->cumplido <= 70) { $color = "\x77\x33\x2d\x70\141\x6c\145\x2d\147\x72\x65\145\x6e"; } elseif ($db->cumplido > 70) { $color = "\167\x33\x2d\x67\x72\145\x65\156"; } $html .= "\12\x20\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x3c\x69\x6e\x70\x75\x74\x20\x74\171\160\x65\x3d\x22\150\x69\144\x64\x65\156\42\x20\x6e\x61\155\145\75\42\x64\x69\x61\163\42\x20\x76\x61\154\x75\145\75\42" . $db->dias . "\x22\x3e\12\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x3c\x74\x72\x20\x6f\x6e\143\x6c\x69\143\x6b\x3d\42\151\x6e\x66\x6f\144\145\x75\x64\141\x73\50" . $i . "\x2c\61\51\x3b\42\76\74\x74\144\x3e" . $db->dias . "\74\x2f\164\x64\76\x3c\164\x64\x3e" . $db->dolar . "\74\x2f\x74\x64\76\x3c\164\144\x3e" . $db->pagado . "\74\x2f\x74\144\x3e\74\164\144\76" . $db->NC . "\x3c\x2f\x74\x64\76\74\164\144\76" . $db->RET . "\x3c\x2f\x74\144\76\74\164\144\76" . $db->debe . "\74\x2f\164\144\76\74\x74\x64\x20\143\154\141\x73\x73\x3d\42" . $color . "\x22\x3e" . $db->cumplido . "\40\45\74\57\164\144\x3e\x3c\x2f\164\x72\76"; } $html .= "\x3c\x2f\164\141\x62\x6c\145\76\12\40\40\x20\x20\x20\x20\40\40\x3c\163\x63\162\151\160\164\40\x74\x79\160\x65\x3d\42\x74\145\170\164\57\x6a\141\166\x61\163\143\162\x69\160\x74\x22\x3e\12\x20\x20\40\x20\40\40\x20\x20\146\x75\x6e\x63\164\x69\x6f\156\x20\151\156\x66\157\x64\x65\x75\x64\x61\x73\50\x61\54\142\51\173\xa\40\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x6c\145\164\40\151\75\x70\x61\x72\163\x65\111\156\164\x28\141\x29\x2d\61\x3b\xa\x20\40\40\40\40\40\40\x20\40\40\40\x20\166\141\x72\x20\144\151\x61\x73\x3d\144\157\x63\165\x6d\145\156\x74\56\147\145\x74\x45\x6c\x65\x6d\x65\156\164\x73\x42\171\116\x61\155\x65\x28\42\144\x69\x61\x73\42\51\x5b\x69\135\x2e\x76\141\x6c\165\x65\73\12\40\40\40\40\x20\40\x20\40\40\40\x20\40\x76\141\x72\x20\144\x61\164\141\x3d\x7b\x64\x69\x61\x73\x3a\x64\151\141\x73\x2c\164\x69\x70\72\x62\x7d\73\12\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x24\x2e\160\157\163\x74\x28\x62\x61\x73\x65\x75\x72\x6c\x2b\42\x63\x5f\144\x72\x6f\151\144\x2f\x69\x6e\x66\157\x64\x65\165\144\x61\163\42\x2c\144\x61\x74\x61\54\x66\165\156\143\x74\151\157\x6e\50\162\x29\x7b\40\x24\50\42\43\x76\151\x65\167\x64\x65\164\x61\x6c\x6c\x65\163\x22\51\x2e\x73\150\157\x77\50\51\x3b\x20\44\x28\x22\43\x64\145\164\x61\x6c\x6c\145\x73\x22\51\56\150\164\155\x6c\x28\x72\x29\x3b\x20\x7d\51\x3b\xa\40\40\x20\x20\x20\40\x20\x20\x7d\xa\40\40\40\40\x20\40\x20\x20\74\x2f\x73\143\x72\x69\x70\x74\x3e\xa\40\40\40\40\40\x20\x20\x20"; } if ($tip == 4) { $bd = $this->db->query("\x53\105\114\105\103\x54\40\x6e\x75\154\x6c\x20\172\157\x6e\141\54\x20\x43\117\116\103\x41\124\50\47\74\x62\x3e\124\157\164\x61\154\x3c\57\142\76\x20\47\x2c\122\x4f\125\x4e\x44\50\x64\x6f\154\141\x72\54\62\51\51\x20\x64\157\x6c\x61\x72\x2c\103\x4f\116\x43\x41\x54\x28\47\x3c\x62\x3e\x54\x6f\x74\x61\154\74\57\x62\76\x20\x27\x2c\x52\x4f\x55\116\x44\x28\x70\x61\147\x61\x64\x6f\x2c\62\x29\51\x70\x61\x67\141\144\x6f\x2c\103\x4f\116\x43\101\x54\x28\47\74\x62\x3e\124\157\164\141\154\x3c\x2f\x62\76\40\x27\x2c\x52\x4f\x55\116\x44\50\116\103\54\62\x29\51\x4e\x43\x2c\x43\x4f\116\103\101\124\50\x27\74\142\x3e\124\x6f\x74\141\154\x3c\x2f\142\76\40\x27\x2c\12\40\40\40\x20\40\40\x20\x20\122\x4f\x55\x4e\104\50\122\x45\124\54\62\51\51\x52\x45\x54\x2c\x43\x4f\x4e\103\x41\124\50\47\x3c\x62\76\x54\157\164\141\x6c\x3c\57\x62\x3e\x20\x27\54\122\x4f\x55\116\104\50\x64\x6f\x6c\x61\162\55\50\160\x61\x67\141\x64\157\53\x4e\103\53\x52\105\124\51\x2c\62\x29\51\144\145\142\x65\x2c\103\117\116\x43\101\124\x28\47\74\142\x3e\124\x6f\x74\x61\154\74\x2f\x62\x3e\40\x27\54\x52\117\125\x4e\104\x28\x28\50\x70\141\147\141\144\x6f\x2b\x6e\x63\x2b\x72\145\164\51\x2a\x31\60\60\x29\57\144\x6f\x6c\x61\x72\54\62\x29\51\x20\143\x75\155\x70\154\151\x64\x6f\40\x46\x52\x4f\x4d\40\12\x20\40\x20\x20\x20\40\x20\x20\x28\123\105\114\105\x43\124\x20\123\x55\115\50\164\x6f\164\141\154\144\x29\40\144\157\x6c\141\162\x2c\x20\x28\x53\105\114\105\x43\124\x20\123\125\115\50\155\x6f\156\x74\157\x64\x29\x20\x46\122\x4f\115\40\157\x70\x65\x72\143\154\151\40\127\x48\x45\x52\x45\40\151\144\x63\157\156\x73\142\x61\x6e\x63\x20\x49\123\40\116\x4f\124\x20\116\x55\114\114\x29\x20\x70\141\x67\141\x64\157\x2c\12\40\x20\40\x20\40\x20\40\40\111\106\50\x28\123\105\x4c\x45\103\124\40\x52\117\125\x4e\x44\x28\123\125\x4d\50\164\157\164\x61\154\x64\51\x2c\x32\51\40\164\157\164\x61\x6c\x64\40\106\122\x4f\115\x20\x61\x70\154\151\x63\x61\x6e\143\x29\76\x30\54\x28\x53\x45\x4c\x45\x43\124\x20\x52\117\x55\x4e\x44\x28\123\x55\x4d\x28\x74\157\164\141\154\144\51\x2c\x32\x29\40\164\157\x74\141\154\144\x20\106\122\117\115\40\x61\160\x6c\x69\x63\x61\x6e\x63\x29\54\x30\51\x20\116\103\x2c\12\x20\x20\x20\40\x20\x20\40\40\111\x46\x28\50\x53\105\x4c\105\103\x54\x20\122\x4f\x55\116\104\x28\123\x55\115\x28\164\157\x74\141\154\x66\151\156\x61\154\57\50\123\x45\x4c\x45\x43\124\40\157\146\x69\143\x69\141\154\40\x46\x52\x4f\115\x20\x6d\x6f\156\x65\x63\x61\155\40\127\x48\105\x52\105\40\146\x65\143\150\x61\74\75\146\145\143\x68\141\143\x72\145\141\40\117\122\104\105\122\40\x42\131\x20\146\x65\x63\150\141\x20\104\105\123\103\x20\114\x49\x4d\111\124\x20\x31\51\51\x2c\x32\51\40\x74\157\164\141\x6c\x64\x20\x46\122\117\x4d\x20\x6f\160\145\162\164\151\x20\127\x48\x45\x52\105\40\x74\x69\160\x6f\144\157\x63\75\47\122\105\124\47\x29\76\x30\x2c\x28\x53\x45\114\x45\x43\x54\40\x52\117\125\x4e\x44\x28\123\125\x4d\50\164\157\x74\x61\x6c\146\151\156\141\154\57\x28\x53\105\114\105\x43\x54\40\x6f\146\x69\x63\x69\x61\x6c\x20\x46\122\x4f\x4d\40\x6d\157\156\x65\143\141\x6d\40\x57\x48\x45\122\x45\x20\x66\145\143\150\141\x3c\x3d\x66\145\x63\150\x61\143\162\x65\x61\40\x4f\122\104\x45\x52\x20\102\x59\x20\x66\x65\143\150\x61\40\x44\x45\x53\x43\40\x4c\111\115\111\124\x20\61\51\x29\x2c\x32\51\40\x74\x6f\164\141\x6c\144\40\106\x52\117\115\40\x6f\x70\x65\162\164\151\x20\x57\110\x45\x52\x45\x20\x74\x69\160\157\x64\x6f\x63\75\47\122\x45\x54\x27\x29\54\x30\x29\40\122\105\x54\12\x20\x20\x20\40\x20\x20\40\x20\106\122\117\x4d\40\157\160\x65\162\164\x69\40\141\40\127\x48\x45\x52\x45\40\x74\x69\160\157\144\x6f\143\x3d\x27\x46\x41\103\47\40\x7c\x7c\40\x74\x69\160\157\x64\157\x63\75\x27\x4e\x4f\x54\47\x20\x26\x26\x20\164\157\x74\141\154\x64\x3e\x30\x20\x26\46\x20\145\163\164\x61\164\x75\163\144\157\143\x21\75\x27\x58\47\x20\x26\x26\x20\50\x53\125\102\x53\124\122\x28\141\56\x63\x6f\144\x63\x6c\151\x65\x6e\164\145\54\61\54\63\x29\41\75\47\x49\x4e\x54\x27\x20\x26\x26\40\x61\x2e\x63\157\x64\x63\x6c\151\145\x6e\164\145\41\x3d\47\x4d\x46\x30\x30\x30\x30\47\51\51\40\x74\157\x74\141\x6c\xa\40\x20\x20\40\x20\40\40\x20\125\x4e\x49\x4f\x4e\xa\40\40\x20\x20\40\40\40\40\123\105\x4c\105\103\124\x20\172\x6f\x6e\141\x2c\x20\x52\x4f\x55\116\104\x28\123\125\115\50\144\157\154\141\x72\x29\54\x32\51\40\144\x6f\154\x61\162\x2c\x20\122\117\x55\x4e\x44\50\x53\125\115\50\160\x61\147\x61\144\x6f\51\x2c\62\51\x20\160\x61\x67\x61\144\157\x2c\x52\117\x55\x4e\104\x28\x53\x55\x4d\x28\116\103\51\54\x32\51\40\x4e\103\x2c\122\x4f\125\116\x44\x28\123\125\115\50\122\x45\x54\x29\54\x32\x29\40\x52\105\x54\x2c\40\122\x4f\x55\116\x44\50\123\x55\115\50\x64\x6f\x6c\141\162\51\x2d\50\x53\x55\115\x28\160\141\x67\141\x64\157\x29\53\x53\x55\115\x28\116\x43\51\53\123\125\x4d\50\x52\105\124\51\x29\54\x32\51\x20\144\145\142\145\x2c\x52\x4f\125\116\x44\50\50\50\123\x55\115\x28\x70\x61\x67\x61\144\157\51\x2b\123\x55\115\x28\x4e\103\x29\x2b\123\x55\115\x28\122\105\124\x29\x29\x2a\61\x30\60\x29\57\x53\x55\x4d\x28\144\157\x6c\x61\162\51\54\62\x29\40\143\x75\155\160\x6c\151\x64\157\x20\x46\x52\x4f\x4d\12\40\40\x20\40\40\x20\x20\40\50\x53\x45\114\x45\x43\x54\x20\x43\117\x4e\x43\x41\x54\50\x61\56\163\145\x63\164\157\162\54\x61\56\x73\x75\x62\x63\x6f\144\151\x67\157\x29\40\x7a\x6f\156\x61\54\40\x53\x55\x4d\50\141\56\x74\157\164\141\x6c\144\51\x20\x64\x6f\154\x61\x72\x2c\50\123\105\x4c\105\103\x54\x20\x53\x55\x4d\x28\155\x6f\x6e\164\x6f\144\x29\x20\x46\x52\x4f\x4d\x20\x6f\x70\145\162\143\x6c\151\40\127\110\x45\122\x45\x20\151\x64\146\141\x63\x3d\141\x2e\144\157\x63\x75\x6d\145\x6e\164\x6f\40\x26\46\x20\x69\x64\143\x6f\x6e\x73\x62\x61\x6e\x63\x20\x49\123\x20\x4e\117\x54\x20\x4e\x55\x4c\x4c\51\x20\160\141\147\x61\144\x6f\54\12\40\40\40\x20\x20\x20\x20\40\x49\106\50\x28\x53\105\x4c\105\x43\x54\x20\x52\x4f\x55\116\104\x28\x53\x55\x4d\50\x74\x6f\x74\x61\154\x64\x29\54\62\51\40\164\x6f\x74\x61\154\x64\x20\x46\122\x4f\x4d\x20\x61\160\x6c\151\143\x61\x6e\143\x20\x57\x48\105\x52\x45\x20\x66\141\x63\x3d\x61\x2e\144\157\143\165\x6d\x65\156\x74\x6f\51\x3e\x30\54\x28\123\x45\114\105\103\x54\40\x52\117\125\116\104\x28\123\x55\x4d\x28\x74\x6f\164\x61\154\144\51\54\x32\51\x20\164\157\x74\141\x6c\x64\40\106\x52\x4f\x4d\40\141\x70\x6c\151\x63\141\156\143\40\x57\110\x45\x52\105\x20\x66\141\x63\75\141\x2e\x64\x6f\143\x75\x6d\145\x6e\x74\x6f\51\x2c\60\x29\40\x4e\x43\54\12\40\40\x20\x20\x20\x20\x20\x20\111\106\50\x28\123\105\x4c\x45\103\x54\x20\x52\x4f\125\x4e\x44\50\x53\125\115\x28\164\x6f\x74\141\154\x66\x69\156\141\x6c\57\x28\123\x45\x4c\x45\103\x54\40\157\146\x69\143\x69\141\154\40\x46\122\x4f\x4d\40\155\157\156\145\143\x61\155\40\x57\x48\x45\122\105\40\146\x65\143\x68\x61\74\x3d\x61\x2e\146\x65\143\150\141\143\x72\x65\141\x20\117\122\x44\105\x52\40\102\131\40\146\x65\143\x68\141\x20\104\105\123\x43\40\x4c\111\x4d\x49\124\40\61\x29\51\x2c\x32\51\x20\x74\157\x74\141\x6c\144\40\106\x52\117\x4d\x20\x6f\x70\x65\162\x74\x69\x20\x57\x48\x45\122\105\40\141\156\x74\144\x6f\x63\x3d\141\x2e\x61\x6e\x74\x64\x6f\143\x20\46\x26\40\x74\151\x70\157\144\x6f\x63\75\x27\x52\x45\124\47\40\46\46\x20\141\x6e\x74\x64\x6f\x63\x21\x3d\47\47\51\76\x30\x2c\50\x53\x45\114\x45\103\x54\x20\122\x4f\125\116\104\50\123\x55\115\x28\x74\x6f\x74\141\154\x66\x69\x6e\x61\154\57\x28\123\105\114\x45\x43\x54\40\x6f\146\x69\143\151\141\x6c\40\106\122\x4f\115\x20\155\157\x6e\x65\143\141\155\40\127\110\105\122\x45\x20\x66\x65\143\150\x61\x3c\x3d\141\x2e\146\x65\143\150\141\143\162\x65\141\x20\117\x52\x44\x45\x52\40\102\x59\40\146\x65\143\150\x61\x20\x44\x45\123\x43\40\x4c\x49\115\111\x54\x20\61\x29\51\54\62\x29\40\164\157\x74\141\154\x64\x20\106\122\117\115\40\157\160\x65\162\164\151\x20\x57\x48\x45\x52\x45\x20\x61\156\x74\x64\x6f\143\75\141\x2e\x61\x6e\164\144\x6f\143\x20\x26\46\x20\x74\151\x70\157\x64\157\143\75\x27\x52\x45\124\47\51\x2c\60\x29\40\122\105\124\xa\40\40\40\x20\x20\x20\x20\x20\x46\122\117\115\40\x6f\160\x65\x72\164\151\40\141\x20\x57\110\105\122\x45\x20\x28\141\56\164\151\x70\x6f\144\x6f\x63\x3d\x27\106\101\103\x27\40\174\174\40\141\x2e\x74\151\160\x6f\x64\x6f\x63\75\47\116\117\124\47\x29\x20\x26\x26\40\141\56\x74\x6f\164\x61\154\144\76\60\40\x26\x26\x20\x61\x2e\x65\163\x74\x61\164\x75\163\144\x6f\143\41\x3d\47\x58\47\40\x26\x26\x20\x28\123\x55\102\x53\124\122\50\141\56\143\157\x64\x63\x6c\x69\x65\156\164\x65\x2c\x31\54\x33\x29\x21\75\x27\x49\116\x54\47\40\x26\46\x20\x61\56\x63\157\x64\143\154\x69\145\x6e\164\145\41\x3d\47\115\106\60\60\60\x30\47\x29\xa\x20\x20\x20\x20\40\x20\x20\x20\107\x52\x4f\x55\120\40\102\131\x20\141\56\x64\157\x63\x75\x6d\x65\x6e\x74\x6f\51\40\143\157\142\162\141\x6e\172\x61\x6d\145\163\40\107\x52\x4f\125\120\x20\x42\x59\40\x7a\157\x6e\141")->result(); $html .= "\x3c\x74\x61\x62\154\x65\x20\143\154\x61\x73\163\75\x22\167\x33\x2d\164\141\142\154\x65\55\x61\154\154\40\167\x33\55\150\x6f\166\145\x72\141\142\154\x65\42\x3e\74\164\x72\x20\143\x6c\x61\x73\x73\x3d\42\167\x33\x2d\146\x6f\x6e\x64\x6f\144\x72\157\x69\x64\40\x77\63\x2d\x66\x69\152\157\42\76\74\164\x68\76\x5a\x6f\156\141\74\x2f\164\x68\x3e\74\x74\150\x3e\x44\157\x6c\x61\162\74\57\164\150\x3e\x3c\x74\x68\x3e\x50\x61\147\141\x64\157\74\x2f\x74\150\x3e\74\164\x68\76\116\103\x3c\57\x74\150\x3e\x3c\x74\150\76\x52\x45\x54\74\57\x74\x68\76\74\x74\x68\x3e\x44\145\142\x65\x3c\57\x74\150\76\74\164\150\76\103\x75\155\x70\154\x69\x64\157\x3c\x2f\164\150\76\x3c\57\x74\x72\x3e"; $i = 0; foreach ($bd as $db) { $i++; if ($db->cumplido <= 50) { $color = "\167\x33\55\162\x65\144"; } elseif ($db->cumplido <= 70) { $color = "\x77\x33\x2d\x70\x61\154\145\x2d\x67\x72\x65\x65\x6e"; } elseif ($db->cumplido > 70) { $color = "\167\63\55\x67\162\145\x65\x6e"; } $zona = $this->db->query("\123\105\x4c\x45\x43\124\x20\x73\x75\142\x73\145\x63\164\157\162\x20\156\40\106\122\x4f\115\x20\x73\165\x62\163\x65\143\x74\157\x72\145\x73\40\127\x48\x45\x52\x45\40\x43\x4f\x4e\x43\x41\124\50\x63\x6f\144\x69\147\157\x2c\163\x75\x62\x63\157\144\151\147\x6f\51\x3d\47{$db->zona}\x27")->row(); $html .= "\xa\40\40\40\x20\40\x20\x20\40\40\40\40\40\74\151\x6e\x70\x75\164\40\164\171\x70\145\75\42\x68\151\144\144\145\x6e\x22\40\x6e\141\x6d\145\75\42\x64\151\x61\x73\42\x20\166\141\154\165\145\x3d\x22" . $db->zona . "\42\76\xa\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x3c\x74\x72\40\157\x6e\x63\x6c\151\x63\153\75\42\151\156\x66\157\144\x65\165\144\x61\163\x28" . $i . "\x2c\x32\x29\73\x22\x3e\74\164\x64\x3e" . $zona->n . "\x3c\57\164\x64\x3e\74\x74\x64\76" . $db->dolar . "\x3c\x2f\x74\x64\76\x3c\164\x64\76" . $db->pagado . "\74\57\164\x64\76\x3c\164\x64\x3e" . $db->NC . "\74\x2f\164\x64\76\74\x74\144\76" . $db->RET . "\x3c\x2f\164\x64\76\x3c\x74\144\x3e" . $db->debe . "\74\x2f\164\x64\76\x3c\x74\x64\x20\143\154\141\x73\x73\x3d\42" . $color . "\42\76" . $db->cumplido . "\x20\x25\74\x2f\164\x64\76\74\57\x74\x72\x3e"; } $html .= "\74\57\164\141\x62\x6c\x65\76\12\x20\40\x20\x20\x20\40\x20\40\x3c\163\x63\162\151\x70\x74\x20\x74\x79\160\145\x3d\x22\x74\145\x78\164\x2f\x6a\141\x76\x61\163\x63\162\151\160\164\x22\76\12\40\x20\40\x20\x20\x20\40\x20\146\165\x6e\143\164\x69\157\x6e\x20\x69\x6e\146\157\144\x65\x75\x64\141\x73\x28\141\54\142\51\173\xa\40\40\40\x20\40\x20\40\40\x20\x20\40\40\154\145\x74\x20\151\75\160\141\162\x73\x65\x49\x6e\x74\50\141\x29\x2d\x31\x3b\12\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\166\141\162\x20\144\151\141\163\75\144\x6f\143\165\x6d\x65\x6e\164\56\x67\x65\164\105\154\x65\155\145\156\164\x73\102\x79\x4e\141\155\145\50\x22\x64\x69\x61\x73\x22\51\133\x69\x5d\x2e\x76\x61\x6c\165\x65\73\12\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\x76\x61\x72\x20\144\141\x74\x61\x3d\x7b\144\151\141\163\x3a\144\x69\x61\x73\54\x74\x69\x70\72\142\175\73\xa\x20\40\x20\x20\40\40\x20\40\x20\40\40\40\x24\56\160\157\x73\164\x28\142\141\x73\145\165\x72\154\x2b\x22\x63\x5f\144\162\x6f\151\x64\x2f\x69\x6e\x66\157\x64\145\165\144\141\x73\42\x2c\x64\141\x74\141\x2c\x66\x75\x6e\x63\164\x69\157\156\50\162\x29\173\40\44\x28\42\x23\x76\151\x65\x77\144\x65\x74\141\x6c\154\145\x73\42\x29\x2e\x73\150\x6f\167\x28\x29\x3b\x20\x24\50\42\43\x64\145\x74\x61\x6c\154\145\x73\x22\x29\x2e\x68\x74\x6d\154\50\x72\51\73\x20\x7d\51\x3b\xa\40\x20\40\40\x20\40\x20\40\175\12\40\40\40\40\x20\40\x20\40\74\x2f\163\x63\x72\x69\160\164\x3e\12\x20\x20\x20\40\40\x20\x20\40"; } if ($tip == 5) { $html = $this->db->query("\x53\x45\x4c\105\x43\x54\40\x43\x4f\x4e\x43\101\124\50\143\157\x64\x63\154\x69\x65\x6e\164\x65\x2c\x27\x20\47\x2c\156\157\155\142\x72\x65\143\154\x69\x29\40\x6e\x6f\155\x62\x72\145\x2c\x63\141\156\x74\54\144\x65\x76\54\x63\x61\x6e\x74\x2d\x64\145\x76\x20\x75\x6e\x69\144\x20\106\x52\117\x4d\x20\50\x53\105\x4c\105\x43\x54\40\142\x2e\x63\157\x64\x63\x6c\151\145\156\164\145\54\x62\x2e\156\157\155\142\162\145\143\x6c\151\54\x52\x4f\125\116\104\x28\x53\125\x4d\x28\x61\x2e\x63\141\156\x74\151\x64\141\144\x29\54\x32\51\40\143\141\x6e\164\x2c\122\117\x55\116\x44\50\x53\x55\115\50\141\x2e\x63\x6e\164\144\x65\x76\165\x65\154\164\x29\x2c\x32\x29\40\x64\145\166\xa\x20\x20\x20\x20\40\x20\x20\x20\x46\122\117\x4d\40\x6f\160\145\x72\x6d\x76\x20\x61\x20\12\x20\40\40\40\40\x20\x20\40\112\117\x49\x4e\40\x6f\x70\145\x72\x74\151\40\x62\x20\117\116\x20\50\x61\56\144\157\143\165\155\145\156\164\x6f\75\142\56\x64\157\x63\165\155\145\156\x74\157\x20\x26\46\40\141\x2e\x74\151\x70\157\x64\x6f\143\x3d\x62\56\164\151\x70\x6f\144\157\x63\51\xa\x20\x20\x20\40\40\40\x20\x20\x20\x57\x48\105\122\105\40\x61\x2e\146\x65\143\x68\141\x64\157\143\x3e\x3d\47{$desde}\x27\x20\x26\x26\x20\x61\x2e\x66\145\143\150\x61\144\157\143\74\x3d\47{$hasta}\47\x20\x26\46\40\x28\x61\x2e\x74\151\160\157\144\157\143\x3d\47\106\x41\x43\47\x20\x7c\174\40\141\56\164\151\160\x6f\144\x6f\x63\75\x27\116\x4f\x54\47\51\xa\x20\x20\x20\x20\40\x20\x20\40\107\x52\x4f\125\x50\40\x42\131\40\142\x2e\x63\x6f\144\143\154\151\145\156\164\x65\40\117\122\x44\x45\122\40\102\131\x20\50\x53\x55\115\50\141\56\143\x61\156\164\151\144\141\x64\51\55\123\125\115\x28\x61\56\143\x6e\x74\x64\x65\166\165\145\x6c\x74\x29\51\40\x44\x45\x53\103\40\114\x49\x4d\111\124\40\x33\60\51\40\x63\x6c\x69\145\156\x74\145\x73\40\x4f\122\x44\x45\x52\40\x42\x59\40\x75\x6e\151\144\x20\x44\105\x53\103")->result(); } if ($tip == 6) { $html = $this->db->query("\123\x45\x4c\x45\x43\x54\40\x43\x4f\x4e\x43\x41\124\x28\x63\157\x64\x69\x67\x6f\54\47\x20\x27\x2c\156\157\155\142\162\145\x29\40\156\x6f\155\x62\x72\x65\x2c\143\x61\x6e\164\54\144\145\166\x2c\143\x61\156\x74\x2d\144\145\x76\40\165\156\x69\x64\x20\106\x52\117\x4d\x20\x28\x53\105\x4c\x45\103\x54\x20\141\56\x63\x6f\x64\151\147\x6f\54\141\x2e\156\157\155\x62\162\x65\x2c\122\x4f\x55\116\x44\50\x53\125\115\50\x61\56\143\141\x6e\164\151\x64\x61\144\51\54\x32\x29\x20\x63\141\156\164\x2c\122\x4f\x55\116\104\50\123\x55\115\50\141\x2e\143\156\164\x64\x65\166\x75\145\154\164\51\x2c\x32\x29\40\144\x65\x76\xa\x20\x20\40\40\x20\x20\40\40\106\122\x4f\x4d\40\157\x70\x65\x72\155\166\40\141\40\12\40\x20\x20\40\x20\40\x20\x20\40\127\110\x45\122\x45\x20\141\x2e\x66\x65\x63\x68\x61\144\157\x63\76\75\x27{$desde}\47\x20\46\46\x20\141\x2e\146\145\x63\150\141\x64\157\143\x3c\75\47{$hasta}\x27\40\x26\46\x20\50\x61\x2e\164\151\x70\x6f\144\x6f\143\75\47\x46\x41\x43\x27\x20\x7c\174\x20\141\56\x74\151\x70\x6f\x64\x6f\x63\75\47\116\x4f\124\x27\51\xa\40\x20\40\x20\x20\40\x20\x20\x47\x52\117\x55\x50\x20\x42\131\40\141\56\143\x6f\x64\x69\x67\x6f\x20\x4f\x52\x44\x45\122\x20\x42\x59\40\x28\123\125\x4d\x28\x61\56\143\x61\x6e\x74\x69\x64\141\x64\51\x2d\x53\x55\x4d\x28\x61\56\x63\156\x74\x64\145\166\x75\x65\x6c\x74\x29\x29\x20\104\x45\x53\103\40\114\111\x4d\x49\124\x20\63\60\x29\x20\143\x6c\x69\x65\156\x74\x65\x73\40\117\x52\104\105\122\x20\102\x59\x20\x75\156\x69\x64\40\x44\x45\123\103")->result(); } if ($tip == 7) { $html = $this->db->query("\x53\105\114\105\x43\x54\40\x7a\x6f\x6e\141\40\x6e\157\155\142\x72\145\x2c\143\141\x6e\x74\x2c\144\145\x76\x2c\143\x61\156\164\x2d\x64\x65\166\x20\165\156\151\x64\40\x46\x52\x4f\115\40\50\123\105\114\x45\x43\124\40\50\123\105\114\105\x43\x54\x20\x73\x75\x62\163\x65\143\164\x6f\162\40\106\x52\117\x4d\x20\163\x75\x62\163\x65\x63\x74\x6f\162\x65\163\40\127\110\105\x52\105\40\143\x6f\144\151\147\157\x3d\x62\x2e\x73\145\143\x74\157\x72\x20\46\x26\40\x73\165\x62\143\157\x64\x69\x67\x6f\x3d\x62\56\163\x75\142\x63\157\144\x69\147\157\x29\x20\172\x6f\156\141\54\122\117\x55\116\x44\x28\123\x55\x4d\50\141\x2e\143\x61\156\164\151\x64\x61\x64\51\x2c\x32\x29\x20\143\x61\x6e\x74\54\x52\x4f\125\116\104\50\123\125\115\50\141\56\x63\156\x74\144\145\x76\x75\x65\x6c\164\x29\x2c\x32\51\40\144\x65\x76\xa\x20\40\x20\40\x20\40\x20\x20\x46\x52\x4f\115\x20\x6f\x70\x65\x72\155\166\x20\141\x20\112\117\x49\x4e\40\x6f\x70\145\x72\164\151\x20\142\40\x4f\x4e\40\x28\x61\56\x64\157\143\165\155\x65\x6e\x74\157\x3d\142\x2e\x64\157\x63\x75\155\x65\156\x74\x6f\40\x26\x26\40\x61\56\x74\151\x70\157\x64\x6f\x63\75\x62\56\x74\151\160\157\x64\157\x63\x29\xa\40\40\x20\x20\x20\40\x20\40\40\x57\110\105\122\x45\40\x61\56\x66\x65\x63\x68\x61\x64\157\x63\76\x3d\47{$desde}\x27\40\46\46\40\x61\56\x66\x65\x63\x68\x61\x64\157\x63\x3c\x3d\47{$hasta}\x27\x20\46\46\x20\50\x61\56\164\151\160\x6f\144\x6f\x63\x3d\47\106\101\x43\47\x20\174\174\x20\141\x2e\164\x69\x70\x6f\144\x6f\x63\75\x27\x4e\x4f\x54\x27\x29\12\40\40\x20\40\x20\40\x20\x20\x47\122\117\125\x50\40\102\x59\x20\142\56\x73\145\x63\x74\157\162\x2c\x62\56\x73\165\142\143\x6f\144\x69\x67\157\40\117\x52\x44\x45\x52\40\x42\x59\40\x28\x53\125\x4d\x28\141\56\x63\141\156\164\151\144\x61\144\x29\55\123\x55\115\x28\x61\x2e\x63\x6e\x74\144\145\x76\x75\x65\154\x74\x29\51\40\x44\x45\123\103\x20\x4c\111\115\x49\x54\40\x33\60\51\40\x7a\x6f\156\x61\40\x4f\122\104\105\x52\x20\x42\131\40\165\x6e\x69\144\x20\x44\x45\123\x43")->result(); } if ($tip == 8) { $bd = $this->db->query("\123\x45\x4c\x45\x43\x54\40\156\x75\154\154\40\x6d\145\x73\54\x20\103\x4f\116\x43\101\124\50\47\x3c\142\76\x54\157\x74\141\x6c\74\57\x62\76\40\47\54\122\117\x55\x4e\104\50\x64\157\x6c\x61\162\54\62\51\x29\x20\144\157\x6c\x61\x72\54\x43\117\116\x43\101\x54\50\47\x3c\x62\x3e\x54\157\164\141\x6c\x3c\57\142\76\x20\x27\x2c\x52\x4f\125\x4e\104\x28\x70\x61\x67\141\144\x6f\54\62\x29\51\x70\141\147\x61\x64\x6f\x2c\103\117\x4e\x43\x41\x54\x28\47\74\x62\76\124\x6f\x74\141\154\x3c\x2f\x62\76\40\47\x2c\x52\117\x55\x4e\104\50\x4e\103\54\62\x29\51\x4e\103\54\x43\117\x4e\103\101\124\50\47\74\x62\76\124\x6f\x74\141\154\x3c\x2f\142\76\x20\47\x2c\12\40\x20\x20\40\x20\40\40\40\122\x4f\x55\x4e\x44\x28\x52\x45\x54\54\x32\x29\51\x52\105\x54\54\x43\117\x4e\103\x41\124\x28\47\74\142\x3e\124\x6f\x74\x61\154\x3c\57\142\76\40\47\54\x52\117\125\116\x44\x28\x64\x6f\x6c\141\x72\x2d\50\160\141\147\x61\144\157\x2b\x6e\143\x2b\x72\x65\x74\51\x2c\62\51\51\x64\145\142\145\54\103\117\x4e\103\101\x54\x28\47\x3c\142\76\124\157\164\x61\x6c\x3c\57\x62\76\40\x27\x2c\122\117\x55\x4e\104\x28\50\50\160\141\147\141\144\157\53\156\x63\53\x72\145\164\x29\x2a\x31\x30\60\51\x2f\144\x6f\x6c\x61\x72\x2c\x32\51\x29\x20\143\165\155\x70\x6c\151\x64\x6f\x20\x46\x52\117\115\40\12\40\x20\40\40\40\x20\x20\x20\50\123\105\x4c\105\103\x54\x20\123\125\x4d\50\164\x6f\164\141\x6c\x64\51\x20\144\157\x6c\141\162\x2c\40\x28\x53\105\x4c\105\x43\x54\40\123\x55\115\50\x6d\x6f\156\x74\x6f\x64\x29\x20\106\x52\x4f\x4d\40\157\160\x65\162\x63\x6c\x69\x20\x57\x48\105\x52\105\40\151\x64\x63\x6f\156\x73\142\x61\x6e\x63\40\x49\123\x20\116\x4f\x54\x20\116\x55\x4c\x4c\x29\40\x70\x61\x67\141\144\157\54\xa\x20\40\x20\x20\40\x20\40\40\x49\x46\x28\x28\123\105\x4c\x45\x43\x54\40\122\x4f\125\116\104\50\123\x55\x4d\50\x74\157\x74\x61\154\x64\51\x2c\62\x29\x20\x74\157\164\141\x6c\x64\x20\106\122\x4f\x4d\x20\141\x70\x6c\x69\x63\x61\x6e\x63\51\76\x30\x2c\50\x53\105\114\105\103\124\x20\x52\117\x55\x4e\x44\x28\123\125\x4d\50\164\157\164\141\154\144\51\54\x32\x29\40\164\x6f\x74\x61\154\x64\40\x46\122\117\x4d\x20\x61\x70\154\x69\x63\141\156\143\x29\x2c\x30\51\x20\116\103\x2c\xa\40\x20\x20\40\40\x20\40\x20\x49\x46\50\50\123\105\x4c\x45\x43\x54\x20\x52\x4f\x55\x4e\104\50\x53\x55\x4d\50\164\x6f\x74\141\x6c\146\x69\156\x61\x6c\57\50\123\x45\114\105\103\x54\40\157\x66\x69\x63\x69\x61\x6c\40\x46\122\117\115\x20\x6d\x6f\x6e\x65\x63\141\155\40\x57\x48\105\x52\105\x20\146\x65\x63\x68\x61\74\75\x66\x65\x63\x68\141\143\x72\145\141\40\117\122\104\105\122\x20\102\131\x20\x66\x65\x63\x68\x61\x20\104\105\123\103\x20\114\111\115\111\124\x20\61\51\51\x2c\62\51\40\x74\x6f\x74\141\154\x64\x20\x46\x52\x4f\115\x20\x6f\160\145\162\x74\x69\x20\127\x48\105\122\x45\40\164\x69\160\x6f\144\x6f\143\75\x27\x52\x45\x54\x27\51\x3e\60\54\50\x53\105\x4c\105\x43\x54\40\122\117\125\x4e\104\50\123\x55\115\50\x74\157\x74\x61\154\x66\151\x6e\141\x6c\57\x28\x53\x45\114\105\x43\x54\40\x6f\146\151\143\151\x61\x6c\x20\x46\x52\117\x4d\x20\155\x6f\156\145\x63\141\x6d\x20\x57\110\x45\x52\105\40\x66\145\x63\x68\x61\74\x3d\x66\145\143\150\141\143\162\145\141\40\117\x52\104\x45\x52\x20\x42\131\40\146\145\143\x68\x61\x20\104\105\123\103\x20\114\111\115\111\124\40\61\51\51\x2c\62\51\40\164\x6f\x74\x61\154\144\x20\x46\122\x4f\115\x20\x6f\x70\145\x72\164\x69\40\127\x48\105\x52\x45\x20\164\x69\x70\157\x64\157\x63\75\47\x52\105\x54\x27\x29\54\60\51\40\122\x45\124\xa\x20\40\x20\40\40\x20\x20\x20\x46\122\117\115\x20\x6f\x70\x65\x72\164\x69\40\141\x20\x57\x48\x45\x52\105\40\x74\x69\160\157\x64\x6f\143\75\x27\x46\101\x43\x27\40\174\174\40\x74\x69\160\157\x64\x6f\x63\x3d\47\x4e\x4f\x54\x27\x20\46\46\40\164\x6f\x74\141\x6c\x64\x3e\x30\x20\46\46\40\145\x73\x74\x61\x74\165\x73\144\x6f\x63\x21\75\47\130\47\x20\x26\x26\x20\50\x53\x55\102\x53\124\122\x28\141\x2e\x63\157\144\x63\154\x69\x65\x6e\164\145\54\x31\x2c\63\51\x21\75\47\111\116\x54\x27\40\46\x26\x20\x61\56\x63\157\144\143\154\151\x65\x6e\x74\145\41\75\47\115\106\60\60\60\x30\x27\x29\x20\x29\x20\x74\157\164\141\x6c\12\40\40\x20\40\x20\40\x20\x20\x55\x4e\x49\x4f\x4e\12\40\x20\x20\40\40\x20\x20\40\x53\x45\114\x45\103\x54\40\x6d\145\x73\54\40\x52\x4f\x55\116\104\x28\123\125\115\50\144\157\154\141\x72\x29\x2c\62\x29\x20\144\x6f\154\141\x72\x2c\40\x52\117\125\x4e\104\50\123\x55\115\x28\x70\x61\x67\141\144\157\51\x2c\x32\x29\40\x70\x61\147\141\144\157\54\122\x4f\x55\116\x44\50\x53\x55\115\x28\x4e\103\x29\x2c\x32\51\40\116\103\54\x52\x4f\x55\x4e\x44\x28\x53\125\115\x28\x52\x45\x54\51\x2c\x32\51\x20\x52\x45\124\54\40\122\x4f\125\x4e\x44\x28\x53\125\x4d\x28\x64\157\x6c\141\162\x29\x2d\50\123\x55\x4d\x28\160\141\147\x61\144\x6f\51\53\x53\x55\x4d\50\116\x43\x29\x2b\x53\125\115\x28\x52\105\124\x29\51\54\x32\51\x20\144\145\x62\x65\54\122\117\125\x4e\x44\x28\x28\50\123\125\x4d\50\x70\x61\x67\141\144\157\51\53\x53\125\x4d\50\x4e\103\x29\x2b\x53\125\115\x28\122\105\124\x29\51\52\61\x30\60\51\x2f\x53\x55\x4d\x28\144\x6f\154\x61\162\x29\x2c\x32\x29\40\143\x75\155\x70\154\151\144\157\x20\106\122\x4f\115\12\40\x20\x20\x20\x20\x20\x20\x20\50\123\105\x4c\105\103\124\40\103\x4f\x4e\103\101\124\x28\115\x4f\116\x54\110\50\x66\145\143\150\x61\x63\162\145\x61\x29\54\x27\x2d\x27\54\x59\105\x41\x52\x28\146\145\143\150\141\143\x72\x65\x61\51\x29\40\155\x65\x73\54\40\x53\x55\115\x28\141\x2e\164\157\164\141\154\x64\x29\40\144\x6f\x6c\x61\162\x2c\12\x20\x20\40\x20\40\x20\x20\40\x28\x53\x45\x4c\x45\103\124\x20\x53\125\115\x28\155\x6f\156\164\157\144\x29\40\x46\x52\117\x4d\x20\x6f\160\x65\162\143\154\x69\40\x57\110\105\122\105\40\x69\144\x66\x61\x63\x3d\141\x2e\x64\x6f\143\165\155\x65\x6e\x74\x6f\x20\46\46\x20\x69\x64\143\x6f\x6e\163\142\x61\156\x63\40\111\x53\x20\116\x4f\x54\x20\116\x55\x4c\x4c\51\x20\x70\141\x67\141\144\x6f\x2c\xa\40\40\x20\x20\x20\40\x20\40\x49\x46\50\50\123\x45\114\x45\103\124\40\x52\x4f\x55\x4e\x44\50\x53\125\115\50\164\x6f\x74\x61\x6c\x64\x29\x2c\62\x29\x20\164\157\164\x61\x6c\x64\x20\x46\122\117\115\x20\141\x70\154\151\143\x61\x6e\143\x20\x57\110\105\122\x45\40\x66\x61\x63\75\141\56\144\x6f\x63\x75\155\145\156\164\x6f\x29\x3e\60\54\50\123\105\x4c\x45\x43\124\x20\x52\x4f\125\x4e\x44\50\x53\125\115\50\x74\157\164\141\x6c\144\51\54\x32\x29\x20\164\157\164\x61\154\144\40\106\122\x4f\x4d\x20\141\x70\x6c\x69\143\141\156\143\40\127\x48\105\122\x45\x20\146\141\x63\x3d\141\x2e\144\x6f\143\x75\x6d\145\156\164\157\x29\x2c\60\x29\40\x4e\103\54\xa\40\x20\x20\x20\40\40\x20\40\x49\x46\50\50\123\105\x4c\x45\x43\x54\40\x52\x4f\x55\116\104\x28\x53\x55\x4d\50\164\x6f\x74\141\x6c\x66\151\156\141\x6c\x2f\x28\123\x45\x4c\x45\103\124\40\x6f\146\151\x63\151\x61\154\40\x46\x52\117\x4d\40\155\157\x6e\145\143\141\x6d\40\127\x48\105\x52\x45\40\x66\145\143\x68\x61\74\75\x61\56\x66\x65\143\x68\x61\x63\162\145\x61\x20\117\122\104\105\x52\x20\102\131\40\146\145\143\150\141\x20\104\105\123\103\x20\114\x49\x4d\x49\x54\40\61\x29\x29\x2c\62\x29\x20\164\x6f\164\141\x6c\x64\x20\x46\x52\x4f\x4d\x20\x6f\160\x65\162\164\151\x20\127\x48\x45\122\x45\40\141\x6e\x74\144\157\143\75\x61\x2e\141\x6e\x74\144\157\143\x20\46\x26\x20\x74\x69\160\157\x64\x6f\143\x3d\x27\122\105\x54\x27\x20\46\x26\40\x61\x6e\164\x64\x6f\143\41\75\47\x27\51\76\60\54\50\x53\105\114\x45\103\x54\40\x52\x4f\125\116\104\x28\123\x55\115\x28\x74\157\164\x61\x6c\x66\151\156\141\154\x2f\x28\123\105\114\x45\103\124\40\x6f\x66\151\x63\x69\141\x6c\x20\106\122\117\115\x20\155\157\x6e\x65\143\141\x6d\40\x57\x48\x45\122\x45\40\x66\x65\143\150\x61\74\75\141\56\146\145\143\150\141\x63\162\145\x61\x20\117\122\x44\x45\x52\40\102\x59\40\146\x65\x63\x68\141\40\104\x45\x53\103\x20\x4c\111\115\111\x54\x20\61\51\x29\x2c\x32\51\x20\164\157\164\x61\154\x64\40\x46\x52\117\x4d\x20\x6f\160\145\162\164\x69\x20\x57\110\105\x52\x45\x20\x61\x6e\x74\x64\x6f\143\x3d\x61\x2e\x61\156\x74\144\x6f\x63\x20\46\46\x20\x74\x69\x70\157\x64\157\x63\x3d\x27\122\105\x54\x27\x29\54\x30\51\x20\122\105\124\xa\x20\x20\x20\40\x20\40\x20\x20\106\x52\117\x4d\40\157\x70\x65\162\x74\x69\x20\x61\40\x57\110\x45\122\x45\40\50\x61\x2e\164\151\160\x6f\144\x6f\x63\75\x27\106\x41\103\x27\x20\174\174\x20\141\x2e\x74\x69\x70\157\x64\157\143\75\47\x4e\x4f\x54\47\51\x20\46\46\x20\x61\56\x74\157\x74\141\154\144\x3e\x30\40\x26\x26\x20\x61\56\145\x73\x74\x61\x74\165\163\144\157\x63\x21\75\47\130\x27\40\x26\46\40\50\x53\125\x42\123\124\x52\x28\x61\x2e\x63\157\x64\x63\154\x69\x65\x6e\x74\x65\54\61\x2c\63\x29\41\75\x27\111\116\124\47\x20\x26\x26\x20\x61\x2e\x63\157\x64\x63\154\x69\145\x6e\164\145\41\75\47\x4d\x46\60\60\60\x30\x27\51\xa\40\x20\x20\x20\40\40\40\x20\107\122\117\x55\120\40\102\x59\40\141\x2e\x64\x6f\143\x75\155\145\x6e\164\157\x29\x20\143\x6f\142\162\x61\156\x7a\141\155\145\163\x20\x47\x52\117\x55\x50\x20\102\131\40\x6d\x65\x73")->result(); $html .= "\74\x74\x61\142\x6c\145\x20\x63\x6c\141\163\163\75\x22\x77\63\55\x74\x61\142\x6c\145\x2d\141\x6c\x6c\x20\167\63\55\x68\157\166\145\162\x61\x62\154\x65\42\76\x3c\164\x72\40\143\154\x61\163\163\x3d\42\167\x33\55\x66\157\x6e\x64\157\x64\x72\157\x69\144\x20\x77\x33\x2d\146\151\x6a\157\x22\76\x3c\x74\x68\76\115\145\x73\55\x41\303\xb1\157\x3c\x2f\x74\150\x3e\74\x74\x68\76\104\157\154\141\162\74\x2f\164\x68\x3e\74\164\150\76\x50\141\147\x61\144\x6f\74\x2f\164\x68\76\x3c\x74\150\x3e\x4e\103\x3c\57\164\150\x3e\x3c\x74\x68\x3e\x52\105\x54\74\x2f\164\x68\x3e\74\x74\150\76\104\x65\x62\x65\74\57\164\x68\76\x3c\164\150\x3e\103\165\x6d\160\x6c\151\144\157\74\57\x74\x68\76\x3c\x2f\164\x72\76"; $i = 0; foreach ($bd as $db) { $i++; if ($db->cumplido <= 50) { $color = "\167\63\55\x72\145\x64"; } elseif ($db->cumplido <= 70) { $color = "\167\63\x2d\160\141\154\x65\x2d\x67\x72\x65\145\156"; } elseif ($db->cumplido > 70) { $color = "\167\63\55\147\162\145\145\x6e"; } $html .= "\12\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x3c\151\x6e\x70\165\x74\40\x74\171\x70\x65\75\x22\x68\x69\x64\x64\145\156\42\40\x6e\141\155\145\x3d\42\x64\x69\141\163\42\x20\x76\141\154\165\145\75\42" . $db->mes . "\42\x3e\12\x20\40\x20\x20\40\x20\40\x20\40\x20\40\40\74\164\162\x20\x6f\156\143\154\151\x63\x6b\75\42\151\x6e\x66\x6f\144\145\165\x64\141\x73\50" . $i . "\x2c\x33\51\x3b\x22\76\x3c\x74\144\76" . $db->mes . "\74\x2f\x74\144\x3e\x3c\x74\144\x3e" . $db->dolar . "\74\57\164\144\76\x3c\164\x64\x3e" . $db->pagado . "\74\57\164\x64\x3e\74\164\x64\x3e" . $db->NC . "\74\57\164\144\x3e\74\164\x64\x3e" . $db->RET . "\x3c\x2f\x74\144\76\74\164\x64\x3e" . $db->debe . "\74\57\164\x64\x3e\74\164\144\40\143\154\141\x73\x73\x3d\x22" . $color . "\42\x3e" . $db->cumplido . "\x20\x25\74\57\164\x64\76\74\x2f\x74\x72\76"; } $html .= "\74\x2f\x74\x61\x62\x6c\x65\76\xa\40\x20\40\x20\40\x20\x20\x20\x3c\x73\x63\x72\151\x70\164\x20\x74\x79\160\x65\75\x22\164\145\170\164\57\152\x61\166\141\163\x63\162\151\160\164\42\76\xa\x20\40\40\40\40\40\40\40\x66\165\156\143\x74\x69\157\x6e\40\151\x6e\x66\x6f\144\145\165\144\141\x73\x28\x61\x2c\x62\x29\173\12\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\x6c\145\x74\40\151\x3d\x70\141\162\x73\145\x49\x6e\164\x28\x61\51\55\61\x3b\xa\40\x20\40\x20\x20\40\40\40\40\40\x20\x20\x76\141\x72\40\144\151\141\x73\x3d\144\x6f\143\x75\x6d\145\156\x74\x2e\147\145\x74\105\x6c\x65\x6d\145\156\164\x73\102\171\116\x61\155\x65\x28\x22\144\151\141\163\42\51\133\151\135\56\x76\141\154\165\145\73\xa\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x76\x61\162\x20\144\141\164\x61\75\x7b\x64\151\141\163\72\144\x69\x61\163\x2c\x74\x69\x70\72\x62\175\x3b\xa\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x24\56\x70\157\x73\x74\50\x62\x61\163\145\165\162\x6c\x2b\x22\143\x5f\144\x72\157\151\x64\57\151\156\146\157\x64\x65\165\144\x61\163\x22\54\144\x61\x74\141\54\146\165\156\143\164\x69\157\156\50\x72\x29\173\40\44\50\x22\x23\x76\x69\145\x77\x64\x65\x74\141\x6c\x6c\145\x73\42\51\x2e\163\x68\157\167\x28\51\x3b\40\x24\50\42\x23\144\145\x74\141\154\154\145\x73\42\x29\x2e\150\x74\155\154\50\162\51\x3b\x20\175\51\x3b\12\40\40\x20\40\x20\40\x20\40\x7d\12\x20\x20\40\x20\40\40\40\x20\x3c\57\163\x63\x72\x69\160\x74\x3e\xa\x20\x20\40\40\x20\x20\40\x20"; } return $html; } function infodeudas($cod, $tip) { if ($tip == 1) { $sql = $this->db->query("\123\x45\x4c\x45\x43\124\40\x7a\157\x6e\x61\x2c\x76\x65\x6e\144\x65\x64\x6f\162\54\x64\x6f\143\165\x6d\x65\x6e\x74\157\x2c\146\x65\x63\150\x61\x63\x72\x65\x61\x2c\x72\x65\143\x65\160\143\x69\157\156\54\166\145\156\143\x65\54\x63\x6f\x64\x63\x6c\x69\145\x6e\x74\145\x2c\x6e\157\x6d\142\162\145\143\154\x69\x2c\x74\157\x74\141\x6c\x64\x2c\122\x4f\x55\x4e\x44\x28\160\x61\147\x61\144\157\x2b\x6e\143\53\50\162\x65\x74\57\164\x61\163\141\x29\54\62\x29\x20\x70\x61\x67\x61\144\x6f\54\111\x46\x28\x28\164\157\164\x61\154\144\55\60\56\x35\x29\76\111\106\x28\160\141\147\x61\x64\x6f\53\x6e\x63\x2b\x28\162\145\164\57\x74\141\163\141\x29\x3e\x30\x2c\160\141\147\x61\x64\157\x2b\156\x63\x2b\50\162\x65\x74\x2f\x74\x61\x73\x61\51\x2c\x30\x29\54\47\74\x62\40\x63\154\x61\163\x73\x3d\42\x77\x33\55\x72\x65\x64\x22\76\115\x41\114\74\57\142\x3e\47\54\x27\x3c\x62\x20\x63\154\x61\163\x73\x3d\x22\167\x33\55\147\x72\x65\x65\x6e\x22\x3e\102\111\105\x4e\x3c\x2f\142\76\47\x29\40\163\x74\x61\164\x75\x73\x20\106\x52\117\x4d\xa\40\40\40\x20\40\x20\x20\40\50\x53\105\x4c\105\103\x54\x20\50\x53\105\114\x45\x43\124\x20\163\x75\142\x73\145\x63\164\x6f\x72\x20\x46\x52\117\115\x20\163\165\142\163\145\143\164\157\162\145\x73\x20\x57\x48\105\x52\x45\40\143\x6f\x64\x69\147\157\75\141\56\163\x65\143\x74\157\x72\40\46\46\x20\163\x75\x62\x63\157\x64\151\x67\157\75\141\56\x73\165\x62\143\157\144\x69\147\157\x29\40\x7a\x6f\x6e\x61\54\x28\123\105\114\x45\103\124\x20\x6e\157\x6d\142\x72\145\40\x46\122\117\x4d\40\154\151\163\164\x76\145\156\x64\x20\127\x48\105\122\105\x20\x63\157\144\x69\147\157\75\141\x2e\x76\145\156\x64\x65\144\157\x72\40\x4c\x49\x4d\x49\x54\40\61\x29\40\166\x65\156\x64\145\x64\x6f\x72\54\x61\x2e\144\157\143\x75\155\145\x6e\164\157\54\xa\40\x20\x20\x20\x20\40\40\40\141\56\x66\145\x63\150\141\x63\x72\x65\x61\x2c\141\56\162\x65\x63\x65\160\x63\151\x6f\156\54\x44\x41\x54\x45\137\x41\x44\x44\50\141\x2e\162\145\143\x65\x70\143\x69\157\x6e\x2c\x49\116\x54\105\x52\126\x41\x4c\x20\141\x2e\x64\x69\x61\x73\x63\x72\x65\x64\40\104\x41\131\51\x20\x76\x65\x6e\x63\145\54\x61\56\143\x6f\144\143\x6c\151\145\x6e\x74\x65\x2c\x61\56\156\157\x6d\142\162\x65\x63\x6c\151\x2c\122\117\125\x4e\104\x28\x61\x2e\x74\157\x74\141\154\144\54\x32\51\40\x74\x6f\164\x61\x6c\x64\x2c\xa\x20\x20\x20\x20\40\40\40\x20\x49\106\x28\50\x53\x45\114\105\103\x54\40\123\x55\115\50\155\157\x6e\x74\x6f\x64\51\40\x46\x52\117\x4d\40\x6f\x70\145\x72\143\x6c\151\x20\x57\x48\x45\x52\105\40\151\x64\x66\141\x63\x3d\x61\x2e\x64\157\x63\165\x6d\x65\x6e\164\x6f\51\x3e\x30\54\50\123\x45\114\x45\x43\x54\x20\x53\125\115\x28\x6d\x6f\156\164\157\x64\x29\40\x46\x52\x4f\115\40\157\160\145\x72\143\x6c\x69\40\127\110\105\122\105\40\151\144\x66\x61\143\75\141\x2e\144\x6f\x63\x75\155\145\x6e\x74\157\x29\x2c\x30\51\x20\x70\141\147\141\x64\x6f\x2c\xa\40\40\40\x20\x20\40\40\x20\111\106\x28\50\x53\x45\x4c\x45\103\x54\40\x53\125\115\x28\x74\157\x74\x61\x6c\x64\51\40\106\x52\x4f\x4d\40\141\160\154\151\x63\141\156\x63\x20\127\110\105\122\105\x20\x66\x61\143\75\x61\x2e\144\157\x63\165\x6d\145\x6e\164\157\x29\x3e\x30\54\50\x53\105\x4c\x45\103\x54\x20\123\125\x4d\x28\164\x6f\164\141\154\x64\51\40\106\122\x4f\x4d\x20\141\160\x6c\x69\143\141\x6e\x63\x20\127\110\x45\122\x45\40\146\x61\143\75\141\56\x64\157\x63\x75\155\x65\x6e\164\157\51\54\60\51\40\x6e\x63\x2c\xa\40\x20\40\x20\40\x20\x20\40\111\x46\50\x28\x53\x45\x4c\x45\103\124\x20\164\157\x74\x61\154\x66\151\156\141\x6c\40\x46\122\117\x4d\x20\157\160\x65\162\x74\151\x20\x57\110\x45\x52\105\x20\x74\151\x70\x6f\x64\x6f\143\x3d\x27\122\105\x54\x27\x20\x26\46\40\x72\x65\x66\x65\x72\x65\x6e\x63\x69\x61\x3d\103\x4f\x4e\103\101\124\50\x61\56\x74\x69\160\x6f\144\x6f\143\x2c\141\x2e\x64\x6f\143\165\155\145\x6e\164\x6f\51\51\76\x30\x2c\x28\x53\105\x4c\x45\103\124\40\164\157\x74\x61\154\x66\151\156\x61\x6c\40\106\122\117\115\x20\157\x70\x65\162\164\151\x20\x57\110\x45\x52\105\x20\x74\x69\x70\157\x64\157\143\x3d\47\x52\105\124\47\x20\x26\46\40\162\x65\x66\x65\x72\145\x6e\143\x69\x61\x3d\103\117\116\103\x41\x54\50\141\x2e\x74\x69\160\x6f\x64\x6f\x63\54\141\56\x64\x6f\143\165\x6d\x65\x6e\164\x6f\x29\51\x2c\60\51\x20\162\145\x74\x2c\12\x20\40\x20\x20\40\x20\x20\x20\x28\x53\105\114\105\x43\124\40\157\x66\151\x63\x69\141\x6c\x20\x46\x52\x4f\x4d\x20\155\x6f\x6e\145\x63\x61\155\x20\x57\110\105\x52\x45\x20\146\145\143\150\141\x3c\75\x61\x2e\x66\145\x63\x68\x61\x63\x72\145\x61\x20\x4f\x52\104\105\122\40\102\x59\40\146\x65\143\150\141\40\x44\x45\123\103\x20\114\x49\115\111\124\40\x31\51\40\x74\x61\163\x61\12\40\x20\x20\40\40\40\x20\40\x46\122\117\x4d\40\x6f\x70\145\x72\164\x69\x20\141\40\x57\x48\x45\x52\105\x20\x28\141\x2e\164\151\160\x6f\144\x6f\x63\75\47\x46\101\103\47\x20\x7c\x7c\40\141\56\x74\x69\160\157\x64\157\x63\x3d\47\x4e\x4f\x54\x27\x29\x20\x26\x26\40\x64\141\164\x65\x64\151\x66\146\50\104\101\x54\105\x5f\x41\104\x44\x28\x61\x2e\162\x65\143\145\160\143\x69\x6f\x6e\54\111\116\124\105\122\x56\x41\x4c\40\x61\x2e\x64\x69\141\x73\x63\x72\x65\144\x20\x44\101\131\51\x2c\x43\x55\x52\x44\101\x54\x45\x28\51\x29\75\47{$cod}\47\x20\46\x26\x20\x61\x2e\164\x6f\x74\141\154\144\76\x30\x20\x26\46\x20\x61\56\x65\163\164\141\x74\x75\x73\144\157\143\x21\75\47\130\x27\51\x20\144\x65\x75\144\141\x73\146\141\x63"); } if ($tip == 2) { $sql = $this->db->query("\x53\x45\114\x45\103\124\40\172\157\156\x61\x2c\166\145\x6e\x64\x65\144\x6f\x72\x2c\144\157\x63\165\155\x65\156\164\x6f\x2c\146\x65\143\x68\141\x63\x72\145\x61\54\x72\145\x63\145\x70\x63\x69\x6f\156\x2c\x76\145\156\x63\145\x2c\x63\157\144\x63\x6c\x69\x65\x6e\164\x65\x2c\x6e\157\x6d\142\x72\x65\x63\x6c\151\54\x74\157\x74\141\x6c\x64\x2c\122\117\x55\x4e\104\50\160\141\x67\x61\144\x6f\x2b\x6e\143\53\x28\x72\x65\x74\57\164\x61\x73\141\51\54\x32\51\x20\160\141\x67\141\x64\x6f\x2c\x49\x46\50\x28\x74\x6f\x74\141\154\x64\55\60\x2e\x35\51\76\111\x46\x28\160\x61\x67\x61\x64\x6f\x2b\156\143\53\50\x72\x65\164\57\164\x61\x73\141\51\x3e\x30\x2c\x70\x61\147\141\x64\x6f\x2b\x6e\x63\x2b\50\x72\145\164\57\164\x61\163\141\x29\x2c\60\x29\x2c\47\74\x62\x20\143\x6c\x61\163\163\x3d\42\x77\63\55\x72\x65\x64\42\76\x4d\x41\x4c\x3c\x2f\142\x3e\47\x2c\x27\74\142\x20\x63\x6c\x61\x73\163\x3d\42\167\x33\55\x67\162\145\145\156\x22\76\x42\111\105\116\x3c\57\142\x3e\x27\x29\40\x73\x74\141\164\x75\163\40\x46\x52\x4f\x4d\xa\40\40\x20\x20\40\x20\x20\40\50\x53\x45\x4c\105\103\124\40\x28\x53\105\114\x45\x43\x54\40\x73\165\142\x73\145\x63\x74\157\x72\x20\106\122\x4f\115\40\x73\x75\142\163\145\x63\x74\157\162\x65\x73\40\x57\x48\105\122\105\40\x63\x6f\x64\x69\x67\x6f\x3d\141\56\163\145\x63\x74\x6f\162\x20\46\46\40\x73\x75\x62\143\157\x64\x69\147\157\75\141\56\x73\x75\142\x63\157\144\x69\x67\157\51\40\x7a\157\156\141\x2c\50\x53\105\114\105\103\124\40\x6e\x6f\x6d\x62\x72\145\x20\x46\122\x4f\x4d\40\x6c\151\163\x74\x76\x65\156\x64\40\127\110\105\x52\105\40\143\157\144\151\x67\x6f\75\x61\56\x76\x65\156\x64\x65\x64\157\x72\40\114\x49\x4d\111\x54\x20\61\51\x20\x76\x65\156\144\x65\144\x6f\162\54\141\56\x64\x6f\143\165\155\x65\156\164\157\54\12\x20\x20\x20\x20\x20\40\x20\40\141\x2e\x66\x65\x63\150\141\x63\162\x65\141\x2c\x61\56\162\x65\x63\x65\x70\143\151\x6f\156\54\104\101\x54\x45\137\x41\104\104\50\141\x2e\x72\x65\x63\x65\160\143\x69\157\x6e\x2c\x49\116\x54\x45\x52\126\101\x4c\40\x61\56\144\151\x61\163\143\162\145\144\x20\104\101\x59\x29\x20\166\145\x6e\x63\145\54\x61\56\x63\x6f\144\x63\154\x69\145\156\x74\x65\54\141\x2e\x6e\157\x6d\x62\x72\x65\143\x6c\x69\54\122\117\125\x4e\104\50\x61\56\x74\157\164\x61\x6c\x64\x2c\x32\51\x20\x74\157\164\x61\154\144\x2c\xa\40\40\40\x20\40\40\40\40\x49\106\50\50\123\105\114\x45\x43\x54\40\x53\125\x4d\50\155\x6f\156\164\157\144\x29\x20\x46\x52\117\x4d\x20\x6f\160\x65\162\x63\x6c\151\40\127\x48\x45\122\105\40\151\x64\146\141\x63\75\x61\56\144\x6f\143\165\x6d\145\x6e\164\x6f\51\x3e\x30\54\50\123\x45\114\105\x43\124\x20\x53\x55\x4d\50\155\157\x6e\x74\157\144\51\x20\106\x52\117\x4d\x20\157\x70\145\162\x63\x6c\151\40\127\110\x45\122\105\40\151\144\x66\x61\x63\75\141\56\x64\157\143\x75\155\145\156\x74\x6f\x29\54\60\x29\40\x70\x61\x67\141\144\157\x2c\12\x20\x20\x20\x20\x20\40\40\40\111\106\x28\x28\123\105\x4c\x45\103\124\40\123\125\115\x28\164\157\x74\x61\154\144\x29\x20\106\122\x4f\115\40\x61\160\x6c\151\x63\141\156\143\40\127\x48\105\x52\x45\x20\146\141\143\75\141\56\x64\x6f\143\165\x6d\x65\156\164\157\x29\x3e\60\x2c\50\x53\105\114\105\x43\124\x20\123\125\115\x28\x74\x6f\x74\141\154\x64\51\x20\106\x52\x4f\115\x20\x61\160\154\x69\143\x61\156\x63\40\x57\110\105\x52\105\x20\146\x61\x63\75\x61\56\144\157\143\165\x6d\x65\156\x74\x6f\x29\x2c\x30\x29\40\156\x63\54\12\x20\x20\40\x20\40\x20\40\x20\x49\x46\50\50\123\105\x4c\x45\103\x54\x20\164\157\x74\x61\154\x66\151\156\141\x6c\x20\106\x52\x4f\x4d\x20\157\x70\145\x72\x74\151\x20\127\110\x45\122\105\40\x74\x69\160\157\144\157\x63\75\x27\x52\105\x54\47\x20\46\x26\40\x72\145\x66\145\x72\x65\156\x63\151\141\x3d\x43\117\x4e\103\x41\124\50\x61\56\x74\151\160\157\x64\157\143\x2c\141\x2e\144\157\x63\x75\x6d\x65\x6e\164\x6f\x29\x29\x3e\x30\54\50\123\105\114\105\103\124\40\164\x6f\164\141\154\146\x69\156\141\x6c\40\x46\x52\x4f\x4d\x20\x6f\160\x65\x72\164\x69\x20\127\x48\105\122\105\40\x74\x69\x70\x6f\x64\157\143\x3d\47\122\105\x54\47\40\x26\46\40\x72\145\x66\x65\x72\145\156\143\x69\141\75\103\117\x4e\x43\x41\124\50\x61\x2e\x74\151\x70\157\x64\157\143\x2c\x61\x2e\x64\x6f\143\165\x6d\x65\156\x74\157\x29\x29\54\x30\51\40\162\x65\164\x2c\xa\x20\x20\x20\40\40\40\x20\40\50\x53\105\114\x45\x43\124\x20\x6f\146\151\143\151\x61\x6c\x20\106\x52\x4f\x4d\40\x6d\157\156\x65\x63\x61\x6d\40\x57\110\105\x52\x45\x20\x66\x65\x63\x68\x61\x3c\75\x61\56\x66\x65\x63\150\x61\x63\x72\145\x61\40\x4f\122\104\x45\x52\x20\x42\x59\x20\x66\145\143\150\141\40\x44\105\123\x43\x20\x4c\111\115\111\124\x20\x31\x29\x20\164\x61\x73\x61\40\xa\x20\x20\40\x20\40\40\40\x20\106\122\x4f\x4d\40\157\160\145\162\164\x69\x20\x61\40\x57\x48\x45\122\105\x20\x28\141\x2e\164\151\160\157\x64\x6f\x63\75\x27\x46\x41\103\x27\40\x7c\174\x20\141\x2e\x74\151\160\157\x64\157\x63\75\x27\116\x4f\x54\x27\51\40\46\x26\40\x43\x4f\x4e\103\101\x54\50\x61\56\163\x65\143\x74\157\162\54\x61\x2e\x73\165\142\143\x6f\144\x69\147\x6f\51\x3d\x27{$cod}\47\40\46\46\x20\x61\x2e\x74\x6f\x74\141\154\x64\76\x30\40\x26\x26\40\141\x2e\x65\163\x74\141\x74\165\x73\144\157\143\x21\x3d\47\130\47\x29\40\144\145\x75\x64\x61\163\146\141\x63"); } if ($tip == 3) { $sql = $this->db->query("\123\105\x4c\x45\x43\x54\x20\172\x6f\x6e\141\x2c\166\145\x6e\x64\145\144\157\162\x2c\x64\x6f\143\x75\x6d\145\x6e\164\x6f\54\x66\145\x63\150\141\143\162\x65\141\x2c\162\145\143\145\x70\x63\x69\157\156\x2c\166\145\156\x63\145\54\143\x6f\144\143\x6c\x69\145\156\164\145\x2c\x6e\157\155\x62\x72\x65\143\x6c\151\x2c\164\x6f\164\x61\x6c\x64\54\122\x4f\x55\x4e\x44\x28\160\x61\147\x61\x64\157\x2b\156\143\53\50\x72\145\164\57\164\x61\x73\141\x29\x2c\62\51\x20\160\x61\147\x61\x64\x6f\54\x49\x46\x28\x28\x74\x6f\x74\x61\x6c\144\x2d\x30\56\65\x29\x3e\111\106\x28\160\x61\147\x61\144\157\53\x6e\143\x2b\x28\162\x65\x74\x2f\164\141\163\x61\51\x3e\x30\x2c\x70\141\x67\x61\144\x6f\x2b\x6e\x63\53\x28\x72\x65\164\x2f\x74\141\x73\x61\x29\x2c\60\x29\x2c\x27\74\x62\40\x63\x6c\141\x73\163\75\x22\167\x33\55\162\145\144\42\76\x4d\x41\x4c\x3c\x2f\x62\76\x27\x2c\x27\x3c\x62\x20\x63\154\141\163\163\75\x22\167\63\x2d\147\x72\145\145\156\42\x3e\x42\x49\x45\x4e\x3c\x2f\142\x3e\x27\x29\40\163\164\141\x74\x75\x73\x20\106\x52\x4f\115\12\40\40\40\40\40\x20\40\40\x28\x53\x45\x4c\x45\103\x54\x20\50\x53\105\114\x45\x43\124\40\163\165\142\x73\x65\x63\164\157\x72\x20\x46\122\117\115\x20\163\165\x62\x73\145\x63\x74\x6f\x72\145\x73\40\127\x48\105\122\105\40\143\x6f\x64\x69\147\157\75\x61\56\x73\x65\143\x74\157\162\40\x26\46\40\163\165\142\143\x6f\x64\x69\x67\157\75\x61\56\x73\165\x62\x63\157\144\x69\x67\x6f\x29\x20\x7a\157\156\x61\x2c\x28\123\105\114\105\103\124\x20\x6e\x6f\155\142\x72\x65\40\106\x52\117\115\40\154\x69\x73\x74\x76\145\x6e\x64\x20\x57\110\105\x52\x45\40\143\157\144\151\147\157\75\141\x2e\166\145\x6e\x64\145\x64\157\x72\40\114\x49\x4d\111\x54\x20\61\51\x20\166\x65\x6e\144\145\144\x6f\x72\x2c\x61\56\144\157\x63\x75\155\145\156\x74\x6f\x2c\12\40\x20\40\40\x20\40\40\x20\x61\x2e\146\x65\x63\150\x61\143\162\145\141\54\141\56\x72\145\143\x65\x70\x63\x69\157\156\x2c\x44\x41\x54\x45\x5f\x41\x44\104\50\141\56\162\145\143\145\x70\x63\151\x6f\156\54\x49\116\x54\x45\x52\126\101\114\40\141\x2e\144\x69\x61\x73\143\162\145\144\x20\104\x41\x59\51\x20\166\x65\156\x63\x65\x2c\x61\x2e\x63\157\144\x63\x6c\x69\145\x6e\x74\x65\x2c\x61\x2e\x6e\x6f\x6d\142\x72\145\x63\x6c\151\54\122\x4f\125\x4e\x44\x28\x61\56\164\x6f\x74\x61\154\x64\x2c\x32\51\40\x74\157\164\141\x6c\x64\x2c\xa\x20\x20\40\40\x20\40\40\x20\111\x46\50\x28\123\x45\114\105\x43\124\40\123\125\x4d\50\x6d\x6f\156\x74\157\x64\51\40\x46\122\117\115\x20\157\160\x65\x72\x63\154\x69\40\127\x48\x45\122\105\40\151\144\146\141\x63\75\x61\x2e\x64\x6f\x63\x75\155\x65\156\164\157\x29\x3e\x30\x2c\50\123\x45\114\105\x43\124\40\123\x55\x4d\x28\x6d\x6f\156\x74\x6f\x64\x29\40\106\x52\x4f\115\x20\x6f\160\145\162\x63\x6c\x69\x20\x57\x48\x45\122\105\40\151\x64\x66\141\143\75\x61\56\144\x6f\x63\165\155\x65\156\164\x6f\51\54\x30\51\x20\x70\141\x67\x61\144\x6f\54\12\x20\40\40\x20\x20\40\x20\x20\111\x46\x28\x28\123\105\x4c\x45\103\124\x20\x53\x55\x4d\x28\x74\x6f\164\x61\154\144\x29\x20\x46\122\117\115\40\141\x70\x6c\151\143\141\x6e\x63\x20\x57\x48\105\x52\105\40\146\141\143\x3d\x61\56\144\157\143\165\x6d\x65\x6e\164\x6f\x29\76\x30\x2c\x28\123\x45\x4c\105\103\124\x20\123\x55\x4d\50\x74\x6f\164\141\x6c\144\x29\40\x46\x52\117\x4d\40\x61\160\154\x69\143\141\156\143\x20\x57\110\105\122\105\40\x66\141\143\75\x61\x2e\x64\157\x63\165\155\x65\156\164\x6f\51\54\x30\51\40\x6e\143\x2c\xa\x20\40\40\x20\x20\40\40\40\111\x46\x28\x28\x53\x45\x4c\105\x43\124\x20\x74\x6f\164\x61\x6c\146\151\156\x61\154\40\x46\122\x4f\x4d\x20\157\x70\x65\162\x74\151\40\127\110\105\122\x45\40\164\151\160\157\x64\x6f\143\x3d\x27\122\105\124\x27\40\x26\x26\x20\162\145\x66\145\x72\145\x6e\143\x69\141\x3d\x43\x4f\x4e\103\101\x54\x28\x61\56\164\151\160\157\144\157\143\x2c\141\x2e\x64\157\143\165\155\145\156\164\x6f\x29\51\x3e\60\54\x28\x53\x45\x4c\105\x43\124\x20\x74\x6f\164\x61\154\146\151\156\141\154\x20\106\x52\x4f\x4d\40\157\x70\x65\162\x74\x69\40\127\110\105\x52\105\x20\x74\151\160\x6f\x64\x6f\x63\x3d\x27\x52\105\124\47\x20\x26\x26\x20\x72\145\x66\145\162\x65\156\143\151\x61\x3d\103\x4f\x4e\103\x41\x54\x28\141\56\x74\x69\160\157\x64\157\x63\x2c\141\x2e\x64\x6f\143\x75\155\145\156\164\x6f\51\51\x2c\60\x29\40\162\x65\x74\x2c\12\x20\40\x20\40\40\40\40\40\50\123\105\x4c\105\x43\124\40\157\146\x69\143\151\141\154\x20\106\122\x4f\115\40\155\157\x6e\145\x63\141\155\x20\x57\x48\105\x52\x45\40\146\x65\x63\150\141\74\75\x61\x2e\x66\145\143\150\141\143\162\145\x61\x20\x4f\x52\104\x45\122\40\x42\131\40\x66\x65\x63\x68\x61\x20\104\105\123\x43\40\114\x49\115\x49\124\x20\x31\51\40\x74\141\x73\x61\12\40\x20\x20\x20\40\40\x20\40\40\x46\x52\117\115\40\157\x70\145\162\x74\151\x20\141\40\x57\x48\x45\x52\x45\x20\x28\x61\x2e\x74\151\x70\x6f\x64\x6f\x63\75\x27\x46\101\103\x27\x20\174\174\x20\x61\56\164\x69\160\x6f\x64\x6f\143\x3d\x27\116\x4f\124\x27\51\x20\46\x26\40\x43\117\116\x43\x41\124\50\115\x4f\x4e\124\110\x28\x66\x65\x63\150\x61\x63\162\145\141\x29\54\47\x2d\47\x2c\131\105\101\122\50\146\x65\x63\150\x61\x63\162\x65\x61\x29\51\x3d\47{$cod}\x27\x20\46\x26\x20\x61\x2e\x74\157\164\x61\154\x64\x3e\60\40\x26\46\40\141\x2e\x65\163\164\x61\164\165\x73\x64\x6f\x63\x21\75\47\x58\x27\x29\x20\x64\145\x75\144\x61\x73\x66\x61\143"); } return $sql; } function stylepdf() { return "\12\40\x20\40\x20\74\x73\x74\x79\154\x65\x3e\12\x2f\52\52\x20\104\x65\x66\x69\x6e\145\40\x6e\x6f\167\x20\164\150\x65\40\162\x65\141\154\x20\x6d\x61\162\147\151\x6e\x73\x20\x6f\146\40\145\x76\145\162\171\40\x70\x61\x67\x65\x20\151\x6e\x20\164\x68\145\x20\x50\104\106\40\x2a\52\57\12\142\157\x64\x79\40\x7b\xa\40\x20\x20\x20\x6d\x61\x72\147\x69\x6e\x2d\x74\157\x70\x3a\x20\64\x63\x6d\x3b\12\40\x20\x20\40\x6d\x61\x72\x67\x69\x6e\55\154\x65\x66\x74\72\x20\61\x63\155\73\12\x20\x20\x20\40\x6d\x61\162\x67\x69\156\55\162\151\x67\x68\164\72\40\x32\143\155\x3b\xa\40\x20\40\40\x6d\x61\x72\x67\151\x6e\x2d\142\157\x74\x74\157\155\72\40\x32\x63\x6d\73\12\175\xa\xa\57\x2a\52\x20\104\145\146\x69\156\x65\x20\164\x68\145\x20\x68\145\141\144\145\162\x20\162\x75\154\145\x73\40\52\52\57\xa\x68\145\141\144\x65\x72\40\x7b\12\40\40\40\40\160\x6f\163\151\x74\x69\x6f\x6e\x3a\x20\x66\x69\170\x65\x64\x3b\12\x20\40\40\x20\164\x6f\x70\x3a\40\60\143\x6d\73\12\x20\40\40\40\x6c\x65\x66\x74\72\40\x30\x63\155\73\12\x20\x20\x20\x20\162\151\147\150\x74\x3a\x20\60\143\155\x3b\12\x20\x20\x20\x20\x68\145\151\x67\150\164\72\40\x32\143\x6d\x3b\12\40\x20\40\x20\x2f\52\x2a\40\x45\170\164\162\141\x20\160\145\x72\163\x6f\x6e\x61\154\40\163\x74\171\x6c\145\x73\40\x2a\x2a\x2f\xa\40\x20\40\40\x62\141\143\153\147\x72\x6f\165\156\x64\55\143\x6f\154\157\x72\x3a\x20\43\x65\141\x65\x61\145\141\x3b\xa\x20\40\x20\x20\x63\x6f\154\x6f\162\x3a\x20\142\154\x61\x63\153\x3b\xa\x20\x20\40\x20\x74\x65\170\x74\55\141\154\x69\147\x6e\x3a\40\x63\x65\x6e\164\x65\162\73\12\40\x20\x20\x20\154\x69\x6e\x65\x2d\150\x65\151\x67\150\x74\72\x20\61\56\x35\x63\x6d\x3b\xa\x7d\xa\xa\x2f\52\x2a\40\104\145\x66\151\156\x65\x20\x74\x68\145\x20\146\157\x6f\x74\145\x72\40\162\165\154\x65\x73\40\x2a\x2a\57\12\x66\157\x6f\x74\x65\162\x20\173\12\40\40\x20\x20\160\x6f\163\151\164\151\x6f\156\72\x20\x66\151\170\x65\144\73\12\40\x20\x20\x20\142\x6f\164\x74\157\x6d\x3a\40\x30\x63\155\73\xa\x20\40\x20\x20\154\x65\146\x74\72\x20\60\x63\155\73\12\x20\x20\40\40\162\151\x67\x68\x74\x3a\x20\x30\x63\x6d\73\12\x20\40\40\40\150\x65\151\147\x68\x74\72\x20\62\143\155\73\xa\12\40\x20\40\x20\57\52\x2a\40\x45\170\x74\x72\x61\40\160\145\x72\163\x6f\x6e\x61\154\40\x73\x74\x79\x6c\x65\x73\40\52\x2a\57\12\x20\40\40\x20\x62\141\143\153\x67\x72\157\165\x6e\x64\x2d\143\x6f\154\157\162\72\x20\x23\145\x61\x65\141\x65\x61\73\12\x20\x20\x20\40\143\157\x6c\157\x72\72\40\x62\154\141\x63\x6b\x3b\xa\40\40\x20\x20\164\x65\170\164\55\141\x6c\151\147\156\72\40\x63\145\x6e\x74\145\162\x3b\12\40\x20\40\x20\x6c\x69\x6e\x65\x2d\x68\145\151\x67\150\164\72\x20\61\x2e\65\x63\155\73\12\x7d\xa\x66\157\157\164\145\162\40\x2e\160\141\x67\x65\156\165\155\72\142\x65\x66\157\162\x65\x20\x7b\12\40\40\40\40\x63\x6f\x6e\164\x65\156\164\x3a\40\143\157\x75\x6e\x74\145\x72\50\x70\141\x67\x65\x29\x3b\xa\175\xa\x3c\x2f\x73\x74\x79\154\x65\x3e\12\40\40\x20\40"; } function catalogoalm() { $style = $this->stylepdf(); $bd = $this->db->query("\123\105\x4c\x45\x43\124\x20\x61\56\x72\x75\164\141\x66\x6f\x74\157\54\x61\x2e\x63\157\x64\x69\147\157\x2c\x61\56\x6e\x6f\155\x62\x72\145\54\141\56\155\x61\x72\143\141\x2c\x52\117\125\x4e\104\x28\x61\56\x70\162\145\x63\151\x6f\x66\x69\x6e\61\54\x32\x29\40\160\162\x65\x63\151\157\x62\x73\54\x20\x52\x4f\x55\116\104\50\141\56\160\x72\x65\143\151\157\146\151\156\x31\x2f\50\123\105\114\105\x43\124\40\157\146\x69\x63\151\x61\x6c\x20\106\x52\x4f\x4d\x20\155\x6f\x6e\x65\x63\141\155\x20\x4f\x52\104\x45\x52\40\102\x59\x20\146\x65\143\x68\x61\x20\104\x45\123\103\x20\114\x49\115\x49\x54\x20\x31\x29\x2c\62\x29\40\160\x72\145\143\151\x6f\144\x2c\xa\x20\x20\40\x20\x52\117\x55\116\x44\50\x61\56\145\170\x69\163\x74\x65\x6e\x63\x69\141\x2d\x61\x2e\x63\157\x6d\160\x72\x6f\x6d\x65\164\151\144\x6f\x29\x20\145\x78\151\163\x74\40\x46\x52\x4f\115\x20\141\x72\164\x69\143\165\x6c\x6f\40\x61\40\x57\x48\x45\122\x45\x20\x28\x61\56\x65\170\151\x73\164\145\156\143\x69\141\55\141\56\x63\x6f\155\160\x72\x6f\155\145\x74\151\x64\x6f\x29\76\x30\40\x26\x26\x20\x61\56\x70\141\x72\141\x5f\x77\x65\142\75\x27\x31\x27\x20\x26\x26\x20\123\125\102\123\124\122\50\141\56\143\157\x64\x69\147\x6f\x2c\61\x2c\x33\x29\x3d\x27\101\114\115\47\40\46\x26\x20\141\x2e\x72\x75\x74\141\146\x6f\164\x6f\x21\75\47\47\x20\x4f\122\x44\105\x52\40\x42\131\40\141\56\x6e\x6f\155\x62\x72\145\x20\101\x53\103"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "\74\164\x72\x3e"; } $table .= "\x3c\x74\144\76\74\x6c\x61\142\145\x6c\40\x63\154\x61\163\163\75\x22\167\x33\x2d\x6d\145\x64\151\165\155\x22\76\74\151\155\147\x20\x73\x72\x63\75\42\x69\155\x61\147\x65\163\57" . $dt->rutafoto . "\x22\40\x61\x6c\x74\75\x22\x69\155\x67\137" . $dt->codigo . "\42\x20\x73\164\x79\154\145\x3d\42\167\151\x64\x74\x68\x3a\x32\62\60\160\170\x3b\x68\x65\x69\147\150\164\x3a\x32\62\60\160\x78\x22\x3e\x3c\x62\162\76\x3c\x62\x3e" . $dt->codigo . "\x3c\x2f\x62\76\x20\x3c\142\76\116\117\115\x42\x52\x45\x3a\40\x3c\57\x62\x3e\40" . $dt->nombre . "\12\x20\x20\40\40\40\40\x20\40\x20\40\x20\40\74\142\x3e\115\101\x52\103\101\72\x20\x3c\x2f\x62\x3e" . $dt->marca . "\40\x3c\142\x3e\x50\x52\x45\103\111\117\40\102\163\72\40\x3c\57\142\76" . $dt->preciobs . "\x20\x3c\142\76\120\x52\x45\x43\x49\117\40\44\x3a\x20\x3c\57\x62\x3e" . $dt->preciod . "\40\x3c\142\x3e\x45\130\x49\x53\x54\x3a\40\74\x2f\x62\x3e" . $dt->exist . "\x3c\57\154\x61\x62\x65\154\76\x3c\x2f\164\144\x3e"; if ($i == 3) { $table .= "\74\x2f\x74\x72\76"; $i = 0; } } } $html = "\12\x20\x20\x20\40\74\x68\x74\155\x6c\76\x3c\150\x65\x61\144\76\x3c\155\x65\x74\141\40\x63\150\x61\162\163\x65\164\75\x22\x55\x54\x46\55\70\x22\x3e\x3c\x6d\145\164\x61\40\x68\x74\164\x70\x2d\145\x71\165\x69\166\x3d\x22\x58\55\125\101\55\x43\x6f\155\x70\141\164\x69\142\x6c\x65\42\40\x63\157\156\x74\x65\156\164\x3d\42\111\x45\75\145\144\147\145\42\76\12\x20\x20\40\x20\x3c\155\x65\x74\141\x20\156\x61\x6d\x65\x3d\x22\166\x69\145\167\x70\157\162\164\42\x20\x63\x6f\x6e\164\145\156\164\x3d\x22\167\x69\144\164\x68\75\x64\145\166\x69\x63\145\55\x77\x69\x64\164\x68\x2c\40\x69\156\151\164\x69\x61\154\55\163\x63\141\x6c\x65\75\61\56\60\x22\x3e\12\40\40\x20\40\x3c\154\x69\x6e\x6b\40\x72\145\x6c\75\x22\163\164\171\x6c\145\x73\x68\x65\145\164\x22\40\x68\162\145\146\75\x22\141\x73\x73\145\164\x73\57\143\163\163\x2f\167\63\x2e\x63\x73\163\42\76" . $style . "\xa\40\x20\40\40\74\57\x68\x65\x61\144\x3e\x3c\x62\x6f\x64\x79\76\xa\40\40\40\40\x3c\150\145\x61\144\145\x72\76\x3c\x69\x6d\x67\40\x73\x72\x63\x3d\x22\151\x6d\x61\x67\x65\x73\57\x63\x69\156\164\151\154\x6c\x6f\56\x6a\160\147\42\x20\x61\154\164\x3d\42\x48\x65\x61\144\x65\x72\42\40\x73\164\171\x6c\145\x3d\x22\x77\151\144\x74\x68\x3a\x31\x30\x30\45\73\42\x3e\74\57\x68\x65\x61\x64\145\x72\76\74\142\x72\x3e\xa\40\40\x20\40\x3c\x74\141\x62\x6c\145\40\x63\154\141\x73\x73\x3d\42\167\x33\55\164\141\x62\x6c\x65\x22\76\12\x20\40\40\40" . $table . "\xa\40\40\x20\x20\74\57\164\141\142\154\x65\x3e\12\x20\x20\x20\x20\74\x66\x6f\157\x74\x65\x72\x3e\12\40\x20\x20\x20\74\144\151\x76\x20\x63\x6c\141\x73\x73\75\x22\160\x61\x67\145\x6e\165\155\x2d\143\157\x6e\x74\141\151\156\x65\162\x22\76\120\141\147\x65\40\74\163\x70\x61\x6e\40\143\154\141\x73\163\x3d\x22\160\x61\x67\145\x6e\x75\155\42\76\74\57\163\160\x61\x6e\76\x3c\57\144\x69\166\x3e\12\40\40\40\x20\74\x2f\146\157\x6f\x74\145\x72\76\xa\40\x20\40\40\74\155\141\x69\156\76\12\x20\40\x20\40\40\40\40\x20\x3c\x64\x69\166\x3e\x4d\x61\x69\x6e\40\x63\157\156\164\x65\x6e\164\x20\x67\x6f\x65\x73\x20\150\x65\x72\145\x20\74\x2f\x64\x69\x76\76\12\40\x20\x20\40\74\57\x6d\141\151\x6e\x3e\12\x20\x20\40\x20\x3c\57\142\x6f\144\x79\76\x3c\57\150\x74\x6d\154\76"; return $html; } function catalogonovex() { $style = $this->stylepdf(); $bd = $this->db->query("\123\105\x4c\105\x43\124\40\141\x2e\x72\x75\164\x61\146\157\164\x6f\x2c\141\56\x63\157\144\151\147\x6f\54\x61\56\156\157\x6d\142\x72\145\54\x61\56\155\x61\162\143\x61\54\x52\117\125\x4e\x44\50\141\56\x70\x72\145\x63\151\x6f\x66\151\156\61\54\x32\51\x20\x70\162\x65\143\x69\157\x62\x73\x2c\x20\122\117\125\x4e\x44\50\141\x2e\x70\162\145\x63\151\x6f\x66\x69\156\61\x2f\50\x53\x45\x4c\x45\x43\124\40\157\146\151\143\x69\141\x6c\x20\x46\x52\117\115\40\x6d\x6f\156\145\143\x61\x6d\x20\x4f\x52\104\105\x52\x20\102\x59\40\146\x65\x63\x68\141\x20\x44\105\x53\103\x20\114\x49\x4d\111\124\x20\61\51\54\62\51\x20\x70\162\x65\143\151\157\x64\x2c\12\x20\40\x20\40\x52\x4f\125\116\x44\50\x61\x2e\145\170\x69\x73\164\145\x6e\143\151\x61\x2d\x61\56\x63\x6f\x6d\160\x72\x6f\x6d\x65\164\x69\x64\157\51\40\x65\x78\151\x73\x74\40\x46\122\117\x4d\x20\141\x72\x74\151\143\165\x6c\157\40\x61\x20\112\x4f\111\116\x20\x61\162\x74\x69\x70\x72\x6f\x76\x20\142\x20\117\116\x20\141\x2e\143\157\x64\x69\147\157\75\142\x2e\x63\x6f\x64\151\x67\157\40\x57\x48\105\122\x45\40\x28\x61\56\145\x78\151\x73\164\x65\156\143\151\141\55\141\56\143\157\x6d\160\162\x6f\x6d\x65\x74\151\144\x6f\x29\76\x30\40\x26\x26\x20\141\x2e\x70\141\162\x61\x5f\167\145\x62\75\47\x31\47\40\46\46\x20\142\x2e\160\x72\157\x76\145\145\144\157\162\x20\x49\116\40\50\x30\x30\70\x38\54\60\62\63\x30\x29\x20\46\46\x20\x61\56\162\x75\164\141\x66\x6f\x74\x6f\x21\75\47\x27\x20\107\122\117\125\x50\40\x42\131\x20\x61\56\x63\x6f\144\151\x67\x6f\40\x4f\122\104\x45\x52\40\102\x59\x20\141\x2e\156\x6f\155\142\162\145\x20\101\123\x43"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "\x3c\x74\162\76"; } $table .= "\x3c\x74\x64\x3e\74\154\141\142\x65\154\x20\143\x6c\x61\163\x73\75\42\x77\x33\55\x6d\145\144\x69\x75\155\x22\76\74\x69\x6d\x67\x20\x73\162\x63\x3d\42\151\155\x61\x67\145\163\x2f" . $dt->rutafoto . "\x22\x20\141\x6c\x74\x3d\42\x69\155\x67\x5f" . $dt->codigo . "\42\40\163\x74\x79\x6c\x65\75\42\x77\x69\x64\x74\150\x3a\62\x32\60\x70\x78\x3b\150\145\x69\147\x68\x74\x3a\62\62\60\160\170\42\76\x3c\142\x72\x3e\x3c\142\x3e" . $dt->codigo . "\x3c\x2f\142\76\x20\74\x62\x3e\x4e\117\115\x42\x52\105\72\40\74\x2f\142\x3e\40" . $dt->nombre . "\xa\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\x3c\142\x3e\115\101\122\x43\x41\x3a\x20\74\x2f\142\x3e" . $dt->marca . "\x20\74\142\76\x50\x52\x45\103\111\x4f\40\102\x73\72\40\74\x2f\x62\x3e" . $dt->preciobs . "\40\74\x62\x3e\x50\122\x45\x43\111\x4f\x20\x24\x3a\40\74\57\142\76" . $dt->preciod . "\40\74\x62\x3e\x45\x58\111\123\124\x3a\x20\74\x2f\142\x3e" . $dt->exist . "\x3c\x2f\x6c\141\x62\x65\154\76\x3c\x2f\164\144\x3e"; if ($i == 3) { $table .= "\74\57\x74\162\76"; $i = 0; } } } $html = "\xa\40\40\x20\x20\x3c\x68\164\x6d\154\x3e\74\150\x65\x61\x64\x3e\74\x6d\145\164\141\40\x63\x68\141\x72\x73\x65\164\x3d\x22\125\124\x46\55\70\x22\x3e\74\x6d\x65\164\141\x20\x68\164\164\x70\55\145\161\x75\151\166\x3d\x22\x58\55\x55\x41\55\x43\157\155\160\x61\164\151\x62\x6c\145\42\40\143\x6f\x6e\164\145\156\164\x3d\42\111\105\75\x65\x64\x67\x65\x22\x3e\xa\x20\40\40\x20\74\155\x65\164\x61\40\x6e\141\x6d\x65\x3d\x22\x76\x69\x65\167\160\157\162\164\x22\40\143\157\x6e\164\x65\x6e\164\x3d\x22\x77\x69\x64\x74\x68\x3d\x64\145\x76\x69\x63\x65\55\x77\x69\x64\x74\150\54\40\x69\x6e\x69\164\151\x61\154\55\163\x63\x61\154\145\x3d\61\x2e\60\x22\x3e\xa\40\x20\x20\x20\x3c\154\151\156\153\40\x72\x65\x6c\75\x22\163\x74\171\x6c\145\163\x68\145\145\x74\x22\x20\x68\x72\x65\x66\75\x22\x61\x73\x73\145\x74\x73\x2f\143\163\x73\x2f\167\x33\56\143\163\163\x22\76" . $style . "\xa\40\x20\40\40\x3c\57\150\145\x61\144\76\74\x62\157\144\171\76\12\x20\40\x20\x20\74\150\x65\x61\144\x65\x72\x3e\74\151\x6d\x67\40\x73\162\x63\75\42\x69\155\x61\x67\145\x73\x2f\x63\151\156\x74\x69\x6c\x6c\x6f\x2e\x6a\160\147\x22\x20\x61\154\164\75\42\110\145\141\x64\x65\x72\x22\40\x73\x74\171\154\x65\x3d\42\x77\151\x64\x74\x68\72\x31\60\x30\x25\73\42\76\x3c\x2f\150\145\x61\x64\x65\x72\x3e\74\142\162\76\xa\x20\x20\x20\x20\74\164\x61\142\x6c\x65\40\x63\154\x61\x73\x73\75\42\x77\63\x2d\x74\x61\142\154\145\42\x3e\12\x20\40\40\40" . $table . "\12\x20\x20\x20\40\x3c\x2f\164\141\142\154\145\76\12\x20\40\x20\40\x20\x20\x20\40\x20\x3c\146\x6f\157\x74\145\162\x3e\xa\40\x20\x20\x20\40\x20\40\x20\x3c\144\x69\166\40\x63\x6c\141\x73\x73\75\42\160\x61\x67\x65\156\x75\155\55\x63\x6f\156\x74\141\151\x6e\x65\x72\42\x3e\120\141\147\145\40\74\x73\160\x61\156\x20\x63\154\x61\163\x73\x3d\42\x70\141\147\x65\x6e\165\x6d\42\76\x3c\x2f\x73\x70\x61\x6e\76\74\57\x64\x69\x76\76\12\x20\40\40\40\40\40\x20\40\x3c\57\146\157\157\164\145\x72\x3e\xa\x20\40\x20\x20\x20\40\40\x20\74\x6d\x61\151\x6e\x3e\12\40\40\40\x20\x20\40\40\40\40\x20\x20\40\74\144\151\x76\x3e\115\x61\x69\x6e\x20\143\157\156\164\145\x6e\164\x20\x67\157\x65\x73\x20\150\x65\162\x65\x20\74\x2f\144\151\166\x3e\xa\x20\40\40\x20\x20\x20\40\40\x3c\x2f\155\x61\151\x6e\76\xa\x20\40\x20\x20\74\x2f\x62\157\144\x79\x3e\74\x2f\x68\x74\155\154\x3e"; return $html; } function catalogoins() { $style = $this->stylepdf(); $bd = $this->db->query("\x53\x45\114\x45\103\124\x20\141\56\x72\165\x74\141\146\157\164\157\x2c\x61\56\143\x6f\144\151\x67\x6f\x2c\x61\x2e\156\157\155\x62\x72\x65\54\x61\56\155\141\x72\143\x61\x2c\x52\x4f\x55\x4e\x44\x28\x61\x2e\x70\x72\145\143\151\157\146\x69\x6e\61\54\x32\51\40\160\x72\x65\143\151\157\x62\x73\54\x20\122\x4f\125\116\104\x28\x61\x2e\x70\162\x65\143\x69\157\x66\151\x6e\61\x2f\50\123\105\x4c\x45\x43\x54\x20\157\146\x69\143\151\141\x6c\x20\106\122\x4f\115\x20\155\x6f\156\145\143\141\x6d\x20\117\x52\x44\x45\x52\40\102\x59\40\146\145\143\150\x61\40\104\105\x53\x43\x20\114\111\x4d\x49\x54\x20\x31\51\54\62\51\x20\160\x72\x65\143\151\157\144\x2c\xa\40\40\40\40\122\117\x55\x4e\104\x28\141\x2e\x65\170\x69\x73\x74\145\156\x63\151\141\55\141\x2e\143\157\155\160\x72\157\x6d\145\164\151\144\x6f\51\x20\x65\x78\151\163\x74\x20\x46\122\117\x4d\40\141\162\x74\151\x63\165\154\x6f\40\141\40\127\110\105\x52\105\40\50\141\x2e\x65\170\x69\163\164\x65\156\x63\x69\141\x2d\x61\56\x63\x6f\155\160\162\157\155\145\x74\151\x64\157\x29\x3e\60\x20\x26\46\x20\141\56\x70\141\162\x61\x5f\x77\x65\142\x3d\x27\61\47\x20\46\x26\40\x53\125\102\x53\x54\122\50\141\x2e\x63\157\x64\151\x67\157\54\x31\x2c\63\x29\75\47\111\x4e\x53\x27\40\x26\46\x20\141\x2e\x72\x75\164\x61\x66\x6f\164\157\x21\x3d\47\47\x20\117\x52\104\x45\x52\40\102\x59\40\141\56\x6e\157\155\x62\x72\x65\x20\x41\123\x43"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "\74\x74\162\76"; } $table .= "\74\164\x64\76\x3c\x6c\x61\142\145\x6c\40\143\154\x61\x73\x73\x3d\42\x77\63\x2d\x6d\x65\x64\151\165\x6d\x22\76\74\151\155\147\40\163\162\x63\75\42\151\155\x61\x67\x65\x73\57" . $dt->rutafoto . "\x22\x20\141\154\164\75\x22\151\155\x67\137" . $dt->codigo . "\x22\x20\163\x74\x79\x6c\145\75\42\x77\151\144\164\x68\x3a\x32\x32\60\160\x78\73\x68\145\x69\x67\x68\x74\72\x32\x32\60\x70\x78\42\x3e\x3c\142\162\76\74\x62\76\x3c\142\x3e" . $dt->codigo . "\x3c\x2f\x62\x3e\40\116\x4f\x4d\102\x52\x45\x3a\x20\74\x2f\142\x3e" . $dt->nombre . "\xa\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\74\x62\76\x4d\101\122\103\x41\x3a\x20\x3c\57\x62\x3e" . $dt->marca . "\40\74\142\76\120\x52\105\x43\111\x4f\x20\102\163\x3a\40\74\57\142\76" . $dt->preciobs . "\40\x3c\142\76\x50\x52\105\103\x49\x4f\x20\x24\x3a\x20\74\x2f\x62\x3e" . $dt->preciod . "\x20\74\142\76\x45\x58\111\x53\x54\x3a\40\x3c\x2f\142\x3e" . $dt->exist . "\x3c\x2f\x6c\x61\142\145\154\x3e\74\x2f\164\144\x3e"; if ($i == 3) { $table .= "\74\x2f\164\x72\76"; $i = 0; } } } $html = "\12\x20\x20\40\40\74\150\164\155\154\x3e\74\150\x65\141\x64\x3e\74\155\145\x74\141\x20\143\x68\x61\162\163\x65\x74\75\x22\x55\124\106\55\70\42\76\x3c\x6d\x65\164\141\x20\150\164\164\x70\55\x65\161\x75\x69\x76\x3d\x22\x58\55\x55\x41\x2d\x43\157\155\x70\141\x74\x69\x62\154\145\42\40\143\x6f\156\164\x65\156\x74\75\42\111\105\x3d\145\x64\x67\145\42\76\12\40\x20\40\40\x3c\155\145\x74\141\40\x6e\141\155\x65\x3d\x22\166\x69\x65\167\160\157\x72\164\42\40\143\x6f\156\x74\145\x6e\164\75\x22\167\x69\144\x74\150\x3d\x64\x65\166\x69\x63\145\55\167\x69\144\164\x68\x2c\x20\151\x6e\151\164\151\141\x6c\55\x73\143\x61\154\x65\x3d\61\x2e\x30\42\76\12\40\40\40\40\74\x6c\151\156\x6b\x20\x72\x65\154\x3d\42\x73\164\x79\x6c\145\x73\x68\145\145\x74\42\x20\x68\x72\x65\146\x3d\x22\141\163\x73\x65\x74\x73\x2f\x63\163\x73\57\x77\63\56\143\x73\x73\x22\76" . $style . "\12\x20\x20\x20\40\x3c\57\x68\x65\141\x64\x3e\x3c\142\157\x64\x79\x3e\12\x20\40\x20\x20\74\x68\145\x61\144\145\x72\x3e\74\x69\x6d\147\x20\163\162\x63\x3d\x22\x69\155\x61\x67\145\163\x2f\x63\151\x6e\164\151\x6c\x6c\157\56\x6a\x70\x67\42\x20\x61\x6c\164\75\42\110\145\x61\x64\x65\x72\42\x20\163\x74\171\154\145\x3d\42\x77\x69\144\x74\x68\72\61\x30\x30\45\73\x22\76\74\57\x68\x65\141\144\x65\162\76\x3c\x62\x72\x3e\12\x20\x20\40\x20\x3c\164\141\x62\x6c\x65\x20\143\154\x61\163\163\75\42\167\x33\x2d\164\x61\142\154\145\42\76\xa\40\40\40\40" . $table . "\xa\40\x20\x20\x20\74\x2f\164\141\142\154\145\76\12\40\x20\40\40\74\x66\157\x6f\164\145\162\76\12\40\x20\x20\40\74\x64\x69\x76\40\143\154\x61\x73\163\x3d\x22\160\141\x67\145\x6e\x75\x6d\55\143\x6f\x6e\x74\141\x69\x6e\x65\x72\42\76\x50\141\147\145\40\x3c\x73\160\x61\x6e\40\143\x6c\141\163\x73\75\42\160\x61\x67\145\156\165\x6d\x22\x3e\x3c\57\x73\x70\x61\156\76\74\57\144\x69\166\76\12\40\40\x20\x20\x3c\x2f\146\157\157\x74\x65\x72\76\12\40\x20\x20\x20\x3c\x6d\x61\x69\x6e\76\xa\x20\x20\x20\x20\x20\40\x20\x20\x3c\x64\x69\166\x3e\115\x61\151\156\x20\x63\157\x6e\164\145\x6e\164\x20\x67\x6f\145\163\40\150\145\x72\145\x20\74\x2f\144\151\x76\76\12\40\40\x20\40\x3c\x2f\155\x61\151\156\76\12\x20\40\x20\x20\x3c\x2f\x62\157\x64\171\76\74\x2f\x68\164\155\x6c\x3e"; return $html; } function catalogomis() { $style = $this->stylepdf(); $bd = $this->db->query("\123\105\x4c\105\103\124\40\x61\x2e\x72\x75\164\x61\x66\157\164\x6f\54\141\x2e\x63\x6f\144\151\x67\157\54\141\x2e\x6e\x6f\155\142\162\145\54\x61\x2e\155\141\162\143\x61\54\x52\x4f\x55\x4e\x44\x28\x61\56\x70\x72\x65\x63\x69\157\146\x69\156\61\x2c\x32\51\40\x70\x72\x65\143\151\x6f\x62\163\x2c\40\x52\117\x55\x4e\x44\50\x61\x2e\x70\162\145\x63\x69\157\x66\151\x6e\61\57\x28\123\105\114\105\x43\x54\40\x6f\x66\151\143\x69\141\154\x20\x46\x52\117\115\x20\155\157\x6e\x65\143\x61\155\x20\x4f\x52\104\x45\122\40\x42\131\x20\146\145\x63\x68\141\40\x44\x45\x53\x43\x20\x4c\111\x4d\111\x54\40\61\51\54\x32\51\x20\160\x72\x65\143\151\x6f\x64\x2c\12\40\40\40\x20\122\x4f\x55\116\104\x28\x61\x2e\145\170\x69\x73\x74\145\x6e\143\x69\x61\55\141\x2e\143\157\155\160\162\x6f\x6d\145\164\x69\x64\x6f\51\x20\145\170\x69\163\x74\x20\x46\x52\117\x4d\40\x61\162\x74\151\143\x75\x6c\157\x20\141\40\127\x48\x45\x52\105\40\50\141\56\145\170\x69\x73\x74\x65\x6e\143\151\x61\55\x61\56\x63\157\x6d\160\162\x6f\x6d\x65\164\151\144\x6f\51\76\60\x20\46\x26\x20\x61\x2e\x70\141\162\141\x5f\167\145\x62\75\x27\61\x27\40\x26\x26\x20\123\x55\x42\123\124\x52\50\x61\x2e\143\157\144\151\x67\157\x2c\x31\x2c\63\51\x3d\47\115\x49\x53\x27\40\x26\46\x20\x61\x2e\162\x75\164\141\x66\x6f\x74\x6f\x21\75\47\47\40\117\122\104\105\x52\x20\x42\x59\x20\141\56\156\157\x6d\142\x72\x65\x20\101\x53\x43"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "\74\164\162\x3e"; } $table .= "\x3c\x74\144\76\x3c\154\x61\142\x65\154\40\x63\154\141\163\x73\x3d\x22\x77\63\55\x6d\145\x64\151\x75\x6d\x22\76\74\x69\155\x67\x20\163\162\143\75\x22\x69\155\x61\147\x65\163\x2f" . $dt->rutafoto . "\x22\x20\141\x6c\x74\75\x22\x69\x6d\x67\137" . $dt->codigo . "\42\40\163\164\171\154\145\x3d\42\167\x69\x64\164\150\72\62\x32\x30\x70\170\x3b\x68\145\x69\147\150\164\x3a\x32\x32\60\x70\170\x22\76\x3c\x62\x72\x3e\x3c\x62\x3e" . $dt->codigo . "\74\x2f\x62\x3e\40\x3c\142\x3e\x4e\x4f\115\102\x52\x45\x3a\40\x3c\x2f\x62\x3e" . $dt->nombre . "\xa\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\x3c\x62\76\115\x41\122\x43\101\x3a\40\74\x2f\142\x3e" . $dt->marca . "\40\74\x62\x3e\x50\x52\105\x43\111\117\40\x42\163\x3a\40\x3c\57\x62\76" . $dt->preciobs . "\x20\x3c\x62\x3e\x50\x52\x45\103\111\117\x20\x24\x3a\40\74\x2f\x62\76" . $dt->preciod . "\x20\74\142\76\x45\130\111\123\124\72\40\74\57\142\x3e" . $dt->exist . "\74\x2f\154\x61\x62\x65\154\76\x3c\57\164\x64\x3e"; if ($i == 3) { $table .= "\74\57\x74\x72\x3e"; $i = 0; } } } $html = "\12\40\x20\40\40\x3c\x68\164\x6d\x6c\x3e\74\x68\x65\141\144\76\x3c\x6d\145\x74\x61\x20\x63\150\x61\162\x73\145\x74\x3d\42\x55\124\106\x2d\x38\x22\76\74\155\x65\164\141\x20\x68\x74\164\160\x2d\145\161\165\151\166\x3d\42\x58\55\x55\101\x2d\x43\157\155\x70\141\164\x69\142\154\x65\42\x20\x63\x6f\156\x74\x65\156\x74\x3d\x22\x49\x45\x3d\x65\144\147\x65\42\76\xa\x20\40\x20\x20\74\x6d\145\164\141\x20\x6e\x61\x6d\145\x3d\42\x76\151\145\167\160\157\x72\164\42\x20\143\x6f\156\x74\145\x6e\x74\75\42\x77\x69\x64\164\150\x3d\x64\145\x76\151\143\145\x2d\x77\151\x64\x74\150\x2c\x20\x69\156\151\164\151\x61\154\55\163\x63\x61\154\x65\x3d\x31\56\60\x22\76\12\40\40\x20\40\74\x6c\151\156\x6b\x20\162\x65\154\x3d\x22\163\x74\x79\x6c\x65\163\x68\x65\x65\164\x22\x20\x68\x72\x65\x66\x3d\42\x61\x73\x73\145\164\x73\57\x63\163\163\x2f\x77\x33\x2e\x63\x73\163\x22\x3e" . $style . "\12\40\x20\x20\x20\x3c\57\150\145\x61\144\76\x3c\x62\x6f\144\171\76\xa\40\x20\40\40\x3c\x68\x65\141\144\x65\x72\76\74\x69\x6d\x67\40\163\x72\143\x3d\x22\x69\x6d\x61\147\145\x73\x2f\x63\x69\156\x74\151\154\x6c\157\x2e\152\x70\147\42\x20\141\x6c\x74\x3d\42\110\x65\141\x64\x65\x72\x22\x20\163\164\171\x6c\145\x3d\42\x77\151\144\x74\x68\72\x31\x30\x30\45\73\x22\76\74\x2f\x68\145\x61\x64\x65\x72\76\x3c\x62\x72\x3e\xa\40\x20\x20\40\74\x74\141\142\154\x65\x20\x63\x6c\x61\163\163\75\42\x77\x33\55\x74\141\x62\154\145\x22\x3e\12\x20\40\40\40" . $table . "\12\40\x20\x20\40\74\x2f\x74\x61\142\154\145\x3e\xa\40\x20\x20\x20\74\146\x6f\x6f\x74\x65\x72\76\xa\40\x20\40\40\x3c\x64\151\x76\x20\x63\x6c\141\163\163\x3d\42\160\x61\x67\x65\156\x75\x6d\x2d\143\157\156\x74\x61\x69\x6e\145\162\42\76\x50\x61\x67\145\x20\74\x73\160\x61\x6e\x20\143\x6c\x61\163\x73\75\x22\160\141\147\x65\x6e\x75\155\42\76\x3c\x2f\163\x70\141\x6e\x3e\x3c\57\144\x69\x76\x3e\xa\40\x20\40\x20\x3c\x2f\146\157\157\164\145\162\76\xa\40\40\x20\40\74\x6d\x61\x69\x6e\x3e\12\40\40\x20\x20\40\40\40\x20\x3c\x64\151\x76\76\x4d\141\x69\156\40\x63\x6f\x6e\164\145\156\164\x20\147\157\x65\x73\x20\150\x65\x72\145\40\74\x2f\144\151\x76\x3e\xa\40\x20\x20\x20\x3c\x2f\155\141\x69\x6e\76\12\40\x20\x20\40\x3c\x2f\142\x6f\144\x79\76\74\x2f\x68\x74\x6d\x6c\76"; return $html; } function catalogobebes() { $style = $this->stylepdf(); $bd = $this->db->query("\x53\105\x4c\x45\103\x54\x20\141\x2e\162\x75\x74\x61\146\157\x74\157\54\x61\56\143\157\144\x69\x67\157\x2c\141\56\156\157\x6d\142\162\145\x2c\141\x2e\x6d\141\x72\143\141\x2c\122\x4f\x55\x4e\x44\50\141\x2e\x70\x72\x65\x63\151\157\x66\x69\x6e\61\54\x32\x29\x20\160\x72\x65\x63\x69\x6f\x62\x73\54\40\122\117\125\116\x44\x28\141\x2e\160\162\145\143\x69\x6f\x66\151\x6e\x31\x2f\x28\123\x45\x4c\105\103\x54\x20\x6f\146\151\x63\x69\x61\154\40\106\x52\x4f\x4d\x20\155\157\156\x65\x63\x61\x6d\x20\117\122\x44\x45\x52\x20\102\x59\40\x66\145\143\x68\141\x20\x44\105\123\x43\40\x4c\111\x4d\x49\124\x20\61\51\x2c\x32\51\x20\x70\162\145\143\151\157\144\x2c\12\40\40\40\x20\x52\117\125\116\x44\50\x61\x2e\145\170\151\x73\x74\145\156\143\151\x61\x2d\141\x2e\x63\x6f\155\160\162\157\x6d\x65\x74\x69\144\x6f\x29\40\x65\x78\x69\163\x74\x20\106\122\x4f\x4d\x20\x61\162\164\151\143\x75\x6c\157\40\x61\x20\x57\x48\x45\122\105\40\x28\141\x2e\x65\170\151\x73\x74\x65\156\143\151\x61\x2d\x61\x2e\143\157\x6d\160\162\157\x6d\145\x74\151\144\x6f\x29\76\60\40\46\x26\x20\x61\56\160\x61\x72\x61\137\x77\145\x62\x3d\47\x31\47\x20\x26\x26\x20\123\x55\102\x53\124\122\x28\141\x2e\143\x6f\x64\x69\147\x6f\x2c\x31\x2c\x33\51\x3d\x27\115\111\x53\x27\40\46\46\x20\x61\x2e\x6d\x61\162\x63\x61\x20\122\105\x47\x45\x58\x50\x20\47\120\x48\101\x52\123\x41\116\101\174\111\x43\105\x42\105\x52\x47\174\x42\105\x42\x45\x4c\114\x45\174\123\x4f\x4d\x41\x7c\x43\110\x49\103\103\x4f\x7c\x47\x45\x4e\x49\101\114\x27\x20\46\x26\x20\x61\56\162\x75\164\141\x66\157\164\x6f\41\x3d\47\47\40\xa\x20\40\x20\40\x26\46\x20\141\56\143\157\x64\151\x67\157\x20\x4e\117\124\40\x49\116\x20\50\x27\115\111\123\60\x30\x31\65\47\x2c\47\x4d\x49\x53\x30\60\x34\60\47\54\47\115\111\123\x30\60\x32\x38\47\54\x27\x4d\111\x53\x30\66\62\64\47\54\x27\115\x49\123\x30\x33\61\67\x27\54\47\115\x49\x53\60\60\x31\x34\x27\x2c\47\115\111\123\x30\x30\61\65\47\x2c\x27\115\x49\x53\x30\60\x38\70\47\54\x27\x4d\111\x53\x30\x30\71\x30\x27\x2c\47\115\x49\x53\60\x32\x34\x39\x27\54\x27\115\x49\123\60\63\62\70\x27\x2c\47\x4d\111\x53\60\x37\64\63\x27\54\47\115\x49\x53\60\x32\62\63\47\x2c\47\x4d\111\x53\x30\60\71\x35\x27\51\40\x4f\122\x44\x45\122\40\102\x59\40\141\x2e\156\157\155\x62\x72\x65\40\101\123\x43"); $table = ''; $row = $bd->num_rows(); $i = 0; $cont = ROUND($row / 3); $cont2 = $cont * 2; $cont3 = $cont * 3; foreach ($bd->result() as $dt) { $i++; if ($i <= 3) { if ($i == 1) { $table .= "\74\x74\162\76"; } $table .= "\74\164\x64\76\74\154\141\142\145\x6c\x20\x63\154\x61\163\163\75\x22\x77\63\55\x6d\x65\x64\x69\x75\x6d\42\x3e\74\151\155\x67\x20\x73\162\x63\75\x22\151\x6d\x61\147\145\x73\57" . $dt->rutafoto . "\x22\x20\x61\154\164\75\x22\151\x6d\x67\x5f" . $dt->codigo . "\x22\40\163\x74\171\x6c\145\75\x22\167\x69\x64\x74\x68\72\x32\62\x30\x70\170\73\x68\x65\151\147\150\x74\72\62\62\x30\160\170\42\x3e\x3c\x62\162\x3e\74\142\76" . $dt->codigo . "\74\x2f\142\76\40\74\142\76\x4e\x4f\115\102\x52\x45\x3a\40\x3c\x2f\x62\x3e" . $dt->nombre . "\xa\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x3c\142\x3e\115\x41\x52\103\101\72\x20\74\57\x62\x3e" . $dt->marca . "\x20\74\x62\76\120\x52\105\103\x49\x4f\40\102\x73\72\40\x3c\57\x62\76" . $dt->preciobs . "\40\x3c\x62\x3e\x50\x52\x45\103\111\117\40\x24\x3a\x20\74\57\x62\76" . $dt->preciod . "\40\x3c\142\x3e\x45\x58\111\x53\124\72\40\x3c\x2f\142\x3e" . $dt->exist . "\74\x2f\x6c\x61\142\145\x6c\x3e\x3c\x2f\164\144\x3e"; if ($i == 3) { $table .= "\74\x2f\x74\x72\x3e"; $i = 0; } } } $html = "\xa\40\x20\40\40\74\150\164\155\154\76\x3c\150\x65\141\x64\x3e\x3c\155\145\164\x61\40\x63\x68\141\162\163\x65\164\x3d\x22\x55\124\106\x2d\x38\x22\76\74\x6d\x65\x74\x61\x20\x68\164\164\x70\x2d\145\161\165\151\166\x3d\x22\130\55\x55\x41\55\103\157\x6d\x70\x61\164\x69\142\x6c\145\42\40\x63\x6f\156\164\x65\156\x74\x3d\42\111\105\x3d\145\144\x67\x65\42\76\xa\x20\x20\x20\40\74\x6d\145\164\141\40\156\141\155\145\75\42\166\x69\145\167\160\157\162\164\42\x20\143\157\x6e\164\x65\x6e\x74\75\x22\x77\151\144\x74\x68\x3d\144\x65\166\151\143\145\55\167\151\144\164\150\54\x20\151\x6e\x69\164\151\141\154\55\x73\143\x61\154\x65\x3d\x31\56\60\x22\76\xa\40\40\x20\x20\74\154\x69\x6e\153\40\162\x65\154\75\x22\163\164\171\154\x65\x73\150\x65\145\164\x22\40\150\162\x65\146\75\42\x61\x73\x73\145\x74\x73\x2f\143\163\163\x2f\x77\63\56\x63\163\163\42\76" . $style . "\12\x20\x20\40\40\74\57\x68\x65\x61\x64\76\x3c\x62\x6f\x64\x79\76\12\x20\x20\x20\x20\x3c\x68\x65\141\x64\x65\x72\76\x3c\151\x6d\147\40\x73\x72\143\x3d\x22\x69\x6d\x61\147\x65\x73\x2f\143\x69\x6e\x74\151\154\x6c\157\56\152\160\147\x22\40\141\154\x74\75\x22\110\x65\141\144\145\162\x22\x20\163\164\171\x6c\x65\75\42\167\151\144\x74\x68\x3a\61\60\x30\45\73\42\76\74\x2f\x68\145\141\144\x65\x72\76\x3c\x62\x72\x3e\12\x20\40\40\x20\x3c\x74\x61\x62\x6c\145\x20\143\x6c\x61\163\163\75\42\x77\63\x2d\x74\x61\142\x6c\145\42\x3e\12\x20\x20\40\40" . $table . "\12\x20\40\40\x20\74\57\x74\x61\142\154\x65\76\xa\40\40\x20\x20\x3c\146\157\x6f\164\x65\x72\76\xa\40\40\40\40\74\x64\x69\x76\x20\143\x6c\141\x73\x73\x3d\42\160\x61\x67\145\x6e\165\x6d\55\143\x6f\x6e\x74\x61\151\156\145\162\42\76\120\x61\147\145\40\x3c\163\160\141\x6e\x20\x63\154\x61\163\x73\75\x22\160\141\147\x65\x6e\x75\155\42\76\74\x2f\x73\x70\141\x6e\x3e\74\x2f\144\x69\x76\76\xa\40\x20\40\x20\74\57\x66\157\x6f\164\145\x72\x3e\12\40\x20\x20\x20\74\x6d\141\151\x6e\x3e\12\x20\40\x20\40\x20\40\x20\x20\74\x64\151\166\76\115\x61\151\156\40\143\x6f\x6e\164\x65\x6e\x74\40\147\x6f\145\x73\x20\x68\x65\162\x65\40\x3c\x2f\144\151\166\x3e\xa\x20\40\x20\40\x3c\57\155\x61\x69\156\76\xa\x20\40\x20\40\x3c\57\142\157\x64\x79\x3e\74\57\x68\x74\x6d\x6c\76"; return $html; } public function farmapatria($a, $b) { $this->load->library("\x74\x61\x62\x6c\145"); if ($b != '') { $filter = "\x26\x26\40\x64\162\157\x67\x75\x65\x72\x69\x61\40\114\x49\113\x45\40\x27\45{$b}\45\47\40\174\174\x20\x72\x61\x7a\x6f\156\40\154\151\x6b\145\40\47\45{$b}\45\47"; } else { $filter = ''; } if ($a == '') { $a = 1; } $mostrar = 30; $totalreg = $this->db->query("\123\105\x4c\105\103\124\x20\x2a\x20\x46\122\117\115\40\x66\x61\162\x6d\x61\x70\x61\164\x72\x69\141\x20\127\x48\105\x52\x45\x20\145\155\151\163\x69\157\x6e\x3e\75\x44\101\x54\x45\137\123\125\102\x28\x63\165\162\144\x61\x74\x65\50\x29\x2c\111\x4e\124\105\122\x56\x41\114\x20\x33\40\x4d\x4f\116\x54\x48\51\x20{$filter}")->num_rows(); $TotalRegistro = ceil($totalreg / $mostrar); $bdfac = $this->db->query("\123\105\x4c\x45\103\124\40\x2a\x20\x46\x52\117\x4d\x20\x66\141\x72\x6d\141\160\141\164\162\x69\x61\x20\x57\x48\x45\122\x45\x20\145\155\x69\163\151\x6f\x6e\x3e\x3d\x44\x41\x54\105\137\123\125\x42\50\x63\165\x72\x64\141\x74\x65\x28\x29\x2c\111\x4e\x54\x45\x52\x56\101\x4c\x20\63\40\115\117\116\x54\x48\x29\40{$filter}\40\x4f\122\104\105\122\40\102\131\40\147\165\x69\141\40\x64\145\163\143\40\x4c\111\x4d\111\124\40" . ($a - 1) * $mostrar . "\40\54\40" . $mostrar . "\73")->result(); $html = "\xa\x20\40\40\x20\74\x74\141\x62\x6c\145\40\x63\154\x61\163\x73\75\x22\167\63\x2d\x74\141\142\x6c\x65\x2d\141\x6c\154\40\x77\x33\55\150\x6f\x76\145\x72\141\142\154\x65\x20\167\x33\55\x6c\145\146\x74\55\141\154\x69\x67\x6e\x22\76\xa\40\40\x20\40\x3c\164\162\x3e\74\164\144\40\143\x6c\x61\x73\163\75\x22\x77\x33\55\146\x6f\156\x64\x6f\144\162\x6f\151\x64\x22\76\x42\x75\x73\x63\x61\162\40\74\x69\x6d\x67\40\163\x72\x63\x3d\42" . base_url() . "\151\x6d\x61\x67\145\x73\x2f\142\165\x73\x63\x61\x72\x2e\160\156\147\x22\x20\x61\x6c\x74\75\42\102\x75\x73\x63\x61\x72\42\40\164\151\164\154\145\75\x22\x42\165\163\x63\141\x72\42\40\x73\x74\171\x6c\145\x3d\x22\167\x69\x64\164\x68\72\61\70\160\x78\73\142\x6f\x72\x64\145\162\72\x30\73\x22\x3e\74\x2f\164\144\76\xa\40\x20\40\40\74\164\144\76\x3c\151\x6e\x70\165\x74\40\164\x79\160\x65\75\x22\164\145\170\164\42\x20\x63\x6c\141\x73\163\75\x22\x77\x33\x2d\x69\156\x70\165\164\x22\x20\160\154\x61\143\x65\x68\x6f\x6c\x64\145\x72\x3d\x22\x49\156\147\162\x65\x73\x65\x20\x73\165\40\142\165\163\x71\x75\x65\x64\x61\x22\x20\x6f\x6e\143\x68\x61\x6e\147\145\x3d\x22\x66\x61\x72\155\x61\x70\141\164\x72\x69\141\x28\51\x22\40\x69\144\75\42\x6c\x69\153\145\x22\76\x3c\57\x74\x64\76\xa\x20\40\40\40\74\164\144\40\x63\154\141\x73\163\75\42\167\63\x2d\x63\x65\156\x74\x65\162\x20\167\x33\55\x62\x74\x6e\x22\76\x3c\141\40\x6f\156\x63\x6c\x69\143\153\x3d\42\x65\x78\x70\157\x72\164\x65\x78\x63\145\154\x66\141\x72\155\x61\50\x29\73\42\x3e\74\151\x6d\147\x20\163\x72\x63\x3d\x22" . base_url() . "\151\155\x61\x67\x65\163\x2f\x78\154\163\x2e\160\156\x67\x22\x20\141\x6c\164\75\42\105\170\160\157\162\164\40\114\151\163\164\42\x20\x74\x69\164\x6c\x65\75\42\x45\170\160\x6f\x72\x74\40\114\x69\163\x74\x22\x20\163\x74\171\x6c\x65\x3d\x22\x77\x69\144\x74\x68\x3a\62\x30\x70\x78\x3b\150\145\151\147\x68\x74\x3a\62\x30\x70\170\73\142\157\x72\x64\x65\162\x3a\60\73\42\x3e\x3c\57\141\76\x3c\x2f\x74\x64\x3e\12\40\40\x20\40\x3c\164\144\40\143\154\x61\163\x73\x3d\42\x77\63\55\143\145\156\x74\145\162\40\x77\x33\x2d\x62\164\x6e\x22\76\x3c\x61\x20\x6f\156\143\154\151\x63\153\x3d\x22\x65\x78\x70\x6f\162\164\145\x78\143\x65\154\x74\157\160\x66\141\162\155\141\x63\154\x69\x28\51\x3b\42\76\x3c\151\x6d\147\x20\x73\162\x63\75\x22" . base_url() . "\151\x6d\x61\147\145\x73\x2f\x78\154\163\56\x70\x6e\x67\x22\x20\141\154\x74\75\x22\x45\170\x70\x6f\x72\164\x20\114\x69\163\x74\x22\40\x74\151\x74\154\145\75\x22\105\x78\x70\x6f\162\x74\40\114\x69\163\x74\x20\x54\157\x70\x20\x43\154\x69\x65\x6e\x74\x65\x73\x22\x20\163\x74\171\x6c\x65\75\x22\167\x69\144\164\150\72\x32\x30\160\x78\x3b\150\145\151\x67\150\164\72\62\x30\160\170\x3b\x62\157\162\144\x65\x72\x3a\60\73\x22\x3e\74\x2f\141\x3e\74\57\x74\x64\x3e\xa\x20\x20\40\40\74\x74\x64\x20\x63\x6c\x61\163\163\75\x22\x77\63\x2d\x63\145\156\x74\145\x72\x20\167\63\55\142\x74\156\x22\x3e\74\141\40\157\x6e\x63\x6c\x69\x63\153\75\42\146\x61\162\155\x61\x70\141\164\162\151\x61\50\x29\x3b\x22\x3e\x3c\151\155\147\40\x73\162\x63\x3d\x22" . base_url() . "\x69\x6d\x61\x67\x65\x73\x2f\162\x65\154\157\x61\144\x2e\x70\x6e\147\42\x20\141\x6c\x74\75\42\122\x65\x63\141\x72\x67\141\162\42\x20\164\x69\164\154\x65\75\x22\122\x65\x63\x61\162\x67\x61\162\42\40\x73\164\171\154\x65\75\42\167\151\x64\164\150\x3a\x32\60\160\x78\73\150\x65\151\x67\x68\x74\x3a\x32\60\160\170\73\142\157\x72\144\x65\x72\72\60\73\x22\x3e\x3c\x2f\141\x3e\74\x2f\x74\x64\76\74\57\164\x72\x3e\xa\40\x20\40\x20\74\57\164\141\142\x6c\x65\x3e\x3c\142\x72\x3e\xa\40\x20\40\40\74\164\x61\x62\154\x65\40\x69\144\x3d\42\151\144\x30\61\42\40\143\x6c\141\163\163\75\x22\167\63\x2d\164\x61\x62\x6c\x65\x2d\x61\x6c\154\x20\x77\x33\55\x68\157\x76\x65\162\141\142\x6c\x65\40\x77\x33\55\154\x65\146\164\55\x61\154\151\147\x6e\x20\167\63\x2d\164\x69\156\171\42\76\x3c\x74\162\x20\143\x6c\x61\x73\x73\75\x22\x77\63\55\146\x6f\156\x64\157\144\x72\x6f\x69\144\x20\167\63\55\x66\x69\x6a\x6f\x22\76\xa\40\40\40\40\x3c\x74\150\x3e\x47\165\x69\141\74\x2f\x74\150\x3e\74\164\150\x3e\105\163\164\x61\164\165\163\74\x2f\x74\x68\76\x3c\x74\x68\x3e\105\155\x69\163\151\157\156\x3c\57\164\150\76\x3c\164\x68\76\x56\x65\156\143\145\x3c\x2f\x74\150\76\x3c\164\150\x3e\x46\101\103\x3c\57\x74\150\76\74\164\150\x3e\123\x49\x43\x4d\x3c\x2f\164\150\x3e\x3c\164\x68\x3e\x44\162\157\147\x75\145\162\151\x61\x3c\57\164\x68\76\74\164\x68\x3e\x43\x6c\151\145\156\164\145\x3c\x2f\164\150\76\74\x74\x68\76\122\151\x66\74\x2f\164\x68\x3e\74\x74\150\76\104\151\162\x65\x63\143\151\x6f\156\x3c\x2f\x74\x68\76\74\164\150\x3e\105\163\x74\141\x64\157\74\57\x74\x68\76\x3c\164\x68\76\x54\145\154\x65\146\x6f\156\157\74\x2f\x74\150\x3e\x3c\x74\x68\76\x43\x6f\156\164\141\x63\74\x2f\164\150\76\x3c\164\150\76\x45\155\x61\151\154\x3c\57\x74\x68\76\74\x74\x68\x3e\x42\165\154\x74\x6f\x73\x3c\x2f\164\150\76\x3c\x74\x68\x3e\x52\x65\156\x67\154\157\x6e\x3c\57\164\x68\x3e\74\164\x68\x3e\x75\x6e\151\x64\x61\144\145\163\x3c\57\164\150\x3e\12\x20\x20\40\40\x3c\57\x74\162\76"; $i = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\164\x72\40\x69\x64\75\x22\163\154\145\143\164" . $i . "\42\40\x63\x6c\x61\x73\x73\x3d\x22\151\164\x65\x6d\x22\x20\157\156\x63\154\151\x63\x6b\x3d\42\x69\164\x66\x61\x72\x6d\141\50\x24\x28\47\x23\141" . $i . "\x27\51\56\x76\141\x6c\50\x29\x29\x3b\x22\76"; $html .= "\74\151\156\160\165\164\x20\164\x79\x70\x65\75\x22\x68\x69\x64\144\145\156\x22\40\x69\x64\75\42\x61" . $i . "\42\x76\141\154\165\x65\x3d\x22" . $dtfac->guia . "\x22\x3e\xa\40\x20\x20\40\x20\x20\40\x20\x3c\164\x64\76" . $dtfac->guia . "\74\x2f\164\x64\76\74\x74\x64\x3e" . $dtfac->status . "\74\57\x74\x64\76\74\164\x64\76" . $dtfac->emision . "\x3c\57\x74\144\x3e\74\x74\144\76" . $dtfac->vence . "\74\57\x74\x64\x3e\x3c\164\144\76" . $dtfac->fac . "\74\x2f\164\x64\x3e\x3c\x74\144\76" . $dtfac->sicm . "\x3c\57\x74\x64\76\x3c\x74\144\76" . $dtfac->drogueria . "\x3c\57\x74\x64\x3e\xa\x20\x20\40\x20\40\x20\x20\x20\74\164\x64\x3e" . $dtfac->razon . "\x3c\x2f\164\x64\x3e\74\164\144\x3e" . $dtfac->rif . "\74\x2f\x74\144\x3e\74\x74\144\x3e" . $dtfac->dirr . "\x3c\57\164\144\76\x3c\x74\x64\x3e" . $dtfac->estado . "\x3c\x2f\x74\x64\x3e\x3c\164\144\76" . $dtfac->telf . "\74\x2f\164\x64\x3e\74\164\x64\76" . $dtfac->contac . "\74\x2f\164\x64\76\x3c\164\144\x3e" . $dtfac->email . "\x3c\57\x74\144\x3e\xa\x20\x20\x20\40\40\x20\x20\x20\74\164\x64\76" . $dtfac->bultos . "\x3c\57\x74\144\76\74\x74\144\x3e" . $dtfac->renglon . "\x3c\57\164\144\x3e\x3c\x74\x64\x3e" . $dtfac->unid . "\74\x2f\164\144\76\12\40\x20\x20\40\40\x20\x20\x20\x3c\57\x74\162\x3e"; } $html .= "\x3c\x74\x72\x3e\74\x74\x64\x20\143\x6c\141\x73\x73\x3d\x22\x77\63\55\143\x65\156\x74\x65\x72\x20\167\63\x2d\x66\x6f\156\144\157\144\162\x6f\x69\x64\42\x20\x63\157\x6c\163\x70\141\156\x3d\x22\x31\x33\42\76\x3c\x6c\141\142\x65\x6c\40\143\x6c\141\163\163\75\x22\x77\x33\55\x6c\141\x72\147\145\42\76\x3c\142\x3e\124\x6f\x74\x61\x6c\x20\x64\145\40\x47\x75\x69\x61\163\x3a\40" . $totalreg . "\74\x2f\x62\x3e\x3c\x2f\154\141\x62\x65\154\x3e\74\57\x74\x64\x3e\x3c\57\164\162\x3e\x3c\x2f\164\x61\142\x6c\x65\x3e"; $IncrimentNum = $a + 1 <= $TotalRegistro ? $a + 1 : 1; $DecrementNum = $a - 1 < 1 ? 1 : $a - 1; $html .= "\12\x20\40\x20\x20\x20\x20\40\x20\74\x73\x63\x72\151\160\164\x20\164\x79\160\145\75\42\x74\x65\x78\164\57\x6a\141\166\x61\163\x63\x72\x69\160\x74\42\x3e\12\x20\40\40\x20\x20\40\40\x20\x66\x75\x6e\x63\164\151\x6f\x6e\x20\x44\145\x63\x72\145\155\x65\x6e\x74\116\x75\x6d\50\x29\x7b\x20\x62\145\x66\157\162\x65\x28\x29\73\xa\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\166\x61\162\40\x44\145\x63\162\x65\155\x65\156\164\116\165\x6d\75\144\157\143\165\155\145\x6e\164\x2e\147\x65\x74\105\x6c\x65\155\x65\156\x74\x42\171\x49\x64\50\x22\104\145\143\162\x65\155\x65\x6e\164\116\x75\155\42\51\x2e\166\141\154\x75\145\73\xa\40\40\x20\40\40\40\x20\40\40\x20\x20\40\166\x61\162\40\153\x65\171\x3d\42\x64\162\157\151\x64\71\60\63\x22\x3b\x20\166\x61\162\x20\x6c\x69\x6b\x65\x3d\x24\x28\42\x23\x6c\151\153\145\42\51\x2e\x76\x61\154\x28\51\x3b\12\40\x20\40\40\40\40\40\40\x20\40\40\x20\166\x61\162\x20\x64\141\164\x6f\x73\x20\75\40\x7b\xa\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\42\160\x61\147\x22\x20\x3a\40\104\145\x63\162\x65\x6d\145\156\x74\x4e\165\155\54\12\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\42\x6b\145\x79\x22\40\x3a\40\x6b\145\171\x2c\154\151\153\145\x3a\x6c\x69\153\x65\12\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\175\x3b\12\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\12\x20\40\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x24\x2e\x61\152\x61\x78\50\173\12\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x64\141\x74\141\x3a\40\144\141\x74\x6f\x73\x2c\12\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\x75\x72\x6c\x3a\40\40\142\141\163\x65\x75\x72\154\53\x22\x63\137\144\x72\x6f\151\x64\57\x66\141\x72\x6d\141\x70\141\164\162\x69\141\x22\54\xa\40\x20\x20\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\164\x79\x70\x65\x3a\x20\x22\120\117\x53\x54\x22\x2c\12\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\163\x75\x63\x63\145\163\x73\x3a\40\146\x75\x6e\143\164\x69\x6f\156\x28\x64\x61\x74\141\51\x20\173\12\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x24\50\42\x23\x62\x6f\144\171\x22\51\56\x68\x74\155\x6c\50\x64\141\x74\141\51\73\40\44\x28\42\x23\x6c\151\x6b\145\x22\51\56\x76\141\x6c\50\x6c\151\153\x65\51\73\40\x73\167\141\x6c\56\x63\x6c\x6f\x73\145\x28\x29\12\x20\40\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x7d\12\40\40\40\40\40\40\40\40\40\40\40\12\40\x20\40\40\x20\x20\40\40\40\x20\40\40\40\x20\40\175\x29\x3b\xa\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\175\xa\x20\40\x20\x20\x20\40\40\40\xa\40\x20\x20\40\x20\40\40\x20\40\40\x20\x66\x75\156\143\x74\x69\157\x6e\40\x6e\165\155\160\x61\x67\50\141\x29\173\x20\x62\145\146\x6f\162\x65\50\51\73\xa\x20\40\x20\40\40\40\40\x20\40\x20\x20\40\x76\141\x72\x20\153\145\171\75\x22\x64\162\x6f\x69\x64\71\x30\x33\x22\x3b\12\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x76\141\x72\40\x6c\x69\153\145\75\44\50\x22\43\x6c\x69\153\x65\x22\x29\x2e\166\141\154\x28\51\73\xa\40\40\x20\40\40\x20\x20\40\x20\x20\40\x20\166\x61\x72\40\x64\141\164\157\163\40\x3d\x20\173\12\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\x20\42\153\x65\171\x22\x3a\153\145\171\54\12\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\x20\x22\x70\141\147\42\40\x3a\40\x61\x2c\x6c\151\x6b\145\72\154\151\153\x65\12\40\40\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\40\40\175\73\xa\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\xa\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\x24\x2e\141\x6a\x61\170\x28\x7b\12\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\144\x61\164\141\x3a\40\144\141\x74\x6f\163\x2c\xa\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\40\40\40\40\40\40\40\x75\162\x6c\x3a\40\142\141\163\145\x75\x72\x6c\x2b\x22\x63\x5f\144\162\157\x69\x64\x2f\146\141\x72\x6d\141\160\141\164\162\151\x61\x22\x2c\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x74\171\x70\x65\72\40\x22\120\x4f\123\x54\x22\x2c\xa\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\40\x20\163\165\143\143\145\163\x73\72\40\x66\x75\x6e\143\164\x69\157\x6e\50\144\x61\x74\141\x29\40\173\xa\40\x20\40\40\x20\40\40\40\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\44\x28\x22\43\142\157\x64\x79\42\51\56\x68\164\155\154\x28\x64\141\x74\141\x29\x3b\40\44\50\42\x23\x6c\151\x6b\x65\x22\x29\56\166\141\x6c\50\x6c\151\153\145\x29\x3b\40\163\x77\x61\x6c\56\143\x6c\x6f\x73\x65\50\x29\12\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x7d\xa\40\x20\x20\40\40\40\40\40\x20\40\x20\xa\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\40\175\x29\73\12\x20\40\40\x20\x20\40\40\40\40\x20\40\175\12\40\40\40\x20\x20\40\40\40\12\40\x20\x20\40\x20\x20\x20\40\40\40\x20\x66\x75\156\x63\x74\151\x6f\156\x20\x49\x6e\x63\162\151\155\145\156\164\116\165\155\50\51\x7b\x20\x62\145\x66\x6f\162\x65\x28\51\73\12\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\166\x61\x72\40\111\x6e\143\162\x69\155\x65\x6e\x74\116\165\155\75\144\157\x63\165\155\145\156\164\x2e\x67\145\164\105\154\145\155\x65\156\164\x42\171\111\144\50\42\x49\x6e\x63\162\151\x6d\x65\156\164\x4e\165\x6d\42\x29\x2e\x76\141\x6c\165\x65\73\xa\40\40\x20\x20\40\x20\40\40\40\x20\40\x20\166\x61\x72\x20\153\145\x79\x3d\42\144\x72\x6f\x69\x64\71\x30\63\x22\x3b\40\x76\x61\162\x20\154\x69\153\145\x3d\44\50\42\43\x6c\x69\x6b\145\42\51\56\x76\x61\154\50\51\x3b\xa\x20\x20\x20\40\x20\40\40\40\x20\x20\40\40\x76\141\162\x20\144\x61\x74\157\x73\x20\75\x20\173\xa\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\42\153\x65\171\42\x3a\153\x65\x79\x2c\xa\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\40\40\40\x22\160\x61\x67\42\x20\72\40\111\x6e\143\162\151\155\x65\x6e\x74\116\165\155\x2c\154\151\153\145\72\154\151\x6b\x65\xa\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\175\73\12\x20\40\x20\x20\40\40\x20\x20\40\40\x20\12\x20\x20\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\44\x2e\x61\x6a\x61\170\x28\173\xa\40\x20\40\x20\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\40\40\40\x64\141\x74\141\x3a\x20\x64\141\x74\157\163\x2c\xa\40\40\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\40\165\x72\x6c\x3a\x20\x20\142\141\163\145\x75\x72\154\53\42\x63\x5f\144\162\157\151\144\57\x66\x61\x72\155\141\160\x61\164\162\x69\x61\x22\54\xa\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\164\x79\x70\145\x3a\40\x22\x50\x4f\x53\x54\x22\x2c\12\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\163\165\143\143\x65\x73\163\72\x20\146\165\156\143\164\151\157\x6e\x28\x64\x61\x74\141\x29\x20\x7b\xa\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\40\40\40\40\40\44\x28\42\x23\x62\x6f\x64\x79\42\51\56\x68\x74\x6d\x6c\x28\144\141\164\x61\x29\73\x20\44\50\x22\x23\154\151\x6b\x65\x22\51\x2e\x76\141\154\x28\154\151\153\145\x29\x3b\40\163\167\141\154\56\x63\154\x6f\163\145\x28\x29\12\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\40\x20\x20\175\xa\40\40\40\x20\40\x20\x20\x20\x20\40\x20\xa\x20\40\40\40\40\40\40\x20\40\40\40\40\x20\40\x20\x7d\x29\73\xa\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\175\12\40\x20\40\x20\x20\x20\x20\40\74\x2f\x73\x63\x72\x69\160\164\x3e\12\x20\40\40\x20\x20\40\x20\40\x3c\144\151\x76\x20\143\154\141\163\x73\75\x22\167\x33\55\x62\x61\162\40\x77\x33\55\x62\x6f\162\144\x65\162\x20\x77\x33\55\142\141\x72\162\141\x73\42\x3e\xa\x20\40\x20\x20\x20\x20\40\40\x3c\151\156\x70\165\164\x20\x74\171\160\x65\75\42\150\151\144\x64\145\x6e\x22\40\x69\144\75\x22\104\x65\x63\162\145\155\145\156\x74\x4e\165\155\x22\40\166\141\x6c\165\x65\x3d\42" . $DecrementNum . "\42\76\xa\40\x20\40\40\x20\x20\x20\40\x3c\x61\x20\157\156\143\154\x69\x63\x6b\x3d\42\104\145\143\x72\x65\x6d\145\x6e\x74\116\165\155\50\51\73\x22\x20\x63\x6c\x61\x73\x73\75\42\x77\x33\x2d\142\x61\x72\x2d\151\164\x65\x6d\40\x77\63\55\142\165\x74\x74\x6f\156\x22\76\46\154\x61\x71\x75\x6f\x3b\74\x2f\141\76"; $Desde = $a - (ceil($mostrar / 2) - 1); $Hasta = $a + (ceil($mostrar / 2) - 1); $Desde = $Desde < 1 ? 1 : $Desde; $Hasta = $Hasta < $mostrar ? $mostrar : $Hasta; for ($i = $Desde; $i <= $Hasta; $i++) { $id = "\x69\144\160\141\147\x69\156\141" . $i; if ($i <= $TotalRegistro) { if ($i == $a) { $hover = "\167\x33\55\x66\x6f\x6e\x64\157\144\162\157\x69\x64"; $html .= "\xa\x20\40\40\x20\40\x20\40\x20\74\x69\156\160\x75\x74\x20\x74\171\160\145\x3d\x22\x68\x69\144\x64\x65\156\42\x20\151\x64\x3d\42" . $id . "\x22\40\x76\141\154\x75\x65\75\x22" . $i . "\42\x3e\12\x20\x20\40\x20\40\x20\x20\x20\74\141\x20\x6f\x6e\x63\x6c\x69\x63\x6b\x3d\42\156\x75\155\x70\141\x67\50\44\x28\x27\x23" . $id . "\47\x29\x2e\x76\141\154\x28\x29\x29\73\42\x20\x63\x6c\x61\163\163\75\42\x77\x33\55\x62\x61\162\x2d\x69\164\145\155\x20\167\x33\55\x62\x75\x74\x74\157\x6e\40" . $hover . "\42\76" . $i . "\74\57\141\76"; } else { $hover = ''; $html .= "\74\x69\156\160\x75\164\x20\164\x79\x70\145\x3d\x22\150\151\144\144\145\x6e\42\x20\151\x64\75\42" . $id . "\42\x20\x76\x61\x6c\x75\x65\75\42" . $i . "\42\76\12\x20\x20\x20\40\40\40\40\x20\74\x61\x20\157\156\143\154\x69\143\x6b\75\x22\x6e\x75\x6d\x70\x61\147\x28\44\x28\47\x23" . $id . "\47\51\56\x76\141\x6c\50\x29\51\73\42\x20\143\154\x61\163\163\75\42\167\63\55\x62\x61\162\x2d\x69\x74\145\x6d\40\x77\63\55\x62\x75\164\x74\x6f\156\x20" . $hover . "\x22\x3e" . $i . "\74\x2f\141\x3e"; } } } $html .= "\x3c\x69\156\x70\x75\164\40\164\x79\x70\x65\x3d\x22\x68\x69\x64\x64\145\x6e\x22\x20\x69\144\x3d\x22\x49\x6e\x63\x72\x69\x6d\145\x6e\x74\x4e\165\155\x22\40\166\x61\154\165\145\x3d\x22" . $IncrimentNum . "\x22\x3e\12\x20\40\x20\x20\x20\40\40\x20\x3c\141\x20\157\156\143\154\151\143\153\75\x22\111\x6e\x63\x72\x69\x6d\145\156\x74\116\165\x6d\x28\51\x3b\42\x20\143\154\141\163\x73\75\x22\x77\63\x2d\x62\x61\x72\55\x69\x74\145\155\40\x77\x33\55\142\165\164\164\x6f\156\x22\x3e\46\162\141\x71\x75\x6f\x3b\x3c\x2f\141\76\xa\12\x20\40\40\40\40\40\x20\40\74\x2f\x64\x69\166\x3e\40"; return $html; } public function itfarma($a) { $this->load->library("\x74\141\x62\x6c\x65"); $bdfac = $this->db->query("\x53\x45\114\105\103\x54\x20\151\x74\145\x6d\x20\106\x52\117\115\x20\x69\164\146\141\162\155\x61\40\x57\110\105\122\x45\40\x67\x75\x69\x61\x3d\x27{$a}\x27")->result(); $html = "\xa\40\40\x20\40\40\40\x20\40\x3c\x74\141\x62\x6c\145\x20\151\x64\75\x22\151\144\60\x31\42\x20\143\154\x61\x73\163\x3d\42\x77\x33\55\164\141\142\x6c\145\55\x61\x6c\154\40\x77\x33\55\x68\157\x76\145\x72\x61\x62\154\145\40\x77\x33\x2d\154\145\x66\164\55\141\x6c\151\x67\x6e\40\x77\63\x2d\x74\151\x6e\x79\x22\76\x3c\x74\162\x20\x63\x6c\x61\x73\163\x3d\42\167\x33\x2d\146\157\156\144\157\x64\x72\157\x69\144\42\x3e\12\x20\x20\40\x20\x20\40\40\x20\x3c\x74\x68\x3e\x49\x74\145\155\74\57\164\150\76\xa\40\40\x20\40\40\x20\40\40\74\x2f\x74\x72\x3e"; $i = 0; $tot = 0; foreach ($bdfac as $dtfac) { $i++; $html .= "\x3c\164\x72\x3e"; $html .= "\74\x74\144\x3e" . $dtfac->item . "\x3c\164\x64\x3e\12\x20\40\x20\40\x20\x20\40\40\x20\40\x20\40\x3c\57\164\162\x3e"; } return $html; } function idfarma() { $bd = $this->db->query("\123\105\114\105\103\x54\40\115\101\130\50\147\165\151\x61\x29\40\x6e\40\x46\x52\117\x4d\40\146\141\162\x6d\141\x70\141\x74\162\151\141")->row(); return $bd->n; } function regdatafarma($guia, $status, $emision, $vence, $fac, $sicm, $razon, $rif, $dirr, $estado, $telf, $contac, $email, $bultos, $renglon, $unid, $item, $drog) { $farma = array("\x67\x75\x69\141" => $guia, "\163\x74\x61\x74\165\163" => $status, "\x65\155\x69\x73\x69\157\156" => DateTime::createFromFormat("\x64\x2d\x6d\x2d\131\x20\x48\72\x69", $emision)->format("\x59\x2d\155\x2d\x64\40\x48\x3a\x69\72\x73"), "\x76\145\156\x63\145" => DateTime::createFromFormat("\144\55\x6d\x2d\x59", $vence)->format("\x59\x2d\155\x2d\144"), "\x66\x61\143" => $fac, "\x73\151\143\155" => $sicm, "\x72\141\x7a\x6f\x6e" => $razon, "\162\151\146" => $rif, "\144\151\162\x72" => $dirr, "\145\x73\x74\141\144\x6f" => $estado, "\164\x65\154\146" => $telf, "\143\157\156\x74\x61\x63\164" => $contac, "\145\155\141\x69\154" => $email, "\142\x75\x6c\x74\x6f\163" => $bultos, "\x72\x65\x6e\x67\154\157\156" => $renglon, "\x75\156\151\144" => $unid, "\144\x72\x6f\x67\165\x65\162\x69\x61" => $drog); $itfarma = array("\x67\165\151\x61" => $guia, "\151\164\x65\x6d" => $item); $this->db->insert("\x66\141\x72\155\x61\x70\x61\x74\162\151\x61", $farma); if ($this->db->affected_rows() > 0) { $this->db->insert("\151\x74\x66\141\162\x6d\141", $itfarma); return $this->db->affected_rows(); } } function exportexcelfarma($desde, $hasta) { return $this->db->query("\123\x45\114\105\x43\x54\x20\x61\56\x67\165\x69\141\x2c\x61\x2e\x73\164\141\164\165\x73\54\x61\56\x65\155\151\163\x69\x6f\156\x2c\141\x2e\166\x65\156\143\x65\x2c\141\56\146\x61\x63\x2c\141\x2e\163\151\x63\x6d\54\x61\56\144\162\157\x67\x75\x65\x72\x69\x61\54\141\56\162\x61\172\157\156\x2c\x61\x2e\162\151\x66\x2c\141\x2e\x64\151\x72\x72\x2c\x61\56\x65\x73\164\141\x64\x6f\x2c\141\x2e\164\145\x6c\146\x2c\x61\x2e\143\x6f\x6e\164\141\x63\164\x2c\x61\56\x65\x6d\x61\x69\x6c\54\x61\x2e\142\165\154\x74\157\163\54\141\x2e\x72\145\156\x67\x6c\157\x6e\x2c\141\x2e\x75\x6e\x69\144\12\x20\x20\x20\40\106\x52\x4f\x4d\x20\x66\x61\x72\x6d\x61\x70\x61\164\162\151\x61\x20\x61\40\57\52\112\x4f\111\x4e\40\x69\164\146\x61\162\x6d\x61\40\142\40\x4f\116\x20\141\56\x67\165\x69\141\75\x62\x2e\147\165\151\x61\52\57\40\127\x48\x45\122\105\40\x61\x2e\x65\155\151\x73\151\x6f\156\76\75\x27{$desde}\x27\x20\46\46\40\141\x2e\145\155\151\163\x69\x6f\x6e\x3c\75\x27{$hasta}\x27\x20\x4f\x52\x44\105\x52\40\x42\131\40\x61\x2e\x65\x6d\151\x73\x69\x6f\x6e\40\x64\x65\163\x63"); } function exportexcellibroventas($desde, $hasta) { return $this->db->query("\123\x45\x4c\x45\x43\x54\x20\144\141\164\x65\x5f\146\x6f\162\155\141\x74\50\146\145\143\150\x61\54\x20\47\x25\144\x2d\45\x6d\55\x25\x59\47\x29\40\x66\145\x63\150\x61\54\144\157\143\x75\x6d\145\156\164\x6f\x2c\164\151\160\157\144\x6f\x63\54\x6e\x63\157\x6e\x74\x72\157\x6c\x2c\x6e\x6f\155\142\162\x65\x2c\x74\x69\x70\157\143\x6f\x6e\164\x2c\162\x69\146\x2c\164\157\x74\x61\154\x2c\142\x61\163\x65\151\x6d\x70\157\156\151\x62\x6c\x65\x2c\x61\154\151\143\165\x6f\164\141\54\x69\x76\x61\x2c\145\170\x63\x65\x6e\x74\x6f\x2c\162\145\164\151\x65\x6e\x65\x2c\142\x61\163\x65\151\x6d\x70\157\x6e\x69\142\154\x65\x5f\x49\x47\124\106\54\47\x27\x20\111\x47\x54\106\137\62\54\40\x49\107\x54\x46\x20\106\x52\x4f\x4d\12\x20\40\40\x20\50\x53\x45\114\105\x43\124\40\156\x75\x6c\x6c\x20\x64\157\143\x75\155\145\x6e\x74\157\x2c\x6e\165\154\154\40\x74\x69\x70\x6f\x64\157\143\x2c\156\x75\154\154\x20\156\x63\157\156\x74\x72\157\x6c\54\156\x75\154\x6c\40\164\x69\160\x6f\x63\x6f\x6e\164\54\x6e\165\154\154\x20\x72\x69\146\x2c\122\x4f\125\116\x44\x28\x53\x55\115\50\111\x46\x28\164\x69\x70\x6f\x64\157\143\x3d\x27\116\x2f\x43\x27\x2c\x61\56\x74\x6f\x74\141\154\x66\151\156\141\154\x2a\55\61\x2c\141\56\164\157\164\141\154\146\x69\x6e\x61\x6c\x29\51\54\x32\x29\40\x74\157\x74\x61\x6c\x2c\x52\117\125\116\104\50\123\x55\x4d\x28\111\x46\50\164\151\x70\157\144\157\143\75\47\116\x2f\x43\47\54\x61\56\142\141\x73\145\151\x6d\x70\x6f\61\52\x2d\61\x2c\x49\106\x28\x61\x2e\144\x6f\x63\165\x6d\x65\x6e\164\157\146\151\163\x63\x61\154\75\x27\x49\x47\x54\106\x27\54\60\x2c\141\56\142\141\x73\145\151\x6d\x70\157\61\x29\51\51\54\62\x29\x20\142\x61\x73\145\x69\x6d\x70\157\x6e\x69\142\x6c\x65\x2c\156\165\154\154\x20\141\x6c\x69\x63\165\x6f\x74\x61\x2c\122\x4f\125\x4e\104\50\x53\125\115\x28\x49\x46\x28\164\151\160\157\x64\157\x63\x3d\47\x4e\57\103\x27\54\141\56\x74\157\x74\x69\155\160\x75\145\163\164\x2a\55\x31\54\141\56\164\157\x74\x69\x6d\x70\x75\145\163\x74\51\x29\x2c\62\51\x20\111\x56\101\54\40\x52\x4f\x55\x4e\x44\50\123\125\x4d\x28\x49\106\50\164\x69\x70\157\144\157\143\x3d\x27\x4e\57\103\47\x2c\141\56\163\151\x6e\151\155\160\x75\145\163\164\52\55\x31\54\141\56\163\x69\x6e\x69\155\160\x75\145\163\x74\51\x29\x2c\x32\51\40\145\x78\x63\x65\156\164\157\54\xa\40\x20\x20\40\122\x4f\125\116\x44\x28\x28\x53\105\x4c\105\103\124\40\123\x55\115\x28\141\61\x2e\164\157\164\x61\x6c\146\151\156\141\x6c\51\x20\106\x52\117\x4d\40\x6f\x70\x65\x72\164\x69\40\x61\x31\40\x57\110\x45\x52\x45\x20\141\x31\x2e\164\151\160\x6f\x64\157\x63\x3d\47\x52\105\124\47\x20\x26\x26\x20\141\x31\56\146\x65\143\x68\141\171\x68\x6f\162\x61\x3e\75\47{$desde}\47\x20\x26\x26\x20\x61\x31\x2e\146\145\143\x68\x61\171\150\157\162\x61\74\x3d\47{$hasta}\47\x29\54\x32\51\x20\x72\145\164\x69\145\156\145\54\x20\xa\x20\x20\x20\x20\x52\x4f\x55\x4e\x44\x28\50\x53\105\x4c\x45\103\x54\40\123\125\x4d\50\50\141\x31\56\x74\x6f\164\141\x6c\146\x69\x6e\x61\x6c\52\61\x30\x30\51\57\x33\x29\x20\106\122\117\115\40\157\x70\145\162\x74\151\40\x61\61\x20\x57\x48\105\x52\105\40\141\x31\56\164\x69\160\x6f\x64\157\143\x3d\47\x4e\x2f\x44\47\40\x26\46\x20\x61\x31\56\144\x6f\143\165\x6d\145\156\164\x6f\146\x69\x73\x63\141\154\75\47\111\x47\124\x46\x27\x20\46\x26\x20\141\61\56\146\x65\x63\x68\x61\x79\x68\x6f\x72\x61\76\x3d\x27{$desde}\x27\40\x26\x26\40\x61\61\x2e\x66\x65\x63\150\x61\x79\x68\157\162\x61\74\75\x27{$hasta}\47\51\54\x32\x29\x20\142\x61\163\145\x69\x6d\x70\157\156\x69\142\x6c\x65\137\111\107\124\x46\54\12\x9\122\117\x55\116\104\x28\50\x53\x45\x4c\105\103\x54\x20\123\x55\115\x28\x61\x31\x2e\164\157\164\141\x6c\146\x69\156\141\x6c\x29\40\106\122\x4f\x4d\x20\157\160\145\x72\x74\151\x20\141\61\40\x57\110\105\122\105\x20\141\61\56\x74\x69\x70\157\144\x6f\143\75\x27\x4e\x2f\x44\47\40\46\46\40\x61\x31\x2e\x64\x6f\x63\x75\155\x65\x6e\164\157\x66\x69\x73\x63\x61\x6c\x3d\47\x49\x47\x54\x46\x27\x20\x26\46\40\x61\61\x2e\x66\x65\x63\150\x61\x79\x68\x6f\162\x61\76\75\x27{$desde}\47\x20\x26\x26\x20\141\x31\56\146\145\x63\x68\141\x79\150\157\162\x61\74\75\47{$hasta}\47\51\x2c\x32\51\x20\x49\x47\x54\x46\x2c\x4e\117\x57\x28\x29\x20\146\145\143\150\141\171\x68\x6f\x72\141\x2c\x20\x6e\x75\154\x6c\x20\156\x6f\155\142\162\145\54\x27\x54\157\164\141\154\47\x20\x66\x65\x63\x68\x61\12\x20\40\40\x20\40\x46\122\117\x4d\40\x6f\x70\145\x72\164\x69\x20\x61\x20\127\x48\105\x52\105\x20\164\x69\x70\x6f\144\x6f\143\x20\111\116\x20\x28\x27\x46\x41\103\47\x2c\x27\x4e\x2f\x43\47\x2c\47\x4e\57\x44\47\51\12\x20\40\x20\40\46\x26\40\141\x2e\146\x65\x63\x68\141\143\162\x65\x61\76\75\47{$desde}\47\x20\46\x26\x20\141\x2e\x66\145\143\150\141\143\162\145\141\74\75\47{$hasta}\47\40\12\40\x20\40\x20\125\x4e\x49\x4f\116\xa\x20\x20\40\40\123\105\x4c\105\103\x54\x20\x64\157\x63\x75\x6d\145\x6e\164\157\x2c\111\x46\x28\x74\151\x70\x6f\144\x6f\143\75\47\x46\x41\103\x27\54\47\106\101\x43\124\125\x52\101\x27\54\x49\x46\x28\x74\x69\x70\157\144\x6f\x63\75\47\x4e\57\x43\x27\54\x27\x4e\117\124\x41\40\104\105\x20\x43\122\105\x44\x49\x54\117\x27\54\x49\106\50\x74\151\160\x6f\144\157\143\75\47\x4e\57\x44\47\x2c\47\116\x4f\x54\x41\x20\x44\x45\x20\104\105\x42\111\x54\x4f\x27\54\x49\x46\50\x74\151\x70\x6f\x64\157\x63\x3d\x27\122\x45\x54\x27\x2c\x27\122\105\x54\x45\x4e\103\x49\x4f\116\47\54\47\116\x2f\101\x27\51\x29\x29\x29\40\164\x69\x70\x6f\x64\x6f\143\x2c\141\56\x6f\162\144\x65\x6e\x20\x6e\143\x6f\156\x74\x72\157\x6c\x2c\x27\103\117\116\x54\x52\111\x42\x55\x59\x45\116\124\x45\x27\40\164\x69\x70\157\143\x6f\156\164\x2c\xa\40\x20\x20\x20\141\x2e\x72\x69\146\54\x49\x46\50\141\x2e\x74\x69\160\157\x64\x6f\143\x21\x3d\47\x52\x45\124\x27\x20\x26\46\x20\141\x2e\144\x6f\143\165\155\145\x6e\164\x6f\x66\x69\x73\143\x61\154\41\x3d\47\x49\x47\x54\106\47\54\122\x4f\125\116\x44\50\x61\x2e\x74\157\164\141\154\x66\151\x6e\141\x6c\x2c\x32\51\54\x30\x2e\60\60\51\x20\x74\x6f\x74\x61\154\x2c\x49\x46\50\141\56\144\x6f\x63\165\155\x65\156\x74\157\x66\151\x73\143\x61\x6c\x3d\x27\x49\107\124\106\47\54\60\54\122\117\125\116\104\x28\141\x2e\x62\141\x73\x65\151\x6d\x70\x6f\x31\x2c\x32\x29\x29\x20\142\141\x73\145\151\x6d\160\x6f\x6e\x69\142\x6c\145\x2c\111\x46\x28\x61\56\x74\x6f\x74\x69\x6d\x70\165\145\163\164\76\60\x2c\47\61\66\56\60\x30\47\54\47\x30\x2e\x30\x30\x27\51\40\141\x6c\x69\143\x75\157\164\x61\54\x52\x4f\x55\x4e\x44\50\x61\x2e\164\157\164\x69\x6d\x70\x75\145\x73\x74\x2c\62\x29\x20\x49\126\x41\x2c\122\x4f\125\116\104\50\141\56\163\151\x6e\151\155\x70\x75\x65\163\164\x2c\62\51\x20\145\x78\143\x65\156\x74\157\x2c\xa\40\x20\x20\x20\x49\x46\x28\x61\x2e\x74\151\x70\x6f\144\157\x63\x3d\47\x52\105\x54\47\54\x52\x4f\x55\x4e\x44\50\x61\x2e\164\x6f\164\x61\x6c\x66\151\x6e\x61\x6c\54\x32\51\54\x30\56\60\x30\51\x20\162\x65\164\151\145\x6e\x65\x2c\111\x46\x28\141\x2e\x64\157\143\165\x6d\145\156\164\x6f\x66\x69\163\143\x61\x6c\75\x27\111\x47\124\106\47\54\122\117\125\116\x44\50\x28\141\x2e\x74\x6f\164\141\x6c\x66\x69\x6e\x61\x6c\52\61\x30\x30\x29\x2f\x33\x2c\x32\x29\54\60\x29\40\x62\x61\x73\145\151\x6d\x70\157\156\x69\142\x6c\145\137\x49\x47\124\x46\54\111\x46\50\141\56\144\157\x63\x75\155\x65\x6e\164\x6f\x66\x69\x73\143\141\154\75\47\x49\x47\x54\x46\47\x2c\x52\x4f\125\x4e\104\x28\x61\x2e\164\x6f\x74\x61\x6c\146\x69\156\141\154\x2c\62\x29\54\60\56\x30\x30\x29\40\x49\x47\124\106\x2c\x61\56\x66\x65\143\150\141\171\150\157\x72\x61\x2c\12\x20\40\x20\40\141\x2e\156\157\155\x62\162\x65\x63\x6c\151\40\156\157\x6d\x62\162\x65\x2c\x61\x2e\146\x65\x63\150\141\143\162\x65\141\x20\146\x65\143\150\x61\12\40\x20\40\x20\40\x46\122\x4f\115\40\x6f\160\x65\162\164\x69\x20\141\x20\127\x48\x45\x52\105\40\x74\x69\x70\157\x64\x6f\x63\x20\111\x4e\40\50\47\106\101\103\47\x2c\x27\x4e\57\103\x27\54\47\x4e\x2f\104\x27\x2c\x27\x52\105\x54\x27\51\12\40\40\x20\40\46\x26\x20\x61\x2e\x66\x65\143\x68\x61\143\162\x65\141\76\75\x27{$desde}\47\x20\x26\x26\x20\141\x2e\146\145\143\150\141\143\x72\145\141\74\75\47{$hasta}\47\12\40\x20\40\x20\51\40\x6c\151\x62\x72\157\x76\145\156\164\x61\x73\x20\117\x52\104\x45\x52\x20\102\x59\40\x6e\x63\x6f\x6e\x74\x72\x6f\x6c\x20\101\x53\x43\xa\x20\40\40\40"); } function exportexcellibrocomp($desde, $hasta) { return $this->db->query("\123\x45\114\x45\103\x54\x20\144\x61\164\x65\x5f\146\x6f\162\155\x61\164\50\x66\145\143\150\x61\54\x20\47\x25\x64\55\45\x6d\55\45\x59\47\x29\x20\x66\x65\x63\150\x61\54\40\164\x69\x70\x6f\144\x6f\143\54\x72\151\x66\54\156\157\155\x62\162\x65\54\146\141\x63\x74\x75\x72\x61\x2c\x6e\x5f\x63\x6f\x6e\164\x72\157\x6c\x2c\x6e\157\164\x61\x5f\x64\145\142\151\x74\x6f\x2c\x6e\x6f\x74\141\x5f\143\162\145\x64\x69\x74\157\54\x66\141\143\x74\165\x72\141\x5f\x61\x66\145\x63\164\x61\144\141\x2c\x52\117\x55\x4e\x44\50\164\x6f\x74\x61\154\x2c\62\51\164\157\x74\x61\154\54\122\117\x55\x4e\x44\50\145\x78\x63\145\x6e\164\x6f\x2c\x32\x29\145\x78\143\145\156\x74\x6f\54\122\x4f\x55\x4e\x44\50\x62\x61\x73\x65\137\x69\155\x70\157\156\151\x62\154\x65\54\62\x29\x20\x62\x61\163\145\137\x69\155\160\157\156\x69\142\x6c\x65\54\x20\x61\x6c\x69\143\165\157\x74\x61\54\40\122\x4f\x55\x4e\104\50\151\166\x61\x2c\x32\x29\40\151\x76\x61\54\40\x52\x4f\x55\116\104\50\x69\166\141\x5f\x72\145\x74\x65\156\151\144\x6f\54\x32\51\x20\151\166\141\x5f\x72\145\164\145\156\x69\144\157\54\x20\141\154\x69\x63\x75\x6f\164\141\x5f\x72\145\164\145\156\143\151\157\156\x2c\40\143\x6f\x6d\160\162\157\x62\x61\x6e\164\145\137\x72\x65\164\x65\x6e\143\x69\x6f\x6e\x2c\x62\141\x73\x65\x69\x6d\x70\x6f\156\x69\142\154\x65\x5f\111\107\124\x46\54\x20\47\47\x20\x70\x61\147\x6f\x5f\x69\147\x74\x66\x32\54\160\x61\x67\157\x5f\x69\147\164\x66\40\106\x52\x4f\x4d\x20\x28\xa\40\x20\40\40\x20\40\40\40\x53\x45\114\105\103\124\40\x49\x46\x28\x61\x2e\164\x69\160\x6f\144\x6f\x63\x21\75\x27\x52\x45\124\x27\54\x61\x2e\146\145\x63\x68\141\x64\x6f\143\x2c\x61\x2e\146\x65\143\x68\x61\x72\145\x74\51\40\x66\x65\x63\150\x61\54\40\x49\x46\x28\141\56\x74\151\160\x6f\144\157\143\75\x27\106\101\103\x27\x2c\x27\x46\101\x43\124\x55\x52\101\47\x2c\111\x46\x28\x61\56\164\151\160\x6f\x64\157\x63\75\47\116\57\104\47\54\x27\116\117\x54\101\40\x44\105\40\104\105\102\111\x54\117\47\54\111\106\50\141\x2e\x74\x69\160\x6f\x64\157\143\75\47\116\x2f\103\x27\x2c\x27\x4e\117\124\x41\x20\x44\105\40\x43\122\x45\x44\111\124\x4f\47\54\111\106\x28\x61\56\x74\151\x70\157\144\x6f\x63\x3d\x27\122\105\124\x27\x2c\x27\122\x45\x54\x45\x4e\x43\x49\x4f\x4e\47\x2c\x27\x27\x29\51\x29\x29\40\164\151\160\157\x64\x6f\143\x2c\x20\x28\123\105\114\x45\103\124\40\x72\x69\x66\40\x46\x52\117\115\x20\x70\162\157\x76\145\145\x64\x20\127\110\x45\122\x45\x20\x69\144\75\141\x2e\160\162\x6f\166\145\x65\x64\51\x20\162\x69\x66\x2c\x28\x53\x45\x4c\105\103\x54\40\156\157\155\142\162\145\40\106\122\117\x4d\x20\160\162\x6f\166\145\145\144\40\127\x48\x45\x52\105\40\x69\144\75\141\56\160\162\x6f\166\145\145\144\x29\x20\156\x6f\155\x62\162\145\x2c\12\x20\x20\x20\40\40\x20\40\x20\111\106\50\141\x2e\x74\151\160\x6f\x64\157\143\75\x27\x46\101\x43\47\x2c\x61\x2e\144\x6f\143\165\155\x65\156\164\157\x2c\x27\47\51\x20\x66\141\143\164\165\x72\x61\54\40\111\106\x28\141\56\x74\151\x70\157\144\x6f\x63\x21\x3d\47\x52\x45\124\47\x2c\141\x2e\x6e\x63\x6f\x6e\x74\162\x6f\x6c\x2c\x27\47\x29\40\x6e\137\143\157\156\164\162\157\154\54\x20\x49\106\x28\141\56\164\151\x70\x6f\x64\x6f\x63\75\47\116\x2f\104\x27\54\x61\56\x64\x6f\143\165\x6d\145\x6e\164\x6f\x2c\x27\x27\x29\40\156\x6f\x74\x61\x5f\x64\145\142\x69\164\157\x2c\x20\x49\x46\x28\x61\x2e\x74\x69\x70\157\x64\157\x63\75\x27\116\57\103\47\x2c\141\x2e\x64\157\x63\165\155\x65\x6e\164\157\x2c\47\47\51\40\x6e\x6f\x74\x61\x5f\143\x72\x65\144\x69\164\x6f\x2c\111\x46\x28\141\56\164\151\x70\x6f\144\157\x63\x3d\47\116\57\104\x27\40\x7c\174\x20\141\56\164\151\x70\157\x64\x6f\143\75\x27\116\x2f\103\x27\x2c\141\x2e\162\x65\x66\145\162\x65\x6e\x63\151\x61\54\x49\106\x28\x61\56\x74\x69\160\157\x64\x6f\143\75\x27\x52\105\124\47\54\x61\x2e\x64\157\143\165\155\x65\156\x74\157\54\47\x27\x29\x29\x20\146\141\x63\x74\x75\162\x61\x5f\x61\x66\x65\x63\164\x61\144\141\54\40\12\x20\x20\x20\40\x20\x20\40\40\111\106\50\141\56\x74\151\x70\x6f\144\157\143\41\75\47\x52\105\124\47\x2c\x61\x2e\x74\157\164\x61\154\54\x27\47\x29\x20\x74\x6f\x74\141\154\x2c\x49\106\x28\141\56\164\x69\x70\157\144\157\x63\41\x3d\47\122\x45\x54\47\54\141\56\163\151\156\x69\x6d\160\165\145\x73\164\54\47\x27\51\x20\x65\x78\x63\145\156\x74\x6f\x2c\x49\106\x28\141\56\164\151\x70\x6f\144\x6f\143\x21\x3d\x27\x52\x45\124\47\54\x61\56\x62\x61\x73\145\x69\x6d\160\x6f\54\x27\47\51\x20\142\141\163\145\137\151\155\x70\157\156\151\142\154\145\54\x27\61\x36\45\x27\40\141\x6c\151\143\165\157\x74\141\54\40\x49\x46\x28\x61\x2e\164\151\160\x6f\x64\157\x63\x21\x3d\x27\122\x45\124\47\54\141\56\x74\157\x74\x69\x6d\x70\x75\x65\x73\x74\x2c\x27\47\x29\40\x69\166\x61\54\40\x20\12\x20\40\40\x20\40\40\x20\40\111\106\x28\x61\56\x74\x69\x70\157\144\x6f\143\75\47\x52\105\124\x27\54\141\x2e\x72\145\164\x69\145\156\x65\x2c\x27\x27\x29\x20\151\x76\141\137\x72\145\164\145\x6e\151\144\157\54\x20\111\106\x28\x61\56\x74\151\160\x6f\144\157\x63\75\x27\122\105\124\47\x2c\50\x53\x45\x4c\x45\x43\x54\x20\x72\145\164\151\145\x6e\145\40\x46\x52\x4f\115\40\160\162\x6f\166\145\145\x64\x20\127\110\105\x52\105\x20\x69\x64\75\x61\x2e\x70\162\157\x76\x65\145\x64\x29\54\x27\x27\x29\40\141\x6c\x69\x63\x75\x6f\164\141\x5f\162\x65\x74\x65\156\x63\x69\x6f\x6e\54\x20\111\x46\x28\141\x2e\164\x69\x70\x6f\144\157\143\x3d\47\122\105\x54\x27\x2c\141\56\x6e\x72\x65\164\x2c\47\47\51\40\x63\157\155\x70\x72\x6f\x62\x61\x6e\164\145\x5f\162\145\164\145\156\x63\x69\x6f\x6e\54\40\x27\x27\x20\x62\x61\x73\145\x69\x6d\160\x6f\156\x69\x62\x6c\145\x5f\x49\107\124\x46\x2c\40\x27\47\40\x70\x61\x67\157\137\151\x67\x74\146\40\xa\40\40\40\x20\40\x20\x20\40\40\x46\122\117\115\40\x63\157\x6d\160\162\x61\x73\x20\x61\x20\127\110\105\x52\x45\40\141\56\x66\x65\x63\x68\141\171\x68\157\x72\x61\x3e\75\47{$desde}\40\60\60\72\60\60\x3a\x30\x30\47\x20\x26\x26\40\x61\56\x66\x65\143\x68\141\171\150\157\162\141\74\x3d\47{$hasta}\x20\x32\63\x3a\x35\x39\72\x30\x30\47\x20\x4f\x52\104\105\x52\40\x42\131\40\141\56\x66\x65\143\150\x61\x79\150\157\162\x61\40\x41\x53\x43\xa\40\x20\40\x20\40\40\40\x20\51\x20\x6c\151\x62\162\x6f\143\157\155\x70\x72\x61\163"); } function exportexcellibroinv($desde, $hasta) { return $this->db->query("\123\105\114\105\x43\124\x20\x63\x6f\144\151\x67\x6f\x2c\156\157\155\x62\162\145\54\145\170\151\163\x74\137\151\156\151\143\x69\x61\x6c\54\x63\x6f\x73\164\x6f\40\143\157\x73\x74\x6f\61\x2c\x65\170\151\163\164\x5f\151\156\x69\x63\x69\141\154\52\143\x6f\163\x74\157\40\x63\157\163\x74\x6f\137\164\157\164\x61\154\x31\x2c\145\156\164\162\x61\x64\141\54\143\157\163\x74\157\x20\x63\x6f\x73\x74\157\x32\54\x65\x6e\164\162\x61\x64\141\x2a\143\x6f\x73\164\x6f\40\143\x6f\163\x74\157\x5f\164\157\x74\x61\x6c\x32\54\x73\141\154\151\144\x61\x2c\x63\157\x73\164\157\40\143\157\x73\164\x6f\63\x2c\x73\x61\154\151\x64\x61\x2a\143\157\163\x74\x6f\40\x63\157\163\164\157\x5f\x74\x6f\x74\x61\x6c\63\x2c\141\x75\164\x6f\143\157\156\163\165\x6d\x6f\54\x63\x6f\x73\x74\x6f\x20\x63\x6f\x73\164\157\64\54\x61\x75\164\x6f\x63\x6f\x6e\163\x75\x6d\x6f\52\x63\157\x73\164\157\40\x63\157\163\164\x6f\137\x74\157\x74\141\x6c\x34\54\40\145\170\151\x73\x74\137\151\156\151\x63\151\x61\154\53\145\x6e\164\x72\x61\144\141\55\141\165\164\x6f\x63\157\x6e\163\165\155\x6f\x2d\x73\x61\x6c\151\x64\x61\40\145\x78\x69\163\x74\137\146\151\156\141\x6c\x2c\x20\143\157\163\x74\x6f\40\x63\x6f\x73\164\x6f\65\54\x20\50\x65\170\151\x73\x74\137\151\x6e\151\143\x69\x61\x6c\53\145\x6e\x74\x72\141\x64\141\55\x61\x75\164\157\143\x6f\156\163\165\x6d\157\x2d\163\x61\154\x69\x64\141\x29\52\x63\157\x73\164\157\40\143\157\163\164\x6f\x5f\164\157\164\141\x6c\x35\x20\106\122\x4f\115\40\50\12\40\40\40\40\40\40\40\40\40\40\x20\x20\x53\x45\114\105\103\124\x20\143\x6f\144\151\x67\157\x2c\x43\x4f\x4e\x43\101\x54\x28\x6e\157\x6d\142\162\145\54\x27\40\x41\x6c\155\x61\143\145\156\x3a\x20\x27\x2c\x61\x6c\155\x61\143\x65\156\x2c\x27\x20\114\157\x74\x65\x3a\x20\47\54\154\x6f\164\145\x29\x20\156\157\155\x62\x72\x65\54\143\x6f\x73\x74\157\54\12\40\x20\40\40\x20\x20\x20\40\40\40\x20\40\111\106\50\x63\x61\x72\x67\157\x69\x6e\x69\x2b\143\141\x72\147\157\x69\156\x69\x32\53\151\156\x67\x72\x65\163\157\151\x6e\151\x2b\144\x65\166\x75\145\154\x74\141\x69\156\151\55\x65\x67\x72\145\x73\x6f\x69\156\151\x2d\144\x65\163\143\141\162\x67\157\151\156\151\x2d\x64\145\163\x63\x61\162\147\x6f\151\x6e\x69\62\x3e\60\54\x63\141\162\x67\x6f\151\156\x69\x2b\x63\141\x72\x67\157\151\156\x69\x32\x2b\x69\x6e\x67\x72\x65\163\x6f\151\x6e\x69\53\x64\145\166\x75\145\154\164\x61\x69\156\x69\x2d\x65\147\162\145\163\157\151\156\x69\55\144\x65\163\143\x61\x72\147\x6f\151\156\x69\x2d\144\x65\163\143\x61\x72\147\157\x69\156\x69\62\x2c\60\51\x20\x65\170\151\x73\164\137\151\156\x69\x63\x69\141\154\54\xa\x20\40\40\40\x20\40\40\x20\40\40\40\x20\151\156\x67\162\145\163\x6f\x2b\x63\x61\162\x67\x6f\x2b\143\141\x72\x67\x6f\x32\x2b\144\x65\x76\165\x65\154\164\141\40\x65\156\164\x72\141\144\141\54\x20\x65\x67\162\x65\163\x6f\40\163\x61\154\x69\x64\141\x2c\x64\145\163\143\x61\x72\147\x6f\x2b\144\145\163\143\x61\162\147\x6f\x32\x20\141\165\164\157\143\157\156\163\165\155\x6f\40\x46\122\x4f\x4d\x20\50\xa\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\123\105\x4c\x45\x43\x54\x20\141\56\141\x6c\x6d\141\143\x65\156\54\141\x2e\x63\157\144\x69\147\x6f\x61\x72\164\40\143\x6f\x64\151\147\157\x2c\142\56\156\x6f\x6d\x62\162\145\x2c\141\56\154\157\164\x65\54\xa\40\40\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x49\x46\50\50\123\105\114\x45\103\124\40\123\x55\x4d\x28\x63\x61\156\x74\51\40\x46\122\117\x4d\x20\141\152\165\163\164\x65\151\x6e\166\40\127\110\105\122\105\40\144\141\x6c\155\x3d\141\56\x61\x6c\x6d\x61\x63\x65\x6e\40\46\x26\x20\x63\x6f\x64\151\147\x6f\x3d\x61\x2e\x63\157\x64\x69\x67\x6f\x61\162\x74\x20\46\x26\x20\x64\154\157\164\x65\x3d\141\x2e\x6c\157\164\x65\40\46\x26\40\164\x69\x70\x6f\x3d\61\x20\x26\46\40\146\145\x63\x68\x3c\47{$desde}\x27\x29\x3e\60\54\50\x53\x45\114\105\x43\124\40\123\x55\115\x28\143\141\156\164\51\40\x46\122\117\x4d\x20\141\x6a\165\x73\x74\x65\151\x6e\x76\x20\x57\110\105\122\x45\x20\x64\x61\x6c\155\x3d\x61\56\141\154\x6d\141\x63\x65\156\40\46\46\x20\143\x6f\144\151\x67\157\75\x61\x2e\x63\x6f\x64\x69\147\x6f\x61\x72\164\40\46\46\x20\144\x6c\x6f\164\145\x3d\x61\56\x6c\157\164\x65\x20\46\46\40\164\x69\160\157\75\61\40\x26\x26\x20\x66\x65\x63\x68\x3c\47{$desde}\x27\x29\54\60\51\x20\143\141\x72\x67\157\151\x6e\x69\54\xa\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\111\106\50\x28\123\105\114\x45\103\124\x20\123\125\x4d\50\x63\141\156\164\x29\x20\106\x52\x4f\115\x20\141\152\165\163\x74\145\x69\156\166\x20\x57\110\105\x52\105\40\144\141\x6c\155\x3d\x61\56\141\154\x6d\141\143\145\156\40\x26\46\x20\143\x6f\144\x69\x67\x6f\75\x61\56\143\x6f\x64\151\x67\x6f\x61\162\164\40\x26\46\x20\x64\x6c\157\164\x65\x3d\141\56\x6c\157\x74\x65\40\46\46\x20\164\151\160\x6f\x3d\63\x20\46\x26\x20\x66\145\x63\x68\x3c\47{$desde}\x27\x29\76\x30\54\50\123\x45\114\x45\103\x54\x20\x53\x55\115\50\x63\x61\156\164\51\40\x46\x52\x4f\115\x20\x61\x6a\165\163\164\x65\x69\156\166\40\127\x48\105\122\x45\x20\144\x61\x6c\x6d\75\x61\56\x61\x6c\x6d\141\x63\x65\156\40\46\x26\40\143\x6f\144\151\x67\x6f\75\141\x2e\143\157\x64\x69\x67\157\141\162\164\x20\x26\46\40\144\x6c\157\164\x65\75\x61\x2e\x6c\157\164\x65\40\46\46\x20\164\x69\x70\x6f\75\63\x20\x26\x26\40\x66\x65\143\150\74\x27{$desde}\47\x29\x2c\60\x29\40\x63\141\x72\147\x6f\x69\156\151\62\54\xa\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\111\x46\x28\x28\x53\x45\x4c\x45\x43\124\40\123\125\x4d\x28\x63\x61\x6e\164\51\x20\106\122\117\x4d\x20\141\152\x75\x73\164\145\x69\x6e\x76\40\127\x48\105\122\105\40\x64\141\x6c\155\x3d\141\x2e\141\x6c\155\141\143\145\156\40\x26\x26\40\x63\x6f\x64\x69\x67\x6f\75\141\x2e\x63\x6f\x64\x69\x67\x6f\x61\162\x74\40\46\x26\x20\144\x6c\x6f\164\x65\75\x61\x2e\154\x6f\x74\145\x20\x26\46\40\x74\x69\160\157\75\60\x20\x26\x26\x20\x66\145\x63\150\x3c\x27{$desde}\x27\51\x3e\60\x2c\x28\123\x45\x4c\x45\103\x54\x20\x53\x55\x4d\50\x63\141\x6e\x74\51\40\106\x52\x4f\x4d\40\141\152\x75\163\164\145\x69\x6e\x76\40\x57\110\x45\x52\105\x20\x64\141\154\x6d\75\141\x2e\x61\154\x6d\141\143\x65\156\x20\46\46\x20\x63\157\144\x69\x67\x6f\x3d\x61\56\x63\157\144\151\x67\157\x61\x72\x74\40\x26\x26\40\x64\x6c\157\164\145\75\141\56\x6c\157\x74\145\x20\x26\x26\40\x74\x69\x70\x6f\x3d\x30\40\46\46\40\146\x65\143\150\x3c\x27{$desde}\47\x29\x2c\x30\51\x20\144\145\x73\x63\141\x72\x67\157\151\156\x69\54\12\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\x49\x46\50\x28\x53\105\x4c\x45\x43\x54\40\x53\x55\x4d\x28\143\141\156\x74\51\x20\106\122\x4f\115\x20\141\x6a\x75\x73\164\x65\151\x6e\166\40\x57\110\105\122\105\x20\x61\154\155\75\x61\x2e\141\154\x6d\141\x63\x65\x6e\40\x26\x26\x20\143\x6f\144\151\x67\157\x3d\x61\56\143\157\144\151\x67\x6f\141\162\x74\x20\46\x26\40\154\x6f\164\145\x3d\x61\x2e\154\157\164\x65\x20\x26\x26\40\164\151\x70\x6f\75\63\x20\x26\46\40\146\x65\143\x68\x3c\47{$desde}\x27\x29\76\x30\x2c\x28\123\x45\x4c\105\103\x54\40\123\x55\115\x28\143\x61\156\x74\51\x20\106\122\x4f\x4d\40\141\x6a\x75\163\164\x65\151\156\166\x20\127\x48\x45\122\105\40\x61\154\155\75\141\56\x61\x6c\x6d\x61\143\145\x6e\40\x26\46\x20\143\x6f\x64\x69\147\x6f\75\x61\x2e\x63\157\144\x69\x67\x6f\141\162\x74\x20\46\46\x20\154\157\x74\x65\x3d\x61\56\154\157\x74\145\x20\x26\x26\40\164\151\x70\157\x3d\63\x20\46\46\40\x66\x65\143\x68\74\x27{$desde}\x27\51\x2c\x30\51\40\x64\x65\163\143\x61\162\x67\157\151\156\151\x32\54\xa\x20\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\111\106\x28\x28\x53\x45\114\x45\103\124\40\123\125\x4d\50\143\x61\x6e\x74\x29\x20\106\x52\x4f\x4d\40\151\x74\157\x72\x64\143\x20\141\x31\x20\x4a\x4f\111\x4e\x20\157\x72\x64\143\40\142\x31\x20\x4f\x4e\40\x61\61\56\x6f\162\x64\x63\75\142\61\56\x69\144\x20\127\x48\x45\x52\x45\40\142\x31\56\x61\x6c\x6d\141\143\145\x6e\x3d\141\56\141\154\x6d\x61\143\x65\x6e\x20\46\x26\40\x61\61\x2e\x63\x6f\144\151\147\157\x3d\141\x2e\143\x6f\x64\151\x67\x6f\x61\x72\164\40\46\46\x20\x6c\x6f\164\145\75\x61\56\x6c\157\x74\145\x20\x26\46\x20\x62\x31\56\146\x72\145\143\145\x70\76\47\62\x30\x32\63\x2d\x31\62\x2d\62\x39\x27\40\x26\46\40\142\x31\56\x66\162\145\143\x65\160\x3c\x27{$desde}\x27\51\76\60\54\x28\123\105\x4c\105\x43\x54\40\x53\125\x4d\x28\x63\141\x6e\164\x29\40\106\x52\x4f\x4d\40\151\164\x6f\162\144\143\40\141\61\40\x4a\117\x49\x4e\40\x6f\x72\x64\143\40\142\61\x20\x4f\116\x20\141\x31\56\157\x72\x64\143\x3d\x62\x31\x2e\x69\144\40\x57\x48\x45\122\105\40\142\61\56\141\x6c\x6d\x61\x63\145\x6e\x3d\x61\56\141\x6c\155\x61\143\x65\156\x20\46\x26\x20\141\61\56\x63\x6f\144\151\147\157\x3d\141\56\143\157\144\151\x67\157\141\162\x74\x20\46\x26\40\154\x6f\x74\x65\75\141\x2e\x6c\x6f\x74\x65\40\x26\x26\40\x62\x31\x2e\146\x72\x65\x63\x65\x70\x3e\x27\x32\60\x32\x33\55\x31\x32\55\62\71\x27\40\x26\x26\40\142\61\56\x66\x72\145\143\x65\160\74\x27{$desde}\47\x29\x2c\x30\x29\x20\x69\x6e\x67\162\x65\163\157\x69\x6e\151\x2c\xa\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\40\122\x4f\x55\x4e\x44\50\x49\x46\50\x28\123\x45\114\x45\103\x54\x20\x53\x55\x4d\x28\143\141\156\164\x69\144\141\x64\x29\x20\x46\122\x4f\115\40\157\x70\x65\x72\155\166\40\x57\x48\105\122\105\x20\141\x6c\155\141\143\x65\156\x3d\141\x2e\141\154\x6d\x61\143\x65\x6e\x20\x26\46\x20\143\157\144\151\147\157\x3d\141\x2e\143\x6f\x64\x69\147\157\141\162\164\40\x26\x26\40\x6c\x6f\x74\x65\75\x61\56\154\x6f\x74\x65\40\46\46\40\x28\x74\151\160\157\144\x6f\x63\x3d\47\x46\101\x43\47\x20\174\x7c\x20\164\151\160\157\144\x6f\143\x3d\47\x4e\x4f\124\47\x29\x20\x26\46\x20\x66\145\143\x68\141\144\x6f\x63\x3e\x27\x32\x30\62\63\x2d\x31\62\x2d\62\x39\x27\40\46\46\x20\146\x65\x63\150\x61\144\x6f\x63\x3c\x27{$desde}\47\51\x3e\x30\x2c\50\123\105\114\105\103\124\40\123\125\x4d\50\143\x61\x6e\x74\x69\144\141\x64\x29\x20\x46\x52\x4f\x4d\x20\x6f\x70\145\x72\x6d\x76\x20\127\110\105\x52\105\x20\x61\x6c\155\141\x63\145\156\75\141\x2e\x61\x6c\155\141\x63\x65\x6e\x20\46\x26\x20\x63\157\144\x69\x67\x6f\x3d\141\56\x63\157\x64\151\x67\x6f\x61\162\x74\x20\x26\46\x20\x6c\157\x74\145\75\141\x2e\x6c\x6f\164\x65\40\x26\46\x20\x28\x74\151\160\157\x64\x6f\x63\x3d\47\106\101\x43\47\40\x7c\x7c\40\x74\151\x70\157\144\157\143\x3d\x27\x4e\117\x54\47\x29\x20\46\x26\40\146\145\143\150\x61\144\x6f\x63\76\x27\x32\60\x32\x33\x2d\61\62\x2d\x32\x39\x27\40\46\46\40\x66\145\x63\x68\141\x64\x6f\x63\74\47{$desde}\47\51\x2c\x30\x29\54\x30\51\40\145\147\162\x65\163\x6f\x69\x6e\x69\54\12\x20\x20\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\40\x52\117\x55\x4e\x44\50\111\x46\x28\x28\123\105\114\x45\x43\x54\40\123\x55\115\x28\x63\156\164\144\145\166\165\145\x6c\164\51\40\x46\122\x4f\x4d\40\144\145\166\157\154\x6d\166\x20\x57\x48\105\x52\105\x20\141\x6c\x6d\x61\143\x65\x6e\75\141\56\x61\154\x6d\x61\x63\x65\156\x20\x26\46\x20\143\x6f\x64\x69\147\x6f\x3d\x61\x2e\x63\x6f\x64\151\x67\157\x61\162\164\40\x26\x26\40\x6c\157\x74\x65\75\x61\x2e\x6c\x6f\164\145\40\x26\x26\40\164\151\160\157\x64\x6f\x63\75\x27\x44\105\126\47\40\46\46\40\x66\145\143\x68\x61\x64\x6f\143\76\x27\62\x30\x32\63\55\x31\x32\x2d\62\71\47\40\46\x26\x20\146\145\x63\150\x61\144\x6f\143\x3c\x27{$desde}\x27\x29\x3e\x30\x2c\x28\123\105\114\105\x43\124\x20\123\125\x4d\50\143\156\164\x64\145\166\165\x65\x6c\164\51\x20\x46\x52\x4f\x4d\x20\x64\145\x76\157\154\155\x76\x20\x57\110\105\x52\x45\40\141\x6c\155\x61\x63\x65\x6e\75\141\x2e\x61\x6c\155\x61\143\145\156\x20\46\46\x20\143\157\x64\x69\x67\x6f\75\141\56\x63\157\x64\x69\147\x6f\141\162\x74\x20\46\x26\x20\154\157\164\x65\75\141\56\154\157\164\145\x20\46\46\40\x74\x69\160\157\144\x6f\x63\75\47\104\105\126\x27\40\x26\46\40\146\145\143\x68\141\144\157\143\76\x27\x32\x30\x32\x33\x2d\x31\62\x2d\x32\x39\47\x20\x26\46\40\146\145\x63\150\141\x64\157\x63\74\x27{$desde}\47\x29\54\60\51\x2c\60\51\x20\x64\145\166\165\x65\x6c\x74\141\151\x6e\151\54\12\40\x20\40\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\x49\106\x28\50\x53\x45\114\105\x43\124\40\x53\125\115\50\143\x61\x6e\164\x29\40\106\x52\x4f\115\x20\141\x6a\x75\163\x74\145\151\156\x76\x20\127\x48\105\122\105\x20\x64\x61\x6c\155\75\x61\x2e\x61\x6c\x6d\x61\x63\x65\156\x20\x26\x26\40\x63\157\144\x69\x67\x6f\x3d\x61\x2e\143\157\x64\x69\x67\x6f\141\x72\x74\40\x26\x26\x20\144\154\x6f\164\x65\75\141\56\154\x6f\164\145\x20\46\x26\x20\164\151\x70\157\75\61\40\46\46\x20\x66\145\143\150\76\x3d\x27{$desde}\x27\x20\46\46\40\x66\145\x63\150\74\x3d\47{$hasta}\47\x29\76\x30\x2c\x28\x53\x45\114\x45\103\x54\x20\x53\x55\x4d\50\143\x61\156\x74\x29\40\x46\x52\117\115\x20\141\152\x75\x73\x74\x65\151\156\166\x20\127\x48\105\122\x45\x20\x64\x61\154\155\x3d\141\56\x61\x6c\155\141\x63\145\x6e\40\46\x26\40\x63\x6f\144\151\147\x6f\x3d\141\56\x63\157\x64\151\147\x6f\x61\162\x74\x20\46\x26\x20\x64\x6c\157\x74\145\75\x61\56\x6c\x6f\164\x65\x20\x26\46\x20\164\151\160\157\x3d\x31\40\46\x26\40\x66\145\x63\x68\x3e\x3d\47{$desde}\47\40\46\x26\x20\x66\145\143\150\74\x3d\47{$hasta}\x27\x29\54\x30\x29\x20\143\141\x72\147\157\54\12\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\x49\x46\50\x28\123\105\x4c\x45\103\x54\40\123\125\115\50\x63\141\x6e\164\51\x20\x46\122\117\115\x20\x61\152\x75\163\164\145\151\156\166\40\x57\110\x45\122\x45\40\144\x61\154\155\75\x61\56\x61\x6c\x6d\x61\x63\x65\x6e\x20\x26\46\40\x63\157\144\151\147\x6f\x3d\141\x2e\143\157\144\x69\x67\157\x61\x72\x74\40\x26\46\x20\x64\x6c\x6f\x74\x65\x3d\x61\56\154\x6f\x74\x65\x20\x26\x26\40\164\x69\x70\157\75\63\x20\46\x26\40\146\x65\143\150\76\75\47{$desde}\47\40\x26\46\40\x66\x65\143\x68\x3c\75\x27{$hasta}\x27\51\76\x30\x2c\50\123\x45\114\x45\x43\x54\40\x53\125\x4d\50\143\x61\156\x74\x29\x20\x46\122\x4f\x4d\x20\141\152\165\x73\164\x65\x69\x6e\166\40\x57\x48\105\122\x45\x20\x64\141\x6c\x6d\75\141\x2e\141\154\155\x61\143\145\x6e\40\46\46\x20\143\157\144\151\147\157\x3d\141\56\x63\157\x64\x69\x67\x6f\x61\x72\x74\x20\x26\x26\40\x64\154\157\x74\145\75\x61\x2e\154\x6f\x74\145\x20\46\46\x20\x74\151\x70\x6f\75\63\40\x26\46\40\x66\x65\143\x68\x3e\75\x27{$desde}\x27\x20\x26\x26\40\146\x65\x63\150\74\75\47{$hasta}\47\x29\54\x30\51\40\x63\141\162\x67\x6f\x32\x2c\12\40\40\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x49\x46\50\x28\123\x45\114\105\x43\124\40\123\125\115\50\143\x61\156\164\51\x20\106\122\x4f\115\40\x61\152\165\x73\x74\145\x69\156\166\x20\127\x48\105\122\105\x20\144\141\x6c\155\x3d\x61\56\141\154\155\x61\x63\x65\x6e\x20\x26\x26\x20\143\157\x64\151\147\157\x3d\x61\x2e\x63\157\x64\151\147\x6f\141\162\164\40\46\x26\40\144\x6c\x6f\x74\x65\x3d\x61\56\x6c\x6f\164\145\40\x26\x26\x20\164\x69\x70\157\75\60\x20\x26\46\x20\x66\x65\143\150\x3e\75\47{$desde}\47\40\46\46\x20\146\x65\143\150\74\75\47{$hasta}\x27\x29\76\x30\54\50\x53\x45\114\x45\103\x54\40\x53\125\115\50\x63\x61\156\x74\x29\x20\x46\122\x4f\x4d\40\x61\x6a\x75\163\164\x65\151\156\x76\40\127\x48\105\122\105\40\144\x61\154\x6d\75\x61\x2e\x61\x6c\155\141\143\145\x6e\40\x26\x26\40\x63\157\144\151\147\157\75\141\56\x63\x6f\144\x69\147\x6f\x61\162\164\x20\46\x26\40\x64\154\157\164\x65\x3d\141\56\x6c\x6f\x74\145\x20\x26\x26\x20\x74\x69\160\157\75\x30\40\46\46\x20\x66\x65\x63\150\x3e\x3d\47{$desde}\x27\40\x26\x26\40\146\x65\143\x68\74\75\47{$hasta}\47\51\x2c\60\51\40\144\145\163\x63\x61\162\x67\157\54\xa\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\x20\x20\40\x20\111\106\x28\50\x53\105\x4c\105\103\124\40\123\125\x4d\50\143\x61\x6e\x74\51\40\x46\x52\117\115\x20\141\x6a\165\163\x74\x65\x69\x6e\166\x20\127\x48\x45\122\x45\x20\x61\x6c\155\75\141\56\141\x6c\155\141\x63\x65\156\40\46\46\x20\x63\x6f\144\151\147\x6f\x3d\x61\x2e\143\157\x64\x69\x67\157\x61\x72\x74\40\x26\46\40\x6c\x6f\x74\x65\x3d\x61\x2e\x6c\x6f\x74\x65\x20\x26\x26\40\164\x69\160\x6f\75\x33\40\46\x26\x20\x66\x65\143\x68\76\75\x27{$desde}\47\40\x26\x26\x20\146\145\143\x68\74\x3d\x27{$hasta}\x27\x29\x3e\x30\x2c\50\123\105\x4c\x45\103\124\40\x53\125\x4d\x28\143\x61\x6e\164\51\x20\x46\122\x4f\x4d\x20\141\x6a\x75\x73\164\x65\x69\156\x76\40\127\110\x45\x52\x45\x20\141\x6c\x6d\75\141\x2e\x61\154\x6d\x61\143\145\x6e\40\46\46\40\x63\157\x64\x69\x67\157\75\141\56\x63\x6f\x64\151\x67\x6f\141\162\x74\x20\x26\x26\x20\x6c\x6f\x74\x65\x3d\141\x2e\x6c\157\164\x65\x20\46\x26\x20\164\x69\x70\x6f\x3d\x33\x20\x26\46\40\146\x65\143\x68\76\x3d\47{$desde}\x27\x20\46\x26\x20\146\x65\143\150\x3c\75\47{$hasta}\x27\x29\x2c\x30\x29\40\144\x65\x73\143\141\x72\147\157\62\x2c\12\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x49\106\50\50\123\x45\x4c\105\x43\124\40\123\125\x4d\50\x63\x61\x6e\x74\51\x20\106\x52\117\115\40\151\164\x6f\162\x64\x63\x20\141\61\40\112\x4f\x49\116\40\157\162\144\x63\40\142\61\40\117\116\x20\x61\61\x2e\157\162\144\143\75\x62\61\56\151\144\x20\x57\110\105\x52\x45\40\142\61\x2e\141\x6c\x6d\x61\143\145\x6e\75\141\56\x61\x6c\155\x61\x63\145\156\40\x26\x26\x20\141\61\x2e\143\157\144\151\147\x6f\x3d\x61\56\x63\157\144\151\x67\x6f\141\162\x74\40\x26\x26\40\x6c\x6f\164\x65\x3d\141\56\154\x6f\x74\x65\x20\46\46\x20\142\x31\x2e\146\162\x65\x63\145\x70\x3e\75\x27{$desde}\x27\40\x26\46\x20\x62\61\56\146\162\145\143\145\160\x3c\75\47{$hasta}\47\51\76\x30\x2c\50\x53\x45\x4c\x45\103\x54\40\123\125\x4d\x28\143\x61\x6e\x74\x29\40\106\122\117\x4d\x20\x69\164\157\x72\x64\143\x20\x61\61\x20\x4a\x4f\111\116\x20\157\162\x64\x63\40\142\x31\40\117\x4e\40\x61\61\56\x6f\x72\x64\x63\75\142\61\56\151\144\40\127\x48\105\122\105\x20\142\61\56\141\x6c\155\141\x63\x65\156\75\x61\x2e\141\154\x6d\x61\143\145\x6e\x20\x26\46\40\141\x31\x2e\143\157\x64\151\x67\157\x3d\x61\x2e\x63\157\144\151\x67\157\x61\162\164\x20\46\x26\40\154\x6f\164\145\75\141\x2e\x6c\x6f\164\x65\40\x26\x26\x20\x62\x31\56\x66\162\x65\x63\145\160\x3e\75\x27{$desde}\x27\40\46\x26\40\x62\x31\56\x66\x72\x65\x63\145\160\x3c\x3d\x27{$hasta}\x27\51\x2c\60\51\40\x69\x6e\x67\162\145\163\157\54\12\x20\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x52\x4f\125\116\104\x28\111\106\50\x28\123\x45\x4c\105\103\x54\40\123\x55\115\50\x63\141\156\x74\x69\x64\141\x64\51\40\x46\122\x4f\115\x20\x6f\x70\145\162\x6d\166\x20\x57\110\x45\x52\105\40\x61\154\x6d\141\143\x65\156\x3d\141\56\x61\x6c\x6d\x61\143\x65\156\40\x26\46\x20\143\x6f\x64\151\x67\157\75\141\x2e\x63\x6f\x64\x69\147\x6f\x61\x72\164\40\x26\x26\x20\154\x6f\164\x65\x3d\x61\56\x6c\x6f\164\x65\40\46\46\x20\50\x74\151\160\157\x64\x6f\143\75\x27\x46\x41\x43\x27\x20\x7c\174\x20\x74\151\x70\157\144\157\143\x3d\47\116\x4f\124\47\x29\x20\46\x26\x20\146\x65\143\x68\x61\x64\157\143\76\x3d\x27{$desde}\x27\x20\46\46\x20\146\x65\x63\150\141\144\x6f\x63\74\75\47{$hasta}\47\x29\76\60\x2c\x28\123\x45\114\x45\x43\x54\40\x53\x55\115\x28\143\141\x6e\x74\151\x64\x61\144\51\x20\106\x52\117\115\40\157\160\x65\x72\x6d\166\x20\x57\x48\105\122\x45\40\141\x6c\155\x61\x63\x65\x6e\75\141\56\141\154\x6d\x61\x63\145\156\x20\x26\46\x20\143\x6f\x64\151\x67\x6f\x3d\141\x2e\x63\x6f\x64\x69\147\157\x61\x72\164\x20\x26\x26\40\x6c\x6f\x74\145\75\141\x2e\x6c\x6f\x74\145\x20\x26\46\40\50\x74\151\x70\157\x64\157\x63\75\x27\106\x41\x43\47\x20\174\174\40\x74\151\160\157\x64\157\143\75\x27\x4e\117\124\x27\51\40\46\x26\40\x66\145\143\x68\141\x64\157\x63\x3e\x3d\x27{$desde}\47\40\46\x26\x20\x66\145\x63\150\141\144\x6f\143\74\x3d\x27{$hasta}\x27\51\x2c\x30\51\x2c\60\x29\40\145\147\162\x65\163\157\54\xa\x20\40\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\40\x20\x52\117\x55\116\x44\50\111\106\50\x28\x53\x45\x4c\105\103\124\40\123\x55\115\x28\x63\156\164\x64\145\166\165\145\154\x74\x29\40\106\122\x4f\x4d\x20\144\145\166\157\154\x6d\x76\40\x57\110\x45\122\105\40\141\154\155\x61\143\x65\x6e\75\141\x2e\x61\154\x6d\141\x63\x65\x6e\x20\46\x26\x20\143\x6f\144\x69\x67\x6f\x3d\x61\56\143\x6f\144\151\x67\x6f\141\x72\x74\40\x26\x26\40\154\157\x74\x65\x3d\x61\56\154\157\x74\x65\x20\46\46\40\164\x69\160\x6f\144\157\x63\75\47\104\x45\x56\x27\x20\46\46\x20\x66\145\143\x68\x61\x64\157\143\76\75\47{$desde}\47\x20\x26\46\x20\x66\x65\x63\x68\x61\144\157\143\74\x3d\x27{$hasta}\47\51\x3e\60\54\50\x53\x45\x4c\105\x43\x54\40\123\x55\x4d\x28\x63\156\164\x64\x65\x76\165\x65\154\x74\51\40\106\122\x4f\115\40\144\x65\x76\157\154\155\166\40\127\x48\x45\x52\105\40\141\154\x6d\x61\x63\x65\x6e\75\141\x2e\x61\154\155\x61\143\x65\156\x20\x26\x26\x20\x63\157\144\151\x67\x6f\x3d\141\x2e\143\157\x64\151\x67\x6f\x61\162\164\40\46\x26\40\x6c\157\164\145\75\141\56\154\x6f\164\145\x20\46\46\40\x74\x69\160\x6f\144\157\143\x3d\47\x44\x45\126\x27\40\46\46\40\146\x65\x63\150\x61\144\157\143\x3e\x3d\47{$desde}\x27\x20\46\46\x20\146\145\x63\150\141\144\157\x63\x3c\75\x27{$hasta}\x27\51\54\x30\51\x2c\60\x29\40\x64\145\x76\x75\145\x6c\164\141\54\xa\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\x20\40\40\x20\x52\117\125\x4e\x44\x28\x28\123\105\114\x45\x43\124\40\x28\x53\125\x4d\50\x63\157\163\164\x6f\x62\x73\x29\x2f\x43\x4f\125\x4e\124\x28\52\x29\51\40\x46\x52\117\x4d\x20\x61\x72\164\151\160\162\x65\143\40\127\110\105\122\105\40\143\157\x64\x69\x67\x6f\75\141\x2e\x63\x6f\x64\151\147\157\141\162\164\x29\54\62\51\40\x63\x6f\x73\x74\157\40\12\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\40\40\40\40\x46\122\x4f\x4d\40\x61\162\164\151\x6c\x6f\x74\145\163\40\x61\x20\x4a\x4f\111\x4e\40\x61\162\164\151\143\165\154\157\x20\x62\40\x4f\x4e\40\141\x2e\x63\157\x64\x69\147\157\x61\x72\x74\75\142\56\143\x6f\144\x69\x67\157\x20\x57\x48\105\x52\x45\40\x61\x2e\141\154\155\x61\x63\145\156\75\60\62\x20\x47\x52\117\x55\120\x20\102\x59\40\x61\56\141\x6c\155\141\143\x65\x6e\54\141\x2e\143\x6f\x64\x69\147\x6f\141\162\164\x2c\141\x2e\154\157\x74\145\xa\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\125\116\111\117\116\12\x20\x20\40\40\x20\40\40\40\40\x20\40\40\x20\40\40\x53\105\x4c\x45\x43\x54\40\141\x2e\141\154\155\141\143\x65\x6e\x2c\141\56\143\x6f\144\x69\147\157\141\162\x74\40\x63\x6f\x64\x69\147\x6f\x2c\142\x2e\x6e\x6f\155\142\162\145\54\x61\x2e\x6c\x6f\x74\145\54\xa\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\60\40\x63\x61\x72\x67\157\151\x6e\151\x2c\60\40\x63\x61\162\147\157\151\156\151\x32\x2c\x30\x20\144\x65\163\143\x61\x72\147\157\151\156\x69\54\x30\40\144\145\x73\143\x61\x72\147\157\151\x6e\151\62\54\x30\40\x69\x6e\x67\162\x65\163\157\x69\156\151\x2c\60\40\x65\147\162\145\163\157\151\x6e\151\x2c\60\x20\x64\x65\x76\x75\145\x6c\x74\141\x69\x6e\151\x2c\60\x20\143\x61\x72\x67\x6f\x2c\60\40\x63\141\162\x67\157\x32\x2c\60\x20\144\x65\x73\x63\141\x72\x67\x6f\54\x30\40\144\x65\x73\x63\141\x72\x67\x6f\x32\54\12\40\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\40\40\40\122\x4f\x55\x4e\x44\50\x49\106\x28\50\x53\105\x4c\105\103\x54\40\x53\x55\115\50\143\x61\x6e\x74\x69\144\141\x64\51\x20\x46\122\117\115\x20\157\x70\x65\162\155\x76\40\x57\110\x45\x52\105\40\141\x6c\155\141\143\x65\x6e\x3d\141\56\141\x6c\155\x61\x63\x65\x6e\40\x26\46\40\143\157\x64\x69\147\x6f\75\141\x2e\143\157\x64\x69\x67\x6f\141\162\x74\40\x26\x26\40\x6c\x6f\x74\x65\x3d\x61\x2e\x6c\x6f\x74\145\40\x26\x26\x20\50\x74\151\x70\157\144\x6f\x63\x3d\47\x46\101\x43\x27\40\x7c\x7c\40\x74\151\160\x6f\144\157\x63\x3d\47\x4e\x4f\x54\47\x29\x20\x26\x26\x20\x66\145\x63\150\141\x64\157\143\76\75\x27{$desde}\47\40\46\46\40\x66\145\143\150\x61\x64\x6f\143\x3c\75\x27{$hasta}\47\51\x3e\x30\54\x28\123\105\114\x45\x43\124\x20\x53\125\115\x28\143\141\x6e\x74\151\144\x61\x64\x29\x20\x46\122\117\x4d\40\157\x70\145\x72\155\166\40\127\110\105\122\x45\40\x61\x6c\155\141\143\x65\x6e\x3d\x61\56\x61\154\x6d\x61\x63\145\156\40\46\x26\40\x63\157\x64\151\x67\157\75\x61\56\143\x6f\144\151\147\157\x61\162\164\x20\x26\x26\40\154\157\x74\x65\x3d\141\56\154\157\164\145\40\x26\46\40\50\x74\x69\x70\x6f\x64\157\x63\75\47\106\101\x43\x27\40\174\174\x20\x74\151\160\x6f\x64\157\143\75\47\116\x4f\x54\x27\51\x20\x26\46\40\146\145\x63\x68\x61\144\157\143\x3e\75\x27{$desde}\x27\x20\x26\x26\x20\x66\145\x63\150\x61\144\x6f\143\74\75\x27{$hasta}\47\51\x2c\x30\x29\x2c\x30\51\40\x69\x6e\x67\162\x65\x73\x6f\54\xa\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\40\x52\x4f\125\x4e\x44\x28\111\x46\50\50\x53\x45\x4c\105\103\x54\40\x53\125\115\x28\143\141\x6e\x74\x69\x64\141\x64\x29\40\106\x52\x4f\115\40\x6f\160\145\x72\155\x76\40\x57\110\105\x52\105\x20\141\154\x6d\x61\143\x65\156\x3d\x61\56\141\x6c\155\x61\143\145\156\40\46\x26\x20\143\157\144\151\x67\157\x3d\141\x2e\x63\157\144\x69\x67\157\x61\162\x74\x20\x26\x26\x20\x6c\157\x74\x65\75\141\x2e\154\x6f\x74\145\x20\46\46\x20\x28\x74\151\160\157\144\x6f\x63\x3d\47\x46\x41\103\x27\40\174\x7c\x20\x74\151\x70\157\144\x6f\x63\75\x27\116\x4f\124\47\x29\40\46\x26\x20\x66\145\x63\150\141\144\157\x63\76\x3d\x27{$desde}\47\x20\46\x26\40\146\145\143\x68\x61\x64\x6f\x63\x3c\x3d\x27{$hasta}\47\51\76\x30\x2c\50\123\x45\x4c\105\103\124\40\x53\125\x4d\50\x63\x61\x6e\164\151\x64\141\144\x29\40\106\122\x4f\115\40\157\160\x65\x72\x6d\166\40\x57\x48\x45\x52\x45\x20\x61\x6c\155\x61\x63\x65\x6e\x3d\141\x2e\x61\x6c\x6d\141\143\145\156\40\x26\x26\x20\x63\157\144\x69\x67\157\x3d\x61\56\143\157\144\151\147\x6f\141\x72\164\x20\46\x26\40\x6c\157\164\x65\75\141\56\154\157\x74\145\x20\x26\x26\x20\50\164\x69\x70\157\x64\157\143\x3d\x27\x46\x41\x43\47\x20\174\x7c\x20\164\151\160\x6f\x64\157\143\x3d\47\116\x4f\124\x27\51\x20\46\x26\x20\146\x65\x63\x68\x61\144\157\143\x3e\75\x27{$desde}\47\40\x26\46\40\146\x65\x63\x68\141\144\x6f\143\74\x3d\x27{$hasta}\x27\51\54\x30\x29\54\60\51\40\x65\147\162\x65\x73\x6f\x2c\60\x20\x64\x65\x76\165\145\154\x74\141\x2c\12\40\40\x20\40\x20\40\40\40\40\40\x20\40\40\40\40\40\122\117\x55\x4e\x44\50\50\x53\x45\114\105\x43\124\40\x28\x53\x55\115\50\x63\157\163\x74\x6f\x62\163\51\57\x43\117\x55\x4e\124\50\52\x29\x29\40\106\122\x4f\x4d\40\141\x72\164\x69\160\x72\x65\x63\40\x57\x48\x45\x52\105\40\143\x6f\x64\151\147\x6f\x3d\x61\x2e\x63\157\144\x69\x67\157\x61\162\164\51\x2c\62\x29\40\143\x6f\x73\164\157\40\12\40\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\x20\40\x20\x46\122\117\x4d\40\141\162\x74\151\x6c\157\x74\145\163\x20\141\40\x4a\x4f\x49\x4e\40\141\x72\x74\151\143\x75\154\x6f\40\142\40\x4f\116\40\141\x2e\143\x6f\x64\151\x67\157\141\x72\164\x3d\142\56\143\157\144\x69\x67\157\x20\x57\x48\x45\122\x45\40\x61\56\141\x6c\155\141\143\x65\156\x3d\x30\67\x20\x47\x52\x4f\125\120\40\102\131\40\x61\56\x61\x6c\x6d\x61\143\145\x6e\x2c\x61\56\x63\x6f\x64\x69\147\x6f\141\x72\x74\54\141\x2e\x6c\x6f\164\x65\12\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x29\x20\x6b\x61\x72\x64\x65\x78\x20\xa\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\40\40\x29\40\164\x6f\x74\x61\154\40\127\x48\x45\x52\105\40\50\145\170\151\x73\x74\x5f\151\156\x69\143\x69\141\154\x2b\x65\156\164\x72\141\x64\x61\55\141\165\164\x6f\x63\157\156\x73\x75\155\x6f\55\x73\141\x6c\151\144\x61\x29\76\x3d\60\x20\x68\141\166\x69\156\147\x20\x65\170\x69\163\x74\x5f\151\x6e\x69\x63\x69\141\x6c\x3e\60\40\174\x7c\40\x65\x6e\x74\x72\x61\x64\x61\76\60\x20\174\174\40\163\141\x6c\x69\144\x61\76\x30\x20\x7c\174\40\x61\165\164\157\143\x6f\156\x73\165\155\x6f\76\x30\40\174\174\40\145\x78\151\x73\164\137\x66\151\x6e\141\154\76\60\xa\40\40\x20\x20\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\125\116\111\x4f\116\12\x20\x20\40\40\40\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\x53\x45\114\105\103\124\x20\156\x75\x6c\154\x2c\x6e\x75\x6c\154\x2c\123\125\115\50\x65\170\x69\163\164\x5f\151\x6e\x69\143\x69\141\154\51\x65\170\x69\x73\x74\x5f\x69\x6e\x69\143\151\x61\154\54\x6e\x75\x6c\154\54\123\x55\115\x28\x65\170\x69\x73\x74\137\x69\x6e\x69\x63\151\x61\x6c\x2a\143\x6f\163\x74\x6f\x29\40\143\x6f\x73\164\157\x5f\164\157\x74\141\154\61\x2c\x53\125\x4d\x28\145\x6e\164\x72\141\144\141\51\40\x65\156\x74\162\x61\144\141\54\156\165\x6c\154\54\123\125\115\x28\145\x6e\x74\162\x61\x64\141\x2a\143\x6f\163\x74\157\51\40\x63\x6f\163\x74\157\x5f\x74\157\x74\x61\154\62\x2c\x53\x55\115\50\163\x61\x6c\151\144\x61\51\40\163\x61\154\x69\144\x61\54\x6e\x75\x6c\x6c\54\123\125\115\x28\163\141\154\151\x64\x61\x2a\143\157\x73\164\x6f\x29\40\x63\x6f\x73\x74\157\x5f\164\x6f\164\141\154\x33\54\123\125\115\x28\141\165\x74\157\x63\x6f\156\x73\x75\155\157\x29\40\x61\x75\x74\157\x63\x6f\156\163\165\155\x6f\x2c\x6e\165\x6c\154\54\x53\125\x4d\50\x61\165\164\x6f\x63\x6f\156\163\165\155\157\52\143\x6f\163\x74\157\51\40\143\x6f\x73\x74\x6f\x5f\164\157\x74\x61\x6c\64\x2c\40\123\125\115\x28\x65\x78\x69\163\x74\137\151\x6e\x69\x63\151\141\154\53\x65\x6e\164\162\x61\x64\141\x2d\141\165\x74\x6f\x63\x6f\156\x73\x75\x6d\157\55\x73\141\154\151\x64\141\x29\x20\145\170\x69\x73\164\137\146\151\x6e\x61\x6c\x2c\x20\x6e\165\x6c\x6c\54\40\x53\125\115\x28\50\x65\x78\x69\163\x74\137\x69\156\x69\143\151\141\x6c\x2b\145\156\164\162\141\144\x61\x2d\141\x75\x74\157\143\157\156\163\165\155\157\x2d\163\141\x6c\x69\x64\x61\51\52\x63\x6f\163\164\157\51\40\x63\157\x73\x74\157\x5f\164\157\x74\141\154\65\40\x46\122\117\115\40\50\12\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\123\x45\x4c\x45\x43\124\40\x63\157\x64\151\x67\x6f\x2c\103\117\116\x43\101\x54\x28\156\157\155\142\x72\145\x2c\47\x20\x41\x6c\155\141\143\145\156\x3a\x20\47\x2c\141\154\x6d\141\143\x65\x6e\54\x27\x20\x4c\x6f\164\x65\72\40\x27\54\154\157\x74\145\x29\x20\x6e\157\155\x62\x72\x65\x2c\x63\x6f\163\x74\x6f\54\12\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x20\111\x46\50\x63\x61\162\147\x6f\x69\x6e\151\x2b\143\141\162\147\x6f\x69\x6e\151\x32\53\151\x6e\x67\162\145\163\157\151\x6e\151\x2b\144\x65\166\165\x65\154\x74\141\151\x6e\x69\x2d\145\x67\x72\x65\163\x6f\x69\156\151\x2d\x64\145\x73\143\x61\x72\147\x6f\151\x6e\x69\x2d\x64\x65\x73\143\x61\x72\x67\x6f\x69\x6e\151\62\x3e\x30\54\143\141\162\147\x6f\x69\x6e\x69\53\x63\141\162\147\157\x69\x6e\151\62\53\x69\156\x67\x72\145\163\x6f\151\156\x69\53\144\x65\166\x75\145\154\164\141\x69\x6e\x69\x2d\145\x67\x72\145\x73\157\151\x6e\x69\55\x64\x65\163\x63\141\x72\147\157\151\156\151\x2d\x64\x65\163\143\x61\x72\x67\x6f\x69\x6e\151\x32\54\x30\x29\40\x65\170\x69\163\x74\137\151\x6e\x69\143\151\141\154\x2c\xa\40\40\40\40\x20\x20\40\x20\x20\40\x20\40\x69\156\147\162\x65\x73\157\x2b\x63\141\162\147\157\53\143\141\162\x67\x6f\62\x2b\x64\145\x76\x75\x65\x6c\164\141\x20\x65\x6e\164\162\x61\x64\x61\x2c\x20\x65\x67\162\145\x73\157\x20\x73\x61\x6c\x69\144\x61\54\144\145\163\143\x61\x72\147\157\53\x64\145\163\x63\x61\162\147\x6f\62\40\141\165\x74\x6f\143\157\x6e\163\165\155\x6f\40\x46\122\x4f\115\x20\x28\xa\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\123\x45\114\x45\x43\x54\x20\x61\56\x61\x6c\155\141\143\x65\156\x2c\x61\56\x63\x6f\x64\x69\147\x6f\x61\x72\x74\40\143\x6f\x64\x69\147\157\54\x62\x2e\156\x6f\x6d\142\162\145\54\x61\56\x6c\x6f\x74\x65\54\xa\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\111\106\50\x28\x53\105\114\x45\103\124\40\123\125\115\50\x63\x61\x6e\164\51\40\x46\122\x4f\115\40\x61\152\x75\163\164\145\x69\156\166\40\127\110\x45\x52\x45\x20\x64\x61\154\155\75\x61\x2e\x61\154\x6d\x61\x63\145\156\40\46\46\40\x63\x6f\144\151\147\157\75\x61\56\143\157\x64\151\x67\x6f\x61\x72\x74\40\x26\x26\x20\x64\x6c\157\x74\145\x3d\x61\x2e\x6c\x6f\164\x65\40\46\46\x20\x74\x69\x70\x6f\x3d\x31\40\x26\x26\40\146\x65\143\x68\74\47{$desde}\x27\51\x3e\60\x2c\x28\123\105\x4c\x45\103\x54\x20\123\x55\115\50\143\x61\156\164\51\x20\106\x52\117\115\40\x61\x6a\165\163\164\145\151\156\x76\x20\127\110\105\x52\x45\x20\144\x61\154\x6d\75\x61\x2e\141\154\155\x61\x63\x65\156\40\46\46\x20\143\x6f\x64\151\x67\x6f\75\x61\56\143\157\x64\x69\x67\157\141\x72\164\x20\x26\x26\x20\144\154\x6f\x74\x65\x3d\141\x2e\154\157\164\145\x20\x26\46\x20\x74\151\x70\x6f\x3d\61\x20\46\x26\x20\x66\145\x63\150\74\x27{$desde}\x27\x29\x2c\x30\x29\40\x63\x61\162\147\157\151\x6e\x69\54\xa\x20\x20\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\x20\x20\111\106\x28\50\x53\x45\x4c\x45\103\124\x20\x53\x55\115\x28\x63\141\x6e\164\x29\x20\x46\x52\x4f\115\x20\141\x6a\x75\163\x74\x65\x69\x6e\166\40\x57\x48\105\122\x45\x20\144\141\x6c\155\x3d\141\x2e\x61\x6c\155\141\x63\x65\x6e\40\46\46\40\x63\157\144\151\x67\x6f\75\x61\56\143\157\x64\151\147\157\x61\162\x74\x20\x26\x26\40\144\x6c\x6f\164\145\75\141\56\154\157\164\145\x20\x26\x26\x20\x74\x69\160\157\x3d\x33\40\x26\x26\40\x66\x65\x63\x68\x3c\x27{$desde}\x27\x29\76\x30\54\x28\x53\105\x4c\105\103\124\x20\x53\x55\x4d\x28\x63\x61\x6e\164\x29\40\106\122\117\115\40\141\152\x75\x73\164\145\151\156\166\40\x57\x48\x45\x52\x45\40\x64\x61\x6c\x6d\75\141\x2e\141\154\x6d\141\143\145\156\40\46\46\40\x63\157\144\151\x67\x6f\x3d\x61\56\x63\157\144\x69\x67\x6f\x61\162\x74\40\46\x26\40\x64\154\157\164\145\x3d\141\56\x6c\157\164\x65\40\46\x26\40\164\151\160\157\x3d\63\40\46\x26\40\146\145\x63\x68\74\47{$desde}\47\51\54\x30\51\x20\143\141\162\x67\x6f\151\156\x69\62\x2c\xa\40\x20\x20\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\x49\x46\x28\50\123\x45\x4c\105\x43\124\x20\123\x55\115\50\x63\141\156\164\51\x20\x46\x52\117\115\x20\x61\x6a\165\x73\x74\x65\x69\x6e\x76\40\x57\x48\105\122\x45\40\144\x61\x6c\155\x3d\x61\56\141\x6c\x6d\x61\143\145\156\x20\46\x26\x20\143\x6f\x64\151\147\x6f\x3d\141\x2e\x63\157\x64\x69\x67\x6f\x61\162\164\x20\x26\46\40\x64\x6c\157\x74\145\x3d\141\56\x6c\x6f\164\145\x20\x26\46\x20\164\x69\x70\157\x3d\60\x20\x26\46\40\x66\x65\x63\150\74\47{$desde}\x27\x29\76\x30\54\x28\123\105\x4c\105\x43\x54\x20\x53\125\115\50\143\x61\x6e\x74\51\40\x46\x52\x4f\115\40\x61\x6a\x75\163\x74\x65\x69\x6e\166\40\127\x48\x45\122\105\x20\144\x61\x6c\155\75\x61\56\x61\x6c\155\141\143\145\x6e\40\46\46\x20\x63\x6f\x64\x69\147\157\x3d\141\x2e\143\x6f\x64\151\147\157\x61\x72\x74\40\46\46\x20\x64\x6c\157\x74\x65\x3d\141\56\x6c\x6f\164\x65\40\46\x26\x20\x74\x69\x70\157\x3d\x30\40\x26\46\x20\146\x65\x63\150\x3c\47{$desde}\x27\x29\x2c\60\x29\40\x64\145\x73\143\141\x72\147\157\x69\156\x69\x2c\xa\x20\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\40\x49\106\50\50\123\x45\x4c\105\x43\124\40\123\x55\x4d\50\143\x61\x6e\x74\x29\40\x46\x52\x4f\x4d\40\141\x6a\x75\163\164\x65\151\156\x76\x20\127\110\105\122\105\40\x61\154\155\x3d\141\x2e\141\x6c\x6d\141\143\x65\x6e\x20\46\x26\x20\x63\157\144\x69\147\157\x3d\x61\56\143\x6f\144\151\147\x6f\x61\x72\164\x20\46\x26\x20\154\x6f\x74\145\75\x61\56\x6c\157\x74\x65\x20\46\46\x20\x74\151\x70\x6f\x3d\63\40\x26\x26\x20\x66\145\x63\x68\74\x27{$desde}\x27\x29\x3e\x30\x2c\x28\123\105\114\105\103\x54\40\123\x55\x4d\50\143\141\156\x74\x29\40\x46\x52\117\x4d\40\x61\x6a\165\163\x74\x65\151\156\166\x20\127\x48\105\x52\105\40\141\x6c\x6d\x3d\141\56\x61\x6c\x6d\141\x63\x65\156\40\x26\46\x20\x63\x6f\144\151\x67\x6f\75\x61\x2e\143\x6f\144\x69\147\157\141\162\164\40\46\46\x20\x6c\157\x74\x65\x3d\x61\56\x6c\157\164\x65\x20\x26\x26\40\164\x69\x70\157\75\63\40\46\46\40\x66\x65\x63\x68\x3c\47{$desde}\x27\51\54\x30\51\40\x64\145\163\x63\141\162\147\157\151\156\x69\x32\x2c\12\40\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x49\106\50\x28\x53\105\114\105\x43\124\x20\123\125\115\50\143\141\156\x74\x29\40\x46\122\x4f\115\40\151\164\157\162\x64\143\x20\x61\61\x20\x4a\x4f\x49\x4e\40\157\x72\144\x63\x20\x62\61\40\117\x4e\40\141\61\56\x6f\162\x64\x63\75\142\x31\x2e\x69\144\40\127\x48\x45\122\105\x20\x62\x31\x2e\141\x6c\155\x61\x63\x65\156\75\141\x2e\x61\154\x6d\x61\143\x65\x6e\40\x26\46\x20\x61\61\56\143\157\144\x69\147\157\75\141\56\143\x6f\144\x69\x67\x6f\141\x72\x74\x20\46\46\40\x6c\x6f\164\145\75\x61\x2e\x6c\x6f\164\145\x20\46\x26\40\x62\61\x2e\146\162\145\143\x65\x70\76\47\x32\x30\62\x33\x2d\61\62\x2d\x32\71\47\x20\x26\46\x20\142\61\x2e\146\x72\145\x63\145\160\x3c\x27{$desde}\47\x29\76\60\x2c\x28\123\105\x4c\x45\103\x54\x20\x53\125\x4d\x28\x63\141\156\164\51\40\106\122\117\x4d\x20\151\164\157\x72\144\143\40\x61\61\40\112\117\x49\116\40\157\x72\144\x63\40\x62\x31\40\x4f\x4e\x20\x61\x31\x2e\x6f\x72\144\x63\75\142\61\x2e\x69\x64\40\127\110\105\x52\x45\x20\142\x31\x2e\x61\154\155\x61\143\145\x6e\x3d\141\56\x61\x6c\x6d\141\143\x65\x6e\x20\46\x26\x20\x61\x31\56\143\157\x64\151\147\157\75\x61\56\143\x6f\144\151\x67\157\141\162\x74\40\x26\46\40\154\157\x74\x65\75\x61\56\154\x6f\164\145\40\46\46\x20\x62\x31\x2e\x66\x72\145\x63\145\x70\76\x27\x32\x30\x32\63\55\61\x32\x2d\62\x39\x27\x20\x26\x26\40\x62\61\56\x66\162\145\143\145\160\x3c\x27{$desde}\x27\x29\54\60\51\x20\x69\x6e\147\162\x65\x73\x6f\151\x6e\151\x2c\12\40\40\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\122\117\125\116\104\50\x49\x46\50\x28\123\x45\x4c\x45\103\x54\40\x53\125\x4d\x28\x63\141\156\164\151\x64\x61\x64\x29\x20\106\x52\117\x4d\x20\x6f\x70\145\162\x6d\166\40\127\x48\105\122\105\40\141\154\155\141\x63\x65\156\75\141\56\141\x6c\x6d\141\143\145\156\x20\x26\x26\40\x63\157\144\151\147\157\75\141\56\143\157\x64\x69\147\x6f\x61\x72\164\x20\x26\x26\x20\154\x6f\x74\x65\75\x61\x2e\154\x6f\x74\x65\x20\46\46\x20\x28\164\x69\x70\157\x64\x6f\143\x3d\x27\x46\101\x43\47\x20\x7c\x7c\40\164\x69\x70\157\144\157\143\x3d\47\116\117\124\x27\x29\x20\46\46\x20\x66\145\x63\x68\x61\x64\x6f\143\76\x27\62\x30\62\x33\55\x31\x32\55\x32\71\47\40\x26\x26\x20\x66\145\x63\x68\141\144\x6f\x63\74\47{$desde}\x27\51\76\x30\x2c\x28\123\105\114\105\x43\x54\x20\123\x55\115\x28\x63\141\156\164\151\144\x61\x64\51\40\x46\122\117\115\40\157\x70\x65\x72\x6d\166\40\127\x48\x45\122\x45\40\x61\154\x6d\141\143\x65\156\x3d\141\x2e\141\x6c\x6d\x61\143\x65\156\40\46\x26\x20\143\x6f\144\x69\x67\157\75\141\56\x63\157\144\151\147\157\x61\162\x74\40\46\46\40\x6c\157\x74\145\75\x61\56\154\x6f\x74\145\x20\46\x26\40\x28\x74\x69\x70\157\144\157\x63\x3d\x27\106\101\x43\47\x20\x7c\x7c\x20\x74\151\160\157\144\x6f\x63\x3d\47\x4e\117\124\x27\x29\x20\46\x26\x20\146\145\143\150\x61\144\x6f\x63\76\47\x32\60\62\63\55\61\62\55\x32\71\x27\40\46\x26\x20\146\145\x63\150\x61\144\157\x63\74\x27{$desde}\47\x29\54\60\x29\x2c\60\51\x20\145\147\x72\x65\163\x6f\151\x6e\x69\54\xa\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\122\x4f\x55\116\104\50\111\106\50\x28\123\x45\114\105\103\124\40\123\x55\115\x28\x63\x6e\164\x64\145\x76\165\x65\154\164\x29\40\x46\122\x4f\x4d\x20\144\x65\x76\157\x6c\x6d\166\x20\x57\110\105\x52\105\40\x61\154\155\141\x63\145\156\x3d\x61\x2e\141\x6c\x6d\141\143\145\x6e\x20\x26\46\40\x63\x6f\x64\x69\x67\157\75\141\x2e\143\x6f\x64\151\x67\x6f\x61\162\x74\x20\46\x26\x20\x6c\x6f\164\145\x3d\141\x2e\154\x6f\x74\145\x20\46\46\x20\164\x69\x70\x6f\x64\157\143\75\47\x44\105\x56\x27\x20\x26\46\40\x66\x65\x63\150\x61\144\x6f\143\x3e\x27\x32\x30\x32\x33\55\x31\x32\55\x32\71\x27\x20\x26\46\x20\146\145\143\x68\141\144\x6f\143\x3c\47{$desde}\x27\51\x3e\60\54\x28\x53\x45\x4c\105\103\x54\x20\123\x55\x4d\x28\143\x6e\164\x64\x65\x76\x75\x65\154\164\51\x20\x46\122\x4f\x4d\40\x64\x65\x76\157\x6c\x6d\166\x20\127\110\x45\122\x45\40\141\154\x6d\x61\143\x65\x6e\x3d\141\x2e\141\x6c\x6d\x61\x63\145\x6e\x20\46\46\40\x63\x6f\144\151\147\157\x3d\x61\56\x63\x6f\144\x69\x67\157\141\x72\164\x20\46\46\x20\x6c\157\164\145\75\x61\56\x6c\157\x74\145\40\46\46\x20\164\151\160\x6f\x64\157\x63\75\x27\x44\105\x56\47\40\46\x26\40\x66\145\x63\x68\141\x64\x6f\143\x3e\47\62\60\62\63\55\x31\62\55\x32\71\47\x20\46\x26\40\x66\x65\x63\150\x61\144\x6f\143\74\47{$desde}\x27\x29\x2c\60\x29\54\60\x29\40\144\145\166\x75\145\x6c\x74\141\x69\x6e\151\x2c\xa\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\40\111\106\x28\x28\x53\x45\x4c\105\x43\124\40\123\x55\115\x28\x63\x61\x6e\164\51\40\x46\122\117\115\40\141\x6a\165\x73\164\145\151\156\166\40\127\110\105\122\105\x20\x64\x61\154\x6d\75\141\x2e\x61\154\155\x61\x63\145\x6e\40\46\x26\x20\143\157\144\151\x67\157\75\141\56\143\157\x64\x69\147\157\141\x72\x74\40\46\46\x20\x64\x6c\x6f\164\145\75\x61\56\x6c\157\164\x65\40\x26\x26\40\164\x69\160\x6f\75\61\x20\46\46\x20\146\x65\143\x68\76\75\x27{$desde}\x27\40\x26\x26\x20\146\145\143\x68\74\75\47{$hasta}\47\51\x3e\x30\54\x28\123\105\x4c\105\103\124\40\123\x55\115\x28\143\x61\156\164\51\40\x46\x52\117\x4d\x20\141\x6a\x75\x73\164\145\x69\x6e\x76\40\127\x48\x45\x52\105\40\144\x61\154\x6d\75\x61\56\x61\154\155\141\143\x65\x6e\x20\46\46\x20\143\157\144\151\x67\x6f\75\141\x2e\143\157\x64\x69\x67\x6f\x61\162\164\x20\46\46\40\144\x6c\x6f\x74\145\75\x61\x2e\x6c\x6f\x74\145\x20\x26\x26\x20\164\x69\160\x6f\x3d\x31\x20\x26\x26\40\x66\145\143\150\76\x3d\x27{$desde}\x27\x20\x26\46\x20\146\x65\x63\150\74\75\x27{$hasta}\x27\x29\54\x30\51\x20\143\x61\x72\x67\157\x2c\xa\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\x20\111\106\50\50\123\x45\x4c\105\103\124\40\123\125\115\50\x63\x61\x6e\164\x29\40\106\122\117\115\x20\x61\152\165\x73\164\145\x69\156\x76\x20\127\110\105\x52\105\x20\144\141\x6c\155\x3d\x61\x2e\141\154\x6d\141\x63\145\x6e\40\x26\46\40\x63\157\144\x69\147\157\75\141\x2e\x63\157\x64\x69\147\157\141\162\x74\x20\x26\46\x20\x64\x6c\157\x74\145\x3d\x61\x2e\154\x6f\164\145\x20\x26\46\x20\x74\151\160\x6f\x3d\x33\40\x26\x26\40\x66\145\x63\150\76\x3d\x27{$desde}\47\x20\x26\x26\x20\x66\x65\x63\x68\74\x3d\x27{$hasta}\x27\51\x3e\60\x2c\x28\x53\105\114\105\103\x54\40\123\x55\115\50\x63\x61\156\x74\x29\x20\x46\122\117\115\40\141\152\x75\x73\x74\145\x69\156\x76\40\127\110\x45\122\105\40\144\141\154\155\75\x61\x2e\x61\x6c\155\x61\143\145\x6e\40\46\x26\x20\x63\x6f\x64\151\147\x6f\75\141\x2e\143\157\x64\151\147\157\141\x72\164\40\x26\x26\x20\144\x6c\157\164\x65\75\x61\x2e\x6c\x6f\164\x65\x20\x26\x26\40\x74\151\x70\157\x3d\63\40\46\x26\40\146\145\143\150\76\75\x27{$desde}\47\x20\x26\46\40\146\145\143\150\74\75\x27{$hasta}\47\x29\54\x30\x29\x20\143\141\x72\147\157\x32\x2c\12\x20\x20\x20\x20\40\40\x20\40\40\40\40\40\40\40\x20\x20\x49\106\x28\50\123\105\x4c\x45\103\x54\40\123\x55\x4d\50\x63\x61\156\x74\51\40\106\122\117\x4d\x20\x61\x6a\165\163\164\x65\151\156\166\40\x57\110\x45\x52\x45\x20\x64\x61\x6c\155\x3d\x61\56\x61\x6c\x6d\x61\x63\145\x6e\40\x26\46\x20\x63\157\144\151\147\x6f\75\x61\x2e\143\x6f\x64\x69\x67\157\x61\162\164\40\46\46\x20\144\154\157\164\145\x3d\x61\56\x6c\157\x74\x65\x20\x26\46\x20\x74\x69\160\157\75\60\x20\46\46\40\x66\x65\143\x68\x3e\x3d\x27{$desde}\x27\x20\46\46\x20\146\145\x63\x68\74\75\x27{$hasta}\x27\x29\x3e\x30\54\50\123\105\x4c\105\103\x54\40\123\x55\x4d\x28\143\141\x6e\x74\51\x20\106\122\x4f\115\40\141\x6a\165\163\164\145\151\x6e\x76\x20\x57\110\x45\122\x45\x20\144\141\x6c\155\x3d\x61\56\141\154\155\x61\x63\x65\x6e\40\46\46\x20\x63\x6f\144\151\x67\157\x3d\141\56\143\x6f\x64\x69\147\157\141\162\164\40\46\x26\x20\x64\x6c\x6f\x74\x65\x3d\x61\56\x6c\x6f\164\x65\x20\x26\x26\40\164\151\160\157\75\x30\x20\x26\x26\x20\146\x65\143\150\76\x3d\x27{$desde}\x27\x20\x26\46\x20\x66\x65\x63\150\x3c\75\47{$hasta}\47\51\x2c\x30\51\40\144\x65\x73\143\x61\162\147\x6f\x2c\12\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\40\111\x46\50\50\123\x45\x4c\x45\103\124\x20\x53\125\115\50\x63\x61\x6e\x74\51\40\106\122\117\115\40\x61\x6a\165\163\x74\145\151\x6e\x76\x20\127\x48\x45\x52\x45\x20\x61\x6c\x6d\75\141\x2e\x61\154\x6d\x61\x63\x65\x6e\40\46\46\40\x63\x6f\x64\x69\147\x6f\75\141\56\143\157\x64\151\147\x6f\141\x72\164\40\46\x26\40\154\157\x74\145\75\x61\x2e\154\157\164\145\x20\46\x26\x20\x74\151\x70\x6f\75\x33\40\46\46\x20\146\x65\143\x68\76\x3d\x27{$desde}\47\40\x26\46\40\146\145\143\150\74\75\x27{$hasta}\47\51\76\x30\54\x28\x53\x45\x4c\105\103\124\40\x53\x55\115\50\x63\x61\x6e\164\x29\40\x46\122\117\115\40\x61\152\165\163\164\145\151\156\x76\40\x57\110\105\x52\105\40\x61\154\155\x3d\141\x2e\141\x6c\x6d\141\143\145\156\40\x26\x26\x20\143\157\x64\x69\x67\x6f\x3d\x61\x2e\143\157\144\151\x67\x6f\141\162\164\x20\46\46\40\x6c\157\164\x65\75\x61\56\x6c\x6f\x74\145\x20\46\46\x20\x74\151\160\x6f\x3d\63\x20\x26\x26\x20\x66\145\143\150\76\x3d\47{$desde}\47\40\x26\x26\x20\146\x65\x63\150\74\x3d\47{$hasta}\x27\51\54\60\51\x20\144\x65\163\x63\x61\x72\x67\x6f\62\54\12\x20\40\40\40\x20\40\40\x20\x20\40\40\40\40\x20\40\x20\111\x46\50\x28\x53\105\x4c\x45\103\124\40\123\125\115\x28\143\141\x6e\164\51\x20\106\122\x4f\115\x20\151\x74\x6f\x72\144\143\x20\x61\61\40\x4a\x4f\111\116\x20\x6f\162\x64\143\40\x62\x31\40\x4f\116\x20\141\x31\56\157\162\x64\143\x3d\x62\61\x2e\x69\144\x20\127\x48\x45\122\x45\40\142\61\56\141\154\155\141\x63\145\x6e\75\141\x2e\141\154\x6d\141\143\x65\x6e\40\46\x26\x20\x61\x31\x2e\x63\x6f\x64\x69\147\157\x3d\141\56\x63\157\144\x69\x67\157\x61\162\164\40\46\46\40\154\x6f\164\145\75\141\x2e\x6c\x6f\x74\145\x20\46\x26\x20\142\x31\x2e\146\162\145\143\145\160\76\75\47{$desde}\x27\x20\46\46\40\142\61\x2e\x66\162\x65\143\x65\160\x3c\75\47{$hasta}\x27\51\76\60\x2c\50\x53\x45\x4c\105\103\x54\x20\x53\125\x4d\50\x63\141\156\164\x29\40\x46\x52\x4f\x4d\40\x69\x74\157\x72\144\x63\40\x61\61\x20\x4a\x4f\x49\116\x20\x6f\x72\144\x63\40\142\x31\40\x4f\116\x20\141\x31\56\x6f\x72\x64\x63\75\142\x31\x2e\151\x64\40\127\110\105\122\105\40\142\61\56\141\x6c\x6d\141\x63\145\x6e\x3d\x61\56\x61\x6c\155\141\143\x65\156\x20\46\x26\x20\x61\61\x2e\143\x6f\144\x69\147\x6f\75\141\x2e\143\x6f\144\151\147\x6f\141\x72\x74\40\x26\x26\40\154\x6f\164\145\x3d\x61\x2e\x6c\157\164\145\x20\x26\46\40\x62\x31\x2e\146\x72\145\x63\x65\x70\x3e\x3d\x27{$desde}\x27\x20\x26\46\40\x62\x31\x2e\x66\x72\145\x63\145\160\74\75\47{$hasta}\x27\x29\x2c\x30\x29\40\x69\156\x67\162\x65\x73\157\54\12\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\122\x4f\125\116\x44\50\x49\x46\50\50\123\105\114\x45\x43\x54\x20\x53\x55\115\x28\143\x61\156\164\x69\144\x61\x64\51\40\106\122\117\x4d\40\157\160\x65\162\x6d\x76\x20\x57\110\x45\x52\x45\x20\x61\x6c\155\141\x63\145\x6e\75\x61\x2e\x61\x6c\155\141\x63\145\x6e\40\46\46\x20\x63\x6f\x64\151\x67\x6f\x3d\x61\x2e\143\x6f\144\x69\x67\x6f\141\162\164\x20\46\46\40\x6c\x6f\x74\145\x3d\141\56\x6c\157\164\145\40\x26\x26\40\50\x74\151\x70\x6f\x64\x6f\x63\75\x27\x46\101\x43\47\x20\x7c\x7c\x20\x74\151\x70\x6f\x64\x6f\x63\75\x27\116\x4f\x54\x27\x29\40\46\x26\x20\146\145\143\150\x61\x64\157\143\76\75\47{$desde}\47\x20\x26\46\40\x66\145\143\x68\x61\x64\157\x63\x3c\75\x27{$hasta}\47\51\x3e\60\x2c\x28\123\x45\x4c\x45\x43\x54\40\123\125\x4d\x28\143\x61\156\164\151\144\x61\x64\x29\x20\x46\x52\x4f\x4d\x20\157\160\x65\162\x6d\x76\40\127\x48\x45\122\105\40\141\x6c\155\x61\143\145\156\x3d\x61\56\141\154\155\x61\143\x65\156\x20\x26\46\40\143\x6f\144\x69\147\157\x3d\141\x2e\143\157\144\151\147\157\141\x72\x74\x20\46\46\40\154\x6f\x74\x65\75\x61\56\x6c\157\164\x65\x20\46\x26\x20\50\x74\151\160\x6f\144\x6f\143\x3d\x27\106\x41\103\47\40\x7c\174\40\164\x69\x70\157\144\157\x63\x3d\47\116\117\x54\47\x29\x20\x26\46\x20\146\x65\143\x68\x61\144\157\x63\x3e\x3d\x27{$desde}\x27\40\46\x26\40\146\145\143\150\x61\x64\x6f\143\x3c\x3d\47{$hasta}\x27\x29\54\x30\x29\x2c\x30\x29\40\x65\147\162\145\x73\157\54\12\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\122\117\x55\116\x44\50\111\x46\x28\x28\123\x45\114\105\103\124\40\x53\x55\115\50\x63\156\x74\144\145\166\165\x65\x6c\164\51\40\x46\x52\117\x4d\x20\144\x65\166\x6f\x6c\x6d\166\x20\x57\110\105\122\x45\x20\x61\x6c\x6d\x61\143\145\156\x3d\x61\x2e\x61\x6c\x6d\x61\x63\145\x6e\40\46\46\40\x63\157\144\151\147\157\x3d\x61\56\x63\157\x64\x69\x67\x6f\141\x72\164\40\46\x26\x20\x6c\157\164\x65\x3d\x61\56\154\x6f\x74\x65\x20\x26\46\40\164\151\x70\x6f\x64\x6f\x63\75\47\104\x45\x56\x27\x20\46\46\40\146\145\x63\x68\141\x64\157\x63\x3e\x3d\x27{$desde}\47\40\46\x26\40\146\x65\x63\150\141\144\157\143\x3c\x3d\47{$hasta}\x27\x29\x3e\60\54\50\x53\x45\x4c\105\103\x54\40\x53\125\115\50\x63\x6e\x74\144\x65\166\165\x65\x6c\164\x29\x20\x46\x52\117\115\40\144\x65\x76\157\x6c\155\x76\40\x57\110\x45\122\105\40\141\154\x6d\141\143\x65\x6e\x3d\141\x2e\141\154\155\x61\143\x65\x6e\x20\46\x26\40\x63\157\x64\x69\147\x6f\x3d\141\56\x63\157\144\151\147\157\x61\162\x74\40\46\x26\40\x6c\157\164\145\x3d\x61\56\x6c\x6f\x74\x65\x20\46\x26\40\164\151\160\157\x64\x6f\143\x3d\47\x44\x45\126\47\40\46\46\x20\x66\145\x63\150\141\x64\157\143\x3e\x3d\47{$desde}\x27\x20\46\x26\x20\x66\145\x63\x68\x61\x64\157\143\x3c\x3d\47{$hasta}\x27\x29\54\60\51\x2c\x30\51\40\144\x65\166\x75\145\x6c\x74\x61\x2c\12\40\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\122\117\x55\116\104\50\x28\123\105\x4c\x45\x43\x54\40\50\x53\125\115\50\143\x6f\163\x74\157\x62\x73\51\57\x43\x4f\125\116\x54\50\52\51\x29\40\106\122\x4f\x4d\40\x61\162\x74\x69\x70\162\x65\x63\40\127\x48\105\122\x45\x20\x63\157\x64\x69\x67\x6f\x3d\141\x2e\143\157\144\151\147\157\x61\x72\x74\51\54\x32\51\40\x63\157\163\x74\x6f\40\12\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\106\122\x4f\x4d\x20\141\162\x74\151\154\x6f\164\x65\163\x20\x61\x20\112\117\111\116\x20\141\162\x74\151\143\165\x6c\x6f\40\142\40\117\116\x20\x61\x2e\143\157\144\x69\147\x6f\141\162\x74\x3d\142\x2e\x63\157\144\151\147\x6f\40\x57\x48\105\x52\x45\40\x61\x2e\141\154\155\x61\x63\145\x6e\x3d\x30\x32\x20\107\122\x4f\125\x50\x20\x42\131\x20\x61\x2e\141\x6c\155\x61\x63\145\156\54\141\x2e\143\157\x64\x69\x67\157\x61\x72\164\x2c\141\x2e\x6c\157\164\x65\12\x20\x20\40\x20\40\40\40\40\40\40\40\x20\40\40\40\40\x55\116\111\x4f\116\xa\40\x20\40\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\40\123\105\114\105\x43\x54\x20\x61\56\x61\154\155\x61\143\x65\x6e\x2c\141\x2e\x63\x6f\144\x69\x67\x6f\x61\x72\x74\x20\143\157\144\x69\147\157\x2c\142\x2e\x6e\157\x6d\x62\162\145\x2c\141\56\154\157\164\x65\x2c\xa\x20\40\40\x20\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\60\40\143\x61\162\x67\157\x69\156\x69\54\60\40\143\x61\162\x67\157\151\x6e\x69\x32\54\60\40\x64\145\163\x63\x61\162\147\x6f\x69\x6e\151\54\x30\x20\144\x65\163\143\141\162\x67\157\151\156\151\62\54\60\40\x69\x6e\147\162\145\163\x6f\x69\156\x69\54\60\x20\145\147\x72\145\163\x6f\x69\156\x69\54\x30\40\144\x65\166\165\145\x6c\x74\x61\x69\x6e\151\54\60\x20\143\x61\162\147\157\54\60\40\x63\x61\x72\147\157\62\x2c\x30\x20\x64\x65\163\x63\141\162\147\157\54\60\x20\144\x65\163\143\x61\162\x67\157\62\54\12\x20\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\40\x20\x20\122\117\x55\x4e\104\50\111\x46\x28\50\x53\105\114\105\103\124\40\123\x55\115\x28\x63\x61\x6e\164\x69\x64\x61\144\x29\x20\106\x52\x4f\115\x20\157\x70\x65\x72\155\166\x20\127\x48\x45\122\x45\40\141\154\x6d\x61\143\145\156\x3d\141\x2e\x61\x6c\x6d\x61\x63\145\x6e\x20\46\x26\40\x63\x6f\144\151\x67\x6f\75\141\56\x63\157\x64\x69\x67\157\x61\162\x74\40\x26\46\x20\x6c\157\x74\x65\x3d\141\x2e\x6c\x6f\164\145\40\46\46\40\50\164\151\x70\x6f\144\157\143\x3d\x27\x46\101\x43\x27\40\174\174\40\x74\151\x70\157\x64\x6f\143\x3d\x27\x4e\117\x54\47\51\x20\x26\46\40\146\145\143\150\x61\144\x6f\x63\76\75\47{$desde}\x27\x20\x26\x26\x20\146\145\143\150\141\144\157\143\74\x3d\x27{$hasta}\x27\x29\76\60\54\x28\x53\x45\114\x45\x43\124\40\123\125\x4d\x28\x63\141\156\164\x69\144\141\144\51\x20\x46\122\x4f\115\40\157\x70\x65\162\x6d\x76\40\127\x48\105\122\x45\x20\x61\x6c\155\141\143\x65\156\75\x61\x2e\141\x6c\x6d\141\143\145\156\x20\46\x26\x20\143\x6f\x64\151\x67\157\75\141\56\x63\x6f\x64\151\147\x6f\x61\162\x74\x20\46\x26\40\x6c\157\164\145\x3d\141\56\154\x6f\x74\x65\40\46\x26\40\50\x74\x69\x70\157\144\157\143\75\47\x46\x41\x43\x27\x20\174\x7c\x20\x74\151\x70\157\144\157\143\75\47\116\x4f\x54\47\x29\x20\46\x26\40\146\x65\x63\150\x61\144\x6f\143\x3e\75\47{$desde}\47\40\46\x26\x20\x66\x65\143\x68\141\144\x6f\143\74\75\x27{$hasta}\47\51\x2c\x30\51\54\60\x29\x20\x69\156\147\x72\x65\x73\x6f\x2c\12\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\122\x4f\125\116\x44\x28\x49\x46\50\50\123\x45\114\x45\103\124\x20\x53\x55\x4d\x28\143\x61\x6e\x74\151\144\141\144\x29\x20\106\x52\x4f\115\x20\x6f\x70\x65\x72\155\x76\40\x57\x48\105\122\105\x20\x61\154\x6d\x61\x63\145\x6e\75\x61\x2e\x61\x6c\x6d\141\x63\x65\x6e\x20\x26\x26\x20\143\157\144\x69\147\157\75\x61\56\143\157\144\151\147\x6f\x61\162\x74\40\x26\46\x20\154\x6f\164\x65\75\x61\56\x6c\x6f\x74\145\x20\46\46\x20\50\x74\x69\x70\x6f\x64\x6f\x63\x3d\x27\106\x41\x43\x27\40\174\x7c\40\164\151\x70\157\144\x6f\x63\75\x27\116\x4f\124\x27\51\x20\x26\x26\x20\x66\x65\143\150\141\144\x6f\143\x3e\x3d\x27{$desde}\x27\x20\x26\x26\40\146\145\143\150\x61\144\x6f\143\x3c\x3d\47{$hasta}\47\x29\x3e\x30\54\50\123\x45\x4c\x45\103\124\40\123\125\x4d\x28\x63\x61\x6e\164\x69\144\141\x64\x29\x20\x46\x52\x4f\115\40\x6f\x70\x65\x72\155\166\40\x57\110\105\x52\105\40\141\154\155\141\143\x65\156\x3d\141\x2e\x61\x6c\x6d\141\143\145\x6e\x20\x26\46\40\143\x6f\144\x69\147\x6f\x3d\x61\56\x63\157\144\151\x67\x6f\x61\x72\164\40\46\x26\40\154\x6f\x74\x65\x3d\x61\56\154\x6f\x74\x65\40\x26\x26\40\50\x74\x69\x70\x6f\x64\x6f\143\75\x27\106\101\103\x27\40\174\174\40\x74\151\x70\x6f\x64\157\x63\75\x27\116\117\124\47\51\x20\46\x26\40\x66\x65\143\150\x61\x64\157\143\76\x3d\x27{$desde}\47\40\x26\46\40\x66\x65\x63\x68\x61\x64\157\143\x3c\x3d\x27{$hasta}\x27\51\54\60\x29\x2c\60\x29\40\x65\x67\x72\145\163\x6f\x2c\60\40\x64\x65\166\x75\x65\154\164\141\x2c\12\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x52\x4f\125\x4e\x44\50\50\x53\x45\x4c\x45\103\124\x20\x28\x53\x55\115\x28\x63\157\x73\x74\157\x62\163\51\57\x43\117\125\x4e\x54\50\x2a\x29\x29\40\x46\122\117\115\40\141\162\164\x69\160\x72\x65\x63\40\127\110\x45\x52\105\x20\x63\157\x64\151\x67\x6f\x3d\x61\x2e\143\157\x64\151\x67\157\x61\x72\x74\x29\54\x32\51\40\x63\x6f\163\x74\x6f\x20\12\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\x20\x46\122\x4f\115\40\141\x72\x74\x69\x6c\157\x74\x65\163\40\141\x20\112\x4f\111\x4e\40\141\x72\x74\151\x63\165\154\157\x20\x62\40\x4f\116\x20\141\56\143\x6f\144\151\147\157\x61\x72\x74\x3d\142\56\x63\x6f\144\x69\147\x6f\40\x57\x48\105\x52\x45\x20\141\x2e\141\154\x6d\141\143\145\x6e\75\x30\67\40\107\122\x4f\x55\x50\40\x42\131\40\141\x2e\x61\x6c\155\141\143\x65\156\54\141\56\143\157\144\151\x67\x6f\141\x72\164\54\x61\56\x6c\x6f\164\145\12\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\51\x20\x6b\x61\162\144\x65\x78\40\12\40\40\40\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\51\x20\164\157\164\x61\x6c\x20\x57\x48\x45\x52\105\x20\x28\145\x78\151\163\x74\137\x69\x6e\151\x63\x69\141\x6c\53\145\x6e\164\162\x61\144\141\x2d\141\x75\164\x6f\143\157\x6e\163\x75\x6d\x6f\55\x73\x61\154\151\x64\x61\51\76\75\60\x20\150\x61\166\151\x6e\x67\40\x65\170\x69\x73\164\137\x69\156\151\143\x69\141\154\76\60\40\174\x7c\40\x65\x6e\164\162\141\144\x61\76\60\40\x7c\174\x20\163\x61\154\151\x64\x61\x3e\x30\x20\174\174\40\x61\165\x74\x6f\143\157\156\x73\165\x6d\x6f\x3e\60\x20\x7c\174\x20\x65\170\x69\163\164\x5f\146\151\156\x61\x6c\76\60"); } function exportexcellibrobanc($desde, $hasta, $banc) { $this->db->query("\x53\105\x54\40\x40\141\x63\165\155\x75\154\x61\144\x6f\x72\x20\75\40\x28\x53\105\114\x45\103\124\x20\x53\x55\115\50\x6d\157\x6e\164\157\x29\x20\x46\122\117\115\x20\143\157\156\x73\142\x61\156\143\40\x57\x48\105\x52\105\40\146\145\143\x68\x3c\x27{$desde}\x27\40\x26\x26\x20\x62\141\x6e\143\x6f\75\x27{$banc}\47\51\x3b"); return $this->db->query("\123\x45\114\x45\103\x54\40\162\145\146\40\x72\x65\x66\x65\x72\x65\x6e\143\151\x61\54\x20\146\x65\x63\x68\40\146\145\143\150\141\54\40\164\151\x70\x6f\x2c\40\x64\x65\x73\143\x72\x69\x70\54\x20\162\x61\172\157\156\54\x52\117\125\x4e\x44\50\145\x6e\164\x72\x61\144\x61\54\x32\51\x65\156\x74\162\x61\144\141\54\x73\141\x6c\151\144\141\54\40\x40\141\x63\165\x6d\x75\154\x61\144\157\162\72\x3d\50\x28\x65\x6e\164\162\141\x64\x61\x2d\x73\x61\154\151\144\141\51\53\x40\141\143\x75\155\165\x6c\x61\x64\157\x72\x29\40\x73\141\x6c\x64\x6f\x20\x46\x52\117\115\x20\x28\xa\x53\x45\114\105\x43\124\x20\141\56\162\145\146\54\x61\56\x66\x65\x63\150\54\x27\x43\157\142\162\157\40\144\145\x20\x66\141\143\164\165\162\x61\x27\40\164\151\x70\157\x2c\x20\12\107\x52\117\125\120\x5f\x43\x4f\x4e\103\101\x54\50\x62\x2e\151\x64\146\141\143\x29\x20\144\145\163\143\x72\x69\160\54\40\50\123\x45\x4c\105\103\124\x20\x43\x4f\x4e\103\x41\124\50\x63\157\144\143\x6c\x69\x65\156\x74\x65\54\x27\40\47\x2c\156\157\155\x62\162\x65\x63\154\151\x29\x20\106\122\x4f\x4d\x20\x6f\x70\x65\162\164\x69\x20\x57\110\105\x52\105\40\144\157\x63\165\x6d\x65\156\x74\157\75\142\56\x69\144\x66\141\x63\40\x26\x26\40\x28\x74\151\x70\x6f\x64\x6f\x63\x3d\47\106\101\103\x27\x20\174\174\40\164\151\160\157\x64\x6f\143\75\x27\116\117\124\x27\51\x20\114\111\x4d\x49\x54\40\61\51\40\162\x61\172\x6f\x6e\x2c\12\x69\x66\50\x61\x2e\x6d\157\x6e\164\x6f\76\60\54\x61\56\x6d\x6f\x6e\164\157\x2c\60\51\x20\145\x6e\x74\x72\x61\x64\141\54\x20\x69\x66\50\x61\56\155\157\156\164\x6f\74\x30\x2c\141\56\155\x6f\x6e\x74\157\x2c\60\51\40\x73\141\154\x69\x64\x61\12\x46\122\x4f\x4d\x20\x63\157\x6e\163\142\141\156\143\x20\x61\40\112\x4f\x49\x4e\x20\157\160\x65\162\143\154\x69\x20\142\x20\x4f\x4e\40\141\x2e\x72\x65\146\75\142\56\162\x65\146\x20\127\x48\105\122\105\x20\x61\x2e\142\141\x6e\x63\157\x3d\47{$banc}\47\x20\46\46\40\141\x2e\146\x65\143\150\76\x3d\47{$desde}\x27\x20\46\46\x20\141\56\146\145\143\x68\x3c\x3d\x27{$hasta}\47\x20\x47\122\117\x55\x50\x20\102\131\40\141\56\162\x65\x66\x20\12\x20\x29\x20\x6c\x69\142\162\157\142\x61\156\x63\157\x20\x4f\122\104\105\122\40\102\131\x20\x66\145\x63\x68\x61\54\162\x65\x66\x65\x72\x65\156\143\x69\141\73"); } function exportexcelretenciones($desde, $hasta) { return $this->db->query("\x53\105\114\x45\103\124\40\164\151\160\x6f\x64\157\x63\54\x64\157\x63\x75\x6d\x65\156\x74\157\x2c\x72\x65\146\x65\162\145\156\x63\151\x61\x2c\x63\157\144\143\x6c\x69\x65\x6e\x74\145\x2c\x6e\157\155\142\x72\145\x63\154\151\x2c\40\164\x6f\164\141\x6c\x66\151\x6e\x61\154\x20\x6d\157\x6e\x74\157\x20\x46\122\x4f\115\40\157\160\145\162\164\x69\x20\x57\x48\105\122\105\x20\164\151\x70\x6f\x64\x6f\x63\75\47\x52\105\x54\x27\x20\46\46\40\x66\x65\143\x68\141\x63\x72\x65\x61\76\x3d\47{$desde}\47\x20\x26\x26\40\146\145\143\x68\x61\x63\x72\145\x61\74\x3d\x27{$hasta}\x27"); } function exportexcelretencionescomp($desde, $hasta) { return $this->db->query("\x53\105\114\105\x43\124\x20\x27\x4a\x34\60\x38\63\64\x32\x34\x36\64\47\x20\162\151\146\155\145\x64\x69\x66\x61\162\x2c\40\x43\x4f\x4e\103\101\124\x28\x79\145\x61\x72\50\146\x65\x63\x68\x61\x64\157\143\51\x2c\155\157\156\164\x68\x28\146\145\143\150\141\x64\157\x63\51\x29\x20\x70\x65\x72\151\x6f\x64\157\x5f\146\151\163\x63\x61\x6c\x2c\40\40\146\x65\143\x68\141\144\157\143\40\x66\x65\x63\150\141\x5f\162\x65\164\145\156\x63\151\x6f\156\x2c\x27\x43\x27\40\143\157\155\x70\x72\141\x73\54\164\x69\160\157\162\145\164\x20\x74\151\160\157\x2c\40\50\123\x45\114\105\x43\124\40\162\151\x66\x20\x46\122\117\115\40\160\162\x6f\166\x65\145\144\x20\x57\110\105\122\x45\40\x69\144\75\x61\56\x70\x72\157\166\x65\145\144\x29\40\162\151\x66\x2c\xa\40\40\40\x20\141\x2e\x64\157\143\x75\155\145\x6e\x74\157\40\x66\x61\x63\164\165\162\x61\x2c\x6e\x63\157\156\x74\x72\x6f\x6c\x20\156\x5f\143\x6f\156\164\x72\157\x6c\x2c\40\x74\157\164\141\x6c\40\x74\x6f\164\141\154\137\106\x61\143\x74\165\162\141\x2c\x20\142\141\163\x65\151\x6d\160\x6f\40\142\x61\163\145\x5f\151\x6d\160\157\x6e\151\142\x6c\145\54\x20\x72\x65\164\x69\x65\156\x65\40\151\166\x61\137\162\x65\164\x65\x6e\151\144\157\x2c\x20\162\x65\x66\x65\x72\x65\x6e\x63\x69\x61\40\x66\x61\x63\164\x75\x72\141\x5f\141\x66\145\x63\x2c\40\x6e\162\x65\164\x20\156\x5f\143\x6f\155\160\162\157\142\141\156\x74\x65\x2c\x20\x73\x69\156\x69\x6d\160\x75\145\x73\164\40\x65\170\x63\x65\156\164\157\54\x27\61\66\56\x30\60\x27\40\x61\x6c\151\x63\x75\157\164\x61\54\40\47\60\x27\x20\145\x78\x70\x65\144\x69\x65\x6e\164\x65\xa\x20\x20\40\x20\40\40\x46\122\117\x4d\x20\143\157\x6d\x70\x72\141\x73\40\x61\40\127\x48\x45\122\105\40\x74\x69\x70\x6f\144\x6f\x63\75\x27\x52\105\124\47\40\x26\x26\x20\x66\x65\143\150\x61\144\x6f\143\76\x3d\x27{$desde}\x27\x20\46\x26\40\146\x65\x63\150\x61\144\x6f\143\x3c\75\x27{$hasta}\x27"); } function exportexcelreportmovbanc() { return $this->db->query("\123\x45\x4c\105\x43\x54\x20\x66\145\143\x68\54\162\x65\x66\54\x64\145\x73\143\x72\x69\x70\54\x20\x6d\x6f\156\164\157\x2c\x20\x28\x53\x45\114\105\x43\124\40\156\x6f\155\x20\106\x52\x4f\x4d\40\x62\141\156\144\x65\x73\x74\40\x57\110\105\122\x45\40\151\144\x3d\x61\x2e\x62\141\156\143\157\x29\40\142\x61\x6e\x63\x6f\54\141\x2e\x60\163\164\x61\164\x75\x73\140\40\145\163\164\x61\164\165\163\x2c\141\56\x6e\157\142\154\x6f\143\x6b\40\x64\x65\163\x62\154\157\161\x75\x65\141\144\x6f\40\xa\40\x20\40\x20\x46\x52\x4f\115\40\x63\x6f\x6e\x73\x62\141\x6e\143\40\141\40\x57\110\x45\x52\105\40\x61\56\151\144\x20\116\117\124\x20\111\116\x20\x28\x53\x45\x4c\105\x43\124\40\151\x64\143\x6f\156\163\x62\x61\156\143\x20\x46\x52\117\115\x20\x6f\160\x65\162\143\x6c\x69\x29\x20\46\x26\x20\x61\56\x66\x65\143\150\76\75\x32\60\x32\x34\x30\61\x30\61\40\117\122\x44\x45\122\x20\102\x59\x20\146\x65\x63\x68\x20\104\x45\x53\103\x3b"); } function exportexceltopfarmacli($desde, $hasta) { return $this->db->query("\123\105\x4c\105\103\x54\40\162\x61\x7a\x6f\x6e\x2c\145\163\x74\141\144\157\x2c\144\151\x72\x72\x2c\x74\x65\x6c\146\x2c\x63\157\156\x74\141\x63\x74\x2c\x65\155\x61\151\154\x2c\x53\125\115\x28\165\156\x69\144\x29\x20\165\156\x69\x64\x61\144\x65\163\40\106\122\117\x4d\x20\x66\x61\x72\x6d\x61\160\x61\164\162\x69\141\40\127\110\x45\122\105\40\162\141\172\x6f\156\40\114\x49\x4b\105\x20\47\x25\x66\x61\162\155\141\x63\x25\x27\xa\x20\x20\40\40\x26\46\40\145\155\151\163\x69\x6f\x6e\x3e\75\x27{$desde}\x27\x20\x26\46\40\x65\155\151\163\151\157\x6e\x3c\75\x27{$hasta}\47\12\x20\40\40\x20\107\122\x4f\x55\x50\x20\x42\x59\x20\x72\141\x7a\x6f\x6e\12\40\40\x20\40\117\x52\104\105\x52\x20\x42\x59\40\165\156\151\144\141\144\x65\163\x20\x44\105\123\x43"); } function sede() { $db = $this->db->query("\x53\x45\114\x45\x43\124\x20\x63\x6f\x6e\x74\x72\x6f\x6c\x20\x46\x52\117\115\40\x73\145\144\145")->row(); return $db->control; } function repara() { $bd = $this->db->query("\x53\105\x4c\105\x43\124\x20\143\x6f\144\151\x67\157\xa\x20\x20\x20\x20\x46\x52\x4f\x4d\x20\x61\x72\x74\151\143\165\154\x6f\x20\12\40\x20\40\40\x57\110\x45\122\105\40\143\x6f\144\x69\x67\x6f\x20\x4e\x4f\x54\40\x49\x4e\40\50\123\x45\x4c\105\103\x54\x20\143\157\144\151\x67\x6f\x61\162\x74\40\106\122\x4f\x4d\40\x61\162\164\x69\x6c\x6f\x74\145\x73\x20\x47\x52\117\x55\x50\x20\102\131\x20\x63\157\x64\151\147\x6f\141\x72\x74\51\12\40\40\x20\40\x26\46\40\x70\141\162\141\x5f\167\145\142\x3d\60")->result(); $i = 0; foreach ($bd as $dt) { $bd2 = $this->db->query("\123\105\x4c\x45\103\124\x20\142\x2e\143\157\x64\x69\147\157\x2c\x61\56\x61\154\155\141\143\x65\x6e\54\142\56\x6c\157\164\x65\x2c\142\x2e\145\154\x61\142\x2c\x62\x2e\x76\145\x6e\x63\145\x2c\x53\125\x4d\x28\142\56\x63\x61\156\164\51\40\x63\141\x6e\164\54\141\56\x66\162\x65\x63\145\160\x20\106\x52\117\115\40\157\162\144\x63\x20\x61\40\112\117\x49\x4e\40\x69\x74\x6f\162\144\x63\x20\142\x20\x4f\116\40\141\x2e\151\144\x3d\142\x2e\x6f\x72\x64\x63\x20\127\110\105\x52\105\40\x62\56\143\x6f\144\151\147\x6f\75\47{$dt->codigo}\x27\xa\40\40\x20\40\40\x20\x20\40\107\122\x4f\x55\x50\x20\102\x59\40\142\56\143\157\x64\x69\x67\157\x2c\141\56\141\x6c\x6d\141\x63\145\x6e\54\142\x2e\x6c\x6f\164\x65")->result(); foreach ($bd2 as $dt2) { $lote = array("\151\144\137\145\x6d\160\x72\x65\163\x61" => "\x44\x4d\x45\104\111\x46", "\141\147\145\156\143\151\141" => "\60\60\x31", "\141\154\x6d\x61\x63\145\156" => $dt2->almacen, "\143\157\x64\x69\147\x6f\141\x72\164" => $dt2->codigo, "\154\157\x74\x65" => $dt2->lote, "\x65\154\141\x62" => $dt2->elab, "\166\145\x6e\143\145" => $dt2->vence, "\x63\x61\156\164\x69\x64\141\x64" => $dt2->cant, "\x72\x65\x63\145\160\x63\151\x6f\x6e" => $dt2->frecep); $this->db->insert("\x61\162\164\x69\154\157\x74\145\x73", $lote); if ($this->db->affected_rows() > 0) { $i++; } } } return $i; } }
Function Calls
None |
Stats
MD5 | f3c9e3da3c4cb7e35afe8038ad8d59cb |
Eval Count | 0 |
Decode Time | 1012 ms |