@@ -115,18 +115,18 @@ discard block |
||
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | 117 | return\ DataTables::of($user->get()) |
| 118 | - ->addColumn('checkbox', function ($model) { |
|
| 118 | + ->addColumn('checkbox', function($model) { |
|
| 119 | 119 | return "<input type='checkbox' class='user_checkbox' |
| 120 | 120 | value=".$model->id.' name=select[] id=check>'; |
| 121 | 121 | }) |
| 122 | - ->addColumn('first_name', function ($model) { |
|
| 122 | + ->addColumn('first_name', function($model) { |
|
| 123 | 123 | return '<a href='.url('clients/'.$model->id).'>' |
| 124 | 124 | .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 125 | 125 | }) |
| 126 | - ->addColumn('email', function ($model) { |
|
| 126 | + ->addColumn('email', function($model) { |
|
| 127 | 127 | return $model->email; |
| 128 | 128 | }) |
| 129 | - ->addColumn('created_at', function ($model) { |
|
| 129 | + ->addColumn('created_at', function($model) { |
|
| 130 | 130 | $ends = $model->created_at; |
| 131 | 131 | if ($ends) { |
| 132 | 132 | $date1 = new DateTime($ends); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | return $end; |
| 139 | 139 | }) |
| 140 | 140 | // ->showColumns('email', 'created_at') |
| 141 | - ->addColumn('active', function ($model) { |
|
| 141 | + ->addColumn('active', function($model) { |
|
| 142 | 142 | if ($model->active == 1) { |
| 143 | 143 | $email = "<span class='glyphicon glyphicon-envelope' |
| 144 | 144 | style='color:green' title='verified email'></span>"; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | return $email.' '.$mobile; |
| 158 | 158 | }) |
| 159 | - ->addColumn('action', function ($model) { |
|
| 159 | + ->addColumn('action', function($model) { |
|
| 160 | 160 | return '<a href='.url('clients/'.$model->id.'/edit') |
| 161 | 161 | ." class='btn btn-sm btn-primary btn-xs'> |
| 162 | 162 | <i class='fa fa-edit' style='color:white;'> </i> Edit</a>" |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | <i class='fa fa-eye' style='color:white;'> </i> View</a>"; |
| 166 | 166 | // return 'hhhh'; |
| 167 | 167 | }) |
| 168 | - ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 168 | + ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 169 | 169 | ->make(true); |
| 170 | 170 | |
| 171 | 171 | // ->searchColumns('email', 'first_name') |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | return \DataTables::of($query->take(50)) |
| 106 | 106 | ->setTotalRecords($query->count()) |
| 107 | - ->addColumn('checkbox', function ($model) { |
|
| 107 | + ->addColumn('checkbox', function($model) { |
|
| 108 | 108 | return "<input type='checkbox' class='order_checkbox' value=". |
| 109 | 109 | $model->id.' name=select[] id=check>'; |
| 110 | 110 | }) |
| 111 | - ->addColumn('date', function ($model) { |
|
| 111 | + ->addColumn('date', function($model) { |
|
| 112 | 112 | $date = $model->created_at; |
| 113 | 113 | |
| 114 | 114 | return "<span style='display:none'>$model->id</span>".$date; |
| 115 | 115 | }) |
| 116 | - ->addColumn('client', function ($model) { |
|
| 116 | + ->addColumn('client', function($model) { |
|
| 117 | 117 | $user = $this->user->where('id', $model->client)->first(); |
| 118 | 118 | $first = $user->first_name; |
| 119 | 119 | $last = $user->last_name; |
@@ -121,28 +121,28 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>'; |
| 123 | 123 | }) |
| 124 | - ->addColumn('productname', function ($model) { |
|
| 124 | + ->addColumn('productname', function($model) { |
|
| 125 | 125 | $productid = ($model->product); |
| 126 | 126 | $productName = Product::where('id', $productid)->pluck('name')->first(); |
| 127 | 127 | |
| 128 | 128 | return $productName; |
| 129 | 129 | }) |
| 130 | - ->addColumn('number', function ($model) { |
|
| 130 | + ->addColumn('number', function($model) { |
|
| 131 | 131 | return ucfirst($model->number); |
| 132 | 132 | }) |
| 133 | - ->addColumn('price_override', function ($model) { |
|
| 133 | + ->addColumn('price_override', function($model) { |
|
| 134 | 134 | return ucfirst($model->price_override); |
| 135 | 135 | }) |
| 136 | - ->addColumn('order_status', function ($model) { |
|
| 136 | + ->addColumn('order_status', function($model) { |
|
| 137 | 137 | return ucfirst($model->order_status); |
| 138 | 138 | }) |
| 139 | 139 | // ->showColumns('number', 'price_override', 'order_status') |
| 140 | - ->addColumn('update_ends_at', function ($model) { |
|
| 140 | + ->addColumn('update_ends_at', function($model) { |
|
| 141 | 141 | $end = $this->getEndDate($model); |
| 142 | 142 | |
| 143 | 143 | return $end; |
| 144 | 144 | }) |
| 145 | - ->addColumn('action', function ($model) { |
|
| 145 | + ->addColumn('action', function($model) { |
|
| 146 | 146 | $sub = $model->subscription()->first(); |
| 147 | 147 | $status = $this->checkInvoiceStatusByOrderId($model->id); |
| 148 | 148 | $url = $this->getUrl($model, $status, $sub); |
@@ -150,30 +150,30 @@ discard block |
||
| 150 | 150 | return $url; |
| 151 | 151 | }) |
| 152 | 152 | |
| 153 | - ->filterColumn('created_at', function ($query, $keyword) { |
|
| 153 | + ->filterColumn('created_at', function($query, $keyword) { |
|
| 154 | 154 | $sql = 'created_at like ?'; |
| 155 | 155 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 156 | 156 | }) |
| 157 | 157 | |
| 158 | - ->filterColumn('client', function ($query, $keyword) { |
|
| 158 | + ->filterColumn('client', function($query, $keyword) { |
|
| 159 | 159 | $sql = 'client like ?'; |
| 160 | 160 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 161 | 161 | }) |
| 162 | 162 | |
| 163 | - ->filterColumn('number', function ($query, $keyword) { |
|
| 163 | + ->filterColumn('number', function($query, $keyword) { |
|
| 164 | 164 | $sql = 'number like ?'; |
| 165 | 165 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 166 | 166 | }) |
| 167 | - ->filterColumn('price_override', function ($query, $keyword) { |
|
| 167 | + ->filterColumn('price_override', function($query, $keyword) { |
|
| 168 | 168 | $sql = 'price_override like ?'; |
| 169 | 169 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 170 | 170 | }) |
| 171 | - ->filterColumn('order_status', function ($query, $keyword) { |
|
| 171 | + ->filterColumn('order_status', function($query, $keyword) { |
|
| 172 | 172 | $sql = 'order_status like ?'; |
| 173 | 173 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 174 | 174 | }) |
| 175 | 175 | |
| 176 | - ->filterColumn('update_ends_at', function ($query, $keyword) { |
|
| 176 | + ->filterColumn('update_ends_at', function($query, $keyword) { |
|
| 177 | 177 | $sql = 'update_ends_at like ?'; |
| 178 | 178 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 179 | 179 | }) |
@@ -49,17 +49,17 @@ discard block |
||
| 49 | 49 | public function getPages() |
| 50 | 50 | { |
| 51 | 51 | return \DataTables::of($this->page->get()) |
| 52 | - ->addColumn('checkbox', function ($model) { |
|
| 52 | + ->addColumn('checkbox', function($model) { |
|
| 53 | 53 | return "<input type='checkbox' class='page_checkbox' |
| 54 | 54 | value=".$model->id.' name=select[] id=check>'; |
| 55 | 55 | }) |
| 56 | - ->addColumn('name', function ($model) { |
|
| 56 | + ->addColumn('name', function($model) { |
|
| 57 | 57 | return ucfirst($model->name); |
| 58 | 58 | }) |
| 59 | - ->addColumn('url', function ($model) { |
|
| 59 | + ->addColumn('url', function($model) { |
|
| 60 | 60 | return $model->url; |
| 61 | 61 | }) |
| 62 | - ->addColumn('created_at', function ($model) { |
|
| 62 | + ->addColumn('created_at', function($model) { |
|
| 63 | 63 | $created = $model->created_at; |
| 64 | 64 | if ($created) { |
| 65 | 65 | $date1 = new \DateTime($created); |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | return $createdate; |
| 72 | 72 | }) |
| 73 | 73 | |
| 74 | - ->addColumn('action', function ($model) { |
|
| 74 | + ->addColumn('action', function($model) { |
|
| 75 | 75 | return '<a href='.url('pages/'.$model->id.'/edit') |
| 76 | 76 | ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 77 | 77 | style='color:white;'> </i> Edit</a>"; |
| 78 | 78 | }) |
| 79 | 79 | |
| 80 | - ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'action']) |
|
| 80 | + ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'action']) |
|
| 81 | 81 | ->make(true); |
| 82 | 82 | // ->searchColumns('name', 'content') |
| 83 | 83 | // ->orderColumns('name') |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $selectedParent = $this->page->where('id', $id)->pluck('parent_page_id')->toArray(); |
| 110 | 110 | $parentName = $this->page->where('id', $selectedParent)->pluck('name', 'id')->toArray(); |
| 111 | 111 | |
| 112 | - return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate','selectedParent', |
|
| 112 | + return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate', 'selectedParent', |
|
| 113 | 113 | 'parentName')); |
| 114 | 114 | } catch (\Exception $ex) { |
| 115 | 115 | return redirect()->back()->with('fails', $ex->getMessage()); |
@@ -201,27 +201,27 @@ |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return \DataTables::of($invoices->get()) |
| 204 | - ->addColumn('number', function ($model) { |
|
| 204 | + ->addColumn('number', function($model) { |
|
| 205 | 205 | return $model->number; |
| 206 | 206 | }) |
| 207 | - ->addColumn('products', function ($model) { |
|
| 207 | + ->addColumn('products', function($model) { |
|
| 208 | 208 | $invoice = $this->invoice->find($model->id); |
| 209 | 209 | $products = $invoice->invoiceItem()->pluck('product_name')->toArray(); |
| 210 | 210 | |
| 211 | 211 | return ucfirst(implode(',', $products)); |
| 212 | 212 | }) |
| 213 | - ->addColumn('date', function ($model) { |
|
| 213 | + ->addColumn('date', function($model) { |
|
| 214 | 214 | $date = date_create($model->created_at); |
| 215 | 215 | |
| 216 | 216 | return date_format($date, 'M j, Y, g:i a'); |
| 217 | 217 | }) |
| 218 | - ->addColumn('total', function ($model) { |
|
| 218 | + ->addColumn('total', function($model) { |
|
| 219 | 219 | return currency_format($model->grand_total, $code = $model->currency); |
| 220 | 220 | }) |
| 221 | - ->addColumn('status', function ($model) { |
|
| 221 | + ->addColumn('status', function($model) { |
|
| 222 | 222 | return ucfirst($model->status); |
| 223 | 223 | }) |
| 224 | - ->addColumn('action', function ($model) { |
|
| 224 | + ->addColumn('action', function($model) { |
|
| 225 | 225 | if (\Auth::user()->role == 'admin') { |
| 226 | 226 | $url = '/invoices/show?invoiceid='.$model->id; |
| 227 | 227 | } else { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $mobileauthkey = $apikeys->pluck('msg91_auth_key')->first(); |
| 69 | 69 | $updateUrl = $apikeys->pluck('update_api_url')->first(); |
| 70 | 70 | $emailStatus = StatusSetting::pluck('emailverification_status')->first(); |
| 71 | - $twitterKeys = $apikeys->select('twitter_consumer_key','twitter_consumer_secret', |
|
| 71 | + $twitterKeys = $apikeys->select('twitter_consumer_key', 'twitter_consumer_secret', |
|
| 72 | 72 | 'twitter_access_token', 'access_tooken_secret')->first(); |
| 73 | 73 | $twitterStatus = $this->statusSetting->pluck('twitter_status')->first(); |
| 74 | 74 | $zohoStatus = $this->statusSetting->pluck('zoho_status')->first(); |
@@ -303,16 +303,16 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | return \DataTables::of($query->take(50)) |
| 305 | 305 | ->setTotalRecords($query->count()) |
| 306 | - ->addColumn('checkbox', function ($model) { |
|
| 306 | + ->addColumn('checkbox', function($model) { |
|
| 307 | 307 | return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
| 308 | 308 | }) |
| 309 | - ->addColumn('name', function ($model) { |
|
| 309 | + ->addColumn('name', function($model) { |
|
| 310 | 310 | return ucfirst($model->log_name); |
| 311 | 311 | }) |
| 312 | - ->addColumn('description', function ($model) { |
|
| 312 | + ->addColumn('description', function($model) { |
|
| 313 | 313 | return ucfirst($model->description); |
| 314 | 314 | }) |
| 315 | - ->addColumn('username', function ($model) { |
|
| 315 | + ->addColumn('username', function($model) { |
|
| 316 | 316 | $causer_id = $model->causer_id; |
| 317 | 317 | $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
| 318 | 318 | foreach ($names as $key => $value) { |
@@ -321,41 +321,41 @@ discard block |
||
| 321 | 321 | return $fullName; |
| 322 | 322 | } |
| 323 | 323 | }) |
| 324 | - ->addColumn('role', function ($model) { |
|
| 324 | + ->addColumn('role', function($model) { |
|
| 325 | 325 | $causer_id = $model->causer_id; |
| 326 | 326 | $role = User::where('id', $causer_id)->pluck('role'); |
| 327 | 327 | |
| 328 | 328 | return json_decode($role); |
| 329 | 329 | }) |
| 330 | - ->addColumn('new', function ($model) { |
|
| 330 | + ->addColumn('new', function($model) { |
|
| 331 | 331 | $properties = ($model->properties); |
| 332 | 332 | $newEntry = $this->getNewEntry($properties, $model); |
| 333 | 333 | |
| 334 | 334 | return $newEntry; |
| 335 | 335 | }) |
| 336 | - ->addColumn('old', function ($model) { |
|
| 336 | + ->addColumn('old', function($model) { |
|
| 337 | 337 | $data = ($model->properties); |
| 338 | 338 | $oldEntry = $this->getOldEntry($data, $model); |
| 339 | 339 | |
| 340 | 340 | return $oldEntry; |
| 341 | 341 | }) |
| 342 | - ->addColumn('created_at', function ($model) { |
|
| 342 | + ->addColumn('created_at', function($model) { |
|
| 343 | 343 | $newDate = $this->getDate($model->created_at); |
| 344 | 344 | |
| 345 | 345 | return $newDate; |
| 346 | 346 | }) |
| 347 | 347 | |
| 348 | - ->filterColumn('log_name', function ($query, $keyword) { |
|
| 348 | + ->filterColumn('log_name', function($query, $keyword) { |
|
| 349 | 349 | $sql = 'log_name like ?'; |
| 350 | 350 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 351 | 351 | }) |
| 352 | 352 | |
| 353 | - ->filterColumn('description', function ($query, $keyword) { |
|
| 353 | + ->filterColumn('description', function($query, $keyword) { |
|
| 354 | 354 | $sql = 'description like ?'; |
| 355 | 355 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 356 | 356 | }) |
| 357 | 357 | |
| 358 | - ->filterColumn('causer_id', function ($query, $keyword) { |
|
| 358 | + ->filterColumn('causer_id', function($query, $keyword) { |
|
| 359 | 359 | $sql = 'first_name like ?'; |
| 360 | 360 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 361 | 361 | }) |
@@ -376,10 +376,10 @@ discard block |
||
| 376 | 376 | $email_log = \DB::table('email_log')->orderBy('date', 'desc')->get(); |
| 377 | 377 | |
| 378 | 378 | return\ DataTables::of($email_log) |
| 379 | - ->addColumn('checkbox', function ($model) { |
|
| 379 | + ->addColumn('checkbox', function($model) { |
|
| 380 | 380 | return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
| 381 | 381 | }) |
| 382 | - ->addColumn('date', function ($model) { |
|
| 382 | + ->addColumn('date', function($model) { |
|
| 383 | 383 | $date = $model->date; |
| 384 | 384 | if ($date) { |
| 385 | 385 | $date1 = new \DateTime($date); |
@@ -390,18 +390,18 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | return $finalDate; |
| 392 | 392 | }) |
| 393 | - ->addColumn('from', function ($model) { |
|
| 393 | + ->addColumn('from', function($model) { |
|
| 394 | 394 | $from = Markdown::convertToHtml($model->from); |
| 395 | 395 | |
| 396 | 396 | return $from; |
| 397 | 397 | }) |
| 398 | - ->addColumn('to', function ($model) { |
|
| 398 | + ->addColumn('to', function($model) { |
|
| 399 | 399 | $to = Markdown::convertToHtml($model->to); |
| 400 | 400 | |
| 401 | 401 | return $to; |
| 402 | 402 | }) |
| 403 | 403 | |
| 404 | - ->addColumn('subject', function ($model) { |
|
| 404 | + ->addColumn('subject', function($model) { |
|
| 405 | 405 | return ucfirst($model->subject); |
| 406 | 406 | }) |
| 407 | 407 | // ->addColumn('headers', function ($model) { |
@@ -409,12 +409,12 @@ discard block |
||
| 409 | 409 | |
| 410 | 410 | // return $headers; |
| 411 | 411 | // }) |
| 412 | - ->addColumn('status', function ($model) { |
|
| 412 | + ->addColumn('status', function($model) { |
|
| 413 | 413 | return ucfirst($model->status); |
| 414 | 414 | }) |
| 415 | 415 | |
| 416 | 416 | ->rawColumns(['checkbox', 'date', 'from', 'to', |
| 417 | - 'bcc', 'subject', 'status', ]) |
|
| 417 | + 'bcc', 'subject', 'status', ]) |
|
| 418 | 418 | ->make(true); |
| 419 | 419 | } catch (\Exception $e) { |
| 420 | 420 | Bugsnag::notifyException($e); |
@@ -118,25 +118,25 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | return\ DataTables::of($new_product) |
| 120 | 120 | |
| 121 | - ->addColumn('checkbox', function ($model) { |
|
| 121 | + ->addColumn('checkbox', function($model) { |
|
| 122 | 122 | return "<input type='checkbox' class='product_checkbox' |
| 123 | 123 | value=".$model->id.' name=select[] id=check>'; |
| 124 | 124 | }) |
| 125 | - ->addColumn('name', function ($model) { |
|
| 125 | + ->addColumn('name', function($model) { |
|
| 126 | 126 | return ucfirst($model->name); |
| 127 | 127 | }) |
| 128 | - ->addColumn('image', function ($model) { |
|
| 128 | + ->addColumn('image', function($model) { |
|
| 129 | 129 | // return $model->image; |
| 130 | 130 | return "<img src= '$model->image' + height=\"80\"/>"; |
| 131 | 131 | }) |
| 132 | - ->addColumn('type', function ($model) { |
|
| 132 | + ->addColumn('type', function($model) { |
|
| 133 | 133 | if ($this->type->where('id', $model->type)->first()) { |
| 134 | 134 | return $this->type->where('id', $model->type)->first()->name; |
| 135 | 135 | } else { |
| 136 | 136 | return 'Not available'; |
| 137 | 137 | } |
| 138 | 138 | }) |
| 139 | - ->addColumn('group', function ($model) { |
|
| 139 | + ->addColumn('group', function($model) { |
|
| 140 | 140 | if ($this->group->where('id', $model->group)->first()) { |
| 141 | 141 | return $this->group->where('id', $model->group)->first()->name; |
| 142 | 142 | } else { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | }) |
| 146 | 146 | |
| 147 | - ->addColumn('Action', function ($model) { |
|
| 147 | + ->addColumn('Action', function($model) { |
|
| 148 | 148 | $permissions = LicensePermissionsController::getPermissionsForProduct($model->id); |
| 149 | 149 | $url = ''; |
| 150 | 150 | if ($permissions['downloadPermission'] == 1) { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $from = $request->input('from'); |
| 109 | 109 | $till = $request->input('till'); |
| 110 | 110 | |
| 111 | - return view('themes.default1.invoice.index', compact('name','invoice_no','status','currencies','currency_id','from', |
|
| 111 | + return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from', |
|
| 112 | 112 | |
| 113 | 113 | 'till')); |
| 114 | 114 | } catch (\Exception $ex) { |
@@ -131,35 +131,35 @@ discard block |
||
| 131 | 131 | return \DataTables::of($query->take(100)) |
| 132 | 132 | ->setTotalRecords($query->count()) |
| 133 | 133 | |
| 134 | - ->addColumn('checkbox', function ($model) { |
|
| 134 | + ->addColumn('checkbox', function($model) { |
|
| 135 | 135 | return "<input type='checkbox' class='invoice_checkbox' |
| 136 | 136 | value=".$model->id.' name=select[] id=check>'; |
| 137 | 137 | }) |
| 138 | - ->addColumn('user_id', function ($model) { |
|
| 138 | + ->addColumn('user_id', function($model) { |
|
| 139 | 139 | $first = $this->user->where('id', $model->user_id)->first()->first_name; |
| 140 | 140 | $last = $this->user->where('id', $model->user_id)->first()->last_name; |
| 141 | 141 | $id = $this->user->where('id', $model->user_id)->first()->id; |
| 142 | 142 | |
| 143 | 143 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 144 | 144 | }) |
| 145 | - ->addColumn('number', function ($model) { |
|
| 145 | + ->addColumn('number', function($model) { |
|
| 146 | 146 | return ucfirst($model->number); |
| 147 | 147 | }) |
| 148 | 148 | |
| 149 | - ->addColumn('date', function ($model) { |
|
| 149 | + ->addColumn('date', function($model) { |
|
| 150 | 150 | $date = ($model->created_at); |
| 151 | 151 | |
| 152 | 152 | return $date; |
| 153 | 153 | // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m'); |
| 154 | 154 | }) |
| 155 | - ->addColumn('grand_total', function ($model) { |
|
| 155 | + ->addColumn('grand_total', function($model) { |
|
| 156 | 156 | return $model->grand_total; |
| 157 | 157 | }) |
| 158 | - ->addColumn('status', function ($model) { |
|
| 158 | + ->addColumn('status', function($model) { |
|
| 159 | 159 | return ucfirst($model->status); |
| 160 | 160 | }) |
| 161 | 161 | |
| 162 | - ->addColumn('action', function ($model) { |
|
| 162 | + ->addColumn('action', function($model) { |
|
| 163 | 163 | $action = ''; |
| 164 | 164 | |
| 165 | 165 | $check = $this->checkExecution($model->id); |
@@ -175,25 +175,25 @@ discard block |
||
| 175 | 175 | style='color:white;'> </i> View</a>" |
| 176 | 176 | ." $action"; |
| 177 | 177 | }) |
| 178 | - ->filterColumn('user_id', function ($query, $keyword) { |
|
| 178 | + ->filterColumn('user_id', function($query, $keyword) { |
|
| 179 | 179 | $sql = 'first_name like ?'; |
| 180 | 180 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 181 | 181 | }) |
| 182 | 182 | |
| 183 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 183 | + ->filterColumn('status', function($query, $keyword) { |
|
| 184 | 184 | $sql = 'status like ?'; |
| 185 | 185 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 186 | 186 | }) |
| 187 | 187 | |
| 188 | - ->filterColumn('number', function ($query, $keyword) { |
|
| 188 | + ->filterColumn('number', function($query, $keyword) { |
|
| 189 | 189 | $sql = 'number like ?'; |
| 190 | 190 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 191 | 191 | }) |
| 192 | - ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 192 | + ->filterColumn('grand_total', function($query, $keyword) { |
|
| 193 | 193 | $sql = 'grand_total like ?'; |
| 194 | 194 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 195 | 195 | }) |
| 196 | - ->filterColumn('date', function ($query, $keyword) { |
|
| 196 | + ->filterColumn('date', function($query, $keyword) { |
|
| 197 | 197 | $sql = 'date like ?'; |
| 198 | 198 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 199 | 199 | }) |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | |
| 422 | 422 | $invoice = Invoice::create(['user_id' => $user_id, 'number' => $number, 'date' => $date, |
| 423 | 423 | 'coupon_code' => $code, 'discount'=>$codeValue, |
| 424 | - 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
|
| 424 | + 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
|
| 425 | 425 | |
| 426 | 426 | $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid, |
| 427 | 427 | $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate); |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | $invoices = $invoice->where('user_id', $id)->orderBy('created_at', 'desc')->get(); |
| 15 | 15 | |
| 16 | 16 | return\ DataTables::of($invoices) |
| 17 | - ->addColumn('checkbox', function ($model) { |
|
| 17 | + ->addColumn('checkbox', function($model) { |
|
| 18 | 18 | return "<input type='checkbox' class='invoice_checkbox' |
| 19 | 19 | value=".$model->id.' name=select[] id=check>'; |
| 20 | 20 | }) |
| 21 | - ->addColumn('date', function ($model) use ($client) { |
|
| 21 | + ->addColumn('date', function($model) use ($client) { |
|
| 22 | 22 | $date1 = new \DateTime($model->date); |
| 23 | 23 | $tz = $client->timezone()->first()->name; |
| 24 | 24 | $date1->setTimezone(new \DateTimeZone($tz)); |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | return $date; |
| 28 | 28 | }) |
| 29 | - ->addColumn('invoice_no', function ($model) { |
|
| 29 | + ->addColumn('invoice_no', function($model) { |
|
| 30 | 30 | return '<a href='.url('invoices/show?invoiceid='.$model->id).'>'.$model->number.'</a>'; |
| 31 | 31 | }) |
| 32 | - ->addColumn('total', function ($model) use ($client) { |
|
| 32 | + ->addColumn('total', function($model) use ($client) { |
|
| 33 | 33 | return currency_format($model->grand_total, $code = $client->currency); |
| 34 | 34 | }) |
| 35 | - ->addColumn('paid', function ($model) use ($client) { |
|
| 35 | + ->addColumn('paid', function($model) use ($client) { |
|
| 36 | 36 | $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get(); |
| 37 | 37 | $c = count($payment); |
| 38 | 38 | $sum = 0; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | return currency_format($sum, $code = $client->currency); |
| 45 | 45 | }) |
| 46 | - ->addColumn('balance', function ($model) use ($client) { |
|
| 46 | + ->addColumn('balance', function($model) use ($client) { |
|
| 47 | 47 | $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get(); |
| 48 | 48 | $c = count($payment); |
| 49 | 49 | $sum = 0; |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | return currency_format($pendingAmount, $code = $client->currency); |
| 57 | 57 | }) |
| 58 | - ->addColumn('status', function ($model) { |
|
| 58 | + ->addColumn('status', function($model) { |
|
| 59 | 59 | return $model->status; |
| 60 | 60 | }) |
| 61 | - ->addColumn('action', function ($model) { |
|
| 61 | + ->addColumn('action', function($model) { |
|
| 62 | 62 | $action = ''; |
| 63 | 63 | $cont = new \App\Http\Controllers\Order\TaxRatesAndCodeExpiryController(); |
| 64 | 64 | $check = $cont->checkExecution($model->id); |
@@ -88,35 +88,35 @@ discard block |
||
| 88 | 88 | $order = $client->order()->orderBy('created_at', 'desc')->get(); |
| 89 | 89 | |
| 90 | 90 | return\ DataTables::of($order) |
| 91 | - ->addColumn('checkbox', function ($model) { |
|
| 91 | + ->addColumn('checkbox', function($model) { |
|
| 92 | 92 | return "<input type='checkbox' class='order_checkbox' |
| 93 | 93 | value=".$model->id.' name=select[] id=checkorder>'; |
| 94 | 94 | }) |
| 95 | - ->addColumn('date', function ($model) { |
|
| 95 | + ->addColumn('date', function($model) { |
|
| 96 | 96 | return ucfirst($model->created_at); |
| 97 | 97 | }) |
| 98 | - ->addColumn('product', function ($model) { |
|
| 98 | + ->addColumn('product', function($model) { |
|
| 99 | 99 | $productName = $model->product()->first() && $model->product()->first()->name ? |
| 100 | 100 | $model->product()->first()->name : 'Unknown'; |
| 101 | 101 | |
| 102 | 102 | return $productName; |
| 103 | 103 | }) |
| 104 | - ->addColumn('number', function ($model) { |
|
| 104 | + ->addColumn('number', function($model) { |
|
| 105 | 105 | $number = $model->number; |
| 106 | 106 | |
| 107 | 107 | return $number; |
| 108 | 108 | }) |
| 109 | - ->addColumn('total', function ($model) use ($client) { |
|
| 109 | + ->addColumn('total', function($model) use ($client) { |
|
| 110 | 110 | $price = currency_format($model->price_override, $code = $client->currency); |
| 111 | 111 | |
| 112 | 112 | return $price; |
| 113 | 113 | }) |
| 114 | - ->addColumn('status', function ($model) { |
|
| 114 | + ->addColumn('status', function($model) { |
|
| 115 | 115 | $status = $model->order_status; |
| 116 | 116 | |
| 117 | 117 | return $status; |
| 118 | 118 | }) |
| 119 | - ->addColumn('action', function ($model) { |
|
| 119 | + ->addColumn('action', function($model) { |
|
| 120 | 120 | return '<a href='.url('orders/'.$model->id)." |
| 121 | 121 | class='btn btn-sm btn-primary btn-xs'><i class='fa fa-eye' |
| 122 | 122 | style='color:white;'> </i> View</a>"; |
@@ -133,25 +133,25 @@ discard block |
||
| 133 | 133 | $extraAmt = $this->getExtraAmtPaid($id); |
| 134 | 134 | |
| 135 | 135 | return\ DataTables::of($payments) |
| 136 | - ->addColumn('checkbox', function ($model) { |
|
| 136 | + ->addColumn('checkbox', function($model) { |
|
| 137 | 137 | return "<input type='checkbox' class='payment_checkbox' |
| 138 | 138 | value=".$model->id.' name=select[] id=checkpayment>'; |
| 139 | 139 | }) |
| 140 | - ->addColumn('invoice_no', function ($model) { |
|
| 140 | + ->addColumn('invoice_no', function($model) { |
|
| 141 | 141 | return $model->invoice()->first() ? $model->invoice()->first()->number : '--'; |
| 142 | 142 | }) |
| 143 | - ->addColumn('date', function ($model) { |
|
| 143 | + ->addColumn('date', function($model) { |
|
| 144 | 144 | $date = $model->created_at; |
| 145 | 145 | $date1 = new \DateTime($date); |
| 146 | 146 | $date = $date1->format('M j, Y, g:i a '); |
| 147 | 147 | |
| 148 | 148 | return $date; |
| 149 | 149 | }) |
| 150 | - ->addColumn('payment_method', function ($model) { |
|
| 150 | + ->addColumn('payment_method', function($model) { |
|
| 151 | 151 | return $model->payment_method; |
| 152 | 152 | }) |
| 153 | 153 | |
| 154 | - ->addColumn('total', function ($model) use ($client, $extraAmt) { |
|
| 154 | + ->addColumn('total', function($model) use ($client, $extraAmt) { |
|
| 155 | 155 | if ($model->invoice_id == 0) { |
| 156 | 156 | $amount = currency_format($extraAmt, $code = $client->currency); |
| 157 | 157 | } else { |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | return $amount; |
| 162 | 162 | }) |
| 163 | - ->addColumn('status', function ($model) { |
|
| 163 | + ->addColumn('status', function($model) { |
|
| 164 | 164 | return ucfirst($model->payment_status); |
| 165 | 165 | }) |
| 166 | 166 | |
| 167 | - ->addColumn('action', function ($model) { |
|
| 167 | + ->addColumn('action', function($model) { |
|
| 168 | 168 | '<input type="hidden" class="paymentid" value="{{$model->id}}">'; |
| 169 | 169 | if ($model->invoice_id == 0) { |
| 170 | 170 | return '<a href='.url('payments/'.$model->id.'/edit/')." class='btn btn-sm btn-primary btn-xs'> <i class='fa fa-edit' style='color:white;'> </i> Edit</a>"; |