public function subir($contrato_id)
 {
     $this->contrato = $contrato_id;
     if (Input::hasPost('oculto')) {
         //para saber si se envió el form
         $_FILES['archivo']['name'] = date("Y_m_d_H_i_s_") . $_FILES['archivo']['name'];
         $archivo = Upload::factory('archivo');
         //llamamos a la libreria y le pasamos el nombre del campo file del formulario
         $archivo->setExtensions(array('pdf'));
         //le asignamos las extensiones a permitir
         $url = '/files/upload/';
         $archivo->setPath(getcwd() . $url);
         if ($archivo->isUploaded()) {
             if ($archivo->save()) {
                 Flash::valid('Archivo subido correctamente!!!');
                 $nuevo_documento = new Documentos(Input::post("documentos"));
                 // $nuevo_documento->contratos_id = $contrato_id;
                 // $nuevo_documento->subido_por = Auth::get("id");
                 // $nuevo_documento->tipo_documento = ;
                 $nuevo_documento->url = $url . $_FILES['archivo']['name'];
                 if ($nuevo_documento->save()) {
                     Flash::valid("Documento Guardado");
                 } else {
                     Flash::error("No se pudo guardar el documento");
                 }
             }
         } else {
             Flash::warning('No se ha Podido Subir el Archivo...!!!');
         }
     }
 }
    public function new_()
    {
        if (Input::hasPost('oculto')) {
            //para saber si se envió el form
            $_FILES['archivo']['name'] = date("Y_m_d_H_i_s_") . $_FILES['archivo']['name'];
            $archivo = Upload::factory('archivo');
            //llamamos a la libreria y le pasamos el nombre del campo file del formulario
            $archivo->setExtensions(array('pdf'));
            //le asignamos las extensiones a permitir
            $url = '/files/upload/';
            $archivo->setPath(getcwd() . $url);
            if ($archivo->isUploaded()) {
                if ($archivo->save()) {
                    Flash::valid('Archivo subido correctamente!!!');
                    $nuevo_contrato = new Contratos(Input::post("contratos"));
                    if ($nuevo_contrato->save()) {
                        Flash::valid("Contrato guardado");
                        $nuevo_documento = new Documentos();
                        $nuevo_documento->contratos_id = Load::model("contratos")->last_id();
                        $nuevo_documento->subido_por = Auth::get("id");
                        $nuevo_documento->tipo_documento = 1;
                        $nuevo_documento->url = $url . $_FILES['archivo']['name'];
                        $email_empresa = Load::model("usuarios")->find($nuevo_documento->pertenece_a);
                        if ($nuevo_documento->save()) {
                            ?>
           				 	<script type="text/javascript">
           				 		alert("Aqui se envia un email a la empresa con email:"+ <?php 
                            echo $email_empresa->email;
                            ?>
);
           				 	</script>
           				 	<?php 
                            Flash::valid("Documento Guardado");
                        } else {
                            Flash::error("No se pudo guardar el documento");
                        }
                    } else {
                        Flash::error("No se pudo guardar el contrato");
                    }
                }
            } else {
                Flash::warning('No se ha Podido Subir el Archivo...!!!');
            }
        }
    }
Example #3
0
 public function __construct()
 {
     parent::__construct($id = 'peticion', Null);
     $this->modelopadre = 'Peticion';
     $this->modeloshijos = array('Dpeticion' => 'Tempdpeticion');
     $this->documentohijo = '430';
     $this->documento = Documentos::model()->findByPk($this->documentohijo)->coddocupadre;
     $this->campoestado = 'codestado';
     $this->estados = array('save' => array(), 'print' => array(), 'out' => array(), 'ok' => array(), 'mail' => array(), 'print' => array());
     $this->ConfigArreglos();
 }
