KERNEL::AddPage("home", "Home", true); KERNEL::AddPage("store", "Store", true, null, function () { $btnHtm = ' <li class="dropdown closed"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Store <span class="caret"></span> </a> <ul class="dropdown-menu"> '; foreach (ItemCategory::GetCachedResults("ItemCategory") as $ItemCat) { $btnHtm .= '<li><a href="?page=store&cat=' . $ItemCat->GetValue("ID") . '">' . $ItemCat->GetValue("Name") . '</a></li>'; } return $btnHtm . ' </ul> </li> <script> $( ".dropdown-toggle" ).dropdown(); </script> '; }); KERNEL::AddPage("account", "Your Account", true, User::AccessCheck_LoggedIn()); KERNEL::AddPage("donate", "Donate", true, User::AccessCheck_LoggedIn()); KERNEL::AddPage("admin", "Admin", true, User::AccessCheck_Admin()); KERNEL::AddPage("login", "Login", false); KERNEL::AddPage("ipn", "Paypal IPN [Private]", false); KERNEL::AddPage("error", "Error", false); KERNEL::SetDefaultPage("home"); KERNEL::NavigatePage();
$FileType = $File["type"]; $FileSize = $File["size"]; if (75000 < $FileSize) { // Too Big } elseif ($FileType != "image/png" && $FileType != "image/jpg" && $FileType != "image/jpeg") { // Bad Type } elseif ($FileExtension != "png" && $FileExtension != "jpg" && $FileExtension != "jpeg") { // Bad Extension } else { $ImageURLName = md5(rand()); move_uploaded_file($File["tmp_name"], "includes/images/uploaded/" . $ImageURLName . "." . $FileExtension); } } Database::Insert("gmd_items", array("Category" => intval($_POST["catID"]), "Name" => $_POST["itemName"], "Description" => $_POST["itemDesc"], "Cost" => floatval($_POST["itemCost"]), "Image" => $ImageURLName, "ShowImage" => !empty($_POST["showImage"]) ? 1 : 0, "Status" => ItemStatus::ACTIVE)); echo "<h4>You are being redirected..</h4>"; KERNEL::HardNavigate("admin", "&area=items"); } else { $CatObj = ItemCategory::GetByField("ItemCategory", "ID", $_GET["catid"]); ?> <h4>Add Item</h4> <form enctype="multipart/form-data" method="POST" action="?page=admin&area=items&newitem=1"> <input type="hidden" name="addItem" value="1" /> <input type="hidden" name="catID" value="<?php echo $CatObj->GetValue("ID"); ?> " /> <input type="hidden" id="itemDesc" name="itemDesc" value="No Description Available" /> <div class="row">
$ActionData = ""; $ServerData = ""; foreach ($ActionArr["Arguments"] as $ArgObject) { $ActionData .= $_POST["input_" . $ArgObject->SysName] . ItemAction::$SerialKey; } foreach (Servers::GetCachedResults("Servers") as $ServerObj) { if (isset($_POST["action_server_" . $ServerObj->GetValue("ID")])) { $ServerData .= $ServerObj->GetValue("ID") . ";"; } } $ItemAction->ChangeValue("ActionData", $ActionData); $ItemAction->ChangeValue("Servers", $ServerData); KERNEL::HardNavigate("admin", "&area=items&edit=1&item=" . $ItemObj->GetValue("ID")); } elseif (isset($_GET["del"])) { $ItemAction->Delete(); KERNEL::HardNavigate("admin", "&area=items&edit=1&item=" . $ItemObj->GetValue("ID")); } ?> <h4>Edit Action</h4> <form method="POST" action="?page=admin&area=items&editaction=<?php echo $ItemAction->GetValue("ID"); ?> "> <input type="hidden" name="doEditAction" value="yes" /> <div class="row"> <div class="col-sm-6 col-md-4" style="text-align: right;line-height: 34px;"> <b>Item Name</b> </div>
<?php $ItemCategories = ItemCategory::GetCachedResults("ItemCategory"); if (count($ItemCategories) == 0) { KERNEL::OnError("You must add an item category before accessing this page.", false); } else { foreach ($ItemCategories as $ItemCat) { echo ' <div class="panel panel-default"> <div class="panel-heading"> <a href="?page=admin&area=items&newitem=1&catid=' . $ItemCat->GetValue("ID") . '" style="float: right;"><span class="btn btn-xs btn-success">Add Item</span></a> <b>' . $ItemCat->GetValue("Name") . ' Items</b> </div> <table class="table"> <thead style="font-size: 12px;"> <th style="width: 50%;">Name</th> <th style="width: 25%;">Cost</th> <th style="width: 25%;text-align: right;">Actions</th> </thead> <tbody> '; $Items = Item::SearchCachedResults("Item", "Category", $ItemCat->GetValue("ID")); if (count($Items) == 0) { echo '<tr><td colspan=3 style="text-align: center;padding: 16px;font-size: 12px;"><i>No items to display!</i></td></tr>'; } else { foreach ($Items as $ItemObj) { echo ' <tr style="font-size: 12px;"> <td>' . $ItemObj->GetValue("Name") . '
function informe_densidad($boleta) { $cantidad_densidades = 6; $this->BoletaHasDensidades->BindModel(array('hasOne' => array('Area' => array('className' => 'Area', 'foreignKey' => '', 'conditions' => array('Area.id = BoletaHasDensidades.area')), 'SubArea' => array('className' => 'SubArea', 'foreignKey' => '', 'conditions' => array('SubArea.id = BoletaHasDensidades.subarea')), 'TipoRelleno' => array('className' => 'TipoRelleno', 'foreignKey' => '', 'conditions' => array('TipoRelleno.id = BoletaHasDensidades.tipo_relleno'))))); $bho = $this->BoletaHasObra->find('first', array('conditions' => array('BoletaHasObra.boleta' => $boleta))); $contratista = $this->DatosClientes->find('first', array('conditions' => array('DAT_CLI_RUT' => $bho['Obra']['contratista_rut']))); $solicitante = $this->DatosClientes->find('first', array('conditions' => array('DAT_CLI_RUT' => $bho['Obra']['cliente_rut']))); $destinatario = $this->Destinatario->find('first', array('conditions' => array('id' => $bho['Obra']['destinatario']))); $operador = $this->Operador->find('first', array('conditions' => array('id' => $bho['DatosBoleta']['operador']))); $bhd = $this->BoletaHasDensidades->find('all', array('conditions' => array('BoletaHasDensidades.boleta' => $boleta), 'order' => 'BoletaHasDensidades.numero_densidad ASC')); $mes_densimetro = date('n', strtotime($bho['DatosBoleta']['fecha_inspeccion'])); $año_densimetro = date('y', strtotime($bho['DatosBoleta']['fecha_inspeccion'])); $densimetro = $this->Densimetro->find('first', array('conditions' => array('and' => array('codigo_densimetro' => $bho['DatosBoleta']['densimetro'], 'mes' => $mes_densimetro, 'año' => $año_densimetro)))); if ($mes_densimetro + 1 == 13) { $mes_densimetro = 0; $año_densimetro = $año_densimetro + 1; } $densimetro_siguiente = $this->Densimetro->find('first', array('conditions' => array('and' => array('codigo_densimetro' => $bho['DatosBoleta']['densimetro'], 'mes' => $mes_densimetro + 1, 'año' => $año_densimetro)))); if ($bho['DatosBoleta']['tipo_instrumento'] == 1) { //Cono de arena $nombre_ensayo = 'Densidad in situ con Cono de Arena'; $metodologia = 'NCh1516.Of1979 Mecánica de suelos - Determinación de la densidad en el terreno - Método del cono de arena.<br>' . 'NCh1515.Of1979 Mecánica de suelos - Determinación de la humedad.'; } elseif ($bho['DatosBoleta']['tipo_instrumento'] == 2) { //Densimetro nuclear $nombre_ensayo = 'Densidad in situ con densímetro nuclear'; $metodologia = 'ASTM D 6938-08a, Standard Test Methods for In-Place Density and Water Content of Soil and Soil-Aggregate by Nuclear Methods (Shallows Depth) 1'; } if ($bho['DatosBoleta']['tipo_ensayo'] == 1) { //densidad relativa $tipo_ensayo = 'Densidad Relativa'; $densidad_relativa = 'Densidad Relativa'; $proctor = ''; $densidad_minima = 'Densidad<br>Mínima<br>(g/cm<sup>3</sup>)'; $densidad_maxima = 'Densidad<br>Máxima<br>(g/cm<sup>3</sup>)'; $dmcs1 = ''; $dmcs2 = ''; $densidad1 = 'Densidad'; $densidad2_1 = 'Mínima'; $densidad2_2 = 'Máxima'; $densidad3 = '(g/cm<sup>3</sup>)'; //largos analisis de suelos $largo_muestra = 25; $largo_informe = 35; $largo_ensayo = 30; $largo_proctor = 1; $largo_humedad_optima = 35; $largo_densidad_min = 30; $largo_densidad_max = 34; //termina largo analisis de suelos //largo densidad in situ $largo_espesor_capa = 25; $largo_espesor_medicion = 25; $largo_densidad_humeda = 25; $largo_humedad = 24; $largo_densidad_seca = 25; $largo_dmcs = 1; $largo_dmin = 15; $largo_dmax = 15; $largo_densidad_relativa = 25; //termina largo densidad in situ $nota = ''; } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 2) { //proctor modificado $tipo_ensayo = 'Proctor Modificado'; $densidad_relativa = 'Compactación'; $proctor = 'DMCS<br>(g/cm<sup>3</sup>)'; $densidad_minima = ''; $densidad_maxima = ''; $dmcs1 = 'DMCS'; $dmcs2 = '(g/cm<sup>3</sup>)'; $densidad1 = ''; $densidad2_1 = ''; $densidad2_2 = ''; $densidad3 = ''; //largos analisis de suelos $largo_muestra = 35; $largo_informe = 35; $largo_ensayo = 35; $largo_proctor = 39; $largo_humedad_optima = 35; $largo_densidad_min = 1; $largo_densidad_max = 10; //termina largo analisis de suelos //largo densidad in situ $largo_espesor_capa = 25; $largo_espesor_medicion = 25; $largo_densidad_humeda = 25; $largo_humedad = 28; $largo_densidad_seca = 25; $largo_dmcs = 25; $largo_dmin = 1; $largo_dmax = 1; $largo_densidad_relativa = 25; //termina largo densidad in situ $nota = ''; } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 3) { //suelo cementado $tipo_ensayo = 'Suelo Cementado'; $densidad_relativa = 'Compactación'; $proctor = ''; $densidad_minima = ''; $densidad_maxima = ''; $dmcs1 = ''; $dmcs2 = ''; $densidad1 = ''; $densidad2_1 = ''; $densidad2_2 = ''; $densidad3 = ''; //largos analisis de suelos $largo_muestra = 35; $largo_informe = 35; $largo_ensayo = 35; $largo_proctor = 39; $largo_humedad_optima = 35; $largo_densidad_min = 1; $largo_densidad_max = 10; //termina largo analisis de suelos //largo densidad in situ $largo_espesor_capa = 20; $largo_espesor_medicion = 20; $largo_densidad_humeda = 20; $largo_humedad = 25; $largo_densidad_seca = 25; $largo_dmcs = 25; $largo_dmin = 10; $largo_dmax = 10; $largo_densidad_relativa = 25; //termina largo densidad in situ //nota solo para suelo cementado $nota = '<br>2. El ensayo de control in situ no puede ser controlado, debido a que la densidad presente en el suelo, no permite la penetración mínima para determinar la densidad del elemento.'; } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 4) { //combinado $tipo_ensayo = 'Densidad Relativa y Proctor Modificado'; $densidad_relativa = 'Compactación'; $proctor = 'DMCS<br>(g/cm<sup>3</sup>)'; $densidad_minima = 'Densidad<br>Mínima<br>(g/cm<sup>3</sup>)'; $densidad_maxima = 'Densidad<br>Máxima<br>(g/cm<sup>3</sup>)'; $dmcs1 = 'DMCS'; $dmcs2 = '(g/cm<sup>3</sup>)'; $densidad1 = 'Densidad'; $densidad2_1 = 'Mínima'; $densidad2_2 = 'Máxima'; $densidad3 = '(g/cm<sup>3</sup>)'; //largos analisis de suelos $largo_muestra = 30; $largo_informe = 29; $largo_ensayo = 30; $largo_proctor = 30; $largo_humedad_optima = 35; $largo_densidad_min = 18; $largo_densidad_max = 18; //termina largo analisis de suelos //largo densidad in situ $largo_espesor_capa = 20; $largo_espesor_medicion = 20; $largo_densidad_humeda = 25; $largo_humedad = 20; $largo_densidad_seca = 21; $largo_dmcs = 25; $largo_dmin = 12; $largo_dmax = 12; $largo_densidad_relativa = 25; //termina largo densidad in situ $nota = ''; } $numero_informe = $this->punto_miles($bho['DatosBoleta']['numero_informe']); $guion = $bho['DatosBoleta']['guion']; $verificar_firma = $this->verificar_firma($boleta); if ($verificar_firma == 1) { KERNEL::error('No se puede subir el informe Nº ' . $numero_informe . '-' . $guion . ' ya que el definitivo se encuentra firmado.'); } elseif ($verificar_firma == 2) { $guion += 1; $this->DatosBoleta->id = $bho['DatosBoleta']['boleta']; $this->DatosBoleta->saveField('guion', $guion); } App::import('Vendor', 'informe_densidad'); $tcpdf = new XTCPDF('M', PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false); $tcpdf->SetMargins(10, 18, 10); $tcpdf->AddPage(); $tcpdf->SetFont('arial', '', 8); $tcpdf->SetCreator(PDF_CREATOR); $tcpdf->SetAuthor('IDIEM'); $tcpdf->SetTitle('Informe Densidad'); $tcpdf->SetSubject(''); $tcpdf->SetKeywords(''); $tcpdf->SetAutoPageBreak(false, PDF_MARGIN_BOTTOM); $tcpdf->SetFillColor(204, 204, 204); $tcpdf->SetLineWidth(0.1); $tcpdf->SetFont('arial', 'black', 9); $tcpdf->MultiCell(130, 4, 'INFORME DE ENSAYO Nº ' . $numero_informe . '-' . $guion, 0, 'R', 0, 0, '', '', true, 0, false, true, 4, 'T'); $tcpdf->SetFont('arial', '', 8); $tcpdf->MultiCell(60, 4, 'Fecha de Emisión: ' . $this->fecha_spanish(date('Y-m-d')), 0, 'R', 0, 1, '', '', true, 0, false, true, 4, 'T'); $tcpdf->SetFont('arial', 'black', 7); $tcpdf->MultiCell(190, 4, 'ANTECEDENTES GENERALES', 'B', 'C', 1, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->SetFont('arial', '', 7); $tcpdf->MultiCell(35, 4, 'NOMBRE DEL ENSAYO', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(95, 4, ': ' . $nombre_ensayo, 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'CÓDIGO DE OBRA', 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $bho['Obra']['codigo_obra'], 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, 'OBRA', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(95, 4, ': ' . $bho['Obra']['nombre_obra'], 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, '', 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); //eliminaron el numero de control $tcpdf->MultiCell(35, 4, '', 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); //eliminaron el numero de control $tcpdf->MultiCell(35, 4, 'UBICACIÓN DE LA OBRA', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(95, 4, ': ' . $bho['Obra']['direccion'], 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'DESTINATARIO', 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $destinatario['Destinatario']['nombre'], 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, 'CONTRATISTA', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(95, 4, ': ' . $contratista['DatosClientes']['DAT_CLI_NOMBRE'], 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'Nº BOLETA', 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $boleta, 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, 'SOLICITANTE', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(95, 4, ': ' . $solicitante['DatosClientes']['DAT_CLI_NOMBRE'], 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'FECHA INSPEC.', 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $this->fechaMysql($bho['DatosBoleta']['fecha_inspeccion']), 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, 'DIRECCIÓN', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(95, 4, ': ' . $contratista['DatosClientes']['DAT_CLI_DIRECCION'], 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'FACILITY', 0, 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $bho['DatosBoleta']['facility'], 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); //---------- $tcpdf->SetFont('arial', 'black', 7); $tcpdf->MultiCell(190, 4, 'METODOLOGÍA', 'LRT', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->SetFont('arial', '', 7); $tcpdf->MultiCell(190, 4, $metodologia, 'LRB', 'L', 0, 1, '', '', true, 0, true, true, 4, 'M'); //--------- $tcpdf->SetFont('arial', 'black', 7); $tcpdf->MultiCell(190, 2, '', 'B', 'C', 0, 1, '', '', true, 0, false, true, 2, 'M'); $tcpdf->MultiCell(190, 4, 'DATOS DEL DENSIMETRO', 'B', 'C', 1, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->SetFont('arial', '', 7); $tcpdf->MultiCell(30, 4, 'MARCA', 'LT', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(40, 4, ': ' . $densimetro['Densimetro']['marca'], 'T', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(20, 4, 'CONTEO', 'T', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(40, 4, ': ' . $densimetro['Densimetro']['conteo'], 'T', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'OPERADOR', 'T', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $operador['Operador']['nombre'], 'TR', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(30, 4, 'DENSIMETRO Nº', 'L', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(40, 4, ': ' . $densimetro['Densimetro']['codigo_densimetro'], '', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(20, 4, 'MODELO', '', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(40, 4, ': ' . $densimetro['Densimetro']['modelo'], '', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(25, 4, 'HUMEDAD', '', 'L', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(35, 4, ': ' . $densimetro['Densimetro']['humedad'], 'R', 'L', 0, 1, '', '', true, 0, false, true, 4, 'M'); //--------tabla de densidad: $tcpdf->MultiCell(30, 4, 'Fecha', 1, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(80, 4, 'Limite inferior de proyección de densidad de conteo (kg/cm<sup>3</sup>)', 1, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(80, 4, 'Limite superior de proyección de densidad de conteo (kg/cm<sup>3</sup>)', 1, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(30, 4, $this->mesEspañol($densimetro['Densimetro']['mes']) . '-' . $densimetro['Densimetro']['año'], 1, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(80, 4, $this->punto_miles($densimetro['Densimetro']['limite_inferior']), 1, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(80, 4, $this->punto_miles($densimetro['Densimetro']['limite_superior']), 1, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(30, 4, $this->mesEspañol($densimetro_siguiente['Densimetro']['mes']) . '-' . $densimetro_siguiente['Densimetro']['año'], 1, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(80, 4, $this->punto_miles($densimetro_siguiente['Densimetro']['limite_inferior']), 1, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(80, 4, $this->punto_miles($densimetro_siguiente['Densimetro']['limite_superior']), 1, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); //ubicacion de los puntos de control: $tcpdf->SetFont('arial', 'black', 7); $tcpdf->MultiCell(190, 2, '', 'B', 'C', 0, 1, '', '', true, 0, false, true, 2, 'M'); $tcpdf->MultiCell(190, 4, 'UBICACIÓN DE LOS PUNTOS DE CONTROL', 'B', 'C', 1, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->SetFont('arial', '', 7); for ($i = 1; $i <= $cantidad_densidades; $i++) { if ($i == 1) { $borde = 'T'; } elseif ($i == $cantidad_densidades) { $borde = 'B'; } else { $borde = ''; } $ubicacion_ptos_control = array(); if ($bhd[$i - 1]['BoletaHasDensidades']['area']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['Area']['nombre']); } if ($bhd[$i - 1]['BoletaHasDensidades']['subarea']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['SubArea']['nombre']); } if ($bhd[$i - 1]['BoletaHasDensidades']['tipo_relleno']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['TipoRelleno']['nombre']); } if ($bhd[$i - 1]['BoletaHasDensidades']['acopio']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['acopio']); } if ($bhd[$i - 1]['BoletaHasDensidades']['elemento']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['elemento']); } if ($bhd[$i - 1]['BoletaHasDensidades']['capa']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['capa']); } if ($bhd[$i - 1]['BoletaHasDensidades']['ejes']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['ejes']); } if ($bhd[$i - 1]['BoletaHasDensidades']['otros']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['otros']); } if ($bhd[$i - 1]['BoletaHasDensidades']['c_norte']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['c_norte']); } if ($bhd[$i - 1]['BoletaHasDensidades']['c_este']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['c_este']); } if ($bhd[$i - 1]['BoletaHasDensidades']['elevacion']) { array_push($ubicacion_ptos_control, $bhd[$i - 1]['BoletaHasDensidades']['elevacion']); } $ubicacion_ptos_control = implode(', ', $ubicacion_ptos_control); $tcpdf->MultiCell(10, 8, 'D' . $i, 'L' . $borde, 'L', 0, 0, '', '', true, 0, false, true, 8, 'M'); $tcpdf->MultiCell(180, 8, $ubicacion_ptos_control, 'R' . $borde, 'L', 0, 1, '', '', true, 0, false, true, 8, 'M'); } //Analisis de suelos: $tcpdf->SetFont('arial', 'black', 7); $tcpdf->SetFillColor(204, 204, 204); $tcpdf->MultiCell(190, 2, '', 'B', 'C', 0, 1, '', '', true, 0, false, true, 2, 'M'); $tcpdf->MultiCell(190, 4, 'ANÁLISIS DE SUELOS', 'B', 'C', 1, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell($largo_muestra, 6, 'Muestra<br> <br>', 'LT', 'C', 0, 0, '', '', true, 0, true, true, 6, 'M'); $tcpdf->MultiCell($largo_informe, 6, 'Informe<br> <br>', 'T', 'C', 0, 0, '', '', true, 0, true, true, 6, 'M'); $tcpdf->MultiCell($largo_ensayo, 6, 'Ensayo<br> <br>', 'T', 'C', 0, 0, '', '', true, 0, true, true, 6, 'M'); $tcpdf->MultiCell($largo_proctor, 6, $proctor, 'T', 'C', 0, 0, '', '', true, 0, true, true, 6, 'M'); $tcpdf->MultiCell($largo_humedad_optima, 6, 'Humedad<br>Óptima (%)', 'T', 'C', 0, 0, '', '', true, 0, true, true, 6, 'M'); $tcpdf->MultiCell($largo_densidad_min, 6, $densidad_minima, 'T', 'C', 0, 0, '', '', true, 0, true, true, 6, 'M'); $tcpdf->MultiCell($largo_densidad_max, 6, $densidad_maxima, 'RT', 'C', 0, 1, '', '', true, 0, true, true, 6, 'M'); //-------- $tcpdf->SetFont('arial', '', 7); $contador = 0; $muestras = array(); for ($i = 0; $i < 6; $i++) { if ($contador < 6) { if ($contador == 5) { $borde = 'B'; } else { $borde = ''; } if (!empty($bhd[$i]['ResultadosAnalisisSuelo']['id']) && !in_array($bhd[$i]['ResultadosAnalisisSuelo']['id'], $muestras)) { $m = 'M' . $bhd[$i]['ResultadosAnalisisSuelo']['identificador_muestra']; $dato_numero_informe = $bhd[$i]['ResultadosAnalisisSuelo']['numero_informe']; $ensayo = $tipo_ensayo; $dato_proctor = str_replace('.', ',', $this->punto_miles($bhd[$i]['ResultadosAnalisisSuelo']['proctor'])); $dato_humedad_optima = str_replace('.', ',', $bhd[$i]['ResultadosAnalisisSuelo']['humedad']); $dato_dmin = $this->punto_miles($bhd[$i]['ResultadosAnalisisSuelo']['densidad_minima']); $dato_dmax = $this->punto_miles($bhd[$i]['ResultadosAnalisisSuelo']['densidad_maxima']); array_push($muestras, $bhd[$i]['ResultadosAnalisisSuelo']['id']); //se le agrega el id de la muestra que se va a mostrar } else { $m = ''; $dato_numero_informe = ''; $ensayo = ''; $dato_proctor = ''; $dato_humedad_optima = ''; $dato_dmin = ''; $dato_dmax = ''; } $tcpdf->MultiCell($largo_muestra, 4, $this->emptyGuion($m), 'L' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell($largo_informe, 4, $this->emptyGuion($dato_numero_informe), '' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell($largo_ensayo, 4, $this->emptyGuion($ensayo), '' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); if ($bho['DatosBoleta']['tipo_ensayo'] == 1) { //densidad relativa $tcpdf->MultiCell($largo_proctor, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 2) { //proctor modificado $tcpdf->MultiCell($largo_proctor, 4, $this->emptyGuion($dato_proctor), '' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 3) { //suelo cementado $tcpdf->MultiCell($largo_proctor, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 4) { //combinado $tcpdf->MultiCell($largo_proctor, 4, $this->emptyGuion($dato_proctor), '' . $borde, 'C', 0, 0, '', '', true, 0, false, true, 4, 'M'); } $tcpdf->MultiCell($largo_humedad_optima, 4, $this->emptyGuion($dato_humedad_optima), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); if ($bho['DatosBoleta']['tipo_ensayo'] == 1) { //densidad relativa $tcpdf->MultiCell($largo_densidad_min, 4, $this->emptyGuion($dato_dmin), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_max, 4, $this->emptyGuion($dato_dmax), 'R' . $borde, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 2) { //proctor modificado $tcpdf->MultiCell($largo_densidad_min, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_max, 4, '', 'R' . $borde, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 3) { //suelo cementado $tcpdf->MultiCell($largo_densidad_min, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_max, 4, '', 'R' . $borde, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 4) { //combinado $tcpdf->MultiCell($largo_densidad_min, 4, $this->emptyGuion($dato_dmin), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_max, 4, $this->emptyGuion($dato_dmax), 'R' . $borde, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); } $contador++; } } //--- //empiezan encabezados $tcpdf->SetFont('arial', 'black', 7); $tcpdf->SetFillColor(204, 204, 204); $tcpdf->MultiCell(190, 2, '', 'B', 'C', 0, 1, '', '', true, 0, false, true, 2, 'M'); $tcpdf->MultiCell(190, 4, 'DENSIDAD IN SITU', 'B', 'C', 1, 1, '', '', true, 0, false, true, 4, 'M'); $tcpdf->MultiCell(10, 4, '', 'LT', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_capa, 4, 'Espesor', 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_medicion, 4, 'Espesor', 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_humeda, 4, 'Densidad', 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_humedad, 4, 'Humedad', 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_seca, 4, 'Densidad', 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmcs, 4, $dmcs1, 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); //DMCS=Densidad maxima compactada seca $tcpdf->MultiCell($largo_dmin + $largo_dmax, 4, $densidad1, 'T', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_relativa, 4, '', 'RT', 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(10, 4, '', 'L', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_capa, 4, 'Capa', '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_medicion, 4, 'Medición', '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_humeda, 4, 'Húmeda', '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_humedad, 4, '', '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_seca, 4, 'Seca', '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmcs, 4, '', '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmin, 4, $densidad2_1, '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmax, 4, $densidad2_2, '', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_relativa, 4, $densidad_relativa, 'R', 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell(10, 4, '', 'LB', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_capa, 4, '(m)', 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_medicion, 4, '(m)', 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_humeda, 4, '(g/cm<sup>3</sup>)', 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_humedad, 4, '(%)', 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_seca, 4, '(g/cm<sup>3</sup>)', 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmcs, 4, $dmcs2, 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmin, 4, $densidad3, 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmax, 4, $densidad3, 'B', 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_relativa, 4, '(%)', 'RB', 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); //terminan encabezados $tcpdf->SetFont('arial', '', 7); for ($i = 1; $i <= $cantidad_densidades; $i++) { if ($i == 1) { $borde = 'T'; } elseif ($i == $cantidad_densidades) { $borde = 'B'; } else { $borde = ''; } $tcpdf->MultiCell(10, 4, 'D' . $i, 'L' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_capa, 4, $this->emptyGuion(str_replace('.', ',', $bhd[$i - 1]['DensidadHasResultados'][0]['promedio'])), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_espesor_medicion, 4, $this->emptyGuion(str_replace('.', ',', $bhd[$i - 1]['DensidadHasResultados'][1]['promedio'])), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_humeda, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][2]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_humedad, 4, $this->emptyGuion(str_replace('.', ',', $bhd[$i - 1]['DensidadHasResultados'][3]['promedio'])), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_densidad_seca, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][4]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); if ($bho['DatosBoleta']['tipo_ensayo'] == 1) { //densidad relativa $tcpdf->MultiCell($largo_dmcs, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 2) { //proctor modificado $tcpdf->MultiCell($largo_dmcs, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][5]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 3) { //suelo cementado $tcpdf->MultiCell($largo_dmcs, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 4) { //combinado $tcpdf->MultiCell($largo_dmcs, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][5]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } if ($bho['DatosBoleta']['tipo_ensayo'] == 1) { //densidad relativa $tcpdf->MultiCell($largo_dmin, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][7]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmax, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][6]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 2) { //proctor modificado $tcpdf->MultiCell($largo_dmin, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmax, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 3) { //suelo cementado $tcpdf->MultiCell($largo_dmin, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmax, 4, '', '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } elseif ($bho['DatosBoleta']['tipo_ensayo'] == 4) { //combinado $tcpdf->MultiCell($largo_dmin, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][7]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); $tcpdf->MultiCell($largo_dmax, 4, $this->emptyGuion(str_replace('.', ',', $this->punto_miles($bhd[$i - 1]['DensidadHasResultados'][6]['promedio']))), '' . $borde, 'C', 0, 0, '', '', true, 0, true, true, 4, 'M'); } $tcpdf->MultiCell($largo_densidad_relativa, 4, $this->emptyGuion(round($bhd[$i - 1]['DensidadHasResultados'][8]['promedio'])), 'R' . $borde, 'C', 0, 1, '', '', true, 0, true, true, 4, 'M'); } if (!empty($bho['DatosBoleta']['observaciones'])) { $observaciones = '<br>' . nl2br($bho['DatosBoleta']['observaciones']); } else { $observaciones = ''; } //--- $tcpdf->SetFont('arial', 'black', 7); $tcpdf->MultiCell(190, 8, 'Observaciones: <br>1. El control de compactación fue realizado en el sector definido por el solicitante.' . $nota . $observaciones . '', 1, 'L', 0, 1, '', '', true, 0, true, true, 8, 'M'); //parte firmas $validador = $this->Validador->find('first', array('conditions' => array('id' => $bho['DatosBoleta']['validador']))); $firmante = $this->Firmante->find('first', array('conditions' => array('id' => $bho['DatosBoleta']['firmante']))); $firma1 = $this->ruta_imagenes . $validador['Validador']['ruta_firma']; $nombre1 = $validador['Validador']['nombre']; $cargo1 = $validador['Validador']['cargo']; $firma2 = $this->ruta_imagenes . $firmante['Firmante']['ruta_firma']; $nombre2 = $firmante['Firmante']['nombre']; $cargo2 = $firmante['Firmante']['cargo']; $tcpdf->SetFont('arial', 'black', 9); //firmante 1 // $tcpdf->writeHTMLCell(95, 10, 0, 269, $nombre1, 0, 0, false, true, 'C'); // $tcpdf->writeHTMLCell(95, 10, 0, 273, $cargo1, 0, 0, false, true, 'C'); // $tcpdf->Image($firma1, 30, 238, 30, 30, 'JPEG', '', '', false, 150, '', false, false, 0, false, false, false); //firmante 2 $tcpdf->writeHTMLCell(95, 10, 105, 269, $nombre2, 0, 0, false, true, 'C'); $tcpdf->writeHTMLCell(95, 10, 105, 273, $cargo2, 0, 0, false, true, 'C'); $tcpdf->Image($firma2, 135, 238, 30, 30, 'JPEG', '', '', false, 150, '', false, false, 0, false, false, false); $timbre_idiem = $this->ruta_imagenes . 'timbre_centro.jpeg'; $tcpdf->Image($timbre_idiem, 85, 240, 33, 33, 'JPEG', '', '', false, 150, '', false, false, 0, false, false, false); $doc_key1 = $this->randStr(); $doc_key2 = md5($doc_key1); $doc_key = $doc_key1 . $doc_key2[13]; $listo = $this->existeDocKey($doc_key); while (!$listo) { $doc_key1 = $this->randStr(); $doc_key2 = md5($doc_key1); $doc_key = $doc_key1 . $doc_key2[13]; $listo = $this->existeDocKey($doc_key); } $archivo = $doc_key . ".pdf"; $tcpdf->SetY(-8); $tcpdf->SetX(-163); $tcpdf->SetFontSize(8); $tcpdf->Cell(30, 10, 'Para verificar este documento ingrese a http://repositorio.idiem.cl - Código del documento: ' . $doc_key, 0, false, 'L', 0, '', 0, false, 'T', 'M'); if ($verificar_firma == 3 || $verificar_firma == 2) { //con el 3 se puede generar, si es 1 no se puede generar $tcpdf->Output($this->rutaFirma . date("Y") . "/" . date("m") . "/" . $archivo, "F"); chmod($this->rutaFirma . date("Y") . "/" . date("m") . "/" . $archivo, 0777); $documento_anterior = $this->Documentos->find('all', array('conditions' => array('and' => array('DOC_ARCHIVO_ORIGINAL' => 'informe_densidad=' . $boleta, 'DOC_ESTADO' => 1)))); if (!empty($documento_anterior)) { if ($verificar_firma == 2) { $sql = ' Update DOCUMENTOS Set DOC_ESTADO=3, DOC_FECHA_ANULACION=\'' . date('Y-m-d H:i:s') . '\', DOC_TEXTO_ANULACION=\'<br> Documento anulado y reemplazado por el informe nº ' . $numeroInforme . ' (http://repositorio.idiem.cl/verifica/' . $doc_key . '). \' Where (DOC_ARCHIVO_ORIGINAL=\'informe_densidad=' . $boleta . '\') and (DOC_ESTADO=1)'; } else { $sql = ' Update DOCUMENTOS Set DOC_ESTADO=2 Where (DOC_ARCHIVO_ORIGINAL=\'informe_densidad=' . $boleta . '\') and (DOC_ESTADO=1)'; } $this->Documentos->query($sql); } if ($bho['DatosBoleta']['estado'] == 0) { $estado = 'Provisorio'; } elseif ($bho['DatosBoleta']['estado'] == 1) { $estado = 'Definitivo'; } $datos_documento = array('DOC_CLI_ID' => $solicitante['DatosClientes']['DAT_CLI_ID'], 'DOC_OBR_CODIGO' => $bho['Obra']['codigo_obra'], 'DOC_ID_MODULO' => $numero_informe . '-' . $guion, 'DOC_ARCHIVO' => $archivo, 'DOC_GRU_ID' => 'idiem.hormigones_proyecto.ews', 'DOC_MODULO' => 'idiem.hormigones_tecnologia.densidad_suelo', 'DOC_KEY' => $doc_key, 'DOC_ARCHIVO_ORIGINAL' => 'informe_densidad=' . $boleta, 'DOC_FECHA' => date("Y-m-d H:i:s"), 'DOC_METADATOS' => "array('area' => '" . $bhd[0]['Area']['nombre'] . "', \n 'subarea' => '" . $bhd[0]['SubArea']['nombre'] . "', 'num_guion'=>'" . $guion . "', " . "'tipo_ensayo'=>'Densidad de suelo', 'numero_muestra'=>'" . $boleta . "','fecha_muestreo'=>'" . $this->fechaMysql($bho['DatosBoleta']['fecha_inspeccion']) . "', 'estado'=>'" . $estado . "', 'numero_control'=>'" . $bho['DatosBoleta']['numero_control'] . "', 'facility'=>'" . $bho['DatosBoleta']['facility'] . "');"); $this->Documentos->create(); $this->Documentos->save($datos_documento); $this->redirect(array('controller' => 'suelos', 'action' => 'edit_boleta/' . $boleta), null, true); } }
function existeDocKey($doc_key) { //verifica que la key no exista $link = InfoNucleo::getConexionDB('firma'); $doc_key = $link->escapeSimple($doc_key); $sql = "\n select count(*) from DOCUMENTOS\n where DOC_KEY = '" . $doc_key . "'"; $res = $link->query($sql); if (DB::isError($res)) { KERNEL::error('Ocurrio un error al buscar la llave', $sql); } $row = $res->fetchRow(); if ($row['count(*)'] != 0) { return false; } return true; }
<?php if (isset($_GET["dobuy"]) && intval($_GET["dobuy"]) && User::$ActiveUser->IsReal()) { $ItemObj = Item::GetByField("Item", "ID", intval($_GET["dobuy"])); if (isset($ItemObj) && $ItemObj->IsReal()) { if (User::$ActiveUser->GetValue("Credit") >= $ItemObj->GetValue("Cost")) { User::$ActiveUser->BuyItem($ItemObj); } } KERNEL::HardNavigate("store", "&cat=" . $ItemObj->GetValue("Category")); }
<?php global $GMDConfig; $OpenID = new LightOpenID($GMDConfig["Domain"]); if (User::$ActiveUser != false) { if (isset($_GET["logout"])) { User::Logout(); KERNEL::HardNavigate("home"); } else { // They are logged in, so just render the home screen KERNEL::LoadPage("home", false); } } else { // See if they already signed in through OpenID /* if( false && $OpenID->validate() ) { /* $ID = $OpenID->identity; $URL_Parts = explode( "/", $ID ); // Get their SteamID $CommunityID = $URL_Parts[ sizeof( $URL_Parts ) - 1]; $SteamID = CommunityToSteam( $CommunityID ); // Try and authenticate them $User = User::GetByField( "User", "SteamID", $SteamID ); if( $User->IsReal() ) $User->AuthToUser(); else User::RegisterUser( $SteamID, $_SERVER[ 'REMOTE_ADDR' ] )->AuthToUser(); KERNEL::HardNavigate( "home" );
static function NavigatePage() { if (!$_GET["page"]) { KERNEL::LoadPage(KERNEL::$DefaultPage); } else { KERNEL::LoadPage($_GET["page"]); } }