FAT_CLIENT_MODULE_AND_FILES_12_NEW_MODEL_FILE_CREATE : RV

This commit is contained in:
VENKATESHWARAN 2024-02-10 09:50:13 +05:30
parent de758a8918
commit 3abf12bfda
34 changed files with 1495 additions and 39 deletions

View File

@ -27,3 +27,34 @@ $routes->group("/dashboard", ["filter" => "authMVC"], function($routes){
$routes->get("view", "DashboardController::dashboard");
});
$routes->group("/client", ["filter" => "authMVC"], function($routes){
$routes->get("list", "ClientController::index");
$routes->get("create", "ClientController::clientOnboarding");
$routes->group("general", ["filter" => "authMVC"], function($routes){
$routes->get("create", "ClientController::clientGeneralInfoData");
$routes->post("create", "ClientController::createClientGeneralInfo");
});
$routes->group("relation", ["filter" => "authMVC"], function($routes){
$routes->get("list", "ClientController::index");
$routes->get("create", "ClientController::clientCreate");
$routes->post("create", "ClientController::clientCreate");
});
$routes->group("branch", ["filter" => "authMVC"], function($routes){
$routes->get("list", "ClientController::index");
$routes->get("create", "ClientController::clientCreate");
$routes->post("create", "ClientController::clientCreate");
});
$routes->group("policy", ["filter" => "authMVC"], function($routes){
$routes->get("list", "ClientController::index");
$routes->get("create", "ClientController::clientCreate");
$routes->post("create", "ClientController::clientCreate");
});
$routes->group("kyc", ["filter" => "authMVC"], function($routes){
$routes->get("list", "ClientController::index");
$routes->get("create", "ClientController::clientCreate");
$routes->post("create", "ClientController::clientCreate");
});
});

View File

