Completed
Push — development ( c78083...b93250 )
by Ashutosh
11:07 queued 10s
created
app/Http/Controllers/Common/BaseTemplateController.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 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);
@@ -136,19 +136,19 @@  discard block
 block discarded – undo
136 136
             if ($value->days >= 366){ 
137 137
             $months = intval($value->days / 30 / 12).' '.'year';
138 138
             }elseif ($value->days < 365){
139
-             $months = intval($value->days / 30 ).' '.'months';
139
+                $months = intval($value->days / 30 ).' '.'months';
140 140
         }
141 141
         else {
142 142
             $months = '';
143 143
         }
144
-         $price = $this->getPrice($months,$price, $currency, $value, $cost);
144
+            $price = $this->getPrice($months,$price, $currency, $value, $cost);
145 145
         }
146 146
        
147 147
        
148 148
         // $this->leastAmount($id);
149 149
 
150 150
         return $price ;
151
-         }
151
+            }
152 152
     
153 153
 
154 154
     public function withoutTaxRelation($productid, $currency)
@@ -216,18 +216,18 @@  discard block
 block discarded – undo
216 216
         return $total;
217 217
     }
218 218
 
219
-     public function getDuration($value)
219
+        public function getDuration($value)
220 220
     {
221
-     if (strpos($value, 'Y') == true){
222
-             $duration = '/Year';
223
-         }
224
-         elseif(strpos($value, 'M') == true){
221
+        if (strpos($value, 'Y') == true){
222
+                $duration = '/Year';
223
+            }
224
+            elseif(strpos($value, 'M') == true){
225 225
             $duration = '/Month';
226
-         }
227
-         else{
226
+            }
227
+            else{
228 228
             $duration = '/One-Time';
229
-         }
230
-         return $duration;
229
+            }
230
+            return $duration;
231 231
     }
232 232
 
233 233
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
         return $result;
112 112
     }
113 113
 
