?> <td width="14.28%"<?php if ($_GET["id"] == $key) { ?> class="selected"<?php } ?> ><?php if ($_GET["id"] != $key) { ?> <a href="organizations.php?id=<?php echo $key; ?> "><?php } else { ?> <b><?php } echo $value; ?> </b></a></td> <?php } ?> </tr> </table> <?php $where = $_GET["id"] == 0 ? " IS NULL " : " = " . $_GET["id"]; echo drawStaffList("u.isactive = 1 AND u.corporationID " . $where); drawBottom();
<?php include 'include.php'; if (!url_id()) { url_query_add(array('id' => 1)); } drawTop(); $locations = db_query("SELECT \n\t\to.id, \n\t\to.name\n\tFROM intranet_offices o \n\tORDER BY (SELECT COUNT(*) FROM intranet_users u WHERE u.officeID = o.id) DESC"); if (db_found($locations)) { $pages = array(); while ($l = db_fetch($locations)) { $pages["/staff/locations.php?id=" . $l["id"]] = $l["name"]; } echo drawNavigationRow($pages, $location, true); } if ($_GET["id"] == "other") { echo drawStaffList("u.isactive = 1 AND u.officeID <> 1 AND u.officeID <> 6 AND u.officeID <> 11 AND u.officeID <> 9"); } else { $l = db_grab('SELECT name, address FROM intranet_offices WHERE id = ' . $_GET['id']); if (!empty($l['address'])) { echo drawServerMessage('<center><strong>' . $l['name'] . ' Office</strong><br>' . nl2br($l['address']) . '</center>'); } echo drawStaffList("u.isactive = 1 and u.officeID = " . $_GET["id"]); } drawBottom();
<?php include "include.php"; drawTop(); $fields = array("lastname", "firstname", "nickname", "title", "departmentName"); $terms = explode(" ", str_replace("'", "''", $_GET["q"])); $where = array(); foreach ($terms as $t) { if (!empty($t)) { foreach ($fields as $f) { $where[] = $f . " LIKE '%" . $t . "%'"; } } } echo drawStaffList("u.isactive = 1 and (" . implode(" OR ", $where) . ")", $terms); drawBottom();
<?php include '../../include.php'; echo drawTop(); echo drawStaffList('u.is_active = 1 AND (SELECT COUNT(*) FROM users_to_modules a WHERE a.user_id = u.id) > 0', 'There are no administrators in this site, which is a problem.'); echo drawBottom();
<?php include 'include.php'; echo drawTop(); if (db_grab('SELECT COUNT(*) FROM users WHERE is_active = 1') > 70) { if (!isset($_GET['id'])) { $_josh['request']['path_query'] .= '?id=1'; $_GET['id'] = 1; } echo drawNavigation(array('/staff/?id=1' => 'A - E', '/staff/?id=2' => 'F - J', '/staff/?id=3' => 'K - O', '/staff/?id=4' => 'P - T', '/staff/?id=5' => 'U - Z')); if ($_GET['id'] == 1) { $letters = ' AND (u.lastname LIKE "a%" OR u.lastname LIKE "b%" OR u.lastname LIKE "c%" OR u.lastname LIKE "d%" OR u.lastname LIKE "e%")'; } elseif ($_GET['id'] == 2) { $letters = ' AND (u.lastname LIKE "f%" OR u.lastname LIKE "g%" OR u.lastname LIKE "h%" OR u.lastname LIKE "i%" OR u.lastname LIKE "j%")'; } elseif ($_GET['id'] == 3) { $letters = ' AND (u.lastname LIKE "k%" OR u.lastname LIKE "l%" OR u.lastname LIKE "m%" OR u.lastname LIKE "n%" OR u.lastname LIKE "o%")'; } elseif ($_GET['id'] == 4) { $letters = ' AND (u.lastname LIKE "p%" OR u.lastname LIKE "q%" OR u.lastname LIKE "r%" OR u.lastname LIKE "s%" OR u.lastname LIKE "t%")'; } elseif ($_GET['id'] == 5) { $letters = ' AND (u.lastname LIKE "u%" OR u.lastname LIKE "v%" OR u.lastname LIKE "w%" OR u.lastname LIKE "x%" OR u.lastname LIKE "y%" OR u.lastname LIKE "z%")'; } } echo drawJumpToStaff(); echo drawStaffList('u.is_active = 1' . @$letters, getString('staff_empty'), $page['is_admin'] ? array('add_edit.php' => getString('add_new')) : false); echo drawBottom();
include 'include.php'; echo drawTop(); if (!isset($_GET['office_id'])) { $_GET['office_id'] = 1; $_josh['request']['path_query'] = '/staff/locations.php?office_id=1'; } $locations = db_query('SELECT o.id, o.name' . langExt() . ' FROM offices o WHERE o.is_active = 1 AND (SELECT COUNT(*) FROM users u WHERE u.is_active = 1 AND u.officeID = o.id) > 0 ORDER BY o.precedence'); if (db_found($locations)) { $pages = array(); $counter = 1; while ($l = db_fetch($locations)) { if ($counter < 6) { $pages['/staff/locations.php?office_id=' . $l['id']] = $l['name']; } else { if ($counter == 6) { $pages['/staff/locations.php?office_id=other'] = 'Other'; $others = array(); } $others[] = $l['id']; } $counter++; } echo drawNavigation($pages, 'path_query'); } if ($_GET['office_id'] == 'other') { echo drawStaffList('u.is_active = 1 AND u.officeID IN (' . implode(',', $others) . ')'); } else { echo drawStaffList('u.is_active = 1 and u.officeID = ' . $_GET['office_id']); } echo drawBottom();
P - T</a></td> <td width="20%"<?php if ($_GET["id"] == 5) { ?> class="selected"<?php } ?> ><?php if ($_GET["id"] != 5) { ?> <a href="index.php?id=5"><?php } ?> U - Z</a></td> </tr> </table> <?php if ($_GET["id"] == 1) { $letters = "u.lastname like 'a%' or \n\t\t\t\tu.lastname like 'b%' or \n\t\t\t\tu.lastname like 'c%' or \n\t\t\t\tu.lastname like 'd%' or \n\t\t\t\tu.lastname like 'e%'"; } elseif ($_GET["id"] == 2) { $letters = "u.lastname like 'f%' or \n\t\t\t\tu.lastname like 'g%' or \n\t\t\t\tu.lastname like 'h%' or \n\t\t\t\tu.lastname like 'i%' or \n\t\t\t\tu.lastname like 'j%'"; } elseif ($_GET["id"] == 3) { $letters = "u.lastname like 'k%' or \n\t\t\t\tu.lastname like 'l%' or \n\t\t\t\tu.lastname like 'm%' or \n\t\t\t\tu.lastname like 'n%' or \n\t\t\t\tu.lastname like 'o%'"; } elseif ($_GET["id"] == 4) { $letters = "u.lastname like 'p%' or \n\t\t\t\tu.lastname like 'q%' or \n\t\t\t\tu.lastname like 'r%' or \n\t\t\t\tu.lastname like 's%' or \n\t\t\t\tu.lastname like 't%'"; } else { $letters = "u.lastname like 'u%' or \n\t\t\t\tu.lastname like 'v%' or \n\t\t\t\tu.lastname like 'w%' or \n\t\t\t\tu.lastname like 'x%' or \n\t\t\t\tu.lastname like 'y%' or \n\t\t\t\tu.lastname like 'z%'"; } echo drawStaffList("u.isactive = 1 and (" . $letters . ")"); drawBottom();
?> '><?php } else { ?> <b><?php } echo format_string($o['title'], 26); ?> </b></a></td> <?php } ?> </tr> </table> <?php } else { echo drawPanel(draw_form_select('foo', $orgs, url_id(), false, false, 'location.href=\'' . $request['path'] . '?id=\' + this.value')); } if (url_id()) { $where = $_GET['id'] == 0 ? ' IS NULL ' : ' = ' . $_GET['id']; $links = $page['is_admin'] ? array('add_edit.php' => getString('add_new')) : false; echo drawStaffList('u.is_active = 1 AND u.organization_id ' . $where, 'This organization has no staff associated with it.', $links, draw_link($request['path_query'], $page['title']) . ' > ' . db_grab('SELECT title FROM organizations WHERE id = ' . $_GET['id'])); } else { $t = new table('foo', drawHeader()); $t->set_column('title', false, getString('title')); foreach ($orgs as &$o) { $o['title'] = draw_link('organizations.php?id=' . $o['id'], $o['title']); } echo $t->draw($orgs); } echo drawBottom();
<?php include "include.php"; echo drawTop(); //comings $links = $page['is_admin'] ? array('add_edit.php' => getString('add_new')) : false; echo drawStaffList('u.is_active = 1 AND ' . db_datediff('u.startdate') . ' < 60', getString('staff_new_empty'), $links, getString('staff_new')); //goings echo drawStaffList('u.is_active = 0 AND ' . db_datediff("u.endDate", "GETDATE()") . ' < 32', getString('staff_goings_empty')); echo drawBottom();
<?php include 'include.php'; echo drawTop(); if (empty($_GET['q'])) { url_change('./'); } $fields = array('u.lastname', 'u.firstname', 'u.nickname', 'u.title', 'u.email', 'departmentName'); $terms = explode(' ', format_quotes($_GET['q'])); $where = array(); foreach ($terms as $t) { if (!empty($t)) { foreach ($fields as $f) { $where[] = $f . ' LIKE "%' . $t . '%"'; } } } $links = $page['is_admin'] ? array('add_edit.php' => getString('add_new')) : false; echo drawStaffList('u.is_active = 1 and (' . implode(' OR ', $where) . ')', getString('staff_search_empty'), $links, false, $terms); echo drawBottom();