@@ -7,5 +7,5 @@ |
||
| 7 | 7 | class Timezone extends BaseModel |
| 8 | 8 | { |
| 9 | 9 | protected $table = 'timezone'; |
| 10 | - protected $fillable = ['id','name', 'location']; |
|
| 10 | + protected $fillable = ['id', 'name', 'location']; |
|
| 11 | 11 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | 'error_log', 'error_email', 'state', 'city', 'country', |
| 13 | 13 | 'invoice', 'download', 'subscription_over', 'subscription_going_to_end', |
| 14 | 14 | 'forgot_password', 'order_mail', 'welcome_mail', 'invoice_template', |
| 15 | - 'driver','admin_logo','title' ,'favicon_title','fav_icon']; |
|
| 15 | + 'driver', 'admin_logo', 'title', 'favicon_title', 'fav_icon']; |
|
| 16 | 16 | |
| 17 | 17 | public function getPasswordAttribute($value) |
| 18 | 18 | { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $ends = $model->subscription()->first(); |
| 18 | 18 | if ($ends) { |
| 19 | 19 | if ($ends->ends_at != '0000-00-00 00:00:00') { |
| 20 | - $date1 = new DateTime($ends->ends_at); |
|
| 20 | + $date1 = new DateTime($ends->ends_at); |
|
| 21 | 21 | $tz = \Auth::user()->timezone()->first()->name; |
| 22 | 22 | $date1->setTimezone(new DateTimeZone($tz)); |
| 23 | 23 | $end = $date1->format('M j, Y, g:i a '); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $user_id = $this->order->find($orderid)->client; |
| 156 | 156 | $this->subscription->create(['user_id' => $user_id, |
| 157 | 157 | 'plan_id' => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at, |
| 158 | - 'version' => $version, 'product_id' =>$product, ]); |
|
| 158 | + 'version' => $version, 'product_id' =>$product, ]); |
|
| 159 | 159 | } |
| 160 | 160 | } catch (\Exception $ex) { |
| 161 | 161 | Bugsnag::notifyException($ex); |
@@ -72,29 +72,29 @@ discard block |
||
| 72 | 72 | $position = $request->input('position'); |
| 73 | 73 | |
| 74 | 74 | $user = $this->advanceSearch($name, $username, $company, |
| 75 | - $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position); |
|
| 75 | + $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position); |
|
| 76 | 76 | |
| 77 | 77 | return\ DataTables::of($user->get()) |
| 78 | - ->addColumn('checkbox', function ($model) { |
|
| 79 | - return "<input type='checkbox' class='user_checkbox' |
|
| 78 | + ->addColumn('checkbox', function ($model) { |
|
| 79 | + return "<input type='checkbox' class='user_checkbox' |
|
| 80 | 80 | value=".$model->id.' name=select[] id=check>'; |
| 81 | - }) |
|
| 81 | + }) |
|
| 82 | 82 | ->addColumn('first_name', function ($model) { |
| 83 | 83 | return '<a href='.url('clients/'.$model->id).'>' |
| 84 | 84 | .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 85 | 85 | }) |
| 86 | - ->addColumn('email', function ($model) { |
|
| 87 | - return $model->email; |
|
| 88 | - }) |
|
| 89 | - ->addColumn('created_at', function ($model) { |
|
| 90 | - $ends = $model->created_at; |
|
| 91 | - if ($ends) { |
|
| 92 | - $date = date_create($ends); |
|
| 93 | - $end = date_format($date, 'l, F j, Y H:m'); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - return $end; |
|
| 97 | - }) |
|
| 86 | + ->addColumn('email', function ($model) { |
|
| 87 | + return $model->email; |
|
| 88 | + }) |
|
| 89 | + ->addColumn('created_at', function ($model) { |
|
| 90 | + $ends = $model->created_at; |
|
| 91 | + if ($ends) { |
|
| 92 | + $date = date_create($ends); |
|
| 93 | + $end = date_format($date, 'l, F j, Y H:m'); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + return $end; |
|
| 97 | + }) |
|
| 98 | 98 | // ->showColumns('email', 'created_at') |
| 99 | 99 | ->addColumn('active', function ($model) { |
| 100 | 100 | if ($model->active == 1) { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | return view('themes.default1.user.client.show', |
| 195 | 195 | compact('id', 'client', 'invoices', 'model_popup', 'orders', |
| 196 | - 'payments', 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency')); |
|
| 196 | + 'payments', 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency')); |
|
| 197 | 197 | } catch (\Exception $ex) { |
| 198 | 198 | app('log')->useDailyFiles(storage_path().'/logs/laravel.log'); |
| 199 | 199 | app('log')->info($ex->getMessage()); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | } |
| 264 | - //for display |
|
| 264 | + //for display |
|
| 265 | 265 | $timezones= array_column($display,'name','id'); |
| 266 | 266 | $state = \App\Http\Controllers\Front\CartController::getStateByCode($user->state); |
| 267 | 267 | $managers = User::where('role', 'admin') |
@@ -363,9 +363,9 @@ discard block |
||
| 363 | 363 | return \Response::json([]); |
| 364 | 364 | } |
| 365 | 365 | $users = User::where('email', 'LIKE', '%'.$term.'%') |
| 366 | - ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
| 367 | - ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
| 368 | - ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
| 366 | + ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
| 367 | + ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
| 368 | + ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
| 369 | 369 | $formatted_tags = []; |
| 370 | 370 | |
| 371 | 371 | foreach ($users as $user) { |
@@ -381,8 +381,8 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | public function advanceSearch($name = '', $username = '', $company = '', |
| 384 | - $mobile = '', $email = '', $country = '', $industry = '', |
|
| 385 | - $company_type = '', $company_size = '', $role = '', $position = '') |
|
| 384 | + $mobile = '', $email = '', $country = '', $industry = '', |
|
| 385 | + $company_type = '', $company_size = '', $role = '', $position = '') |
|
| 386 | 386 | { |
| 387 | 387 | $join = \DB::table('users'); |
| 388 | 388 | $join = $this->getNamUserCom($join, $name, $username, $company); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | |
| 393 | 393 | $join = $join->orderBy('created_at', 'desc') |
| 394 | 394 | ->select('id', 'first_name', 'last_name', 'email', 'created_at', |
| 395 | - 'active', 'mobile_verified', 'role', 'position'); |
|
| 395 | + 'active', 'mobile_verified', 'role', 'position'); |
|
| 396 | 396 | |
| 397 | 397 | return $join; |
| 398 | 398 | } |
@@ -75,18 +75,18 @@ discard block |
||
| 75 | 75 | $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position); |
| 76 | 76 | |
| 77 | 77 | return\ DataTables::of($user->get()) |
| 78 | - ->addColumn('checkbox', function ($model) { |
|
| 78 | + ->addColumn('checkbox', function($model) { |
|
| 79 | 79 | return "<input type='checkbox' class='user_checkbox' |
| 80 | 80 | value=".$model->id.' name=select[] id=check>'; |
| 81 | 81 | }) |
| 82 | - ->addColumn('first_name', function ($model) { |
|
| 82 | + ->addColumn('first_name', function($model) { |
|
| 83 | 83 | return '<a href='.url('clients/'.$model->id).'>' |
| 84 | 84 | .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 85 | 85 | }) |
| 86 | - ->addColumn('email', function ($model) { |
|
| 86 | + ->addColumn('email', function($model) { |
|
| 87 | 87 | return $model->email; |
| 88 | 88 | }) |
| 89 | - ->addColumn('created_at', function ($model) { |
|
| 89 | + ->addColumn('created_at', function($model) { |
|
| 90 | 90 | $ends = $model->created_at; |
| 91 | 91 | if ($ends) { |
| 92 | 92 | $date = date_create($ends); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return $end; |
| 97 | 97 | }) |
| 98 | 98 | // ->showColumns('email', 'created_at') |
| 99 | - ->addColumn('active', function ($model) { |
|
| 99 | + ->addColumn('active', function($model) { |
|
| 100 | 100 | if ($model->active == 1) { |
| 101 | 101 | $email = "<span class='glyphicon glyphicon-envelope' |
| 102 | 102 | style='color:green' title='verified email'></span>"; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | return $email.' '.$mobile; |
| 116 | 116 | }) |
| 117 | - ->addColumn('action', function ($model) { |
|
| 117 | + ->addColumn('action', function($model) { |
|
| 118 | 118 | return '<a href='.url('clients/'.$model->id.'/edit') |
| 119 | 119 | ." class='btn btn-sm btn-primary btn-xs'> |
| 120 | 120 | <i class='fa fa-edit' style='color:white;'> </i> Edit</a>" |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | <i class='fa fa-eye' style='color:white;'> </i> View</a>"; |
| 124 | 124 | // return 'hhhh'; |
| 125 | 125 | }) |
| 126 | - ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 126 | + ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 127 | 127 | ->make(true); |
| 128 | 128 | |
| 129 | 129 | // ->searchColumns('email', 'first_name') |
@@ -252,17 +252,17 @@ discard block |
||
| 252 | 252 | $timezonesList = \App\Model\Common\Timezone::get(); |
| 253 | 253 | foreach ($timezonesList as $timezone) { |
| 254 | 254 | $location = $timezone->location; |
| 255 | - if($location){ |
|
| 255 | + if ($location) { |
|
| 256 | 256 | $start = strpos($location, '('); |
| 257 | 257 | $end = strpos($location, ')', $start + 1); |
| 258 | 258 | $length = $end - $start; |
| 259 | 259 | $result = substr($location, $start + 1, $length - 1); |
| 260 | - $display[]=(['id'=>$timezone->id ,'name'=> '('.$result.')'.' '.$timezone->name]); |
|
| 260 | + $display[] = (['id'=>$timezone->id, 'name'=> '('.$result.')'.' '.$timezone->name]); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | } |
| 264 | 264 | //for display |
| 265 | - $timezones= array_column($display,'name','id'); |
|
| 265 | + $timezones = array_column($display, 'name', 'id'); |
|
| 266 | 266 | $state = \App\Http\Controllers\Front\CartController::getStateByCode($user->state); |
| 267 | 267 | $managers = User::where('role', 'admin') |
| 268 | 268 | ->where('position', 'manager') |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | $timezonesList = \App\Model\Common\Timezone::get(); |
| 253 | 253 | foreach ($timezonesList as $timezone) { |
| 254 | 254 | $location = $timezone->location; |
| 255 | - if($location){ |
|
| 255 | + if($location) { |
|
| 256 | 256 | $start = strpos($location, '('); |
| 257 | 257 | $end = strpos($location, ')', $start + 1); |
| 258 | 258 | $length = $end - $start; |
@@ -102,16 +102,16 @@ discard block |
||
| 102 | 102 | if ($request->hasFile('admin-logo')) { |
| 103 | 103 | $logoName = $request->file('admin-logo')->getClientOriginalName(); |
| 104 | 104 | $destinationPath = public_path('images/admin-logo'); |
| 105 | - $request->file('admin-logo')->move($destinationPath,$logoName); |
|
| 105 | + $request->file('admin-logo')->move($destinationPath, $logoName); |
|
| 106 | 106 | $setting->admin_logo = $logoName; |
| 107 | 107 | } |
| 108 | 108 | if ($request->hasFile('fav-icon')) { |
| 109 | 109 | $iconName = $request->file('fav-icon')->getClientOriginalName(); |
| 110 | 110 | $destinationPath = public_path('images/favicon'); |
| 111 | - $request->file('fav-icon')->move($destinationPath,$iconName); |
|
| 111 | + $request->file('fav-icon')->move($destinationPath, $iconName); |
|
| 112 | 112 | $setting->fav_icon = $iconName; |
| 113 | 113 | } |
| 114 | - $setting->fill($request->except('password', 'logo','admin-logo','fav-icon'))->save(); |
|
| 114 | + $setting->fill($request->except('password', 'logo', 'admin-logo', 'fav-icon'))->save(); |
|
| 115 | 115 | |
| 116 | 116 | return redirect()->back()->with('success', \Lang::get('message.updated-successfully')); |
| 117 | 117 | } catch (\Exception $ex) { |
@@ -214,16 +214,16 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | return \DataTables::of($activity_log->take(50)) |
| 216 | 216 | ->setTotalRecords($activity_log->count()) |
| 217 | - ->addColumn('checkbox', function ($model) { |
|
| 217 | + ->addColumn('checkbox', function($model) { |
|
| 218 | 218 | return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
| 219 | 219 | }) |
| 220 | - ->addColumn('name', function ($model) { |
|
| 220 | + ->addColumn('name', function($model) { |
|
| 221 | 221 | return ucfirst($model->log_name); |
| 222 | 222 | }) |
| 223 | - ->addColumn('description', function ($model) { |
|
| 223 | + ->addColumn('description', function($model) { |
|
| 224 | 224 | return ucfirst($model->description); |
| 225 | 225 | }) |
| 226 | - ->addColumn('username', function ($model) { |
|
| 226 | + ->addColumn('username', function($model) { |
|
| 227 | 227 | $causer_id = $model->causer_id; |
| 228 | 228 | $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
| 229 | 229 | foreach ($names as $key => $value) { |
@@ -232,41 +232,41 @@ discard block |
||
| 232 | 232 | return $fullName; |
| 233 | 233 | } |
| 234 | 234 | }) |
| 235 | - ->addColumn('role', function ($model) { |
|
| 235 | + ->addColumn('role', function($model) { |
|
| 236 | 236 | $causer_id = $model->causer_id; |
| 237 | 237 | $role = User::where('id', $causer_id)->pluck('role'); |
| 238 | 238 | |
| 239 | 239 | return json_decode($role); |
| 240 | 240 | }) |
| 241 | - ->addColumn('new', function ($model) { |
|
| 241 | + ->addColumn('new', function($model) { |
|
| 242 | 242 | $properties = ($model->properties); |
| 243 | 243 | $newEntry = $this->getNewEntry($properties, $model); |
| 244 | 244 | |
| 245 | 245 | return $newEntry; |
| 246 | 246 | }) |
| 247 | - ->addColumn('old', function ($model) { |
|
| 247 | + ->addColumn('old', function($model) { |
|
| 248 | 248 | $data = ($model->properties); |
| 249 | 249 | $oldEntry = $this->getOldEntry($data, $model); |
| 250 | 250 | |
| 251 | 251 | return $oldEntry; |
| 252 | 252 | }) |
| 253 | - ->addColumn('created_at', function ($model) { |
|
| 253 | + ->addColumn('created_at', function($model) { |
|
| 254 | 254 | $newDate = $this->getDate($model->created_at); |
| 255 | 255 | |
| 256 | 256 | return $newDate; |
| 257 | 257 | }) |
| 258 | 258 | |
| 259 | - ->filterColumn('log_name', function ($query, $keyword) { |
|
| 259 | + ->filterColumn('log_name', function($query, $keyword) { |
|
| 260 | 260 | $sql = 'log_name like ?'; |
| 261 | 261 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 262 | 262 | }) |
| 263 | 263 | |
| 264 | - ->filterColumn('description', function ($query, $keyword) { |
|
| 264 | + ->filterColumn('description', function($query, $keyword) { |
|
| 265 | 265 | $sql = 'description like ?'; |
| 266 | 266 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 267 | 267 | }) |
| 268 | 268 | |
| 269 | - ->filterColumn('causer_id', function ($query, $keyword) { |
|
| 269 | + ->filterColumn('causer_id', function($query, $keyword) { |
|
| 270 | 270 | $sql = 'first_name like ?'; |
| 271 | 271 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 272 | 272 | }) |
@@ -287,38 +287,38 @@ discard block |
||
| 287 | 287 | $email_log = \DB::table('email_log')->get(); |
| 288 | 288 | |
| 289 | 289 | return\ DataTables::of($email_log) |
| 290 | - ->addColumn('checkbox', function ($model) { |
|
| 290 | + ->addColumn('checkbox', function($model) { |
|
| 291 | 291 | return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
| 292 | 292 | }) |
| 293 | - ->addColumn('date', function ($model) { |
|
| 293 | + ->addColumn('date', function($model) { |
|
| 294 | 294 | return ucfirst($model->date); |
| 295 | 295 | }) |
| 296 | - ->addColumn('from', function ($model) { |
|
| 296 | + ->addColumn('from', function($model) { |
|
| 297 | 297 | $from = Markdown::convertToHtml(ucfirst($model->from)); |
| 298 | 298 | |
| 299 | 299 | return $from; |
| 300 | 300 | }) |
| 301 | - ->addColumn('to', function ($model) { |
|
| 301 | + ->addColumn('to', function($model) { |
|
| 302 | 302 | $to = Markdown::convertToHtml(ucfirst($model->to)); |
| 303 | 303 | |
| 304 | 304 | return $to; |
| 305 | 305 | }) |
| 306 | - ->addColumn('cc', function ($model) { |
|
| 306 | + ->addColumn('cc', function($model) { |
|
| 307 | 307 | $cc = '--'; |
| 308 | 308 | |
| 309 | 309 | return $cc; |
| 310 | 310 | }) |
| 311 | 311 | |
| 312 | - ->addColumn('subject', function ($model) { |
|
| 312 | + ->addColumn('subject', function($model) { |
|
| 313 | 313 | return ucfirst($model->subject); |
| 314 | 314 | }) |
| 315 | 315 | |
| 316 | - ->addColumn('headers', function ($model) { |
|
| 316 | + ->addColumn('headers', function($model) { |
|
| 317 | 317 | $headers = Markdown::convertToHtml(ucfirst($model->headers)); |
| 318 | 318 | |
| 319 | 319 | return $headers; |
| 320 | 320 | }) |
| 321 | - ->addColumn('status', function ($model) { |
|
| 321 | + ->addColumn('status', function($model) { |
|
| 322 | 322 | return ucfirst($model->status); |
| 323 | 323 | }) |
| 324 | 324 | |