public function actionExportExcel()
 {
     $model = new Reporte();
     $evento_id = $_POST['Report']['evento_id'];
     $sector_id = $_POST['Report']['sector_id'];
     $subsector_id = $_POST['Report']['subsector_id'];
     $rama_actividad_id = $_POST['Report']['rama_actividad_id'];
     $actividad_id = $_POST['Report']['actividad_id'];
     $dataReporte = $model->search($evento_id, $sector_id, $subsector_id, $rama_actividad_id, $actividad_id);
     $objExcel = new PHPExcel();
     $objExcel->setActiveSheetIndex(0)->setCellValue('A1', 'Nombre')->setCellValue('B1', 'Cédula')->setCellValue('C1', 'Celular')->setCellValue('D1', 'Teléfono')->setCellValue('E1', 'E-mail')->setCellValue('F1', 'Dirección')->setCellValue('G1', 'Sector')->setCellValue('H1', 'Subsector')->setCellValue('I1', 'Rama de Actividad')->setCellValue('J1', 'Actividad');
     $id = 2;
     foreach ($dataReporte as $Reporte) {
         $objExcel->setActiveSheetIndex(0)->setCellValue('A' . $id, $Reporte['nombre_completo'])->setCellValue('B' . $id, $Reporte['cedula'])->setCellValue('C' . $id, $Reporte['celular'])->setCellValue('D' . $id, $Reporte['telefono'])->setCellValue('E' . $id, $Reporte['email'])->setCellValue('F' . $id, $Reporte['direccion'])->setCellValue('G' . $id, $Reporte['sector'])->setCellValue('H' . $id, $Reporte['subsector'])->setCellValue('I' . $id, $Reporte['rama_actividad'])->setCellValue('J' . $id, $Reporte['actividad']);
         $id++;
     }
     for ($i = 'A'; $i <= 'O'; $i++) {
         $objExcel->setActiveSheetIndex(0)->getColumnDimension($i)->setAutoSize(TRUE);
     }
     $objExcel->getActiveSheet()->setTitle('ReporteParticipantes');
     //// Se activa la hoja para que sea la que se muestre cuando el archivo se abre
     $objExcel->setActiveSheetIndex(0);
     //
     //// Inmovilizar paneles
     $objExcel->getActiveSheet(0)->freezePane('A4');
     $objExcel->getActiveSheet(0)->freezePaneByColumnAndRow(1, 2);
     // Se manda el archivo al navegador web, con el nombre que se indica, en formato 2007
     header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
     header('Content-Disposition: attachment;filename="ReporteParticipantes.xlsx"');
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objExcel, 'Excel2007');
     $objWriter->save('php://output');
     exit;
 }
Example #2
1
 /**
  * Método para descargar
  */
 public function descargar($key = '')
 {
     if (!($id = Security::getKey($key, 'descargar_reporte', 'int'))) {
         return Redirect::toAction('listar');
     }
     $reporte = new Reporte();
     if (!$reporte->find_first($id)) {
         Flash::info('El archivo de reporte no fue encontrado');
         return Redirect::toAction('listar');
     }
     $this->file = dirname(APP_PATH) . "/public/" . $reporte->ruta;
     if (!is_file($this->file)) {
         Flash::warning('No hemos podido localizar el archivo. Por favor contacta al administrador del sistema.');
         return Redirect::toAction('listar');
     }
     View::template(NULL);
     $this->reporte = $reporte;
 }
 public function buscador()
 {
     if ($page == null) {
         $page = 1;
     }
     $rep = new Reporte();
     $tip = new Tipo();
     $this->data = $rep->getTodosSinPaginar(0);
 }
Example #4
0
 public function index()
 {
     $usuario_id = Session::get('id');
     $this->eventos = Evento::getListadoEventos($usuario_id);
     $reporte = new Reporte();
     $this->progress_report = $reporte->getListadoReportePorTipo($usuario_id, 'progress_report');
     $this->demographics_report = $reporte->getListadoReportePorTipo($usuario_id, 'demographics_report');
     $this->beehive_report = $reporte->getListadoReportePorTipo($usuario_id, 'beehive_report');
     $this->read_only = false;
 }
 /**
  * Inserta un nuevo reporte en la base de datos
  * Todos los parámetros son necesarios
  * Si no se desea subir foto se recomienda dar valor 0.
  * Si se quisiera obtener longitud y latitud aleatorios habría que insertar "x" en el campo longitud y "y en latitud"
  * Ejemplo: http://denunciaty/api/reporte/nuevo/Accidente/Uno muy gordo/Una calle/x/y/1/23/foto
  * @param string $titulo
  * @param string $foto
  * @param string $descripcion
  * @param int $gravedad_id
  * @param string $ubicacion
  * @param int $tipo_id
  * @param int $usuario_id
  */
 public function nuevo($titulo, $descripcion, $ubicacion, $longitud = null, $latitud = null, $tipo_id, $usuario_id, $foto)
 {
     $repo = new Reporte();
     if ($longitud == 'x') {
         $longitud = Reporte::getRandomCoordinates()[0];
     }
     if ($latitud == 'y') {
         $latitud = Reporte::getRandomCoordinates()[1];
     }
     $crear = $repo->createReporte($titulo, str_replace('+', '/', $foto), $descripcion, $ubicacion, $longitud, $latitud, $tipo_id, $usuario_id);
     if ($crear == false) {
         $this->data = '0';
     } else {
         $this->data = $crear;
     }
 }
