Пример #1
0
 public function actionVerimagenes($id)
 {
     /*
       		echo "<pre>"; print_r($_GET); echo "</pre>";
     	exit; 
     */
     $consecutivo = 1;
     $resolution = 'low';
     if (isset($_GET['c'])) {
         $consecutivo = (int) $_GET['c'];
     }
     if (isset($_GET['res'])) {
         $resolution = $_GET['res'];
     }
     if (isset($_GET["t"])) {
         $archivoHistorico = ArchivoHistorico::model()->find("volumen_did = " . $id);
         $id_arch = $archivoHistorico->id;
     } else {
         $id_arch = $id;
     }
     $model = ArchivoDetalle::model()->findByAttributes(array('archivoId' => $id_arch, 'consecutivo' => $consecutivo));
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $this->render("view_historico", array('model' => $model, 'resolution' => $resolution));
 }
Пример #2
0
<?php

$archivo = ArchivoHistorico::model()->find("volumen_did = :v and coleccion_did = :c", array(":v" => $_GET["id"], ":c" => $_GET["col"]));
$imagenes = ArchivoHistoricoDetalle::model()->findAll("Id_Archivo = " . $_GET["id"]);
header("Content-Disposition: inline; filename='hola'");
foreach ($imagenes as $imagen) {
    echo $imagen->imagen;
}
Пример #3
0
if (isset($volumenes) && count($volumenes) > 0) {
    ?>
	<table id="table" class="table table-bordered table-striped table-hover">
		<thead>
			<tr>
				<th>Mes Inicial</th>
				<th>Año Inicial</th>
				<th>Mes Final</th>
				<th>Año Final</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<?php 
    foreach ($volumenes as $volumen) {
        $idArchivo = ArchivoHistorico::model()->find("coleccion_did = :c and volumen_did = :v", array(":c" => $volumen->coleccion_did, ":v" => $volumen->id));
        if (isset($idArchivo) && !empty($idArchivo)) {
            echo '<tr>
									<td>' . $volumen->mesInicial . '</td>
									<td>' . $volumen->anoInicial . '</td>
									<td>' . $volumen->mesFinal . '</td>
									<td>' . $volumen->anoFinal . '</td>
									<td class="text-center">' . CHtml::link("Ver", array('coleccion/verimagenes', 'id' => $idArchivo->id), array('target' => '_blank', 'class' => 'btn btn-warning')) . '</td>
								</tr>';
        } else {
            echo '<tr>
									<td>' . $volumen->mesInicial . '</td>
									<td>' . $volumen->anoInicial . '</td>
									<td>' . $volumen->mesFinal . '</td>
									<td>' . $volumen->anoFinal . '</td>
									<td class="text-center"></td>
Пример #4
0
 public function actionAutocompletesearch()
 {
     $q = "%" . $_GET['term'] . "%";
     $result = array();
     if (!empty($q)) {
         $criteria = new CDbCriteria();
         $criteria->select = array('id', "CONCAT_WS(' ',nombre) as nombre");
         $criteria->condition = "lower(CONCAT_WS(' ',nombre)) like lower(:nombre) ";
         $criteria->params = array(':nombre' => $q);
         $criteria->limit = '10';
         $cursor = ArchivoHistorico::model()->findAll($criteria);
         foreach ($cursor as $valor) {
             $result[] = array('label' => $valor->nombre, 'value' => $valor->nombre, 'id' => $valor->id);
         }
     }
     echo json_encode($result);
     Yii::app()->end();
 }