@@ -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', ]) |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $msg91Sender = $apikeys->pluck('msg91_sender')->first(); |
| 70 | 70 | $updateUrl = $apikeys->pluck('update_api_url')->first(); |
| 71 | 71 | $emailStatus = StatusSetting::pluck('emailverification_status')->first(); |
| 72 | - $twitterKeys = $apikeys->select('twitter_consumer_key','twitter_consumer_secret', |
|
| 72 | + $twitterKeys = $apikeys->select('twitter_consumer_key', 'twitter_consumer_secret', |
|
| 73 | 73 | 'twitter_access_token', 'access_tooken_secret')->first(); |
| 74 | 74 | $twitterStatus = $this->statusSetting->pluck('twitter_status')->first(); |
| 75 | 75 | $zohoStatus = $this->statusSetting->pluck('zoho_status')->first(); |
@@ -306,16 +306,16 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | return \DataTables::of($query->take(50)) |
| 308 | 308 | ->setTotalRecords($query->count()) |
| 309 | - ->addColumn('checkbox', function ($model) { |
|
| 309 | + ->addColumn('checkbox', function($model) { |
|
| 310 | 310 | return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
| 311 | 311 | }) |
| 312 | - ->addColumn('name', function ($model) { |
|
| 312 | + ->addColumn('name', function($model) { |
|
| 313 | 313 | return ucfirst($model->log_name); |
| 314 | 314 | }) |
| 315 | - ->addColumn('description', function ($model) { |
|
| 315 | + ->addColumn('description', function($model) { |
|
| 316 | 316 | return ucfirst($model->description); |
| 317 | 317 | }) |
| 318 | - ->addColumn('username', function ($model) { |
|
| 318 | + ->addColumn('username', function($model) { |
|
| 319 | 319 | $causer_id = $model->causer_id; |
| 320 | 320 | $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
| 321 | 321 | foreach ($names as $key => $value) { |
@@ -324,41 +324,41 @@ discard block |
||
| 324 | 324 | return $fullName; |
| 325 | 325 | } |
| 326 | 326 | }) |
| 327 | - ->addColumn('role', function ($model) { |
|
| 327 | + ->addColumn('role', function($model) { |
|
| 328 | 328 | $causer_id = $model->causer_id; |
| 329 | 329 | $role = User::where('id', $causer_id)->pluck('role'); |
| 330 | 330 | |
| 331 | 331 | return json_decode($role); |
| 332 | 332 | }) |
| 333 | - ->addColumn('new', function ($model) { |
|
| 333 | + ->addColumn('new', function($model) { |
|
| 334 | 334 | $properties = ($model->properties); |
| 335 | 335 | $newEntry = $this->getNewEntry($properties, $model); |
| 336 | 336 | |
| 337 | 337 | return $newEntry; |
| 338 | 338 | }) |
| 339 | - ->addColumn('old', function ($model) { |
|
| 339 | + ->addColumn('old', function($model) { |
|
| 340 | 340 | $data = ($model->properties); |
| 341 | 341 | $oldEntry = $this->getOldEntry($data, $model); |
| 342 | 342 | |
| 343 | 343 | return $oldEntry; |
| 344 | 344 | }) |
| 345 | - ->addColumn('created_at', function ($model) { |
|
| 345 | + ->addColumn('created_at', function($model) { |
|
| 346 | 346 | $newDate = $this->getDate($model->created_at); |
| 347 | 347 | |
| 348 | 348 | return $newDate; |
| 349 | 349 | }) |
| 350 | 350 | |
| 351 | - ->filterColumn('log_name', function ($query, $keyword) { |
|
| 351 | + ->filterColumn('log_name', function($query, $keyword) { |
|
| 352 | 352 | $sql = 'log_name like ?'; |
| 353 | 353 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 354 | 354 | }) |
| 355 | 355 | |
| 356 | - ->filterColumn('description', function ($query, $keyword) { |
|
| 356 | + ->filterColumn('description', function($query, $keyword) { |
|
| 357 | 357 | $sql = 'description like ?'; |
| 358 | 358 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 359 | 359 | }) |
| 360 | 360 | |
| 361 | - ->filterColumn('causer_id', function ($query, $keyword) { |
|
| 361 | + ->filterColumn('causer_id', function($query, $keyword) { |
|
| 362 | 362 | $sql = 'first_name like ?'; |
| 363 | 363 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 364 | 364 | }) |
@@ -379,10 +379,10 @@ discard block |
||
| 379 | 379 | $email_log = \DB::table('email_log')->orderBy('date', 'desc')->get(); |
| 380 | 380 | |
| 381 | 381 | return\ DataTables::of($email_log) |
| 382 | - ->addColumn('checkbox', function ($model) { |
|
| 382 | + ->addColumn('checkbox', function($model) { |
|
| 383 | 383 | return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
| 384 | 384 | }) |
| 385 | - ->addColumn('date', function ($model) { |
|
| 385 | + ->addColumn('date', function($model) { |
|
| 386 | 386 | $date = $model->date; |
| 387 | 387 | if ($date) { |
| 388 | 388 | $date1 = new \DateTime($date); |
@@ -393,18 +393,18 @@ discard block |
||
| 393 | 393 | |
| 394 | 394 | return $finalDate; |
| 395 | 395 | }) |
| 396 | - ->addColumn('from', function ($model) { |
|
| 396 | + ->addColumn('from', function($model) { |
|
| 397 | 397 | $from = Markdown::convertToHtml($model->from); |
| 398 | 398 | |
| 399 | 399 | return $from; |
| 400 | 400 | }) |
| 401 | - ->addColumn('to', function ($model) { |
|
| 401 | + ->addColumn('to', function($model) { |
|
| 402 | 402 | $to = Markdown::convertToHtml($model->to); |
| 403 | 403 | |
| 404 | 404 | return $to; |
| 405 | 405 | }) |
| 406 | 406 | |
| 407 | - ->addColumn('subject', function ($model) { |
|
| 407 | + ->addColumn('subject', function($model) { |
|
| 408 | 408 | return ucfirst($model->subject); |
| 409 | 409 | }) |
| 410 | 410 | // ->addColumn('headers', function ($model) { |
@@ -412,12 +412,12 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | // return $headers; |
| 414 | 414 | // }) |
| 415 | - ->addColumn('status', function ($model) { |
|
| 415 | + ->addColumn('status', function($model) { |
|
| 416 | 416 | return ucfirst($model->status); |
| 417 | 417 | }) |
| 418 | 418 | |
| 419 | 419 | ->rawColumns(['checkbox', 'date', 'from', 'to', |
| 420 | - 'bcc', 'subject', 'status', ]) |
|
| 420 | + 'bcc', 'subject', 'status', ]) |
|
| 421 | 421 | ->make(true); |
| 422 | 422 | } catch (\Exception $e) { |
| 423 | 423 | 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; |
@@ -177,11 +177,13 @@ |
||
| 177 | 177 | |
| 178 | 178 | //if product has Update expiry date ie subscription is generated |
| 179 | 179 | if ($updateEndDate) { |
| 180 | - if ($downloadPermission['allowDownloadTillExpiry'] == 1) {//Perpetual download till expiry permission selected |
|
| 180 | + if ($downloadPermission['allowDownloadTillExpiry'] == 1) { |
|
| 181 | +//Perpetual download till expiry permission selected |
|
| 181 | 182 | $getDownload = $this->whenDownloadTillExpiry($updateEndDate, $productid, $versions, $clientid, $invoiceid); |
| 182 | 183 | |
| 183 | 184 | return $getDownload; |
| 184 | - } elseif ($downloadPermission['allowDownloadTillExpiry'] == 0) {//When download retires after subscription |
|
| 185 | + } elseif ($downloadPermission['allowDownloadTillExpiry'] == 0) { |
|
| 186 | +//When download retires after subscription |
|
| 185 | 187 | $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $updateEndDate, $productid, $versions, $clientid, $invoiceid); |
| 186 | 188 | |
| 187 | 189 | return $getDownload; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $order_id = $order->id; |
| 146 | 146 | $updatesEndDate = Subscription::select('update_ends_at') |
| 147 | - ->where('product_id', $productid)->where('order_id', $order_id)->first(); |
|
| 147 | + ->where('product_id', $productid)->where('order_id', $order_id)->first(); |
|
| 148 | 148 | if ($updatesEndDate) { |
| 149 | 149 | foreach ($versions as $version) { |
| 150 | 150 | if ($version->created_at->toDateTimeString() |
@@ -417,9 +417,9 @@ discard block |
||
| 417 | 417 | ->addColumn('payment_method', function ($model) { |
| 418 | 418 | return $model->payment_method; |
| 419 | 419 | }) |
| 420 | - ->addColumn('payment_status', function ($model) { |
|
| 421 | - return $model->payment_status; |
|
| 422 | - }) |
|
| 420 | + ->addColumn('payment_status', function ($model) { |
|
| 421 | + return $model->payment_status; |
|
| 422 | + }) |
|
| 423 | 423 | ->addColumn('created_at', function ($model) { |
| 424 | 424 | $date1 = new DateTime($model->created_at); |
| 425 | 425 | $tz = \Auth::user()->timezone()->first()->name; |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | return $date; |
| 430 | 430 | }) |
| 431 | 431 | ->rawColumns(['checkbox', 'number', 'amount', |
| 432 | - 'payment_method', 'payment_status', 'created_at', ]) |
|
| 432 | + 'payment_method', 'payment_status', 'created_at', ]) |
|
| 433 | 433 | ->make(true); |
| 434 | 434 | } catch (Exception $ex) { |
| 435 | 435 | Bugsnag::notifyException($ex); |
@@ -455,17 +455,17 @@ discard block |
||
| 455 | 455 | ->addColumn('number', function ($model) { |
| 456 | 456 | return $model->invoice()->first()->number; |
| 457 | 457 | }) |
| 458 | - ->addColumn('total', function ($model) { |
|
| 459 | - return $model->amount; |
|
| 460 | - }) |
|
| 461 | - ->addColumn('created_at', function ($model) { |
|
| 462 | - $date1 = new DateTime($model->created_at); |
|
| 463 | - $tz = \Auth::user()->timezone()->first()->name; |
|
| 464 | - $date1->setTimezone(new DateTimeZone($tz)); |
|
| 465 | - $date = $date1->format('M j, Y, g:i a'); |
|
| 466 | - |
|
| 467 | - return $date; |
|
| 468 | - }) |
|
| 458 | + ->addColumn('total', function ($model) { |
|
| 459 | + return $model->amount; |
|
| 460 | + }) |
|
| 461 | + ->addColumn('created_at', function ($model) { |
|
| 462 | + $date1 = new DateTime($model->created_at); |
|
| 463 | + $tz = \Auth::user()->timezone()->first()->name; |
|
| 464 | + $date1->setTimezone(new DateTimeZone($tz)); |
|
| 465 | + $date = $date1->format('M j, Y, g:i a'); |
|
| 466 | + |
|
| 467 | + return $date; |
|
| 468 | + }) |
|
| 469 | 469 | |
| 470 | 470 | ->addColumn('payment_method', 'payment_status', 'created_at') |
| 471 | 471 | |
@@ -79,18 +79,18 @@ discard block |
||
| 79 | 79 | ->select('number', 'created_at', 'grand_total', 'id', 'status'); |
| 80 | 80 | |
| 81 | 81 | return \DataTables::of($invoices->get()) |
| 82 | - ->addColumn('number', function ($model) { |
|
| 82 | + ->addColumn('number', function($model) { |
|
| 83 | 83 | return $model->number; |
| 84 | 84 | }) |
| 85 | - ->addColumn('date', function ($model) { |
|
| 85 | + ->addColumn('date', function($model) { |
|
| 86 | 86 | $date = $model->created_at; |
| 87 | 87 | |
| 88 | 88 | return $date; |
| 89 | 89 | }) |
| 90 | - ->addColumn('total', function ($model) { |
|
| 90 | + ->addColumn('total', function($model) { |
|
| 91 | 91 | return currency_format($model->grand_total, $code = \Auth::user()->currency); |
| 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) { |
@@ -155,19 +155,19 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | return \DataTables::of($versions) |
| 158 | - ->addColumn('id', function ($versions) { |
|
| 158 | + ->addColumn('id', function($versions) { |
|
| 159 | 159 | return ucfirst($versions->id); |
| 160 | 160 | }) |
| 161 | - ->addColumn('version', function ($versions) { |
|
| 161 | + ->addColumn('version', function($versions) { |
|
| 162 | 162 | return ucfirst($versions->version); |
| 163 | 163 | }) |
| 164 | - ->addColumn('title', function ($versions) { |
|
| 164 | + ->addColumn('title', function($versions) { |
|
| 165 | 165 | return ucfirst($versions->title); |
| 166 | 166 | }) |
| 167 | - ->addColumn('description', function ($versions) { |
|
| 167 | + ->addColumn('description', function($versions) { |
|
| 168 | 168 | return ucfirst($versions->description); |
| 169 | 169 | }) |
| 170 | - ->addColumn('file', function ($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) { |
|
| 170 | + ->addColumn('file', function($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) { |
|
| 171 | 171 | $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first(); |
| 172 | 172 | $order = Order::where('invoice_id', '=', $invoice_id)->first(); |
| 173 | 173 | $order_id = $order->id; |
@@ -233,18 +233,18 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | return \DataTables::of($link) |
| 236 | - ->addColumn('version', function ($link) { |
|
| 236 | + ->addColumn('version', function($link) { |
|
| 237 | 237 | return ucfirst($link['tag_name']); |
| 238 | 238 | }) |
| 239 | - ->addColumn('name', function ($link) { |
|
| 239 | + ->addColumn('name', function($link) { |
|
| 240 | 240 | return ucfirst($link['name']); |
| 241 | 241 | }) |
| 242 | - ->addColumn('description', function ($link) { |
|
| 242 | + ->addColumn('description', function($link) { |
|
| 243 | 243 | $markdown = Markdown::convertToHtml(ucfirst($link['body'])); |
| 244 | 244 | |
| 245 | 245 | return $markdown; |
| 246 | 246 | }) |
| 247 | - ->addColumn('file', function ($link) use ($countExpiry, $countVersions, $invoiceid, $productid) { |
|
| 247 | + ->addColumn('file', function($link) use ($countExpiry, $countVersions, $invoiceid, $productid) { |
|
| 248 | 248 | $order = Order::where('invoice_id', '=', $invoiceid)->first(); |
| 249 | 249 | $order_id = $order->id; |
| 250 | 250 | $orderEndDate = Subscription::select('update_ends_at') |
@@ -280,20 +280,20 @@ discard block |
||
| 280 | 280 | $orders = Order::where('client', \Auth::user()->id); |
| 281 | 281 | |
| 282 | 282 | return \DataTables::of($orders->get()) |
| 283 | - ->addColumn('id', function ($model) { |
|
| 283 | + ->addColumn('id', function($model) { |
|
| 284 | 284 | return $model->id; |
| 285 | 285 | }) |
| 286 | - ->addColumn('product_name', function ($model) { |
|
| 286 | + ->addColumn('product_name', function($model) { |
|
| 287 | 287 | return $model->product()->first()->name; |
| 288 | 288 | }) |
| 289 | - ->addColumn('expiry', function ($model) { |
|
| 289 | + ->addColumn('expiry', function($model) { |
|
| 290 | 290 | $tz = \Auth::user()->timezone()->first()->name; |
| 291 | 291 | $end = $this->getExpiryDate($model); |
| 292 | 292 | |
| 293 | 293 | return $end; |
| 294 | 294 | }) |
| 295 | 295 | |
| 296 | - ->addColumn('Action', function ($model) { |
|
| 296 | + ->addColumn('Action', function($model) { |
|
| 297 | 297 | $sub = $model->subscription()->first(); |
| 298 | 298 | $order = Order::where('id', $model->id)->select('product')->first(); |
| 299 | 299 | $productid = $order->product; |
@@ -399,28 +399,28 @@ discard block |
||
| 399 | 399 | ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at'); |
| 400 | 400 | |
| 401 | 401 | return \DataTables::of($payments->get()) |
| 402 | - ->addColumn('checkbox', function ($model) { |
|
| 402 | + ->addColumn('checkbox', function($model) { |
|
| 403 | 403 | if (\Input::get('client') != 'true') { |
| 404 | 404 | return "<input type='checkbox' class='payment_checkbox' |
| 405 | 405 | value=".$model->id.' name=select[] id=check>'; |
| 406 | 406 | } |
| 407 | 407 | }) |
| 408 | - ->addColumn('number', function ($model) { |
|
| 408 | + ->addColumn('number', function($model) { |
|
| 409 | 409 | return $model->invoice()->first()->number; |
| 410 | 410 | }) |
| 411 | - ->addColumn('amount', function ($model) { |
|
| 411 | + ->addColumn('amount', function($model) { |
|
| 412 | 412 | $currency = $model->invoice()->first()->currency; |
| 413 | 413 | $total = currency_format($model->amount, $code = $currency); |
| 414 | 414 | |
| 415 | 415 | return $total; |
| 416 | 416 | }) |
| 417 | - ->addColumn('payment_method', function ($model) { |
|
| 417 | + ->addColumn('payment_method', function($model) { |
|
| 418 | 418 | return $model->payment_method; |
| 419 | 419 | }) |
| 420 | - ->addColumn('payment_status', function ($model) { |
|
| 420 | + ->addColumn('payment_status', function($model) { |
|
| 421 | 421 | return $model->payment_status; |
| 422 | 422 | }) |
| 423 | - ->addColumn('created_at', function ($model) { |
|
| 423 | + ->addColumn('created_at', function($model) { |
|
| 424 | 424 | $date1 = new DateTime($model->created_at); |
| 425 | 425 | $tz = \Auth::user()->timezone()->first()->name; |
| 426 | 426 | $date1->setTimezone(new DateTimeZone($tz)); |
@@ -452,13 +452,13 @@ discard block |
||
| 452 | 452 | ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount'); |
| 453 | 453 | //dd(\Input::all()); |
| 454 | 454 | return \DataTables::of($payments->get()) |
| 455 | - ->addColumn('number', function ($model) { |
|
| 455 | + ->addColumn('number', function($model) { |
|
| 456 | 456 | return $model->invoice()->first()->number; |
| 457 | 457 | }) |
| 458 | - ->addColumn('total', function ($model) { |
|
| 458 | + ->addColumn('total', function($model) { |
|
| 459 | 459 | return $model->amount; |
| 460 | 460 | }) |
| 461 | - ->addColumn('created_at', function ($model) { |
|
| 461 | + ->addColumn('created_at', function($model) { |
|
| 462 | 462 | $date1 = new DateTime($model->created_at); |
| 463 | 463 | $tz = \Auth::user()->timezone()->first()->name; |
| 464 | 464 | $date1->setTimezone(new DateTimeZone($tz)); |