PDF generater added

This commit is contained in:
gandhimathi Bharathirajan 2017-04-22 13:10:33 +05:30
parent d75794eb0f
commit a883393c0b
2 changed files with 58 additions and 48 deletions

View File

@ -1,3 +1,7 @@
<script>
$(function() {
@ -5,7 +9,7 @@ $(function() {
//Initialize Select2 Elements
$(".select2").select2();
//$('#content').html('<img id="loader-img" alt="" src="<?php echo base_url();?>assets/dist/loader.gif" align="center" />');
$('#All').click(function(){
//alert('clicked');
if ($('#All').prop('checked'))
@ -21,7 +25,38 @@ $(function() {
});
$('#PayOn').change(function() {
var id = $('#PayOn').val();
if(id != '-1')
{
$('#content').loader('show');
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url();?>payslip/getEmployee",
success:function(result) {
if(result)
{
$('#content').loader('hide');
$("#Employee").append(result);
}
}
});
}
else
{
alert('Please select the PayOn');
return false;
}
});
});
</script>
<div class="content-wrapper">
@ -37,6 +72,7 @@ $(function() {
<form id="PayslipGenerator" action="<?php echo base_url() ?>PrintPdf" method="post" role="form" >
<div class="row" >
<div class="col-md-4">
<span for="selectmonth">Select Month</span>
<select id="PayOn" name="PayOn" class="form-control select2" style="width: 100%;">
<option value="-1">Select Payon Month</option>
@ -62,48 +98,27 @@ $(function() {
?>
</select>
</div>
<div id="content"></div>
<div class="col-md-4 col-md-offset-2">
<div class="row">
<span>Employee</span>
<select id="Employee" name="Employee" class="form-control select2" type="text" class="form-control">
<option value="-1">Select Employee</option>
<?php
if(!empty($Emplist))
{
foreach ($Emplist as $rl)
{
$Emp = $rl->EmpId;
if ($_POST['Employee'] == $Emp)
{
echo "<option value=\"".$Emp."\" selected=\"selected\">".$Emp.' - '. $rl->Fname ."</option>";
}
else
{
echo "<option value=\"".$Emp."\">".$Emp.' - '. $rl->Fname ."</option>";
}
}
}
?>
</select>
</div>
<div class="row">
<input type="checkbox" name="All" id="All" > Select All<br>
</div>
</div>
<input type="checkbox" name="All" id="All" > Select All<br>
</div>
<div class="col-md-4 col-md-offset-6" align = "right">
<input type="submit" class="btn btn-info" value="Generate" />
</div>
</div>
<div class="row" >
<div class="col-md-4 col-md-offset-6" align = "right">
<input type="submit" class="btn btn-info" value="Generate" />
</div>
<?php
$this->load->helper('form');

View File

@ -12,17 +12,8 @@
?>
<script>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#salaryexcele')
.attr('src', e.target.result)
};
reader.readAsDataURL(input.files[0]);
$('#FileName').val(input.files[0].name);
}
}
</script>
@ -36,16 +27,20 @@
</section>
<section class="content">
<div class="row">
<div class="col-md-8 col-md-offset-2" style="border:2px dotted;padding:2%;">
<form id="upload" action="<?php echo base_url() ?>FileUpload" method="post" role="form" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-2" style="border:2px dotted;padding:2%;">
<form id="upload" action="<?php echo base_url() ?>FileUpload" method="post" role="form" enctype="multipart/form-data"> <div class="col-md-3">
<span for="FileName">File Name</span>
<input type="text" class="form-control required" id="FileName" name="FileName" readonly>
</div>
<div class="box-header">
<input type="file" id="userfile" name="userfile"/>
<input type="file" onchange="readURL(this);" id="userfile" name="userfile"/>
<label for="photo">Select Excel File to upload<br/>(only .xls)</label>
</div>
<div class="row" align="right">
<input type="submit" class="btn btn-info" value="upload" />
</div>
</div>
<div class="col-md-3">
<input type="submit" class="btn btn-info" value="upload" /> </div>
</div>
</div>