suseendhiran
@ -32,6 +32,7 @@ class CompanyController extends CI_Controller{
|
||||
|
||||
if($this->input->post('submit')){
|
||||
|
||||
print_r($this->input->post());die();
|
||||
$config = array(
|
||||
|
||||
'file_name'=>time(),
|
||||
@ -116,6 +117,7 @@ class CompanyController extends CI_Controller{
|
||||
$id=$this->input->get('id');
|
||||
$result['data']=$this->CompanyModel->editcompany($id);
|
||||
$result['bdata']=$this->CompanyModel->get_branch($id);
|
||||
// print_r($result);die();
|
||||
// echo '<pre>'; print_r($result); die();
|
||||
$this->load->view('editcompanylist',$result);
|
||||
|
||||
@ -165,17 +167,36 @@ class CompanyController extends CI_Controller{
|
||||
|
||||
$count = count($this->input->post('branch_name'));
|
||||
|
||||
|
||||
// print_r($this->input->post('new_branch_name'));die();
|
||||
for($i=0;$i<$count;$i++)
|
||||
{
|
||||
$id = $this->input->post('branch_id');
|
||||
// echo $this->input->post('branch_id')[$i];die();
|
||||
$id = $this->input->post('branch_id')[$i];
|
||||
$branch['branch_name']= $this->input->post('branch_name')[$i];
|
||||
$branch['branch_address'] = $this->input->post('address')[$i];
|
||||
$branch['maplink'] = $this->input->post('maplink')[$i];
|
||||
|
||||
// echo '<pre>'; echo $id; print_r($branch); die();
|
||||
$this->CompanyModel->updatebranches($branch, $id);
|
||||
}
|
||||
if ($this->input->post('new_branch_name')) {
|
||||
$count1 = count($this->input->post('new_branch_name'));
|
||||
|
||||
|
||||
for($i=0;$i<$count1;$i++) {
|
||||
|
||||
$branch['comp_id'] = $this->input->post('comp_id');
|
||||
$branch['branch_name']= $this->input->post('new_branch_name')[$i];
|
||||
$branch['branch_address'] = $this->input->post('new_address')[$i];
|
||||
$branch['maplink'] = $this->input->post('new_maplink')[$i];
|
||||
|
||||
// echo '<pre>'; print_r($branch); die();
|
||||
|
||||
}
|
||||
$result=$this->CompanyModel->branches($branch);
|
||||
|
||||
}
|
||||
}
|
||||
$this->session->set_flashdata('status', '"'. $company['comp_name'] .'" -Company Updated Sucessfully');
|
||||
redirect('CompanyController/companylist');
|
||||
|
||||
|
||||
@ -132,6 +132,8 @@ public function addemp()
|
||||
|
||||
|
||||
$id=$this->input->get('id');
|
||||
$result['get_comp'] = $this->EmployeeModel->getcomp();
|
||||
$result['get_branch'] = $this->EmployeeModel->getbranch();
|
||||
$result['data']=$this->EmployeeModel->editrecords($id);
|
||||
$this->load->view('EditEmp',$result);
|
||||
}
|
||||
@ -204,30 +206,37 @@ public function addemp()
|
||||
|
||||
|
||||
|
||||
public function viewemp($id)
|
||||
public function viewemp($id = null)
|
||||
{
|
||||
|
||||
if($this->session->userdata('user_id'))
|
||||
{
|
||||
|
||||
$result['view'] = $this->EmployeeModel->viewEmployee($id);
|
||||
$this->load->view('EmpPreview', $result);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
redirect('LoginController');
|
||||
}
|
||||
if($this->session->userdata('user_id'))
|
||||
{
|
||||
|
||||
$result['view'] = $this->EmployeeModel->viewEmployee($id);
|
||||
if ($result['view'] == '') {
|
||||
echo '<center><h2>User information not avaiable<h2><center>';
|
||||
} else {
|
||||
$this->load->view('EmpPreview', $result);
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<center><h2>User information not avaiable<h2><center>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function EmpIDCard($id)
|
||||
public function EmpIDCard($id = null)
|
||||
{
|
||||
|
||||
$result['view'] = $this->EmployeeModel->viewEmployee($id);
|
||||
$this->load->view('EmpIDCard', $result);
|
||||
if ($result['view'] == '') {
|
||||
echo '<center><h2>User information not avaiable<h2><center>';
|
||||
} else {
|
||||
$this->load->view('EmpIDCard', $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -345,6 +354,31 @@ public function vcard(){
|
||||
force_download($filename, $vcard);
|
||||
}
|
||||
|
||||
public function deleteEmp()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$this->db->set('is_active', '2');
|
||||
$this->db->where('emp_id', $id);
|
||||
$this->db->update('employees');
|
||||
redirect( 'EmployeeController/DisableEmployeeList' );
|
||||
}
|
||||
|
||||
public function check_emp_code()
|
||||
{
|
||||
if($this->input->post('emp_code'))
|
||||
{
|
||||
$data = $this->EmployeeModel->check_code_exist($this->input->post('emp_code'));
|
||||
if ($data)
|
||||
{
|
||||
echo true;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -67,20 +67,23 @@ class LoginController extends CI_Controller
|
||||
|
||||
// $email_verify = $this->LoginModel->validate_user($user);
|
||||
if (empty($user)) {
|
||||
$this->session->set_flashdata('msg1', "Email not available");
|
||||
$this->session->set_flashdata('username', $this->input->post('email'));
|
||||
$this->session->set_flashdata('user', "Invalid email id");
|
||||
$this->load->view('login');
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
if ($user && password_verify($password, $user->password))
|
||||
if ($user && $password == $user->password)
|
||||
{
|
||||
$this->session->set_userdata('user_id', $user->email);
|
||||
redirect('Dashboard');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('msg2',"Invalid Password");
|
||||
$this->session->set_userdata('user_id', $user->email);
|
||||
$this->session->set_flashdata('password', $this->input->post('password'));
|
||||
$this->session->set_flashdata('pass',"Invalid Password");
|
||||
$this->load->view('login');
|
||||
}
|
||||
}
|
||||
@ -120,20 +123,22 @@ public function updatepass()
|
||||
$this->load->view('changepass');
|
||||
|
||||
}
|
||||
|
||||
if ($new_password != $confirm_password)
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error', 'The new password and confirm password do not match.');
|
||||
$this->load->view('changepass');
|
||||
if ($new_password != $confirm_password)
|
||||
{
|
||||
$this->session->set_flashdata('error', 'The new password and confirm password do not match.');
|
||||
$this->load->view('changepass');
|
||||
}
|
||||
|
||||
$hashed_password = password_hash($new_password, PASSWORD_DEFAULT);
|
||||
|
||||
|
||||
$this->LoginModel->update_user_password($user_id, $hashed_password);
|
||||
|
||||
$this->session->set_flashdata('success', 'Your password has been changed.');
|
||||
redirect('LoginController');
|
||||
}
|
||||
|
||||
$hashed_password = password_hash($new_password, PASSWORD_DEFAULT);
|
||||
|
||||
|
||||
$this->LoginModel->update_user_password($user_id, $hashed_password);
|
||||
|
||||
$this->session->set_flashdata('success', 'Your password has been changed.');
|
||||
redirect('LoginController');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ public function getbranch(){
|
||||
}
|
||||
|
||||
public function EmployeeList(){
|
||||
// echo $this->siteURL();die();
|
||||
|
||||
$query = $this->db->query('SELECT employees.* , company.comp_name,branches.branch_name
|
||||
FROM employees LEFT JOIN company
|
||||
@ -68,6 +69,17 @@ return $query->result();
|
||||
|
||||
}
|
||||
|
||||
public function check_code_exist($id)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from('employees');
|
||||
$this->db->where('emp_code', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result_array();
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
public function updateemp($employee, $id){
|
||||
|
||||
@ -94,11 +106,12 @@ return $query->result();
|
||||
$this->db->from('employees A');
|
||||
$this->db->join('company', 'company.comp_id = A.comp_id', 'left');
|
||||
$this->db->join('branches', 'branches.branch_id = A.branch_id', 'left');
|
||||
$this->db->where('md5(A.emp_id)', $id);
|
||||
$this->db->where('A.emp_code', $id);
|
||||
$this->db->where('A.is_active', 1);
|
||||
|
||||
$query = $this->db->get();
|
||||
$query = $query->row();
|
||||
// echo $this->db->last_query(); die;
|
||||
return $query;
|
||||
|
||||
|
||||
@ -109,6 +122,31 @@ return $query->result();
|
||||
}
|
||||
|
||||
|
||||
// public function view_employee($id)
|
||||
// {
|
||||
|
||||
|
||||
|
||||
// $this->db->select('A.* , company.*, branches.* ');
|
||||
// $this->db->from('employees A');
|
||||
// $this->db->join('company', 'company.comp_id = A.comp_id', 'left');
|
||||
// $this->db->join('branches', 'branches.branch_id = A.branch_id', 'left');
|
||||
// $this->db->where('A.emp_code', $id);
|
||||
// $this->db->where('A.is_active', 1);
|
||||
|
||||
// $query = $this->db->get();
|
||||
// $query = $query->row();
|
||||
// // echo $this->db->last_query(); die;
|
||||
// return $query;
|
||||
|
||||
|
||||
// // $this->db->where('md5(emp_id)', $id);
|
||||
// // $query = $this->db->get('employees');
|
||||
// // return $query->result_array();
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public function DisableEmployeeList(){
|
||||
|
||||
@ -179,6 +217,15 @@ public function empcode_validation($empid){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function delete_emp_by_md5_id($id,$business_id,$table)
|
||||
{
|
||||
$this->db->where('md5(id)', $id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update($table);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -81,12 +81,16 @@ $('#empidErr').hide();
|
||||
data:{ empid:empid},
|
||||
success:function(response)
|
||||
{
|
||||
|
||||
alert(response)
|
||||
if (response == true)
|
||||
{
|
||||
$('#empidErr').show();
|
||||
$('#empidErr').html('This Employee Code Alredy Exist');
|
||||
$("#empid").val('');
|
||||
$('#empidErr').html('This Employee Code Alredy Exist.');
|
||||
$("#submit").attr("disabled", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#submit").attr("disabled", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -276,9 +280,9 @@ if (companyName == '') {
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label>Upload Photo<span class="error">*</span></label>
|
||||
<input type="file" name="emp_img" accept="image/png, image/jpg" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" required/><br>
|
||||
<input type="file" name="emp_img" accept="image/png, image/jpg , image/jpeg" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" required/><br>
|
||||
<span id="imgErr" class="error"></span>
|
||||
<div class="mt-2" style="color:#c73200;">(JPG, PNG Only | Max 1MB)</div>
|
||||
<div class="mt-2" style="color:#c73200;">(JPG, JPEG , PNG Only | Max 1MB | 300 x 300)</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<img src="http://ssl.gstatic.com/accounts/ui/avatar_2x.png" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/>
|
||||
@ -325,10 +329,51 @@ $(document).ready(function() {
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// $('#companyName').on('change', function () {
|
||||
// $('#comp_Err').html('')
|
||||
// });
|
||||
// $('#empid').on('change', function () {
|
||||
// $('#empidErr').html('')
|
||||
// });
|
||||
// $('#name').on('change', function () {
|
||||
// $('#nameErr').html('')
|
||||
// });
|
||||
// $('#emp_desg').on('change', function () {
|
||||
// $('#degsErr').html('')
|
||||
// });
|
||||
// $('#mno').on('change', function () {
|
||||
// $('#mobErr').html('')
|
||||
// });
|
||||
// $('#email').on('change', function () {
|
||||
// $('#emailErr').html('')
|
||||
// });
|
||||
// $('#uploadImage').on('change', function () {
|
||||
// $('#imgErr').html('')
|
||||
// });
|
||||
|
||||
// function check_if_exists() {
|
||||
|
||||
// var code = $("#empid").val();
|
||||
// $.ajax({
|
||||
// type:"post",
|
||||
// url: "<?php echo base_url(); ?>EmployeeController/check_emp_code",
|
||||
// data:{ code:code},
|
||||
// success:function(response)
|
||||
// {
|
||||
// if (response == true)
|
||||
// {
|
||||
// alert("This mail id already exists");
|
||||
// // $("#email").val('');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#companyName').on('keyup', function() {
|
||||
$('#companyName').on('change', function() {
|
||||
var companyName = $('#companyName').val();
|
||||
if (companyName == '') {
|
||||
if ($('#companyName').val().length == 0) {
|
||||
$('#comp_Err').text('Please Select a Company name.');
|
||||
} else
|
||||
{
|
||||
@ -338,26 +383,26 @@ $(document).ready(function() {
|
||||
|
||||
$('#branch_name').on('keyup', function() {
|
||||
var branchName = $('#branch_name').val();
|
||||
if (branchName == '') {
|
||||
if ($('#branch_name').val().length == 0) {
|
||||
$('#branchErr').text('Please Select a Branch name.');
|
||||
} else {
|
||||
$('#branchErr').text('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#empid').on('keyup', function() {
|
||||
var empid = $('#empid').val();
|
||||
if (empid == '') {
|
||||
$('#empidErr').text('Please Enter a Employee Code.');
|
||||
$('#empid').on('change', function() {
|
||||
if ($('#empid').val().length == 0) {
|
||||
alert($('#empid').val().length)
|
||||
$('#empidErr').html('Please Enter a Employee Code.');
|
||||
} else {
|
||||
$('#empidErr').text('');
|
||||
$('#empidErr').html();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#name').on('keyup', function() {
|
||||
var name = $('#name').val();
|
||||
if (name == '') {
|
||||
if ($('#name').val().length == 0) {
|
||||
$('#nameErr').text('Please Enter a Employee Name.');
|
||||
} else {
|
||||
$('#nameErr').text('');
|
||||
@ -367,7 +412,7 @@ $(document).ready(function() {
|
||||
|
||||
$('#emp_desg').on('keyup', function() {
|
||||
var emp_desg = $('#emp_desg').val();
|
||||
if (emp_desg == '') {
|
||||
if ($('#emp_desg').val().length == 0) {
|
||||
$('#degsErr').text('Please Enter a Employee Designation.');
|
||||
} else {
|
||||
$('#degsErr').text('');
|
||||
@ -378,7 +423,7 @@ $(document).ready(function() {
|
||||
|
||||
$('#mno').on('keyup', function() {
|
||||
var mno = $('#mno').val();
|
||||
if (mno == '')
|
||||
if ($('#mno').val().length == 0)
|
||||
{
|
||||
$('#mobErr').text('Please Enter a MobileNumber.');
|
||||
}
|
||||
@ -390,7 +435,7 @@ $(document).ready(function() {
|
||||
|
||||
$('#email').on('keyup', function() {
|
||||
var email = $('#branch_name').val();
|
||||
if (email == '') {
|
||||
if ($('#email').val().length == 0) {
|
||||
$('#emailErr').text('Please Enter a Employee Email-Id.');
|
||||
} else {
|
||||
$('#emailErr').text('');
|
||||
@ -398,9 +443,9 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
|
||||
$('#uploadImage').on('keyup', function() {
|
||||
$('#uploadImage').on('change', function() {
|
||||
var uploadImage = $('#uploadImage').val();
|
||||
if (uploadImage == '') {
|
||||
if ($('#uploadImage').val().length == 0) {
|
||||
$('#imgErr').text('Please Enter a Employee Image.');
|
||||
} else {
|
||||
$('#imgErr').text('');
|
||||
@ -422,37 +467,37 @@ $(document).ready(function() {
|
||||
var errorFound = false;
|
||||
|
||||
if (companyName == '') {
|
||||
$('#comp_Err').text('Please Select a Company name.');
|
||||
$('#comp_Err').text('Enter Company Name.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (empid == '') {
|
||||
$('#empidErr').text('Please Enter a Employee Code.');
|
||||
$('#empidErr').text('Enter Employee Code.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (name == '') {
|
||||
$('#nameErr').text('Please Enter a Employee Name.');
|
||||
$('#nameErr').text('Enter Employee Name.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (emp_desg == '') {
|
||||
$('#degsErr').text('Please Enter a Employee Designation.');
|
||||
$('#degsErr').text('Enter Employee Designation.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (mno == '') {
|
||||
$('#mobErr').text('Please Enter a Employee MobileNumber.');
|
||||
$('#mobErr').text('Enter Employee MobileNumber.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (email == '') {
|
||||
$('#emailErr').text('Please Enter a Employee Email-Id.');
|
||||
$('#emailErr').text('Enter Employee Email-Id.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (uploadImage == '') {
|
||||
$('#imgErr').text('Please Enter a Employee Image.');
|
||||
$('#imgErr').text('Enter Employee Image.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
|
||||
@ -36,13 +36,13 @@
|
||||
<table class="custom-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Emp ID</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Mobile</th>
|
||||
<th>Company</th>
|
||||
<th>Branch</th>
|
||||
<th>Action</th>
|
||||
<th class="disableSort">Emp ID</th>
|
||||
<th class="disableSort">Name</th>
|
||||
<th class="disableSort">Email</th>
|
||||
<th class="disableSort">Mobile</th>
|
||||
<th class="disableSort">Company</th>
|
||||
<th class="disableSort">Branch</th>
|
||||
<th class="disableSort">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -60,7 +60,8 @@
|
||||
<td><?php echo $row['emp_mobile']; ?></td>
|
||||
<td><?php echo $row['comp_name']; ?></td>
|
||||
<td><?php echo $row['branch_name']; ?></td>
|
||||
<td><a href="<?php echo base_url('EmployeeController/EmpEnable'); ?>?id=<?php echo $row['emp_id'];?>" onclick = "return confirm('Are you sure to ENABLE <?php echo $row['emp_name']; ?>')" class="edit-btn">ENABLE</a></td>
|
||||
<td class="action-btn deactivate-btn"><a href="<?php echo base_url('EmployeeController/EmpEnable'); ?>?id=<?php echo $row['emp_id'];?>" onclick = "return confirm('Are you sure to ENABLE <?php echo $row['emp_name']; ?>')"><i class="fa fa-power-off"></i></a>
|
||||
<a href="<?php echo base_url('EmployeeController/deleteEmp'); ?>?id=<?php echo $row['emp_id'];?>" onclick = "return confirm('Are you sure to DELETE <?php echo $row['emp_name']; ?>')" class="delete"> <i class="fa fa-trash"></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -63,45 +63,48 @@
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-6">
|
||||
<label>Branch Name<span class="error">*</span></label>
|
||||
<select name='branch_id' class="ct" required>
|
||||
<select name='branch_id' class="st" required>
|
||||
<option value="<?php echo $row->branch_id; ?>" ><?php echo $row->branch_name; ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Employee ID<span class="error">*</span></label>
|
||||
<input type="text" name="emp_code" value="<?php echo $row->emp_code; ?>" class="disabled" readonly />
|
||||
<input type="text" onkeyup="checkemp_if_exists()" id="emp_code" name="emp_code" value="<?php echo $row->emp_code; ?>" class="disabled" required /><span id="empidErr" class="error"></span>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Employee Name<span class="error">*</span></label>
|
||||
<input type="text" name="emp_name" value="<?php echo $row->emp_name; ?>"/>
|
||||
<input type="text" name="emp_name" value="<?php echo $row->emp_name; ?>" required />
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Designation<span class="error">*</span></label>
|
||||
<input type="text" name="emp_desg" value="<?php echo $row->emp_desg; ?>"/>
|
||||
<input type="text" name="emp_desg" value="<?php echo $row->emp_desg; ?>" required />
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Mobile Number<span class="error">*</span></label>
|
||||
<input type="text" name="emp_mobile" value="<?php echo $row->emp_mobile; ?>"/>
|
||||
<input type="tel" onkeypress = "return matchnum(event)" pattern="[6-9]{1}[0-9]{9}"
|
||||
title="Phone number with 6-9 and remaing 9 digit with 0-9" name="emp_mobile" value="<?php echo $row->emp_mobile; ?>" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-6">
|
||||
<label>Email<span class="error">*</span></label>
|
||||
<input type="text" name="emp_email" value="<?php echo $row->emp_email; ?>"/>
|
||||
<input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" name="emp_email" value="<?php echo $row->emp_email; ?>" required/>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label>Upload Photo<span class="error">*</span></label>
|
||||
<input type="file" name="emp_img" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" value="<?php echo base_url(); ?>/uploads/<?php echo $row->emp_img; ?>" >
|
||||
<div class="mt-2" style="color:#c73200;">(JPG, PNG Only | Max 1MB)</div>
|
||||
<input type="file" accept="image/png, image/jpg , image/jpeg" name="emp_img" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" value="<?php echo base_url(); ?>/uploads/<?php echo $row->emp_img; ?>" >
|
||||
<div class="mt-2" style="color:#c73200;">(JPG , JPEG , PNG Only | Max 1MB | 300 x 300)</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<img src="<?php echo base_url(); ?>/uploads/<?php echo $row->emp_img; ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"><br><br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
<input type="submit" name="Submit" value="Submit" class="blue-btn submit-btn m-auto">
|
||||
<input type="submit" id="submit" name="Submit" value="Submit" class="blue-btn submit-btn m-auto">
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
@ -113,8 +116,38 @@
|
||||
<!-- Footer -->
|
||||
<?php include 'includes/footer.php' ?>
|
||||
<script>
|
||||
var empid1 = $("#emp_code").val();
|
||||
|
||||
function checkemp_if_exists() {
|
||||
var empid = $("#emp_code").val();
|
||||
$('#empidErr').hide();
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<?php echo base_url(); ?>EmployeeController/empcode_validation",
|
||||
data:{ empid:empid},
|
||||
success:function(response)
|
||||
{
|
||||
if (response == true)
|
||||
{
|
||||
|
||||
if ( $("#emp_code").val() != empid1 ) {
|
||||
$('#empidErr').show();
|
||||
$('#empidErr').html('This Employee Code Alredy Exist.');
|
||||
$("#submit").attr("disabled", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$("#submit").attr("disabled", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.st').change(function() {
|
||||
$('.ct').change(function() {
|
||||
var comp_id = $(this).val();
|
||||
if (comp_id != '') {
|
||||
$.ajax({
|
||||
@ -127,12 +160,15 @@ $(document).ready(function() {
|
||||
console.log(response)
|
||||
|
||||
var len = response.length;
|
||||
$('.ct').empty();
|
||||
// $('.st').empty();
|
||||
var arr = [];
|
||||
for (var i = 0; i < len; i++) {
|
||||
var branch_name = response[i]['branch_name'];
|
||||
var branch_id = response[i]['branch_id'];
|
||||
$('.ct').append("<option value='"+branch_id+"'>"+branch_name+"</option>");
|
||||
data = "<option value='"+branch_id+"'>"+branch_name+"</option>";
|
||||
arr.push(data);
|
||||
}
|
||||
$('.st').html(arr);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -141,6 +177,18 @@ $(document).ready(function() {
|
||||
}""
|
||||
});
|
||||
});
|
||||
|
||||
// age & mobile number (only number)
|
||||
function matchnum(event)
|
||||
{
|
||||
var charcode;
|
||||
|
||||
charcode = event.which || event.keyCode;
|
||||
|
||||
if(charcode>= 48 && charcode <= 57)return true; //only numbers
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -33,7 +33,7 @@
|
||||
<img src="<?php echo base_url(); ?>/assets/images/Whatsapp-icon.png">
|
||||
</div>
|
||||
<div class="details">
|
||||
<?php echo $view->emp_mobile; ?>
|
||||
<a href="https://api.whatsapp.com/send?phone=91<?php echo $view->emp_mobile; ?>" target="_blank"><?php echo $view->emp_mobile; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="employee-email">
|
||||
@ -41,7 +41,7 @@
|
||||
<img src="<?php echo base_url(); ?>/assets/images/Email-icon.png">
|
||||
</div>
|
||||
<div class="details">
|
||||
<?php echo $view->emp_email; ?>
|
||||
<a href="mailto:<?php echo $view->emp_email; ?>" target="_blank"><?php echo $view->emp_email; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="employee-website">
|
||||
@ -49,7 +49,7 @@
|
||||
<img src="<?php echo base_url(); ?>/assets/images/Website-Icon.png">
|
||||
</div>
|
||||
<div class="details">
|
||||
<?php echo $view->comp_web; ?>
|
||||
<a href="<?php echo $view->comp_web; ?>" target="_blank"><?php echo $view->comp_web; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="employee-address">
|
||||
@ -57,7 +57,7 @@
|
||||
<img src="<?php echo base_url(); ?>/assets/images/Location-Icon.png">
|
||||
</div>
|
||||
<div class="details">
|
||||
<?php echo $view->branch_name; ?>
|
||||
<?php echo $view->branch_address; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="emp-btn">
|
||||
@ -77,6 +77,15 @@
|
||||
</div>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script>
|
||||
|
||||
function siteURL() {
|
||||
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ||
|
||||
$_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
||||
$domainName = $_SERVER['HTTP_HOST'];
|
||||
return $protocol;
|
||||
}
|
||||
|
||||
|
||||
document.querySelector('#shareBtn')
|
||||
.addEventListener('click', event => {
|
||||
|
||||
@ -91,7 +100,24 @@
|
||||
title: 'GeeksForGeeks',
|
||||
|
||||
// URL to share
|
||||
url:"<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>",
|
||||
<?php
|
||||
if (isset($_SERVER['HTTPS']) &&
|
||||
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
|
||||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
|
||||
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
|
||||
?>
|
||||
url:"<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>",
|
||||
// $protocol = 'https://';
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
?>
|
||||
// $protocol = 'http://';
|
||||
url:"<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>",
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
}).then(() => {
|
||||
console.log('Thanks for sharing!');
|
||||
}).catch(err => {
|
||||
@ -114,4 +140,4 @@
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
<img src="<?php echo base_url(); ?>/assets/images/Website-Icon.png">
|
||||
</div>
|
||||
<div class="details">
|
||||
<?php echo $view->comp_web; ?>
|
||||
<?php echo preg_replace('~^https?://~', '', $view->comp_web); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="employee-address">
|
||||
@ -77,7 +77,7 @@
|
||||
<img src="<?php echo base_url(); ?>/assets/images/Location-Icon.png">
|
||||
</div>
|
||||
<div class="details">
|
||||
<?php echo $view->branch_name; ?>
|
||||
<?php echo $view->branch_address; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="emp-btn">
|
||||
@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div><a class="blue-btn w-100" href="<?php echo base_url('EmployeeController/EditEmp'); ?>?id=<?php echo $view->emp_id;?>">Edit</a></div>
|
||||
<div><a class="blue-btn w-100" href="<?php echo base_url('EmployeeController/EmpDisable'); ?>?id=<?php echo $view->emp_id;?>" onclick = "return confirm('Are you sure to DISABLE <?php echo $view->emp_name; ?>')">Deactivate</a></div>
|
||||
<div><a class="blue-btn w-100" href="<?php echo base_url('empvcard/'.md5($view->emp_id)); ?>" target="_blank">Live Link</a></div>
|
||||
<div><a class="blue-btn w-100" href="<?php echo base_url('empvcard/'.$view->emp_code); ?>" target="_blank">Live Link</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <input type="" name="emp_img" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" required><br><br> -->
|
||||
|
||||
@ -42,12 +42,12 @@
|
||||
<table class="custom-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Emp ID</th>
|
||||
<th>Name</th>
|
||||
<th>Mobile</th>
|
||||
<th>Company</th>
|
||||
<th>Branch</th>
|
||||
<th>Action</th>
|
||||
<th class="disableSort">Emp ID</th>
|
||||
<th class="disableSort">Name</th>
|
||||
<th class="disableSort">Mobile</th>
|
||||
<th class="disableSort">Company</th>
|
||||
<th class="disableSort">Branch</th>
|
||||
<th class="disableSort">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -67,7 +67,7 @@
|
||||
<td><?php echo $row['branch_name']; ?></td>
|
||||
|
||||
<td class="action-btn">
|
||||
<a href="<?php echo base_url('EmployeeController/viewemp/'.md5($row['emp_id'])); ?>"><i class="fas fa-eye"></i></a>
|
||||
<a href="<?php echo base_url('EmployeeController/viewemp/'.$row['emp_code']); ?>"><i class="fas fa-eye"></i></a>
|
||||
|
||||
|
||||
<a href="<?php echo base_url('EmployeeController/EditEmp'); ?>?id=<?php echo $row['emp_id'];?>"><i class="fa fa-pencil-alt"></i></a>
|
||||
|
||||
@ -1,203 +1,459 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Add Company</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2, user-scalable=yes">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo base_url('assets/fontawesome/css/all.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo base_url('assets/style.css'); ?>" rel="stylesheet">
|
||||
<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.bundle.min.js'); ?>"></script>
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Header -->
|
||||
<?php include 'includes/header.php'?>
|
||||
<section class="p-4">
|
||||
<div class="container">
|
||||
<h1 class="heading-style h2">Add Company</h1>
|
||||
<div style="color:orangered; font-weight: bolder; font-size: 16px;">
|
||||
<?php echo $this->session->flashdata('status');?>
|
||||
</div>
|
||||
<form method="post" action="<?php echo base_url('CompanyController/addcompany')?>" enctype="multipart/form-data" id="myForm" class="form-design">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<label>Company Logo<span id="logoErr" class="error">*</span></label>
|
||||
<input type="file" name="comp_logo" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" required>
|
||||
<div class="mt-2" style="color:#c73200;">(UploadSize: Below 1MB/ Type: PNG Only)</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<img src="http://ssl.gstatic.com/accounts/ui/avatar_2x.png" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Company Name<span id="companyNameError" class="error">*</span></label>
|
||||
<input type="text" id="companyName" name="comp_name" required/>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Company Website<span id="companyWebsiteError" class="error">*</span></label>
|
||||
<input type="text" id="companyWebsite" name="comp_web" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm-6">
|
||||
<label>Branch Name<span id="branchNameError" class="error">*</span></label>
|
||||
<input type="text" id="branch_name" name="branch_name[]" required/>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<label>Branch Address<span id="addressError" class="error">*</span></label>
|
||||
<input type="text" id="address" name="address[]" required/>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="button" id="add-button"><i class="fa fa-plus-square"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- division for add text fields -->
|
||||
<div id="fields-container"><div class="field-pair"></div></div>
|
||||
<input type="submit" id="submitButton" name=submit value="Submit">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// add event listener to "Add" button
|
||||
document.getElementById("add-button").addEventListener("click", function() {
|
||||
// create new field pair element
|
||||
var newPair = document.createElement("div");
|
||||
newPair.className = "field-pair";
|
||||
var label1 = document.createElement("label");
|
||||
label1.innerHTML = "Branch Name<span class='error'>*</span>";
|
||||
var label2 = document.createElement("label");
|
||||
label2.innerHTML = "Branch Address<span class='error'>*</span>";
|
||||
var input1 = document.createElement("input");
|
||||
input1.type = "text";
|
||||
input1.name = "branch_name[]";
|
||||
input1.required = true;
|
||||
var input2 = document.createElement("input");
|
||||
input2.type = "text";
|
||||
input2.name = "address[]";
|
||||
input2.required = true;
|
||||
var removeButton = document.createElement("button");
|
||||
removeButton.type = "button";
|
||||
removeButton.className = "remove-button";
|
||||
removeButton.textContent = "Remove";
|
||||
newPair.appendChild(label1);
|
||||
newPair.appendChild(input1);
|
||||
newPair.appendChild(label2);
|
||||
newPair.appendChild(input2);
|
||||
newPair.appendChild(removeButton);
|
||||
document.getElementById("fields-container").appendChild(newPair);
|
||||
// add event listener to "Remove" button
|
||||
removeButton.addEventListener("click", function() {
|
||||
newPair.remove();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]);
|
||||
|
||||
oFReader.onload = function (oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#uploadImage').on('keyup', function() {
|
||||
var uploadImage = $('#uploadImage').val();
|
||||
if (uploadImage == '') {
|
||||
$('#logoErr').text('Please enter a company name.');
|
||||
} else {
|
||||
$('#logoErr').text('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#companyName').on('keyup', function() {
|
||||
var companyName = $('#companyName').val();
|
||||
if (companyName == '') {
|
||||
$('#companyNameError').text('Please enter a company name.');
|
||||
} else {
|
||||
$('#companyNameError').text('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#companyWebsite').on('keyup', function() {
|
||||
var companyWebsite = $('#companyWebsite').val();
|
||||
if (companyWebsite == '') {
|
||||
$('#companyWebsiteError').text('Please enter a company website.');
|
||||
} else {
|
||||
$('#companyWebsiteError').text('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#branch_name').on('keyup', function() {
|
||||
var branchName = $('#branch_name').val();
|
||||
if (branchName == '') {
|
||||
$('#branchNameError').text('Please enter a branch name.');
|
||||
} else {
|
||||
$('#branchNameError').text('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#address').on('keyup', function() {
|
||||
var branchAddress = $('#address').val();
|
||||
if (branchAddress == '') {
|
||||
$('#addressError').text('Please enter a branch Address');
|
||||
} else {
|
||||
$('#addressError').text('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#submitButton').on('click', function() {
|
||||
var uploadImage = $('#uploadImage').val();
|
||||
var companyName = $('#companyName').val();
|
||||
var companyWebsite = $('#companyWebsite').val();
|
||||
var branchName = $('#branch_name').val();
|
||||
var branchAddress = $('#address').val();
|
||||
var errorFound = false;
|
||||
|
||||
if (companyName == '') {
|
||||
$('#companyNameError').text('Please enter a company name.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (companyWebsite == '') {
|
||||
$('#companyWebsiteError').text('Please enter a company website.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (branchName == '') {
|
||||
$('#branchNameError').text('Please enter a branch Name');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
if (branchAddress == '') {
|
||||
$('#addressError').text('Please enter a branch Address.');
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
|
||||
if (errorFound) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Footer -->
|
||||
<?php include 'includes/footer.php' ?>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<title>Add Company</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2, user-scalable=yes">
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
|
||||
|
||||
<link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet">
|
||||
|
||||
<link href="<?php echo base_url('assets/fontawesome/css/all.css'); ?>" rel="stylesheet">
|
||||
|
||||
<link href="<?php echo base_url('assets/style.css'); ?>" rel="stylesheet">
|
||||
|
||||
<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.bundle.min.js'); ?>"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
<?php include 'includes/header.php'?>
|
||||
|
||||
<section class="p-4">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1 class="heading-style h2">Add Company</h1>
|
||||
|
||||
<div style="color:orangered; font-weight: bolder; font-size: 16px;">
|
||||
|
||||
<?php echo $this->session->flashdata('status');?>
|
||||
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?php echo base_url('CompanyController/addcompany')?>" enctype="multipart/form-data" id="myForm" class="form-design">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
<label>Company Logo<span id="logoErr" class="error">*</span></label>
|
||||
|
||||
<input type="file" accept="image/png, image/jpg" name="comp_logo" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" required>
|
||||
<div class="mt-2" style="color:#c73200;">(UploadSize: Below 1MB/ Type: PNG Only)</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
<img src="http://ssl.gstatic.com/accounts/ui/avatar_2x.png" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
<label>Company Name<span class="error">*</span></label>
|
||||
|
||||
<input type="text" id="companyName" name="comp_name" required/>
|
||||
|
||||
<span id="companyNameError" class="error"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
<label>Company Website<span class="error">*</span></label>
|
||||
|
||||
<input type="url" id="companyWebsite" name="comp_web" required/>
|
||||
|
||||
<span id="companyWebsiteError" class="error"></span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row align-items-center">
|
||||
|
||||
<div class="col-sm-11">
|
||||
|
||||
<div class="mb-3">
|
||||
|
||||
<label>Branch Name<span class="error">*</span></label>
|
||||
|
||||
<input type="text" id="branch_name" name="branch_name[]" required/>
|
||||
|
||||
<span id="branchNameError" class="error"></span>
|
||||
</div>
|
||||
|
||||
<label>Branch Address<span class="error">*</span></label>
|
||||
|
||||
<input type="text" id="address" name="address[]" required/>
|
||||
|
||||
<span id="addressError" class="error"></span>
|
||||
|
||||
<label>Google Map Link<span class="error">*</span></label>
|
||||
|
||||
<input type="url" id="maplink" name="maplink[]" required/>
|
||||
|
||||
<span id="maplinkError" class="error"></span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-1">
|
||||
|
||||
<button type="button" id="add-button" class="border-0"><i class="fa fa-plus-square"></i></button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- division for add text fields -->
|
||||
|
||||
<div id="fields-container"><div class="field-pair"></div></div>
|
||||
<div class="row text-center">
|
||||
<input type="submit" id="submitButton" name=submit value="Submit" class="blue-btn submit-btn m-auto">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// add event listener to "Add" button
|
||||
|
||||
document.getElementById("add-button").addEventListener("click", function() {
|
||||
|
||||
// create new field pair element
|
||||
|
||||
var newPair = document.createElement("div");
|
||||
|
||||
newPair.className = "field-pair";
|
||||
|
||||
var label1 = document.createElement("label");
|
||||
|
||||
label1.innerHTML = "Branch Name<span class='error'>*</span>";
|
||||
|
||||
var label2 = document.createElement("label");
|
||||
|
||||
label2.innerHTML = "Branch Address<span class='error'>*</span>";
|
||||
|
||||
var label3 = document.createElement("label");
|
||||
|
||||
label3.innerHTML = "Google Map Link<span class='error'>*</span>";
|
||||
|
||||
var input1 = document.createElement("input");
|
||||
|
||||
input1.type = "text";
|
||||
|
||||
input1.name = "branch_name[]";
|
||||
|
||||
input1.required = true;
|
||||
|
||||
var input2 = document.createElement("input");
|
||||
|
||||
input2.type = "text";
|
||||
|
||||
input2.name = "address[]";
|
||||
|
||||
input2.required = true;
|
||||
|
||||
var input3 = document.createElement("input");
|
||||
|
||||
input3.type = "url";
|
||||
|
||||
input3.name = "maplink[]";
|
||||
|
||||
input3.required = true;
|
||||
|
||||
var removeButton = document.createElement("button");
|
||||
|
||||
removeButton.type = "button";
|
||||
|
||||
removeButton.className = "remove-button border-0";
|
||||
|
||||
removeButton.innerHTML = "<i class='fa fa-times'></i>";
|
||||
|
||||
newPair.appendChild(label1);
|
||||
|
||||
newPair.appendChild(input1);
|
||||
|
||||
newPair.appendChild(label2);
|
||||
|
||||
newPair.appendChild(input2);
|
||||
|
||||
newPair.appendChild(label3);
|
||||
|
||||
newPair.appendChild(input3);
|
||||
|
||||
newPair.appendChild(removeButton);
|
||||
|
||||
document.getElementById("fields-container").appendChild(newPair);
|
||||
|
||||
// add event listener to "Remove" button
|
||||
|
||||
removeButton.addEventListener("click", function() {
|
||||
|
||||
newPair.remove();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function PreviewImage() {
|
||||
|
||||
var oFReader = new FileReader();
|
||||
|
||||
oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]);
|
||||
|
||||
|
||||
|
||||
oFReader.onload = function (oFREvent) {
|
||||
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
|
||||
$('#uploadImage').on('keyup', function() {
|
||||
|
||||
var uploadImage = $('#uploadImage').val();
|
||||
|
||||
if (uploadImage == '') {
|
||||
|
||||
$('#logoErr').text('Upload Image');
|
||||
|
||||
} else {
|
||||
|
||||
$('#logoErr').text('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#companyName').on('keyup', function() {
|
||||
|
||||
var companyName = $('#companyName').val();
|
||||
|
||||
if (companyName == '') {
|
||||
|
||||
$('#companyNameError').text('Enter Company Name');
|
||||
|
||||
} else {
|
||||
|
||||
$('#companyNameError').text('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#companyWebsite').on('keyup', function() {
|
||||
|
||||
var companyWebsite = $('#companyWebsite').val();
|
||||
|
||||
if (companyWebsite == '') {
|
||||
|
||||
$('#companyWebsiteError').text('Enter Company Website');
|
||||
|
||||
} else {
|
||||
|
||||
$('#companyWebsiteError').text('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#branch_name').on('keyup', function() {
|
||||
|
||||
var branchName = $('#branch_name').val();
|
||||
|
||||
if (branchName == '') {
|
||||
|
||||
$('#branchNameError').text('Enter Branch Name');
|
||||
|
||||
} else {
|
||||
|
||||
$('#branchNameError').text('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#address').on('keyup', function() {
|
||||
|
||||
var branchAddress = $('#address').val();
|
||||
|
||||
if (branchAddress == '') {
|
||||
|
||||
$('#addressError').text('Enter Branch Address');
|
||||
|
||||
} else {
|
||||
|
||||
$('#addressError').text('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#maplink').on('keyup', function() {
|
||||
|
||||
var maplink = $('#maplink').val();
|
||||
|
||||
if (maplink == '') {
|
||||
|
||||
$('#maplinkError').text('Enter Google Map Link');
|
||||
|
||||
} else {
|
||||
|
||||
$('#maplinkError').text('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#submitButton').on('click', function() {
|
||||
|
||||
var uploadImage = $('#uploadImage').val();
|
||||
|
||||
var companyName = $('#companyName').val();
|
||||
|
||||
var companyWebsite = $('#companyWebsite').val();
|
||||
|
||||
var branchName = $('#branch_name').val();
|
||||
|
||||
var branchAddress = $('#address').val();
|
||||
|
||||
var maplink = $('#maplink').val();
|
||||
|
||||
var errorFound = false;
|
||||
|
||||
|
||||
|
||||
if (companyName == '') {
|
||||
|
||||
$('#companyNameError').text('Enter Company Name');
|
||||
|
||||
errorFound = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (companyWebsite == '') {
|
||||
|
||||
$('#companyWebsiteError').text('Enter Company Website');
|
||||
|
||||
errorFound = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (branchName == '') {
|
||||
|
||||
$('#branchNameError').text('Enter Branch Name');
|
||||
|
||||
errorFound = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (branchAddress == '') {
|
||||
|
||||
$('#addressError').text('Enter Branch Address');
|
||||
|
||||
errorFound = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (maplink == '') {
|
||||
|
||||
$('#maplinkError').text('Enter Google Map Link');
|
||||
|
||||
errorFound = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (errorFound) {
|
||||
|
||||
return false;
|
||||
|
||||
} else {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
|
||||
<?php include 'includes/footer.php' ?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -4,7 +4,9 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Change Password</title>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
@ -23,6 +25,7 @@
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
input[type="email"],
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
display: block;
|
||||
width: 100%;
|
||||
@ -45,6 +48,14 @@
|
||||
input[type="submit"]:hover {
|
||||
background-color: #3e8e41;
|
||||
}
|
||||
.field-icon {
|
||||
float: right;
|
||||
margin-left: -25px;
|
||||
margin-top: -45px;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -52,17 +63,20 @@
|
||||
<form method="post" action="<?php echo base_url('LoginController/updatepass'); ?>">
|
||||
<div>
|
||||
<label for="old_password">Old Password:</label>
|
||||
<input type="password" id="old_password" name="old_password" required>
|
||||
<span id='message1'></span>
|
||||
<input class="form-control" type="password" id="old_password" name="old_password" required>
|
||||
<span id='message1' style="color:red"><?php echo $this->session->flashdata('error'); ?></span>
|
||||
<span toggle="#old_password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
<!-- <span id='message1'></span> -->
|
||||
</div>
|
||||
<div>
|
||||
<label for="new_password">New Password:</label>
|
||||
<input type="password" id="new_password" maxlength="10" name="new_password" required>
|
||||
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
<input class="form-control" type="password" id="new_password" maxlength="10" name="new_password" required>
|
||||
<span toggle="#new_password" id="toggle-password1" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="confirm_password">Confirm New Password:</label>
|
||||
<input type="password" id="confirm_password" maxlength="10" name="confirm_password" required>
|
||||
<input class="form-control" type="password" id="confirm_password" maxlength="10" name="confirm_password" required>
|
||||
<span toggle="#confirm_password" id="toggle-password2" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
<span id='message'></span>
|
||||
</div>
|
||||
<!-- <input type="submit" value="Change Password"><br> -->
|
||||
@ -75,6 +89,31 @@
|
||||
<script>
|
||||
|
||||
$("#toggle-password").click(function() {
|
||||
// alert("sdvs")
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
var input = $($(this).attr("toggle"));
|
||||
if (input.attr("type") == "password") {
|
||||
input.attr("type", "text");
|
||||
}
|
||||
else {
|
||||
input.attr("type", "password");
|
||||
}
|
||||
});
|
||||
|
||||
$("#toggle-password1").click(function() {
|
||||
// alert("sdvs")
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
var input = $($(this).attr("toggle"));
|
||||
if (input.attr("type") == "password") {
|
||||
input.attr("type", "text");
|
||||
}
|
||||
else {
|
||||
input.attr("type", "password");
|
||||
}
|
||||
});
|
||||
|
||||
$("#toggle-password2").click(function() {
|
||||
// alert("sdvs")
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
var input = $($(this).attr("toggle"));
|
||||
if (input.attr("type") == "password") {
|
||||
|
||||
@ -1,21 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>Company Lists</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2, user-scalable=yes">
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo base_url('assets/fontawesome/css/all.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo base_url('assets/style.css'); ?>" rel="stylesheet">
|
||||
<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.bundle.min.js'); ?>"></script>
|
||||
|
||||
<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.bundle.min.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Header -->
|
||||
@ -43,10 +39,10 @@
|
||||
<table id="my-table tr" class="custom-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Company Logo</th>
|
||||
<th>Company Name</th>
|
||||
<th>Company Website</th>
|
||||
<th>Action</th>
|
||||
<th class="disableSort">Company Logo</th>
|
||||
<th class="disableSort">Company Name</th>
|
||||
<th class="disableSort">Company Website</th>
|
||||
<th class="disableSort">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -54,8 +50,7 @@
|
||||
if(isset($view))
|
||||
{
|
||||
foreach ($view as $row)
|
||||
{
|
||||
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td> <img width="70" height="50" src="<?php echo base_url(); ?>/uploads/<?php echo $row->comp_logo; ?>" alt="img"> </td>
|
||||
@ -82,8 +77,7 @@
|
||||
<script type="text/javascript">
|
||||
// basic usage
|
||||
$('.custom-table').tablemanager({
|
||||
firstSort: [[3,0],[2,0],[1,'asc']],
|
||||
disable: ["last"],
|
||||
firstSort: false,
|
||||
appendFilterby: true,
|
||||
debug: true,
|
||||
vocabulary: {
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<label>Upload Photo<span class="error">*</span></label>
|
||||
<input type="file" name="comp_logo" value="Company Logo" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" ><div class="mt-2" style="color:#c73200;">(UploadSize: Below 1MB/ Type: PNG Only)</div>
|
||||
<input type="file" accept="image/png" name="comp_logo" value="Company Logo" id="uploadImage" onchange="PreviewImage();" class="text-center center-block file-upload" ><div class="mt-2" style="color:#c73200;">(UploadSize: Below 1MB/ Type: PNG Only)</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<img src="<?php echo base_url(); ?>/uploads/<?php echo $row->comp_logo; ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"><br><br>
|
||||
@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>Company Website<span class="error">*</span></label>
|
||||
<input type="text" name="comp_web" placeholder="Company Website" value="<?php echo $row->comp_web; ?>" required >
|
||||
<input type="url" name="comp_web" placeholder="Company Website" value="<?php echo $row->comp_web; ?>" required >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -63,18 +63,18 @@
|
||||
foreach($bdata as $key =>$row)
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="branch_id" value="<?php echo $row->branch_id; ?>">
|
||||
<input type="hidden" name="branch_id[]" value="<?php echo $row->branch_id; ?>">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-11">
|
||||
<label>Branch Name<span class="error">*</span></label>
|
||||
<input type="text" name="branch_name[]" placeholder="Branch Name" value="<?php echo $row->branch_name; ?>">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" name="branch_name[]" placeholder="Branch Name" value="<?php echo $row->branch_name; ?>" required>
|
||||
<label>Branch Address<span class="error">*</span></label>
|
||||
<input type="text" name="address[]" placeholder=" Address " value="<?php echo $row->branch_address; ?>">
|
||||
</div>
|
||||
<input type="text" name="address[]" placeholder="Address" value="<?php echo $row->branch_address; ?>" required>
|
||||
<label>Google Map Link<span class="error">*</span></label>
|
||||
<input type="text" name="maplink[]" placeholder="Google Map Link" value="<?php echo $row->maplink; ?>" required>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="button" id="add-button"><i class="fa fa-plus-square"></i></button>
|
||||
<button type="button" id="add-button" class="border-0"><i class="fa fa-plus-square"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -109,22 +109,43 @@
|
||||
// create new field pair element
|
||||
var newPair = document.createElement("div");
|
||||
newPair.className = "field-pair";
|
||||
|
||||
var label1 = document.createElement("label");
|
||||
label1.innerHTML = "Branch Name<span class='error'>*</span>";
|
||||
|
||||
var label2 = document.createElement("label");
|
||||
label2.innerHTML = "Branch Address<span class='error'>*</span>";
|
||||
|
||||
var label3 = document.createElement("label");
|
||||
label3.innerHTML = "Google Map Link<span class='error'>*</span>";
|
||||
|
||||
var input1 = document.createElement("input");
|
||||
input1.type = "text";
|
||||
input1.name = "branch_name[]";
|
||||
input1.name = "new_branch_name[]";
|
||||
input1.placeholder = 'Branch Name';
|
||||
input1.required = true;
|
||||
|
||||
var input2 = document.createElement("input");
|
||||
input2.type = "text";
|
||||
input2.name = "address[]";
|
||||
input2.name = "new_address[]";
|
||||
input2.placeholder = "Address";
|
||||
input2.required = true;
|
||||
|
||||
var input3 = document.createElement("input");
|
||||
input3.type = "url";
|
||||
input3.name = "new_maplink[]";
|
||||
input3.required = true;
|
||||
|
||||
var removeButton = document.createElement("button");
|
||||
removeButton.type = "button";
|
||||
removeButton.className = "remove-button";
|
||||
removeButton.textContent = "Remove";
|
||||
removeButton.className = "remove-button border-0";
|
||||
removeButton.innerHTML = "<i class='fa fa-times'></i>";
|
||||
newPair.appendChild(label1);
|
||||
newPair.appendChild(input1);
|
||||
newPair.appendChild(label2);
|
||||
newPair.appendChild(input2);
|
||||
newPair.appendChild(label3);
|
||||
newPair.appendChild(input3);
|
||||
newPair.appendChild(removeButton);
|
||||
document.getElementById("fields-container").appendChild(newPair);
|
||||
|
||||
@ -149,6 +170,8 @@ function PreviewImage() {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<?php include 'includes/footer.php' ?>
|
||||
</body>
|
||||
|
||||
@ -28,11 +28,13 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<label>Email<span class="error">*</span></label>
|
||||
<input type="email" name="email" required/>
|
||||
<input type="email" name="email" value="<?php echo $this->session->flashdata('username'); ?>" required/>
|
||||
<span style="color:red"><?php echo $this->session->flashdata('user'); ?></span>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label>Password<span class="error">*</span></label>
|
||||
<input type="password" name="password" required/>
|
||||
<input type="password" name="password" value="<?php echo $this->session->flashdata('password'); ?>" required/>
|
||||
<span style="color:red"><?php echo $this->session->flashdata('pass'); ?></span>
|
||||
</div>
|
||||
<div class="col-sm-12 text-center">
|
||||
<input type="submit" name="Submit" value="Login" class="blue-btn submit-btn m-auto">
|
||||
|
||||
BIN
uploads/1683282445.png
Normal file
|
After Width: | Height: | Size: 766 KiB |
BIN
uploads/1683282719.png
Normal file
|
After Width: | Height: | Size: 770 KiB |
BIN
uploads/1683282767.png
Normal file
|
After Width: | Height: | Size: 727 KiB |
BIN
uploads/1683283052.png
Normal file
|
After Width: | Height: | Size: 770 KiB |
BIN
uploads/1683289319.png
Normal file
|
After Width: | Height: | Size: 471 KiB |
BIN
uploads/1683350088.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
uploads/1683350201.png
Normal file
|
After Width: | Height: | Size: 770 KiB |
BIN
uploads/1683350344.png
Normal file
|
After Width: | Height: | Size: 770 KiB |
BIN
uploads/1683608638.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
uploads/1683616574.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |