hjkhghoppoopppooppoppoppoopoirh
bnmbertsurheoppopopooooooooooooooopoopopdf'tdfg
/
home
/
u658436918
/
domains
/
pingotravels.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include 'lib/core.php'; //Show All categories if ($_SERVER['REQUEST_METHOD'] == "GET") { if (isset($_GET['show_data'])) { $show = "SELECT * FROM insurance_time_periods"; $result = $conn->query($show); while ($row = $result->fetch_assoc()) { $alldata[] = $row; } echo json_encode($alldata); } } if ($_SERVER['REQUEST_METHOD'] == "POST") { // Adding package Categories if (isset($_POST['time_period'])) { $time_period = $_POST['time_period']; $status = $_POST['status']; $add = "INSERT INTO insurance_time_periods(time_period,status) VALUES('$time_period','$status')"; if ($conn->query($add)) { echo "Success"; } else { echo "Something Wrong"; } } //Show Current Catagory in Edit Modal if (isset($_POST['show_id'])) { $id = $_POST['show_id']; $query = "SELECT * FROM insurance_time_periods WHERE id = " . $id; $result = $conn->query($query); if ($result->num_rows > 0) { $show = $result->fetch_assoc(); echo json_encode($show); } } //Updating package Catagory in Modal if (isset($_POST['save_id'])) { $id = $_POST['save_id']; $time_period = $_POST['edit_time_period']; $status = $_POST['status']; $sql = "UPDATE insurance_time_periods SET time_period = '$time_period', status='$status' WHERE id = $id"; if ($conn->query($sql)) { echo "Success"; } else { echo "Something Wrong"; } } //Delete package categories if (isset($_POST['delete_id'])) { $id = $_POST['delete_id']; $query = "DELETE FROM insurance_time_periods WHERE id = " . $id; if ($conn->query($query)) { echo "Success"; } else { echo "Something Wrong"; } } } ?>