".ERROR39."
"; echo "



Return ".BACK."
"; } else { $ticket_id=$_GET['ticket_id']; $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_query = $d->query("select * from $db_prefix"."users where username='$username' and password='$password'"); if($sql_result) { while($r = $d->fetch_row($sql_query)) { $userid = $r["id"]; $name = $r["name"]; $email = $r["email"]; $groupid = $r["group_id"]; $adminis = $r["admin"]; $level = $r["level"]; } } $d->close(); $d->connect($db_host, $db_username, $db_password, $db); $result_checkid = $d->query("select * from $db_prefix"."list where ticket_id='$ticket_id'"); $checkattach = $d->query("select * from $db_prefix"."attachment where ticket_id='$ticket_id'"); if($result_checkid){ while($f = $d->fetch_array($result_checkid)) { $checkid = $f["ticket_id"]; $checkg = $f["groups"]; $ticket_createdby_userid = $f["ticket_createdby_userid"]; $ticket_owner_id = $f["ticket_owner_id"]; } } $d->close(); if(empty($checkid)){ echo "

$font ".ERROR63.""; } else { if($level == "5" && $ticket_createdby_userid != "$userid"){ echo "

$font ".ERROR73."
"; } elseif($level == "2" && $groupid != $checkg && !empty($groupid)) { echo "

$font ".ERROR45."
"; } else { // start of view ticket $d->connect($db_host, $db_username, $db_password, $db); $result_todo = $d->query("select * from $db_prefix"."list where ticket_id='$ticket_id'"); if($result_todo) { while($r = $d->fetch_array($result_todo)) { $view_ticket_id = $r["ticket_id"]; $ticket_added_date = $r["ticket_added_date"]; $ticket_lastaction_date = $r["ticket_lastaction_date"]; $ticket_status = $r["ticket_status"]; $ticket_severity = $r["ticket_severity"]; $ticket_owner_id = $r["ticket_owner_id"]; $ticket_short_description = $r["ticket_short_description"]; $ticket_short_description=stripslashes($ticket_short_description); $ticket_short_description=safeHTML($ticket_short_description); $ticket_full_description = $r["ticket_full_description"]; $ticket_createdby_userid = $r["ticket_createdby_userid"]; $ticket_full_description=stripslashes($ticket_full_description); $ticket_createdbyemail = $r["ticket_createdbyemail"]; $ticket_lastupdate_userid = $r["ticket_lastupdate_userid"]; $ticket_group = $r["groups"]; } } $ticket_full_description = eregi_replace ("=20", "", $ticket_full_description); $ticket_full_description=safeHTML($ticket_full_description); $ticket_full_description = cleanup($ticket_full_description); $result_groupname = $d->query("select * from $db_prefix"."groups where id='$ticket_group'"); if($result_groupname) { while($tt = $d->fetch_array($result_groupname)) { $groupname = $tt["group_name"]; } } if($ticket_createdby_userid == "0" && $ticket_createdbyemail != ""){ $ticket_created_by = "$ticket_createdbyemail"; } else { $result_user = $d->query("select * from $db_prefix"."users where id='$ticket_createdby_userid'"); if($result_user) { while($r = $d->fetch_array($result_user)) { $ticket_created_by = $r["name"]; } } } $result_actionby=$d->query("select * from $db_prefix"."users where id='$ticket_lastupdate_userid'"); if($result_actionby) { while($s = $d->fetch_array($result_actionby)) { $ticket_action_user = $s["name"]; } } if($ticket_action_user != "0"){ $result_owner=$d->query("select * from $db_prefix"."users where id='$ticket_owner_id'"); if($result_owner) { while ($q = $d->fetch_array($result_owner)) { $ticket_owner = $q["name"]; } } } // start of html echo "

$font ".T_I."
$font ".T_ID." $ticket_id $font ".T_SI." $ticket_severity
$font ".CREATED." $ticket_added_date $font ".T_STAT." $ticket_status
$font ".CREATED_BY." $ticket_created_by $font ".T_TYPE." $groupname
$font ".L_ACT." $ticket_lastaction_date $font ".T_OWNER2." "; if($ticket_owner == ""){ echo "$font No Owner"; } else { echo "$font $ticket_owner"; } echo "

$font ".T_LOG."

"; echo "
$font ".TICKET.": $font $ticket_short_description
$font $ticket_full_description

 "; echo "


"; echo "
"; //start of comments and updates. echo "
$font ".UPD."

"; // todo comment update = 1 // todo update = 2 $result_update=$d->query("select * from $db_prefix"."tickets_comment where ticket_id='$ticket_id' and ticket_comment_update ='2' order by ticket_comment_id desc"); $num_update=$d->numrows($result_update); if($num_update == "" || $num_update == "0"){ echo "$font ".ERROR40.""; } else { while ($l < $num_update) { $ticket_id=$d->result($result_update,$l,"ticket_id"); $update_full=$d->result($result_update,$l,"ticket_comment"); $ticket_comment_id=$d->result($result_update,$l,"ticket_comment_id"); $ticket_comment_type=$d->result($result_update,$l,"ticket_comment_type"); $update_full=stripslashes($update_full); $update_full= eregi_replace ("=20", "", $update_full); $update_date=$d->result($result_update,$l,"ticket_comment_date"); $update_userid=$d->result($result_update,$l,"ticket_comment_user"); $update_full=safeHTML($update_full); $update_full = cleanup($update_full); $result_name=$d->query("select * from $db_prefix"."users where id='$update_userid'"); $isuser=$d->numrows($result_name); if($result_name) { while ($a = $d->fetch_array($result_name)) { $updateby = $a["name"]; } } $chris = ereg('@',$update_userid); if($chris == "1"){ $updateby="$update_userid"; } elseif($chris != "1" && $updateby == ""){ $updateby="$font ".ERROR41.""; } echo "
$font ".UDB." $font $update_date  by $updateby ($ticket_comment_type)
$font $update_full"; $getattach=$d->query("select * from $db_prefix"."r_attachment where ticket_id='$ticket_id' and reply_id='$ticket_comment_id'"); while($getdata=$d->fetch_array($getattach)){ echo "$font

".ATTACHMENT." $getdata[filename]"; } echo "

"; ++$l; } } echo "
"; echo "

$font ".COM."

"; $result_comment=$d->query("select * from $db_prefix"."tickets_comment where ticket_id='$ticket_id' and ticket_comment_update ='1' order by ticket_comment_id desc"); $num_comment=$d->numrows($result_comment); if($num_comment == "" || $num_comment == "0"){ echo "$font ".ERROR42.""; } else { while ($k < $num_comment) { $ticket_id=$d->result($result_comment,$k,"ticket_id"); $comment_full=$d->result($result_comment,$k,"ticket_comment"); $comment_full=stripslashes($comment_full); $comment_full=safeHTML($comment_full); $comment_date=$d->result($result_comment,$k,"ticket_comment_date"); $comment_userid=$d->result($result_comment,$k,"ticket_comment_user"); $comment_full = cleanup($comment_full); $result_name_comment=$d->query("select * from $db_prefix"."users where id='$comment_userid'"); if($result_name_comment) { while ($b = $d->fetch_array($result_name_comment)) { $commentby = $b["name"]; } } if($commentby == ""){ $commentby="$font ".ERROR41.""; } echo "
$font ".COM_ADD." $font $comment_date   by $commentby
$font $comment_full

"; ++$k; } } echo "


"; echo "



Return ".BACK."
"; } } } } } ?>