Example #6
0
 public function editar_form($reporte_id = NULL)
 {
     $reporte = NULL;
     if ($reporte_id) {
         $reporte = Doctrine::getTable('Reporte')->find($reporte_id);
     } else {
         $reporte = new Reporte();
         $reporte->proceso_id = $this->input->post('proceso_id');
     }
     if ($reporte->Proceso->cuenta_id != UsuarioBackendSesion::usuario()->cuenta_id) {
         echo 'Usuario no tiene permisos para editar este documento.';
         exit;
     }
     $this->form_validation->set_rules('nombre', 'Nombre', 'required');
     $this->form_validation->set_rules('campos', 'Campos', 'required');
     $respuesta = new stdClass();
     if ($this->form_validation->run() == TRUE) {
         $reporte->nombre = $this->input->post('nombre');
         $reporte->campos = $this->input->post('campos');
         $reporte->save();
         $respuesta->validacion = TRUE;
         $respuesta->redirect = site_url('backend/reportes/listar/' . $reporte->Proceso->id);
     } else {
         $respuesta->validacion = FALSE;
         $respuesta->errores = validation_errors();
     }
     echo json_encode($respuesta);
 }
 public function getGenerateTxt($desde, $hasta)
 {
     $reportes = Reporte::where('fecha', '>=', $desde)->where('fecha', '<=', $hasta)->get();
     $facturas = Factura::all();
     $agente = Agente::find(1);
     $proveedores = Proveedor::all();
     $code = str_random(10);
     $content = \View::make('excel.txt')->with('reportes', $reportes)->with('facturas', $facturas)->with('agente', $agente)->with('proveedores', $proveedores);
     return \Response::make($content, '200')->header('Content-Type', 'plain/txt');
 }
Example #8
0
 /**
  * Método para crear/modificar un objeto de base de datos
  *
  * @param string $medthod: create, update
  * @param array $data: Data para autocargar el modelo
  * @param array $optData: Data adicional para autocargar
  *
  * return object ActiveRecord
  */
 public static function setReporte($method, $data, $optData = null)
 {
     $obj = new Reporte($data);
     //Se carga los datos con los de las tablas
     if ($optData) {
         //Se carga información adicional al objeto
         $obj->dump_result_self($optData);
     }
     //Verifico que no exista otro menu, y si se encuentra inactivo lo active
     $conditions = "usuario_id = {$obj->usuario_id} and nombre = '{$data['nombre']}' and  DATE_FORMAT(fecha, '%Y-%m') = DATE_FORMAT('{$data['fecha']}', '%Y-%m')";
     $old = new Reporte();
     if ($old->find_first($conditions)) {
         if ($method == 'create') {
             $obj->id = $old->id;
             $method = 'update';
         }
     }
     return $obj->{$method}() ? $obj : FALSE;
 }
Example #9
0
 function reporteStockValorizado()
 {
     $idLinea = $_REQUEST['linea'];
     $idSubLinea = $_REQUEST['sublinea'];
     $reporte = new Reporte();
     $data = $reporte->reporteStockValorizado($idLinea, $idSubLinea);
     $total = 0;
     for ($i = 0; $i < count($data); $i++) {
         echo '<tr>';
         echo "<td>" . $data[$i]['codigo'] . "</td>";
         echo "<td>" . $data[$i]['nompro'] . "</td>";
         echo "<td>" . $data[$i]['idalmacen'] . "</td>";
         echo "<td>" . $data[$i]['idlineapadre'] . "</td>";
         echo "<td>" . $data[$i]['nomum'] . "</td>";
         echo "<td>" . $data[$i]['stockactual'] . "</td>";
         echo '<td class="right">' . number_format($data[$i]['preciolista'], 2) . '</td>';
         echo '<td class="right">' . number_format($data[$i]['stockactual'] * $data[$i]['preciolista'], 2) . '</td>';
         echo '<tr>';
         $total += $data[$i]['stockactual'] * $data[$i]['preciolista'];
     }
     echo '<tr style="font-weight:bold"><td colspan="6"></td><td class="right">Total:</td><td class="right">' . number_format($total, 2) . '</td></tr>';
 }
