FIX_Expense Module : ps
This commit is contained in:
parent
c04ddd41a9
commit
dd8d8be3c0
@ -68,85 +68,72 @@ public function get_emp_name()
|
||||
public function rise_expence_request()
|
||||
{
|
||||
|
||||
$data = $this->input->post('emp_id');
|
||||
if(!empty($data)){
|
||||
$emp_id =$this->input->post('emp_id');
|
||||
}else{
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
// echo $emp_id;die;
|
||||
$get_manager_id = $this->Expence_model->get_manager_id($emp_id);
|
||||
// echo $get_manager_id[0]->manager;die;
|
||||
if($get_manager_id[0]->manager == null){
|
||||
## Logged In Variables
|
||||
$logged_in_user = user()->id;
|
||||
$logged_in_business = user()->business_id;
|
||||
|
||||
## Form Requested Data
|
||||
$requested_data = $this->input->post();
|
||||
|
||||
//Employee id
|
||||
$employee_id = (isset($requested_data['emp_id']) && !empty($requested_data['emp_id'])) ? $requested_data['emp_id'] : $logged_in_user;
|
||||
|
||||
$manager = 0;
|
||||
}else{
|
||||
//Manager id
|
||||
$get_manager_details = $this->Expence_model->get_manager_id($employee_id);
|
||||
$manager_id = ((!empty($get_manager_details)) && $get_manager_details[0]->manager != null) ? $get_manager_details[0]->manager : 0;
|
||||
|
||||
$manager = $get_manager_id[0]->manager;
|
||||
}
|
||||
|
||||
$data1 = array(
|
||||
'created_by'=>user()->id,
|
||||
'requested_for'=>$emp_id ,
|
||||
'expense_name'=>$this->input->post('expense_name'),
|
||||
'business_reason'=>$this->input->post('business_reason'),
|
||||
'manager_id' => $manager,
|
||||
'business_id' => user()->business_id,
|
||||
// Table Name Declarations
|
||||
$expense_master_table = "expense";
|
||||
$expense_child_table = "expense_child";
|
||||
|
||||
// Array formation for updating the master details
|
||||
$expense_master_arr = array(
|
||||
'created_by'=>$logged_in_user,
|
||||
'requested_for'=>$employee_id,
|
||||
'expense_name'=>$requested_data['expense_name'],
|
||||
'business_reason'=>$requested_data['business_reason'],
|
||||
'manager_id' => $manager_id,
|
||||
'business_id' => $logged_in_business,
|
||||
'status'=>'Draft',
|
||||
);
|
||||
$table="expense";
|
||||
$create_Expence = $this->MY_Model->insert($data1,$table);
|
||||
|
||||
// $count = count($this->input->post('date_of_expence'));
|
||||
$count = ($this->input->post('date_of_expence_new')) ? count($this->input->post('date_of_expence_new')) : 1;
|
||||
// echo json_encode($this->input->post());die;
|
||||
for($i=0;$i<$count;$i++)
|
||||
{
|
||||
|
||||
$data2 = array(
|
||||
'expense_id' => $create_Expence,
|
||||
'emp_id'=>$emp_id ,
|
||||
'business_id' => user()->business_id,
|
||||
'manager_id' => $manager,
|
||||
## Retrive the Inserted ID from Master Table
|
||||
$create_expence = $this->MY_Model->insert($expense_master_arr,$expense_master_table);
|
||||
|
||||
$first = $requested_data['date_of_expence_new'];
|
||||
## Get the Count for Child Expence
|
||||
$count = (gettype($first) == 'array') ? count($first) : 0;
|
||||
if ($count > 0) {
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
##Preparing Array Stored in Expence child Table
|
||||
$expense_child_arr = array(
|
||||
'expense_id' => $create_expence,
|
||||
'emp_id'=>$employee_id ,
|
||||
'business_id' => $logged_in_business,
|
||||
'manager_id' => $manager_id,
|
||||
'status' => 'Draft',
|
||||
// 'date_of_expense'=> $this->input->post('date_of_expence')[$i],
|
||||
'date_of_expense'=> $this->input->post('date_of_expence_new')[$i],
|
||||
'date_of_expense_new' => date('Y-m-d', strtotime($this->input->post('date_of_expence_new')[$i])),
|
||||
'amount' => $this->input->post('amount')[$i],
|
||||
'description' => $this->input->post('description')[$i],
|
||||
);
|
||||
// print_r($data2);die;
|
||||
$this->load->library('upload');
|
||||
|
||||
$config['upload_path'] = APPPATH. '../assets/uploads/Expence_Bill/';
|
||||
$config['allowed_types'] = 'jpg|png|jpeg|pdf';
|
||||
$config['max_size'] = 80000;
|
||||
$config['file_name'] = time(). '_' . $_FILES['bill']['name'][$i];
|
||||
|
||||
$_FILES['userfile']['name'] = $_FILES['bill']['name'][$i];
|
||||
$_FILES['userfile']['type'] = $_FILES['bill']['type'][$i];
|
||||
$_FILES['userfile']['tmp_name'] = $_FILES['bill']['tmp_name'][$i];
|
||||
$_FILES['userfile']['error'] = $_FILES['bill']['error'][$i];
|
||||
$_FILES['userfile']['size'] = $_FILES['bill']['size'][$i];
|
||||
|
||||
$this->upload->initialize($config);
|
||||
if ($this->upload->do_upload('userfile'))
|
||||
{
|
||||
$upload_image = $this->upload->data();
|
||||
$data2['bill'] = $upload_image['file_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = $this->upload->display_errors();
|
||||
}
|
||||
|
||||
$table="expense_child";
|
||||
$create_expence_list = $this->MY_Model->insert($data2,$table);
|
||||
}
|
||||
|
||||
|
||||
);
|
||||
|
||||
if (!empty($_FILES['bill']['name'][$i])) {
|
||||
$upload_result = $this->upload_file($_FILES['bill'], $i);
|
||||
|
||||
if ($upload_result['success']) {
|
||||
$expense_child_arr['bill'] = $upload_result['file_name'];
|
||||
} else {
|
||||
log_message('error', $upload_result['error']);
|
||||
}
|
||||
}
|
||||
|
||||
$create_expence_child = $this->MY_Model->insert($expense_child_arr, $expense_child_table);
|
||||
}
|
||||
}
|
||||
$this->session->set_flashdata('Create', '1');
|
||||
redirect('Expence/Emp_Expence_List');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function edit_expence($id)
|
||||
@ -162,15 +149,22 @@ public function edit_expence($id)
|
||||
|
||||
public function edit_rise_expence_request()
|
||||
{
|
||||
// Expense primary key
|
||||
$id = $this->input->post('expense_pid');
|
||||
## Logged In Variables
|
||||
$logged_in_user = user()->id;
|
||||
$logged_in_business = user()->business_id;
|
||||
|
||||
## Form Requested Data
|
||||
$requested_data = $this->input->post();
|
||||
|
||||
## Expense primary key
|
||||
$id = $requested_data['expense_pid'];
|
||||
|
||||
// Employee id
|
||||
$emp_id = (!empty($this->input->post('emp_id'))) ? $this->input->post('emp_id') : user()->id;
|
||||
$employee_id = (isset($requested_data['emp_id']) && !empty($requested_data['emp_id'])) ? $requested_data['emp_id'] : $logged_in_user;
|
||||
|
||||
// Manager id
|
||||
$manager = $this->Expence_model->get_manager_id($emp_id);
|
||||
$manager_id = (!empty($manager)) ? $manager[0]->manager : 0;
|
||||
$get_manager_details = $this->Expence_model->get_manager_id($employee_id);
|
||||
$manager_id = ((!empty($get_manager_details)) && $get_manager_details[0]->manager != null) ? $get_manager_details[0]->manager : 0;
|
||||
|
||||
// Table Name Declarations
|
||||
$expense_master_table = "expense";
|
||||
@ -178,25 +172,26 @@ public function edit_rise_expence_request()
|
||||
|
||||
// Array formation for updating the master details
|
||||
$expense_master_arr = array(
|
||||
'created_by' => user()->id,
|
||||
'requested_for' => $emp_id,
|
||||
'expense_name' => $this->input->post('expense_name'),
|
||||
'business_reason' => $this->input->post('business_reason'),
|
||||
'created_by' => $logged_in_user,
|
||||
'requested_for' => $employee_id,
|
||||
'expense_name' => $requested_data['expense_name'],
|
||||
'business_reason' => $requested_data['business_reason'],
|
||||
'manager_id' => $manager_id,
|
||||
'business_id' => user()->business_id,
|
||||
'business_id' => $logged_in_business,
|
||||
'status' => 'Draft',
|
||||
);
|
||||
|
||||
// Update process for master
|
||||
$update_expense = $this->MY_Model->edit_option($expense_master_arr, $id, $expense_master_table);
|
||||
log_message('info', "update_expense_master - expense_id => ".$id." is updated == ".$update_expense);
|
||||
$first = $this->input->post('date_of_expence_new');
|
||||
$first = $requested_data['date_of_expence_new'];
|
||||
$count = (gettype($first) == 'array') ? count($first) : 0;
|
||||
if ($count > 0) {
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$expense_child_id = $this->input->post('expense_child_id')[$i];
|
||||
$first_child = array(
|
||||
'date_of_expense' => $this->input->post('date_of_expence_new')[$i],
|
||||
'date_of_expense_new' => date('Y-m-d', strtotime($this->input->post('date_of_expence_new')[$i])),
|
||||
'amount' => $this->input->post('amount')[$i],
|
||||
'description' => $this->input->post('description')[$i],
|
||||
);
|
||||
@ -213,7 +208,7 @@ public function edit_rise_expence_request()
|
||||
for ($j = 0; $j < $additional_count; $j++) {
|
||||
$second_child = array(
|
||||
'expense_id' => $id,
|
||||
'emp_id' => $emp_id,
|
||||
'emp_id' => $employee_id,
|
||||
'business_id' => user()->business_id,
|
||||
'manager_id' => $manager_id,
|
||||
'status' => 'Draft',
|
||||
@ -223,6 +218,7 @@ public function edit_rise_expence_request()
|
||||
);
|
||||
if (!empty($_FILES['bill2']['name'][$j])) {
|
||||
$upload_result = $this->upload_file($_FILES['bill2'], $j);
|
||||
|
||||
if ($upload_result['success']) {
|
||||
$second_child['bill'] = $upload_result['file_name'];
|
||||
} else {
|
||||
@ -237,11 +233,13 @@ public function edit_rise_expence_request()
|
||||
redirect('Expence/Emp_Expence_List');
|
||||
}
|
||||
|
||||
private function upload_file($file_data, $index)
|
||||
public function upload_file($file_data, $index)
|
||||
{
|
||||
$this->load->library('upload');
|
||||
|
||||
$config['upload_path'] = APPPATH . '../assets/uploads/Expense_Bill/';
|
||||
|
||||
$upload_path = APPPATH . '../assets/uploads/Expense_Bill/';
|
||||
|
||||
$config['upload_path'] = realpath($upload_path);
|
||||
$config['allowed_types'] = 'jpg|png|jpeg|pdf';
|
||||
$config['max_size'] = 80000;
|
||||
$config['file_name'] = time() . '_' . $file_data['name'][$index];
|
||||
|
||||
@ -134,10 +134,10 @@
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Expense Name<a style="color:red;">*</a></label>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="expense_name">Expense Name<a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<input type='text' class="form-control" name="expense_name" value="<?php if (isset($expense_data[0]->id)) {
|
||||
<input type='text' class="form-control" id="expense_name" name="expense_name" value="<?php if (isset($expense_data[0]->id)) {
|
||||
echo $expense_data[0]->expense_name;
|
||||
} ?>" autocomplete='off' required />
|
||||
|
||||
@ -145,10 +145,10 @@
|
||||
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Business Reason</label>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="business_reason">Business Reason</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<input type='text' class="form-control" name="business_reason" value="<?php if (isset($expense_data[0]->id)) {
|
||||
<input type='text' class="form-control" id="business_reason" name="business_reason" value="<?php if (isset($expense_data[0]->id)) {
|
||||
echo $expense_data[0]->business_reason;
|
||||
} ?>" autocomplete='off' />
|
||||
|
||||
@ -174,23 +174,18 @@
|
||||
foreach ($expense_child_data as $key => $value) { ?>
|
||||
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Status</label>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="temporary_status">Status</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<input id="cost" class="form-control" readonly name="middle-name" autocomplete='off' value="
|
||||
<?php if ($value->status == "Approved") {
|
||||
echo $value->status . ' By ' . $value->approved_by . ' - ' . date('d-m-Y h:i:s', strtotime($value->approved_at));
|
||||
} else if ($value->status == "Declined") {
|
||||
echo $value->status . ' By ' . $value->decline_by . ' ( ' . $value->decline_reason . ' )';
|
||||
} else if ($value->status == "Cancelled") {
|
||||
echo $value->status . ' at ' . date('d-m-Y h:i:s', strtotime($value->cancelled_at));
|
||||
} else {
|
||||
echo $value->status;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
">
|
||||
<input id="temporary_status" class="form-control" readonly name="temporary_status" autocomplete='off'
|
||||
value="<?php if ($value->status == "Approved") {
|
||||
echo $value->status . ' By ' . $value->approved_by . ' - ' . date('d-m-Y h:i:s', strtotime($value->approved_at));
|
||||
} else if ($value->status == "Declined") {
|
||||
echo $value->status . ' By ' . $value->decline_by . ' ( ' . $value->decline_reason . ' )';
|
||||
} else if ($value->status == "Cancelled") {
|
||||
echo $value->status . ' at ' . date('d-m-Y h:i:s', strtotime($value->cancelled_at));
|
||||
} else {
|
||||
echo trim($value->status);
|
||||
} ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -210,7 +205,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Amount<a style="color:red;">*</a></label>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="cost">Amount<a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<input id="cost" name="amount[]" required value="<?php echo $value->amount ?>" class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
|
||||
</div>
|
||||
@ -225,11 +220,19 @@
|
||||
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1" required for="first-name">Recipt</label>
|
||||
<label class="control-label col-md-1 col-sm-1" required for="formFile">Recipt</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple><br>
|
||||
|
||||
<a href="<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>" target="_blank" class="float-right" style="font-size: x-small; color: darkblue; margin-top: 7px;"><b>View Recipt(<?php echo $value->bill; ?>)</b></a>
|
||||
<!-- <a href="<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>" target="_blank" class="float-right" style="font-size: x-small; color: darkblue; margin-top: 7px;"><b>View Recipt(<?php echo $value->bill; ?>)</b></a> -->
|
||||
<?php $bill = "";
|
||||
if ($value->bill !== '' || $value->bill !== null) {
|
||||
$billPath = base_url() . 'assets/uploads/Expence_Bill/' . $value->bill;
|
||||
$billContents = @file_get_contents($billPath);
|
||||
$bill = ($billContents !== false) ? $billPath : "";
|
||||
}
|
||||
if (!$bill) { ?>
|
||||
<a href="<?php echo $bill; ?>" target="_blank" class="float-right" style="font-size: x-small; color: darkblue; margin-top: 7px;"><b>View Recipt(<?php echo $bill; ?>)</b></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if ($expense_data[0]->status == 'Draft') { ?>
|
||||
@ -441,7 +444,7 @@ function createAndAppendFormGroup() {
|
||||
html1 += '<div class="item form-group">';
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 " for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
|
||||
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="date" id="datepicker' + i + '" class="form-control dates" placeholder="DD-MM-YYYY" required name="date_of_expence2[]" value="" autocomplete="off"/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i></div></div>';
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 " for="first-name"> Expense Cost <a style="color:red;">*</a></label>';
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 " for="cost"> Amount <a style="color:red;">*</a></label>';
|
||||
html1 += '<div class="col-md-5 col-sm-5 "><input id="cost" name="amount2[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
|
||||
html1 += '</div>';
|
||||
|
||||
@ -450,7 +453,7 @@ function createAndAppendFormGroup() {
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1" for="last-name">Description</label>'
|
||||
html1 += '<div class="col-md-5 col-sm-3"><textarea id="comments" name="description2[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea></div>'
|
||||
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1" required for="first-name">Receipt </label>'
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1" required for="formFile">Receipt </label>'
|
||||
html1 += '<div class="col-md-5 col-sm-5 "><input id="formFile" name="bill2[]" multiple onchange="validateFile(this)" class="typeFile" type="file" value="" ></div>'
|
||||
html1 += '</div>'
|
||||
html1 += '<div class="col-12"><button type="button" class="float-right btn btn-danger"" id="remove-button" onclick="removebutton(' + i + ')"><i class="fa fa-trash"></i></button></div><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div></br>'
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Expense Name<a style="color:red;">*</a></label>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="expense_name">Expense Name<a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<input type='text' id="expense_name" class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' required />
|
||||
@ -118,10 +118,10 @@
|
||||
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Business Reason</label>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="business_reason">Business Reason</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<input type='text' class="form-control" name="business_reason" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->business_reason; } ?>" autocomplete='off'/>
|
||||
<input type='text' class="form-control" id="business_reason" name="business_reason" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->business_reason; } ?>" autocomplete='off'/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -155,7 +155,7 @@
|
||||
<input type="hidden" name="expense_pid" value="<?php echo $expense_data[0]->id; ?>">
|
||||
|
||||
</div>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a style="color:red;">*</a></label>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="cost"> Expense Cost <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="amount[]" required value="<?php echo $value->amount ?>" class="form-control" onkeypress = "return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
|
||||
</div>
|
||||
@ -171,7 +171,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt</label>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" required for="formFile">Recipt</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple>
|
||||
</div>
|
||||
@ -194,7 +194,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a style="color:red;">*</a></label>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" for="cost"> Amount <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="amount[]" required value="" class="form-control" onkeypress = "return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
|
||||
</div>
|
||||
@ -208,7 +208,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt</label>
|
||||
<label class="control-label col-md-1 col-sm-1 label-align" required for="formFile">Recipt</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="" multiple></div>
|
||||
</div><div class="col-12"><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>
|
||||
@ -403,7 +403,7 @@ function createAndAppendFormGroup() {
|
||||
html1 += '<div class="item form-group">';
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
|
||||
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="text" id="datepicker'+i+'" class="form-control date-picker" placeholder="DD-MM-YYYY" name="date_of_expence_new[]" value="" autocomplete="off" required/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i></div></div>';
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a style="color:red;">*</a></label>';
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="cost"> Amount <a style="color:red;">*</a></label>';
|
||||
html1 += '<div class="col-md-5 col-sm-5 "><input id="cost" name="amount[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
|
||||
html1 += '</div>';
|
||||
|
||||
@ -412,7 +412,7 @@ function createAndAppendFormGroup() {
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>'
|
||||
html1 += '<div class="col-md-5 col-sm-3"><textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea></div>'
|
||||
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt </label>'
|
||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" required for="formFile">Recipt </label>'
|
||||
html1 += '<div class="col-md-5 col-sm-5 "><input id="formFile" name="bill[]" multiple onchange="validateFile(this)" class="typeFile" type="file" value="" ></div>'
|
||||
html1 += '</div>'
|
||||
html1 += '<div class="col-12"><button type="button" class="float-right btn btn-danger"" id="remove-button" onclick="removebutton('+i+')"><i class="fa fa-trash"></i></button></div><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>'
|
||||
|
||||
@ -91,12 +91,17 @@
|
||||
|
||||
<li class="nav-item dropdown open" style="padding-left: 15px;">
|
||||
<a href="javascript:;" class="user-profile dropdown-toggle" aria-haspopup="true" id="navbarDropdown" data-toggle="dropdown" aria-expanded="false">
|
||||
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="">
|
||||
|
||||
<?php } else { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>" alt="">
|
||||
<?php } ?>
|
||||
<?php $defaultProfilePicture = base_url() . '/assets/uploads/profile_picture/profile.jpg';
|
||||
$FinalProfilePicture = "";
|
||||
if(user()->profile_image == '' || user()->profile_image == null) {
|
||||
$FinalProfilePicture = $defaultProfilePicture;
|
||||
}else{
|
||||
$personProfilePicture = base_url() . '/assets/uploads/profile_picture/'.user()->profile_image;
|
||||
$persContents = @file_get_contents($personProfilePicture);
|
||||
$FinalProfilePicture = ($persContents !== false) ? $personProfilePicture : $defaultProfilePicture;
|
||||
}
|
||||
?>
|
||||
<img src="<?php echo $FinalProfilePicture; ?>" alt="">
|
||||
<?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-usermenu pull-right" aria-labelledby="navbarDropdown">
|
||||
|
||||
@ -92,12 +92,18 @@
|
||||
|
||||
<li class="nav-item dropdown open" style="padding-left: 15px;">
|
||||
<a href="javascript:;" class="user-profile dropdown-toggle" aria-haspopup="true" id="navbarDropdown" data-toggle="dropdown" aria-expanded="false">
|
||||
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="">
|
||||
|
||||
<?php } else { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>" alt="">
|
||||
<?php } ?>
|
||||
<?php $defaultProfilePicture = base_url() . '/assets/uploads/profile_picture/profile.jpg';
|
||||
$FinalProfilePicture = "";
|
||||
if(user()->profile_image == '' || user()->profile_image == null) {
|
||||
$FinalProfilePicture = $defaultProfilePicture;
|
||||
}else{
|
||||
$personProfilePicture = base_url() . '/assets/uploads/profile_picture/'.user()->profile_image;
|
||||
$persContents = @file_get_contents($personProfilePicture);
|
||||
$FinalProfilePicture = ($persContents !== false) ? $personProfilePicture : $defaultProfilePicture;
|
||||
}
|
||||
?>
|
||||
<img src="<?php echo $FinalProfilePicture; ?>" alt="">
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-usermenu pull-right" aria-labelledby="navbarDropdown">
|
||||
|
||||
@ -30,14 +30,17 @@
|
||||
<!-- menu profile quick info -->
|
||||
<div class="profile clearfix">
|
||||
<div class="profile_pic">
|
||||
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="..." class="img-circle profile_img">
|
||||
<?php } else { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>"
|
||||
alt="..." class="img-circle profile_img">
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php $defaultProfilePicture = base_url() . '/assets/uploads/profile_picture/profile.jpg';
|
||||
$FinalProfilePicture = "";
|
||||
if(user()->profile_image == '' || user()->profile_image == null) {
|
||||
$FinalProfilePicture = $defaultProfilePicture;
|
||||
}else{
|
||||
$personProfilePicture = base_url() . '/assets/uploads/profile_picture/'.user()->profile_image;
|
||||
$persContents = @file_get_contents($personProfilePicture);
|
||||
$FinalProfilePicture = ($persContents !== false) ? $personProfilePicture : $defaultProfilePicture;
|
||||
}
|
||||
?>
|
||||
<img src="<?php echo $FinalProfilePicture; ?>" alt="..." class="img-circle profile_img">
|
||||
</div>
|
||||
<div class="profile_info">
|
||||
<span>Welcome,</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user