diff --git a/3 b/3 new file mode 100644 index 0000000..b7f89a4 --- /dev/null +++ b/3 @@ -0,0 +1,3 @@ +[] +[] +[] diff --git a/I Paid Almost NOTHING For This PC... But What IS It? [3CDVOTeF_hw].mp4 b/I Paid Almost NOTHING For This PC... But What IS It? [3CDVOTeF_hw].mp4 deleted file mode 100644 index b53fc48..0000000 Binary files a/I Paid Almost NOTHING For This PC... But What IS It? [3CDVOTeF_hw].mp4 and /dev/null differ diff --git a/accounts.md b/accounts.md index ce43f65..27e3db0 100755 --- a/accounts.md +++ b/accounts.md @@ -1,4 +1,4 @@ -# URL +F# URL - http://206.225.84.201/general/team_tracker # Email @@ -55,3 +55,7 @@ app password: sqczcsrtcehpywjv - daniel - theCitadel@111 + + +- andrew +- blacktone@900 \ No newline at end of file diff --git a/app/Http/Controllers/ClientsController.php b/app/Http/Controllers/ClientsController.php index 8785389..1b7df86 100755 --- a/app/Http/Controllers/ClientsController.php +++ b/app/Http/Controllers/ClientsController.php @@ -30,6 +30,14 @@ class ClientsController extends Controller ]; return view('client.index-tabulator', $data); } + public function indexInactive(){ + $data = [ + 'page_title' => 'Inactive Clients', + 'current_user' => session('current_user') + ]; + // dd('foo bar'); + return view('client.index-inactive', $data); + } public function indexBak(){ $client_arr = new Models\Client; $client_arr = $client_arr->with('auth_user_info','country_info', 'created_by_info')->orderBy('name', 'ASC')->paginate(10); @@ -73,6 +81,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') + ->paginate(10); if($request->has('keyword')){ @@ -87,6 +96,56 @@ class ClientsController extends Controller return response()->json($client_arr); } + public function getInactiveClientJson(Request $request){ + + $client_arr = \DB::table('clients') + ->join('auth_users AS aumngr', 'aumngr.id', '=', 'clients.auth_user_id') + ->join('auth_users AS aumodify', 'aumodify.id', '=', 'clients.last_modified_by') + ->join('flags AS flags', 'flags.country', '=', 'clients.country') + ->select('clients.id', 'clients.name', 'clients.status','clients.progress_indicator_score', 'clients.country', 'aumngr.name As accountMgr', 'aumodify.name AS modifiedBy', 'flags.url AS theflag') + ->whereRaw("status = 'inactive'") + ->orderBy('name', 'ASC') + ->get(); + // ->paginate(15); + + if($request->has('keyword')){ + $keyword = $request->keyword; + $client_arr = \DB::table('clients') + ->join('auth_users AS aumngr', 'aumngr.id', '=', 'clients.auth_user_id') + ->join('auth_users AS aumodify', 'aumodify.id', '=', 'clients.last_modified_by') + ->join('flags AS flags', 'flags.country', '=', 'clients.country') + ->select('clients.id','clients.name', 'clients.status', 'clients.progress_indicator_score','clients.country', 'aumngr.name As accountMgr', 'aumodify.name AS modifiedBy', 'flags.url AS theflag') + ->whereRaw("status = 'inactive'") + ->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%' OR clients.progress_indicator_score like '%$keyword%'") + ->orderBy('name', 'ASC') + ->get(); + // ->paginate(15); + } + + return response()->json($client_arr); + } + public function getInacticeClientJsonRawJs(Request $request){ + $client_arr = \DB::table('clients') + ->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') + ->whereRaw("status = 'inactive'") + ->paginate(10); + + if($request->has('keyword')){ + $keyword = $request->keyword; + $client_arr = \DB::table('clients') + ->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') + // ->where('status', 'inactive') + ->whereRaw("status = 'inactive'") + ->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%'") + ->paginate(10); + } + return response()->json($client_arr); + } + /** * Show the form for creating a new resource. @@ -99,7 +158,7 @@ class ClientsController extends Controller $service_type = Models\Service::pluck('name', 'name'); $payment_type = ['Prepaid' => 'Prepaid', 'Postpaid' => 'Postpaid']; //Models\PaymentType::pluck('name', 'id'); $auth_users = Models\SystemUser::pluck('name', 'id'); - $status = ['Live' => 'Live', 'inactive' => 'Inactive', 'Prospective' => 'Prospective']; + $status = ['Live' => 'Live', 'inactive' => 'Inactive', 'Prospective' => 'Prospective', 'Cancelled' => 'Cancelled']; $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'); @@ -669,6 +728,7 @@ class ClientsController extends Controller 'Telkom Kenya' => 'Telkom Kenya', 'Orange Kenya' => 'Orange Kenya' ]; + // dd($networks_raw); //->where('highlight', 'NO') $show_notes = Models\ClientNote::with('created_by_info', 'client_info')->where('client_id', $id)->orderBy('created_at', 'DESC')->get()->take(20); $show_notes_highlight = Models\ClientNote::with('created_by_info', 'client_info')->where('client_id', $id)->where('highlight', 'YES')->orderBy('created_at', 'DESC')->get()->take(1); @@ -684,7 +744,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(); + //$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"; @@ -695,7 +755,7 @@ class ClientsController extends Controller else{ $status_bg = "danger"; } - + // dd($showclient->progress_indicator_score); if ($showclient->progress_indicator_score >= 70) { $progress_status_bg = "success"; } @@ -705,7 +765,7 @@ class ClientsController extends Controller else{ $progress_status_bg = "danger"; } - + // dump($progress_status_bg); $renewal_due = 'N/A'; $highlight_colour = 'none'; @@ -777,8 +837,8 @@ class ClientsController extends Controller 'showdocuments' => $showdocuments, 'support_fees' => $support_fees, 'recurring_arr' => $recurring_arr, - 'client_sender_ids' => $client_sender_ids, - 'sender_id_statuses' => $sender_id_statuses, + // 'client_sender_ids' => $client_sender_ids, + // 'sender_id_statuses' => $sender_id_statuses, 'country_network_arr' => $country_networks, 'mnos_arr' => ['' => '-- Select Country first --'] ]; @@ -787,8 +847,8 @@ class ClientsController extends Controller // dd($value->network_info->name); // } // dd($data); - // return view('client.show_original_copy', $data); - return view('client.show_test', $data); + // return view('client.show', $data); + return view('client.show_accordion', $data); } public function showReadonly($id){ @@ -958,7 +1018,8 @@ class ClientsController extends Controller $countries = Models\Country::orderBy('en_short_name', 'ASC')->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']; + // $status = ['Live' => 'Live', 'inactive' => 'Inactive', 'Prospective' => 'Prospective']; + $status = ['Live' => 'Live', 'inactive' => 'Inactive', 'Prospective' => 'Prospective', 'Cancelled' => 'Cancelled']; $currency = Models\Currency::orderBy('name', 'ASC')->pluck('name', 'name'); $existing_documents = Models\ClientFile::where('client_id', $id)->get(); $files = [ @@ -996,7 +1057,7 @@ class ClientsController extends Controller if ($client->progress_indicator !== "COMPLETED") { $stage_details = Models\ClientOnboardingMainStage::where('stage', $client->progress_indicator)->first(); // dump($stage_details); - $onboarding_sub_items_progress = Models\ClientOnboardingProgress::where('stage_id', $stage_details->stage_id)->where('client_id', $id)->pluck('name', 'name'); + $onboarding_sub_items_progress = Models\ClientOnboardingProgress::where('stage_id', $stage_details->stage_id)->where('client_id', $id)->where('status', 'COMPLETED')->pluck('name', 'name'); // dd($onboarding_sub_items_progress); $onboarding_sub_items = Models\ClientOnboardingSubItem::where('stage_id', $stage_details->stage_id)->pluck('name', 'name'); } @@ -1125,6 +1186,7 @@ class ClientsController extends Controller 'has_pending' => $has_pending, 'files' => $files ]; + // dd($data['onboarding_sub_items_progress']); return view('client.edit', $data); } @@ -1145,7 +1207,11 @@ class ClientsController extends Controller $get_stage_subs_items = Models\ClientOnboardingSubItem::where('stage_id', $current_pending_stage_details->stage_id)->get(); #update the table for onboarding progress foreach ($request->onboarding_sub_items_progress as $value) { - $stage_id = ['stage_id' => $current_pending_stage_details->stage_id, 'client_id' => $id, 'name' => $value ]; + $stage_id = [ + 'stage_id' => $current_pending_stage_details->stage_id, + 'client_id' => $id, + 'name' => $value + ]; $progress_arr = [ 'status' => 'COMPLETED' ]; @@ -1154,10 +1220,7 @@ class ClientsController extends Controller //update the status of onboarding progress stage in clients $get_stage_onboarding_status = Models\ClientOnboardingProgress::where('client_id', $id)->where('stage_id', $current_pending_stage_details->stage_id)->where('status', 'COMPLETED')->get(); - // dd($get_stage_onboarding_status); $onboarding_progress_stage = json_decode($client_update->onboarding_progress_stage, true); - - // dd(count($get_stage_subs_items) == count($get_stage_onboarding_status)); if (count($get_stage_subs_items) == count($get_stage_onboarding_status)) { //check if all items have been completed and update $onboarding_progress_stage[$current_pending_stage_details->stage] = 'COMPLETED'; @@ -1169,7 +1232,6 @@ class ClientsController extends Controller #$pending_stage = array_key_first($pending_stage); reset($pending_stage); $pending_stage = key($pending_stage); - // dd($pending_stage); if ($pending_stage == true) { //Pending Exist $client_update->progress_indicator = $pending_stage; @@ -1276,15 +1338,16 @@ class ClientsController extends Controller #$client_update->progress_indicators = json_encode($request->onboarding_sub_items_progress); if ($client_update->progress_indicator != 'COMPLETED') { $client_update->onboarding_progress_stage = json_encode($onboarding_progress_stage); - + // dump(json_encode($onboarding_progress_stage)); $progress_breakdown = array_count_values($onboarding_progress_stage); + // dd($progress_breakdown); if (array_has($progress_breakdown, ['COMPLETED']) == false) { + // dd('foo'); $indicator_score = "0"; } else{ $indicator_score = ($progress_breakdown['COMPLETED']/count($onboarding_progress_stage)) * 100; } - $indicator_score = number_format($indicator_score); $client_update->progress_indicator_score = $indicator_score; } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 8fe2ca7..ed3d1f4 100755 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -21,11 +21,10 @@ class Controller extends BaseController{ public function log_query() { // , $binding, $timing 'bindings' => $binding) \DB::listen(function ($sql) { - \Log::info('Showing query', array('sql' => $sql)); - $encoded_sql = json_encode($sql); - $this->sendNtfy("Showing Query : " . $encoded_sql); - } - ); + \Log::info('Showing query', array('sql' => $sql)); + $encoded_sql = json_encode($sql); + $this->sendNtfy("Showing Query : " . $encoded_sql); + }); } public function sendNtfy($data){ diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index ea36830..cd3c42b 100755 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -5,18 +5,28 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models; use Session; - +use DB; +use Carbon\Carbon; class DashboardController extends Controller { public function index(){ // dd('foo bar'); + + $currentdate = date('m-d'); $total_clients = Models\Client::count(); $ussd_clients = Models\Client::where('services', 'LIKE', '%ussd%')->orwhere('services', 'LIKE', '%A2P%')->count(); + $airtime_clients = Models\Client::where('services', 'LIKE', '%airtime%')->count(); + // dd($airtime_clients); $sms_clients = Models\Client::where('services', 'LIKE', '%sms%')->count(); $voice_clients = Models\Client::where('services', 'LIKE', '%ivr%')->count(); $expiring_contracts = Models\Client::where('contract_auto_renew', '<>', 'YES')->where('contract_validity', '<>', null)->orwhere('contract_validity', '<>', '')->orderBy('contract_validity', 'ASC')->take(5)->get(); $user_activities = Models\UserActivity::where('user_id', '>', '1')->with('userInfo')->orderBy('created_at', 'DESC')->take(5)->get(); $recent_clients = Models\Client::with('auth_user_info')->orderBy('id', 'DESC')->take(5)->get(); + // $upcoming_birthdays = Models\StaffMember::whereDate('dob', '>=', $currentdate)->orderBy('dob', 'ASC')->take(5)->get(); + $upcoming_birthdays = Models\StaffMember::whereRaw("(month(dob) >= month(curdate())) AND day(dob) >= day(curdate())")->orderBy('dob', 'ASC')->take(5)->get(); + $upcoming_hodidays = Models\NationalHoliday::whereRaw("(month(event_date) >= month(curdate()))")->orderBy('event_date', 'ASC')->take(5)->get(); + + // dd($upcoming_hodidays); // $recent_clients = Models\Client::orderBy('id', 'DESC')->take(5)->get(); // dd($recent_clients); $data = [ @@ -24,13 +34,14 @@ class DashboardController extends Controller 'sms' => $sms_clients, 'ussd' => $ussd_clients, 'voice' => $voice_clients, + 'airtime' => $airtime_clients, 'total' => $total_clients, 'recent_clients' => $recent_clients, 'user_activities' => $user_activities, - 'expiring_contracts' => $expiring_contracts + 'expiring_contracts' => $expiring_contracts, + 'upcoming_birthdays' => $upcoming_birthdays, + 'upcoming_hodidays' => $upcoming_hodidays ]; - - // dd($data); return view('dashboard.index_two', $data); } @@ -49,4 +60,71 @@ class DashboardController extends Controller return response()->json($event_arr); } + + public function getQuotes(){ + // put numbers against the quotes + // $daily_quotes = Models\Client::where('services', 'LIKE', '%ivr%')->count(); + + $daily_quotes = DB::table('daily_quotes') + ->where('id', '>=', DB::raw('(SELECT FLOOR(RAND() * (SELECT MAX(id) FROM daily_quotes)))')) + // ->limit(5) + ->first(); + return response()->json($daily_quotes); + + } + public function getMnosContracts(){ + $threeMonthsLater = Carbon::now()->addMonths(3)->format('m-d'); + $threeMonthsEarlier = Carbon::now()->addMonths(3)->format('m-d'); + $currentMonth = Carbon::now()->format('m'); + $today = Carbon::now()->format('m-d'); + + $expiring_three_months = Models\NetworkOps::where('contract_auto_renew', 'NO')->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') = ?", [$threeMonthsLater])->get(); + #$network_arr = Models\NetworkOps::where('contract_auto_renew', 'NO')->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') = ?", [$threeMonthsEarlier])->get(); + + + + $expired_in_current_month = Models\NetworkOps::whereRaw("DATE_FORMAT(contract_validity, '%m-%d') < ?", [$today])->get(); + $expired_overall = Models\NetworkOps::whereDate('contract_validity', '<', Carbon::now())->get(); + + // $network_arr = Models\NetworkOps::with('account_manager_info') + // ->where('contract_auto_renew', 'NO') + // ->get(); + + $expiring_current_month = Models\NetworkOps::whereMonth('contract_validity', $currentMonth)->get(); + $data = [ + 'expiring_three_months' => $expiring_three_months->count(), + 'expired_overall' => $expired_overall->count(), + 'expiring_current_month' => $expiring_current_month->count() + ]; + return response()->json($data); + } + + public function getClientContracts(){ + $threeMonthsLater = Carbon::now()->addMonths(3)->format('m-d'); + $threeMonthsEarlier = Carbon::now()->addMonths(3)->format('m-d'); + $currentMonth = Carbon::now()->format('m'); + $today = Carbon::now()->format('m-d'); + + $expiring_three_months = Models\Client::where('contract_auto_renew', 'NO')->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') = ?", [$threeMonthsLater])->get(); + #$network_arr = Models\NetworkOps::where('contract_auto_renew', 'NO')->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') = ?", [$threeMonthsEarlier])->get(); + + + + $expired_in_current_month = Models\Client::whereRaw("DATE_FORMAT(contract_validity, '%m-%d') < ?", [$today])->get(); + $expired_overall = Models\Client::whereDate('contract_validity', '<', Carbon::now())->get(); + + // $network_arr = Models\NetworkOps::with('account_manager_info') + // ->where('contract_auto_renew', 'NO') + // ->get(); + + + + $expiring_current_month = Models\Client::whereMonth('contract_validity', $currentMonth)->get(); + $data = [ + 'expiring_three_months' => $expiring_three_months->count(), + 'expired_overall' => $expired_overall->count(), + 'expiring_current_month' => $expiring_current_month->count() + ]; + return response()->json($data); + } } diff --git a/app/Http/Controllers/GeneralDocumentsController.php b/app/Http/Controllers/GeneralDocumentsController.php index 0046f08..a81be0b 100644 --- a/app/Http/Controllers/GeneralDocumentsController.php +++ b/app/Http/Controllers/GeneralDocumentsController.php @@ -31,6 +31,7 @@ class GeneralDocumentsController extends Controller $category_names = [ 'api' => 'API Documents', + 'airtime' => 'Click Airtime', 'presentations' => 'Presentations', 'rates' => 'SMS/Voice Rates', 'scfees' => 'Short Code Fees', @@ -107,6 +108,7 @@ class GeneralDocumentsController extends Controller $categories = [ 'sidwl' => 'Sender ID Whitelisting Letter', 'api' => 'API Docs', + 'airtime' => 'Click Airtime', 'rates' => 'Rates', 'scfees' => 'Short Code Fees', 'presentations' => 'presentations', diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index ce1230a..cf137d3 100755 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -5,6 +5,9 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models; use Spatie\Activitylog\Models\Activity; +use Illuminate\Support\Str; +use App\Jobs\SendOtpEmailAlert; + class LoginController extends Controller { @@ -15,33 +18,113 @@ class LoginController extends Controller ]; return view('login.index', $data); } + public function resendOtp(){ + if(!request()->session()->has('current_otpuser')){ + return redirect(url('login'))->withErrors("No session found. You need to be logged in!"); + } + $otp_code = Str::random(6); + \Log::info($otp_code); + request()->session()->put('current_otpuser.otp', $otp_code); + $otp_user = session('current_otpuser'); - public function handleLogin(Request $request){ - $this->validate($request, ['email' => 'required', 'password' => 'required']); + $otp_set = [ + 'otp' => $otp_code, + 'email' => $otp_user['email'], + 'auth_name' => $otp_user['name'] + ]; + dispatch(new SendOtpEmailAlert($otp_set)); + $data = [ + 'otp_user_id' => $otp_user['id'], + 'page_title' => 'Login OTP', + 'auth_name' => $otp_user['name'] + ]; + return view('login.otp', $data); + } + public function showOtpPage(){ + if(!request()->session()->has('current_otpuser')){ + $random = uniqid(); + return redirect(url('login'))->withErrors("$random | You need to be logged in "); + } + $otp_user = session('current_otpuser'); + $data = [ + 'otp_user_id' => $otp_user['id'], + 'page_title' => 'Login OTP', + 'auth_name' => $otp_user['name'] + ]; + return view('login.otp', $data); + } + public function handleLoginOtp(Request $request){ + $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(); + $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(); + } + + $otp_code = Str::random(6); + $request->session()->regenerate(true); + $request->session()->put('current_otpuser.id', $logged_in->id); + $request->session()->put('current_otpuser.otp', $otp_code); + $request->session()->put('current_otpuser.name', $logged_in->name); + $request->session()->put('current_otpuser.email', $logged_in->email); + $request->session()->put('current_otpuser.phone', $logged_in->phone); + $request->session()->put('current_otpuser.datetime_sent', date('Y-m-d H:i:s')); + $request->session()->put('current_otpuser.designation', $logged_in->designation_info->name); + + $otp_set = ['otp' => $otp_code, 'email' => $logged_in->email, 'auth_name' => $logged_in->name]; + dispatch(new SendOtpEmailAlert($otp_set)); + return redirect(url('showotp')); + } + public function handleLogin(Request $request){ + // dump($request->all()); + $this->validate($request, ['otp' => 'required', 'otp_user_id' => 'required']); + //system user : $table = "auth_users"; + $current_date = date('Y-m-d H:i:s'); + $otp_user = session('current_otpuser'); + + $date1 = new \DateTime($otp_user['datetime_sent']); + $date2 = new \DateTime($current_date); + + $interval = $date1->diff($date2); + $minutes = ($interval->h * 60) + $interval->i; + // dd($minutes); + if($minutes > 2 ){ + return redirect("showotp")->withErrors(array("OTP Time Out. Resend and try again!")); + } + + $otp_user = session('current_otpuser'); + if(strtoupper($otp_user['otp']) !== strtoupper($request->otp)){ + + return redirect("showotp")->withErrors(array("Incorrect OTP. Check and try again!"))->withInput(); + } + #$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(); } - + */ $request->session()->regenerate(true); - $request->session()->put('current_user.id', $logged_in->id); - $request->session()->put('current_user.name', $logged_in->name); - $request->session()->put('current_user.email', $logged_in->email); - $request->session()->put('current_user.phone', $logged_in->phone); - $request->session()->put('current_user.designation', $logged_in->designation_info->name); + $request->session()->put('current_user.id', $otp_user['id']); + $request->session()->put('current_user.name', $otp_user['name']); + $request->session()->put('current_user.email', $otp_user['email']); + $request->session()->put('current_user.phone', $otp_user['phone']); + $request->session()->put('current_user.designation', $otp_user['designation']); - \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')); + \Log::info($otp_user['name']. ' Successfully logged in at : ' . date('Y-m-d H:i:s')); - $this->logUsersActivity($type = 'staff', $content, $logged_in->id); + $content = $otp_user['name'] . " Successfully Logged In"; + // dd($content); + #activity()->log($otp_user['name']. ' Successfully logged in at : ' . date('Y-m-d H:i:s')); + + $this->logUsersActivity($type = 'staff', $content, $otp_user['id']); $this->deleteLoggedUser(); $this->storeLoggedUser(); - switch ($logged_in->designation_info->name) { + return redirect(url('/')); + /* + switch ($otp_user['designation_info']) { case 'Administrator': return redirect(url('finance')); // change it to a combined dashboard break; @@ -53,6 +136,7 @@ class LoginController extends Controller return redirect(url('/')); break; } + */ } public function handle_logout(Request $request) { @@ -65,8 +149,8 @@ class LoginController extends Controller $request->session()->flush(); $request->session()->regenerate(true); - activity()->log($username . " Logged Out : " . date('Y-m-d H:i:s')); - // $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("/"); } diff --git a/app/Http/Controllers/NetworkOperatorsController.php b/app/Http/Controllers/NetworkOperatorsController.php index 613a4dc..e7bee1c 100755 --- a/app/Http/Controllers/NetworkOperatorsController.php +++ b/app/Http/Controllers/NetworkOperatorsController.php @@ -388,7 +388,13 @@ class NetworkOperatorsController extends Controller * @return \Illuminate\Http\Response */ public function update(Requests\UpdateMnoRequest $request, $id) - { + { + if ($request->has('document_one') && isset($request->document_one_name) == false) { + return redirect()->back()->withErrors(array("You need to add a name for the document to be uploaded !"))->withInput(); + } + if ($request->has('document_two') && isset($request->document_two_name) == false) { + return redirect()->back()->withErrors(array("You need to add a name for the document to be uploaded !"))->withInput(); + } $operator_update = Models\NetworkOps::find($id); $paperless = new PaperLessNgx(); if ($request->has('document_one') && $request->has('document_one_name')) { diff --git a/app/Http/Controllers/OfficeLocationsController.php b/app/Http/Controllers/OfficeLocationsController.php index e31531c..1d97b9f 100644 --- a/app/Http/Controllers/OfficeLocationsController.php +++ b/app/Http/Controllers/OfficeLocationsController.php @@ -35,7 +35,7 @@ class OfficeLocationsController extends Controller $id = $request->branch_id; $document_arr = \DB::table('branch_files') ->join('auth_users', 'auth_users.id', '=', 'branch_files.uploaded_by') - ->select('branch_files.id', 'branch_files.name','branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at') + ->select('branch_files.id', 'branch_files.name', 'branch_files.validity_period','branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at') ->orderBy('branch_files.name', 'ASC') ->where('branch_files.branch_id', $id) ->paginate(15); @@ -44,7 +44,7 @@ class OfficeLocationsController extends Controller $keyword = $request->keyword; $document_arr = \DB::table('branch_files') ->join('auth_users', 'auth_users.id', '=', 'branch_files.uploaded_by') - ->select('branch_files.id', 'branch_files.name','branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at') + ->select('branch_files.id', 'branch_files.name', 'branch_files.validity_period', 'branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at') ->orderBy('branch_files.name', 'ASC') ->where('branch_files.branch_id', $id) ->whereRaw("branch_files.name LIKE '%$keyword%' OR branch_files.description LIKE '%$keyword%' OR branch_files.filename LIKE '%$keyword%' OR auth_users.name LIKE '%$keyword%'") @@ -70,6 +70,7 @@ class OfficeLocationsController extends Controller 'page_title' => 'Upload Document', 'branch_id' => $id ]; + // dd($data); return view('officelocations.filescreate', $data); } /** @@ -153,7 +154,7 @@ class OfficeLocationsController extends Controller if ($request->has('document_one') && $request->has('document_one_name')) { if ($request->file('document_one')->isValid()) { - $filename = "erp_" . time() . str_random(6) . "." . $request->document_one->extension(); + $filename = "erp_" . time() . str_random(6) . "." . $request->document_one->extension(); $request->document_one->storeAs('branch_files', $filename, 'public'); $document_arr['filename'] = $filename; $document_arr['branch_id'] = $request->branch_id; @@ -162,6 +163,7 @@ class OfficeLocationsController extends Controller $document_arr['file_extension'] = $request->document_one->extension(); $document_arr['file_reff'] = time() . uniqid(); $document_arr['name'] = $request->document_one_name; + $document_arr['validity_period'] = $request->validity_period_one; $document_arr['uploaded_by'] = session('current_user.id'); $result = Models\BranchFile::create($document_arr); } @@ -177,6 +179,7 @@ class OfficeLocationsController extends Controller $document_arr['file_extension'] = $request->document_two->extension(); $document_arr['file_reff'] = time() . uniqid(); $document_arr['name'] = $request->document_two_name; + $document_arr['validity_period'] = $request->validity_period_two; $document_arr['uploaded_by'] = session('current_user.id'); $result = Models\BranchFile::create($document_arr); } @@ -192,6 +195,7 @@ class OfficeLocationsController extends Controller $document_arr['file_extension'] = $request->document_three->extension(); $document_arr['file_reff'] = time() . uniqid(); $document_arr['name'] = $request->document_three_name; + $document_arr['validity_period'] = $request->validity_period_third; $document_arr['uploaded_by'] = session('current_user.id'); $result = Models\BranchFile::create($document_arr); } diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 4cb7a4c..608ad45 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -102,12 +102,75 @@ class ReportsController extends Controller{ ->select('user_activities.id','auth_users.name', 'user_activities.content', 'user_activities.ip_address', 'user_activities.created_at', 'user_activities.updated_at') ->whereRaw("user_activities.name like '%$keyword%' or user_activities.ip_address like '%$keyword%' OR user_activities.created_at like '%$keyword%' OR user_activities.updated_at like '%$keyword%'") ->orderBy('user_activities.created_at', 'DESC') - ->get(); - // ->paginate(15); + //->get(); + ->paginate(50); } return response()->json($user_activities); } + public function getMnosContracts(){ + #$user_activities = Models\UserActivity::where('user_id', '>', '1')->with('userInfo')->orderBy('created_at', 'DESC')->take(5)->get(); + $data = [ + 'page_title' => 'Expired MNO Contracts', + 'current_user' => session('current_user') + ]; + return view('reports.mno-expired-contracts', $data); + } + + public function getMnosContractsJson(Request $request){ + + $today = Carbon::now()->format('m-d'); + $expired_contracts = \DB::table('network_operators') + ->join('auth_users', 'auth_users.id', '=', 'network_operators.account_manager_id') + ->select('network_operators.id','auth_users.name AS accountManager', 'network_operators.name','network_operators.contact_person', 'network_operators.contact_person_email', 'network_operators.country', 'network_operators.contract_validity', 'network_operators.created_at') + ->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') < ?", [$today]) + ->orderBy('network_operators.name', 'DESC') + ->get(); + + if($request->has('keyword')){ + $keyword = $request->keyword; + $expired_contracts = \DB::table('network_operators') + ->join('auth_users', 'auth_users.id', '=', 'network_operators.account_manager_id') + ->select('network_operators.id','auth_users.name AS accountManager', 'network_operators.name','network_operators.contact_person', 'network_operators.contact_person_email', 'network_operators.country', 'network_operators.contract_validity', 'network_operators.created_at') + ->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') < ?", [$today]) + ->whereRaw("network_operators.name like '%$keyword%' or network_operators.contact_person like '%$keyword%' OR network_operators.created_at like '%$keyword%' OR network_operators.contract_validity like '%$keyword%' OR network_operators.contact_person_email like '%$keyword%'") + ->orderBy('network_operators.name', 'DESC') + ->get(); + } + return response()->json($expired_contracts); + } + + public function getClientContracts(){ + #$user_activities = Models\UserActivity::where('user_id', '>', '1')->with('userInfo')->orderBy('created_at', 'DESC')->take(5)->get(); + $data = [ + 'page_title' => 'Expirted Client Contracts', + 'current_user' => session('current_user') + ]; + return view('reports.clients-expired-contracts', $data); + } + + public function getClientContractsJson(Request $request){ + $today = Carbon::now()->format('m-d'); + $expired_contracts = \DB::table('clients') + ->join('auth_users', 'auth_users.id', '=', 'clients.auth_user_id') + ->select('clients.id','auth_users.name AS accountManager', 'clients.name','clients.contact_person', 'clients.email', 'clients.country', 'clients.contract_validity', 'clients.created_at') + ->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') < ?", [$today]) + ->orderBy('clients.name', 'DESC') + ->get(); + + if($request->has('keyword')){ + $keyword = $request->keyword; + $expired_contracts = \DB::table('clients') + ->join('auth_users', 'auth_users.id', '=', 'clients.auth_user_id') + ->select('clients.id','auth_users.name AS accountManager', 'clients.name','clients.contact_person', 'clients.email', 'clients.country', 'clients.contract_validity', 'clients.created_at') + ->whereRaw("DATE_FORMAT(contract_validity, '%m-%d') < ?", [$today]) + ->whereRaw("clients.name like '%$keyword%' or clients.contact_person like '%$keyword%' OR clients.created_at like '%$keyword%' OR clients.contract_validity like '%$keyword%' OR clients.contact_person_email like '%$keyword%'") + ->orderBy('clients.name', 'DESC') + ->get(); + } + return response()->json($expired_contracts); + } + public function getAmNewClients(){ // $new_clients = Models\Client::where() } diff --git a/app/Http/Controllers/SenderIdController.php b/app/Http/Controllers/SenderIdController.php index d8dcfa9..f7bd1dc 100644 --- a/app/Http/Controllers/SenderIdController.php +++ b/app/Http/Controllers/SenderIdController.php @@ -5,13 +5,16 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models; use Session; +use Excel; +use App\Imports\Senderidimport; +use Illuminate\Support\Facades\File; class SenderIdController extends Controller { public function index(){ $senderid_arr = new Models\SenderId; // $senderid_arr = $senderid_arr->with('modified_by_info', 'network_info', 'created_by_info')->orderBy('senderid', 'ASC')->paginate(15); - // dd($senderid_arr); + // dd($senderid_arr); $data = [ 'page_title' => 'Sender IDs', // 'senderid_arr' => $senderid_arr, @@ -25,23 +28,25 @@ class SenderIdController extends Controller $senderid_arr = \DB::table('sender_ids') ->join('staff_members AS staffcreate', 'staffcreate.id', '=', 'sender_ids.created_by') ->join('staff_members AS staffmodify', 'staffmodify.id', '=', 'sender_ids.last_modified_by') - ->join('network_operators', 'network_operators.id', '=', 'sender_ids.network_id') - ->join('clients', 'clients.id', '=', 'sender_ids.client_id') - ->select('sender_ids.id', 'clients.name AS clientName', 'network_operators.name AS networkName', 'network_operators.country', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.network_id', 'network_operators.country','sender_ids.remarks', 'staffcreate.name As createdBy','sender_ids.direct_mno', 'staffmodify.name AS modifiedBy') + // ->join('network_operators', 'network_operators.id', '=', 'sender_ids.network_id') + // ->join('clients', 'clients.id', '=', 'sender_ids.client_id') + ->select('sender_ids.id', 'mno_name', 'supplier_name', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.remarks', 'staffcreate.name As createdBy','sender_ids.direct_mno', 'staffmodify.name AS modifiedBy') ->orderBy('sender_ids.senderid', 'ASC') ->paginate(15); if($request->has('keyword')){ + $queries = []; $keyword = $request->keyword; + $queries['keyword'] = $keyword; $senderid_arr = \DB::table('sender_ids') ->join('staff_members AS staffcreate', 'staffcreate.id', '=', 'sender_ids.created_by') ->join('staff_members AS staffmodify', 'staffmodify.id', '=', 'sender_ids.last_modified_by') - ->join('network_operators', 'network_operators.id', '=', 'sender_ids.network_id') - ->join('clients', 'clients.id', '=', 'sender_ids.client_id') - ->select('sender_ids.id', 'clients.name AS clientName', 'network_operators.name AS networkName', 'network_operators.country', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.network_id', 'network_operators.country','sender_ids.remarks', 'staffcreate.name As createdBy', 'sender_ids.direct_mno', 'staffmodify.name AS modifiedBy') - ->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%' OR sender_ids.direct_mno LIKE '%$keyword%'") + // ->join('network_operators', 'network_operators.id', '=', 'sender_ids.network_id') + // ->join('clients', 'clients.id', '=', 'sender_ids.client_id') + ->select('sender_ids.id', 'mno_name', 'supplier_name', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.remarks', 'staffcreate.name As createdBy', 'sender_ids.direct_mno', 'staffmodify.name AS modifiedBy') + ->whereRaw("sender_ids.senderid LIKE '%$keyword%' OR sender_ids.status LIKE '%$keyword%' OR mno_name LIKE '%$keyword%' OR supplier_name LIKE '%$keyword%' OR staffcreate.name LIKE '%$keyword%' OR staffmodify.name LIKE '%$keyword%' OR sender_ids.direct_mno LIKE '%$keyword%'") ->orderBy('sender_ids.senderid', 'ASC') - ->paginate(15); + ->paginate(15)->appends($queries); } return response()->json($senderid_arr); } @@ -49,29 +54,46 @@ class SenderIdController extends Controller { #$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'); + $networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS networkvalue, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); + $network_arr = array_pluck($networks, 'network', 'networkvalue'); $direct_mno_arr = ['YES' => 'YES', 'NO' => 'NO']; // dd($network_arr); #$network_arr = array_combine($network_arr, $network_arr); - $clients = Models\Client::pluck('name', 'id'); + // $clients = Models\Client::pluck('name', 'name'); + $clients = \DB::table('clients')->Select(\DB::raw('concat(name, " (", country, ")") AS clientvalue, concat(name, " (", country, ")") AS client'))->orderBy('client')->get()->toArray(); + $client_arr = array_pluck($clients, 'client', 'clientvalue'); $staffmembers = Models\StaffMember::pluck('name', 'id'); - $status = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; + #$status = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; + #$status = ['Applied to MNO', 'Applied to Aggregator', 'Approved on MNO', 'Approved on Aggregator', 'Active', 'InActive']; + $status = [ + 'Applied to MNO' => 'Applied to MNO', + 'Applied to Aggregator' => 'Applied to Aggregator', + 'Approved on MNO' => 'Approved on MNO', + 'Approved on Aggregator' => 'Approved on Aggregator', + 'Active' => 'Active', + 'Inactive' => 'InActive' + ]; $data = [ 'page_title' => 'Create Sender ID', - 'network_arr' => [], // $network_arr, + 'network_arr' => $network_arr, 'status' => $status, - 'clients' => $clients, + 'clients' => $client_arr, 'direct_mno_arr' => $direct_mno_arr, 'staffmembers' => $staffmembers ]; - + // dd($data); return view('senderid.create', $data); } + public function showuploadform(){ + $data = [ + 'page_title' => 'Upload Sender IDs', + ]; + return view('senderid.uploadbulk', $data); + } /** * Store a newly created resource in storage. * @@ -82,14 +104,30 @@ class SenderIdController extends Controller { $request->validate([ 'senderid' => 'required|max:11', - 'network_id' => 'required', + 'mno_name' => 'required_if:direct_mno,YES', + 'supplier_name' => 'required_if:direct_mno,NO', 'status' => 'required', 'remarks' => 'sometimes', ]); + $check_duplicate = Models\SenderId::where('senderid', $request->senderid) + ->where('mno_name', $request->mno_name) + ->first(); + + if($check_duplicate){ + return redirect()->back()->withInput()->withErrors("Sender ID already exist for " . $request->mno_name ); + } + $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 ?? ''; + $senderid_arr['direct_mno'] = $request->direct_mno; + + + // dd($senderid_arr); + $result = Models\SenderId::create($senderid_arr); + + /* if ($request->direct_mno == 'NO') { $mno_world_wide = Models\Worldwidemno::find($request->network_id); // code... save in the network ops with status as non-direct ... user createOrUpdate method @@ -98,37 +136,176 @@ class SenderIdController extends Controller $network_ops_arr['name'] = $mno_world_wide->network; $network_ops_arr['direct_business'] = 'NO'; // $mno_world_wide->network; $result = Models\NetworkOps::updateOrCreate(['name' => $mno_world_wide->network, 'country' => $mno_world_wide->country, 'direct_business' => 'NO'], $network_ops_arr); + $senderid_arr['network_id'] = $result->id; } - // dd($senderid_arr); - - $result = Models\SenderId::create($senderid_arr); - + //validate senderid with same client and same network + // $result = Models\SenderId::create($senderid_arr); + $result = Models\SenderId::updateOrCreate([ + 'network_id' => $senderid_arr['network_id'], + 'client_id' => $senderid_arr['client_id'], + 'senderid' => $senderid_arr['senderid'] + ], $senderid_arr); + */ #save services this has been moved to the main client table //$retval = $this->store_services($request->services, $result->id); - + // dd('foo bar'); Session::flash('success_message', 'Sender ID successfully added'); return redirect(url('senderids')); } + public function uploadstore(Request $request) + { + $request->validate([ + 'senderid_file' => 'required|max:6000|mimes:xlx,xlsx', + ]); + + + $request->session()->put('current_user.rejected_rows_filename', ''); + + // dump($request->all()); + $networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS networkvalue, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); + + $network_arr = array_pluck($networks, 'network', 'networkvalue'); + + $clients = \DB::table('clients')->Select(\DB::raw('concat(name, " (", country, ")") AS clientvalue, concat(name, " (", country, ")") AS client'))->orderBy('client')->get()->toArray(); + $client_arr = array_pluck($clients, 'client', 'clientvalue'); + + if (!$request->hasFile('senderid_file') && !$request->senderid_file->isValid() ) { + Session::flash('error_message', 'File could not be loaded'); + return redirect()->back(); + } + $file = $request->senderid_file; + $filename = "erp_" . time() . str_random(6) . "." . $request->senderid_file->extension(); + $request->senderid_file->storeAs('general_files', $filename, 'public'); + + $stored_file = public_path('documents/general_files/'.$filename); + $extracted_arr = Excel::toArray(new Senderidimport, $stored_file); + // dd($extracted_arr[0]); + $row_count = $extracted_arr[0]; + $main = []; + $count = 0; + $senderid_arr = []; + $rejected_rows = []; + $rejected_rows_filename = public_path('documents/general_files/'. $filename . "_rejected_rows.txt"); + foreach ($extracted_arr[0] as $key => $value) { + if ($value['senderid'] == null) { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + if ($value['direct_mno'] == "YES" && $value['mno_name'] == null) { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + if ($value['direct_mno'] == "NO" && $value['supplier_name'] == null) { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + if ($value['direct_mno'] == "YES" && in_array($value['mno_name'], $network_arr) == true) { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + if ($value['direct_mno'] == "NO" && in_array($value['supplier_name'], $client_arr) == true) { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + $check_duplicate_mno = Models\SenderId::where('senderid', $value['senderid']) + ->where('mno_name', $value['mno_name']) + ->first(); + $check_duplicate_client = Models\SenderId::where('senderid', $value['senderid']) + ->where('supplier_name', $value['supplier_name']) + ->first(); + + if ($check_duplicate_mno && $value['direct_mno'] == "YES") { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + if ($check_duplicate_client && $value['direct_mno'] == "NO") { + file_put_contents($rejected_rows_filename, json_encode($value) . PHP_EOL, FILE_APPEND); + continue; + } + if (strtoupper($value['direct_mno']) == 'YES') { + // dd('foo bar'); + $senderid_arr['senderid'] = $value['senderid']; + $senderid_arr['mno_name'] = $value['mno_name']; + $senderid_arr['created_by'] = session('current_user.id'); + $senderid_arr['last_modified_by'] = session('current_user.id'); + $senderid_arr['remarks'] = $value['remarks']; + $senderid_arr['direct_mno'] = 'YES'; + } + else{ + $senderid_arr['senderid'] = $value['senderid']; + $senderid_arr['supplier_name'] = $value['supplier_name']; + $senderid_arr['created_by'] = session('current_user.id'); + $senderid_arr['last_modified_by'] = session('current_user.id'); + $senderid_arr['remarks'] = $value['remarks']; + $senderid_arr['direct_mno'] = 'NO'; + } + + // dd($senderid_arr); + $result = Models\SenderId::create($senderid_arr); + // dd($retval); + + } + + $request->session()->put('current_user.rejected_rows_filename', $filename . "_rejected_rows.txt"); + $rejected = file($rejected_rows_filename); + + // dump(session('current_user.rejected_rows_filename')); + // dd('the end'); + Session::flash('success_message', 'Bulk Sender ID successfully uploaded, review the report file!'); + return redirect(url('senderids')); + } + public function getUploadReport($name){ + $file = public_path('documents/general_files/') . $name; + $headers = ['Content-Type' => 'text/plain ']; + return \Response::download($file, 'Sender ID Upload Report', $headers); + } + public function getSampleFile(){ + $file = public_path('documents/general_files/senderid_sample_file.xlsx'); + + #$extension = pathinfo($file, PATHINFO_EXTENSION); + $headers = ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; + return \Response::download($file, 'Sender ID Sample Upload File', $headers); + } public function edit($id){ $senderid = Models\SenderId::findOrFail($id); //dd($senderid); - $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'); + $networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS networkvalue, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray(); + $network_arr = array_pluck($networks, 'network', 'networkvalue'); + $direct_mno_arr = ['YES' => 'YES', 'NO' => 'NO']; + // dd($network_arr); - $clients = Models\Client::pluck('name', 'id'); + $clients = \DB::table('clients')->Select(\DB::raw('concat(name, " (", country, ")") AS clientvalue, concat(name, " (", country, ")") AS client'))->orderBy('client')->get()->toArray(); + $client_arr = array_pluck($clients, 'client', 'clientvalue'); $staffmembers = Models\StaffMember::pluck('name', 'id'); - $status = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; - + // $status = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; + $status = [ + 'Applied to MNO' => 'Applied to MNO', + 'Applied to Aggregator' => 'Applied to Aggregator', + 'Approved on MNO' => 'Approved on MNO', + 'Approved on Aggregator' => 'Approved on Aggregator', + 'Active' => 'Active', + 'Inactive' => 'InActive' + ]; + // $data = [ + // 'page_title' => 'Create Sender ID', + // 'network_arr' => $network_arr, G*385058081508uq + // 'status' => $status, + // 'clients' => $clients, + // 'senderid' => $senderid, + // 'direct_mno_arr' => $direct_mno_arr, + // 'staffmembers' => $staffmembers + // ]; $data = [ - 'page_title' => 'Create Sender ID', + 'page_title' => 'Edit Sender ID', 'network_arr' => $network_arr, 'status' => $status, - 'clients' => $clients, + 'clients' => $client_arr, 'senderid' => $senderid, + 'direct_mno_arr' => $direct_mno_arr, 'staffmembers' => $staffmembers ]; @@ -139,18 +316,33 @@ class SenderIdController extends Controller $request->validate([ 'senderid' => 'required|max:11', - 'network_id' => 'required', + 'mno_name' => 'required_if:direct_mno,YES', + 'supplier_name' => 'required_if:direct_mno,NO', 'status' => 'required', 'remarks' => 'sometimes', ]); - + // dd($request->all()); $senderid = Models\SenderId::findOrFail($id); $senderid->senderid = $request->senderid; - $senderid->client_id = $request->client_id; + $senderid->mno_name = $request->mno_name ?? ''; $senderid->status = $request->status; - $senderid->network_id = $request->network_id; + $senderid->supplier_name = $request->supplier_name ?? ''; $senderid->remarks = $request->remarks; + $senderid->direct_mno = $request->direct_mno; + $senderid->last_modified_by = session('current_user.id'); + + // if ($request->direct_mno == 'NO') { + // $mno_world_wide = Models\Worldwidemno::find($request->network_id); + // // code... save in the network ops with status as non-direct ... user createOrUpdate method + // $network_ops_arr['name'] = $mno_world_wide->network; + // $network_ops_arr['country'] = $mno_world_wide->country; + // $network_ops_arr['name'] = $mno_world_wide->network; + // $network_ops_arr['direct_business'] = 'NO'; // $mno_world_wide->network; + // $result = Models\NetworkOps::updateOrCreate(['name' => $mno_world_wide->network, 'country' => $mno_world_wide->country, 'direct_business' => 'NO'], $network_ops_arr); + // $senderid->network_id = $result->id; + // } + $senderid->save(); diff --git a/app/Http/Controllers/ShortCodesController.php b/app/Http/Controllers/ShortCodesController.php index 7c128f5..f024baf 100644 --- a/app/Http/Controllers/ShortCodesController.php +++ b/app/Http/Controllers/ShortCodesController.php @@ -19,9 +19,22 @@ class ShortCodesController extends Controller{ ]; return view('shortcodes.index', $data); } + public function create(){ + $country_networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->pluck('network', 'network'); + $client_arr = Models\Client::pluck('name', 'id'); + $data = [ + 'page_title' => 'New Short Code', + 'country_network_arr' => $country_networks, + 'client_arr' => $client_arr, + 'current_user' => session('current_user') + ]; + return view('shortcodes.create', $data); + } public function smsindex(){ // $codes_data = Models\ClientShortCode::groupBy('code_type')->get(); + $country_networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->pluck('network', 'network'); + $client_arr = Models\Client::orderBy('name', 'ASC')->pluck('name', 'id'); $codes_data = \DB::table('client_short_codes') ->select('code_type', \DB::raw('count(*) as total')) ->groupBy('code_type') @@ -44,12 +57,14 @@ class ShortCodesController extends Controller{ 'type' => 'SMS', 'codes_data' => $codes_data, 'networks_raw' => array_combine($networks_raw, $networks_raw), + 'country_network_arr' => $country_networks, + 'client_arr' => $client_arr, 'current_user' => session('current_user') ]; return view('shortcodes.smsindex', $data); } public function getShortCodesJson(Request $request){ - $this->log_query(); + //$this->log_query(); //$codes_data = Models\ClientShortCode::with('client_info', 'update_info')->where('code_type', 'sms')->orderBy('id', 'DESC')->get(); $shortcode_arr = \DB::table('client_short_codes') @@ -57,7 +72,7 @@ class ShortCodesController extends Controller{ ->join('clients', 'clients.id', '=', 'client_short_codes.client_id') ->select('client_short_codes.id', 'client_short_codes.name', 'client_short_codes.shortcode', 'clients.name AS clientName', 'client_short_codes.network', 'client_short_codes.toll_free', 'client_short_codes.monthly_fee', 'client_short_codes.status', 'client_short_codes.remarks', 'client_short_codes.launch_date', 'client_short_codes.expiry_date', 'client_short_codes.last_updated_by', 'auth_users.name AS modifiedBy') ->where('client_short_codes.code_type', 'sms') - ->orderBy('client_short_codes.shortcode', 'ASC') + ->orderBy('client_short_codes.created_at', 'DESC') ->paginate(15); if($request->has('keyword')){ @@ -69,7 +84,7 @@ class ShortCodesController extends Controller{ ->select('client_short_codes.id', 'client_short_codes.name', 'client_short_codes.shortcode', 'clients.name AS clientName', 'client_short_codes.network', 'client_short_codes.toll_free', 'client_short_codes.monthly_fee', 'client_short_codes.status', 'client_short_codes.remarks', 'client_short_codes.launch_date', 'client_short_codes.expiry_date', 'client_short_codes.last_updated_by', 'auth_users.name AS modifiedBy') ->whereRaw("code_type = '$code_type' AND (client_short_codes.name LIKE '%$keyword%' OR client_short_codes.shortcode LIKE '%$keyword%' OR client_short_codes.status LIKE '%$keyword%' OR client_short_codes.network LIKE '%$keyword%' OR client_short_codes.toll_free LIKE '%$keyword%' OR client_short_codes.monthly_fee LIKE '%$keyword%' OR client_short_codes.launch_date LIKE '%$keyword%' OR client_short_codes.expiry_date LIKE '%$keyword%' OR clients.name LIKE '%$keyword%' OR auth_users.name LIKE '%$keyword%')") // ->where('code_type', $code_type) - ->orderBy('client_short_codes.shortcode', 'ASC') + ->orderBy('client_short_codes.created_at', 'DESC') ->paginate(15); } return response()->json($shortcode_arr); @@ -77,6 +92,8 @@ class ShortCodesController extends Controller{ public function ussdindex(){ // $codes_data = Models\ClientShortCode::groupBy('code_type')->get(); + $country_networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->pluck('network', 'network'); + $client_arr = Models\Client::orderBy('name', 'ASC')->pluck('name', 'id'); $codes_data = \DB::table('client_short_codes') ->select('code_type', \DB::raw('count(*) as total')) ->groupBy('code_type') @@ -85,8 +102,11 @@ class ShortCodesController extends Controller{ 'page_title' => 'Short Codes', 'type' => 'USSD', 'codes_data' => $codes_data, + 'country_network_arr' => $country_networks, + 'client_arr' => $client_arr, 'current_user' => session('current_user') ]; + return view('shortcodes.ussdindex', $data); } public function getUssdShortCodesJson(Request $request){ @@ -98,7 +118,7 @@ class ShortCodesController extends Controller{ ->join('clients', 'clients.id', '=', 'client_short_codes.client_id') ->select('client_short_codes.id', 'client_short_codes.name', 'client_short_codes.shortcode', 'clients.name AS clientName', 'client_short_codes.network', 'client_short_codes.toll_free', 'client_short_codes.monthly_fee', 'client_short_codes.status', 'client_short_codes.remarks', 'client_short_codes.launch_date', 'client_short_codes.expiry_date', 'client_short_codes.last_updated_by', 'auth_users.name AS modifiedBy') ->where('client_short_codes.code_type', 'ussd') - ->orderBy('client_short_codes.shortcode', 'ASC') + ->orderBy('client_short_codes.created_at', 'DESC') ->paginate(15); if($request->has('keyword')){ @@ -110,7 +130,7 @@ class ShortCodesController extends Controller{ ->select('client_short_codes.id', 'client_short_codes.name', 'client_short_codes.shortcode', 'clients.name AS clientName', 'client_short_codes.network', 'client_short_codes.toll_free', 'client_short_codes.monthly_fee', 'client_short_codes.status', 'client_short_codes.remarks', 'client_short_codes.launch_date', 'client_short_codes.expiry_date', 'client_short_codes.last_updated_by', 'auth_users.name AS modifiedBy') ->whereRaw("code_type = '$code_type' AND (client_short_codes.name LIKE '%$keyword%' OR client_short_codes.shortcode LIKE '%$keyword%' OR client_short_codes.status LIKE '%$keyword%' OR client_short_codes.network LIKE '%$keyword%' OR client_short_codes.toll_free LIKE '%$keyword%' OR client_short_codes.monthly_fee LIKE '%$keyword%' OR client_short_codes.launch_date LIKE '%$keyword%' OR client_short_codes.expiry_date LIKE '%$keyword%' OR clients.name LIKE '%$keyword%' OR auth_users.name LIKE '%$keyword%')") // ->where('code_type', $code_type) - ->orderBy('client_short_codes.shortcode', 'ASC') + ->orderBy('client_short_codes.created_at', 'DESC') ->paginate(15); } return response()->json($shortcode_arr); @@ -119,6 +139,8 @@ class ShortCodesController extends Controller{ public function voiceindex(){ // $codes_data = Models\ClientShortCode::groupBy('code_type')->get(); + $country_networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->pluck('network', 'network'); + $client_arr = Models\Client::orderBy('name', 'ASC')->pluck('name', 'id'); $codes_data = \DB::table('client_short_codes') ->select('code_type', \DB::raw('count(*) as total')) ->groupBy('code_type') @@ -127,6 +149,8 @@ class ShortCodesController extends Controller{ 'page_title' => 'Short Codes', 'type' => 'Voice', 'codes_data' => $codes_data, + 'country_network_arr' => $country_networks, + 'client_arr' => $client_arr, 'current_user' => session('current_user') ]; return view('shortcodes.voiceindex', $data); @@ -140,7 +164,7 @@ class ShortCodesController extends Controller{ ->join('clients', 'clients.id', '=', 'client_short_codes.client_id') ->select('client_short_codes.id', 'client_short_codes.name', 'client_short_codes.shortcode', 'clients.name AS clientName', 'client_short_codes.network', 'client_short_codes.toll_free', 'client_short_codes.monthly_fee','client_short_codes.status', 'client_short_codes.remarks', 'client_short_codes.launch_date', 'client_short_codes.expiry_date', 'client_short_codes.last_updated_by', 'auth_users.name AS modifiedBy') ->where('client_short_codes.code_type', 'voice') - ->orderBy('client_short_codes.shortcode', 'ASC') + ->orderBy('client_short_codes.created_at', 'DESC') ->paginate(15); if($request->has('keyword')){ @@ -152,7 +176,7 @@ class ShortCodesController extends Controller{ ->select('client_short_codes.id', 'client_short_codes.name', 'client_short_codes.shortcode', 'clients.name AS clientName', 'client_short_codes.network', 'client_short_codes.toll_free', 'client_short_codes.monthly_fee', 'client_short_codes.status', 'client_short_codes.remarks', 'client_short_codes.launch_date', 'client_short_codes.expiry_date', 'client_short_codes.last_updated_by', 'auth_users.name AS modifiedBy') ->whereRaw("code_type = '$code_type' AND (client_short_codes.name LIKE '%$keyword%' OR client_short_codes.shortcode LIKE '%$keyword%' OR client_short_codes.status LIKE '%$keyword%' OR client_short_codes.network LIKE '%$keyword%' OR client_short_codes.toll_free LIKE '%$keyword%' OR client_short_codes.monthly_fee LIKE '%$keyword%' OR client_short_codes.launch_date LIKE '%$keyword%' OR client_short_codes.expiry_date LIKE '%$keyword%' OR clients.name LIKE '%$keyword%' OR auth_users.name LIKE '%$keyword%')") // ->where('code_type', $code_type) - ->orderBy('client_short_codes.shortcode', 'ASC') + ->orderBy('client_short_codes.created_at', 'DESC') ->paginate(15); } return response()->json($shortcode_arr); diff --git a/app/Http/Controllers/UtilityController.php b/app/Http/Controllers/UtilityController.php index d6749f6..4dac865 100644 --- a/app/Http/Controllers/UtilityController.php +++ b/app/Http/Controllers/UtilityController.php @@ -14,6 +14,29 @@ class UtilityController extends Controller public function underconstruction(){ return view('utility.underconstruction'); } + public function migrateSenderids(){ + $senderid = Models\Senderidold::with('network_info', 'client_info')->where('direct_mno', 'YES')->get(); + // dd($senderid); + $counter = 0; + foreach ($senderid as $row) { + + // dd($row); + $senderid_arr['senderid'] = $row->senderid; + $senderid_arr['created_by'] = $row->created_by; + $senderid_arr['last_modified_by'] = $row->last_modified_by; + $senderid_arr['remarks'] = $row->remarks; + $senderid_arr['mno_name'] = $row->network_info->name . ' (' . $row->network_info->country .')'; + $senderid_arr['status'] = $row->status; + $senderid_arr['direct_mno'] = $row->direct_mno; + $senderid_arr['created_at'] = $row->created_at; + $senderid_arr['modified_at'] = $row->modified_at; + + $result = Models\SenderId::create($senderid_arr); + // dump($result); + $counter++; + } + return ['gip' => 'string', 'counter' => $counter]; + } public function EmailTest(Mailer $mailer) { dispatch(new SendTestEmail()); diff --git a/app/Http/Requests/UpdateMnoRequest.php b/app/Http/Requests/UpdateMnoRequest.php index 77f7af7..c4f6c44 100644 --- a/app/Http/Requests/UpdateMnoRequest.php +++ b/app/Http/Requests/UpdateMnoRequest.php @@ -41,9 +41,13 @@ class UpdateMnoRequest extends FormRequest 'contact_person_phone' => 'required', 'contract_auto_renew' => 'required', 'contract_validity' => 'required', + 'document_one' => 'max:20480|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx', 'document_two' => 'max:20480|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx', 'sliding_rate_file' => 'max:10240|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx', + + // 'document_one_name' => 'required_with:document_one.*', + // 'document_two_name' => 'required_with:document_two.*', ]; } diff --git a/app/Imports/SenderidImport.php b/app/Imports/SenderidImport.php new file mode 100644 index 0000000..5ece007 --- /dev/null +++ b/app/Imports/SenderidImport.php @@ -0,0 +1,27 @@ + $row['senderid'], + "direct_mno" => $row['direct_mno'], + "mno_name" => $row['mno_name'], + "status" => $row['status'], + "remarks" => $row['remarks'] + ]; + } + } +} diff --git a/app/Jobs/SendOtpEmailAlert.php b/app/Jobs/SendOtpEmailAlert.php new file mode 100644 index 0000000..514d190 --- /dev/null +++ b/app/Jobs/SendOtpEmailAlert.php @@ -0,0 +1,47 @@ +otp_set = $otp_set; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle(Mailer $mailer) + { + $otp_set = $this->otp_set; + $emails = [ + $otp_set['email'] + ]; + $data = [ + 'otp' => $otp_set['otp'], + 'auth_name' => $otp_set['auth_name'] + ]; + $mailer->send('emails.otp', $data, function ($message) use ($data, $emails) { + $message->from('alerts@click-mobile.com', 'Click Mobile ERP'); + $message->to($emails)->subject('Login OTP'); + }); + } +} diff --git a/app/Jobs/SendTestEmail.php b/app/Jobs/SendTestEmail.php index c74b0be..e76635f 100644 --- a/app/Jobs/SendTestEmail.php +++ b/app/Jobs/SendTestEmail.php @@ -33,7 +33,8 @@ class SendTestEmail implements ShouldQueue $emails = [ 'kwesi@click-mobile.com', 'kwesi_banson@hotmail.com', - 'mansa@click-mobile.com' + 'mansa@click-mobile.com', + 'diana@click-mobile.com' ]; $data = []; $mailer->send('emails.test', $data, function ($message) use ($data, $emails) { diff --git a/app/Models/DailyQoute.php b/app/Models/DailyQoute.php new file mode 100644 index 0000000..ff1eb8b --- /dev/null +++ b/app/Models/DailyQoute.php @@ -0,0 +1,12 @@ +hasOne('App\Models\OfficeLocation', 'id', 'branch_id'); + // } +} + + ?> \ No newline at end of file diff --git a/app/Models/SenderId.php b/app/Models/SenderId.php index fd03a4c..54cdbaa 100644 --- a/app/Models/SenderId.php +++ b/app/Models/SenderId.php @@ -7,22 +7,22 @@ use Spatie\Activitylog\Traits\LogsActivity; use Spatie\Activitylog\LogOptions; class SenderId extends Model{ - use LogsActivity; + // 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 $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 getActivitylogOptions(): LogOptions{ + // return LogOptions::defaults() + // ->logUnguarded()->useLogName('senderid_log')->logOnlyDirty()->dontSubmitEmptyLogs(); + // } public function modified_by_info(){ diff --git a/app/Models/Senderidold.php b/app/Models/Senderidold.php new file mode 100644 index 0000000..02e78a5 --- /dev/null +++ b/app/Models/Senderidold.php @@ -0,0 +1,27 @@ +hasOne('App\Models\StaffMember', 'id', 'last_modified_by'); + } + 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\StaffMember', 'id', 'created_by'); + } +} diff --git a/app/Models/SystemUser.php b/app/Models/SystemUser.php index 3a4e365..c189d87 100755 --- a/app/Models/SystemUser.php +++ b/app/Models/SystemUser.php @@ -3,21 +3,15 @@ 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; + //use CausesActivity; protected $guarded = array('id'); public $table = "auth_users"; - protected static $logUnguarded = true; - // public function getActivitylogOptions(): LogOptions{ - // return LogOptions::defaults()->logUnguarded(); - // } - + // protected static $logUnguarded = true; + 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 348ea81..d54c2a7 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -13,14 +13,15 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // $monolog = \Log::getMonolog(); + #$monolog = \Log::getMonolog(); //new --- > xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a //old ---> xoxp-677819906294-675678554016-720956680656-4a6b5d0fcb00e9e0512c14341d3a7563 //clickml_erp_ntfy - //click_erp_notify - // $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#clickml_erp_ntfy', 'Monolog', true, null, \Monolog\Logger::ERROR); - // $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#clickml_erp_ntfy', 'Monolog', true, null, \Monolog\Logger::INFO); - // $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#clickml_erp_ntfy', 'Monolog', true, null, \Monolog\Logger::DEBUG); + //click_erp_notify + // team_erp + // $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#team_erp', 'Monolog', true, null, \Monolog\Logger::ERROR); + // $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#team_erp', 'Monolog', true, null, \Monolog\Logger::INFO); + // $slackHandler = new \Monolog\Handler\SlackHandler('xoxp-677819906294-675678554016-693747277911-5166bcbb9a5fc3d5434b42a10c4d358a', '#team_erp', 'Monolog', true, null, \Monolog\Logger::DEBUG); // $monolog->pushHandler($slackHandler); diff --git a/composer.json b/composer.json index d01b5ed..cf5206e 100755 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "laravel/tinker": "~1.0", "laravelcollective/html": "^5.4.0", "maatwebsite/excel": "^3.1", - "spatie/laravel-activitylog": "^3.2" + "thibaud-dauce/laravel-mattermost-logger": "^1.2" }, "require-dev": { "filp/whoops": "~2.0", diff --git a/composer.lock b/composer.lock index 62fecda..6a0e311 100755 --- a/composer.lock +++ b/composer.lock @@ -4,63 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6220800cdce8e79b948fcc3175695707", + "content-hash": "d6b526be34793fb2333359d042baaf53", "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", @@ -514,6 +459,331 @@ }, "time": "2017-06-15T17:19:42+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:37:11+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:27:01+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2025-03-27T12:30:47+00:00" + }, { "name": "jakub-onderka/php-console-color", "version": "v0.2", @@ -1734,83 +2004,6 @@ }, "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", @@ -2303,6 +2496,50 @@ }, "time": "2019-12-06T14:19:43+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "ramsey/uuid", "version": "3.9.4", @@ -2406,144 +2643,6 @@ ], "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", @@ -2837,6 +2936,73 @@ ], "time": "2020-10-24T10:57:07+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:11:13+00:00" + }, { "name": "symfony/event-dispatcher", "version": "v4.4.30", @@ -4321,6 +4487,84 @@ ], "time": "2020-10-24T10:57:07+00:00" }, + { + "name": "thibaud-dauce/laravel-mattermost-logger", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://gitlab.com/thibauddauce/laravel-mattermost-logger.git", + "reference": "c5b5822c1df3f2ae8821bf124bf71b736885699b" + }, + "dist": { + "type": "zip", + "url": "https://gitlab.com/api/v4/projects/thibauddauce%2Flaravel-mattermost-logger/repository/archive.zip?sha=c5b5822c1df3f2ae8821bf124bf71b736885699b", + "reference": "c5b5822c1df3f2ae8821bf124bf71b736885699b", + "shasum": "" + }, + "require": { + "monolog/monolog": "^1.23", + "thibaud-dauce/mattermost-php": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "ThibaudDauce\\MattermostLogger\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Thibaud Dauce", + "email": "thibaud.dauce@pm.me" + } + ], + "time": "2018-11-07T15:59:04+00:00" + }, + { + "name": "thibaud-dauce/mattermost-php", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/ThibaudDauce/mattermost-php.git", + "reference": "0299c3dc6a2f7adacf663db6dcc93ad5a7b99bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ThibaudDauce/mattermost-php/zipball/0299c3dc6a2f7adacf663db6dcc93ad5a7b99bd2", + "reference": "0299c3dc6a2f7adacf663db6dcc93ad5a7b99bd2", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.2|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ThibaudDauce\\Mattermost\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Thibaud Dauce", + "email": "thibaud@dauce.fr", + "homepage": "https://www.formations-laravel.fr" + } + ], + "description": "Mattermost PHP driver to send incoming webhooks", + "homepage": "https://github.com/thibaud-dauce/mattermost-php", + "support": { + "issues": "https://github.com/ThibaudDauce/mattermost-php/issues", + "source": "https://github.com/ThibaudDauce/mattermost-php/tree/1.3.0" + }, + "time": "2020-11-26T13:26:31+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "2.2.3", @@ -6509,12 +6753,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0.0" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/config/filesystems.php b/config/filesystems.php index 6b7f3d8..a9f53ef 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -62,6 +62,7 @@ return [ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), + 'endpoint' => env('AWS_ENDPOINT'), ], ], diff --git a/info.md b/info.md index 9b43d59..dc9437e 100644 --- a/info.md +++ b/info.md @@ -1,2 +1,7 @@ +# Details -- Balance notifications \ No newline at end of file +- Balance notifications +# Charity notes entry | deleted +INSERT INTO `client_finances` (`id`, `client_id`, `invoice_number`, `invoice_amount`, `invoice_date`, `invoice_status`, `user_id`, `services`, `short_code`, `remarks`, `created_at`, `updated_at`) +VALUES + ('602', '36', '1878', '6.16', '2025-06-17 00:00:00', 'UNPAID', '8', 'A2P', '', 'May 2025 SMS traffic', '2025-06-17 12:13:37', '2025-06-17 12:13:37'); diff --git a/live.env b/live.env index 6f8d89d..3e4046f 100644 --- a/live.env +++ b/live.env @@ -44,3 +44,8 @@ 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 72c8c2f..ba5959b 100644 --- a/pending-issues.md +++ b/pending-issues.md @@ -16,6 +16,14 @@ - send holiday reminders - Use the calender + +## HI @Kwesi Banson + +I have an idea, customers whose status are put to dormant – should be kinda locked or change colour, i.e not waste our time. Can you add that on the system? +Kind Regards +Sam + + # Onboarding process Thank you sir, @@ -64,3 +72,6 @@ Comments - reports on new notes - @exoscutter + +## Profile Management +- activate the edit button with diff --git a/public/assets/img/ClickMobile_final_logo copy.png b/public/assets/img/ClickMobile_final_logo copy.png new file mode 100644 index 0000000..fded7fd Binary files /dev/null and b/public/assets/img/ClickMobile_final_logo copy.png differ diff --git a/public/assets/img/ClickMobile_final_logo.jpg b/public/assets/img/ClickMobile_final_logo.jpg new file mode 100644 index 0000000..a7e048d Binary files /dev/null and b/public/assets/img/ClickMobile_final_logo.jpg differ diff --git a/public/assets/img/ClickMobile_final_logo.png b/public/assets/img/ClickMobile_final_logo.png new file mode 100644 index 0000000..366950c Binary files /dev/null and b/public/assets/img/ClickMobile_final_logo.png differ diff --git a/public/assets/img/clicklogo.png b/public/assets/img/clicklogo.png new file mode 100644 index 0000000..269a345 Binary files /dev/null and b/public/assets/img/clicklogo.png differ diff --git a/public/assets/img/logo-light_sm.png b/public/assets/img/logo-light_sm.png new file mode 100644 index 0000000..637eb2e Binary files /dev/null and b/public/assets/img/logo-light_sm.png differ diff --git a/public/assets/img/report-icon.png b/public/assets/img/report-icon.png new file mode 100644 index 0000000..622ff84 Binary files /dev/null and b/public/assets/img/report-icon.png differ diff --git a/public/assets/img/user 2.png b/public/assets/img/user 2.png new file mode 100755 index 0000000..c0b9594 Binary files /dev/null and b/public/assets/img/user 2.png differ diff --git a/public/assets/js/clientshow.js b/public/assets/js/clientshow.js index 20c9f27..ed7d2a3 100644 --- a/public/assets/js/clientshow.js +++ b/public/assets/js/clientshow.js @@ -1,4 +1,4 @@ - $(document).ready(function(){ +$(document).ready(function(){ //console.log('foo bar'); var d = new Date(); var month = d.getMonth()+1; diff --git a/public/assets/js/dashboard.js b/public/assets/js/dashboard.js index 11cc661..4a76a6f 100644 --- a/public/assets/js/dashboard.js +++ b/public/assets/js/dashboard.js @@ -1,25 +1,73 @@ $(document).ready(function(){ - /* + $.ajax({ type: "get", - url: base_url + '/dashboard/get_events', + url: base_url + '/dashboard/getquotes', // data : formData, processData: false, contentType: false, async: false, success: function (data){ - //init_calendar(data); + console.log(data); + $('#dailyQuoteBlock').text(data.quote); + $('#authorParagraph').text(data.author); + }, error: function(error){ var output = $.parseJSON(error.responseText); console.log(output.errors); - $('#ipNotifyArea').removeClass('hidden'); - $('#ipNotifyArea').addClass('alert alert-danger'); + $('#dailyQuoteBlock').text(''); $.each(output.errors, function (key, value) { - //console.log(value[0]); - $('#ipNotifyArea').text(value[0]); + console.log(value[0]); }); } }); - */ + + + $.ajax({ + type: "get", + url: base_url + '/dashboard/getmnoexpiry', + // data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + console.log(data); + $('#mnoExpiredHref').text(data.expired_overall); + $('#mnoExpiringThisMonth').text(data.expiring_current_month); + $('#mnoExpiringInThreeMonths').text(data.expiring_three_months); + + }, + error: function(error){ + var output = $.parseJSON(error.responseText); + console.log(output.errors); + $('#dailyQuoteBlock').text(''); + $.each(output.errors, function (key, value) { + console.log(value[0]); + }); + } + }); + $.ajax({ + type: "get", + url: base_url + '/dashboard/getclientexpiry', + // data : formData, + processData: false, + contentType: false, + async: false, + success: function (data){ + console.log(data); + $('#clientExpiredHref').text(data.expired_overall); + $('#clientExpiringThisMonth').text(data.expiring_current_month); + $('#clientExpiringInThreeMonths').text(data.expiring_three_months); + }, + error: function(error){ + var output = $.parseJSON(error.responseText); + console.log(output.errors); + $('#dailyQuoteBlock').text(''); + $.each(output.errors, function (key, value) { + console.log(value[0]); + }); + } + }); + }); \ No newline at end of file diff --git a/public/assets/js/laravel-2025-06-04.log b/public/assets/js/laravel-2025-06-04.log new file mode 100644 index 0000000..75637a0 --- /dev/null +++ b/public/assets/js/laravel-2025-06-04.log @@ -0,0 +1,16 @@ +[2025-06-04 08:59:13] production.INFO: Mphatso Katundu Successfully logged in at : 2025-06-04 08:59:13 +[2025-06-04 08:59:15] production.INFO: Mphatso Katundu Successfully logged in at : 2025-06-04 08:59:15 +[2025-06-04 10:18:10] production.INFO: PPXkA9 +[2025-06-04 11:36:58] production.INFO: Kwesi Banson Successfully logged in at : 2025-06-04 11:36:58 +[2025-06-04 11:58:49] production.INFO: Charity Mtembezeka Successfully logged in at : 2025-06-04 11:58:49 +[2025-06-04 13:00:02] production.INFO: MNOs due for renewal +[2025-06-04 13:15:21] production.INFO: New notes for : ASTRAL SMS +[2025-06-04 13:15:21] production.INFO: New notes triggered by : Charity Mtembezeka +[2025-06-04 13:15:21] production.INFO: Astral SMS: Afghanistan route was set for them, they are in the process of testing the route. +[2025-06-04 14:00:13] production.INFO: Clients due for renewal TSG Carrier, mansa@click-mobile.com, 15 +[2025-06-04 14:40:58] production.INFO: New notes for : Zaheen Telecom +[2025-06-04 14:40:58] production.INFO: New notes triggered by : Charity Mtembezeka +[2025-06-04 14:40:58] production.INFO: Zaheen: Continued our Sierra Leone discussion, they said they will set for us. They wanted Sri Lanka route, but unfortunately, they have lost the traffic. +[2025-06-04 14:43:59] production.INFO: New notes for : BBT VOICE & SMS +[2025-06-04 14:44:00] production.INFO: New notes triggered by : Charity Mtembezeka +[2025-06-04 14:44:00] production.INFO: BBT: Been asking them to check on their Afghanistan route as other messages from Astral SMS are failing. diff --git a/public/assets/js/senderid.js b/public/assets/js/senderid.js index 4dd6ccb..04f1c30 100644 --- a/public/assets/js/senderid.js +++ b/public/assets/js/senderid.js @@ -1,36 +1,74 @@ $(document).ready(function(){ - $('#directMno').change(function(tve){ - tve.preventDefault(); - // var theIDD = $(this).siblings('.shortCodeEntryRowId').val(); - var directMnoSelection = $(this).val(); - $.ajax({ - type: "GET", - url: base_url + '/senderids/get-mno-list/' + directMnoSelection, - processData: false, - contentType: false, - async: false, - success: function (data){ - if (data.code === 1) { - $('#networkName').empty(); - $.each(data.result, function(id, row) { - // console.log(row); - $('#networkName').append($("