function verRecs($id = "") { global $pdo; try { $sql = 'SELECT recsilumtbl.id, deptostbl.departamento, deptostbl.area, deptostbl.descriproceso FROM recsilumtbl INNER JOIN ordenestbl ON ordenidfk=ordenestbl.id INNER JOIN deptorecilumtbl ON recsilumtbl.id=deptorecilumtbl.deptoidfk INNER JOIN deptostbl ON deptorecilumtbl.deptoidfk=deptostbl.id WHERE recsilumtbl.ordenidfk = :id'; $s = $pdo->prepare($sql); $s->bindValue(':id', $id); $s->execute(); } catch (PDOException $e) { $mensaje = 'Hubo un error extrayendo la lista de reconocimientos iniciales.'; include $_SERVER['DOCUMENT_ROOT'] . '/reportes/includes/error.html.php'; exit; } foreach ($s as $linea) { $recsini[] = array('id' => $linea['id'], 'departamento' => $linea['departamento'], 'area' => $linea['area'], 'descriproceso' => $linea['descriproceso']); } $idot = $id; $ot = otdeordenes($id); include 'formarci.html.php'; exit; }
include $_SERVER['DOCUMENT_ROOT'] . '/reportes/includes/error.html.php'; exit; } verPuntos($_POST['idrci']); } /**************************************************************************************************/ /* Acción por defualt, llevar a búsqueda de puntos */ /**************************************************************************************************/ include $_SERVER['DOCUMENT_ROOT'] . '/reportes/includes/conectadb.inc.php'; if (isset($_SESSION['idot']) and isset($_SESSION['idrci']) and isset($_SESSION['quien']) and $_SESSION['quien'] == 'Iluminacion') { $idot = $_SESSION['idot']; $idrci = $_SESSION['idrci']; } else { header('Location: http://' . $_SERVER['HTTP_HOST'] . str_replace('puntos/', '', $_SERVER['REQUEST_URI'])); } $ot = otdeordenes($idot); $puntos = verpuntos($idrci); include $_SERVER['DOCUMENT_ROOT'] . '/reportes/includes/formas/formapuntos.html.php'; exit; /**************************************************************************************************/ /* Función para ver puntos de un reconocimiento inicial */ /**************************************************************************************************/ function verPuntos($id = "") { global $pdo; try { $sql = 'SELECT puntostbl.id, puntostbl.medicion, puntostbl.departamento, puntostbl.area, puntorecilumtbl.identificacion FROM puntostbl INNER JOIN puntorecilumtbl ON puntostbl.id=puntorecilumtbl.puntoidfk WHERE puntorecilumtbl.recilumidfk = :id'; $s = $pdo->prepare($sql);
function verRecs($id = "") { global $pdo; $idot = $id; $ot = otdeordenes($id); try { $sql = 'SELECT ot, fechafin FROM ordenestbl INNER JOIN estudiostbl ON ordenestbl.id = estudiostbl.ordenidfk WHERE ordenestbl.id = :id AND estudiostbl.nombre = "Iluminacion"'; $s = $pdo->prepare($sql); $s->bindValue(':id', $idot); $s->execute(); $nombreot = $s->fetch(); $sql = 'SELECT recsilumtbl.id, deptostbl.departamento, deptostbl.area, deptostbl.descriproceso FROM recsilumtbl INNER JOIN ordenestbl ON ordenidfk=ordenestbl.id INNER JOIN deptorecilumtbl ON recsilumtbl.id=deptorecilumtbl.deptoidfk INNER JOIN deptostbl ON deptorecilumtbl.deptoidfk=deptostbl.id WHERE recsilumtbl.ordenidfk = :id'; $s = $pdo->prepare($sql); $s->bindValue(':id', $id); $s->execute(); $sql = 'SELECT id, observacion, fecha, supervisor FROM observacionestbl WHERE ordenesidfk = :id AND estudio = "Iluminacion" ORDER BY id DESC'; $c = $pdo->prepare($sql); $c->bindValue(':id', $idot); $c->execute(); $comentarios = $c->fetchAll(); } catch (PDOException $e) { $mensaje = 'Hubo un error extrayendo la lista de reconocimientos iniciales.'; include $_SERVER['DOCUMENT_ROOT'] . '/reportes/includes/error.html.php'; exit; } foreach ($s as $linea) { $recsini[] = array('id' => $linea['id'], 'departamento' => $linea['departamento'], 'area' => $linea['area'], 'descriproceso' => $linea['descriproceso']); } include 'formarci.html.php'; exit; }