Esempio n. 1
0
        }
    }
    $ticketinvoicesquery = !empty($ticketinvoicelinks) ? "(\".implode(' AND '," . $ticketinvoicelinks . ").\") OR " : "";
    $totalinvoiced = get_query_val("tblinvoices", "SUM(subtotal+tax+tax2)", "id IN (SELECT invoiceid FROM tblinvoiceitems WHERE description LIKE '%Project #" . $projectid . "%' OR " . $ticketinvoicesquery . " (type='Project' AND relid='" . $projectid . "'))");
    $totalinvoiced = $userid ? formatCurrency($totalinvoiced) : format_as_currency($totalinvoiced);
    $totalpaid = get_query_val("tblinvoices", "SUM(subtotal+tax+tax2)", "id IN (SELECT invoiceid FROM tblinvoiceitems WHERE description LIKE '%Project #" . $projectid . "%' OR " . $ticketinvoicesquery . " (type='Project' AND relid='" . $projectid . "')) AND status='Paid'");
    $totalpaid = $userid ? formatCurrency($totalpaid) : format_as_currency($totalpaid);
    $reportdata['drilldown'][$i]['tableheadings'] = array("Task Name", "Start Time", "Stop Time", "Duration", "Task Status");
    $timerresult = select_query("mod_projecttimes", "mod_projecttimes.start,mod_projecttimes.end,mod_projecttasks.task,mod_projecttasks.completed", array("mod_projecttimes.projectid" => $projectid), "", "", "", "mod_projecttasks ON mod_projecttimes.taskid = mod_projecttasks.id");
    while ($data2 = mysql_fetch_assoc($timerresult)) {
        $rowcount = $rowtotal = 0;
        $taskid = $data2['id'];
        $task = $data2['task'];
        $taskadminid = $data2['adminid'];
        $timerstart = $data2['start'];
        $timerend = $data2['end'];
        $duration = $timerend ? $timerend - $timerstart : 0;
        $taskadmin = getAdminName($taskadminid);
        $starttime = date("d/m/Y H:i:s ", $timerstart);
        $stoptime = date("d/m/Y H:i:s ", $timerend);
        $taskstatus = $data2['completed'] ? "Completed" : "Open";
        $totalprojectstime += $duration;
        $totaltaskstime += $duration;
        ++$rowcount;
        $rowtotal += $ordertotal;
        $reportdata['drilldown'][$i]['tablevalues'][] = array($task, $starttime, $stoptime, project_management_sec2hms($duration), $taskstatus);
    }
    $reportdata['tablevalues'][$i] = array("<a href=\"addonmodules.php?module=project_management&m=view&projectid=" . $projectid . "\">" . $projectid . "</a>", $created, $projectname, $admin, $client, $duedate, $totalinvoiced, $totalpaid, project_management_sec2hms($totaltaskstime), $projectstatus);
    ++$i;
}
$reportdata['footertext'] = "Total Time effort across " . $i . " projects: " . project_management_sec2hms($totalprojectstime);
Esempio n. 2
0
$title = $data['title'];
$message = $data['message'];
$tstatus = $data['status'];
$attachment = $data['attachment'];
$urgency = $data['urgency'];
$lastreply = $data['lastreply'];
$flag = $data['flag'];
$access = validateAdminTicketAccess($id);
if ($access == "invalidid") {
    $aInt->gracefulExit($aInt->lang("support", "ticketnotfound"));
}
if ($access == "deptblocked") {
    $aInt->gracefulExit($aInt->lang("support", "deptnoaccess"));
}
if ($access == "flagged") {
    $aInt->gracefulExit($aInt->lang("support", "flagnoaccess") . ": " . getAdminName($flag));
}
if ($access) {
    exit;
}
$message = strip_tags($message);
$message = nl2br($message);
$message = ticketAutoHyperlinks($message);
if ($pauserid != "0000000000") {
    $result = select_query("tblclients", "", array("id" => $pauserid));
    $data = mysql_fetch_array($result);
    $firstname = $data['firstname'];
    $lastname = $data['lastname'];
    $clientinfo = "<a href=\"clientsprofile.php?userid=" . $puserid . "\">" . $firstname . " " . $lastname . "</a>";
} else {
    $clientinfo = $aInt->lang("support", "notregclient");
Esempio n. 3
0
function buildAdminTicketListArray($result)
{
    global $departmentsarray;
    global $tabledata;
    global $aInt;
    global $tickets;
    while ($data = mysql_fetch_array($result)) {
        $id = $data['id'];
        $ticketnumber = $data['tid'];
        $did = $data['did'];
        $puserid = $data['userid'];
        $name = $data['name'];
        $email = $data['email'];
        $date = $data['date'];
        $title = $data['title'];
        $message = $data['message'];
        $tstatus = $data['status'];
        $priority = $data['urgency'];
        $rawlastactivity = $data['lastreply'];
        $flag = $data['flag'];
        $firstname = $data['firstname'];
        $lastname = $data['lastname'];
        $companyname = $data['companyname'];
        $groupid = $data['groupid'];
        $adminread = $data['adminunread'];
        $adminread = explode(",", $adminread);
        $tickets->addTagCloudID($id);
        if (!in_array($_SESSION['adminid'], $adminread)) {
            $unread = 1;
        } else {
            $unread = 0;
        }
        $alttitle = "";
        $title = trim($title);
        if (!$title) {
            $title = "&nbsp;- " . $aInt->lang("emails", "nosubject") . " -&nbsp;";
        }
        if (80 < strlen($title)) {
            $alttitle = $title;
            $title = substr($title, 0, 80) . "...";
        }
        if ($alttitle) {
            $alttitle .= "\r\n";
        }
        $alttitle .= trim(ticketsummary($message, 250));
        $flaggedto = "";
        if ($flag == $_SESSION['adminid']) {
            $showflag = "user";
        } else {
            if ($flag == 0) {
                $showflag = "none";
            } else {
                $showflag = "other";
                $flaggedto = getAdminName($flag);
            }
        }
        $department = $departmentsarray[$did];
        if ($flaggedto) {
            $department .= " (" . $flaggedto . ")";
        }
        $date = fromMySQLDate($date, "time");
        $lastactivity = fromMySQLDate($rawlastactivity, "time");
        $tstatus = getStatusColour($tstatus);
        $lastreply = getShortLastReplyTime($rawlastactivity);
        $title = "#" . $ticketnumber . " - " . $title;
        if ($unread) {
            $title = "<strong>" . $title . "</strong>";
        }
        $clientinfo = $puserid != "0" ? $aInt->outputClientLink($puserid, $firstname, $lastname, $companyname, $groupid) : $name;
        $ticketlink = "<a href=\"?action=viewticket&id=" . $id . "\"" . ($alttitle ? " title=\"" . $alttitle . "\"" : "") . "" . $ainject . ">";
        $tabledata[] = array("<input type=\"checkbox\" name=\"selectedtickets[]\" value=\"" . $id . "\" class=\"checkall\">", "<img src=\"images/" . strtolower($priority) . ("priority.gif\" width=\"16\" height=\"16\" alt=\"" . $priority . "\" class=\"absmiddle\" />"), $department, "<div style=\"text-align:left;\">" . $ticketlink . $title . "</a></div>", $clientinfo, $tstatus, $lastreply);
    }
}
Esempio n. 4
0
             $deptid = $data['id'];
         }
         openNewTicket($userid, "", $deptid, $subject, $message, "Medium", "", $from);
         $status = "Ticket Imported Successfully";
     } else {
         $tid = substr($subject, $pos + 12, 6);
         $result = select_query("tbltickets", "", array("tid" => $tid));
         $data = mysql_fetch_array($result);
         $tid = $data['id'];
         $result = select_query("tbladmins", "id", array("email" => $email));
         $data = mysql_fetch_array($result);
         $adminid = $data['id'];
         if ($adminid) {
             $userid = 0;
             $from = "";
             $admin = getAdminName($adminid);
         }
         AddReply($tid, $userid, "", $message, $admin, "", $from);
         $status = "Ticket Reply Imported Successfully";
     }
     update_query("tblticketmaillog", array("status" => $status), array("id" => $id));
     redir("display=true&id=" . $id);
 }
 $content = "<p><b>" . $aInt->lang("emails", "to") . ":</b> " . $to . "<br>\n<b>" . $aInt->lang("emails", "from") . ":</b> " . $name . " &laquo;" . $email . "&raquo;<br>\n<b>" . $aInt->lang("emails", "subject") . ":</b> " . $subject . "<br>\n<b>" . $aInt->lang("fields", "status") . ":</b> " . $status;
 if ($status != "Ticket Imported Successfully" && $status != "Ticket Reply Imported Successfully") {
     $content .= " <input type=\"button\" value=\"" . $aInt->lang("system", "ignoreimport") . "\" onclick=\"window.location='" . $_SERVER['PHP_SELF'] . "?display=true&id=" . $id . generate_token("link") . "&action=import'\" />";
 }
 $content .= "</p>\n<p>" . nl2br($message) . "</p>\n<p align=\"center\"><a href=\"#\" onClick=\"window.close();return false\">" . $aInt->lang("addons", "closewindow") . "</a></p>";
 $aInt->content = $content;
 $aInt->displayPopUp();
 exit;
