public function Address()
 {
     if (Auth::check()) {
         $customerId = Auth::user()->id;
         $province = Province::select(["provinceid", "name"])->orderBy("name")->get();
         $district = District::select(["districtid", "name"])->where("provinceid", $province[0]->provinceid)->orderBy("name")->get();
         $ward = Ward::select(["wardid", "name"])->where("districtid", $district[0]->districtid)->orderBy("name")->get();
         $address = CustomerInfo::getAllAddressInfo($customerId);
         return view("pages.paymentInfo.address", compact("province", "district", "ward", "address"));
     } else {
         return redirect()->route("login");
     }
 }
Пример #2
0
 public function CustomerInfo()
 {
     if (Request::ajax()) {
         if (Auth::check()) {
             $customerId = Auth::user()->id;
             $province = Province::select(["provinceid", "name"])->orderBy("name")->get();
             $district = District::select(["districtid", "name"])->where("provinceid", $province[0]->provinceid)->orderBy("name")->get();
             $ward = Ward::select(["wardid", "name"])->where("districtid", $district[0]->districtid)->orderBy("name")->get();
             $address = CustomerInfo::getAllAddressInfo($customerId);
             //danh sach dia chi
             return view("pages.customerInfo.info", compact("province", "district", "ward", "address"));
         }
     } else {
         return redirect()->route("home");
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $provinces = Province::select(array('id', 'name', 'created_at'));
     return \Datatables::of($provinces)->addColumn('actions', '<a class="btn btn-xs btn-alt" data-toggle="modal" onClick="launchUpdateProvinceModal({{$id}});" data-target=".modalEditProvince">Edit</a>')->make(true);
 }