From 903c1703b93a5d39602112939e5f88e3392d0ac3 Mon Sep 17 00:00:00 2001 From: Kwesi Banson Date: Mon, 17 Apr 2023 20:25:52 +0000 Subject: [PATCH] clients profile,slack, new email, bug fixes --- accounts.md | 21 +- app/Http/Controllers/ClickAppsController.php | 7 + app/Http/Controllers/ClientsController.php | 390 ++++++++++++++++-- app/Http/Controllers/DashboardController.php | 1 + app/Http/Controllers/LoginController.php | 1 + app/Http/Controllers/UtilityController.php | 31 ++ app/Models/ClickServer.php | 2 +- app/Models/Client.php | 3 + app/Models/ClientPayment.php | 18 + app/Models/ClientShortCode.php | 18 + app/Models/Industry.php | 10 + app/Models/ShortCode.php | 21 + app/Models/SystemUser.php | 3 +- app/Providers/AppServiceProvider.php | 9 +- public/assets/js/clientshow.js | 249 +++++++++++ requirements.md | 15 +- .../views/click_apps/short-codes.blade.php | 175 ++++++++ resources/views/client/create.blade.php | 16 +- resources/views/client/edit.blade.php | 153 +++++-- .../partials/client-sms-codes.blade.php | 48 +++ .../partials/client-ussd-codes.blade.php | 48 +++ .../partials/client-voice-codes.blade.php | 49 +++ .../partials/create-shortcodes.blade.php | 97 +++++ .../client/partials/edit-finance.blade.php | 80 ++++ .../views/client/partials/finance.blade.php | 102 +++++ .../views/client/partials/new_notes.blade.php | 63 +++ .../client/partials/recent-payments.blade.php | 44 ++ .../views/client/partials/sms-codes.blade.php | 45 ++ .../client/partials/ussd-codes.blade.php | 46 +++ .../client/partials/voice-codes.blade.php | 45 ++ resources/views/client/shortcodes.blade.php | 88 ++++ resources/views/client/show.blade.php | 244 +++++++---- resources/views/dashboard/index.blade.php | 2 +- resources/views/emails/new-notes.blade.php | 12 +- resources/views/layouts/master.blade.php | 13 +- .../views/layouts/partials/sidebar.blade.php | 10 +- routes/web.php | 17 +- 37 files changed, 2031 insertions(+), 165 deletions(-) create mode 100644 app/Http/Controllers/UtilityController.php create mode 100644 app/Models/ClientPayment.php create mode 100644 app/Models/ClientShortCode.php create mode 100644 app/Models/Industry.php create mode 100644 app/Models/ShortCode.php create mode 100644 public/assets/js/clientshow.js create mode 100644 resources/views/click_apps/short-codes.blade.php create mode 100644 resources/views/client/partials/client-sms-codes.blade.php create mode 100644 resources/views/client/partials/client-ussd-codes.blade.php create mode 100644 resources/views/client/partials/client-voice-codes.blade.php create mode 100644 resources/views/client/partials/create-shortcodes.blade.php create mode 100644 resources/views/client/partials/edit-finance.blade.php create mode 100644 resources/views/client/partials/finance.blade.php create mode 100644 resources/views/client/partials/new_notes.blade.php create mode 100644 resources/views/client/partials/recent-payments.blade.php create mode 100644 resources/views/client/partials/sms-codes.blade.php create mode 100644 resources/views/client/partials/ussd-codes.blade.php create mode 100644 resources/views/client/partials/voice-codes.blade.php create mode 100644 resources/views/client/shortcodes.blade.php diff --git a/accounts.md b/accounts.md index 0e148bf..71e211c 100755 --- a/accounts.md +++ b/accounts.md @@ -1,5 +1,12 @@ # URL - http://206.225.84.201/general/team_tracker + +# Email +- mail: erp@click-mobile.com +- password: Click@Erp2023 + +app password: sqczcsrtcehpywjv + ## Accounts - charity - char5009 @@ -29,4 +36,16 @@ - flowers500 - effie@click-mobile.com -- fridays@800 \ No newline at end of file +- fridays@800 + +- mansa@click-mobile.com +- evanmyboy + +- william@click-mobile.com +- zimNation900 + +- priscilla@click-mobile.com +- fairfields500 + +- badjinga@click-mobile.com +- tripple400 \ No newline at end of file diff --git a/app/Http/Controllers/ClickAppsController.php b/app/Http/Controllers/ClickAppsController.php index b43ee3d..2c6f88d 100755 --- a/app/Http/Controllers/ClickAppsController.php +++ b/app/Http/Controllers/ClickAppsController.php @@ -62,6 +62,13 @@ class ClickAppsController extends Controller 'clickapp' => $clickapp ])); } + public function getShortCodes(){ + $data = [ + 'page_title' => 'Click Short Codes' + ]; + dd('This feature is not yet ready'); + return view('click_apps.short-codes', $data); + } public function update(Request $request, $id) { diff --git a/app/Http/Controllers/ClientsController.php b/app/Http/Controllers/ClientsController.php index 494dacc..27b2337 100755 --- a/app/Http/Controllers/ClientsController.php +++ b/app/Http/Controllers/ClientsController.php @@ -23,12 +23,13 @@ class ClientsController extends Controller $client_arr = new Models\Client; $client_arr = $client_arr->with('auth_user_info','country_info', 'created_by_info')->orderBy('name', 'ASC')->paginate(10); - + //dd($client_arr); $data = [ 'page_title' => 'Clients', 'client_arr' => $client_arr, 'current_user' => session('current_user') ]; + // dd($data); return view('client.index-tabulator', $data); } public function indexBak(){ @@ -55,6 +56,7 @@ class ClientsController extends Controller ->join('auth_users AS aumngr', 'aumngr.id', '=', 'clients.auth_user_id') ->join('auth_users AS aumodify', 'aumodify.id', '=', 'clients.last_modified_by') ->select('clients.id', 'clients.name', 'clients.status', 'clients.country', 'aumngr.name As accountMgr', 'aumodify.name AS modifiedBy') + ->orderBy('name', 'ASC') ->paginate(15); if($request->has('keyword')){ // != '' @@ -64,6 +66,7 @@ class ClientsController extends Controller ->join('auth_users AS aumodify', 'aumodify.id', '=', 'clients.last_modified_by') ->select('clients.id','clients.name', 'clients.status', 'clients.country', 'aumngr.name As accountMgr', 'aumodify.name AS modifiedBy') ->whereRaw("clients.name like '%$keyword%' or clients.status like '%$keyword%' OR clients.country like '%$keyword%' OR aumngr.name like '%$keyword%' OR aumodify.name like '%$keyword%'") + ->orderBy('name', 'ASC') ->paginate(15); } @@ -140,13 +143,15 @@ class ClientsController extends Controller */ public function create() { - $countries = Models\Country::pluck('en_short_name','alpha_2_code'); - $service_type = Models\Service::pluck('name', 'id'); + $countries = Models\Country::pluck('en_short_name','en_short_name'); + $service_type = Models\Service::pluck('name', 'name'); $payment_type = Models\PaymentType::pluck('name', 'id'); $auth_users = Models\Account::pluck('name', 'id'); $status = ['Live' => 'Live', 'inactive' => 'Inactive', 'Prospective' => 'Prospective']; $currency = Models\Currency::pluck('name','name'); - + $company_types = ['Aggregator/Supplier' => 'Aggregator/Supplier', 'Enterprise' => 'Enterprise', 'Hybrid' => 'Hybrid']; + $industries = Models\Industry::orderBy('name', 'ASC')->pluck('name', 'name'); + // $industries = Models\Industry::pluck('name', 'name')->orderBy('name', 'ASC'); $data = [ 'page_title' => 'Create Client', 'countries' => $countries, @@ -154,7 +159,9 @@ class ClientsController extends Controller 'status' => $status, 'currency' => $currency, 'auth_users' => $auth_users, - 'payment_type' => $payment_type + 'payment_type' => $payment_type, + 'company_types' => $company_types, + 'industries' => $industries ]; return view('client.create', $data); @@ -177,12 +184,10 @@ class ClientsController extends Controller 'status' => 'required', 'payment_mode' => 'required', 'currency' => 'required', + 'company_type' => 'required', + 'industry' => 'required', 'auth_user_id' => 'required', // account manager ]); - - - // dd($request->all()); - //'email' => 'unique:users,email_address' $client_arr = [ 'name' => $request->name, 'email' => $request->email, @@ -194,15 +199,24 @@ class ClientsController extends Controller 'created_by' => session('current_user.id'), 'last_modified_by' => session('current_user.id') ]; - if ($request->notes) { + if ($request->has('notes')) { $client_arr['notes'] = $request->notes; } - if ($request->skype_name) { + if ($request->has('services')) { + $client_arr['services'] = json_encode($request->services); + } + if ($request->has('phone')) { + $client_arr['phone'] = $request->phone; + } + if ($request->has('skype_name')) { $client_arr['skype_name'] = $request->skype_name; } - if ($request->linkedin_name) { + if ($request->has('linkedin_name')) { $client_arr['linkedin_name'] = $request->linkedin_name; } + if ($request->has('contact_person')) { + $client_arr['contact_person'] = $request->contact_person; + } $result = Models\Client::create($client_arr); @@ -216,7 +230,8 @@ class ClientsController extends Controller //TODO send an email to jim/priscilla about new USSD client, #dispatch(new SendNewUssdClientEmail($result)); } - $retval = $this->store_services($request->services, $result->id); + #save services this has been moved to the main client table + //$retval = $this->store_services($request->services, $result->id); Session::flash('success_message', 'Client successfully added'); return redirect(url('clients')); @@ -247,7 +262,7 @@ class ClientsController extends Controller $notes = Models\ClientNote::with('client_info', 'created_by_info')->find($result->id); //todo : send emails - //dispatch(new SendNewNotesEmailAlert($notes)); + dispatch(new SendNewNotesEmailAlert($notes)); if ($result) { $data = ['code' => 1, 'msg' => 'Notes successfully added']; @@ -257,6 +272,129 @@ class ClientsController extends Controller } return response()->json($data, 200); } + public function financeStore(Request $request) + { + $request->validate([ + 'client_id' => 'required', + 'services' => 'required', + 'invoice_number' => 'required', + 'invoice_amount' => 'required', + 'invoice_date' => 'required', + 'invoice_status' => 'required' + ]); + $auth_user = session('current_user'); + + // dd($request->all()); + //'email' => 'unique:users,email_address' + $finance_arr = [ + 'invoice_number' => $request->invoice_number, + 'invoice_amount' => $request->invoice_amount, + 'invoice_date' => $request->invoice_date, + 'invoice_status' => $request->invoice_status, + 'services' => implode(',', $request->services), + 'user_id' => $auth_user['id'], + 'client_id' => $request->client_id + ]; + if ($request->has('remarks')) { + $finance_arr['remarks'] = $request->remarks; + } + + $result = Models\ClientPayment::create($finance_arr); + + #$payments = Models\ClientPayment::with('client_info', 'created_by_info')->find($result->id); + if ($result) { + $data = ['code' => 1, 'msg' => 'Payment Details successfully added']; + } + else{ + $data = ['code' => 3, 'msg' => 'Your request could not be handled at this time']; + } + return response()->json($data, 200); + } + public function shortcodeStore(Request $request) + { + $request->validate([ + 'client_id' => 'required', + 'network' => 'required', + 'shortcode' => 'required', + 'code_type' => 'required', + 'toll_free' => 'required', + 'status' => 'required', + 'remarks' => 'required', + 'launch_date' => 'required' + ]); + $auth_user = session('current_user'); + + $shortcode_arr = [ + 'name' => $request->name, + 'client_id' => $request->client_id, + 'network' => $request->network, + 'shortcode' => $request->shortcode, + 'code_type' => $request->code_type, + 'toll_free' => $request->toll_free, + 'last_updaed_by' => $auth_user['id'], + 'launch_date' => $request->launch_date, + 'status' => $request->status + ]; + if ($request->has('remarks')) { + $shortcode_arr['remarks'] = $request->remarks; + } + + $result = Models\ClientShortCode::create($shortcode_arr); + + if ($result) { + $data = ['code' => 1, 'msg' => 'ShortCode Details successfully added']; + } + else{ + $data = ['code' => 3, 'msg' => 'Your request could not be handled at this time']; + } + return response()->json($data, 200); + } + public function financeUpdate(Request $request) + { + $request->validate([ + 'payment_id' => 'required', + 'client_id' => 'required', + 'services' => 'required', + 'invoice_number' => 'required', + 'invoice_amount' => 'required', + 'invoice_date' => 'required', + 'invoice_status' => 'required' + ]); + $auth_user = session('current_user'); + $payment = Models\ClientPayment::findOrFail($request->payment_id); + + $payment->invoice_number = $request->invoice_number; + $payment->invoice_amount = $request->invoice_amount; + $payment->invoice_date = $request->invoice_date; + $payment->invoice_status = $request->invoice_status; + $payment->services = implode(',', $request->services); + $result = $payment->save(); + + //'email' => 'unique:users,email_address' + /* + $finance_arr = [ + 'invoice_number' => $request->invoice_number, + 'invoice_amount' => $request->invoice_amount, + 'invoice_date' => $request->invoice_date, + 'invoice_status' => $request->invoice_status, + 'services' => implode(',', $request->services), + 'user_id' => $auth_user['id'], + 'client_id' => $request->client_id + ]; + if ($request->has('remarks')) { + $finance_arr['remarks'] = $request->remarks; + } + */ + + #$payments = Models\ClientPayment::with('client_info', 'created_by_info')->find($result->id); + if ($result) { + $data = ['code' => 1, 'msg' => 'Payment Details successfully updated']; + } + else{ + $data = ['code' => 3, 'msg' => 'Your request could not be handled at this time']; + } + return response()->json($data, 200); + } /** * Display the specified resource. @@ -266,15 +404,21 @@ class ClientsController extends Controller */ public function show($id) { - - $showclient = Models\Client::with('service_info', 'country_info', 'auth_user_info')->find($id); + //with('short_code_info')-> + $showclient = Models\Client::with('service_info', 'country_info', 'auth_user_info', 'short_code_info')->find($id); $service_type = Models\Service::pluck('name', 'id'); $service_type_names = Models\Service::pluck('name', 'name'); $show_services = Models\ClientCategory::where('client_id', $id)->get(); + //->where('highlight', 'NO') $show_notes = Models\ClientNote::with('created_by_info', 'client_info')->where('client_id', $id)->orderBy('id', 'DESC')->get()->take(20); + $voice_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'voice')->get(); + $sms_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'sms')->get(); + $ussd_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'ussd')->get(); + $recent_payments = Models\ClientPayment::where('client_id', $id)->orderBy('id', 'DESC')->get(); + $countries = Models\Country::pluck('en_short_name','en_short_name'); + $networks = Models\NetworkOps::pluck('name', 'name'); - if ($showclient->status == 'Live') { $status_bg = "info"; } @@ -284,8 +428,48 @@ class ClientsController extends Controller else{ $status_bg = "danger"; } - - //dd($showclient->sender_ids); + + $renewal_due = 'N/A'; + $highlight_colour = 'none'; + //review this later + if ($showclient->contract_validity == null || $showclient->contract_validity == '') { + $renewal_due = "N/A"; + } + else{ + + + $current_date = date_create(date('Y-m-d')); + + $expiry_date = date_create($showclient->contract_validity); + + $diff = date_diff($current_date, $expiry_date); + + $polar = $diff->format("%R"); + + $months = $diff->format("%m"); + + $days = $diff->format("%a"); + if ($days < 31) { + if ($polar == '-') { + $highlight_colour = 'warning'; + $renewal_due = "Contract expired $days days(s) ago"; + } + else{ + $renewal_due = "In $days day(s)" ; + } + } + else{ + + if ($polar == '-') { + $highlight_colour = 'warning'; + $renewal_due = "Contract expired $months month(s) ago"; + + } + else{ + $renewal_due = "In $months months"; + } + } + } $data = [ 'page_title' => 'Client Profile', 'showclient' => $showclient, @@ -293,9 +477,16 @@ class ClientsController extends Controller 'service_type' => $service_type, 'service_type_names' => $service_type_names, 'show_notes' => $show_notes, - 'status_bg' => $status_bg + 'status_bg' => $status_bg, + 'voice_codes' => $voice_codes, + 'sms_codes' => $sms_codes, + 'ussd_codes' => $ussd_codes, + 'countries' => $countries, + 'networks' => $networks, + 'renewal_due' => $renewal_due, + 'recent_payments' => $recent_payments, + 'highlight_colour' => $highlight_colour ]; - return view('client.show', $data); } public function showservices($id) @@ -311,14 +502,47 @@ class ClientsController extends Controller } public function editservice($id) { - $service = Models\ClientCategory::find($id); - dd($service); + $payment = Models\ClientCategory::find($id); $data = [ 'page_title' => 'Show Services', 'service' => $service ]; return view('client.service-edit', $data); } + public function getPayment($id) + { + $payment = Models\ClientPayment::find($id); + if ($payment) { + $services_arr = explode(',', $payment->services); + + return response()->json([ 'code' => 1, 'result' => $payment, 'services_arr' => $services_arr]); + } + else{ + return response()->json([ 'code' => 3, 'msg' => 'Request could not be handled at this time']); + } + + } + public function getShortCodes(){ + //$auth_users = Models\SystemUser::pluck('name', 'id'); + + $voice_codes = Models\ClientShortCode::with('client_info', 'client_info', 'update_info')->where('code_type', 'voice')->get(); + $sms_codes = Models\ClientShortCode::with('client_info','client_info', 'update_info')->where('code_type', 'sms')->get(); + $ussd_codes = Models\ClientShortCode::with('client_info', 'client_info', 'update_info')->where('code_type', 'ussd')->get(); + //dd($voice_codes); + + // dump($sms_codes[0]->last_updaed_by); + // dd($auth_users[$sms_codes[0]->last_updaed_by]); + + $codes = Models\ClientShortCode::with('update_info')->get(); + + $data = [ + 'page_title' => 'Client Short Codes', + 'voice_codes' => $voice_codes, + 'sms_codes' => $sms_codes, + 'ussd_codes' => $ussd_codes, + ]; + return view('client.shortcodes', $data); + } /** * Show the form for editing the specified resource. * @@ -328,17 +552,75 @@ class ClientsController extends Controller public function edit($id) { $client = Models\Client::find($id); - - $service_type = Models\Service::pluck('name', 'id'); + + $service_type = Models\Service::pluck('name', 'name'); $countries = Models\Country::pluck('en_short_name','en_short_name'); $payment_type = ['Prepaid' => 'Prepaid', 'Postpaid' => 'Postpaid']; // Models\PaymentType::pluck('name', 'id')->toArray(); $status = ['Live' => 'Live', 'inactive' => 'Inactive', 'Prospective' => 'Prospective']; $currency = Models\Currency::pluck('name', 'name'); // - $company_types = ['A2P Supplier' => 'A2P Supplier', 'A2P Consumer' => 'A2P Consumer', 'Hybrid' => 'Hybrid']; + $company_types = ['Aggregator/Supplier' => 'Aggregator/Supplier', 'Enterprise' => 'Enterprise', 'Hybrid' => 'Hybrid']; $auth_users = Models\Account::pluck('name', 'id'); - // dd($client->sender_ids); + $industries = Models\Industry::orderBy('name', 'ASC')->pluck('name', 'name'); + $message_types_arr = ['International' => 'International', 'Local' => 'Local']; + + + + $how_we_got_clients_arr = ['Event : (GCCM) etc' => 'Event : (GCCM) etc', 'Referral' => 'Referral', 'Word of Mouth' => 'Word of Mouth', 'Marketing' => 'Marketing', 'Other' => 'Other']; + + + // 'current_services' => json_decode($client->services, true); + + if ($client->support_emails) { + $support_emails = json_decode($client->support_emails, true); + $support_emails = array_combine($support_emails, $support_emails); + $old_support_emails = json_decode($client->support_emails, true); + } + else{ + $support_emails = []; + $old_support_emails = []; + } + if ($client->rate_emails) { + $rate_emails = json_decode($client->rate_emails, true); + $rate_emails = array_combine($rate_emails, $rate_emails); + $old_rate_emails = json_decode($client->rate_emails, true); + + } + else{ + $rate_emails = []; + $old_rate_emails = []; + } + + if ($client->support_phones) { + $support_phones = json_decode($client->support_phones, true); + $support_phones = array_combine($support_phones, $support_phones); + $old_support_phones = json_decode($client->support_phones, true); + } + else{ + $support_phones = []; + $old_support_phones = []; + } + + if ($client->support_skype) { + $support_skype_arr = json_decode($client->support_skype, true); + $support_skype_arr = array_combine($support_skype_arr, $support_skype_arr); + $old_support_skype_arr = json_decode($client->support_skype, true); + } + else{ + $support_skype_arr = []; + $old_support_skype_arr = []; + } + if ($client->finance_email) { + $finance_emails = json_decode($client->finance_email, true); + $finance_emails = array_combine($finance_emails, $finance_emails); + $old_finance_emails = json_decode($client->finance_email, true); + } + else{ + $finance_emails = []; + $old_finance_emails = []; + } + if ($client->sender_ids) { $sender_ids = json_decode($client->sender_ids, true); $sender_ids = array_combine($sender_ids, $sender_ids); @@ -363,6 +645,7 @@ class ClientsController extends Controller $contract_types = ['bilateral' => 'bilateral', 'unilateral' => 'unilateral']; $connections = ['SMPP' => 'SMPP', 'HTTP' => 'HTTP']; + $data = [ 'client' => $client, 'countries' => $countries, @@ -375,11 +658,27 @@ class ClientsController extends Controller 'connections_arr' => $connections, 'status_bg' => $status_bg, 'sender_ids' => $sender_ids, + + 'finance_emails' => $finance_emails, + 'support_emails' => $support_emails, + 'rate_emails' => $rate_emails, + 'support_skype_arr' => $support_skype_arr, + 'support_phones' => $support_phones, + + 'old_finance_emails' => $old_finance_emails, + 'old_rate_emails' => $old_rate_emails, + 'old_support_emails' => $old_support_emails, + 'old_support_skype_arr' => $old_support_skype_arr, + 'old_support_phones' => $old_support_phones, + 'company_types' => $company_types, 'old_sender_ids' => $old_sender_ids, - 'contract_types' => $contract_types + 'contract_types' => $contract_types, + 'message_types_arr' => $message_types_arr, + 'industries' => $industries, + 'how_we_got_clients_arr' => $how_we_got_clients_arr, + 'current_services' => json_decode($client->services, true) ]; - // dd($service_type->toArray()); return view('client.edit', $data); } @@ -403,9 +702,7 @@ class ClientsController extends Controller ]); $client_update = Models\Client::find($id); - //dump($request->status); - //dump(($request->sender_ids) ? json_encode($request->sender_ids) : ""); - //dd($request->all()); + // dd($request->support_emails); $client_update->name = $request->name; $client_update->email = $request->email; @@ -416,16 +713,38 @@ class ClientsController extends Controller $client_update->country = $request->country; $client_update->currency = $request->currency; $client_update->notes = $request->notes; - $client_update->skype_name = $request->skype_name; - $client_update->linkedin_name = $request->linkedin_name; + $client_update->industry = $request->industry; + + $client_update->skype_name = $request->skype_name ?? ""; + $client_update->linkedin_name = $request->linkedin_name ?? ""; + $client_update->smpp_username = $request->smpp_username ?? ""; $client_update->company_type = $request->company_type ?? ""; $client_update->auth_user_id = $request->auth_user_id ?? ""; $client_update->contract_type = $request->contract_type ?? ""; $client_update->contract_validity = $request->contract_validity ?? ""; - $client_update->smpp_details = $request->smpp_details ?? ""; + $client_update->contract_auto_renew = $request->contract_auto_renew ?? ""; + //$client_update->smpp_details = $request->smpp_details ?? ""; $client_update->sender_ids = ($request->sender_ids) ? json_encode($request->sender_ids) : ""; $client_update->connections = ($request->connections) ? json_encode($request->connections) : ""; + $client_update->services = ($request->services) ? json_encode($request->services) : ""; + $client_update->message_types = ($request->message_types) ? json_encode($request->message_types) : ""; + + $client_update->finance_email = ($request->finance_email) ? json_encode($request->finance_email) : ""; + $client_update->support_emails = ($request->support_emails) ? json_encode($request->support_emails) : ""; + $client_update->rate_emails = ($request->rate_emails) ? json_encode($request->rate_emails) : ""; + $client_update->support_phones = ($request->support_phones) ? json_encode($request->support_phones) : ""; + $client_update->support_skype = ($request->support_skype) ? json_encode($request->support_skype) : ""; + + if ($request->has('how_we_got_client')) { + if ($request->how_we_got_client == 'Other') { + $client_update->how_we_got_client = $request->how_we_got_client_other ?? ""; + } + else{ + $client_update->how_we_got_client = $request->how_we_got_client ?? ""; + } + } + $client_update->created_by = session('current_user.id'); $client_update->last_modified_by = session('current_user.id'); @@ -501,6 +820,7 @@ class ClientsController extends Controller return true; } + public function get_filter_ids($filter, $keyword) { switch ($filter) { diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index d93c4c7..6784a36 100755 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -10,6 +10,7 @@ class DashboardController extends Controller $data = [ 'page_title' => 'Dashboard' ]; + // dd($data); return view('dashboard.index', $data); } } diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 5ab02a9..95edd31 100755 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -32,6 +32,7 @@ class LoginController extends Controller $request->session()->put('current_user.phone', $logged_in->phone); $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')); // return redirect(url('dashboard')); return redirect(url('clients')); } diff --git a/app/Http/Controllers/UtilityController.php b/app/Http/Controllers/UtilityController.php new file mode 100644 index 0000000..59cb797 --- /dev/null +++ b/app/Http/Controllers/UtilityController.php @@ -0,0 +1,31 @@ + 'test client', + 'created_by' => 'Kwesi', + 'services' => 'test services', + 'notes_body' => 'test notes' + ]; + $mailer->send('emails.new-notes', $data, function ($message) use ($data, $emails) { + $message->from('erp@click-mobile.com', 'Click Mobile ERP'); + $message->to($emails)->subject('New Notes'); + }); + } +} diff --git a/app/Models/ClickServer.php b/app/Models/ClickServer.php index 7e1f875..00f3a1d 100755 --- a/app/Models/ClickServer.php +++ b/app/Models/ClickServer.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class ClickServer extends Model { - protected $guarded = array('id'); + protected $guarded = array('id'); public $table = "click_servers"; protected $appends = ['root_password']; diff --git a/app/Models/Client.php b/app/Models/Client.php index 500f839..0364857 100755 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -33,6 +33,9 @@ class Client extends Model public function modified_by_info(){ return $this->hasOne('App\Models\Account', 'id', 'last_modified_by'); } + public function short_code_info(){ + return $this->hasMany('App\Models\ShortCode', 'client_id', 'id'); + } public function getClientServicesAttribute(){ diff --git a/app/Models/ClientPayment.php b/app/Models/ClientPayment.php new file mode 100644 index 0000000..4b26eb8 --- /dev/null +++ b/app/Models/ClientPayment.php @@ -0,0 +1,18 @@ +hasOne('App\Models\Client', 'id', 'client_id'); + } + public function created_by_info(){ + return $this->hasOne('App\Models\Account', 'id', 'auth_user_id'); + } +} diff --git a/app/Models/ClientShortCode.php b/app/Models/ClientShortCode.php new file mode 100644 index 0000000..021f08a --- /dev/null +++ b/app/Models/ClientShortCode.php @@ -0,0 +1,18 @@ +hasOne('App\Models\Client', 'id', 'client_id'); + } + public function update_info(){ + return $this->hasOne('App\Models\SystemUser', 'id', 'last_updated_by'); + } +} diff --git a/app/Models/Industry.php b/app/Models/Industry.php new file mode 100644 index 0000000..7d48025 --- /dev/null +++ b/app/Models/Industry.php @@ -0,0 +1,10 @@ +hasOne('App\Models\Client', 'id', 'client_id'); + } + public function update_info(){ + return $this->hasOne('App\Models\SystemUser', 'id', 'last_updated_by'); + } + public function account_mgr_info(){ + return $this->hasOne('App\Models\SystemUser', 'id', 'account_manager_id'); + } +} diff --git a/app/Models/SystemUser.php b/app/Models/SystemUser.php index 6264db2..1070a06 100755 --- a/app/Models/SystemUser.php +++ b/app/Models/SystemUser.php @@ -8,7 +8,8 @@ class SystemUser extends Model { protected $guarded = array('id'); public $table = "auth_users"; - public function designation_info(){ + + public function designation_info(){ return $this->hasOne('App\Models\Designation', 'id', 'designation'); } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 3581bab..cd874b8 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -16,10 +16,13 @@ class AppServiceProvider extends ServiceProvider $monolog = \Log::getMonolog(); //new --- > xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a //old ---> xoxp-677819906294-675678554016-720956680656-4a6b5d0fcb00e9e0512c14341d3a7563 - $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-720956680656-4a6b5d0fcb00e9e0512c14341d3a7563', '#click_tracker', 'Monolog', true, null, \Monolog\Logger::ERROR); - $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-720956680656-4a6b5d0fcb00e9e0512c14341d3a7563', '#click_tracker', 'Monolog', true, null, \Monolog\Logger::INFO); - $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-720956680656-4a6b5d0fcb00e9e0512c14341d3a7563', '#click_tracker', 'Monolog', true, null, \Monolog\Logger::DEBUG); + /* + $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#click_tracker', 'Monolog', true, null, \Monolog\Logger::ERROR); + $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#click_tracker', 'Monolog', true, null, \Monolog\Logger::INFO); + $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#click_tracker', 'Monolog', true, null, \Monolog\Logger::DEBUG); + $monolog->pushHandler($slackHandler); + */ } /** diff --git a/public/assets/js/clientshow.js b/public/assets/js/clientshow.js new file mode 100644 index 0000000..776593a --- /dev/null +++ b/public/assets/js/clientshow.js @@ -0,0 +1,249 @@ + $(document).ready(function(){ + //console.log('foo bar'); + var d = new Date(); + var month = d.getMonth()+1; + var day = d.getDate(); + var currentDate = d.getFullYear() + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day; + + $('select').select2(); + $('#myDatepicker2').datetimepicker({ + format: 'YYYY-MM-DD', + maxDate: currentDate + }); + $('#launchDate').datetimepicker({ + format: 'YYYY-MM-DD' + }); + $('#createNotesBtn').click(function(evt){ + evt.preventDefault(); + $('#newNotesForm').modal('show'); + }); + + $('#createSmsShortCodeBtn').click(function(evt){ + evt.preventDefault(); + $('#shortCodeType').val('sms'); + $('#newShortCodeFormModal').modal('show'); + }); + $('#createUssdShortCodeBtn').click(function(evt){ + evt.preventDefault(); + $('#shortCodeType').val('ussd'); + $('#newShortCodeFormModal').modal('show'); + }); + + $('#createVoiceShortCodeBtn').click(function(evt){ + evt.preventDefault(); + $('#shortCodeType').val('voice'); + $('#newShortCodeFormModal').modal('show'); + }); + + $('#createPaymentBtn').click(function(evt){ + evt.preventDefault(); + $('#financePaymentsForm').modal('show'); + }); + $('.paymentEntryEditBtn').click(function(tve){ + tve.preventDefault(); + //var theIDD = $("input[name=payment_entry_id]").val(); + var theIDD = $(this).siblings('.paymentEntryRowId').val(); + console.log(theIDD); + + $.ajax({ + type: "GET", + url: base_url + '/clients/get_payment/' + theIDD, + processData: false, + contentType: false, + async: false, + success: function (data){ + if (data.code === 1) { + console.log(theIDD); + $('#paymentIdEdit').val(theIDD); + $('#financeServicesEdit').val(data.services_arr).change(); + $('#invoiceNumberEdit').val(data.result.invoice_number); + $('#invoiceAmountEdit').val(data.result.invoice_amount); + $('#invoiceDateEdit').val(data.result.invoice_date); + $('#invoiceStatusEdit').val(data.result.invoice_status).change(); + $('#remarksEdit').val(data.result.remarks); + $('#financePaymentsEditForm').modal('show'); + } + else if (data.code > 1) { + $.alert({ + title: 'Alert!', + content: data.msg, + }); + } + else { + $.alert({ + title: 'Alert!', + content: 'Your request could not be handled. Try again !', + }); + + } + } + }); + + + + }); + + $('#newNotesFormForm').submit(function(evt){ + evt.preventDefault(); + var formData = new FormData($(this)[0]); + $.ajax({ + type: "POST", + url: base_url + '/clients/notes_store', + data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + if (data.code === 1) { + $("#newNotesFormForm")[0].reset(); + $.alert({ + title: 'Alert!', + content: 'Notes added successfully', + }); + setTimeout(function(){ + location.reload(); + }, 8000); + } + else if (data.code > 5) { + $.alert({ + title: 'Alert!', + content: data.msg, + }); + } + else { + $.alert({ + title: 'Alert!', + content: 'Your request could not be handled. Try again !', + }); + + } + } + }); + }); + $('#financeForm').submit(function(evt){ + evt.preventDefault(); + var formData = new FormData($(this)[0]); + $.ajax({ + type: "POST", + url: base_url + '/clients/finance_store', + data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + if (data.code === 1) { + $("#financeForm")[0].reset(); + $.alert({ + title: 'Alert!', + content: 'Payment Details added successfully', + }); + setTimeout(function(){ + location.reload(); + }, 8000); + } + else if (data.code > 5) { + $.alert({ + title: 'Alert!', + content: data.msg, + }); + } + else { + $.alert({ + title: 'Alert!', + content: 'Your request could not be handled. Try again !', + }); + + } + } + }); + }); + + $('#financeEditForm').submit(function(evt){ + evt.preventDefault(); + var formData = new FormData($(this)[0]); + $.ajax({ + type: "POST", + url: base_url + '/clients/finance_update', + data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + if (data.code === 1) { + $.alert({ + title: 'Alert!', + content: 'Payment Details successfully updated', + }); + 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 !', + }); + + } + } + }); + }); + + $('#shortCodeForm').submit(function(evt){ + evt.preventDefault(); + var formData = new FormData($(this)[0]); + $.ajax({ + type: "POST", + url: base_url + '/clients/shortcode_store', + data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + if (data.code === 1) { + $.alert({ + title: 'Alert!', + content: 'Short code details 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); + $('#notifyArea').removeClass('hidden'); + $.each(output.errors, function (key, value) { + console.log(value[0]); + $('#notifyArea').text(value[0]); + }); + }, + fail : function(errordata){ + console.log(errordata); + } + }); + }); + + // + + }); \ No newline at end of file diff --git a/requirements.md b/requirements.md index 552c4f1..d4eb5dc 100755 --- a/requirements.md +++ b/requirements.md @@ -27,4 +27,17 @@ The Account Manager ## Code Flow - client-updates-temp-folder -- \ No newline at end of file +- + +# Fanny's Feedback - After uploading a few clients I had some observations. +- Contact details: Suggestion to add a finance, rates and support email details +- Connection details: we usually have 2 or more SMPP details could it have an option of inputting several items like the services tab +- For Finance rates and Support we may need full contact details: E-mail address, skype, phone + +# ON the client list can we add how we got client? + use normal select, on select of Event ask for details + Event : (GCCM) etc + Referral + Word of Mouth + Marketing + diff --git a/resources/views/click_apps/short-codes.blade.php b/resources/views/click_apps/short-codes.blade.php new file mode 100644 index 0000000..cfc1938 --- /dev/null +++ b/resources/views/click_apps/short-codes.blade.php @@ -0,0 +1,175 @@ +@extends('layouts.master') +@section('page_title') +@if(isset($page_title)) +{{ $page_title }} +@endif +@endsection + +@section('content') +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+
+
+ @include('commons.notifications') +
+
+
+

