<!--- report detail-->
<?php 
include '../fusionchart/Class/FusionCharts.php';
include '../fusionchart/graph/graph.php';
$var_msdate = datetimetomysql($var_sdate);
$var_medate = datetimetomysql($var_edate);
/* $sql = " select s.nStaffId,s.vLogin,count(r.nReplyId) as rpcnt,";
  $sql .=" count(r.nReplyId)-count(r1.tPvtMessage) as cmtcnt,count(p.nStaffId) as pntcnt,";
  $sql .=" sum(r3.vReplyTime)/count(r.nReplyId) as avgtimecnt from sptbl_staffs  s ";
  $sql .=" inner join dummy d on (d.num<4) left join sptbl_replies r on(d.num=0 and";
  $sql .=" s.nStaffId=r.nStaffId and (r.dDate>='$var_msdate' and r.dDate<='$var_medate')) left join sptbl_replies r1 on(d.num=1 and s.nStaffId=r1.nStaffId ";
  $sql .=" and r1.tPvtMessage='' and (r1.dDate>='$var_msdate' and r1.dDate<='$var_medate')) left join sptbl_personalnotes p on(d.num=2 and ";
  $sql .=" s.nStaffId=p.nStaffId and  (p.dDate>='$var_msdate' and p.dDate<='$var_medate') ) left join sptbl_replies r3 on(d.num=3 and s.nStaffId=r3.nStaffId and r3.vReplyTime>0 and (r3.dDate>='$var_msdate' and r3.dDate<='$var_medate'))";
 */
if ($var_staffcmbid != 0) {
    $sqlUser = mysql_query("SELECT * FROM sptbl_staffs WHERE nStaffId = '" . addslashes($var_staffcmbid) . "'");
} else {
    $sqlUser = mysql_query("SELECT * FROM sptbl_staffs");
}
?>

<!--<div class="content_section_title"><h3><?php 
echo TEXT_LBL1 . "&nbsp;" . $var_sdate . "&nbsp;" . TEXT_LBL2 . "&nbsp;" . $var_edate . "";
?>
</h3></div>-->

<table width="100%" border="0"  cellpadding="0" cellspacing="0" class="list_tbl">

