Files
Testing/batemin/admin_header_he_user_note.php

48 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
/**
* @author Ermek
* @copyright Hire-Experts LLC
* @version UserNote 1.01
*/
// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
defined('SE_PAGE') or exit();
include_once "../admin/admin_header_he_core.php";
include_once "../include/class_he_user_note.php";
$user_id = isset($_GET['user_id']) ? (int)$_GET['user_id'] : false;
if ( $admin->admin_exists && $user_id && $page=="admin_viewusers_edit" )
{
if ( isset($_GET['task']) && $_GET['task']=='save_user_note' )
{
$note_result = he_user_note::save_note(0, $user_id, $_GET['note'], true);
}
elseif ( isset($_GET['task']) && $_GET['task']=='delete_user_note' )
{
$note_result = he_user_note::delete_note(0, $user_id, true);
}
if ( isset($note_result) )
{
// CONSTRUCT AND OUTPUT JSON
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
header("Content-Type: application/json");
echo json_encode($note_result);
exit();
}
$note_info = he_user_note::get_note(0, $user_id, true);
$smarty->assign('note_info', $note_info);
}
$smarty->assign('he_user_note', ($page=='admin_viewusers_edit'));
?>