You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.7 KiB
65 lines
2.7 KiB
<?php
|
|
|
|
header("Cache-Control: no-cache, must-revalidate");
|
|
header("Expires: Sat, 6 May 1998 03:10:00 GMT");
|
|
|
|
/*===============================================*\
|
|
|| ############################################# ||
|
|
|| # JAKWEB.CH / Version 1.2 # ||
|
|
|| # ----------------------------------------- # ||
|
|
|| # Copyright 2021 JAKWEB All Rights Reserved # ||
|
|
|| ############################################# ||
|
|
\*===============================================*/
|
|
|
|
if (!file_exists('../../config.php')) die('template/business/[available.php] config.php not exist');
|
|
require_once '../../config.php';
|
|
|
|
// Extensive test if that is the real user or not
|
|
if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) die("Nothing to do here");
|
|
|
|
if (!isset($_SESSION['jak_lcpc_idhash'])) die(json_encode(array("status" => 0, "notifciations" => "Account issue")));
|
|
|
|
// Import the correct language file for this customer
|
|
if (isset($_SESSION['jak_lcp_lang']) && file_exists(APP_PATH.'lang/'.$BT_LANGUAGE.'.php')) {
|
|
include_once(APP_PATH.'lang/'.strtolower($BT_LANGUAGE).'.php');
|
|
} else {
|
|
include_once(APP_PATH.'lang/'.JAK_LANG.'.php');
|
|
}
|
|
|
|
// Get the absolute url for the image
|
|
$base_url = str_replace('template/business/', '', BASE_URL);
|
|
|
|
// Reset some vars
|
|
$tccount = 0;
|
|
$cl_tickets = array();
|
|
$ctickets = "";
|
|
|
|
// Now only get the tickets from the logged in client
|
|
$cl_tickets = $jakdb->select("support_tickets", ["[>]support_departments" => ["depid" => "id"]], ["support_tickets.id", "support_tickets.subject", "support_tickets.updated"], ["AND" => ["support_tickets.opid" => $_SESSION['opid'], "support_tickets.status" => 2, "support_tickets.clientid" => JAK_CLIENTID], "ORDER" => ["support_tickets.updated" => "DESC"], "LIMIT" => 10]);
|
|
|
|
if (isset($cl_tickets) && !empty($cl_tickets)) {
|
|
|
|
foreach ($cl_tickets as $ti) {
|
|
|
|
$ctickets .= '<a href="'.str_replace('template/business/', '', JAK_rewrite::jakParseurl(JAK_SUPPORT_URL, 't', $ti["id"], JAK_rewrite::jakCleanurl($ti["subject"]))).'" class="notification-item">
|
|
<div class="notification-text">
|
|
<span class="badge badge-pill badge-success"><i class="fa fa-ticket-alt"></i></span>
|
|
<span class="message">
|
|
'.$ti["subject"].'</span>
|
|
<br>
|
|
<span class="time">'.JAK_base::jakTimesince($ti["updated"], JAK_DATEFORMAT, JAK_TIMEFORMAT).'</span>
|
|
</div>
|
|
</a>';
|
|
|
|
$tccount++;
|
|
|
|
}
|
|
|
|
// Nice format
|
|
$notimsg = sprintf($jkl['hd164'], $tccount);
|
|
|
|
die(json_encode(array("status" => 1, "notifications" => $notimsg, "tickets" => $ctickets)));
|
|
|
|
}
|
|
die(json_encode(array("status" => 0, "notifciations" => $jkl['hd165'])));
|
|
?>
|
|
|