echo "<span class='closed'>CLOSED</span>"; } elseif ($row->status == '3') { echo "<span class='hold'>ON HOLD</span>"; } elseif ($row->status == '4') { echo "<span class='escalated'>ESCALATED</span>"; } elseif ($row->status == '5') { echo "<span class='hold'>SENT AWAY</span>"; } else { echo "<span class='open'>" . date("d/m/y", strtotime($row->opened)) . "</span>"; } ?> </td> <td> <?php if ($row->assigned !== NULL) { echo engineer_friendlyname($row->assigned); } else { echo "NULL"; } ?> </td> <td> <?php $datetime1 = new DateTime(date("Y-m-d", strtotime($row->opened))); $datetime2 = new DateTime(date("Y-m-d")); $interval = date_diff($datetime1, $datetime2); echo $interval->format('%a days'); ?> </td> <td> <form action="<?php
<?php session_start(); include_once $_SERVER['DOCUMENT_ROOT'] . '/config/config.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/includes/functions.php'; ?> <h3>Engineer Breakdown This Month</h3> <?php $STH = $DBH->Prepare("SELECT Month(closed) AS MonthNum, helpdesk, calls.closeengineerid, assigned, count(callid) AS Totals\n\t\tFROM calls\n\t\tWHERE status = 2 AND Month(closed) = :month AND Year(closed) = :year\n\t\tGROUP BY calls.closeengineerid\n\t\tORDER BY Totals"); $STH->bindParam(':month', date("m"), PDO::PARAM_INT); $STH->bindParam(':year', date("o"), PDO::PARAM_INT); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); while ($row = $STH->fetch()) { $lables .= "'" . engineer_friendlyname($row->closeengineerid) . "',"; $data .= $row->Totals . ","; } $data = rtrim($data, ","); $lables = rtrim($lables, " ,"); ?> <script type="text/javascript"> $(function() { // WAIT FOR DOM // Draw Bar chartist.js var data = { labels: [<?php echo $lables; ?> ], series: [[<?php
<input type="hidden" id="id" name="id" value="<?php echo $row->callid; ?> " /> <button name="submit" value="submit" type="submit" class="calllistbutton" title="view call"><?php echo substr(strip_tags($row->title), 0, 40); ?> ...</button> </form> </td> <td> <?php if ($row->status == "2") { ?> <?php echo strstr(engineer_friendlyname($row->closeengineerid), " ", true); ?> <?php } else { ?> <?php echo strstr($row->engineerName, " ", true); ?> <?php } ?> </td> </tr> <?php
<td> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post" class="yourcallslist"> <input type="hidden" id="id" name="id" value="<?php echo $latest->callid; ?> " /> <input type="image" name="submit" value="submit" src="/public/images/svg/ICONS-view.svg" width="24" height="25" class="icon" alt="View ticket" title="View ticket"/> </form> </td> </tr> <tr> <td colspan="6"><span class="smalltxt"><?php echo engineer_friendlyname($row->idengineers); ?> checked into ticket on <?php echo date("d/m/Y H:i", strtotime($latest->stamp)); ?> </span> </td> </tr> <?php } ?> </table><br/> <?php } ?>
// List users logged in echo "* Engineers still logged in \n"; $STH = $DBH->Prepare("\n\t\t\t\t\t\t\tSELECT *\n\t\t\t\t\t\t\tFROM engineers_punchcard a1\n\t\t\t\t\t\t\tinner join\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tselect max(stamp) as max\n\t\t\t\t\t\t\t\tfrom engineers_punchcard\n\t\t\t\t\t\t\t\tgroup by engineerid\n\t\t\t\t\t\t\t) a2\n\t\t\t\t\t\t\ton a1.stamp = a2.max\n\t\t\t\t\t\t\tWHERE direction =1\n\t\t\t\t\t\t\t"); //$STH = $DBH->Prepare("SELECT * FROM engineers_punchcard GROUP BY engineerid ORDER BY id DESC"); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); if ($STH->rowCount() == 0) { echo "0 engineers logged in\n"; } while ($row = $STH->fetch()) { // auto logout each engineer and stamp db so managment know it was a auto logout $STHloop = $DBH->Prepare("INSERT INTO engineers_punchcard (engineerid, direction, stamp, note) VALUES (:id, '0', :date, 'auto logout')"); $STHloop->bindParam(":id", $row->engineerid, PDO::PARAM_INT); $STHloop->bindParam(":date", date("c"), PDO::PARAM_STR); $STHloop->execute(); echo "auto logged out " . engineer_friendlyname($row->engineerid) . "\n"; } echo "\n-- Ending Process Logouts : " . date("h:i:s") . "\n"; // Log CRON Task to database $message = "CRON JOB ENDED : " . date("d:m:y h:i:s"); $STH = $DBH->Prepare("INSERT INTO scheduled_calls_cron_log (message) VALUES (:message)"); $STH->bindParam(":message", $message, PDO::PARAM_STR); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); // End CRON echo "\nCRON JOB ENDED : " . date("h:i:s") . "\n"; // mark the stop time $stop_time = MICROTIME(TRUE); // get the difference in seconds $time = $stop_time - $start_time; print "Elapsed time was {$time} seconds.\n";
// while results loop details to view while ($row = $STH->fetch()) { ?> <h1>Change Control #<?php echo $row->id; ?> </h1> <fieldset> <legend>Details</legend> <h3><?php echo $row->server; ?> </h3> <p><?php echo nl2br($row->changemade); ?> </p> <p><?php echo engineer_friendlyname($row->engineersid); ?> - <?php echo date("d/m/Y @ h:s", strtotime($row->stamp)); ?> </p> <p><em><?php echo $row->tags; ?> </em></p> </fieldset> <?php }
<?php session_start(); include_once $_SERVER['DOCUMENT_ROOT'] . '/config/config.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/includes/functions.php'; ?> <div id="ajaxforms"> <p class="note">Showing all open performance objectives set for <?php echo engineer_friendlyname($_SESSION['engineerId']); ?> </p> <table> <tbody> <?php $STH = $DBH->Prepare("SELECT * FROM performance_review_objectives WHERE engineerid = :assigned AND status !='2'"); $STH->bindParam(":assigned", $_SESSION['engineerId'], PDO::PARAM_STR); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); if ($STH->rowCount() == 0) { echo "<p>0 performance objectives set</p>"; } while ($row = $STH->fetch()) { ?> <tr> <td> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post" class="assignedtoyou"> <input type="hidden" id="id" name="id" value="<?php echo $row->id;
$hour = date("G"); if ($hour > $OFHTIME) { $OFH = $OFHMESSAGE; } else { $OFH = null; } } // Update view and update call list ?> <h2>Thank you</h2> <p><?php if ($assignedengineer !== NULL) { ?> Your ticket has been added and has been assigned to <?php echo engineer_friendlyname($assignedengineer); } else { ?> Your ticket has been added to <?php echo CODENAME; } ?> </p> <?php echo $OFH; ?> <p>An engineer will be in touch shortly if they require additional information, any correspondence will be emailed to the contact address you entered in the form.</p> <?php if ($SLA) { ?> <h3>Service Level Agreement</h3>
$STH = $DBH->Prepare("SELECT * FROM engineers WHERE helpdesk <= :helpdeskid"); $hdid = 3; } else { $STH = $DBH->Prepare("SELECT * FROM engineers WHERE helpdesk = :helpdeskid"); $hdid = $_SESSION['engineerHelpdesk']; } $STH->bindParam(":helpdeskid", $hdid, PDO::PARAM_STR); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); while ($row = $STH->fetch()) { // email all engineers to let them know details of change control // Construct message $to = $row->engineerEmail; $message = "<span style='font-family: arial;'><p>Change control has been added</p>"; $message .= "<p><b>" . $_POST['servername'] . "</b></p>"; $message .= "<p>" . engineer_friendlyname($_POST['engineer']) . "</p>"; $message .= "<p>" . date("l jS \\of F Y h:i:s A") . "</p>"; $message .= "<p>" . $_POST['details'] . "</p>"; $message .= "<p>To view the details of this change please <a href='" . HELPDESK_LOC . "'>Visit " . CODENAME . "</a></p>"; $message .= "<p>This is an automated message please <b>do not reply</b></p>"; $msgtitle = "Change Control Added (" . $_POST['servername'] . ")"; $headers = 'From: Helpdesk@cheltladiescollege.org' . "\r\n"; $headers .= 'Reply-To: helpdesk@cheltladiescollege.org' . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); // In case any of our lines are larger than 70 characters, we wordwrap() $message = wordwrap($message, 70, "\r\n"); // Send email mail($to, $msgtitle, $message, $headers); }
while ($row = $STH->fetch()) { $totalstars = $row->stars; } // Top engineer this week $STH = $DBH->Prepare("SELECT closeengineerid, Count(callid) as count FROM calls WHERE closed >= DATE_SUB(CURDATE(),INTERVAL 6 DAY) AND status=2 AND helpdesk <=3 GROUP BY closeengineerid ORDER BY count DESC LIMIT 1"); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); while ($row = $STH->fetch()) { $topengineer = engineer_friendlyname($row->closeengineerid); } // Top engineer of all time $STH = $DBH->Prepare("SELECT closeengineerid, Count(callid) as count FROM calls WHERE closed >= DATE_SUB(CURDATE(),INTERVAL 10 YEAR) AND status=2 AND helpdesk <=3 GROUP BY closeengineerid ORDER BY count DESC LIMIT 1"); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); while ($row = $STH->fetch()) { $topengineeralltime = engineer_friendlyname($row->closeengineerid); } // Avg Ticket Time $STH = $DBH->Prepare("SELECT callid, AVG(DATEDIFF(opened, closed)) AS avgticketdays FROM calls WHERE status=2"); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute(); while ($row = $STH->fetch()) { $avgtickettime = abs(ROUND($row->avgticketdays)); } ?> <table> <tbody> <?php $STH = $DBH->Prepare("SELECT sum(case when calls.closed >= DATE_SUB(CURDATE(),INTERVAL 6 DAY) THEN 1 ELSE 0 END) AS Last7, sum(case when calls.closed >= DATE_SUB(CURDATE(),INTERVAL 0 DAY) THEN 1 ELSE 0 END) AS Last1 FROM calls WHERE helpdesk <= 3"); $STH->setFetchMode(PDO::FETCH_OBJ); $STH->execute();
echo $_SERVER['PHP_SELF']; ?> " method="post" class="assignedtoyou"> <input type="hidden" id="id" name="id" value="<?php echo $row->callid; ?> " /> <input type="submit" name="submit" value="<?php echo substr(strip_tags($row->title), 0, 40); ?> ..." alt="View ticket" title="View ticket" class="calllistbutton"/> </form> </td> <td> <?php $engineername = engineer_friendlyname($row->assigned); $fullname = explode(' ', $engineername); $first_name = $fullname[0]; echo $first_name; ?> </td> <td><?php echo $row->total_days_to_close - $row->close_eta_days; ?> days</td> </tr> <?php } } ?> </tbody>