echo "<div class='thumb-wrapper new-btn' title='Add Pictures'>"; echo "<img src='{$home_url}images/add.png' />"; echo "</div>"; ?> <!-- real field to browse image to upload --> <input type="file" name="files[]" id="html-btn" class='form-control' multiple> </td> </tr> <tr> <td>PDF(s):</td> <td> <?php // set product id $product_pdf->product_id = $product_id; // read all pdf records under the product id $stmt_product_pdf = $product_pdf->readAll(); // count number of pdf records under a product id $num_product_pdf = $stmt_product_pdf->rowCount(); // if retrieved pdf records was greater than 0 if ($num_product_pdf > 0) { // loop through the retrieved product pdf records while ($row = $stmt_product_pdf->fetch(PDO::FETCH_ASSOC)) { // pdf record id and name $product_pdf_id = $row['id']; $product_pdf_name = $row['name']; // display pdf list echo "<div class='pdf-item'>"; echo "<a href='{$home_url}uploads/pdfs/{$product_pdf_name}' target='_blank'>"; echo "{$product_pdf_name}"; echo "</a>"; echo "<span class='delete-pdf delete-object' delete-id='{$product_pdf_id}' delete-file='delete_pdf.php' >";