예제 #1
0
 public function actionSubirDocumento()
 {
     Yii::import("ext.EAjaxUpload.qqFileUploader");
     $folder = Yii::app()->getBasePath() . "/../upload/";
     // folder for uploaded files
     $allowedExtensions = array("pdf", "zip", "rar", "txt", "cvs", "doc", "docx", "xls", "xlsx", "ppt", "pptx");
     //array("jpg","jpeg","gif","exe","mov" and etc...
     $sizeLimit = 5 * 1024 * 1024;
     // maximum file size in bytes
     $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
     $result = $uploader->handleUpload($folder, true);
     $return = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
     $fileName = $result['filename'];
     //GETTING FILE NAME
     $fileSize = filesize($folder . $result['filename']);
     //GETTING FILE SIZE
     $fileExt = $result['ext'];
     //GETTING FILE NAME
     $documento = new Documento();
     $documento->fecha_creacion = date("Y-m-d H:i:s");
     $documento->nombre = $fileName;
     $documento->usuario_id = Yii::app()->user->id;
     $documento->peso = $fileSize;
     $documento->extension = $fileExt;
     $documento->insert();
     echo $return;
     // it's array
 }
예제 #2
0
 public function run()
 {
     $faker = Faker::create();
     $documentos = [];
     $documentos[] = ["titulo" => "Carta de Residencia", "contenido" => '<div style="background-color:rgb(230, 230, 255); padding:10px;"> <h2 style="text-align:right"><img alt="" src="' . asset("images/condominio/logo.png") . '" style="float:left" /><span style="font-size:20px">{condo}</span></h2> <p style="text-align:right"><span style="font-size:16px">{condo_direccion}</span></p> <p style="text-align:right"><span style="font-size:12px">Rif:&nbsp;{condo_doc}</span></p> </div> <p style="text-align:right"><span style="color:#0000FF"><span style="font-size:14px">{fecha}</span></span></p> <p style="text-align:center">&nbsp;</p> <p style="text-align:center"><span style="color:#000000"><span style="font-size:18px">CARTA DE RESIDENCIA</span></span></p> <p style="text-align:center">&nbsp;</p> <p style="text-align:center">&nbsp;</p> <p style="text-align:center">&nbsp;</p> <p style="text-align:justify"><span style="font-size:18px">Por medio de la presente hacemos constar &nbsp;actuando como Miembros &nbsp;Legales de este consejo Comunal y vecinos de&nbsp;{condo}, que el ciudadano&nbsp;{persona} portador(a) de la cedula de identidad N&ordm;&nbsp;{persona_cedula} , reside en este sector en la&nbsp;{residencia}.</span></p> <p style="text-align:justify"><span style="font-size:18px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Documento Expedido a los&nbsp;{dia} d&iacute;a(s)&nbsp;del mes de&nbsp;{nombre_mes} de&nbsp;{ano}</span></p> <p style="text-align:justify"><span style="font-size:18px">&nbsp; &nbsp; &nbsp; Dicho Ciudadano(a) presenta buena conducta y espiritu de colaboraci&oacute;n por los dem&aacute;s</span></p> <p style="text-align:justify">&nbsp;</p> <p style="text-align:right"><span style="font-size:18px">&nbsp; &nbsp; &nbsp; &nbsp;</span><strong><em><span style="font-size:20px">Atentamente, El consejo comunal de&nbsp;{condo}</span></em></strong></p> <p style="text-align:right">&nbsp;</p> <p style="text-align:right">&nbsp;</p> <p style="text-align:right">&nbsp;</p> <p style="text-align:right">&nbsp;</p> <p style="text-align:right">&nbsp;</p> <p style="text-align:right">&nbsp;</p> <p style="text-align:center">__________________________________</p> <p style="text-align:center"><strong><span style="font-size:22px">{propietario}</span></strong></p> <p style="text-align:center"><span style="font-size:20px"><strong>C.I</strong>:&nbsp;{propietario_cedula}</span></p> <p style="text-align:center"><span style="font-size:20px"><strong>Telefono</strong>: {propietario_telefono}</span></p> <p style="text-align:center">&nbsp;</p> <p><img alt="" src="' . asset("images/condominio/logo.png") . '" style="float:right; height:70px; width:130px" />Telefono:&nbsp;{condo_telefono}</p> <p>Correo:&nbsp;{condo_email}</p> <p style="text-align:left">Rif: {condo_doc}</p> '];
     Documento::insert($documentos);
 }
예제 #3
0
$documento->setOperacion($mov['ope']);
$producto = new Producto();
$cliente = new Cliente();
$id_ses = session_id();
if ($_GET['action'] == 'Guardar' or $_GET['action'] == 'Actualizar') {
    $id_rem = $_GET['id_rem'];
    $no_doc = $_GET['no_doc'];
    $id_ses = $id_ses;
    $documento->setIdCliente($id_rem);
    $documento->setNoDoc($no_doc);
    $documento->setSesion($id_ses);
}
if ($_GET['action'] == 'Guardar') {
    try {
        if ($_GET['id_doc'] == 0) {
            $documento->insert();
        } else {
            $documento->update($_GET['id_doc']);
        }
    } catch (Exception $e) {
        echo "Error Insertando";
    }
}
if ($_GET['action'] == 'Actualizar') {
    try {
        $documento->update($_POST['id']);
    } catch (Exception $e) {
        echo "Error actualizando";
    }
}
if ($_GET['action'] == 'Upload') {