Moved ShortCodes to a new controller, added Tabulator, bug fixes

This commit is contained in:
Kwesi Banson
2024-07-09 15:49:56 +00:00
parent 101012c684
commit 4a0248e40d
12 changed files with 1215 additions and 40 deletions

View File

@@ -854,21 +854,22 @@ class ClientsController extends Controller
public function getShortCodes($type){
//$auth_users = Models\SystemUser::pluck('name', 'id');
//todo : separate the short codes into individual pages
// dd(session('current_user.designation'));
switch ($type) {
case 'sms':
$codes_data = Models\ClientShortCode::with('client_info','client_info', 'update_info')->where('code_type', 'sms')->get();
$codes_data = Models\ClientShortCode::with('client_info','client_info', 'update_info')->where('code_type', 'sms')->orderBy('id', 'DESC')->get();
break;
case 'ussd':
$codes_data = Models\ClientShortCode::with('client_info', 'client_info', 'update_info')->where('code_type', 'ussd')->get();
$codes_data = Models\ClientShortCode::with('client_info', 'client_info', 'update_info')->where('code_type', 'ussd')->orderBy('id', 'DESC')->get();
break;
case 'voice':
$codes_data = Models\ClientShortCode::with('client_info', 'client_info', 'update_info')->where('code_type', 'voice')->get();
$codes_data = Models\ClientShortCode::with('client_info', 'client_info', 'update_info')->where('code_type', 'voice')->orderBy('id', 'DESC')->get();
break;
default:
// code... show 404
break;
}
$codes = Models\ClientShortCode::with('update_info')->get();
// $codes = Models\ClientShortCode::with('update_info')->get();
$data = [
'page_title' => 'Client Short Codes',