public function search(Request $request) { $rfc = $request->rfc; $tipo = $request->tipo_id; $today = Carbon::today(); $today = $today->year . '-' . $today->month . '-' . $today->day; $paciente = Paciente::where('rfc', '=', $rfc)->where('tipo_id', '=', $tipo)->first(); $tipo = Tipo::find($tipo); if (isset($paciente)) { if ($paciente->count() > 1) { $citas = Cita::orderBy('fecha', 'desc')->where('paciente_id', '=', $paciente->id)->take(5)->get(); $citas->each(function ($citas) { $citas->paciente->tipo; $citas->medico->especialidad; $citas->fecha = fecha_dmy($citas->fecha); }); if ($citas->count() >= 1) { return Response::json($citas, 200); } else { $response = array('error' => 'true'); return Response::json('No se encontro citas con paciente RFC: ' . $rfc . ' - ' . $tipo->code, 500); } } } else { $response = array('error' => 'true'); return Response::json('No se encontro Paciente con RFC: ' . $rfc . ' - ' . $tipo->code, 500); } }
function listado($fechai, $fechaf, $proy_add, $proy_del, $aplica_oes, $buscar, $filtros, $reason, $pagina, $tipo, $editada, $motivo) { if (!$aplica_oes) { $aplica_oes = 'no'; } if ($tipo != 'proceso') { if (!$fechai) { $fechai = date("Y-m-d", mktime(0, 0, 0, date("m"), 1, date("Y"))); } if (!$fechaf) { $fechaf = date("Y-m-d", mktime(0, 0, 0, date("m") + 1, 0, date("Y"))); } } if (!$pagina) { $pagina = 1; } if ($proy_add != '') { $s_ = "insert into filtros values('','proyectos','{$proy_add}','{$_SESSION['IDEMP']}')"; $r_ = mysql_query($s_); } if ($proy_del != '') { if ($proy_del == 'del_all') { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}'"; $r_ = mysql_query($s_); } else { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}' and valor='{$proy_del}'"; $r_ = mysql_query($s_); } } ?> <div style="margin-left:100px;" class="titulo"> <table align="center" cellpadding="10" cellspacing="0" border="0"> <tr> <td class="titulo" width="190"> <?php if ($tipo == "proceso") { $titulo = "SCRAP EN PROCESO"; } if ($tipo == "aprobados") { $titulo = "SCRAP APROBADO"; } if ($tipo == "cancelados") { $titulo = "SCRAP CANCELADO"; } if ($tipo == "rechazados") { $titulo = "SCRAP RECHAZADO"; } echo $titulo; ?> </td> <td align="left"> <span title="header=[ <?php echo $titulo; ?> ] body=[Usted puede revisar el estado de boleta de scrap en base a los colores y las banderas:<br><br> <table align='center' border='0' cellspacing='2'> <tr bgcolor='#FFFFFF'> <td><img src='../imagenes/flag_orange.gif'></td> <td width=200> Firmas que están pendientes</td> </tr><tr bgcolor='#FFFFFF'> <td><img src='../imagenes/flag_green.gif'></td> <td> Firmas aprobadas</td> </tr><tr bgcolor='#FFFFFF'> <td><img src='../imagenes/flag_red.gif'></td> <td> Firmas rechazadas</td> </tr></table><br>]"><img src="../imagenes/question.gif" width="20" height="20"></span> </td> </tr> </table></div><hr> <div align="center" class="aviso">Utilice los filtros para generar búsquedas. Al cambiar un filtro, haga clic en el botón Buscar para refrescar la información. El reporte muestra toda la información sobre folios en proceso.</div> <form action="consultas.php" method="post" name="form1"> <input type="hidden" name="pagina" value="<?php echo $pagina; ?> " /> <input type="hidden" name="tipo" value="<?php echo $tipo; ?> " /> <table align="center" class="tabla"> <tr height="20"> <td align="center" width="100" bgcolor="#E6E6E6">Inicio Captura</td> <td align="center" width="100" bgcolor="#E6E6E6">Fin Captura</td> <td align="center" bgcolor="#E6E6E6">Agregue/quite proyectos</td> <?php if ($tipo == 'cancelados') { ?> <td align="center" bgcolor="#E6E6E6">Filtrar Motivos</td><?php } ?> </tr> <tr> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechai', 'valor': '<?php echo $fechai; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechaf', 'valor': '<?php echo $fechaf; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <table align="center" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr><td align="center"> <?php $r_1 = mysql_query(get_proyectos_out($division)); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_add" class="texto" style="width:180px;" onchange="submit();"> <option value="">Sin filtro (<?php echo $n_1; ?> )</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['id']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center"> <?php $r_1 = mysql_query(get_proyectos_in()); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_del" class="texto" style="width:180px;" onchange="submit();"> <option value="">En filtro (<?php echo $n_1; ?> )</option> <option value="del_all" class="quitar">Quitar Todos</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['valor']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr></table></td> <?php if ($tipo == 'cancelados') { ?> <td align="center"> <?php $s_1 = "select * from motivos_cancel where activo='1' order by motivo"; $r_1 = mysql_query($s_1); ?> <select name="motivo" class="texto" style="width:180px;"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['motivo']; ?> " <?php if ($motivo == $d_1['motivo']) { ?> selected <?php } ?> ><?php echo $d_1['motivo']; ?> </option><?php } ?> </select></td><?php } ?> </tr> </table><br> <table align="center" class="tabla"> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['0']; ?> " name="buscar[0]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where a_proceso='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[0]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[0] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center" width="110">Filtrar por OES?</td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['1']; ?> " name="buscar[1]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where a_proceso='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[1]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[1] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center"> <input type="radio" value="si" name="aplica_oes" <?php if ($aplica_oes == 'si') { ?> checked="checked"<?php } ?> onclick='filtro_oes();'> SI</td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['2']; ?> " name="buscar[2]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where a_proceso='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[2]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[2] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center"> <input type="radio" value="no" name="aplica_oes" <?php if ($aplica_oes == 'no') { ?> checked="checked"<?php } ?> onclick='filtro_oes();'> NO</td> </tr> </table> <div align="center" class="texto"><br> <input type="button" value="Buscar" class="submit" onclick="submit();"> <input type="button" value="Exportar" class="submit" onclick="exportar();"> <input type="checkbox" name="reason" value="1" <?php if ($reason == 1) { ?> checked="checked"<?php } ?> > Mostrar reason code <input type="checkbox" name="editada" value="1" <?php if ($editada == 1) { ?> checked="checked"<?php } ?> > Mostrar sólo editadas </div><br></form> <table align="center" border="0" class="texto"> <tr> <td width="20" align="center"><img src="../imagenes/zoom.png" /></td> <td width="60" align="left">Ver Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/pencil.gif" /></td> <td width="70" align="left">Editar Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/tick.png" /></td> <td width="40" align="left">Editada</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/information.png" /></td> <td width="40" align="left">Historial</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/attach.png" /></td> <td width="50" align="left">Evidencias</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/ayuda.gif" /></td> <td width="40" align="left">Detalles</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_orange.gif" /></td> <td width="50" align="left">Pendiente</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_green.gif" /></td> <td width="50" align="left">Aprobado</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_red.gif" /></td> <td width="50" align="left">Rechazado</td> </tr> </table><br> <?php $s_f = "select * from (select folios.*, sum(partes.cantidad) as cantidad_total, sum(partes.total) as costo_total, (select motivo from aut_bitacora where "; $s_f .= "aut_bitacora.no_folio=folios.no_folio and aut_bitacora.status='3' order by id desc limit 0,1) as motivo from scrap_partes as partes, scrap_folios as folios, "; $s_f .= "autorizaciones where folios.no_folio = partes.no_folio and autorizaciones.no_folio = folios.no_folio "; if ($_SESSION["DEPTO"] != 'esp') { $s_f .= " and autorizaciones.depto='{$_SESSION['DEPTO']}' "; } else { $s_f .= " and (autorizaciones.depto='esp_1' or autorizaciones.depto='esp_2') "; } switch ($tipo) { case "proceso": $s_f .= "and folios.activo='1' and folios.status='0' "; break; case "aprobados": $s_f .= "and folios.activo='1' and folios.status='1' "; break; case "cancelados": $s_f .= "and folios.activo='2' "; break; case "rechazados": $s_f .= "and folios.activo='1' and folios.status='2' "; break; } if ($editada == '1') { $s_f .= "and editada='1' "; } if ($aplica_oes == 'si') { $s_f .= " and autorizaciones.depto = 'oes' "; } if ($fechai != '' && $fechaf != '') { $s_f .= "and (fecha>='{$fechai}' and fecha<='{$fechaf}') "; } for ($i = 0; $i <= 2; $i++) { if ($buscar[$i] != '' && $filtros[$i] != '') { $s_f .= " and ( "; $data = split(",", $buscar[$i]); for ($j = 0; $j < count($data); $j++) { $s_f .= get_operador($filtros[$i], $data[$j]) . " or "; } $s_f = substr($s_f, 0, -3) . " ) "; } } $s_f .= filtros_autorizador(); $s_f .= " group by folios.no_folio order by folios.no_folio ASC) as general "; if ($motivo != '') { $s_f .= " where motivo like '{$motivo}' "; } $r_1 = mysql_query($s_f); $tot = mysql_num_rows($r_1); $pags = ceil($tot / 100); $ini_ = ($pagina - 1) * 100; $i = 1; $j = 0; $ruta = "&fechai={$fechai}&fechaf={$fechaf}&reason={$reason}&buscar[0]={$buscar['0']}&filtros[0]={$filtros['0']}"; $ruta .= "&buscar[1]={$buscar['1']}&filtros[1]={$filtros['1']}&buscar[2]={$buscar['2']}&filtros[2]={$filtros['2']}"; if ($tot > 0) { ?> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="0"> <tr> <td width="110" align="center" bgcolor="#BDBDBD" class="link_paginas"><?php echo $tot; ?> Registros</td> <td align="center" valign="top" bgcolor="#BDBDBD"> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="2"> <?php while ($i <= $pags) { if ($j >= 30) { echo "</tr>"; $j = 0; } if ($j == 0) { echo "<tr height='20'>"; } if ($pagina == $i) { $color = '#FFBF00'; } else { $color = '#F2F2F2'; } ?> <td width="30" align="center" bgcolor="<?php echo $color; ?> "> <a href="consultas.php?tipo=<?php echo $tipo; echo $ruta; ?> &pagina=<?php echo $i; ?> " class="link_paginas"><?php echo $i; ?> </a></td> <?php $i++; $j++; } ?> </table> </td> </tr> </table><br><?php } ?> <table align="center" class="tabla"> <tr bgcolor="#E6E6E6" height="20"> <td align="center" width="30"><img src="../imagenes/zoom.png" /></td> <td align="center" width="30"><img src="../imagenes/information.png" /></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { $cols = 5; ?> <td align="center" width="25"><img src="../imagenes/attach.png" /></td><?php } else { $cols = 4; } ?> <td align="center" width="30" rowspan="2"><img src="../imagenes/tick.png" /></td> <td align="center" width="50">Folio</td> <td align="center" width="40">Qty</td> <td align="center" width="100">Proyecto</td> <td align="center" width="100">Capturista</td> <?php if ($reason != 1) { ?> <td align="center" width="80">Cod.Scrap</td><?php } ?> <?php if ($reason == 1) { ?> <td align="center" width="80">Reason Code</td><?php } ?> <td align="center" width="80" colspan="2">Cod. Causa Original</td> <td align="center" width="100">Info.Obligatoria</td> <td align="center" width="70">Total</td> <td align="center" width="90">Fecha</td> <?php if ($tipo == 'cancelados') { ?> <td align="center" width="150">Motivo</td><?php } ?> <?php if ($_SESSION["DEPTO"] == 'lo') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LO</span></td>"; if ($_SESSION["DEPTO"] == 'loa') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LO-A</span></td>"; if ($_SESSION["DEPTO"] == 'lpl') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LPL</span></td>"; if ($_SESSION["DEPTO"] == 'ffm') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>FFM</span></td>"; if ($_SESSION["DEPTO"] == 'ffc') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>FFC</span></td>"; if ($_SESSION["DEPTO"] == 'prod') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>Prod</span></td>"; if ($_SESSION["DEPTO"] == 'sqm') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>SQM</span></td>"; if ($_SESSION["DEPTO"] == 'fin') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>Finanzas</span></td>"; if ($_SESSION["DEPTO"] == 'esp') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>ESP</span></td>"; if ($_SESSION["DEPTO"] == 'oes') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>OES</span></td>"; if ($_SESSION["DEPTO"] == 'inv') { $class = 'naranja'; } else { $class = ''; } echo "<td width='70' align='center'><span class={$class}>Inventarios</span></td>"; ?> </tr> </thead> <tbody> <?php $s_f .= " limit {$ini_},100"; $r_1 = mysql_query($s_f); while ($d_1 = mysql_fetch_array($r_1)) { $qty = $qty + $d_1['cantidad_total']; $cost = $cost + $d_1['costo_total']; ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=ver_boleta&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/zoom.png" border="0"></a></td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=historial&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/information.png" border="0"></a></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { ?> <td align="center"> <?php $s_c = "select * from configuracion where variable='ruta_evidencias'"; $r_c = mysql_query($s_c); $d_c = mysql_fetch_array($r_c); $ruta = $d_c['valor'] . $d_1['archivo']; if ($d_1['archivo'] != '') { ?> <a href="<?php echo $ruta; ?> " target="_blank"> <img src="../imagenes/attach.png" border="0"></a><?php } ?> </td><?php } ?> <td align="center"> <?php if ($d_1['editada'] == '1') { ?> <img src="../imagenes/tick.png" border="0"><?php } else { echo " "; } ?> </td> <td align="center"><?php echo $d_1['no_folio']; ?> </td> <td align="center"><?php echo $d_1['cantidad_total']; ?> </td> <td align="left"> <?php echo $d_1['proyecto']; ?> </td> <td align="left"> <?php echo $d_1['empleado']; ?> </td> <?php if ($reason != 1) { ?> <td align="center"><?php echo $d_1['codigo_scrap']; ?> </td><?php } ?> <?php if ($reason == 1) { ?> <td align="center"><?php echo $d_1['reason_code']; ?> </td><?php } ?> <td align="center" width="60"> <?php $original = data_codigo_original($d_1['no_folio'], $d_1['financiero']); echo $original['codigo']; ?> </td> <td align="center" width="20"> <?php if ($d_1['financiero'] == '1') { ?> <span title='header=[ Código de Causa Original] body=[<?php echo detalles_codigo_original($d_1['no_folio']); ?> ]'> <img src="../imagenes/ayuda.gif" style="cursor: hand;"></span><?php } ?> </td> <td align="center"><?php if ($d_1['info_1'] != 'NA') { echo $d_1['info_1'] . "-" . $d_1['info_2']; } else { echo "NA"; } ?> </td> <td align="right"><?php echo "\$ " . number_format($d_1['costo_total'], 2); ?> </td> <td align="center"><?php echo fecha_dmy($d_1['fecha']); ?> </td> <?php if ($tipo == 'cancelados') { ?> <td align="left"> <?php echo $d_1['motivo']; ?> </td><?php } ?> <td align="center"><?php echo get_bandera("lo", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("loa", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("lpl", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffc", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("prod", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("sqm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("fin", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("esp", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("oes", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("inv", $d_1['no_folio']); ?> </td> </tr> <?php } if ($qty > 0) { ?> <tr onMouseOut="this.style.background='#E6E6E6'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#E6E6E6" height="20"> <td colspan="<?php echo $cols; ?> "> </td> <td align="center" class="naranja"><b><?php echo $qty; ?> </b></td> <td colspan="5"> </td> <td align="right" class="naranja"><b><?php echo "\$ " . number_format($cost, 2); ?> </b></td> <td colspan="13"> </td> </tr><?php } ?> </tbody> </table><br><br><br> <?php }
function listado($orden, $fechai, $fechaf) { $s_ = "delete from scrap_temporal where id_emp='{$_SESSION['IDEMP']}'"; $r_ = mysql_query($s_); if (!$orden) { $orden = 'enviado_fecha'; } if (!$fechai) { $fechai = date("Y-m-d", mktime(0, 0, 0, date("m"), 1, date("y"))); } if (!$fechaf) { $fechaf = date("Y-m-d", mktime(0, 0, 0, date("m") + 1, 0, date("y"))); } ?> <div align="center" class="aviso">Los encabezados de la tabla permiten ordenar los campos</div> <form action="?op=listado" method="post" name="form1"> <table align="center" class="tabla"> <tr> <td align="center" width="120">Buscar mensajes</td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechai', 'valor': '<?php echo $fechai; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechaf', 'valor': '<?php echo $fechaf; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td><input type="submit" value="Buscar" class="submit"></td></tr> </table> </form> <table align="center" class="tabla"> <caption>Resumen de mensajes de <?php echo fecha_dmy($fechai); ?> a <?php echo fecha_dmy($fechaf); ?> </caption> <thead> <tr bgcolor="#E6E6E6" height="20"> <td width="50" align="center">Leído</td> <td width="350" align="center"><a href="?op=listado&orden=asunto" class="linkTabla">Asunto</a></td> <td width="120" align="center"><a href="?op=listado&orden=enviado_fecha" class="linkTabla">Fecha Envío</a></td> <td width="120" align="center"><a href="?op=listado&orden=enviado_hora" class="linkTabla">Hora Envío</a></td> <td width="50" align="center">Leer</td> </tr> </thead> <?php $s_1 = "select * from mails where enviado_fecha>='{$fechai}' and enviado_fecha<='{$fechaf}' and para_id='{$_SESSION['IDEMP']}' order by "; $s_1 .= "leido_fecha, {$orden} ASC"; $r_1 = mysql_query($s_1); ?> <tbody> <?php while ($d_1 = mysql_fetch_array($r_1)) { $ruta = "&fechai={$fechai}&fechaf={$fechaf}&orden={$orden}"; ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <?php if ($d_1['leido_fecha'] != '0000-00-00') { echo "<img src='../imagenes/tick.png' alt='Leído' border='0'>"; } ?> </td> <td align="left"> <?php echo $d_1['asunto']; ?> </td> <td align="center"><?php echo fecha_dmy($d_1['enviado_fecha']); ?> </td> <td align="center"><?php echo $d_1['enviado_hora']; ?> </td> <td align="center"><a class="frame_ver_mail" href="../detalles.php?op=ver_mail&leido=1&id_=<?php echo $d_1['id']; ?> "> <img src="../imagenes/mail.png" border="0"></a></td> </tr> <?php } ?> </tbody> </table> </form><br><br><br> <?php }
public function medicos_checkbox(Request $request) { $citas = Cita::where('fecha', '=', $request->date)->whereIn('medico_id', $request->medicos)->get(); $citas->each(function ($citas) { $citas->codigo; $citas->medico->especialidad; $citas->paciente->tipo; }); $citas = $citas->sortBy('horario')->groupBy('medico_id'); $mpdf = new mPDF('', 'Legal-L'); $header = \View('admin.reportes.header')->with('date', $request->date)->render(); $mpdf->SetFooter('Generado el: {DATE j-m-Y}| AgendaElectronica | ©' . date('Y') . ' ISSSTE BAJA CALIFORNIA'); $html = \View('admin.reportes.show')->with('citas', $citas)->with('date', $date)->render(); $pdfFilePath = 'Citas del ' . fecha_dmy($date) . '.pdf'; $mpdf->setAutoTopMargin = 'stretch'; $mpdf->setAutoBottomMargin = 'stretch'; $mpdf->setHTMLHeader($header); $mpdf->SetDisplayMode('fullpage'); $mpdf->WriteHTML($html); $mpdf->Output($pdfFilePath, "I"); //D }
function listado($orden, $fechai, $fechaf, $for_id, $reenviar) { if (!$for_id) { $for_id = '%'; } if (!$orden) { $orden = 'enviado_fecha'; } if (!$fechai) { $fechai = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d"), date("y"))); } if (!$fechaf) { $fechaf = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d"), date("y"))); } $ruta = "&for_id={$for_id}&fechai={$fechai}&fechaf={$fechaf}"; ?> <div align="center" class="aviso">Los encabezados de la tabla permiten ordenar los campos. Para reenviar correos, active la casillas de los que desea enviar.</div> <form action="?op=listado" method="post" name="form1"> <input type="hidden" name="orden" value="<?php echo $orden; ?> "> <table align="center" class="tabla"> <tr> <td align="center" width="120">Buscar mensajes</td> <td align="center"> <?php $s_ = "select para_id, para_name from mails group by para_id order by para_name"; $r_ = mysql_query($s_); ?> <select name="for_id" class="texto" style="width:250px;" onchange="submit();"> <option value=""></option> <?php while ($d_ = mysql_fetch_array($r_)) { ?> <option value="<?php echo $d_['para_id']; ?> " <?php if ($for_id == $d_['para_id']) { ?> selected="selected"<?php } ?> > <?php echo $d_['para_name']; ?> </option> <?php } ?> </select> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechai', 'valor': '<?php echo $fechai; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechaf', 'valor': '<?php echo $fechaf; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td><input type="submit" value="Buscar" class="submit"></td> <td><input type="button" value="Reenviar" class="submit" onclick="re_send();"></td> <td><input type="button" value="Borrar" class="submit" onclick="del_all();"></td></tr> </table> <br><table align="center" class="tabla"> <caption>Resúmen de mensajes de <?php echo fecha_dmy($fechai); ?> a <?php echo fecha_dmy($fechaf); ?> </caption> <thead> <tr bgcolor="#E6E6E6" height="20"> <td width="50" align="center"> <input type="checkbox" name="reenviar" value="1" onclick="submit();" <?php if ($reenviar == '1') { ?> checked="checked"<?php } ?> ></td> <td width="50" align="center">Leído</td> <td width="250" align="center">Para</td> <td width="350" align="center"><a href="?op=listado<?php echo $ruta; ?> &orden=asunto" class="linkTabla">Asunto</a></td> <td width="100" align="center"><a href="?op=listado<?php echo $ruta; ?> &orden=enviado_fecha" class="linkTabla">Fecha Envío</a></td> <td width="80" align="center"><a href="?op=listado<?php echo $ruta; ?> &orden=enviado_hora" class="linkTabla">Hora Envío</a></td> <td width="50" align="center">Leer</td> <td width="50" align="center">Borrar</td> </tr> </thead> <?php $s_1 = "select * from mails where enviado_fecha>='{$fechai}' and enviado_fecha<='{$fechaf}' and para_id like '{$for_id}' order by "; $s_1 .= "leido_fecha, {$orden} ASC"; $r_1 = mysql_query($s_1); ?> <tbody> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <input type="checkbox" name="mails[]" value="<?php echo $d_1['id']; ?> " <?php if ($reenviar == '1') { ?> checked="checked"<?php } ?> ></td> <td align="center"> <?php if ($d_1['leido_fecha'] != '0000-00-00') { echo "<img src='../imagenes/tick.png' alt='Leído' border='0'>"; } ?> </td> <td align="left"> <?php echo $d_1['para_name']; ?> </td> <td align="left"> <?php echo $d_1['asunto']; ?> </td> <td align="center"><?php echo fecha_dmy($d_1['enviado_fecha']); ?> </td> <td align="center"><?php echo $d_1['enviado_hora']; ?> </td> <td align="center"><a class="frame_ver_mail" href="detalles.php?op=ver_mail&leido=0&id_=<?php echo $d_1['id']; ?> "> <img src="../imagenes/mail.png" border="0"></a></td> <td align="center"><a href="?op=borrar&id_=<?php echo $d_1['id']; echo $ruta; ?> " onclick='return confirm("¿Borrar Registro?")'><img src="../imagenes/delete.gif" alt="Borrar" border="0"></a></td> </tr> <?php } ?> </tbody> </table> </form><br><br><br> <?php }
@if($citas) <div class="col-md-8"> <div class="panel-group"> <div class="panel panel-color"> <div class="panel-heading"> <div align="center"> <?php $permiso_act = 0; if (isset($permiso->fecha_inicio) && isset($permiso->fecha_final)) { $f_inicio = strtotime($permiso->fecha_inicio); $f_final = strtotime($permiso->fecha_final); if ($date2 >= $f_inicio && $date2 <= $f_final) { $permiso_act = 1; echo "<b><span class='font-border'>Medico esta de<br>Permiso hasta el " . fecha_dmy($permiso->fecha_final) . "</span></b>"; } } ?> @if($citas->count() < 10 && $permiso_act != 1 && $f_anterior != 1) <a data-url="{{ route('medico.nueva_cita', $date) }}" class="load-form-modal btn btn-primary" data-toggle ="modal" data-target='#form-modal'>+Agregar Cita</a> <div class="label label-warning pull pull-right">{{ fecha_dmy($date) }}</div> <div class="label label-warning pull pull-left"> Hay {{ $citas->count() }} Citas</div> @else <div class="label label-warning pull pull-right">{{ fecha_dmy($date) }}</div> <div class="label label-warning pull pull-left"> Hay {{ $citas->count() }} Citas</div> <br> @if($citas->count() >= 10) <b><span class="blink">No se pueden programar mas Citas para esta fecha.</span></b> @endif
function listado($fechai, $fechaf, $proy_add, $proy_del, $buscar, $filtros, $reason, $editados, $pagina) { if (!$pagina) { $pagina = 1; } if ($proy_add != '') { $s_ = "insert into filtros values('','proyectos','{$proy_add}','{$_SESSION['IDEMP']}')"; $r_ = mysql_query($s_); } if ($proy_del != '') { if ($proy_del == 'del_all') { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}'"; $r_ = mysql_query($s_); } else { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}' and valor='{$proy_del}'"; $r_ = mysql_query($s_); } } /*$s_2 = "select vw_reportes.*, bitacora.status from vw_reportes_".$_SESSION["IDEMP"]." vw_reportes "; $s_2.= "INNER JOIN (select MAX(id) as primera, no_folio, status from aut_bitacora group by no_folio) as aut ON aut.no_folio = vw_reportes.no_folio "; $s_2.= "INNER JOIN aut_bitacora bitacora ON aut.primera = bitacora.id "; if($editados=='1') { $s_2.= " where bitacora.status='5' "; } */ $s_2 = "select * from vw_reportes_" . $_SESSION["IDEMP"] . " vw_reportes"; if (mysql_query($s_2)) { $r_2 = mysql_query($s_2); $total = mysql_num_rows($r_2); } ?> <div align="center" class="aviso">Utilice los filtros para generar búsquedas. Al cambiar un filtro, haga clic en el botón Buscar para refrescar la información. El reporte muestra toda la información sobre folios en proceso.</div> <form action="?op=listado" method="post" name="form1"> <input type="hidden" name="pagina" value="<?php echo $pagina; ?> " /> <table align="center" class="tabla"> <tr height="20"> <td align="center" width="100" bgcolor="#E6E6E6">Incio Captura</td> <td align="center" width="100" bgcolor="#E6E6E6">Fin Captura</td> <td align="center" bgcolor="#E6E6E6">Agregue/quite proyectos</td> </tr> <tr> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechai', 'valor': '<?php echo $fechai; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechaf', 'valor': '<?php echo $fechaf; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <table align="center" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr><td align="center"> <?php $r_1 = mysql_query(get_proyectos_out($division)); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_add" class="texto" style="width:180px;" onchange="submit();"> <option value="">Sin filtro (<?php echo $n_1; ?> )</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['id']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center"> <?php $r_1 = mysql_query(get_proyectos_in()); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_del" class="texto" style="width:180px;" onchange="submit();"> <option value="">En filtro (<?php echo $n_1; ?> )</option> <option value="del_all" class="quitar">Quitar Todos</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['valor']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr></table></td> </tr> </table><br> <table align="center" class="tabla"> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['0']; ?> " name="buscar[0]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where a_rechazados='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[0]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[0] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['1']; ?> " name="buscar[1]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where a_rechazados='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[1]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[1] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['2']; ?> " name="buscar[2]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where a_rechazados='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[2]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[2] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> </table> <div align="center" class="texto"><br> <input type="button" value="Buscar" class="submit" onclick="validar('reporte');"> <input type="button" value="Exportar" class="submit" onclick="validar('excel');" <?php if ($total <= 0) { ?> disabled <?php } ?> > <input type="checkbox" name="reason" value="1" <?php if ($reason == 1) { ?> checked="checked"<?php } ?> > Mostrar Reason code <input type="checkbox" name="editados" value="1" <?php if ($editados == 1) { ?> checked="checked"<?php } ?> > Sólo folios editados </div><br></form> <table align="center" border="0" class="texto"> <tr> <td width="20" align="center"><img src="../imagenes/zoom.png" /></td> <td width="60" align="left">Ver Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/pencil.gif" /></td> <td width="70" align="left">Editar Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/tick.png" /></td> <td width="40" align="left">Editada</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/information.png" /></td> <td width="40" align="left">Historial</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/attach.png" /></td> <td width="50" align="left">Evidencias</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/ayuda.gif" /></td> <td width="40" align="left">Detalles</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_orange.gif" /></td> <td width="50" align="left">Pendiente</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_green.gif" /></td> <td width="50" align="left">Aprobado</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_red.gif" /></td> <td width="50" align="left">Rechazado</td> </tr> </table><br> <?php $pags = ceil($total / 100); $ini_ = ($pagina - 1) * 100; $i = 1; $j = 0; $ruta = "&fechai={$fechai}&fechaf={$fechaf}&reason={$reason}&buscar[0]={$buscar['0']}&filtros[0]={$filtros['0']}"; $ruta .= "&buscar[1]={$buscar['1']}&filtros[1]={$filtros['1']}&buscar[2]={$buscar['2']}&filtros[2]={$filtros['2']}"; if ($total > 0 && $editados != '1') { ?> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="0"> <tr> <td width="110" align="center" bgcolor="#BDBDBD" class="link_paginas"><?php echo $total; ?> Registros</td> <td align="center" valign="top" bgcolor="#BDBDBD"> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="2"> <?php while ($i <= $pags) { if ($j >= 30) { echo "</tr>"; $j = 0; } if ($j == 0) { echo "<tr height='20'>"; } if ($pagina == $i) { $color = '#FFBF00'; } else { $color = '#F2F2F2'; } ?> <td width="30" align="center" bgcolor="<?php echo $color; ?> "> <a href="?op=listado<?php echo $ruta; ?> &pagina=<?php echo $i; ?> " class="link_paginas"><?php echo $i; ?> </a></td> <?php $i++; $j++; } ?> </table> </td> </tr> </table><br><?php } ?> <table align="center" class="tabla"> <tr bgcolor="#E6E6E6" height="20"> <td align="center" width="30"><img src="../imagenes/zoom.png" /></td> <td align="center" width="30"><img src="../imagenes/information.png" /></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { $cols = 5; ?> <td align="center" width="25"><img src="../imagenes/attach.png" /></td><?php } else { $cols = 4; } ?> <td align="center" width="30" rowspan="2"><img src="../imagenes/tick.png" /></td> <td align="center" width="50">Folio</td> <td align="center" width="40">Qty</td> <td align="center" width="100">Proyecto</td> <?php if ($reason != 1) { ?> <td align="center" width="80">Cod.Scrap</td><?php } ?> <?php if ($reason == 1) { ?> <td align="center" width="80">Reason Code</td><?php } ?> <td align="center" width="80" colspan="2">Cod. Causa Original</td> <td align="center" width="100">Info.Obligatoria</td> <td align="center" width="70">Total</td> <td align="center" width="90">Fecha</td> <?php if ($_SESSION["DEPTO"] == 'lo') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LO</span></td>"; if ($_SESSION["DEPTO"] == 'loa') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LO-A</span></td>"; if ($_SESSION["DEPTO"] == 'lpl') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LPL</span></td>"; if ($_SESSION["DEPTO"] == 'ffm') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>FFM</span></td>"; if ($_SESSION["DEPTO"] == 'ffc') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>FFC</span></td>"; if ($_SESSION["DEPTO"] == 'prod') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>Prod</span></td>"; if ($_SESSION["DEPTO"] == 'sqm') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>SQM</span></td>"; if ($_SESSION["DEPTO"] == 'inv') { $class = 'naranja'; } else { $class = ''; } echo "<td width='70' align='center'><span class={$class}>Inventarios</span></td>"; ?> </tr> </thead> <tbody> <?php if ($total > 0) { if ($editados == '1') { $s_2 .= " order by no_folio desc "; } else { $s_2 .= " order by no_folio desc limit {$ini_},100"; } $r_1 = mysql_query($s_2); while ($d_1 = mysql_fetch_array($r_1)) { $qty = $qty + $d_1['cantidad_total']; $cost = $cost + $d_1['costo_total']; $edit = fue_editado($d_1['no_folio']); if ($edit == 'SI' && $editados == '1' || !$editados) { ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=ver_boleta&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/zoom.png" border="0"></a></td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=historial&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/information.png" border="0"></a></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { ?> <td align="center"> <?php $s_c = "select * from configuracion where variable='ruta_evidencias'"; $r_c = mysql_query($s_c); $d_c = mysql_fetch_array($r_c); $ruta = $d_c['valor'] . $d_1['archivo']; if ($d_1['archivo'] != '') { ?> <a href="<?php echo $ruta; ?> " target="_blank"> <img src="../imagenes/attach.png" border="0"></a><?php } ?> </td><?php } ?> <td align="center"> <?php $s_b = "select status from aut_bitacora where no_folio='{$d_1['no_folio']}' order by id desc"; $r_b = mysql_query($s_b); $d_b = mysql_fetch_array($r_b); if ($d_b['status'] == '5') { ?> <img src="../imagenes/tick.png" border="0"><?php } else { echo " "; } ?> </td> <td align="center"><?php echo $d_1['no_folio']; ?> </td> <td align="center"><?php echo $d_1['cantidad_total']; ?> </td> <td align="left"> <?php echo $d_1['proyecto']; ?> </td> <?php if ($reason != 1) { ?> <td align="center"><?php echo $d_1['codigo_scrap']; ?> </td><?php } ?> <?php if ($reason == 1) { ?> <td align="center"><?php echo $d_1['reason_code']; ?> </td><?php } ?> <td align="center" width="60"> <?php $original = data_codigo_original($d_1['no_folio'], $d_1['financiero']); echo $original['codigo']; ?> </td> <td align="center" width="20"> <?php if ($d_1['financiero'] == '1') { ?> <span title='header=[ Código de Causa Original] body=[<?php echo detalles_codigo_original($d_1['no_folio']); ?> ]'> <img src="../imagenes/ayuda.gif" style="cursor: hand;"></span><?php } ?> </td> <td align="center"><?php if ($d_1['info_1'] != 'NA') { echo $d_1['info_1'] . "-" . $d_1['info_2']; } else { echo "NA"; } ?> </td> <td align="right"><?php echo "\$ " . number_format($d_1['costo_total'], 2); ?> </td> <td align="center"><?php echo fecha_dmy($d_1['fecha']); ?> </td> <td align="center"><?php echo get_bandera("lo", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("loa", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("lpl", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffc", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("prod", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("sqm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("inv", $d_1['no_folio']); ?> </td> </tr> <?php } } if ($qty > 0) { ?> <tr onMouseOut="this.style.background='#E6E6E6'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#E6E6E6" height="20"> <td colspan="<?php echo $cols; ?> "> </td> <td align="center" class="naranja"><b><?php echo $qty; ?> </b></td> <td colspan="5"> </td> <td align="right" class="naranja"><b><?php echo "\$ " . number_format($cost, 2); ?> </b></td> <td colspan="9"> </td> </tr><?php } } ?> </tbody> </table><br><br><br> <?php }
function listado($fechai, $fechaf, $proy_add, $proy_del, $buscar, $filtros, $reason, $editados, $pagina, $op) { if (!$pagina) { $pagina = 1; } if ($op == 'aprobados') { if (!$fechai) { $fechai = date("Y-m-d", mktime(0, 0, 0, date("m"), 1, date("Y"))); } if (!$fechaf) { $fechaf = date("Y-m-d", mktime(0, 0, 0, date("m") + 1, 0, date("Y"))); } } ?> <table align="center" border="0" class="texto"> <tr> <td width="20" align="center"><img src="../imagenes/zoom.png" /></td> <td width="60" align="left">Ver Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/pencil.gif" /></td> <td width="70" align="left">Editar Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/tick.png" /></td> <td width="40" align="left">Editada</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/information.png" /></td> <td width="40" align="left">Historial</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/attach.png" /></td> <td width="50" align="left">Evidencias</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/ayuda.gif" /></td> <td width="40" align="left">Detalles</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_orange.gif" /></td> <td width="50" align="left">Pendiente</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_green.gif" /></td> <td width="50" align="left">Aprobado</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_red.gif" /></td> <td width="50" align="left">Rechazado</td> </tr> </table><br> <?php $s_1 = "select no_folio, id_emp, fecha, sum(cantidad) as cantidad_total, planta, carga_masiva, proyecto, id_division, division, profit_center, area, codigo_scrap, "; $s_1 .= "reason_code, sum(total) as costo_total, financiero, archivo, info_1, info_2, editado from "; switch ($op) { case "proceso": $s_1 .= "vw_pendientes "; break; case "rechazados": $s_1 .= "vw_rechazados "; break; case "cancelados": $s_1 .= "vw_cancelados "; break; case "aprobados": $s_1 .= "vw_aprobados "; break; } $s_1 .= "where no_folio!='0' "; if ($fechai != '' && $fechaf != '') { $s_1 .= "and (fecha>='{$fechai}' and fecha<='{$fechaf}') "; } if ($editados == '1') { $s_1 .= "and editado='1' "; } for ($i = 0; $i <= 2; $i++) { if ($buscar[$i] != '' && $filtros[$i] != '') { $s_1 .= " and ( "; $data = split(",", $buscar[$i]); for ($j = 0; $j < count($data); $j++) { $s_1 .= get_operador($filtros[$i], $data[$j]) . " or "; } $s_1 = substr($s_1, 0, -3) . " ) "; } } $s_1 .= filtros_autorizador($division); $s_1 .= " group by no_folio"; $r_1 = mysql_query($s_1); $total = mysql_num_rows($r_1); $pags = ceil($total / 100); $ini_ = ($pagina - 1) * 100; $i = 1; $j = 0; $ruta = "&op={$op}&fechai={$fechai}&fechaf={$fechaf}&reason={$reason}&tipo={$tipo}&buscar[0]={$buscar['0']}&filtros[0]={$filtros['0']}"; $ruta .= "&buscar[1]={$buscar['1']}&filtros[1]={$filtros['1']}&buscar[2]={$buscar['2']}&filtros[2]={$filtros['2']}"; if ($total > 0) { ?> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="0"> <tr> <td width="110" align="center" bgcolor="#BDBDBD" class="link_paginas"><?php echo $total; ?> Registros</td> <td align="center" valign="top" bgcolor="#BDBDBD"> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="2"> <?php while ($i <= $pags) { if ($j >= 30) { echo "</tr>"; $j = 0; } if ($j == 0) { echo "<tr height='20'>"; } if ($pagina == $i) { $color = '#FFBF00'; } else { $color = '#F2F2F2'; } ?> <td width="30" align="center" bgcolor="<?php echo $color; ?> "> <a href="?op=listado<?php echo $ruta; ?> &pagina=<?php echo $i; ?> " class="link_paginas"><?php echo $i; ?> </a></td> <?php $i++; $j++; } ?> </table> </td> </tr> </table><br><?php } ?> <table align="center" class="tabla"> <tr bgcolor="#E6E6E6" height="20"> <td align="center" width="40"> </td> <td align="center" width="30"><img src="../imagenes/zoom.png" /></td> <td align="center" width="30"><img src="../imagenes/information.png" /></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { $cols = 6; ?> <td align="center" width="25"><img src="../imagenes/attach.png" /></td><?php } else { $cols = 5; } ?> <td align="center" width="30" rowspan="2"><img src="../imagenes/tick.png" /></td> <td align="center" width="50">Folio</td> <td align="center" width="40">Qty</td> <td align="center" width="100">Proyecto</td> <?php if ($reason != 1) { ?> <td align="center" width="80">Cod.Scrap</td><?php } ?> <?php if ($reason == 1) { ?> <td align="center" width="80">Reason Code</td><?php } ?> <td align="center" width="80" colspan="2">Cod. Causa Original</td> <td align="center" width="100">Info.Obligatoria</td> <td align="center" width="70">Total</td> <td align="center" width="90">Fecha</td> <?php if ($_SESSION["DEPTO"] == 'lo') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LO</span></td>"; if ($_SESSION["DEPTO"] == 'loa') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LO-A</span></td>"; if ($_SESSION["DEPTO"] == 'lpl') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>LPL</span></td>"; if ($_SESSION["DEPTO"] == 'ffm') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>FFM</span></td>"; if ($_SESSION["DEPTO"] == 'ffc') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>FFC</span></td>"; if ($_SESSION["DEPTO"] == 'prod') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>Prod</span></td>"; if ($_SESSION["DEPTO"] == 'sqm') { $class = 'naranja'; } else { $class = ''; } echo "<td width='60' align='center'><span class={$class}>SQM</span></td>"; if ($_SESSION["DEPTO"] == 'inv') { $class = 'naranja'; } else { $class = ''; } echo "<td width='70' align='center'><span class={$class}>Inventarios</span></td>"; ?> </tr> </thead> <tbody> <?php if ($total > 0) { $s_1 .= " order by no_folio desc limit {$ini_},100"; $r_1 = mysql_query($s_1); $i = $ini_ + 1; while ($d_1 = mysql_fetch_array($r_1)) { $qty = $qty + $d_1['cantidad_total']; $cost = $cost + $d_1['costo_total']; ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"><?php echo $i; ?> </td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=ver_boleta&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/zoom.png" border="0"></a></td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=historial&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/information.png" border="0"></a></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { ?> <td align="center"> <?php $s_c = "select * from configuracion where variable='ruta_evidencias'"; $r_c = mysql_query($s_c); $d_c = mysql_fetch_array($r_c); $ruta = $d_c['valor'] . $d_1['archivo']; if ($d_1['archivo'] != '') { ?> <a href="<?php echo $ruta; ?> " target="_blank"> <img src="../imagenes/attach.png" border="0"></a><?php } ?> </td><?php } ?> <td align="center"> <?php if ($d_1['editado'] == '1') { ?> <img src="../imagenes/tick.png" border="0"><?php } else { echo " "; } ?> </td> <td align="center"><?php echo $d_1['no_folio']; ?> </td> <td align="center"><?php echo $d_1['cantidad_total']; ?> </td> <td align="left"> <?php echo $d_1['proyecto']; ?> </td> <?php if ($reason != 1) { ?> <td align="center"><?php echo $d_1['codigo_scrap']; ?> </td><?php } ?> <?php if ($reason == 1) { ?> <td align="center"><?php echo $d_1['reason_code']; ?> </td><?php } ?> <td align="center" width="60"> <?php $original = data_codigo_original($d_1['no_folio'], $d_1['financiero']); echo $original['codigo']; ?> </td> <td align="center" width="20"> <?php if ($d_1['financiero'] == '1') { ?> <span title='header=[ Código de Causa Original] body=[<?php echo detalles_codigo_original($d_1['no_folio']); ?> ]'> <img src="../imagenes/ayuda.gif" style="cursor: hand;"></span><?php } ?> </td> <td align="center"><?php if ($d_1['info_1'] != 'NA') { echo $d_1['info_1'] . "-" . $d_1['info_2']; } else { echo "NA"; } ?> </td> <td align="right"><?php echo "\$ " . number_format($d_1['costo_total'], 2); ?> </td> <td align="center"><?php echo fecha_dmy($d_1['fecha']); ?> </td> <td align="center"><?php echo get_bandera("lo", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("loa", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("lpl", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffc", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("prod", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("sqm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("inv", $d_1['no_folio']); ?> </td> </tr> <?php $i++; } if ($qty > 0) { ?> <tr onMouseOut="this.style.background='#E6E6E6'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#E6E6E6" height="20"> <td colspan="<?php echo $cols; ?> "> </td> <td align="center" class="naranja"><b><?php echo $qty; ?> </b></td> <td colspan="5"> </td> <td align="right" class="naranja"><b><?php echo "\$ " . number_format($cost, 2); ?> </b></td> <td colspan="9"> </td> </tr><?php } } ?> </tbody> </table><br><br><br> <?php }
public function cita_store(CitasRequest $request, $date) { $cita = new Cita($request->all()); $medico = Medico::find(\Auth::guard('doctors')->user()->doctor_id); $cita->fecha = fecha_ymd($request->fecha); $cita->capturado_por = 1; $cita->folio = getRandomeStr(4); $medico = Medico::find(\Auth::guard('doctors')->user()->doctor_id); $total_citas = Cita::getTotalCitasCount($medico->id, $cita->fecha); if ($total_citas) { Toastr::error('Error al asignar Cita, Agenda del dia: ' . fecha_dmy($cita->fecha) . ' llena'); return redirect()->route('hojas.index', ['date' => $request->date]); } else { $cita->save(); } //Flash::success('Cita registrada con exito!'); Toastr::success('Cita Agendada con exito'); return redirect()->route('hojas.index', ['date' => $request->date]); }
function listado($fechai, $fechaf, $proy_add, $proy_del, $buscar, $filtros, $reason, $pagina) { if (!$pagina) { $pagina = 1; } if ($proy_add != '') { $s_ = "insert into filtros values('','proyectos','{$proy_add}','{$_SESSION['IDEMP']}')"; $r_ = mysql_query($s_); } if ($proy_del != '') { if ($proy_del == 'del_all') { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}'"; $r_ = mysql_query($s_); } else { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}' and valor='{$proy_del}'"; $r_ = mysql_query($s_); } } $s_1 = "select count(*) as total from vw_reportes_" . $_SESSION["IDEMP"]; if (mysql_query($s_1)) { $r_1 = mysql_query($s_1); $d_1 = mysql_fetch_array($r_1); $total = $d_1['total']; } ?> <div align="center" class="aviso">Utilice los filtros para generar búsquedas. Al cambiar un filtro, haga clic en el botón Buscar para refrescar la información. El reporte muestra toda la información sobre folios cancelados.</div> <form action="?op=listado" method="post" name="form1"> <input type="hidden" name="pagina" value="<?php echo $pagina; ?> " /> <table align="center" class="tabla"> <tr height="20"> <td align="center" width="100" bgcolor="#E6E6E6">Incio Captura</td> <td align="center" width="100" bgcolor="#E6E6E6">Fin Captura</td> <td align="center" bgcolor="#E6E6E6">Agregue/quite proyectos</td> </tr> <tr> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechai', 'valor': '<?php echo $fechai; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechaf', 'valor': '<?php echo $fechaf; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <table align="center" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr><td align="center"> <?php $r_1 = mysql_query(get_proyectos_out($division)); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_add" class="texto" style="width:180px;" onchange="submit();"> <option value="">Sin filtro (<?php echo $n_1; ?> )</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['id']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center"> <?php $r_1 = mysql_query(get_proyectos_in()); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_del" class="texto" style="width:180px;" onchange="submit();"> <option value="">En filtro (<?php echo $n_1; ?> )</option> <option value="del_all" class="quitar">Quitar Todos</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['valor']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr></table></td> </tr> </table><br> <table align="center" class="tabla"> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['0']; ?> " name="buscar[0]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where c_cancelados='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[0]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[0] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['1']; ?> " name="buscar[1]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where c_cancelados='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[1]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[1] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['2']; ?> " name="buscar[2]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where c_cancelados='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[2]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[2] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> </table> <div align="center" class="texto"><br> <input type="button" value="Buscar" class="submit" onclick="validar('reporte');"> <input type="button" value="Exportar" class="submit" onclick="validar('excel');" <?php if ($total <= 0) { ?> disabled <?php } ?> > <input type="checkbox" name="reason" value="1" <?php if ($reason == 1) { ?> checked="checked"<?php } ?> > Mostrar Reason code </div><br></form> <table align="center" border="0" class="texto"> <tr> <td width="20" align="center"><img src="../imagenes/zoom.png" /></td> <td width="60" align="left">Ver Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/information.png" /></td> <td width="40" align="left">Historial</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/attach.png" /></td> <td width="50" align="left">Evidencias</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/ayuda.gif" /></td> <td width="40" align="left">Detalles</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_orange.gif" /></td> <td width="50" align="left">Pendiente</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_green.gif" /></td> <td width="50" align="left">Aprobado</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/flag_red.gif" /></td> <td width="50" align="left">Rechazado</td> </tr> </table><br> <?php $pags = ceil($total / 100); $ini_ = ($pagina - 1) * 100; $i = 1; $j = 0; $ruta = "&fechai={$fechai}&fechaf={$fechaf}&reason={$reason}&tipo={$tipo}&buscar[0]={$buscar['0']}&filtros[0]={$filtros['0']}"; $ruta .= "&buscar[1]={$buscar['1']}&filtros[1]={$filtros['1']}&buscar[2]={$buscar['2']}&filtros[2]={$filtros['2']}"; if ($total > 0) { ?> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="0"> <tr> <td width="110" align="center" bgcolor="#BDBDBD" class="link_paginas"><?php echo $total; ?> Registros</td> <td align="center" valign="top" bgcolor="#BDBDBD"> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="2"> <?php while ($i <= $pags) { if ($j >= 30) { echo "</tr>"; $j = 0; } if ($j == 0) { echo "<tr height='20'>"; } if ($pagina == $i) { $color = '#FFBF00'; } else { $color = '#F2F2F2'; } ?> <td width="30" align="center" bgcolor="<?php echo $color; ?> "> <a href="?op=listado<?php echo $ruta; ?> &pagina=<?php echo $i; ?> " class="link_paginas"><?php echo $i; ?> </a></td> <?php $i++; $j++; } ?> </table> </td> </tr> </table><br><?php } ?> <table align="center" class="tabla"> <thead> <tr bgcolor="#E6E6E6" height="20"> <td align="center" width="30" rowspan="2"><img src="../imagenes/zoom.png"></td> <td align="center" width="30" rowspan="2"><img src="../imagenes/information.png" /></td> <td align="center" width="30" rowspan="2"><img src="../imagenes/attach.png" /></td> <td align="center" width="50" rowspan="2">Folio</td> <td align="center" width="80" rowspan="2">Fecha</td> <td align="center" width="80" rowspan="2">Planta</td> <td align="center" width="80" rowspan="2">Division</td> <td align="center" width="80" rowspan="2">Proyecto</td> <td align="center" width="70" rowspan="2">P.C.</td> <?php if ($reason != 1) { ?> <td align="center" width="70" rowspan="2">Cod.Scrap</td><?php } ?> <?php if ($reason == 1) { ?> <td align="center" width="70" rowspan="2">Reason Code</td><?php } ?> <td align="center" width="90" rowspan="2" colspan="2">Cod. Causa Original</td> <td align="center" width="90" rowspan="2">Info.Obligatoria</td> <td align="center" width="60" rowspan="2">Cantidad</td> <td align="center" width="100" rowspan="2">Total</td> <td align="center" colspan="4">Estado Actual</td> </tr> <tr> <td width="40" align="center" bgcolor="#F3F781"> <span title='header=[ Pendientes] body=[Resúmen de firmas pendientes]'> <img src="../imagenes/flag_orange.gif" style="cursor: hand;"></span></td> <td width="40" align="center" bgcolor="#BEF781"> <span title='header=[ Aprobados] body=[Resúmen de firmas aprobadas]'> <img src="../imagenes/flag_green.gif" style="cursor: hand;"></span></td> <td width="40" align="center" bgcolor="#F78181"> <span title='header=[ Rechazados] body=[Resúmen de firmas rechazadas]'> <img src="../imagenes/flag_red.gif" style="cursor: hand;"></span></td> <td width="60" align="center" bgcolor="#CCCCCC"> <span title='header=[ Porcentaje] body=[Porcentaje de avance en el proceso de aprobación]'> <img src="../imagenes/flag_white.gif" style="cursor: hand;"></span></td> </tr> </thead> <tbody> <?php if ($total > 0) { $s_1 = "select * from vw_reportes_" . $_SESSION["IDEMP"] . " order by no_folio desc limit {$ini_},100"; $r_1 = mysql_query($s_1); while ($d_1 = mysql_fetch_array($r_1)) { $qty = $qty + $d_1['cantidad_total']; $cost = $cost + $d_1['costo_total']; ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <?php if ($_SESSION["IDEMP"] == $d_1['id_emp']) { ?> <?php if ($d_1['carga_masiva'] == '1') { ?> <a class="frame_editar_boleta" href="scrap_edicion_2.php?op=editar_1&folio=<?php echo $d_1['no_folio']; ?> &from=proceso"> <img src="../imagenes/pencil.gif" border="0" style="cursor:hand;"></a> <?php } else { ?> <a class="frame_editar_boleta" href="scrap_edicion_1.php?op=editar_1&folio=<?php echo $d_1['no_folio']; ?> &from=proceso"> <img src="../imagenes/pencil.gif" border="0" style="cursor:hand;"></a><?php } ?> <?php } else { ?> <a class="frame_ver_boleta" href="../detalles.php?op=ver_boleta&folio=<?php echo $d_1['no_folio']; ?> "> <img src="../imagenes/zoom.png" border="0"></a><?php } ?> </td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=historial&folio=<?php echo $d_1['no_folio']; ?> "> <img src="../imagenes/information.png" border="0"></a></td> <td align="center"> <?php $s_c = "select * from configuracion where variable='ruta_evidencias'"; $r_c = mysql_query($s_c); $d_c = mysql_fetch_array($r_c); $ruta = $d_c['valor'] . $d_1['archivo']; if ($d_1['archivo'] != '') { ?> <a href="<?php echo $ruta; ?> " target="_blank"> <img src="../imagenes/attach.png" border="0"></a><?php } ?> </td> <td align="center"><?php echo $d_1['no_folio']; ?> </td> <td align="center"><?php echo fecha_dmy($d_1['fecha']); ?> </td> <td align="left"> <?php echo $d_1['planta']; ?> </td> <td align="left"> <?php echo $d_1['division']; ?> </td> <td align="left"> <?php echo $d_1['proyecto']; ?> </td> <td align="center"><?php echo $d_1['profit_center']; ?> </td> <?php if ($reason != 1) { ?> <td align="center"><?php echo $d_1['codigo_scrap']; ?> </td><?php } ?> <?php if ($reason == 1) { ?> <td align="center"><?php echo $d_1['reason_code']; ?> </td><?php } ?> <td align="center" width="70"> <?php $original = data_codigo_original($d_1['no_folio'], $d_1['financiero']); echo $original['codigo']; ?> </td> <td align="center" width="20"> <?php if ($d_1['financiero'] == '1') { ?> <span title='header=[ Código de Causa Original] body=[<?php echo detalles_codigo_original($d_1['no_folio']); ?> ]'> <img src="../imagenes/ayuda.gif" style="cursor: hand;"></span><?php } ?> </td> <td align="center"><?php if ($d_1['info_1'] != 'NA') { echo $d_1['info_1'] . "-" . $d_1['info_2']; } else { echo "NA"; } ?> </td> <td align="center"><?php echo $d_1['cantidad_total']; ?> </td> <td align="right"><?php echo "\$ " . number_format($d_1['costo_total'], 2); ?> </td> <?php $datos = get_status_folio($d_1['no_folio']); ?> <td width="40" align="center" bgcolor="#F3F781"><?php echo $datos['p']; ?> </td> <td width="40" align="center" bgcolor="#BEF781"><?php echo $datos['a']; ?> </td> <td width="40" align="center" bgcolor="#F78181"><?php echo $datos['r']; ?> </td> <?php $porcentaje = $datos['a'] * 100 / $datos['t']; ?> <td width="60" align="center" bgcolor="#CCCCCC"><?php echo number_format($porcentaje, 2) . '%'; ?> </td> </tr> <?php } if ($qty > 0) { ?> <tr onMouseOut="this.style.background='#E6E6E6'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#E6E6E6" height="20"> <td colspan="13" align="right" class="naranja"> </td> <td align="center" class="naranja"><b><?php echo $qty; ?> </b></td> <td align="right" class="naranja"><b><?php echo "\$ " . number_format($cost, 2); ?> </b> </td> <td colspan="4"> </td> </tr><?php } } ?> </tbody> </table> <?php }
<div class="col-md-8"> <div class="panel-group"> <div class="panel panel-primary"> <div class="panel-heading"> <div align="center"> <?php $permiso_act = 0; if (isset($permiso->fecha_inicio) && isset($permiso->fecha_final)) { $date2 = strtotime($date); $f_inicio = strtotime($permiso->fecha_inicio); $f_final = strtotime($permiso->fecha_final); if ($date2 >= $f_inicio && $date2 <= $f_final) { $permiso_act = 1; echo "<b><span style='color: red'>El medico esta de Permiso hasta el " . fecha_dmy($permiso->fecha_final) . "</span></b>"; } } ?> @if($citas->count() < 10 && $permiso_act != 1) <a data-url="{{ route('medico.nueva_cita', [$medico->slug , $date]) }}" class="load-form-modal fa fa-pencil fa-2x panelColor" data-toggle ="modal" data-target='#form-modal'></a> <h3> Hay <span class="badge">{{ $citas->count() }}</span> Citas del dia: {{ fecha_dmy($date) }}</h3> @else <h3> Hay <span class="badge">{{ $citas->count() }}</span> Citas del dia: {{ fecha_dmy($date) }}</h3> <br> @if($citas->count() >= 10) <b><span class="blink">No se pueden programar mas Citas para esta fecha.</span></b> @endif @endif </div>
function listado($buscar, $filtros, $pagina) { if (!$pagina) { $pagina = 1; } $s_ = "select valor from configuracion where variable='dias_atraso'"; $r_ = mysql_query($s_); $d_ = mysql_fetch_array($r_); $limite = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - $d_['valor'], date("Y"))); $s_f = "select folios.*, sum(partes.cantidad) as cantidad_total, sum(partes.total) as costo_total from scrap_partes as partes, scrap_folios as folios, "; $s_f .= "autorizaciones where folios.no_folio = partes.no_folio and autorizaciones.no_folio = folios.no_folio and folios.status='0' "; $s_f .= "and folios.activo='1' and folios.fecha<='{$limite}' "; for ($i = 0; $i <= 2; $i++) { if ($buscar[$i] != '' && $filtros[$i] != '') { $s_f .= " and ( "; $data = split(",", $buscar[$i]); for ($j = 0; $j < count($data); $j++) { $s_f .= get_operador($filtros[$i], $data[$j]) . " or "; } $s_f = substr($s_f, 0, -3) . " ) "; } } if ($_SESSION["TYPE"] != 'administrador') { $s_ = "select * from divisiones where jefe='{$_SESSION['IDEMP']}'"; $r_ = mysql_query($s_); if (mysql_num_rows($r_) > 0) { $s_f .= "and ("; while ($d_ = mysql_fetch_array($r_)) { $s_f .= "id_division = '{$d_['id']}' or "; } $s_f = substr($s_f, 0, -3) . " ) "; } $s_ = "select * from plantas where jefe='{$_SESSION['IDEMP']}'"; $r_ = mysql_query($s_); if (mysql_num_rows($r_) > 0) { $s_f .= "and ("; while ($d_ = mysql_fetch_array($r_)) { $s_f .= "id_planta = '{$d_['id']}' or "; } $s_f = substr($s_f, 0, -3) . " ) "; } } $s_f .= " group by folios.no_folio order by folios.no_folio asc "; $r_1 = mysql_query($s_f); $tot = mysql_num_rows($r_1); ?> <div align="center" class="aviso">Utilice los filtros para generar búsquedas. Al cambiar un filtro, haga clic en el botón Buscar para refrescar la información. El reporte muestra toda la información sobre folios pendientes de autorizar.</div> <form action="?op=listado" method="post" name="form1"> <input type="hidden" name="pagina" value="<?php echo $pagina; ?> " /> <table align="center" class="tabla"> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['0']; ?> " name="buscar[0]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where atrasos='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[0]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[0] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['1']; ?> " name="buscar[1]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where atrasos='1 order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[1]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[1] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['2']; ?> " name="buscar[2]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where atrasos='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[2]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[2] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> </table> <div align="center" class="texto"><br> <input type="button" value="Buscar" class="submit" onclick="validar('reporte');"> <input type="button" value="Exportar" class="submit" onclick="exportar();"> </div></form> <table align="center" border="0" class="texto"> <tr> <td width="20" align="center"><img src="../imagenes/zoom.png" /></td> <td width="60" align="left">Ver Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/information.png" /></td> <td width="40" align="left">Historial</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/ayuda.gif" /></td> <td width="40" align="left">Detalles</td> </tr> </table><br> <?php $pags = ceil($tot / 100); $ini_ = ($pagina - 1) * 100; $i = 1; $j = 0; $ruta = "&fechai={$fechai}&fechaf={$fechaf}&buscar[0]={$buscar['0']}&filtros[0]={$filtros['0']}"; $ruta .= "&buscar[1]={$buscar['1']}&filtros[1]={$filtros['1']}&buscar[2]={$buscar['2']}&filtros[2]={$filtros['2']}"; if ($tot > 0) { ?> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="0"> <tr> <td width="110" align="center" bgcolor="#BDBDBD" class="link_paginas"><?php echo $tot; ?> Registros</td> <td align="center" valign="top" bgcolor="#BDBDBD"> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="2"> <?php while ($i <= $pags) { if ($j >= 30) { echo "</tr>"; $j = 0; } if ($j == 0) { echo "<tr height='20'>"; } if ($pagina == $i) { $color = '#FFBF00'; } else { $color = '#F2F2F2'; } ?> <td width="30" align="center" bgcolor="<?php echo $color; ?> "> <a href="?op=listado<?php echo $ruta; ?> &pagina=<?php echo $i; ?> " class="link_paginas"><?php echo $i; ?> </a></td> <?php $i++; $j++; } ?> </table> </td> </tr> </table><br><?php } ?> <table align="center" class="tabla"> <thead> <tr bgcolor="#E6E6E6" height="20"> <td align="center" width="25"><img src="../imagenes/zoom.png" /></td> <td align="center" width="25"><img src="../imagenes/information.png" /></td> <td align="center" width="30">No.</td> <td align="center" width="60">Folio</td> <td align="center" width="90">Fecha</td> <td align="center" width="90">Cod.Scrap</td> <td align="center" width="90">Reason Code</td> <td align="center" width="90" colspan="2">Cod. Causa Original</td> <td align="center" width="60">Qty</td> <td align="center" width="80">Total</td> <td align="center" width="250">Números de Parte</td> <td align="center" width="50">APD</td> <td align="center" width="100">Capturista</td> <td align="center" width="30">LO</td> <td align="center" width="30">LO-A</td> <td align="center" width="30">LPL</td> <td align="center" width="30">FFM</td> <td align="center" width="30">FFc</td> <td align="center" width="30">Prod</td> <td align="center" width="30">SQM</td> <td align="center" width="30">Finanzas</td> <td align="center" width="30">ESP</td> <td align="center" width="30">Inv</td> </tr> </thead> <tbody> <?php $i = $ini_ + 1; $qty = $cost = 0; $s_f .= " limit {$ini_},100"; $r_1 = mysql_query($s_f); while ($d_1 = mysql_fetch_array($r_1)) { $qty = $qty + $d_1['cantidad_total']; $cost = $cost + $d_1['costo_total']; ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=ver_boleta&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/zoom.png" border="0"></a></td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=historial&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/information.png" border="0"></a></td> <td align="center"><?php echo $i; ?> </td> <td align="center"><?php echo $d_1['no_folio']; ?> </td> <td align="center"><?php echo fecha_dmy($d_1['fecha']); ?> </td> <td align="center"><?php echo $d_1['codigo_scrap']; ?> </td> <td align="center"><?php echo $d_1['reason_code']; ?> </td> <td align="center" width="70"> <?php $original = data_codigo_original($d_1['no_folio'], $d_1['financiero']); echo $original['codigo']; ?> </td> <td align="center" width="20"> <?php if ($d_1['financiero'] == '1') { ?> <span title='header=[ Código de Causa Original] body=[<?php echo detalles_codigo_original($d_1['no_folio']); ?> ]'> <img src="../imagenes/ayuda.gif" style="cursor: hand;"></span><?php } ?> </td> <td align="center"><?php echo $d_1['cantidad_total']; ?> </td> <td align="right"><?php echo "\$ " . number_format($d_1['costo_total'], 2); ?> </td> <td align="center"> <?php if ($d_1['carga_masiva'] == '0') { echo "<table align='center' border='0' cellpadding='0' cellspacing='2' style='border:#CCCCCC solid 1px;' width='250'>"; $s_2 = "select * from scrap_partes where no_folio='{$d_1['no_folio']}' order by no_parte"; $r_2 = mysql_query($s_2); while ($d_2 = mysql_fetch_array($r_2)) { echo "<tr bgcolor='#EEEEEE'>"; echo "<td align='left' width='100'> {$d_2['no_parte']}</td>"; echo "<td align='left' width='150'> {$d_2['descripcion']}</td>"; echo "</tr>"; } echo "</table>"; } if ($d_1['carga_masiva'] == '1') { echo "<a href='../excel_reportes.php?op=ver_modelos&folio={$d_1['no_folio']}' class='menuLink'>"; echo "Archivo de modelos<br>(carga masiva)</a>"; } ?> </td> <td align="center"><?php echo $d_1['apd']; ?> </td> <td align="center"><?php echo $d_1['empleado']; ?> </td> <td align="center"><?php echo get_bandera("lo", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("loa", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("lpl", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffc", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("prod", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("sqm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("fin", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("esp", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("inv", $d_1['no_folio']); ?> </td> </tr> <?php $i++; } ?> <tr bgcolor="#E6E6E6"> <td colspan="9" align="right" class="naranja"><b>Totales</b> </td> <td align="center" class="naranja"><b><?php echo $qty; ?> </b></td> <td align="right" class="naranja"><b><?php echo "\$ " . number_format($cost, 2); ?> </b> </td> <td colspan="14"> </td> </tr> </tbody> </table><br> <?php }
function listado($fechai, $fechaf, $proy_add, $proy_del, $buscar, $filtros, $tipo, $reason, $pagina) { if (!$tipo) { $tipo = 'todos'; } if (!$pagina) { $pagina = 1; } if (count($proy_add) > 0) { for ($i = 0; $i < count($proy_add); $i++) { if ($proy_add[$i] != '' && $proy_add[$i] != '0') { $s_ = "insert into filtros values('','proyectos','{$proy_add[$i]}','{$_SESSION['IDEMP']}')"; $r_ = mysql_query($s_); } } } if (count($proy_del) > 0) { for ($i = 0; $i < count($proy_del); $i++) { if ($proy_del[$i] != '' && $proy_del[$i] != '0') { $s_ = "delete from filtros where filtro='proyectos' and id_emp='{$_SESSION['IDEMP']}' and valor='{$proy_del[$i]}'"; $r_ = mysql_query($s_); } } } ?> <div align="center" class="aviso">Utilice los filtros para generar búsquedas. Al cambiar un filtro, haga clic en el botón Buscar para refrescar la información. El reporte muestra toda la información sobre folios pendientes de autorizar.</div> <form action="?op=listado" method="post" name="form1"> <input type="hidden" name="pagina" value="<?php echo $pagina; ?> " /> <table align="center" class="tabla"> <tr height="20"> <td align="center" width="100" bgcolor="#E6E6E6">Inicio Captura</td> <td align="center" width="100" bgcolor="#E6E6E6">Fin Captura</td> <td align="center" bgcolor="#E6E6E6">Agregue/quite proyectos</td> <?php if ($_SESSION["DEPTO"] == 'inv') { ?> <td align="center" bgcolor="#E6E6E6">Tipo</td><?php } ?> </tr> <tr> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechai', 'valor': '<?php echo $fechai; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <script language="JavaScript"> var GC_SET_0 = { 'appearance': GC_APPEARANCE, 'dataArea': 'fechaf', 'valor': '<?php echo $fechaf; ?> ' } new gCalendar(GC_SET_0); </script> </td> <td align="center"> <table align="center" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr><td align="left"> <?php $r_1 = mysql_query(get_proyectos_out()); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_add[]" multiple="multiple" class="texto" id="proy_add_"> <option value="">Seleccionar Todos</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['id']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> <td align="center"><input type="button" value="<< >>" onclick="submit()" style="width:50px;" class="submit"></td> <td align="left"> <?php $r_1 = mysql_query(get_proyectos_in()); $n_1 = mysql_num_rows($r_1); ?> <select name="proy_del[]" multiple="multiple" class="texto" id="proy_del_"> <option value="">Seleccionar Todos</option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['valor']; ?> "><?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr></table></td> <?php if ($_SESSION["DEPTO"] == 'inv') { ?> <td align="center"> <select name="tipo" class="texto" style="width:120px;"> <option value="todos" <?php if ($tipo == 'todos') { ?> selected="selected"<?php } ?> >Todos</option> <option value="aprobados" <?php if ($tipo == 'aprobados') { ?> selected="selected"<?php } ?> >Aprobados</option> <option value="cancelados" <?php if ($tipo == 'cancelados') { ?> selected="selected"<?php } ?> >Cancelados</option> <option value="pendientes" <?php if ($tipo == 'pendientes') { ?> selected="selected"<?php } ?> >Pendientes</option> <option value="rechazados" <?php if ($tipo == 'rechazados') { ?> selected="selected"<?php } ?> >Rechazados</option> </select></td><?php } ?> </tr> </table><br> <table align="center" class="tabla"> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['0']; ?> " name="buscar[0]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where scrap_firmar='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[0]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[0] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['1']; ?> " name="buscar[1]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where scrap_firmar='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[1]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[1] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> <tr height="20"> <td align="left" width="62"> Buscar:</td> <td> <input type="text" class="texto" size="75" value="<?php echo $buscar['2']; ?> " name="buscar[2]" id="buscar"> </td> <td align="center">En:</td> <td><?php $s_1 = "select campo, nombre from encabezados where scrap_firmar='1' order by nombre"; $r_1 = mysql_query($s_1); ?> <select name="filtros[2]" class="texto" style="width:150px;" id="filtros"> <option value=""></option> <?php while ($d_1 = mysql_fetch_array($r_1)) { ?> <option value="<?php echo $d_1['campo']; ?> " <?php if ($filtros[2] == $d_1['campo']) { ?> selected="selected"<?php } ?> > <?php echo $d_1['nombre']; ?> </option><?php } ?> </select></td> </tr> </table> <div align="center" class="texto"><br> <input type="button" value="Buscar" class="submit" onclick="validar('reporte');"> <input type="button" value="Exportar" class="submit" onclick="validar('excel');"> <input type="checkbox" name="reason" value="1" <?php if ($reason == 1) { ?> checked="checked"<?php } ?> > Mostrar Reason code </div><br> <table align="center" border="0" class="texto"> <tr> <td width="20" align="center"><img src="../imagenes/zoom.png" /></td> <td width="60" align="left">Ver Boleta</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/information.png" /></td> <td width="40" align="left">Historial</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/attach.png" /></td> <td width="50" align="left">Evidencias</td> <td width="20" align="center">|</td> <td width="20" align="center"><img src="../imagenes/ayuda.gif" /></td> <td width="40" align="left">Detalles</td> </tr> </table><br> <?php //Reviso que realmente tenga asignada una división, profit_center, área o proyecto $s_p = "select * from autorizadores where id_emp='{$_SESSION['IDEMP']}'"; $r_p = mysql_query($s_p); if (mysql_num_rows($r_p) > 0) { //CONSULTA GLOBAL $s_f = "select folios.*, sum(partes.cantidad) as cantidad_total, sum(partes.total) as costo_total from scrap_partes as partes, "; $s_f .= "scrap_folios as folios, autorizaciones, numeros_parte where folios.no_folio = partes.no_folio and autorizaciones.no_folio = "; $s_f .= "folios.no_folio and partes.no_parte = numeros_parte.nombre "; if ($_SESSION["DEPTO"] != 'esp') { $s_f .= " and autorizaciones.depto='{$_SESSION['DEPTO']}' "; } else { $s_f .= " and (autorizaciones.depto='esp_1' or autorizaciones.depto='esp_2') "; } switch ($tipo) { case "todos": if ($_SESSION["DEPTO"] == 'inv') { $s_f .= " and (folios.status='0' or folios.status='2') and folios.activo='1' and "; $s_f .= "autorizaciones.status='0' "; } if ($_SESSION["DEPTO"] != 'inv') { $s_f .= " and folios.status='0' and folios.activo='1' and autorizaciones.status='0' "; } break; case "aprobados": $s_f .= " and not exists (select no_folio from autorizaciones where status!='1' and folios.no_folio="; $s_f .= "autorizaciones.no_folio and autorizaciones.depto!='inv') and "; $s_f .= "folios.status='0' and folios.activo='1' and autorizaciones.status='0' "; break; case "cancelados": $s_f .= " and (folios.status='0' or folios.status='2') and folios.activo='2' "; case "rechazados": $s_f .= " and folios.status='2' and folios.activo='1' "; break; case "pendientes": $s_f .= " and folios.status='0' and folios.activo='1' and autorizaciones.status='0' "; break; } for ($i = 0; $i <= 2; $i++) { if ($buscar[$i] != '' && $filtros[$i] != '') { $s_f .= " and ( "; $data = split(",", $buscar[$i]); for ($j = 0; $j < count($data); $j++) { if ($filtros[$i] == "global_pc") { $s_f .= get_operador($filtros[$i], $data[$j]) . " or "; } $s_f .= get_operador($filtros[$i], $data[$j]) . " or "; } $s_f = substr($s_f, 0, -3) . " ) "; } } if ($fechai != '' && $fechaf != '') { $s_f .= "and (fecha>='{$fechai}' and fecha<='{$fechaf}') "; } $s_f .= filtros_autorizador(); $s_f .= " group by no_folio order by no_folio DESC"; $r_1 = mysql_query($s_f); $d_1 = mysql_fetch_array($r_1); $tot = mysql_num_rows($r_1); $pags = ceil($tot / 100); $ini_ = ($pagina - 1) * 100; $i = 1; $j = 0; $ruta = "&fechai={$fechai}&fechaf={$fechaf}&reason={$reason}&tipo={$tipo}&buscar[0]={$buscar['0']}&filtros[0]={$filtros['0']}"; $ruta .= "&buscar[1]={$buscar['1']}&filtros[1]={$filtros['1']}&buscar[2]={$buscar['2']}&filtros[2]={$filtros['2']}"; if ($tot > 0) { ?> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="0"> <tr> <td width="110" align="center" bgcolor="#BDBDBD" class="link_paginas"><?php echo $tot; ?> Registros</td> <td align="center" valign="top" bgcolor="#BDBDBD"> <table align="center" border="0" class="texto" cellpadding="0" cellspacing="2"> <?php while ($i <= $pags) { if ($j >= 30) { echo "</tr>"; $j = 0; } if ($j == 0) { echo "<tr height='20'>"; } if ($pagina == $i) { $color = '#FFBF00'; } else { $color = '#F2F2F2'; } ?> <td width="30" align="center" bgcolor="<?php echo $color; ?> "> <a href="?op=listado<?php echo $ruta; ?> &pagina=<?php echo $i; ?> " class="link_paginas"><?php echo $i; ?> </a></td> <?php $i++; $j++; } ?> </table> </td> </tr> </table><br><?php } ?> <?php if ($_SESSION["DEPTO"] == 'inv') { //Mostrar la hora y detalles de la última autorización existente de cualquier perfil $s_b = "select aut_bitacora.*, general.* from aut_bitacora, autorizaciones, (" . $s_f . ") as general where general.no_folio = aut_bitacora.no_folio and "; $s_b .= "autorizaciones.no_folio = general.no_folio and general.status='0' and autorizaciones.status='0' and aut_bitacora.status='1' order by aut_bitacora.fecha "; $s_b .= "desc, aut_bitacora.hora desc"; $r_b = mysql_query($s_b); $d_b = mysql_fetch_array($r_b); ?> <table align="center" class="tabla"> <tr> <td align="center" bgcolor="#CCCCCC" width="100"><b>Folio</b></td> <td align="center" bgcolor="#CCCCCC" width="100"><b>Fecha</b></td> <td align="center" bgcolor="#CCCCCC" width="100"><b>Hora</b></td> <td align="center" bgcolor="#CCCCCC" width="100"><b>Perfil</b></td> <td align="center" bgcolor="#CCCCCC" width="250"><b>Empleado</b></td> <td align="center" bgcolor="#CCCCCC" width="120" rowspan="2"><input type="button" value="Descargar Reporte" class="submit" onclick="descargar();"></td> </tr> <tr> <td align="center"><?php echo $d_b['no_folio']; ?> </td> <td align="center"><?php echo $d_b['fecha']; ?> </td> <td align="center"><?php echo $d_b['hora']; ?> </td> <td align="center"><?php switch ($d_b["depto"]) { case "lo": echo "LO"; break; case "loa": echo "LO-Almacén"; break; case "lpl": echo "LPL"; break; case "ffm": echo "FFM"; break; case "ffc": echo "FFC"; break; case "prod": echo "Producción"; break; case "sqm": echo "SQM"; break; case "fin": echo "Finanzas"; break; case "esp": echo "ESP"; break; case "oes": echo "OES"; break; } ?> </td> <td align="left"> <?php echo $d_b['empleado']; ?> </td> </tr> </table><br> <?php } ?> <table align="center" class="tabla"> <thead> <tr bgcolor="#E6E6E6" height="20"> <td align="center" width="25"> <input type="checkbox" name="todos" id="todos" value="1" <?php if ($todos == '1') { ?> checked="checked" <?php } ?> onclick="select_all('<?php echo $tot; ?> ');"></td> <td align="center" width="25"><img src="../imagenes/zoom.png" /></td> <td align="center" width="25"><img src="../imagenes/information.png" /></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { ?> <td align="center" width="25"><img src="../imagenes/attach.png" /></td><?php } ?> <td align="center" width="60">Folio</td> <td align="center" width="90">Fecha</td> <?php if ($reason != 1) { ?> <td align="center" width="90">Cod.Scrap</td><?php } ?> <?php if ($reason == 1) { ?> <td align="center" width="90">Reason Code</td><?php } ?> <td align="center" width="90" colspan="2">Cod. Causa Original</td> <td align="center" width="100">Info.Obligatoria</td> <td align="center" width="60">Qty</td> <td align="center" width="80">Total</td> <td align="center" width="250">Números de Parte</td> <td align="center" width="50">APD</td> <td align="center" width="100">Proyecto</td> <td align="center" width="100">Capturista</td> <?php switch ($_SESSION["DEPTO"]) { case "lo": echo "<td align='center' colspan=2>LO</td>"; break; case "loa": echo "<td align='center' colspan=2>LO-Almacén</td>"; break; case "lpl": echo "<td align='center' colspan=2>LPL</td>"; break; case "ffm": echo "<td align='center' colspan=2>FFM</td>"; break; case "ffc": echo "<td align='center' colspan=2>FFC</td>"; break; case "prod": echo "<td align='center' colspan=2>Producción</td>"; break; case "sqm": echo "<td align='center' colspan=2>SQM</td>"; break; case "fin": echo "<td align='center' colspan=2>Finanzas</td>"; break; case "esp": echo "<td align='center' colspan=2>ESP</td>"; break; case "oes": echo "<td align='center' colspan=2>OES</td>"; break; case "inv": echo "<td width='30' align='center'>LO</td>"; echo "<td width='30' align='center'>LO-A</td>"; echo "<td width='30' align='center'>LPL</td>"; echo "<td width='30' align='center'>FFM</td>"; echo "<td width='30' align='center'>FFC</td>"; echo "<td width='30' align='center'>Prod</td>"; echo "<td width='30' align='center'>SQM</td>"; echo "<td width='30' align='center'>Finanzas</td>"; echo "<td width='30' align='center'>ESP</td>"; echo "<td width='30' align='center'>OES</td>"; echo "<td width='30' align='center'>Inv</td>"; echo "<td align='center' colspan='3'>Acciones</td>"; break; } ?> </tr> </thead> <tbody> <?php $qty = $cost = 0; $s_f .= " limit {$ini_}, 100"; $r_1 = mysql_query($s_f); $n_1 = mysql_num_rows($r_1); while ($d_1 = mysql_fetch_array($r_1)) { $qty = $qty + $d_1['cantidad_total']; $cost = $cost + $d_1['costo_total']; $dis = firma_inventarios($d_1['no_folio']); ?> <tr onMouseOut="this.style.background='#F7F7F7'" onMouseOver="this.style.background='#FFDD99'" bgcolor="#F7F7F7" height="20"> <td align="center"> <input type="checkbox" name="varios[]" id="varios" value="<?php echo $d_1['no_folio']; ?> " <?php echo firma_inventarios($d_1['no_folio']); ?> ></td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=ver_boleta&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/zoom.png" border="0"></a></td> <td align="center"> <a class="frame_ver_boleta" href="../detalles.php?op=historial&folio=<?php echo $d_1['no_folio']; ?> &buscar=no"> <img src="../imagenes/information.png" border="0"></a></td> <?php if ($_SESSION["DEPTO"] == 'lo' || $_SESSION["DEPTO"] == 'loa') { $cols = 10; ?> <td align="center"> <?php $s_c = "select * from configuracion where variable='ruta_evidencias'"; $r_c = mysql_query($s_c); $d_c = mysql_fetch_array($r_c); $ruta = $d_c['valor'] . $d_1['archivo']; if ($d_1['archivo'] != '') { ?> <a href="<?php echo $ruta; ?> " target="_blank"> <img src="../imagenes/attach.png" border="0"></a><?php } ?> </td><?php } else { $cols = 9; } ?> <td align="center"><?php echo $d_1['no_folio']; ?> </td> <td align="center"><?php echo fecha_dmy($d_1['fecha']); ?> </td> <?php if ($reason != 1) { ?> <td align="center"><?php echo $d_1['codigo_scrap']; ?> </td><?php } ?> <?php if ($reason == 1) { ?> <td align="center"><?php echo $d_1['reason_code']; ?> </td><?php } ?> <td align="center" width="70"> <?php $original = data_codigo_original($d_1['no_folio'], $d_1['financiero']); echo $original['codigo']; ?> </td> <td align="center" width="20"> <?php if ($d_1['financiero'] == '1') { ?> <span title='header=[ Código de Causa Original] body=[<?php echo detalles_codigo_original($d_1['no_folio']); ?> ]'> <img src="../imagenes/ayuda.gif" style="cursor: hand;"></span><?php } ?> </td> <td align="center"><?php if ($d_1['info_1'] != 'NA' && $d_1['info_1'] != '') { echo $d_1['info_1'] . "-" . $d_1['info_2']; } else { echo "NA"; } ?> </td> <td align="center"><?php echo $d_1['cantidad_total']; ?> </td> <td align="right"><?php echo "\$ " . number_format($d_1['costo_total'], 2); ?> </td> <td align="center"> <?php if ($d_1['carga_masiva'] == '0') { echo "<table align='center' border='0' cellpadding='0' cellspacing='2' style='border:#CCCCCC solid 1px;' width='250'>"; $s_2 = "select * from scrap_partes where no_folio='{$d_1['no_folio']}' order by no_parte"; $r_2 = mysql_query($s_2); while ($d_2 = mysql_fetch_array($r_2)) { echo "<tr bgcolor='#EEEEEE'>"; echo "<td align='left' width='100'> {$d_2['no_parte']}</td>"; echo "<td align='left' width='150'> {$d_2['descripcion']}</td>"; echo "</tr>"; } echo "</table>"; } if ($d_1['carga_masiva'] == '1') { echo "<a href='../excel_reportes.php?op=ver_modelos&folio={$d_1['no_folio']}' class='menuLink'>"; echo "Archivo de modelos<br>(carga masiva)</a>"; } ?> </td> <td align="center"><?php echo $d_1['apd']; ?> </td> <td align="left"> <?php echo $d_1['proyecto']; ?> </td> <td align="center"><?php echo $d_1['empleado']; ?> </td> <?php if ($_SESSION["DEPTO"] == 'inv') { ?> <td align="center"><?php echo get_bandera("lo", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("loa", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("lpl", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("ffc", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("prod", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("sqm", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("fin", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("esp", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("oes", $d_1['no_folio']); ?> </td> <td align="center"><?php echo get_bandera("inv", $d_1['no_folio']); ?> </td> <td align="center"> <input type="button" class="submit_small" value="Aprobar" name="app" onclick="aprobar('<?php echo $d_1['no_folio']; ?> ');" <?php echo $dis; ?> ></td> <td align="center"> <input type="button" class="submit_small" value="Rechazar" name="rech" onclick="rechazar('<?php echo $d_1['no_folio']; ?> ');"> </td> <td align="center"> <input type="button" class="submit_small" value="Cancelar" name="canc" onclick="cancelar('<?php echo $d_1['no_folio']; ?> ');"> </td> <?php } else { ?> <td align="center" width="60"> <input type="button" class="submit_small" value="Aprobar" name="app" onclick="aprobar('<?php echo $d_1['no_folio']; ?> ');"></td> <td align="center" width="60"> <input type="button" class="submit_small" value="Rechazar" name="rech" onclick="rechazar('<?php echo $d_1['no_folio']; ?> ');"></td> </tr> <?php } } ?> <tr bgcolor="#E6E6E6"> <td colspan="<?php echo $cols; ?> " align="right" class="naranja"><b>Totales</b> </td> <td align="center" class="naranja"><b><?php echo $qty; ?> </b></td> <td align="right" class="naranja"><b><?php echo "\$ " . number_format($cost, 2); ?> </b> </td> <td colspan="18"> </td> </tr> </tbody> </table><br> <div align="center"> <input type="button" name="aprobar_todos" class="submit_big" value="Aprobar Seleccionados" onclick="app_sel();"> <input type="button" name="rechazar_todos" class="submit_big" value="Rechazar Seleccionados" onclick="rech_sel();"> </div><br><br></form> <?php } else { echo "<div align='center' class='naranja'><b>Usted no tiene división, área, profit center o proyectos asignados como autorizador.<br>"; echo "Contacte al administrador del sistema para que le asigne dichos filtros para ver las boletas correspondientes.<b></div>"; } }