Mini Shell

Direktori : /home2/aravindar/public_html/admin/ajax/
Upload File :
Current File : /home2/aravindar/public_html/admin/ajax/com_action.php

<?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== 'delete'){
$event_id = $_POST['news_id'];
$sql = "UPDATE  tb1_committees SET status=0,crm_id='$admin_id',updated_log='$today' WHERE com_id='$event_id'";
$content_res = mysqli_query($conn, $sql); 	
$code = 'done';
}
else if($type== 'add')
{
$name = mysqli_real_escape_string($conn,$_POST['name']);
$position = mysqli_real_escape_string($conn,$_POST['position']);
$c_type = mysqli_real_escape_string($conn,$_POST['c_type']);
$designation = mysqli_real_escape_string($conn,$_POST['designation']);

$sql = "INSERT INTO tb1_committees(name,designation,position,type,status,crm_id,updated_log,created_log) VALUES ('$name','$designation','$position','$c_type','1','$admin_id','$today','$today')";
//echo $sql;
$content_res = mysqli_query($conn, $sql); 
$code = 'done';
}
else if($type== 'update')
{
$com_id = $_POST['com_id'];	
$name = mysqli_real_escape_string($conn,$_POST['name']);
$position = mysqli_real_escape_string($conn,$_POST['position']);
$c_type = mysqli_real_escape_string($conn,$_POST['c_type']);
$designation = mysqli_real_escape_string($conn,$_POST['designation']);
$status = $_POST['status'];	

$sql = "UPDATE tb1_committees SET name='$name',designation='$designation',position='$position',type='$c_type',status='$status',crm_id='$admin_id',updated_log='$today' WHERE com_id='$com_id'";
//echo $sql;
$content_res = mysqli_query($conn, $sql); 
$code = 'done';
}
echo $data = json_encode($code);
?>

Zerion Mini Shell 1.0