File manager - Edit - /home/autoph/public_html/data03252025consolidation/app/misc/refresh_notification.php
Back
<?php include_once("../../cfg/db.php"); $notification_type_id = $_POST['type']; $employee_id = $_SESSION['user']['id']; // $db -> sql_query("UPDATE `notification_list` SET `status`= 1 WHERE `notification_type_id` = '$notification_type_id' AND `employee_id` = '$employee_id' "); $notification_total_count = $db -> select("SELECT count(id) FROM `notification_list` WHERE `employee_id` = '$employee_id' AND `status` != '1'"); $return_arr['count'] = ""; $return_arr['sub_count'] = "0"; $return_arr['data'] = ""; if($notification_total_count > 0){ $return_arr['count'] = $notification_total_count; $return_arr['sub_count'] = $notification_total_count; } $notification_list = $db -> sql_query("SELECT nl.description,nt.link,nl.record_id,nl.employee_id,nl.generate_by_employee_id, DATE_FORMAT(`date_time`,'%M %d, %Y - %h:%m %p') as date_time FROM `notification_list` nl INNER JOIN notification_type nt ON nt.id = nl.`notification_type_id` WHERE nl.`employee_id` = '$employee_id' AND nl.status = 0 ORDER BY nl.date_time DESC LIMIT 5"); // foreach($notification_list as $data){ // if($notification_total_count < 1){ // break; // } // $link = $data['link']; // $data = $data['data']; // $return_arr['data'] = "<div class='dropdown-divider'></div> // <a href='$link' class='dropdown-item'> // <i class='fas fa-file mr-2'></i> $data // <!-- <span class='float-right text-muted text-sm'>2 days</span> --> // </a> // <div class='dropdown-divider'></div>"; // } foreach($notification_list as $data){ if($notification_total_count < 1){ break; } $header_date_time = $data['date_time']; $header_record_id = $data['record_id']; $header_employee_id = $data['employee_id']; $header_generate_by_employee_id = $data['generate_by_employee_id']; $header_description = $data['description']; $header_link = $data['link'].$db -> base64_url_encode( '{"record_id":"'.$header_record_id.'","generate_by_employee_id":"'.$header_generate_by_employee_id.'","employee_id":"'.$header_employee_id.'"}' ); $return_arr['data'] = $return_arr['data'] . "<div class='dropdown-divider'></div> <a href='$header_link' > <p class='dropdown-item' style='white-space: normal;'> <i class='fas fa-file mr-2'></i> $header_description <p class='text-right text-sm text-muted mt-0 mb-0 mr-1'><i class='far fa-clock mr-1'></i> $header_date_time </p> <p> </a> <div class='dropdown-divider'></div>"; } echo json_encode($return_arr); ?>
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings