Пример #1
0
 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));
 }
Пример #2
0
 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'));
 }
Пример #3
0
 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'));
 }
Пример #4
0
 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'));
 }
Пример #5
0
 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));
     }
 }