示例#1
0
 //$db->conn->debug=true;
 !$expNum ? $expNum = $_GET['expNUM'] ? $_GET['expNUM'] : $_POST['expNUM'] : 0;
 if ($expNum && substr(base64_decode($expNum), -1) === '%') {
     $expNum = substr(base64_decode($expNum), 0, strlen(base64_decode($expNum)) - 1);
     include "{$ruta_raiz}/include/tx/Expediente.php";
     include "{$ruta_raiz}/include/combos.php";
     include "{$ruta_raiz}/include/tx/Historico.php";
     $cmb = new combo();
     $expediente = new Expediente($db);
     $objHist = new Historico($db);
     if (isset($_POST['btn_accion'])) {
         //$db->conn->debug=true;
         switch ($_POST['btn_accion']) {
             case 'Crear':
                 $idCarpeta = $db->conn->GenID('SEC_IDCARPETA');
                 $cscCarpeta = $expediente->getSecCarpeta($expNum) + 1;
                 $_POST['txtNFolios'] ? $nfolios = $_POST['txtNFolios'] : ($nfolios = 'null');
                 $sql = "insert into sgd_carpeta_expediente(sgd_carpeta_id, sgd_carpeta_csc, sgd_carpeta_descripcion, sgd_carpeta_numero,  sgd_exp_numero , sgd_carpeta_nfolios)";
                 $sql .= "values ({$idCarpeta},{$cscCarpeta},'" . $_POST['txtDescip'] . "'," . $_POST['txtNCarpeta'] . ", '{$expNum}', {$nfolios})";
                 $db->conn->Execute($sql) ? $error = 1 : ($error = 2);
                 if ($error == 1) {
                     $radicados[] = "NULL";
                     $objHist->insertarHistoricoExp($expNum, $radicados, $_SESSION['dependencia'], $_SESSION['codusuario'], "Se agrega Carpeta No." . $_POST['txtNCarpeta'], 61, '0');
                 }
                 break;
             case 'Modificar':
                 $_POST['txtNFolios'] ? $setNfolios = ", sgd_carpeta_nfolios=" . $_POST['txtNFolios'] : ($setNfolios = '');
                 $sqlUp = "update sgd_carpeta_expediente set sgd_carpeta_descripcion='" . $_POST['txtDescip'] . "', sgd_carpeta_numero=" . $_POST['txtNCarpeta'] . " {$setNfolios} ";
                 $sqlUp .= "where sgd_carpeta_id={$selCarpetas} and sgd_exp_numero='{$expNum}' ";
                 $db->conn->Execute($sqlUp) ? $error = 4 : ($error = 5);
                 if ($error == 4) {