public function create()
 {
     $city = City::all();
     $type = VehicleType::all();
     $partner = Partner::all();
     return view::make('vehicle::addVehicle', compact('city', 'type', 'partner'));
 }
 function destroy()
 {
     $data = Input::all();
     $partner = Partner::findPartner($data['PARTNER_ID']);
     $partner->delete();
     return back();
 }
 function updatepassword()
 {
     $data = Input::all();
     $partnerObject = Partner::where('PARTNER_ID', '=', $data['PARTNER_ID']);
     $partner = $partnerObject->first();
     if ($partner['PARTNER_PASSWORD'] == md5($data['old_password'])) {
         if ($data['new_password'] == $data['confirm_password']) {
             $password = [];
             $new_password = md5($data['confirm_password']);
             $password = ['PARTNER_PASSWORD' => $new_password];
             $partnerObject->update($password);
             Session::flash('message', "Perubahan Password Berhasil");
             return back();
         } else {
             Session::flash('message', "Password Yang Anda Masukkan Tidak sama, mohon ulang kembali");
             return redirect::back();
         }
     } else {
         Session::flash('message', "Password Yang Anda Masukkan Salah");
         return redirect::back();
     }
 }
 function checkusername()
 {
     $data = Input::all();
     $partner = Partner::where('PARTNER_USERNAME', '=', $data['PARTNER_USERNAME'])->where('PARTNER_TYPE_ID', '=', $data['PARTNER_TYPE_ID'])->get();
     return json_encode($partner);
 }
 public function index()
 {
     $id = Session::get('id');
     $partner = Partner::where('PARTNER_ID', '=', $id)->first();
     return view('ticketpartner::index', compact('partner'));
 }