114
-    public function getPrice($months,$price, $currency, $value, $cost)
114
+    public function getPrice($months, $price, $currency, $value, $cost)
115 115
     {
116 116
         if ($currency == 'INR') {
117
-            $price[$value->id] = $months  .'  ' . '₹'.' '.$cost;
117
+            $price[$value->id] = $months.'  '.'₹'.' '.$cost;
118 118
         } else {
119
-            $price[$value->id] = $months  .'  ' . '$'.' '.$cost;
119
+            $price[$value->id] = $months.'  '.'$'.' '.$cost;
120 120
         }
121 121
 
122 122
         return $price;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     public function prices($id)
126 126
     {
127 127
         $plan = new Plan();
128
-        $plans = $plan->where('product', $id)->orderBy('id','desc')->get();
128
+        $plans = $plan->where('product', $id)->orderBy('id', 'desc')->get();
129 129
         $price = [];
130 130
         $cart_controller = new \App\Http\Controllers\Front\CartController();
131 131
         $currency = $cart_controller->currency();
@@ -133,21 +133,21 @@  discard block
 block discarded – undo
133 133
         foreach ($plans as $value) {
134 134
             $cost = $value->planPrice()->where('currency', $currency)->first()->add_price;
135 135
             $cost = \App\Http\Controllers\Front\CartController::rounding($cost);
136
-            if ($value->days >= 366){ 
136
+            if ($value->days >= 366) { 
137 137
             $months = intval($value->days / 30 / 12).' '.'year';
138
-            }elseif ($value->days < 365){
139
-             $months = intval($value->days / 30 ).' '.'months';
138
+            }elseif ($value->days < 365) {
139
+             $months = intval($value->days / 30).' '.'months';
140 140
         }
141 141
         else {
142 142
             $months = '';
143 143
         }
144
-         $price = $this->getPrice($months,$price, $currency, $value, $cost);
144
+         $price = $this->getPrice($months, $price, $currency, $value, $cost);
145 145
         }
146 146
        
147 147
        
148 148
         // $this->leastAmount($id);
149 149
 
150
-        return $price ;
150
+        return $price;
151 151
          }
152 152
     
153 153
 
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
 
219 219
      public function getDuration($value)
220 220
     {
221
-     if (strpos($value, 'Y') == true){
221
+     if (strpos($value, 'Y') == true) {
222 222
              $duration = '/Year';
223 223
          }
224
-         elseif(strpos($value, 'M') == true){
224
+         elseif (strpos($value, 'M') == true) {
225 225
             $duration = '/Month';
226 226
          }
227
-         else{
227
+         else {
228 228
             $duration = '/One-Time';
229 229
          }
230 230
          return $duration;
Please login to merge, or discard this patch.
Braces   +7 added lines, -10 removed lines patch added patch discarded remove patch
@@ -133,12 +133,11 @@  discard block
 block discarded – undo
133 133
         foreach ($plans as $value) {
134 134
             $cost = $value->planPrice()->where('currency', $currency)->first()->add_price;
135 135
             $cost = \App\Http\Controllers\Front\CartController::rounding($cost);
136
-            if ($value->days >= 366){ 
136
+            if ($value->days >= 366) {
137 137
             $months = intval($value->days / 30 / 12).' '.'year';
138
-            }elseif ($value->days < 365){
138
+            } elseif ($value->days < 365) {
139 139
              $months = intval($value->days / 30 ).' '.'months';
140
-        }
141
-        else {
140
+        } else {
142 141
             $months = '';
143 142
         }
144 143
          $price = $this->getPrice($months,$price, $currency, $value, $cost);
@@ -217,14 +216,12 @@  discard block
 block discarded – undo
217 216
     }
218 217
 
219 218
      public function getDuration($value)
220
-    {
221
-     if (strpos($value, 'Y') == true){
219
+     {
220
+     if (strpos($value, 'Y') == true) {
222 221
              $duration = '/Year';
223
-         }
224
-         elseif(strpos($value, 'M') == true){
222
+         } elseif(strpos($value, 'M') == true) {
225 223
             $duration = '/Month';
226
-         }
227
-         else{
224
+         } else {
228 225
             $duration = '/One-Time';
229 226
          }
230 227
          return $duration;
Please login to merge, or discard this patch.
app/Http/Controllers/Common/TemplateController.php 3 patches
Indentation   +7 added lines, -7 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
                         })
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     }
274 274
 
275 275
     public function mailing($from, $to, $data, $subject, $replace = [],
276
-     $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
276
+        $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
277 277
     {
278 278
         try {
279 279
             $transform = [];
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
             }
378 378
             foreach ($prices as $key => $value) {
379 379
                 $duration= $this->getDuration($value);
380
-               $priceVal[] = intval($value);
380
+                $priceVal[] = intval($value);
381 381
             }
382
-             $price = min($priceVal).' '.$duration;
382
+                $price = min($priceVal).' '.$duration;
383 383
             $cost = "$symbol$price";
384 384
         } else {
385 385
             $cost = 'Free';
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     } catch(\Exception $ex)
390 390
     {  
391 391
         Bugsnag::notifyException($ex);
392
-       return redirect()->back()->with('fails', $ex->getMessage());
392
+        return redirect()->back()->with('fails', $ex->getMessage());
393 393
     }
394 394
     }
395 395
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 
355 355
     public function leastAmount($id)
356 356
     {
357
-        try{
357
+        try {
358 358
         $cost = 'Free';
359 359
         $symbol = '';
360 360
         $price = '';
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                
377 377
             }
378 378
             foreach ($prices as $key => $value) {
379
-                $duration= $this->getDuration($value);
379
+                $duration = $this->getDuration($value);
380 380
                $priceVal[] = intval($value);
381 381
             }
382 382
              $price = min($priceVal).' '.$duration;
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         }
387 387
 
388 388
         return $cost;
389
-    } catch(\Exception $ex)
389
+    } catch (\Exception $ex)
390 390
     {  
391 391
         Bugsnag::notifyException($ex);
392 392
        return redirect()->back()->with('fails', $ex->getMessage());
Please login to merge, or discard this patch.
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 
355 355
     public function leastAmount($id)
356 356
     {
357
-        try{
357
+        try {
358 358
         $cost = 'Free';
359 359
         $symbol = '';
360 360
         $price = '';
@@ -386,8 +386,7 @@  discard block
 block discarded – undo
386 386
         }
387 387
 
388 388
         return $cost;
389
-    } catch(\Exception $ex)
390
-    {  
389
+    } catch(\Exception $ex) {
391 390
         Bugsnag::notifyException($ex);
392 391
        return redirect()->back()->with('fails', $ex->getMessage());
393 392
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedBaseInvoiceController.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
     public function newPayment(Request $request)
21 21
     {
22 22
         try{
23
-             $clientid = $request->input('clientid');
24
-             $invoice = new Invoice();
23
+                $clientid = $request->input('clientid');
24
+                $invoice = new Invoice();
25 25
             $order = new Order();
26 26
             $invoices = $invoice->where('user_id', $clientid)->where('status','=','pending')->orderBy('created_at', 'desc')->get();
27 27
             $cltCont = new \App\Http\Controllers\User\ClientController();
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
        
35 35
 
36 36
         return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
37
-                  'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
38
-     }catch(Exception $ex){
37
+                    'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
38
+        }catch(Exception $ex){
39 39
         return redirect()->back()->with('fails',$ex->getMessage());
40
-     }
40
+        }
41 41
     }
42 42
 
43 43
     public function postNewPayment($clientid, Request $request)
44 44
     {
45 45
         $this->validate($request, [
46
-           'payment_date'  => 'required',
47
-           'payment_method'=> 'required',
48
-           'amount'        => 'required',
46
+            'payment_date'  => 'required',
47
+            'payment_method'=> 'required',
48
+            'amount'        => 'required',
49 49
         ]);
50 50
 
51 51
         try {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function newPayment(Request $request)
21 21
     {
22
-        try{
22
+        try {
23 23
              $clientid = $request->input('clientid');
24 24
              $invoice = new Invoice();
25 25
             $order = new Order();
26
-            $invoices = $invoice->where('user_id', $clientid)->where('status','=','pending')->orderBy('created_at', 'desc')->get();
26
+            $invoices = $invoice->where('user_id', $clientid)->where('status', '=', 'pending')->orderBy('created_at', 'desc')->get();
27 27
             $cltCont = new \App\Http\Controllers\User\ClientController();
28 28
             $invoiceSum = $cltCont->getTotalInvoice($invoices);
29 29
             $amountReceived = $cltCont->getAmountPaid($clientid);
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
             $orders = $order->where('client', $clientid)->get();
34 34
        
35 35
 
36
-        return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
36
+        return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders',
37 37
                   'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
38
-     }catch(Exception $ex){
39
-        return redirect()->back()->with('fails',$ex->getMessage());
38
+     } catch (Exception $ex) {
39
+        return redirect()->back()->with('fails', $ex->getMessage());
40 40
      }
41 41
     }
42 42
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function newPayment(Request $request)
21 21
     {
22
-        try{
22
+        try {
23 23
              $clientid = $request->input('clientid');
24 24
              $invoice = new Invoice();
25 25
             $order = new Order();
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
37 37
                   'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
38
-     }catch(Exception $ex){
38
+     } catch(Exception $ex) {
39 39
         return redirect()->back()->with('fails',$ex->getMessage());
40 40
      }
41 41
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 3 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -129,22 +129,22 @@  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
-             $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
136
-             $order = Order::where('invoice_id', '=', $invoice_id)->first();
135
+                $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
136
+                $order = Order::where('invoice_id', '=', $invoice_id)->first();
137 137
 
138
-             $order_id = $order->id;
139
-             $endDate = Subscription::select('ends_at')
140
-                 ->where('product_id', $productid)->where('order_id', $order_id)->first();
138
+                $order_id = $order->id;
139
+                $endDate = Subscription::select('ends_at')
140
+                    ->where('product_id', $productid)->where('order_id', $order_id)->first();
141 141
 
142 142
             foreach ($versions as $version) {
143
-               if ($version->created_at->toDateTimeString()
144
-               < $endDate->ends_at->toDateTimeString())
145
-               {
146
-                   $countExpiry = $countExpiry +1;
147
-               }
143
+                if ($version->created_at->toDateTimeString()
144
+                < $endDate->ends_at->toDateTimeString())
145
+                {
146
+                    $countExpiry = $countExpiry +1;
147
+                }
148 148
             }
149 149
 
150 150
             return \DataTables::of($versions)
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                                         return $getDownload;
177 177
 
178 178
                          
179
-                                  }elseif($getDownloadCondition == 0){//When download retires after subscription
179
+                                    }elseif($getDownloadCondition == 0){//When download retires after subscription
180 180
                                           
181 181
                                         $getDownload =  $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions,$endDate,$productid,$versions,$clientid,$invoiceid);
182 182
 
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
             $link = (array_slice($link, 0, 10, true));
254 254
             $order = Order::where('invoice_id', '=', $invoiceid)->first();
255 255
             $order_id = $order->id;
256
-             $orderEndDate = Subscription::select('ends_at')
256
+                $orderEndDate = Subscription::select('ends_at')
257 257
                         ->where('product_id', $productid)->where('order_id', $order_id)->first();
258
-             foreach ($link as $lin) {
259
-              if(strtotime($lin['created_at']) < strtotime($orderEndDate->ends_at))
260
-               {
261
-                   $countExpiry = $countExpiry +1;
262
-               }
258
+                foreach ($link as $lin) {
259
+                if(strtotime($lin['created_at']) < strtotime($orderEndDate->ends_at))
260
+                {
261
+                    $countExpiry = $countExpiry +1;
262
+                }
263 263
             }
264 264
 
265 265
             return \DataTables::of($link)
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
             $bussinesses = \App\Model\Common\Bussiness::pluck('name', 'short')->toArray();
385 385
 
386 386
             return view('themes.default1.front.clients.profile',
387
-             compact('user', 'timezones', 'state', 'states', 'bussinesses'));
387
+                compact('user', 'timezones', 'state', 'states', 'bussinesses'));
388 388
         } catch (Exception $ex) {
389 389
             Bugsnag::notifyException($ex);
390 390
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                                 return $model->grand_total;
464 464
                             })
465 465
                             ->rawColumns(['checkbox', 'number', 'total',
466
-                             'payment_method', 'payment_status', 'created_at', ])
466
+                                'payment_method', 'payment_status', 'created_at', ])
467 467
                             ->make(true);
468 468
         } catch (Exception $ex) {
469 469
             Bugsnag::notifyException($ex);
@@ -489,17 +489,17 @@  discard block
 block discarded – undo
489 489
                             ->addColumn('number', function ($model) {
490 490
                                 return $model->invoice()->first()->number;
491 491
                             })
492
-                              ->addColumn('total', function ($model) {
493
-                                  return $model->amount;
494
-                              })
495
-                               ->addColumn('created_at', function ($model) {
496
-                                   $date1 = new DateTime($model->created_at);
497
-                                   $tz = \Auth::user()->timezone()->first()->name;
498
-                                   $date1->setTimezone(new DateTimeZone($tz));
499
-                                   $date = $date1->format('M j, Y, g:i a');
500
-
501
-                                   return $date;
502
-                               })
492
+                                ->addColumn('total', function ($model) {
493
+                                    return $model->amount;
494
+                                })
495
+                                ->addColumn('created_at', function ($model) {
496
+                                    $date1 = new DateTime($model->created_at);
497
+                                    $tz = \Auth::user()->timezone()->first()->name;
498
+                                    $date1->setTimezone(new DateTimeZone($tz));
499
+                                    $date = $date1->format('M j, Y, g:i a');
500
+
501
+                                    return $date;
502
+                                })
503 503
 
504 504
                             ->addColumn('payment_method', 'payment_status', 'created_at')
505 505
 
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 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) {
@@ -143,24 +143,24 @@  discard block
 block discarded – undo
143 143
                if ($version->created_at->toDateTimeString()
144 144
                < $endDate->ends_at->toDateTimeString())
145 145
                {
146
-                   $countExpiry = $countExpiry +1;
146
+                   $countExpiry = $countExpiry + 1;
147 147
                }
148 148
             }
149 149
 
150 150
             return \DataTables::of($versions)
151
-                            ->addColumn('id', function ($versions) {
151
+                            ->addColumn('id', function($versions) {
152 152
                                 return ucfirst($versions->id);
153 153
                             })
154
-                            ->addColumn('version', function ($versions) {
154
+                            ->addColumn('version', function($versions) {
155 155
                                 return ucfirst($versions->version);
156 156
                             })
157
-                            ->addColumn('title', function ($versions) {
157
+                            ->addColumn('title', function($versions) {
158 158
                                 return ucfirst($versions->title);
159 159
                             })
160
-                            ->addColumn('description', function ($versions) {
160
+                            ->addColumn('description', function($versions) {
161 161
                                 return ucfirst($versions->description);
162 162
                             })
163
-                            ->addColumn('file', function ($versions) use ($countExpiry, $countVersions,$clientid, $invoiceid, $productid) {
163
+                            ->addColumn('file', function($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) {
164 164
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
165 165
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
166 166
                                 $order_id = $order->id;
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
                                         return $getDownload;
177 177
 
178 178
                          
179
-                                  }elseif($getDownloadCondition == 0){//When download retires after subscription
179
+                                  }elseif ($getDownloadCondition == 0) {//When download retires after subscription
180 180
                                           
181
-                                        $getDownload =  $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions,$endDate,$productid,$versions,$clientid,$invoiceid);
181
+                                        $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $endDate, $productid, $versions, $clientid, $invoiceid);
182 182
 
183 183
                                         return $getDownload;
184 184
                                     }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     }
212 212
 
213 213
 
214
-    public function whenDownloadExpiresAfterExpiry($countExpiry, $countVersions,$endDate,$productid,$versions,$clientid,$invoiceid)
214
+    public function whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $endDate, $productid, $versions, $clientid, $invoiceid)
215 215
     {
216 216
         if ($countExpiry == $countVersions) {
217 217
             return '<p><a href='.url('download/'.$productid.'/'
@@ -249,38 +249,38 @@  discard block
 block discarded – undo
249 249
             $countExpiry = 0;
250 250
             $link = $this->github_api->getCurl1($url);
251 251
             $link = $link['body'];
252
-            $countVersions = 10;//because we are taking oly the first 10 versions
252
+            $countVersions = 10; //because we are taking oly the first 10 versions
253 253
             $link = (array_slice($link, 0, 10, true));
254 254
             $order = Order::where('invoice_id', '=', $invoiceid)->first();
255 255
             $order_id = $order->id;
256 256
              $orderEndDate = Subscription::select('ends_at')
257 257
                         ->where('product_id', $productid)->where('order_id', $order_id)->first();
258 258
              foreach ($link as $lin) {
259
-              if(strtotime($lin['created_at']) < strtotime($orderEndDate->ends_at))
259
+              if (strtotime($lin['created_at']) < strtotime($orderEndDate->ends_at))
260 260
                {
261
-                   $countExpiry = $countExpiry +1;
261
+                   $countExpiry = $countExpiry + 1;
262 262
                }
263 263
             }
264 264
 
265 265
             return \DataTables::of($link)
266
-                            ->addColumn('version', function ($link) {
266
+                            ->addColumn('version', function($link) {
267 267
                                 return ucfirst($link['tag_name']);
268 268
                             })
269
-                            ->addColumn('name', function ($link) {
269
+                            ->addColumn('name', function($link) {
270 270
                                 return ucfirst($link['name']);
271 271
                             })
272
-                            ->addColumn('description', function ($link) {
272
+                            ->addColumn('description', function($link) {
273 273
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
274 274
 
275 275
                                 return $markdown;
276 276
                             })
277
-                            ->addColumn('file', function ($link) use ( $countExpiry,$countVersions,$invoiceid, $productid) {
277
+                            ->addColumn('file', function($link) use ($countExpiry, $countVersions, $invoiceid, $productid) {
278 278
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
279 279
                                 $order_id = $order->id;
280 280
                                 $orderEndDate = Subscription::select('ends_at')
281 281
                                 ->where('product_id', $productid)->where('order_id', $order_id)->first();
282 282
                                 if ($orderEndDate) {
283
-                                    $actionButton = $this->getActionButton($countExpiry,$countVersions,$link, $orderEndDate, $productid);
283
+                                    $actionButton = $this->getActionButton($countExpiry, $countVersions, $link, $orderEndDate, $productid);
284 284
 
285 285
                                     return $actionButton;
286 286
                                 } elseif (!$orderEndDate) {
@@ -321,20 +321,20 @@  discard block
 block discarded – undo
321 321
             $orders = Order::where('client', \Auth::user()->id);
322 322
 
323 323
             return \DataTables::of($orders->get())
324
-                            ->addColumn('id', function ($model) {
324
+                            ->addColumn('id', function($model) {
325 325
                                 return $model->id;
326 326
                             })
327
-                            ->addColumn('product_name', function ($model) {
327
+                            ->addColumn('product_name', function($model) {
328 328
                                 return $model->product()->first()->name;
329 329
                             })
330
-                            ->addColumn('expiry', function ($model) {
330
+                            ->addColumn('expiry', function($model) {
331 331
                                 $tz = \Auth::user()->timezone()->first()->name;
332 332
                                 $end = $this->getExpiryDate($model);
333 333
 
334 334
                                 return $end;
335 335
                             })
336 336
 
337
-                            ->addColumn('Action', function ($model) {
337
+                            ->addColumn('Action', function($model) {
338 338
                                 $sub = $model->subscription()->first();
339 339
                                 $order = Order::where('id', $model->id)->select('product')->first();
340 340
                                 $productid = $order->product;
@@ -449,17 +449,17 @@  discard block
 block discarded – undo
449 449
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
450 450
 
451 451
             return \DataTables::of($payments->get())
452
-                            ->addColumn('checkbox', function ($model) {
452
+                            ->addColumn('checkbox', function($model) {
453 453
                                 if (\Input::get('client') != 'true') {
454 454
                                     return "<input type='checkbox' class='payment_checkbox' 
455 455
                                     value=".$model->id.' name=select[] id=check>';
456 456
                                 }
457 457
                             })
458
-                            ->addColumn('number', function ($model) {
458
+                            ->addColumn('number', function($model) {
459 459
                                 return $model->invoice()->first()->number;
460 460
                             })
461 461
                             ->addColumn('amount', 'payment_method', 'payment_status', 'created_at')
462
-                            ->addColumn('total', function ($model) {
462
+                            ->addColumn('total', function($model) {
463 463
                                 return $model->grand_total;
464 464
                             })
465 465
                             ->rawColumns(['checkbox', 'number', 'total',
@@ -486,13 +486,13 @@  discard block
 block discarded – undo
486 486
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
487 487
             //dd(\Input::all());
488 488
             return \DataTables::of($payments->get())
489
-                            ->addColumn('number', function ($model) {
489
+                            ->addColumn('number', function($model) {
490 490
                                 return $model->invoice()->first()->number;
491 491
                             })
492
-                              ->addColumn('total', function ($model) {
492
+                              ->addColumn('total', function($model) {
493 493
                                   return $model->amount;
494 494
                               })
495
-                               ->addColumn('created_at', function ($model) {
495
+                               ->addColumn('created_at', function($model) {
496 496
                                    $date1 = new DateTime($model->created_at);
497 497
                                    $tz = \Auth::user()->timezone()->first()->name;
498 498
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -141,8 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
             foreach ($versions as $version) {
143 143
                if ($version->created_at->toDateTimeString()
144
-               < $endDate->ends_at->toDateTimeString())
145
-               {
144
+               < $endDate->ends_at->toDateTimeString()) {
146 145
                    $countExpiry = $countExpiry +1;
147 146
                }
148 147
             }
@@ -170,13 +169,15 @@  discard block
 block discarded – undo
170 169
 
171 170
                                 //if product has expiry date ie sunscriptioon is generated
172 171
                                 if ($endDate) {
173
-                                    if ($getDownloadCondition == 1) {//Perpetual download till expiry selected
172
+                                    if ($getDownloadCondition == 1) {
173
+//Perpetual download till expiry selected
174 174
                                         $getDownload = $this->whenDownloadTillExpiry($endDate, $productid, $versions, $clientid, $invoiceid);
175 175
 
176 176
                                         return $getDownload;
177 177
 
178 178
                          
179
-                                  }elseif($getDownloadCondition == 0){//When download retires after subscription
179
+                                  } elseif($getDownloadCondition == 0) {
180
+//When download retires after subscription
180 181
                                           
181 182
                                         $getDownload =  $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions,$endDate,$productid,$versions,$clientid,$invoiceid);
182 183
 
@@ -256,8 +257,7 @@  discard block
 block discarded – undo
256 257
              $orderEndDate = Subscription::select('ends_at')
257 258
                         ->where('product_id', $productid)->where('order_id', $order_id)->first();
258 259
              foreach ($link as $lin) {
259
-              if(strtotime($lin['created_at']) < strtotime($orderEndDate->ends_at))
260
-               {
260
+              if(strtotime($lin['created_at']) < strtotime($orderEndDate->ends_at)) {
261 261
                    $countExpiry = $countExpiry +1;
262 262
                }
263 263
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Front/BaseClientController.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
             </i>&nbsp;&nbsp;Download</a>".'&nbsp;
98 98
 
99 99
       </p>';
100
-         }
101
-         else {
100
+            }
101
+            else {
102 102
             return '<button class="btn btn-primary btn-sm disabled tooltip">
103 103
             Download <span class="tooltiptext">Please Renew!!</span></button>';
104 104
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
       </p>';
115 115
         }
116 116
         else{
117
-             return '<button class="btn btn-primary btn-sm disabled tooltip">
117
+                return '<button class="btn btn-primary btn-sm disabled tooltip">
118 118
             Download <span class="tooltiptext">Please Renew!!</span></button>';
119 119
 
120 120
         } 
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
             }
191 191
 
192 192
             return \DataTables::of($invoices->get())
193
-             ->addColumn('number', function ($model) {
194
-                 return $model->number;
195
-             })
193
+                ->addColumn('number', function ($model) {
194
+                    return $model->number;
195
+                })
196 196
             ->addColumn('products', function ($model) {
197 197
                 $invoice = $this->invoice->find($model->id);
198 198
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
         return view('themes.default1.renew.popup', compact('id', 'productid'));
83 83
     }
84 84
 
85
-    public function getActionButton($countExpiry,$countVersions,$link, $orderEndDate, $productid)
85
+    public function getActionButton($countExpiry, $countVersions, $link, $orderEndDate, $productid)
86 86
     {
87 87
         $getDownloadCondition = Product::where('id', $productid)->value('deny_after_subscription');
88 88
         if ($getDownloadCondition == 1)
89 89
             {
90
-                if(strtotime($link['created_at']) < strtotime($orderEndDate->ends_at)) {
90
+                if (strtotime($link['created_at']) < strtotime($orderEndDate->ends_at)) {
91 91
             $githubApi = new \App\Http\Controllers\Github\GithubApiController();
92 92
 
93 93
             $link = $githubApi->getCurl1($link['zipball_url']);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             Download <span class="tooltiptext">Please Renew!!</span></button>';
104 104
         }
105 105
     } elseif ($getDownloadCondition == 0) {
106
-            if ($countExpiry == $countVersions){
106
+            if ($countExpiry == $countVersions) {
107 107
             $githubApi = new \App\Http\Controllers\Github\GithubApiController();
108 108
             $link = $githubApi->getCurl1($link['zipball_url']);
109 109
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
       </p>';
115 115
         }
116
-        else{
116
+        else {
117 117
              return '<button class="btn btn-primary btn-sm disabled tooltip">
118 118
             Download <span class="tooltiptext">Please Renew!!</span></button>';
119 119
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 $user->profile_pic = $fileName;
137 137
             }
138 138
             $user->fill($request->input())->save();
139
-            $response = ['type' => 'success',  'message' =>'Updated Successfully..'];
139
+            $response = ['type' => 'success', 'message' =>'Updated Successfully..'];
140 140
 
141 141
             return $response;
142 142
         } catch (Exception $ex) {
@@ -190,27 +190,27 @@  discard block
 block discarded – undo
190 190
             }
191 191
 
192 192
             return \DataTables::of($invoices->get())
193
-             ->addColumn('number', function ($model) {
193
+             ->addColumn('number', function($model) {
194 194
                  return $model->number;
195 195
              })
196
-            ->addColumn('products', function ($model) {
196
+            ->addColumn('products', function($model) {
197 197
                 $invoice = $this->invoice->find($model->id);
198 198
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
199 199
 
200 200
                 return ucfirst(implode(',', $products));
201 201
             })
202
-            ->addColumn('date', function ($model) {
202
+            ->addColumn('date', function($model) {
203 203
                 $date = date_create($model->created_at);
204 204
 
205 205
                 return date_format($date, 'M j, Y, g:i a');
206 206
             })
207
-            ->addColumn('total', function ($model) {
207
+            ->addColumn('total', function($model) {
208 208
                 return $model->grand_total;
209 209
             })
210
-            ->addColumn('status', function ($model) {
210
+            ->addColumn('status', function($model) {
211 211
                 return ucfirst($model->status);
212 212
             })
213
-            ->addColumn('action', function ($model) {
213
+            ->addColumn('action', function($model) {
214 214
                 if (\Auth::user()->role == 'admin') {
215 215
                     $url = '/invoices/show?invoiceid='.$model->id;
216 216
                 } else {
Please login to merge, or discard this patch.
Braces   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
     public function getActionButton($countExpiry,$countVersions,$link, $orderEndDate, $productid)
86 86
     {
87 87
         $getDownloadCondition = Product::where('id', $productid)->value('deny_after_subscription');
88
-        if ($getDownloadCondition == 1)
89
-            {
88
+        if ($getDownloadCondition == 1) {
90 89
                 if(strtotime($link['created_at']) < strtotime($orderEndDate->ends_at)) {
91 90
             $githubApi = new \App\Http\Controllers\Github\GithubApiController();
92 91
 
@@ -97,13 +96,12 @@  discard block
 block discarded – undo
97 96
             </i>&nbsp;&nbsp;Download</a>".'&nbsp;
98 97
 
99 98
       </p>';
100
-         }
101
-         else {
99
+         } else {
102 100
             return '<button class="btn btn-primary btn-sm disabled tooltip">
103 101
             Download <span class="tooltiptext">Please Renew!!</span></button>';
104 102
         }
105 103
     } elseif ($getDownloadCondition == 0) {
106
-            if ($countExpiry == $countVersions){
104
+            if ($countExpiry == $countVersions) {
107 105
             $githubApi = new \App\Http\Controllers\Github\GithubApiController();
108 106
             $link = $githubApi->getCurl1($link['zipball_url']);
109 107
 
@@ -112,8 +110,7 @@  discard block
 block discarded – undo
112 110
             </i>&nbsp;&nbsp;Download</a>".'&nbsp;
113 111
 
114 112
       </p>';
115
-        }
116
-        else{
113
+        } else {
117 114
              return '<button class="btn btn-primary btn-sm disabled tooltip">
118 115
             Download <span class="tooltiptext">Please Renew!!</span></button>';
119 116
 
Please login to merge, or discard this patch.