bug fixes, AM change feature, refactoring

This commit is contained in:
Kwesi Banson Jnr
2025-11-23 14:40:32 +00:00
parent eabf61b7da
commit d5ac7391dd
41 changed files with 1559 additions and 125 deletions

3
3
View File

@@ -1,3 +0,0 @@
[]
[]
[]

View File

@@ -56,6 +56,14 @@ app password: sqczcsrtcehpywjv
- daniel - daniel
- theCitadel@111 - theCitadel@111
- orou
- boatformer@100
- andrew - andrew
- blacktone@900 - blacktone@900
- aniguia@click-mobile.com
- mozfet@100
- melissa@click-mobile.com
- swlgas@Och5T

View File

@@ -15,6 +15,7 @@ use App\Http\Requests;
use Carbon\Carbon; use Carbon\Carbon;
use App\Libs\PaperLessNgx; use App\Libs\PaperLessNgx;
use Spatie\Activitylog\Models\Activity; use Spatie\Activitylog\Models\Activity;
use Config;
class ClientsController extends Controller class ClientsController extends Controller
{ {
@@ -715,7 +716,7 @@ class ClientsController extends Controller
$country_networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->pluck('network', 'network'); $country_networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->pluck('network', 'network');
// $country_networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS network)')->orderBy('network')->get()->toArray(); // $country_networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS network)')->orderBy('network')->get()->toArray();
// $country_networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS network)'))->pluck('network', 'network'); // $country_networks = \DB::table('network_operators')->Select(\DB::raw('concat(name, " (", country, ")") AS network)'))->pluck('network', 'network');
$auth_users = Models\SystemUser::orderBy('name', 'ASC')->pluck('name', 'id');
$networks_raw = [ $networks_raw = [
'AirtelTigo GH' => 'AirtelTigo GH', 'AirtelTigo GH' => 'AirtelTigo GH',
'MTN GH' => 'MTN GH', 'MTN GH' => 'MTN GH',
@@ -814,6 +815,8 @@ class ClientsController extends Controller
sort($networks_raw); sort($networks_raw);
$recurring_arr = ['NO' => 'NO', 'Monthly' => 'Monthly', 'Quarterly' => 'Quarterly', 'Semiannual' => 'Semiannual', 'Yearly' => 'Yearly']; $recurring_arr = ['NO' => 'NO', 'Monthly' => 'Monthly', 'Quarterly' => 'Quarterly', 'Semiannual' => 'Semiannual', 'Yearly' => 'Yearly'];
$sender_id_statuses = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved']; $sender_id_statuses = ['Pending' => 'Pending', 'Inactive' => 'Inactive', 'Approved' => 'Approved'];
$change_account_mgr_permisson = Config::get('permissions.CHANGE_ACCOUNT_MANAGERS');
$change_account_mgr_permisson = ($this->hasAnyAccess([$change_account_mgr_permisson])) ? 'YES' : 'NO';
$data = [ $data = [
'page_title' => 'Client Profile', 'page_title' => 'Client Profile',
'showclient' => $showclient, 'showclient' => $showclient,
@@ -839,6 +842,8 @@ class ClientsController extends Controller
'recurring_arr' => $recurring_arr, 'recurring_arr' => $recurring_arr,
// 'client_sender_ids' => $client_sender_ids, // 'client_sender_ids' => $client_sender_ids,
// 'sender_id_statuses' => $sender_id_statuses, // 'sender_id_statuses' => $sender_id_statuses,
'change_account_mgr_permisson' => $change_account_mgr_permisson,
'am_list_arr' => $auth_users,
'country_network_arr' => $country_networks, 'country_network_arr' => $country_networks,
'mnos_arr' => ['' => '-- Select Country first --'] 'mnos_arr' => ['' => '-- Select Country first --']
]; ];
@@ -1198,14 +1203,17 @@ class ClientsController extends Controller
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function update(Requests\UpdateClientRequest $request, $id){ public function update(Requests\UpdateClientRequest $request, $id){
// dd($request->all()); // dump($request->all());
// \DB::connection()->enableQueryLog(); // \DB::connection()->enableQueryLog();
$client_update = Models\Client::find($id); $client_update = Models\Client::find($id);
// dump($client_update->progress_indicator);
$paperless = new PaperLessNgx(); $paperless = new PaperLessNgx();
if ($client_update->progress_indicator != 'COMPLETED') { if ($client_update->progress_indicator != 'COMPLETED') {
$current_pending_stage_details = Models\ClientOnboardingMainStage::where('stage', $request->current_pending_stage)->first(); $current_pending_stage_details = Models\ClientOnboardingMainStage::where('stage', $request->current_pending_stage)->first();
$get_stage_subs_items = Models\ClientOnboardingSubItem::where('stage_id', $current_pending_stage_details->stage_id)->get(); $get_stage_subs_items = Models\ClientOnboardingSubItem::where('stage_id', $current_pending_stage_details->stage_id)->get();
#update the table for onboarding progress #update the table for onboarding progress
// dump($request->onboarding_sub_items_progress);
if ($request->onboarding_sub_items_progress) {
foreach ($request->onboarding_sub_items_progress as $value) { foreach ($request->onboarding_sub_items_progress as $value) {
$stage_id = [ $stage_id = [
'stage_id' => $current_pending_stage_details->stage_id, 'stage_id' => $current_pending_stage_details->stage_id,
@@ -1217,7 +1225,7 @@ class ClientsController extends Controller
]; ];
$clients_onboarding_progress = Models\ClientOnboardingProgress::updateOrCreate($stage_id, $progress_arr); $clients_onboarding_progress = Models\ClientOnboardingProgress::updateOrCreate($stage_id, $progress_arr);
} }
}
//update the status of onboarding progress stage in clients //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(); $get_stage_onboarding_status = Models\ClientOnboardingProgress::where('client_id', $id)->where('stage_id', $current_pending_stage_details->stage_id)->where('status', 'COMPLETED')->get();
$onboarding_progress_stage = json_decode($client_update->onboarding_progress_stage, true); $onboarding_progress_stage = json_decode($client_update->onboarding_progress_stage, true);
@@ -1450,6 +1458,45 @@ class ClientsController extends Controller
$result = Models\ClientCategory::create($client_arr); $result = Models\ClientCategory::create($client_arr);
} }
return true; return true;
}
public function changeAccountManagers(Request $request){
$new_account_manager = Models\SystemUser::find($request->account_manager);
$client = Models\Client::with('auth_user_info')->find($request->client_id);
$client->auth_user_id = $request->account_manager;
$client->last_modified_by = session('current_user.id');
$result = $client->save();
if ($result) {
$log_text = session('current_user.name') . " changed the account manager of ";
$log_text .= " " . $client->name . " from " . $client->auth_user_info->name;
$log_text .= " to " . $new_account_manager->name;
$activity_arr = [
'type' => 'staff',
'content' => $log_text,
'user_id' => session('current_user.id'),
'ip_address' => \Request::ip(),
'device' => $request->header('User-Agent')
];
$retval = Models\UserActivity::create($activity_arr);
$user_id = session('current_user.id');
$username = session('current_user.name');
$content = $log_text;
$this->logUsersActivity($type = 'staff', $content);
$data = ['code' => 1, $msg = 'success'];
return response()->json($data, 200);
}
else{
$data = ['code' => 3, $msg = 'fail'];
return response()->json($data, 200);
}
} }
public function storeFiles(AddFilesRequest $request){ public function storeFiles(AddFilesRequest $request){
$document_arr = $request->except('document'); $document_arr = $request->except('document');

View File

@@ -7,7 +7,7 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController; use Illuminate\Routing\Controller as BaseController;
use App\Models; use App\Models;
use Config;
class Controller extends BaseController{ class Controller extends BaseController{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
@@ -92,4 +92,20 @@ class Controller extends BaseController{
} }
return true; return true;
} }
public function hasAnyAccess($permissions){
// dump(Config::get('permissions.' ));
$required_permission = array_sum($permissions);
#$system_permissions = Models\Permission::where('status', 'active')->get();
if (session('current_user.permissions') <> '') {
if ((int)session('current_user.permissions') & $required_permission) {
return true;
}
else{
return false;
}
}
return false;
}
} }

View File

@@ -70,6 +70,7 @@ class LoginController extends Controller
$request->session()->put('current_otpuser.email', $logged_in->email); $request->session()->put('current_otpuser.email', $logged_in->email);
$request->session()->put('current_otpuser.phone', $logged_in->phone); $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.datetime_sent', date('Y-m-d H:i:s'));
$request->session()->put('current_otpuser.permissions', $logged_in->permissions);
$request->session()->put('current_otpuser.designation', $logged_in->designation_info->name); $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]; $otp_set = ['otp' => $otp_code, 'email' => $logged_in->email, 'auth_name' => $logged_in->name];
@@ -109,6 +110,7 @@ class LoginController extends Controller
$request->session()->put('current_user.name', $otp_user['name']); $request->session()->put('current_user.name', $otp_user['name']);
$request->session()->put('current_user.email', $otp_user['email']); $request->session()->put('current_user.email', $otp_user['email']);
$request->session()->put('current_user.phone', $otp_user['phone']); $request->session()->put('current_user.phone', $otp_user['phone']);
$request->session()->put('current_user.permissions', $otp_user['permissions']);
$request->session()->put('current_user.designation', $otp_user['designation']); $request->session()->put('current_user.designation', $otp_user['designation']);

View File

@@ -69,8 +69,8 @@ class NetworkOperatorsController extends Controller
public function getMnosJson(Request $request){ public function getMnosJson(Request $request){
//$this->log_query(); //$this->log_query();
$mno_arr = \DB::table('network_operators') $mno_arr = \DB::table('network_operators')
->join('staff_members AS staffam', 'staffam.id', '=', 'network_operators.account_manager_id') ->join('auth_users AS staffam', 'staffam.id', '=', 'network_operators.account_manager_id')
->join('staff_members AS staffmodify', 'staffmodify.id', '=', 'network_operators.last_modified_by') ->join('auth_users AS staffmodify', 'staffmodify.id', '=', 'network_operators.last_modified_by')
->select('network_operators.id', 'staffam.name AS accountManager', 'network_operators.name AS networkName', 'network_operators.country','network_operators.contract_validity', 'network_operators.connection_status', 'staffmodify.name AS modifiedBy') ->select('network_operators.id', 'staffam.name AS accountManager', 'network_operators.name AS networkName', 'network_operators.country','network_operators.contract_validity', 'network_operators.connection_status', 'staffmodify.name AS modifiedBy')
->orderBy('network_operators.name', 'ASC') ->orderBy('network_operators.name', 'ASC')
->paginate(15); ->paginate(15);
@@ -78,8 +78,8 @@ class NetworkOperatorsController extends Controller
if($request->has('keyword')){ if($request->has('keyword')){
$keyword = $request->keyword; $keyword = $request->keyword;
$mno_arr = \DB::table('network_operators') $mno_arr = \DB::table('network_operators')
->join('staff_members AS staffam', 'staffam.id', '=', 'network_operators.account_manager_id') ->join('auth_users AS staffam', 'staffam.id', '=', 'network_operators.account_manager_id')
->join('staff_members AS staffmodify', 'staffmodify.id', '=', 'network_operators.last_modified_by') ->join('auth_users AS staffmodify', 'staffmodify.id', '=', 'network_operators.last_modified_by')
->select('network_operators.id', 'staffam.name AS accountManager', 'network_operators.name AS networkName', 'network_operators.country','network_operators.contract_validity', 'network_operators.connection_status', 'staffmodify.name AS modifiedBy') ->select('network_operators.id', 'staffam.name AS accountManager', 'network_operators.name AS networkName', 'network_operators.country','network_operators.contract_validity', 'network_operators.connection_status', 'staffmodify.name AS modifiedBy')
->whereRaw("network_operators.name LIKE '%$keyword%' OR network_operators.connection_status LIKE '%$keyword%' OR network_operators.country LIKE '%$keyword%' OR staffam.name LIKE '%$keyword%' ") ->whereRaw("network_operators.name LIKE '%$keyword%' OR network_operators.connection_status LIKE '%$keyword%' OR network_operators.country LIKE '%$keyword%' OR staffam.name LIKE '%$keyword%' ")
->orderBy('network_operators.name', 'ASC') ->orderBy('network_operators.name', 'ASC')

View File

@@ -18,8 +18,9 @@ class OfficeLocationsController extends Controller
'offices_arr' => $offices_arr, 'offices_arr' => $offices_arr,
'current_user' => session('current_user') 'current_user' => session('current_user')
]; ];
// dd($data);
// dd($offices_arr->isEmpty()); // dd($offices_arr->isEmpty());
return view('officelocations.index', $data); return view('officelocations.index-new', $data);
} }
public function showfiles($id){ public function showfiles($id){
$branch_files = Models\BranchFile::where('branch_id', $id)->get(); $branch_files = Models\BranchFile::where('branch_id', $id)->get();
@@ -55,7 +56,7 @@ class OfficeLocationsController extends Controller
public function create() public function create()
{ {
$countries = Models\Country::pluck('en_short_name','en_short_name'); $countries = Models\Country::pluck('en_short_name','en_short_name');
$staffmembers = Models\StaffMember::pluck('name', 'id'); $staffmembers = Models\SystemUser::pluck('name', 'id'); //system users
$data = [ $data = [
'page_title' => 'Add Office Location', 'page_title' => 'Add Office Location',
'countries' => $countries, 'countries' => $countries,
@@ -85,7 +86,6 @@ class OfficeLocationsController extends Controller
'street_name' => 'sometimes', 'street_name' => 'sometimes',
'physical_address' => 'required', 'physical_address' => 'required',
'postal_address' => 'required', 'postal_address' => 'required',
'block_number' => 'sometimes',
'city_town' => 'required', 'city_town' => 'required',
'country' => 'required|unique:office_locations,country', 'country' => 'required|unique:office_locations,country',
'country_manager_id' => 'required', 'country_manager_id' => 'required',
@@ -102,6 +102,7 @@ class OfficeLocationsController extends Controller
$office_arr['user_id'] = session('current_user.id'); $office_arr['user_id'] = session('current_user.id');
$office_arr['flag_url'] = $flag_url; $office_arr['flag_url'] = $flag_url;
$office_arr['city'] = $request->city_town;
$result = Models\OfficeLocation::create($office_arr); $result = Models\OfficeLocation::create($office_arr);
Session::flash('success_message', 'Office Location successfully added'); Session::flash('success_message', 'Office Location successfully added');
return redirect(url('officelocations')); return redirect(url('officelocations'));
@@ -133,13 +134,13 @@ class OfficeLocationsController extends Controller
'country_manager_id' => 'required', 'country_manager_id' => 'required',
'office_phone' => 'required' 'office_phone' => 'required'
]); ]);
// dd($request->all());
$office = Models\OfficeLocation::findOrFail($id); $office = Models\OfficeLocation::findOrFail($id);
$office->street_name = $request->street_name ?? ""; $office->street_name = $request->street_name ?? "";
$office->physical_address = $request->physical_address; $office->physical_address = $request->physical_address;
$office->postal_address = $request->postal_address; $office->postal_address = $request->postal_address;
$office->block_number = $request->block_number; $office->city = $request->city_town;
$office->country = $request->country; $office->country = $request->country;
$office->country_manager_id = $request->country_manager_id; $office->country_manager_id = $request->country_manager_id;
$office->office_phone = $request->office_phone; $office->office_phone = $request->office_phone;
@@ -208,10 +209,12 @@ class OfficeLocationsController extends Controller
$request->validate([ $request->validate([
'document_one_name' => 'required', 'document_one_name' => 'required',
'id' => 'required', 'id' => 'required',
'validity_period_one' => 'sometimes',
'document_one' => 'max:10240|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx,pptx,ppt', 'document_one' => 'max:10240|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx,pptx,ppt',
]); ]);
$document = Models\BranchFile::findOrFail($request->id); $document = Models\BranchFile::findOrFail($request->id);
$document->name = $request->document_one_name; $document->name = $request->document_one_name;
$document->validity_period = $request->validity_period_one;
if ($request->has('document_one')) { if ($request->has('document_one')) {
if ($request->file('document_one')->isValid()) { 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();

View File

@@ -6,7 +6,7 @@ use Illuminate\Http\Request;
use App\Models; use App\Models;
use Session; use Session;
use Excel; use Excel;
use App\Imports\Senderidimport; use App\Imports\SenderidImport;
use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\File;
class SenderIdController extends Controller class SenderIdController extends Controller
@@ -35,8 +35,10 @@ class SenderIdController extends Controller
->paginate(15); ->paginate(15);
if($request->has('keyword')){ if($request->has('keyword')){
$queries = []; $queries = [];
$keyword = $request->keyword; $keyword = $request->keyword;
$request->session()->put('current_user.senderid_keyword', $keyword);
$queries['keyword'] = $keyword; $queries['keyword'] = $keyword;
$senderid_arr = \DB::table('sender_ids') $senderid_arr = \DB::table('sender_ids')
->join('staff_members AS staffcreate', 'staffcreate.id', '=', 'sender_ids.created_by') ->join('staff_members AS staffcreate', 'staffcreate.id', '=', 'sender_ids.created_by')
@@ -109,13 +111,34 @@ class SenderIdController extends Controller
'status' => 'required', 'status' => 'required',
'remarks' => 'sometimes', 'remarks' => 'sometimes',
]); ]);
// dump($request->all());
/*
$check_duplicate = Models\SenderId::where('senderid', $request->senderid) $check_duplicate = Models\SenderId::where('senderid', $request->senderid)
->where('mno_name', $request->mno_name) ->where('mno_name', $request->mno_name)
->first(); ->first();
*/
$check_duplicate = Models\SenderId::where('senderid', $request->senderid)->first();
// dd($check_duplicate);
if ($check_duplicate) { if ($check_duplicate) {
// code...
if ($request->direct_mno == 'YES' && $check_duplicate->direct_mno == 'YES') {
if ($request->mno_name == $check_duplicate->mno_name) {
return redirect()->back()->withInput()->withErrors("Sender ID already exist for " . $request->mno_name ); return redirect()->back()->withInput()->withErrors("Sender ID already exist for " . $request->mno_name );
} }
}
if ($request->direct_mno == 'NO' && $check_duplicate->direct_mno == 'NO') {
if ($request->supplier_name == $check_duplicate->supplier_name) {
return redirect()->back()->withInput()->withErrors("Sender ID already exist for " . $request->supplier_name );
}
}
}
// dd('foo stop');
// if($check_duplicate){
// return redirect()->back()->withInput()->withErrors("Sender ID already exist for " . $request->mno_name );
// }
$senderid_arr = $request->except('_token'); $senderid_arr = $request->except('_token');
$senderid_arr['created_by'] = session('current_user.id'); $senderid_arr['created_by'] = session('current_user.id');
@@ -179,7 +202,7 @@ class SenderIdController extends Controller
$request->senderid_file->storeAs('general_files', $filename, 'public'); $request->senderid_file->storeAs('general_files', $filename, 'public');
$stored_file = public_path('documents/general_files/'.$filename); $stored_file = public_path('documents/general_files/'.$filename);
$extracted_arr = Excel::toArray(new Senderidimport, $stored_file); $extracted_arr = Excel::toArray(new SenderidImport, $stored_file);
// dd($extracted_arr[0]); // dd($extracted_arr[0]);
$row_count = $extracted_arr[0]; $row_count = $extracted_arr[0];
$main = []; $main = [];
@@ -227,6 +250,7 @@ class SenderIdController extends Controller
// dd('foo bar'); // dd('foo bar');
$senderid_arr['senderid'] = $value['senderid']; $senderid_arr['senderid'] = $value['senderid'];
$senderid_arr['mno_name'] = $value['mno_name']; $senderid_arr['mno_name'] = $value['mno_name'];
$senderid_arr['status'] = $value['status'];
$senderid_arr['created_by'] = session('current_user.id'); $senderid_arr['created_by'] = session('current_user.id');
$senderid_arr['last_modified_by'] = session('current_user.id'); $senderid_arr['last_modified_by'] = session('current_user.id');
$senderid_arr['remarks'] = $value['remarks']; $senderid_arr['remarks'] = $value['remarks'];
@@ -235,6 +259,7 @@ class SenderIdController extends Controller
else{ else{
$senderid_arr['senderid'] = $value['senderid']; $senderid_arr['senderid'] = $value['senderid'];
$senderid_arr['supplier_name'] = $value['supplier_name']; $senderid_arr['supplier_name'] = $value['supplier_name'];
$senderid_arr['status'] = $value['status'];
$senderid_arr['created_by'] = session('current_user.id'); $senderid_arr['created_by'] = session('current_user.id');
$senderid_arr['last_modified_by'] = session('current_user.id'); $senderid_arr['last_modified_by'] = session('current_user.id');
$senderid_arr['remarks'] = $value['remarks']; $senderid_arr['remarks'] = $value['remarks'];
@@ -261,7 +286,7 @@ class SenderIdController extends Controller
return \Response::download($file, 'Sender ID Upload Report', $headers); return \Response::download($file, 'Sender ID Upload Report', $headers);
} }
public function getSampleFile(){ public function getSampleFile(){
$file = public_path('documents/general_files/senderid_sample_file.xlsx'); $file = public_path('helper_documents/senderid_sample_file.xlsx');
#$extension = pathinfo($file, PATHINFO_EXTENSION); #$extension = pathinfo($file, PATHINFO_EXTENSION);
$headers = ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; $headers = ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
@@ -374,6 +399,65 @@ class SenderIdController extends Controller
} }
} }
public function exportSenderIdCsv(){
$fileName = 'senderid_list.csv';
$users = Models\SenderId::all()->toArray(); // Adjust model as needed
$headers = [
'Content-Type' => 'text/csv',
'Content-Disposition' => "attachment; filename=\"$fileName\"",
'Pragma' => 'no-cache',
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
'Expires' => '0',
];
$keyword = session('current_user.senderid_keyword');
// dd(request('keyword'));
// dd($keyword);
request()->session()->put('current_user.senderid_keyword', null);
// dump($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')
->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')
->get()->toArray();
// dd($senderid_arr);
# add headers for each column in the CSV download
array_unshift($senderid_arr, array_keys((array)$senderid_arr[0]));
$callback = function() use ($senderid_arr){
$file_handle = fopen('php://output', 'w');
foreach ($senderid_arr as $row) {
$row = (array)$row;
fputcsv($file_handle, $row);
}
fclose($file_handle);
};
// return Response::stream($callback, 200, $headers);
return response()->stream($callback, 200, $headers);
// $callback = function() use ($senderid_arr) {
// $file = fopen('php://output', 'w');
// // Add CSV headers
// fputcsv($file, array_keys($senderid_arr[0]));
// // Add data rows
// foreach ($senderid_arr as $row) {
// fputcsv($file, $row);
// }
// fclose($file);
// };
// return response()->stream($callback, 200, $headers);
}
public function getMNOList($type){ public function getMNOList($type){
if ($type == 'YES') { if ($type == 'YES') {

View File

@@ -0,0 +1,273 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models;
use Session;
use Illuminate\Support\Facades\File;
class SupportTicketsController extends Controller
{
//
public function index(){
$data = [
'page_title' => 'Support Tickets Home',
'current_user' => session('current_user')
];
return view('support-ticket.landing', $data);
}
public function ticketlist(){
$data = [
'page_title' => 'Support Tickets List',
'current_user' => session('current_user')
];
return view('support-ticket.index', $data);
}
public function getSuppoerTicketJson(Request $request)
{
#$this->log_query();
$supportticket_arr = \DB::table('support_tickets')
->join('staff_members AS staffcreate', 'staffcreate.id', '=', 'support_tickets.created_by_id')
->join('staff_members AS assignedTo', 'assignedTo.id', '=', 'support_tickets.assigned_to_id')
// ->join('network_operators', 'network_operators.id', '=', 'support_tickets.network_id')
// ->join('clients', 'clients.id', '=', 'support_tickets.client_id')
->select('support_tickets.id', 'support_tickets.case_number', 'support_tickets.subject', 'support_tickets.body', 'support_tickets.created_by_id', 'support_tickets.status', 'support_tickets.created_at', 'support_tickets.assigned_to_id', 'staffcreate.name As createdBy', 'assignedTo.name AS assignedToName')
->orderBy('support_tickets.id', 'ASC')
->paginate(15);
if($request->has('keyword')){
$queries = [];
$keyword = $request->keyword;
$queries['keyword'] = $keyword;
$supportticket_arr = \DB::table('support_tickets')
->join('staff_members AS staffcreate', 'staffcreate.id', '=', 'support_tickets.created_by_id')
->join('staff_members AS assignedTo', 'assignedTo.id', '=', 'support_tickets.assigned_to_id')
->select('support_tickets.id', 'support_tickets.case_number', 'support_tickets.subject', 'support_tickets.body', 'support_tickets.created_by_id', 'support_tickets.status', 'support_tickets.created_at', 'support_tickets.assigned_to_id', 'staffcreate.name As createdBy', 'assignedTo.name AS assignedToName')
->whereRaw("support_tickets.case_number LIKE '%$keyword%' OR assignedTo.name LIKE '%$keyword%' OR support_tickets.status LIKE '%$keyword%' OR support_tickets.body LIKE '%$keyword%' OR staffcreate.name LIKE '%$keyword%' OR support_tickets.created_at LIKE '%$keyword%'")
->orderBy('support_tickets.id', 'ASC')
->paginate(15)->appends($queries);
}
return response()->json($supportticket_arr);
}
public function create()
{
#$network_arr = Models\NetworkOps::pluck('name','country');
$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', '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 = ['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,
'status' => $status,
'clients' => $client_arr,
'direct_mno_arr' => $direct_mno_arr,
'staffmembers' => $staffmembers
];
// dd($data);
return view('support-ticket.create', $data);
}
public function store(Request $request)
{
$request->validate([
'subject' => 'sometimes',
'body' => 'required',
'attachment' => 'sometimes',
//max:10240|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx,pptx,ppt
]);
// dd($request->all());
//Generate case number here
$case_number = "ERP-" . date('Y-m-d-') . time();
$ticket_arr = $request->except('_token');
$ticket_arr['case_number'] = $case_number;
$ticket_arr['assigned_to_id'] = 1; // change this
$ticket_arr['created_by_id'] = session('current_user.id'); // change this
$result = Models\SupportTicket::create($ticket_arr);
if ($request->attachment !== null) {
if ($request->file('attachment')->isValid()) {
//dd($request->all());
$filename = "erp_" . time() . str_random(4) . "." . $request->attachment->extension();
$request->attachment->storeAs('supportticket_files', $filename, 'public');
$document_arr['filename'] = $filename;
$document_arr['file_extension'] = $request->document_one->extension();
$document_arr['file_reff'] = time() . uniqid();
$document_arr['case_number'] = $case_number;
$document_arr['uploaded_by'] = session('current_user.id');
$result = Models\SupportTicketsDocument::create($document_arr);
}
}
Session::flash('success_message', 'Support Ticket successfully created');
return redirect(url('supporttickets/list'));
}
public function edit($id){
$support_ticket = Models\SupportTicket::findOrFail($id);
$data = [
'page_title' => 'Edit Support',
'support_ticket' => $support_ticket,
];
return view('support-ticket.edit', $data);
}
public function update(Request $request, $id)
{
$request->validate([
'subject' => 'sometimes',
'body' => 'required',
'attachment' => 'sometimes',
]);
$support_ticket = Models\SupportTicket::findOrFail($id);
$support_ticket->body = $request->body;
$support_ticket->body = $request->subject;
$support_ticket->save();
Session::flash('success_message', 'Support Ticket successfully Updated');
return redirect(url('supporttickets/list'));
}
public function fileStore(Requests\BranchFilesRequest $request)
{
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();
$request->document_one->storeAs('branch_files', $filename, 'public');
$document_arr['filename'] = $filename;
$document_arr['branch_id'] = $request->branch_id;
$document_arr['file_path'] = $filename;
$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);
}
}
if ($request->has('document_two') && $request->has('document_two_name')) {
if ($request->file('document_two')->isValid()) {
$filename = "erp_" . time() . str_random(6) . "." . $request->document_two->extension();
$request->document_two->storeAs('branch_files', $filename, 'public');
$document_arr['filename'] = $filename;
$document_arr['branch_id'] = $request->branch_id;
$document_arr['file_path'] = $filename;
$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);
}
}
if ($request->has('document_three') && $request->has('document_three_name')) {
if ($request->file('document_three')->isValid()) {
$filename = "erp_" . time() . str_random(6) . "." . $request->document_three->extension();
$request->document_three->storeAs('branch_files', $filename, 'public');
$document_arr['filename'] = $filename;
$document_arr['branch_id'] = $request->branch_id;
$document_arr['file_path'] = $filename;
$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);
}
}
Session::flash('success_message', 'Document(s) successfully uploaded');
return redirect(url('supporttickets/list'));
}
public function filesUpdate(Request $request)
{
$request->validate([
'document_one_name' => 'required',
'id' => 'required',
'validity_period_one' => 'sometimes',
'document_one' => 'max:10240|mimes:png,jpg,jpeg,bmp,pdf,doc,docx,xlx,xlsx,pptx,ppt',
]);
$document = Models\BranchFile::findOrFail($request->id);
$document->name = $request->document_one_name;
$document->validity_period = $request->validity_period_one;
if ($request->has('document_one')) {
if ($request->file('document_one')->isValid()) {
$filename = "erp_" . time() . str_random(6) . "." . $request->document_one->extension();
$request->document_one->storeAs('branch_files', $filename, 'public');
$document->file_path = $filename;
$document->file_extension = $request->document_one->extension();
$document->file_reff = time() . uniqid();
//$document->name = $request->document_one_name;
$document->uploaded_by = session('current_user.id');
}
}
$result = $document->save();
Session::flash('success_message', 'Document(s) successfully updated');
return redirect(url('supporttickets/list'));
}
public function show_edit_files_form($id){
$document = Models\BranchFile::findOrFail($id);
$data = [
'page_title' => 'Update Document',
'document' => $document
];
return view('supporttickets.filesedit', $data);
}
public function getDocument($id)
{
$branch_file = Models\BranchFile::with('branch_info')->findOrFail($id);
$file = public_path('documents/branch_files/') . $branch_file->file_path;
$headers = []; //['Content-Type: application/pdf'];
$filename = $branch_file->branch_info->name . "_" . $branch_file->name;
$filename = $this->cleanStr($filename);
$filename = $filename . "." . $branch_file->file_extension;
// $filename = str_replace(' ', '_', $filename);
return \Response::download($file, $filename, $headers);
}
public function cleanStr($string){
// Replaces all spaces with hyphens.
$string = str_replace(' ', '-', $string);
// Removes special chars.
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string);
// Replaces multiple hyphens with single one.
$string = preg_replace('/-+/', '_', $string);
return $string;
}
}

View File

@@ -6,7 +6,7 @@ use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\ToCollection; use Maatwebsite\Excel\Concerns\ToCollection;
use Maatwebsite\Excel\Concerns\WithHeadingRow; use Maatwebsite\Excel\Concerns\WithHeadingRow;
class Senderidimport implements ToCollection, WithHeadingRow class SenderidImport implements ToCollection, WithHeadingRow
{ {
/** /**
* @param Collection $collection * @param Collection $collection

View File

@@ -9,9 +9,10 @@ class OfficeLocation extends Model
protected $guarded = array('id'); protected $guarded = array('id');
public function created_by_info(){ public function created_by_info(){
return $this->hasOne('App\Models\StaffMember', 'id', 'user_id'); return $this->hasOne('App\Models\SystemUser', 'id', 'user_id');
} }
public function country_manager_info(){ public function country_manager_info(){
return $this->hasOne('App\Models\StaffMember', 'id', 'country_manager_id'); // return $this->hasOne('App\Models\StaffMember', 'id', 'country_manager_id');
return $this->hasOne('App\Models\SystemUser', 'id', 'country_manager_id');
} }
} }

11
app/Models/Permission.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
protected $guarded = array('id');
public $table = "hlp_permissions";
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SupportTicket extends Model
{
protected $guarded = array('id');
public $table = "support_tickets";
public function modified_by_info(){
return $this->hasOne('App\Models\StaffMember', 'id', 'last_modified_by');
}
public function created_by_info(){
return $this->hasOne('App\Models\StaffMember', 'id', 'created_by');
}
public function assignedTo(){
return $this->hasOne('App\Models\StaffMember', 'id', 'assigned_to');
}
}

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SupportTicketsDocument extends Model
{
//
protected $guarded = array('id');
public $table = "support_ticket_attachments";
}

18
config/permissions.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
return [
'SUPER_ADMIN' => 1,
'VIEW_USERS' => 2,
'ADD_EDIT_REMOVE_USERS' => 4,
'MANAGE_CLIENTS' => 8,
'MANAGE_MNOS' => 16,
'MANAGE_SHORT_CODES' => 32,
'MANAGE_SENDER_IDS' => 64,
'MANAGE_VPN_CONFIGS' => 128,
'MANAGE_BRANCH_OFFICES' => 256,
'MANAGE_UTILITIES' => 512,
'MANAGE_TEAM_MEMBERS' => 1024,
'CHANGE_ACCOUNT_MANAGERS' => 2048,
];
?>

View File

@@ -144,6 +144,12 @@ $(document).ready(function(){
evt.preventDefault(); evt.preventDefault();
$('#supportFeesFormModal').modal('show'); $('#supportFeesFormModal').modal('show');
}); });
$('#changeAmTrigBtn').click(function(evt){
evt.preventDefault();
$('#changeAmModal').modal('show');
});
$('.paymentEntryEditBtn').click(function(tve){ $('.paymentEntryEditBtn').click(function(tve){
tve.preventDefault(); tve.preventDefault();
//var theIDD = $("input[name=payment_entry_id]").val(); //var theIDD = $("input[name=payment_entry_id]").val();
@@ -593,6 +599,49 @@ $(document).ready(function(){
} }
}); });
}); });
$('#changeAmForm').submit(function(evt){
evt.preventDefault();
var formData = new FormData($(this)[0]);
$.ajax({
type: "POST",
url: base_url + '/clients/changeam',
data : formData,
processData: false,
contentType: false,
async: false,
success: function (data){
if (data.code === 1) {
$.alert({
title: 'Alert!',
content: 'Account Manager successfully changed',
});
setTimeout(function(){
location.reload();
}, 8000);
}
else if (data.code > 1) {
$.alert({
title: 'Alert!',
content: data.msg,
});
}
else {
$.alert({
title: 'Alert!',
content: 'Your request could not be handled. Try again !',
});
}
},
error: function (data) {
var output = $.parseJSON(data.responseText);
console.log(output);
},
fail : function(errordata){
console.log(errordata);
}
});
});
$('#newSenderIdForm').submit(function(evt){ $('#newSenderIdForm').submit(function(evt){
evt.preventDefault(); evt.preventDefault();

View File

@@ -1,16 +0,0 @@
[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.

View File

@@ -1,44 +1,94 @@
$(document).ready(function(){ $(document).ready(function(){
$('#resetBtn').click(function(){
console.log('foo bar');
location.reload();
});
var directMnoSelectionEditStart = $('#directMnoEdit').val(); var directMnoSelectionStart = $('#directMno').val();
console.log(directMnoSelectionEditStart + " at rest"); if (directMnoSelectionStart !== undefined) {
if (directMnoSelectionEditStart == 'YES') { // #console.log(directMnoSelectionStart + " at rest");
$('#mnoDivEdit').removeClass('hidden'); if (directMnoSelectionStart == 'YES') {
$('#supplierDivEdit').addClass('hidden'); // $('#mnoDiv').removeClass('hidden');
// $("#supplierNameEdit").prop("disabled", true); // $('#supplierDiv').addClass('hidden');
// $("#networkNameEdit").prop("disabled", false); $('#supplierName').attr('required', false);
$('#supplierName').attr('disabled', true);
$('#networkName').attr('disabled', false);
} }
else if(directMnoSelectionEditStart == 'NO'){ else if(directMnoSelectionStart == 'NO'){
console.log('in the NO | at rest'); // console.log('in the NO in Create | at rest');
$('#supplierDivEdit').removeClass('hidden'); // $('#supplierDiv').removeClass('hidden');
$('#mnoDivEdit').addClass('hidden'); // $('#mnoDiv').addClass('hidden');
// $("#supplierNameEdit").prop("disabled", false); $('#networkName').attr('required', false);
// $("#networkNameEdit").prop("disabled", true); $('#networkName').attr('disabled', true);
$('#supplierName').attr('disabled', false);
} }
else{ else{
console.log('do nothing | at rest'); console.log('do nothing in create | at rest');
}
}
//Edit
var directMnoSelectionEditStart = $('#directMnoEdit').val();
if (directMnoSelectionEditStart !== undefined) {
// console.log(directMnoSelectionEditStart + " at rest");
if (directMnoSelectionEditStart == 'YES') {
// $('#mnoDivEdit').removeClass('hidden');
// $('#supplierDivEdit').addClass('hidden');
$('#supplierNameEdit').attr('required', false);
$('#supplierNameEdit').attr('disabled', false);
$('#networkNameEdit').attr('disabled', true);
}
else if(directMnoSelectionEditStart == 'NO'){
console.log('in the NO in Edit | at rest');
// $('#supplierDivEdit').removeClass('hidden');
// $('#mnoDivEdit').addClass('hidden');
$('#networkNameEdit').attr('required', false);
$('#networkNameEdit').attr('disabled', true);
$('#supplierNameEdit').attr('disabled', false);
}
else{
console.log('do nothing in Edit | at rest');
}
} }
//Create
$('#directMno').change(function(tve){ $('#directMno').change(function(tve){
tve.preventDefault(); tve.preventDefault();
// var theIDD = $(this).siblings('.shortCodeEntryRowId').val(); // var theIDD = $(this).siblings('.shortCodeEntryRowId').val();
var directMnoSelection = $(this).val(); var directMnoSelection = $(this).val();
// console.log('User selection ' + directMnoSelection);
if (directMnoSelection == 'YES') { if (directMnoSelection == 'YES') {
$('#mnoDiv').removeClass('hidden'); // $('#mnoDiv').removeClass('hidden');
$('#supplierDiv').addClass('hidden'); // $('#supplierDiv').addClass('hidden');
$('#mnoDivEdit').removeClass('hidden'); // $('#mnoDivEdit').removeClass('hidden');
// // $('#supplierNameMM').val('').change();
// $('#supplierNameMM').remove();
// $('#supplierDiv').remove();
$('#supplierName').attr('required', false);
$('#supplierName').attr('disabled', true);
$('#networkName').attr('disabled', false);
// $("#supplierName").prop("disabled", true); // $("#supplierName").prop("disabled", true);
// $("#networkNameEdit").prop("disabled", false); // $("#networkNameEdit").prop("disabled", false);
} }
else{ else{
$('#supplierDiv').removeClass('hidden'); // $('#supplierDiv').removeClass('hidden');
$('#mnoDiv').addClass('hidden'); // $('#mnoDiv').addClass('hidden');
$('#mnoDivEdit').addClass('hidden'); // $('#mnoDivEdit').addClass('hidden');
// $('#networkNameMM').val('').change();
// $('#mnoDiv').remove();
// $("#networkName").prop("disabled", true); // $("#networkName").prop("disabled", true);
// $("#supplierNameEdit").prop("disabled", false); // $("#supplierNameEdit").prop("disabled", false);
$('#networkName').attr('disabled', true);
$('#networkName').attr('required', false);
$('#supplierName').attr('disabled', false);
} }
@@ -48,21 +98,28 @@ $(document).ready(function(){
$('#directMnoEdit').change(function(tve){ $('#directMnoEdit').change(function(tve){
tve.preventDefault(); tve.preventDefault();
var directMnoSelectionEdit = $(this).val(); var directMnoSelectionEdit = $(this).val();
console.log(directMnoSelectionEdit); // console.log(directMnoSelectionEdit);
if (directMnoSelectionEdit == 'YES') { if (directMnoSelectionEdit == 'YES') {
$('#mnoDivEdit').removeClass('hidden'); // $('#mnoDivEdit').removeClass('hidden');
$('#supplierDivEdit').addClass('hidden'); // $('#supplierDivEdit').addClass('hidden');
// $("#supplierNameEdit").prop("disabled", true); // $("#supplierNameEdit").prop("disabled", true);
// $("#networkNameEdit").prop("disabled", false); // $("#networkNameEdit").prop("disabled", false);
$('#supplierNameEdit').attr('required', false);
$('#supplierNameEdit').attr('disabled', false);
$('#networkNameEdit').attr('disabled', true);
} }
else if(directMnoSelectionEdit == 'NO'){ else if(directMnoSelectionEdit == 'NO'){
console.log('in the NO | on change'); console.log('in the NO | on change');
$('#supplierDivEdit').removeClass('hidden'); // $('#supplierDivEdit').removeClass('hidden');
// $('#networkNameEdit').removeClass('hidden'); // $('#networkNameEdit').removeClass('hidden');
// $('#mnoDivEdit').addClass('hidden'); // $('#mnoDivEdit').addClass('hidden');
$('#networkNameEdit').addClass('hidden'); // $('#networkNameEdit').addClass('hidden');
// $("#supplierNameEdit").prop("disabled", false); // $("#supplierNameEdit").prop("disabled", false);
// $("#networkNameEdit").prop("disabled", true); // $("#networkNameEdit").prop("disabled", true);
$('#networkNameEdit').attr('required', false);
$('#networkNameEdit').attr('disabled', true);
$('#supplierNameEdit').attr('disabled', false);
} }
else{ else{
console.log('do nothing | on change'); console.log('do nothing | on change');

0
public/assets/js/support_ticket.js vendored Normal file
View File

Binary file not shown.

View File

@@ -0,0 +1,42 @@
<div class="modal fade" id="changeAmModal" tabindex="-1" role="dialog" aria-labelledby="changeAmModalLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title text-center" id="changeAmModalLabelHeading">Change Account Manager</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="form-vertical" method="POST" id="changeAmForm" action="{{ url('clients/changeam') }}">
{{ csrf_field() }}
<input type="hidden" name="client_id" id="changeAmFormClientId" value="{{ $showclient->id }}">
<div class="row">
<div class="form-group">
<div class="col-md-12" style="padding-bottom: 20px">
<label for="changeAmList">Accouont Manager *</label>
{!! Form::select('account_manager', $am_list_arr, old('auth_user_id'), ['class' => 'form-control' , 'placeholder' => 'Select new account manager', 'id' => 'changeAmList', 'required' => 'required', 'style' => 'width: 100%']) !!}
</div>
</div>
<br>
<div class="form-group" style="margin-bottom: 0.2rem; padding-bottom: 5px; padding-top: 5px;">
<div class="col-md-12" style="padding-bottom: 10px;">
<button type="submit" class="btn btn-success btn-block" id="changeAmFormEditBtn"> <i class="fa fa-send"></i> Submit</button>
</div>
</div>
<br>
<div class="form-group" style="margin-bottom: 0.5rem; padding-bottom: 5px; padding-top: 5px;">
<div class="col-md-12">
<button type="button" class="btn btn-dark btn-block" data-dismiss="modal"><i class="fa fa-close"></i> Close</button>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->

View File

@@ -60,7 +60,9 @@
<h3>{{ $showclient->name }}</h3> <h3>{{ $showclient->name }}</h3>
<div class="well" style="border-radius: 25px;"> <div class="well" style="border-radius: 25px;">
Click Account Manager <br> Click Account Manager <br>
<strong><em> <?php echo $showclient->auth_user_info->name ?? 'N/A' ?> </em></strong> <strong>
<em> <?php echo $showclient->auth_user_info->name ?? 'N/A' ?> </em>
</strong>
</div> </div>
<h4> <h4>
Status : <span class="label label-{{ $status_bg }}">{{ $showclient->status }}</span>&nbsp; Status : <span class="label label-{{ $status_bg }}">{{ $showclient->status }}</span>&nbsp;

View File

@@ -17,6 +17,7 @@
@include('client.partials.edit-finance') @include('client.partials.edit-finance')
@include('client.partials.progress_indicator_details') @include('client.partials.progress_indicator_details')
@include('client.partials.support_fees_form') @include('client.partials.support_fees_form')
@include('client.partials.change-am')
<div class=""> <div class="">
<div class="x_content"> <div class="x_content">
<div class="col-md-12 col-sm-12 col-xs-12"> <div class="col-md-12 col-sm-12 col-xs-12">
@@ -77,7 +78,12 @@
Client Account Manager : <strong><em> <?php echo $showclient->contact_person ?? 'N/A' ?> </em></strong> Client Account Manager : <strong><em> <?php echo $showclient->contact_person ?? 'N/A' ?> </em></strong>
</div> </div>
<div class=""> <div class="">
Click Account Manager : <strong><em> <?php echo $showclient->auth_user_info->name ?? 'N/A' ?> </em></strong> Click Account Manager :
<strong><em> <?php echo $showclient->auth_user_info->name ?? 'N/A' ?> </em>
@if($change_account_mgr_permisson == 'YES' )
<button class="btn btn-success btn-xs" id="changeAmTrigBtn"><i class="fa fa-edit m-right-xs"></i></button>
@endif
</strong>
</div> </div>
<ul class="list-unstyled user_data"> <ul class="list-unstyled user_data">
<li> <li>

View File

@@ -62,6 +62,8 @@
<!-- </li> --> <!-- </li> -->
<li><a href="{!! url('clickapps') !!}"><i class="fa fa-code"></i> Click Apps </a></li> <li><a href="{!! url('clickapps') !!}"><i class="fa fa-code"></i> Click Apps </a></li>
<li><a href="{!! url('supporttickets') !!}"><i class="fa fa-ticket"></i> Support Center</a></li>
<li><a href="{!! url('infrastructure/vpn') !!}"><i class="fa fa-shield"></i> VPN Configs </a></li> <li><a href="{!! url('infrastructure/vpn') !!}"><i class="fa fa-shield"></i> VPN Configs </a></li>
<li><a href="{!! url('ussdclients') !!}"><i class="fa fa-money"></i> USSD Clients Payments</a></li> <li><a href="{!! url('ussdclients') !!}"><i class="fa fa-money"></i> USSD Clients Payments</a></li>
<li><a href="{!! url('staffmembers') !!}"><i class="fa fa-users"></i> Team Members</a></li> <li><a href="{!! url('staffmembers') !!}"><i class="fa fa-users"></i> Team Members</a></li>

View File

@@ -50,13 +50,7 @@
{!! $errors->first('postal_address', '<p class="help-block">:message</p>') !!} {!! $errors->first('postal_address', '<p class="help-block">:message</p>') !!}
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">Block Number</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}">
{!! Form::text('block_number', old('block_number'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter block number' , 'id' => 'blockNumber']) !!}
{!! $errors->first('block_number', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">City/Town *</label> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">City/Town *</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}"> <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}">

View File

@@ -57,13 +57,7 @@
{!! $errors->first('postal_address', '<p class="help-block">:message</p>') !!} {!! $errors->first('postal_address', '<p class="help-block">:message</p>') !!}
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">Block Number</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}">
{!! Form::text('block_number', old('block_number'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter block number' , 'id' => 'blockNumber']) !!}
{!! $errors->first('block_number', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">City/Town *</label> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">City/Town *</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}"> <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}">

View File

@@ -121,7 +121,7 @@
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="form-group"> <div class="form-group">
<div class="col-md-12 col-sm-12 col-xs-12 btn-block"> <div class="col-md-12 col-sm-12 col-xs-12 btn-block">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Upload</button> <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Save</button>
</div> </div>
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}

View File

@@ -31,7 +31,7 @@
<input type="hidden" name="id" value="{{ $document->id }}"> <input type="hidden" name="id" value="{{ $document->id }}">
<div class="row"> <div class="row">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<div class=" {{ $errors->has('how_we_got_client_other') ? 'has-error' : ''}}"> <div class=" {{ $errors->has('how_we_got_client_other') ? 'has-error' : ''}}">
<label class="" for="documentOneName">Document Name</label> <label class="" for="documentOneName">Document Name</label>
@@ -40,7 +40,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group">
<div class=" {{ $errors->has('validity_period_one') ? 'has-error' : ''}}">
<label class="" for="validityPeriodOne">Expiry Date</label>
{!! Form::text('validity_period_one', null, ['class' => 'form-control validityPeriod' , 'id' => 'validityPeriodOne', 'placeholder' => '']) !!}
{!! $errors->first('validity_period_one', '<p class="help-block">:message</p>') !!}
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group"> <div class="form-group">
<div class=" {{ $errors->has('document_one') ? 'has-error' : ''}}"> <div class=" {{ $errors->has('document_one') ? 'has-error' : ''}}">
<label class="" for="documentOne">Document</label> <label class="" for="documentOne">Document</label>
@@ -53,7 +62,7 @@
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="form-group"> <div class="form-group">
<div class="col-md-12 col-sm-12 col-xs-12 btn-block"> <div class="col-md-12 col-sm-12 col-xs-12 btn-block">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Upload</button> <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Save</button>
</div> </div>
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}
@@ -71,6 +80,9 @@
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
//$('select').select2(); //$('select').select2();
$('.validityPeriod').datetimepicker({
format: 'YYYY-MM-DD'
});
}); });
</script> </script>

View File

@@ -0,0 +1,123 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('css')
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left">
<div class="title_left">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active">Branch Offices</li>
</ol>
</div>
</div>
<div class="title_right">
<div class="row">
<form method="GET" action="{!! url('senderids') !!}">
<div class="col-md-5 col-sm-5 col-xs-12 form-group">
<div style="margin-top:1px; margin-right:-90px;" class="top_search">
</div>
</div>
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search" style="margin-top: -2px;">
<div class="input-group">
<input type="text" name="keyword" class="form-control" id="keywordField" placeholder="Keyword here...">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary" style="color: #fff;" type="button">Go!</button>
</span>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-sm-12">
<div class="pull-right"></div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
@include('commons.notifications')
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Branch Offices</h2>
<div class="pull-right">
<a class="btn btn-primary btn-sm" href="{!! url('officelocations/create') !!}"><i class="fa fa-plus-circle"></i> New Branch Office</a>
</div>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div id="" class="row">
@if($offices_arr->isEmpty() == false)
@foreach($offices_arr as $row)
<div class="col-md-4 col-sm-4 col-xs-12 profile_details">
<div class="well profile_view">
<div class="col-sm-12">
<h4 class="brief"><i>Digital Strategist</i></h4>
<div class="left col-xs-7">
<h2>Nicole Pearson</h2>
<p><strong>About: </strong> Web Designer / UX / Graphic Artist / Coffee Lover </p>
<ul class="list-unstyled">
<li><i class="fa fa-building"></i> Address: </li>
<li><i class="fa fa-phone"></i> Phone #: </li>
</ul>
</div>
<div class="right col-xs-5 text-center">
<img src="images/img.jpg" alt="" class="img-circle img-responsive">
</div>
</div>
<div class="col-xs-12 bottom text-center">
<div class="col-xs-12 col-sm-6 emphasis">
<p class="ratings">
<a>4.0</a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star-o"></span></a>
</p>
</div>
<div class="col-xs-12 col-sm-6 emphasis">
<button type="button" class="btn btn-success btn-xs"> <i class="fa fa-user">
</i> <i class="fa fa-comments-o"></i> </button>
<button type="button" class="btn btn-primary btn-xs">
<i class="fa fa-user"> </i> View Profile
</button>
</div>
</div>
</div>
</div>
@endforeach
@else
<div class="col-md-12">
<p>No Records</p>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function(){
});
</script>
@endsection

View File

@@ -60,10 +60,9 @@
<div id="" class="row"> <div id="" class="row">
@if($offices_arr->isEmpty() == false) @if($offices_arr->isEmpty() == false)
@foreach($offices_arr as $row) @foreach($offices_arr as $row)
<div class="col-md-4 col-sm-4 col-xs-12 profile_details"> <div class="col-md-3 col-sm-4 col-xs-12 profile_details">
<div class="well profile_view"> <div class="well profile_view">
<div class="col-sm-12"> <div class="col-sm-12">
<!-- <h4 class="brief"><i>{{ $row->country }}</i></h4> -->
<div class="leftd col-xs-12"> <div class="leftd col-xs-12">
<div class="text-centers"> <div class="text-centers">
<img src="<?php echo $row->flag_url; ?>" alt="" class="img-circles img-responsives" width="60" height="30"> <img src="<?php echo $row->flag_url; ?>" alt="" class="img-circles img-responsives" width="60" height="30">
@@ -73,7 +72,7 @@
<p><strong>Physical Address </strong>: {{ $row->physical_address or '' }} {{ $row->block_number or '' }}</p> <p><strong>Physical Address </strong>: {{ $row->physical_address or '' }} {{ $row->block_number or '' }}</p>
<p><strong>Postal Address </strong>: {{ $row->postal_address or '' }}</p> <p><strong>Postal Address </strong>: {{ $row->postal_address or '' }}</p>
<p><strong>City/Town </strong>: {{ $row->city_town or '' }}</p> <p><strong>City/Town </strong>: {{ $row->city or '' }}</p>
<p><strong>Country </strong>: {{ $row->country or '' }}</p> <p><strong>Country </strong>: {{ $row->country or '' }}</p>
<ul class="list-unstyled"> <ul class="list-unstyled">
<!-- <li><i class="fa fa-buildings"></i>Country Code: </li> --> <!-- <li><i class="fa fa-buildings"></i>Country Code: </li> -->

View File

@@ -0,0 +1,105 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left" style="width:800px !important;">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active"><a href="{!! url('senderids') !!}">Sender IDs</a></li>
<li class="active">New Sender ID</li>
</ol>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
New Sender ID
@include('commons.notifications')
<div class="clearfix"></div>
</div>
{{-- start of content --}}
<div class="x_content">
<br>
{!! Form::open(['url' => 'senderids', 'class' => 'form-horizontal form-label-left']) !!}
<div class="row">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="senderIDD">Sender ID</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('senderid') ? 'has-error' : ''}}">
{!! Form::text('senderid', old('senderid'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter sender ID' , 'id' => 'senderIDD', 'required' => 'true']) !!}
{!! $errors->first('name', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="directMno">Direct MNO</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('direct_mno') ? 'has-error' : ''}}">
{!! Form::select('direct_mno', $direct_mno_arr ,old('direct_mno'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select one ' , 'id' => 'directMno', 'required' => 'true']) !!}
{!! $errors->first('direct_mno', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group hidden" id="mnoDiv">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="networkName">MNO Name</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('network') ? 'has-error' : ''}}">
{!! Form::select('mno_name', $network_arr, old('mno_name'), ['class' => 'form-control col-md-7 col-xs-12', 'id' => 'networkName', 'placeholder' => '-- Select --', 'required' => 'true', 'style' => 'width:100%;']) !!}
{!! $errors->first('network', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group hidden" id="supplierDiv">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="supplierName">Supplier Name</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('name') ? 'has-error' : ''}}">
<!-- 'required' => 'true', -->
{!! Form::select('supplier_name', $clients, old('supplier_name'), ['class' => 'form-control', 'id' => 'supplierName', 'placeholder' => '-- Select --', 'style' => 'width:100%;']) !!}
{!! $errors->first('client_id', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="status">Status</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('status') ? 'has-error' : ''}}">
{!! Form::select('status', $status ,old('status'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Status ' , 'id' => 'status', 'required' => 'true']) !!}
{!! $errors->first('status', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="remarks">Remarks</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('remarks') ? 'has-error' : ''}}">
{!! Form::text('remarks', old('remarks'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter remarks here' , 'id' => 'remarks']) !!}
{!! $errors->first('remarks', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
</div>
</div>
{!! Form::close() !!}
</div>
{{-- end of x_content --}}
</div>
{{-- end of x_panel --}}
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript" src="{!! url('public/assets/js/senderid.js') !!}"></script>
<script type="text/javascript">
$(function(){
$('select').select2();
});
</script>
@endsection

View File

@@ -27,7 +27,7 @@
{{-- start of content --}} {{-- start of content --}}
<div class="x_content"> <div class="x_content">
<br> <br>
{!! Form::open(['url' => 'senderids', 'class' => 'form-horizontal form-label-left']) !!} {!! Form::open(['url' => 'senderids', 'id' => 'senderIdCreateForm', 'class' => 'form-horizontal form-label-left']) !!}
<div class="row"> <div class="row">
<div class="form-group"> <div class="form-group">
@@ -45,14 +45,14 @@
</div> </div>
</div> </div>
<div class="form-group hidden" id="mnoDiv"> <div class="form-group " id="mnoDiv">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="networkName">MNO Name</label> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="networkName">MNO Name</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('network') ? 'has-error' : ''}}"> <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('network') ? 'has-error' : ''}}">
{!! Form::select('mno_name', $network_arr, old('mno_name'), ['class' => 'form-control col-md-7 col-xs-12', 'id' => 'networkName', 'placeholder' => '-- Select --', 'required' => 'true', 'style' => 'width:100%;']) !!} {!! Form::select('mno_name', $network_arr, old('mno_name'), ['class' => 'form-control col-md-7 col-xs-12', 'id' => 'networkName', 'placeholder' => '-- Select --', 'required' => 'true', 'style' => 'width:100%;']) !!}
{!! $errors->first('network', '<p class="help-block">:message</p>') !!} {!! $errors->first('network', '<p class="help-block">:message</p>') !!}
</div> </div>
</div> </div>
<div class="form-group hidden" id="supplierDiv"> <div class="form-group " id="supplierDiv">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="supplierName">Supplier Name</label> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="supplierName">Supplier Name</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('name') ? 'has-error' : ''}}"> <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('name') ? 'has-error' : ''}}">
<!-- 'required' => 'true', --> <!-- 'required' => 'true', -->
@@ -79,6 +79,9 @@
<div class="form-group"> <div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3"> <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button> <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
&nbsp;
<button type="button" class="btn btn-warning btn-block" id="resetBtn"><i class="fa fa-save"></i> Reset</button>
</div> </div>
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}

View File

@@ -54,17 +54,20 @@
<div class="pull-right"> <div class="pull-right">
<a class="btn btn-warning btn-sm" href="{!! url('senderids/upload') !!}"><i class="fa fa-cloud-upload"></i> Upload Sender ID</a> <a class="btn btn-warning btn-sm" href="{!! url('senderids/upload') !!}"><i class="fa fa-cloud-upload"></i> Upload Sender ID</a>
<a class="btn btn-primary btn-sm" href="{!! url('senderids/create') !!}"><i class="fa fa-plus-circle"></i> New Sender ID</a> <a class="btn btn-primary btn-sm" href="{!! url('senderids/create') !!}"><i class="fa fa-plus-circle"></i> New Sender ID</a>
<a class="btn btn-success btn-sm" href="{!! url('senderids/exportall') !!}"><i class="fa fa-plus-circle"></i> Download All</a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<div class=" well" >
@if(session('current_user.rejected_rows_filename') !== null) @if(session('current_user.rejected_rows_filename') !== null)
<div class=" well" >
<?php $url = session('current_user.rejected_rows_filename');?> <?php $url = session('current_user.rejected_rows_filename');?>
<a href="{{ url('senderids/uploadreportdownload', $url) }}" class="btn btn-link">View Sender ID Bulk Upload Report</a> <a href="{{ url('senderids/uploadreportdownload', $url) }}" class="btn btn-link">View Sender ID Bulk Upload Report</a>
@endif
</div> </div>
@endif
<div> <div>
<button id="senderid-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button> <button id="senderid-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
<button id="senderid-download-pdf" class="btn btn-danger btn-sm"><i class="fa fa-file-pdf-o"></i> Download PDF</button> <button id="senderid-download-pdf" class="btn btn-danger btn-sm"><i class="fa fa-file-pdf-o"></i> Download PDF</button>
@@ -98,6 +101,8 @@
function statusDesign (cell, formatterParams){ function statusDesign (cell, formatterParams){
var value = cell.getValue(); var value = cell.getValue();
// if(value === 'Approved'){ // if(value === 'Approved'){
// console.log(value !== null);
if (value !== null) {
if(value.includes('Approved')){ if(value.includes('Approved')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>"; return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
} }
@@ -108,6 +113,7 @@
return "<span style='color:#E4A11B;'>" + value + "</span>"; return "<span style='color:#E4A11B;'>" + value + "</span>";
} }
} }
}
var table = new Tabulator("#senderIdsTable", { var table = new Tabulator("#senderIdsTable", {
ajaxURL: "senderids/all", ajaxURL: "senderids/all",
paginationSize: 15, paginationSize: 15,

View File

@@ -0,0 +1,77 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left" style="width:800px !important;">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active"><a href="{!! url('supporttickets/list') !!}">Ticket List</a></li>
<li class="active">New Ticket</li>
</ol>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
@include('commons.notifications')
<div class="clearfix"></div>
</div>
{{-- start of content --}}
<div class="x_content">
<br>
{!! Form::open(['url' => 'supporttickets', 'class' => 'form-horizontal form-label-left']) !!}
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Subject</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('subject') ? 'has-error' : ''}}">
{!! Form::text('subject', old('subject'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter subject' , 'id' => 'subject']) !!}
{!! $errors->first('subject', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="type">Body</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('body') ? 'has-error' : ''}}">
{!! Form::textarea('body', old('body'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter body ' , 'id' => 'body']) !!}
{!! $errors->first('body', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="type">Attachment</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('body') ? 'has-error' : ''}}">
{!! Form::file('attachment', null, ['class' => 'form-control' , 'id' => 'attachment']) !!}
{!! $errors->first('attachment', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
</div>
</div>
{!! Form::close() !!}
</div>
{{-- end of x_content --}}
</div>
{{-- end of x_panel --}}
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(function(){
$('select').select2();
});
</script>
@endsection

View File

@@ -0,0 +1,76 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left" style="width:800px !important;">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active">Create Service</li>
</ol>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
@include('commons.notifications')
<div class="clearfix"></div>
</div>
{{-- start of content --}}
<div class="x_content">
<br>
{!! Form::open(['url' => 'supporttickets', 'class' => 'form-horizontal form-label-left']) !!}
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Subject</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('subject') ? 'has-error' : ''}}">
{!! Form::text('subject', old('subject'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter subject' , 'id' => 'subject']) !!}
{!! $errors->first('subject', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="type">Body</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('body') ? 'has-error' : ''}}">
{!! Form::textarea('body', old('body'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter body ' , 'id' => 'body']) !!}
{!! $errors->first('body', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="type">Attachment</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('body') ? 'has-error' : ''}}">
{!! Form::file('attachment', null, ['class' => 'form-control' , 'id' => 'attachment']) !!}
{!! $errors->first('attachment', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
</div>
</div>
{!! Form::close() !!}
</div>
{{-- end of x_content --}}
</div>
{{-- end of x_panel --}}
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(function(){
$('select').select2();
});
</script>
@endsection

View File

@@ -0,0 +1,182 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('css')
<link href="{!! url('public/assets/vendors/tabulator/css/bootstrap/tabulator_bootstrap.css') !!}" type="text/css" rel="stylesheet">
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left">
<div class="title_left">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active">Support Ticket List</li>
</ol>
</div>
</div>
<div class="title_right">
<div class="row">
<form method="GET" action="{!! url('supporttickets') !!}">
<div class="col-md-5 col-sm-5 col-xs-12 form-group">
<div style="margin-top:1px; margin-right:-90px;" class="top_search">
</div>
</div>
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search" style="margin-top: -2px;">
<div class="input-group">
<input type="text" name="keyword" class="form-control" id="keywordField" placeholder="Keyword here...">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary" style="color: #fff;" type="button">Go!</button>
</span>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-sm-12">
<div class="pull-right"></div>
</div>
</div>
</div>
</div>
<div class="row">
@include('commons.notifications')
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Support Ticket Lists </h2>
<div class="pull-right">
<a class="btn btn-primary btn-sm" href="{!! url('supporttickets/create') !!}"><i class="fa fa-plus-circle"></i> New Ticket</a>
</div>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div>
<button id="support-tickets-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
<button id="support-tickets-download-pdf" class="btn btn-danger btn-sm"><i class="fa fa-file-pdf-o"></i> Download PDF</button>
</div>
<div id="supportTicketsTable"></div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script src="{!! url('public/assets/vendors/tabulator/js/tabulator.js') !!}"></script>
<script type="text/javascript" src="{!! url('public/assets/vendors/tabulator/js/xlsx.full.min.js') !!}"></script>
<script type="text/javascript" src="{!! url('public/assets/vendors/tabulator/js/jspdf.min.js') !!}"></script>
<script type="text/javascript" src="{!! url('public/assets/vendors/tabulator/js/jspdf.plugin.autotable.js') !!}"></script>
<script type="text/javascript">
$(document).ready(function(){
function link(cell, formatterParams){
var url = cell.getValue();
console.log(cell.getData());
var rowID = cell.getData().id
return "<a href='"+ base_url + "/supporttickets/"+rowID+"/edit' class='btn btn-link'>"+url+"</a>";
}
function cellDesign (cell, formatterParams){
var value = cell.getValue();
return "<span style='color:#54B4D3; font-weight:bold;'>" + value + "</span>";
}
function statusDesign (cell, formatterParams){
var value = cell.getValue();
if (value !== null) {
if(value.includes('CLOSED')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else if(value.includes('OPEN')){
return "<span style='color:#d9534f; font-weight:bold;'>" + value + "</span>";
}
else{
return "<span style='color:#E4A11B;'>" + value + "</span>";
}
}
}
var table = new Tabulator("#supportTicketsTable", {
ajaxURL: "all",
paginationSize: 15,
layout: "fitColumns",
pagination: "remote",
selectable: false,
printAsHtml: true,
ajaxLoaderLoading: $('#logo_spinner').html(),
columns: [
{
title: "Case Number",
field: "case_number",
sorter: "string",
// formatter: cellDesign,
formatter:link,
},
{
title: "Subject",
field: "subject",
sorter: "string",
},
{
title: "Ticket Body",
field: "body",
sorter: "string",
},
{
title: "assigned To",
field: "assignedToName",
sorter: "string",
},
{
title: "Created By",
field: "createdBy",
sorter: "string",
},
{
title: "Status",
field: "status",
sorter: "string",
formatter: statusDesign,
},
{
title: "Created At",
field: "created_at",
sorter: "string",
}
],
rowClick:function(e, row){
var userID = row.getData().id;
console.log(userID);
//$('#userEditModal').modal('show');
},
});
document.getElementById("support-tickets-download-xlsx").addEventListener("click", function(){
table.download("xlsx", "support-tickets-list.xlsx", {sheetName:"Sheet 1"});
});
//trigger download of data.pdf file
document.getElementById("support-tickets-download-pdf").addEventListener("click", function(){
table.download("pdf", "support-ticket-list.pdf", {
orientation:"portrait", //set page orientation to portrait
title:"Click Mobile - Support Ticket List", //add title to report
});
});
$('#keywordField').on('keyup', function(){
console.log('up');
var keyword = $(this).val();
table.setData("supporttickets/all?keyword=" + keyword);
});
});
</script>
@endsection

View File

@@ -0,0 +1,106 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('css')
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left">
<div class="title_left">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active">Support Tickets</li>
</ol>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
@include('commons.notifications')
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Welcome to the Support Center </h2>
<div class="pull-right">
<a class="btn btn-warning btn-sm" href="{!! url('senderids/create') !!}"><i class="fa fa-plus-circle"></i> New Ticket </a>
</div>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Tickets Count (Today) <small><a href="{{ url('supporttickets/today') }}">40</a></small></h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="bs-example" data-example-id="simple-jumbotron">
<div class="jumbotron">
<h1>Open a new Ticket</h1>
<p>Create a new ticket with as much details as possible.</p>
<a href="{{ url('supporttickets/create') }}" class="btn btn-success"><i class="fa fa-life-ring"></i> New Ticket</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Total Tickets Count <small><a href="{{ url('supporttickets') }}">400</a></small></h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="bs-example" data-example-id="simple-jumbotron">
<div class="jumbotron">
<h1>Check Ticket Status</h1>
<p>Check details of Past and Present tickets</p>
<!-- <form class="form-inline">
<div class="form-group">
<input type="text" name="case_number" class="form-control">
<button type="submit" class="btn btn-primary" ><i class="fa fa-clock-o"></i> Check</button>
</div>
</form> -->
<form class="form-inline" action="">
<div class="form-group">
<!-- <label for="email">Ticket Number:</label> -->
<input type="email" class="form-control" id="email" placeholder="Enter Ticket Number">
</div>
<button type="submit" class="btn btn-primary"><i class="fa fa-clock-o"></i> Submit</button>
</form>
<!-- <a href="" class="btn btn-primary" style="margin-top: 5px;"><i class="fa fa-clock-o"></i> Check </a> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function(){
});
</script>
@endsection

View File

@@ -0,0 +1,107 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('css')
@endsection
@section('content')
<div class="row">
<div class="col-md-12 col-sm-6">
<div class="x_panel">
<div class="x_title">
<h2>Daily active users <small>Sessions</small></h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Settings 1</a>
</li>
<li><a href="#">Settings 2</a>
</li>
</ul>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<ul class="list-unstyled timeline">
<li>
<div class="block">
<div class="tags">
<a href="" class="tag">
<span>Entertainment</span>
</a>
</div>
<div class="block_content">
<h2 class="title">
<a>Who Needs Sundance When Youve Got&nbsp;Crowdfunding?</a>
</h2>
<div class="byline">
<span>13 hours ago</span> by <a>Jane Smith</a>
</div>
<p class="excerpt">Film festivals used to be do-or-die moments for movie makers. They were where you met the producers that could fund your project, and if the buyers liked your flick, theyd pay to Fast-forward and <a>Read&nbsp;More</a>
</p>
</div>
</div>
</li>
<li>
<div class="block">
<div class="tags">
<a href="" class="tag">
<span>Entertainment</span>
</a>
</div>
<div class="block_content">
<h2 class="title">
<a>Who Needs Sundance When Youve Got&nbsp;Crowdfunding?</a>
</h2>
<div class="byline">
<span>13 hours ago</span> by <a>Jane Smith</a>
</div>
<p class="excerpt">Film festivals used to be do-or-die moments for movie makers. They were where you met the producers that could fund your project, and if the buyers liked your flick, theyd pay to Fast-forward and <a>Read&nbsp;More</a>
</p>
</div>
</div>
</li>
<li>
<div class="block">
<div class="tags">
<a href="" class="tag">
<span>Entertainment</span>
</a>
</div>
<div class="block_content">
<h2 class="title">
<a>Who Needs Sundance When Youve Got&nbsp;Crowdfunding?</a>
</h2>
<div class="byline">
<span>13 hours ago</span> by <a>Jane Smith</a>
</div>
<p class="excerpt">Film festivals used to be do-or-die moments for movie makers. They were where you met the producers that could fund your project, and if the buyers liked your flick, theyd pay to Fast-forward and <a>Read&nbsp;More</a>
</p>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function(){
});
</script>
@endsection

View File

@@ -52,16 +52,17 @@
{!! $errors->first('email', '<p class="help-block">:message</p>') !!} {!! $errors->first('email', '<p class="help-block">:message</p>') !!}
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="permissions">Permissions</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('permissions') ? 'has-error' : ''}}">
{!! Form::text('permissions', null, ['class' => 'form-control col-md-7 col-xs-12', 'id' => 'permissions']) !!}
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
</div>
<!-- <hr> --> <!-- <hr> -->
<!-- <p class="text-center">Leave password blank to keep the current password</p> --> <!-- <p class="text-center">Leave password blank to keep the current password</p> -->
<!-- <div class="form-group"> <!-- -->
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="password">Password</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('passwword') ? 'has-error' : ''}}">
{!! Form::text('password', null, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter password' , 'id' => 'password']) !!}
{!! $errors->first('password', '<p class="help-block">:message</p>') !!}
</div>
</div> -->
<!-- <div class="form-group"> <!-- <div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="confirm_password">Confirm Password</label> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="confirm_password">Confirm Password</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('confirm_password') ? 'has-error' : ''}}"> <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('confirm_password') ? 'has-error' : ''}}">

View File

@@ -134,7 +134,9 @@ Route::group(['middleware' => ['checklogin', 'checkcurrentlylogged']], function(
Route::get('senderids/downloadsample', 'SenderIdController@getSampleFile'); Route::get('senderids/downloadsample', 'SenderIdController@getSampleFile');
Route::get('senderids/exportall', 'SenderIdController@exportSenderIdCsv');
Route::get('senderids/uploadreportdownload/{name}', 'SenderIdController@getUploadReport'); Route::get('senderids/uploadreportdownload/{name}', 'SenderIdController@getUploadReport');
Route::get('senderids/upload', 'SenderIdController@showuploadform'); Route::get('senderids/upload', 'SenderIdController@showuploadform');
Route::post('senderids/uploadstore', 'SenderIdController@uploadstore'); Route::post('senderids/uploadstore', 'SenderIdController@uploadstore');
Route::get('senderids/all', 'SenderIdController@getSenderIdsJson'); Route::get('senderids/all', 'SenderIdController@getSenderIdsJson');
@@ -142,6 +144,11 @@ Route::group(['middleware' => ['checklogin', 'checkcurrentlylogged']], function(
Route::post('senderids/direct_store', 'SenderIdController@direct_store'); Route::post('senderids/direct_store', 'SenderIdController@direct_store');
Route::resource('senderids', 'SenderIdController'); Route::resource('senderids', 'SenderIdController');
Route::get('supporttickets/all', 'SupportTicketsController@getSuppoerTicketJson');
Route::get('supporttickets/list', 'SupportTicketsController@ticketlist');
Route::resource('supporttickets', 'SupportTicketsController');
Route::get('staffmembers/profile/{staff_member_id}', 'StaffMembersController@profile'); Route::get('staffmembers/profile/{staff_member_id}', 'StaffMembersController@profile');
Route::get('staffmembers/index', 'StaffMembersController@index'); Route::get('staffmembers/index', 'StaffMembersController@index');
Route::get('staffmembers/all', 'StaffMembersController@getstaffMemberssJson'); Route::get('staffmembers/all', 'StaffMembersController@getstaffMemberssJson');
@@ -149,6 +156,7 @@ Route::group(['middleware' => ['checklogin', 'checkcurrentlylogged']], function(
Route::post('clients/changeam', 'ClientsController@changeAccountManagers');
Route::get('clients/downloadfile/{id}', 'ClientsController@getClientFile'); Route::get('clients/downloadfile/{id}', 'ClientsController@getClientFile');
Route::get('clients/onboarding/{id}', 'ClientsController@showOnboardingForm'); Route::get('clients/onboarding/{id}', 'ClientsController@showOnboardingForm');
Route::post('clients/shortcode_store', 'ClientsController@shortcodeStore'); Route::post('clients/shortcode_store', 'ClientsController@shortcodeStore');