function viewCajaExpediente() { $ini = $_POST['nro_inicial']; $fin = $ini; $exp_ids = $_POST['expedientes_ids']; $cantidadexp = $_POST['cantidadexp']; $cantdocs = $_POST['cantdocs']; $expedientes = explode(",", $_POST['cantexps']); $documentos = explode(",", $_POST['cantdocs']); $tiposeries = $_POST['tiposeries']; $cantidadetiqcajas = count($expedientes); $cantidadetiqcajas2 = count($documentos); $explode = explode(",", $exp_ids); $varioseries = $_POST['varioseries']; $nropiezas = $_POST['nropiezas']; if ($nropiezas != "") { $extraer_piezas = explode(",", $nropiezas); } $tab_expediente = new tab_expediente(); $tab_expisadg = new Tab_expisadg(); $cantidadtotal = $cantidadetiqcajas + $cantidadetiqcajas2; $expediente = new Tab_expediente(); $fondo2 = new Tab_fondo(); $texp = new Tab_etiquetas(); $usuario = new usuario(); $idexp = "SELECT tab_expediente.exp_id,tab_expediente.exp_codigo\r\n FROM\r\n tab_expediente\r\n INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n WHERE\r\n tab_archivo.fil_estado=1 and tab_archivo.fil_id={$documentos['0']} "; $rowespdoc = $tab_expediente->dbSelectBySQL($idexp); $cant = count($explode); if ($fin == NULL) { $fin = $ini; } $where2 = ""; $where4 = ""; if ($cantidadexp != 0) { for ($t = 0; $t < $cantidadetiqcajas; $t++) { if ($expedientes[$t] != "") { $where2 .= " tab_expediente.exp_id=" . $expedientes[$t]; if ($t < $cantidadetiqcajas - 1) { $where2 .= " OR "; } } } if ($cantidadetiqcajas2 > 0) { for ($u = 0; $u < $cantidadetiqcajas2; $u++) { if ($documentos[$u] != "") { $where4 .= " tab_archivo.fil_id=" . $documentos[$u]; if ($u < $cantidadetiqcajas2 - 1) { $where4 .= " OR "; } } } } } else { for ($t = 0; $t < $cantidadetiqcajas; $t++) { $where2 .= " tab_expediente.exp_id=" . $rowespdoc[0]->exp_id; } for ($u = 0; $u < $cantidadetiqcajas2; $u++) { if ($documentos[$u] != "") { $where4 .= " tab_archivo.fil_id=" . $documentos[$u]; if ($u < $cantidadetiqcajas2 - 1) { $where4 .= " OR "; } } } } if ($cantdocs == 1) { $where4 = " tab_archivo.fil_id=0"; } $consultaexps = "SELECT\r\n min(tab_expediente.exp_codigo) as minimo,\r\n max(tab_expediente.exp_codigo) as maximo,\r\n count(tab_expediente.exp_codigo) as cantidad\r\n FROM\r\n tab_expediente\r\n WHERE\r\n tab_expediente.exp_estado = 1 AND {$where2}"; $consultadoc = "SELECT\r\n MIN(tab_expediente.exp_codigo) as minimo,\r\n MAX(tab_expediente.exp_codigo) as maximo\r\n FROM\r\n tab_expediente\r\n INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n WHERE\r\n tab_archivo.fil_estado = 1 and {$where4}"; $rowsdocs = $expediente->dbSelectBySQL($consultadoc); $rowsexps = $tab_expediente->dbSelectBySQL($consultaexps); $wh = ""; if ($nropiezas == "") { $wh = " AND tab_expediente.exp_nrocaj<>''"; } // echo $tiposeries; exit(); $sql = "SELECT\r\n tab_fondo.fon_cod,\r\n u.uni_cod,\r\n u.uni_id,\r\n u.uni_descripcion,\r\n tab_tipocorr.tco_codigo,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo,\r\n tab_expediente.exp_ori,\r\n tab_expediente.exp_cop,\r\n tab_expisadg.exp_titulo,\r\n tab_series.ser_categoria,\r\n (SELECT uni_descripcion from tab_unidad WHERE tab_unidad.uni_id=u.uni_par) AS uni_par_cod,\r\n u.uni_codigo,\r\n (SELECT sof_nombre FROM tab_sopfisico WHERE sof_id=tab_expediente.sof_id AND tab_sopfisico.sof_estado = '1' ) AS sof_nombre\r\n FROM\r\n tab_fondo\r\n INNER JOIN tab_unidad AS u ON tab_fondo.fon_id = u.fon_id\r\n INNER JOIN tab_series ON u.uni_id = tab_series.uni_id\r\n INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n INNER JOIN tab_expisadg ON tab_expisadg.exp_id = tab_expediente.exp_id\r\n WHERE\r\n tab_fondo.fon_estado = 1 AND\r\n u.uni_estado = 1 AND\r\n tab_tipocorr.tco_estado = 1 AND\r\n tab_series.ser_estado = 1 AND\r\n tab_expediente.exp_estado = 1 {$wh} and tab_series.ser_id={$tiposeries}"; $rows = $texp->dbSelectBySQL($sql); $rows2 = $rows; $rows2 = $rows2[0]; $tabfondo = new Tab_fondo(); $cuerpo = $tabfondo->dbSelectBySQL($sql); // Include the main TCPDF library (search for installation path). //require_once('tcpdf/tcpdf_include.php'); require_once 'tcpdf/tcpdf.php'; // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Castellon S.R.L.'); $pdf->SetTitle('Etiquetado de Cajas'); $pdf->SetSubject('Etiquetado de Cajas'); $pdf->SetKeywords('Etiquetado, Cajas, cajas, caratulas, folders'); // set default header data // $pdf->SetHeaderData('logo2.png', 25, 'ADMINISTRADORA BOLIVIANA DE CARRETERA', 'IMPRESIÓN DE CAJAS'); //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 048', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 5, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { require_once dirname(__FILE__) . '/lang/eng.php'; $pdf->setLanguageArray($l); } // --------------------------------------------------------- // set font $pdf->SetFont('helvetica', 'B', 8); // add a page $pdf->AddPage(); $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0); $pdf->SetFont('helvetica', '', 8); $st = ""; // ----------------------------------------------------------------------------- // $id_exp = $_REQUEST['exp_id']; $minimoExps = $rowsexps[0]->minimo; $maximoExps = $rowsexps[0]->maximo; $minimoDoc = $rowsdocs[0]->minimo; $maximoDoc = $rowsdocs[0]->maximo; $numero = $rowespdoc[0]->exp_codigo; if ($minimoExps != "" && $maximoExps != "" && $minimoDoc != "" && $maximoDoc != "") { $array = array($minimoExps, $maximoExps, $minimoDoc, $maximoDoc); } else { if ($maximoExps != "" && $minimoDoc != "" && $maximoDoc != "") { $array = array($maximoExps, $minimoDoc, $maximoDoc); } else { if ($minimoDoc != "" && $maximoDoc != "") { $array = array($minimoDoc, $maximoDoc); } else { if ($minimoExps != "" && $maximoExps != "") { $array = array($minimoExps, $maximoExps); } } } } $cant3 = 0; $minimo = min($array); $maximo = max($array); $diferencia = $maximo - $minimo; $cantMin = ""; $cantMax = ""; for ($i = $ini; $i <= $fin; $i++) { $sala = ""; $estante = ""; $balda = ""; $cuerpo = ""; $wh1 = ""; if ($nropiezas == "") { $wh1 = " AND tab_expediente.exp_nrocaj='{$i}'"; } $expcodigo = ""; $sqlcodigos = "SELECT\r\n tab_fondo.fon_cod,\r\n u.uni_cod,\r\n tab_tipocorr.tco_codigo,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo,\r\n (NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\n tab_expediente.exp_ori,\r\n tab_expediente.exp_cop,\r\n tab_expediente.exp_fot,\r\n tab_expisadg.exp_titulo,\r\n (SELECT uni_descripcion from tab_unidad WHERE tab_unidad.uni_id=u.uni_par) AS uni_par_cod,\r\n u.uni_codigo,\r\n (SELECT sof_nombre FROM tab_sopfisico WHERE sof_id=tab_expediente.sof_id AND tab_sopfisico.sof_estado = '1' ) AS sof_nombre\r\n FROM\r\n tab_fondo\r\n INNER JOIN tab_unidad AS u ON tab_fondo.fon_id = u.fon_id\r\n INNER JOIN tab_series ON u.uni_id = tab_series.uni_id\r\n INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n INNER JOIN tab_expisadg ON tab_expisadg.exp_id = tab_expediente.exp_id\r\n WHERE\r\n tab_fondo.fon_estado = 1 AND\r\n u.uni_estado = 1 AND\r\n tab_tipocorr.tco_estado = 1 AND\r\n tab_series.ser_estado = 1 AND\r\n tab_expediente.exp_estado = 1 {$wh1} AND tab_series.ser_id={$tiposeries}\r\n ORDER BY tab_expediente.exp_id"; $resultadocod = $fondo2->dbSelectBySQL($sqlcodigos); $resultadocod = $resultadocod[0]; $expe = new Tab_expediente(); if ($cantidadexp != 0) { $sqlcaja = "SELECT\r\n tab_expediente.exp_sala,\r\n tab_expediente.exp_estante,\r\n tab_expediente.exp_balda,\r\n tab_expediente.exp_cuerpo,\r\n tab_expediente.exp_codigo\r\n FROM\r\n tab_expediente\r\n WHERE\r\n exp_estado=1 AND\r\n exp_nrocaj='{$i}' AND tab_expediente.exp_id={$expedientes['0']}"; $cajaresult = $expe->dbSelectBySQL($sqlcaja); foreach ($cajaresult as $rowscaja) { $sala = $rowscaja->exp_sala; $estante = $rowscaja->exp_estante; $balda = $rowscaja->exp_balda; $cuerpo = $rowscaja->exp_cuerpo; $expcodigo = $rowscaja->exp_codigo; } } else { $sqlcaja = "SELECT\r\n tab_expediente.exp_id,\r\n tab_expediente.exp_codigo,\r\n tab_archivo.fil_sala,\r\n tab_archivo.fil_estante,\r\n tab_archivo.fil_cuerpo,\r\n tab_archivo.fil_balda\r\n FROM\r\n tab_expediente\r\n INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n WHERE\r\n tab_archivo.fil_id ={$documentos['0']} and tab_archivo.fil_estado=1"; $cajaresult = $expe->dbSelectBySQL($sqlcaja); foreach ($cajaresult as $rowscaja) { $sala = $rowscaja->fil_sala; $estante = $rowscaja->fil_estante; $balda = $rowscaja->fil_balda; $cuerpo = $rowscaja->fil_cuerpo; $expcodigo = $rowscaja->exp_codigo; $exp_id = $rowscaja->exp_id; } } $st .= '<br><br>'; $st .= '<table border="1" style="width: 100%">'; $st .= '<tr>'; $st .= '<td style="border-right:2px solid white;">'; $st .= '<img src="' . PATH_ROOT . '/web/img/escudo.png" width="50" height="50" border="0" />'; $st .= '</td><td align="right"><img src="' . PATH_ROOT . '/web/img/iso.png" width="50" height="50" border="0" />'; $st .= '</td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td colspan="2">'; $st .= '<table border="1" style="width: 100%; text-align: center">'; $st .= '<tr>'; //$st.='<td colspan="11">'.$value->fon_cod . "-" . $value->uni_cod. '</td>'; $st .= '<th colspan="11" height="20" style="font-size:70px"><b>' . $resultadocod->fon_cod . DELIMITER . $resultadocod->uni_cod . DELIMITER . $resultadocod->tco_codigo . DELIMITER . $resultadocod->ser_codigo . '</b>'; if ($nropiezas != "") { $st .= "<b>." . $expcodigo . "</b>"; } else { $st .= " " . $minimo . ' - ' . $maximo; } $st .= '</th>'; $st .= '</tr>'; // echo $rows2->uni_cod; exit(); // Verificar que tipo de seccion se va a mostrar de que serie si tiene varias series $uc = explode(".", $rows2->uni_cod); $coduni = "{$uc['0']}.0"; $tab_unidad = new Tab_unidad(); $result = $tab_unidad->dbselectByField("uni_cod", $coduni); $result = $result[0]; $explodeObtCaja = explode("(", $result->uni_descripcion); if ($explodeObtCaja[1] == "") { $seccion = $result->uni_descripcion; } else { $nuevo = $explodeObtCaja[1] . "a"; $explodeObtCaja1 = explode(")", $nuevo); $seccion = $explodeObtCaja1[0]; } $where3 = ""; $longitud_cadena = explode(",", $varioseries); $longitud = count($longitud_cadena); for ($y = 0; $y < $longitud; $y++) { $where3 .= " tab_series.ser_id={$longitud_cadena[$y]} "; if ($y < $longitud - 1) { $where3 .= " OR "; } } $slverificavariaseries = "SELECT\r\n tab_series.ser_categoria\r\n FROM\r\n tab_series\r\n WHERE\r\n tab_series.ser_estado=1 AND {$where3}"; $tab_series = new Tab_series(); $unidad = new unidad(); $padre = $unidad->obtenerPadre($rows2->uni_id); $pa = 0; if ($padre == $rows2->uni_descripcion) { $pa++; } if ($seccion == "PRESIDENCIA" && $rows2->uni_descripcion == "AREA TECNICA") { $st .= '<tr>'; $st .= '<td colspan="11" height="20" style="font-size:30px"><b>' . htmlentities($rows2->uni_descripcion, ENT_IGNORE, 'utf-8') . '</b></td>'; $st .= '</tr>'; } else { if ($pa > 0) { $st .= '<tr>'; $st .= '<td colspan="11" height="20" style="font-size:30px"><b>' . htmlentities($rows2->uni_descripcion, ENT_IGNORE, 'utf-8') . '</b></td>'; $st .= '</tr>'; } else { $st .= '<tr>'; $st .= '<td colspan="11" height="20" style="font-size:30px"><b>' . $padre . " - " . htmlentities($rows2->uni_descripcion, ENT_IGNORE, 'utf-8') . '</b></td>'; $st .= '</tr>'; } } // if ($rows2->uni_par_cod) // { // $st.='<tr>'; // $st.='<td colspan="11" height="20" style="font-size:30px"><b>' . $seccion . ' - ' . $rows2->uni_descripcion . '</b></td>'; // $st.='</tr>'; // } // else // { // $st.='<tr>'; // $st.='<td colspan="11" height="20" style="font-size:30px"><b>' . $seccion . ' - ' . $result->uni_descripcion . '</b></td>'; // $st.='</tr>'; // } $st .= '<tr>'; $st .= '<td colspan="11" height="20" style="font-size:35px"><b>'; $series_rows = $tab_series->dbSelectBySQL($slverificavariaseries); foreach ($series_rows as $row) { $st .= $row->ser_categoria; if ($longitud > 1) { $st .= ","; } } $diferencia = $diferencia + 1; $st .= '</b></td>'; $st .= '</tr>'; if ($diferencia > 1) { $st .= '<tr>'; $st .= '<td colspan="11" height="20" style="font-size:48px"><b>' . $diferencia . ' EXPEDIENTE(S)</b></td>'; $st .= '</tr>'; } else { $rowtitulo = $tab_expisadg->dbselectByField("exp_id", $exp_id); $st .= '<tr>'; $st .= '<td colspan="11" height="20" style="font-size:48px"><b>' . $rowtitulo[0]->exp_titulo . '</b></td>'; $st .= '</tr>'; } $cant1 = 0; $pdf->SetFont('helvetica', '', 8); $st .= '<tr>'; $st .= '<td colspan="2" height="20" bgcolor="#CCCCCC" style="font-size:40px" width="232">FECHAS EXTREMAS:</td>'; $st .= '<td colspan="9" bgcolor="#CCCCCC" width="420" style="font-size:40px">CODIGOS:</td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td colspan="2" height="20" style="font-size:45px"><b>'; if ($diferencia == 1) { $st .= $rowtitulo[0]->exp_anioi; if ($rowtitulo[0]->exp_aniof) { $st .= " - " . $rowtitulo[0]->exp_aniof; } } $st .= '</b></td>'; $st .= '<th colspan="9" rowspan="3"'; if ($cantidadtotal > 15) { if ($cantidadtotal > 30) { $st .= 'style="text-align:left;font-size:24px;padding:15px">'; } else { $st .= 'style="text-align:left;font-size:32px;padding:15px">'; } } else { $st .= 'style="text-align:left;font-size:40px;padding:15px">'; } $p = 0; if ($cantidadexp != 0) { $sqlcodigos2 = "SELECT\r\n tab_fondo.fon_cod,\r\n u.uni_cod,\r\n tab_tipocorr.tco_codigo,\r\n tab_series.ser_codigo,\r\n (NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\n tab_expediente.exp_codigo,\r\n tab_expediente.exp_ori,\r\n tab_expediente.exp_cop,\r\n tab_expediente.exp_fot,\r\n tab_expediente.exp_id,\r\n tab_expisadg.exp_titulo,\r\n (SELECT uni_descripcion from tab_unidad WHERE tab_unidad.uni_id=u.uni_par) AS uni_par_cod,\r\n u.uni_codigo,\r\n (SELECT sof_nombre FROM tab_sopfisico WHERE sof_id=tab_expediente.sof_id AND tab_sopfisico.sof_estado = '1' ) AS sof_nombre\r\n FROM\r\n tab_fondo\r\n INNER JOIN tab_unidad AS u ON tab_fondo.fon_id = u.fon_id\r\n INNER JOIN tab_series ON u.uni_id = tab_series.uni_id\r\n INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n INNER JOIN tab_expisadg ON tab_expisadg.exp_id = tab_expediente.exp_id\r\n WHERE\r\n tab_fondo.fon_estado = 1 AND\r\n u.uni_estado = 1 AND\r\n tab_tipocorr.tco_estado = 1 AND\r\n tab_series.ser_estado = 1 AND\r\n tab_expediente.exp_estado = 1 AND\r\n tab_expediente.exp_nrocaj='{$i}' AND {$where2}\r\n ORDER BY correlativo"; $idexp = $_REQUEST['exp_id']; $vector = array(); $resultadoexpw = $fondo2->dbSelectBySQL($sqlcodigos2); $r = 0; $cantidadCajasfilas = count($resultadoexpw); foreach ($resultadoexpw as $filnro) { $st44 = ""; $codigo_exp = $filnro->fon_cod . DELIMITER . $filnro->uni_cod . DELIMITER . $filnro->tco_codigo . DELIMITER . $filnro->ser_codigo . DELIMITER . $filnro->correlativo; $sumar = $filnro->exp_ori + $filnro->exp_cop + $filnro->exp_fot; $cant1 = $cant1 + $filnro->exp_ori + $filnro->exp_cop + $filnro->exp_fot; if ($sumar == 0) { $archivo = new archivo(); $nroejemp = $archivo->obtenercantejemplares($filnro->exp_id); $sumar = $nroejemp; $cant1 = $cant1 + $sumar; } $st44 .= $codigo_exp . "("; if ($nropiezas != "") { $st44 .= $extraer_piezas[$r]; $cant3 = $extraer_piezas[$r] + $cant3; } else { $st44 .= $sumar; } $st44 .= ")"; // $st.=" (".$filnro->fil_fot.")"; $vector[$p] = $st44; // $st.=" "; $r++; $p++; } } if ($cantidadetiqcajas2 > 0) { $sqlcodigos2 = "SELECT\r\n tab_fondo.fon_cod,\r\n tab_unidad.uni_cod,\r\n tab_unidad.uni_codigo,\r\n tab_series.ser_codigo,\r\n tab_tipocorr.tco_codigo,\r\n tab_expediente.exp_id,\r\n tab_expediente.exp_codigo,\r\n (NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\n tab_archivo.fil_id,\r\n tab_archivo.fil_ori,\r\n tab_archivo.fil_cop,\r\n tab_archivo.fil_fot,\r\n tab_archivo.fil_nro,\r\n tab_archivo.fil_titulo\r\n FROM\r\n tab_fondo\r\n INNER JOIN tab_unidad ON tab_fondo.fon_id = tab_unidad.fon_id\r\n INNER JOIN tab_series ON tab_unidad.uni_id = tab_series.uni_id\r\n INNER JOIN tab_tipocorr ON tab_series.tco_id = tab_tipocorr.tco_id\r\n INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n WHERE\r\n tab_fondo.fon_estado = 1 AND\r\n tab_series.ser_estado = 1 AND\r\n tab_expediente.exp_estado = 1 AND\r\n {$where4} ORDER BY tab_archivo.fil_nro"; $resultadoexpw = $fondo2->dbSelectBySQL($sqlcodigos2); $y = 0; $cantidadCajasfilas = count($resultadoexpw); foreach ($resultadoexpw as $filnro) { $st44 = ""; $codigo_exp = $filnro->fon_cod . DELIMITER . $filnro->uni_cod . DELIMITER . $filnro->tco_codigo . DELIMITER . $filnro->ser_codigo . DELIMITER . $filnro->correlativo . DELIMITER . $filnro->fil_nro; $sumar = $filnro->fil_ori + $filnro->fil_cop + $filnro->fil_fot; $cant1 = $cant1 + $filnro->fil_ori + $filnro->fil_cop + $filnro->fil_fot; if ($sumar == 0) { $archivo = new archivo(); $nroejemp = $archivo->obtenercantejemplares($filnro->exp_id); $sumar = $nroejemp; $cant1 = $cant1 + $sumar; } $st44 .= $codigo_exp . "("; if ($nropiezas != "") { $st44 .= $extraer_piezas[$y]; $cant3 = $extraer_piezas[$y] + $cant3; } else { $st44 .= $sumar; } $st44 .= ")"; // $st42.=" (".$filnro->fil_fot.")"; $vector[$p] = $st44; $y++; $p++; } sort($vector); foreach ($vector as $ro) { $st .= $ro; $st .= " "; } } $st .= '</th>'; $st .= '</tr>'; if ($cant3 == 0) { $cant = $cant1; } else { $cant = $cant3; } $st .= '<tr>'; $st .= '<td colspan="4" height="20" bgcolor="#CCCCCC" width="232">NRO. DE CAJA DE EXPS.</td>'; // $st.='<td colspan="7" bgcolor="#CCCCCC" >ML</td>'; $st .= '</tr>'; //width="420" $st .= '<tr>'; $st .= '<td height="20" colspan="4" rowspan="3" style="font-size:190px">' . $i . '</td>'; // $st.='<td colspan="7" height="20" style="font-size:70px" >0,32</td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td colspan="5" bgcolor="#CCCCCC" height="20" width="218">NRO. DE PIEZAS</td>'; $st .= '<td colspan="2" bgcolor="#CCCCCC" width="201">Nº DE TRANSFERENCIA</td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td colspan="5" height="20" style="font-size:60px"><b>' . $cant . '</b></td>'; $st .= '<td colspan="2"></td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td colspan="4" bgcolor="#CCCCCC" height="20" width="232">UBICACIÓN TOPOGRAFICA:</td>'; $st .= '<td colspan="5" bgcolor="#CCCCCC" height="20" width="218">FECHA DE TRANSFERENCIA DOCUMENTAL</td>'; $st .= '<td colspan="2" bgcolor="#CCCCCC" width="201">ELABORADO POR:</td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td height="20" bgcolor="#CCCCCC">SALA</td>'; $st .= '<td height="20" bgcolor="#CCCCCC">ESTANTE</td>'; $st .= '<td height="20" bgcolor="#CCCCCC">BALDA</td>'; $st .= '<td height="20" bgcolor="#CCCCCC">CUERPO</td>'; $st .= '<td colspan="5" rowspan="2">'; $st .= '</td>'; $st .= '<td colspan="2" rowspan="2">' . $usuario->obtenerNombre($_SESSION['USU_ID']) . '</td>'; $st .= '</tr>'; $st .= '<tr>'; $st .= '<td height="20" style="font-size:35px">' . $sala . '</td>'; $st .= '<td height="20" style="font-size:35px">' . $estante . '</td>'; $st .= '<td height="20" style="font-size:35px">' . $balda . '</td>'; $st .= '<td height="20" style="font-size:35px">' . $cuerpo . '</td>'; $st .= '</tr>'; $st .= '</table>'; $st .= '</td>'; $st .= '</tr>'; $st .= '</table>'; $st .= ''; $s = 0; $pdf->writeHTML($st, true, false, false, false, ''); $st = ""; } // ----------------------------------------------------------------------------- //Close and output PDF document $pdf->Output('reporte_paquetes.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+ }
function view() { $exp_id = VAR3; $fil_id = VAR4; $this->archivo = new tab_archivo(); $rows = $this->archivo->dbselectByField("fil_id", $fil_id); $row = $rows[0]; // Tab_archivo // Tab_doccorr $tab_doccorr = new Tab_doccorr(); $sql = "SELECT *\r\n FROM tab_doccorr\r\n WHERE fil_id='" . $row->fil_id . "'"; $doccorr = $tab_doccorr->dbSelectBySQL($sql); if ($doccorr) { $doccorr = $doccorr[0]; // Nur $hojas_ruta = new hojas_ruta(); $this->registry->template->dco_id = $doccorr->dco_id; $this->registry->template->fil_cite = $hojas_ruta->obtenerSelect($doccorr->fil_cite); $seguimientos = new seguimientos(); $this->registry->template->fil_nur_s = $seguimientos->obtenerSelect($doccorr->fil_nur_s); $this->registry->template->fil_nur = $doccorr->fil_nur; $this->registry->template->fil_asunto = $doccorr->fil_asunto; $this->registry->template->fil_sintesis = $doccorr->fil_sintesis; $this->registry->template->fil_nur_tipo = ""; } else { // Nur $this->registry->template->dco_id = ""; $this->registry->template->fil_cite = ""; $this->registry->template->fil_nur_s = ""; $this->registry->template->fil_nur = $_SESSION["codigo"]; $this->registry->template->fil_asunto = ""; $this->registry->template->fil_sintesis = ""; $this->registry->template->fil_nur_tipo = ""; } // Tab_exparchivo $sql = "SELECT *\r\n FROM tab_exparchivo\r\n WHERE fil_id='" . $row->fil_id . "'"; $exa_rows = $this->archivo->dbSelectBySQL($sql); $exa_row = $exa_rows[0]; $this->registry->template->exp_id = $exp_id; $this->registry->template->tra_id = $exa_row->tra_id; $this->registry->template->cue_id = $exa_row->cue_id; $this->registry->template->exa_id = $exa_row->exa_id; // Tab_archivo $this->registry->template->fil_id = $fil_id; $this->registry->template->fil_codigo = $row->fil_codigo; $expediente = new expediente(); $this->registry->template->exp_codigo = $expediente->obtenerCodigo(VAR3); $this->registry->template->exp_nombre = ""; $this->registry->template->exp_corr = $expediente->obtenerTipoCorrExpediente(VAR3); $this->registry->template->fil_nro = $row->fil_nro; $this->registry->template->fil_titulo = $row->fil_titulo; $this->registry->template->fil_subtitulo = $row->fil_subtitulo; $this->registry->template->fil_fecha = $row->fil_fecha; $this->registry->template->fil_mes = $expediente->obtenerSelectMes($row->fil_mes); $this->registry->template->fil_anio = $expediente->obtenerSelectAnio($row->fil_anio); $this->registry->template->fil_mesf = $expediente->obtenerSelectMes($row->fil_mesf); $this->registry->template->fil_aniof = $expediente->obtenerSelectAnio($row->fil_aniof); $idioma = new idioma(); $this->registry->template->idi_id = $idioma->obtenerSelect($row->idi_id); $this->registry->template->fil_proc = $row->fil_proc; $this->registry->template->fil_firma = $row->fil_firma; $this->registry->template->fil_cargo = $row->fil_cargo; $this->registry->template->fil_alccon = $row->fil_alccon; // Find ser_id $texpediente = new tab_expediente(); $tab_expediente = $texpediente->dbselectById(VAR3); $ser_id = $tab_expediente->getSer_id(); // Include dynamic fields $expcampo = new expcampo(); $this->registry->template->filcampo = $expcampo->obtenerSelectCampos($ser_id); $sopfisico = new sopfisico(); $this->registry->template->sof_id = $sopfisico->obtenerSelect($row->sof_id); $this->registry->template->fil_nrofoj = $row->fil_nrofoj; $this->registry->template->fil_tomovol = $row->fil_tomovol; $this->registry->template->fil_nroejem = $row->fil_nroejem; $this->registry->template->fil_nrocaj = $row->fil_nrocaj; $this->registry->template->fil_nropaq = $row->fil_nropaq; $this->registry->template->fil_cantpaq = $row->fil_cantpaq; $this->registry->template->fil_cantcaj = $row->fil_cantcaj; $this->registry->template->fil_sala = $row->fil_sala; $archivo = new archivo(); $this->registry->template->fil_estante = $archivo->obtenerSelectEstante($row->fil_estante); $this->registry->template->fil_cuerpo = $row->fil_cuerpo; $this->registry->template->fil_balda = $row->fil_balda; $this->registry->template->fil_tipoarch = $row->fil_tipoarch; $this->registry->template->fil_mrb = $row->fil_mrb; if ($row->fil_ori) { $this->registry->template->fil_ori = $row->fil_ori; } else { $this->registry->template->fil_ori = '0'; } if ($row->fil_cop) { $this->registry->template->fil_cop = $row->fil_cop; } else { $this->registry->template->fil_cop = '0'; } if ($row->fil_fot) { $this->registry->template->fil_fot = $row->fil_fot; } else { $this->registry->template->fil_fot = '0'; } $this->registry->template->fil_confidencilidad = $row->fil_confidencialidad; $this->registry->template->fil_obs = $row->fil_obs; $this->registry->template->required_archivo = ""; // Validate keywords $palclave = new palclave(); $sis_palclave = $palclave->obtenerSisPalclave(); if ($sis_palclave == "RECORDAR") { $this->registry->template->fil_descripcion = $palclave->listaPCFile($row->fil_id); $this->registry->template->pac_nombre = ""; } else { $this->registry->template->fil_descripcion = ""; $this->registry->template->pac_nombre = ""; } $tab_serie = new tab_series(); $row1 = $tab_serie->dbselectById($ser_id); $expisadg = new tab_expisadg(); $row2 = $expisadg->dbselectById(VAR3); $expediente2 = new expediente(); $this->registry->template->detExpediente = ""; $this->registry->template->detExpediente = $expediente2->getDetalles(VAR3); $this->registry->template->ubicacion = $expediente2->getUbicacion(VAR3); $this->registry->template->ser_id = $row1->ser_id; $this->registry->template->serie = $row1->ser_categoria; $this->registry->template->exp_fecha_exi = $row2->exp_fecha_exi; $this->registry->template->exp_fecha_exf = $row2->exp_fecha_exf; if (VAR5) { if (VAR5 == 0) { $msm = "HUBO ERROR AL REGISTRAR EL DOCUMENTO!"; } else { if (VAR5 == 1) { $msm = "SE GUARDO CORRECTAMENTE EL DOCUMENTO!"; } else { $msm = ""; } } } else { $msm = ""; } $this->registry->template->msm = $msm; $exp = new expediente(); $this->registry->template->linkTree = $exp->linkTree($exp_id, $exa_row->tra_id, $exa_row->cue_id); $arc = new archivo(); $this->registry->template->confidencialidad = $arc->loadConfidencialidad('1'); $this->registry->template->PATH_WEB = PATH_WEB; $this->registry->template->PATH_DOMAIN = PATH_DOMAIN; $this->registry->template->PATH_EVENT = "update"; $this->registry->template->controller = VAR1; $this->registry->template->GRID_SW = "true"; $this->registry->template->PATH_J = "jquery-1.4.1"; $this->registry->template->tituloEstructura = "<div class='titulo' align='center'>ESTRUCTURA DOCUMENTAL</div>"; $this->menu = new menu(); $liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']); $this->registry->template->men_titulo = $liMenu; $this->registry->template->show('headerG'); // $this->registry->template->show('archivo/exp_detallesView.tpl'); $this->registry->template->show('archivo/tab_archivo.tpl'); $this->registry->template->show('footer'); }
function view() { $pav_id = VAR3; $dov_id = VAR4; $this->pasaje_viatico = new tab_documento_viaje(); $rows = $this->pasaje_viatico->dbselectByField("pav_id", $pav_id); $row = $rows[0]; $pasaje_viatico = new pasaje_viatico(); $this->registry->template->pav_nromemo = $pasaje_viatico->getPav_nromemo(VAR3); $this->registry->template->pav_de = $pasaje_viatico->getPav_de(VAR3); $this->registry->template->pav_a = $pasaje_viatico->getPav_a(VAR3); if (VAR5) { if (VAR5 == 0) { $msm = "HUBO ERROR AL REGISTRAR EL DOCUMENTO!"; } else { if (VAR5 == 1) { $msm = "SE GUARDO CORRECTAMENTE EL DOCUMENTO!"; } else { $msm = ""; } } } else { $msm = ""; } $this->registry->template->msm = $msm; $exp = new pasaje_viatico(); $this->registry->template->linkTree = $exp->linkTree(VAR3); $arc = new archivo(); $this->registry->template->confidencialidad = $arc->loadConfidencialidad('1'); $this->registry->template->PATH_WEB = PATH_WEB; $this->registry->template->PATH_DOMAIN = PATH_DOMAIN; $this->registry->template->PATH_EVENT = "update"; $this->registry->template->controller = VAR1; $this->registry->template->GRID_SW = "true"; $this->registry->template->PATH_J = "jquery-1.4.1"; $this->registry->template->tituloEstructura = "<div class='titulo' align='center'>DOCUMENTOS DEL INFORME</div>"; $this->menu = new menu(); $liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']); $this->registry->template->men_titulo = $liMenu; $this->registry->template->show('headerG'); // $this->registry->template->show('archivo/exp_detallesView.tpl'); $this->registry->template->show('documento_viaje/tab_documento_viaje.tpl'); $this->registry->template->show('footer'); }
function subirDatos() { error_reporting(0); Session::init(); $id_user = Session::get("cedula"); $apell = Session::get("apellido"); $edad = Session::get('edad'); $tpl = new Template(); $mensaje = ""; $titulo = "Multimedia"; $archivo = new archivo(); if (isset($_POST['cursos'])) { $serv = $ruta = dirname(__FILE__) . '/' . $id_user . '/'; if (strcmp($_POST['cursos'], "0") == 0) { $varia = $_POST['nombre']; } else { $varia = $_POST['cursos']; } //var_dump($varia);exit(); $exten = explode(".", $_FILES['archivo']['name']); $ex = end($exten); $var = $varia . '.' . $ex; $ruta = $serv . $_FILES['archivo']['name']; // Primero creamos un ID de conexión a nuestro servidor $cid = ftp_connect(FTP_HOST); // Luego creamos un login al mismo con nuestro usuario y contraseña $resultado = ftp_login($cid, FTP_USR, FTP_PASS); // Comprobamos que se creo el Id de conexión y se pudo hacer el login if (!$cid || !$resultado) { echo "Fallo en la conexión"; die; } // Cambiamos a modo pasivo, esto es importante porque, de esta manera le decimos al //servidor que seremos nosotros quienes comenzaremos la transmisión de datos. ftp_pasv($cid, true); // Nos cambiamos al directorio, donde queremos subir los archivos, si se van a subir a la raíz // esta por demás decir que este paso no es necesario. En mi caso uso un directorio llamado boca ftp_chdir($cid, ${$id_user}); // Tomamos el nombre del archivo a transmitir, pero en lugar de usar $_POST, usamos $_FILES que le indica a PHP // Que estamos transmitiendo un archivo, esto es en realidad un matriz, el segundo argumento de la matriz, indica // el nombre del archivo $local = $var; // Este es el nombre temporal del archivo mientras dura la transmisión $remoto = $_FILES["archivo"]["tmp_name"]; // Juntamos la ruta del servidor con el nombre real del archivo $ruta = $serv . $local; // Verificamos si ya se subio el archivo temporal if (is_uploaded_file($remoto)) { $archivo->setId_usuario($id_user); $archivo->setNombre($varia); $archivo->setExtension($ex); if ($archivo->insertarArchivo()) { //guardamos nombre en base de datos copy($remoto, $ruta); // copiamos el archivo temporal, del directorio de temporales de nuestro servidor a la ruta que creamos } else { $mensaje = "error al guardar archivo"; } } else { echo "no se pudo subir el archivo " . $local; } //} //cerramos la conexión FTP ftp_close($cid); } $archivos = $archivo->listarArchivos($id_user); $imagen = $archivo->mostrarArchivo($id_user, $_POST['cursos']); //var_dump($imagen);exit(); $datos = array('archivos' => $archivos, 'imagen' => $imagen, 'mensaje' => $mensaje, 'titulo' => $titulo); $tpl->asignar('edad', $edad); $tpl->asignar('cedula', $id_user); $tpl->asignar('apellido', $apell); $tpl->mostrar("multimedia", $datos); }