extract($_POST);
extract($_GET);
$search = new search();
$obj_setting = new common();
$modelList = array();
$manf = $obj_setting->CustomQuery("SELECT * FROM `attribute_option_value` WHERE `attribute_id` = '2' ORDER BY `value`,`sort_order` ASC");
while ($row = mysql_fetch_assoc($manf)) {
    $modelList[] = $row;
}
/*Fetch welcome section content*/
$fetchSetting = $obj_setting->read('editor_rows', 'id = 1');
$getSetting = $db->fetchNextObject($fetchSetting);
$content = $getSetting->content;
/*Fetch rotating banner section content*/
$allBanner = $obj_setting->customQuery("SELECT * FROM  rot_banner where status=1 order by id asc");
$totalBanners = mysql_num_rows($allBanner);
/*Fetch about us section content*/
$fetchSetting = $obj_setting->read('editor_rows', 'id = 2');
$getSetting = $db->fetchNextObject($fetchSetting);
$aboutUsContent = $getSetting->content;
/*Fetch about us section content*/
$fetchSetting = $obj_setting->read('editor_rows', 'id = 3');
$getSetting = $db->fetchNextObject($fetchSetting);
$realFactsContent = $getSetting->content;
$realFactBackgroundImage = $getSetting->image;
/*Fetch homepage review content*/
/////
$check_home_review_one = $obj_setting->getValueByField("superadmin_options", "option_name='HomeReviewOne'", "option_value");
$check_home_review_two = $obj_setting->getValueByField("superadmin_options", "option_name='HomeReviewTwo'", "option_value");
$check_home_review = $check_home_review_one . "','" . $check_home_review_two;
$obj_setting = new common();
if (!isset($_REQUEST['searchcombo'])) {
    $total_rows = $obj_setting->numberOfRows('contact', 'type = 101');
    //number of rows in pages table
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $total_rows = $obj_setting->numberOfRows('contact', 'type = 101');
        //number of rows in pages table
    } else {
        $total_rows = $obj_setting->numberOfRows('contact', "type = 101 and `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `email` like '%" . addslashes($_REQUEST['searchtext']) . "%'");
        //number of rows in pages table for perticular search criteria
    }
}
if (!isset($_REQUEST['searchcombo'])) {
    if ($searchword == "" && $type != "") {
        $all_pages = $obj_setting->customQuery("SELECT * FROM contact where type = 101 order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        if ($searchword != "" && $type != "") {
            $all_pages = $obj_setting->customQuery("SELECT * FROM contact where type = 101 and name like '%" . addslashes($searchword) . "%' or  `email` like '%" . addslashes($searchword) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        } else {
            $all_pages = $obj_setting->customQuery("SELECT * FROM contact where type = 101 order by {$field} {$orderby} limit {$eu}, {$limit} ");
        }
    }
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $all_pages = $obj_setting->customQuery("SELECT * FROM contact where type = 101 and order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        $all_pages = $obj_setting->customQuery("SELECT * FROM contact where type = 101 and `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `desc` like '%" . addslashes($_REQUEST['searchtext']) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        //number of rows in pages table for perticular search criteria
    }
}
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
    $obj_setting->delete('rot_banner', " id={$id}");
    $_SESSION['success_msg'] = 'Banner deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/home/index.php' . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('rot_banner', " id={$id}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT name FROM rot_banner where id='" . $id . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->name;
} else {
    $pageName = 'There is no banner exists with this page id.';
}
unset($obj_setting);
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($pageid) and $pageid != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('pages', " id={$pageid}");
    $_SESSION['success_msg'] = 'Page deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/page/index.php' . $addToUrl . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('pages', " id={$pageid}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT name FROM pages where id='" . $pageid . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->name;
} else {
    $pageName = 'There is no page exists with this page id.';
}
unset($obj_setting);
<?php

$obj_setting = new common();
$firstVid = $obj_setting->getValueByField("superadmin_options", "option_name='firstVid'", "option_value");
$secondVid = $obj_setting->getValueByField("superadmin_options", "option_name='secondVid'", "option_value");
if (isset($_POST) && $_POST['submit'] == 'submit') {
    foreach ($_POST as $key => $value) {
        if ($value != 'submit') {
            $checkExist = $obj_setting->getValueByField("superadmin_options", "option_name='" . trim($key) . "'", "option_value");
            if ($checkExist) {
                $settings_save = $obj_setting->customQuery("UPDATE `superadmin_options` SET `option_name`='{$key}',`option_value`='{$value}'  WHERE  `option_name`='" . $key . "'");
            } else {
                $settings_save = $obj_setting->customQuery("INSERT INTO `superadmin_options`(`option_name`, `option_value`) VALUES ('" . trim($key) . "' , '" . trim($value) . "')");
            }
        }
    }
    if ($settings_save) {
        echo '<script>location.href = "' . DEFAULT_ADMIN_URL . '/car/productcars.php?response=success";</script>';
    } else {
        echo '<script>location.href = "' . DEFAULT_ADMIN_URL . '/car/productcars.php?response=error";</script>';
    }
}
    $field = 'name';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
    $orderby = $_GET['orderBy'];
} else {
    $orderby = 'ASC';
}
$obj_setting = new common();
if (!isset($_REQUEST['searchcombo'])) {
    $total_rows = $obj_setting->numberOfRows('pages');
    //number of rows in pages table
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $total_rows = $obj_setting->numberOfRows('pages');
        //number of rows in pages table
    } else {
        $total_rows = $obj_setting->numberOfRows('pages', " `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `desc` like '%" . addslashes($_REQUEST['searchtext']) . "%'");
        //number of rows in pages table for perticular search criteria
    }
}
if (!isset($_REQUEST['searchcombo'])) {
    $all_pages = $obj_setting->customQuery("SELECT * FROM pages order by {$field} {$orderby} limit {$eu}, {$limit} ");
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $all_pages = $obj_setting->customQuery("SELECT * FROM pages order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        $all_pages = $obj_setting->customQuery("SELECT * FROM pages where `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `desc` like '%" . addslashes($_REQUEST['searchtext']) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        //number of rows in pages table for perticular search criteria
    }
}
unset($obj_setting);
    $searched .= " with price range <span class=\"searched\"> \$" . $price[0] * 1000 . " USD  to \$" . $price[1] * 1000 . " USD </span>";
    $dataArray['price'] = array('0' => (int) $price[0] * 1000, '1' => (int) $price[1] * 1000);
}
if (isset($filter) && $filter != '') {
    if ($filter == 1) {
        $val = array('FixedPrice', 'StoreInventory', 'AuctionWithBIN');
    } else {
        $val = array('AuctionWithBIN', 'Auction');
    }
    $filterarray[] = array('name' => 'ListingType', 'value' => $val, 'paramName' => '', 'paramValue' => '');
} else {
    $filterarray[] = array('name' => 'ListingType', 'value' => array('FixedPrice', 'StoreInventory', 'AuctionWithBIN', 'Auction'), 'paramName' => '', 'paramValue' => '');
}
$userTblName = 'temp_' . $_SESSION['unique_id'][0];
if (!isset($_SESSION['announces'])) {
    $common->customQuery('DROP TABLE IF EXISTS `' . $userTblName . '`');
    $common->customQuery('CREATE TABLE `' . $userTblName . '` (
							  `type` int(10) NOT NULL,
							  `itemId` bigint(20) NOT NULL,
							  `title` varchar(255) NOT NULL,
							  `Price` float NOT NULL,
							  `content` longtext
							) ENGINE=MyISAM DEFAULT CHARSET=latin1');
    $common->customQuery('INSERT INTO master_temp (user_id, tbl_name, lastAct) VALUES ("' . $_SESSION['unique_id'][0] . '","' . $userTblName . '",' . getCurrentTimestamp() . ')');
    $common->customQuery("DELETE FROM " . $userTblName);
}
if (!isset($_GET['page'])) {
    $_SESSION['announces'] = array();
    $_SESSION['announces']['fill'] = true;
    $page = 1;
    $_SESSION['announces']['page'] = 8;
extract($_GET);
extract($_POST);
#getting array of ids from multiple checkbox and then imploding those ids with ',' to put in IN()
$totalIds = implode("','", $allselect);
$obj_setting = new common();
# Here we are deleting all selected pages
if (isset($pageid) and $pageid != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('contact', " id IN('{$pageid}')");
    $_SESSION['success_msg'] = 'Enquiry deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/contact/consult/index.php' . $addToUrl . '";</script>';
}
#taking imploded ids and checking if these ids exists in database or not
#if not then we are showing error message and if found then we are fetching names
#of those pages to show
$total_rows = $obj_setting->numberOfRows('contact', " id IN('{$totalIds}')");
if ($total_rows > 0) {
    $totalNames = array();
    $singlePage = $obj_setting->customQuery("SELECT * FROM contact where id IN('{$totalIds}')");
    while ($getPageName = $db->fetchNextObject($singlePage)) {
        $totalNames[] = $getPageName->name;
    }
    $pageName = implode("&nbsp;,&nbsp;", $totalNames);
} else {
    $pageName = 'No Enquiry exists with these ids.';
}
unset($obj_setting);
                $pages->items_total = $total_rows;
                $pages->default_ipp = 15;
                $pages->paginate();
                $cars = $search->attributeSearch($dataArray, 'fullName', 'ASC', $pages->limit);
            }
        }
    }
} else {
    $total_rows = $common->numberOfRows("car", '');
    $pages = new Paginator();
    $pages->items_total = $total_rows;
    $pages->default_ipp = 15;
    $pages->paginate();
    /*$dataArray = array( "manufacturer" => "64");
    	$cars = $search->attributeSearch($dataArray,'fullName','ASC',$pages->limit);*/
    $result = $common->customQuery("select car_id from car " . $pages->limit);
    $car = array();
    while ($res = mysql_fetch_object($result)) {
        $cars[] = $res->car_id;
    }
}
if (isset($_POST) && isset($_POST["submit_inq"])) {
    global $db;
    $common_obj = new common();
    $arr = array("car_id" => $_POST['car_id'], "name" => $_POST['name'], "email" => $_POST['email'], "phone" => $_POST['phone'], "message" => $_POST['message'], "address" => $_POST['address'], "type" => 0);
    $common_obj->save("contact", $arr);
    // Your subject
    $subject = 'Inquiry About Car';
    // From
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
<?php

extract($_POST);
extract($_GET);
$search = new search();
$obj_setting = new common();
$page_name = 'revue_automobiles';
/******************************************************/
//fetch all makes entered so far from the admin
/*******************************************************/
$all_makes_query = $obj_setting->customQuery("SELECT make, make_name FROM  reviews ");
$all_makes = array();
while ($makerow = mysql_fetch_object($all_makes_query)) {
    $make_id = $makerow->make;
    $make_name = $makerow->make_name;
    $all_makes[$make_id] = $make_name;
}
$QueryString = '';
//$limit = PAGING_LIMIT;
$limit = 1;
if (strlen($start) > 0 and !is_numeric($start)) {
    $start = 0;
}
$eu = $start - 0;
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (strlen($startOld) > 0 and !is_numeric($startOld)) {
    $startOld = 0;
}
$euOld = $startOld - 0;
        $select20 = "";
        break;
}
$start = $_GET['start'];
if (strlen($start) > 0 and !is_numeric($start)) {
    $start = 0;
}
$eu = $start - 0;
if (!$limit > 0) {
    // if limit value is not available then let us use a default value
    $limit = PAGING_LIMIT;
    // No of records to be shown per page by default.
}
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($_GET['field']) and $_GET['field'] != '') {
    $field = $_GET['field'];
} else {
    $field = 'id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
    $orderby = $_GET['orderBy'];
} else {
    $orderby = 'ASC';
}
$obj_setting = new common();
//number of rows in pages table
$total_rows = $obj_setting->numberOfRows('media');
$allMedia = $obj_setting->customQuery("SELECT * from media order by {$field} {$orderby} limit {$eu}, {$limit}");
unset($obj_setting);
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
    $obj_setting->delete('content_page', " id={$id}");
    $_SESSION['success_msg'] = 'Tab deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/logistique/index.php' . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('content_page', " id={$id}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT tab_title FROM content_page where page_name='logistique' and id='" . $id . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->tab_title;
} else {
    $pageName = 'There is no Tab exists with this id.';
}
unset($obj_setting);
    $start = 0;
}
$eu = $start - 0;
if (!$limit > 0) {
    // if limit value is not available then let us use a default value
    $limit = PAGING_LIMIT;
    // No of records to be shown per page by default.
}
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($_GET['field']) and $_GET['field'] != '') {
    $field = 'news_articles' . $_GET['field'];
} else {
    $field = 'articles.id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
    $orderby = $_GET['orderBy'];
} else {
    $orderby = 'ASC';
}
$obj_setting = new common();
//number of rows in pages table
if ($_GET['cat_id'] != '') {
    $total_rows = $obj_setting->numberOfRows('news_articles', "category_id='" . $_GET['cat_id'] . "'");
    $allArticles = $obj_setting->customQuery("SELECT category.category_name,articles.id,articles.title FROM  news_articles as articles LEFT JOIN news_category as category ON articles.category_id=category.id where articles.category_id='" . $_GET['cat_id'] . "' order by {$field} {$orderby} limit {$eu}, {$limit}");
} else {
    $total_rows = $obj_setting->numberOfRows('news_articles');
    $allArticles = $obj_setting->customQuery("SELECT category.category_name,articles.id,articles.title FROM  news_articles as articles LEFT JOIN news_category as category ON articles.category_id=category.id order by {$field} {$orderby} limit {$eu}, {$limit}");
}
unset($obj_setting);
    $obj->add_fields($name, 'req', 'Please Enter Page Title');
    $obj->add_fields($desc, 'req', 'Please Enter Description');
    $error = $obj->validate();
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>Please fill all required fields.</font>";
    } else {
        if (trim($slug)) {
            $slug = makeAlias($slug);
        } else {
            $slug = makeAlias($name);
        }
        if (trim($metatitle)) {
            $metatitle = $metatitle;
        } else {
            $metatitle = $name;
        }
        if (isset($searchtext) and $searchtext != '') {
            $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
        } else {
            $addToUrl = '';
        }
        $_SESSION['success_msg'] = 'Page has been edited successfully.';
        $dataArr = array('name' => $name, 'slug' => $slug, 'desc' => $desc, 'publish' => $publish, 'metatitle' => $metatitle, 'metakeyword' => $metakeyword, 'metadescription' => $metadescription, 'can_delete' => $can_delete, 'page_cat' => $page_cat);
        $update_site = $obj_setting->update(TBL_PAGE, $dataArr, ' id=' . $id);
        echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/page/index.php' . $addToUrl . '";</script>';
        exit;
    }
}
$fetchPage_cat = $obj_setting->customQuery("SELECT * FROM pages where page_cat=0");
unset($obj_setting);
unset($obj);
        <table style="float:right">
          <tr>
            <td><input class="inp-form" type="text" name="searchcar" id="searchcar" value="<?php 
echo $searchcar;
?>
" /></td>
            <td><?php 
//echo $searchattr;
if (isset($searchattr)) {
    $sel = explode("~", $searchattr);
}
?>
              <select class="select-form" name="searchattr">
                <?php 
$objcommon = new common();
$result = $objcommon->customQuery("Select attribute_id, frontend_label,backend_type,frontend_type From attribute  where searchable = '1' order by frontend_label ASC");
while ($row = mysql_fetch_array($result)) {
    ?>
                <option value="<?php 
    echo $row[attribute_id] . "~" . $row[backend_type] . "~" . $row[frontend_type];
    ?>
" <?php 
    if ($sel[0] == $row[attribute_id]) {
        ?>
 selected="selected"<?php 
    }
    ?>
><?php 
    echo $row[frontend_label];
    ?>
</option>
}
if (isset($_GET['media']) && $_GET['media'] == 'photo') {
    $pagesnum = 1;
    $pagesPhotonum = $_GET['page'];
}
if (isset($_GET['media']) && $_GET['media'] == 'video') {
    $pagesPhotonum = 1;
    $pagesnum = $_GET['page'];
}
$pagesPhoto = new Paginator();
$pagesPhoto->default_ipp = 8;
$total_rows = $common->numberOfRows('media', "type='1'");
$pagesPhoto->items_total = $total_rows;
$pagesPhoto->extraParam = 'photo';
$pagesPhoto->paginate();
$limit = 8;
$eu = $limit * ($pagesPhotonum - 1);
$allMedia = $common->customQuery("SELECT * FROM  media where type = '1' ORDER BY id ASC limit {$eu}, {$limit}");
$pages = new Paginator();
$pages->default_ipp = 8;
$totalVideos = $common->numberOfRows('media', "type='0'");
$pages->items_total = $totalVideos;
$pages->extraParam = 'video';
$pages->paginate();
$limit = 8;
$eu = $limit * ($pagesnum - 1);
$allVideo = $common->customQuery("SELECT * FROM  media where type = '0' ORDER BY id ASC limit {$eu}, {$limit}");
$fetchSetting = $common->read('content_page', 'id = 16');
$getSetting = $db->fetchNextObject($fetchSetting);
$bannerImage = $getSetting->banner_image;
$content = $getSetting->content;
extract($_GET);
extract($_POST);
#getting array of ids from multiple checkbox and then imploding those ids with ',' to put in IN()
$totalIds = implode("','", $allselect);
$obj_setting = new common();
# Here we are deleting all selected pages
if (isset($pageid) and $pageid != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('email_log', " id IN('{$pageid}')");
    $_SESSION['success_msg'] = 'Enquiry deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/contact/log/index.php' . $addToUrl . '";</script>';
}
#taking imploded ids and checking if these ids exists in database or not
#if not then we are showing error message and if found then we are fetching names
#of those pages to show
$total_rows = $obj_setting->numberOfRows('contact', " id IN('{$totalIds}')");
if ($total_rows > 0) {
    $totalNames = array();
    $singlePage = $obj_setting->customQuery("SELECT * FROM email_log where id IN('{$totalIds}')");
    while ($getPageName = $db->fetchNextObject($singlePage)) {
        $totalNames[] = $getPageName->name;
    }
    $pageName = implode("&nbsp;,&nbsp;", $totalNames);
} else {
    $pageName = 'No Enquiry exists with these ids.';
}
unset($obj_setting);
$obj_search = new search();
if (isset($_GET['field']) and $_GET['field'] != '') {
    $field = $_GET['field'];
} else {
    $field = 'car_id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
    $orderby = $_GET['orderBy'];
} else {
    $orderby = 'ASC';
}
$addCarToQuery = '';
$dataArr = array("featured" => 169);
if ($submitcar == 'Search') {
    $backtype = explode("~", $searchattr);
    if ($backtype[2] == "select" or $backtype[2] == "radio" or $backtype[2] == "multiselect" or $backtype[2] == "checkbox") {
        $value_id = $obj_setting->customQuery("select value_id from attribute_option_value where attribute_id = '" . $backtype['0'] . "' and value like '" . "%" . $searchcar . "%" . "' ");
        $value_id = mysql_fetch_object($value_id);
        $value = $value_id->value_id;
    } else {
        $value = $searchcar;
    }
    $attribute_code = $obj_setting->customQuery("select attribute_code from attribute where attribute_id = " . $backtype['0']);
    $attribute_code = mysql_fetch_object($attribute_code);
    $dataArr[$attribute_code->attribute_code] = $value;
}
$pages->items_total = $obj_search->attributeSearchCount($dataArr);
$total_rows = $pages->items_total;
$pages->paginate();
$all_car = $obj_search->attributeSearch($dataArr, "fullName", "ASC", $pages->limit);
$all_car = $obj_setting->CarAttributesFromID($all_car);
 $old_new = $getSetting->old_new;
 $make = $getSetting->make;
 $model = $getSetting->model;
 $pdsf = $getSetting->pdsf;
 $mpg = $getSetting->mpg;
 $make_name = $getSetting->make_name;
 $model_name = $getSetting->model_name;
 $year = $getSetting->year;
 $expert = $getSetting->expert;
 $ensemble = $getSetting->ensemble;
 $ensemble = $getSetting->ensemble;
 $characteristique = $getSetting->characteristique;
 $image = $getSetting->image;
 $title = $make_name . ' ' . $model_name . ' ' . $year;
 $currentUrl = DEFAULT_URL . $_SERVER['REQUEST_URI'];
 $all_media_query = $obj_setting->customQuery("SELECT * FROM  reviews_media WHERE review_id=" . $id);
 $all_media = array();
 while ($mediaRow = mysql_fetch_object($all_media_query)) {
     $mediaid = $mediaRow->id;
     $review_id = $mediaRow->review_id;
     $media_type = $mediaRow->media_type;
     $media_name = $mediaRow->media_name;
     $order_id = $mediaRow->order_id;
     if ($media_type == 'video') {
         $Exploded = explode('-', $media_name);
         $video_thumb = DEFAULT_ADMIN_URL_REVIEW_IMAGEPATH . '/' . $Exploded[0] . '.jpg';
     } else {
         if ($media_type == 'youtube_link') {
             $Exploded = explode('=', $media_name);
             $video_thumb = 'http://img.youtube.com/vi/' . $Exploded[1] . '/0.jpg';
         } else {
    $error = $obj->validate();
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
    } else {
        /*save category*/
        $slug = str_replace(' ', '_', strtolower($title));
        $dataArr = array('category_id' => $category_id, 'title' => $title, 'content' => $content, 'slug' => $slug);
        if ($id == "") {
            $categoryInsert = $obj_setting->save('news_articles', $dataArr);
        } else {
            $categoryInsert = $obj_setting->update('news_articles', $dataArr, "id=" . $id);
        }
        $_SESSION['success_msg'] = 'Successfully Saved';
        echo '<script>location.href="' . DEFAULT_URL . '/superadmin/page/articles.php";</script>';
        exit;
    }
}
/*Fetch banner section content*/
if (isset($_GET['id'])) {
    $fetchSetting = $obj_setting->read('news_articles', 'id = ' . $_GET['id']);
    $getSetting = $db->fetchNextObject($fetchSetting);
    $id = $getSetting->id;
    $categoryId = $getSetting->category_id;
    $title = $getSetting->title;
    $content = $getSetting->content;
    $heading = "Edit";
} else {
    $heading = "Add New";
}
$allCategories = $obj_setting->customQuery("SELECT id,category_name FROM  news_category order by category_name ASC");
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('newsletter_subscriber', " id={$id}");
    $_SESSION['success_msg'] = 'Enquiry deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/contact/newsletter/index.php' . $addToUrl . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('newsletter_subscriber', " id={$id}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT * FROM newsletter_subscriber where id='" . $id . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->name;
} else {
    $pageName = 'No enquiry exists with this id.';
}
unset($obj_setting);
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('car_inquiry', " id={$id}");
    $_SESSION['success_msg'] = 'Enquiry deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/contact/guest/index.php' . $addToUrl . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('car_inquiry', " id={$contactid}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT * FROM car_inquiry where id='" . $id . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->name;
} else {
    $pageName = 'No enquiry exists with this id.';
}
unset($obj_setting);
 function AdminSearch($text)
 {
     $common = new common();
     $result = $common->customQuery("select car_id from car_varchar where attribute_id=22 and value like '" . "%" . $text . "%" . "' ");
     while ($row = mysql_fetch_array($result)) {
         $carID[] = $row['car_id'];
     }
     return $carID;
 }
$obj_setting = new common();
if (!isset($_REQUEST['searchcombo'])) {
    $total_rows = $obj_setting->numberOfRows('car_inquiry');
    //number of rows in pages table
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $total_rows = $obj_setting->numberOfRows('car_inquiry');
        //number of rows in pages table
    } else {
        $total_rows = $obj_setting->numberOfRows('car_inquiry', " `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `email` like '%" . addslashes($_REQUEST['searchtext']) . "%'");
        //number of rows in pages table for perticular search criteria
    }
}
if (!isset($_REQUEST['searchcombo'])) {
    if ($searchword == "" && $type != "") {
        $all_pages = $obj_setting->customQuery("SELECT * FROM car_inquiry where type = {$type} order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        if ($searchword != "" && $type != "") {
            $all_pages = $obj_setting->customQuery("SELECT * FROM car_inquiry where type = {$type} and name like '%" . addslashes($searchword) . "%' or  `email` like '%" . addslashes($searchword) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        } else {
            $all_pages = $obj_setting->customQuery("SELECT * FROM car_inquiry order by {$field} {$orderby} limit {$eu}, {$limit} ");
        }
    }
} else {
    echo "hii";
    die;
    if ($_REQUEST['searchtext'] == 'Search') {
        $all_pages = $obj_setting->customQuery("SELECT * FROM car_inquiry order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        $all_pages = $obj_setting->customQuery("SELECT * FROM car_inquiry where `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `desc` like '%" . addslashes($_REQUEST['searchtext']) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        //number of rows in pages table for perticular search criteria
<?php

/*************************************************************************************************************
#Coder         : Kapil Verma
#Description   : This Code is used to manage general settings
*************************************************************************************************************/
extract($_GET);
extract($_POST);
$obj_setting = new common();
$obj = new validation();
/* Get Current Date Time Stamp */
$currentTimestamp = getCurrentTimestamp();
$adminSql = $obj_setting->customQuery("SELECT logo FROM " . TBL_ADMIN . " where id='" . $_SESSION['LoggedInId'] . "'");
$adminResult = $db->fetchNextObject($adminSql);
$oldImageNameName = $adminResult->logo;
$imageName = $oldImageNameName;
#predefined so if no image name found then it will take image name from datsabase table
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    #checking if image uploaded or not
    if (isset($_FILES['logo_header']['tmp_name']) and $_FILES['logo_header']['tmp_name'] != '') {
        $imageTypes = array('image/gif', 'image/jpeg', 'image/pjpeg');
        $imageName = $currentTimestamp . '_' . $_FILES['logo_header']['name'];
        $successstatus = fileUpload(LIST_ROOT_ADMIN . '/images/logo_header/', $imageName, 'logo_header', $imageTypes, 200, $oldImageNameName, 'header_logo.jpg');
        switch ($successstatus) {
            case 0:
                $imageName = $oldImageNameName;
                break;
            case 1:
                $imageName = $imageName;
                break;
            case 2:
<?php

$userTblName = "wishlist";
$common = new common();
if (!isset($_GET['page'])) {
    $page = 1;
}
if ($_SESSION['User']['id'] != "") {
    $userid = $_SESSION['User']['id'];
    $list = $common->customQuery("SELECT * FROM " . $userTblName . " where user_id = " . $userid . " ORDER BY created DESC LIMIT 0 ,25");
}
extract($_POST);
#getting array of ids from multiple checkbox and then imploding those ids with ',' to put in IN()
$totalIds = implode(",", $allselect);
$obj_setting = new common();
# Here we are deleting all selected pages
if ($totalIds != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('car', " car_id IN ({$totalIds})");
    $obj_setting->delete('contact', " car_id IN ({$totalIds})");
    $_SESSION['success_msg'] = 'Cars deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/car/index.php' . $addToUrl . '";</script>';
}
#taking imploded ids and checking if these ids exists in database or not
#if not then we are showing error message and if found then we are fetching names
#of those pages to show
$total_rows = $obj_setting->numberOfRows('pages', " id IN('{$totalIds}')");
if ($total_rows > 0) {
    $totalNames = array();
    $singlePage = $obj_setting->customQuery("SELECT name FROM pages where id IN('{$totalIds}')");
    while ($getPageName = $db->fetchNextObject($singlePage)) {
        $totalNames[] = $getPageName->name;
    }
    $pageName = implode("&nbsp;,&nbsp;", $totalNames);
} else {
    $pageName = 'There are no cars exists with these car ids.';
}
unset($obj_setting);
$obj_setting = new common();
if (!isset($_REQUEST['searchcombo'])) {
    $total_rows = $obj_setting->numberOfRows('email_log');
    //number of rows in pages table
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $total_rows = $obj_setting->numberOfRows('email_log');
        //number of rows in pages table
    } else {
        $total_rows = $obj_setting->numberOfRows('email_log', " `email` like '%" . addslashes($_REQUEST['searchtext']) . "%'");
        //number of rows in pages table for perticular search criteria
    }
}
if (!isset($_REQUEST['searchcombo'])) {
    if ($searchword == "" && $type != "") {
        $all_pages = $obj_setting->customQuery("SELECT * FROM email_log  order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        if ($searchword != "" && $type != "") {
            $all_pages = $obj_setting->customQuery("SELECT * FROM email_log where `email` like '%" . addslashes($searchword) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        } else {
            $all_pages = $obj_setting->customQuery("SELECT * FROM email_log order by {$field} {$orderby} limit {$eu}, {$limit} ");
        }
    }
} else {
    if ($_REQUEST['searchtext'] == 'Search') {
        $all_pages = $obj_setting->customQuery("SELECT * FROM email_log order by {$field} {$orderby} limit {$eu}, {$limit} ");
    } else {
        $all_pages = $obj_setting->customQuery("SELECT * FROM email_log where `email` like '%" . addslashes($_REQUEST['searchtext']) . "%' order by {$field} {$orderby} limit {$eu}, {$limit} ");
        //number of rows in pages table for perticular search criteria
    }
}
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
    if (isset($searchtext) and $searchtext != '') {
        $addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
    } else {
        $addToUrl = '';
    }
    $obj_setting->delete('faq', " id={$id}");
    $_SESSION['success_msg'] = 'FAQ deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/faq/index.php' . $addToUrl . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('faq', " id={$contactid}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT * FROM faq where id='" . $id . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->name;
} else {
    $pageName = 'No FAQ exists with this id.';
}
unset($obj_setting);
<?php

extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
    $obj_setting->delete('news_category', "id={$id}");
    $obj_setting->delete('news_articles', "category_id={$id}");
    $_SESSION['success_msg'] = 'Category and its associated articles deleted successfully.';
    echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/page/news_category.php' . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('news_category', "id={$id}");
if ($total_rows > 0) {
    $singlePage = $obj_setting->customQuery("SELECT category_name FROM news_category id='" . $id . "'");
    $getPageName = $db->fetchNextObject($singlePage);
    $pageName = $getPageName->tab_title;
} else {
    $pageName = 'There is no Category exists with this id.';
}
unset($obj_setting);