header file issues fixed

This commit is contained in:
venbatechnologies@gmail.com 2018-03-26 10:43:41 +05:30
parent 06c58fa2ee
commit 301cd1b03e
15 changed files with 657 additions and 657 deletions

View File

@ -1,3 +1,4 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/libraries/BaseController.php';
@ -189,6 +190,9 @@ class employeedetails extends BaseController
function AddNewEmployee()
{
$aadharfilename ='';
$panfilename ='';
$voterfilename = '';
$this->load->library('form_validation');
@ -268,50 +272,50 @@ class employeedetails extends BaseController
$ESIno = $this->input->post('esino');
$Nominee = $this->input->post('nomineename');
$createdby = $this->session->userdata ( 'userId' );
$Ddname = $this->input->post('ddName');//dropdown
//print_r($Ddname);die;
//$browseFiles[] = $_FILES['browseFiles']['name'];
$browseFiles = $_FILES['browseFiles']['name'];
// print_r($browseFiles);
// print_r($Ddname);
// echo "dropdown values".$Ddname[0];
// echo "browse data files".$browseFiles[0];
//$aadharname = $Ddname[0]."-".$browseFiles[0];
if($Ddname[0] != '' && $browseFiles[0] != '')
{
$aadharfilename = $Ddname[0]."-".$browseFiles[0];
}
else
{
$aadharfilename = null;
}
//$panname = $Ddname[1]."-".$browseFiles[1];
if($Ddname[1] != '' && $browseFiles[1] != '')
{
$panfilename = $Ddname[1]."-".$browseFiles[1];
}
else
{
$panfilename = null;
}
//$votername = $Ddname[2]."-".$browseFiles[2];
if($Ddname[2] != '' && $browseFiles[2] != '')
{
$voterfilename = $Ddname[2]."-".$browseFiles[2];
}
else
{
$voterfilename = null;
}
//die();//echo count($browseFiles);
$count = $this->input->post('hidecounter');
$constant = $this->input->post('hideconstant');
//print_r($browseFiles);
//$path = 'uploads/images/';
$oth = $this->do_upload();
for($i=1;$i<=$constant;$i++){
$Ddname = $this->input->post('Ddname');
$filename = 'browseFiles'.$i;
$Pi = $this->additional($filename);
//$idproof[$i] = array($Ddname[$i],$Pi);
$idproof[$i] = $Ddname[$i]."/".$Pi;
}
foreach ($idproof as $key => $value) {
$exp = explode("/",$value);
if($exp[0] == 'aadhar'){
if(!empty($value)){
$aadharfilename = $value ;
}
else{
$aadharfilename = 'NULL';
}
}
elseif($exp[0] == 'pan' ){
if(!empty($value)){
$panfilename = $value;
}
else{
$panfilename ='NULL';
}
}
elseif($exp[0] = 'voter'){
if(!empty($value)){
$voterfilename = $value;
}
else{
$voterfilename = 'NULL';
}
}
}
if($licenseExpiryDate != '')
{
$License_ExpiryDate = $this->getDateformat($licenseExpiryDate);
@ -351,12 +355,8 @@ class employeedetails extends BaseController
$this->load->model('employeedetails_model');
print_r($Employee);
// echo "\n";
// print_r($Ddname);
// echo "\n";
// print_r($browseFiles);
//die();
// print_r($Employee);
// die();
$result = $this->employeedetails_model->addNewemployee($Employee);
if($result > 0)
@ -368,58 +368,11 @@ class employeedetails extends BaseController
{
$this->session->set_flashdata('Error', 'New Employee details not saved');
echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','refresh');
}
}
}
function do_upload()
{
echo "i am a do upload function";
$this->load->library('upload');
$files = $_FILES;
$cpt = count($_FILES['browseFiles']['name']);
echo $cpt;
for($i=0; $i<$cpt; $i++)
{
$_FILES['browseFiles']['name']= $files['browseFiles']['name'][$i];
$_FILES['browseFiles']['type']= $files['browseFiles']['type'][$i];
$_FILES['browseFiles']['tmp_name']= $files['browseFiles']['tmp_name'][$i];
$_FILES['browseFiles']['error']= $files['browseFiles']['error'][$i];
$_FILES['browseFiles']['size']= $files['browseFiles']['size'][$i];
//echo $_FILES['browseFiles']['name'];
$this->upload->initialize($this->set_upload_options());
if($this->upload->do_upload('browseFiles'))
{
echo "do_upload function";
// $uploadData = $this->upload->data();
// $picture = $uploadData['file_name'];
}
else
{
echo "not upload function";
// $error = array('error' => $this->upload->display_errors());
// $picture = '';
}
}
}
private function set_upload_options()
{
//upload an image options
echo "upload an image options";
//die();
$config = array();
//$config['upload_path'] = './Images/';
$config['upload_path'] = 'uploads/images/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '0';
$config['overwrite'] = FALSE;
return $config;
}
/**
* To Convert the dateformat (date with time) and stored into DB
*/
@ -598,6 +551,54 @@ private function set_upload_options()
return $picture ;
}
function additional($filename)
{
//echo "add files";
//echo $_FILES[$filename]['name'];
$picture = '';
if(!empty($_FILES[$filename]['name']))
{
//echo '********';
//echo $_FILES[$filename]['name'];
$config['upload_path'] = 'uploads/images/';
$config['allowed_types'] = '*';
//$config['allowed_types'] = 'jpg|jpeg|png|gif';
$config['file_name'] = $_FILES[$filename]['name'];
//print_r($config);
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload($filename))
{
// echo '\\\\\\';
// echo $_FILES[$filename]['name'];
// echo '//////';
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
else
{
//echo 'asdasdf // inner else // afsdafsdafsdfdasfads';
$error = array('error' => $this->upload->display_errors());
$picture = '';
}
}
else
{
//echo 'outer else';
$picture = '';
}
return $picture ;
}
/**
* To view the employee information and load's the edit employee screen

File diff suppressed because it is too large Load Diff

View File

@ -104,12 +104,13 @@ if(!empty($EmpDetails))
$personalEmailId = $Emp->personalEmailId;
$DriverLicense = $Emp->DriverLicense;
$VoterID = $Emp->VoterID;
echo $AadharNo.$PANNo.$VoterID;
// print_r (explode("-",$AadharNo));
// print_r (explode("-",$PANNo));
// print_r (explode("-",$VoterID));
$a=array();
if (!empty($AadharNo)){array_push($a,$AadharNo);}
if (!empty($PANNo)){array_push($a,$PANNo); }
if (!empty($VoterID)){array_push($a,$VoterID); }
print_r($a);
$pfno = $Emp->PFNO;
$esino = $Emp->ESI;
$nominee=$Emp->NomineeDetails;
@ -139,6 +140,7 @@ if(!empty($EmpDetails))
?>
<script>
@ -550,7 +552,7 @@ function getAge() {
$("#age").val(ageyear);
}
var index = 0 ;
$(function() {
var d = new Date();
@ -579,6 +581,46 @@ $(function() {
});
$("#LicenseExpiryDate").datepicker({dateFormat: 'dd-mm-yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
});
$("#gender").select2();
$("#bloodgroup").select2();
$("#MartialStatus").select2();
$("#desigination").select2();
$("#departmentname").select2();
$("#eduqualifaction").select2();
$("#bankbranchname").select2();
alert('good way');
var js_array =<?php echo json_encode($a);?>;
alert(js_array[0]);
var mybaseurl='<?php echo base_url('uploads/images');?>';
$.each(js_array,function(j,ja){
alert(ja);
var ss = ja.split("/");
alert(ss[0]);
alert(ss[1]);
var div = document.createElement('div');
div.id = "dbdivid"+index;
div.className="row";
div.innerHTML='<div class="col-md-12">'+
'<div class="col-md-3">'+
'<input type="text" name="Ddname'+index+'" id="Ddname'+index+'" class="form-control" value="'+ss[0]+'" readonly/>'+
'</div>'+
'<div class="col-md-6">'+
'<b>File Name:</b><input type="text" name="filename'+index+'" id="filename" class="form-control" value="'+ss[1]+'" readonly/>'+
'</div>'+
'<div class="col-md-3">'+
'<a href="'+mybaseurl+'/'+ss[1]+'" class="btn btn-primary active" target="_blank" role="button"><i class="fa fa-download" ></i>Download</a>'+
'<button class="btn btn-danger" id="delbtn'+index+'" onclick="deleted(this.id)"><i class="fa fa-trash"></i> Remove</button>'+
'</div>'+
'</div>';
$('#newdiv').append(div);
index++;
});
});
@ -601,18 +643,6 @@ function ValidatePassport()
}
$(document).ready(function(){
$("#gender").select2();
$("#bloodgroup").select2();
$("#MartialStatus").select2();
$("#desigination").select2();
$("#departmentname").select2();
$("#eduqualifaction").select2();
$("#bankbranchname").select2();
document.getElementById('aadharno').addEventListener('input', function (e) {
e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim();
});
});
function onlyAlphabets(evt) {
var charCode;
@ -633,6 +663,12 @@ function onlyAlphabets(evt) {
</script>
<style>
.test input {
border: 0;
}
/* <span class="test">Your name is <input type="text" value="SAM" readonly="readonly" /></span> */
span {
font-weight:800;
}
@ -1101,9 +1137,17 @@ function onlyAlphabets(evt) {
</div>
</div>
<legend>Multiple File</legend>
<div class="col-md-12 pad table-repsonsive" id="file_div">
<legend>Multiple File</legend>
<div class="col-md-12">
<div class="col-md-offset-10 col-md-1" >
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" + ADD FILES.."><p><br/></p>
</div>
</div>
<div id="newdiv"></div><!-- this div for add more section-->
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
<!-- <div class="col-md-12 pad table-repsonsive" id="file_div">
<table class="table table-bordered" id="item_table">
<tr>
<th>Upload your files</th>
@ -1111,7 +1155,7 @@ function onlyAlphabets(evt) {
<th><button type="button" id="addbtn" name="add" class="btn btn-success btn-sm add"><span class="glyphicon glyphicon-plus"></span></button></th>
</tr>
</table>
</div>
</div> -->
<!-- <input type="submit" name="submit_file" value="SUBMIT"> -->
</div>
@ -1267,17 +1311,86 @@ function onlyAlphabets(evt) {
});
$("#addbtn").click(function () {
var html = '';
html += '<tr>';
html += '<td><input type="file" name="browseFiles[]" onchange="readURL(this)" class="form-control" /></td>';
html += '<td><select name="ddName[]" class="form-control"><option value="default">Select ID Name</option><option value="pan">Pan Card</option><option value="aadhar">Aadhar card</option><option value="voter">Voter ID Card</option></select></td>';
html += '<td><button type="button" id="removebtn" name="remove" class="btn btn-danger btn-sm remove"><span class="glyphicon glyphicon-minus"></span></button></td></tr>';
$('#item_table').append(html);
});
$(document).on('click','.remove',function() {
//alert('removebtn');
$(this).closest('tr').remove();
var counter = 0;
var counterConstant = 0;
var temparray = [];
//
$("#addmorebutton").click(function(){
if(counter>2){
alert(" constant counter 3 error msg ");
return false;
}
else{
counter++;
counterConstant++;
var div = document.createElement('div');
div.id = "divid"+counterConstant;
div.className="row";
div.innerHTML='<div class="col-md-12">'+
'<div class="col-md-3">'+
'<select name="Ddname['+counterConstant+']" id="mulfilename'+counterConstant+'" class="form-control" onchange="changeFunc(this.id);"><option value="default">Select ID Name</option><option value="pan">Pan Card</option><option value="aadhar">Aadhar Card</option><option value="voter">Voter ID Card</option></select>'+
'</div>'+
'<div class="col-md-6">'+
'<input type="file" name="browseFiles'+counterConstant+'" onchange="Copyfilename(this.name);"><br>'+
'</div>'+
'<div class="col-md-3">'+
'<input class="btn btn-danger btn-sm remove remove_this" type="button" id="removebtn'+counterConstant+'" value="REMOVE" onclick="removeRow(this.id)"></div>'+
'</div>'+
'</div>';
$('#newdiv').append(div);
$('#hidecounter').val(counter);
$('#hideconstant').val(counterConstant);
$.each(temparray,function(t,temp){
$('#mulfilename'+(counterConstant)+' option[value='+temp+']').remove();
});
}
});
function removeRow(input) {
var number = input.replace(/[^0-9]+/ig,"");
if(counter >= 1){
counter--;
$("#divid"+number).remove();
$('#hidecounter').val(counter);
}
}
function changeFunc(input) {
alert("onchange function ");
var number = input.replace(/[^0-9]+/ig,"");
var ddvalue = $('#mulfilename'+number+' option:selected').val();
alert(ddvalue);
if(ddvalue != 'default'){ temparray.push(ddvalue); }
alert(temparray);
// $.each(temparray,function(t,temp){
// $('#mulfilename'+(counterConstant+1)+' option[value='+temp+']').remove();
// });
//var $list = $("#myList"),toRemove = $();
// for(var i = selectedItems.length; i--;) {
// toRemove = toRemove.add($list.find('option[value="' + selectedItems[i] + '"]'));
// }
// toRemove.remove();
//$('#mulfilename'+(number+1)+' option[value='+temp+']').prop('disabled',true);
// $('#mulfilename option:not(:first)').filter(function() {
// return $.inArray($.trim($(this).text()), types) == -1;
// }).remove();
}
</script>

View File

@ -356,9 +356,9 @@
<?php }?>
<?php if($check2 == 1){break;} }?>
<?php foreach($DepAccesslist as $dep){ $check1=0;
<?php foreach($DepAccesslist as $dep){ $check1=0; $check5=0;
$assd= $dep->AssDep;?>
<?php if($assd == FINANCE || $DEPCode == FINANCE){ $check2=1; ?>
<?php if($assd == FINANCE || $DEPCode == FINANCE){ $check5=1; ?>
<li><a href="<?php echo base_url(); ?>costListing" >
<i class="fa fa-cart-plus"></i>
@ -372,8 +372,8 @@
</a>
</li>
<?php }?>
<?php if($check2 == 1){break;} }?>
<?php foreach($DepAccesslist as $dep){ $check1=0;
<?php if($check5 == 1){break;} }?>
<?php foreach($DepAccesslist as $dep){ $check1=0;
$assd= $dep->AssDep;?>
<?php if($assd == HR || $assd == SYSTEM_ADMIN || $DEPCode == HR || $DEPCode == ADMIN || $assd == ADMIN){ $check2=1; ?>

View File

@ -686,11 +686,11 @@ function validate()
swal('Please Add Line Item');
return false;
}
else if(isExceed == 1)
{
swal('You dont have Budget and You cant Raise New Requisition');
return false;
}
// else if(isExceed == 1)
// {
// swal('You dont have Budget and You cant Raise New Requisition');
// return false;
// }
else
{
return true;
@ -733,11 +733,11 @@ function validateBeforeAdd()
$("#CostCenter").focus();
return false;
}
else if( isExceed == '1')
{
swal('You dont have available Budget Amount. You cant raise new Requisition');
return false;
}
// else if( isExceed == '1')
// {
// swal('You dont have available Budget Amount. You cant raise new Requisition');
// return false;
// }
else
{
$('#myModal1').modal('show');

View File

@ -997,7 +997,7 @@ function clearEditTaxField()
<?php
$optionsnew=array('0'=>'Select','1'=>'REVENUE','2'=>'CAPITAL');
$optionsnew=array('0'=>'Select','1'=>'REVENUE','2'=>'CAPITAL');
echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2');
?>

0
uploads/images/avatar.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
uploads/images/avatar2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
uploads/images/avatar3.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

0
uploads/images/avatar4.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

0
uploads/images/avatar5.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

0
uploads/images/user1-128x128.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

0
uploads/images/user2-160x160.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

0
uploads/images/user3-128x128.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

0
uploads/images/user4-128x128.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB