@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | protected static $logName = 'Product'; |
| 21 | 21 | |
| 22 | 22 | protected static $logAttributes = ['name', 'description', 'type', 'file', 'category', |
| 23 | - 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', ]; |
|
| 23 | + 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', ]; |
|
| 24 | 24 | |
| 25 | 25 | protected static $logOnlyDirty = true; |
| 26 | 26 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return ''; |
| 43 | 43 | |
| 44 | 44 | // return "Product has been {$eventName}"; |
| 45 | - // \Auth::user()->activity; |
|
| 45 | + // \Auth::user()->activity; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // protected static $recordEvents = ['deleted']; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | use LogsActivity; |
| 12 | 12 | protected $table = 'products'; |
| 13 | 13 | protected $fillable = ['name', 'description', 'type', 'group', 'file', 'image', 'require_domain', 'category', |
| 14 | - 'stock_control', 'stock_qty', 'sort_order', 'tax_apply', 'retired', 'hidden', 'auto_terminate', |
|
| 14 | + 'stock_control', 'stock_qty', 'sort_order', 'tax_apply', 'retired', 'hidden', 'auto_terminate', |
|
| 15 | 15 | 'setup_order_placed', 'setup_first_payment', 'setup_accept_manually', |
| 16 | 16 | 'no_auto_setup', 'shoping_cart_link', 'process_url', 'github_owner', |
| 17 | 17 | 'github_repository', |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | protected static $logName = 'Product'; |
| 21 | 21 | |
| 22 | 22 | protected static $logAttributes = ['name', 'description', 'type', 'file', 'category', |
| 23 | - 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', ]; |
|
| 23 | + 'github_owner', 'github_repository', 'version', 'subscription', 'hidden', ]; |
|
| 24 | 24 | |
| 25 | 25 | protected static $logOnlyDirty = true; |
| 26 | 26 | |
@@ -83,22 +83,22 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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(); |
@@ -61,19 +61,19 @@ 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 | $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 |
||
| 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 |
||
| 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> Edit</a>"; |
@@ -114,10 +114,10 @@ discard block |
||
| 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 |
||
| 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()); |
@@ -107,18 +107,18 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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). |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | return view('themes.default1.common.dashboard', compact('totalSalesINR', 'totalSalesUSD', |
| 57 | 57 | 'yearlySalesINR', 'yearlySalesUSD', 'monthlySalesINR', 'monthlySalesUSD', 'users', |
| 58 | 58 | 'count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices', |
| 59 | - 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status','startSubscriptionDate', |
|
| 60 | - 'endSubscriptionDate')); |
|
| 59 | + 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status','startSubscriptionDate', |
|
| 60 | + 'endSubscriptionDate')); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | // dd($currentYear,$currentMonth ); |
| 155 | 155 | $total = Invoice::whereYear('created_at', '=', $currentYear)->whereMonth('created_at', '=', $currentMonth) |
| 156 | 156 | ->where('currency', 'USD') |
| 157 | - ->where('status', '=', 'success') |
|
| 157 | + ->where('status', '=', 'success') |
|
| 158 | 158 | ->pluck('grand_total')->all(); |
| 159 | 159 | $grandTotal = array_sum($total); |
| 160 | 160 | |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | public function getAllUsers() |
| 202 | 202 | { |
| 203 | 203 | $allUsers = User::orderBy('created_at', 'desc')->where('active', 1)->where('mobile_verified', 1) |
| 204 | - ->take(20) |
|
| 205 | - ->get() |
|
| 206 | - ->toArray(); |
|
| 204 | + ->take(20) |
|
| 205 | + ->get() |
|
| 206 | + ->toArray(); |
|
| 207 | 207 | |
| 208 | 208 | return $allUsers; |
| 209 | 209 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $dayUtc = new Carbon('-30 days'); |
| 239 | 239 | $minus30Day = $dayUtc->toDateTimeString(); |
| 240 | 240 | $recentOrders = Order::where('created_at', '>', $minus30Day)->orderBy('created_at', 'desc') |
| 241 | - ->where('price_override', '>', 0)->get(); |
|
| 241 | + ->where('price_override', '>', 0)->get(); |
|
| 242 | 242 | |
| 243 | 243 | return $recentOrders; |
| 244 | 244 | } |
@@ -55,8 +55,8 @@ |
||
| 55 | 55 | |
| 56 | 56 | return view('themes.default1.common.dashboard', compact('totalSalesINR', 'totalSalesUSD', |
| 57 | 57 | 'yearlySalesINR', 'yearlySalesUSD', 'monthlySalesINR', 'monthlySalesUSD', 'users', |
| 58 | - 'count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices', |
|
| 59 | - 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status','startSubscriptionDate', |
|
| 58 | + 'count_users', 'arraylists', 'productSoldlists', 'orders', 'subscriptions', 'invoices', |
|
| 59 | + 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status', 'startSubscriptionDate', |
|
| 60 | 60 | 'endSubscriptionDate')); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -245,37 +245,37 @@ discard block |
||
| 245 | 245 | // 'subject_id', 'subject_type', 'causer_id', 'properties', 'created_at')->orderBy('id', 'desc'); |
| 246 | 246 | |
| 247 | 247 | return \DataTables::of($query->take(50)) |
| 248 | - ->setTotalRecords($query->count()) |
|
| 249 | - ->addColumn('checkbox', function ($model) { |
|
| 250 | - return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
|
| 251 | - }) |
|
| 252 | - ->addColumn('name', function ($model) { |
|
| 253 | - return ucfirst($model->log_name); |
|
| 254 | - }) |
|
| 255 | - ->addColumn('description', function ($model) { |
|
| 256 | - return ucfirst($model->description); |
|
| 257 | - }) |
|
| 258 | - ->addColumn('username', function ($model) { |
|
| 259 | - $causer_id = $model->causer_id; |
|
| 260 | - $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
|
| 261 | - foreach ($names as $key => $value) { |
|
| 262 | - $fullName = $key.' '.$value; |
|
| 263 | - |
|
| 264 | - return $fullName; |
|
| 265 | - } |
|
| 266 | - }) |
|
| 267 | - ->addColumn('role', function ($model) { |
|
| 268 | - $causer_id = $model->causer_id; |
|
| 269 | - $role = User::where('id', $causer_id)->pluck('role'); |
|
| 270 | - |
|
| 271 | - return json_decode($role); |
|
| 272 | - }) |
|
| 273 | - ->addColumn('new', function ($model) { |
|
| 274 | - $properties = ($model->properties); |
|
| 275 | - $newEntry = $this->getNewEntry($properties, $model); |
|
| 276 | - |
|
| 277 | - return $newEntry; |
|
| 278 | - }) |
|
| 248 | + ->setTotalRecords($query->count()) |
|
| 249 | + ->addColumn('checkbox', function ($model) { |
|
| 250 | + return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
|
| 251 | + }) |
|
| 252 | + ->addColumn('name', function ($model) { |
|
| 253 | + return ucfirst($model->log_name); |
|
| 254 | + }) |
|
| 255 | + ->addColumn('description', function ($model) { |
|
| 256 | + return ucfirst($model->description); |
|
| 257 | + }) |
|
| 258 | + ->addColumn('username', function ($model) { |
|
| 259 | + $causer_id = $model->causer_id; |
|
| 260 | + $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
|
| 261 | + foreach ($names as $key => $value) { |
|
| 262 | + $fullName = $key.' '.$value; |
|
| 263 | + |
|
| 264 | + return $fullName; |
|
| 265 | + } |
|
| 266 | + }) |
|
| 267 | + ->addColumn('role', function ($model) { |
|
| 268 | + $causer_id = $model->causer_id; |
|
| 269 | + $role = User::where('id', $causer_id)->pluck('role'); |
|
| 270 | + |
|
| 271 | + return json_decode($role); |
|
| 272 | + }) |
|
| 273 | + ->addColumn('new', function ($model) { |
|
| 274 | + $properties = ($model->properties); |
|
| 275 | + $newEntry = $this->getNewEntry($properties, $model); |
|
| 276 | + |
|
| 277 | + return $newEntry; |
|
| 278 | + }) |
|
| 279 | 279 | ->addColumn('old', function ($model) { |
| 280 | 280 | $data = ($model->properties); |
| 281 | 281 | $oldEntry = $this->getOldEntry($data, $model); |
@@ -320,40 +320,40 @@ discard block |
||
| 320 | 320 | $email_log = \DB::table('email_log')->get(); |
| 321 | 321 | |
| 322 | 322 | return\ DataTables::of($email_log) |
| 323 | - ->addColumn('checkbox', function ($model) { |
|
| 324 | - return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
|
| 325 | - }) |
|
| 326 | - ->addColumn('date', function ($model) { |
|
| 327 | - return ucfirst($model->date); |
|
| 328 | - }) |
|
| 329 | - ->addColumn('from', function ($model) { |
|
| 330 | - $from = Markdown::convertToHtml(ucfirst($model->from)); |
|
| 331 | - |
|
| 332 | - return $from; |
|
| 333 | - }) |
|
| 334 | - ->addColumn('to', function ($model) { |
|
| 335 | - $to = Markdown::convertToHtml(ucfirst($model->to)); |
|
| 336 | - |
|
| 337 | - return $to; |
|
| 338 | - }) |
|
| 339 | - ->addColumn('cc', function ($model) { |
|
| 340 | - $cc = '--'; |
|
| 341 | - |
|
| 342 | - return $cc; |
|
| 343 | - }) |
|
| 344 | - |
|
| 345 | - ->addColumn('subject', function ($model) { |
|
| 346 | - return ucfirst($model->subject); |
|
| 347 | - }) |
|
| 348 | - |
|
| 349 | - ->addColumn('headers', function ($model) { |
|
| 350 | - $headers = Markdown::convertToHtml(ucfirst($model->headers)); |
|
| 351 | - |
|
| 352 | - return $headers; |
|
| 353 | - }) |
|
| 354 | - ->addColumn('status', function ($model) { |
|
| 355 | - return ucfirst($model->status); |
|
| 356 | - }) |
|
| 323 | + ->addColumn('checkbox', function ($model) { |
|
| 324 | + return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
|
| 325 | + }) |
|
| 326 | + ->addColumn('date', function ($model) { |
|
| 327 | + return ucfirst($model->date); |
|
| 328 | + }) |
|
| 329 | + ->addColumn('from', function ($model) { |
|
| 330 | + $from = Markdown::convertToHtml(ucfirst($model->from)); |
|
| 331 | + |
|
| 332 | + return $from; |
|
| 333 | + }) |
|
| 334 | + ->addColumn('to', function ($model) { |
|
| 335 | + $to = Markdown::convertToHtml(ucfirst($model->to)); |
|
| 336 | + |
|
| 337 | + return $to; |
|
| 338 | + }) |
|
| 339 | + ->addColumn('cc', function ($model) { |
|
| 340 | + $cc = '--'; |
|
| 341 | + |
|
| 342 | + return $cc; |
|
| 343 | + }) |
|
| 344 | + |
|
| 345 | + ->addColumn('subject', function ($model) { |
|
| 346 | + return ucfirst($model->subject); |
|
| 347 | + }) |
|
| 348 | + |
|
| 349 | + ->addColumn('headers', function ($model) { |
|
| 350 | + $headers = Markdown::convertToHtml(ucfirst($model->headers)); |
|
| 351 | + |
|
| 352 | + return $headers; |
|
| 353 | + }) |
|
| 354 | + ->addColumn('status', function ($model) { |
|
| 355 | + return ucfirst($model->status); |
|
| 356 | + }) |
|
| 357 | 357 | |
| 358 | 358 | ->rawColumns(['checkbox', 'date', 'from', 'to', 'cc', |
| 359 | 359 | 'bcc', 'subject', 'headers', 'status', ]) |
@@ -246,16 +246,16 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | return \DataTables::of($query->take(50)) |
| 248 | 248 | ->setTotalRecords($query->count()) |
| 249 | - ->addColumn('checkbox', function ($model) { |
|
| 249 | + ->addColumn('checkbox', function($model) { |
|
| 250 | 250 | return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
| 251 | 251 | }) |
| 252 | - ->addColumn('name', function ($model) { |
|
| 252 | + ->addColumn('name', function($model) { |
|
| 253 | 253 | return ucfirst($model->log_name); |
| 254 | 254 | }) |
| 255 | - ->addColumn('description', function ($model) { |
|
| 255 | + ->addColumn('description', function($model) { |
|
| 256 | 256 | return ucfirst($model->description); |
| 257 | 257 | }) |
| 258 | - ->addColumn('username', function ($model) { |
|
| 258 | + ->addColumn('username', function($model) { |
|
| 259 | 259 | $causer_id = $model->causer_id; |
| 260 | 260 | $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
| 261 | 261 | foreach ($names as $key => $value) { |
@@ -264,41 +264,41 @@ discard block |
||
| 264 | 264 | return $fullName; |
| 265 | 265 | } |
| 266 | 266 | }) |
| 267 | - ->addColumn('role', function ($model) { |
|
| 267 | + ->addColumn('role', function($model) { |
|
| 268 | 268 | $causer_id = $model->causer_id; |
| 269 | 269 | $role = User::where('id', $causer_id)->pluck('role'); |
| 270 | 270 | |
| 271 | 271 | return json_decode($role); |
| 272 | 272 | }) |
| 273 | - ->addColumn('new', function ($model) { |
|
| 273 | + ->addColumn('new', function($model) { |
|
| 274 | 274 | $properties = ($model->properties); |
| 275 | 275 | $newEntry = $this->getNewEntry($properties, $model); |
| 276 | 276 | |
| 277 | 277 | return $newEntry; |
| 278 | 278 | }) |
| 279 | - ->addColumn('old', function ($model) { |
|
| 279 | + ->addColumn('old', function($model) { |
|
| 280 | 280 | $data = ($model->properties); |
| 281 | 281 | $oldEntry = $this->getOldEntry($data, $model); |
| 282 | 282 | |
| 283 | 283 | return $oldEntry; |
| 284 | 284 | }) |
| 285 | - ->addColumn('created_at', function ($model) { |
|
| 285 | + ->addColumn('created_at', function($model) { |
|
| 286 | 286 | $newDate = $this->getDate($model->created_at); |
| 287 | 287 | |
| 288 | 288 | return $newDate; |
| 289 | 289 | }) |
| 290 | 290 | |
| 291 | - ->filterColumn('log_name', function ($query, $keyword) { |
|
| 291 | + ->filterColumn('log_name', function($query, $keyword) { |
|
| 292 | 292 | $sql = 'log_name like ?'; |
| 293 | 293 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 294 | 294 | }) |
| 295 | 295 | |
| 296 | - ->filterColumn('description', function ($query, $keyword) { |
|
| 296 | + ->filterColumn('description', function($query, $keyword) { |
|
| 297 | 297 | $sql = 'description like ?'; |
| 298 | 298 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 299 | 299 | }) |
| 300 | 300 | |
| 301 | - ->filterColumn('causer_id', function ($query, $keyword) { |
|
| 301 | + ->filterColumn('causer_id', function($query, $keyword) { |
|
| 302 | 302 | $sql = 'first_name like ?'; |
| 303 | 303 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 304 | 304 | }) |
@@ -320,38 +320,38 @@ discard block |
||
| 320 | 320 | $email_log = \DB::table('email_log')->get(); |
| 321 | 321 | |
| 322 | 322 | return\ DataTables::of($email_log) |
| 323 | - ->addColumn('checkbox', function ($model) { |
|
| 323 | + ->addColumn('checkbox', function($model) { |
|
| 324 | 324 | return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
| 325 | 325 | }) |
| 326 | - ->addColumn('date', function ($model) { |
|
| 326 | + ->addColumn('date', function($model) { |
|
| 327 | 327 | return ucfirst($model->date); |
| 328 | 328 | }) |
| 329 | - ->addColumn('from', function ($model) { |
|
| 329 | + ->addColumn('from', function($model) { |
|
| 330 | 330 | $from = Markdown::convertToHtml(ucfirst($model->from)); |
| 331 | 331 | |
| 332 | 332 | return $from; |
| 333 | 333 | }) |
| 334 | - ->addColumn('to', function ($model) { |
|
| 334 | + ->addColumn('to', function($model) { |
|
| 335 | 335 | $to = Markdown::convertToHtml(ucfirst($model->to)); |
| 336 | 336 | |
| 337 | 337 | return $to; |
| 338 | 338 | }) |
| 339 | - ->addColumn('cc', function ($model) { |
|
| 339 | + ->addColumn('cc', function($model) { |
|
| 340 | 340 | $cc = '--'; |
| 341 | 341 | |
| 342 | 342 | return $cc; |
| 343 | 343 | }) |
| 344 | 344 | |
| 345 | - ->addColumn('subject', function ($model) { |
|
| 345 | + ->addColumn('subject', function($model) { |
|
| 346 | 346 | return ucfirst($model->subject); |
| 347 | 347 | }) |
| 348 | 348 | |
| 349 | - ->addColumn('headers', function ($model) { |
|
| 349 | + ->addColumn('headers', function($model) { |
|
| 350 | 350 | $headers = Markdown::convertToHtml(ucfirst($model->headers)); |
| 351 | 351 | |
| 352 | 352 | return $headers; |
| 353 | 353 | }) |
| 354 | - ->addColumn('status', function ($model) { |
|
| 354 | + ->addColumn('status', function($model) { |
|
| 355 | 355 | return ucfirst($model->status); |
| 356 | 356 | }) |
| 357 | 357 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $user_id = $this->order->find($orderid)->client; |
| 163 | 163 | $this->subscription->create(['user_id' => $user_id, |
| 164 | 164 | 'plan_id' => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at, |
| 165 | - 'version' => $version, 'product_id' =>$product, ]); |
|
| 165 | + 'version' => $version, 'product_id' =>$product, ]); |
|
| 166 | 166 | } |
| 167 | 167 | } catch (\Exception $ex) { |
| 168 | 168 | Bugsnag::notifyException($ex); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $data = $template->data; |
| 266 | 266 | $replace = [ |
| 267 | 267 | 'name' => $user->first_name.' '.$user->last_name, |
| 268 | - 'serialkeyurl'=> $myaccounturl, |
|
| 268 | + 'serialkeyurl'=> $myaccounturl, |
|
| 269 | 269 | 'downloadurl' => $downloadurl, |
| 270 | 270 | 'invoiceurl' => $invoiceurl, |
| 271 | 271 | 'product' => $product, |
@@ -78,31 +78,31 @@ discard block |
||
| 78 | 78 | $reg_from = $request->input('reg_from'); |
| 79 | 79 | $reg_till = $request->input('reg_till'); |
| 80 | 80 | $user = $this->advanceSearch($name, $username, $company, |
| 81 | - $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position, $reg_from, $reg_till); |
|
| 81 | + $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position, $reg_from, $reg_till); |
|
| 82 | 82 | |
| 83 | 83 | return\ DataTables::of($user->get()) |
| 84 | - ->addColumn('checkbox', function ($model) { |
|
| 85 | - return "<input type='checkbox' class='user_checkbox' |
|
| 84 | + ->addColumn('checkbox', function ($model) { |
|
| 85 | + return "<input type='checkbox' class='user_checkbox' |
|
| 86 | 86 | value=".$model->id.' name=select[] id=check>'; |
| 87 | - }) |
|
| 87 | + }) |
|
| 88 | 88 | ->addColumn('first_name', function ($model) { |
| 89 | 89 | return '<a href='.url('clients/'.$model->id).'>' |
| 90 | 90 | .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 91 | 91 | }) |
| 92 | - ->addColumn('email', function ($model) { |
|
| 93 | - return $model->email; |
|
| 94 | - }) |
|
| 95 | - ->addColumn('created_at', function ($model) { |
|
| 96 | - $ends = $model->created_at; |
|
| 97 | - if ($ends) { |
|
| 98 | - $date1 = new DateTime($ends); |
|
| 99 | - $tz = \Auth::user()->timezone()->first()->name; |
|
| 100 | - $date1->setTimezone(new DateTimeZone($tz)); |
|
| 101 | - $end = $date1->format('M j, Y, g:i a '); |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - return $end; |
|
| 105 | - }) |
|
| 92 | + ->addColumn('email', function ($model) { |
|
| 93 | + return $model->email; |
|
| 94 | + }) |
|
| 95 | + ->addColumn('created_at', function ($model) { |
|
| 96 | + $ends = $model->created_at; |
|
| 97 | + if ($ends) { |
|
| 98 | + $date1 = new DateTime($ends); |
|
| 99 | + $tz = \Auth::user()->timezone()->first()->name; |
|
| 100 | + $date1->setTimezone(new DateTimeZone($tz)); |
|
| 101 | + $end = $date1->format('M j, Y, g:i a '); |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + return $end; |
|
| 105 | + }) |
|
| 106 | 106 | // ->showColumns('email', 'created_at') |
| 107 | 107 | ->addColumn('active', function ($model) { |
| 108 | 108 | if ($model->active == 1) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | return view('themes.default1.user.client.show', |
| 227 | 227 | compact('id', 'client', 'invoices', 'model_popup', 'orders', |
| 228 | - 'payments', 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'extraAmt', 'comments')); |
|
| 228 | + 'payments', 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'extraAmt', 'comments')); |
|
| 229 | 229 | } catch (\Exception $ex) { |
| 230 | 230 | app('log')->info($ex->getMessage()); |
| 231 | 231 | Bugsnag::notifyException($ex); |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | return view('themes.default1.user.client.edit', |
| 398 | 398 | compact('bussinesses', 'user', 'timezones', 'state', |
| 399 | 399 | 'states', 'managers', 'selectedCurrency', 'selectedCompany', |
| 400 | - 'selectedIndustry', 'selectedCompanySize')); |
|
| 400 | + 'selectedIndustry', 'selectedCompanySize')); |
|
| 401 | 401 | } catch (\Exception $ex) { |
| 402 | 402 | app('log')->error($ex->getMessage()); |
| 403 | 403 | |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | return \Response::json([]); |
| 494 | 494 | } |
| 495 | 495 | $users = User::where('email', 'LIKE', '%'.$term.'%') |
| 496 | - ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
| 497 | - ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
| 498 | - ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
| 496 | + ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
| 497 | + ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
| 498 | + ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
| 499 | 499 | $formatted_tags = []; |
| 500 | 500 | |
| 501 | 501 | foreach ($users as $user) { |
@@ -511,8 +511,8 @@ discard block |
||
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | public function advanceSearch($name = '', $username = '', $company = '', |
| 514 | - $mobile = '', $email = '', $country = '', $industry = '', |
|
| 515 | - $company_type = '', $company_size = '', $role = '', $position = '', $reg_from = '', $reg_till = '') |
|
| 514 | + $mobile = '', $email = '', $country = '', $industry = '', |
|
| 515 | + $company_type = '', $company_size = '', $role = '', $position = '', $reg_from = '', $reg_till = '') |
|
| 516 | 516 | { |
| 517 | 517 | $join = \DB::table('users'); |
| 518 | 518 | $join = $this->getNamUserCom($join, $name, $username, $company); |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | |
| 524 | 524 | $join = $join->orderBy('created_at', 'desc') |
| 525 | 525 | ->select('id', 'first_name', 'last_name', 'email', 'created_at', |
| 526 | - 'active', 'mobile_verified', 'role', 'position'); |
|
| 526 | + 'active', 'mobile_verified', 'role', 'position'); |
|
| 527 | 527 | |
| 528 | 528 | return $join; |
| 529 | 529 | } |
@@ -81,18 +81,18 @@ discard block |
||
| 81 | 81 | $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position, $reg_from, $reg_till); |
| 82 | 82 | |
| 83 | 83 | return\ DataTables::of($user->get()) |
| 84 | - ->addColumn('checkbox', function ($model) { |
|
| 84 | + ->addColumn('checkbox', function($model) { |
|
| 85 | 85 | return "<input type='checkbox' class='user_checkbox' |
| 86 | 86 | value=".$model->id.' name=select[] id=check>'; |
| 87 | 87 | }) |
| 88 | - ->addColumn('first_name', function ($model) { |
|
| 88 | + ->addColumn('first_name', function($model) { |
|
| 89 | 89 | return '<a href='.url('clients/'.$model->id).'>' |
| 90 | 90 | .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 91 | 91 | }) |
| 92 | - ->addColumn('email', function ($model) { |
|
| 92 | + ->addColumn('email', function($model) { |
|
| 93 | 93 | return $model->email; |
| 94 | 94 | }) |
| 95 | - ->addColumn('created_at', function ($model) { |
|
| 95 | + ->addColumn('created_at', function($model) { |
|
| 96 | 96 | $ends = $model->created_at; |
| 97 | 97 | if ($ends) { |
| 98 | 98 | $date1 = new DateTime($ends); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | return $end; |
| 105 | 105 | }) |
| 106 | 106 | // ->showColumns('email', 'created_at') |
| 107 | - ->addColumn('active', function ($model) { |
|
| 107 | + ->addColumn('active', function($model) { |
|
| 108 | 108 | if ($model->active == 1) { |
| 109 | 109 | $email = "<span class='glyphicon glyphicon-envelope' |
| 110 | 110 | style='color:green' title='verified email'></span>"; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | return $email.' '.$mobile; |
| 124 | 124 | }) |
| 125 | - ->addColumn('action', function ($model) { |
|
| 125 | + ->addColumn('action', function($model) { |
|
| 126 | 126 | return '<a href='.url('clients/'.$model->id.'/edit') |
| 127 | 127 | ." class='btn btn-sm btn-primary btn-xs'> |
| 128 | 128 | <i class='fa fa-edit' style='color:white;'> </i> Edit</a>" |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | <i class='fa fa-eye' style='color:white;'> </i> View</a>"; |
| 132 | 132 | // return 'hhhh'; |
| 133 | 133 | }) |
| 134 | - ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 134 | + ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 135 | 135 | ->make(true); |
| 136 | 136 | |
| 137 | 137 | // ->searchColumns('email', 'first_name') |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'zip' => 'required|numeric', |
| 38 | 38 | 'user_name' => 'required|unique:users,user_name,'.$userid, |
| 39 | 39 | 'bussiness' => 'required', |
| 40 | - 'profile_pic' => 'sometimes|mimes:jpeg,jpg,png,gif|max:100000', |
|
| 40 | + 'profile_pic' => 'sometimes|mimes:jpeg,jpg,png,gif|max:100000', |
|
| 41 | 41 | |
| 42 | 42 | ]; |
| 43 | 43 | } |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | $userid = \Auth::user()->id; |
| 47 | 47 | |
| 48 | 48 | return [ |
| 49 | - 'first_name' => 'required|min:3|max:30', |
|
| 49 | + 'first_name' => 'required|min:3|max:30', |
|
| 50 | 50 | 'last_name' => 'required|max:30', |
| 51 | - 'mobile' => 'required|regex:/[0-9]/|min:5|max:20', |
|
| 52 | - 'email' => 'required', |
|
| 51 | + 'mobile' => 'required|regex:/[0-9]/|min:5|max:20', |
|
| 52 | + 'email' => 'required', |
|
| 53 | 53 | 'mobile_code' => 'required|numeric', |
| 54 | 54 | 'mobile' => 'required|numeric', |
| 55 | 55 | 'zip' => 'required|numeric', |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | try { |
| 82 | 82 | $merge_fields = $this->field($email); |
| 83 | 83 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 84 | - $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 84 | + $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 85 | 85 | $result = $this->mailchimp->post("lists/$this->list_id/members", [ |
| 86 | 86 | 'status' => $this->mailchimp_set->subscribe_status, |
| 87 | 87 | 'email_address' => $email, |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | try { |
| 107 | 107 | $merge_fields = $this->field($email); |
| 108 | 108 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 109 | - $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 110 | - $productGroupId = $this->groupRelation->where('agora_product_id', $productid) |
|
| 111 | - ->pluck('mailchimp_group_cat_id')->first(); |
|
| 109 | + $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 110 | + $productGroupId = $this->groupRelation->where('agora_product_id', $productid) |
|
| 111 | + ->pluck('mailchimp_group_cat_id')->first(); |
|
| 112 | 112 | $hash = md5($email); |
| 113 | 113 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 114 | - 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
|
| 115 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 116 | - ]); |
|
| 114 | + 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
|
| 115 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 116 | + ]); |
|
| 117 | 117 | } catch (Exception $ex) { |
| 118 | 118 | $exe = json_decode($ex->getMessage(), true); |
| 119 | 119 | } |
@@ -125,16 +125,16 @@ discard block |
||
| 125 | 125 | try { |
| 126 | 126 | $merge_fields = $this->field($email); |
| 127 | 127 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 128 | - $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 129 | - $productGroupId = $this->groupRelation->where('agora_product_id', $productid) |
|
| 130 | - ->pluck('mailchimp_group_cat_id')->first(); |
|
| 128 | + $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 129 | + $productGroupId = $this->groupRelation->where('agora_product_id', $productid) |
|
| 130 | + ->pluck('mailchimp_group_cat_id')->first(); |
|
| 131 | 131 | |
| 132 | 132 | $hash = md5($email); |
| 133 | 133 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 134 | - 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
|
| 134 | + 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
|
| 135 | 135 | |
| 136 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 137 | - ]); |
|
| 136 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 137 | + ]); |
|
| 138 | 138 | } catch (Exception $ex) { |
| 139 | 139 | $exe = json_decode($ex->getMessage(), true); |
| 140 | 140 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $user = $user->where('email', $email)->first(); |
| 176 | 176 | if ($user) { |
| 177 | 177 | $fields = ['first_name', 'last_name', 'company', 'mobile', |
| 178 | - 'address', 'town', 'state', 'zip', 'active', 'role', 'source', ]; |
|
| 178 | + 'address', 'town', 'state', 'zip', 'active', 'role', 'source', ]; |
|
| 179 | 179 | $relation = $this->relation; |
| 180 | 180 | $merge_fields = []; |
| 181 | 181 | foreach ($fields as $field) { |
@@ -326,11 +326,11 @@ discard block |
||
| 326 | 326 | // this->addIsPaidInterestFieldsToAgora(); |
| 327 | 327 | |
| 328 | 328 | $group_fields = $this->groups->where('list_id', $this->list_id) |
| 329 | - ->select('category_name', 'category_option_id', 'category_id')->get()->toArray(); |
|
| 329 | + ->select('category_name', 'category_option_id', 'category_id')->get()->toArray(); |
|
| 330 | 330 | // dd($group_fields[0]); |
| 331 | 331 | $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0) |
| 332 | - ->select('agora_product_id', 'mailchimp_group_cat_id') |
|
| 333 | - ->orderBy('id', 'asc')->get()->toArray(); |
|
| 332 | + ->select('agora_product_id', 'mailchimp_group_cat_id') |
|
| 333 | + ->orderBy('id', 'asc')->get()->toArray(); |
|
| 334 | 334 | $productList = []; |
| 335 | 335 | $categoryList = []; |
| 336 | 336 | if (count($relations) != 0) { |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | // code... |
| 341 | 341 | } |
| 342 | 342 | // dd(count($categoryList)); |
| 343 | - // dd($productList); |
|
| 343 | + // dd($productList); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | // $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0)->orderBy('id', 'asc')->get()->toArray(); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | echo '<option value='.$field['category_option_id'].'>'.$field['category_option_name'].'</option>'; |
| 376 | 376 | |
| 377 | 377 | // array_push($responseData, (['selectedCat'=>$selectedCategory, 'catId'=>$field['category_option_id'],'catName'=>$field['category_option_name']] |
| 378 | - // )); |
|
| 378 | + // )); |
|
| 379 | 379 | } |
| 380 | 380 | // return $responseData; |
| 381 | 381 | } |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | MailchimpGroupAgoraRelation::where('id', '!=', 0)->delete(); |
| 426 | 426 | foreach ($request->row as $key => $value) { |
| 427 | 427 | MailchimpGroupAgoraRelation::create(['agora_product_id'=> $value[0], |
| 428 | - 'mailchimp_group_cat_id' => $value[1], ]); |
|
| 428 | + 'mailchimp_group_cat_id' => $value[1], ]); |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | return redirect()->back()->with('success', \Lang::get('message.updated-successfully')); |