function print_layout($error = array()) { global $_submenu, $print_auth, $db, $user, $config, $screen; page_header(); $page_e = explode('/', requested_url()); $folder = array_splice($page_e, 1, 1); $folder = !empty($screen) ? $screen : $folder[0]; $_buildmenu = array(); foreach ($_submenu as $k => $v) { if (!$print_auth[$k]) { continue; } $_buildmenu[] = $k == $folder ? '<strong class="gray">' . $v . '</strong>' : '<a href="' . s_link('print', $k) . '">' . $v . '</a>'; } ?> <div class="vsep-pre"><div class="vsep1"> </div></div> <div class="subtitle-link-container"><div><?php echo implode(' <span class="soft">|</span> ', $_buildmenu); ?> </div></div> <?php // Show requested screen $call_func = 's_print_' . $screen; if (function_exists($call_func)) { ?> <div class="vsep-pre"><div class="vsep1"> </div></div> <form action="<?php echo s_link('print'); ?> " method="post"> <div class="colorbox darkborder pad10"> <div align="center" class="h2"><?php echo $_submenu[$screen]; ?> </div> <div class="ie-widthfix"> <?php show_error($error); ?> <br /> <table cellpadding="5" cellspacing="0" border="1" bordercolor="#999999" class="table-collapse" align="center"> <?php $call_func(); ?> </table> <div align="center"> <?php echo s_hidden(array('screen' => $screen)); ?> <br /> <input type="submit" class="submitdata" name="submit" value="Realizar consulta" /> </div> </div> </div> </form> <?php } page_footer(); }
function page_header() { global $user, $config; if (strstr($user->browser, 'compatible') || strstr($user->browser, 'Gecko')) { ob_start('ob_gzhandler'); } // Headers header('Cache-Control: private, no-cache="set-cookie", pre-check=0, post-check=0'); header('Expires: 0'); header('Pragma: no-cache'); $_menu = array('search' => 'Consulta', 'insert' => 'Ingreso', 'edit' => 'Modificación', 'null' => 'Anulación', 'print' => 'Impresión', 'log' => 'Registro de cambios', 'users|ranks' => 'Administrar usuarios'); $page_e = explode('/', requested_url()); $folder = array_splice($page_e, 0, 1); $folder = $folder[0]; print_header(); ?> <div><a class="bold" href="<?php echo s_link('cover'); ?> ">Menú Principal</a> <span class="soft">|</span> <a class="red bold" href="<?php echo s_link('logout'); ?> ">Salir del sistema</a></div><br /> <div> <?php $title = ''; $_buildmenu = array(); foreach ($_menu as $k => $v) { $item_auth = false; if (strpos($k, '|')) { foreach (explode('|', $k) as $item_a) { if ($user->auth['auth_' . $item_a] || $user->data['user_adm']) { $item_auth = true; $k = $item_a; break; } } } else { $item_auth = $user->auth['auth_' . $k]; } if (!$item_auth && !$user->data['user_adm']) { continue; } $is_pane = $k == $folder; if ($is_pane) { $title = $v; } $_buildmenu[] = ($is_pane ? '<strong class="gray">' : '') . '<a href="' . s_link($k) . '">' . $v . '</a>' . ($is_pane ? '</strong>' : ''); } if (sizeof($_buildmenu)) { echo '<div class="hr"> </div><br />'; echo implode(' <span class="soft">|</span> ', $_buildmenu); if ($title != '') { ?> <br /><br /><div class="hr"> </div> <div class="subtitle h3 ie-widthfix"><?php echo $title; ?> </div> <?php } } else { echo 'Usted no está autorizado para realizar operaciones, contacte al administrador del sistema.'; } ?> </div> <?php }
if ($screen == 'c' || $cwe) { $redt[] = $exencion; } redirect($redt); break; default: redirect(array('insert', 'c')); break; } } } // // Display forms // page_header(); $page_e = explode('/', requested_url()); $folder = array_splice($page_e, 1, 1); $folder = !empty($screen) ? $screen : $folder[0]; $_buildmenu = array(); foreach ($_submenu as $k => $v) { $_buildmenu[] = $k == $folder ? '<strong class="gray">' . $v . '</strong>' : '<a href="' . s_link('insert', $k) . '">' . $v . '</a>'; } echo '<div class="vsep-pre"><div class="vsep1"> </div></div>'; echo '<div class="subtitle-link-container"><div>' . implode(' <span class="soft">|</span> ', $_buildmenu) . '</div></div>'; // // Show requested screen // $call_func = 'f_print_' . $screen; if (function_exists($call_func)) { ?> <div class="vsep-pre"><div class="vsep1"> </div></div>
function submenu() { global $config, $screen, $_submenu; $page_e = explode('/', requested_url()); $folder = array_splice($page_e, 1, 1); $folder = !empty($screen) ? $screen : $folder[0]; $_buildmenu = array(); foreach ($_submenu as $k => $v) { $_buildmenu[] = $k == $folder ? '<strong class="gray">' . $v . '</strong>' : '<a href="' . s_link('edit', $k) . '">' . $v . '</a>'; } ?> <div class="vsep-pre"><div class="vsep1"> </div></div> <div class="subtitle-link-container"><div><?php echo implode(' <span class="soft">|</span> ', $_buildmenu); ?> </div></div> <?php }