Example #10
0
 public function createReporte($titulo, $foto = null, $descripcion, $ubicacion, $longitud = null, $latitud = null, $tipo_id, $usuario_id)
 {
     $repo = new Reporte();
     $fecha = strtotime('+30 day', strtotime(date('Y-m-d')));
     $nuevafecha = date('Y-m-d', $fecha);
     if ($foto != '0') {
         $repo->foto = $foto;
     }
     $repo->titulo = $titulo;
     $repo->descripcion = $descripcion;
     $repo->ubicacion = $ubicacion;
     $repo->longitud = $longitud;
     $repo->latitud = $latitud;
     $repo->tipo_id = $tipo_id;
     $repo->usuario_id = $usuario_id;
     $repo->solucionado = 0;
     $repo->caducidad = $nuevafecha;
     $rep = $repo->create();
     if ($rep == true) {
         return true;
     } else {
         return '0';
     }
 }
Example #11
0
<?php

session_start();
if (isset($_SESSION["Usuario"])) {
    require_once 'clases/clsReportes.php';
    $Reporte = new Reporte();
    if (isset($_POST['Consultar'])) {
        $montoMensual = $Reporte->getEgresosmensual($_POST['year']);
    } else {
        $montoMensual = $Reporte->getEgresosmensual(date('Y'));
    }
    $meses = $Reporte->meses();
    ?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Sistema - Tienda Virtual</title>
	<?php 
    require_once 'inc/header.php';
    ?>
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
	<script type="text/javascript">
		google.load("visualization", "1.1", {packages:["bar"]});
		google.setOnLoadCallback(drawChart);
			function drawChart() {
				var data = google.visualization.arrayToDataTable([
					['Meses', 'Egresos'],
					<?php 
    foreach ($montoMensual as $key) {
        ?>
Example #12
0
<?php

session_start();
if (isset($_SESSION["Usuario"])) {
    $url = $_SERVER['REQUEST_URI'];
    $url = explode('/', $url);
    include_once 'print/fpdf.php';
    require_once 'clases/clsReportes.php';
    $objRep = new Reporte();
    if (isset($url[4], $url[5]) && !empty($url[4]) && !empty($url[5])) {
        $fila = $objRep->Productos_vendidos_por_mes($url[4], $url[5]);
        if (empty($fila)) {
            header('Location: ../productos-mas-vendidos');
        }
    } else {
        header('Location: ../productos-mas-vendidos');
    }
    date_default_timezone_set("America/Lima");
    class PDF extends FPDF
    {
        //Cabecera de página
        function Header()
        {
            $this->Image('images/www.png', 10, 8, 65, 38, 'png');
            $this->SetFont('Arial', 'B', 12);
            //Movernos a la derecha
            $this->Cell(30);
            //Título
            $this->Cell(200, 40, iconv('utf-8', 'cp1252', 'SISTEMA DE COMPRA Y VENTA (JCL SOFT SOLUTION)'), 0, 1, 'C');
            $this->SetFont('Arial', 'B', 9);
            $this->Cell(365, -10, "Fecha: " . date("d/m/Y"), 0, 1, 'C');
		  <tr>
		    <td height="17">&nbsp;</td>
		    <td>&nbsp;</td>
	      </tr>
		  <tr>
		    <td colspan="2"><div align="center" class="cabecera_documento Estilo26">Filtros del Reporte </div></td>
	      </tr>
		  <tr>
		    <td height="18">&nbsp;</td>
		    <td>&nbsp;</td>
	      </tr>
		  <tr>
			<td width="118"><strong class="Estilo22">Nombre del &Aacute;rea </strong></td>
			<td width="318">
				<?php 
    $reporte = new Reporte();
    $areas = $reporte->obtener_areas();
    ?>
			
				<select name="area_rep">
					<option value="">---------- Seleccione un area --------</option>
				<?php 
    foreach ($areas as $area) {
        ?>
					<option value="<?php 
        echo $area["id"];
        ?>
"><?php 
        echo $area["area"];
        ?>
</option>
Example #14
0
            if (!empty($titulo)) {
                $graph->title->Set($titulo);
            }
            //Creamos el plot de tipo tarta
            $p1 = new PiePlot3D($data);
            $p1->SetSliceColors($color);
            #indicamos la leyenda para cada porcion de la tarta
            $p1->SetLegends($nombres);
            //Añadirmos el plot al grafico
            $graph->Add($p1);
            //mostramos el grafico en pantalla
            $graph->Stroke("{$nombreGrafico}.png");
            $this->Image("{$nombreGrafico}.png", $x, $y, $ancho, $altura);
            unlink("{$nombreGrafico}.png");
        }
    }
}
$pdf = new Reporte();
//creamos el documento pdf
$pdf->AddPage();
//agregamos la pagina
$pdf->SetFont("Arial", "B", 16);
//establecemos propiedades del texto tipo de letra, negrita, tamaño
//$pdf->Cell(40,10,'hola mundo',1);
$pdf->Cell(0, 5, "Estadisticas de los ultimos 30 dias", 0, 0, 'C');
$compra = new Compra();
$venta = new Venta();
$nro_compra = $compra->contar();
$nro_venta = $venta->contar();
$pdf->gaficoPDF(array('Ingresos' => array($nro_compra['0']['compras'], 'red'), 'Egresos' => array($nro_venta['0']['ventas'], 'blue')), 'Grafico', array(20, 40, 170, 170), 'Ingresos ' . $nro_compra['0']['compras'] . ' | Egresos ' . $nro_venta['0']['ventas']);
$pdf->Output();
Example #15
0
<?php

require_once 'clases/clsReportes.php';
$repor = new Reporte();
?>
				<ul class="nav nav-pills nav-stacked">
					<li role="presentation" class="active">
						<a href="<?php 
echo $_SESSION['Tipo'] == 'Administrador' ? "categoria.php" : "#";
?>
">
							<i class="glyphicon glyphicon-home"></i>
							Categoría <span class="badge pull-right">
							<i class="glyphicon glyphicon-bell"></i><?php 
echo $repor->numcateg();
?>
</span></a>
					</li>
					<li role="presentation">
						<a href="<?php 
echo $_SESSION['Tipo'] == 'Administrador' ? "presentacion.php" : "#";
?>
">
							<i class="glyphicon glyphicon-knight"></i> Presentación 
							<span class="badge alert-primary pull-right">
								<i class="glyphicon glyphicon-bell"></i><?php 
echo $repor->numpres();
?>
</span>
						</a>
					</li>
<?php

include 'reportes.php';
$client = new Reporte();
var_dump($_GET);
exit;
$paquete = $_GET;
$count = $client->countEncuestas($_GET);
// $count =8001;
if ($count == 0 || $count == null) {
    ?>
		<p><span> <span class="glyphicon glyphicon-warning-sign" style="font-size:16px;"></span>   Aún no existen registros para generar descargar. </span></p>
<?php 
} else {
    ?>
<div class="col-lg-12">
	<p><span>A continuacion se previsualizan los reportes generados de la consulta. De clic en el icono <span class="glyphicon glyphicon-download" style="font-size:16px;"></span> para descargar. </span></p>
		<table class="table table-condensed table-striped" >
			<thead>
				<tr>
					<th>#</th>
					<th>Reporte</th>
					<th>Descarga</th>
				</tr>
			</thead>
			<tbody id="reportes"></tbody>
		</table>
</div>
<script>
	var totalRegistros = parseInt("<?php 
    echo $count;
<?php

include_once 'reporte.php';
/*recibimos las variables post*/
$folioReporte = $_POST["folio_reporte"];
$objetoReporte = new Reporte();
/*se crea un objeto de la clase recibo*/
$respuestacrep = new stdClass();
/*para guardar la respuesta con json se declara la variable*/
$datos_reporte = $objetoReporte->consultar_folio($folioReporte);
/*se llama la funcion crear*/
if ($row = mysql_fetch_array($datos_reporte)) {
    $respuestacrep->resultado_cons_rep = "<span class='titulo-cons'> >>>>>>> Resultado Consultar-Reporte: <<<<<<< <br></span><div class='clearfix'></div>" . "<span class='encc'>Folio: </span><span class='encc1' id='folio_repc'>" . $row['Folio_reporte'] . "</span><br> " . "<span class='encc'>Fecha de Realización: </span><span class='encc1'>" . $row['Fecha_realizacion'] . "</span><br>" . "<span class='encc'>Mes y Año Consultados: </span><span class='encc1'>" . $row['Mes'] . " del " . $row['Anio'] . "</span><br> " . "<span class='encc'>Factura: </span><span class='encc1'>" . $row['Factura'] . "</span><br>" . "<span class='encc'>No. Eco Unidad de Transporte: </span><span class='encc1'>" . $row['No_eco_U_T'] . "</span><br> " . "<span class='encc'>Numero Total de Vales: </span><span class='encc1'>" . $row['No_total_vales'] . "</span><br>" . "<span class='encc'>Total de Recorrido: </span><span class='encc1'>" . $row['Total_recorrido'] . " KM</span><br> " . "<span class='encc'>Total Importe: </span><span class='encc1'>\$ " . $row['Total_importe'] . "</span><br>" . "<span class='encc'>Total de Litros: </span><span class='encc1'>" . $row['Total_litros'] . " Litros</span><br> " . "<span class='encc'>Observaciones: </span><span class='encc1'>" . $row['Observaciones'] . "</span><br>" . "<span class='encc'>Elaboró: </span><span class='encc1'>" . $row['Nombre_elaboro'] . "</span><br> " . "<span class='encc'>VO. BO.: </span><span class='encc1'>" . $row['Nombre_vobo'] . "</span><br>" . "<span class='encc'>Autorizó: </span><span class='encc1'>" . $row['Nombre_autorizo'] . "</span><br>";
    $respuestacrep->informe = "Reporte Encontrado";
} else {
    $respuestacrep->resultado_cons_rep = "Reporte NO Encontrado en la Base de Datos";
    $respuestacrep->informe = "Reporte NO Encontrado en la Base de Datos";
}
$rejsoncrep = json_encode($respuestacrep);
/*se convierte a json*/
echo $rejsoncrep;
/*se imprime la variable json que contiene la consulta de la tabla y el informe separados en variablaes*/
Example #18
0
<?php

session_start();
if (isset($_SESSION["Usuario"])) {
    include_once 'print/fpdf.php';
    require_once 'clases/clsReportes.php';
    require_once 'clases/clsNumeroLetras.php';
    $url = $_SERVER['REQUEST_URI'];
    $url = explode('/', $url);
    $Reporte = new Reporte();
    if (!is_numeric($url[5]) || strlen($url[5]) < 7 || strlen($url[5]) > 7) {
        header("Location: ../ventas");
    } else {
        $fila = $Reporte->PrintComprobante($url[5], $url[4]);
        $dc = $Reporte->getdatosCliente($url[5], $url[4]);
    }
    if (empty($fila) && empty($dc)) {
        header("Location: ../ventas");
    }
    $moneda = new EnLetras();
    $meses = $Reporte->meses();
    for ($mes = 1; $mes <= 12; $mes++) {
        if (date('m') == $mes) {
            $month = $meses[$mes];
        }
    }
    date_default_timezone_set("America/Lima");
    class PDF extends FPDF
    {
        function __construct()
        {
                if ($asistencias[$i] == 'licencia') {
                    $presente = 0;
                    $licencia = 1;
                }
            }
            $asistencia = new Asistencia($registro, $codigo, $presente, $licencia);
            $asistencia->insertarBD();
        }
        break;
    case 'registrar reportes':
        $roles = explode(',', $_POST['roles']);
        $actividades = explode(',', $_POST['actividades']);
        $hechos = explode(',', $_POST['hechos']);
        $resultados = explode(',', $_POST['resultados']);
        $conclusiones = explode(',', $_POST['conclusiones']);
        $observaciones = explode(',', $_POST['observaciones']);
        for ($i = 0; $i < count($roles); $i++) {
            $rol = $roles[$i];
            $actividad = $actividades[$i];
            $hecho = 1;
            $resultado = $resultados[$i];
            $conclusion = $conclusiones[$i];
            $observacion = $observaciones[$i];
            if ($hechos[$i] == 'no') {
                $hecho = 0;
            }
            $reporte = new Reporte($registro, $rol, $actividad, $hecho, $resultado, $conclusion, $observacion);
            $reporte->insertarBD();
        }
        break;
}
 function ordenCompraVendedor()
 {
     $idProveedor = $_REQUEST['idProveedor'];
     $fecha = $_REQUEST['fecha'];
     $fechaInicio = $_REQUEST['fechaInicio'];
     $fechaFinal = $_REQUEST['fechaFinal'];
     $repote = new Reporte();
     $data = $repote->reporteOrdenCompra($idProveedor, $fecha, $fechaInicio, $fechaFinal);
     for ($i = 0; $i < count($data); $i++) {
         echo "<tr>";
         echo "<td>" . $data[$i]['codigov'] . "</td>";
         echo '<td>' . date("d/m/Y", strtotime($data[$i]['fordencompra'])) . '</td>';
         echo "<td>" . $data[$i]['razonsocial'] . "</td>";
         echo "<td>" . $data[$i]['nombrezona'] . "</td>";
         echo "<td>" . $data[$i]['direccion'] . "</td>";
         $imagen1 = $vbVentas == 0 ? '' : ($vbVentas == 1 ? '/imagenes/iconos/aprobado.jpg' : '/imagenes/iconos/desaprobado.jpg');
         $imagen2 = $vbCobranza == 0 ? '' : ($vbCobranza == 1 ? '/imagenes/iconos/aprobado.jpg' : '/imagenes/iconos/desaprobado.jpg');
         $imagen3 = $vbCreditos == 0 ? '' : ($vbCreditos == 1 ? '/imagenes/iconos/aprobado.jpg' : '/imagenes/iconos/desaprobado.jpg');
         echo '<td><img src="' . $imagen1 . '"</td>';
         echo '<td><img src="' . $imagen2 . '"</td>';
         echo '<td><img src="' . $imagen3 . '"</td>';
         echo '<td width="100px">' . '<a href="/almacen/editar/' . $data[$i]['idalmacen'] . '" class="btnEditarAlmacen"><img src="/imagenes/iconos/editar.gif"></a>' . '<a href="/almacen/eliminar/"' . $data[$i]['idalmacen'] . '" class="btnEliminarAlmacen"><img src="/imagenes/iconos/eliminar.gif"></a>';
         echo "</td>";
         echo "</tr>";
         echo "</tr>";
     }
 }
Example #21
0
<?php

session_start();
if (isset($_SESSION["Usuario"])) {
    require_once 'clases/clsReportes.php';
    $Reporte = new Reporte();
    if (isset($_POST['Consultar'])) {
        $montoMensual = $Reporte->getVentasMensual($_POST['year']);
    } else {
        $montoMensual = $Reporte->getVentasMensual(date('Y'));
    }
    $meses = $Reporte->meses();
    ?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Sistema - Tienda Virtual</title>
	<?php 
    require_once 'inc/header.php';
    ?>
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
	<script type="text/javascript">
		google.load("visualization", "1.1", {packages:["bar"]});
		google.setOnLoadCallback(drawChart);
			function drawChart() {
				var data = google.visualization.arrayToDataTable([
					['Meses', 'Ingresos'],
					<?php 
    foreach ($montoMensual as $key) {
        ?>
        $detallePedidos = getVwDetallePedidoByIdPedido($_GET["idPedido"]);
    }
}
if ($submit == "atender") {
    if (isset($_GET["idPedido"])) {
        atenderPedido($_GET["idPedido"]);
        header("Location: ../View/Pedidos/ListaPedidos.php?rpta=boleta&idPedido=" . $_GET["idPedido"]);
    }
}
if ($submit == "boleta") {
    if (isset($_GET["idPedido"])) {
        $idPedido = $_GET["idPedido"];
        $pedido = getVwPedido($idPedido);
        $detallePedidos = getVwDetallePedidoByIdPedido($_GET["idPedido"]);
        ob_start();
        $reporte = new Reporte();
        $reporte->setFecha($pedido["fecha"]);
        $reporte->setTitulo("Boleta " . $pedido["idPedido"]);
        $reporte->AddPage();
        // Generarndo Boleta
        $reporte->Ln(20);
        $reporte->SetFont('helvetica', 'B', 6);
        $reporte->Cell(20, 5, "ID:", 0, 0, 'B');
        $reporte->SetFont('helvetica', '', 6);
        $reporte->Cell(20, 5, $pedido["idPedido"], 0, 0, 'C');
        $reporte->Ln(5);
        $reporte->SetFont('helvetica', 'B', 6);
        $reporte->Cell(20, 5, "Cliente:", 0, 0, 'B');
        $reporte->SetFont('helvetica', '', 6);
        $reporte->Cell(20, 5, $pedido["cliente"], 0, 0, 'C');
        $reporte->Ln(5);
<?php

include '../header.php';
$reporte = new Reporte($_GET['/'], '', '', '', '', '', '', '', '', '', '', '');
$reporte->Eliminar();
<?php

session_start();
ini_set("memory_limit", "1000M");
set_time_limit(20 * 60);
$consulta = array('idEstacion' => $_GET['idEstacion'], "rubro" => $_GET['rubro']);
$skip = (int) $_GET['skip'];
$limit = (int) $_GET['limit'];
//** Include PHPExcel */
require_once 'Classes/PHPExcel.php';
include 'reportes.php';
$client = new Reporte();
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
if (PHP_SAPI == 'cli') {
    die('This example should only be run from a Web Browser');
}
// Create new PHPExcel object
if ($_GET['rubro'] === 'pds1') {
    //	echo "preferencias";
    $objPHPExcel = new PHPExcel();
    // Set document properties
    $objPHPExcel->getProperties()->setCreator("Servicios Mexicanos de Ingenieria Civil")->setLastModifiedBy("SEMIC")->setTitle("Office 2007 XLSX Document")->setSubject("Office 2007 XLSX Document")->setDescription("Document de Office 2007 XLSX, Generado por Semic.")->setKeywords("office 2007 openxml php")->setCategory("Semic");
    $i = 1;
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . (string) $i, "PROG");
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B' . (string) $i, "ESTACIÓN");
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C' . (string) $i, "KM");
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D' . (string) $i, "SEN");
<?php

include '../header.php';
$db = new Conexion();
$link = Conectarse();
$Ot = $_POST['ot'];
$Horainicio = $_POST['horainicio'];
$Horafin = $_POST['horafin'];
$date = new DateTime($_POST['fecha']);
$Fecha = $date->format('Y-m-d');
$HorasTrabajo = $Horafin - $horainicio;
$Horashombre = (floatval($Horafin) - floatval($Horainicio)) / 60;
/*1. Obtener el centro de costo de la ot*/
$sql = "SELECT  CODIGOCENTROCOSTO,CODIGOOT\n\tFROM [020BDCOMUN].DBO.CENCOSOT  WHERE\n\tCODIGOOT IN (SELECT OF_COD FROM [011BDCOMUN].DBO.ORD_FAB\n WHERE OF_ESTADO='ACTIVO') AND CODIGOOT='{$Ot}'";
$result = mssql_query($sql, $link);
if ($row = mssql_fetch_array($result)) {
    mssql_field_seek($result, 0);
    while ($field = mssql_fetch_field($result)) {
    }
    do {
        $Cencos = $row['CODIGOCENTROCOSTO'];
    } while ($row = mssql_fetch_array($result));
} else {
    echo "error";
}
$reporte = new Reporte($_POST['id'], $Fecha, $DescHorainicio, $DescHorafin, $HorasTrabajo, $_POST['detalle'], $Horashombre, $Ot, $Cencos, $_SESSION['id'], $_POST['proceso'], $_POST['clasificacion']);
$reporte->Actualizar();
Example #26
0
 function agotados()
 {
     $fecha = $_REQUEST['fecha'];
     $fechaInicio = $_REQUEST['fechaInicio'];
     $fechaFinal = $_REQUEST['fechaFinal'];
     $idProducto = $_REQUEST['idProducto'];
     $repote = new Reporte();
     $ordenCompra = new Ordencompra();
     $linea = new Linea();
     $cantidadDoc = 0;
     $rutaImagen = $this->rutaImagenesProducto();
     $data = $repote->reporteAgotados($fecha, $fechaInicio, $fechaFinal, $idProducto);
     //$data=$repote->reporteAgotados('','','','');
     $unidadMedida = $this->unidadMedida();
     $cantidadData = count($data);
     for ($i = 0; $i < $cantidadData; $i++) {
         $fu = '';
         //Fecha ultima compra
         $fp = '';
         //Fecha penultima compra
         $c1 = 0;
         //Cantidad 1
         $c2 = 0;
         //Cantidad 2
         $doc = $ordenCompra->lista2UltimasCompras($data[$i]['idproducto']);
         $cantidadDoc = count($doc);
         //Data orden compra
         if ($cantidadDoc) {
             if ($cantidadDoc == 2) {
                 $fu = $doc[0]['fordencompra'];
                 $fp = $doc[1]['fordencompra'];
                 $c1 = $doc[0]['cantidadsolicitadaoc'];
                 $c2 = $doc[1]['cantidadsolicitadaoc'];
             } else {
                 $fu = $doc[0]['fordencompra'];
                 $c1 = $doc[0]['cantidadsolicitadaoc'];
             }
         }
         //><img src="'.$rutaImagen.$data[$i]['codigo'].'/'.$data[$i]['imagen'].'"></td>';
         $data[$i]['codigo'] = $data[$i]['codigop'];
         $data[$i]['nompro'] = $data[$i]['nompro'];
         $data[$i]['fechaultima'] = date("d/m/Y", strtotime($fu));
         $data[$i]['cantidadultima'] = $c1;
         $data[$i]['fechapenultima'] = date("d/m/Y", strtotime($fp));
         $data[$i]['cantidadpenultima'] = $c2;
         $data[$i]['nomlin'] = $linea->nombrexid($data[$i]['idlinea']);
     }
     $pdf = new PDF_Mc_Table("L", "mm", "A4");
     $titulos = array('Penultima', 'C.Penul', 'Ultima', 'C. Ultima', 'codigo', 'Descripcion', 'Sublinea');
     $columnas = array('fechapenultima', 'cantidadpenultima', 'fechaultima', 'cantidadultima', 'codigo', 'nompro', 'nomlin');
     $ancho = array(20, 15, 25, 18, 22, 110, 70);
     $orientacion = array('C', 'C', 'C', 'C', 'C', '', '');
     $pdf->_titulo = "Reporte de Agotados";
     $pdf->AddPage();
     $relleno = true;
     $pdf->SetFillColor(202, 232, 234);
     $pdf->SetTextColor(12, 78, 139);
     $pdf->SetDrawColor(12, 78, 139);
     $pdf->SetLineWidth(0.3);
     $pdf->SetFont('Helvetica', 'B', 8);
     $pdf->fill($relleno);
     //un arreglo con su medida  a lo ancho
     $pdf->SetWidths($ancho);
     $valor = "Reporte de Ventas";
     $pdf->titlees($valor);
     //un arreglo con alineacion de cada celda
     $pdf->SetAligns($orientacion);
     for ($i = 0; $i < count($titulos); $i++) {
         $pdf->Cell($ancho[$i], 7, $titulos[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetFillColor(224, 235, 255);
     $pdf->SetTextColor(0);
     $pdf->SetFont('');
     for ($i = 0; $i < $cantidadData; $i++) {
         $fila = array($data[$i]['fechapenultima'], $data[$i]['cantidadpenultima'], utf8_decode($data[$i]['fechaultima']), $data[$i]['cantidadultima'], $data[$i]['codigo'], utf8_decode($data[$i]['nompro']), $data[$i]['nomlin']);
         $pdf->Row($fila);
         $relleno = !$relleno;
         $pdf->fill($relleno);
     }
     $pdf->AliasNbPages();
     $pdf->Output();
 }
Example #27
0
require_once __ROOT__ . '/Util/Reporte.php';
$submit = $_GET["submit"];
$fechaInicio = $_POST["fechaInicio"];
$fechaFin = $_POST["fechaFin"];
// Convertir fechas
if ($submit == "Pedidos") {
    $pedidos = getReportePedidosByFechas($fechaInicio, $fechaFin);
    ob_start();
    $reporte = new Reporte();
    $reporte->setFecha($fechaInicio . " - " . $fechaFin);
    $reporte->setTitulo('Pedidos');
    $header = array(utf8_decode("idPedido"), utf8_decode("Cliente"), utf8_decode("Mesa"), utf8_decode("Fecha"), utf8_decode("N° Productos"), utf8_decode("Importe Total"));
    $cols = array("idPedido", "nombreCompleto", "descripcion", "fecha", "productos", "importeTotal");
    $w = array(20, 50, 30, 30, 20);
    $reporte->AddPage();
    $reporte->Table($header, $cols, $pedidos, $w);
    $reporte->Output();
}
if ($submit == "Consumo") {
    $pedidos = getReporteConsumoByFechas($fechaInicio, $fechaFin);
    ob_start();
    $reporte = new Reporte();
    $reporte->setFecha($fechaInicio . " - " . $fechaFin);
    $reporte->setTitulo('Consumo');
    $header = array(utf8_decode("Producto"), utf8_decode("Tipo"), utf8_decode("Precio"), utf8_decode("Cantidad"), utf8_decode("Importe"));
    $cols = array("descripcion", "tipo", "precio", "cantidad", "importe");
    $w = array(40, 40, 30, 30, 30);
    $reporte->AddPage();
    $reporte->Table($header, $cols, $pedidos, $w);
    $reporte->Output();
}
<?php

include_once 'reporte.php';
$objReportes = new Reporte();
$listaReportes = $objReportes->consultar();
?>
<div class="tabla_consulta">
<table class="consulta" border>
<tr>
<th>Folio Reporte</th>
<th>Fecha Realiz</th>
<th>Mes-Año Reportado </th>
<th>No EcoUT</th>
</tr>
<?php 
while ($row = mysql_fetch_array($listaReportes)) {
    echo "<tr>";
    echo "<td>" . $row['Folio_reporte'] . "</td>";
    echo "<td>" . $row['Fecha_realizacion'] . "</td>";
    echo "<td>" . $row['Mes'] . " " . $row['Anio'] . "</td>";
    echo "<td>" . $row['No_eco_U_T'] . "</td>";
    echo "</tr>";
}
?>
</table>
</div>
Example #29
0
<?php

require_once './models/Reporte.php';
ob_start();
$reporte = new Reporte();
$reporte->setFecha(date('d/m/Y'));
$reporte->setTitulo('Lista de Tipo de Equipos');
$header = array(utf8_decode('Código'), utf8_decode('Descripción'), utf8_decode('Nro. Modelos'), utf8_decode('Nro. Equipos'));
$cols = array('idTipoEquipo', 'descripcion', 'nroModelos', 'nroEquipos');
$w = array(20, 80, 30, 30);
$reporte->AddPage();
$reporte->Table($header, $cols, $tipoEquipos, $w);
$reporte->Output();
<?php

session_start();
ini_set("memory_limit", "1000M");
set_time_limit(20 * 60);
$consulta = array('capturista' => $_GET['capturista'], "rubro" => $_GET['rubro']);
$skip = (int) $_GET['skip'];
$limit = (int) $_GET['limit'];
//** Include PHPExcel */
require_once 'Classes/PHPExcel.php';
include 'reportes.php';
$client = new Reporte();
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
if (PHP_SAPI == 'cli') {
    die('This example should only be run from a Web Browser');
}
// Create new PHPExcel object
if ($_GET['rubro'] === 'pds1') {
    //	echo "preferencias";
    $objPHPExcel = new PHPExcel();
    // Set document properties
    $objPHPExcel->getProperties()->setCreator("Servicios Mexicanos de Ingenieria Civil")->setLastModifiedBy("SEMIC")->setTitle("Office 2007 XLSX Document")->setSubject("Office 2007 XLSX Document")->setDescription("Document de Office 2007 XLSX, Generado por Semic.")->setKeywords("office 2007 openxml php")->setCategory("Semic");
    $i = 1;
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . (string) $i, "PROG");
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B' . (string) $i, "ESTACIÓN");
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C' . (string) $i, "KM");
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D' . (string) $i, "SEN");