diff --git a/app/Console/Commands/ProcessSupportFeesRenewalReminders.php b/app/Console/Commands/ProcessSupportFeesRenewalReminders.php new file mode 100644 index 0000000..94f1e79 --- /dev/null +++ b/app/Console/Commands/ProcessSupportFeesRenewalReminders.php @@ -0,0 +1,44 @@ +contractRenewalReminder = $contractRenewalReminder; + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + $this->contractRenewalReminder->getSupportFeesList(); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 9815331..6240b62 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -29,6 +29,7 @@ class Kernel extends ConsoleKernel // ->hourly(); $schedule->command('renewal:send')->weekdays()->at('13:00'); $schedule->command('client_renewal:send')->weekdays()->at('14:00'); + $schedule->command('support_fees_renewal:send')->weekdays()->at('15:00'); } /** diff --git a/app/Http/Controllers/ClientsController.php b/app/Http/Controllers/ClientsController.php index dad0a0e..523296b 100755 --- a/app/Http/Controllers/ClientsController.php +++ b/app/Http/Controllers/ClientsController.php @@ -13,6 +13,7 @@ use App\Jobs\SendOnboardingCompletedEmailAlert; use App\Http\Requests; use Carbon\Carbon; use App\Libs\PaperLessNgx; +use Spatie\Activitylog\Models\Activity; class ClientsController extends Controller { @@ -22,6 +23,21 @@ class ClientsController extends Controller * @return \Illuminate\Http\Response */ public function index(){ + + /* + $currentuser = session('current_user.name'); + $user_model = Models\SystemUser::find(session('current_user.id')); + #\Auth::user()->actions; + $actions = $user_model->actions; + dd($actions); + $clientModel = new Models\Client; + $currentuser = session('current_user.name'); + $user_model = Models\SystemUser::find(session('current_user.id')); + activity()->performedOn($clientModel) + ->causedBy($user_model) + ->log($currentuser . ' Opened the Client Module at: ' . date('Y-m-d H:i:s')); + */ + // ->log('viewed'); /* $client = Models\Client::find(3); dd($client->client_services); @@ -341,11 +357,20 @@ class ClientsController extends Controller 'invoice_amount' => 'required|numeric', 'invoice_date' => 'required', 'invoice_status' => 'required', - 'short_code' => 'sometimes|numeric' + // 'short_code' => 'sometimes|numeric' ]); $auth_user = session('current_user'); - + // dump($request->has('short_code')); //dd($request->all()); + // dump($request->short_code); + if ($request->short_code !== null) { + $check = is_numeric($request->short_code); + if ($check == false) { + $data = ['code' => 3, 'msg' => 'Short Code must be a number']; + return response()->json($data, 200); + } + } + // dd($request->all()); $finance_arr = [ 'invoice_number' => $request->invoice_number, 'invoice_amount' => $request->invoice_amount, @@ -359,7 +384,7 @@ class ClientsController extends Controller if ($request->has('remarks')) { $finance_arr['remarks'] = $request->remarks; } - + // dd($finance_arr); $result = Models\ClientPayment::create($finance_arr); #$payments = Models\ClientPayment::with('client_info', 'created_by_info')->find($result->id); @@ -591,6 +616,14 @@ class ClientsController extends Controller public function show($id){ //with('short_code_info')-> $showclient = Models\Client::with('service_info', 'country_flag_info', 'auth_user_info', 'short_code_info')->find($id); + //$clientModel = new Models\Client; + /* + $currentuser = session('current_user.name'); + $user_model = Models\SystemUser::find(session('current_user.id')); + activity()->performedOn($showclient) + ->causedBy($user_model) + ->log($currentuser . ' Opened the page for : ' . $showclient->name . date('Y-m-d H:i:s')); + */ // dd(json_decode($showclient->progress_indicators, true)); /* "Initial talks\/ discussions", @@ -629,6 +662,7 @@ class ClientsController extends Controller $support_fees = Models\ClientSupportFees::where('client_id', $id)->orderBy('id', 'DESC')->get(); $showdocuments = Models\ClientFile::where('client_id', $id)->get(); + $client_sender_ids = Models\SenderId::with('network_info', 'created_by_info')->where('client_id', $id)->orderBy('senderid', 'ASC')->get(); // dd($showdocuments[0]->name); if ($showclient->status == 'Live') { $status_bg = "info"; @@ -697,7 +731,7 @@ class ClientsController extends Controller sort($networks_raw); $recurring_arr = ['NO' => 'NO', 'Monthly' => 'Monthly', 'Quarterly' => 'Quarterly', 'Semiannual' => 'Semiannual', 'Yearly' => 'Yearly']; - + $sender_id_statuses = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; $data = [ 'page_title' => 'Client Profile', 'showclient' => $showclient, @@ -719,8 +753,14 @@ class ClientsController extends Controller 'highlight_colour' => $highlight_colour, 'showdocuments' => $showdocuments, 'support_fees' => $support_fees, - 'recurring_arr' => $recurring_arr + 'recurring_arr' => $recurring_arr, + 'client_sender_ids' => $client_sender_ids, + 'sender_id_statuses' => $sender_id_statuses ]; + // dump($client_sender_ids); + // foreach ($client_sender_ids as $value) { + // dd($value->network_info->name); + // } return view('client.show', $data); } @@ -1070,6 +1110,7 @@ class ClientsController extends Controller */ public function update(Requests\UpdateClientRequest $request, $id){ // dump($request->all()); + // \DB::connection()->enableQueryLog(); $client_update = Models\Client::find($id); $paperless = new PaperLessNgx(); if ($client_update->progress_indicator != 'COMPLETED') { @@ -1117,7 +1158,6 @@ class ClientsController extends Controller $existing_documents = Models\ClientFile::where('client_id', $id)->get(); - if ($request->has('document_one') && $request->has('document_one_name')) { if ($request->file('document_one')->isValid()) { $filename = "erp_" . time() . str_random(4) . "." . $request->document_one->extension(); @@ -1270,6 +1310,10 @@ class ClientsController extends Controller 'device' => $request->header('User-Agent') ]; $retval = Models\UserActivity::create($activity_arr); + // $queries = \DB::getQueryLog(); + // dd($queries); + // \Log::info($queries); + Session::flash('success_message', 'Client successfully Updated'); return redirect(url('clients', $id)); } diff --git a/app/Http/Controllers/ContractRenewalReminderController.php b/app/Http/Controllers/ContractRenewalReminderController.php index f66c92a..0ceb8b3 100644 --- a/app/Http/Controllers/ContractRenewalReminderController.php +++ b/app/Http/Controllers/ContractRenewalReminderController.php @@ -9,6 +9,7 @@ use App\Models; use Session; use Illuminate\Support\Arr; use App\Jobs\SendMnoContractRenewalEmailAlert; +use App\Jobs\SendSupportFeesReminderEmailAlert; use App\Http\Requests; use Carbon\Carbon; @@ -36,4 +37,51 @@ class ContractRenewalReminderController extends Controller \Log::info('MNOs due for renewal ' . $log_data); $this->sendNtfy('MNOs due for renewal ' . $log_data); } + public function getSupportFeesList(){ + $support_fees_arr = Models\ClientSupportFees::with('created_by_info', 'client_info')->where('recurring', '<>', 'NO')->get(); + // dd($support_fees_arr); + $renew_ready = []; + $current_date = date('Y-m-d'); + foreach ($support_fees_arr as $value) { + // dd($value->created_by_info); + $date1 = date_create($current_date); + switch ($value->recurring) { + case 'Annual': + $date2 = date('Y-m-d', strtotime('+1 year', strtotime($value->invoice_date))); + $date2 = date_create($value->invoice_date); + $difference = date_diff($date1, $date2); + break; + case 'Semiannual': + $date2 = date('Y-m-d', strtotime('+6 months', strtotime($value->invoice_date))); + $date2 = date_create($value->invoice_date); + $difference = date_diff($date1, $date2); + break; + case 'Quarterly': + $date2 = date('Y-m-d', strtotime('+3 months', strtotime($value->invoice_date))); + $date2 = date_create($value->invoice_date); + $difference = date_diff($date1, $date2); + break; + case 'Monthly': + $date2 = date('Y-m-d', strtotime('+1 month', strtotime($value->invoice_date))); + $date2 = date_create($date2); + $difference = date_diff($date1, $date2); + break; + default: + continue 2; + break; + } + } + if ($difference->days <= 10) { + $renew_ready['client_name'] = $value->client_info->name; + $renew_ready['account_manager_email'] = $value->created_by_info->email; + $renew_ready['days_to_renew'] = $difference->days; + dispatch(new SendSupportFeesReminderEmailAlert($renew_ready)); + } + \Log::info('Support Fees Reminder schedule has successfully ran '); + if (count($renew_ready) > 0) { + $log_data = implode(', ', $renew_ready); + \Log::info('Support Fees Reminder for ' . $log_data); + $this->sendNtfy('Support Fees due for renewal ' . $log_data); + } + } } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index f59329b..8fe2ca7 100755 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -64,6 +64,15 @@ class Controller extends BaseController{ $retval = Models\UserActivity::create($activity_arr); return true; } + public function logUsersActivityTwo($content){ + $clientModel = new Models\Client; + $currentuser = session('current_user.name'); + $user_model = Models\SystemUser::find(session('current_user.id')); + activity()->performedOn($clientModel) + ->causedBy($user_model) + ->log($currentuser . ' Opened the Client Module at: ' . date('Y-m-d H:i:s')); + return true; + } public function storeLoggedUser(){ $user_id = session('current_user.id'); $logged_arr = [ diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index f3142be..ce1230a 100755 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models; +use Spatie\Activitylog\Models\Activity; class LoginController extends Controller { @@ -19,7 +20,7 @@ class LoginController extends Controller $this->validate($request, ['email' => 'required', 'password' => 'required']); //system user : $table = "auth_users"; $logged_in = Models\SystemUser::with('designation_info')->where('email', $request->email)->where('password', md5($request->password))->first(); - + if(empty($logged_in)){ return redirect("/")->withErrors(array("Incorrect Email/Password. Check and try again!"))->withInput(); } @@ -32,12 +33,14 @@ class LoginController extends Controller $request->session()->put('current_user.designation', $logged_in->designation_info->name); \Log::info($logged_in->name . ' Successfully logged in at : ' . date('Y-m-d H:i:s')); + $content = $logged_in->name . " Successfully Logged In"; - + activity()->log($logged_in->name . ' Successfully logged in at : ' . date('Y-m-d H:i:s')); + $this->logUsersActivity($type = 'staff', $content, $logged_in->id); $this->deleteLoggedUser(); $this->storeLoggedUser(); - + switch ($logged_in->designation_info->name) { case 'Administrator': return redirect(url('finance')); // change it to a combined dashboard @@ -45,11 +48,11 @@ class LoginController extends Controller case 'Accounts & Finance': return redirect(url('finance')); break; - + default: return redirect(url('/')); break; - } + } } public function handle_logout(Request $request) { @@ -62,7 +65,8 @@ class LoginController extends Controller $request->session()->flush(); $request->session()->regenerate(true); - $this->logUsersActivity($type = 'staff', $content, $user_id); + activity()->log($username . " Logged Out : " . date('Y-m-d H:i:s')); + // $this->logUsersActivity($type = 'staff', $content, $user_id); return redirect("/"); } @@ -75,7 +79,7 @@ class LoginController extends Controller 'email' => 'required', 'phone' => 'required', 'password' => 'required', - 'confirm_password' => 'same:password', + 'confirm_password' => 'same:password', ]); $make_account = [ diff --git a/app/Http/Controllers/NetworkOperatorsController.php b/app/Http/Controllers/NetworkOperatorsController.php index aaa06a9..f6823e4 100755 --- a/app/Http/Controllers/NetworkOperatorsController.php +++ b/app/Http/Controllers/NetworkOperatorsController.php @@ -21,8 +21,7 @@ class NetworkOperatorsController extends Controller * * @return \Illuminate\Http\Response */ - public function indexBAK() - { + public function indexBAK(){ $network_operators = new Models\NetworkOps; $table_columns = \DB::select(\DB::raw("show full columns from network_operators")); $exclude_arr = [ @@ -99,14 +98,16 @@ class NetworkOperatorsController extends Controller $account_manager = Models\SystemUser::pluck('name', 'id'); $services = Models\Service::pluck('name', 'name'); $status = ['Active' => 'Active', 'Inactive' => 'Inactive', 'Pending' => 'Pending']; + $direct_arr = ['Direct' => 'Direct', 'Non Direct' => 'Non Direct']; + // dd('foo bar'); $data = [ 'page_title' => 'Create Network Operator', 'countries'=> $countries, 'account_manager' => $account_manager, 'services' => $services, - 'status' => $status + 'status' => $status, + 'direct_arr' => $direct_arr ]; - return view('network_ops.create', $data); } @@ -119,12 +120,14 @@ class NetworkOperatorsController extends Controller public function store(Request $request){ $request->validate([ 'name' => 'required', + 'direct_status' => 'required', 'country' => 'required', - 'account_manager_id' => 'required', - 'services' => 'required', - 'contact_person' => 'required', - 'email' => 'required', - 'phone' => 'required' + 'account_manager_id' => 'required_if:direct_status,Direct', + 'services' => 'required_if:direct_status,Direct', + 'contact_person' => 'required_if:direct_status,Direct', + 'email' => 'required_if:direct_status,Direct', + 'phone' => 'required_if:direct_status,Direct', + 'status' => 'required' ]); $operator_arr = [ @@ -140,6 +143,9 @@ class NetworkOperatorsController extends Controller if ($request->has('services')) { $operator_arr['services'] = json_encode($request->services); } + if ($request->account_manager_id == false) { + $operator_arr['account_manager_id'] = session('current_user.id'); + } if ($request->has('phone')) { $operator_arr['phone'] = $request->phone; } @@ -152,7 +158,7 @@ class NetworkOperatorsController extends Controller if ($request->has('contact_person')) { $operator_arr['contact_person'] = $request->contact_person; } - + // dd($operator_arr); $saved = Models\NetworkOps::create($operator_arr); Session::flash('success_message', 'Network Operator successfully added'); return redirect(url('mnos')); diff --git a/app/Http/Controllers/RemindersController.php b/app/Http/Controllers/RemindersController.php new file mode 100644 index 0000000..564f126 --- /dev/null +++ b/app/Http/Controllers/RemindersController.php @@ -0,0 +1,10 @@ + 'Recent Clients', @@ -26,6 +26,7 @@ class ReportsController extends Controller } public function getRecentClientsJson(){ + // $period = $request->period; // $clients = Models\Client::where()->get(); /* $clients = \DB::table('clients') diff --git a/app/Http/Controllers/SenderIdController.php b/app/Http/Controllers/SenderIdController.php index 977bd61..66c2817 100644 --- a/app/Http/Controllers/SenderIdController.php +++ b/app/Http/Controllers/SenderIdController.php @@ -42,23 +42,23 @@ class SenderIdController extends Controller ->whereRaw("sender_ids.senderid LIKE '%$keyword%' OR sender_ids.status LIKE '%$keyword%' OR network_operators.name LIKE '%$keyword%' OR network_operators.country LIKE '%$keyword%' OR staffcreate.name LIKE '%$keyword%' OR staffmodify.name LIKE '%$keyword%' OR clients.name LIKE '%$keyword%'") ->orderBy('sender_ids.senderid', 'ASC') ->paginate(15); - } + } return response()->json($senderid_arr); } public function create() { #$network_arr = Models\NetworkOps::pluck('name','country'); - + $networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); $network_arr = array_pluck($networks, 'network', 'id'); // dd($network_arr); #$network_arr = array_combine($network_arr, $network_arr); - + $clients = Models\Client::pluck('name', 'id'); $staffmembers = Models\StaffMember::pluck('name', 'id'); $status = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; - + $data = [ 'page_title' => 'Create Sender ID', 'network_arr' => $network_arr, @@ -87,14 +87,14 @@ class SenderIdController extends Controller $senderid_arr['created_by'] = session('current_user.id'); $senderid_arr['last_modified_by'] = session('current_user.id'); $senderid_arr['remarks'] = $request->remarks ?? ''; - + $result = Models\SenderId::create($senderid_arr); - - + + #save services this has been moved to the main client table //$retval = $this->store_services($request->services, $result->id); - + Session::flash('success_message', 'Sender ID successfully added'); return redirect(url('senderids')); } @@ -104,12 +104,12 @@ class SenderIdController extends Controller $networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); $network_arr = array_pluck($networks, 'network', 'id'); - + $clients = Models\Client::pluck('name', 'id'); $staffmembers = Models\StaffMember::pluck('name', 'id'); $status = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; - + $data = [ 'page_title' => 'Create Sender ID', @@ -131,9 +131,9 @@ class SenderIdController extends Controller 'status' => 'required', 'remarks' => 'sometimes', ]); - + $senderid = Models\SenderId::findOrFail($id); - + $senderid->senderid = $request->senderid; $senderid->client_id = $request->client_id; $senderid->status = $request->status; @@ -145,4 +145,28 @@ class SenderIdController extends Controller Session::flash('success_message', 'Sender ID successfully Updated'); return redirect(url('senderids')); } + public function direct_store(Request $request) + { + $request->validate([ + 'senderid' => 'required|max:11', + 'network_id' => 'required', + 'status' => 'required', + 'remarks' => 'sometimes', + ]); + $senderid_arr = $request->except('_token'); + $senderid_arr['created_by'] = session('current_user.id'); + $senderid_arr['last_modified_by'] = session('current_user.id'); + $senderid_arr['remarks'] = $request->remarks ?? ''; + + + $result = Models\SenderId::create($senderid_arr); + + + if($result){ + return response()->json([ 'code' => 1, 'result' => 'success']); + } + else { + return response()->json([ 'code' => 3, 'msg' => 'Request could not be handled at this time']); + } + } } diff --git a/app/Http/Controllers/SystemCredentialsController.php b/app/Http/Controllers/SystemCredentialsController.php new file mode 100644 index 0000000..77b98ba --- /dev/null +++ b/app/Http/Controllers/SystemCredentialsController.php @@ -0,0 +1,145 @@ + 'Credentials', + ]; + return view('sys_credentials.index', $data); + + } + public function getCredListJson(Request $request){ + //$this->log_query(); + $credentials_arr = \DB::table('sys_credentials') + ->join('auth_users AS userModify', 'userModify.id', '=', 'sys_credentials.last_modified_by_id') + ->join('auth_users AS userCreate', 'userCreate.id', '=', 'sys_credentials.created_by_id') + ->join('clients', 'clients.id', '=', 'sys_credentials.client_id') + ->join('network_operators', 'network_operators.id', '=', 'sys_credentials.network_operator_id') + ->select('sys_credentials.id', 'clients.name AS clientName', 'network_operators.name AS networkOpsName', 'sys_credentials.service', 'userCreate.name AS created_by_user', 'userModify.name AS modified_by_user', 'sys_credentials.client_id','sys_credentials.network_operator_id', 'sys_credentials.url_endpoint', 'sys_credentials.credentials', 'sys_credentials.expiry_date', 'sys_credentials.remarks', 'sys_credentials.created_at', 'sys_credentials.updated_at') + ->orderBy('sys_credentials.service', 'ASC') + ->paginate(20); + + if($request->has('keyword')){ + $keyword = $request->keyword; + $credentials_arr = \DB::table('sys_credentials') + ->join('auth_users AS userModify', 'userModify.id', '=', 'sys_credentials.last_modified_by_id') + ->join('auth_users AS userCreate', 'userCreate.id', '=', 'sys_credentials.created_by_id') + ->join('clients', 'clients.id', '=', 'sys_credentials.client_id') + ->join('network_operators', 'network_operators.id', '=', 'sys_credentials.network_operator_id') + ->select('sys_credentials.id', 'clients.name AS clientName', 'network_operators.name AS networkOpsName', 'sys_credentials.service', 'userCreate.name AS created_by_user', 'userModify.name AS modified_by_user', 'sys_credentials.client_id','sys_credentials.network_operator_id', 'sys_credentials.url_endpoint', 'sys_credentials.credentials', 'sys_credentials.expiry_date', 'sys_credentials.remarks', 'sys_credentials.created_at', 'sys_credentials.updated_at') + ->whereRaw("sys_credentials.service LIKE '%$keyword%' OR userCreate.name LIKE '%$keyword%' OR sys_credentials.url_endpoint LIKE '%$keyword%' OR sys_credentials.expiry_date LIKE '%$keyword%' OR userModify.name LIKE '%$keyword%' OR sys_credentials.created_at LIKE '%$keyword%' OR sys_credentials.remarks LIKE '%$keyword%' OR sys_credentials.updated_at LIKE '%$keyword%' OR network_operators.name LIKE '%$keyword%'") + ->orderBy('sys_credentials.service', 'ASC') + ->paginate(15); + } + return response()->json($credentials_arr); + } + + + + public function create(){ + $networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); + $network_arr = array_pluck($networks, 'network', 'id'); + $services = Models\Service::pluck('name', 'name'); + $clients = Models\Client::pluck('name', 'id'); + $auth_users = Models\SystemUser::pluck('name', 'id'); + + $data = [ + 'page_title' => 'System Credentialss', + 'clients' => $clients, + 'network_arr' => $network_arr, + 'services' => $services, + 'auth_users' => $auth_users + ]; + return view('sys_credentials.create', $data); + } + public function store(Request $request){ + $request->validate([ + 'service' => 'required', + 'client_id' => 'required', + 'network_operator_id' => 'required', + 'url_endpoint' => 'required', + 'credentials' => 'required', + 'expiry_date' => 'required', + 'remarks' => 'sometimes', + ]); + // dump($request->all()); + + $credentials_arr = $request->except('_token'); + $credentials_arr['last_modified_by_id'] = session('current_user.id'); + $credentials_arr['created_by_id'] = session('current_user.id'); + + // dd($credentials_arr); + // TODO: add user activity here + $result = Models\SystemCredential::create($credentials_arr); + Session::flash('success_message', 'Credentials successfully added'); + return redirect(url('systemcreds')); + } + + public function edit($id){ + $credential = Models\SystemCredential::find($id); + + $networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); + $network_arr = array_pluck($networks, 'network', 'id'); + $clients = Models\Client::pluck('name', 'id'); + $auth_users = Models\SystemUser::pluck('name', 'id'); + + + $data = [ + 'page_title' => 'System Credentials', + 'credential' => $credential, + 'clients' => $clients, + 'network_arr' => $network_arr, + 'auth_users' => $auth_users + ]; + return view('sys_credentials.edit', $data); + } + + public function update(Request $request, $id){ + $request->validate([ + 'friendly_name' => 'required', + 'server_id' => 'required', + 'public_ip_address' => 'sometimes|ip', + 'private_ip_address' => 'sometimes|nullable|ip', + 'main_use' => 'required', + 'remarks' => 'nullable', + 'status' => 'required', + 'server_number' => 'required', + ]); + $server = Models\ClickServer::findOrFail($id); + $server_arr = $request->except('_token', 'server_id', 'server_number'); + $server_arr['last_modified_by_id'] = session('current_user.id'); + $server_arr['server_id'] = $request->server_number; + $result = $server->update($server_arr); + Session::flash('success_message', 'Server Details successfully updated'); + return redirect(url('infrastructure/server-list')); + } + + public function reveal_password($id){ + $server = Models\ClickServer::find($id); + if ($server) { + $response_arr = [ + 'code' => 1, + 'password' => decrypt($server->root_password) + ]; + } + else{ + $response_arr = [ + 'code' => 3, + 'msg' => 'not found' + ]; + } + return response()->json($response_arr); + } + +} diff --git a/app/Http/Controllers/UtilityController.php b/app/Http/Controllers/UtilityController.php index 9d728fa..e9fb0a8 100644 --- a/app/Http/Controllers/UtilityController.php +++ b/app/Http/Controllers/UtilityController.php @@ -5,13 +5,16 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models; +use Spatie\Activitylog\Models\Activity; // use Illuminate\Contracts\Mail\Mailer; class UtilityController extends Controller { - + public function underconstruction(){ + return view('utility.underconstruction'); + } public function EmailTest(Mailer $mailer) { @@ -28,6 +31,11 @@ class UtilityController extends Controller $message->to($emails)->subject('New Notes'); }); } + /** + * maptest function to display the map view. + * + * @return Illuminate\View\View + */ public function maptest(){ return view('utility.map'); @@ -111,5 +119,31 @@ class UtilityController extends Controller } dump($count_cl); } + function loggingTest(){ + $rando = uniqid(); + + $newsItem = Models\Utility::create([ + 'name' => 'original name : ' . $rando, + 'type' => 'Lorum' + ]); + $activity = Activity::all()->last(); + + dump($activity->description); //returns 'created' + dump($activity->subject); //returns the instance of NewsItem that was created + dump($activity->changes); //returns ['attributes' => ['name' => 'original name', 'text' => 'Lorum']]; + // + $rando = uniqid(); + + $newsItem->name = 'updated name to something like this ' . $rando; + $newsItem->type = 'franko'; + $newsItem->save(); + + //updating the newsItem will cause an activity being logged + $activity_up = Activity::all()->last(); + dump($activity_up); + dump($activity_up->description); //returns 'updated' + dump($activity_up->subject); //returns the instance of NewsItem that was created + dump($activity_up->changes); + } } // https://www.tokyvideo.com/video/sheena-the-queen-of-the-jungle-1984-movie-with-tanya-roberts-ted-wass-donovan-scott diff --git a/app/Http/Middleware/CheckCurrentlyLoggedInUsers.php b/app/Http/Middleware/CheckCurrentlyLoggedInUsers.php index 0d7500e..50b1d8a 100644 --- a/app/Http/Middleware/CheckCurrentlyLoggedInUsers.php +++ b/app/Http/Middleware/CheckCurrentlyLoggedInUsers.php @@ -17,6 +17,7 @@ class CheckCurrentlyLoggedInUsers { if($request->session()->has('current_user')){ $id = session('current_user.id'); + $device = $request->server('HTTP_USER_AGENT'); $realm = $id . $device; $current_user = Models\LoggedUser::where('user_id', $id)->where('device', $device)->first(); diff --git a/app/Jobs/SendSupportFeesReminderEmailAlert.php b/app/Jobs/SendSupportFeesReminderEmailAlert.php new file mode 100644 index 0000000..7db16a6 --- /dev/null +++ b/app/Jobs/SendSupportFeesReminderEmailAlert.php @@ -0,0 +1,52 @@ +renewalSet = $renewalSet; + } + + /** + * Execute the job. + * + * @return void + */ + + public function handle(Mailer $mailer){ + $renewalSet = $this->renewalSet; + $emails = ['samuel@click-mobile.com']; + $emails = ['kwesi@click-mobile.com']; + $emails = ['effie@click-mobile.com']; + $emails = ['priscilla@click-mobile.com']; + $emails = ['jim@click-mobile.com']; + $emails = ['daniel@click-mobile.com']; + $emails = ['mansa@click-mobile.com']; + $emails[] = $renewalSet['account_manager_email']; + $data = [ + 'client_name' => $renewalSet['client_name'], + 'alert_body' => 'Support fees for ' . $renewalSet['client_name'] . ' will be due in ' . $renewalSet['days_to_renew'] . ' days. Take note' + ]; + $mailer->send('emails.supportfees-alert', $data, function ($message) use ($data, $emails) { + $message->from('support@click-mobile.com', 'Click Mobile ERP'); + $message->to($emails)->subject('Support Fees Reminder'); + }); + } +} diff --git a/app/Models/Client.php b/app/Models/Client.php index c730f1c..93bd58e 100755 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -4,11 +4,29 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use App\Models; +#use Spatie\Activitylog\Traits\LogsActivity; +//use Spatie\Activitylog\Traits\CausesActivity; +#use Spatie\Activitylog\LogOptions; + class Client extends Model { + #use LogsActivity; + protected $guarded = array('id'); public $table = "clients"; protected $appends = ['client_services']; + /* + protected static $logName = 'clients_log'; + protected static $logOnlyDirty = true; + protected static $dontSubmitEmptyLogs = true; + + + protected static $logUnguarded = true; + public function getActivitylogOptions(): LogOptions{ + return LogOptions::defaults() + ->logUnguarded()->useLogName('client')->logOnlyDirty()->dontSubmitEmptyLogs(); + } + */ /* public function getprogressIndicatorsAttribute($value){ @@ -17,8 +35,8 @@ class Client extends Model $indicator_score = (count($current_indicator_count)/$general_indicators) * 100; return number_format($indicator_score); } - - + + public function getOnboardingProgressStageAttribute($value){ $onboarding_stage = json_decode($value, true); @@ -55,8 +73,8 @@ class Client extends Model public function short_code_info(){ return $this->hasMany('App\Models\ShortCode', 'client_id', 'id'); } - - + + public function getClientServicesAttribute(){ $services = $this->service_info; $service_name_arr = []; @@ -66,5 +84,5 @@ class Client extends Model } return $service_name_arr; } - + } diff --git a/app/Models/ClientNote.php b/app/Models/ClientNote.php index f759ecf..aa93002 100644 --- a/app/Models/ClientNote.php +++ b/app/Models/ClientNote.php @@ -3,10 +3,17 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +use Spatie\Activitylog\Traits\LogsActivity; +use Spatie\Activitylog\LogOptions; class ClientNote extends Model { protected $guarded = array('id'); + protected static $logUnguarded = true; + + public function getActivitylogOptions(): LogOptions{ + return LogOptions::defaults()->logUnguarded(); + } public function client_info(){ return $this->hasOne('App\Models\Client', 'id', 'client_id'); @@ -14,5 +21,5 @@ class ClientNote extends Model public function created_by_info(){ return $this->hasOne('App\Models\SystemUser', 'id', 'auth_user_id'); } - + } diff --git a/app/Models/ClientSupportFees.php b/app/Models/ClientSupportFees.php index 1ec940c..0f09c88 100644 --- a/app/Models/ClientSupportFees.php +++ b/app/Models/ClientSupportFees.php @@ -14,6 +14,6 @@ class ClientSupportFees extends Model } public function created_by_info(){ // return $this->hasOne('App\Models\Account', 'id', 'auth_user_id'); - return $this->hasOne('App\Models\SystemUser', 'id', 'auth_user_id'); + return $this->hasOne('App\Models\SystemUser', 'id', 'user_id'); } } diff --git a/app/Models/LoggedUser.php b/app/Models/LoggedUser.php index f95ebf7..bcb89b5 100644 --- a/app/Models/LoggedUser.php +++ b/app/Models/LoggedUser.php @@ -11,6 +11,6 @@ class LoggedUser extends Model public function auth_user_info(){ - return $this->hasOne('App\Models\Account', 'id', 'user_id'); + return $this->hasOne('App\Models\SystemUser', 'id', 'user_id'); } } diff --git a/app/Models/SenderId.php b/app/Models/SenderId.php index 86674b5..fd03a4c 100644 --- a/app/Models/SenderId.php +++ b/app/Models/SenderId.php @@ -3,19 +3,35 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +use Spatie\Activitylog\Traits\LogsActivity; +use Spatie\Activitylog\LogOptions; class SenderId extends Model{ + use LogsActivity; + protected $guarded = array('id'); public $table = "sender_ids"; + protected static $logName = 'senderid_log'; + // protected static $causedBy = $user_model; + protected static $logOnlyDirty = true; + protected static $dontSubmitEmptyLogs = true; + + + protected static $logUnguarded = true; + public function getActivitylogOptions(): LogOptions{ + return LogOptions::defaults() + ->logUnguarded()->useLogName('senderid_log')->logOnlyDirty()->dontSubmitEmptyLogs(); + } + public function modified_by_info(){ return $this->hasOne('App\Models\StaffMember', 'id', 'last_modified_by'); } public function network_info(){ - return $this->hasOne('App\Models\NetworkOps', 'id', 'netowkr_id'); + return $this->hasOne('App\Models\NetworkOps', 'id', 'network_id'); } public function created_by_info(){ return $this->hasOne('App\Models\StaffMember', 'id', 'created_by'); - } + } } diff --git a/app/Models/SystemCredential.php b/app/Models/SystemCredential.php new file mode 100644 index 0000000..1ba1cf1 --- /dev/null +++ b/app/Models/SystemCredential.php @@ -0,0 +1,24 @@ +hasOne('App\Models\SystemUser', 'id', 'last_modified_by_id'); + } + public function network_info(){ + return $this->hasOne('App\Models\NetworkOps', 'id', 'network_id'); + } + public function client_info(){ + return $this->hasOne('App\Models\Client', 'id', 'client_id'); + } + public function created_by_info(){ + return $this->hasOne('App\Models\SystemUser', 'id', 'created_by_id'); + } +} diff --git a/app/Models/SystemUser.php b/app/Models/SystemUser.php index 1070a06..3a4e365 100755 --- a/app/Models/SystemUser.php +++ b/app/Models/SystemUser.php @@ -3,12 +3,21 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +// use Spatie\Activitylog\Traits\LogsActivity; +use Spatie\Activitylog\Traits\CausesActivity; +use Spatie\Activitylog\LogOptions; class SystemUser extends Model { + // use LogsActivity; + use CausesActivity; protected $guarded = array('id'); public $table = "auth_users"; - + protected static $logUnguarded = true; + // public function getActivitylogOptions(): LogOptions{ + // return LogOptions::defaults()->logUnguarded(); + // } + public function designation_info(){ return $this->hasOne('App\Models\Designation', 'id', 'designation'); } diff --git a/app/Models/UserActivity.php b/app/Models/UserActivity.php index 3b41f50..6a3c2af 100644 --- a/app/Models/UserActivity.php +++ b/app/Models/UserActivity.php @@ -14,10 +14,13 @@ class UserActivity extends Model public function userInfo(){ return $this->hasOne('App\Models\StaffMember', 'id', 'user_id'); } + public function userInfoSystem(){ + return $this->hasOne('App\Models\SystemUser', 'id', 'user_id'); + } public function getActivityTimeAttribute(){ $created = $this->created_at; $parsed_created_date = Carbon::parse($created); - $current_date = Carbon::parse(date('Y-m-d')); + $current_date = Carbon::parse(date('Y-m-d')); $days = $parsed_created_date->diffForHumans(); return $days; } diff --git a/app/Models/Utility.php b/app/Models/Utility.php new file mode 100644 index 0000000..eb40c61 --- /dev/null +++ b/app/Models/Utility.php @@ -0,0 +1,23 @@ +logUnguarded(); + // ->logOnly(['name', 'type']); + // Chain fluent methods for configuration options + } +} diff --git a/composer.json b/composer.json index e28c2d3..d01b5ed 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ "laravel/framework": "5.5.*", "laravel/tinker": "~1.0", "laravelcollective/html": "^5.4.0", - "maatwebsite/excel": "^3.1" + "maatwebsite/excel": "^3.1", + "spatie/laravel-activitylog": "^3.2" }, "require-dev": { "filp/whoops": "~2.0", diff --git a/composer.lock b/composer.lock index b247f82..62fecda 100755 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,63 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1b55af854942faedd605d375de12227b", + "content-hash": "6220800cdce8e79b948fcc3175695707", "packages": [ + { + "name": "anahkiasen/underscore-php", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/Anahkiasen/underscore-php.git", + "reference": "48f97b295c82d99c1fe10d8b0684c43f051b5580" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Anahkiasen/underscore-php/zipball/48f97b295c82d99c1fe10d8b0684c43f051b5580", + "reference": "48f97b295c82d99c1fe10d8b0684c43f051b5580", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.0", + "patchwork/utf8": "^1.2", + "php": ">=5.4.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "2.0.*@dev", + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Underscore\\": [ + "src", + "tests" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Fabre", + "email": "ehtnam6@gmail.com" + } + ], + "description": "A redacted port of Underscore.js for PHP", + "keywords": [ + "internals", + "laravel", + "toolkit" + ], + "support": { + "issues": "https://github.com/Anahkiasen/underscore-php/issues", + "source": "https://github.com/Anahkiasen/underscore-php/tree/develop" + }, + "abandoned": true, + "time": "2015-05-16T19:24:58+00:00" + }, { "name": "dnoegel/php-xdg-base-dir", "version": "v0.1.1", @@ -1679,6 +1734,83 @@ }, "time": "2020-10-15T08:29:30+00:00" }, + { + "name": "patchwork/utf8", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/tchwork/utf8.git", + "reference": "e1fa4d4a57896d074c9a8d01742b688d5db4e9d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tchwork/utf8/zipball/e1fa4d4a57896d074c9a8d01742b688d5db4e9d5", + "reference": "e1fa4d4a57896d074c9a8d01742b688d5db4e9d5", + "shasum": "" + }, + "require": { + "lib-pcre": ">=7.3", + "php": ">=5.3.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4|^4.4" + }, + "suggest": { + "ext-iconv": "Use iconv for best performance", + "ext-intl": "Use Intl for best performance", + "ext-mbstring": "Use Mbstring for best performance", + "ext-wfio": "Use WFIO for UTF-8 filesystem access on Windows" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Patchwork\\": "src/Patchwork/" + }, + "classmap": [ + "src/Normalizer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "(Apache-2.0 or GPL-2.0)" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + } + ], + "description": "Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP", + "homepage": "https://github.com/tchwork/utf8", + "keywords": [ + "grapheme", + "i18n", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "issues": "https://github.com/tchwork/utf8/issues", + "source": "https://github.com/tchwork/utf8/tree/v1.3.3" + }, + "funding": [ + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/patchwork/utf8", + "type": "tidelift" + } + ], + "abandoned": "symfony/polyfill-mbstring or symfony/string", + "time": "2021-01-07T16:38:58+00:00" + }, { "name": "phpoffice/phpspreadsheet", "version": "1.29.0", @@ -2274,6 +2406,144 @@ ], "time": "2021-08-06T20:32:15+00:00" }, + { + "name": "spatie/laravel-activitylog", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-activitylog.git", + "reference": "8db5d2f314a26ee9a1617bdecd98947fdf29fcfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-activitylog/zipball/8db5d2f314a26ee9a1617bdecd98947fdf29fcfa", + "reference": "8db5d2f314a26ee9a1617bdecd98947fdf29fcfa", + "shasum": "" + }, + "require": { + "illuminate/config": "~5.5.0|~5.6.0|~5.7.0|~5.8.0", + "illuminate/database": "~5.5.0|~5.6.0|~5.7.0|~5.8.0", + "illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0", + "php": "^7.1", + "spatie/string": "^2.1" + }, + "require-dev": { + "ext-json": "*", + "orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0|~3.8.0", + "phpunit/phpunit": "^7.4 | ^8.0", + "scrutinizer/ocular": "^1.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Activitylog\\ActivitylogServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Activitylog\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A very simple activity logger to monitor the users of your website or application", + "homepage": "https://github.com/spatie/activitylog", + "keywords": [ + "activity", + "laravel", + "log", + "spatie", + "user" + ], + "support": { + "issues": "https://github.com/spatie/laravel-activitylog/issues", + "source": "https://github.com/spatie/laravel-activitylog/tree/master" + }, + "time": "2019-02-27T12:41:17+00:00" + }, + { + "name": "spatie/string", + "version": "2.2.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/string.git", + "reference": "79ed501c8d624fb85bf71da4254e1878fb616c51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/string/zipball/79ed501c8d624fb85bf71da4254e1878fb616c51", + "reference": "79ed501c8d624fb85bf71da4254e1878fb616c51", + "shasum": "" + }, + "require": { + "anahkiasen/underscore-php": "^2.0", + "php": "^7.0|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "autoload": { + "files": [ + "src/string_functions.php" + ], + "psr-4": { + "Spatie\\String\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "String handling evolved", + "homepage": "https://github.com/spatie/string", + "keywords": [ + "handling", + "handy", + "spatie", + "string" + ], + "support": { + "issues": "https://github.com/spatie/string/issues", + "source": "https://github.com/spatie/string/tree/2.2.3" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2020-11-28T22:24:20+00:00" + }, { "name": "swiftmailer/swiftmailer", "version": "v6.2.7", diff --git a/config/activitylog.php b/config/activitylog.php new file mode 100644 index 0000000..a9c32bf --- /dev/null +++ b/config/activitylog.php @@ -0,0 +1,45 @@ + env('ACTIVITY_LOGGER_ENABLED', true), + + /* + * When the clean-command is executed, all recording activities older than + * the number of days specified here will be deleted. + */ + 'delete_records_older_than_days' => 365, + + /* + * If no log name is passed to the activity() helper + * we use this default log name. + */ + 'default_log_name' => 'default', + + /* + * You can specify an auth driver here that gets user models. + * If this is null we'll use the default Laravel auth driver. + */ + 'default_auth_driver' => null, + + /* + * If set to true, the subject returns soft deleted models. + */ + 'subject_returns_soft_deleted_models' => false, + + /* + * This model will be used to log activity. + * It should be implements the Spatie\Activitylog\Contracts\Activity interface + * and extend Illuminate\Database\Eloquent\Model. + */ + 'activity_model' => \Spatie\Activitylog\Models\Activity::class, + + /* + * This is the name of the table that will be created by the migration and + * used by the Activity model shipped with this package. + */ + 'table_name' => 'activity_log', +]; diff --git a/database/migrations/2024_07_18_105534_create_activity_log_table.php b/database/migrations/2024_07_18_105534_create_activity_log_table.php new file mode 100644 index 0000000..9630776 --- /dev/null +++ b/database/migrations/2024_07_18_105534_create_activity_log_table.php @@ -0,0 +1,38 @@ +increments('id'); + $table->string('log_name')->nullable(); + $table->text('description'); + $table->integer('subject_id')->nullable(); + $table->string('subject_type')->nullable(); + $table->integer('causer_id')->nullable(); + $table->string('causer_type')->nullable(); + $table->text('properties')->nullable(); + $table->timestamps(); + + $table->index('log_name'); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + { + Schema::dropIfExists(config('activitylog.table_name')); + } +} diff --git a/live.env b/live.env new file mode 100644 index 0000000..6f8d89d --- /dev/null +++ b/live.env @@ -0,0 +1,46 @@ +APP_NAME=Tracker +APP_ENV=production +APP_KEY=base64:8gXdEEPNnQJeaD4v9y4djtdj3h13Db3KeWbAlV4fYo0= +APP_DEBUG=false +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=click_team_tracker +DB_USERNAME=root +DB_PASSWORD=n1h1!1st + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.gmail.com +MAIL_PORT=587 +MAIL_USERNAME=erp@click-mobile.com +MAIL_PASSWORD=sqczcsrtcehpywjv +MAIL_ENCRYPTION=tls +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/pending-issues.md b/pending-issues.md index 42eb613..f4ca4f9 100644 --- a/pending-issues.md +++ b/pending-issues.md @@ -1,11 +1,5 @@ # Onboarding process -# Date 2024-01-18 -i Effie, -Lets have app fee and development once off 100,000 and at 13% annual maintenance, which reminds me we are not billing customers for support and annual maintenance ☹. -@'Kwesi Banson' we need to add these on the ERP. -Kind Regards, -Sam Thank you sir, @@ -38,22 +32,9 @@ Dynamic Numeric- Yes/No Delivery Report- Yes/No Comments -# Short Code Licence/Certificate Renewal Date -Our ZICTA certificate for the Geopoll short code 5155 will expire on the 22nd of March. Renewal fee is K18,000. - -Kind Regards, - -Martha - -VFGH83347501 - - -https://youtu.be/6kBAkodqBRM - -https://youtu.be/OUSTGLL51m0 - -In response to SSL Certificate renewal -Anything that needs renewal etc - needs to be on the ERP under tech, - -Kind Regards +1. Charity suggested we link clients with Sender IDs to avoid having to enter Sender IDS on a separate page +2. Charity and the team also suggested it would be good for us country managers to have more options on the ERP. Country documents should also have an option to add expiry dates. Have the same notes function under countries just like AMs. +3. Charity also suggested that we have a feature that sends emails to AMs to remind them of the invoices. Since invoices have validity period to say to be paid after so an so date, it should be used to send reminders to alert AMs to followup on payments. Don’t know if it makes sense. +4. I have asked Kwesi if we could have a page on the ERP that displays all activities rather than just on the home page. Also suggested that we be able to click on some activities like when AM leaves a note, we should be able to open and view that note. +5. The other suggestion was to have an option to view all clients instead of just showing 15 clients per page, have an option to view 15, view 50. view 100. view all. that way will be able to download XLSX/PDF for all clients if we view all. currently it only downloads 15 clients of that particular page diff --git a/public/assets/js/clientshow.js b/public/assets/js/clientshow.js index 4d79ccb..3b35e72 100644 --- a/public/assets/js/clientshow.js +++ b/public/assets/js/clientshow.js @@ -66,6 +66,11 @@ $('#shortCodeType').val('voice'); $('#newShortCodeFormModal').modal('show'); }); + $('#createSenderIdBtn').click(function(evt){ + evt.preventDefault(); + console.log('Heere at the wall'); + $('#newSenderIdFormModal').modal('show'); + }); $('#createPaymentBtn').click(function(evt){ evt.preventDefault(); @@ -264,7 +269,7 @@ location.reload(); }, 8000); } - else if (data.code > 5) { + else if (data.code > 1) { $.alert({ title: 'Alert!', content: data.msg, @@ -343,7 +348,7 @@ }); }); - + /* $('#financeServicesStore').change(function(evtt){ let currentServices = $('#financeServicesStore').val(); $.each(currentServices, function (key, value) { @@ -359,6 +364,7 @@ } }); }); + */ $('#financeEditForm').submit(function(evt){ evt.preventDefault(); @@ -521,4 +527,52 @@ }); }); + $('#newSenderIdForm').submit(function(evt){ + evt.preventDefault(); + var formData = new FormData($(this)[0]); + $.ajax({ + type: "POST", + url: base_url + '/senderids/direct_store', + data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + if (data.code === 1) { + $.alert({ + title: 'Alert!', + content: 'Sender ID successfully saved', + }); + setTimeout(function(){ + location.reload(); + }, 8000); + } + else if (data.code > 1) { + $.alert({ + title: 'Alert!', + content: data.msg, + }); + } + else { + $.alert({ + title: 'Alert!', + content: 'Your request could not be handled. Try again !', + }); + + } + }, + error: function (data) { + var output = $.parseJSON(data.responseText); + console.log(output.errors); + $('#senderIdnotifyArea').removeClass('hidden'); + $.each(output.errors, function (key, value) { + console.log(value[0]); + $('#senderIdnotifyArea').text(value[0]); + }); + }, + fail : function(errordata){ + console.log(errordata); + } + }); + }); }); diff --git a/public/documents/general_files/erp_17217462929CO2.xlsx b/public/documents/general_files/erp_17217462929CO2.xlsx new file mode 100644 index 0000000..eef1547 Binary files /dev/null and b/public/documents/general_files/erp_17217462929CO2.xlsx differ diff --git a/public/screenshots/Screenshot 2024-07-15 at 3.37.19 PM.png b/public/screenshots/Screenshot 2024-07-15 at 3.37.19 PM.png new file mode 100644 index 0000000..649aa73 Binary files /dev/null and b/public/screenshots/Screenshot 2024-07-15 at 3.37.19 PM.png differ diff --git a/public/screenshots/Screenshot 2024-07-15 at 3.37.30 PM.png b/public/screenshots/Screenshot 2024-07-15 at 3.37.30 PM.png new file mode 100644 index 0000000..6574236 Binary files /dev/null and b/public/screenshots/Screenshot 2024-07-15 at 3.37.30 PM.png differ diff --git a/public/screenshots/Screenshot 2024-07-15 at 3.37.39 PM.png b/public/screenshots/Screenshot 2024-07-15 at 3.37.39 PM.png new file mode 100644 index 0000000..8079008 Binary files /dev/null and b/public/screenshots/Screenshot 2024-07-15 at 3.37.39 PM.png differ diff --git a/public/screenshots/Screenshot 2024-07-15 at 3.37.45 PM.png b/public/screenshots/Screenshot 2024-07-15 at 3.37.45 PM.png new file mode 100644 index 0000000..1666894 Binary files /dev/null and b/public/screenshots/Screenshot 2024-07-15 at 3.37.45 PM.png differ diff --git a/requirements.md b/requirements.md index 54a6d9a..79744d9 100755 --- a/requirements.md +++ b/requirements.md @@ -1,5 +1,5 @@ # Pending features -- Click Infrastructure +- Click Infrastructure - IP/Domains - Services - Server Overview @@ -11,9 +11,15 @@ - - Prospective - - Live - - Inactive - + +# Call with Priscilla - 30-07-2024 +## Custom Reminders +- Email : +- Subject +- Body : +- Date : diff --git a/resources/views/client/partials/create-senderids.blade.php b/resources/views/client/partials/create-senderids.blade.php new file mode 100644 index 0000000..94df267 --- /dev/null +++ b/resources/views/client/partials/create-senderids.blade.php @@ -0,0 +1,64 @@ + + diff --git a/resources/views/client/partials/create-shortcodes.blade.php b/resources/views/client/partials/create-shortcodes.blade.php index c7636b9..f86691c 100644 --- a/resources/views/client/partials/create-shortcodes.blade.php +++ b/resources/views/client/partials/create-shortcodes.blade.php @@ -15,14 +15,14 @@
- +
- +
-
+
@@ -32,15 +32,15 @@
- +
-
+
@@ -63,18 +63,18 @@
-
-
+
+
-
+
@@ -82,7 +82,7 @@
- +
diff --git a/resources/views/client/partials/finance.blade.php b/resources/views/client/partials/finance.blade.php index 9f5d601..032380f 100644 --- a/resources/views/client/partials/finance.blade.php +++ b/resources/views/client/partials/finance.blade.php @@ -20,10 +20,10 @@ {!! Form::select('services[]', $service_type_names , old('services'), ['class' => 'form-control' , 'id' => 'financeServicesStore', 'required' => 'required', 'multiple'=> 'true', 'style' => 'width: 100%']) !!}
-