/* Si el radicado esta incluido en el expediente digitado por el usuario. * != No identico no se puede poner !== por que la funcion array_search * tambien arroja 0 o "" vacio al ver que un expediente no se encuentra */ foreach ($arrExpedientes as $line_num => $line) { if ($line === $_POST['numeroExpediente']) { print '<center><hr><font color="red">El radicado ya está incluido en el expediente.</font><hr></center>'; } else { $resultadoExp = $expediente->insertar_expediente($_POST['numeroExpediente'], $_GET['nurad'], $dependencia, $codusuario, $usua_doc); if ($resultadoExp == 1) { $observa = "Incluir radicado en Expediente"; include_once "{$ruta_raiz}/include/tx/Historico.php"; $radicados[] = $_GET['nurad']; $tipoTx = 53; $Historico = new Historico($db); $Historico->insertarHistoricoExp($_POST['numeroExpediente'], $radicados, $dependencia, $codusuario, $observa, $tipoTx, 0); ?> <script language="JavaScript"> opener.regresar(); window.close(); </script> <?php } else { print '<hr><font color=red>No se anexo este radicado al expediente. Verifique que el numero del expediente exista e intente de nuevo.</font><hr>'; } } } } ?> <html> <head>
include_once "{$ruta_raiz}/include/tx/Historico.php"; include "{$ruta_raiz}/include/db/ConnectionHandler.php"; $db = new ConnectionHandler("{$ruta_raiz}"); if ($db) { //$db->conn->debug=true; if (isset($exps)) { $objHistorico = new Historico($db); $expsIn = str_ireplace(",", "','", $exps); $sqlUp = "update sgd_sexp_secexpedientes set sgd_sexp_faseexp=1, sgd_fech_soltransferencia=" . $db->conn->OffsetDate(0, $db->conn->sysTimeStamp) . "\n where sgd_exp_numero in ('{$expsIn}') "; $rsUp = $db->conn->Execute($sqlUp); if ($rsUp) { $sqlSel = "select sgd_exp_numero from sgd_sexp_secexpedientes where sgd_exp_numero in ('{$expsIn}') "; $expsVec = $db->conn->GetArray($sqlSel); $radicados[] = "NULL"; foreach ($expsVec as $i => $valExp) { $objHistorico->insertarHistoricoExp($valExp[0], $radicados, $_SESSION['dependencia'], $_SESSION['codusuario'], "Solicitud de Transferencia Archivo Central. " . $_POST['txtNCarpeta'], 67, '0'); } } $table = "<table class='borde_tab'>\n <tr>\n <td class='titulos5'><font size=3 color=red>\n Se realizó la solicitud.\n </td>\n </tr>\n </table>"; } } ?> <html> <head> <title>Solicitar Transferencias de Expedientes</title> <link rel="stylesheet" href="../estilos/orfeo.css"> <center> <body bgcolor="#FFFFFF"> <script> function cerrar() {
function modificarExpediente($numExpediente, $usuaDocExp, $fechaExp = null, $txtNombre = null, $txt_asuExp = null, $nivelExp = 0, $fechaCerrar = null, $cerrado = 0, $fase = 0) { //$this->db->conn->debug=true; $sql = "select sgd_sexp_cerrado from sgd_sexp_secexpedientes where sgd_exp_numero='{$numExpediente}'"; $rs = $this->db->conn->Execute($sql); $band = false; if ($cerrado != $rs->fields['SGD_SEXP_CERRADO']) { $band = true; } $query = "UPDATE SGD_SEXP_SECEXPEDIENTES SET\n SGD_SEXP_FECH=" . $this->db->conn->DBDate($fechaExp) . ",\n USUA_DOC_RESPONSABLE='{$usuaDocExp}',\n SGD_SEXP_NOMBRE='{$txtNombre}',\n SGD_SEXP_ASUNTO='{$txt_asuExp}',\n SGD_SEXP_NIVELSEG={$nivelExp},\n\t\t\t\t\t\t\tSGD_SEXP_FECHACIERRE=" . $this->db->conn->DBDate($fechaCerrar) . ",\n \tSGD_SEXP_CERRADO={$cerrado},\n\t\t\t\t\t\t\tSGD_SEXP_FASEEXP={$fase}\n WHERE SGD_EXP_NUMERO='{$numExpediente}'"; if ($this->db->conn->Execute($query)) { $Historico = new Historico($this->db); $codiRegE[0] = "null"; $radiModi = $Historico->insertarHistoricoExp($numExpediente, $codiRegE, $_SESSION['dependencia'], $_SESSION['codusuario'], "Se modificaron datos del Expediente", 64, 0); $sql = "select sgd_sexp_cerrado from sgd_sexp_secexpedientes where sgd_exp_numero='{$numExpediente}'"; $rs = $this->db->conn->Execute($sql); if ($band) { if ($cerrado == 0) { $observa = "Se abre Expediente"; } if ($cerrado == 1) { $observa = "Se cierra Expediente con fecha: {$fechaCerrar}"; } $Historico->insertarHistoricoExp($numExpediente, $codiRegE, $_SESSION['dependencia'], $_SESSION['codusuario'], $observa, 67, 0); } return $numExpediente; } else { echo "No se ha podido modificar el Expediente"; return 0; } }
if (is_array($_POST['checkValue'])) { include_once "{$ruta_raiz}/include/tx/Historico.php"; $objHistorico = new Historico($db); foreach ($_POST['checkValue'] as $l => $value) { $dep = substr($value, strpos($value, ',') + 1); $fechaSolicitud = substr($value, 0, strpos($value, ',')); $sqlSel = "select distinct sgd_exp_numero from sgd_sexp_secexpedientes where sgd_fech_soltransferencia='{$fechaSolicitud}' and depe_codi={$dep}"; $expsVec = $db->conn->GetArray($sqlSel); if ($expsVec) { $sqlUp = "update sgd_sexp_secexpedientes set sgd_sexp_faseexp=0, sgd_fech_soltransferencia=null\n\t\t\t\t\t\t\t \t\twhere sgd_fech_soltransferencia='{$fechaSolicitud}' and depe_codi={$dep} "; //$db->conn->debug=true; $rsUp = $db->conn->Execute($sqlUp); if ($rsUp) { $radicados[0] = "NULL"; foreach ($expsVec as $i => $valExp) { $objHistorico->insertarHistoricoExp($valExp["SGD_EXP_NUMERO"], $radicados, $_SESSION['dependencia'], $_SESSION['codusuario'], "Cancelación de Solicitud de Transferencia Archivo Central. " . $_POST['txtNCarpeta'], 67, '0'); } } } empty($expsVec); } } break; case '': break; } } $sql = "SELECT d.dep_sigla " . $db->conn->concat_operator . "'-'" . $db->conn->concat_operator . " d.DEPE_NOMB, d.DEPE_CODI FROM DEPENDENCIA d where d.depe_estado=1 {$whereSecc} ORDER BY 1"; $rs = $db->conn->execute($sql); $selDep = $rs->GetMenu2('dependenciaSel', $dependenciaSel, $blank1stItem, false, 0, " id='dependenciaSel' class=select onChange='combos(this)'"); }
$campos["P_RAD_E"] = $noRad; $campos["P_USUA_CODI"] = $codusuario; $campos["P_DEPENDENCIA"] = $dependencia; $campos["P_USUA_DOC"] = $usua_doc; $campos["P_COD_REF"] = $anexo; //El nuevo radicado hereda la informacion del expediente del radicado padre if (isset($expRadi) && $expRadi != 0) { $resultadoExp = $objExpediente->insertar_expediente($expRadi, $noRad, $dependencia, $codusuario, $usua_doc); $radicados = ""; if ($resultadoExp == 1) { $observa = "Se ingresa al expediente del radicado padre ({$numrad})"; include_once "{$ruta_raiz}/include/tx/Historico.php"; $radicados[] = $noRad; $tipoTx = 53; $Historico = new Historico($db); $Historico->insertarHistoricoExp($expRadi, $radicados, $dependencia, $codusuario, $observa, $tipoTx, 0, 0); } else { die('<hr><font color=red>No se anexo este radicado al expediente. Verifique que el numero del expediente exista e intente de nuevo.</font><hr>'); } } $estQueryAdd = $objCtrlAplInt->queryAdds($noRad, $campos, $MODULO_RADICACION_DOCS_ANEXOS); if ($estQueryAdd == "0") { $db->conn->RollbackTrans(); die("fallo en la consulta de aplintegra"); } $radicadosSel[0] = $noRad; $hist->insertarHistorico($radicadosSel, $dependencia, $codusuario, $dependencia, $codusuario, " ", $codTx); echo "<br/>"; echo "<br/>"; echo "<br/>"; //echo "inserto el historico tal rads=".var_dump($radicadosSel)."--dep=".$dependencia."--cod=".$codusuario."--dep2".$dependencia."---coduser".$codusuario."--codtx".$codTx;
$query = "UPDATE SGD_EXP_EXPEDIENTE SET SGD_EXP_PRIVADO={$nivelExp} where SGD_EXP_NUMERO='{$num_expediente}'"; $query2 = "UPDATE SGD_SEXP_SECEXPEDIENTES SET SGD_EXP_PRIVADO={$nivelExp} where SGD_EXP_NUMERO='{$num_expediente}'"; if ($nivelExp == 1) { $observa = "Expediente Confidencial solo Jefe y Responsable"; } elseif ($nivelExp == 0) { $observa = "Expediente Publico."; } elseif ($nivelExp == 2) { $observa = "Expediente Confidencial dependencia. (Y Usuarios Acutales Radicados)"; } elseif ($nivelExp == 3) { $observa = "Expediente Confidencial Usuario Responsable y Jefe. (No usuarios actules de Radicados)"; } //$db->conn->debug = true; if ($db->conn->Execute($query) && $db->conn->Execute($query2)) { echo "<span class=leidos>El nivel se actualizó correctamente. "; include_once "{$ruta_raiz}/include/tx/Historico.php"; $codiRegH = ""; $Historico = new Historico($db); //$radiModi = $Historico->insertarHistorico($codiRegE, $coddepe, $codusua, $coddepe, $codusua, $observa, 33); $codiRegR[0] = $numrad; $radiModi = $Historico->insertarHistoricoExp($num_expediente, $codiRegR, $dependencia, $codusuario, $observa, 60, 0); } else { echo "<span class=titulosError> !No se pudo actualizar el nivel para el expediente !"; } } echo $mensaje_err; ?> </p> </span> </body> </html>
$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) { $radicados[] = "NULL"; $objHist->insertarHistoricoExp($expNum, $radicados, $_SESSION['dependencia'], $_SESSION['codusuario'], "Se modifica Carpeta No. " . $_POST['txtNCarpeta'], 62, '0'); } break; case 'Eliminar': $sqlVerfi = "select sgd_carpeta_id from sgd_exp_radcarpeta where sgd_carpeta_id={$selCarpetas}"; $rs = $db->conn->Execute($sqlVerfi);
if ($arrDatosArchivado['estado'] == 0) { $mensaje = "Va a excluir éste documento del(os) Expediente(s) seleccionado(s). <br> Está seguro?"; } } } // Excluye el radicado del expediente if (isset($_POST['confirmaIncluirExp']) && $_POST['confirmaIncluirExp'] == "EXCLUIR_EXP") { foreach ($arrExpSeleccionados as $clave => $numExpediente) { $resultadoExp = $expediente->excluirExpediente($_GET['nurad'], $numExpediente); if ($resultadoExp == 1) { $observa = "Excluir radicado de Expediente"; include_once "{$ruta_raiz}/include/tx/Historico.php"; $radicados[0] = $_GET['nurad']; $tipoTx = 52; $Historico = new Historico($db); $Historico->insertarHistoricoExp($numExpediente, $radicados, $dependencia, $codusuario, $observa, $tipoTx, 0); } else { print '<hr><font color=red>No se excluyó este radicado del expediente No. ' . $numExpediente . '. Por favor intente de nuevo.</font><hr>'; break; } } ?> <script language="JavaScript"> opener.regresar(); window.close(); </script> <?php } } /** CONSULTA SI EL EXPEDIENTE TIENE UNA CLASIFICACION TRD */
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/tx/Historico.php"; $expediente = new Expediente($db); $objHist = new Historico($db); if (isset($_POST['btn_accion'])) { //$db->conn->debug=true; switch ($_POST['btn_accion']) { case 'Grabar': $sqlUp = "update sgd_sexp_secexpedientes set sgd_sexp_nombre='" . $_POST['txtNombreExp'] . "' "; $sqlUp .= "where sgd_exp_numero='{$expNum}'"; $db->conn->Execute($sqlUp) ? $error = 4 : ($error = 5); if ($error == 4) { $radicados[] = "NULL"; $objHist->insertarHistoricoExp($expNum, $radicados, $_SESSION['dependencia'], $_SESSION['codusuario'], "Se modifica nombre del Expediente ", 64, '0'); } break; } $selCarpetas = 0; } $expediente->getExpediente($expNum); $nombreExp = $expediente->nombreExp; } } if ($error) { $msg = '<tr bordercolor="#FFFFFF"> <td width="3%" align="center" class="titulosError" colspan="3" bgcolor="#FFFFFF">'; switch ($error) { case 4: //
<form name=cambiar action="lista_expediente.php?<?php echo $encabezado; ?> " method='get'> <?php $dat = date("Y-m-d"); $sqle = "update SGD_EXP_EXPEDIENTE set SGD_EXP_ARCHIVO='{$est}',SGD_EXP_FECHFIN='{$dat}' where SGD_EXP_NUMERO LIKE '{$expediente}'"; $rs = $db->query($sqle); $arrayRad[0] = $numRad; $isqlDepR = "SELECT USUA_CODI\n\t\t\tFROM usuario\n\t\t\tWHERE USUA_LOGIN = '******'"; $rsDepR = $db->conn->Execute($isqlDepR); $codusua = $rsDepR->fields['USUA_CODI']; if ($est == 2) { $observa = "Se Cerro el Expediente "; $objHistorico->insertarHistoricoExp($expediente, $arrayRad, $dependencia, $codusua, $observa, 58, 1); ?> <center>El Expediente fue Cerrado <?php } if ($est == 1) { $observa = "Se Reabrio el Expediente "; $objHistorico->insertarHistoricoExp($expediente, $arrayRad, $dependencia, $codusua, $observa, 59, 1); ?> <center>El Expediente fue Reabierto <?php } ?> <input type="button" value="Cerrar" class="botones_3" onclick="opener.regresar();window.close()">
$ADODB_COUNTRECS = false; if (!$numExpActual) { $numExpActual = $rs_exp->fields['VALOR']; } $selExpIncluidos = $rs_exp->GetMenu('expIncluido[]', $numExpActual, false, true, 3, "id='expIncluido[]' class='select' onChange='cambiaExp()'", false); if (isset($_POST['btnMoverCarp'])) { if (isset($_POST['checkRads']) && $numExpActual) { $Historico = new Historico($db); foreach ($_POST['checkRads'] as $rads => $valu) { //$db->conn->debug=true; if ($_POST['selCarpetas'] == 0) { $sqlDel = "delete from sgd_exp_radcarpeta where sgd_carpeta_id in (select sgd_carpeta_id from sgd_carpeta_expediente where sgd_exp_numero='{$numExpActual}') and radi_nume_radi={$rads}"; $rsDel = $db->conn->Execute($sqlDel); if ($rsDel) { $codiRegE[0] = $rads; $radiModi = $Historico->insertarHistoricoExp($numExpActual, $codiRegE, $_SESSION['dependencia'], $_SESSION['codusuario'], "Radicado sin carpeta", 66, 0); } } else { $sqlDel = "delete from sgd_exp_radcarpeta where sgd_carpeta_id in (select sgd_carpeta_id from sgd_carpeta_expediente where sgd_exp_numero='{$numExpActual}') and radi_nume_radi={$rads}"; $rsDel = $db->conn->Execute($sqlDel); $sqlIns = "insert into sgd_exp_radcarpeta(radi_nume_radi,sgd_carpeta_id) values({$rads}," . $_POST['selCarpetas'] . ")"; $rsIns = $db->conn->Execute($sqlIns); if ($rsIns) { $sql = "select * from sgd_carpeta_expediente where sgd_carpeta_id=" . $_POST['selCarpetas']; $rs = $db->conn->Execute($sql); $codiRegE[0] = $rads; $radiModi = $Historico->insertarHistoricoExp($numExpActual, $codiRegE, $_SESSION['dependencia'], $_SESSION['codusuario'], "Se incluye Radicado en la carpeta No [" . $rs->fields['SGD_CARPETA_NUMERO'] . "] " . $rs->fields['SGD_CARPETA_DESCRIPCION'], 66, 0); } } } }
switch ($_POST['btn_accion']) { case 'Transferir': if (isset($_POST['checkValue']) && is_array($_POST['checkValue'])) { $selCarpetas = implode(',', $_POST['checkValue']); $where = " and sgd_carpeta_id in ({$selCarpetas})"; $sqlUp = "update sgd_carpeta_expediente set SGD_CARPETA_NUMERO='" . $_POST['txtNCarp'] . "'"; $sqlUp .= "where sgd_exp_numero='{$expNum}' {$where}"; //$db->conn->debug=true; $db->conn->StartTrans(); $db->conn->Execute($sqlUp) ? $error = 4 : ($error = 5); if ($error == 4) { $sqlSel = "select SGD_CARPETA_CSC from sgd_carpeta_expediente where sgd_exp_numero='{$expNum}' {$where}"; $carpsVec = $db->conn->GetArray($sqlSel); $radicados[] = "NULL"; foreach ($carpsVec as $i => $valCar) { $objHist->insertarHistoricoExp($expNum, $radicados, $_SESSION['dependencia'], $_SESSION['codusuario'], "Cambio de Carpeta en Archivo Central para la carpeta No. " . $valCar['SGD_CARPETA_CSC'], 62, '0'); } $sqlUp = "update sgd_sexp_secexpedientes set sgd_sexp_faseexp=2"; $sqlUp .= "where sgd_exp_numero='{$expNum}'"; if ($db->conn->Execute($sqlUp)) { $db->conn->CompleteTrans(); } else { $db->conn->RollbackTrans(); } } } break; } $selCarpetas = 0; } $expediente->getExpediente($expNum);
<tr><TD colspan='2'> <CENTER><input name='Grabar' type=submit class="botones_funcion" value="Grabar" > <?php } ?> <input name="Cerrar" type="button" class="botones_funcion" id="envia22" onClick="opener.regresar();window.close();" value=" Cerrar " > </TD></tr> </table> <?php if ($Grabar) { if ($usuaDocExp != 0) { $isqlDepR = "SELECT USUA_CODI \r\n\t\t\tFROM usuario \r\n\t\t\tWHERE USUA_LOGIN = '******'"; $rsDepR = $db->conn->Execute($isqlDepR); $codusua = $rsDepR->fields['USUA_CODI']; $objHistorico->insertarHistoricoExp($numeroExpediente, $arrayRad, $dependencia, $codusua, $observa, 56, 1); //$objHistorico->insertarHistoricoExp($numeroExpediente,$arrayRad,$coddepe ,$codusua, $observa, 56,0); //print $numeroExpediente.$arrayRad.$coddepe.$codusua.$observa; echo "<CENTER><table><tr><td class=titulosError>EL RESPONSABLE HA SIDO MODIFICADO.</td></tr></table>"; } else { echo "<CENTER><table><tr><td class=titulosError>NO HA SELECCIONADO NINGUN RESPONSABLE.</td></tr></table>"; } } ?> </form> </CENTER> </html>
$Oexpediente = new Expediente($db); // Consulta si el radicado está incluido en el expediente. $arrExpedientes = $Oexpediente->expedientesRadicado($verrad); // Si el radicado está incluido en el expediente digitado por el usuario. // !== No idéntico if (array_search($expediente, $arrExpedientes) !== false) { print '<hr><font color="red">El radicado ya está incluido en el expediente.</font><hr>'; } else { $resultadoExp = $Oexpediente->insertar_expediente($expediente, $verrad, $dependencia, $codusuario, $usua_doc); if ($resultadoExp == 1) { $observa = "Incluir radicado en Expediente"; // include_once "$ruta_raiz/include/tx/Historico.php"; $radicados[] = $verrad; $tipoTx = 53; $Historico = new Historico($db); $Historico->insertarHistoricoExp($expediente, $radicados, $dependencia, $codusuario, "EXPEDIENTE AUTOMATICO", $tipoTx, 0); include "{$ruta_raiz}/include/tx/Tx.php"; $rs = new Tx($db); $nombTx = "Archivo de Documentos"; $radicadosSel[] = $verrad; $txSql = $rs->archivar($radicadosSel, $krd, $dependencia, $codusuario, "ARCHIVO AUTOMATICO"); ?> <?php } else { print '<hr><font color=red>No se anexo este radicado al expediente. Verifique que el numero del expediente exista e intente de nuevo.</font><hr>'; } } } //$db->conn->debug=true; $db->conn->CommitTrans(); ?>