@@ -122,18 +122,18 @@ discard block |
||
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> Edit</a>"; |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | $settings = \App\Model\Common\Setting::find(1); |
286 | 286 | $fromname = $settings->company; |
287 | - \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) { |
|
287 | + \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) { |
|
288 | 288 | $m->from($from, $fromname); |
289 | 289 | |
290 | 290 | $m->to($to, $toname)->subject($subject); |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | value=".$model->id.' name=select[] id=check>'; |
123 | 123 | }) |
124 | 124 | |
125 | - ->addColumn('name', function ($model) { |
|
126 | - return $model->name; |
|
127 | - }) |
|
125 | + ->addColumn('name', function ($model) { |
|
126 | + return $model->name; |
|
127 | + }) |
|
128 | 128 | ->addColumn('type', function ($model) { |
129 | 129 | return $this->type->where('id', $model->type)->first()->name; |
130 | 130 | }) |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | public function mailing($from, $to, $data, $subject, $replace = [], |
271 | - $type = '', $fromname = '', $toname = '', $cc = [], $attach = []) |
|
271 | + $type = '', $fromname = '', $toname = '', $cc = [], $attach = []) |
|
272 | 272 | { |
273 | 273 | try { |
274 | 274 | $transform = []; |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | 'date' => date('Y-m-d H:i:s'), |
302 | 302 | 'from' => $from, |
303 | 303 | 'to' => $to, |
304 | - 'subject' => $subject, |
|
304 | + 'subject' => $subject, |
|
305 | 305 | 'body' => $data, |
306 | 306 | 'status' => 'success', |
307 | - ]); |
|
307 | + ]); |
|
308 | 308 | |
309 | 309 | return 'success'; |
310 | 310 | } catch (\Exception $ex) { |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | 'date' => date('Y-m-d H:i:s'), |
313 | 313 | 'from' => $from, |
314 | 314 | 'to' => $to, |
315 | - 'subject' => $subject, |
|
315 | + 'subject' => $subject, |
|
316 | 316 | 'body' => $data, |
317 | 317 | 'status' => 'failed', |
318 | 318 | ]); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | protected static $logName = 'Product'; |
20 | 20 | |
21 | 21 | protected static $logAttributes = ['name', 'description', 'type', 'file', 'category', |
22 | - 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', 'product_sku', ]; |
|
22 | + 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', 'product_sku', ]; |
|
23 | 23 | |
24 | 24 | protected static $logOnlyDirty = true; |
25 | 25 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | use LogsActivity; |
11 | 11 | protected $table = 'products'; |
12 | 12 | protected $fillable = ['name', 'description', 'type', 'group', 'file', 'image', 'require_domain', 'category', |
13 | - 'can_modify_agent', 'can_modify_quantity', 'show_agent', 'tax_apply', 'show_product_quantity', 'hidden', 'auto_terminate', |
|
13 | + 'can_modify_agent', 'can_modify_quantity', 'show_agent', 'tax_apply', 'show_product_quantity', 'hidden', 'auto_terminate', |
|
14 | 14 | 'setup_order_placed', 'setup_first_payment', 'setup_accept_manually', |
15 | 15 | 'no_auto_setup', 'shoping_cart_link', 'process_url', 'github_owner', |
16 | 16 | 'github_repository', |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | protected static $logName = 'Product'; |
20 | 20 | |
21 | 21 | protected static $logAttributes = ['name', 'description', 'type', 'file', 'category', |
22 | - 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', 'product_sku', ]; |
|
22 | + 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', 'product_sku', ]; |
|
23 | 23 | |
24 | 24 | protected static $logOnlyDirty = true; |
25 | 25 |
@@ -48,15 +48,15 @@ |
||
48 | 48 | $condition = new \App\Model\Mailjob\Condition(); |
49 | 49 | $command = $condition->getConditionValue($task); |
50 | 50 | switch ($task) { |
51 | - case 'expiryMail': |
|
52 | - if ($expiryMailStatus == 1) { |
|
53 | - return $this->getCondition($schedule->command('expiry:notification'), $command); |
|
54 | - } |
|
51 | + case 'expiryMail': |
|
52 | + if ($expiryMailStatus == 1) { |
|
53 | + return $this->getCondition($schedule->command('expiry:notification'), $command); |
|
54 | + } |
|
55 | 55 | |
56 | - case 'deleteLogs': |
|
57 | - if ($logDeleteStatus == 1) { |
|
58 | - return $this->getCondition($schedule->command('activitylog:clean'), $command); |
|
59 | - } |
|
56 | + case 'deleteLogs': |
|
57 | + if ($logDeleteStatus == 1) { |
|
58 | + return $this->getCondition($schedule->command('activitylog:clean'), $command); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | } |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | */ |
18 | 18 | protected $commands = [ |
19 | 19 | // |
20 | - 'App\Console\Commands\Inspire', |
|
21 | - \App\Console\Commands\Install::class, |
|
22 | - CurrencyManage::class, |
|
20 | + 'App\Console\Commands\Inspire', |
|
21 | + \App\Console\Commands\Install::class, |
|
22 | + CurrencyManage::class, |
|
23 | 23 | 'App\Console\Commands\ExpiryCron', |
24 | 24 | ]; |
25 | 25 | |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | switch ($task) { |
53 | 53 | case 'expiryMail': |
54 | 54 | if ($expiryMailStatus == 1) { |
55 | - return $this->getCondition($schedule->command('expiry:notification'), $command); |
|
56 | - } |
|
55 | + return $this->getCondition($schedule->command('expiry:notification'), $command); |
|
56 | + } |
|
57 | 57 | |
58 | 58 | case 'deleteLogs': |
59 | 59 | if ($logDeleteStatus == 1) { |
60 | - return $this->getCondition($schedule->command('activitylog:clean'), $command); |
|
61 | - } |
|
60 | + return $this->getCondition($schedule->command('activitylog:clean'), $command); |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
@@ -25,7 +25,8 @@ |
||
25 | 25 | $currencyAndSymbol = $cart_controller->currency(); |
26 | 26 | $currency = $currencyAndSymbol['currency']; |
27 | 27 | $symbol = $currencyAndSymbol['symbol']; |
28 | - if ($symbol == '') { //If user has no currency symbol(In case of old customers) |
|
28 | + if ($symbol == '') { |
|
29 | +//If user has no currency symbol(In case of old customers) |
|
29 | 30 | $symbol = Currency::where('code', $currency)->pluck('symbol')->first(); |
30 | 31 | $symbol = \Auth::user()->update(['currency_symbol'=> $symbol]); |
31 | 32 | } |
@@ -435,7 +435,7 @@ |
||
435 | 435 | |
436 | 436 | StatusSetting::where('id', 1)->update(['recaptcha_status'=>$status]); |
437 | 437 | ApiKey::where('id', 1)->update(['nocaptcha_sitekey'=> $nocaptcha_sitekey, |
438 | - 'captcha_secretCheck' => $captcha_secretCheck, ]); |
|
438 | + 'captcha_secretCheck' => $captcha_secretCheck, ]); |
|
439 | 439 | |
440 | 440 | return ['message' => 'success', 'update'=>'Recaptcha Settings Updated']; |
441 | 441 | } |
@@ -296,7 +296,7 @@ |
||
296 | 296 | |
297 | 297 | // validate detected / default PHP CLI |
298 | 298 | // Because array_filter() preserves keys, you should consider the resulting array to be an associative array even if the original array had integer keys for there may be holes in your sequence of keys. This means that, for example, json_encode() will convert your result array into an object instead of an array. Call array_values() on the result array to guarantee json_encode() gives you an array. |
299 | - $paths = array_values(array_filter($paths, function ($path) { |
|
299 | + $paths = array_values(array_filter($paths, function($path) { |
|
300 | 300 | return is_executable($path) && preg_match("/php[0-9\.a-z]{0,3}$/i", $path); |
301 | 301 | })); |
302 | 302 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | ->addColumn('version', function ($model) { |
88 | 88 | return $model['version']; |
89 | 89 | }) |
90 | - ->rawColumns(['name', 'description', 'author', 'website', 'version']) |
|
90 | + ->rawColumns(['name', 'description', 'author', 'website', 'version']) |
|
91 | 91 | ->make(true); |
92 | 92 | } |
93 | 93 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | return \DataTables::of(new Collection($plugins)) |
17 | 17 | // ->searchColumns('name') |
18 | - ->addColumn('name', function ($model) { |
|
18 | + ->addColumn('name', function($model) { |
|
19 | 19 | if (array_has($model, 'path')) { |
20 | 20 | if ($model['status'] == 0) { |
21 | 21 | $activate = '<a href='.url('plugin/status/'.$model['name']).'>Activate</a>'; |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | |
52 | 52 | return ucfirst($model['name']).$action; |
53 | 53 | }) |
54 | - ->addColumn('description', function ($model) { |
|
54 | + ->addColumn('description', function($model) { |
|
55 | 55 | return $model['description']; |
56 | 56 | }) |
57 | - ->addColumn('author', function ($model) { |
|
57 | + ->addColumn('author', function($model) { |
|
58 | 58 | return ucfirst($model['author']); |
59 | 59 | }) |
60 | - ->addColumn('website', function ($model) { |
|
60 | + ->addColumn('website', function($model) { |
|
61 | 61 | return '<a href='.$model['website'].' target=_blank>'.$model['website'].'</a>'; |
62 | 62 | }) |
63 | - ->addColumn('version', function ($model) { |
|
63 | + ->addColumn('version', function($model) { |
|
64 | 64 | return $model['version']; |
65 | 65 | }) |
66 | 66 | ->rawColumns(['name', 'description', 'author', 'website', 'version']) |
@@ -96,7 +96,8 @@ |
||
96 | 96 | $pluginName[] = $plugin->name; //get the name of active plugin |
97 | 97 | } |
98 | 98 | |
99 | - if (count($models) > 0) {//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned |
|
99 | + if (count($models) > 0) { |
|
100 | +//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned |
|
100 | 101 | for ($i = 0; $i < count($pluginName); $i++) { |
101 | 102 | $currencies = explode(',', $models[$i]->currencies); |
102 | 103 | if (in_array($currency, $currencies)) { |
@@ -302,37 +302,37 @@ discard block |
||
302 | 302 | $query = $this->advanceSearch($from, $till, $delFrom, $delTill); |
303 | 303 | |
304 | 304 | return \DataTables::of($query->take(50)) |
305 | - ->setTotalRecords($query->count()) |
|
306 | - ->addColumn('checkbox', function ($model) { |
|
307 | - return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
|
308 | - }) |
|
309 | - ->addColumn('name', function ($model) { |
|
310 | - return ucfirst($model->log_name); |
|
311 | - }) |
|
312 | - ->addColumn('description', function ($model) { |
|
313 | - return ucfirst($model->description); |
|
314 | - }) |
|
315 | - ->addColumn('username', function ($model) { |
|
316 | - $causer_id = $model->causer_id; |
|
317 | - $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
|
318 | - foreach ($names as $key => $value) { |
|
319 | - $fullName = $key.' '.$value; |
|
320 | - |
|
321 | - return $fullName; |
|
322 | - } |
|
323 | - }) |
|
324 | - ->addColumn('role', function ($model) { |
|
325 | - $causer_id = $model->causer_id; |
|
326 | - $role = User::where('id', $causer_id)->pluck('role'); |
|
327 | - |
|
328 | - return json_decode($role); |
|
329 | - }) |
|
330 | - ->addColumn('new', function ($model) { |
|
331 | - $properties = ($model->properties); |
|
332 | - $newEntry = $this->getNewEntry($properties, $model); |
|
333 | - |
|
334 | - return $newEntry; |
|
335 | - }) |
|
305 | + ->setTotalRecords($query->count()) |
|
306 | + ->addColumn('checkbox', function ($model) { |
|
307 | + return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
|
308 | + }) |
|
309 | + ->addColumn('name', function ($model) { |
|
310 | + return ucfirst($model->log_name); |
|
311 | + }) |
|
312 | + ->addColumn('description', function ($model) { |
|
313 | + return ucfirst($model->description); |
|
314 | + }) |
|
315 | + ->addColumn('username', function ($model) { |
|
316 | + $causer_id = $model->causer_id; |
|
317 | + $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
|
318 | + foreach ($names as $key => $value) { |
|
319 | + $fullName = $key.' '.$value; |
|
320 | + |
|
321 | + return $fullName; |
|
322 | + } |
|
323 | + }) |
|
324 | + ->addColumn('role', function ($model) { |
|
325 | + $causer_id = $model->causer_id; |
|
326 | + $role = User::where('id', $causer_id)->pluck('role'); |
|
327 | + |
|
328 | + return json_decode($role); |
|
329 | + }) |
|
330 | + ->addColumn('new', function ($model) { |
|
331 | + $properties = ($model->properties); |
|
332 | + $newEntry = $this->getNewEntry($properties, $model); |
|
333 | + |
|
334 | + return $newEntry; |
|
335 | + }) |
|
336 | 336 | ->addColumn('old', function ($model) { |
337 | 337 | $data = ($model->properties); |
338 | 338 | $oldEntry = $this->getOldEntry($data, $model); |
@@ -376,42 +376,42 @@ discard block |
||
376 | 376 | $email_log = \DB::table('email_log')->orderBy('date', 'desc')->get(); |
377 | 377 | |
378 | 378 | return\ DataTables::of($email_log) |
379 | - ->addColumn('checkbox', function ($model) { |
|
380 | - return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
|
381 | - }) |
|
382 | - ->addColumn('date', function ($model) { |
|
383 | - $date = $model->date; |
|
384 | - if ($date) { |
|
385 | - $date1 = new \DateTime($date); |
|
386 | - $tz = \Auth::user()->timezone()->first()->name; |
|
387 | - $date1->setTimezone(new \DateTimeZone($tz)); |
|
388 | - $finalDate = $date1->format('M j, Y, g:i a '); |
|
389 | - } |
|
390 | - |
|
391 | - return $finalDate; |
|
392 | - }) |
|
393 | - ->addColumn('from', function ($model) { |
|
394 | - $from = Markdown::convertToHtml($model->from); |
|
395 | - |
|
396 | - return $from; |
|
397 | - }) |
|
398 | - ->addColumn('to', function ($model) { |
|
399 | - $to = Markdown::convertToHtml($model->to); |
|
400 | - |
|
401 | - return $to; |
|
402 | - }) |
|
403 | - |
|
404 | - ->addColumn('subject', function ($model) { |
|
405 | - return ucfirst($model->subject); |
|
406 | - }) |
|
379 | + ->addColumn('checkbox', function ($model) { |
|
380 | + return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
|
381 | + }) |
|
382 | + ->addColumn('date', function ($model) { |
|
383 | + $date = $model->date; |
|
384 | + if ($date) { |
|
385 | + $date1 = new \DateTime($date); |
|
386 | + $tz = \Auth::user()->timezone()->first()->name; |
|
387 | + $date1->setTimezone(new \DateTimeZone($tz)); |
|
388 | + $finalDate = $date1->format('M j, Y, g:i a '); |
|
389 | + } |
|
390 | + |
|
391 | + return $finalDate; |
|
392 | + }) |
|
393 | + ->addColumn('from', function ($model) { |
|
394 | + $from = Markdown::convertToHtml($model->from); |
|
395 | + |
|
396 | + return $from; |
|
397 | + }) |
|
398 | + ->addColumn('to', function ($model) { |
|
399 | + $to = Markdown::convertToHtml($model->to); |
|
400 | + |
|
401 | + return $to; |
|
402 | + }) |
|
403 | + |
|
404 | + ->addColumn('subject', function ($model) { |
|
405 | + return ucfirst($model->subject); |
|
406 | + }) |
|
407 | 407 | // ->addColumn('headers', function ($model) { |
408 | 408 | // $headers = Markdown::convertToHtml(ucfirst($model->headers)); |
409 | 409 | |
410 | 410 | // return $headers; |
411 | 411 | // }) |
412 | - ->addColumn('status', function ($model) { |
|
413 | - return ucfirst($model->status); |
|
414 | - }) |
|
412 | + ->addColumn('status', function ($model) { |
|
413 | + return ucfirst($model->status); |
|
414 | + }) |
|
415 | 415 | |
416 | 416 | ->rawColumns(['checkbox', 'date', 'from', 'to', |
417 | 417 | 'bcc', 'subject', 'status', ]) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $mobileauthkey = $apikeys->pluck('msg91_auth_key')->first(); |
69 | 69 | $updateUrl = $apikeys->pluck('update_api_url')->first(); |
70 | 70 | $emailStatus = StatusSetting::pluck('emailverification_status')->first(); |
71 | - $twitterKeys = $apikeys->select('twitter_consumer_key','twitter_consumer_secret', |
|
71 | + $twitterKeys = $apikeys->select('twitter_consumer_key', 'twitter_consumer_secret', |
|
72 | 72 | 'twitter_access_token', 'access_tooken_secret')->first(); |
73 | 73 | $twitterStatus = $this->statusSetting->pluck('twitter_status')->first(); |
74 | 74 | $zohoStatus = $this->statusSetting->pluck('zoho_status')->first(); |
@@ -303,16 +303,16 @@ discard block |
||
303 | 303 | |
304 | 304 | return \DataTables::of($query->take(50)) |
305 | 305 | ->setTotalRecords($query->count()) |
306 | - ->addColumn('checkbox', function ($model) { |
|
306 | + ->addColumn('checkbox', function($model) { |
|
307 | 307 | return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
308 | 308 | }) |
309 | - ->addColumn('name', function ($model) { |
|
309 | + ->addColumn('name', function($model) { |
|
310 | 310 | return ucfirst($model->log_name); |
311 | 311 | }) |
312 | - ->addColumn('description', function ($model) { |
|
312 | + ->addColumn('description', function($model) { |
|
313 | 313 | return ucfirst($model->description); |
314 | 314 | }) |
315 | - ->addColumn('username', function ($model) { |
|
315 | + ->addColumn('username', function($model) { |
|
316 | 316 | $causer_id = $model->causer_id; |
317 | 317 | $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
318 | 318 | foreach ($names as $key => $value) { |
@@ -321,41 +321,41 @@ discard block |
||
321 | 321 | return $fullName; |
322 | 322 | } |
323 | 323 | }) |
324 | - ->addColumn('role', function ($model) { |
|
324 | + ->addColumn('role', function($model) { |
|
325 | 325 | $causer_id = $model->causer_id; |
326 | 326 | $role = User::where('id', $causer_id)->pluck('role'); |
327 | 327 | |
328 | 328 | return json_decode($role); |
329 | 329 | }) |
330 | - ->addColumn('new', function ($model) { |
|
330 | + ->addColumn('new', function($model) { |
|
331 | 331 | $properties = ($model->properties); |
332 | 332 | $newEntry = $this->getNewEntry($properties, $model); |
333 | 333 | |
334 | 334 | return $newEntry; |
335 | 335 | }) |
336 | - ->addColumn('old', function ($model) { |
|
336 | + ->addColumn('old', function($model) { |
|
337 | 337 | $data = ($model->properties); |
338 | 338 | $oldEntry = $this->getOldEntry($data, $model); |
339 | 339 | |
340 | 340 | return $oldEntry; |
341 | 341 | }) |
342 | - ->addColumn('created_at', function ($model) { |
|
342 | + ->addColumn('created_at', function($model) { |
|
343 | 343 | $newDate = $this->getDate($model->created_at); |
344 | 344 | |
345 | 345 | return $newDate; |
346 | 346 | }) |
347 | 347 | |
348 | - ->filterColumn('log_name', function ($query, $keyword) { |
|
348 | + ->filterColumn('log_name', function($query, $keyword) { |
|
349 | 349 | $sql = 'log_name like ?'; |
350 | 350 | $query->whereRaw($sql, ["%{$keyword}%"]); |
351 | 351 | }) |
352 | 352 | |
353 | - ->filterColumn('description', function ($query, $keyword) { |
|
353 | + ->filterColumn('description', function($query, $keyword) { |
|
354 | 354 | $sql = 'description like ?'; |
355 | 355 | $query->whereRaw($sql, ["%{$keyword}%"]); |
356 | 356 | }) |
357 | 357 | |
358 | - ->filterColumn('causer_id', function ($query, $keyword) { |
|
358 | + ->filterColumn('causer_id', function($query, $keyword) { |
|
359 | 359 | $sql = 'first_name like ?'; |
360 | 360 | $query->whereRaw($sql, ["%{$keyword}%"]); |
361 | 361 | }) |
@@ -376,10 +376,10 @@ discard block |
||
376 | 376 | $email_log = \DB::table('email_log')->orderBy('date', 'desc')->get(); |
377 | 377 | |
378 | 378 | return\ DataTables::of($email_log) |
379 | - ->addColumn('checkbox', function ($model) { |
|
379 | + ->addColumn('checkbox', function($model) { |
|
380 | 380 | return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
381 | 381 | }) |
382 | - ->addColumn('date', function ($model) { |
|
382 | + ->addColumn('date', function($model) { |
|
383 | 383 | $date = $model->date; |
384 | 384 | if ($date) { |
385 | 385 | $date1 = new \DateTime($date); |
@@ -390,18 +390,18 @@ discard block |
||
390 | 390 | |
391 | 391 | return $finalDate; |
392 | 392 | }) |
393 | - ->addColumn('from', function ($model) { |
|
393 | + ->addColumn('from', function($model) { |
|
394 | 394 | $from = Markdown::convertToHtml($model->from); |
395 | 395 | |
396 | 396 | return $from; |
397 | 397 | }) |
398 | - ->addColumn('to', function ($model) { |
|
398 | + ->addColumn('to', function($model) { |
|
399 | 399 | $to = Markdown::convertToHtml($model->to); |
400 | 400 | |
401 | 401 | return $to; |
402 | 402 | }) |
403 | 403 | |
404 | - ->addColumn('subject', function ($model) { |
|
404 | + ->addColumn('subject', function($model) { |
|
405 | 405 | return ucfirst($model->subject); |
406 | 406 | }) |
407 | 407 | // ->addColumn('headers', function ($model) { |
@@ -409,12 +409,12 @@ discard block |
||
409 | 409 | |
410 | 410 | // return $headers; |
411 | 411 | // }) |
412 | - ->addColumn('status', function ($model) { |
|
412 | + ->addColumn('status', function($model) { |
|
413 | 413 | return ucfirst($model->status); |
414 | 414 | }) |
415 | 415 | |
416 | 416 | ->rawColumns(['checkbox', 'date', 'from', 'to', |
417 | - 'bcc', 'subject', 'status', ]) |
|
417 | + 'bcc', 'subject', 'status', ]) |
|
418 | 418 | ->make(true); |
419 | 419 | } catch (\Exception $e) { |
420 | 420 | Bugsnag::notifyException($e); |
@@ -87,22 +87,22 @@ discard block |
||
87 | 87 | |
88 | 88 | return ucfirst($response); |
89 | 89 | }) |
90 | - ->addColumn('price', function ($model) use ($defaultCurrency) { |
|
91 | - $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency) |
|
90 | + ->addColumn('price', function ($model) use ($defaultCurrency) { |
|
91 | + $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency) |
|
92 | 92 | ->pluck('add_price')->first(); |
93 | - if ($price != null) { |
|
94 | - return $price; |
|
95 | - } else { |
|
96 | - return 'Not Available'; |
|
97 | - } |
|
98 | - }) |
|
99 | - ->addColumn('currency', function ($model) use ($defaultCurrency) { |
|
100 | - if ($defaultCurrency && $defaultCurrency != null) { |
|
101 | - return $defaultCurrency; |
|
102 | - } else { |
|
103 | - return 'Not Available'; |
|
104 | - } |
|
105 | - }) |
|
93 | + if ($price != null) { |
|
94 | + return $price; |
|
95 | + } else { |
|
96 | + return 'Not Available'; |
|
97 | + } |
|
98 | + }) |
|
99 | + ->addColumn('currency', function ($model) use ($defaultCurrency) { |
|
100 | + if ($defaultCurrency && $defaultCurrency != null) { |
|
101 | + return $defaultCurrency; |
|
102 | + } else { |
|
103 | + return 'Not Available'; |
|
104 | + } |
|
105 | + }) |
|
106 | 106 | ->addColumn('action', function ($model) { |
107 | 107 | return '<a href='.url('plans/'.$model->id.'/edit')." |
108 | 108 | class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
@@ -206,10 +206,10 @@ discard block |
||
206 | 206 | $agentQuantity = $plan->planPrice->first()->no_of_agents; |
207 | 207 | foreach ($products as $key => $product) { |
208 | 208 | $selectedProduct = $this->product->where('id', $plan->product) |
209 | - ->pluck('name', 'id', 'subscription')->toArray(); |
|
209 | + ->pluck('name', 'id', 'subscription')->toArray(); |
|
210 | 210 | } |
211 | 211 | $selectedPeriods = $this->period->where('days', $plan->days) |
212 | - ->pluck('name', 'days')->toArray(); |
|
212 | + ->pluck('name', 'days')->toArray(); |
|
213 | 213 | |
214 | 214 | return view( |
215 | 215 | 'themes.default1.product.plan.edit', |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | 'name' => 'required', |
248 | 248 | 'add_price.*' => 'required', |
249 | 249 | 'product' => 'required', |
250 | - 'days' => $days_rule.'numeric', |
|
251 | - 'product_quantity' => 'required_without:no_of_agents|integer|min:0', |
|
250 | + 'days' => $days_rule.'numeric', |
|
251 | + 'product_quantity' => 'required_without:no_of_agents|integer|min:0', |
|
252 | 252 | 'no_of_agents' => 'required_without:product_quantity|integer|min:0', |
253 | 253 | ]); |
254 | 254 | $product_quantity = $request->input('product_quantity'); |
@@ -61,14 +61,14 @@ discard block |
||
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 | if ($model->days != '') { |
73 | 73 | $months = $model->days / 30; |
74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | return 'Not Available'; |
79 | 79 | }) |
80 | - ->addColumn('product', function ($model) { |
|
80 | + ->addColumn('product', function($model) { |
|
81 | 81 | $productid = $model->product; |
82 | 82 | $product = $this->product->where('id', $productid)->first(); |
83 | 83 | $response = ''; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | return ucfirst($response); |
89 | 89 | }) |
90 | - ->addColumn('price', function ($model) use ($defaultCurrency) { |
|
90 | + ->addColumn('price', function($model) use ($defaultCurrency) { |
|
91 | 91 | $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency) |
92 | 92 | ->pluck('add_price')->first(); |
93 | 93 | if ($price != null) { |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | return 'Not Available'; |
97 | 97 | } |
98 | 98 | }) |
99 | - ->addColumn('currency', function ($model) use ($defaultCurrency) { |
|
99 | + ->addColumn('currency', function($model) use ($defaultCurrency) { |
|
100 | 100 | if ($defaultCurrency && $defaultCurrency != null) { |
101 | 101 | return $defaultCurrency; |
102 | 102 | } else { |
103 | 103 | return 'Not Available'; |
104 | 104 | } |
105 | 105 | }) |
106 | - ->addColumn('action', function ($model) { |
|
106 | + ->addColumn('action', function($model) { |
|
107 | 107 | return '<a href='.url('plans/'.$model->id.'/edit')." |
108 | 108 | class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
109 | 109 | style='color:white;'> </i> Edit</a>"; |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | $currency = $request->input('currency'); |
193 | 193 | $symbol = $request->input('symbol'); |
194 | 194 | Cart::update($id, [ |
195 | - 'price' => $price, |
|
196 | - 'attributes' => ['agents' => $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]], |
|
195 | + 'price' => $price, |
|
196 | + 'attributes' => ['agents' => $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]], |
|
197 | 197 | ]); |
198 | 198 | |
199 | 199 | return 'success'; |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | $currency = $request->input('currency'); |
215 | 215 | $symbol = $request->input('symbol'); |
216 | 216 | Cart::update($id, [ |
217 | - 'price' => $price, |
|
218 | - 'attributes' => ['agents' => $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]], |
|
217 | + 'price' => $price, |
|
218 | + 'attributes' => ['agents' => $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]], |
|
219 | 219 | ]); |
220 | 220 | |
221 | 221 | return 'success'; |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | 'relative' => false, |
259 | 259 | 'value' => $qty, |
260 | 260 | ], |
261 | - 'price' => $price, |
|
261 | + 'price' => $price, |
|
262 | 262 | ]); |
263 | 263 | |
264 | 264 | return 'success'; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | $actualPrice = $this->cost($product->id); |
296 | 296 | // $taxConditions = $this->checkTax($id); |
297 | 297 | $items = ['id' => $id, 'name' => $product->name, 'price' => $actualPrice, |
298 | - 'quantity' => $qty, 'attributes' => ['currency' => $currency, 'agents'=> $agents], ]; |
|
298 | + 'quantity' => $qty, 'attributes' => ['currency' => $currency, 'agents'=> $agents], ]; |
|
299 | 299 | |
300 | 300 | return $items; |
301 | 301 | } catch (\Exception $e) { |
@@ -283,7 +283,8 @@ |
||
283 | 283 | $planid = $this->checkPlanSession() === true ? Session::get('plan') : Plan::where('product', $id)->pluck('id')->first(); //Get Plan id From Session |
284 | 284 | $product = Product::find($id); |
285 | 285 | $plan = $product->planRelation->find($planid); |
286 | - if ($plan) { //If Plan For a Product exists |
|
286 | + if ($plan) { |
|
287 | +//If Plan For a Product exists |
|
287 | 288 | $quantity = $plan->planPrice->first()->product_quantity; |
288 | 289 | //If Product quantity is null(when show agent in Product Seting Selected),then set quantity as 1; |
289 | 290 | $qty = $quantity != null ? $quantity : 1; |