@ -9,12 +9,10 @@ use Psr\Log\LoggerInterface;
use App\Controllers\PublicController;
//This is a controller act like base controller for business logics which are required
// authendication and authrizations also config the routes as per requirement in routes.php
class AdminController extends BaseController
{
public function __construct()
{

View File

@ -0,0 +1,89 @@
<?php
namespace App\Controllers;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\UserModel;
use App\Models\ClientModel;
use App\Models\ClientBranchModel;
use App\Models\ClientKYCDocsModel;
use App\Models\ClientPolicyModel;
use App\Models\ClientRMModel;
use App\Models\InsurerBranchModel;
use App\Models\InsurerModel;
use App\Models\KYCDocsModel;
use App\Models\KYCEntityTypeModel;
use App\Models\LevelContactModel;
use App\Models\PolicesModel;
use App\Models\TPABranchModel;
use App\Models\TPAModel;
class ClientController extends AdminController
{
protected $clientModel;
protected $userModel;
protected $clientBranchModel;
protected $clientKYCDocsModel;
protected $clientPolicyModel;
protected $clientRMModel;
protected $insurerBranchModel;
protected $insurerModel;
protected $kycDocsModel;
protected $kycEntityTypeModel;
protected $levelContactModel;
protected $policesModel;
protected $tpaBranchModel;
protected $tpaModel;
public function __construct()
{
parent::__construct();
$this->clientModel = new ClientModel();
$this->userModel = new UserModel();
$this->clientBranchModel = new ClientBranchModel();
$this->clientKYCDocsModel = new ClientKYCDocsModel();
$this->clientPolicyModel = new ClientPolicyModel();
$this->clientRMModel = new ClientRMModel();
$this->insurerBranchModel = new InsurerBranchModel();
$this->insurerModel = new InsurerModel();
$this->kycDocsModel = new KYCDocsModel();
$this->kycEntityTypeModel = new KYCEntityTypeModel();
$this->levelContactModel = new LevelContactModel();
$this->policesModel = new PolicesModel();
$this->tpaBranchModel = new TPABranchModel();
$this->tpaModel = new TPAModel();
}
public function index()
{
echo view('layout/header');
echo view('client_list');
echo view('layout/footer');
}
public function clientOnboarding(){
$data['contact_level'] = ['1'=>'level 1', '2'=>'level 2', '3'=>'level 3'];
$data['entity'] = $this->kycEntityTypeModel->findAll();
$data['kyc_docs'] = $this->kycDocsModel->findAll();
$data['police'] = $this->policesModel->findAll();
$data['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
$data['RM'] = $this->userModel->findAll();
echo view('layout/header');
echo view('client_onboarding', $data);
echo view('layout/footer');
}
public function createClientGeneralInfo(){
}
}

View File

@ -7,7 +7,8 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\UserModal;
use App\Models\UserModel;
use App\Models\AuthHistoryModel;
class LoginController extends BaseController
{
@ -25,7 +26,7 @@ class LoginController extends BaseController
public function receiveGoogleOAuthResponse()
{
$UserModel = new UserModal();
$UserModel = new UserModel();
if ($this->request->getGet('code')) {
$code = (string) $this->request->getGet('code');
log_message('error', 'Get OAuth Responce Code Sucessfully');
@ -40,6 +41,7 @@ class LoginController extends BaseController
set_session_data($session_data);
log_message('error', 'Set The UserId : `'. $user->id .'` in Session');
log_message('error', 'Is User Login Sucessfully');
$this->getUserDeviceInfo($user->id);
return redirect()->to(base_url('/dashboard/view'));
}else{
@ -66,5 +68,32 @@ class LoginController extends BaseController
return redirect()->to(base_url('login'));
}
public function getUserDeviceInfo($userId){
// Load the UserAgent library
$userAgent = $this->request->getUserAgent();
// Get the user's platform (e.g., Windows, Mac, Linux)
$platform = $userAgent->getPlatform();
// Get the user's browser (e.g., Chrome, Firefox, Safari)
$browser = $userAgent->getBrowser();
// Get the user's IP address
$ipAddress = $this->request->getIPAddress();
$datd = [
'user_id' => $userId,
'ip' => $ipAddress,
'platform' => $platform,
'broswer' => $browser,
];
$AuthHistoryModel = new AuthHistoryModel;
$insertAuthHistory = $AuthHistoryModel->insert($datd);
}
}

View File

@ -8,9 +8,10 @@ use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\UserModal;
use App\Models\RoleModal;
use App\Models\TeamsModal;
use App\Models\UserModel;
use App\Models\RoleModel;
use App\Models\TeamModel;
use App\Models\UserTeamsModel;
class UserController extends AdminController
@ -18,7 +19,7 @@ class UserController extends AdminController
public function list()
{
$model = new UserModal();
$model = new UserModel();
$data['UserList'] = $model->where('is_active', 1)->orderBy('id', 'DESC')->findAll();
echo view('layout/header');
echo view('AddUser');
@ -28,16 +29,15 @@ class UserController extends AdminController
public function create()
{
print_r($this->request->getPost()); die;
{
$teams = $this->request->getPost('team');
//if this is get method return to user creation page
if(!$this->request->getPost()){
return redirect()->to(base_url('/user/list'));
}else{
//else do user insert operation
$userModel = new UserModal();
$userModel = new UserModel();
$File = fileUpload($this->request->getFile('profile'));
$userData = $this->request->getPost();
if(!empty($File)){
@ -46,17 +46,34 @@ class UserController extends AdminController
// Inserting data into the 'users' table
$userData['created_by'] = get_session_userid();
unset($userData['team']);
$insert = $userModel->insert($userData);
if($insert){
$teamData['user_id'] = $insert ;
$UserTeamsModel = new UserTeamsModel();
foreach ($teams as $value) {
$teamData['team_id'] = $value;
$teamData['created_by'] = get_session_userid();
$UserTeamsModel->insert($teamData);
}
}
}
return redirect()->to(base_url('/user/list'));
}
public function getuser($id = null){
$model = new UserModal();
$data = $model->where('id', $id)->first();
$model = new UserModel();
$RoleModel = new RoleModel();
$TeamModal = new TeamModel();
$UserTeamsModel = new UserTeamsModel();
$roleData = $RoleModel->select('id, role')->findAll();
$teamData = $TeamModal->select('id, name')->findAll();
$userTeamData = $UserTeamsModel->where('user_id', $id)->findAll();
$data = $model->getUserById($id);
if($data){
echo json_encode(array("status" => true , 'data' => $data));
echo json_encode(array("status" => true , 'data' => $data, 'roleData' => $roleData, 'teamData' => $teamData, 'userTeamData' => $userTeamData));
}else{
echo json_encode(array("status" => false));
}
@ -65,10 +82,13 @@ class UserController extends AdminController
public function edit()
{
$teams = $this->request->getPost('team');
// echo '<pre>';
// print_r($this->request->getPost()); die;
if(!$this->request->getPost()){
return redirect()->to(base_url('/user/list'));
}else{
$userModel = new UserModal();
$userModel = new UserModel();
$id = $this->request->getPost('PrimaryKey');
$imageDetails = $userModel->find($id);
$File = fileUpload($this->request->getFile('profile'), (isset($imageDetails['profile']) ? $imageDetails['profile'] : null));
@ -81,6 +101,16 @@ class UserController extends AdminController
$userData['updated_by'] = get_session_userid();
unset($userData['PrimaryKey']);
$update = $userModel->update($id, $userData);
if($update){
$UserTeamsModel = new UserTeamsModel();
$UserTeamsModel->where('user_id', $id)->delete();
$teamData['user_id'] = $id ;
foreach ($teams as $value) {
$teamData['team_id'] = $value;
$teamData['created_by'] = get_session_userid();
$UserTeamsModel->insert($teamData);
}
}
return redirect()->to(base_url('/user/list'));
}
@ -88,7 +118,7 @@ class UserController extends AdminController
public function deactive($id = null)
{
$model = new UserModal();
$model = new UserModel();
$deactive = $model->where('id', $id)->set(['is_active' => 0])->update();
if($deactive)
{
@ -100,10 +130,10 @@ class UserController extends AdminController
public function getRolesAndTeams(){
$RoleModal = new RoleModal();
$TeamModal = new TeamsModal();
$RoleModel = new RoleModel();
$TeamModal = new TeamModel();
$roleData = $RoleModal->select('id, role')->findAll();
$roleData = $RoleModel->select('id, role')->findAll();
$teamData = $TeamModal->select('id, name')->findAll();
echo json_encode(array("status" => true , 'roleData' => $roleData, 'teamData' => $teamData,));

View File

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class AuthHistoryModel extends Model
{
protected $table = 'auth_history';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"user_id",
"ip",
"platform",
"broswer",
"created_by",
"updated_by",
];
}
?>

View File

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ClientBranchModel extends Model
{
protected $table = 'client_branch';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"client_id",
"branch_name",
"branch_code",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ClientKYCDocsModel extends Model
{
protected $table = 'client_kyc_documents';
protected $primaryKey = 'id';
protected $allowedFields = ['id','client_id','entity_type_id','file_name','is_active',"created_by","updated_by",];
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ClientModel extends Model
{
protected $table = 'clients';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"entity_type_id",
"client_name",
"short_name",
"pan",
"gst",
"address1",
"address2",
"city",
"state",
"pincode",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ClientPolicyModel extends Model
{
protected $table = 'client_policy';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"client_id",
"policy_id",
"insurer_id",
"insurer_branch_id",
"tpa_id",
"tpa_branch_id",
"created_by",
"updated_by",
"Is_active",
];
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ClientRMModel extends Model
{
protected $table = 'client_rm';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"client_id",
"user_id",
"level",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,36 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class InsurerBranchModel extends Model
{
protected $table = 'insurer_branch';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"insurer_id",
"branch_name",
"branch_code",
"address1",
"address2",
"city",
"district",
"state",
"pincode",
"created_by",
"updated_by",
"is_active",
];
public function getInsurerBranchesWithInsurerNames()
{
$query = $this->select('insurer_branch.*, I.short_name as insurer_name')
->join('insurers I', 'insurer_branch.insurer_id = I.id', 'left')
->find();
return $query;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class InsurerModel extends Model
{
protected $table = 'insurers';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"name",
"tpa_id",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class KYCDocsModel extends Model
{
protected $table = 'kyc_docs';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"kyc_type_id",
"file_name",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class KYCEntityTypeModel extends Model
{
protected $table = 'kyc_entity_type';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"name",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class LevelContactModel extends Model
{
protected $table = 'level_contacts';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"ref_id",
"contact_type",
"level",
"name",
"email",
"city",
"mobile",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PolicesModel extends Model
{
protected $table = 'policies';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"insurer_id",
"name",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -3,13 +3,16 @@ namespace App\Models;
use CodeIgniter\Model;
class RoleModal extends Model
class RoleModel extends Model
{
protected $table = 'roles';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"role",
"created_by",
"updated_by",
"is_active",
];

View File

@ -0,0 +1,26 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class TPABranchModel extends Model
{
protected $table = 'tpa_branch';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"tpa_id",
"branch_name",
"branch_code",
"address1",
"address2",
"city",
"district",
"state",
"pincode",
"created_by",
"updated_by",
"is_active",
];
}

18
app/Models/TPAModel.php Normal file
View File

@ -0,0 +1,18 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class TPAModel extends Model
{
protected $table = 'tpa';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"name",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -3,13 +3,16 @@ namespace App\Models;
use CodeIgniter\Model;
class TeamsModal extends Model
class TeamModel extends Model
{
protected $table = 'teams';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"name",
"created_by",
"updated_by",
"is_active",
];
}

View File

@ -3,7 +3,7 @@ namespace App\Models;
use CodeIgniter\Model;
class UserModal extends Model
class UserModel extends Model
{
protected $DBGroup = 'default';
protected $table = 'user_profiles';
@ -21,10 +21,13 @@ class UserModal extends Model
"email",
"mobile",
"profile",
"role",
"created_by",
"created_at",
"updated_by",
"updated_at",
"created_by",
"updated_by",
"is_active",
];
@ -82,6 +85,17 @@ class UserModal extends Model
} else {
return false;
}
}
public function getUserById($id){
$userData = $this->where('id', $id)->get();
if ($userData->getNumRows() > 0) {
return $userData->getRow();
} else {
return false;
}
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class UserTeamsModel extends Model
{
protected $table = 'user_teams';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"user_id",
"team_id",
"created_by",
"updated_by",
"is_active",
];
}
?>

View File

@ -1,5 +1,45 @@
<!-- start page title -->
<style>
body {
.multiselect-native-select {
position: relative;
bottom: 32px;
select {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px -1px -1px -3px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
left: 50%;
top: 30px;
}
}
.multiselect-container{
width: 100% !important;
}
.multiselect-selected-text{
float: left !important;
}
}
</style>
<style>
.btn-group, .btn-group-vertical {
position: relative;
top: 31px !important;
display: inline-flex;
vertical-align: middle;
}
</style>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
@ -22,7 +62,7 @@
<h4 class="header-title" style="position: relative;"></h4>
</div>
<div class="col-6" style="text-align: right;">
<button type="button" class="btn btn-primary waves-effect waves-light btnBack">Back</button>
<button type="button" class="btn btn-primary waves-effect waves-light btnBack">Back</button>
</div>
</div>
<form role="form" class="parsley-examples" method="post" id="UserForm" action="" enctype="multipart/form-data">
@ -64,13 +104,13 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="emp_code">User Role</label>
<select class="form-control" id="role" name="role" >
<select class="form-control" id="role" name="role">
<option value="">Select Role</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="profile">User Team</label>
<select class="form-control" id="team" name="team[]" multiple>
<option value="">Select Team</option>
</select>
</div>
</div>

View File

@ -89,7 +89,7 @@ $(document).ready(function () {
nonSelectedText: 'Select Team',
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
includeSelectAllOption : true,
includeSelectAllOption : false,
buttonWidth:'100%'
});
},
@ -112,6 +112,7 @@ $(document).ready(function () {
$('#mobile').val('');
$('#emp_code').val('');
$('#profile').val('');
$('#role').val('')
$('#ajaxImgUpload').attr('src', 'https://via.placeholder.com/300').width(100);
$('#List-page').show();
$('.btnBack').hide();
@ -125,6 +126,8 @@ $(document).ready(function () {
type: "GET",
dataType: 'json',
success: function (res) {
console.log(res)
$('#role').val('')
$('#Add-Edit-Page').show();
$('.header-title').html('Edit User');
$('#List-page').hide();
@ -138,6 +141,34 @@ $(document).ready(function () {
$('#mobile').val(res.data.mobile);
$('#emp_code').val(res.data.emp_code);
$('#btnSubmit').html('Update');
var roleOptionHTML = '';
$.each(res.roleData, function(index, item) {
var isSelected = res.userTeamData.some(function(userTeamItem) {
return res.data.role === item.id;
});
roleOptionHTML += '<option value="' + item.id + '" ' + (isSelected ? 'selected="selected"' : '') + '>' + item.role + '</option>';
});
$('#role').html(roleOptionHTML);
var optionsHTML = '';
$.each(res.teamData, function(index, item) {
var isSelected = res.userTeamData.some(function(userTeamItem) {
return userTeamItem.team_id === item.id;
});
optionsHTML += '<option value="' + item.id + '" ' + (isSelected ? 'selected="selected"' : '') + '>' + item.name + '</option>';
});
$('#team').html(optionsHTML);
$('#team').multiselect({
nonSelectedText: 'Select Team',
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
includeSelectAllOption : false,
buttonWidth:'100%'
});
if(res.data.profile){
$('#ajaxImgUpload').attr('src', '<?php echo base_url();?>public/uploads/'+res.data.profile).width(100);
}else{

View File

@ -0,0 +1,106 @@
<div class="tab-pane fade active show" id="general-q-tab">
<div class="row">
<div class="col-12">
<div class="card-body">
<form role="form" class="parsley-examples" method="post" id="UserForm" action=""
enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="UserId" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-4">
<label for="emp_code">Entity Type <span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role" required>
<option value="">Select Entity</option>
<?php foreach($entity as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="first_name">Client Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Client Name" name="first_name" required>
</div>
<div class="form-group col-md-4">
<label for="last_name">Client Short Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Short Name" name="last_name" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="email">PAN<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="email"
placeholder="Enter PAN Number" name="email" required>
</div>
<div class="form-group col-md-4">
<label for="mobile">GST<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile"
placeholder="Enter GST Number" name="mobile" required>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-md-6">
<label for="email">Address 1<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="email"
placeholder="Enter Address 1" name="email" required>
</div>
<div class="form-group col-md-6">
<label for="mobile">Address 2<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile"
placeholder="Enter Address 2" name="mobile" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="first_name">City<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter City" name="first_name" required>
</div>
<div class="form-group col-md-4">
<label for="last_name">State<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter State" name="last_name" required>
</div>
<div class="form-group col-md-4">
<label for="last_name">Pincode<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Pincode" name="last_name" required>
</div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button>
<button type="button" class="btn btn-secondary waves-effect btnBack"
id="btnBack">Cancel</button>
</div>
</form>
</div>
</div> <!-- end col-->
</div>
</div>
<!-- end -->
<script>
$(document).ready(function () {
});
</script>

318
app/Views/client_branch.php Normal file
View File

@ -0,0 +1,318 @@
<div class="tab-pane fade" id="branch-tab">
<div class="row float-right" style="padding-bottom: 10px;">
<div class="col-6">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light">Add</button>
</div>
</div>
<div class="table-responsive" id="branch_table" >
<table class="table table-borderless table-nowrap mb-0">
<thead class="thead-light">
<tr>
<th>#</th>
<th>Branch Name</th>
<th>Branch Code</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>App design and development</td>
<td>01/01/2015</td>
</tr>
<tr>
<td>2</td>
<td>Coffee detail page - Main Page</td>
<td>21/07/2016</td>
</tr>
</tbody>
</table>
</div>
<div class="row" id="add_branch">
<div class="col-12">
<div class="card-body">
<div class="row float-right" style="position: relative; bottom: 20px;">
<div class="col-6">
<button type="button" class="btn btn-primary waves-effect waves-light btnBack">Back</button>
</div>
</div>
<hr>
<form role="form" class="parsley-examples" method="post" id="UserForm" action=""
enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="UserId" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">
<label for="first_name">Branch Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Branch Name" name="first_name" required>
</div>
<div class="form-group col-md-6">
<label for="last_name">Branch Code<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Branch Code" name="last_name" required>
</div>
</div>
<hr>
<h6 class="header-title">Contact 1</h6>
<br>
<div class="form-row">
<div class="form-group col-md-4">
<label for="first_name">Contact Level<span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role">
<option value="">Select Contact Level</option>
<?php foreach($contact_level as $key => $value) { ?>
<option value="<?= $key ?>"><?= $value ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="first_name">Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Contact Name" name="first_name" required>
</div>
<div class="form-group col-md-4">
<label for="last_name">Email<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Contact Email" name="last_name" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="last_name">Mobile<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Contact Mobile" name="last_name" required>
</div>
<div class="form-group col-md-4">
<label for="first_name">City<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Contact City" name="first_name" required>
</div>
<div class="form-group col-md-4">
<label for="first_name">Level Name</label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Level Name" name="first_name" >
</div>
</div>
<br>
<h6 class="header-title">Contact 2</h6>
<br>
<div class="form-row">
<div class="form-group col-md-4">
<label for="first_name">Contact Level<span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role">
<option value="">Select Contact Level</option>
<?php foreach($contact_level as $key => $value) { ?>
<option value="<?= $key ?>"><?= $value ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="first_name">Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Contact Name" name="first_name" required>
</div>
<div class="form-group col-md-4">
<label for="last_name">Email<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Contact Email" name="last_name" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="last_name">Mobile<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Contact Mobile" name="last_name" required>
</div>
<div class="form-group col-md-4">
<label for="first_name">City<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Contact City" name="first_name" required>
</div>
<div class="form-group col-md-4">
<label for="first_name">Level Name</label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Level Name" name="first_name" >
</div>
</div>
<br>
<h6 class="header-title">Contact 3</h6>
<br>
<div class="form-row">
<div class="form-group col-md-4">
<label for="first_name">Contact Level<span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role">
<option value="">Select Contact Level</option>
<?php foreach($contact_level as $key => $value) { ?>
<option value="<?= $key ?>"><?= $value ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="first_name">Level Name</label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Level Name" name="first_name" >
</div>
<div class="form-group col-md-4">
<label for="first_name">Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Contact Name" name="first_name" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="last_name">Email<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Contact Email" name="last_name" required>
</div>
<div class="form-group col-md-4">
<label for="last_name">Mobile<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name"
placeholder="Enter Contact Mobile" name="last_name" required>
</div>
<div class="form-group col-md-4">
<label for="first_name">City<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name"
placeholder="Enter Contact City" name="first_name" required>
</div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button>
<button type="button" class="btn btn-secondary waves-effect btnBack"
id="btnBack">Cancel</button>
</div>
</form>
</div>
</div>
</div> <!-- end col-->
</div>
<!-- end -->
<script>
$(document).ready(function () {
$('#add_branch').hide();
$('.btnBack').hide();
$('#btnAdd').click(function(){
$('#add_branch').show();
$('#branch_table').hide();
$('.btnBack').show();
$('#btnAdd').hide();
$('#UserForm').attr('action', '<?php echo base_url('/user/create');?>');
})
$('.btnBack').click(function(){
$('#add_branch').hide();
$('#branch_table').show();
$('.btnBack').hide();
$('#btnAdd').show();
})
$('body').on('click', '.btnEdit', function () {
var student_id = $(this).attr('data-id');
$.ajax({
url: '<?php echo base_url('user/getuser/');?>'+student_id,
type: "GET",
dataType: 'json',
success: function (res) {
console.log(res)
$('#role').val('')
$('#Add-Edit-Page').show();
$('.header-title').html('Edit User');
$('#List-page').hide();
$('.btnBack').show();
$('#btnAdd').hide();
$('#UserForm').attr('action', '<?php echo base_url('user/edit');?>');
$('#UserId').val(res.data.id);
$('#first_name').val(res.data.first_name);
$('#last_name').val(res.data.last_name);
$('#email').val(res.data.email);
$('#mobile').val(res.data.mobile);
$('#emp_code').val(res.data.emp_code);
$('#btnSubmit').html('Update');
$.each(res.roleData, function(index, item) {
var isSelected = res.userTeamData.some(function(userTeamItem) {
return res.data.role === item.id;
});
$('#role').append($('<option>', {
value: item.id,
text : item.role,
selected: isSelected
}));
});
$.each(res.teamData, function(index, item) {
var isSelected = res.userTeamData.some(function(userTeamItem) {
return userTeamItem.team_id === item.id;
});
$('#team').append($('<option>', {
value: item.id,
text : item.name,
selected: isSelected
}));
});
$('#team').multiselect({
nonSelectedText: 'Select Team',
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
includeSelectAllOption : false,
buttonWidth:'100%'
});
if(res.data.profile){
$('#ajaxImgUpload').attr('src', '<?php echo base_url();?>public/uploads/'+res.data.profile).width(100);
}else{
$('#ajaxImgUpload').attr('src', 'https://via.placeholder.com/300').width(100);
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
}
});
});
});
</script>

36
app/Views/client_kyc.php Normal file
View File

@ -0,0 +1,36 @@
<div class="tab-pane fade" id="KYC-DOC-tab">
<div class="row">
<div class="col-12">
<div class="card-body">
<form role="form" class="parsley-examples" method="post" id="UserForm" action=""
enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="UserId" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-4">
<label for="emp_code">Document Type</label>
<select class="form-control" id="role" name="role">
<option value="">Select Document</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="profile">File</label>
<input class="form-control" type="file" name="profile"
multiple="true" id="profile">
</div>
<div class="form-group col-md-4 align-self-end">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"id="btnSubmit">Submit</button>
</div>
</div>
</div>
</form>
</div>
</div> <!-- end col-->
</div>
<!-- end row -->
</div>
<!-- end -->

141
app/Views/client_list.php Normal file
View File

@ -0,0 +1,141 @@
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"></h4>
<div class="page-title-right">
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row" id="client_list">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Client List</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("client/create"); ?>" class="btn btn-primary waves-effect waves-light">Add</a>
</div>
</div>
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0" id="tickets-table">
<thead class="bg-light">
<tr>
<th class="font-weight-medium">ID</th>
<th class="font-weight-medium">Requested By</th>
<th class="font-weight-medium">Subject</th>
<th class="font-weight-medium">Assignee</th>
<th class="font-weight-medium">Priority</th>
<th class="font-weight-medium">Status</th>
<th class="font-weight-medium">Created Date</th>
<th class="font-weight-medium">Due Date</th>
<th class="font-weight-medium">Action</th>
</tr>
</thead>
<tbody class="font-14">
<tr>
<td><b>#1256</b></td>
<td>
<a href="javascript: void(0);" class="text-dark">
<img src="../assets/images/users/avatar-2.jpg" alt="contact-img" title="contact-img" class="avatar-sm rounded-circle img-thumbnail" />
<span class="ml-2">George A. Lianes</span>
</a>
</td>
<td>
Support for theme
</td>
<td>
<a href="javascript: void(0);">
<img src="../assets/images/users/avatar-10.jpg" alt="contact-img" title="contact-img" class="avatar-sm rounded-circle img-thumbnail" />
</a>
</td>
<td>
<span class="badge badge-secondary">Low</span>
</td>
<td>
<span class="badge badge-success">Open</span>
</td>
<td>
2017/04/28
</td>
<td>
2017/04/28
</td>
<td>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit Ticket</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-check-all mr-2 text-muted font-18 vertical-middle"></i>Close</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Remove</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-star mr-2 font-18 text-muted vertical-middle"></i>Mark as Unread</a>
</div>
</div>
</td>
</tr>
<tr>
<td><b>#2542</b></td>
<td>
<a href="javascript: void(0);" class="text-dark">
<img src="../assets/images/users/avatar-3.jpg" alt="contact-img" title="contact-img" class="avatar-sm rounded-circle img-thumbnail" />
<span class="ml-2">Jose D. Delacruz</span>
</a>
</td>
<td>
New submission on your website
</td>
<td>
<a href="javascript: void(0);">
<img src="../assets/images/users/avatar-9.jpg" alt="contact-img" title="contact-img" class="avatar-sm rounded-circle img-thumbnail" />
</a>
</td>
<td>
<span class="badge badge-warning">Medium</span>
</td>
<td>
<span class="badge badge-secondary">Closed</span>
</td>
<td>
2008/04/25
</td>
<td>
2008/04/25
</td>
<td>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit Ticket</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-check-all mr-2 text-muted font-18 vertical-middle"></i>Close</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Remove</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-star mr-2 font-18 text-muted vertical-middle"></i>Mark as Unread</a>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- end col -->
</div>
<!-- end row -->

View File

@ -0,0 +1,59 @@
<div class="row mt-4" id="client_add">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Client Onboarding</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("client/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>
</div>
</div>
<ul class="nav nav-pills navtab-bg">
<li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block">General</span>
</a>
</li>
<li class="nav-item">
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2">
<span class="mr-1"><i class="fa fa-file"></i></span>
<span class="d-none d-sm-inline-block">KYC Docs</span>
</a>
</li>
<li class="nav-item">
<a href="#RM-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2">
<span class="mr-1"><i class="mdi mdi-account-switch"></i></span>
<span class="d-none d-sm-inline-block"> Relationship Manager</span>
</a>
</li>
<li class="nav-item">
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2">
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
<span class="d-none d-sm-inline-block">Branch & Contacts</span>
</a>
</li>
<li class="nav-item">
<a href="#police-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2">
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
<span class="d-none d-sm-inline-block">Polices</span>
</a>
</li>
</ul>
<div class="tab-content">
<?php include('client_basic_info.php'); ?>
<?php include('client_kyc.php'); ?>
<?php include('client_rm.php'); ?>
<?php include('client_branch.php'); ?>
<?php include('client_policy.php'); ?>
</div>
</div>
</div>
</div>
</div>

116
app/Views/client_policy.php Normal file
View File

@ -0,0 +1,116 @@
<div class="tab-pane fade" id="police-tab">
<div class="row float-right" style="padding-bottom: 10px;">
<div class="col-6">
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd">Add</button>
</div>
</div>
<div class="table-responsive" id="table_list" >
<table class="table table-borderless table-nowrap mb-0">
<thead class="thead-light">
<tr>
<th>#</th>
<th>Branch Name</th>
<th>Branch Code</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>App design and development</td>
<td>01/01/2015</td>
</tr>
<tr>
<td>2</td>
<td>Coffee detail page - Main Page</td>
<td>21/07/2016</td>
</tr>
</tbody>
</table>
</div>
<div class="row" id="add_form">
<div class="col-12">
<div class="card-body">
<div class="row float-right" style="position: relative; bottom: 20px;">
<div class="col-6">
<button type="button" class="btn btn-primary waves-effect waves-light btnBack">Back</button>
</div>
</div>
<hr>
<form role="form" class="parsley-examples" method="post" id="UserForm" action=""
enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="UserId" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-4">
<label for="email">Insurer<span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role">
<option value="">Select Insurer Branch</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="first_name">Polices<span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role">
<option value="">Select Policy</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="mobile">TPA<span
class="text-danger">*</span></label>
<select class="form-control" id="role" name="role">
<option value="">Select TPA Branch</option>
</select>
</div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button>
<button type="button" class="btn btn-secondary waves-effect btnBack"
id="btnBack">Cancel</button>
</div>
</form>
</div>
</div> <!-- end col-->
</div>
</div>
<!-- end -->
<script>
$(document).ready(function () {
$('#add_form').hide();
$('.btnBack').hide();
$('.btnAdd').click(function(){
$('#add_form').show();
$('#table_list').hide();
$('.btnBack').show();
$('.btnAdd').hide();
$('#UserForm').attr('action', '<?php echo base_url('/user/create');?>');
})
$('.btnBack').click(function(){
$('#add_form').hide();
$('#table_list').show();
$('.btnBack').hide();
$('.btnAdd').show();
})
});
</script>

91
app/Views/client_rm.php Normal file
View File

@ -0,0 +1,91 @@
<style>
body {
.multiselect-native-select {
position: relative;
/* bottom: 32px; */
select {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px -1px -1px -3px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
left: 50%;
top: 30px;
}
}
.multiselect-container{
width: 100% !important;
}
.multiselect-selected-text{
float: left !important;
}
}
</style>
<div class="tab-pane fade" id="RM-tab">
<div class="row">
<div class="col-12">
<div class="card-body">
<form role="form" class="parsley-examples" method="post" id="UserForm" action=""
enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="UserId" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-4">
<label for="emp_code">Account Manager</label>
<select class="form-control" id="account_manager" name="role">
<!-- <option value="">Select Account Manager</option> -->
</select>
</div>
<div class="form-group col-md-4">
<label for="profile">Manager</label>
<select class="form-control" id="role" name="role">
<option value="">Select Manager</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="profile">Head</label>
<select class="form-control" id="role" name="role">
<option value="">Select Head</option>
</select>
</div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button>
<button type="button" class="btn btn-secondary waves-effect btnBack"
id="btnBack">Cancel</button>
</div>
</form>
</div>
</div> <!-- end col-->
</div>
<!-- end row -->
</div>
<!-- end -->
<script>
$(document).ready(function(){
$('#account_manager').multiselect({
nonSelectedText: 'Select Account Manager',
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
includeSelectAllOption : false,
buttonWidth:'100%'
});
});
</script>

View File

@ -470,6 +470,8 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" />
<!-- fontAwsome -->
<script src="<?= base_url()."public"; ?>/assets/js/pages/fontawesome.init.js"></script>
</body>
</html>

View File

@ -52,15 +52,6 @@
});
}
</script>
<style>
.btn-group, .btn-group-vertical {
position: relative;
top: 31px !important;
display: inline-flex;
vertical-align: middle;
}
</style>
</head>
@ -529,10 +520,10 @@
<h5 class="menu-title">Dashboards</h5>
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" href="index.html">Sales</a>
<a class="nav-link" href="<?= base_url('/user/list')?>">Users</a>
</li>
<li class="nav-item">
<a class="nav-link" href="dashboard-crm.html">CRM</a>
<a class="nav-link" href="<?= base_url('/client/list')?>">Clients</a>
</li>
<li class="nav-item">
<a class="nav-link" href="dashboard-analytics.html">Analytics</a>