"; include("blank.inc"); } elseif(!isset($nav) or ($nav==0)) { $sid=md5(uniqid(mt_rand(),1)); $sql="select * from tbl_hd_transaction where (assignedto=$uid and status<>2 and status<>3) ORDER BY transdtrecd;"; $requests=odbc_exec($connect,$sql); include("help_desk/hdlist.inc"); } elseif($_GET['nav']==1 or $_POST['nav']==1) {//chose client if($function==0) { include("help_desk/hdrequest.inc"); } elseif($function==13) { require("help_desk/hdbkupreq.inc"); } else { include("help_desk/hdrequest.inc"); } } elseif($_GET['nav']==2 or $_POST['nav']==2) { include("help_desk/hd.inc"); } elseif($_GET['nav']==3 or $_POST['nav']==3) {//process submitted data, allow user to add actions taken if($function!=13) { $date=check_errors($date); $needed=check_errors($date); $desc=check_errors($desc); $needed=check_errors($needed); $sql="insert into tbl_hd_transaction (transoperator, transcaller, transnatureofcall, transissuedesc, transdtrecd, transurgency, assignedto, sessionID, status, transdtNeeded, irritation_id, client_id) values ($uid,$call,$category,'$desc','$date',$urgent, $assign, '$sid', 1, '$needed', $irritation, $client);"; odbc_exec($connect,$sql); $sql="select transkey from tbl_hd_transaction where sessionid='$sid';"; $request=odbc_exec($connect,$sql); $r=odbc_result($request,1); $header=""; //$complete="Add Actions to Request $r | Log Another Help Desk Request"; $links="Add Actions to Request $r | Log Another Request For This Client"; //$sql="select * from tbl_hd_transaction where (assignedto=$uid and status<>2 and status<>3) ORDER BY transdtrecd;"; $sql="select transkey from tbl_hd_transaction where sessionid='$sid'"; $requests=odbc_exec($connect,$sql); $requestid=odbc_result($requests,1); include("help_desk/hdview.inc"); } else { $date=check_errors($date); $desc=check_errors($desc); $sql="insert into tbl_hd_transaction (transoperator, transnatureofcall,transissuedesc, transdtrecd, transurgency, assignedto, sessionid, status, client_id) values ($uid,$category,'$desc','$date',2, $uid, '$sid', 2, $client);"; odbc_exec($connect,$sql); $header=""; include("help_desk/blank.inc"); } } elseif($_GET['nav']==4 or $_POST['nav']==4)//log actions for the request { include("help_desk/actions.inc"); } elseif($_GET['nav']==5 or $_POST['nav']==5)//submitted new action on existing request { //$user $adate=check_errors($adate); $adesc=check_errors($adesc); $adesc=shorten($adesc,500); if($time=="") { $time=0; } $sql="insert into tbl_action_transaction (actionuserfkey, actiondt, actiondesc, hd_transaction_Fkey, time_hours, is_billable, is_onsite) values ($user, '$adate', '$adesc', $requestid, $time, $is_billable, $is_onsite);"; odbc_exec($connect,$sql); $complete="Add Actions to this Request
Log Another Help Desk Request"; $links="Update Request $requestid's Status | Add Actions to Request $requestid"; include("help_desk/hdviewonly.inc"); } elseif($_GET['nav']==6 or $_POST['nav']==6)//list of requests { $user=$uid; $sql="select * from tbl_hd_transaction where (assignedto=$uid and status<>2 and status<>3) ORDER BY transdtrecd;"; $requests=odbc_exec($connect,$sql); include("help_desk/hdlist.inc"); } elseif($_GET['nav']==7 or $_POST['nav']==7) //chose a specific request to look at { //now need to determine if you are going to update the status //or add actions to the request. $links="Update Request $requestid's Status | Add Actions to Request $requestid"; include("help_desk/hdviewonly.inc"); //include("hd/choose.inc"); } elseif($_GET['nav']==8 or $_POST['nav']==8) //see status of request to change it { $links="Add Actions to Request $r | Log Another Request For This Client"; include("help_desk/hdview.inc"); } elseif($_GET['nav']==9 or $_POST['nav']==9)//update status of hd request { $sql="update tbl_hd_transaction set status=$complete, assignedto=$assign where transkey=$requestid;"; odbc_exec($connect,$sql); if($complete==2 or $complete==3) { $sql="update tbl_hd_transaction set compl_dt=getdate() where transkey=$requestid;"; odbc_exec($connect,$sql); } $sql="select sum(time_hours) as total_hours from tbl_action_transaction where is_billable=1 and hd_transaction_fkey=$requestid"; $hourstobill=odbc_exec($connect,$sql); $hours=odbc_result($hourstobill,1); if($hours>0) { /*Sample Code using the built-in mail function $from = get_user_email($uid); $recip = get_user_email($assign); $subj="New Help Desk Request Assigned to You"; $today = date("F j, Y, g:i a"); $body="Help Desk Message"; $body.="

