Revonzy Mini Shell
<?php
include('../../config.php');
require_once(PATH_LIBRARIES.'/classes/DBConn.php');
require_once(PATH_LIBRARIES.'/functions/fun1.php');
$db = new DBConn();
$pathmulti = ROOT."/image_upload/awards/";
$pathmulti1 = ROOT."/image_upload/awards/thumb/";
///*******************************************************
/// Validate that the data already exist or not
///*******************************************************
/*if($_POST['type']=="validate")
{
$sql="SELECT Category_Name FROM category WHERE Category_Name='".$_POST['cate_name']."' and Category_Id<>'".$_REQUEST['id']."'";
$res=$db->ExecuteQuery($sql);
if(empty($res))
{
echo 0;
}
else
{
echo 1;
}
}*/
///*******************************************************
/// To Insert New category /////////////////////////////////
///*******************************************************
if($_POST['type']=="addClient")
{
$shortDescription = mysql_real_escape_string($_POST['shortDescription']);
$Description = mysql_real_escape_string($_POST['description']);
$website = mysql_real_escape_string($_POST['website']);
/*echo $Description;
exit();*/
$tblfield=array('Client_Name','Location','Project','Short_Description','Description','Website');
$tblvalues=array($_POST['name'],$_POST['location'],$_POST['project'],$shortDescription,$Description,$website);
$res=$db->valInsert("clients",$tblfield,$tblvalues);
if(empty($res))
{
echo 0;
}
else
{
echo 1;
}
}
///*******************************************************
/// Edit Sub news
///*******************************************************
if($_POST['type']=="editClient")
{
$con= mysql_connect(SERVER,DBUSER,DBPASSWORD);
mysql_query('SET AUTOCOMMIT=0',$con);
mysql_query('START TRANSACTION',$con);
try
{
$shortDescription = mysql_real_escape_string($_POST['shortDescription']);
$Description = mysql_real_escape_string($_POST['description']);
$website = mysql_real_escape_string($_POST['website']);
$tblfield=array('Client_Name','Location','Project','Short_Description','Description','Website');
$tblvalues=array($_POST['name'],$_POST['location'],$_POST['project'],$shortDescription,$Description,$website);
$condition="Client_Id=".$_POST['id'];
$res=$db->updateValue('clients',$tblfield,$tblvalues,$condition);
if(!$res)
{
throw new Exception('0');
}
echo 1;
mysql_query("COMMIT",$con);
}
catch(Exception $e)
{
echo $e->getMessage();
mysql_query('ROLLBACK',$con);
mysql_query('SET AUTOCOMMIT=1',$con);
}
}
///*******************************************************
/// Update Status
///*******************************************************
if($_POST['type']=="CheckStatus")
{
$mysql=$db->ExecuteQuery("SELECT * FROM testimonials WHERE Test_Id='".$_REQUEST['id']."'");
//Check Here Any Records IS Availble OR Not
if(count($mysql)>0)
{
if($mysql[1]['Status']==1)
{
$status=0;
}else
{
$status=1;
}
$tblfield=array('Status');
$tblvalues=array($status);
$condition="Test_Id=".$_POST['id'];
$res=$db->updateValue('testimonials',$tblfield,$tblvalues,$condition);
if (empty($res))
{
//echo mysql_error();
echo 0;
}
else
{
echo 1;
}
}
}
///*******************************************************
/// Delete row from testimonials table
///*******************************************************
if($_POST['type']=="delete")
{
$con= mysql_connect(SERVER,DBUSER,DBPASSWORD);
mysql_query('SET AUTOCOMMIT=0',$con);
mysql_query('START TRANSACTION',$con);
try
{
//Delete Row
$tblname="clients";
$condition="Client_Id=".$_POST['id'];
$res=$db->deleteRecords($tblname,$condition);
if(!$res)
{
throw new Exception('0');
}
echo 1;
mysql_query("COMMIT",$con);
}
catch(Exception $e)
{
echo $e->getMessage();
mysql_query('ROLLBACK',$con);
mysql_query('SET AUTOCOMMIT=1',$con);
}
}
EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com