function Muestra() { $empresa = new Empresa(); if (isset($_GET['empresa_id'])) { $empresa_id = $_GET['empresa_id']; $empresa->Load_EmpresaporID($empresa_id); } else { header("Location: index.php"); } $I = new Interfaz("Usuarios:: Editar Usuario", true); ?> <style type="text/css"> <!-- .Estilo1 {color: #FF0000} --> </style> <script language="JavaScript" src="../../lib/js/jquery/jquery-1.3.2.js" type="text/javascript"></script> <script language="JavaScript" src="../../lib/js/validateForm.js" type="text/javascript"></script> <script language="javascript"> function validate(){ if($("#nombre").val() == ""){ alert("El nombre es un campo requerido."); $("#nombre").focus(); return false; } if($("#codigo").val() == ""){ alert("El código es un campo requerido."); $("#codigo").focus(); return false; } var url = "services/Ajax_empresa.php"; var codigo = $("#codigo").val(); var regresa = true; var id = <?php echo $_GET['empresa_id']; ?> ; $.ajaxSetup({async:false}); $.post(url,{codigo:codigo,id:id},function(data){ if(data!=''){ alert("El código ya ha sido asignado a otra empresa."); $("#codigo").focus(); regresa = false; } }); return regresa; } </script> <br><br> <form name="form1" method="post" action=""> <table width="80%" align="center" cellpadding="4" cellspacing="4" border="0" bgcolor="#f4f4f4" style="padding-top: 20px;"> <tr> <td align="right"> </td> <td><strong>Editar Empresa</strong></td> </tr> <tr> <td align="right"> </td> <td> <input type="hidden" name="empresa_id" id="empresa_id" value="<?php echo $empresa_id; ?> " readonly="readonly" style="border-color:#FFFFFF" /> </td> </tr> <tr> <td align="right" width="30%">Nombre<span class="Estilo1">*</span>: </td> <td> <input type="text" name="nombre" id="nombre" size="70" value="<?php echo $empresa->Get_dato("e_nombre"); ?> "/> </td> </tr> <tr> <td align="right" width="30%">Código<span class="Estilo1">*</span>: </td> <td> <input type="text" name="codigo" id="codigo" size="40" value="<?php echo $empresa->Get_dato("e_codigo"); ?> "/> </td> </tr> <tr> <td align="right" width="30%">Estatus :</td><td> <select name="estatus" id="estatus"> <?php if ($empresa->Get_dato("e_estatus") == 1) { ?> <option selected value="1">Activo</option> <option value="0">Inactivo</option> <?php } else { ?> <option value="1">Activo</option> <option selected value="0">Inactivo</option> <?php } ?> </select> </td> </tr> <tr> <td colspan="2"> </td></tr> <tr> <td colspan="2" align="center"> <input type="submit" value="Actualizar" name="Actualizar" onclick="return validate(); "> <input type="submit" value="Cancelar" name="Cancelar"> </td> </tr> </table> </form> <?php $I->Footer(); }
<?php session_start(); require_once "../lib/php/constantes.php"; require_once "{$RUTA_A}/Connections/fwk_db.php"; require_once "{$RUTA_A}/functions/utils.php"; require_once '../lib/php/utils.php'; $I = new Interfaz("Reportes", true); $cnn = new conexion(); if (isset($_POST['buscar'])) { $parametros = "WHERE 1 = 1 "; if (!empty($_POST['EmpresaOpciones'])) { $empresa = new Empresa(); $empresa->Load_EmpresaporID($_POST['EmpresaOpciones']); $idEmpresa = $empresa->Get_Dato("e_id"); $parametros .= sprintf(" AND emp.e_id = '%s'", $idEmpresa); } $parametros .= !empty($_POST['rfc']) ? sprintf(" AND fact.e_rfc = %s ", $_POST['rfc']) : ""; $parametros .= !empty($_POST['fechaInicio']) ? sprintf(" AND fact.f_timbrado >= '%s 00:00:00' ", fecha_to_mysql($_POST['fechaInicio'])) : ""; $parametros .= !empty($_POST['fechaFin']) ? sprintf(" AND fact.f_timbrado <= '%s 00:00:00' ", fecha_to_mysql($_POST['fechaFin'])) : ""; $parametros .= !empty($_POST['empleados']) ? sprintf(" AND t.t_iniciador = '%s' ", $_POST['empleados']) : ""; $queryDropTables = "DROP TABLE IF EXISTS resultado"; $cnn->ejecutar($queryDropTables); $sql = "CREATE TABLE resultado AS\n\t\t\t\tSELECT\tt.t_id AS 'FOLIO',\n\t\t\t\t\tdc_tipo_comprobacion AS 'TIPO DE COMPROBACION',\n\t\t\t\t\tDATE_FORMAT(t.t_fecha_registro, '%d/%m/%Y') AS 'FECHA DE COMPROBACION',\t\n\t\t\t\t\tLEFT(u_usuario, 8) AS 'NUMERO DE EMPLEADO',\n\t\t\t\t\tnombre AS 'NOMBRE DEL EMPLEADO',\n\t\t\t\t\temp.e_nombre AS 'EMPRESA',\n\t\t\t\t\tf_nombre AS 'DOCUMENTO',\n\t\t\t\t\tfact.id_factura AS 'FACTURA ID',\n\t\t\t\t\tDATE_FORMAT(fact.f_timbrado, '%d/%m/%Y') AS 'FECHA EMISION FACTURA',\n\t\t\t\t\tfact.e_rfc AS 'RFC EMISOR',\n\t\t\t\t\tfact.uuid AS 'FOLIO FISCAL - UUID', \n\t\t\t\t\tfact.e_nombre AS 'APELLIDO PATERNO MATERNO NOMBRE(S) O DENOMINACION O RAZON SOCIAL',\n\t\t\t\t\tCONCAT(fact.e_domicilio, ', ', fact.e_estado, ', ', fact.e_pais) AS 'DIRECCION FISCAL',\n\t\t\t\t\t(IF(co_tramite = '-1', 'N/A', (SELECT DATE_FORMAT(t_fecha_registro, '%d/%m/%Y') FROM tramites WHERE t_id = co_tramite))) AS 'FECHA DE SOLICITUD',\n\t\t\t\t\t(IF(co_tramite = '-1', 'N/A', (SELECT t_id FROM tramites WHERE t_id = co_tramite))) AS 'FOLIO DE SOLICITUD',\n\t\t\t\t\tDATE_FORMAT(t.t_fecha_cierre, '%d/%m/%Y') AS 'FECHA DE AUTORIZACIÓN DE COMPROBACION',\n\t\t\t\t\t(IF(co_tramite = '-1', co_motivo_gasolina, t.t_etiqueta)) AS 'MOTIVO', \n\t\t\t\t\t(IF(co_tramite = '-1', 'N/A', co_anticipo_comprobado)) AS 'ANTICIPO COMPROBADO',\n\t\t\t\t\tCONCAT(cc_centrocostos,' - ',cc_nombre) AS 'CENTRO DE COSTOS',\n\t\t\t\t\tcp_concepto AS 'CONCEPTO',\n\t\t\t\t\tcp_cuenta AS 'CUENTA CONTABLE',\n\t\t\t\t\tdc_monto AS 'SUBTOTAL',\n\t\t\t\t\tdc_total AS 'MONTO TOTAL',\n\t\t\t\t\tdiv_nombre AS 'MONEDA',\n\t\t\t\t\tIFNULL(SUBSTRING(dc_notransaccion, 29, 9), 'N/A') AS 'TRANSACCION',\n\t\t\t\t\tIFNULL(CONVERT(notarjetacredito USING UTF8),'N/A') AS 'NÚMERO DE TARJETA',\n\t\t\t\t\tet_etapa_nombre AS 'ETAPA',\n\t\t\t\t\trut_ruta AS 'RUTA DE AUTORIZACION'\n\t\t\t\tFROM tramites t\n\n\t\t\t\tJOIN empleado ON idfwk_usuario = t.t_iniciador\n\t\t\t\tJOIN usuario ON idfwk_usuario = u_id\n\n\t\t\t\tJOIN comprobaciones ON co_mi_tramite = t.t_id\n\t\t\t\tJOIN detalle_comprobacion ON dc_comprobacion = co_id\n\t\t\t\tLEFT JOIN factura fact ON detalle_comprobacion.id_factura = fact.id_factura\n\n\t\t\t\tJOIN cat_cecos ON cc_id = co_cc_clave\n\t\t\t\tJOIN flujos ON f_id = t.t_flujo\n\t\t\t\tJOIN etapas ON et_etapa_id = t.t_etapa_actual AND et_flujo_id = t.t_flujo\n\t\t\t\tJOIN divisa ON div_id = dc_divisa\n\t\t\t\tJOIN empresas emp ON e_codigo = cc_empresa_id\n\t\t\t\tJOIN cat_conceptos ON cp_id = dc_concepto\n\n\t\t\t\tLEFT JOIN rutatransformacion ON rut_id = t.t_id\n\t\t\t\t{$parametros}\n\t\t\t\tAND t.t_flujo = 3\n\t\t\t\n\t\t\tUNION\n\n\t\t\t\tSELECT\tt.t_id AS 'FOLIO',\n\t\t\t\t\tdc_tipo AS 'TIPO DE COMPROBACION',\n\t\t\t\t\tDATE_FORMAT(t.t_fecha_registro, '%d/%m/%Y') AS 'FECHA DE COMPROBACION',\n\t\t\t\t\tLEFT(u_usuario, 8) AS 'NUMERO DE EMPLEADO',\n\t\t\t\t\tnombre AS 'NOMBRE DEL EMPLEADO',\n\t\t\t\t\temp.e_nombre AS 'EMPRESA',\n\t\t\t\t\tf_nombre AS 'DOCUMENTO',\n\t\t\t\t\tfact.id_factura AS 'FACTURA ID',\n\t\t\t\t\tDATE_FORMAT(fact.f_timbrado, '%d/%m/%Y') AS 'FECHA EMISION FACTURA',\n\t\t\t\t\tfact.e_rfc AS 'RFC EMISOR',\n\t\t\t\t\tfact.uuid AS 'FOLIO FISCAL - UUID', \n\t\t\t\t\tfact.e_nombre AS 'APELLIDO PATERNO MATERNO NOMBRE(S) O DENOMINACION O RAZON SOCIAL',\n\t\t\t\t\tCONCAT(fact.e_domicilio, ', ', fact.e_estado, ', ', fact.e_pais) AS 'DIRECCION FISCAL',\n\t\t\t\t\t(IF(co_tramite = '-1', 'N/A', (SELECT DATE_FORMAT(t_fecha_registro, '%d/%m/%Y') FROM tramites WHERE t_id = co_tramite))) AS 'FECHA DE SOLICITUD',\n\t\t\t\t\t(IF(co_tramite = '-1', 'N/A', (SELECT t_id FROM tramites WHERE t_id = co_tramite))) AS 'FOLIO DE SOLICITUD',\n\t\t\t\t\tDATE_FORMAT(t.t_fecha_cierre, '%d/%m/%Y') AS 'FECHA DE AUTORIZACIÓN DE COMPROBACION',\n\t\t\t\t\t(IF(co_tramite = '-1', co_motivo_gasolina, t.t_etiqueta)) AS 'MOTIVO', \n\t\t\t\t\t(IF(co_tramite = '-1', 'N/A', co_anticipo_comprobado)) AS 'ANTICIPO COMPROBADO',\n\t\t\t\t\tCONCAT(cc_centrocostos,' - ',cc_nombre) AS 'CENTRO DE COSTOS',\n\t\t\t\t\tcp_concepto AS 'CONCEPTO',\n\t\t\t\t\tcp_cuenta AS 'CUENTA CONTABLE',\n\t\t\t\t\tdc_monto AS 'SUBTOTAL',\n\t\t\t\t\tdc_total AS 'MONTO TOTAL',\n\t\t\t\t\tdiv_nombre AS 'MONEDA',\n\t\t\t\t\tIFNULL(SUBSTRING(dc_notransaccion, 29, 9), 'N/A') AS 'TRANSACCION',\n\t\t\t\t\tIFNULL(CONVERT(notarjetacredito USING UTF8),'N/A') AS 'NÚMERO DE TARJETA',\n\t\t\t\t\tet_etapa_nombre AS 'ETAPA',\n\t\t\t\t\trut_ruta AS 'RUTA DE AUTORIZACION'\n\t\t\t\tFROM tramites t\n\n\t\t\t\tJOIN empleado ON idfwk_usuario = t.t_iniciador\n\t\t\t\tJOIN usuario ON idfwk_usuario = u_id\n\n\t\t\t\tJOIN comprobacion_gastos ON co_mi_tramite = t.t_id\n\t\t\t\tJOIN detalle_comprobacion_gastos ON dc_comprobacion = co_id\n\t\t\t\tLEFT JOIN factura fact ON detalle_comprobacion_gastos.id_factura = fact.id_factura\n\n\t\t\t\tJOIN cat_cecos ON cc_id = co_cc_clave\n\t\t\t\tJOIN flujos ON f_id = t.t_flujo\n\t\t\t\tJOIN etapas ON et_etapa_id = t.t_etapa_actual AND et_flujo_id = t.t_flujo\n\t\t\t\tJOIN divisa ON div_id = dc_divisa\n\t\t\t\tJOIN empresas emp ON e_codigo = cc_empresa_id\n\t\t\t\tJOIN cat_conceptos ON cp_id = dc_concepto\n\n\t\t\t\tLEFT JOIN rutatransformacion ON rut_id = t.t_id\n\t\t\t\t{$parametros}\n\t\t\t\tAND t.t_flujo = 4\n\t\t\tORDER BY folio"; $_SESSION['query'] = $sql; $_SESSION['nombreReporte'] = "Reporte Fiscal"; $_SESSION['head'] = "Reporte Fiscal"; $res = mysql_query($sql); $sql = "SELECT * FROM resultado"; $res = mysql_query($sql); $count = mysql_num_rows($res);