D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
ajax
/
Filename :
show-po-uploaded-files.php
back
Copy
<?php ini_set('display_errors',0); error_reporting(0); ob_start(); session_start(); include_once("../config.php"); date_default_timezone_set( "Asia/Calcutta" ); $regDate = date( 'd-M-Y H:i' ); if ( isset( $_POST['data_po_row_id'] ) ) { $po_row_id = $_POST['data_po_row_id']; $sql1="SELECT * FROM `purchase_order` WHERE `purchase_order`.`id`='$po_row_id';"; $query1=mysqli_query($conn,$sql1); $count1=mysqli_num_rows($query1); if($count1){ $result1=mysqli_fetch_assoc($query1); $supporting_documents=$result1['supporting_documents']; $po_id=$result1['po_id']; } $linkz=""; if(!empty($supporting_documents)){ $myArray = explode(',', $supporting_documents); foreach ( $myArray as $key ) { $kaboom1 = explode( ".", $key ); $fileExt1 = end( $kaboom1 ); //echo $key; if($fileExt1== 'jpg'||$fileExt1== 'jpeg'||$fileExt1== 'JPG'||$fileExt1== 'JPEG'||$fileExt1== 'png'||$fileExt1== 'PNG'){ $linkz.="<a href='' class='button showSupportingDocFile' data-po-id='".$po_id."' data-file-name='po-supporting-files/".$key."'><img src='images/img-icon.png' class='sDoc'></a>"; } if($fileExt1== 'pdf'||$fileExt1== 'PDF'){ $linkz.="<a href='' class='button showSupportingDocFile' data-po-id='".$po_id."' data-file-name='po-supporting-files/".$key."'><img src='images/pdf-icon.png' class='sDoc'></a>"; } } echo $linkz; }else{ echo $linkz=""; } } ?>