public function show_product($id) { $products = new Products(); $result_category = $products->get_category_by_id($id); $subProducts = new SubProducts(); $result_sub_category = $subProducts->get_sub_category_by_category_id($id); return view('auth/show_products')->with(array('result_category' => $result_category, 'result_sub_category' => $result_sub_category)); }
public function index() { $products = new Products(); $sub_products = new SubProducts(); $result_category = $products->get_category(); foreach ($result_category as $results_category) { $menu_result[$results_category->category_name] = $sub_products->get_sub_category_by_category_id($results_category->id); } return view('index', compact('result_category', 'menu_result')); }
public function get() { $about = new About(); $data_about = $about->get_about(); $products = new Products(); $sub_products = new SubProducts(); $result_category = $products->get_category(); foreach ($result_category as $results_category) { $menu_result[$results_category->category_name] = $sub_products->get_sub_category_by_category_id($results_category->id); } return view('about', compact('result_category', 'menu_result', 'data_about')); }
public function get() { $partners = new Partners(); $data_partners = $partners->get_partners(); $products = new Products(); $sub_products = new SubProducts(); $result_category = $products->get_category(); foreach ($result_category as $results_category) { $menu_result[$results_category->category_name] = $sub_products->get_sub_category_by_category_id($results_category->id); } return view('partners', compact('result_category', 'menu_result', 'data_partners')); }
public function add_sub_category($id) { $data_sub_category = Input::all(); $validator_sub_category = Validator::make(array('sub_category_name' => $data_sub_category['sub_category_name']), array('sub_category_name' => 'required|min:2|max:25')); $message = $validator_sub_category->errors(); if ($validator_sub_category->fails()) { return redirect()->back()->with('errors', $message); } else { $Products = new Products(); $result_category = $Products->get_category_by_id($id); $subProducts = new SubProducts(); $subProducts->insert_sub_category($id, $data_sub_category); $result_sub_category = $subProducts->get_sub_category_by_category_id($id); return view('auth/show_products')->with(array('result_category' => $result_category, 'result_sub_category' => $result_sub_category)); } }