public function index() { $twig = Config::getTwig(); $productId = Request::_request('productId'); $productDetail = \model\ProductList::getProduct($productId); //die( $productDetail) ; /*if (isset($_GET['marketId'])){ $marketId = $_GET['marketId']; // ########################################## // ########################################## // -- ** -- // Burada market sayfası için gerekli diğer sorgular yapılacaktır // - section Listesi // - genel ürün listesi (çok satılan vs) // - (+) diğer istekler // ########################################## // ########################################## $sectionList = \model\GuppyFunctions::prepareCategoryMenu(); }*/ $result = array('productDetail' => json_decode($productDetail)->content); //$result = array('products' => $productList); return $twig->render('client/product_detail2.html', $result); }
public function index() { // -- ** -- GET Twig & city list $twig = Config::getTwig(); $loginResult = ProductList::getAllProducts(); //die($_SERVER['REQUEST_URI']); // -- ** -- Check $cityList content is exist with isset method $result = array('products' => $loginResult->content); // -- ** -- Render result with twig if ($loginResult->isSuccess()) { return $twig->render('admin/pages/tables/products.html', $result); } else { return $twig->render('admin/pages/tables/products.html', $result); } }
public function index() { // -- ** -- GET Twig & city list $twig = Config::getTwig(); #$loginResult = ProductList::getAllProducts(); //die($_SERVER['REQUEST_URI']); $brands = Brand::getBrands(); $sections = Section::getSections(); if (Request::_request_post('product_name')) { $array["do"] = "addProduct"; if (Request::_request_post("product_brand")) { $array['brand_id'] = Request::_request_post("product_brand"); } $array['name'] = Request::_request_post("product_name"); if (Request::_request_post("product_code")) { $array['barcode'] = Request::_request_post("product_code"); } if (Request::_request_post("product_desc")) { $array['desc'] = Request::_request_post("product_desc"); } if (Request::_request_post("product_section")) { $array['section_id'] = Request::_request_post("product_section"); } if ($_FILES["product_image"]) { } else { echo "lkşkşki"; } $array["admin_id"] = "123459"; $res = ProductDetail::addProduct($array); if ($res->isSuccess()) { $result = array('addProductSuccess' => true, 'brands' => json_decode($brands)->content, 'sections' => json_decode($sections)->content); } else { $result = array('addProductFailure' => true, 'brands' => json_decode($brands)->content, 'sections' => json_decode($sections)->content); } return $twig->render('admin/pages/forms/general2.html', $result); } else { $prod = ProductList::getProduct(Request::_get("id")); if ($prod->isSuccess()) { $result = array('brands' => json_decode($brands)->content, 'sections' => json_decode($sections)->content, 'product' => $prod->content); } else { $result = array('brands' => json_decode($brands)->content, 'sections' => json_decode($sections)->content); } return $twig->render('admin/pages/forms/product.html', $result); } }