Ejemplo n.º 1
0
 public function postDealinsert(Request $request)
 {
     $rules = array('eventname' => 'required', 'company' => 'required', 'dealdate' => 'required', 'deal_value' => 'required', 'deal_curr' => 'required', 'sent_date' => 'required', 'rec_date' => 'required', 'deal_type' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return redirect('targetmodule/eventdeal')->withErrors($validator);
     } else {
         $data = Input::get();
         $dealstatus = '1';
         $c = new Deal();
         $c->Clientname = $data['clientname'];
         $c->Companyname = $data['company'];
         $c->Eventname = $data['eventname'];
         $c->Dealdate = $data['dealdate'];
         $c->Dealvalue = $data['deal_value'];
         $c->Dealtype = $data['deal_type'];
         $c->Dealcurr = $data['deal_curr'];
         $c->ConSentdate = $data['sent_date'];
         $c->ConRecdate = $data['rec_date'];
         $c->Empid = $data['emp_id'];
         $c->Status = $dealstatus;
         $c->save();
         $request->session()->flash('alert-success', 'Deal Has Been inserted Successfully');
         return redirect('targetmodule/eventdeal');
         //
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $deals = [['name' => 'Desert Safari with Dinner', 'slug' => 'desert-safari-with-dinner', 'description' => '<p>The price for desert safari is 295 per person. We currently have a buy one get one free promotion if you have one of our promotional vouchers in the entertainer or gulf news.</p>
     			<h3>Our Desert Safari with Dinner includes</h3>
     			<ul>
     				<li>Pickup from your hotel or residence in Dubai or Sharjah</li>
     				<li>Dune Bashing (Adventurous Desert Drive)</li>
     				<li>Henna Painting</li>
     				<li>Arabic Dress Photograph opportunity</li>
     				<li>Camel Ride</li>
     				<li>Sand Boarding (Optional - upon availability)</li>
     				<li>Quad Biking (Optional - upon availability with extra charge)</li>
     				<li>BBQ Dinner (Vegetarian option available)</li>
     				<li>Soft drinks, Mineral Water, Tea & Coffee (Unlimited)</li>
     				<li>Sheesha / Hubbllee Bubblee smoking facility</li>
     				<li>Belly Dance show</li>
     				<li>Tanoura Dance Show</li>
     				<li>Alcohol available at camp - at extracost</li>
     				<li>Return back to your hotel or residence</li>
     			</ul>
     		', 'photos' => [['path' => 'Desert-Safari-with-Dinner.jpg']]]];
     foreach ($deals as $item) {
         $promo = new Deal();
         $promo->name = $item['name'];
         $promo->slug = $item['slug'];
         $promo->description = $item['description'];
         $promo->save();
         foreach ($item['photos'] as $photo) {
             $newPhoto = new Photo(['path' => $photo['path']]);
             $promo->photos()->save($newPhoto);
         }
     }
 }
 public function getAssigntarget()
 {
     $employee = Employee::all();
     $categories = Event::all();
     $userdetails = User::all();
     $targets = Targetassign::all();
     $deals = Deal::all();
     $userData = array();
     $key = 0;
     foreach ($targets as $target) {
         $achieved = 0;
         $userData[$key]['eventcode'] = $target->Eventcode;
         $userData[$key]['event'] = $target->Eventname;
         $userData[$key]['employee'] = $target->Employeeid;
         $userData[$key]['targetVal'] = $target->Targetvalue;
         foreach ($deals as $deal) {
             if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) {
                 $achieved = $achieved + $deal->Dealvalue;
             }
         }
         $userData[$key]['achieved'] = $achieved;
         $userData[$key]['variance'] = $achieved - $target->Targetvalue;
         $userData[$key]['cur'] = $target->Currency;
         $key++;
     }
     return View('approval/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories));
 }
Ejemplo n.º 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function postAdd(Request $request, $product_id)
 {
     $deal = Deal::firstOrCreate(['user_id' => $request->user()->id, 'product_id' => $product_id]);
     $product = \App\Product::find($product_id);
     $request->session()->put("deals.{$product_id}", $product);
     return response()->json(['id' => $product_id, 'mobile' => trans('products.mobile', ['mobile' => $request->user()->mobile]), 'text' => trans_choice('products.deal', $product->deals_count)]);
 }
Ejemplo n.º 5
0
 public function store(Request $request)
 {
     if (!Deal::create($request->all())) {
         flash()->error('There was an error when adding a new promo. Please double-check your inputs.');
         return redirect()->back()->withInput();
     }
     flash()->success('New promo has been successfully added.');
     return redirect()->route('admin.deals.index');
 }
Ejemplo n.º 6
0
 /**
  * 显示指定id交易记录
  *
  * @param Request $request
  * @param         $id
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function show(Request $request, $id)
 {
     $deal = Deal::find($id);
     if (empty($deal)) {
         return response()->json(['status' => 4, 'message' => '数据异常']);
     }
     if ($deal->registration()->withTrashed()->first()->user_id != $request->user()->id) {
         return response()->json(['status' => 1, 'message' => '无权限']);
     }
     return $deal;
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getIndex($dealid)
 {
     $id = $dealid;
     $invoicedata = Deal::where('Id', $id)->get();
     // dd($invoicedata);
     foreach ($invoicedata as $dat) {
         # code...
         $evname = $dat['Eventname'];
     }
     $categories = Event::where('event', $evname)->get();
     foreach ($categories as $category) {
         $EventDate = $category['date'];
     }
     $employee = Employee::all();
     $invoice = Invoice::all();
     return View('createinvoice')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invoicedata' => $invoicedata, 'EventDate' => $EventDate));
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $this->bind('package', function ($slug) {
         return Package::with('information', 'tickets.information', 'photos')->whereSlug($slug)->firstOrFail();
     });
     $this->bind('category', function ($slug) {
         return Category::whereSlug($slug)->firstOrFail();
     });
     $this->bind('packages', function ($id) {
         return Package::with('information', 'tickets.information', 'photos')->findOrFail($id);
     });
     $this->bind('categories', function ($id) {
         return Category::findOrFail($id);
     });
     $this->bind('deal', function ($slug) {
         return Deal::with('photos')->whereSlug($slug)->first();
     });
     $this->bind('deals', function ($id) {
         return Deal::findOrFail($id);
     });
     parent::boot($router);
 }
 public function postVariancecard()
 {
     $empid = Auth::user()->empid;
     $eventName = Input::get('event');
     $targets = Targetassign::where('Employeeid', $empid)->where('Eventname', $eventName)->get();
     $variancedata = $targets;
     $deals = Deal::where('Eventname', $eventName)->where('Empid', $empid)->get();
     $eventDate = Event::where('event', $eventName)->select('date')->get();
     $userData = array();
     $key = 0;
     foreach ($eventDate as $val) {
         $eventdate = $val['date'];
     }
     foreach ($targets as $target) {
         $achieved = 0;
         $userData[$key]['event'] = $target->Eventname;
         $userData[$key]['eventcode'] = $target->Eventcode;
         $userData[$key]['targetVal'] = $target->Targetvalue;
         foreach ($deals as $key1 => $deal) {
             if ($target->Eventname == $deal->Eventname) {
                 $achieved = $achieved + $deal->Dealvalue;
                 $dealx[$key1]['dealdate'] = $deal->Dealdate;
                 $dealx[$key1]['cost'] = (double) $deal->Dealvalue;
             }
         }
         $userData[$key]['achieved'] = $achieved;
         $userData[$key]['variance'] = $achieved - $target->Targetvalue;
         $userData[$key]['cur'] = $target->Currency;
         $date2 = strtotime(date('d-m-Y'));
         $date1 = $target->Targetdate;
         $date5 = $target->Targetassigned;
         // dd($date5);
         $date3 = strtotime($target->Targetdate);
         $diff = $date3 - $date2;
         $days = floor($diff / (60 * 60 * 24));
         // dd($days);
         $userData[$key]['dayleft'] = $days;
         $key++;
     }
     $dealjson = json_encode($dealx);
     // dd($dealjson);
     return View('targetmodule/variancecard')->with(array('target' => $targets, 'userdata' => $userData, 'variancedata' => $variancedata, 'eventdate' => $date1, 'targetdate' => $date5, 'dealjson' => $dealjson));
 }
 public function postInvoice(Request $request)
 {
     $dealid = Input::get('dealid');
     $variable = Input::get('purpose');
     $inv = 'IDE';
     $nameofinvoice = 'PROFORMA INVOICE';
     $dateValue = date('d-m-Y');
     $time = strtotime($dateValue);
     $year = date("Y", $time);
     $count = Invoice::all()->count();
     $counti = $count + 01;
     $invoicecode = $inv . $year . $counti;
     $varr = 'Null';
     $st = 'Invoice Created';
     $dealstatus = '0';
     if ($variable == 'annual') {
         $c = new Invoice();
         $c->Particulars = Input::get('purpose');
         $c->CientAddress = Input::get('client_address');
         $c->ClientName = Input::get('client_name');
         $c->Companyname = Input::get('companyname');
         $c->ClientEmail = Input::get('client_email');
         $c->RepresentativeNo = Input::get('rep_id');
         $c->InvoiceDate = Input::get('invoice_date');
         $c->DueDate = Input::get('due_date');
         $c->AnnualSerialNo = Input::get('s_no_anuual1');
         $c->AnnualText = Input::get('anuual_text');
         $c->AnnualCurrencyType = Input::get('annual_currency1');
         $c->AnnualAmount = Input::get('annual_amount1');
         $c->SerialNo = Input::get('s_no');
         $c->Eventcode = Input::get('eventcode');
         $c->EventName = Input::get('event_name');
         $c->CurrencyType = Input::get('currency_type');
         $c->Amount = Input::get('amount');
         $c->GrandTotal = Input::get('grand_total');
         $c->Subtotal = Input::get('sub_total');
         $c->AmountInWords = Input::get('amount_in_words');
         $c->PaymentTerms = Input::get('payment_interms');
         $c->ServiceTax = Input::get('service_tax');
         $c->ServiceTaxAmount = Input::get('service_tax_amount');
         $c->Status = $varr;
         $c->InvoiceCode = $invoicecode;
         $c->Nameofinvoice = $nameofinvoice;
         $c->dealid = $dealid;
         $c->save();
         // you had skipped the parenthesis in your code.
         $insertedId = $c->id;
         $invoicedata = Invoice::where('Id', $insertedId)->get();
         foreach ($invoicedata as $in) {
             $inv = $in->InvoiceCode;
             # code...
         }
         $html22 = View('pdfgenerate')->with(array('invoicedata' => $invoicedata))->render();
         $html1 = "<h1>adsfadsfasdf</h1>";
         require_once app_path() . '/libs/html2pdf/html2pdf.class.php';
         $html2pdf = new \HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
         // $html2pdf->pdf->SetDisplayMode('fullpage');
         $html2pdf->WriteHTML($html22);
         $htmltosend = $html2pdf->Output('', 'S');
         $i = 'Invoice_';
         $b = $inv;
         $h = '_Generated';
         $subject = $i . $b . $h;
         Mail::send('emails.test', ['Invoice' => 'hgff'], function ($message) use($subject, $htmltosend) {
             // note: if you don't set this, it will use the defaults from config/mail.php
             $message->from('*****@*****.**', 'Jeevan');
             $message->to('*****@*****.**', 'Harshitha')->subject($subject)->attachData($htmltosend, 'invoice.pdf', array('mime' => 'application/pdf', 'Content-Disposition' => 'attachment'));
         });
         $request->session()->flash('alert-success', 'Invoice was successful added!');
         return redirect('dealsclosed');
     }
     if ($variable == 'single') {
         $c = new Invoice();
         $c->Particulars = Input::get('purpose');
         $c->CientAddress = Input::get('client_address');
         $c->ClientName = Input::get('client_name');
         $c->Companyname = Input::get('companyname');
         $c->ClientEmail = Input::get('client_email');
         $c->RepresentativeNo = Input::get('rep_id');
         $c->InvoiceDate = Input::get('invoice_date');
         $c->DueDate = Input::get('due_date');
         $c->SerialNo = Input::get('s_no');
         $c->Eventcode = Input::get('eventcode');
         $c->EventName = Input::get('event_name');
         $c->CurrencyType = Input::get('currency_type');
         $c->Amount = Input::get('amount');
         $c->ServiceTax = Input::get('service_tax');
         $c->ServiceTaxAmount = Input::get('service_tax_amount');
         $c->GrandTotal = Input::get('grand_total');
         $c->Subtotal = Input::get('sub_total');
         $c->AmountInWords = Input::get('amount_in_words');
         $c->PaymentTerms = Input::get('payment_interms');
         $c->InvoiceCode = $invoicecode;
         $c->Nameofinvoice = $nameofinvoice;
         $c->dealid = $dealid;
         $c->Status = $varr;
         $c->save();
         // you had skipped the parenthesis in your code.
         $insertedId = $c->id;
         $invoicedata = Invoice::where('Id', $insertedId)->get();
         foreach ($invoicedata as $in) {
             $inv = $in->InvoiceCode;
             # code...
         }
         $i = Deal::where('Id', $dealid)->update(array('Status' => $dealstatus));
         $html22 = View('pdfgenerate')->with(array('invoicedata' => $invoicedata))->render();
         $html1 = "<h1>adsfadsfasdf</h1>";
         require_once app_path() . '/libs/html2pdf/html2pdf.class.php';
         $html2pdf = new \HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
         // $html2pdf->pdf->SetDisplayMode('fullpage');
         $html2pdf->WriteHTML($html22);
         $htmltosend = $html2pdf->Output('', 'S');
         $i = 'Invoice_';
         $b = $inv;
         $h = '_Generated';
         $subject = $i . $b . $h;
         Mail::send('emails.test', ['Invoice' => 'hgff'], function ($message) use($subject, $htmltosend) {
             // note: if you don't set this, it will use the defaults from config/mail.php
             $message->from('*****@*****.**', 'Jeevan');
             $message->to('*****@*****.**', 'Harshitha')->subject($subject)->attachData($htmltosend, 'invoice.pdf', array('mime' => 'application/pdf', 'Content-Disposition' => 'attachment'));
         });
         $request->session()->flash('alert-success', 'Invoice was successful added!');
         //return redirect()->route('/home');
         return redirect('dealsclosed');
     }
 }
 public function postHotelform(Request $request)
 {
     // dd('dhkajhd');
     $post = Input::get();
     $leadcode = Input::get('leadid');
     $pemail = Input::get('pemail');
     $dealid = Input::get('dealid');
     $pname = Input::get('pname');
     $confirmation_code = str_random(30);
     // $fromemail=Input::get('fromemail');
     // $empid=Input::get('empid');
     // dd($fromemail);
     $c = new hotelform();
     $c->pemail = $pemail;
     $c->pname = $pname;
     $c->dealid = $dealid;
     $c->leadcode = $leadcode;
     $c->token = $confirmation_code;
     $c->save();
     //update delegate deal info
     $deal = Deal::where('leadcode', $leadcode)->get();
     foreach ($deal as $key) {
         $event = $key->Eventname;
         $company = $key->Companyname;
     }
     // dd($confirmation_code);
     $subject = $event . "_" . "Service" . " Booking" . "Form" . "_" . $company;
     // dd($subject);
     Mail::send('emails.hotelbooking', ['Hotelbooking' => 'sdsad'], function ($message) use($subject, $pemail) {
         // note: if you don't set this, it will use the defaults from config/mail.php
         $message->from('*****@*****.**', 'IDE Consulting Services Pvt  Ltd');
         $message->to($pemail)->subject($subject);
     });
     $request->session()->flash('alert-success', 'Service Booking  Form has been sent to client');
     return redirect('reviewer/pendingactivity');
 }
 public function getVipbooking($token)
 {
     $status = 0;
     $lead_id = vipbooking::where('confirmation_code', $token)->get();
     foreach ($lead_id as $lead) {
         $leadocde = $lead->leadcode;
         if ($lead->confirmation_code == $token) {
             $status = 1;
         }
     }
     $dealtype = Deal::where('leadcode', $leadocde)->get();
     //dd($dealtype);
     if ($status == 1) {
         return View('initiator/vipbooking')->with(array('lead_id' => $lead_id, 'dealtype' => $dealtype));
     }
     /**$lead_id=Deal::where('leadcode',$dealid)->get();
        return View('initiator/vipbooking')->with(array('lead_id'=>$lead_id));**/
     /**$status=0;
      	
     	$lead_id=vipbooking::where('confirmation_code',$token)->get();
     	
     	foreach($lead_id as $lead){
     		if($lead->confirmation_code==$token)
     		{
     			$status =1;
     		}
     	}
     	
     	if($status==1)
     	{
           		 return View('initiator/editdeal')->with(array('lead_id'=>$lead_id));
           		 return View('initiator/home');
           
           }else
           	dd('ssss');**/
 }
 /**
  * 退款
  *
  * @param Deal $payDeal 支付交易
  *
  * @return bool
  */
 public static function refund(Deal $payDeal)
 {
     $state = RegistrationController::xxPay($payDeal->payee_account, $payDeal->payer_account, $payDeal->fee);
     //TODO 待优化
     if ($state == 1) {
         $refundDeal = new Deal();
         $refundDeal->registration_id = $payDeal->registration_id;
         $refundDeal->fee = $payDeal->fee;
         $refundDeal->payer_account = $payDeal->payee_account;
         $refundDeal->payee_account = $payDeal->payer_account;
         $refundDeal->type = '退款';
         if ($refundDeal->save()) {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 14
0
 public function latest()
 {
     return Deal::latest()->get();
 }
 public function getViewdetails($dealid)
 {
     $leadsheet = leadsheet::where('leadcode', $dealid)->get();
     // dd($leadsheet);
     $varr = Auth::user()->empid;
     $evarr = User::where('empid', $varr)->get();
     $emp = Employee::where('emp_ide_id', $varr)->get();
     foreach ($emp as $empp) {
         $fromemail = $empp->email;
     }
     // dd($fromemail);
     $lead_id = Deal::where('leadcode', $dealid)->get();
     foreach ($lead_id as $editlead) {
         $dealid = $editlead->Id;
         $leadcode = $editlead->leadcode;
     }
     // dd($dealid);
     $editlead = vipbooking::where('leadcode', $leadcode)->where('deal_id', $dealid)->where('id', DB::raw("(select max(`id`) from vipbooking)"))->get();
     $delegateinfo = delegatedealinfo::where('leadcode', $leadcode)->where('deal_id', $dealid)->get();
     //dd(count($editlead));
     return View('initiator/viewdetails')->with(array('lead_id' => $lead_id, 'editlead' => $editlead, 'emp' => $emp, 'delegateinfo' => $delegateinfo, 'leadsheet' => $leadsheet));
 }
 public function getServiceform($token1)
 {
     $status = 0;
     $token = explode('===', $token1);
     $lead_id = hotelform::where('token', $token[0])->get();
     // dd($lead_id);
     foreach ($lead_id as $lead) {
         $leadcode = $lead->leadcode;
         if ($lead->token == $token[0]) {
             $status = 1;
         }
     }
     //dd($dealtype);
     if ($status == 1) {
         $dealtype = Deal::where('leadcode', $leadcode)->get();
         foreach ($dealtype as $dealt) {
             $evcode = $dealt->Eventcode;
             # code...
         }
         $vip = vipbooking::where('leadcode', $leadcode)->max('id');
         $event = Event::where('eventcode', $evcode)->get();
         $leadsheet = leadsheet::where('leadcode', $leadcode)->get();
         $benefits = benefits::where('leadcode', $leadcode)->get();
         return View('form/serviceform')->with(array('lead_id' => $lead_id, 'dealtype' => $dealtype, 'event' => $event, 'leadsheet' => $leadsheet, 'benefits' => $benefits, 'vip' => $vip));
     } else {
         echo 'token expired';
     }
 }
 public function postDealcancel(Request $request)
 {
     $dealid = Input::get('dealid');
     $post = Input::get();
     $i = Deal::where('Id', $dealid)->update(array('Status' => 'Request Cancel'));
     if ($i > 0) {
         $request->session()->flash('alert-success', 'Updated Success!');
         return redirect('executor/dealsclosed');
     }
 }
Ejemplo n.º 18
0
 public function edit($id)
 {
     $article = Article::find($id);
     $deals = Deal::all()->lists('dealname', 'dayID');
     $categories = Category::lists('name', 'id');
     $days = Day::lists('dayname', 'id');
     return view('articles.edit', compact('article', 'categories', 'days', 'deals'));
 }
<?php

use App\vipbooking;
use App\Deal;
use App\Event;
use App\hotelform;
$lastId = hotelform::get()->last();
$lastinvoice = hotelform::where('id', $lastId->id)->get();
foreach ($lastinvoice as $inv) {
    $leadcode = $inv->leadcode;
    $token = $inv['token'];
    $token1 = str_random(30);
}
$details = Deal::where('leadcode', $leadcode)->get();
foreach ($details as $lead) {
    $eventc = $lead->Eventcode;
}
$event = Event::where('eventcode', $eventc)->get();
foreach ($event as $eve) {
}
?>
	<p><b>Dear {{$inv->clientname}}	</b></p>								
										
	<p>We thank  <b>{{$lead->Companyname}} </b>for giving us an opportunity to serve you at our initiative <b>{{$lead->Eventname}}</b>  to be held on <b>{{$eve->date}}</b> at <b>{{$eve->city}},{{$eve->country}}</b>								
	As part of the confirmation process you need to fill up a Service booking  form.	</p>								
										
	<p>Please follow the link to register for the initiative:</p>	


	<p>Service  Booking Form Link : {{url('form/serviceform/'.$token."===".$token1)}} </p>									
										
Ejemplo n.º 20
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $categories = Deal::where('Status', '=', 1)->get();
     $in = Invoice::all();
     return View('dealsclosed')->with(array('categories' => $categories, 'in' => $in));
 }