Completed
Pull Request — development (#552)
by Ashutosh
19:55 queued 09:32
created
app/Http/Controllers/User/ClientController.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
          $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position);
79 79
 
80 80
         return\ DataTables::of($user->get())
81
-                         ->addColumn('checkbox', function ($model) {
81
+                         ->addColumn('checkbox', function($model) {
82 82
                              return "<input type='checkbox' class='user_checkbox' 
83 83
                             value=".$model->id.' name=select[] id=check>';
84 84
                          })
85
-                        ->addColumn('first_name', function ($model) {
85
+                        ->addColumn('first_name', function($model) {
86 86
                             return '<a href='.url('clients/'.$model->id).'>'
87 87
                             .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>';
88 88
                         })
89
-                         ->addColumn('email', function ($model) {
89
+                         ->addColumn('email', function($model) {
90 90
                              return $model->email;
91 91
                          })
92
-                          ->addColumn('created_at', function ($model) {
92
+                          ->addColumn('created_at', function($model) {
93 93
                               $ends = $model->created_at;
94 94
                               if ($ends) {
95 95
                                   $date1 = new DateTime($ends);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                               return $end;
102 102
                           })
103 103
                         // ->showColumns('email', 'created_at')
104
-                        ->addColumn('active', function ($model) {
104
+                        ->addColumn('active', function($model) {
105 105
                             if ($model->active == 1) {
106 106
                                 $email = "<span class='glyphicon glyphicon-envelope'
107 107
                                  style='color:green' title='verified email'></span>";
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
                             return $email.'&nbsp;&nbsp;'.$mobile;
121 121
                         })
122
-                        ->addColumn('action', function ($model) {
122
+                        ->addColumn('action', function($model) {
123 123
                             return '<a href='.url('clients/'.$model->id.'/edit')
124 124
                             ." class='btn btn-sm btn-primary btn-xs'>
125 125
                             <i class='fa fa-edit' style='color:white;'> </i>&nbsp;&nbsp;Edit</a>"
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                                     <i class='fa fa-eye' style='color:white;'> </i>&nbsp;&nbsp;View</a>";
129 129
                             // return 'hhhh';
130 130
                         })
131
-                        ->rawColumns(['checkbox', 'first_name', 'email',  'created_at', 'active', 'action'])
131
+                        ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action'])
132 132
                         ->make(true);
133 133
 
134 134
         // ->searchColumns('email', 'first_name')
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -75,31 +75,31 @@  discard block
 block discarded – undo
75 75
         $position = $request->input('position');
76 76
 
77 77
         $user = $this->advanceSearch($name, $username, $company,
78
-         $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position);
78
+            $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position);
79 79
 
80 80
         return\ DataTables::of($user->get())
81
-                         ->addColumn('checkbox', function ($model) {
82
-                             return "<input type='checkbox' class='user_checkbox' 
81
+                            ->addColumn('checkbox', function ($model) {
82
+                                return "<input type='checkbox' class='user_checkbox' 
83 83
                             value=".$model->id.' name=select[] id=check>';
84
-                         })
84
+                            })
85 85
                         ->addColumn('first_name', function ($model) {
86 86
                             return '<a href='.url('clients/'.$model->id).'>'
87 87
                             .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>';
88 88
                         })
89
-                         ->addColumn('email', function ($model) {
90
-                             return $model->email;
91
-                         })
92
-                          ->addColumn('created_at', function ($model) {
93
-                              $ends = $model->created_at;
94
-                              if ($ends) {
95
-                                  $date1 = new DateTime($ends);
96
-                                  $tz = \Auth::user()->timezone()->first()->name;
97
-                                  $date1->setTimezone(new DateTimeZone($tz));
98
-                                  $end = $date1->format('M j, Y, g:i a ');
99
-                              }
100
-
101
-                              return $end;
102
-                          })
89
+                            ->addColumn('email', function ($model) {
90
+                                return $model->email;
91
+                            })
92
+                            ->addColumn('created_at', function ($model) {
93
+                                $ends = $model->created_at;
94
+                                if ($ends) {
95
+                                    $date1 = new DateTime($ends);
96
+                                    $tz = \Auth::user()->timezone()->first()->name;
97
+                                    $date1->setTimezone(new DateTimeZone($tz));
98
+                                    $end = $date1->format('M j, Y, g:i a ');
99
+                                }
100
+
101
+                                return $end;
102
+                            })
103 103
                         // ->showColumns('email', 'created_at')
104 104
                         ->addColumn('active', function ($model) {
105 105
                             if ($model->active == 1) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
             return view('themes.default1.user.client.show',
222 222
                 compact('id', 'client', 'invoices', 'model_popup', 'orders',
223
-                 'payments', 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'extraAmt', 'comments'));
223
+                    'payments', 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'extraAmt', 'comments'));
224 224
         } catch (\Exception $ex) {
225 225
             app('log')->info($ex->getMessage());
226 226
             Bugsnag::notifyException($ex);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
             return view('themes.default1.user.client.edit',
328 328
                 compact('bussinesses', 'user', 'timezones', 'state',
329 329
                     'states', 'managers', 'selectedCurrency', 'selectedCompany',
330
-                     'selectedIndustry', 'selectedCompanySize'));
330
+                        'selectedIndustry', 'selectedCompanySize'));
331 331
         } catch (\Exception $ex) {
332 332
             app('log')->error($ex->getMessage());
333 333
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
                 return \Response::json([]);
424 424
             }
425 425
             $users = User::where('email', 'LIKE', '%'.$term.'%')
426
-             ->orWhere('first_name', 'LIKE', '%'.$term.'%')
427
-             ->orWhere('last_name', 'LIKE', '%'.$term.'%')
428
-             ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get();
426
+                ->orWhere('first_name', 'LIKE', '%'.$term.'%')
427
+                ->orWhere('last_name', 'LIKE', '%'.$term.'%')
428
+                ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get();
429 429
             $formatted_tags = [];
430 430
 
431 431
             foreach ($users as $user) {
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
     }
442 442
 
443 443
     public function advanceSearch($name = '', $username = '', $company = '',
444
-     $mobile = '', $email = '', $country = '', $industry = '',
445
-      $company_type = '', $company_size = '', $role = '', $position = '')
444
+        $mobile = '', $email = '', $country = '', $industry = '',
445
+        $company_type = '', $company_size = '', $role = '', $position = '')
446 446
     {
447 447
         $join = \DB::table('users');
448 448
         $join = $this->getNamUserCom($join, $name, $username, $company);
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 
453 453
         $join = $join->orderBy('created_at', 'desc')
454 454
         ->select('id', 'first_name', 'last_name', 'email', 'created_at',
455
-         'active', 'mobile_verified', 'role', 'position');
455
+            'active', 'mobile_verified', 'role', 'position');
456 456
 
457 457
         return $join;
458 458
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Product/PlanController.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -83,22 +83,22 @@  discard block
 block discarded – undo
83 83
 
84 84
                             return ucfirst($response);
85 85
                         })
86
-                         ->addColumn('price', function ($model) use ($defaultCurrency) {
87
-                             $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
86
+                            ->addColumn('price', function ($model) use ($defaultCurrency) {
87
+                                $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
88 88
                             ->pluck('add_price')->first();
89
-                             if ($price != null) {
90
-                                 return $price;
91
-                             } else {
92
-                                 return 'Not Available';
93
-                             }
94
-                         })
95
-                         ->addColumn('currency', function ($model) use ($defaultCurrency) {
96
-                             if ($defaultCurrency && $defaultCurrency != null) {
97
-                                 return $defaultCurrency;
98
-                             } else {
99
-                                 return 'Not Available';
100
-                             }
101
-                         })
89
+                                if ($price != null) {
90
+                                    return $price;
91
+                                } else {
92
+                                    return 'Not Available';
93
+                                }
94
+                            })
95
+                            ->addColumn('currency', function ($model) use ($defaultCurrency) {
96
+                                if ($defaultCurrency && $defaultCurrency != null) {
97
+                                    return $defaultCurrency;
98
+                                } else {
99
+                                    return 'Not Available';
100
+                                }
101
+                            })
102 102
                         ->addColumn('action', function ($model) {
103 103
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
104 104
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
         $products = $this->product->pluck('name', 'id')->toArray();
191 191
         foreach ($products as $key => $product) {
192 192
             $selectedProduct = $this->product->where('id', $plan->product)
193
-          ->pluck('name', 'id', 'subscription')->toArray();
193
+            ->pluck('name', 'id', 'subscription')->toArray();
194 194
         }
195 195
         $selectedPeriods = $this->period->where('days', $plan->days)
196
-       ->pluck('name', 'days')->toArray();
196
+        ->pluck('name', 'days')->toArray();
197 197
 
198 198
         return view('themes.default1.product.plan.edit',
199 199
             compact('plan', 'currency', 'add_price', 'renew_price', 'periods', 'products',
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             'name'          => 'required',
217 217
             'add_price.*'   => 'required',
218 218
             'product'       => 'required',
219
-              'days'        => $days_rule.'numeric',
219
+                'days'        => $days_rule.'numeric',
220 220
         ]);
221 221
         $plan = $this->plan->where('id', $id)->first();
222 222
         $plan->fill($request->input())->save();
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,19 +61,19 @@  discard block
 block discarded – undo
61 61
         $defaultCurrency = Setting::where('id', 1)->value('default_currency');
62 62
 
63 63
         return\ DataTables::of($new_plan)
64
-                        ->addColumn('checkbox', function ($model) {
64
+                        ->addColumn('checkbox', function($model) {
65 65
                             return "<input type='checkbox' class='plan_checkbox' 
66 66
                             value=".$model->id.' name=select[] id=check>';
67 67
                         })
68
-                        ->addColumn('name', function ($model) {
68
+                        ->addColumn('name', function($model) {
69 69
                             return ucfirst($model->name);
70 70
                         })
71
-                        ->addColumn('days', function ($model) {
71
+                        ->addColumn('days', function($model) {
72 72
                             $months = $model->days / 30;
73 73
 
74 74
                             return round($months);
75 75
                         })
76
-                        ->addColumn('product', function ($model) {
76
+                        ->addColumn('product', function($model) {
77 77
                             $productid = $model->product;
78 78
                             $product = $this->product->where('id', $productid)->first();
79 79
                             $response = '';
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
                             return ucfirst($response);
85 85
                         })
86
-                         ->addColumn('price', function ($model) use ($defaultCurrency) {
86
+                         ->addColumn('price', function($model) use ($defaultCurrency) {
87 87
                              $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
88 88
                             ->pluck('add_price')->first();
89 89
                              if ($price != null) {
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
                                  return 'Not Available';
93 93
                              }
94 94
                          })
95
-                         ->addColumn('currency', function ($model) use ($defaultCurrency) {
95
+                         ->addColumn('currency', function($model) use ($defaultCurrency) {
96 96
                              if ($defaultCurrency && $defaultCurrency != null) {
97 97
                                  return $defaultCurrency;
98 98
                              } else {
99 99
                                  return 'Not Available';
100 100
                              }
101 101
                          })
102
-                        ->addColumn('action', function ($model) {
102
+                        ->addColumn('action', function($model) {
103 103
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
104 104
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
105 105
                             style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
                             ->addColumn('name', function ($model) {
115 115
                                 return ucfirst($model->name);
116 116
                             })
117
-                              ->addColumn('image', function ($model) {
118
-                                  // return $model->image;
119
-                                  return "<img src= '$model->image' + height=\"80\"/>";
120
-                              })
117
+                                ->addColumn('image', function ($model) {
118
+                                    // return $model->image;
119
+                                    return "<img src= '$model->image' + height=\"80\"/>";
120
+                                })
121 121
                             ->addColumn('type', function ($model) {
122 122
                                 if ($this->type->where('id', $model->type)->first()) {
123 123
                                     return $this->type->where('id', $model->type)->first()->name;
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
                         'group'      => 'required',
336 336
                         'description'=> 'required',
337 337
                         'image'      => 'sometimes | mimes:jpeg,jpg,png,gif | max:1000',
338
-      ]);
338
+        ]);
339 339
 
340 340
             if ($v->fails()) {
341 341
                 return redirect()->back()->with('errors', $v->errors());
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -107,18 +107,18 @@  discard block
 block discarded – undo
107 107
 
108 108
                 return\ DataTables::of($new_product)
109 109
 
110
-                            ->addColumn('checkbox', function ($model) {
110
+                            ->addColumn('checkbox', function($model) {
111 111
                                 return "<input type='checkbox' class='product_checkbox' 
112 112
                                 value=".$model->id.' name=select[] id=check>';
113 113
                             })
114
-                            ->addColumn('name', function ($model) {
114
+                            ->addColumn('name', function($model) {
115 115
                                 return ucfirst($model->name);
116 116
                             })
117
-                              ->addColumn('image', function ($model) {
117
+                              ->addColumn('image', function($model) {
118 118
                                   // return $model->image;
119 119
                                   return "<img src= '$model->image' + height=\"80\"/>";
120 120
                               })
121
-                            ->addColumn('type', function ($model) {
121
+                            ->addColumn('type', function($model) {
122 122
                                 if ($this->type->where('id', $model->type)->first()) {
123 123
                                     return $this->type->where('id', $model->type)->first()->name;
124 124
                                 } else {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                                 }
127 127
                             })
128 128
 
129
-                            ->addColumn('group', function ($model) {
129
+                            ->addColumn('group', function($model) {
130 130
                                 if ($this->group->where('id', $model->group)->first()) {
131 131
                                     return $this->group->where('id', $model->group)->first()->name;
132 132
                                 } else {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                                 }
135 135
                             })
136 136
 
137
-                            ->addColumn('Action', function ($model) {
137
+                            ->addColumn('Action', function($model) {
138 138
                                 $url = '';
139 139
                                 if ($model->type == 2) {
140 140
                                     $url = '<a href='.url('product/download/'.$model->id).
Please login to merge, or discard this patch.