4 Commits 02782254a4 ... e7fabd3411

Autor SHA1 Mensagem Data
  Alejandro Granados e7fabd3411 eliminacion css que no se usa 6 anos atrás
  Alejandro Granados 51d805a0a1 eliminacion vistas que no se usan 6 anos atrás
  Alejandro Granados 63cc4c5347 ordenamiento y comentarios de funciones del controlador 6 anos atrás
  Alejandro Granados 91f8948fb8 update firma controller 6 anos atrás

+ 7 - 72
application/controllers/FirmaController.php

@@ -26,12 +26,14 @@ class FirmaController extends CI_Controller {
 
 
 	/** Comentario sobre  data_file():
-	 * ESTA FUNCION REGRESA LA DIRECCION DEL ARCHIVO EXCEL QUE SE ESTÁ LEYENDO PARA GENERAR LAS FIRMAS 
+	 * ESTA FUNCION REGRESA LA DIRECCION DEL ARCHIVO EXCEL QUE SE ESTÁ LEYENDO PARA GENERAR LAS FIRMAS
 	 */ 
 
 	private function data_file(){
 		return 'C:\xampp\htdocs\firmasCI\system_files\datos_firmas.xlsx';
 	}
+
+
 	public function index()
 	{	
 		$File = $this->data_file();
@@ -48,7 +50,6 @@ class FirmaController extends CI_Controller {
 					$headers[] = $cell->getCalculatedValue();	
 				}
 		}
-
 		#obteniendo datos de las personas
 	$personal =[];
 		foreach($sheet->getRowIterator(2,$fila_maxima) as $row){
@@ -76,7 +77,6 @@ class FirmaController extends CI_Controller {
 			list($site,$type,$identifier) = explode("/",$persona['LinkedIn']);
 			list($email_id,$email_domain) = explode("@",$persona['Correo']);
 			$data=['persona'=>$persona,'site'=>$site,'type'=>$type,'identifier'=>$identifier,'email_id'=>$email_id,'email_domain'=>$email_domain];
-			
 			//llamada a la vista
 			$this->load->view($persona['Plantilla'],$data);
 			/*
@@ -110,7 +110,7 @@ class FirmaController extends CI_Controller {
 
 
 	public function consultarPersonal($id){
-		$File = 'C:\xampp\htdocs\firmasCI\system_files\datos_firmas.xlsx';
+		$File = $this->data_file();
 		$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
 		$spreadsheet= $reader->load($File);
 		$sheet = $spreadsheet->getActiveSheet();
@@ -150,73 +150,11 @@ class FirmaController extends CI_Controller {
 		return null;
 	}
 
-		/* Comentario sobre generarZIP($id):
-		*ESTA FUNCION GENERA UN ZIP CON LOS ELEMENTOS DE CADA FIRMA
-		*DESCARGA LAS IMAGENES, EL TIPO DE FUENTE Y LA VISTA EN HTML DE LA FIRMA.
-		*EL CSS ESTÁ SIENDO INCRUSTADO EN LA VISTA, DENTRO DE LA FUNCIÓN generarHTML
-		*LA FUNCION generarHTML GENERA LA VISTA DE LA FIRMA DE MODO QUE CONSUMA FUENTE E IMAGENES
-		*DESDE UN SERVIDOR, POR LO TANTO DEBERÁ MODIFICARSE LA VISTA PARA QUE TRABAJE DE FORMA LOCAL
-		*UNA VEZ LOS ARCHIVOS ESTÉN DESCARGADOS.
-		*/
-
-	public function generarZIP($id){
-	$persona = $this->consultarPersonal($id);
-
-	if(isset($persona)){
-	$persona_name = $persona['Primer Nombre']."_".$persona['Primer Apellido'];
-	$file_name = $this->generarHTML($persona);
-
-
-	$zip =  new ZipArchive();
-	$zip_name = $persona_name."_".$persona['Plantilla'].".zip";
-	$zip->open($zip_name,ZipArchive::CREATE);
-
-
-	$public_folder_dir = "C:/XAMPP/htdocs/firmasCI/public";
-	$imagenes_folder = $public_folder_dir."/Imagenes";
-	$css_folder = $public_folder_dir."/css";
-	$tipograf_folder =$public_folder_dir."/Tipografias";
-
-	$carpetas=[];
-	$carpetas['Imagenes']=$imagenes_folder;
-	//$carpetas['css']=$css_folder;
-	$carpetas['Tipografias']=$tipograf_folder;
-
-	$dir = 'public';
-	$zip->addEmptyDir($dir);
-	$zip->addFile($file_name,$persona_name.".html");
-
-	foreach($carpetas as $key => $dir_folder){
-		$curr_dest_folder=$dir."/".$key;
-		$zip->addEmptyDir($curr_dest_folder);
-
-		foreach(array_diff(scandir($dir_folder), array('..', '.','fichas_style.css')) as $file){
-			$source_dir=$dir_folder."/".$file;
-			$dest_folder=$curr_dest_folder."/".$file;
-			$zip->addFile($source_dir,$dest_folder);
-		}
-	}
-
-	$zip->close();
-
-	// Creamos las cabezeras que forzaran la descarga del archivo como archivo zip.
-	header("Content-type: application/octet-stream");
-	header("Content-disposition: attachment; filename=".$zip_name);
-	// leemos el archivo creado
-	readfile($zip_name);
-	// Por último eliminamos el archivo temporal creado
-	unlink($zip_name);//Destruye el archivo temporal
-
-		}else{
-			print("NO EXISTE EL ID ".$id." REGISTRADO EN LA HOJA DE EXCEL,POR FAVOR REVISE LOS DATOS");
-		}
-	}
-
-
-
-
 	/**
 	 * comentario sobre la funcion descargarHTML($id)
+	 * ESTA FUNCION UTILIZA LAS FUNCIONES consultarPersonal($id) 
+	 * y generarHTML($persona)
+	 * PARA GENERAR LA FIRMA DESEADA, LUEGO DE GENERARLA REALIZA LA DESCARGA
 	 */
 	public function descargarHTML($id){
 		$persona = $this->consultarPersonal($id);
@@ -227,8 +165,6 @@ class FirmaController extends CI_Controller {
 		header("Content-disposition: attachment; filename=".$persona['Plantilla']."_".str_replace (" ","_" ,$persona['Nombre Completo']).".htm");
 		// leemos el archivo creado
 		readfile($file_name);
-
-
 		}else{
 			print("ERROR AL CONSULTAR EL EXCEL, REVISE LOS DATOS");
 		}
@@ -763,7 +699,6 @@ $html_header ="<html>
 					$headers[] = $cell->getCalculatedValue();	
 				}
 		}
-
 		#obteniendo datos de las personas
 	$file_names=[];
 	$file_dirs=[];

+ 0 - 89
application/views/welcome_message.php

@@ -1,89 +0,0 @@
-<?php
-defined('BASEPATH') OR exit('No direct script access allowed');
-?><!DOCTYPE html>
-<html lang="en">
-<head>
-	<meta charset="utf-8">
-	<title>Welcome to CodeIgniter</title>
-
-	<style type="text/css">
-
-	::selection { background-color: #E13300; color: white; }
-	::-moz-selection { background-color: #E13300; color: white; }
-
-	body {
-		background-color: #fff;
-		margin: 40px;
-		font: 13px/20px normal Helvetica, Arial, sans-serif;
-		color: #4F5155;
-	}
-
-	a {
-		color: #003399;
-		background-color: transparent;
-		font-weight: normal;
-	}
-
-	h1 {
-		color: #444;
-		background-color: transparent;
-		border-bottom: 1px solid #D0D0D0;
-		font-size: 19px;
-		font-weight: normal;
-		margin: 0 0 14px 0;
-		padding: 14px 15px 10px 15px;
-	}
-
-	code {
-		font-family: Consolas, Monaco, Courier New, Courier, monospace;
-		font-size: 12px;
-		background-color: #f9f9f9;
-		border: 1px solid #D0D0D0;
-		color: #002166;
-		display: block;
-		margin: 14px 0 14px 0;
-		padding: 12px 10px 12px 10px;
-	}
-
-	#body {
-		margin: 0 15px 0 15px;
-	}
-
-	p.footer {
-		text-align: right;
-		font-size: 11px;
-		border-top: 1px solid #D0D0D0;
-		line-height: 32px;
-		padding: 0 10px 0 10px;
-		margin: 20px 0 0 0;
-	}
-
-	#container {
-		margin: 10px;
-		border: 1px solid #D0D0D0;
-		box-shadow: 0 0 8px #D0D0D0;
-	}
-	</style>
-</head>
-<body>
-
-<div id="container">
-	<h1>Welcome to CodeIgniter!</h1>
-
-	<div id="body">
-		<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
-
-		<p>If you would like to edit this page you'll find it located at:</p>
-		<code>application/views/welcome_message.php</code>
-
-		<p>The corresponding controller for this page is found at:</p>
-		<code>application/controllers/Welcome.php</code>
-
-		<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
-	</div>
-
-	<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo  (ENVIRONMENT === 'development') ?  'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
-</div>
-
-</body>
-</html>

+ 0 - 172
public/css/fichas_style_download.css

@@ -1,172 +0,0 @@
-/*FUENTE INVERSOL*/
-@font-face{
-    font-family:HelveticaNeueLTStd-Lt;
-    src:url(../Tipografias/HelveticaNeueLTStd-Lt.otf);
-      }
-/*fuentes METCO*/
-    @font-face{
-    font-family:HelveticaNeueLTStd-Lt;
-    src:url(../Tipografias/HelveticaNeueLTStd-Lt.ttf);
-    }
-
-    @font-face{
-        font-family:VAGRoundedStd-Light;
-        src:url(../Tipografias/VAGRoundedStd-Light.otf);
-    }
-
-/*fuentes MERELEC*/
-@font-face{
-    font-family:GOTHICBI;
-    src:url(../Tipografias/GOTHICB.ttf);
-    }
-
-/*fuentes INVERLEC*/
-@font-face{
-    font-family:HelveticaNeueLTStd-Lt;
-    src:url(../Tipografias/HelveticaNeueLTStd-Lt.otf);
-    }
-
-/*Colores INVERSOL*/
-    .inversol_name_yellow{
-        font-family: HelveticaNeueLTStd-Lt;
-        color: #F78D27;
-        font-size: 25px;
-    }
-    .inversol_name_black{
-      font-family: HelveticaNeueLTStd-Lt;
-      color: black;
-      font-size: 25px;
-    }
-    td{
-        font-family: HelveticaNeueLTStd-Lt;
-    }
-
-  .inversol_yellow_text{
-    color: #F78D27;
-    font-family: HelveticaNeueLTStd-Lt;
-    font-size: 20px;
-  }
-
-  .inversol_black_text{
-    color: black;
-    font-family: HelveticaNeueLTStd-Lt;
-    font-size: 20px;
-  }
-
-
-/*Colores METCO*/
-.metco_name_yellow{
-    font-family: VAGRoundedStd-Light;
-    color: #DE8C33;
-    font-size: 19pt;
-}
-
-.metco_name_black{
-    font-family: VAGRoundedStd-Light;
-    color: black;
-    font-size: 19pt;
-}
-
-.metco_puesto{
-    font-family: VAGRoundedStd-Light;
-    color: black;
-    font-size: 18pt;
-}
-
-td{
-    font-family: HelveticaNeueLTStd-Lt;
-}
-.metco_yellow_text{
-color: #DE8C33;
-font-size: 14pt;
-font-family: HelveticaNeueLTStd-Lt;
-}
-
-.metco_gray_text{
-color: black;
-font-size: 14pt;
-font-family: HelveticaNeueLTStd-Lt;
-}
-
-/*Colores MERELEC*/
-font{
-    font-family: GOTHICBI;
-}
-
-td{
-    font-family: GOTHICBI;
-}
-
-.merelec_name_yellow{
-    font-family: GOTHICBI;
-    color: #FCB122;
-    font-size: 18pt;
-}
-
-.merelec_name_gray{
-    font-family: GOTHICBI;
-    color: #80888F;
-    font-size: 18pt;
-}
-
-.merelec_puesto{
-    font-family: GOTHICBI;
-    color: #80888F;
-    font-size: 17pt;
-}
-
-.merelec_yellow_text{
-color: #FCB122;
-font-size: 14pt;
-}
-
-.merelec_gray_text{
-color: #80888F;
-font-size: 14pt;
-}
-
-/*colores INVERLEC*/
-
-.inverlec_name_blue{
-    font-family: HelveticaNeueLTStd-Lt;
-    color: #436DAA;
-    font-size: 25px;
-}
-.inverlec_name_black{
-  font-family: HelveticaNeueLTStd-Lt;
-  color: black;
-  font-size: 25px;
-}
-td{
-    font-family: HelveticaNeueLTStd-Lt;
-}
-
-.inverlec_blue_text{
-color: #436DAA;
-font-family: HelveticaNeueLTStd-Lt;
-font-size: 20px;
-}
-
-.inverlec_black_text{
-color: black;
-font-family: HelveticaNeueLTStd-Lt;
-font-size: 20px;
-}
-
-
-a{
-    text-decoration: none;
-    display:table-cell;
-    vertical-align:middle;
-}
-
-.social_media{
-  padding-right:4px;
-  display:inline;
-
-}
-
-.imagen{
-    max-width: 230px; 
-    height: auto;
-}