/** * Function updates a new product * * * @return array */ function updateProducts() { include 'classes/Core/CRoleChecking.php'; include_once 'classes/Core/Settings/CAddCrossProducts.php'; include_once 'classes/Display/DAddCrossProducts.php'; $chkuser = Core_CRoleChecking::checkRoles(); if ($chkuser) { $default = new Core_Settings_CManageProducts(); $output['maincategory'] = $default->displayCategory($id); $output['subcat'] = $default->displaySubCategory($subcatid); $output['disptitle'] = $default->dispProductTitle(); $output['updatemsg'] = $default->updateProducts(); Bin_Template::createTemplate('editeproduct.html', $output); } else { $output['usererr'] = 'You are Not having Privilege to view this page contact your Admin for detail'; Bin_Template::createTemplate('Errors.html', $output); } }
/** * Function gets the product details and sub category details for the selected product id. * * * @return string */ function editSubCategory() { $id = $_GET['prodid']; if ((int) $id > 0) { $sql = 'select * from products_table where product_id=' . $id; $obj = new Bin_Query(); $obj->executeQuery($sql); $sqlid = "SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='" . $obj->records[0]['category_id'] . "')"; $query = new Bin_Query(); $query->executeQuery($sqlid); $category = Core_Settings_CManageProducts::displayCategory($query->records[0]['category_parent_id']); $sqlid = 'select category_id from category_table where category_id in(select sub_category_id from products_table where product_id=' . $id . ')'; $query = new Bin_Query(); $query->executeQuery($sqlid); $subcat = Core_Settings_CManageProducts::displaySubCategory($query->records[0]['category_id']); return $subcat; } }