session_start(); $ruta_raiz = ".."; include $ruta_raiz . '/config.php'; // incluir configuracion. define('ADODB_ASSOC_CASE', 1); include $ADODB_PATH . '/adodb.inc.php'; // $ADODB_PATH configurada en config.php $error = 0; $dsn = $driver . "://" . $usuario . ":" . $contrasena . "@" . $servidor . "/" . $db; $conn = NewADOConnection($dsn); if ($conn) { $conn->SetFetchMode(ADODB_FETCH_ASSOC); //$conn->debug=true; include $ruta_raiz . '/include/class/tipEnvio.class.php'; $obj_tmp = new tipEnvio($conn); if (isset($_POST['btn_accion'])) { $numRad = $_POST['numRad'] ? $_POST['numRad'] : $_GET['numRad']; $tip = $_POST['tip'] ? $_POST['tip'] : $_GET['tip']; $anex_codi = $_POST['anex_codi'] ? $_POST['anex_codi'] : $_GET['anex_codi']; if (((int) $tip === 1 or !$tip) and $tip != '01') { $tip = 1; } else { if (strlen($tip) == 2) { $tip = '7' . $tip; } } switch ($_POST['btn_accion']) { case 'Modificar': if ($anex_codi) { $where = "sgd_anex_codigo='{$anex_codi}'";
include $ruta_raiz . '/config.php'; // incluir configuracion. define('ADODB_ASSOC_CASE', 1); include $ADODB_PATH . '/adodb.inc.php'; // $ADODB_PATH configurada en config.php $error = 0; $dsn = $driver . "://" . $usuario . ":" . $contrasena . "@" . $servidor . "/" . $db; $conn = NewADOConnection($dsn); !$env ? $env = 0 : ($env = $env); !$rec ? $rec = 0 : ($rec = $rec); !$pqr ? $pqr = 0 : ($pqr = $pqr); if ($conn) { $conn->SetFetchMode(ADODB_FETCH_ASSOC); //$conn->debug=true; include $ruta_raiz . '/include/class/tipEnvio.class.php'; $obj_tmp = new tipEnvio($conn); $ver = 'ate'; if (isset($_POST['btn_accion'])) { switch ($_POST['btn_accion']) { case 'Agregar': $sql = "insert into MEDIO_RECEPCION(MREC_CODI, MREC_DESC,MREC_ENV,MREC_REC,MREC_PQR,ENVIO_DIRECTO) "; $sql .= "values (" . $_POST['txtId'] . ",'" . $_POST['txtModelo'] . "',{$env},{$rec},{$pqr}," . $_POST['envDirecto'] . ")"; $conn->Execute($sql) ? $error = 3 : ($error = 2); break; case 'Modificar': $sql = "update MEDIO_RECEPCION set MREC_DESC = '" . $_POST['txtModelo'] . "',MREC_ENV = '" . $env . "',MREC_REC = '" . $rec . "',MREC_PQR = '" . $pqr . "',ENVIO_DIRECTO=" . $_POST['envDirecto'] . " "; $sql .= "where MREC_CODI = " . $_POST['txtId']; $conn->Execute($sql) ? $error = 4 : ($error = 2); break; case 'Eliminar': $sql = "SELECT COUNT(*) FROM SGD_MTR_MRECFENV WHERE MREC_CODI =" . $_POST['txtId'];