public function create()
 {
     $contact = contact::latest()->get();
     $list = File::directories('chess');
     $body = admin::latest()->get();
     $doc = docs::latest()->get();
     return view('admin.admin', compact('list', 'body', 'doc', 'contact'));
 }
Example #2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     session_start();
     if (isset($_SESSION['contact_report_to'])) {
         $contact_details = App\contact::where('deleted', '0')->where('id', $_SESSION['contact_report_to'])->first();
         return View::make('ticket.ticket_create', compact('contact_details'));
     } else {
         return View::make('ticket.ticket_create');
     }
 }
Example #3
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     session_start();
     $group = new groups();
     // get user can add groups
     $add_group_sales = $group->user_can_add_groups('sales');
     if (isset($_SESSION['contact_report_to'])) {
         $contact_detial = App\contact::findOrFail($_SESSION['contact_report_to']);
         return View::make('sale.sales_create', compact('add_group_sales', 'contact_detial'));
     }
     return View::make('sale.sales_create', compact('add_group_sales'));
 }
Example #4
0
 public function checkcall($cli)
 {
     $contact = App\contact::where('deleted', '0')->where('contact_no', $cli)->first();
     if ($contact) {
         return 1;
     } else {
         $count = App\contact::where('deleted', '0')->where('contact_mobile2', $cli)->orwhere('contact_work_phone', $cli)->count();
         if ($count == 0) {
             return 0;
         } elseif ($count == 1) {
             return 1;
         } elseif ($count > 1) {
             return 3;
         }
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $contact = contact::find($id);
     $contact->delete();
     return redirect('admin');
 }
Example #6
0
 public function getContact()
 {
     $validator = Validator::make(Input::all(), array("email" => "required|email", "name" => "required", "subject" => "required", "message" => "required"));
     if ($validator->passes()) {
         $userr = new contact();
         $userr->email = Input::get('email');
         $userr->name = Input::get('name');
         $userr->subject = Input::get('subject');
         $userr->message = Input::get('message');
         $userr->save();
         return Redirect::to("/contact")->with('contact_success', 'Thank you, your message sent successfully');
     } else {
         return Redirect::to('/contact')->withErrors($validator)->withInput();
     }
 }
Example #7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     session_start();
     $loguser = $_SESSION['user_id'];
     $data = ['contact_modified_by' => $loguser, 'deleted' => '1'];
     App\contact::find($id)->update($data);
 }