<tr> <td colspan="4"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title" Health>Audit Documents</h3> <span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> <p style="text-align: center;">Uploading Audit Document <button onclick="check_id_not()" class="btn btn-info btn-sm save_button"><i class="ace-icon glyphicon glyphicon-upload"></i>Upload Document </button> </br> <table class="table table-bordered" id="medical_doc_id" style="width: 100%"> <thead> <tr> <th>Document Name</th> <th>Download</th> <?php $hasExecuteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'E'); ?> <?php if ($hasExecuteAccess) { ?> <th>Delete</th> <?php } ?> </tr> </thead> <tbody> <?php // echo $checkup_section_id; $emp_id = $_REQUEST['audit_id'] != '' ? $_REQUEST['audit_id'] : $_REQUEST['audit_id']; $id = $_REQUEST['audit_id']; if ($id) { $sql_medical_doc = "SELECT * from medical_document where audit_id = '$id'"; $checkup_id = $_REQUEST['flex_checkup_id']; error_log("idddd" . $checkup_id); // echo $emp_id; $result_medical_doc = @mysqli_query($conn, $sql_medical_doc); while ($row_medical_doc = @mysqli_fetch_array($result_medical_doc)) { ?> <tr id="medical_doc_<?php echo $row_medical_doc['id'] ?>"> <td> <?php echo $row_medical_doc['medical_doc_desc']; ?> </td> <?php if ($row_medical_doc['medical_doc_type'] == 'application/pdf') { ?> <td><a href='#'><img src='images/pdf.png' width='35' height='35' onclick='$("#med_doc_<?php echo $row_medical_doc['id'] ?>").click()'></a> <img id="med_doc_<?php echo $row_medical_doc['id'] ?>" style='display:none' <?php echo ' src = "data:' . $row_medical_doc['medical_doc_type'] . ';base64,' . base64_encode($row_medical_doc['medical_doc']) . '"' ?> alt="pdf" onclick="getMedicalDocument('<?php echo $row_medical_doc['id'] ?>')" /> </td> <?php } else { ?> <td><img width="50" height="50" <?php echo ' src = "data:' . $row_medical_doc['medical_doc_type'] . ';base64,' . base64_encode($row_medical_doc['medical_doc']) . '"' ?> alt="new image" onclick="image(this,'<?php echo $row_medical_doc['medical_doc_desc'] ?>')" /></td> <?php } ?> <?php $hasReadAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'R'); $hasWriteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'W'); $hasExecuteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'E'); ?> <?php if ($hasExecuteAccess) { ?> <td align="center" style="width: 20%"> <a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" onclick="delete_opd_document('<?php echo $row_medical_doc['id'] ?>')" title="Delete"><span class="glyphicon glyphicon-trash"></span></a> </td> <?php } ?> </tr> <?php $count++; } } ?> </tbody> </table> </div> </div> </td> </tr> <script> $(document).on('click', '.panel-heading span.clickable', function (e) { var $this = $(this); if (!$this.hasClass('panel-collapsed')) { $this.parents('.panel').find('.panel-body').slideUp(); $this.addClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); } else { $this.parents('.panel').find('.panel-body').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); } }) function check_id_not() { var audit_name = $('#audit_name').val(); if (audit_name == "") { BootstrapDialog.alert('First You Need To Fill-up Audit Details'); return false; } open_popup_img() } </script>