This commit is contained in:
venbatechnologies 2018-07-19 12:48:01 +05:30
parent 526a6acbb2
commit 8f0b886332
6 changed files with 334 additions and 303 deletions

View File

@ -260,7 +260,7 @@ class inwardgateregister extends BaseController
if($this->upload->do_upload('file'))
{
echo "uploadif";
//echo "if conditioncheck file do_upload";
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
@ -285,6 +285,8 @@ class inwardgateregister extends BaseController
function addloadfile()
{
//echo 'Add new file ';
$upfiles = '';
$pono= $this->input->post('PONO');
@ -323,7 +325,7 @@ $fcount = 0;
if($fcount == 0)
{
//echo 'if'.$fcount;
//echo 'if'.$fcount.'</br>';
if(!empty($new_file_name))
{
@ -336,6 +338,7 @@ $fcount = 0;
//print_r($upfiles);
}
}
//echo 'filename'.$upfiles;
if( $upfiles > 0){
echo "file updated successfully!";
@ -723,7 +726,9 @@ $prefile =array();
function ViewIGRfile()
{
$IGRNO= $this->input->post('id');
$data = $this->inwardgateregister_model->viewIGRFile($IGRNO);
$igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
$billfile = $this->inwardgateregister_model->ViewIGRfile1($IGRNO);
$data = array_merge($igrfile,$billfile);
echo json_encode($data);
}

View File

@ -527,14 +527,16 @@ class report extends BaseController
function Viewnormaligrfiles()
{
$PO= $this->input->post('id');
$igr= $this->input->post('id');
$PONO= $this->input->post('id1');
$PONO= substr($PO,5);
// $PONO= substr($PO,5);
//echo $PONO; die;
$igrfile= $this->dahsboard_Model->getfiles($PONO);
$igrfile= $this->dahsboard_Model->getfiles($igr,$PONO);
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
$billfile = $this->dahsboard_Model->viewIGRFile1($PONO);
$billfile = $this->dahsboard_Model->viewIGRFile1($igr,$PONO);
$data = array_merge($igrfile,$billfile);
@ -543,6 +545,7 @@ class report extends BaseController
echo json_encode($data);
}
public function ipurchase()
{

View File

@ -34,11 +34,12 @@ function getfile($PONO)
$result = $query->result_array();
return $result;
}
function getfiles($PONO)
function getfiles($igr,$PONO)
{
//$this->db->distinct();
$this->db->select('*');
$this->db->from('T_Inwardgateregister_fileupload');
$this->db->where('IGRNO',$igr);
$this->db->where('PONO',$PONO);
@ -49,11 +50,12 @@ function getfiles($PONO)
}
function viewIGRFile1($PONO)
function viewIGRFile1($igr,$PONO)
{
$this->db->distinct();
$this->db->select('igrm.file,igrm.PONO as pono'); //BillNo,IGRNO,FilePath,PONO
$this->db->from('T_IGR_Master igrm');
$this->db->where('igrm.IGRNO',$igr);
$this->db->where('igrm.PONO',$PONO);
$query = $this->db->get();
@ -1789,7 +1791,7 @@ if ($cname!= ''){
$tempArray['total'] = $value->total;
$tempArray['created_date'] = $value->created_date;
$tempArray['file'] = $value->file;
$tempArray['ifile'] = $value->created_date;
$tempArray['ifile'] = $value->ifile;
$tempArray['igrn'] =$value->igrn;
$sqli ="select FilePath as Infiles from T_Inwardgateregister_fileupload where PONO =? and IGRNO =? ";

View File

@ -260,18 +260,19 @@
?></span></td>
<!-- $record->IGRNO.'-'.$record->PONO -->
<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 splpofile" id="files<?php echo $rel['pono'];?>">Download</button></a>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="<?php echo $rel['igrn'].'-'.$rel['pono'];?>">Download</button></a>
<?php } elseif(!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 IGRfile" id="files<?php echo $rel['pono'];?>">Download</button></a>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel['igrn'].'-'.$rel['pono'];?>">Download</button></a>
<?php } elseif(!empty(sizeof($rel['Infiles'])) !=0){?>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel['pono'];?>">Download</button></a>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel['igrn'].'-'.$rel['pono'];?>">Download</button></a>
<?php }else{
echo "N/A";
@ -333,9 +334,16 @@
$('.IGRfile').click(function() {
var id = $(this).attr('id');
//alert(id);
var igr = id.substring(0, 9);
//alert(igr);
var po = id.substring(10, 33);
//alert(po);
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
data:{id:igr,id1:po},
type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
@ -364,12 +372,14 @@ $("#Fileshow").modal("show");
}else{
Filename ="BillDetails";
PONO =item.PONO;
BillNO =item.BillNo;
FilePath = item.FilePath;
}
}else{
Filename = item.file;
PONO =item.pono;
BillNO = '-';
FilePath =item.file;

View File

@ -307,6 +307,7 @@ table.dataTable thead > tr > td.sorting {
$tot_tot = 0;
if(!empty($purchase)){
foreach($purchase as $key => $rel)
//print_r($rel);
{
?>
<tr id="lastvalue">
@ -362,14 +363,14 @@ table.dataTable thead > tr > td.sorting {
<td id="download<?php echo $key?>" style="text-align:center"><span>
<?php
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="files<?php echo $rel->pono;?>">Download</button></a>
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="<?php echo $rel->igrn.'-'.$rel->pono;?>">Download</button></a>
<?php }
else if(!empty($rel->ifile )) { ?><!-- else if for igr file -->
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View">
<button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel->pono;?>">Download</button>
<button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel->igrn.'-'.$rel->pono;?>">Download</button>
</a>
<?php } else if (!empty($rel->Infiles)){ ?><!-- if for Inward po file -->
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel->pono;?>">Download</button></a>
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel->igrn.'-'.$rel->pono;?>">Download</button></a>
<?php } else { echo 'N/A'; } ?><!-- both inwardpo file and Igr file empty means -->
@ -535,6 +536,7 @@ $(document).ready(function() {
/** On click for Displaying File MOdal***/
$('.splpofile').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
@ -567,9 +569,14 @@ $('.splpofile').click(function() {
$('.IGRfile').click(function() {
var id = $(this).attr('id');
var igr = id.substring(0, 9);
//alert(igr);
var po = id.substring(10, 33);
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
data:{id:igr,id1:po},
type:"POST",
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
success: function(data){
@ -594,6 +601,7 @@ $('.IGRfile').click(function() {
}else{
Filename ="BillDetails";
PONO =item.PONO;
BillNO =item.BillNo;
FilePath = item.FilePath;
}

View File

@ -394,6 +394,7 @@
else
{
alert('Sorry Your File is Large To 2MB');
$('#billimag').val('');
}
}
@ -498,6 +499,7 @@ $("#hiddenPONO").val(po);
}else{
Filename ="BillDetails";
PONO =item.PONO;
BillNO =item.BillNo;
FilePath = item.FilePath;
}
@ -672,6 +674,8 @@ counter++;
if(bil_count>=6){
alert("You have to upload five files only");//this allows only 5 files;
$('#addmorebutton').hide();
return false;
}
@ -697,7 +701,7 @@ counter++;
// '<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 class="col-md-2">'+
'<label><br><br></label>'+
'<button class="btn btn-primary add add_this" id="addbtn" onclick="addRow()">ADD</button></div>'+
'<button class="btn btn-primary" type ="button" id="addbtn" onclick="addRow()">ADD</button></div>'+
'</div>'+
'</div>';
@ -788,7 +792,7 @@ counter++;
success:function(data) {
if(data){
alert(data);
window.location.reload();
$('.content').loader('hide');
// $('#spl').find('td').eq(5).text(filename[2]);
$('#billModel').modal('hide');
@ -798,4 +802,3 @@ counter++;
});
}
</script>