A new help desk request was assigned to you on $today. "; $body.="You can find the record just added with the key value of: $requestid."; $body.="

Please login to the help desk log on the intranet here. "; $body.="Navigate to Help Desk, then Review Help Desk Log to find this ticket. You will be asked to login with your Windows network credentials to access this information."; $body.="

Please contact your system administrator if you do not have a password or your password does not allow you to see the log."; $body.="

Sincerely,


Intranet Administrator"; $body.=""; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers.="From: $from"; $additional_parameters="-f ".$from; mail("$recip","$subj","$body","$headers","$additional_parameters"); */ $from="admin@2wgmultimedia.com"; $recip="billing@2wg.net"; $subj="New Billable Call Closed"; $today = date("F j, Y, g:i a"); $body="
A new billable call was closed on $today. You can find the record just added with the key value $requestid; total hours to be billed totals $hours.
 
Sincerely,

Net Admin - 2wg.net
"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers.="From: $from"; $additional_parameters="-f ".$from; mail("$recip","$subj","$body","$headers","$additional_parameters"); } $sql="select * from tbl_hd_transaction where (assignedto=$uid and status<>2 and status<>3) ORDER BY transdtrecd;"; $requests=odbc_exec($connect,$sql); include("help_desk/hdlist.inc"); } elseif($_GET['nav']==10 or $_POST['nav']==10)//add actions to the request { include("help_desk/actions.inc"); } elseif($_GET['nav']==11 or $_POST['nav']==11)//view the request's details { include("help_desk/hdviewonly.inc"); } elseif($_GET['nav']==12 or $_POST['nav']==12)//view all requests { $user=$uid; include("help_desk/hdlistall.inc"); } elseif($_GET['nav']==100)//add new client { include("help_desk/addnewclient.inc"); } elseif($_GET['nav']==101 or $_POST['nav']==101)//update clients listing { if($client<>"") { $sql="insert into clients (name) values ('$client');"; odbc_exec($connect,$sql); } $header=""; include("blank.inc"); } elseif($_GET['nav']==110)//add new contact to existing client { include("help_desk/addnewcontact.inc"); } elseif($_GET['nav']==111 or $_POST['nav']==111)//update contacts on client { if($pnumber=="") {$pnumber="000 000 0000";} if($email=="") {$email="nobody@2wg.net";} if($lname<>"" and $fname<>"") { $sql="insert into contacts (last_name, first_name, client_id, phone_number, email_address) values ('$lname','$fname',$client,'$pnumber','$email');"; odbc_exec($connect,$sql); } $header=""; include("blank.inc"); } elseif($_GET['nav']==200 or $_POST['nav']==200)//view other user's list of help desk calls { include("help_desk/hdlistall.inc"); } elseif($_GET['nav']==300)//search for help desk tickets { include("help_desk/search.inc"); } elseif($_GET['nav']==301 or $_POST['nav']==301)//search results { $sql="select *, username from tbl_hd_transaction inner join pwd_master_tbl on pwd_master_tbl.user_id=tbl_hd_transaction.assignedto where transkey>0 "; if($keyword!="") { $sql=$sql."and ("; $keyword=explode(',',$keyword); $size=count($keyword); for($i=0;$i<$size;$i++) { $sql=$sql." transissuedesc like '%$keyword[$i]%' "; if($size>1 and $i!=($size-1)) { $sql=$sql." or "; } } $sql=$sql.")"; } if($client!=0) { $sql=$sql." and client_id=$client "; } if($category!=0) { $sql=$sql." and transnatureofcall=$category "; } if($user!=0) { $sql=$sql." and assignedto=$uid "; } $sql=$sql." order by tbl_hd_transaction.transdtrecd desc;"; //echo "$sql
"; $requests=odbc_exec($connect,$sql); include("help_desk/hdlist.inc"); } ?>