示例#1
0
 }
 if (!isset($get->actualizar)) {
     $get->actualizar = false;
 }
 if (!isset($get->buscar)) {
     $get->buscar = false;
 }
 if ($get->registrar) {
     $get->fecha = base64_decode($get->fecha);
     $get->tipo = base64_decode($get->tipo);
     $get->item = base64_decode($get->item);
     $get->cantidad = base64_decode($get->cantidad);
     $get->valorunit = base64_decode($get->valorunit);
     if ($get->fecha != "" && $get->tipo != "" && $get->item != "" && $get->cantidad != "" && $get->valorunit != "") {
         $conexion = new Conexion();
         $operation = Inventario::registrar($get->fecha, $get->item, $get->tipo, $get->cantidad, $get->valorunit, $conexion);
         if ($operation['ejecution'] && $operation['result']) {
             $inventario = new Inventario($operation['returning']['id'], $conexion);
             $operation['message'] = "Se registró correctamente la información.";
             $log = Log::registro($usuario->getID(), "info", "Registro de Iventario. {" . $get->fecha . ", " . $get->item . ", " . $get->tipo . ", " . $get->cantidad . ", " . $get->valorunit . "}", $conexion);
         }
         $_SESSION['inventario'] = serialize($inventario);
     } else {
         $operation['ejecution'] = true;
         $operation['result'] = false;
         $operation['message'] = "Por favor diligencie todos los campos del formulario.";
     }
     echo json_encode($operation);
 }
 if ($get->loadData) {
     if (isset($_SESSION['inventario'])) {