Esempio n. 5
0
 public function getOrders($criteria = array())
 {
     global $aInt;
     $query = " FROM tbltickets LEFT JOIN tblclients ON tblclients.id=tbltickets.userid";
     $filters = $this->buildCriteria($criteria);
     if (count($filters)) {
         $query .= " WHERE " . implode(" AND ", $filters);
     }
     $result = full_query("SELECT COUNT(tbltickets.id)" . $query);
     $data = mysql_fetch_array($result);
     $this->getPageObj()->setNumResults($data[0]);
     $query .= " ORDER BY " . $this->getPageObj()->getOrderBy() . " " . $this->getPageObj()->getSortDirection();
     $query .= " LIMIT " . $this->getQueryLimit();
     $tickets = array();
     $result = full_query("SELECT tbltickets.*,tblclients.firstname,tblclients.lastname,tblclients.companyname,tblclients.groupid" . $query);
     while ($data = mysql_fetch_array($result)) {
         $id = $data['id'];
         $ticketnumber = $data['tid'];
         $did = $data['did'];
         $puserid = $data['userid'];
         $name = $data['name'];
         $email = $data['email'];
         $date = $data['date'];
         $title = $data['title'];
         $message = $data['message'];
         $tstatus = $data['status'];
         $priority = $data['urgency'];
         $rawlastactivity = $data['lastreply'];
         $flag = $data['flag'];
         $adminread = $data['adminunread'];
         $firstname = $data['firstname'];
         $lastname = $data['lastname'];
         $companyname = $data['companyname'];
         $groupid = $data['groupid'];
         $adminread = explode(",", $adminread);
         $unread = in_array(WHMCS_Session::get("adminid"), $adminread) ? 0 : 1;
         $alttitle = "";
         $title = trim($title);
         if (!$title) {
             $title = "&nbsp;- " . $aInt->lang("emails", "nosubject") . " -&nbsp;";
         }
         if (80 < strlen($title)) {
             $alttitle = $title . "\r\n";
             $title = $this->getSummary($title, 80);
         }
         $alttitle .= $this->getSummary($message, 250);
         $flaggedto = "";
         if ($flag == $_SESSION['adminid']) {
             $showflag = "user";
         } else {
             if ($flag == 0) {
                 $showflag = "none";
             } else {
                 $showflag = "other";
                 $flaggedto = getAdminName($flag);
             }
         }
         $department = $this->getDeptName($did);
         if ($flaggedto) {
             $department .= " (" . $flaggedto . ")";
         }
         $date = fromMySQLDate($date, 1);
         $lastactivity = fromMySQLDate($rawlastactivity, 1);
         $tstatus = $this->getStatusColour($tstatus);
         $lastreply = $this->getShortLastReplyTime($rawlastactivity);
         $title = "#" . $ticketnumber . " - " . $title;
         $clientinfo = $puserid != "0" ? $aInt->outputClientLink($puserid, $firstname, $lastname, $companyname, $groupid) : $name;
         $tickets[] = array("id" => $id, "priority" => $priority, "department" => $department, "subject" => $title, "textsummary" => $alttitle, "clientname" => $clientinfo, "status" => $tstatus, "lastreply" => $lastreply, "unread" => $unread);
     }
     return $tickets;
 }
