Completed
Push — development ( b93250...5717ca )
by Bhanu
20:53 queued 10:50
created
app/Http/Controllers/Common/BaseTemplateController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     }
54 54
 
55 55
     public function getResult($country, $geoip_country, $state, $geoip_state,
56
-     $shop, $cart, $cart1, $shop1, $rate, $product, $price)
56
+        $shop, $cart, $cart1, $shop1, $rate, $product, $price)
57 57
     {
58 58
         if ($country == $geoip_country || $state == $geoip_state || ($country == '' && $state == '')) {
59 59
             $result = $this->getCartResult($product, $shop, $cart, $rate, $price, $cart1, $shop1);
Please login to merge, or discard this patch.
app/Http/Controllers/Common/TemplateController.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
                             value=".$model->id.' name=select[] id=check>';
128 128
                         })
129 129
 
130
-                         ->addColumn('name', function ($model) {
131
-                             return $model->name;
132
-                         })
130
+                            ->addColumn('name', function ($model) {
131
+                                return $model->name;
132
+                            })
133 133
                         ->addColumn('type', function ($model) {
134 134
                             return $this->type->where('id', $model->type)->first()->name;
135 135
                         })
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     }
273 273
 
274 274
     public function mailing($from, $to, $data, $subject, $replace = [],
275
-     $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
275
+        $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
276 276
     {
277 277
         try {
278 278
             $transform = [];
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
     public function getTemplates()
123 123
     {
124 124
         return \DataTables::of($this->template->select('id', 'name', 'type')->get())
125
-                        ->addColumn('checkbox', function ($model) {
125
+                        ->addColumn('checkbox', function($model) {
126 126
                             return "<input type='checkbox' class='template_checkbox' 
127 127
                             value=".$model->id.' name=select[] id=check>';
128 128
                         })
129 129
 
130
-                         ->addColumn('name', function ($model) {
130
+                         ->addColumn('name', function($model) {
131 131
                              return $model->name;
132 132
                          })
133
-                        ->addColumn('type', function ($model) {
133
+                        ->addColumn('type', function($model) {
134 134
                             return $this->type->where('id', $model->type)->first()->name;
135 135
                         })
136
-                        ->addColumn('action', function ($model) {
136
+                        ->addColumn('action', function($model) {
137 137
                             return '<a href='.url('templates/'.$model->id.'/edit').
138 138
                             " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
139 139
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
             $data = $page_controller->transform($type, $data, $transform);
283 283
             $settings = \App\Model\Common\Setting::find(1);
284 284
             $fromname = $settings->company;
285
-            \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
285
+            \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
286 286
                 $m->from($from, $fromname);
287 287
 
288 288
                 $m->to($to, $toname)->subject($subject);
Please login to merge, or discard this patch.
app/Http/Controllers/Front/BaseClientController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -168,9 +168,9 @@
 block discarded – undo
168 168
             }
169 169
 
170 170
             return \DataTables::of($invoices->get())
171
-             ->addColumn('number', function ($model) {
172
-                 return $model->number;
173
-             })
171
+                ->addColumn('number', function ($model) {
172
+                    return $model->number;
173
+                })
174 174
             ->addColumn('products', function ($model) {
175 175
                 $invoice = $this->invoice->find($model->id);
176 176
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $user->profile_pic = $fileName;
115 115
             }
116 116
             $user->fill($request->input())->save();
117
-            $response = ['type' => 'success',  'message' =>'Updated Successfully..'];
117
+            $response = ['type' => 'success', 'message' =>'Updated Successfully..'];
118 118
 
119 119
             return $response;
120 120
         } catch (Exception $ex) {
@@ -168,27 +168,27 @@  discard block
 block discarded – undo
168 168
             }
169 169
 
170 170
             return \DataTables::of($invoices->get())
171
-             ->addColumn('number', function ($model) {
171
+             ->addColumn('number', function($model) {
172 172
                  return $model->number;
173 173
              })
174
-            ->addColumn('products', function ($model) {
174
+            ->addColumn('products', function($model) {
175 175
                 $invoice = $this->invoice->find($model->id);
176 176
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
177 177
 
178 178
                 return ucfirst(implode(',', $products));
179 179
             })
180
-            ->addColumn('date', function ($model) {
180
+            ->addColumn('date', function($model) {
181 181
                 $date = date_create($model->created_at);
182 182
 
183 183
                 return date_format($date, 'M j, Y, g:i a');
184 184
             })
185
-            ->addColumn('total', function ($model) {
185
+            ->addColumn('total', function($model) {
186 186
                 return $model->grand_total;
187 187
             })
188
-            ->addColumn('status', function ($model) {
188
+            ->addColumn('status', function($model) {
189 189
                 return ucfirst($model->status);
190 190
             })
191
-            ->addColumn('action', function ($model) {
191
+            ->addColumn('action', function($model) {
192 192
                 if (\Auth::user()->role == 'admin') {
193 193
                     $url = '/invoices/show?invoiceid='.$model->id;
194 194
                 } else {
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedBaseInvoiceController.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             $orders = $order->where('client', $clientid)->get();
34 34
 
35 35
             return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
36
-                  'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
36
+                    'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
37 37
         } catch (Exception $ex) {
38 38
             return redirect()->back()->with('fails', $ex->getMessage());
39 39
         }
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
     public function postNewPayment($clientid, Request $request)
43 43
     {
44 44
         $this->validate($request, [
45
-           'payment_date'  => 'required',
46
-           'payment_method'=> 'required',
47
-           'amount'        => 'required',
45
+            'payment_date'  => 'required',
46
+            'payment_method'=> 'required',
47
+            'amount'        => 'required',
48 48
         ]);
49 49
 
50 50
         try {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
             $currency = $client->currency;
33 33
             $orders = $order->where('client', $clientid)->get();
34 34
 
35
-            return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
35
+            return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders',
36 36
                   'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
37 37
         } catch (Exception $ex) {
38 38
             return redirect()->back()->with('fails', $ex->getMessage());
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         try {
130 130
             $versions = ProductUpload::where('product_id', $productid)
131 131
             ->select('id', 'product_id', 'version',
132
-             'title', 'description', 'file', 'created_at')->get();
132
+                'title', 'description', 'file', 'created_at')->get();
133 133
             $countVersions = count($versions);
134 134
             $countExpiry = 0;
135 135
             $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
             $order_id = $order->id;
139 139
             $endDate = Subscription::select('ends_at')
140
-                 ->where('product_id', $productid)->where('order_id', $order_id)->first();
140
+                    ->where('product_id', $productid)->where('order_id', $order_id)->first();
141 141
 
142 142
             foreach ($versions as $version) {
143 143
                 if ($version->created_at->toDateTimeString()
144
-               < $endDate->ends_at->toDateTimeString()) {
144
+                < $endDate->ends_at->toDateTimeString()) {
145 145
                     $countExpiry = $countExpiry + 1;
146 146
                 }
147 147
             }
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             $bussinesses = \App\Model\Common\Bussiness::pluck('name', 'short')->toArray();
380 380
 
381 381
             return view('themes.default1.front.clients.profile',
382
-             compact('user', 'timezones', 'state', 'states', 'bussinesses'));
382
+                compact('user', 'timezones', 'state', 'states', 'bussinesses'));
383 383
         } catch (Exception $ex) {
384 384
             Bugsnag::notifyException($ex);
385 385
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                                 return $model->grand_total;
459 459
                             })
460 460
                             ->rawColumns(['checkbox', 'number', 'total',
461
-                             'payment_method', 'payment_status', 'created_at', ])
461
+                                'payment_method', 'payment_status', 'created_at', ])
462 462
                             ->make(true);
463 463
         } catch (Exception $ex) {
464 464
             Bugsnag::notifyException($ex);
@@ -484,17 +484,17 @@  discard block
 block discarded – undo
484 484
                             ->addColumn('number', function ($model) {
485 485
                                 return $model->invoice()->first()->number;
486 486
                             })
487
-                              ->addColumn('total', function ($model) {
488
-                                  return $model->amount;
489
-                              })
490
-                               ->addColumn('created_at', function ($model) {
491
-                                   $date1 = new DateTime($model->created_at);
492
-                                   $tz = \Auth::user()->timezone()->first()->name;
493
-                                   $date1->setTimezone(new DateTimeZone($tz));
494
-                                   $date = $date1->format('M j, Y, g:i a');
495
-
496
-                                   return $date;
497
-                               })
487
+                                ->addColumn('total', function ($model) {
488
+                                    return $model->amount;
489
+                                })
490
+                                ->addColumn('created_at', function ($model) {
491
+                                    $date1 = new DateTime($model->created_at);
492
+                                    $tz = \Auth::user()->timezone()->first()->name;
493
+                                    $date1->setTimezone(new DateTimeZone($tz));
494
+                                    $date = $date1->format('M j, Y, g:i a');
495
+
496
+                                    return $date;
497
+                                })
498 498
 
499 499
                             ->addColumn('payment_method', 'payment_status', 'created_at')
500 500
 
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
                     ->select('number', 'created_at', 'grand_total', 'id', 'status');
78 78
 
79 79
             return \DataTables::of($invoices->get())
80
-                            ->addColumn('number', function ($model) {
80
+                            ->addColumn('number', function($model) {
81 81
                                 return $model->number;
82 82
                             })
83
-                            ->addColumn('date', function ($model) {
83
+                            ->addColumn('date', function($model) {
84 84
                                 $date = $model->created_at;
85 85
 
86 86
                                 return $date;
87 87
                                 // $myobject->created_at->timezone($this->auth->user()->timezone);
88 88
                             })
89 89
                             // ->showColumns('created_at')
90
-                            ->addColumn('total', function ($model) {
90
+                            ->addColumn('total', function($model) {
91 91
                                 return $model->grand_total;
92 92
                             })
93
-                            ->addColumn('Action', function ($model) {
93
+                            ->addColumn('Action', function($model) {
94 94
                                 $status = $model->status;
95 95
                                 $payment = '';
96 96
                                 if ($status == 'Pending' && $model->grand_total > 0) {
@@ -147,19 +147,19 @@  discard block
 block discarded – undo
147 147
             }
148 148
 
149 149
             return \DataTables::of($versions)
150
-                            ->addColumn('id', function ($versions) {
150
+                            ->addColumn('id', function($versions) {
151 151
                                 return ucfirst($versions->id);
152 152
                             })
153
-                            ->addColumn('version', function ($versions) {
153
+                            ->addColumn('version', function($versions) {
154 154
                                 return ucfirst($versions->version);
155 155
                             })
156
-                            ->addColumn('title', function ($versions) {
156
+                            ->addColumn('title', function($versions) {
157 157
                                 return ucfirst($versions->title);
158 158
                             })
159
-                            ->addColumn('description', function ($versions) {
159
+                            ->addColumn('description', function($versions) {
160 160
                                 return ucfirst($versions->description);
161 161
                             })
162
-                            ->addColumn('file', function ($versions) use ($countExpiry, $countVersions,$clientid, $invoiceid, $productid) {
162
+                            ->addColumn('file', function($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) {
163 163
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
164 164
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
165 165
                                 $order_id = $order->id;
@@ -258,18 +258,18 @@  discard block
 block discarded – undo
258 258
             }
259 259
 
260 260
             return \DataTables::of($link)
261
-                            ->addColumn('version', function ($link) {
261
+                            ->addColumn('version', function($link) {
262 262
                                 return ucfirst($link['tag_name']);
263 263
                             })
264
-                            ->addColumn('name', function ($link) {
264
+                            ->addColumn('name', function($link) {
265 265
                                 return ucfirst($link['name']);
266 266
                             })
267
-                            ->addColumn('description', function ($link) {
267
+                            ->addColumn('description', function($link) {
268 268
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
269 269
 
270 270
                                 return $markdown;
271 271
                             })
272
-                            ->addColumn('file', function ($link) use ($countExpiry,$countVersions,$invoiceid, $productid) {
272
+                            ->addColumn('file', function($link) use ($countExpiry, $countVersions, $invoiceid, $productid) {
273 273
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
274 274
                                 $order_id = $order->id;
275 275
                                 $orderEndDate = Subscription::select('ends_at')
@@ -316,20 +316,20 @@  discard block
 block discarded – undo
316 316
             $orders = Order::where('client', \Auth::user()->id);
317 317
 
318 318
             return \DataTables::of($orders->get())
319
-                            ->addColumn('id', function ($model) {
319
+                            ->addColumn('id', function($model) {
320 320
                                 return $model->id;
321 321
                             })
322
-                            ->addColumn('product_name', function ($model) {
322
+                            ->addColumn('product_name', function($model) {
323 323
                                 return $model->product()->first()->name;
324 324
                             })
325
-                            ->addColumn('expiry', function ($model) {
325
+                            ->addColumn('expiry', function($model) {
326 326
                                 $tz = \Auth::user()->timezone()->first()->name;
327 327
                                 $end = $this->getExpiryDate($model);
328 328
 
329 329
                                 return $end;
330 330
                             })
331 331
 
332
-                            ->addColumn('Action', function ($model) {
332
+                            ->addColumn('Action', function($model) {
333 333
                                 $sub = $model->subscription()->first();
334 334
                                 $order = Order::where('id', $model->id)->select('product')->first();
335 335
                                 $productid = $order->product;
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
445 445
 
446 446
             return \DataTables::of($payments->get())
447
-                            ->addColumn('checkbox', function ($model) {
447
+                            ->addColumn('checkbox', function($model) {
448 448
                                 if (\Input::get('client') != 'true') {
449 449
                                     return "<input type='checkbox' class='payment_checkbox' 
450 450
                                     value=".$model->id.' name=select[] id=check>';
451 451
                                 }
452 452
                             })
453
-                            ->addColumn('number', function ($model) {
453
+                            ->addColumn('number', function($model) {
454 454
                                 return $model->invoice()->first()->number;
455 455
                             })
456 456
                             ->addColumn('amount', 'payment_method', 'payment_status', 'created_at')
457
-                            ->addColumn('total', function ($model) {
457
+                            ->addColumn('total', function($model) {
458 458
                                 return $model->grand_total;
459 459
                             })
460 460
                             ->rawColumns(['checkbox', 'number', 'total',
@@ -481,13 +481,13 @@  discard block
 block discarded – undo
481 481
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
482 482
             //dd(\Input::all());
483 483
             return \DataTables::of($payments->get())
484
-                            ->addColumn('number', function ($model) {
484
+                            ->addColumn('number', function($model) {
485 485
                                 return $model->invoice()->first()->number;
486 486
                             })
487
-                              ->addColumn('total', function ($model) {
487
+                              ->addColumn('total', function($model) {
488 488
                                   return $model->amount;
489 489
                               })
490
-                               ->addColumn('created_at', function ($model) {
490
+                               ->addColumn('created_at', function($model) {
491 491
                                    $date1 = new DateTime($model->created_at);
492 492
                                    $tz = \Auth::user()->timezone()->first()->name;
493 493
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -169,11 +169,13 @@
 block discarded – undo
169 169
 
170 170
                                 //if product has expiry date ie sunscriptioon is generated
171 171
                                 if ($endDate) {
172
-                                    if ($getDownloadCondition == 1) {//Perpetual download till expiry selected
172
+                                    if ($getDownloadCondition == 1) {
173
+//Perpetual download till expiry selected
173 174
                                         $getDownload = $this->whenDownloadTillExpiry($endDate, $productid, $versions, $clientid, $invoiceid);
174 175
 
175 176
                                         return $getDownload;
176
-                                    } elseif ($getDownloadCondition == 0) {//When download retires after subscription
177
+                                    } elseif ($getDownloadCondition == 0) {
178
+//When download retires after subscription
177 179
 
178 180
                                         $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $endDate, $productid, $versions, $clientid, $invoiceid);
179 181
 
Please login to merge, or discard this patch.