Mini Shell
<?php
include("../config.php");
$conn = dbconnect();
error_reporting(0);
date_default_timezone_set('Asia/Kolkata');
session_start();
$admin_id = $_SESSION['admin_id'];
$today = date( 'Y-m-d H:i:s');
$type = $_POST['type'];
if($type=='active')
{
$news_id = $_POST['news_id'];
$sql = "UPDATE tb1_importantnews SET status=1,crm_id='$admin_id',updated_log='$today' WHERE news_id='$news_id'";
$content_res = mysqli_query($conn, $sql);
$code = 'done';
}
else if($type== 'inactive'){
$news_id = $_POST['news_id'];
$sql = "UPDATE tb1_importantnews SET status=0,crm_id='$admin_id',updated_log='$today' WHERE news_id='$news_id'";
$content_res = mysqli_query($conn, $sql);
$code = 'done';
}
else if($type== 'delete'){
$news_id = $_POST['news_id'];
$sql = "UPDATE tb1_importantnews SET delete_flag=1,crm_id='$admin_id',updated_log='$today' WHERE news_id='$news_id'";
$content_res = mysqli_query($conn, $sql);
$code = 'done';
}
else if($type== 'update')
{
$flash_news = mysqli_real_escape_string($conn,$_POST['flash_news']);
$sql = "INSERT INTO tb1_importantnews(news_content,status,crm_id,delete_flag,updated_log,created_log) VALUES ('$flash_news','0','$admin_id','0','$today','$today')";
$content_res = mysqli_query($conn, $sql);
$code = 'done';
}
echo $data = json_encode($code);
?>
Zerion Mini Shell 1.0