function drawStaffList($where, $searchterms = false) { global $isAdmin, $_josh; $return = drawJumpToStaff() . '<table class="left" cellspacing="1">'; if ($isAdmin) { $colspan = 5; $return .= drawHeaderRow(false, $colspan, "new", "add_edit.php"); } else { $colspan = 4; $return .= drawHeaderRow(false, $colspan); } $return .= '<tr> <th class="image"></th> <th>Name / Office</th> <th>Title / Department</th> <th class="r">Phone</th>'; if ($isAdmin) { $return .= '<th></th>'; } $return .= '</tr>'; $result = db_query("SELECT \n\t\t\tu.userID, \n\t\t\tu.lastname,\n\t\t\tISNULL(u.nickname, u.firstname) firstname, \n\t\t\tu.bio, \n\t\t\tu.phone,\n\t\t\tc.description corporationName,\n\t\t\tu.corporationID,\n\t\t\to.name office, \n\t\t\tu.title, \n\t\t\td.departmentName\n\t\tFROM intranet_users u\n\t\tLEFT JOIN intranet_departments d\tON d.departmentID = u.departmentID \n\t\tLEFT JOIN organizations c\t\t\tON u.corporationID = c.id\n\t\tLEFT JOIN intranet_offices o\t\tON o.id = u.officeID\n\t\tWHERE " . $where . "\n\t\tORDER BY u.lastname, ISNULL(u.nickname, u.firstname)"); $count = db_found($result); if ($count) { if ($count == 1 && $searchterms) { $r = db_fetch($result); $_josh["slow"] = true; url_change("view.php?id=" . $r["userID"]); } else { while ($r = db_fetch($result)) { $return .= drawStaffRow($r, $searchterms); } } } else { $return .= drawEmptyResult("No staff match those criteria.", $colspan); } return $return . '</table>'; }
include "../../include.php"; if (url_action("delete")) { db_delete('board_members'); url_drop(); } elseif ($posting) { $id = db_save('board_members'); url_change(); } echo drawTop(); echo drawTableStart(); if ($page['is_admin']) { $colspan = 2; echo drawHeaderRow("Board Members", $colspan, "new", "#bottom"); } else { $colspan = 3; echo drawHeaderRow("Board Members", $colspan); } $result = db_query("SELECT\n\t\t\t\tm.id,\n\t\t\t\tm.firstname,\n\t\t\t\tm.lastname,\n\t\t\t\tm.board_position,\n\t\t\t\to.description organization\n\t\t\tFROM board_members m\n\t\t\tJOIN organizations o ON m.organization_id = o.id\n\t\t\tWHERE m.is_active = 1\n\t\t\tORDER BY o.description, m.lastname, m.firstname"); if (db_found($result)) { ?> <tr> <th align="left" width="60%">Name</th> <th align="left" width="40%">Position on Board</th> <?php if ($page['is_admin']) { echo "<th width='16'></th>"; } ?> </tr> <?php $lastCorporation = "";
<?php include '../include.php'; url_query_require(); if (url_action('delete')) { db_delete('press_clips', $_GET['delete_id']); url_change('/press-clips/'); } echo drawTop(); echo drawTableStart(); echo drawHeaderRow($page['breadcrumbs'] . $page['title'], 2, getString('edit'), 'edit/?id=' . $_GET['id'], getString('delete'), drawDeleteLink()); $r = db_grab('SELECT c.title' . langExt() . ' title, c.url, c.pub_date, c.publication' . langExtT() . ' publication, c.type_id, c.description' . langExt() . ' description, t.title' . langExt() . ' type FROM press_clips c JOIN press_clips_types t ON c.type_id = t.id WHERE c.id = ' . $_GET['id']); ?> <tr> <td class="left"><?php echo getString('title'); ?> </td> <td class='title'><?php echo $r['title']; ?> </td> </tr> <tr> <td class="left"><?php echo getString('category'); ?> </td> <td><?php echo draw_link('categories.php?id=' . $r['type_id'], $r['type']); ?>
<?php include "../../include.php"; echo drawTop(); $r = db_grab("SELECT \n\t\tj.id,\n\t\tj.title,\n\t\tj.description,\n\t\tc.description corporationName,\n\t\to.name office,\n\t\tj.created_date, \n\t\tj.updated_date,\n\t\tj.deleted_date,\n\t\tu1.firstname created_userFirst,\n\t\tu1.lastname created_userLast,\n\t\tu2.firstname updated_userFirst,\n\t\tu2.lastname updated_userLast,\n\t\tu3.firstname deleted_userFirst,\n\t\tu3.lastname deleted_userLast\n\tFROM openings j\n\tLEFT JOIN organizations c ON j.corporationID = c.id\n\tLEFT JOIN offices o ON j.officeID = o.id\n\tLEFT JOIN users u1 ON j.created_user = u1.id\n\tLEFT JOIN users u2 ON j.updated_user = u2.id\n\tLEFT JOIN users u3 ON j.deleted_user = u3.id\n\t\n\tWHERE j.id = " . $_GET["id"]); $r["created_user"] = $r["created_userFirst"] ? $r["created_userFirst"] . " " . $r["created_userLast"] : false; $r["updated_user"] = $r["updated_userFirst"] ? $r["updated_userFirst"] . " " . $r["updated_userLast"] : false; $r["deleted_user"] = $r["deleted_userFirst"] ? $r["deleted_userFirst"] . " " . $r["deleted_userLast"] : false; ?> <table class="left" cellspacing="1"> <?php if ($page['is_admin']) { echo drawHeaderRow("View Position", 2, "edit", "position_edit.php?id=" . $_GET["id"]); } else { echo drawHeaderRow("View Position", 2); } ?> <tr> <td class="left">Organization</td> <td><?php echo $r["corporationName"]; ?> </td> </tr> <tr> <td class="left">Location</td> <td><?php echo $r["office"]; ?> </td> </tr>
<?php include "../../include.php"; echo drawTop(); ?> <table class="left"> <?php echo drawHeaderRow("Long Distance Codes", 1); ?> <?php $codes = db_query("SELECT\n\tl.code\nFROM ldcodes l\nWHERE (SELECT COUNT(*) FROM users u WHERE u.is_active = 1 AND u.officeID = 1 AND u.longdistancecode = l.code) = 0\nORDER BY NEWID()"); while ($c = db_fetch($codes)) { ?> <tr> <td><?php echo sprintf("%04s", $c["code"]); ?> </td> </tr> <?php } ?> </table> <?php echo drawBottom();
<?php include 'include.php'; url_query_require('skills.php'); if (!($skill = db_grab('SELECT title FROM skills where isActive = 1 AND id = ' . url_id()))) { url_chagne('skills.php'); } echo drawTop(); echo drawTableStart(); if ($isAdmin) { echo drawHeaderRow($skill, 1, 'Edit', 'skill_add_edit.php?id=' . url_id()); } else { echo drawHeaderRow($skill, 1); } if ($users = db_table('SELECT u.userID, u.firstName, u.lastName FROM users_to_skills u2s JOIN intranet_users u ON u2s.user_id = u.userID WHERE u2s.skill_id = ' . url_id() . ' AND u.isActive = 1 ORDER BY u.lastName, u.firstName')) { ?> <tr> <th>User</th> </tr> <?php foreach ($users as $u) { echo '<tr> <td><a href="view.php?id=' . $u['userID'] . '">' . $u['firstName'] . ' ' . $u['lastName'] . '</a></td> </tr>';
//} else { //$file .= "-"; } $file .= '</td>'; } $file .= '<td align="right">' . $counter . '</td></tr>'; } $file .= '</table>'; //die($file); file_download($file, $reportname, "xls"); } echo drawTop(); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Percentages Report (without Vacation)", 2); ?> <form method="post" action="<?php echo $_josh["request"]["path_query"]; ?> "> <tr> <td class="left">Start Date</td> <td><?php echo draw_form_select_month("start", "1/2005", false, false, "field", false, true); ?> </td> </tr> <tr> <td class="left">End Date</nobr></td> <td><?php
echo format_date_time($r["createdOn"]); ?> </td> <td width="16"><?php echo draw_img($locale . "images/icons/delete.gif", url_query_add(array("action" => "deletereq", "id" => $r["id"]), false)); ?> </td> </tr> <?php } } else { echo drawEmptyResult("No pending requests!"); } echo drawTableEnd(); echo drawTableStart(); echo drawHeaderRow("Never Logged In", 3, "invite them all", url_query_add(array("action" => "invite"), false)); $result = db_query("SELECT userid, lastname, firstname, createdOn FROM intranet_users WHERE lastlogin IS NULL AND isactive = 1 ORDER BY lastname"); if (db_found($result)) { ?> <tr> <th width="70%">Name</th> <th width="30%" class="r">Created Date</th> <th></th> </tr> <?php while ($r = db_fetch($result)) { ?> <tr> <td><a href="view.php?id=<?php echo $r["userid"]; ?>
db_query('DELETE FROM it_system_status'); db_query('INSERT INTO it_system_status ( message, updated_date, updated_user ) VALUES ("' . format_html($_POST['helpdesk_status']) . '", GETDATE(),' . user() . ')'); url_change('./'); } echo drawTop(); echo lib_get('tinymce'); echo draw_javascript_src('/_intranet.seedco.site/lib/tinymce/tinymce_3_3_8/tiny_mce.js'); echo draw_javascript('form_tinymce_init("/css/tinymce-helpdesk-status.css", true);'); ?> <table class="left" cellspacing="1"> <form action="<?php echo $request["path_query"]; ?> " method="post"> <?php echo drawHeaderRow("Update Status Message"); ?> <tr> <td><?php echo draw_form_textarea("helpdesk_status", $helpdeskStatus, "tinymce", false); ?> </td> </tr> <tr> <td class="bottom"><?php echo draw_form_submit("update message"); ?> </td> </tr> </form> </table>
<?php include "../../include.php"; if ($posting) { $id = db_save("wiki_topics"); db_checkboxes("tags", "wiki_topics_to_tags", "topicID", "tagID", $id); url_change(); } echo drawTop(); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Main Page", 4); $topics = db_query("SELECT \n\t\tw.id,\n\t\tw.title,\n\t\tw.description,\n\t\tISNULL(u.nickname, u.firstname) first,\n\t\tu.lastname last,\n\t\tw.created_date\n\tFROM wiki_topics w\n\tJOIN wiki_topics_types t ON w.type_id = t.id\n\tJOIN users u ON w.created_user = u.id\n\tWHERE w.is_active = 1\n\tORDER BY w.created_date DESC"); if (db_found($topics)) { ?> <tr> <th width="16"></th> <th align="left">Title</th> <th align="left" width="100">Created By</th> <th align="right" width="80">Created On</th> </tr> <?php while ($t = db_fetch($topics)) { ?> <tr height="36"> <td></td> <td><a href="topic.php?id=<?php echo $t["id"]; ?> "><?php
<?php include "../../include.php"; url_query_require("types.php"); echo drawTop(); $r = db_grab("SELECT description FROM wiki_topics_types WHERE id = " . $_GET["id"]); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("<a href='types.php' class='white'>Types</a> > " . $r["description"], 4); $topics = db_query("SELECT \n\t\tw.id,\n\t\tw.title,\n\t\tw.description,\n\t\tISNULL(u.nickname, u.firstname) first,\n\t\tu.lastname last,\n\t\tw.created_date\n\tFROM wiki_topics w\n\tJOIN wiki_topics_types t ON w.type_id = t.id\n\tJOIN users u ON w.created_user = u.id\n\tWHERE w.is_active = 1 AND w.type_id = " . $_GET["id"]); if (db_found($topics)) { ?> <tr> <th width="16"></th> <th align="left">Title</th> <th align="left" width="100">Created By</th> <th align="right" width="80">Created On</th> </tr> <?php while ($t = db_fetch($topics)) { ?> <tr height="36"> <td></td> <td><a href="topic.php?id=<?php echo $t["id"]; ?> "><?php echo $t["title"]; ?> </a></td>
<?php include "../include.php"; drawTop(); $users = db_query("select \n\t\tISNULL(u.nickname, u.firstname) first,\n\t\tu.lastname last,\n\t\tu.userID,\n\t\tu.title,\n\t\td.departmentName,\n\t\tu.officeid,\n\t\tr.isPayroll,\n\t\tu.lastlogin, \n\t\tu.updatedOn, \n\t\t" . db_datediff("u.updatedOn", "GETDATE()") . " recent \n\tFROM intranet_users u\n\tJOIN intranet_departments d on u.departmentID = d.departmentID\n\tJOIN intranet_ranks r on u.rankID = r.id\n\tWHERE u.isactive = 1 and (u.homeaddress1 = '' OR u.homeaddress1 IS NULL)\n\tORDER BY lastname"); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Staff Profiles Needing Update (" . db_found($users) . ")", 4); ?> <tr> <th width="25%" align="left">email</th> <th width="30%" align="left">department</th> <th width="30%" align="left">title</th> <th width="15%" align="right">last login</th> </tr> <?php while ($u = db_fetch($users)) { ?> <tr> <td><a href="/staff/view.php?id=<?php echo $u["userID"]; ?> "><?php echo $u["first"]; ?> <?php echo $u["last"]; ?> </a></td> <td><?php
if ($posting) { $userID = $isAdmin ? $_POST["createdBy"] : $user["id"]; format_post_html("description"); db_query("INSERT INTO intranet_jobs (\n \ttitle,\n \tdescription,\n\t\tcorporationID,\n\t\tofficeID,\n\t\tcreatedBy,\n\t\tcreatedOn,\n\t\tisActive\n\t) VALUES (\n\t\t'" . $_POST["title"] . "',\n\t\t" . $_POST["description"] . ",\n\t\t" . $_POST["corporationID"] . ",\n\t\t" . $_POST["officeID"] . ",\n\t\t" . $userID . ",\n\t\tGETDATE(),\n\t\t1\n );"); url_change(); } drawTop(); ?> <table class="left" cellspacing="1"> <?php if ($isAdmin) { $colspan = 4; echo drawHeaderRow("Open Positions", $colspan, "new", "#bottom"); } else { $colspan = 3; echo drawHeaderRow("Open Positions", $colspan); } ?> <tr> <th align="left" width="50%">Title</th> <th align="left" width="30%">Location</th> <th align="right" width="20%"><nobr>Last Update</nobr></th> <?php if ($isAdmin) { ?> <th></th><?php } ?> </tr> <?php $result = db_query("SELECT \n\t\t\t\t\t\t\tj.id,\n\t\t\t\t\t\t\tj.title,\n\t\t\t\t\t\t\tc.description corporationName,\n\t\t\t\t\t\t\to.name office,\n\t\t\t\t\t\t\tISNULL(j.updatedOn, j.createdOn) updatedOn\n\t\t\t\t\t\tFROM intranet_jobs j\n\t\t\t\t\t\tLEFT JOIN organizations c ON j.corporationID = c.id\n\t\t\t\t\t\tLEFT JOIN intranet_offices o ON j.officeID = o.id\n\t\t\t\t\t\tWHERE j.isActive = 1\n\t\t\t\t\t\tORDER BY c.description, j.title");
//get addresses & send $users = db_query("SELECT email FROM intranet_users WHERE isactive = 1"); while ($u = db_fetch($users)) { mail($u["email"], $r["title"], $message, $headers); } } syndicateBulletinBoard(); url_change(); } drawTop(); echo drawSyndicateLink("bb"); ?> <table class="left" id="bb"> <thead> <?php echo drawHeaderRow("", 4, "new", "#bottom"); ?> <tr> <th width="320">Topic</th> <th width="120">Starter</th> <th class="c">Replies</th> <th class="r">Last Post</th> </tr> </thead> <tbody> <?php echo drawBBPosts(15, drawEmptyResult("No topics have been added yet. Why not <a href='#bottom'>be the first</a>?", 4)); ?> </tbody> <tfoot class="more"> <tr>
db_query("INSERT INTO it_laptops_2_accessories (\r\n\t\t\t\tlaptopID,\r\n\t\t\t\taccessoryID\r\n\t\t\t) VALUES (\r\n\t\t\t\t" . $_GET["id"] . ",\r\n\t\t\t\t" . $accessoryID . "\r\n\t\t\t);"); } } url_change("laptop.php?id=" . $_GET["id"]); } echo drawTop(); if (isset($_GET["id"])) { $r = db_grab("SELECT \r\n\t\t\t\t\t\tl.laptopName,\r\n\t\t\t\t\t\tl.laptopPurpose,\r\n\t\t\t\t\t\tl.laptopModel,\r\n\t\t\t\t\t\tl.laptopHomeID,\r\n\t\t\t\t\t\tl.laptopSerial,\r\n\t\t\t\t\t\tl.laptopExpressServiceCode,\r\n\t\t\t\t\t\tl.laptopServiceTag,\r\n\t\t\t\t\t\tl.laptopOS,\r\n\t\t\t\t\t\tl.laptopOffice,\r\n\t\t\t\t\t\tl.laptopIsWireless,\r\n\t\t\t\t\t\tl.laptopMACAddress\r\n\t\t\t\t\tFROM it_laptops l\r\n\t\t\t\t\tWHERE laptopID = " . $_GET["id"]); $openEnded = empty($r["laptopEnd"]) ? true : false; } ?> <a name="closedtickets"></a> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Add Laptop", 2); ?> <form method="post" action="<?php echo $request["path_query"]; ?> "> <tr> <td class="left">Laptop Name</td> <td><?php echo draw_form_text("laptopName", @$r["laptopName"]); ?> </td> </tr> <tr> <td class="left">Model #</td> <td><?php
} echo drawMessage($msg, "center"); } ?> <table class="left" cellspacing="1"> <?php if ($page['is_admin']) { if ($r['is_active']) { echo drawHeaderRow($page['breadcrumbs'] . $page['title'], 3, getString('edit'), "add_edit.php?id=" . $_GET['id'], getString('delete'), drawDeleteLink("Deactivate this staff member?")); } else { echo drawHeaderRow($page['breadcrumbs'] . $page['title'], 3, getString('edit'), "add_edit.php?id=" . $_GET['id'], "re-activate", drawDeleteLink("Re-activate this staff member?", false, "undelete")); } } elseif ($_GET['id'] == $_SESSION['user_id']) { echo drawHeaderRow($page['title'], 3, getString('edit'), "add_edit.php?id=" . $_GET['id']); } else { echo drawHeaderRow($page['title'], 3); } $rowspan = 6; if (getOption("staff_showdept")) { $rowspan++; } if (getOption("staff_showoffice")) { $rowspan++; } if (getOption("languages")) { $rowspan++; } ?> <tr> <td class="left"><?php echo getString('name');
?> </td> <td width="16"><?php echo draw_img("/images/icons/delete.png", url_query_add(array("action" => "deletereq", "id" => $r["id"]), false)); ?> </td> </tr> <?php } } else { echo drawEmptyResult(getString('staff_requests_empty')); } echo drawTableEnd(); //never logged in echo drawTableStart(); echo drawHeaderRow(getString('staff_never_logged_in'), 3, getString('staff_invite_all'), url_query_add(array("action" => "invite"), false)); $result = db_query("SELECT id, lastname, firstname, created_date FROM users WHERE lastlogin IS NULL AND is_active = 1 ORDER BY lastname"); if (db_found($result)) { ?> <tr> <th width="70%"><?php echo getString('name'); ?> </th> <th width="30%" class="r"><?php echo getString('date_created'); ?> </th> <th></th> </tr> <?php
<?php include "../../include.php"; echo drawTop(); $r = db_grab("SELECT programDesc FROM funders_programs WHERE programID = " . $_GET["id"]); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow($r, 2); ?> <tr> <td class="left">Name</td> <td><b><?php echo $r; ?> </b></td> </tr> <tr> <td class="bottom" colspan="2"><?php echo draw_form_button("edit name", "program_add_edit.php?id=" . $_GET["id"]); ?> </td> </tr> </table> <table class="left" cellspacing="1"> <tr> <td colspan="5" class="head"> Funders Interesed in <?php echo $r;
<?php include "include.php"; url_query_require("admins.php"); echo drawTop(); echo drawTicketFilter(); ?> <table class="left" cellspacing="1"> <?php $result = db_query("SELECT\r\n\t\t\t\t\t\tt.title,\r\n\t\t\t\t\t\tt.statusID,\r\n\t\t\t\t\t\t(SELECT COUNT(*) FROM helpdesk_tickets_followups f WHERE f.ticketID = t.id) as ticketfollowups,\r\n\t\t\t\t\t\tt.created_user,\r\n\t\t\t\t\t\tt.updated_date,\r\n\t\t\t\t\t\tt.id,\r\n\t\t\t\t\t\tt.ownerID,\r\n\t\t\t\t\t\tt.priorityID,\r\n\t\t\t\t\t\tt.created_date,\r\n\t\t\t\t\t\tISNULL(u.nickname, u.firstname) first,\r\n\t\t\t\t\t\tu.lastname last\r\n\t\t\t\t\tFROM helpdesk_tickets t\r\n\t\t\t\t\tJOIN users u ON u.id = t.created_user\r\n\t\t\t\t\tWHERE t.ownerID = {$_GET["id"]} {$where}\r\n\t\t\t\t\tORDER BY t.created_date DESC"); $admin = db_grab("SELECT ISNULL(u.nickname, u.firstname) first FROM users u WHERE u.id = " . $_GET["id"]); echo drawHeaderRow("<a href='admins.php' class='white'>Admins</a> > " . $admin["first"] . " (" . db_found($result) . ")", 5); if (db_found($result)) { echo drawTicketHeader(); while ($r = db_fetch($result)) { echo drawTicketRow($r); } } else { if ($filtered) { echo drawEmptyResult("No tickets were assigned to this admin in this month / year", 5); } else { echo drawEmptyResult("No tickets were assigned to this admin.", 5); } } ?> </table> <?php echo drawBottom();
<?php include "include.php"; url_query_require("users.php"); echo drawTop(); $result = db_query("select\r\n\t\t\t\tt.title,\r\n\t\t\t\tt.statusID,\r\n\t\t\t\t(SELECT COUNT(*) FROM helpdesk_tickets_followups f where f.ticketID = t.id) as ticketfollowups,\r\n\t\t\t\tt.created_user,\r\n\t\t\t\tt.updated_date,\r\n\t\t\t\tt.id,\r\n\t\t\t\tt.ownerID,\r\n\t\t\t\tt.priorityID,\r\n\t\t\t\tt.created_date,\r\n\t\t\t\tISNULL(u.nickname, u.firstname) first,\r\n\t\t\t\tu.lastname last,\r\n\t\t\t\t(SELECT COUNT(*) FROM users_to_modules a WHERE a.module_id = 3 AND a.user_id = t.created_user) is_adminIT\r\n\t\t\tFROM helpdesk_tickets t\r\n\t\t\tJOIN users u ON u.id = t.created_user\r\n\t\t\tWHERE t.created_user = {$_GET["id"]} {$where}\r\n\t\t\tORDER BY t.created_date DESC"); echo drawTicketFilter(); ?> <table class="left" cellspacing="1"> <?php $u = db_grab("SELECT ISNULL(nickname, firstname) first, lastname last FROM users WHERE id = " . $_GET["id"]); echo drawHeaderRow("<a href='users.php' class='white'>Users</a> > " . $u["first"] . " " . $u["last"] . " (" . db_found($result) . ")", 5); if (db_found($result)) { echo drawTicketHeader(); while ($r = db_fetch($result)) { echo drawTicketRow($r); } } else { if ($filtered) { echo drawEmptyResult("No tickets for this user / month / year.", 5); } else { echo drawEmptyResult("This user hasn't posted any tickets.", 5); } } ?> </table> <?php echo drawBottom();
<?php include "../include.php"; if (!isset($_GET["id"])) { $_GET["id"] = "a"; } echo drawTop(); $r = db_grab("SELECT tt.name, t.type_id, t.tag FROM contacts_tags t INNER JOIN contacts_tags_types tt ON t.type_id = tt.id WHERE t.id = " . $_GET["id"]); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow($r["tag"], 4); ?> <tr> <th width="16"></th> <th width="27%" align="left">Name</th> <th width="48%" align="left">Company</th> <th width="25%" align="left">Phone</th> </tr> <?php $contacts = db_query("SELECT\r\n\t\t\t\t\t\to.id,\r\n\t\t\t\t\t\to.is_active,\r\n\t\t\t\t\t\ti.varchar_01 as firstname,\r\n\t\t\t\t\t\ti.varchar_02 as lastname,\r\n\t\t\t\t\t\ti.varchar_04 as organization,\r\n\t\t\t\t\t\ti.varchar_08 as phone,\r\n\t\t\t\t\t\ti.varchar_11 as email\r\n\t\t\t\t\tFROM contacts o\r\n\t\t\t\t\tJOIN contacts_instances i ON o.instanceCurrentID = i.id\r\n\t\t\t\t\tJOIN contacts_instances_to_tags i2t ON i.id = i2t.instanceID\r\n\t\t\t\t\tWHERE o.is_active = 1 AND i2t.tagID = {$_GET["id"]}\r\n\t\t\t\t\tORDER BY i.varchar_02, i.varchar_01"); while ($c = db_fetch($contacts)) { if (strlen($c["organization"]) > 40) { $c["organization"] = substr($c["organization"], 0, 39) . "..."; } ?> <tr <?php if (!$c["is_active"]) { ?> class="deleted"<?php }
if (url_id()) { if (!($l = db_grab('SELECT id, name, address, precedence FROM intranet_offices WHERE id = ' . $_GET['id']))) { url_query_drop('id'); } $form = new intranet_form(); $form->addRow('hidden', '', 'precedence', $l['precedence']); $form->addRow('itext', 'Name', 'name', $l['name'], '', true, 255); $form->addRow('textarea-plain', 'Address', 'address', $l['address'], ''); $form->addRow('submit', 'Save Changes'); $form->draw('Edit Location'); } else { ?> <table cellspacing='1' class='left draggable locations'> <thead> <?php echo drawHeaderRow(false, 4, 'new', '#bottom'); ?> <tr> <th class='reorder'></th> <th>Link</th> <th>Address</th> <th class='delete'></th> </tr> </thead> <tbody> <?php $intranet_offices = db_query('SELECT id, name, address FROM intranet_offices ORDER BY precedence'); if ($max = db_found($intranet_offices)) { while ($l = db_fetch($intranet_offices)) { ?> <tr id='<?php
<?php include "../include.php"; echo drawTop(); echo drawNavigation(); $result = db_query("SELECT\n\t\t\t\t\t\tu.id,\n\t\t\t\t\t\tu.lastname last,\n\t\t\t\t\t\tISNULL(u.nickname, u.firstname) first,\n\t\t\t\t\t\tu.title,\n\t\t\t\t\t\tu.homephone, \n\t\t\t\t\t\tu.homecell \n\t\t\t\t\tFROM users u\n\t\t\t\t\tWHERE u.rankid < 8 AND u.is_active = 1\n\t\t\t\t\tORDER BY u.lastname, ISNULL(u.nickname, u.firstname)"); ?> <table class="left"> <?php echo drawHeaderRow("Management Contact Numbers", 4); ?> <tr bgcolor="#F6F6F6" class="small"> <th align="left">Name</th> <th align="left">Title</th> <th align="left">Home #</th> <th align="left">Cell #</th> </tr> <?php while ($r = db_fetch($result)) { ?> <tr> <td><a href="view.php?id=<?php echo $r["user_id"]; ?> "><?php echo $r["first"]; ?> <?php echo $r["last"]; ?> </a></td>
//christmas $holidays[25] = "Christmas Day"; if (date("w", mktime(0, 0, 0, 12, 25, $_GET['year'])) == 6) { $holidays[24] = "Christmas"; } if (date("w", mktime(0, 0, 0, 12, 25, $_GET['year'])) == 0) { $holidays[26] = "Christmas"; } //obscure possibility that new year's is on a saturday; take friday off (score) if (date("w", mktime(0, 0, 0, 12, 31, $_GET['year'])) == 5) { $holidays[31] = "New Year's"; } } } echo drawTableStart(); echo drawHeaderRow($_josh['months'][$_GET['month'] - 1] . " " . $_GET['year'], 7, getString('add_new'), "#bottom"); echo '<tr>'; foreach ($_josh['days'] as $day) { echo draw_container('th', $day, 'c'); } echo '</tr>'; // === OUTER LOOP: WEEKS ==================================================== for ($week = 1, $thisday = 1; $thisday < $lastday; $week++) { ?> <tr class="calendar"><?php // === INNER LOOP: DAYS====================================================== for ($day = 1; $day <= 7; $day++) { $thisday = 7 * ($week - 1) + $day - $firstday; if ($thisday > 0 && $thisday <= $lastday) { $bgcolor = "#ffffff"; if ($_GET['year'] == $_josh['year'] && $_GET['month'] == $_josh['month'] && $thisday == $_josh['today']) {
?> .</nobr></td> <td><?php echo $r["description"]; ?> </td> <td align="center"><?php echo $r["owner"]; ?> </td> </tr> <?php } } } else { echo drawHeaderRow("No Tickets", 1, "new", "#bottom"); echo drawEmptyResult("There are no open {$deptName} tickets right now!", 4); } ?> </table> <a name="bottom"></a> <?php $form = new intranet_form(); if ($page['is_admin']) { $form->addUser("user_id", "Posted By", $_SESSION["user_id"], false); } $form->addRow("itext", "Problem", "title", "", "", true); if ($page['is_admin']) { $form->addRow("select", "Priority", "priorityID", "SELECT id, description FROM helpdesk_tickets_priorities", 3); } else {
<?php include "include.php"; echo drawTop(); echo drawTicketFilter(); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Tickets by Administrator", 3, "by month", "admins-report.php", "by age", "admins-byage.php"); ?> <tr> <th>Location</td> <th class="r" width="50">#</td> <th class="r" width="50">%</td> </tr> <?php $counter = 0; $users = db_query("SELECT \n\t\tu.id,\n\t\tISNULL(u.nickname, u.firstname) first, \n\t\tu.lastname last,\n\t\t(SELECT COUNT(*) FROM helpdesk_tickets t WHERE u.id = t.ownerID {$where}) tickets,\n\t\t(SELECT SUM(timeSpent) FROM helpdesk_tickets t WHERE u.id = t.ownerID {$where}) minutes\t\t\n\t\tFROM users u\n\t\tJOIN users_to_modules a ON u.id = a.user_id\n\t\tWHERE a.module_id = 3 AND u.departmentID = {$departmentID}\n\t\tORDER BY last, first"); while ($u = db_fetch($users)) { if (!$u["tickets"] && $filtered) { continue; } $counter++; ?> <tr class="helptext" bgcolor="#FFFFFF"> <td><a href="admin.php?id=<?php echo $u["id"]; if ($filtered) { ?> &month=<?php echo $_GET["month"];
echo $s["bio"]; ?> </td> </tr> <?php } ?> </table> <?php $result = db_query("SELECT \n\t\t\tISNULL(u.nickname, u.firstname) first,\n\t\t\tu.lastname last,\n\t\t\tu.title,\n\t\t\td.departmentName,\n\t\t\tu.userID, \n\t\t\tu.endDate\n\t\t\tFROM intranet_users u\n\t\t\tJOIN intranet_departments d ON u.departmentID = d.departmentID\n\t\t\tWHERE " . db_datediff("u.endDate", "GETDATE()") . " < 32 ORDER BY endDate DESC"); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Goings", 4); ?> <tr> <th width="47"></th> <th width="25%" align="left">Name</th> <th width="50%" align="left">Title, Department</th> <th width="20%" align="right">Last Day</th> </tr> <?php while ($r = db_fetch($result)) { ?> <tr bgcolor="#FFFFFF" class="helptext" valign="top" height="38"> <td><?php echo drawImg($r['userID']); ?> </td>
while ($v = db_fetch($values)) { $checkboxes[] = "!form.tag_multiple_" . $v["id"] . ".checked"; } ?> return(form_errors(errors)); } //--> <!-- if (<?php echo implode(" && ", $checkboxes); ?> ) errors[errors.length] = "Contact Department must be checked"; --> </script> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("View Contact", 2); ?> <form method="post" action="<?php echo $request["path_query"]; ?> " onsubmit="javascript:return validate(this);"> <?php echo draw_form_hidden("objectID", @$_GET["id"]); ?> <tr> <td class="left">Courtesy Title</td> <td> <?php echo draw_form_select("tag_single_10", "SELECT id, tag FROM contacts_tags WHERE type_id = 10 AND is_active = 1 ORDER BY tag", @$i["salutation"]); ?> </td>
<?php include "../../include.php"; echo drawTop(); ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Services", 2, "add new organization", "organization_add_edit.php"); ?> <tr> <th align="left">Service</td> <th align="right">#</td> </tr> <?php $result = db_query("SELECT s.id, s.name, (SELECT count(*) FROM web_organizations_2_services o2s WHERE o2s.serviceID = s.id) as countservices FROM web_services s ORDER by s.name"); while ($r = db_fetch($result)) { ?> <tr> <td><a href="service.php?id=<?php echo $r["id"]; ?> "><?php echo $r["name"]; ?> </a></td> <td align="right"><?php echo $r["countservices"]; ?> </td> </tr> <?php
function email_user($address, $title, $content, $colspan = 1) { global $_josh; $message = drawEmailHeader() . drawTableStart() . drawHeaderRow($title, $colspan) . $content . drawTableEnd() . drawEmailFooter(); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: " . $_josh["email_default"] . "\r\n"; if (!mail($address, $title, $message, $headers)) { error_handle("Couldn't Send Email", "The message to " . $address . " was rejected by the mailserver for some reason", true); } }