Click Apps

+ +
+
+ +
+ +
+ + + + {{-- --}} + + + + + + + + + + + + + + + + + @if ($click_apps->isEmpty()) + + + + @else + @foreach ($click_apps as $row) + + + + + + + + + + + + + + + @endforeach + @endif + +
#App NameTypeCode/URLCountryOperatorTFreeClientStatusLaunch DateOther InfoAction + + Bulk Actions ( ) +
No Records found
{{ $row->app_name }}{{ $row->app_type }}{{ $row->code }}{{ $row->country }}{{ $row->operator }}{{ $row->tollfree }}{{ $row->client }}{{ $row->status }}{{ $row->launch_date }}{{ $row->other_info }} + + + + +
+
+
+
+
+
+
+ +@endsection + + + +@section('javascript') + + + +@endsection \ No newline at end of file diff --git a/resources/views/client/create.blade.php b/resources/views/client/create.blade.php index d02fa65..40fb359 100755 --- a/resources/views/client/create.blade.php +++ b/resources/views/client/create.blade.php @@ -37,6 +37,20 @@ {!! $errors->first('name', '

:message

') !!} +
+ +
+ {!! Form::select('company_type', $company_types, old('company_type'), ['class' => 'form-control', 'placeholder'=>'Enter Company Type' , 'id' => 'companyType', 'required' => 'true']) !!} + {!! $errors->first('company_type', '

:message

') !!} +
+
+
+ +
+ {!! Form::select('industry', $industries, old('industry'), ['class' => 'form-control', 'placeholder'=>'Enter Industry Type' , 'id' => 'industryType', 'required' => 'true']) !!} + {!! $errors->first('industry', '

:message

') !!} +
+
@@ -127,7 +141,7 @@
- +
{!! Form::close() !!} diff --git a/resources/views/client/edit.blade.php b/resources/views/client/edit.blade.php index 277c034..1a1ccda 100755 --- a/resources/views/client/edit.blade.php +++ b/resources/views/client/edit.blade.php @@ -10,7 +10,8 @@
@@ -40,8 +41,15 @@ {!! $errors->first('name', '

:message

') !!}
+
+
+ + {!! Form::select('auth_user_id', $auth_users ,old('auth_user_id'), ['class' => 'form-control ', 'placeholder'=>'Enter Account Manager ' , 'id' => 'auth_user_id']) !!} + {!! $errors->first('auth_user_id', '

:message

') !!} +
+
-
+
{!! Form::text('contact_person', old('contact_person'), ['class' => 'form-control', 'placeholder'=>'Enter Contact Person' , 'id' => 'contact_person']) !!} {!! $errors->first('contact_person', '

:message

') !!} @@ -56,26 +64,48 @@
-
+
{!! Form::text('email', old('email'), ['class' => 'form-control ', 'placeholder'=>'Enter email' , 'id' => 'email']) !!} {!! $errors->first('email', '

:message

') !!}
-
+
-
+
{!! Form::text('skype_name', old('skype_name'), ['class' => 'form-control', 'placeholder'=>'Enter Skype Name' , 'id' => 'skypeName']) !!} {!! $errors->first('skype_name', '

:message

') !!}
-
+
{!! Form::text('linkedin_name', old('linkedin_name'), ['class' => 'form-control ', 'placeholder'=>'Enter LinkedIn Name' , 'id' => 'linkedIn']) !!} {!! $errors->first('linkedin_name', '

:message

') !!}
+
+
+ + {!! Form::select('finance_email[]', $finance_emails, $old_finance_emails, ['class' => 'form-control financeEmail', 'id' => 'financeEmail', 'multiple' => 'true']) !!} + {!! $errors->first('finance_email', '

:message

') !!} +
+
+
+
+ + {!! Form::select('support_emails[]', $support_emails, $old_support_emails, ['class' => 'form-control supportEmail', 'id' => 'supportEmail', 'multiple' => 'true']) !!} + {!! $errors->first('support_emails', '

:message

') !!} +
+
+ +
+
+ + {!! Form::select('support_phones[]', $support_phones, $old_support_phones, ['class' => 'form-control supportPhones', 'id' => 'supportPhones', 'multiple' => 'true']) !!} + {!! $errors->first('support_phones', '

:message

') !!} +
+
@@ -90,31 +120,29 @@ {!! $errors->first('currency', '

:message

') !!}
- -
-
-
-
- - {!! Form::select('auth_user_id', $auth_users ,old('auth_user_id'), ['class' => 'form-control ', 'placeholder'=>'Enter Account Manager ' , 'id' => 'auth_user_id']) !!} - {!! $errors->first('auth_user_id', '

:message

') !!} -
-
+
- {!! Form::select('services[]', $service_type, ['1' => 'A2P', '2' => 'USSD'], ['class' => 'form-control typeServices' , 'id' => 'services', 'multiple'=> 'true']) !!} + {!! Form::select('services[]', $service_type, $current_services, ['class' => 'form-control typeServices' , 'id' => 'services', 'multiple'=> 'true']) !!} {!! $errors->first('services', '

:message

') !!}
-
- - {!! Form::select('company_type', $company_types, old('company_type'), ['class' => 'form-control', 'placeholder'=>'Enter Company Type' , 'id' => 'companyType']) !!} - {!! $errors->first('company_type', '

:message

') !!} +
+ + {!! Form::select('company_type', $company_types, old('company_type'), ['class' => 'form-control', 'placeholder'=>'Enter Company Type' , 'id' => 'companyType']) !!} + {!! $errors->first('company_type', '

:message

') !!} +
+
+
+
+ + {!! Form::select('industry', $industries, old('industry'), ['class' => 'form-control', 'placeholder'=>'Enter Industry Type' , 'id' => 'industryType', 'required' => 'true']) !!} + {!! $errors->first('industry', '

:message

') !!} +
-
@@ -123,26 +151,55 @@
- +
- {!! Form::number('contract_validity', old('contract_validity'), ['class' => 'form-control', 'placeholder'=>'Enter Contract Validity Period' , 'id' => 'contractValidity']) !!} + {!! Form::text('contract_validity', old('contract_validity'), ['class' => 'form-control', 'placeholder'=>'Enter Contract Date' , 'id' => 'contractValidity']) !!} {!! $errors->first('contract_validity', '

:message

') !!}
+
+
+ + {!! Form::select('contract_auto_renew', ['YES' => 'YES','NO' => 'NO'], old('contract_auto_renew'), ['class' => 'form-control ' , 'id' => 'contractAutoRenew' ]) !!} + {!! $errors->first('contract_auto_renew', '

:message

') !!} +
+
- {!! Form::select('connections[]', $connections_arr, json_decode($client->connections, true), ['class' => 'form-control ' , 'id' => 'connections', 'placeholder'=> 'Select Connection Type', 'multiple' => 'true' ]) !!} + {!! Form::select('connections[]', $connections_arr, json_decode($client->connections, true), ['class' => 'form-control ' , 'id' => 'connections', 'multiple' => 'true' ]) !!} {!! $errors->first('connections', '

:message

') !!}
-
- - {!! Form::textarea('smpp_details', old('smpp_details'), ['class' => 'form-control' , 'id' => 'smppDetails', 'placeholder' => 'SMPP Details in JSON Format here', 'rows' => '4']) !!} - {!! $errors->first('smpp_details', '

:message

') !!} +
+ + {!! Form::select('message_types[]', $message_types_arr, json_decode($client->message_types, true), ['class' => 'form-control ' , 'id' => 'connections', 'multiple' => 'true' ]) !!} + {!! $errors->first('connections', '

:message

') !!}
+
+
+ + {!! Form::text('smpp_username', old('smpp_username'), ['class' => 'form-control' , 'id' => 'smppUsername', 'placeholder' => 'SMPP Username']) !!} + {!! $errors->first('smpp_username', '

:message

') !!} +
+
+
+
+ + {!! Form::select('support_skype[]', $support_skype_arr, $old_support_skype_arr, ['class' => 'form-control supportSkype', 'id' => 'supportSkype', 'multiple' => 'true']) !!} + {!! $errors->first('support_skype', '

:message

') !!} +
+
+
+
+ + {!! Form::select('rate_emails[]', $rate_emails, $old_rate_emails, ['class' => 'form-control rateEmail', 'id' => 'rateEmail', 'multiple' => 'true']) !!} + {!! $errors->first('rate_emails', '

:message

') !!} +
+
+
@@ -153,12 +210,26 @@
-
+
{!! Form::select('sender_ids[]', $sender_ids, $old_sender_ids, ['class' => 'form-control senderIds' , 'id' => 'senderIds', 'multiple' => 'true' ]) !!} {!! $errors->first('sender_ids', '

:message

') !!}
+
+
+ + {!! Form::select('how_we_got_client', $how_we_got_clients_arr, old('how_we_got_client'), ['class' => 'form-control' , 'id' => 'howWeGotClient' ]) !!} + {!! $errors->first('how_we_got_client', '

:message

') !!} +
+
+
+
+ + {!! Form::text('how_we_got_client_other', null, ['class' => 'form-control' , 'id' => 'howWeGotClientOther', 'placeholder' => 'Specify how we got the client']) !!} + {!! $errors->first('how_we_got_client_other', '

:message

') !!} +
+
@@ -167,7 +238,6 @@
-

@@ -183,8 +253,7 @@ status == 'Inactive') ? "checked" : ""; ?> />

-
- +
@@ -216,6 +285,24 @@ $('.senderIds').select2({ tags : true }); + $('.supportEmail').select2({ + tags : true + }); + $('.supportPhones').select2({ + tags : true + }); + $('.supportSkype').select2({ + tags : true + }); + $('.rateEmail').select2({ + tags : true + }); + $('.financeEmail').select2({ + tags : true + }); + $('#contractValidity').datetimepicker({ + format: 'YYYY-MM-DD' + }); // // }); diff --git a/resources/views/client/partials/client-sms-codes.blade.php b/resources/views/client/partials/client-sms-codes.blade.php new file mode 100644 index 0000000..802c531 --- /dev/null +++ b/resources/views/client/partials/client-sms-codes.blade.php @@ -0,0 +1,48 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + + + @if ($sms_codes->isEmpty()) + + + + @else + @foreach ($sms_codes as $row) + + + + + + + + + + + + @endforeach + @endif + +
#NameCodeNetwork/CountryClientToll FreeStatusLaunch DateLast Updated ByAction +
No Records found
{{ $row->name }}{{ $row->shortcode }}{{ $row->network }}{{ $row->client_info->name }}{{ $row->toll_free }}{{ $row->status }}{{ $row->launch_date }}update_info->name ?? 'N/A'; ?> + + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/partials/client-ussd-codes.blade.php b/resources/views/client/partials/client-ussd-codes.blade.php new file mode 100644 index 0000000..cd8e389 --- /dev/null +++ b/resources/views/client/partials/client-ussd-codes.blade.php @@ -0,0 +1,48 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + + + @if ($ussd_codes->isEmpty()) + + + + @else + @foreach ($ussd_codes as $row) + + + + + + + + + + + + @endforeach + @endif + +
#NameCodeNetwork/CountryClientToll FreeStatusLaunch DateLast Updated ByAction +
No Records found
{{ $row->name }}{{ $row->shortcode }}{{ $row->network }}{{ $row->client_info->name }}{{ $row->toll_free }}{{ $row->status }}{{ $row->launch_date }}update_info->name ?? 'N/A'; ?> + + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/partials/client-voice-codes.blade.php b/resources/views/client/partials/client-voice-codes.blade.php new file mode 100644 index 0000000..694dc57 --- /dev/null +++ b/resources/views/client/partials/client-voice-codes.blade.php @@ -0,0 +1,49 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + + + + @if ($voice_codes->isEmpty()) + + + + @else + @foreach ($voice_codes as $row) + + + + + + + + + + + + @endforeach + @endif + +
#NameCodeNetwork/CountryClientToll FreeStatusLaunch DateAccount ManagerLast Updated ByAction +
No Records found
{{ $row->name }}{{ $row->shortcode }}{{ $row->network }}{{ $row->client_info->name }}{{ $row->toll_free }}{{ $row->status }}{{ $row->launch_date }}update_info->name ?? 'N/A'; ?> + + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/partials/create-shortcodes.blade.php b/resources/views/client/partials/create-shortcodes.blade.php new file mode 100644 index 0000000..adadf65 --- /dev/null +++ b/resources/views/client/partials/create-shortcodes.blade.php @@ -0,0 +1,97 @@ + + diff --git a/resources/views/client/partials/edit-finance.blade.php b/resources/views/client/partials/edit-finance.blade.php new file mode 100644 index 0000000..ad3bce1 --- /dev/null +++ b/resources/views/client/partials/edit-finance.blade.php @@ -0,0 +1,80 @@ + + diff --git a/resources/views/client/partials/finance.blade.php b/resources/views/client/partials/finance.blade.php new file mode 100644 index 0000000..ceb2551 --- /dev/null +++ b/resources/views/client/partials/finance.blade.php @@ -0,0 +1,102 @@ + + diff --git a/resources/views/client/partials/new_notes.blade.php b/resources/views/client/partials/new_notes.blade.php new file mode 100644 index 0000000..b0bf456 --- /dev/null +++ b/resources/views/client/partials/new_notes.blade.php @@ -0,0 +1,63 @@ + + diff --git a/resources/views/client/partials/recent-payments.blade.php b/resources/views/client/partials/recent-payments.blade.php new file mode 100644 index 0000000..3298e0a --- /dev/null +++ b/resources/views/client/partials/recent-payments.blade.php @@ -0,0 +1,44 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + @if ($recent_payments->isEmpty()) + + + + @else + @foreach ($recent_payments as $row) + + + + + + + + + + @endforeach + @endif + +
#Invoice NumberInvoice AmountInvoice DateServicesRemarksStatusAction +
No Records found
{{ $row->invoice_number }}{{ $row->invoice_amount }}{{ date('d-m-Y', strtotime($row->invoice_date)) }}{{ $row->services }} {{ $row->remarks }} {{ $row->invoice_status }} + + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/partials/sms-codes.blade.php b/resources/views/client/partials/sms-codes.blade.php new file mode 100644 index 0000000..52972e1 --- /dev/null +++ b/resources/views/client/partials/sms-codes.blade.php @@ -0,0 +1,45 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + + @if ($sms_codes->isEmpty()) + + + + @else + @foreach ($sms_codes as $row) + + + + + + + + + + + @endforeach + @endif + +
#NameCodeNetworkToll FreeStatusRemarksLaunch DateAction +
No Records found
{{ $row->name }}{{ $row->shortcode }}{{ $row->network }}{{ $row->toll_free }}{{ $row->status }}{{ $row->remarks }}{{ date('d-m-Y', strtotime($row->launch_date)) }} + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/partials/ussd-codes.blade.php b/resources/views/client/partials/ussd-codes.blade.php new file mode 100644 index 0000000..12aa505 --- /dev/null +++ b/resources/views/client/partials/ussd-codes.blade.php @@ -0,0 +1,46 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + + @if ($ussd_codes->isEmpty()) + + + + @else + @foreach ($ussd_codes as $row) + + + + + + + + + + + @endforeach + @endif + +
#NameCodeNetwork/CountryToll FreeStatusRemarksLaunch DateAction +
No Records found
{{ $row->name }}{{ $row->shortcode }}{{ $row->network }}{{ $row->toll_free }}{{ $row->status }}{{ $row->remarks }}{{ date('d-m-Y', strtotime($row->launch_date)) }} + + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/partials/voice-codes.blade.php b/resources/views/client/partials/voice-codes.blade.php new file mode 100644 index 0000000..d9d6e61 --- /dev/null +++ b/resources/views/client/partials/voice-codes.blade.php @@ -0,0 +1,45 @@ +
+
+ + + + {{-- --}} + + + + + + + + + + + + @if ($voice_codes->isEmpty()) + + + + @else + @foreach ($voice_codes as $row) + + + + + + + + + + + @endforeach + @endif + +
#NameCodeNetwork/CountryToll FreeStatusLaunch DateAction +
No Records found
{{ $row->name }}{{ $row->shortcode }}{{ $row->network }}{{ $row->toll_free }}{{ $row->status }}{{ $row->remarks }}{{ date('d-m-Y', strtotime($row->launch_date)) }} + + + + +
+
+
\ No newline at end of file diff --git a/resources/views/client/shortcodes.blade.php b/resources/views/client/shortcodes.blade.php new file mode 100644 index 0000000..e955d69 --- /dev/null +++ b/resources/views/client/shortcodes.blade.php @@ -0,0 +1,88 @@ +@extends('layouts.master') + @section('page_title') + @if(isset($page_title)) + {{ $page_title }} + @endif + @endsection + +@section('content') +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+
+ @include('commons.notifications') +
+
+
+

Client Short Codes

+
+ +
+
+
+ +
+
+
+ +
+ +
+

SMS Short Code

+ @include('client.partials.client-sms-codes') +
+
+

USSD Short Codes

+ @include('client.partials.client-ussd-codes') +
+
+

Voice Short Code

+ @include('client.partials.client-voice-codes') +
+
+
+
+
+
+
+
+
+ +@endsection + +@section('javascript') + + + +@endsection diff --git a/resources/views/client/show.blade.php b/resources/views/client/show.blade.php index 0468be6..9b94e33 100755 --- a/resources/views/client/show.blade.php +++ b/resources/views/client/show.blade.php @@ -6,7 +6,10 @@ @endsection @section('content') -@include('client.new_notes') +@include('client.partials.new_notes') +@include('client.partials.finance') +@include('client.partials.create-shortcodes') +@include('client.partials.edit-finance')
@@ -83,28 +86,143 @@
-
+
+
+ +

Company Details

-

Country : {{ $showclient->country or "N/A" }}

-

Company Type : {{ $showclient->company_type or "N/A" }}

- - - - -

Requested Sender IDs : sender_ids) { echo implode(", ", json_decode($showclient->sender_ids, true)); } else {echo "N/A"; } ?>

-
+

Country : {{ $showclient->country or "N/A" }}

+

Company Type : {{ $showclient->company_type or "N/A" }}

+ + + + +

Requested Sender IDs : sender_ids) { echo implode(", ", json_decode($showclient->sender_ids, true)); } else {echo "N/A"; } ?>

+ + +

Connection Details

+
+

Connection Types : connections) { echo implode(", ", json_decode($showclient->connections, true)); } else {echo "N/A"; } ?>

+

SMPP Username : + smpp_username) { echo $showclient->smpp_username; } else {echo "N/A"; } ?>

+

Message Types : + message_types) { + $types_array = json_decode($showclient->message_types); + echo implode(', ', $types_array); + } + else { + echo "N/A"; + } ?> + +

+
+
+
+ +

Support Phone(s)

+ @if($showclient->support_phones !== null) +
+ support_phones, true) ?> +
    + + +
  • {{ $row }}
  • + + +
+
+ @else + N/A + @endif +

Support Email(s)

+ @if($showclient->support_emails !== null) +
+ support_emails, true) ?> +
    + + +
  • {{ $row }}
  • + + +
+
+ @else + N/A + @endif + @if($showclient->rate_emails !== null) +

Rates Email(s)

+
+ rate_emails, true) ?> +
    + + +
  • {{ $row }}
  • + + +
+
+ @else + N/A + @endif +

Finance Email(s)

+ @if($showclient->finance_emails !== null) +
+ finance_emails, true) ?> +
    + + +
  • {{ $row }}
  • + + +
+
+ @else + N/A + @endif + +
+
+

Support Skype ID(s)

+ @if($showclient->support_skype !== null) +
+ support_skype, true) ?> +
    + + +
  • {{ $row }}
  • + + +
+
+ @else + N/A + @endif +
+

How We Got This Client

+ how_we_got_client ?? "N/A" ?> +
+
+
-
+

Connection Details

@@ -112,32 +230,32 @@

Partner SMPP Details
- smpp_details) { echo $showclient->smpp_details; } else {echo "N/A"; } ?>

+ smpp_details) { echo $showclient->smpp_details; } else {echo "N/A"; } ?>

-
+

Contract Details

Contract Type : {{ ucfirst($showclient->contract_type) ?? 'N/A'}}

-

Contract Validity (years) : {{ $showclient->contract_validity or 'N/A'}}

+

Contract Validity (Date) : {{ $showclient->contract_validity or 'N/A'}}

+

Contract Auto Renewal : {{ $showclient->contract_auto_renew or 'N/A'}}

+

Renewal Due : {{ $renewal_due }}

-
+

Finance Details

-
-

Last Invoice Sent : "N/A"


- - -

Payment Status : N/A

-
+ +
+
+ @include('client.partials.recent-payments')
-
+

Notes

- +
@@ -169,6 +287,24 @@
+
+

SMS Short Code

+ +
+ @include('client.partials.sms-codes') +
+
+

USSD Short Codes

+ +
+ @include('client.partials.ussd-codes') +
+
+

Voice Short Code

+ +
+ @include('client.partials.voice-codes') +
@@ -180,55 +316,5 @@
@endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/dashboard/index.blade.php b/resources/views/dashboard/index.blade.php index 2621243..9932da8 100755 --- a/resources/views/dashboard/index.blade.php +++ b/resources/views/dashboard/index.blade.php @@ -44,7 +44,7 @@
- Add content to the page ... + Page Design Not ready
diff --git a/resources/views/emails/new-notes.blade.php b/resources/views/emails/new-notes.blade.php index dad3aa1..2642a43 100644 --- a/resources/views/emails/new-notes.blade.php +++ b/resources/views/emails/new-notes.blade.php @@ -7,17 +7,21 @@
Click Mobile Banner Logo
-

New Notes Alert

- {{ date('F d, Y') }}
+

{{ date('F d, Y') }} New Notes Alert

+ Hello Sam,

- {{ $created_by }} has added a new note entry to the client details of {{ $client }}. + {{ $created_by }} has added a new note entry to the client details of {{ $client }} .

+ +
+
Notes Details -

{{ $notes_body }}

+
+ {{ $notes_body }}

Sincerely,
diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index d5c58e1..881c9c9 100755 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -19,7 +19,11 @@ - + + + + + @@ -107,6 +111,10 @@ + + + + @@ -114,6 +122,9 @@ + + +