Merge branch 'main' of bitbucket.org:venbainformationtechnology/bb_sign
This commit is contained in:
commit
61b293bf04
@ -33,8 +33,10 @@ use CodeIgniter\Router\RouteCollection;
|
||||
$routes->get('client_home','ClientController::client_home');
|
||||
$routes->post('status_client','ClientController::status_client');
|
||||
$routes->post('doc_rejection','ClientController::doc_rejection');
|
||||
$routes->match(['get','post'],'/client_branch_list','ClientController::client_branch_list');
|
||||
|
||||
|
||||
|
||||
$routes->match(['get','post'],'/service_group_list','MasterController::service_group_list');
|
||||
$routes->match(['get','post'],'/service_group_create','MasterController::service_group_create');
|
||||
$routes->match(['get','post'],'/service_group_edit','MasterController::service_group_edit');
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Controllers;
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\ClientBranchModel;
|
||||
use App\Models\StaffModel;
|
||||
use App\Models\ClientDocsModel;
|
||||
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
@ -11,6 +13,8 @@ class ClientController extends BaseController
|
||||
{
|
||||
public $session;
|
||||
protected $ClientModel;
|
||||
protected $ClientBranchModel;
|
||||
protected $StaffModel;
|
||||
protected $ClientDocsModel;
|
||||
|
||||
use ResponseTrait;
|
||||
@ -19,6 +23,8 @@ class ClientController extends BaseController
|
||||
{
|
||||
$this->session = session();
|
||||
$this->ClientModel = new ClientModel();
|
||||
$this->ClientBranchModel = new ClientBranchModel();
|
||||
$this->StaffModel = new StaffModel();
|
||||
$this->ClientDocsModel = new ClientDocsModel();
|
||||
|
||||
}
|
||||
@ -244,4 +250,24 @@ class ClientController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function client_branch_list()
|
||||
{
|
||||
// if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
|
||||
|
||||
|
||||
// $data['clientBranchList'] = $this->ClientBranchModel->select('client.* , COUNT(client_docs.id) as docs_count')
|
||||
$data['clientBranchList'] = $this->ClientBranchModel->select('*')
|
||||
// ->join('client_docs', 'client.client_id = client_docs.client_id', 'left')
|
||||
// ->where('client.branch_id',$this->session->get('logged_in_staff_branch_id'))
|
||||
// ->groupBy('client.client_id')
|
||||
->findAll();
|
||||
|
||||
$staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();
|
||||
echo view('layout/header', ['Data'=>$staffdata]);
|
||||
// echo view('layout/header');
|
||||
echo view('client_branch_list',$data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
19
app/Models/ClientBranchModel.php
Normal file
19
app/Models/ClientBranchModel.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ClientBranchModel extends Model
|
||||
{
|
||||
protected $table = 'client_branch';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = [ 'client_id','name',
|
||||
'gst_no', 'mobile_no' ,
|
||||
'email' , 'address',
|
||||
'country', 'state',
|
||||
'city', 'pin_code',
|
||||
'otp', 'is_active',
|
||||
'created_by', 'updated_by'];
|
||||
|
||||
|
||||
}
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="form-group ">
|
||||
<label for="name">Change Logo</label>
|
||||
<input type="file" id="business_logo" name="business_logo" accept="image/*" onchange="PreviewImage();">
|
||||
|
||||
@ -283,18 +283,18 @@ function PreviewImage() {
|
||||
var allowedExtensions = ["jpg", "jpeg", "png"];
|
||||
var fileExtension = file.name.split('.').pop().toLowerCase();
|
||||
|
||||
if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) {
|
||||
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
fileInput.value = ""; // Clear the file input
|
||||
document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; // Remove the preview image
|
||||
} else {
|
||||
// if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) {
|
||||
// toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
// // fileInput.value = ""; // Clear the file input
|
||||
// // document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; // Remove the preview image
|
||||
// } else {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
reader.onload = function (event) {
|
||||
document.getElementById("uploadPreview").src = event.target.result;
|
||||
};
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
164
app/Views/client_branch_list.php
Normal file
164
app/Views/client_branch_list.php
Normal file
@ -0,0 +1,164 @@
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<div class="content-page">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Client Branch List</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class=""> <a href="#" id="add_branch_model_open" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect">
|
||||
Add Branch
|
||||
</a>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Branch Name</th>
|
||||
<th>GST</th>
|
||||
<th>Address</th>
|
||||
<th>City</th>
|
||||
<th>State</th>
|
||||
<th>Postal Code</th>
|
||||
<th>Contact</th>
|
||||
<th>Active</th>
|
||||
<!-- <th>User List</th> -->
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- container -->
|
||||
|
||||
</div> <!-- content -->
|
||||
|
||||
|
||||
<div id="bike_make_login-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4>Add Branch - </h4>
|
||||
</div>
|
||||
<form id="model_form_data" class="px-4">
|
||||
|
||||
<input type="text" id="business_id" value="" hidden>
|
||||
<input type="text" id="branch_id" hidden>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="branchname">Branch Name</label>
|
||||
<input class="form-control" name="branch_name" type="text" id="branch_name" required="" placeholder="Branch Name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="gstno">GST No</label>
|
||||
<input class="form-control" name="gst_no" type="text" id="gst_no" required="" placeholder="GST No" pattern="[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[0-9]{1}[Z]{1}[0-9A-Z]{1}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input class="form-control" name="email" type="email" id="email" required="" placeholder="Email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="contact1">Contact 1</label>
|
||||
<input class="form-control" name="contact_1" type="text" id="contact_1" required="" minlength="6" maxlength="16" placeholder="Contact 1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="contact2">Contact 2</label>
|
||||
<input class="form-control" name="contact_2" type="text" id="contact_2" required="" minlength="6" maxlength="16" placeholder="Contact 2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="address">Address</label>
|
||||
<input class="form-control" name="address" type="text" id="address" required="" placeholder="Address">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="city">City</label>
|
||||
<input class="form-control" name="city" type="text" id="city" required="" placeholder="City">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="state">State</label>
|
||||
<input class="form-control" name="state" type="text" id="state" required="" placeholder="State">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="pincode">Country</label>
|
||||
<input class="form-control" name="country" type="text" id="country" required="" placeholder="Country">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="pincode">Pin Code</label>
|
||||
<input class="form-control" name="postal_code" type="text" id="postal_code" required="" placeholder="Postal Code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="statecode">State Code</label>
|
||||
<input class="form-control" name="state_code" type="text" id="state_code" required="" placeholder="State Code">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitBranch(this)">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
|
||||
@ -297,7 +297,7 @@
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-client">
|
||||
<a href="<?= base_url()."client_list"; ?>" class="dropdown-item">Client List</a>
|
||||
<a href="<?= base_url()."client_create"; ?>" class="dropdown-item">Create Client</a>
|
||||
<a href="<?= base_url()."client_branch_list"; ?>" class="dropdown-item">Client Branch</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user