Example #4
0
 function selectAllDocumentos()
 {
     $sql = "select * from documento ";
     $lista = array();
     $result = $this->retrieve($sql);
     while ($qr = mysqli_fetch_array($result)) {
         $documentos = new Documentos();
         $documentos->setDoc_id($qr['doc_id']);
         $documentos->setDoc_assunto($qr['doc_assunto']);
         $documentos->setDoc_descricao($qr['doc_descricao']);
         $documentos->setDoc_arquivo($qr['doc_arquivo']);
         array_push($lista, $documentos);
     }
     return $lista;
 }
 static function init()
 {
     $prefix = '_pan_';
     // A lista de sites
     $sites = wp_get_sites();
     if ($sites) {
         $sites_dropdown = array();
         foreach ($sites as $site) {
             if ($site['blog_id'] == 1) {
                 continue;
             }
             $sites_dropdown[] = array('label' => get_blog_details($site['blog_id'])->blogname, 'value' => $site['blog_id']);
         }
     }
     self::$custom_meta_fields = array(array('label' => __('Publication Source', 'panamazonica'), 'description' => '', 'id' => $prefix . 'fonte', 'type' => 'text', 'description' => ''), array('label' => __('Year', 'panamazonica'), 'description' => '', 'id' => $prefix . 'ano', 'type' => 'text', 'description' => ''), array('label' => __('Place', 'panamazonica'), 'description' => '', 'id' => $prefix . 'local', 'type' => 'text', 'description' => ''), array('label' => __('Author', 'panamazonica'), 'description' => '', 'id' => $prefix . 'autor', 'type' => 'text', 'description' => ''), array('label' => __('Collaborators', 'panamazonica'), 'description' => '', 'id' => $prefix . 'colaboradores', 'type' => 'text', 'description' => ''), array('label' => __('Language', 'panamazonica'), 'description' => '', 'id' => $prefix . 'idioma', 'type' => 'select', 'options' => array(array('label' => __('Portuguese', 'panamazonica'), 'value' => 'pt'), array('label' => __('Spanish', 'panamazonica'), 'value' => 'es'), array('label' => __('English', 'panamazonica'), 'value' => 'en'))), array('label' => __('Link', 'panamazonica'), 'description' => '', 'id' => $prefix . 'link', 'type' => 'upload', 'description' => 'Fill in the field with a link or upload a file.'));
     add_action('init', array(__CLASS__, 'register'));
     add_action('add_meta_boxes', array(__CLASS__, 'add_meta_box'));
     add_action('save_post', array(__CLASS__, 'save_postdata'));
     add_action('pre_get_posts', array(__CLASS__, 'pre_get_posts'));
     //add_filter('menu_order', array(__CLASS__, 'change_menu_label'));
     //add_filter('custom_menu_order', array(__CLASS__, 'custom_menu_order'));
 }
Example #6
0
 private function getPrefijo()
 {
     $prefix = "";
     if ($this->documento === null or empty($this->documento)) {
         throw new CHttpException(500, __CLASS__ . '   ' . __FUNCTION__ . '   ' . __LINE__ . ' NO ha definido la propiedad documento ');
     }
     $prefix = Documentos::Prefijo($this->documento);
     if ($prefix === null or empty($prefix)) {
         throw new CHttpException(500, __CLASS__ . '   ' . __FUNCTION__ . '   ' . __LINE__ . ' NO se encontro ningun prefijo para el documento ' . $this->documento . '  Revise la tabla documentos');
     }
     return trim($prefix);
 }
Example #7
0
<?php

