file
This commit is contained in:
parent
526a6acbb2
commit
8f0b886332
@ -260,7 +260,7 @@ class inwardgateregister extends BaseController
|
|||||||
|
|
||||||
if($this->upload->do_upload('file'))
|
if($this->upload->do_upload('file'))
|
||||||
{
|
{
|
||||||
echo "uploadif";
|
//echo "if conditioncheck file do_upload";
|
||||||
$uploadData = $this->upload->data();
|
$uploadData = $this->upload->data();
|
||||||
$picture = $uploadData['file_name'];
|
$picture = $uploadData['file_name'];
|
||||||
}
|
}
|
||||||
@ -285,6 +285,8 @@ class inwardgateregister extends BaseController
|
|||||||
function addloadfile()
|
function addloadfile()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//echo 'Add new file ';
|
||||||
|
|
||||||
$upfiles = '';
|
$upfiles = '';
|
||||||
$pono= $this->input->post('PONO');
|
$pono= $this->input->post('PONO');
|
||||||
|
|
||||||
@ -323,7 +325,7 @@ $fcount = 0;
|
|||||||
|
|
||||||
if($fcount == 0)
|
if($fcount == 0)
|
||||||
{
|
{
|
||||||
//echo 'if'.$fcount;
|
//echo 'if'.$fcount.'</br>';
|
||||||
|
|
||||||
if(!empty($new_file_name))
|
if(!empty($new_file_name))
|
||||||
{
|
{
|
||||||
@ -336,6 +338,7 @@ $fcount = 0;
|
|||||||
//print_r($upfiles);
|
//print_r($upfiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//echo 'filename'.$upfiles;
|
||||||
|
|
||||||
if( $upfiles > 0){
|
if( $upfiles > 0){
|
||||||
echo "file updated successfully!";
|
echo "file updated successfully!";
|
||||||
@ -723,7 +726,9 @@ $prefile =array();
|
|||||||
function ViewIGRfile()
|
function ViewIGRfile()
|
||||||
{
|
{
|
||||||
$IGRNO= $this->input->post('id');
|
$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);
|
echo json_encode($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -527,14 +527,16 @@ class report extends BaseController
|
|||||||
function Viewnormaligrfiles()
|
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;
|
//echo $PONO; die;
|
||||||
|
|
||||||
$igrfile= $this->dahsboard_Model->getfiles($PONO);
|
$igrfile= $this->dahsboard_Model->getfiles($igr,$PONO);
|
||||||
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||||
$billfile = $this->dahsboard_Model->viewIGRFile1($PONO);
|
$billfile = $this->dahsboard_Model->viewIGRFile1($igr,$PONO);
|
||||||
|
|
||||||
$data = array_merge($igrfile,$billfile);
|
$data = array_merge($igrfile,$billfile);
|
||||||
|
|
||||||
@ -543,6 +545,7 @@ class report extends BaseController
|
|||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ipurchase()
|
public function ipurchase()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -34,11 +34,12 @@ function getfile($PONO)
|
|||||||
$result = $query->result_array();
|
$result = $query->result_array();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
function getfiles($PONO)
|
function getfiles($igr,$PONO)
|
||||||
{
|
{
|
||||||
//$this->db->distinct();
|
//$this->db->distinct();
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_Inwardgateregister_fileupload');
|
$this->db->from('T_Inwardgateregister_fileupload');
|
||||||
|
$this->db->where('IGRNO',$igr);
|
||||||
$this->db->where('PONO',$PONO);
|
$this->db->where('PONO',$PONO);
|
||||||
|
|
||||||
|
|
||||||
@ -49,11 +50,12 @@ function getfiles($PONO)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function viewIGRFile1($PONO)
|
function viewIGRFile1($igr,$PONO)
|
||||||
{
|
{
|
||||||
$this->db->distinct();
|
$this->db->distinct();
|
||||||
$this->db->select('igrm.file,igrm.PONO as pono'); //BillNo,IGRNO,FilePath,PONO
|
$this->db->select('igrm.file,igrm.PONO as pono'); //BillNo,IGRNO,FilePath,PONO
|
||||||
$this->db->from('T_IGR_Master igrm');
|
$this->db->from('T_IGR_Master igrm');
|
||||||
|
$this->db->where('igrm.IGRNO',$igr);
|
||||||
$this->db->where('igrm.PONO',$PONO);
|
$this->db->where('igrm.PONO',$PONO);
|
||||||
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
@ -1789,7 +1791,7 @@ if ($cname!= ''){
|
|||||||
$tempArray['total'] = $value->total;
|
$tempArray['total'] = $value->total;
|
||||||
$tempArray['created_date'] = $value->created_date;
|
$tempArray['created_date'] = $value->created_date;
|
||||||
$tempArray['file'] = $value->file;
|
$tempArray['file'] = $value->file;
|
||||||
$tempArray['ifile'] = $value->created_date;
|
$tempArray['ifile'] = $value->ifile;
|
||||||
$tempArray['igrn'] =$value->igrn;
|
$tempArray['igrn'] =$value->igrn;
|
||||||
|
|
||||||
$sqli ="select FilePath as Infiles from T_Inwardgateregister_fileupload where PONO =? and IGRNO =? ";
|
$sqli ="select FilePath as Infiles from T_Inwardgateregister_fileupload where PONO =? and IGRNO =? ";
|
||||||
|
|||||||
@ -260,18 +260,19 @@
|
|||||||
?></span></td>
|
?></span></td>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- $record->IGRNO.'-'.$record->PONO -->
|
||||||
|
|
||||||
<td style="text-align:center"><span>
|
<td style="text-align:center"><span>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($rel['file'])){ ?>
|
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'])){?>
|
<?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){?>
|
<?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{
|
<?php }else{
|
||||||
echo "N/A";
|
echo "N/A";
|
||||||
@ -333,9 +334,16 @@
|
|||||||
|
|
||||||
$('.IGRfile').click(function() {
|
$('.IGRfile').click(function() {
|
||||||
var id = $(this).attr('id');
|
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");
|
$("#Fileshow").modal("show");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:{id:id},
|
data:{id:igr,id1:po},
|
||||||
type:"POST",
|
type:"POST",
|
||||||
//dataType: 'json',
|
//dataType: 'json',
|
||||||
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
|
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
|
||||||
@ -364,12 +372,14 @@ $("#Fileshow").modal("show");
|
|||||||
}else{
|
}else{
|
||||||
Filename ="BillDetails";
|
Filename ="BillDetails";
|
||||||
PONO =item.PONO;
|
PONO =item.PONO;
|
||||||
|
BillNO =item.BillNo;
|
||||||
FilePath = item.FilePath;
|
FilePath = item.FilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
Filename = item.file;
|
Filename = item.file;
|
||||||
PONO =item.pono;
|
PONO =item.pono;
|
||||||
|
|
||||||
BillNO = '-';
|
BillNO = '-';
|
||||||
|
|
||||||
FilePath =item.file;
|
FilePath =item.file;
|
||||||
|
|||||||
@ -307,6 +307,7 @@ table.dataTable thead > tr > td.sorting {
|
|||||||
$tot_tot = 0;
|
$tot_tot = 0;
|
||||||
if(!empty($purchase)){
|
if(!empty($purchase)){
|
||||||
foreach($purchase as $key => $rel)
|
foreach($purchase as $key => $rel)
|
||||||
|
//print_r($rel);
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr id="lastvalue">
|
<tr id="lastvalue">
|
||||||
@ -362,14 +363,14 @@ table.dataTable thead > tr > td.sorting {
|
|||||||
<td id="download<?php echo $key?>" style="text-align:center"><span>
|
<td id="download<?php echo $key?>" style="text-align:center"><span>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
|
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 }
|
<?php }
|
||||||
else if(!empty($rel->ifile )) { ?><!-- else if for igr file -->
|
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">
|
<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>
|
</a>
|
||||||
<?php } else if (!empty($rel->Infiles)){ ?><!-- if for Inward po file -->
|
<?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 -->
|
<?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***/
|
/** On click for Displaying File MOdal***/
|
||||||
$('.splpofile').click(function() {
|
$('.splpofile').click(function() {
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
|
|
||||||
$("#Fileshow").modal("show");
|
$("#Fileshow").modal("show");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:{id:id},
|
data:{id:id},
|
||||||
@ -567,9 +569,14 @@ $('.splpofile').click(function() {
|
|||||||
$('.IGRfile').click(function() {
|
$('.IGRfile').click(function() {
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
|
|
||||||
|
var igr = id.substring(0, 9);
|
||||||
|
//alert(igr);
|
||||||
|
var po = id.substring(10, 33);
|
||||||
|
|
||||||
$("#Fileshow").modal("show");
|
$("#Fileshow").modal("show");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:{id:id},
|
|
||||||
|
data:{id:igr,id1:po},
|
||||||
type:"POST",
|
type:"POST",
|
||||||
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
|
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
@ -594,6 +601,7 @@ $('.IGRfile').click(function() {
|
|||||||
}else{
|
}else{
|
||||||
Filename ="BillDetails";
|
Filename ="BillDetails";
|
||||||
PONO =item.PONO;
|
PONO =item.PONO;
|
||||||
|
BillNO =item.BillNo;
|
||||||
FilePath = item.FilePath;
|
FilePath = item.FilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -394,6 +394,7 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
alert('Sorry Your File is Large To 2MB');
|
alert('Sorry Your File is Large To 2MB');
|
||||||
|
|
||||||
$('#billimag').val('');
|
$('#billimag').val('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -498,6 +499,7 @@ $("#hiddenPONO").val(po);
|
|||||||
}else{
|
}else{
|
||||||
Filename ="BillDetails";
|
Filename ="BillDetails";
|
||||||
PONO =item.PONO;
|
PONO =item.PONO;
|
||||||
|
BillNO =item.BillNo;
|
||||||
FilePath = item.FilePath;
|
FilePath = item.FilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,6 +674,8 @@ counter++;
|
|||||||
if(bil_count>=6){
|
if(bil_count>=6){
|
||||||
|
|
||||||
alert("You have to upload five files only");//this allows only 5 files;
|
alert("You have to upload five files only");//this allows only 5 files;
|
||||||
|
$('#addmorebutton').hide();
|
||||||
|
|
||||||
return false;
|
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>'+
|
// '<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">'+
|
'<div class="col-md-2">'+
|
||||||
'<label><br><br></label>'+
|
'<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>'+
|
||||||
|
|
||||||
'</div>';
|
'</div>';
|
||||||
@ -788,7 +792,7 @@ counter++;
|
|||||||
success:function(data) {
|
success:function(data) {
|
||||||
if(data){
|
if(data){
|
||||||
alert(data);
|
alert(data);
|
||||||
|
window.location.reload();
|
||||||
$('.content').loader('hide');
|
$('.content').loader('hide');
|
||||||
// $('#spl').find('td').eq(5).text(filename[2]);
|
// $('#spl').find('td').eq(5).text(filename[2]);
|
||||||
$('#billModel').modal('hide');
|
$('#billModel').modal('hide');
|
||||||
@ -798,4 +802,3 @@ counter++;
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user