selectAllSports();
//var_dump($fetchData);
foreach ($fetchData as $row) {
?>
view('errors/403');
// }
}
public function templatesCat($url)
{
$m = new MainModel;
$data = $m->selectSportsId($url);
$categoryids = array();
foreach ($data as $row) {
$categoryids[] = $row->Category;
}
$array_sports = $m->selectSportsByURL($url);
$array_category = $m->selectCategory($categoryids);
// $array_templateby_category = $m->selectTemplatesByCategory($url, $id);
// var_dump($array_category);
return view('sublayouts.sports-category')
->with('array_sports', $array_sports)
->with('row', $array_category);
}
public function templatesByCategory($url, $id)
{
$m = new MainModel;
$data = $m->selectTemplatesByCategory($url, $id);
$categoryids = array();
$categoryids[] = $id;
$array_category = $m->selectCategory($categoryids);
// var_dump($array_category);
return view('sublayouts.sports-styles')
->with('cat', $url)
->with('row', $data)
->with('array_category', $array_category);
// if(count($data) > 1){
// return view('sublayouts.sports-styles')
// ->with('cat', $url)
// ->with('row', $data);
// }else{
// $url = url('/designer'). '/'.$data[0]->HashTemplateCode; // desinger url
// return redirect()->to($url);
// }
}
public function fetchTemplates()
{
// if(Request::ajax()){
// $m = new MainModel;
//
// $data = $m->selectSportsId($url);
// echo $data[0]->id;
//$fetchData = $m->selectSportsTemplates();
//var_dump($fetchData);
// }else{
// return response()->view('errors/403');
// }
}
//call this from blade view
public static function getCountCart()
{
$m = new MainModel;
if (Session::get('cartkey')) {
$cartKey = Session::get('cartkey');
echo $i = $m->cartCount($cartKey);
} else {
echo 0;
}
}
public function countCart(Request $request)
{
$m = new MainModel;
if ($request->session()->has('cartkey')) {
$cartKey = $request->session()->get('cartkey');
echo $i = $m->cartCount($cartKey);
} else {
echo 0;
}
}
public function removeCartItem($id)
{
$m = new MainModel;
$row = $m->removeItem($id);
if ($row > 0) {
// \Session::flash('message', 'Record successfully deleted.');
echo '';
return redirect('cart');
}
}
public function trackingPage()
{
if (Auth::check()) {
$userId = Auth::user()->id;
} else {
$userId = "";
}
return view('merchbay.track_order')
->with('userId', $userId);
}
}