@@ -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 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | style='color:white;'> </i> Edit</a>"; |
| 73 | 73 | }) |
| 74 | 74 | |
| 75 | - ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action']) |
|
| 75 | + ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action']) |
|
| 76 | 76 | ->make(true); |
| 77 | 77 | // ->searchColumns('name', 'content') |
| 78 | 78 | // ->orderColumns('name') |
@@ -115,28 +115,28 @@ discard block |
||
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | 117 | return\ DataTables::of($user->get()) |
| 118 | - ->addColumn('checkbox', function ($model) { |
|
| 119 | - return "<input type='checkbox' class='user_checkbox' |
|
| 118 | + ->addColumn('checkbox', function ($model) { |
|
| 119 | + return "<input type='checkbox' class='user_checkbox' |
|
| 120 | 120 | value=".$model->id.' name=select[] id=check>'; |
| 121 | - }) |
|
| 121 | + }) |
|
| 122 | 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) { |
|
| 127 | - return $model->email; |
|
| 128 | - }) |
|
| 129 | - ->addColumn('created_at', function ($model) { |
|
| 130 | - $ends = $model->created_at; |
|
| 131 | - if ($ends) { |
|
| 132 | - $date1 = new DateTime($ends); |
|
| 133 | - $tz = \Auth::user()->timezone()->first()->name; |
|
| 134 | - $date1->setTimezone(new DateTimeZone($tz)); |
|
| 135 | - $end = $date1->format('M j, Y, g:i a '); |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - return $end; |
|
| 139 | - }) |
|
| 126 | + ->addColumn('email', function ($model) { |
|
| 127 | + return $model->email; |
|
| 128 | + }) |
|
| 129 | + ->addColumn('created_at', function ($model) { |
|
| 130 | + $ends = $model->created_at; |
|
| 131 | + if ($ends) { |
|
| 132 | + $date1 = new DateTime($ends); |
|
| 133 | + $tz = \Auth::user()->timezone()->first()->name; |
|
| 134 | + $date1->setTimezone(new DateTimeZone($tz)); |
|
| 135 | + $end = $date1->format('M j, Y, g:i a '); |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + return $end; |
|
| 139 | + }) |
|
| 140 | 140 | // ->showColumns('email', 'created_at') |
| 141 | 141 | ->addColumn('active', function ($model) { |
| 142 | 142 | if ($model->active == 1) { |
@@ -553,9 +553,9 @@ discard block |
||
| 553 | 553 | return \Response::json([]); |
| 554 | 554 | } |
| 555 | 555 | $users = User::where('email', 'LIKE', '%'.$term.'%') |
| 556 | - ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
| 557 | - ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
| 558 | - ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
| 556 | + ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
| 557 | + ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
| 558 | + ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
| 559 | 559 | $formatted_tags = []; |
| 560 | 560 | |
| 561 | 561 | foreach ($users as $user) { |
@@ -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') |