| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/rsdgroup/conf/ |
Upload File : |
<?php
function mysqltoarray($sql){
//echo $sql;
$result = mysql_query($sql);
if(!$result){
die("cannot execute query $sql".mysql_error());
}
$i = 0;
$sqlresult = array();
while($row = mysql_fetch_assoc($result)){
foreach($row as $key => $value ){
$sqlresult[$i][$key] = $value;
}
$i++;
}
return $sqlresult;
}
function getDropDown($parentId)
{
$query = "SELECT `staticId`,`parentId`,`staticTitle`,`pageKey`,`linkType`,`externalLink` FROM `tbl_static_pages` WHERE `parentId` = ".$parentId." AND `enable` = 'Activate'";
$exe_query = mysql_query($query) OR DIE(mysql_error());
$count = mysql_num_rows($exe_query);
if($count > 0)
{
$all_menu_arr = array();
while($row = mysql_fetch_assoc($exe_query))
{
$sub_query ="SELECT `staticId`,`parentId`,`staticTitle`,`pageKey`,`linkType`,`externalLink` FROM `tbl_static_pages` WHERE `parentId` = ".$row['staticId']." AND `enable` = 'Activate'";
$exe_sub_query = mysql_query($sub_query) OR DIE(mysql_error());
$sub_count = mysql_num_rows($exe_sub_query);
if($sub_count >0)
{
$thirdlb_menu_arr = array();
while($sub_row = mysql_fetch_assoc($exe_sub_query))
{
$thirdlb_menu_arr[] = array(
'staticId' =>$sub_row['staticId'],
'parentId' =>$sub_row['parentId'],
'staticTitle' =>$sub_row['staticTitle'],
'pageKey' =>$sub_row['pageKey'],
'linkType' =>$sub_row['linkType'],
'externalLink' =>$sub_row['externalLink']
);
}
}
$all_menu_arr[] = array(
'staticId' =>$row['staticId'],
'parentId' =>$row['parentId'],
'staticTitle' =>$row['staticTitle'],
'pageKey' =>$row['pageKey'],
'linkType' =>$row['linkType'],
'externalLink' =>$row['externalLink'],
'thirdlb_menu_count' =>count($thirdlb_menu_arr),
'thirdlb_menu_arr' =>$thirdlb_menu_arr
);
}
}
return $all_menu_arr;
}
function getStaticPageContentByPageKey($table,$page){
$dataArray = array();
$sql = "SELECT `staticId`,`parentId`,`staticTitle`,`pageKey`,`linkType`,`staticDescription`,`metaTitle`,`metaKeywords`,`metaDescription`,`headerImage` FROM ".$table." WHERE `pageKey` = '".$page."'";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllRecords($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `isDeleted` = 'no'";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllBrands($table,$brandId){
$dataArray = array();
if($brandId > 0){ $sql1 = 'AND `Species_Id` = '.$brandId.' '; }
$sql = "SELECT * FROM ".$table." WHERE `isDeleted` = 'no' ".$sql1." order by `OrderOfApperance` ASC";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllCategory($table,$brandId,$cateId){
$dataArray = array();
if($cateId > 0){ $sql1 = 'AND `Category_Id` = "'.$cateId.'" '; }
$sql = "SELECT * FROM ".$table." WHERE `Species_Id` = '$brandId' ".$sql1." order by `Category_Name` ASC";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllProductCategory($table,$brandId,$cateId,$product_Id){
$dataArray = array();
if($product_Id > 0){ $sql1 = 'AND `Product_Id` = "'.$product_Id.'" '; }
$sql = "SELECT * FROM ".$table." WHERE `Species_Id` = '$brandId' and `Category_Id`='$cateId' ".$sql1." order by `Product_Name` ASC";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getCertificates($table){
$dataArray = array();
$sql = "SELECT * FROM $table";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getTestimonial($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table."";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getNewsEvents($table,$type,$id){
$dataArray = array();
if($id > 0){ $sql1 = 'AND `id` = "'.$id.'" '; }
$sql = "SELECT * FROM ".$table." WHERE `type` = '".$type."' AND `isDeleted` = 'no' ".$sql1." ORDER BY `createdOn` DESC";
//echo $sql;
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getWinner($table,$id){
$dataArray = array();
if($id > 0){ $sql1 = '`news_id` = "'.$id.'" '; }
$sql = "SELECT * FROM ".$table." WHERE ".$sql1."";
//echo $sql;
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getStaticPage($table,$id){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `staticId` = '".$id."'";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getMedia($table,$type){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `type` = '".$type."' AND `isDeleted` = 'no' ORDER BY `createdOn` DESC";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getCareer($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE Status = 'Active' ORDER BY `createdOn` DESC";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getCareerByName($table,$job_key){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `job_key` = '".$job_key."' ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getCareerById($table,$jobid){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE md5(concat('RSDGROUPJOB', id)) = '".$jobid."' ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getContact($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `id` = 1 limit 1";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getWhatsNew($table){
$dataArray = array();
$sql = "SELECT * FROM $table";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getFaqs($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table."";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getEvents($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table."";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function sanitize_data($input_data) {
$searchArr=array("document","write","alert","%","$",";","+","|","#","<",">",")","(","'","\'",",","AND","JAVASCRIPT");
$input_data = str_replace("script","",$input_data);
$input_data = str_replace("iframe","",$input_data);
$input_data = str_replace($searchArr,"",$input_data);
return htmlentities(stripslashes($input_data), ENT_QUOTES);
}
function getAlbum(){
$sql = "SELECT * FROM `tblPhoto` where `type` = 'pic' group by `albumId` order by `id` DESC ";
$result = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($result);
if($count >0)
{
$main_arr = array();
while($img = mysql_fetch_assoc($result))
{
$sqlAlbum = "select * from `tblalbum` WHERE `id` = '".$img['albumId']."' ";
$resultAlbum= mysql_query($sqlAlbum) or die(mysql_error());
$album = mysql_fetch_assoc($resultAlbum);
$albumName = $album['albumName'];
$sql1 = "SELECT * FROM `tblPhoto` where `type` = 'pic' AND `albumId` = '".$img['albumId']."' order by `id` DESC";
$result1 = mysql_query($sql1) or die(mysql_error());
$count1 = mysql_num_rows($result1);
if($count1 >0)
{
$img_arr = array();
while($img1 = mysql_fetch_assoc($result1))
{
$img_arr[] = array(
'id' =>$img1['id'],
'media' =>$img1['media'],
'type' =>$img1['type'],
'albumId' =>$img1['albumId']
);
}
//echo "<pre>";print_r($img_arr);die;
}
$main_arr[] = array(
'albumName' => $albumName,
'imgs_count' => count($img_arr),
'imgs' => $img_arr
);
}
}
//echo "<pre>";print_r($main_arr);die;
return $main_arr;
}
function getAllRecipeByCategory()
{
$query = "SELECT `id`,`category` FROM `tblRecipeCate` WHERE `isDeleted` = 'no' ";
$exe_query = mysql_query($query) OR DIE(mysql_error());
$count = mysql_num_rows($exe_query);
if($count > 0)
{
$all_recipe_arr = array();
while($row = mysql_fetch_assoc($exe_query))
{
$sub_query ="SELECT `Category_Id`,`Category_Name`,`recipe_key`,`Species_Id` FROM `tblRecipe` WHERE `Species_Id` ='".$row['id']."' AND `Status` = 'Active'";
$exe_sub_query = mysql_query($sub_query) OR DIE(mysql_error());
$sub_count = mysql_num_rows($exe_sub_query);
if($sub_count >0)
{
$recipe_arr = array();
while($sub_row = mysql_fetch_assoc($exe_sub_query))
{
$recipe_arr[] = array(
'Category_Id' =>$sub_row['Category_Id'],
'Category_Name' =>$sub_row['Category_Name'],
'recipe_key' =>$sub_row['recipe_key']
);
}
}
$all_recipe_arr[] = array(
'id' =>$row['id'],
'category' =>$row['category'],
'recipe_count' =>count($recipe_arr),
'recipe_arr' =>$recipe_arr
);
}
}
return $all_recipe_arr;
}
function getRecipeDetailsByName($table,$recipe_key){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `recipe_key` = '".$recipe_key."' ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getFeaturedRecipe($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table."";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getLatestOfferBanner($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table."";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getENewsLetter($table){
$dataArray = array();
$sql = "SELECT * FROM ".$table."";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getSearchPage($name){
$dataArray = array();
$sql = "SELECT * FROM `tbl_static_pages` WHERE
(staticTitle LIKE '%" . $name . "%'
OR
staticDescription LIKE '%" . $name . "%' )
AND
enable ='Activate'
AND
parentId > 0 ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getBrandDetails($table,$id){
$dataArray = array();
$sql = "SELECT * FROM ".$table." WHERE `Species_Id` = '".$id."'";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getOfferSettings($table){
$dataArray = array();
$sql = "SELECT `offer_settings` FROM ".$table." WHERE `id` = '2'";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllProductsDetails($table){
$dataArray = array();
$sql = "SELECT tp.Category_Id,tp.category_key,ts.Species_Id,ts.species_key,tp.Category_Image FROM ".$table." AS tp JOIN `tblSpecies` AS ts
ON (ts.Species_Id=tp.Species_Id) WHERE ts.isDeleted='no' ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getNutritionalInformationByProductId($table,$productId){
$dataArray = array();
$sql = "SELECT tni.* FROM ".$table." AS tni JOIN `tblProduct` AS tp ON (tp.Product_Id=tni.Product_Id) WHERE tp.product_key='".$productId."' ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllBrandListByLocator(){
$dataArray = array();
$sql = "SELECT ts.Species_Id,ts.Species_Name FROM `tbl_store_locator` AS tsl JOIN `tblSpecies` AS ts ON (ts.Species_Id=tsl.brand_id) WHERE tsl.status='Active' GROUP BY tsl.brand_id order by ts.Species_Name";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllStateListByLocator($Brand_Id){
$dataArray = array();
$sql = "SELECT ts.id,ts.state_name FROM `tbl_store_locator` AS tsl JOIN `tbl_states` AS ts ON (ts.id=tsl.state_id) WHERE tsl.brand_id='".$Brand_Id."' and tsl.status='Active' GROUP BY tsl.state_id order by ts.state_name";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllCityListByLocator($State_Id, $Brand_Id){
$dataArray = array();
$sql = "SELECT tc.id,tc.city_name FROM `tbl_store_locator` AS tsl JOIN `tbl_city` AS tc ON (tc.id=tsl.city_id) WHERE tsl.state_id='".$State_Id."' and tsl.brand_id='".$Brand_Id."' and tsl.status='Active' GROUP BY tsl.city_id order by tc.city_name";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllLocatorListByCityId($City_Id, $Brand_Id){
$dataArray = array();
$sql = "SELECT id,location FROM `tbl_store_locator` WHERE city_id='".$City_Id."' and brand_id='".$Brand_Id."' and status='Active' order by location";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllLocatorListByLocationId($Location_Id){
$dataArray = array();
$sql = "SELECT * FROM `tbl_store_locator` WHERE 1=1 and `id`='".$Location_Id."' and `status`='Active' ";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllStateList(){
$dataArray = array();
$sql = "SELECT ts.id,ts.state_name FROM `tbl_store_locator` AS tsl JOIN `tbl_states` AS ts ON (ts.id=tsl.state_id) WHERE tsl.status='Active' GROUP BY tsl.state_id order by ts.state_name";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllCityList(){
$dataArray = array();
$sql = "SELECT tc.id,tc.city_name FROM `tbl_store_locator` AS tsl JOIN `tbl_city` AS tc ON (tc.id=tsl.city_id) WHERE tsl.status='Active' GROUP BY tsl.city_id order by tc.city_name";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
function getAllLocatorList(){
$dataArray = array();
$sql = "SELECT id,location FROM `tbl_store_locator` WHERE status='Active' order by location";
$dataArray = mysqltoarray($sql);
return $dataArray;
}
?>