/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //        //
     $institutes = Institute::all();
     $data = array('institutes' => $institutes);
     return view('institutes.list', $data);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function edit($id)
 {
     $event = Event::findOrFail($id);
     $institutes = Institute::pluck('name', 'id');
     return View::make('events.forms.edit', compact('event', 'institutes'));
 }
Example #3
0
 public function PostRoomNumberView()
 {
     $roomnum = Input::get('rnumber');
     $roomnocheck = Room::where('institute_code', '=', Auth::user()->institute_id)->where('room_no', '=', $roomnum)->count();
     if ($roomnocheck == 1) {
         Session::flash('warn', 'This Room already allocated for another class Please Try another !');
         return Redirect::to('add/room/number');
     } else {
         $iid = Institute::where('institute_code', '=', Auth::user()->institute_id)->pluck('institute_code');
         // /return $iid;
         $radd = new Room();
         $radd->institute_code = $iid;
         $radd->room_name = Input::get('rname');
         $radd->room_no = Input::get('rnumber');
         $radd->note = Input::get('note');
         $radd->save();
         Session::flash('data', 'Data successfully added !');
         return Redirect::to('add/room/number');
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function destroy($id)
 {
     $title = Institute::findOrFail($id);
     if ($this->destroyPrototype($title, 'delete', 'Instituto')) {
         return Redirect::route('institutes.index');
     }
     return Redirect::route('institutes.show', $id);
 }
 public function individualReportPrint($name)
 {
     $printview = Invoice::where('institute_code', '=', Auth::user()->institute_id)->where('student_name', '=', $name)->first();
     $paidtotal = Invoice::where('institute_code', '=', Auth::user()->institute_id)->where('student_name', '=', $name)->sum('payment_ammount');
     $duetotal = Invoice::where('institute_code', '=', Auth::user()->institute_id)->where('student_name', '=', $name)->sum('due_amount');
     $totalamount = Invoice::where('institute_code', '=', Auth::user()->institute_id)->where('student_name', '=', $name)->sum('total_amount');
     //return $duetotal;
     $institute = Institute::where('institute_code', '=', Auth::user()->institute_id)->first();
     $balance = Invoice::where('institute_code', '=', Auth::user()->institute_id)->where('student_name', '=', $name)->get();
     //return $balance;
     return view('admin.individualreportprint', ['balance' => $balance, 'print' => $printview, 'iis' => $institute, 'paid' => $paidtotal, 'due' => $duetotal, 'total' => $totalamount]);
 }
 /**
  * Elimina la relacion entre un profesor y un instituto
  *
  * @param int $professorId
  * @param int $instituteId
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroyProfessorInstitute($professorId, $instituteId)
 {
     /** @var Institute $institute */
     $institute = Institute::findOrFail($instituteId);
     $institute->professors()->detach([$professorId]);
     Flash::success('Profesor eliminado correctamente.');
     return Redirect::route('institutes.show', $institute->id);
 }
 public function PostInstitute(Request $request)
 {
     if ($request->ajax()) {
         $data = Input::all();
         $iurl = $data['iurl'];
         $iphone = $data['phone'];
         $iname = $data['iname'];
         $iemail = $data['email'];
         $idivision = $data['division'];
         $idistric = $data['district'];
         $iThana = $data['thana'];
         $iaddress = $data['address'];
         //  return $idivision.$idistric.$iThana;
         $userc = User::where('institute_id', '=', Auth::user()->institute_id)->Where('email', '=', $iemail)->count();
         $marchant = Institute::where('institute_code', '=', Auth::user()->institute_id)->Where('email', '=', $iemail)->count();
         if ($userc > 0 || $marchant > 0) {
             // return $iemail;
             $IsettingUpdate = User::where('institute_id', '=', Auth::user()->institute_id)->update(['email' => $iemail, 'name' => $iname]);
             //$IsettingUpdate=User::where('institute_id','=', Auth::user()->institute_id)->get();
             //  return $IsettingUpdate;
             $IUsersettingUpdate = Institute::where('institute_code', '=', Auth::user()->institute_id)->update(['email' => $iemail, 'institute_name' => $iname, 'phone' => $iphone, 'address' => $iaddress, 'url' => $iurl, 'division' => $idivision, 'district' => $idistric, 'thana' => $iThana]);
             return response()->json();
         } else {
             $userc = User::where('institute_id', '=', Auth::user()->institute_id)->Where('email', '=', $iemail)->count();
             $marchant = Institute::where('institute_code', '=', Auth::user()->institute_id)->Where('email', '=', $iemail)->count();
             if ($userc > 0 || $marchant > 0) {
                 Session::flash('data', 'Institute or Email was already used. Please Try a different number.');
                 return Redirect::to('Institute/Setting');
             } else {
                 $IsettingUpdate = User::where('institute_id', '=', Auth::user()->institute_id)->update(['email' => $iemail, 'name' => $iname]);
                 $IUsersettingUpdate = Institute::where('institute_code', '=', Auth::user()->institute_id)->update(['email' => $iemail, 'institute_name' => $iname, 'phone' => $iphone, 'address' => $iaddress, 'url' => $iurl, 'division' => $idivision, 'district' => $idistric, 'thana' => $iThana]);
                 return response()->json();
             }
         }
     }
 }