<?php if (!empty($helpdeskStatus)) { $return .= '<tr style="background-color:#fffce0;text-align:center;"><td style="padding:8px 4px 0px 4px;" colspan="2">' . $helpdeskStatus . '</td></tr>'; } if (!empty($helpdeskOptions)) { $items = array(); foreach ($helpdeskOptions as $option) { $items[] = draw_link('/helpdesk/?dept=' . $option['id'], $option['name']) . ' (' . format_num($option["num_open"], 0, true, 0) . ')'; } $return .= draw_table_rows($items); }
function drawBottom() { global $_josh, $modules, $helpdeskOptions, $helpdeskStatus, $modulettes, $page; $return = ' </div> <div id="right"> <div id="tools"> <a class="right button" href="/index.php?action=logout">' . getString('log_out') . '</a> ' . getString('hello') . ' <a href="/staff/view.php?id=' . $_SESSION['user_id'] . '"><b>' . $_SESSION['full_name'] . '</b></a>'; //search $return .= '<form name="search" accept-charset="utf-8" method="get" action="/staff/search.php" onsubmit="javascript:return doSearch(this);"> <input type="text" name="q" placeholder="' . getString('staff_search') . '"/> </form>'; //channel or language selectors if (getOption('channels')) { //$return .= draw_form_select('channel_id', 'SELECT id, title' . langExt() . ' title FROM channels WHERE is_active = 1 AND is_private = 0 ORDER BY precedence', $_SESSION['channel_id'], false, 'channels', 'url_query_set(\'channel_id\', this.value)', getString('networks_view_all')); $return .= draw_form_select('channel_id', 'SELECT c.id, c.title' . langExt() . ' title FROM channels c WHERE c.is_active = 1 AND (c.is_private = 0 OR (SELECT COUNT(*) FROM users_to_channels u2c WHERE u2c.channel_id = c.id AND u2c.user_id = ' . user() . ') > 0) ORDER BY precedence', $_SESSION['channel_id'], false, 'channels', 'url_query_set(\'channel_id\', this.value)', getString('networks_view_all')); } if (getOption('languages')) { $return .= draw_form_select('language_id', 'SELECT id, title FROM languages ORDER BY title', $_SESSION['language_id'], true, 'languages', 'url_query_set(\'language_id\', this.value)'); } //links $links = db_table('SELECT title' . langExt() . ' title, url FROM links WHERE is_active = 1 ORDER BY precedence'); foreach ($links as &$l) { $l = draw_link($l['url'], $l['title'], true); } $return .= draw_div('#links', draw_container('h3', getString('links')) . (admin() ? draw_link('/a/admin/links.php', getString('edit'), false, array('class' => 'right button')) : false) . draw_list($links)); $return .= '</div>'; foreach ($modules as $m) { $return .= ' <table class="right ' . $m['folder'] . '" cellspacing="1"> <tr> <td colspan="2" class="head" style="background-color:#' . $m['color'] . ';"> <a href="/' . $m['folder'] . '/" class="left">' . $m['title'] . '</a> ' . draw_img('/images/arrows-new/' . format_boolean($m['is_closed'], 'up|down') . '.png', url_query_add(array('module' => $m['id']), false)) . ' </td> </tr>'; if (!$m['is_closed']) { include DIRECTORY_ROOT . DIRECTORY_SEPARATOR . $m['folder'] . DIRECTORY_SEPARATOR . 'pallet.php'; } $return .= '</table>'; } $return .= '</div> <div id="footer">'; //if (admin()) $return .= 'page rendered in ' . format_time_exec() . '<br/>'; $return .= getString('copyright') . '<br/>'; if (getOption('legal')) { $return .= draw_link('/login/legal.php', getString('legal_title')); } $return .= '</div></div> <div id="subfooter"></div> </body> </html>'; //record pageview if ($page['id'] && user()) { db_query('INSERT INTO pages_views ( page_id, user_id, timestamp ) VALUES ( ' . $page['id'] . ', ' . user('NULL') . ', GETDATE() )'); } return $return; }
</td> <td><?php echo $r['publication']; ?> , <?php echo format_date($r['pub_date']); ?> </td> </tr> <tr> <td class="left"><?php echo getString('url'); ?> </td> <td><?php echo draw_link($r['url'], format_string($r['url'], 70), true); ?> </td> </tr> <tr> <td class="left"><?php echo getString('description'); ?> </td> <td class="text"><?php echo $r['description']; ?> </td> </tr> <?php if (getOption('channels')) {
<?php include "include.php"; if (url_action('delete')) { db_delete('bb_topics_types'); url_drop('action,id'); } echo drawTop(); $t = new table('bb_topics_types', drawHeader($page['is_admin'] ? array('category_edit.php' => getString('category_new')) : false)); $t->set_column('category', 'l', getString('category')); $t->set_column('topics', 'r', getString('topics')); if ($page['is_admin']) { $t->set_column('delete', 'd', ' '); } $result = db_table('SELECT y.id, y.title' . langExt() . ' category, (SELECT COUNT(*) FROM bb_topics t WHERE t.type_id = y.id AND t.is_active = 1) topics FROM bb_topics_types y WHERE y.is_active = 1 ORDER BY y.title'); foreach ($result as &$r) { $r['category'] = draw_link('category.php?id=' . $r['id'], $r['category']); if ($page['is_admin']) { $r['delete'] = draw_img('/images/icons/delete.png', url_query_add(array('action' => 'delete', 'id' => $r['id']), false)); } } echo $t->draw($result, 'No categories added yet'); echo drawBottom();
if ($posting) { langTranslatePost('title'); $id = db_save('modules'); url_drop('id'); } echo drawTop(); if (url_id()) { //form $f = new form('modules', @$_GET['id']); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f); echo $f->draw(); } else { //modules list $t = new table('modules', drawHeader()); $t->set_column('is_selected', 'd', ' '); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('pages', 'r'); $result = db_table('SELECT m.id, m.title' . langExt() . ' title, m.is_active, (SELECT COUNT(*) FROM pages p WHERE p.module_id = m.id AND p.modulette_id IS NULL) pages FROM modules m ORDER BY m.precedence'); $t->set_draggable('draggy'); foreach ($result as &$r) { $r['is_selected'] = draw_form_checkbox('foo', $r['is_active'], false, 'ajax_set(\'modules\', \'is_active\', ' . $r['id'] . ', ' . abs($r['is_active'] - 1) . ');'); $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('./?id=' . $r['id'], $r['title']); $r['pages'] = draw_link('pages.php?module_id=' . $r['id'], format_quantitize($r['pages'], 'page')); } echo $t->draw($result, 'No modules'); } echo drawBottom();
<?php } ?> </td> </tr> <?php } ?> </table> <?php } else { //main table $result = db_table('SELECT e.id, e.title' . langExt() . ' title, t.title' . langExt() . ' "group", e2t.type_id FROM external_orgs e JOIN external_orgs_to_types e2t ON e.id = e2t.org_id JOIN external_orgs_types t ON e2t.type_id = t.id WHERE e.is_active = 1 ORDER BY t.title, e.title '); $t = new table('external_orgs_types', drawHeader(array('#bottom' => getString('add_new')))); $t->set_column('title', 'l', getString('title')); foreach ($result as &$r) { $r['group'] = draw_link('./type.php?id=' . $r['type_id'], $r['group']); $r['title'] = draw_link('./?id=' . $r['id'], $r['title']); } echo $t->draw($result, 'There are no external orgs added yet.'); //add new include 'edit.php'; } echo drawBottom();
<?php include '../include.php'; if (url_action('delete')) { if (!isset($_GET['delete_id']) && isset($_GET['id'])) { $_GET['delete_id'] = $_GET['id']; } $r = db_grab('SELECT firstname, lastname, endDate FROM users WHERE id = ' . $_GET['delete_id']); if ($r['endDate']) { db_query('UPDATE users SET is_active = 0, deleted_user = '******'user_id'] . ', deleted_date = GETDATE() WHERE id = ' . $_GET['delete_id']); } else { db_query('UPDATE users SET is_active = 0, deleted_user = '******'user_id'] . ', deleted_date = GETDATE(), endDate = GETDATE() WHERE id = ' . $_GET['delete_id']); } if (getOption('staff_alertdelete')) { emailAdmins('Intranet: Staff Deleted', draw_link(url_base() . '/staff/view.php?id=' . $_GET['staffID'], $r['firstname'] . ' ' . $r['lastname']) . ' was just deactivated on the Intranet.'); } url_query_drop('action,delete_id'); } function drawJumpToStaff($selectedID = false) { global $page; $nullable = $selectedID === false; $return = drawPanel(getString('jump_to') . ' ' . drawSelectUser('', $selectedID, $nullable, 0, true, true, 'Staff Member:')); if ($page['is_admin'] && db_grab('SELECT COUNT(*) FROM users_requests WHERE is_active = 1')) { $return = drawMessage('There are pending <a href="requests.php">account requests</a> for you to review.') . $return; } return $return; }
} elseif (url_action('delete')) { db_delete('dl_categories'); url_drop('action,id'); } echo drawTop(); if (!empty($_GET['category_id'])) { //category form if ($_GET['category_id'] == 'new') { $_GET['category_id'] = false; } $f = new form('dl_categories', $_GET['category_id'], ($_GET['category_id'] ? 'Edit' : 'Add') . ' Category'); $f->set_title_prefix($page['breadcrumbs']); echo $f->draw(); } else { //list of categories $result = db_table('SELECT id, title, ' . db_updated() . ' FROM dl_categories WHERE is_active = 1 ORDER BY precedence'); $links = $page['is_admin'] ? array(url_query_add(array('category_id' => 'new'), false) => getString('add_new')) : false; $t = new table('dl_categories', drawHeader($links)); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('updated', 'r', getString('updated')); $t->set_column('delete', 'd', ' '); foreach ($result as &$r) { $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link(url_query_add(array('category_id' => $r['id']), false), $r['title']); $r['updated'] = format_date($r['updated']); $r['delete'] = draw_link(url_query_add(array('action' => 'delete', 'id' => $r['id']), false), 'x', false, 'confirm'); } echo $t->draw($result, getString('categories_empty')); } echo drawBottom();
<?php include '../include.php'; echo drawTop(); $clips = db_query('SELECT c.id, c.title, c.url, c.publication, c.pub_date, c.description, t.title type FROM press_clips c JOIN press_clips_types t ON c.type_id = t.id WHERE c.is_active = 1 AND ' . db_datediff('c.pub_date') . ' < 7 ORDER BY t.precedence, c.pub_date'); $return = ''; $lastType = ''; while ($c = db_fetch($clips)) { if ($lastType != $c['type']) { $return .= '<div style="font-size:18px;margin-top:24px;">' . $c['type'] . ':</div>'; $lastType = $c['type']; } $return .= draw_link($c['url'], $c['title'], false, array('style' => 'font-size:14px;')) . '<br>' . $c['publication'] . '<br>' . format_date($c['pub_date'], ' ', 'M d, Y', false) . $c['description']; } echo draw_div_class('press_export', $return); echo '<textarea class="press_export">' . htmlentities($return, ENT_QUOTES, 'UTF-8') . '</textarea>'; echo drawBottom();
<?php include '../../include.php'; if (url_action('delete')) { db_delete('soc_whatsnew', $_GET['delete_id']); url_drop('action,delete_id'); } echo drawTop(); $t = new table('soc_whatsnew', drawHeader(array('edit/' => getString('add_new')))); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('updated', 'r', getString('updated')); $t->set_column('delete', 'd', ' '); $result = db_table('SELECT w.id, w.title' . langExt() . ' title, ' . db_updated('w') . ' FROM soc_whatsnew w WHERE w.is_active = 1 ORDER BY w.precedence'); foreach ($result as &$r) { $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('edit.php?id=' . $r['id'], format_string($r['title'], 70)); $r['updated'] = format_date($r['updated']); $r['delete'] = drawColumnDelete($r['id']); } echo $t->draw($result); echo drawBottom();
<?php $array = array(); foreach ($modulettes as $o) { if (!$_SESSION["is_admin"] && !$o["is_public"] && !$o["is_admin"]) { continue; } $array[] = draw_link('/' . $m['folder'] . '/' . $o["folder"] . '/', $o['title']); } $return .= draw_table_rows($array);
} echo drawTop(); if (url_id()) { //form $f = new form('channels', @$_GET['id']); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f); echo $f->draw(); } else { //modules list $t = new table('channels', drawHeader()); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('delete', 'd', ' '); $result = db_table('SELECT id, title' . langExt() . ' title FROM channels WHERE is_active = 1 ORDER BY precedence'); $t->set_draggable('draggy'); foreach ($result as &$r) { $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('channels.php?id=' . $r['id'], $r['title']); $r['delete'] = drawColumnDelete($r['id']); } echo $t->draw($result, 'No modules'); //add new $f = new form('channels'); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f, false); echo $f->draw(); } echo drawBottom();
<?php include "../../include.php"; echo drawTop(); $t = new table(); $t->set_column("organization"); $t->set_column("location"); $t->set_column("updated", "r"); $t->set_title(drawHeader()); $result = db_table("SELECT o.id, o.name organization, z.city, z.state, o.updated_date updated FROM web_organizations o JOIN zip_codes z ON o.zip = z.zip ORDER BY o.name"); foreach ($result as &$r) { $r["organization"] = draw_link("organization_view.php?id=" . $r["id"], format_string($r["organization"], 50)); $r["location"] = $r["city"] . ", " . $r["state"]; $r["updated"] = "<nobr>" . format_date($r["updated"]) . "</nobr>"; } echo $t->draw($result); echo drawBottom();
reset($_POST); while (list($key, $value) = each($_POST)) { if ($key == 'email') { $value = draw_link('mailto:' . $value); } elseif ($key == 'departmentID' && $value) { $value = db_grab('SELECT departmentName FROM departments WHERE departmentID = ' . $value); } elseif ($key == 'officeID' && $value) { $value = db_grab('SELECT name FROM offices WHERE id = ' . $value); } elseif ($key == 'organization_id' && $value) { $value = db_grab('SELECT title from organizations WHERE id = ' . $value); } elseif ($key == 'Additional Info') { $value = nl2br($value); } $message .= '<tr><td class="left">' . $key . '</td><td>' . $value . '</td></tr>'; } $message .= '<tr><td colspan="2" class="bottom">' . draw_link($link, 'click here') . '</td></tr>'; $message = '<table border="1">' . $message . '</table>'; emailAdmins($message, $subject); } url_change('account_confirm.php'); } echo drawSimpleTop(getString('login_account_request')); echo drawMessage(getString('login_account_request_msg')); $f = new form('users_requests', false, getString('login_account_request')); $f->set_field(array('type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence', 'name' => 'organization_id', 'label' => getString('organization'), 'required' => true, 'null_value' => getString('please_select'))); $f->set_field(array('type' => 'text', 'name' => 'firstname', 'label' => getString('name_first'))); $f->set_field(array('type' => 'text', 'name' => 'nickname', 'label' => getString('nickname'))); $f->set_field(array('type' => 'text', 'name' => 'lastname', 'label' => getString('name_last'))); $f->set_field(array('type' => 'text', 'name' => 'title', 'label' => getString('staff_title'))); $f->set_field(array('type' => 'text', 'name' => 'phone', 'label' => getString('telephone'))); $f->set_field(array('type' => 'text', 'name' => 'email', 'label' => getString('email')));
y.title' . langExt($lang) . ' type, t.created_date FROM bb_topics t LEFT JOIN bb_topics_types y ON t.type_id = y.id WHERE t.id = ' . $_POST['topic_id']); $reply = db_grab('SELECT f.description' . langExt($lang) . ' description, ISNULL(u.nickname, u.firstname) firstname, u.lastname FROM bb_followups f JOIN users u ON f.created_user = u.id WHERE f.id = ' . $id); $channels_text = db_array('SELECT c.title' . langExt($lang) . ' FROM bb_topics_to_channels t2c JOIN channels c ON t2c.channel_id = c.id WHERE t2c.topic_id = ' . $_POST['topic_id']); $channels_text = implode(', ', $channels_text); $message = '<p style="font-weight:bold;">' . $reply['firstname'] . ' ' . $reply['lastname'] . ' ' . getString('bb_followup', $lang) . '</p> <p>' . getString('title', $lang) . ': ' . draw_link(url_base() . '/bb/topic.php?id=' . $id, $topic['title']) . '</p> <p>' . getString('channels_label', $lang) . ': ' . $channels_text . '</p>'; if ($topic['type']) { $message .= '<p>' . getString('category', $lang) . ': ' . $topic['type'] . '</p>'; } $message .= '<div style="color:#555; border-top:1px dotted #555; padding-top:5px; margin-top:5px;">' . $reply['description'] . '</div>'; emailUser($emails, 'RE: ' . $topic['title'], $message); } } bbDrawRss(); url_change(); } elseif (isset($_GET['delete'])) { db_delete('bb_topics'); bbDrawRss(); url_change('/bb/'); } elseif (isset($_GET['deleteFollowupID'])) {
} echo drawTop(); if (url_id()) { //form $f = new form('links', @$_GET['id']); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f); echo $f->draw(); } else { //modules list $t = new table('links', drawHeader()); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('delete', 'd', ' '); $result = db_table('SELECT l.id, l.title' . langExt() . ' title FROM links l WHERE l.is_active = 1 ORDER BY l.precedence'); $t->set_draggable('draggy'); foreach ($result as &$r) { $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('links.php?id=' . $r['id'], $r['title']); $r['delete'] = drawColumnDelete($r['id']); } echo $t->draw($result, 'No modules'); //add new $f = new form('links'); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f, false); echo $f->draw(); } echo drawBottom();
<?php include "../include.php"; echo drawTop(); if (url_id()) { $title = db_grab('SELECT title' . langExt() . ' title FROM press_clips_types WHERE id = ' . $_GET["id"]); $result = db_table('SELECT c.id, c.title' . langExt() . ' title, c.pub_date, c.publication' . langExt() . ' publication, ISNULL(c.created_date, c.updated_date) updated FROM press_clips c ' . getChannelsWhere('press_clips', 'c', 'clip_id') . ' AND c.type_id = ' . $_GET["id"] . ' ORDER BY updated DESC'); $t = new table('press_clips', drawHeader(false, $title)); $t->set_column('title', 'l', getString('title')); $t->set_column('publication', 'l', getString('publication')); $t->set_column('pub_date', 'r', getString('published')); foreach ($result as &$r) { $r['title'] = draw_link('clip.php?id=' . $r['id'], format_string($r['title'], 50)); $r['pub_date'] = format_date($r['pub_date']); } echo $t->draw($result, 'There are no clips tagged <i>' . $title . '</i>.'); } else { $t = new table('press_clips', drawHeader()); $t->set_column('category', 'l', getString('category')); $t->set_column('clips', 'r', getString('clips')); $result = db_table('SELECT t.id, t.title' . langExt() . ' category, (SELECT COUNT(*) FROM press_clips c WHERE c.type_id = t.id) clips FROM press_clips_types t ORDER BY t.precedence'); foreach ($result as &$r) { $r['category'] = draw_link(url_query_add(array('id' => $r['id']), false), $r['category']); } echo $t->draw($result); } echo drawBottom();
<?php include '../../include.php'; echo drawtop(); $t = new table('ldcodes', drawHeader(false, 'Long Distance Codes')); $t->set_column('code', 'c', 'Code'); $t->set_column('user', 'l', 'User'); $result = db_table('SELECT l.code, (SELECT CONCAT_WS(",", u.lastname, u.firstname, u.id) FROM users u WHERE u.longDistanceCode = l.code AND u.is_active = 1) user FROM ldcodes l ORDER BY user'); foreach ($result as &$r) { if ($r['user']) { $r['group'] = 'Assigned'; list($lastname, $firstname, $id) = explode(',', $r['user']); $r['user'] = draw_link('/staff/view.php?id=' . $id, $lastname . ', ' . $firstname); } else { $r['group'] = 'Unassigned Codes'; } } echo $t->draw($result, 'There are no long distance codes'); echo drawBottom();
$f->set_field(array('name' => 'content', 'label' => getString('file'), 'type' => 'file', 'additional' => getString('upload_max') . file_get_max())); $f->set_field(array('name' => 'categories', 'label' => getString('categories'), 'type' => 'checkboxes', 'options_table' => 'dl_categories', 'option_title' => 'title', 'linking_table' => 'dl_docs_to_categories', 'object_id' => 'doc_id', 'option_id' => 'category_id')); echo $f->draw(); } else { $result = db_table('SELECT d.id, d.title, ' . db_updated('d') . ', d.extension, c.title "group" FROM dl_docs d JOIN dl_docs_to_categories d2c ON d.id = d2c.doc_id JOIN dl_categories c ON d2c.category_id = c.id ORDER BY c.precedence, d.title;'); $links = $page['is_admin'] ? array(url_query_add(array('doc_id' => 'new'), false) => getString('add_new')) : false; $t = new table('dl_docs', drawHeader($links)); $t->set_column('icon', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('updated', 'r', getString('updated')); foreach ($result as &$r) { $link = 'info.php?id=' . $r['id']; $r['icon'] = file_icon($r['extension'], $link); $r['title'] = draw_link($link, $r['title']); if (getOption('languages')) { $r['title'] .= ' (' . $r['language'] . ')'; } $r['updated'] = format_date($r['updated']); } echo $t->draw($result, getString('documents_empty')); } echo drawBottom();
<?php include "../include.php"; echo drawTop(); $result = db_table('SELECT c.id, c.title' . langExt() . ' title, c.pub_date, t.title' . langExt() . ' "group", c.publication' . langExt() . ' publication, ' . db_updated('c') . ' FROM press_clips c JOIN press_clips_types t ON c.type_id = t.id ' . getChannelsWhere('press_clips', 'c', 'clip_id') . ' ORDER BY t.title, pub_date DESC', 20); $t = new table('press-clips', drawHeader(array('edit.php' => getString('add_new')))); $t->set_column('title', 'l', getString('title')); foreach ($result as &$r) { $r['title'] = draw_link("clip.php?id=" . $r["id"], format_string($r["title"], 80)) . '<br>' . $r["publication"] . ' <span class="light">' . format_date($r["pub_date"]) . '</span>'; } echo $t->draw($result, getString('pressclips_recent_empty')); include "edit.php"; echo drawBottom();
function emailITticket($id, $scenario, $admin = false, $debug = false) { global $_josh, $page; $ticket = db_grab('SELECT u.id, (SELECT COUNT(*) FROM users_to_modules a WHERE a.user_id = u.id AND a.module_id = 3) isUserAdmin, t.title, t.created_user, t.description, t.departmentID, ISNULL(u.nickname, u.firstname) first, u.lastname last, u.email, ' . db_updated('u') . ', t.created_date, t.priorityID, t.statusID, d.shortName department, t.type_id, y.description type, u2.email as ownerEmail, t.ownerID, ISNULL(u2.nickname, u2.firstname) as ownerName FROM helpdesk_tickets t LEFT JOIN helpdesk_tickets_types y ON t.type_id = y.id JOIN users u ON t.created_user = u.id JOIN departments d ON t.departmentID = d.departmentID LEFT JOIN users u2 ON t.ownerID = u2.id WHERE t.id = ' . $id); //yellow box if ($scenario == "followup") { $subject = "Followup On Your Helpdesk Ticket"; $message = drawMessage('There\'s been followup on your Helpdesk ticket - please see below. <b>Don\'t reply to this email!</b> Instead, please ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view your ticket') . ' in the intranet ticketing system.<br><br><b>Note:</b> if you add this sender to your "safe senders list," pictures will always download.'); } elseif ($scenario == "followupadmin") { $subject = "Admin Followup on Helpdesk Ticket"; $message = drawMessage(draw_link('/staff/view.php?id=' . user(), $_SESSION['full_name']) . ' just made an administrative followup on this Helpdesk ticket. Regular staff were not copied on this message.'); } elseif ($scenario == "closed") { $subject = "Your Ticket Has Been Closed"; $message = drawMessage('This is to let you know that your ticket has been closed. <b>Don\'t reply to this email!</b> You can still followup on this thread by ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'viewing your ticket') . ' in the intranet ticketing system.<br><br><b>Note:</b> if you add this sender to your "safe senders list," pictures will always download.'); } elseif ($scenario == "assign") { $subject = "Your Ticket Has Been Assigned"; $message = drawMessage(draw_link('/staff/view.php?id=' . user(), $_SESSION["full_name"]) . ' has assigned this ticket to ' . draw_link('/staff/view.php?id=' . $ticket['ownerID'], $ticket["ownerName"]) . '<b>Don\'t reply to this email!</b> Instead, please ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view your ticket') . ' in the intranet ticketing system.<br><br><b>Note:</b> if you add this sender to your "safe senders list," pictures will always download.'); } elseif ($scenario == "new") { $subject = "New " . $ticket["department"] . " Ticket Posted"; $message = drawMessage('This is to let you know that a new ticket has just been posted to the Helpdesk. You can ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view the ticket') . ' in the intranet ticketing system.'); } elseif ($scenario == "critical") { $subject = "Critical " . $ticket["department"] . " Ticket Still Open"; $message = drawMessage('A ticket flagged "Critical" is open on the Helpdesk. You can ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view the ticket') . ' in the intranet ticketing system.'); } //$message .= drawtableStart() . drawHeaderRow(false, 2); //recipients arrays $users = array(); $admins = array(); if ($ticket["isUserAdmin"]) { $admins[] = $ticket["email"]; } else { $users[] = $ticket["email"]; } if ($page['is_admin']) { $admins[] = $_SESSION["email"]; } else { $users[] = $_SESSION["email"]; } //add owner if ticket is assigned if ($ticket["ownerEmail"]) { $admins[] = $ticket["ownerEmail"]; } //owner logically has to be admin $d_user = new display($page['breadcrumbs'] . $ticket['title'], false, false, 'thread'); $d_admin = new display($page['breadcrumbs'] . $ticket['title'], false, false, 'thread'); $d_user->row(drawName($ticket['created_user'], $ticket['first'] . ' ' . $ticket['last'], $ticket['created_date'], true, BR, $ticket['updated']), draw_h1($ticket['title']) . $ticket['description']); $d_admin->row(drawName($ticket['created_user'], $ticket['first'] . ' ' . $ticket['last'], $ticket['created_date'], true, BR, $ticket['updated']), draw_h1($ticket['title']) . $ticket['description']); //get followups $followups = db_query('SELECT u.id, f.message, (SELECT COUNT(*) FROM users_to_modules u2m WHERE u2m.user_id = u.id AND u2m.module_id = 3 AND u2m.is_admin = 1) isUserAdmin, ISNULL(u.nickname, u.firstname) firstname, u.lastname, u.email, f.created_date, f.is_admin, f.created_user, ' . db_updated('u') . ' FROM helpdesk_tickets_followups f INNER JOIN users u ON f.created_user = u.id WHERE f.ticketID = ' . $id . ' ORDER BY f.created_date'); while ($f = db_fetch($followups)) { $d_admin->row(drawName($f['created_user'], $f['firstname'] . ' ' . $f['lastname'], $f['created_date'], true, BR, $f['updated']), $f['message']); if (!$f['is_admin']) { $d_user->row(drawName($f['created_user'], $f['firstname'] . ' ' . $f['lastname'], $f['created_date'], true, BR, $f['updated']), $f['message']); } if ($f['isUserAdmin']) { $admins[] = $f['email']; } else { $users[] = $f['email']; } } $admins = array_remove($_SESSION['email'], array_unique($admins)); $users = array_remove($_SESSION['email'], array_unique($users)); if ($debug) { die(drawEmail($message . $d_admin->draw())); } //special codes for email //todo: put this in db, possibly by adding something to the users table or something if ($scenario == "new" && $ticket["departmentID"] == 3) { $admins = array('*****@*****.**', '*****@*****.**', '*****@*****.**'); } if ($scenario == "new" && $ticket["departmentID"] == 13) { $admins = array('*****@*****.**', '*****@*****.**'); } if ($scenario == "new" && $ticket["departmentID"] == 2) { $admins = array('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**'); } if ($scenario == "critical" && $ticket["departmentID"] == 8) { $admins = array('*****@*****.**'); } if (count($admins)) { //$admins = join(", ", $admins); email($admins, drawEmail($message . $d_admin->draw()), $subject); error_debug('admin message emailed to ' . implode(', ', $admins) . ' admins', __FILE__, __LINE__); } if (count($users) && $scenario != "followupadmin" && !$admin) { //$users = join(", ", $users); email($users, drawEmail($message . $d_user->draw()), $subject); error_debug('user message emailed to ' . implode(', ', $users) . ' users', __FILE__, __LINE__); } }
<?php include '../include.php'; $result = db_table('SELECT u.id link, u.firstname, u.lastname, u.title, d.departmentName department, o.title organization, u.email, (SELECT CASE WHEN u.rankID = 9 THEN "No" ELSE "Yes" END) is_staff FROM users u LEFT JOIN departments d ON u.departmentID = d.departmentID JOIN organizations o ON u.organization_id = o.id WHERE u.is_active = 1 ORDER BY u.lastname, u.firstname'); foreach ($result as &$r) { $r['link'] = draw_link(url_base() . '/staff/view.php?id=' . $r['link'], $r['link']); } file_array($result, 'employees');
<?php include '../include.php'; echo drawTop(); $t = new table('staff', drawHeader()); $t->set_column('picture', 'l', ' ', '50'); $t->set_column('name'); $t->set_column('organization'); $t->set_column('last_login', 'r'); $result = db_table('SELECT u.id, u.firstname, u.lastname, u.title, o.title organization, u.organization_id, u.lastLogin last_login FROM users u LEFT JOIN organizations o ON u.organization_id = o.id JOIN users_to_modules u2m ON u.id = u2m.user_id WHERE u.is_active = 1 AND u2m.module_id = ' . $page['module_id'] . ' ORDER BY u.lastname, u.firstname'); foreach ($result as &$r) { $link = '/staff/view.php?id=' . $r['id']; $r['picture'] = draw_img(file_dynamic('users', 'image_small', $r['id'], 'jpg'), $link); $r['name'] = draw_link($link, $r['firstname'] . ' ' . $r['lastname']); if ($r['organization']) { $r['organization'] = draw_link('/staff/organizations.php?id=' . $r['organization_id'], $r['organization']) . '<br>'; } $r['organization'] .= $r['title']; $r['last_login'] = format_date($r['last_login']); } echo $t->draw($result, 'No administrators for this module yet!'); echo drawBottom();
<?php $return .= '<tr><td colspan="2">' . drawSelectUser('staff', false, true, 0, true, true, "Jump to Staff Member") . '</td></tr>'; $pages = db_table('SELECT url, title' . langExt() . ' title FROM pages WHERE module_id = ' . $m['id'] . ' AND is_active = 1 AND is_hidden <> 1 AND is_admin <> 1 ORDER by precedence'); foreach ($pages as &$p) { $p = draw_link('/staff/' . $p['url'], $p['title']); } $return .= draw_table_rows($pages);
<?php include "../../include.php"; if (url_id('module_id')) { $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE module_id = ' . $_GET['module_id'] . ' ORDER BY p.precedence'); } elseif (url_id('modulette_id')) { $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE modulette_id = ' . $_GET['modulette_id'] . ' ORDER BY p.precedence'); } else { url_change('./'); } echo drawTop(); //pages list $t = new table('pages', drawHeader()); $t->set_column('is_hidden', 'd', ' '); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('url'); $t->set_draggable('draggy'); foreach ($result as &$r) { $r['is_hidden'] = draw_form_checkbox('foo', !$r['is_hidden'], false, 'ajax_set(\'pages\', \'is_hidden\', ' . $r['id'] . ', ' . abs($r['is_hidden'] - 1) . ');'); $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('page.php?id=' . $r['id'], $r['title']); if (empty($r['url'])) { $r['url'] = 'index.php'; } } echo $t->draw($result, 'No pages'); echo drawBottom();
<?php include "../include.php"; echo drawTop(); $t = new table('bb_topics', drawHeader()); $t->set_column('contact', 'l', 'Contact Record'); $t->set_column('action'); //$t->set_column('contact', 'l', 'Done By'); $t->set_column('when', 'r'); $result = db_table('SELECT c.id, c.firstname, c.lastname, c.updated_date, ' . db_updated('c') . ' FROM contacts c ORDER BY updated DESC', 40); foreach ($result as &$r) { $r['contact'] = draw_link('contact.php?id=' . $r['id'], $r['lastname'] . ', ' . $r['firstname']); $r['action'] = $r['updated_date'] ? 'Update' : 'New Contact'; $r['when'] = format_date($r['updated']); } echo $t->draw($result); echo drawBottom();
<?php include "../../include.php"; echo drawTop(); $blurbs = db_table("SELECT \n\t\tr.id,\n\t\tr.title,\n\t\tt.icon,\n\t\tISNULL(r.updated_date, r.created_date) updated\n\t\tFROM employer_strategy_resources r\n\t\tJOIN docs_types t ON r.type_id = t.id\n\t\tWHERE r.is_active = 1\n\t\tORDER BY updated DESC", 20); $t = new table("web_news_blurbs"); $t->set_column("icon"); $t->set_column("title"); $t->set_column("updated", "r"); $t->set_title(drawHeader(array("add new" => "edit/"))); foreach ($blurbs as &$b) { $b["icon"] = draw_img($b["icon"]); $b["title"] = draw_link("edit/?id=" . $b["id"], $b["title"]); $b["updated"] = format_date($b["updated"]); } echo $t->draw($blurbs); echo drawBottom();
c.address_2, RIGHT("00000" + RTRIM(c.zip), 5) zip, c.phone, c.fax, c.mobile_phone, c.email, z.city, z.state, c.notes FROM contacts c LEFT JOIN zip_codes z ON c.zip = z.zip WHERE c.id = ' . $_GET['id']); $d = new display(); $d->row('Name', $r['salutation'] . ' ' . $r['firstname'] . ' ' . $r['lastname'] . ($r['suffix'] ? ', ' . $r['suffix'] : '')); $d->row('Company', $r['organization']); $d->row('Job Title', $r['title']); $d->row('Address', $r['address_1'] . ($r['address_2'] ? BR . $r['address_2'] : false) . BR . $r['city'] . ', ' . $r['state'] . ' ' . $r['zip']); $d->row('Phone', $r['phone']); $d->row('Fax', $r['fax']); $d->row('Mobile', $r['mobile_phone']); $d->row('Email', draw_link('mailto:' . $r['email'])); $d->row('Notes', nl2br($r['notes'])); echo $d->draw(); $result = db_table('SELECT t.id, t.tag, y.title "group" FROM contacts_to_tags c2t JOIN contacts_tags t ON c2t.tag_id = t.id JOIN contacts_tags_types y ON t.type_id = y.id WHERE c2t.contact_id = ' . $_GET['id']); $t = new table('contacts_tags'); $t->set_column('tag'); foreach ($result as &$r) { $r['tag'] = draw_link('value.php?id=' . $r['id'], $r['tag']); } echo $t->draw($result); echo drawBottom();
db_delete('organizations', $_GET['delete_id']); url_drop('delete_id,action'); } echo drawTop(); if (url_id()) { //form $f = new form('organizations', @$_GET['id']); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f); echo $f->draw(); } else { //modules list $t = new table('organizations', drawHeader()); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('delete', 'd', ' '); $result = db_table('SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence'); foreach ($result as &$r) { $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('organizations.php?id=' . $r['id'], $r['title']); $r['delete'] = drawColumnDelete($r['id']); } echo $t->draw($result, 'No organizations'); //add new $f = new form('organizations'); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); echo $f->draw(false, false); } echo drawBottom();
<?php $orgs = db_table('SELECT id, title' . langExt() . ' title FROM external_orgs_types ORDER BY title'); foreach ($orgs as &$o) { $o = draw_link('/' . $m["folder"] . '/type.php?id=' . $o["id"], format_string($o["title"], 21)); } $return .= draw_table_rows($orgs);