<?php 
if ($sqlUser) {
    while ($userRes = mysql_fetch_array($sqlUser)) {
示例#2
0
    exit;
} elseif (!is_executable("./purgedtickets/attachments")) {
    echo "<table><tr><td>admin/purgedtickets/attachments " . TEXT_NEED_EXECUTE . "</td></tr></table>";
    ob_flush();
    flush();
    exit;
}
$var_comp = $_GET["cmp"];
$var_dept = trim($_GET["dpt"]);
$var_status = trim($_GET["st"]);
$var_owner = trim($_GET["own"]);
$var_user = trim($_GET["usr"]);
//$var_from = $_GET["frm"];
//$var_to = $_GET["to"];
$var_from = datetimetomysql($_GET["frm"], "/");
$var_to = datetimetomysql($_GET["to"], "/");
$var_compop = $_GET["cop"];
$var_deptop = $_GET["dop"];
$var_deptlp = $_GET["dlp"];
$var_statusop = $_GET["sop"];
$var_statuslp = $_GET["slp"];
$var_ownerop = $_GET["oop"];
$var_ownerlp = $_GET["olp"];
$var_userop = $_GET["uop"];
$var_userlp = $_GET["ulp"];
$flag_where = false;
$flag_sub = false;
if ($var_comp != "") {
    $var_compop = $var_compop == "m" ? "=" : "!=";
    $sql = "Select distinct t.nTicketId from sptbl_tickets t inner join sptbl_depts d on\r\n\t\tt.nDeptId = d.nDeptId  Where \r\n\t\t(d.nCompId" . $var_compop . "'" . addslashes($var_comp) . "' ";
    $flag_where = true;
示例#3
0
    }
} elseif ($_POST["postback"] == "U") {
    $sql = "Select nTemplateId from sptbl_templates Where nTemplateId='" . mysql_real_escape_string($var_id) . "'";
    if (mysql_num_rows(executeSelect($sql, $conn)) > 0) {
        $var_title = trim($_POST["txtTitle"]);
        $var_desc = trim($_POST["txtDesc"]);
        $dup_flag = 0;
        //check duplicate  template title to block page refrsh
        $sql = "select *  from sptbl_templates  WHERE   vTemplateTitle ='" . mysql_real_escape_string($var_title) . "'";
        $sql .= " and  nTemplateId   !={$var_id}";
        $rs = executeSelect($sql, $conn);
        if (mysql_num_rows($rs) > 0) {
            $dup_flag = 1;
        }
        if (validateUpdation() == true and $dup_flag == 0) {
            $var_validdate = datetimetomysql($var_validdate);
            $sql = "Update sptbl_templates  set vTemplateTitle ='" . mysql_real_escape_string($var_title) . "',\r\n\t\t\t\t\t     tTemplateDesc ='" . mysql_real_escape_string($var_desc) . "',\r\n\t\t\t\t\t     dDate  =now()\r\n\t\t\t\t\t     where nTemplateId='" . mysql_real_escape_string($var_id) . "'";
            executeQuery($sql, $conn);
            //Insert the actionlog
            if (logActivity()) {
                $sql = "Insert into sptbl_actionlog(nALId,nStaffId,vAction,vArea,nRespId,dDate) Values('','{$var_staffid}','" . TEXT_UPDATION . "','Templates','" . mysql_real_escape_string($var_id) . "',now())";
                executeQuery($sql, $conn);
            }
            $var_message = MESSAGE_RECORD_UPDATED;
            $flag_msg = 'class="msg_success"';
        } else {
            $var_message = MESSAGE_RECORD_ERROR;
            $flag_msg = 'class="msg_error"';
        }
    } else {
        $var_id = "";
<!--- report detail-->
<?php 
$var_msdate = datetimetomysql($var_sdate, "/");
$var_medate = datetimetomysql($var_edate, "/");
$sql = " Select s.nStaffId,s.vLogin,count(r.nStaffId) as replies,round(avg(vReplyTime),2) as 'reply',\n\t\t\t\t\t\t\t\tround(avg(sr.nMarks),2) as 'ratings',count(distinct(r.nTicketId)) as 'tickets' from sptbl_staffs s \n\t\t\t\t\t\t\t\tinner join dummy d on(d.num<2)\n\t\t\t\t\t\t\t\tleft outer join sptbl_replies r on(d.num=0 and s.nStaffId=r.nStaffId and\n\t\t\t\t\t\t\t\tr.dDate >='{$var_msdate}' and r.dDate <= '{$var_medate}')\n\t\t\t\t\t\t\t\tleft outer join sptbl_staffratings sr on(d.num=1 and s.nStaffId=sr.nStaffId) ";
if ($var_staffcmbid > 0) {
    $sql .= " where s.nStaffId='" . addslashes($var_staffcmbid) . "' ";
}
$sql .= " group by s.nStaffId order by s.vLogin";
$rs = executeSelect($sql, $conn);
?>

<?php 
if (mysql_num_rows($rs) > 0) {
    ?>
<tr>
    <td  colspan="5" align="center"><a href="javascript:printSpecial();"><?php 
    echo TEXT_PRINT;
    ?>
</a></td>
</tr>


<tr><td width="100%">
        <div id="printReady">
            <table width="100%" border=0 cellspacing=1 cellpadding=2 class="column1">
                <tr class="listing">
                    <td  colspan="5" align="center" class="fieldnames"><?php 
    echo TEXT_LBL1 . "&nbsp;<b>" . $var_sdate . "</b>&nbsp;" . TEXT_LBL2 . "&nbsp;<b>" . $var_edate . "</b>";
    ?>
</td>