<?php include "../AccesoDatos/Controller.php"; include "../ReglasNegocio/es_retirado.php"; $retirado = new es_retirado(); $folio = $retirado->GetMayor() + 1; $boton = "verifica()"; $boton2 = "verifica2()"; ?> <script LANGUAGE="JavaScript"> function verifica() { if (document.miform.ninventario.value.length==0) { alert("Debe ingresar un Numero de Inventario"); document.miform.MInventario.focus(); return 0; } document.miform.submit(); } function verifica2() { if(document.miform.NombreRC.value.length==0){ alert("Debe seleccionar un Nombre de Funcionario que retira"); return 0; } else{ document.miform.submitRC.value="Ingresar"; document.miform.submit();
include "../ReglasNegocio/es_retirado.php"; include "../ReglasNegocio/retiros_custodia.php"; $nombre = $_POST['NombreRC']; $obs = $_POST['obs']; if ($nombre == "" || $obs == "") { $_SESSION["mensaje"] = "NO HA INGRESADO NOMBRE U OBSERVACION"; } else { $arr = $_SESSION["rcustodia"]; if (count($arr) == 0) { $_SESSION["mensaje"] = "NO HAY MATERIAL PARA INGRESAR"; } else { $retiros = new retiros_custodia(); $fecha = time(); $fechaactual = date("Y-m-d h:m:s", $fecha); $retiros->Add($nombre, $obs, $fechaactual); $listaretiro = $retiros->Select($nombre, $obs, $fechaactual); $rowretiros = mysql_fetch_array($listaretiro); $id_retiro = $rowretiros["ID_RETIRO_CUSTODIA"]; $material = new material(); $asociado = new asociado(); $folio = $_SESSION["folio_rcustodia"]; $es_retirado = new es_retirado(); for ($i = 0; $i < count($arr); $i++) { $asociado->Update($arr[$i][0]); $material->Update2($arr[$i][0]); $es_retirado->Add($arr[$i][0], $id_retiro, $folio, $fechaactual); } } } header("Location: paso.php?c=6"); }