Ejemplo n.º 1
0
                                            <th>Customer Name</th>
                                            <th>Email</th>
                                            <th>Phone</th>
                                            <th>Update Progress</th>
                                        </tr>
                                    </thead>

                                    <tbody>
                                        <?php 
//GET data passed from controller and display information
use App\Models\Quote_Requests;
if ($result == '[]') {
    echo '<tr><td>No Events In Progress</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';
} else {
    foreach ($result as $item) {
        $evedetails = Quote_Requests::select('*')->where('id', $item->EventID)->first();
        echo '<tr>';
        echo '<td>' . $evedetails->id . '</td>';
        echo '<td>' . $evedetails->EventDate . '</td>';
        echo '<td>' . $evedetails->EventType . '</td>';
        echo '<td>' . $evedetails->FirstName . ' ' . $evedetails->LastName . '</td>';
        echo '<td>' . $evedetails->Email . '</td>';
        echo '<td>' . $evedetails->Phone . '</td>';
        echo '<td><a href ="progress?EventID=' . $evedetails->id . '" ><i class="fa fa-edit"></i></td>';
        ?>
 
                                            
                                            <?php 
        echo '</tr>';
    }
}
Ejemplo n.º 2
0
 /**
  * This function used to send the rejected details of a quote made by a customer
  *
  * @param string  POST Data
  *
  * @return success or fail message using $result variable
  */
 public function SendRejectQuoteAdmin()
 {
     $id = Request::all();
     $quoteID = $id['eventid'];
     $reason = $id['selectReason'];
     $message = $id['rejectMessage'];
     $addedDate = date('Y-m-d');
     try {
         /*
          *
          */
         $rejectedQuote = new Rejected_Quotes();
         $rejectedQuote->QuoteID = $quoteID;
         $rejectedQuote->Reason = $reason;
         $rejectedQuote->Message = $message;
         $rejectedQuote->RejectedDate = $addedDate;
         $rejectedQuote->save();
         Quote_Requests::where('id', $quoteID)->update(['Status' => 'Rejected']);
         $result = array('eventID' => $quoteID, 'message' => 'success');
         $user = Quote_Requests::select('Username', 'Email')->where('id', $quoteID)->get();
         foreach ($user as $key) {
             $username = $key->Username;
             $emailuser = $key->Email;
         }
         $email = new EmailController();
         $email->quoteRejectedEmail($username, $emailuser, $quoteID, $reason, $message);
         return redirect('dashboard/quote-requests/reject-quote')->with('result', $result);
     } catch (QueryException $e) {
         $result = array('eventID' => $quoteID, 'message' => 'fail');
         return redirect('dashboard/quote-requests/reject-quote')->with('result', $result);
     }
 }
Ejemplo n.º 3
0
 public function store()
 {
     $getid = Events::select('EventID')->get();
     if (!$getid->isEmpty()) {
         $getid = Events::select('EventID')->orderBy('EventID', 'desc')->first()->get();
         foreach ($getid as $key) {
             $id = (int) $key->EventID + 1;
         }
     } else {
         $id = 1;
     }
     $result = Request::all();
     $quoteID = $result['quoteid'];
     $eventType = $result['eventType'];
     $downpayment = $result['downpayment'];
     $userID = Auth::user()->id;
     $addedDate = date('Y-m-d H:i:s');
     try {
         /*
          * Insert the new Quote to Database Table 'quote_requests'
          */
         $events = new Events();
         $events->EventID = $id;
         $events->QuoteID = $quoteID;
         $events->UserID = $userID;
         $events->EventType = $eventType;
         $events->AddedDate = $addedDate;
         $events->save();
         Quote_Requests::where('id', $quoteID)->update(['Status' => 'Paid']);
     } catch (QueryException $e) {
     }
     // ### Address
     // Base Address object used as shipping or billing
     // address in a payment. [Optional]
     $addr = Paypalpayment::address();
     $addr->setLine1("22/1, Nagavihara Road");
     $addr->setLine2("Pitakotte");
     $addr->setCity("Pitakotte");
     $addr->setState("");
     $addr->setPostalCode("10100");
     $addr->setCountryCode("SL");
     $addr->setPhone("0094773685526");
     // ### CreditCard
     $card = Paypalpayment::creditCard();
     $card->setType("visa")->setNumber("4758411877817150")->setExpireMonth("05")->setExpireYear("2019")->setCvv2("456")->setFirstName("Hasitha")->setLastName("Jayasinghe");
     // ### FundingInstrument
     // A resource representing a Payer's funding instrument.
     // Use a Payer ID (A unique identifier of the payer generated
     // and provided by the facilitator. This is required when
     // creating or using a tokenized funding instrument)
     // and the `CreditCardDetails`
     $fi = Paypalpayment::fundingInstrument();
     $fi->setCreditCard($card);
     // ### Payer
     // A resource representing a Payer that funds a payment
     // Use the List of `FundingInstrument` and the Payment Method
     // as 'credit_card'
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $item_1 = new Item();
     $item_1->setName('Quote ID: ' . $quoteID)->setCurrency('USD')->setQuantity(1)->setPrice($downpayment);
     // unit price
     // add item to list
     $item_list = new ItemList();
     $item_list->setItems(array($item_1));
     $amount = new Amount();
     $amount->setCurrency('USD')->setTotal($downpayment);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Your transaction description');
     // ### Payment
     // A Payment Resource; create one using
     // the above types and intent as 'sale'
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(URL::route('payment-status'))->setCancelUrl(URL::route('payment-status'));
     $payment = new Payment();
     $payment->setIntent('order')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         // ### Create Payment
         // Create a payment by posting to the APIService
         // using a valid ApiContext
         // The return object contains the status;
         $payment->create($this->_apiContext);
     } catch (\PPConnectionException $ex) {
         return "Exception: " . $ex->getMessage() . PHP_EOL;
         exit(1);
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return Redirect::away($redirect_url);
     }
     return Redirect::route('original-route')->with('error', 'Unknown error occurred');
     dd($payment);
 }
 /**
  * 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);
 }
 /**
  * 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'));
 }