require 'vendor/autoload.php';
$db = Connection::getConnection();
error_reporting(E_ALL);
if (isset($_GET['id_documento'])) {
    $id = htmlspecialchars($_GET['id_documento']);
    $id = strip_tags($id);
    $id = filter_var($id, FILTER_VALIDATE_INT);
    $documento = Documentos::where('id', '=', $id)->get();
    if (count($documento) > 0) {
        $pathToFile = __DIR__ . '/uploads/' . $documento[0]->id_maestro . '/';
        switch ($documento[0]->Clasificacion_Documento_Id) {
            case 1:
                $pathToFile .= 'documentacion/';
                break;
            case 2:
                $pathToFile .= 'alternativa_1/';
                break;
            case 3:
                $pathToFile .= 'alternativa_2/';
                break;
            default:
                # code...
                break;
        }
        $pathToFile .= $documento[0]->Documento;
        $name = $documento[0]->Documento;
        if (file_exists($pathToFile)) {
            header('Content-Descripcion: File Transfer');
            header("Content-type: application/octet-stream");
<title>STD .:. Aprobar Derivacion</title>
</head>
<body>
	<fieldset>		
		<legend>Aprobaci&oacute;n</legend>							
	    <?php 
if ($_REQUEST["opcion"] == 'addha') {
    $documento = new Documento($_REQUEST['id']);
    $atencion = $documento->AprobarDocumento($_REQUEST['comentario']);
    if ($atencion != 0) {
        //if($_REQUEST['accion']==35){ //Archivar Aprobado
        //Documentos::GuardarArchivoRespuesta($atencion);
        //Documentos::GuardarAdjuntosArchivo($atencion,$_REQUEST['categoria']);
        //}
        //else
        Documentos::GuardarAprobacion($atencion);
        echo "<p>Se propuso correctamente</p></div>";
    } else {
        echo "<div id='error'>Hubo un error al procesar su consulta</div>";
    }
    ?>
			<br/>
			<br/>
			<input name="cancelar" type="button" class="boton" id="cerrar_j" value="Cerrar" />
		<?php 
} else {
    if ($_REQUEST["id"]) {
        $accion = new Accion($_REQUEST["acc"]);
        $categoria = $_REQUEST["cat"] == 1 ? "Original" : "Copia";
        ?>
		<form id="form_justificacion" name="form_justificacion" method="post" action="javascript:validar_aprobacion(<?php 
Example #9
0
    {
        require "../models/Documento.php";
        $documento = new Documento();
        $respuesta = $documento->Duplicado($datos);
        if ($respuesta == true) {
            echo "Existe un documento creado con la misma informacion";
        } else {
            $documento->Add($datos);
            echo "Se han  Ingresado correctamente los datos";
            header("Location: ../views/MostrarProyectos.php");
        }
    }
}
//Recogiendo los datos de los casiellors de la vista
$iddocum = $_REQUEST['iddocum'];
$idproy = $_REQUEST['idproy'];
$idimagen = $_REQUEST['idimagen'];
$idinvol = $_REQUEST['idinvol'];
$codigo = $_REQUEST['codigo'];
$dia = $_REQUEST['dia'];
$mes = $_REQUEST['mes'];
$anio = $_REQUEST['anio'];
$nombres = $_REQUEST['nombres'];
$apellidos = $_REQUEST['apellidos'];
$asunto = $_REQUEST['asunto'];
$direccion = $_REQUEST['direccion'];
$cantfolios = $_REQUEST['cantfolios'];
$obs = $_REQUEST['obs'];
$datos = array("iddocum" => "{$iddocum}", "idproy" => "{$idproy}", "idimagen" => "{$idimagen}", "idinvol" => "{$idinvol}", "codigo" => "{$codigo}", "dia" => "{$dia}", "mes" => "{$mes}", "anio" => "{$anio}", "nombres" => "{$nombres}", "apellidos" => "{$apellidos}", "asunto" => "{$asunto}", "direccion" => "{$direccion}", "cantfolios" => "{$cantfolios}", "obs" => "{$obs}");
$documentos = new Documentos();
$documentos->Duplicados($datos);
Example #10
0
 public function actionConfiguraop($codocupadre)
 {
     $docu = MiFactoria::CleanInput($codocupadre);
     $registrox = $this->loadModel($docu);
     $documentopadre = $registrox->desdocu;
     $matrizpadre = Opcionescamposdocu::Model()->findAll(" codocu=:cod", array(":cod" => $docu));
     foreach ($matrizpadre as $fila) {
         $cantidadregistros = Yii::app()->db->createCommand()->select("id")->from("{{opcionesdocumentos}}")->where("idopdoc=:vidop", array(":vidop" => $fila->id))->queryScalar();
         if (!$cantidadregistros) {
             $modex = new Opcionesdocumentos();
             $modex->setAttributes(array("idusuario" => Yii::app()->user->id, "idopdoc" => $fila->id), false);
             $modex->save();
         }
     }
     $proveedor = VwOpcionesdocumentos::model()->search_us($docu, Yii::app()->user->id);
     //buacnado el codochijo
     $registro = Documentos::model()->findAll("coddocupadre=:vpadre", array(":vpadre" => $docu));
     if (!is_null($registro)) {
         $codocuhijo = $registro[0]->coddocu;
         $documentohijo = $registro[0]->desdocu;
     } else {
         $codocuhijo = null;
     }
     if (!is_null($codocuhijo)) {
         $codocuhijo = MiFactoria::CleanInput($codocuhijo);
         $matrizpadre1 = Opcionescamposdocu::Model()->findAll(" codocu=:cod", array(":cod" => $codocuhijo));
         foreach ($matrizpadre1 as $fila) {
             $cantidadregistros = Yii::app()->db->createCommand()->select("id")->from("{{opcionesdocumentos}}")->where("idopdoc=:vidop", array(":vidop" => $fila->id))->queryScalar();
             if (!$cantidadregistros) {
                 $modex = new Opcionesdocumentos();
                 $modex->setAttributes(array("idusuario" => Yii::app()->user->id, "idopdoc" => $fila->id), false);
                 $modex->save();
             }
         }
         $proveedor1 = VwOpcionesdocumentos::model()->search_us($codocuhijo, Yii::app()->user->id);
         $this->render('vw_admin_opciones', array('proveedor' => $proveedor, 'proveedor1' => $proveedor1, 'documentopadre' => $documentopadre, 'documentohijo' => $documentohijo));
     } else {
         $this->render('vw_admin_opciones', array('proveedor' => $proveedor, 'documentopadre' => $documentopadre, 'proveedor1' => null));
     }
 }
	<tr>
		<td class="menu"><?php 
Plantilla::PlantillaIzquierdo();
?>
</td>	
		<td>
			<table  class="contenido" cellpadding="0" cellspacing="0" width="100%" align="left">
				<tr>
					<td><?php 
Plantilla::menuSuperior("atencion_acceso_registro.php", $menu, $_GET['id'], false);
?>
</td>
				</tr>										
				<tr>								
					<td style="width:100%;height:417px"><?php 
$docs = new Documentos();
switch ($_REQUEST['opcion']) {
    case 'deleteha':
        $documento = new Documento($_REQUEST['id']);
        $documento->deleteHistorialBorrador($_REQUEST['idb']);
        $nuevo_doc = new Documento($_REQUEST['id']);
        $docs->detalleDocumentosPorUsuario($usuario, $nuevo_doc);
        break;
    case 'detalle':
        $documento = new Documento($_GET['id']);
        $docs->detalleDocumentosPorUsuario($usuario, $documento);
        break;
    case 'list':
        $docs->listarDocumentosPorUsuario($usuario);
        break;
    case 'aprobar':
Example #12
0
 public static function estadosnocalculablesdetalle($codocu)
 {
     ///$CODOCU es el codigo del docuenmtno padre
     /*esta funcion devuel los estado del detalle de un domcuento
      *  que no son calculables x ejemplo una item anualado o cualquier otro estado que no s etome necuenta
      *
      */
     $codocu = MiFactoria::cleanInput($codocu);
     $documentohijo = Documentos::model()->find("coddocupadre='" . $codocu . "'");
     //var_dump($documentohijo);
     if (!is_null($documentohijo)) {
         return Yii::app()->db->createCommand()->select('codestado')->from('{{estado}}')->where("codocu=:vcodocu AND nocalculable='1' ", array(":vcodocu" => $documentohijo->coddocu))->queryColumn();
     } else {
         return array();
     }
 }
Example #13
0
<h1>Tenores de Documentos</h1>
<?php 
$this->menu = array(array('label' => 'Crear Tenor', 'url' => array('create')));
?>

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'tenores-grid', 'dataProvider' => $model->search(), 'cssFile' => Yii::app()->getTheme()->baseUrl . '/css/grilla_celeste.css', 'filter' => $model, 'columns' => array(array('name' => 'activo', 'type' => 'raw', 'value' => 'CHtml::checkBox("hu",($data->activo=="1"),array("disabled"=>"disabled"))'), array('name' => 'coddocu', 'type' => 'raw', 'value' => '$data->coddocu', 'filter' => CHtml::listData(Documentos::model()->findAll(), 'coddocu', 'desdocu'), 'htmlOptions' => array('width' => 300)), 'mensaje', 'sociedad', 'posicion', array('class' => 'CButtonColumn', 'template' => '{update}'))));
Example #14
0
	  </div>
    </fieldset>
      </div>
	 
	 
	 
	  <div style="float: left; width:320px; padding:10px;">
    <fieldset>
	<LEGEND><b>Referencia</b></LEGEND>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'documento');
?>
		<?php 
$datos = CHtml::listData(Documentos::model()->findAll(" clase='D'", array('order' => 'desdocu')), 'coddocu', 'desdocu');
echo $form->DropDownList($model, 'documento', $datos, array('empty' => '--Seleccione un documento--'));
?>
		<?php 
echo $form->error($model, 'documento');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'numeroref');
?>
		<?php 
echo $form->textField($model, 'numeroref', array('size' => 25, 'maxlength' => 25));
?>
		<?php 
Example #15
0
?>
<div class="division">
<div class="wide form">

<?php 
$form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
?>

	

	<div class="row">
		<?php 
echo $form->labelEx($model, 'codocu');
?>
		<?php 
$datos = CHtml::listData(Documentos::model()->findAll(" coddocupadre in ('999','000') "), 'coddocu', 'desdocu');
echo $form->DropDownList($model, 'codocu', $datos, array('empty' => '--Seleccione un clase --'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'desarchivo');
?>
		<?php 
echo $form->textField($model, 'desarchivo', array('size' => 40, 'maxlength' => 40));
?>
	</div>

	<div class="row">
		<?php 
    if ($atencion != 0) {
        Documentos::GuardarArchivoJustificacion($atencion);
        echo "<p>Se propuso correctamente</p></div>";
    } else {
        echo "<div id='error'>Hubo un error al procesar su consulta</div>";
    }
    ?>
    <br/>
    <br/>
    <input name="cancelar" type="button" class="boton" id="cerrar_j" value="Cerrar" />
    <?php 
} elseif ($_REQUEST["opcion"] == 'addhd') {
    $documento = new Documento($_REQUEST['id']);
    $atencion = $documento->AprobarDocumento($_REQUEST['comentario']);
    if ($atencion != 0) {
        Documentos::GuardarArchivoJustificacion($atencion);
        echo "<p>Se aprobo correctamente</p></div>";
    } else {
        echo "<div id='error'>Hubo un error al procesar su consulta</div>";
    }
    ?>
    <br/>
    <br/>
    <input name="cancelar" type="button" class="boton" id="cerrar_j" value="Cerrar" />
    <?php 
} else {
    $accion = new Accion($_REQUEST["acc"]);
    $categoria = $_REQUEST["cat"] == 1 ? "Original" : "Copia";
    if ($_REQUEST["id"]) {
        ?>
		
Example #17
0


	<div class="row">
		<?php 
echo $form->labelEx($model, 'coddocupadre');
?>
		<?php 
//$documento='032';
$criterial = new CDbCriteria();
$criterial->condition = 'coddocu <>:docu';
$criterial->params = $model->isNewRecord ? array(':docu' => 'x') : array(':docu' => "'" . $model->coddocu . "'");
//$post = Post::model()->find($criteria);
//$datos = CHtml::listData(Estado::model()->find('codocu=:c_hcod', array(':c_hcod'=>$documento)),'codestado','estado');
//datos = CHtml::listData(Estado::model()->find($criteria),'codestado','estado');
$datos = CHtml::listData(Documentos::model()->findall($criterial), 'coddocu', 'desdocu');
echo $form->DropDownList($model, 'coddocupadre', $datos, array('empty' => '--Indique un documento padre--'));
?>
		<?php 
echo $form->error($model, 'coddocupadre');
?>
              
		
		</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'idreportedefault');
$datos = CHtml::listData(Coordocs::model()->findall(), 'id', 'nombrereporte');
echo $form->DropDownList($model, 'idreportedefault', $datos, array('empty' => '--Indique el reporte--'));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>STD .:. Archivar Documento</title>
<?php 
include_once "includes/inc.header.php";
?>
</head>
<body>
<?php 
if ($_SESSION['session'][3] == "SI") {
    if ($_REQUEST['op'] == "cargar_adj") {
        if ($_REQUEST['id_hist'] && $_REQUEST['id_hist'] != 0) {
            Documentos::GuardarArchivoRespuesta($_REQUEST['id_hist']);
            Documentos::GuardarAdjuntosArchivo($_REQUEST['id_hist'], $_REQUEST['cat']);
            echo "<p>Se propuso correctamente</p></div>";
        }
        ?>
		<input name="cancelar" type="button" class="boton" id="cerrar_a" value="Cerrar" />
		<?php 
    } else {
        ?>
<fieldset>
	<legend>Archivar Documento</legend>
	<form id="form_archivo" name="form_justificacion" method="post" action="javascript:ArchivarCompletado(<?php 
        echo $_REQUEST['id'];
        ?>
)" enctype="multipart/form-data">																
	<input type="hidden" value="<?php 
        echo $_REQUEST["cat"];
Example #19
0
     } catch (Exception $e) {
         $response['mensaje'] = $e->getMessage();
     }
     $dirs = array(__DIR__ . '/uploads/' . $maestro->id_maestro . '/documentacion/', __DIR__ . '/uploads/' . $maestro->id_maestro . '/alternativa_1/', __DIR__ . '/uploads/' . $maestro->id_maestro . '/alternativa_2/');
     foreach ($dirs as $key => $value) {
         try {
             mkdir($value, 0777);
         } catch (Exception $e) {
             $response['mensaje'] = $e->getMessage();
         }
     }
     umask($oldmask);
 }
 $documento = Documentos::find($_POST['id_documento']);
 if ($documento == null) {
     $documento = new Documentos();
 }
 $dirToSave = '';
 switch ($_POST['clasificacion_documento_id']) {
     case 1:
         $dirToSave = __DIR__ . '/uploads/' . $maestro->id_maestro . '/documentacion/';
         break;
     case 2:
         $dirToSave = __DIR__ . '/uploads/' . $maestro->id_maestro . '/alternativa_1/';
         break;
     case 3:
         $dirToSave = __DIR__ . '/uploads/' . $maestro->id_maestro . '/alternativa_2/';
         break;
     default:
         # code...
         break;
Example #20
0
<?php

require 'vendor/autoload.php';
$db = Connection::getConnection();
error_reporting(E_ALL);
$response = array('codigo' => 0, 'mensaje' => '', 'error' => '');
if (isset($_POST['id_documento'])) {
    $id = strip_tags($_POST['id_documento']);
    $id = filter_var($id, FILTER_VALIDATE_INT);
    $documento = Documentos::find($id);
    if ($documento != null) {
        $db::beginTransaction();
        try {
            if (file_exists($documento->URL)) {
                if (unlink($documento->URL)) {
                    $conf = parse_ini_file(__DIR__ . '/config/conf.db.ini');
                    $mbd = new PDO('mysql:host=localhost;dbname=sacd', $conf['username'], $conf['password']);
                    $query = $mbd->prepare('delete from documento where id = ?');
                    $query->bindParam(1, $id);
                    $query->execute();
                    $mbd = null;
                    $response['codigo'] = 1;
                    $response['mensaje'] = 'Se eliminó correctamente';
                } else {
                    $response['mensaje'] = 'No se eliminó el archivo';
                }
            } else {
                $response['mensaje'] = 'El archivo no existe';
            }
        } catch (Exception $e) {
            $db::rollback();
Example #21
0
		vertical-align:top;
		padding-top:3px;
	}
</style>
<title>STD .:. Elaborar Borrador de Respuesta</title>
</head>
<body>
	<fieldset>
		<legend>Borrador de Respuesta</legend>							

	<?php 
if ($_REQUEST["opcion"] == 'addha') {
    $documento = new Documento($_REQUEST['id']);
    $borr = $documento->addHistorialBorrador();
    if ($borr != 0) {
        Documentos::GuardarArchivo($borr);
        echo "<p>Se Elaboro el borrador correctamente</p></div>";
    } else {
        echo "<div id='error'>Hubo un error al procesar su consulta</div>";
    }
    ?>
    <br/>
    <br/>
    <input name="cancelar" type="button" class="boton" id="cerrar_b" value="Cerrar" />
    <?php 
} else {
    $usuario = new Usuario($_REQUEST["usu"]);
    $accion = new Accion($_REQUEST["acc"]);
    $categoria = $_REQUEST["cat"] == 1 ? "Original" : "Copia";
    if ($_REQUEST["id"]) {
        $documento = new Documento($_REQUEST["id"]);
<?php

include_once "../models/Datasource.php";
include_once "../models/DocumentosDao.php";
include_once "../models/Documentos.php";
include_once "../models/Variables.php";
$conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword);
$docdao = new DocumentosDao();
$titulo = $_POST["titulo"];
$descripcion = $_POST["descripcion"];
$tipo = $_POST["group"];
$documento = new Documentos();
$dirdoc = $_FILES["doc"]["tmp_name"];
$formatodoc = substr($_FILES["doc"]["name"], strrpos($_FILES["doc"]["name"], "."));
//Obtener la última aparición del punto y por consiguiente, el formato
$destinoruta = substr($docLocation, 3);
$destinodoc = $docLocation . "/doc_" . $titulo . $formatodoc;
$destino = $destinoruta . "/doc_" . $titulo . $formatodoc;
$documento->setTitulo($titulo);
$documento->setDescripcion($descripcion);
$documento->setTipo($tipo);
$documento->setRuta($destino);
$correcto = true;
if ($docdao->create($conn, $documento) && move_uploaded_file($dirdoc, $destinodoc)) {
    ?>
		<meta http-equiv="REFRESH" content="0,url=../admin_documentos.php">
		<script type="text/javascript">
			alert("Documento Subido Exitosamente");
		</script>
		<?php 
} else {
Example #23
0
echo $form->label($model, 'nombrereporte');
?>
		<?php 
echo $form->textField($model, 'nombrereporte');
?>
	</div>




	<div class="row">
		<?php 
echo $form->label($model, 'codocu');
?>
		<?php 
$datos = CHTml::listData(Documentos::model()->findAll(), 'coddocu', 'desdocu');
?>
		<?php 
echo $form->dropDownList($model, 'codocu', $datos, array('prompt' => 'Seleccione un Documento'));
?>
	</div>


	<div class="row buttons">
		<?php 
echo CHtml::submitButton('Buscar', array('onClick' => 'Loading.show();Loading.hide();'));
?>
	</div>

<?php 
$this->endWidget();
Example #24
0
echo $form->labelEx($model, 'ceco');
?>
                    <?php 
$this->widget('ext.matchcode.MatchCode', array('nombrecampo' => 'ceco', 'ordencampo' => 3, 'controlador' => 'Dcajachica', 'relaciones' => $model->relations(), 'tamano' => 6, 'model' => $model, 'form' => $form, 'nombredialogo' => 'cru-dialog3', 'nombreframe' => 'cru-frame3', 'nombrearea' => 'fhdfjfgery'));
?>
                    <?php 
echo $form->error($model, 'ceco');
?>
                </div>

                <div class="row">
                    <?php 
echo $form->labelEx($model, 'codocu');
?>
                    <?php 
$datos1 = CHtml::listData(Documentos::model()->findAll("comprobante='1'"), 'coddocu', 'desdocu');
echo $form->DropDownList($model, 'codocu', $datos1, array('empty' => '--Seleccione comprobante--'));
?>
                    <?php 
echo $form->error($model, 'codocu');
?>
                </div>




                <div class="row buttons">
                    <?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
                </div>
Example #25
0
	<div class="row">
			<?php 
//echo $form->label($model,'lugares_lugar');
?>
			<?php 
//echo $form->textField($model,'lugares_lugar',array('size'=>25,'maxlength'=>40));
?>
													
	</div>
	
	<div class="row">
			<?php 
echo $form->label($model, 'tipodoc');
?>
			<?php 
$datos = CHtml::listData(Documentos::model()->findAll(array("condition" => "clase='D' ", 'order' => 'desDOCU')), 'coddocu', 'desdocu');
echo $form->DropDownList($model, 'tipodoc', $datos, array('empty' => '--Seleccione un documento --'));
//ECHO CHtml::image(Yii::app()->getTheme()->baseUrl.Yii::app()->params["rutatemaimagenes"]."nuevo.gif","",array("width"=>30,"height"=>15));
?>
													
	</div>
	
	
	
	
	<div class="row">
   	</div>
	
	
	<div class="row buttons">
		<?php 
Example #26
0
		<?php 
echo $form->textField($model, 'numdocref', array('size' => 15, 'maxlength' => 15, 'disabled' => $model->isNewRecord ? '' : 'disabled'));
?>
		<?php 
echo $form->error($model, 'numdocref');
?>
	</div>

	

	<div class="row">
		<?php 
echo $form->labelEx($model, 'codocuref');
?>
		<?php 
$datos1 = CHtml::listData(Documentos::model()->findAll(array('order' => 'desdocu')), 'coddocu', 'desdocu');
echo $form->DropDownList($model, 'codocuref', $datos1, array('empty' => '--Seleccione un documento--', 'disabled' => $model->isNewRecord ? '' : 'disabled'));
?>
		<?php 
echo $form->error($model, 'codocuref');
?>
	</div>

</div>



	

	<?php 
if (!$model->isNewRecord) {
Example #27
0
<?php

require 'vendor/autoload.php';
$db = Connection::getConnection();
error_reporting(E_ALL);
$response = array('data' => array(), 'error' => 0);
if (isset($_GET['clasificacion_documento_id']) and isset($_GET['id_maestro'])) {
    $id = htmlspecialchars($_GET['clasificacion_documento_id']);
    $id = strip_tags($id);
    $id = filter_var($id, FILTER_VALIDATE_INT);
    $id_maestro = htmlspecialchars($_GET['id_maestro']);
    $id_maestro = strip_tags($id_maestro);
    $id_maestro = filter_var($id_maestro, FILTER_VALIDATE_INT);
    $documentos = Documentos::where('clasificacion_documento_id', '=', $id)->where('id_maestro', '=', $id_maestro)->orderBy('Tipo_Documento_Id')->get();
    if (count($documentos) > 0) {
        $clasificacion = '';
        switch ($id) {
            case 1:
                $clasificacion = '/documentacion/';
                break;
            case 2:
                $clasificacion = '/alternativa_1/';
                break;
            case 3:
                $clasificacion = '/alternativa_2/';
                break;
            default:
                # code...
                break;
        }
        foreach ($documentos as $key => $value) {