コード例 #1
0
 /**
  * This function loads the 'Events  Progress'  page for Customer
  *
  *
  * @return  progress 'Events Progress' page with Event Tasks/Quote Requests table data
  */
 public function ProgressCustomer()
 {
     $input = Request::all();
     $iName = $input['EventID'];
     $user_id = \Auth::user()->id;
     //$customereventid = Quote_Requests::select('*')->where('id',$iName)->first();
     $memtasks = Event_Tasks::select('*')->where('EventID', $iName)->get();
     $teammem = Users::select('*')->where('role', 'team-member')->get();
     $evedetails = Quote_Requests::select('*')->where('id', $iName)->first();
     $data = array('memtasks' => $memtasks, 'teammem' => $teammem, 'eveID' => $iName, 'evedetails' => $evedetails, 'result' => 'null');
     return view('progress_customer.progress')->with($data);
 }
コード例 #2
0
 /**
  * This function Handles the post event of the Assign Tasks page
  *
  *
  * @return   if successful All Events To Be Assigned page
  */
 public function AssignPOST()
 {
     $input = Request::all();
     //create arrays to store post data
     $iTaskdesc = array();
     $iTeamMem = array();
     $dbData = array();
     //take inputs to variables
     $iName = $input['EventID'];
     //store input data in corresponding arrays
     foreach ($input['desc'] as $x) {
         $iTaskdesc[] = $x;
     }
     foreach ($input['teammember'] as $y) {
         $iTeamMem[] = $y;
     }
     foreach ($input['desc'] as $z => $value) {
         Event_Tasks::insert([['EventID' => $iName, 'MemberID' => $iTeamMem[$z], 'Description' => $iTaskdesc[$z]]]);
     }
     $mem = Event_Tasks::distinct()->select('MemberID')->where('EventID', $iName)->get();
     $evedata = Quote_Requests::select('*')->where('id', $iName)->first();
     //return dd($mem);
     foreach ($mem as $memb) {
         $time = Carbon::now();
         $em = Users::select('*')->where('id', $memb->MemberID)->first();
         $mailData = ['EventID' => $iName, 'MemName' => $em->Name, 'DueDate' => $evedata->EventDate, 'FirstName' => $evedata->FirstName, 'LastName' => $evedata->LastName];
         Mail::send('emails.member-tasks', $mailData, function ($message) use($em) {
             $message->to($em->email, 'Test')->subject('Tasks Assgined for Event');
         });
     }
     /* 
      */
     $team = Users::distinct()->select('*')->where('role', 'team-member')->get();
     $quote = Quote_Requests::select('*')->get();
     return view('assign_task.assign-tasks')->with(array('team' => $team, 'quote' => $quote, 'message' => 'yes'));
 }