multiple file upload in sp po and report filedownload

This commit is contained in:
venbatechnologies 2018-05-31 17:22:47 +05:30
parent d21d19ed95
commit 2d1e629f2a
8 changed files with 840 additions and 168 deletions

View File

@ -99,43 +99,43 @@ class emergencypurchaseorder extends BaseController
}
function addfile()
{
// function addfile()
// {
$file = '';
//Check whether user upload picture
if(!empty($_FILES['images']['name']))
{
//echo 'true';
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
$config['file_name'] = $_FILES['images']['name'];
// $file = '';
// //Check whether user upload picture
// if(!empty($_FILES['images']['name']))
// {
// //echo 'true';
// $config['upload_path'] = 'uploads/BillFiles/';
// $config['allowed_types'] = 'docx|pdf|doc|png|jpg';
// $config['file_name'] = $_FILES['images']['name'];
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
// //Load upload library and initialize configuration
// $this->load->library('upload',$config);
// $this->upload->initialize($config);
if($this->upload->do_upload('images'))
{
$uploadData = $this->upload->data();
//print_r($uploadData);
$file = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
//print_r($error);
$file = '';
}
}
else
{
//echo 'false';
$file = '';
}
// if($this->upload->do_upload('images'))
// {
// $uploadData = $this->upload->data();
// //print_r($uploadData);
// $file = $uploadData['file_name'];
// }
// else
// {
// $error = array('error' => $this->upload->display_errors());
// //print_r($error);
// $file = '';
// }
// }
// else
// {
// //echo 'false';
// $file = '';
// }
return $file ;
}
// return $file ;
// }
@ -143,45 +143,120 @@ class emergencypurchaseorder extends BaseController
function addfile1()
{
// function addfile1()
// {
$file = '';
//Check whether user upload picture
if(!empty($_FILES['images1']['name']))
{
//echo 'true';
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
$config['file_name'] = $_FILES['images1']['name'];
// print_r($config);die;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
// $file = '';
// //Check whether user upload picture
// if(!empty($_FILES['images1']['name']))
// {
// //echo 'true';
// $config['upload_path'] = 'uploads/BillFiles/';
// $config['allowed_types'] = 'docx|pdf|doc|png|jpg';
// $config['file_name'] = $_FILES['images1']['name'];
// // print_r($config);die;
// //Load upload library and initialize configuration
// $this->load->library('upload',$config);
// $this->upload->initialize($config);
if($this->upload->do_upload('images1'))
{
$uploadData = $this->upload->data();
//print_r($uploadData);
$file = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
//print_r($error);
$file = '';
}
// if($this->upload->do_upload('images1'))
// {
// $uploadData = $this->upload->data();
// //print_r($uploadData);
// $file = $uploadData['file_name'];
// }
// else
// {
// $error = array('error' => $this->upload->display_errors());
// //print_r($error);
// $file = '';
// }
// }
// else
// {
// //echo 'false';
// $file = '';
// }
// return $file ;
// }
function addfile($pathname)
{
// echo "add files";
// die();
//echo $pathname; die();
$picture = '';
if(!empty($_FILES[$pathname]['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = '*';
//$config['allowed_types'] = 'jpg|jpeg|png|gif';
$config['file_name'] = $_FILES[$pathname]['name'];
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload($pathname))
{
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
else
{
//echo 'false';
$file = '';
$error = array('error' => $this->upload->display_errors());
$picture = '';
}
return $file ;
}
else
{
$picture = '';
}
return $picture ;
}
/*----------------------------------special po file upload service----------------------------------*/
function add($pathname)
{
// echo "add files";
// die();
//echo $pathname; die();
$picture = '';
if(!empty($_FILES[$pathname]['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = '*';
//$config['allowed_types'] = 'jpg|jpeg|png|gif';
$config['file_name'] = $_FILES[$pathname]['name'];
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload($pathname))
{
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$picture = '';
}
}
else
{
$picture = '';
}
return $picture ;
}
@ -405,13 +480,47 @@ function addfile1()
}
if($POStatus==SPECIAL_PO){
$file =$this->addfile1();
$myfile = array('FilePath'=>$file,'PONO'=>$PONO); //'MaterialCode'=>$MaterialCode,
$result= $this->purchaseorder_model->fileupload($myfile);
$count = $this->input->post('hidecounters');
$constant = $this->input->post('hideconstants');
for($i=1;$i<=$constant;$i++){
$pathname = 'browseFiles'.$i;
if(!empty($_FILES[$pathname]['name']))
{
$Picture = $this->add($pathname);
//echo $Picture;
$arr[] = array($Picture);
}
}
//print_r($arr);
foreach($arr as $ma){
$index = 0;
foreach($ma as $key=>$value){
$index++;
if($index == 1){
$filename = $value;
}
}
$myfile = array('FilePath'=>$filename);
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO);
$this->purchaseorder_model->fileupload($myfile);
//addfiledetails($addfilelist);
//print_r($myfile);
}
/**/
// $myfile = array('FilePath'=>$file,'PONO'=>$PONO); //'MaterialCode'=>$MaterialCode,
// $result= $this->purchaseorder_model->fileupload($myfile);
}
if($POStatus == REQ_DRAFT)
{
// echo 'Emergency Service Purchase Order Saved Successfully!The PO NO Is: '.$PONO;
@ -871,12 +980,47 @@ $RequestedBy = $this->input->post('drpDepartment');
$file =$this->addfile();
$emergencyitemcode = $this->input->post('materialCode'.$i);
$myfile = array('FilePath'=>$file,'MaterialCode'=>$emergencyitemcode,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
$result= $this->purchaseorder_model->fileupload($myfile);
// $file =$this->addfile();
// $emergencyitemcode = $this->input->post('materialCode'.$i);
// $myfile = array('FilePath'=>$file,'MaterialCode'=>$emergencyitemcode,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
// $result= $this->purchaseorder_model->fileupload($myfile);
$counts = $this->input->post('hidecounter');
$constants = $this->input->post('hideconstant');
for($i=1;$i<=$constants;$i++){
$pathname = 'browseFiles'.$i;
if(!empty($_FILES[$pathname]['name']))
{
$Picture = $this->addfile($pathname);
//echo $Picture;
$arr[] = array($Picture);
}
}
//print_r($arr);
foreach($arr as $ma){
$index = 0;
foreach($ma as $key=>$value){
$index++;
if($index == 1){
$filename = $value;
}
}
$myfile = array('FilePath'=>$filename);
$emergencyitemcode = $this->input->post('materialCode'.$i);
$myfile = array('FilePath'=>$filename,'MaterialCode'=>$emergencyitemcode,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
$this->purchaseorder_model->fileupload($myfile);
//addfiledetails($addfilelist);
//print_r($myfile);
}
}

View File

@ -505,6 +505,24 @@ class report extends BaseController
$this->loadviews("Report_cumulative_day",$this->global,$data, NULL);
}
function Viewfiles()
{
$PO= $this->input->post('id');
$PONO= substr($PO,5);
//echo $PONO; die;
$data = $this->dahsboard_Model->getfile($PONO);
// print_r( $data);die;
echo json_encode($data);
}
public function ipurchase()
{

View File

@ -593,7 +593,6 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO);
/*-----------------------------------*/
function uploadfile()
{
$bill= $this->input->post('param1');
@ -645,7 +644,6 @@ function uploadfile()
return $picture ;
}
/*-----------------------------------*/
function pageNotFound()

View File

@ -20,6 +20,22 @@ class dahsboard_Model extends CI_Model
}
function getfile($PONO)
{
//$this->db->distinct();
$this->db->select('*');
$this->db->from('T_PurchaseOrder_BillUpload');
$this->db->where('PONO',$PONO);
$query = $this->db->get();
// print_r( $this->db->last_query());
$result = $query->result_array();
return $result;
}
function totloan()
{

View File

@ -2290,12 +2290,13 @@ $(document).ready(function () {
<?php
if(!empty($getdata))
{
foreach($getdata as $gd)
foreach($getdata as $row=> $gd)
{
?>
<tr>
<tr id="lastvalue">
<td><?php echo $gd->BillNo ?></td>
<input type="hidden" id="billnos<?= $row?>" value="<?= $gd->BillNo?>">
<!-- <td><?php echo $gd->MaterialCode ?> - <?php echo $gd->MaterialName ?></td> -->
<!-- <td><?php echo $gd->DeliveryChellanOrInvoiceNo?></td>
<td><?php $date = new DateTime($gd->DeliveryChellanDate);
@ -2307,10 +2308,10 @@ $(document).ready(function () {
<td><a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $gd->FilePath ?>"><i class="fa fa-download" ></i></a></td> -->
<input type="hidden" id="file<?=$row?>" value="<?=$gd->FilePath?>">
<td><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
<td><a data-target='#EditServiceSplPOModel' data-toggle="modal" href="#EditServiceSplPOModel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></a>
<td><span onclick="openmodel(<?=$row?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
<?php if(!empty($gd->FilePath)) { ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $gd->FilePath ?>"><i class="fa fa-download" ></i></a>
<?php } ?>
@ -2413,7 +2414,7 @@ $(document).ready(function () {
<div class="modal-content" style="width:950px;">
<div class="modal-header">
<h4 class="modal-title">Update <?php echo $getdata[0]->BillNo ?> Bill Details</h4>
<h4 class="modal-title">Update Bill <!-- <?php echo $getdata[0]->BillNo ?> --> <span id="bill"><span> Details</h4>
</div>
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data" >
<div class="modal-body" style="padding:0px;">
@ -2423,14 +2424,18 @@ $(document).ready(function () {
<div class="col-md-12">
<div class="col-md-5">
<?php if($getdata[0]->FilePath != '') { ?>
<label for="oldimagename">Old file Name :</label><?php echo $getdata[0]->FilePath; ?> <br/><?php } ?>
<label for="oldimagename">Old file Name :<div class="oldimage"></div></label>
<input type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();"/>
<label for="images">Select file <br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div>
</div>
<input type="hidden" name="hideoldfile" id="hideoldfile" value="<?php echo $getdata[0]->FilePath; ?>" class="form-control" readonly>
<input type="hidden" name="hidebillno" id="hidebillno" value="<?php echo $getdata[0]->BillNo ?>" class="form-control" readonly>
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
</div><!-- /.modal body -->
<div class="modal-footer">
@ -2654,6 +2659,18 @@ $('.AddService').click(function(){
});
function openmodel(i){
//alert(i);
var file = $("#file"+i).val();
//alert(file);
var Billno = $("#billnos"+i).val();
//alert(Billno);
$("#EditServiceSplPOModel").modal("show");
$(".oldimage").text(file);
$("#hideoldfile").val(file);
$("#hidebillno").val(Billno);
$("#bill").text(Billno);
}
$('.EditService').click(function(){
tinyMCE.triggerSave();
@ -3697,17 +3714,33 @@ $('#insuranceNo').val('');
function splpoupdate(){
// alert();
var formData = new FormData();
var file = $("#imag").prop('files')[0];
var param1 = $('#hidebillno').val();
var param2 = $('#hideoldfile').val();
// var param3 =$('#ChallanInvNo').val();
// var param4 =$('#Date').val();
// var param5 =$('#VehicleNo').val();
// var param6 =$('#CourierNo').val();
//var param7 =$('#hideoldfile').val();
var filename = $("#imag").val();
filename = filename.split('\\');
formData.append('file',file);
formData.append('param1',param1);
formData.append('param2',param2);
// formData.append('param3',param3);
// formData.append('param4',param4);
// formData.append('param5',param5);
// formData.append('param6',param6);
$('.content').loader('show');
$.ajax({
@ -3721,7 +3754,7 @@ function splpoupdate(){
if(data){
alert(data);
$('.content').loader('hide');
$('#spl').find('td').eq(1).text(filename[2]);
//$('#spl').find('td').eq(1).text(filename[2]);
$('#EditServiceSplPOModel').modal('hide');
}

View File

@ -186,7 +186,47 @@ if(!empty($mms))
</div>
<!-- <div class="container"> -->
<div class="modal fade" id="Fileshow" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:800px;">
<!-- Table to show the line item of po -->
<div id="content" > </div>
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>SNo</th>
<th>BillNO</th>
<th>PONO</th>
<th>FileName</th>
</tr>
</thead>
<tbody id="tbleAppend1">
</tbody>
</table>
<div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
</form>
</div>
</div>
<!-- </div> -->
<div class="box-body">
@ -225,12 +265,27 @@ if(!empty($mms))
$tot_tot= $tot_tot + round($rel->total,2);
echo $rel->total;
?></span></td>
<td style="text-align:center"><span>
<!-- <td style="text-align:center"><span>
<?php
if(!empty($rel->file)){ ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php }else if(!empty($rel->ifile)) { ?>
<a target="_blank" href="<?php echo base_url().''. $rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php
}else
{
echo 'N/A';
}
?>
</span></td> -->
<td style="text-align:center"><span>
<?php
if(!empty($rel->file)){ ?>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm" id="files<?php echo $rel->pono;?>">Download</button></a>
<?php }else if(!empty($rel->ifile)) { ?>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><<button class="btn btn-info btn-sm" id="files<?php echo $rel->pono;?>">Download</button></a>
<?php
}else
{
@ -238,8 +293,6 @@ if(!empty($mms))
}
?>
</span></td>
</tr>
<?php
@ -300,6 +353,53 @@ if(!empty($mms))
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
$('.btn-sm').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>report/Viewfiles",
success: function(data){
//console.log((data));
var trHTML = '';
$.each($.parseJSON(data), function (i, item) {
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td>' + item.BillNo+ '</td>' +
'<td>' + item.PONO+ '</td>' +
'<td><a target="_blank" href = <?php echo base_url()?>uploads/BillFiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
// '<td>' +item.FilePath+"<?php echo base_url().'uploads/BillFiles/'?>"> +'</td>'
'</tr>';
});
$("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
});
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {

View File

@ -218,6 +218,45 @@ table.dataTable thead > tr > td.sorting {
</div>
<div class="modal fade" id="Fileshow" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:800px;">
<!-- Table to show the line item of po -->
<div id="content" > </div>
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>SNo</th>
<th>BillNO</th>
<th>PONO</th>
<th>FileName</th>
</tr>
</thead>
<tbody id="tbleAppend1">
</tbody>
</table>
<div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
</form>
</div>
</div>
<span style="color:red;">*Insurance field not included </span>
@ -268,8 +307,8 @@ table.dataTable thead > tr > td.sorting {
foreach($purchase as $rel)
{
?>
<tr>
<td><span>
<tr id="lastvalue">
<td id="pono<?php echo $key?>"><span>
<a href="<?php echo base_url().'purchaseorder/CreatePOPrint?PONO='.$rel->pono.'&ReqType='.$rel->potype; ?>"><?php echo $rel->pono;?></a>
</span></td>
<td style="text-align:center"><span><?php echo $rel->created_date;?></span></td>
@ -311,15 +350,36 @@ table.dataTable thead > tr > td.sorting {
$tot_pac= $tot_pac + $rel->Package;
echo $rel->Package;?></span></td>
<td style="text-align:right"><span><?php
<!-- <td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
?>
<?php
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
if(!empty($rel->file)){ ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
<?php }else if(!empty($rel->ifile)) { ?><a target="_blank" href="<?php echo base_url().''.$rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
<?php } else { echo number_format($rel->total,2,'.',''); } ?>
</span></td> -->
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
echo number_format($rel->total,2,'.','');
?></span></td>
<td id="download<?php echo $key?>" style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
?><?php
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
<!-- href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>"
href="<?php echo base_url().'report/filedownload?pono ='.$rel->pono ?>"-->
<a target="_blank"
class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm" id="files<?php echo $rel->pono;?>">Download</button></a>
<?php }else if(!empty($rel->ifile)) { ?><!-- else if for igr file -->
<a target="_blank" href="<?php echo base_url().''.$rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
<?php } else { echo number_format($rel->total,2,'.',''); } ?><!-- both inwardpo file and Igr file empty means -->
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View">
<button class="btn btn-info btn-sm" id="files<?php echo $rel->pono;?>">Download</button></a>
<?php } else { echo 'N/A'; } ?><!-- both inwardpo file and Igr file empty means -->
</span></td>
@ -476,6 +536,48 @@ table.dataTable thead > tr > td.sorting {
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
$('.btn-sm').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>report/Viewfiles",
success: function(data){
//console.log((data));
var trHTML = '';
$.each($.parseJSON(data), function (i, item) {
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td>' + item.BillNo+ '</td>' +
'<td>' + item.PONO+ '</td>' +
'<td><a target="_blank" href = <?php echo base_url()?>uploads/BillFiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
// '<td>' +item.FilePath+"<?php echo base_url().'uploads/BillFiles/'?>"> +'</td>'
'</tr>';
});
$("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
});
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {

View File

@ -180,13 +180,16 @@ if(!empty($INRSYMBOL))
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
$("#Date1").datepicker({
// minDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
$("#MRC").datepicker({
$("#MRC").datepicker({
// minDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
@ -1728,34 +1731,7 @@ function calculatePackaging(isEdit)
}
}
function rfilealert()
{
var file = $('#imag').val();
if (file=='')
{
alert('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function sfilealert()
{
var file1 = $('#images1').val();
if (file1=='')
{
alert('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function SpecialPOcheck()
{
@ -1770,6 +1746,10 @@ function SpecialPOcheck()
var row=$('#txtRowCount1').val();
var PO=$('#POType').val();
// $('#hideconstants').val(counterConstants);
var file1 = $('#images1'+counterConstants).val()
var file = $('#imag'+counterConstant).val()
// if(splrow!=row)
// {
// alert("You havent add all the material details")
@ -1781,7 +1761,7 @@ function SpecialPOcheck()
if(PO=='REVENUE')
{
var images = $('#images').val();
var images = $('#imag').val();
$('#content').loader('show');
@ -3075,15 +3055,17 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-4 pad"><strong>Delivery Challan /Inv Date</strong>
<!-- <input type="Date" name="Date1" onkeypress="return onlyAlphabets(event);" maxlength="100" id="Date1" class="form-control" required value="2"> -->
<?php
$data = array('name' => 'ChallanInvDate','value' => set_value('ChallanInvDate',$CurrentDate),'id'=>'Date1', 'class' => 'form-control num' ,'required' => 'true');
$data = array('name' => 'Date1','value' => set_value('Date1',$CurrentDate),'id'=>'Date1', 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data);?>
</div>
<div class="col-md-4 pad"> <strong>Material Received Date</strong>
<div class="col-md-4 pad"> <strong>Material Received Date</strong>
<?php
$data = array('name' => 'MRC','value' => set_value('MRC',$CurrentDate),'id'=>'MRC', 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data);?>
</div>
echo form_input($data);?>
</div>
<!-- <div class="col-md-4 pad"><strong>Advise Quantity</strong>
<input type="text" name="AQuantity" id="AQuantity" maxlength="12" class="form-control" value="" required>
</div> -->
@ -3103,6 +3085,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-4 pad"><strong>Courier No</strong>
<input type="text" name="CourierNo" id="CourierNo" maxlength="12" class="form-control" value="" required>
</div>
<div class="col-md-4" id="QualityChecked"><strong>Is Quality Check Required</strong>
<div class="radio">
<label><input type="radio" name="Quality" checked="checked" value='0' id="Quality">Yes</label>
@ -3116,14 +3099,35 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12">
<div class="col-md-5">
<input type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();"/>
<label for="images">Select file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div>
<!-- <div class="col-md-5">
<input type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();"/>
<label for="images">Select file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div> -->
<div class="col-md-10">
<!-- <legend>Multiple File</legend> -->
<div class="col-md-offset-10 col-md-1" >
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" + ADD FILES..">
</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>
</div>
</div>
<div class="col-md-12">
@ -3153,7 +3157,9 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12 text-right">
<!-- <div class="col-md-4">
<a class="btn btn-primary Add" onclick="addtable();"><span class="bold">Add table</span></a>
</div> -->
</div> -->
<div class="col-md-4 col-md-offset-8">
<a class="btn btn-primary ok" ID="ExciseOption12" onclick="rfilealert();" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
@ -3178,15 +3184,31 @@ function populateValueMainFormForDeleteItem(rowid)
<h4 class="modal-title">SERVICE Bill Details</h4>
</div>
<div class="modal-body" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-12">
<div class="col-md-4">
<!-- <div class="col-md-4">
<input type = "file" size = "20" input accept=".docx,.pdx,.doc.JPG,.PNG,.jpg" id="images1" name="images1" onChange="sfilecheck();"/>
<label for="images">Select Company file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div>
</div>
</div> -->
<!-- <div class="col-md-10"> -->
<!-- <legend>Multiple File</legend> -->
<div class="col-md-offset-10 col-md-1" >
<input type="button" class="btn btn-primary" id ="addemorebutton" value=" + ADD FILES..">
</div>
<div id="newsdiv"></div><!-- this div for add more section-->
<input type="hidden" name="hidecounters" id="hidecounters" value="0" />
<input type="hidden" name="hideconstants" id="hideconstants" value="0" />
</div>
@ -8693,44 +8715,283 @@ var specialservicerow=0;
}//add click function closed
function filecheck()
{
// function filecheck()
// {
//$('#content').loader('show');
var sizef = document.getElementById('imag').files[0].size;
var file = $('#imag').val();
//alert(file);
if(file!='' && sizef < 2100000)
{
// //$('#content').loader('show');
// var sizef = document.getElementById('imag').files[0].size;
// var file = $('#imag').val();
// //alert(file);
// if(file!='' && sizef < 2100000)
// {
alert('Your file added successfully');
}
else
{
alert('Sorry Your File is Large To 2MB');
$('#imag').val('');
}
// alert('Your file added successfully');
// }
// else
// {
// alert('Sorry Your File is Large To 2MB');
// $('#imag').val('');
// }
}
function sfilecheck()
{
//$('#content').loader('show');
var sizef = document.getElementById('images1').files[0].size;
var file1 = $('#images1').val();
if(file1!='' && sizef < 2100000)
{
// }
// function sfilecheck()
// {
// //$('#content').loader('show');
// var sizef = document.getElementById('images1').files[0].size;
// var file1 = $('#images1').val();
// if(file1!='' && sizef < 2100000)
// {
alert('Your file added successfully');
}
else
{
alert('Sorry Your File is Large To 2MB');
$('#images1').val('');
}
// alert('Your file added successfully');
// }
// else
// {
// alert('Sorry Your File is Large To 2MB');
// $('#images1').val('');
// }
}
// }
</script>
<!-- Multiple file Upload Script -->
<script>
// var selDiv = "";
// document.addEventListener("DOMContentLoaded", init, false);
// function init() {
// document.querySelector('#files').addEventListener('change', handleFileSelect, false);
// selDiv = document.querySelector("`#selectedFiles");
// }
// function handleFileSelect(e) {
// if(!e.target.files) return;
// selDiv.innerHTML = "";
// var files = e.target.files;
// for(var i=0; i<files.length; i++) {
// var f = files[i];
// selDiv.innerHTML += f.name + "<br/>";
// }
// }
//this script used to multiple file upoads in REVENUE//
var counter = 0;
var counterConstant = 0;
$("#addmorebutton").click(function(){
//alert('sda');
// if(counter>4){
// alert("No more files to add");//this allows only 5 files;
// 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">'+
// '<label>File Name</label>'+
// '<input type="text" id="maint_filename'+counterConstant+'" name="filename'+counterConstant+'" class="form-control" onkeypress="return false;" readonly/>'+
// '</div>'+
'<div class="col-md-4">'+
'<label><br></label>'+
'<input type="file" name="browseFiles'+counterConstant+'" id="imag" onchange="Copyfilename(this.name); "><br>'+
'</div>'+
'<div class="col-md-3">'+
'<label><br><br></label>'+
'<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstant+'" onclick="removeRow(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
'</div>'+
'</div>';
$('#newdiv').append(div);
$('#hidecounter').val(counter);
$('#hideconstant').val(counterConstant);
//}
});
function rfilealert()
{
//var file = $('#imag').val();
var file = $('#imag'+counterConstant).val();
if (file=='')
{
alert('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function Copyfilename(id)
{
var size = $('input[name='+id+']')[0].files[0].size;
var number = id.replace(/[^0-9]+/ig,"");
if(size > 2100000){
//alert(id);
alert('Sorry Your File is Large To 2MB');
removeRow(id);
//$('input[name = browseFiles'+number+']').val(' ');
}else {
var name = $('input[name='+id+']')[0].files[0].name;
//alert(name);
$("#maint_filename"+number).val(name);
}
}
function removeRow(input) {
var number = input.replace(/[^0-9]+/ig,"");
if(counter >= 1){
counter--;
$("#divid"+number).remove();
$('#hidecounter').val(counter);
}
}
//this script used to multiple file upoads in service//
var counters = 0;
var counterConstants = 0;
$("#addemorebutton").click(function(){
//alert('sda');
// if(counter>4){
// alert("No more files to add");//this allows only 5 files;
// return false;
// }
// else{
counters++;
counterConstants++;
var div = document.createElement('div');
div.id = "divid"+counterConstants;
div.className="row";
div.innerHTML='<div class="col-md-12">'+
// '<div class="col-md-3">'+
// '<label>File Name</label>'+
// '<input type="text" id="maint_filename'+counterConstant+'" name="filename'+counterConstant+'" class="form-control" onkeypress="return false;" readonly/>'+
// '</div>'+
'<div class="col-md-4">'+
'<label><br></label>'+
'<input type="file" id="images1" name="browseFiles'+counterConstants+'" onchange="Copyfilenames(this.name);"><br>'+
'</div>'+
'<div class="col-md-3">'+
'<label><br><br></label>'+
'<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstants+'" onclick="removeRows(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
'</div>'+
'</div>';
$('#newsdiv').append(div);
$('#hidecounters').val(counters);
$('#hideconstants').val(counterConstants);
// document.write("browseFiles"+length);
//}
});
function sfilealert()
{
var file1 = $('#images1'+counterConstants).val();
//$('input[name='+id+']')[0].files[0].size;
if (file1=='')
{
alert('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function Copyfilenames(id)
{
var size = $('input[name='+id+']')[0].files[0].size;
var number = id.replace(/[^0-9]+/ig,"");
if(size > 2100000){
//alert(id);
alert('Sorry Your File is Large To 2MB');
removeRows(id);
//$('input[name = browseFiles'+number+']').val(' ');
}else {
var name = $('input[name='+id+']')[0].files[0].name;
//alert(name);
//$("#maint_filename"+number).val(name);
}
}
function removeRows(input) {
var number = input.replace(/[^0-9]+/ig,"");
if(counters>= 1){
counters --;
$("#divid"+number).remove();
$('#hidecounter').val(counters);
}
}
</script>