public function delete()
 {
     $obj = new anexo();
     $p = $obj->delete($_GET['id']);
     if ($p[0]) {
         header('Location: index.php?controller=anexo');
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=anexo';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
Example #2
0
//direcion usuario
$telefono_us = $tel;
//telefono usuario
$mail_us = $email;
//mail
$nextval = $db->nextId("sec_dir_direcciones");
$isql = "insert into SGD_DIR_DRECCIONES(\tSGD_TRD_CODIGO,\r\n\t\t                                                    SGD_DIR_NOMREMDES,\r\n\t\t                                                    SGD_DIR_DOC,\r\n\t\t                                                    DPTO_CODI,\r\n\t\t                                                    MUNI_CODI,\r\n\t\t                                                    id_pais,\r\n\t\t                                                    id_cont,\r\n\t\t                                                    SGD_DOC_FUN,\r\n\t\t                                                    SGD_OEM_CODIGO,\r\n\t\t                                                    SGD_CIU_CODIGO,\r\n\t\t                                                    SGD_ESP_CODI,\r\n\t\t                                                    RADI_NUME_RADI,\r\n\t\t                                                    SGD_SEC_CODIGO,\r\n\t\t                                                    SGD_DIR_DIRECCION,\r\n\t\t                                                    SGD_DIR_TELEFONO,\r\n\t\t                                                    SGD_DIR_MAIL,\r\n\t\t                                                    SGD_DIR_TIPO,\r\n\t\t                                                    SGD_DIR_CODIGO,\r\n\t\t                                                    SGD_DIR_NOMBRE)\r\n\t\t                                            values('{$sgdTrd}',\r\n\t\t                                                    '{$grbNombresUs2}',\r\n\t\t                                                    '{$cc_documento_us2}',\r\n\t\t                                                    {$dpto_tmp2},\r\n\t\t                                                    {$muni_tmp2},\r\n\t\t                                                    {$idpais2},\r\n\t\t                                                    {$idcont2},\r\n\t\t                                                    {$sgd_fun_codigo},\r\n\t\t                                                    {$sgd_oem_codigo},\r\n\t\t                                                    {$sgd_ciu_codigo},\r\n\t\t                                                    {$sgd_esp_codigo},\r\n\t\t                                                    {$nurad},\r\n\t\t                                                    0,\r\n\t\t                                                    '{$direccion_us}',\r\n\t\t                                                    '{$telefono_us}',\r\n\t\t                                                    '{$mail_us}',\r\n\t\t                                                    1,\r\n\t\t                                                    {$nextval},\r\n\t\t                                                    '{$emp}')";
$rsg = $db->conn->Execute($isql);
if ($gestor = opendir('../bodega/tmp/')) {
    /* Esta es la forma correcta de iterar sobre el directorio. 
       Se buscan aka los archvios generados en el sistema
       @autor Se extrae de version 3.8.0 version por correlibre.org
              Modificacion 11/2010 DNP
       */
    include "../class_control/anexo.php";
    $anexo = new anexo($db);
    $anexo->anex_radi_nume = $nurad;
    //$db->conn->debug = true;
    while (false !== ($archivo = readdir($gestor))) {
        $archivoFile = explode("_", $archivo, 2);
        if ($archivoFile[0] == $identificadorArchivos) {
            $anexo->anex_nomb_archivo = "{$archivo}";
            $anexo->anex_solo_lect = "'S'";
            $anexo->anex_creador = "'" . $usuarioqueradica . "'";
            $anexo->anex_desc = $archivoFile[1];
            $nuevoArchivo = "{$nurad}";
            $anexo->anex_depe_creador = $coddepe;
            $anexo->usuaDoc = $radUsuaDoc;
            $anexo->anexarFilaRadicado();
            if (!copy("../bodega/tmp/" . $archivo, "../bodega" . $anexo->anexoRutaArchivo)) {
                //echo "Error al copiar $archivo...\n";