require("./global.php"); $primaryTableName = "notice_board"; array( // field_name [type, isrequired, array_select, inner_type] <= "template" "notice" => ["input", "", "", "text"], "customer_id" => ["input", "", "", "text"], );; if (isset($_POST['create_package'])) { $actionId = escape($_POST['actionId']); $notice = escape($_POST['notice']); $customer_id = escape($_POST['customer_id']); $end_date = escape($_POST['end_date']); $message = escape($_POST['message']); // Assuming $timeAdded should contain the current timestamp $timeAdded = time(); if ($actionId == "") { $id = generateRandomString(); $actionId = $id; $query = "INSERT INTO jeoXillityCrm_notice_board SET id='$id', notice='$notice', customer_id='$customer_id', timeAdded='$timeAdded', message='$message', userId='$session_userId', end_date='$end_date'"; } else { $query = "UPDATE jeoXillityCrm_notice_board SET id='$actionId', notice='$notice', customer_id='$customer_id', message='$message', end_date='$end_date' WHERE id='$actionId'"; } runQuery($query); header("Location: ?" . generateUrlParams_return(["m" => "Data was saved successfully!", "type" => "success"])); exit(); } if (isset($_GET['delete-record'])) { $id = escape($_GET['delete-record']); $query = "delete from jeoXillityCrm_notice_board where id='$id'"; runQuery($query); } $getData = getAll($con,"SELECT * FROM ".$g_projectSlug."_users"); $myIndexedArray = []; foreach($getData as $k => $v){ $myIndexedArray[$v['id']] = ucfirst($v['name']); } $productData = getAll($con,"SELECT * FROM ".$g_projectSlug."_products"); $productIndexedArray = []; foreach($productData as $k => $v){ $productIndexedArray[$v['id']] = ucfirst($v['title']); } ?>
include("./includes/views/head2.php"); ?>