include('check_session.php'); include("../includes/config.php"); include("../includes/conn.php"); $open=0; $closed=0; $final_open=0; $final_close=0; $_SESSION["opera_id"]=$_SESSION["op_id"]; $qry_dept="select dept_id from tbl_relationship where opera_id = $_SESSION[opera_id]"; $res_dept=mysql_query($qry_dept); while($row_dept=mysql_fetch_array($res_dept,MYSQL_ASSOC)) { $open_tic=0; $close_tic=0; $dept_id = $row_dept['dept_id']; $strarvind.= $dept_id.","; } //while... if(strlen($strarvind)>0) { $strarvind = substr($strarvind,0,strlen($strarvind)-1); } //This is for OPEN tickets... if(strlen($strarvind)>0) { $qry_tic="select count(*) from tbl_tickets where dept_id in($strarvind) and ticket_flag='0'"; $res_tic=mysql_query($qry_tic); $rowtic=mysql_fetch_row($res_tic); $arvindcnt_open=$rowtic['0']; mysql_free_result($res_tic); //This is for CLOSED tickets... $qry_tic="select count(*) from tbl_tickets where dept_id in($strarvind) and ticket_flag='1'"; $res_tic=mysql_query($qry_tic); $rowtic=mysql_fetch_row($res_tic); $arvindcnt_close=$rowtic['0']; }else{ $arvindcnt_open=0; $arvindcnt_close=0; } ?>
|
||||||||||||||||||||||||||||||||||||||||||||