Esempio n. 6
0
 public function getName()
 {
     return getAdminName();
 }
        
          <tbody>
        <?php 
/*..............................Further Training List....................................*/
$user_interest = getUserInterest($conn, $registration_id);
$result1 = $conn->query("SELECT * FROM `job_training_list` WHERE admin_id!=0 and status=1");
while ($row1 = $result1->fetch_assoc()) {
    ?>

          <tr>
            <td data-title="Training Category"><?php 
    echo getInterest($conn, $row1['area_of_interest']);
    ?>
</td>
            <td data-title="Name of the Program"><?php 
    echo getAdminName($conn, $row1['admin_id']);
    ?>
</td>
            <td data-title="Brief Description"><?php 
    echo $row1['description'];
    ?>
</td>
			<td data-title=""><a href="#" class="contact">contact</a></td>
                        
			
          </tr>
          <?php 
}
?>
 
         
Esempio n. 8
0
             exit;
         }
         update_query("tbltickets", array("urgency" => $value), array("id" => (int) $id));
         addTicketLog($id, "Priority changed to " . $value);
         exit;
     }
 }
 if ($sub == "savecustomfields") {
     check_token("WHMCS.admin.default");
     $customfields = getCustomFields("support", $deptid, $id, true);
     foreach ($customfields as $v) {
         $k = $v['id'];
         $customfieldsarray[$k] = $customfield[$k];
     }
     saveCustomFields($id, $customfieldsarray);
     $adminname = getAdminName();
     addTicketLog($id, "Custom Field Values Modified by " . $adminname);
 }
 AdminRead($id);
 if ($replyingadmin && $replyingadmin != $_SESSION['adminid']) {
     $result = select_query("tbladmins", "", array("id" => $replyingadmin));
     $data = mysql_fetch_array($result);
     $replyingadmin = ucfirst($data['username']);
     $smartyvalues['replyingadmin'] = array("name" => $replyingadmin, "time" => $replyingtime);
 }
 $clientname = $contactname = $clientgroupcolour = "";
 if ($pauserid) {
     $clientname = strip_tags($aInt->outputClientLink($pauserid));
 }
 if ($pacontactid) {
     $contactname = strip_tags($aInt->outputClientLink(array($pauserid, $pacontactid)));
Esempio n. 9
0
function hook_project_management_calendar_tasks($vars)
{
    $events = array();
    $result = select_query("mod_projecttasks", "mod_projecttasks.*,(SELECT title FROM mod_project WHERE mod_project.id=mod_projecttasks.projectid) AS projecttitle", "duedate BETWEEN '" . date("Y-m-d", $vars['start']) . "' AND '" . date("Y-m-d", $vars['end']) . "'");
    while ($data = mysql_fetch_assoc($result)) {
        $projecttitle = "Task Due: " . $data['task'] . "\n" . "Project: " . $data['projecttitle'] . "\nStatus: " . ($data['completed'] ? "Completed" : "Pending");
        if ($data['adminid']) {
            $projecttitle .= " (" . getAdminName($data['adminid']) . ")";
        }
        $events[] = array("id" => "prj" . $data['id'], "title" => $projecttitle, "start" => strtotime($data['duedate']), "allDay" => true, "url" => "addonmodules.php?module=project_management&m=view&projectid=" . $data['id']);
    }
    return $events;
}
Esempio n. 10
0
}
echo "</div></td>\n</tr>\n</table>\n</div>\n\n<table width=\"100%\" align=\"center\"><tr><td width=\"50%\" valign=\"top\">";
global $currency;
$currency = getCurrency($userid);
$gateways = getGatewaysArray();
$taskshtml = "";
$taski = $totaltimecount = 0;
$result = select_query("mod_projecttasks", "", array("projectid" => $projectid), "order", "ASC");
while ($data = mysql_fetch_array($result)) {
    $taskid = $data['id'];
    $task = $data['task'];
    $taskadminid = $data['adminid'];
    $taskduedate = $data['duedate'];
    $tasknotes = $data['notes'];
    $taskcompleted = $data['completed'];
    $taskadmin = $taskadminid ? "<span class=\"taskbox\">" . getAdminName($data['adminid']) . "</span> " : "";
    $taskduedate = $taskduedate != "0000-00-00" ? " <span class=\"taskdue\">" . project_management_daysleft($data['duedate'], $vars) . " (" . fromMySQLDate($data['duedate']) . ")</span>" : "";
    $taskcompleted = $taskcompleted ? " checked=\"checked\"" : "";
    $taskedit = project_management_checkperm("Edit Tasks") ? " <a href=\"" . str_replace("&m=view", "&m=edittask", $modulelink) . "&id=" . $taskid . "\"><img src=\"images/edit.gif\" align=\"absmiddle\" title=\"Edit Task\" /></a>" : "";
    $taskdelete = project_management_checkperm("Delete Tasks") ? " <a href=\"#\" onclick=\"deleteTask(" . $taskid . ");return false\"><img src=\"images/delete.gif\" align=\"absmiddle\" /></a>" : "";
    $notesoutput = "<div align=\"center\" style=\"margin-top:5px;\"><table width=\"95%\" align=\"center\"><tr><td><textarea rows=\"3\" style=\"width:100%\" id=\"tasknotestxtarea" . $taskid . "\">" . $tasknotes . "</textarea></td><td width=\"120\" align=\"right\"><input type=\"button\" id=\"savetasknotestxtarea" . $taskid . "\" class=\"savetasknotestxtarea\" value=\"" . $vars['_lang']['savenotes'] . "\" /></td></tr></table></div>";
    $tasknotes = "<a class=\"tasknotestoggler\" id=\"tasknotestogglerclicker" . $taskid . "\"><img src=\"../modules/addons/project_management/images/" . ($tasknotes ? "" : "no") . "notes.png\" align=\"absmiddle\" title=\"View/Edit Notes\" /></a>";
    ++$taski;
    $invoicelinedesc = "" . $taski . ". " . $task . "\r\n";
    $timesoutput = project_management_timesoutput($vars, $taskid);
    $timerid = $GLOBALS['timerid'];
    $timecount = $GLOBALS['timecount'];
    $invoicelinedesc = $GLOBALS['invoicelinedesc'];
    $csstimerdisplay = !get_query_val("mod_projecttimes", "id", array("end" => "", "projectid" => $projectid, "taskid" => $taskid, "adminid" => $_SESSION['adminid'])) ? "style=\"display:none\"" : "";
    $taskshtml .= "<tr id=\"taskholder" . $taskid . "\">\n    <td class=\"sortcol\"></td>\n    <td>\n\t\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t<tr><td width=\"35%\" align=\"left\"><input type=\"checkbox\" name=\"task[" . $taskid . "]\" id=\"tk" . $taskid . "\" value=\"1\"" . $taskcompleted . " onclick=\"updatetaskstatus('" . $taskid . "')\" /> " . $taskadmin . "<label for=\"tk" . $taskid . "\">" . $task . "</label> " . $taskduedate . " <span class=\"taskbox\">" . project_management_sec2hms($timecount) . " Hrs</span> " . $tasknotes . " <div style=\"float:right;\"><a class=\"ajaxstarttimer tasktimerexpander\" id=\"ajaxstarttimer" . $taskid . "\"><img src=\"../modules/addons/project_management/images/starttimer.png\" align=\"absmiddle\" title=\"Start Timer\" /></a> <a id=\"tasktimertoggleclicker" . $taskid . "\" class=\"tasktimertoggle\"><img src=\"../modules/addons/project_management/images/" . ($timerid ? "" : "no") . "times.png\" align=\"absmiddle\" title=\"View Times\" /></a> " . $taskedit . $taskdelete . "</div></td></tr>\n\t\t\t<tr " . $csstimerdisplay . " id=\"tasktimerexpandholder" . $taskid . "\"><td>" . $timesoutput . "</td></tr>\n\t\t\t<tr style=\"display:none\" id=\"tasknotesexpandholder" . $taskid . "\"><td>" . $notesoutput . "</td></tr>\n\t\t</table>\n\t</td>\n</tr>";
    if ($createinvoice) {