@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | return\ DataTables::of($new_product) |
| 109 | 109 | // return \Datatable::collection($this->product->select('id', 'name', 'type', 'group')->where('id', '!=', 1)->get()) |
| 110 | - ->addColumn('checkbox', function ($model) { |
|
| 110 | + ->addColumn('checkbox', function($model) { |
|
| 111 | 111 | return "<input type='checkbox' class='product_checkbox' value=".$model->id.' name=select[] id=check>'; |
| 112 | 112 | }) |
| 113 | - ->addColumn('name', function ($model) { |
|
| 113 | + ->addColumn('name', function($model) { |
|
| 114 | 114 | return ucfirst($model->name); |
| 115 | 115 | }) |
| 116 | - ->addColumn('type', function ($model) { |
|
| 116 | + ->addColumn('type', function($model) { |
|
| 117 | 117 | //dd($model->type()); |
| 118 | 118 | if ($this->type->where('id', $model->type)->first()) { |
| 119 | 119 | return $this->type->where('id', $model->type)->first()->name; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | return 'Not available'; |
| 122 | 122 | } |
| 123 | 123 | }) |
| 124 | - ->addColumn('group', function ($model) { |
|
| 124 | + ->addColumn('group', function($model) { |
|
| 125 | 125 | //dd($model->type()); |
| 126 | 126 | if ($this->group->where('id', $model->group)->first()) { |
| 127 | 127 | return $this->group->where('id', $model->group)->first()->name; |
@@ -129,21 +129,21 @@ discard block |
||
| 129 | 129 | return 'Not available'; |
| 130 | 130 | } |
| 131 | 131 | }) |
| 132 | - ->addColumn('price', function ($model) { |
|
| 132 | + ->addColumn('price', function($model) { |
|
| 133 | 133 | if ($this->price->where('product_id', $model->id)->first()) { |
| 134 | 134 | return $this->price->where('product_id', $model->id)->first()->price; |
| 135 | 135 | } else { |
| 136 | 136 | return 'Not available'; |
| 137 | 137 | } |
| 138 | 138 | }) |
| 139 | - ->addColumn('currency', function ($model) { |
|
| 139 | + ->addColumn('currency', function($model) { |
|
| 140 | 140 | if ($this->price->where('product_id', $model->id)->first()) { |
| 141 | 141 | return $this->price->where('product_id', $model->id)->first()->currency; |
| 142 | 142 | } else { |
| 143 | 143 | return 'Not available'; |
| 144 | 144 | } |
| 145 | 145 | }) |
| 146 | - ->addColumn('Action', function ($model) { |
|
| 146 | + ->addColumn('Action', function($model) { |
|
| 147 | 147 | $url = ''; |
| 148 | 148 | if ($model->type == 2) { |
| 149 | 149 | $url = '<a href='.url('product/download/'.$model->id)." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-download' style='color:white;'> </i> Download</a>"; |
@@ -166,28 +166,28 @@ discard block |
||
| 166 | 166 | $new_upload = ProductUpload::where('product_id', '=', $id)->select('id', 'product_id', 'title', 'description', 'version', 'file')->get(); |
| 167 | 167 | |
| 168 | 168 | return \DataTables::of($new_upload) |
| 169 | - ->addColumn('checkbox', function ($model) { |
|
| 169 | + ->addColumn('checkbox', function($model) { |
|
| 170 | 170 | return "<input type='checkbox' class='upload_checkbox' value=".$model->id.' name=select[] id=checks>'; |
| 171 | 171 | }) |
| 172 | 172 | |
| 173 | - ->addColumn('product_id', function ($model) { |
|
| 173 | + ->addColumn('product_id', function($model) { |
|
| 174 | 174 | return ucfirst($this->product->where('id', $model->product_id)->first()->name); |
| 175 | 175 | }) |
| 176 | 176 | |
| 177 | - ->addColumn('title', function ($model) { |
|
| 177 | + ->addColumn('title', function($model) { |
|
| 178 | 178 | return ucfirst($model->title); |
| 179 | 179 | }) |
| 180 | - ->addColumn('description', function ($model) { |
|
| 180 | + ->addColumn('description', function($model) { |
|
| 181 | 181 | return ucfirst($model->description); |
| 182 | 182 | }) |
| 183 | - ->addColumn('version', function ($model) { |
|
| 183 | + ->addColumn('version', function($model) { |
|
| 184 | 184 | return $model->version; |
| 185 | 185 | }) |
| 186 | 186 | |
| 187 | - ->addColumn('file', function ($model) { |
|
| 187 | + ->addColumn('file', function($model) { |
|
| 188 | 188 | return $model->file; |
| 189 | 189 | }) |
| 190 | - ->addColumn('action', function ($model) { |
|
| 190 | + ->addColumn('action', function($model) { |
|
| 191 | 191 | return '<a href='.('#edit-upload-option/'.$model->id).' class=" btn btn-sm btn-primary " data-title="'.$model->title.'" data-description="'.$model->description.'" data-version="'.$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>'; |
| 192 | 192 | }) |
| 193 | 193 | ->rawcolumns(['checkbox', 'product_id', 'title', 'description', 'version', 'file', 'action']) |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | //add tax class to tax_product_relation table |
| 430 | 430 | $taxes = $request->input('tax'); |
| 431 | 431 | if ($taxes) { |
| 432 | - $saveTax = $this->saveTax($taxes,$product_id); |
|
| 432 | + $saveTax = $this->saveTax($taxes, $product_id); |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | } |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - public function saveTax($taxes,$product_id) |
|
| 444 | + public function saveTax($taxes, $product_id) |
|
| 445 | 445 | { |
| 446 | 446 | $this->tax_relation->where('product_id', $product_id)->delete(); |
| 447 | 447 | foreach ($taxes as $tax) { |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | \Cart::clear(); |
| 96 | 96 | $status = 'success'; |
| 97 | - $message = view('themes.default1.front.postPaymentTemplate', compact('invoice','date','order', |
|
| 98 | - 'product','invoiceItem'))->render(); |
|
| 97 | + $message = view('themes.default1.front.postPaymentTemplate', compact('invoice', 'date', 'order', |
|
| 98 | + 'product', 'invoiceItem'))->render(); |
|
| 99 | 99 | \Session::forget('items'); |
| 100 | 100 | } else { |
| 101 | 101 | $control->successRenew($invoice); |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | \Cart::clear(); |
| 115 | 115 | $status = 'success'; |
| 116 | 116 | |
| 117 | - $message =view('themes.default1.front.postRenewTemplate', compact('invoice','date','order', |
|
| 118 | - 'product','invoiceItem'))->render(); |
|
| 117 | + $message = view('themes.default1.front.postRenewTemplate', compact('invoice', 'date', 'order', |
|
| 118 | + 'product', 'invoiceItem'))->render(); |
|
| 119 | 119 | } |
| 120 | 120 | return redirect()->back()->with($status, $message); |
| 121 | 121 | } catch (\Exception $ex) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | return $this->generateInvoice($product, $user, $orderid, $planid, $cost, $code = ''); |
| 50 | 50 | } catch (Exception $ex) { |
| 51 | - throw new Exception($ex->getMessage()); |
|
| 51 | + throw new Exception($ex->getMessage()); |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function getCost(Request $request) |
|
| 68 | + public function getCost(Request $request) |
|
| 69 | 69 | { |
| 70 | 70 | try { |
| 71 | 71 | $planid = $request->input('plan'); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function getCost(Request $request) |
| 69 | - { |
|
| 69 | + { |
|
| 70 | 70 | try { |
| 71 | 71 | $planid = $request->input('plan'); |
| 72 | 72 | $userid = $request->input('user'); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | return $url; |
| 141 | 141 | }) |
| 142 | 142 | |
| 143 | - ->rawColumns(['checkbox', 'date', 'client', 'number', 'price_override', 'order_status', 'ends_at', 'action']) |
|
| 143 | + ->rawColumns(['checkbox', 'date', 'client', 'number', 'price_override', 'order_status', 'ends_at', 'action']) |
|
| 144 | 144 | ->make(true); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $fromdate = date_create($from); |
| 397 | 397 | $from = date_format($fromdate, 'Y-m-d H:m:i'); |
| 398 | 398 | $tills = date('Y-m-d H:m:i'); |
| 399 | - $tillDate = $this->getTillDate($from,$till,$tills); |
|
| 399 | + $tillDate = $this->getTillDate($from,$till,$tills); |
|
| 400 | 400 | $join = $join->whereBetween('orders.created_at', [$from, $tillDate]); |
| 401 | 401 | } |
| 402 | 402 | if ($till) { |
@@ -420,17 +420,17 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | public function getTillDate($from,$till,$tills) |
| 422 | 422 | { |
| 423 | - if ($till) |
|
| 424 | - { |
|
| 423 | + if ($till) |
|
| 424 | + { |
|
| 425 | 425 | $todate = date_create($till); |
| 426 | 426 | $tills = date_format($todate, 'Y-m-d H:m:i'); |
| 427 | - } |
|
| 428 | - return $tills; |
|
| 427 | + } |
|
| 428 | + return $tills; |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | public function getFromDate($from,$froms) |
| 432 | 432 | { |
| 433 | - if ($from) { |
|
| 433 | + if ($from) { |
|
| 434 | 434 | $fromdate = date_create($from); |
| 435 | 435 | $froms = date_format($fromdate, 'Y-m-d H:m:i'); |
| 436 | 436 | } |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | return\ DataTables::of($query->get()) |
| 103 | 103 | |
| 104 | - ->addColumn('checkbox', function ($model) { |
|
| 104 | + ->addColumn('checkbox', function($model) { |
|
| 105 | 105 | return "<input type='checkbox' class='order_checkbox' value=".$model->id.' name=select[] id=check>'; |
| 106 | 106 | }) |
| 107 | - ->addColumn('date', function ($model) { |
|
| 107 | + ->addColumn('date', function($model) { |
|
| 108 | 108 | $date = $model->created_at; |
| 109 | 109 | |
| 110 | 110 | return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m A'); |
| 111 | 111 | }) |
| 112 | - ->addColumn('client', function ($model) { |
|
| 112 | + ->addColumn('client', function($model) { |
|
| 113 | 113 | $user = $this->user->where('id', $model->client)->first(); |
| 114 | 114 | $first = $user->first_name; |
| 115 | 115 | $last = $user->last_name; |
@@ -117,22 +117,22 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>'; |
| 119 | 119 | }) |
| 120 | - ->addColumn('number', function ($model) { |
|
| 120 | + ->addColumn('number', function($model) { |
|
| 121 | 121 | return ucfirst($model->number); |
| 122 | 122 | }) |
| 123 | - ->addColumn('price_override', function ($model) { |
|
| 123 | + ->addColumn('price_override', function($model) { |
|
| 124 | 124 | return ucfirst($model->price_override); |
| 125 | 125 | }) |
| 126 | - ->addColumn('order_status', function ($model) { |
|
| 126 | + ->addColumn('order_status', function($model) { |
|
| 127 | 127 | return ucfirst($model->order_status); |
| 128 | 128 | }) |
| 129 | 129 | // ->showColumns('number', 'price_override', 'order_status') |
| 130 | - ->addColumn('ends_at', function ($model) { |
|
| 130 | + ->addColumn('ends_at', function($model) { |
|
| 131 | 131 | $end = $this->getEndDate($model); |
| 132 | 132 | |
| 133 | 133 | return $end; |
| 134 | 134 | }) |
| 135 | - ->addColumn('action', function ($model) { |
|
| 135 | + ->addColumn('action', function($model) { |
|
| 136 | 136 | $sub = $model->subscription()->first(); |
| 137 | 137 | $status = $this->checkInvoiceStatusByOrderId($model->id); |
| 138 | 138 | $url = $this->getUrl($model, $status, $sub); |
@@ -396,14 +396,14 @@ discard block |
||
| 396 | 396 | $fromdate = date_create($from); |
| 397 | 397 | $from = date_format($fromdate, 'Y-m-d H:m:i'); |
| 398 | 398 | $tills = date('Y-m-d H:m:i'); |
| 399 | - $tillDate = $this->getTillDate($from,$till,$tills); |
|
| 399 | + $tillDate = $this->getTillDate($from, $till, $tills); |
|
| 400 | 400 | $join = $join->whereBetween('orders.created_at', [$from, $tillDate]); |
| 401 | 401 | } |
| 402 | 402 | if ($till) { |
| 403 | 403 | $tilldate = date_create($till); |
| 404 | 404 | $till = date_format($tilldate, 'Y-m-d H:m:i'); |
| 405 | 405 | $froms = $this->order->first()->created_at; |
| 406 | - $fromDate = $this->getFromDate($from,$froms); |
|
| 406 | + $fromDate = $this->getFromDate($from, $froms); |
|
| 407 | 407 | $join = $join->whereBetween('orders.created_at', [$fromDate, $till]); |
| 408 | 408 | } |
| 409 | 409 | if ($domain) { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | return $join; |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - public function getTillDate($from,$till,$tills) |
|
| 421 | + public function getTillDate($from, $till, $tills) |
|
| 422 | 422 | { |
| 423 | 423 | if ($till) |
| 424 | 424 | { |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | return $tills; |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - public function getFromDate($from,$froms) |
|
| 431 | + public function getFromDate($from, $froms) |
|
| 432 | 432 | { |
| 433 | 433 | if ($from) { |
| 434 | 434 | $fromdate = date_create($from); |
@@ -420,8 +420,7 @@ |
||
| 420 | 420 | |
| 421 | 421 | public function getTillDate($from,$till,$tills) |
| 422 | 422 | { |
| 423 | - if ($till) |
|
| 424 | - { |
|
| 423 | + if ($till) { |
|
| 425 | 424 | $todate = date_create($till); |
| 426 | 425 | $tills = date_format($todate, 'Y-m-d H:m:i'); |
| 427 | 426 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if ($product == 0) { |
| 70 | - $result = $this->getTotalCart($shop, $cart,$rate, $price, $cart1, $shop1); |
|
| 70 | + $result = $this->getTotalCart($shop, $cart, $rate, $price, $cart1, $shop1); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | return $result; |