$font ".SECURITY.""; } else { function calc( $date1, $date2 ) { $diff = $date1-$date2; $seconds = 0; $hours = 0; $minutes = 0; if($diff % 86400 > 0) { $rest = ($diff % 86400); $days = ($diff - $rest) / 86400; if( $rest % 3600 > 0 ) { $rest1 = ($rest % 3600); $hours = ($rest - $rest1) / 3600; if( $rest1 % 60 > 0 ) { $rest2 = ($rest1 % 60); $minutes = ($rest1 - $rest2) / 60; $seconds = $rest2; }else $minutes = $rest1 / 60; }else $hours = $rest / 3600; }else $days = $diff / 86400; return array( "days" => $days, "hours" => $hours, "minutes" => $minutes, "seconds" => $seconds); } header("Cache-control: private"); head(); $login = $_COOKIE['PHPCookie']; $userdetail = explode("&", $login); $username = $userdetail[0]; $passdetail = explode("=", $login); $password = $passdetail[1]; if (!$username && !$password) { echo "$font ".LOGIN_TITLE." "; loginf(); } else { // start of getting user data $d = new dbC(); $d->connect($db_host, $db_username, $db_password, $db); $sql_result = $d->query("select * from $db_prefix"."users where username='$username' and password='$password'"); if($sql_result) { while ($r = $d->fetch_array($sql_result)) { $userid = $r["id"]; $name = $r["name"]; $email = $r["email"]; $groupid = $r["group_id"]; $adminis = $r["admin"]; $level = $r["level"]; } } $d->close(); // end of getting user information // start of header data // static html $username=strtolower($username); $admin=strtolower($admin); if($username == "$admin" && !empty($admin) || $level == "0"){ echo "
 
  "; echo "
$font $font "; echo "$font ".C_USER." - ".MOD_USER." | ".MAN_GROUP." | ".OPTIONS." | ".REPORTS.""; echo "
$font $name ($username) UID: $userid | ".LOGOUT." | ".EDIT_A." | "; if($allowmsg == "1"){ echo "".MESS_C.""; $d->connect($db_host, $db_username, $db_password, $db); $getpm1=$d->query("select * from $db_prefix"."privatemessage where to_userid='$userid'"); $getnum1=$d->numrows($getpm1); $d->close(); if($getnum1 == "0" || $getnum1 == ""){ echo " (0)"; } else { echo " ($getnum1)"; } } echo "
"; echo "
 
 
"; } echo "$font $back"; echo "

$font
".SOA."


"; if($level == "0"){ /* Get Tickets */ $d->connect($db_host, $db_username, $db_password, $db); $result=$d->query("select * from $db_prefix"."list order by ticket_id desc"); $getC=$d->numrows($result); $i = $l + $sortby; $j = $l + 1; $k = "$l" - $sortby; $t = $getC - $i; if ($i > $getC) { $i = $getC; } if($getC == "0"){ echo "$font


".ERROR18."

"; } else { echo "
"; if ($i < $getC) { echo "
".NEXT." $t "; } if ($i > "$sortby") { echo "".PREVIOUS." $sortby"; } echo "
"; echo "

"; while ($l < $i) { $ticket_id=$d->result($result,$l,"ticket_id"); $ticket_severity=$d->result($result,$l,"ticket_severity"); $ticket_added_date=$d->result($result,$l,"ticket_added_date"); $ticket_lastaction_date=$d->result($result,$l,"ticket_lastaction_date"); $ticket_short_description=$d->result($result,$l,"ticket_short_description"); $ticket_sub=stripslashes($ticket_short_description); $ticket_sub=safeHTML($ticket_sub); $ticket_status=$d->result($result,$l,"ticket_status"); $ticket_severity=$d->result($result,$l,"ticket_severity"); $ticket_createdby_userid=$d->result($result,$l,"ticket_createdby_userid"); $ticket_createdbyemail=$d->result($result,$l,"ticket_createdbyemail"); $ticket_createdbyemail= eregi_replace("'","",$ticket_createdbyemail); $ticket_createdbyemail=safeHTML($ticket_createdbyemail); $ticket_owner_id=$d->result($result,$l,"ticket_owner_id"); $ticket_group=$d->result($result,$l,"groups"); $queryit=$d->query("select ticket_action_date from $db_prefix"."tickets_action where ticket_id='$ticket_id'"); $total=$d->numrows($queryit); while($getdates=$d->fetch_array($queryit)){ } if($ticket_owner_id != "0" || empty($ticket_owner_id)){ $getUser=$d->query("select username from $db_prefix"."users where id='$ticket_owner_id'"); $UserIS=$d->fetch_array($getUser); $UserN=$UserIS['username']; } $getC=$d->query("select ticket_comment_id from $db_prefix"."tickets_comment where ticket_id='$ticket_id' and ticket_comment_update='1'"); $c=$d->numrows($getC); $getU=$d->query("select ticket_comment_id from $db_prefix"."tickets_comment where ticket_id='$ticket_id' and ticket_comment_update='2'"); $u=$d->numrows($getU); echo "
"; if($ticket_status == "Closed"){ $diff=calc( strtotime( "$ticket_lastaction_date" ), strtotime( "$ticket_added_date" ) ); $days=$diff['days']; $days="".$days." days"; $hours=$diff['hours']; $hours="".$hours." hours"; $minutes=$diff['minutes']; $minutes="".$minutes." minutes"; $seconds=$diff['seconds']; $seconds="".$seconds." seconds"; if($ticket_status == "Closed"){ $ticket_status="Closed"; } echo ""; if($diff['days'] == "0" && $diff['hours'] == "0"){ echo ""; } elseif($diff['days'] == "0" && $diff['hours'] != "0"){ echo ""; } echo " "; } echo "
$font Ticket ID : $ticket_id   $font Created on: $ticket_added_date
$font Ticket Status : $font $ticket_status  
$font Ticket : $font $ticket_sub  
$font Ticket Response Time: "; $diff=calc( strtotime( "$ticket_lastaction_date" ), strtotime( "$ticket_added_date" ) ); $days=$diff['days']; $days="".$days." days"; $hours=$diff['hours']; $hours="".$hours." hours"; $minutes=$diff['minutes']; $minutes="".$minutes." minutes"; $seconds=$diff['seconds']; $seconds="".$seconds." seconds"; if($diff['days'] == "0" && $diff['hours'] == "0" && $diff['minutes'] == "0" && $diff['seconds'] == "0"){ echo "$font No Updates."; } elseif($diff['days'] == "0" && $diff['hours'] == "0"){ echo "$font Update Delay was $minutes, $seconds."; } elseif($diff['days'] == "0" && $diff['hours'] != "0"){ echo "$font Update Delay was $hours, $minutes, $seconds."; } elseif($diff['days'] != "0" && $diff['hours'] != "0"){ echo "$font Update Delay was $hours, $minutes, $seconds."; } echo " Comments: $c
Updates: $u
$font Closed by: $UserN$font Tickets closed in: $minutes, $seconds.$font Tickets closed in: $hours, $minutes, $seconds.$font Closed on: $ticket_lastaction_date

"; ++$l; } } $d->close(); } else { echo "$font


".ERRORADMIN."

"; } } // end of logged in user check } // end of admin file check foot(); ?>