示例#1
0
function sampleDetail($id, $code, $sampleID)
{
    ?>
  <div class="row">
    <input type="hidden" id="tab" value="<?php 
    echo $code;
    ?>
">
    <div class="col-md-12">
      <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
        <div class="panel-heading ui-sortable-handle">
          <i class="fa fa-eyedropper"></i><span class="panel-title">Sample Information</span>
        </div>
        <div class="panel-body">
          <?php 
    if ($id == 16) {
        if ($code == 1) {
            $sql = "SELECT pp_kod AS kod,pp_nama AS product,pp_osa_kod_owner,pp_osa_kod_holder,rkatp_desc,rkatp_class,pp_rd_kod FROM p_product\n                      LEFT JOIN ref_kat_produk ON rkatp_kod=pp_rkatp_kod\n                      WHERE pp_kod='{$sampleID}'";
        } elseif ($code == 2) {
            $sql = "SELECT adrFormID AS kod,product_name AS product,remarks AS remark,quantity,batchno FROM adr_sample WHERE adrSampleID='{$sampleID}'";
        } elseif ($code == 3 || $code == 4) {
            $sql = "SELECT csps_cs_ruj AS kod,product_name AS product,remarks_to_lab AS remark,quantity,batchno FROM c_surv_sample WHERE pSampleID='{$sampleID}'";
        } elseif ($code == 5 || $code == 6) {
            $sql = "SELECT kp_id AS kod,kp_product_name AS product,kp_manufacturer,kp_holder,rkatp_desc,rkatp_class FROM k_produk\n                      LEFT JOIN ref_kat_produk ON rkatp_kod=kp_rkatp_kod\n                      WHERE kp_id='{$sampleID}'";
        }
        $result = selQuery($sql);
        $row = mysqli_fetch_assoc($result);
        $product = str_replace("'", "\\'", $row['product']);
        if ($code == 6) {
            $check = "SELECT kp_id FROM k_produk\n                        WHERE kp_id='{$sampleID}' AND kp_rsc_kod IN(1,4)";
        } else {
            if ($code == 1) {
                $group = 5;
            } elseif ($code == 2) {
                $group = 11;
            } elseif ($code == 3) {
                $group = 2;
            } elseif ($code == 4) {
                $group = 3;
            } elseif ($code == 5) {
                $group = 12;
            }
            $check = "SELECT kp_id,kp_batch_no,kp_kuantiti_htr,kp_tkh_terima,\n                        kp_tkh_luput,kp_complete_day,kp_sender,kp_rskt_kod,kp_rd_kod FROM k_produk\n                        WHERE kp_sampleID='{$sampleID}' AND kp_rsc_kod='{$group}'";
        }
        if (countRow($check) == 0) {
            if ($code == 1) {
                $group = 5;
            } elseif ($code == 2) {
                $group = 11;
            } elseif ($code == 3) {
                $group = 2;
            } elseif ($code == 4) {
                $group = 3;
            } elseif ($code == 5) {
                $group = 12;
            }
            $kp_id = kpID();
            $query = "INSERT INTO k_produk(kp_id,kp_sampleID,kp_rsc_kod,kp_product_name,kp_requestSpl)\n                        VALUE('{$kp_id}','{$sampleID}','{$group}','{$product}',0)";
            executeQuery($query);
        } else {
            $res = selQuery($check);
            $ro = mysqli_fetch_assoc($res);
            $kp_id = $ro['kp_id'];
        }
        $sampleID = $kp_id;
        ?>
          <input type="hidden" id="sampleID" value="<?php 
        echo $sampleID;
        ?>
">
          <div class="admin-form">
            <table class="table table-stripe table-hover" cellspacing="0" width="100%">
              <tbody>
                <?php 
        if ($code != 6) {
            ?>
                <tr>
                  <td>
                    <?php 
            if ($code == 2) {
                echo "ADR No";
            } else {
                if ($code == 3) {
                    echo "Complaint No";
                } else {
                    if ($code == 4) {
                        echo "Surveilance No";
                    } else {
                        echo "Call No";
                    }
                }
            }
            ?>
                  </td>
                  <td>:</td>
                  <td><b><?php 
            echo $row['kod'];
            ?>
</b></td>
                </tr>
                <?php 
        }
        ?>
                <tr>
                  <td width="24%">Product Name</td>
                  <td width="1%">:</td>
                  <td width="75%"><b><?php 
        echo $product;
        ?>
</b></td>
                </tr>
                <?php 
        if ($code == 1 || $code == 5 || $code == 6) {
            ?>
                <tr>
                  <td>Product Category</td>
                  <td>:</td>
                  <td><b><?php 
            echo $row['rkatp_desc'] . " - " . $row['rkatp_class'];
            ?>
</b></td>
                </tr>
                <tr>
                  <td>Manufacturer</td>
                  <td>:</td>
                  <td>
                    <b><?php 
            if ($code == 1) {
                echo getUser($row['pp_osa_kod_owner'], "os_sykt");
            } else {
                echo $row['kp_manufacturer'];
            }
            ?>
</b>
                  </td>
                </tr>
                <tr>
                  <td>Holder</td>
                  <td>:</td>
                  <td>
                    <b><?php 
            if ($code == 1) {
                echo getUser($row['pp_osa_kod_holder'], "os_sykt");
            } else {
                echo $row['kp_holder'];
            }
            ?>
</b>
                </td>
                </tr>
                <?php 
        } else {
            ?>
                <tr>
                  <td>Pasca Comment</td>
                  <td>:</td>
                  <td>
                    <div class="col-md-9">
                      <label class="field prepend-icon">
                        <textarea class="gui-textarea" id="comment" readonly><?php 
            echo $row['remark'];
            ?>
</textarea>
                        <label for="comment" class="field-icon">
                          <i class="fa fa-comments"></i>
                        </label>
                        <span class="input-footer">Pasca Comment</span>
                      </label>
                    </div>
                  </td>
                </tr>
                <?php 
        }
        ?>
              </tbody>
            </table>
          </div>
          <?php 
    } else {
        $query = "SELECT * FROM k_produk";
        if ($code == 1) {
            $query .= " LEFT JOIN p_product ON pp_kod=kp_sampleID\n                          LEFT JOIN ref_kat_produk ON rkatp_kod=pp_rkatp_kod";
        }
        $query .= " WHERE kp_id='{$sampleID}'";
        //echo $query;
        $result = selQuery($query);
        $row = mysqli_fetch_assoc($result);
        ?>
          <input type="hidden" id="sampleID" value="<?php 
        echo $sampleID;
        ?>
">
          <table class="table table-stripe table-hover" cellspacing="0" width="100%">
            <tbody>
              <tr>
                <td colspan="3" align="right">
                  <?php 
        getBarcode($row['kp_sampel_no']);
        ?>
                </td>
              </tr>
              <tr>
                <td>Sample Status</div>
                <td>:</td>
                <td>
                  <?php 
        if ($row['kp_requestSpl'] == 0) {
            echo "<b>In Store</b>";
        } elseif ($row['kp_requestSpl'] == 1) {
            echo "<b>Ready to Collect</b>";
        } else {
            echo "<b>Sample Collected</b>";
        }
        ?>
                </td>
              </tr>
              <tr>
                <td width="24%">Sample Number</td>
                <td width="1%">:</td>
                <td width="75%"><b><?php 
        echo $row['kp_sampel_no'];
        ?>
</b></td>
              </tr>
              <tr>
                <td>Product Name</td>
                <td>:</td>
                <td><b><?php 
        echo $row['kp_product_name'];
        ?>
</b></td>
              </tr>
              <?php 
        if ($row['kp_rsc_kod'] == 5) {
            ?>
              <tr>
                <td>Product Category</td>
                <td>:</td>
                <td><b><?php 
            echo $row['rkatp_desc'] . " - " . $row['rkatp_class'];
            ?>
</b></td>
              </tr>
              <tr>
                <td>Manufacturer</td>
                <td>:</td>
                <td><b><?php 
            echo $row['kp_manufacturer'];
            ?>
</b></td>
              </tr>
              <tr>
                <td>Holder</td>
                <td>:</td>
                <td><b><?php 
            echo $row['kp_holder'];
            ?>
</b></td>
              </tr>
              <?php 
        }
        ?>
              <tr>
                <td>Batch Number</td>
                <td>:</td>
                <td><b><?php 
        echo $row['kp_batch_no'];
        ?>
</b></td>
              </tr>
              <tr>
                <td>Quantity Received</td>
                <td>:</td>
                <td><b><?php 
        echo $row['kp_kuantiti_htr'];
        ?>
</b></td>
              </tr>
              <tr>
                <td>Dosage</td>
                <td>:</td>
                <td><b><?php 
        echo getDosage($row['kp_rd_kod'], 1);
        ?>
</b></td>
              </tr>
              <tr>
                <td>Unit</td>
                <td>:</td>
                <td><b><?php 
        getSukatan($row['kp_rskt_kod'], 1);
        ?>
</b></td>
              </tr>
              <tr>
                <td>Expiry Date</td>
                <td>:</td>
                <td><b><?php 
        echo displayDate($row['kp_tkh_luput']);
        ?>
</b></td>
              </tr>
              <tr>
                <td>Received Date</td>
                <td>:</td>
                <td><b><?php 
        echo displayDate($row['kp_tkh_terima']);
        ?>
</b></td>
              </tr>
              <tr>
                <td>Expected Complete Day(s)</td>
                <td>:</td>
                <td><b><?php 
        echo $row['kp_complete_day'];
        ?>
</b></td>
              </tr>
              <tr>
                <td>Sender</td>
                <td>:</td>
                <td><b><?php 
        echo $row['kp_sender'];
        ?>
</b></td>
              </tr>
            </tbody>
          </table>
          <?php 
    }
    ?>
        </div>
      </div>
    </div>
  </div>
  <?php 
    if ($id == 16) {
        ?>
  <div class="row">
    <div class="col-md-12">
      <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
        <div class="panel-heading ui-sortable-handle">
          <i class="fa fa-edit"></i><span class="panel-title">To be filled by QCC Officer</span>
        </div>
        <div class="panel-body">
          <div class="admin-form">
            <table class="table table-stripe table-hover" cellspacing="0" width="100%">
              <tbody>
                <tr>
                  <td width="24%">Batch Number <font color="red">*</font></td>
                  <td width="1%">:</td>
                  <td width="75%">
                    <div class="col-md-4">
                      <label class="field prepend-icon">
                        <input type="text" id="txt_batch" class="gui-input" value="<?php 
        if (!$row['batchno']) {
            echo $ro['kp_batch_no'];
        } else {
            echo $row['batchno'];
        }
        ?>
" onchange="savedSample('txt_batch')">
                        <label for="txt_batch" class="field-icon">
                          <i class="fa fa-calculator"></i>
                        </label>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Quantity Received <font color="red">*</font></td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field prepend-icon">
                        <input type="text" id="txt_quantity" class="gui-input" value="<?php 
        if (!$row['quantity']) {
            echo $ro['kp_kuantiti_htr'];
        } else {
            echo $row['quantity'];
        }
        ?>
" onchange="savedSample('txt_quantity')">
                        <label for="txt_quantity" class="field-icon">
                          <i class="fa fa-calculator"></i>
                        </label>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Dosage</td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field select">
                        <select id="txt_dosage" onchange="savedSample('txt_dosage')">
                          <?php 
        if (!$row['pp_rd_kod']) {
            echo getDosage($ro['kp_rd_kod']);
        } else {
            echo getDosage($row['pp_rd_kod']);
        }
        ?>
                        </select>
                        <i class="arrow"></i>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Unit</td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field select" onchange="savedSample('txt_unit')">
                        <select id="txt_unit">
                          <?php 
        getSukatan($ro['kp_rskt_kod']);
        ?>
                        </select>
                        <i class="arrow"></i>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Expiry Date</td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field prepend-icon">
                        <input type="text" name="txt_expiry" id="txt_expiry" class="gui-input" readonly value="<?php 
        echo displayDate($ro['kp_tkh_luput']);
        ?>
" onchange="savedSample('txt_expiry')">
                        <label for="txt_expiry" class="field-icon">
                          <i class="fa fa-calendar"></i>
                        </label>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Received Date <font color="red">*</font></td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field prepend-icon">
                        <input type="text" name="txt_received" id="txt_received" class="gui-input" readonly value="<?php 
        echo displayDate($ro['kp_tkh_terima']);
        ?>
" onchange="savedSample('txt_received')">
                        <label for="txt_received" class="field-icon">
                          <i class="fa fa-calendar"></i>
                        </label>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Expected Complete Day(s) <font color="red">*</font></td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field prepend-icon">
                        <input type="number" name="txt_complete" id="txt_complete" class="gui-input" value="<?php 
        echo $ro['kp_complete_day'];
        ?>
" onchange="savedSample('txt_complete')">
                        <label for="txt_complete" class="field-icon">
                          <i class="fa fa-calculator"></i>
                        </label>
                      </label>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Sender <font color="red">*</font></td>
                  <td>:</td>
                  <td>
                    <div class="col-md-7">
                      <label class="field prepend-icon">
                        <input type="text" name="txt_sender" id="txt_sender" class="gui-input" value="<?php 
        echo $ro['kp_sender'];
        ?>
" onchange="savedSample('txt_sender')">
                        <label for="txt_sender" class="field-icon">
                          <i class="fa fa-user"></i>
                        </label>
                      </label>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php 
    }
    if ($id == 19 || $id == 20) {
        ?>
  <div class="row">
    <div class="col-md-12">
      <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
        <div class="panel-heading ui-sortable-handle">
          <i class="fa fa-random"></i><span class="panel-title">Distribute Sample</span>
        </div>
        <div class="panel-body">
          <div class="admin-form">
            <table class="table table-stripe table-hover" cellspacing="0" width="100%">
              <tbody>
                <tr>
                  <td width="24%">Unit <font class="text-danger">*</font></td>
                  <td width="1%">:</td>
                  <td width="75%">
                    <div class="col-md-10">
                      <select id="txt_lab" class="form-control">
                          <option value='0'>-- Please Select --</option>
                          <?php 
        getLab();
        ?>
                      </select>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>Quantity <font class="text-danger">*</font></td>
                  <td>:</td>
                  <td>
                    <div class="col-md-4">
                      <label class="field prepend-icon">
                        <input type="text" name="txt_assign" id="txt_assign" class="gui-input">
                        <label for="txt_assign" class="field-icon">
                          <i class="fa fa-calculator"></i>
                        </label>
                      </label>
                    </div>
                    <div class="col-md-8">
                      <button class="btn btn-alert" onclick="balance('<?php 
        echo $sampleID;
        ?>
')"><i class="fa fa-plus"></i> Balance</button>
                      <button class="btn btn-alert" onclick="assignSample('<?php 
        echo $sampleID;
        ?>
')"><i class="fa fa-pencil"></i> Assign Sample</button>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php 
        $sql = "SELECT klb_kod,klb_ru_kod,klb_kuantiti_agih,klb_rskt_kod FROM k_lab\n          WHERE klb_kp_id='{$sampleID}'";
        if (countRow($sql) > 0) {
            ?>
  <div class="row">
    <div class="col-md-12">
      <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
        <div class="panel-heading ui-sortable-handle">
          <i class="fa fa-list"></i><span class="panel-title">Quantity Distribute to Each Lab</span>
        </div>
        <div class="panel-body">
          <table class="table table-striped table-hover" id="primary" cellspacing="0" width="100%">
            <thead>
              <tr class="alert" align="center">
                <td width="5%">No</td>
                <td width="30%">Lab Name</td>
                <td width="20%">Quantity</td>
                <td width="20%">Units</td>
                <td width="25%">Action</td>
              </tr>
            </thead>
            <tbody>
              <?php 
            $count = 1;
            $result = selQuery($sql);
            while ($row = mysqli_fetch_assoc($result)) {
                ?>
              <tr align="center">
                <td><?php 
                echo $count++;
                ?>
</td>
                <td align="left"><?php 
                echo retriveLab($row['klb_ru_kod']);
                ?>
</td>
                <td><?php 
                echo $row['klb_kuantiti_agih'];
                ?>
</td>
                <td><?php 
                echo $row['klb_rskt_kod'];
                ?>
</td>
                <td>
                  <button class="btn btn-alert btn-sm" onclick="sampleTest('<?php 
                echo $row['klb_kod'];
                ?>
')"><i class="fa fa-plus"></i> Add Test</button>
                  <button class="btn btn-danger btn-sm" onclick="removeAssign('<?php 
                echo $row['klb_kod'];
                ?>
','<?php 
                echo $sampleID;
                ?>
')"><i class="fa fa-trash-o"></i> Remove</button>
                </td>
              </tr>
              <?php 
            }
            ?>
            </tbody>
          </table>
          <div>&nbsp;</div>
          <div align="right">
            <button class="btn btn-danger btn-sm" onclick="removeAllAssign('<?php 
            echo $sampleID;
            ?>
')"><i class="fa fa-trash-o"></i> Remove All</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php 
        }
        $query = "SELECT kltt_kod,kltt_ru_kod,kltt_rt_kod,kltt_rt_desc FROM k_lab_task_test\n            WHERE kltt_kp_id='{$sampleID}' ORDER BY kltt_ru_kod";
        if (countRow($query) > 0) {
            ?>
  <div class="row">
    <div class="col-md-12">
      <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
        <div class="panel-heading ui-sortable-handle">
          <i class="fa fa-list"></i><span class="panel-title">Test(s) Assigned</span>
        </div>
        <div class="panel-body">
          <table class="table table-striped table-hover" id="second" cellspacing="0" width="100%">
            <thead>
              <tr class="alert" align="center">
                <td width="5%">No</td>
                <td width="30%">Lab Name</td>
                <td width="10%">Test Code</td>
                <td width="45%">Description</td>
                <td width="10%">Action</td>
              </tr>
            </thead>
            <tbody>
              <?php 
            $count = 1;
            $result = selQuery($query);
            while ($row = mysqli_fetch_assoc($result)) {
                ?>
              <tr align="center">
                <td><?php 
                echo $count++;
                ?>
</td>
                <td align="left"><?php 
                echo retriveLab($row['kltt_ru_kod']);
                ?>
</td>
                <td><?php 
                echo getTestCode($row['kltt_rt_kod']);
                ?>
</td>
                <td align="left"><a style="cursor:pointer;" id="<?php 
                echo $row['kltt_kod'];
                ?>
" onclick="changeDesc('<?php 
                echo $row['kltt_kod'];
                ?>
')"><?php 
                echo $row['kltt_rt_desc'];
                ?>
</a></td>
                <td><button class="btn btn-danger btn-sm" onclick="deleteTest('<?php 
                echo $row['kltt_kod'];
                ?>
','<?php 
                echo $kp_id;
                ?>
',1)"><i class="fa fa-trash-o"></i> Remove</button></td>
              </tr>
              <?php 
            }
            ?>
            </tbody>
          </table>
          <div>&nbsp;</div>
          <div align="right">
            <button class="btn btn-danger btn-sm" onclick="deleteAllTest('<?php 
            echo $sampleID;
            ?>
')"><i class="fa fa-trash-o"></i> Remove All</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php 
        }
    } elseif ($id == 21 || $id == 23 || $id == 25) {
        $query = "SELECT kltt_kod,kltt_ru_kod,kltt_rt_kod,kltt_rt_desc FROM k_lab_task_test\n              WHERE kltt_kp_id='{$sampleID}' AND kltt_ru_kod='" . $_SESSION['ru_kod'] . "'";
        $sql = "SELECT klb_kuantiti_agih,klb_kod FROM k_lab\n            WHERE klb_kp_id='{$sampleID}' AND klb_ru_kod='" . $_SESSION['ru_kod'] . "'";
        $res = selQuery($sql);
        $ro = mysqli_fetch_assoc($res);
        ?>
    <div class="row">
      <div class="col-md-12">
        <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
          <div class="panel-heading ui-sortable-handle">
            <i class="fa fa-list"></i><span class="panel-title">Test(s) Assigned</span>
          </div>
          <div class="panel-body">
            <div class="admin-form">
              <table class="table" cellspacing="0" width="100%">
                <tbody>
                  <tr>
                    <td width="24%">Quantity Assigned</td>
                    <td width="1%">:</td>
                    <td width="75%"><b><?php 
        echo $ro['klb_kuantiti_agih'];
        ?>
</b></td>
                  </tr>
                  <tr>
                    <td colspan="3">
                      <?php 
        if (getSampleResult($sampleID, $_SESSION['ru_kod']) == true) {
            ?>
                      <table class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                        <thead>
                          <tr class="alert" align="center">
                            <td width="5%">No</td>
                            <td width="10%">Code</td>
                            <td width="25%">Test</td>
                            <td width="25%">Specification</td>
                            <td width="15%">Result</td>
                            <td width="20%">Action</td>
                          </tr>
                        </thead>
                        <tbody>
                          <?php 
            $count = 1;
            $query = "SELECT kltt_kod,kltt_rt_kod,kltt_rt_desc,kltt_spec_desc,\n                                      kltt_result_desc1,kltt_result_desc2,kltt_result_desc3,kltt_result_desc4\n                                      FROM k_lab_task_test\n                                      WHERE kltt_kp_id='{$sampleID}' AND kltt_ru_kod='" . $_SESSION['ru_kod'] . "'";
            $result = selQuery($query);
            while ($rows = mysqli_fetch_assoc($result)) {
                ?>
                          <tr align="center">
                            <td><?php 
                echo $count++;
                ?>
</td>
                            <td>
                              <?php 
                echo getTestCode($rows['kltt_rt_kod']);
                echo getAccreditation($rows['kltt_rt_kod']);
                ?>
                            </td>
                            <td align="left"><?php 
                echo $rows['kltt_rt_desc'];
                ?>
</td>
                            <td align="left"><?php 
                echo $rows['kltt_spec_desc'];
                ?>
</td>
                            <td align="left">
                              <?php 
                $str = $rows['kltt_result_desc1'];
                if ($rows['kltt_result_desc2'] != NULL) {
                    $str .= "<br />" . $rows['kltt_result_desc2'];
                }
                if ($rows['kltt_result_desc3'] != NULL) {
                    $str .= "<br />" . $rows['kltt_result_desc3'];
                }
                if ($rows['kltt_result_desc4'] != NULL) {
                    $str .= "<br />" . $rows['kltt_result_desc4'];
                }
                echo $str;
                ?>
                            </td>
                            <td>
                              <button class="btn btn-alert btn-sm" onclick="evaluateSample('<?php 
                echo $rows['kltt_kod'];
                ?>
')"><i class="fa fa-edit"></i> Edit</button>
                              <button class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i> Remove</button>
                            </td>
                          </tr>
                          <?php 
            }
            ?>
                        </tbody>
                      </table>
                      <?php 
        } else {
            ?>
                      <table class="table table-striped table-hover" id="second" cellspacing="0" width="100%">
                        <thead>
                          <tr class="alert" align="center">
                            <td width="5%">No</td>
                            <td width="10%">Test Code</td>
                            <td width="75%">Description</td>
                            <td width="10%">Action</td>
                          </tr>
                        </thead>
                        <tbody>
                          <?php 
            $count = 1;
            $result = selQuery($query);
            while ($row = mysqli_fetch_assoc($result)) {
                ?>
                          <tr align="center">
                            <td><?php 
                echo $count++;
                ?>
</td>
                            <td><?php 
                echo getTestCode($row['kltt_rt_kod']);
                ?>
</td>
                            <td align="left"><a style="cursor:pointer;" id="<?php 
                echo $row['kltt_kod'];
                ?>
" onclick="changeDesc('<?php 
                echo $row['kltt_kod'];
                ?>
')"><?php 
                echo $row['kltt_rt_desc'];
                ?>
</a></td>
                            <td><button class="btn btn-danger btn-sm" onclick="deleteTest('<?php 
                echo $row['kltt_kod'];
                ?>
','<?php 
                echo $kp_id;
                ?>
',1)"><i class="fa fa-trash-o"></i> Remove</button></td>
                          </tr>
                          <?php 
            }
            ?>
                        </tbody>
                      </table>
                      <?php 
        }
        ?>
                    </td>
                  </tr>
                  <?php 
        if ($id == 23 || $id == 25) {
            ?>
                  <tr>
                    <td colspan="3" align="right">
                      <button class="btn btn-alert btn-sm" onclick="sampleTest('<?php 
            echo $ro['klb_kod'];
            ?>
')"><i class="fa fa-plus"></i> Add Test</button>
                    </td>
                  </tr>
                  <tr>
                    <td>Pharmacist</td>
                    <td>:</td>
                    <td>
                      <?php 
            if (getSampleResult($sampleID, $_SESSION['ru_kod']) == true) {
                if ($id == 23) {
                    $query = "SELECT klb_tp_kod FROM k_lab\n                                      WHERE klb_kp_id='{$sampleID}' AND klb_ru_kod='" . $_SESSION['ru_kod'] . "'";
                    $result = selQuery($query);
                    $row = mysqli_fetch_assoc($result);
                    $us_id = $row['klb_tp_kod'];
                    $name = getUsername($row['klb_tp_kod']);
                } elseif ($id == 25) {
                    $query = "SELECT kltt_tp_kod FROM k_lab_task_test\n                                      WHERE kltt_kp_id='{$sampleID}' AND kltt_ru_kod='" . $_SESSION['ru_kod'] . "'";
                    $result = selQuery($query);
                    $row = mysqli_fetch_assoc($result);
                    $us_id = $row['kltt_tp_kod'];
                    $name = getUsername($row['kltt_tp_kod']);
                }
                ?>
                        <div class="col-md-5">
                          <label class="field prepend-icon">
                            <input type="hidden" id="pharmacist_id" value="<?php 
                echo $us_id;
                ?>
"/>
                            <input type="text" id="txt_pharmacist" class="gui-input" value="<?php 
                echo $name;
                ?>
" readonly>
                            <label for="txt_pharmacist" class="field-icon">
                              <i class="fa fa-user-md"></i>
                            </label>
                          </label>
                        </div>
                        <?php 
            } else {
                ?>
                      <div class="col-md-5">
                        <label class="field prepend-icon">
                          <input type="hidden" id="pharmacist_id"/>
                          <input type="text" id="txt_pharmacist" class="gui-input" readonly>
                          <label for="txt_pharmacist" class="field-icon">
                            <i class="fa fa-user-md"></i>
                          </label>
                        </label>
                      </div>
                      <?php 
            }
            ?>
                      <div class="col-md-2">
                        <?php 
            if ($id == 23) {
                ?>
                        <button class="btn btn-alert" onclick="viewPharma('sample')"><i class="fa fa-plus"></i> Assign Pharmacist</button>
                        <?php 
            } elseif ($id == 25) {
                ?>
                        <button class="btn btn-alert" onclick="viewPharma('assist')"><i class="fa fa-plus"></i> Assign Assistant Pharmacist</button>
                        <?php 
            }
            ?>
                      </div>
                    </td>
                  </tr>
                  <?php 
        }
        ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  <?php 
    } elseif ($id == 27) {
        $sql = "SELECT klb_kuantiti_agih,klb_kod FROM k_lab\n            WHERE klb_kp_id='{$sampleID}' AND klb_ru_kod='" . $_SESSION['ru_kod'] . "'";
        $res = selQuery($sql);
        $ro = mysqli_fetch_assoc($res);
        ?>
  <div class="row">
    <div class="col-md-12">
      <div class="panel panel-alert" data-panel-color="panel-alert" data-panel-fullscreen="false" data-panel-title="false" data-panel-remove="false" data-panel-collapse="false">
        <div class="panel-heading ui-sortable-handle">
          <span class="panel-title">Enter Result</span>
        </div>
        <div class="panel-body">
          <table class="table" cellspacing="0" width="100%">
            <tbody>
              <tr>
                <td width="24%">Quantity Assigned</td>
                <td width="1%">:</td>
                <td width="75%"><b><?php 
        echo $ro['klb_kuantiti_agih'];
        ?>
</b></td>
              </tr>
              <tr>
                <td colspan="3">
                  <table class="table table-striped table-hover" id="second" cellspacing="0" width="100%">
                    <thead>
                      <tr class="alert" align="center">
                        <td width="5%">No</td>
                        <td width="15%">Test Code</td>
                        <td width="65%">Description</td>
                        <td width="10%">Action</td>
                        <td width="5%">&nbsp;</td>
                      </tr>
                    </thead>
                    <tbody>
                      <?php 
        $count = 1;
        $query = "SELECT * FROM k_lab_task_test\n                                WHERE kltt_kp_id='{$sampleID}' AND kltt_ru_kod='" . $_SESSION['ru_kod'] . "'";
        $result = selQuery($query);
        while ($row = mysqli_fetch_assoc($result)) {
            ?>
                      <tr align="center">
                        <td><?php 
            echo $count++;
            ?>
</td>
                        <td><?php 
            echo getTestCode($row['kltt_rt_kod']);
            ?>
</td>
                        <td align="left"><?php 
            echo $row['kltt_rt_desc'];
            ?>
</td>
                        <td><button class="btn btn-alert btn-sm" onclick="evaluateSample('<?php 
            echo $row['kltt_kod'];
            ?>
')"><i class="fa fa-plus"></i> Add Result</button></td>
                        <td>
                          <?php 
            if ($row['kltt_result'] == NULL) {
                echo "<input type='hidden' id='testCount' value='1' />";
                echo "<i class='fa fa-close text-danger'></i>";
            } else {
                echo "<i class='fa fa-check text-success'></i>";
            }
            ?>
                        </td>
                      </tr>
                      <?php 
        }
        ?>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
  <?php 
    }
    ?>
  <div class="row">
    <div class="col-md-12">
      <div class="admin-form">
        <label class="field prepend-icon">
          <textarea class="gui-textarea" id="txt_comment" placeholder="Enter Comment..." <?php 
    echo "onchange=\"saveComment('" . $sampleID . "',0)\"";
    ?>
><?php 
    echo getComments($id, $sampleID, $_SESSION['us_id']);
    ?>
</textarea>
          <label for="comment" class="field-icon">
            <i class="fa fa-comments"></i>
          </label>
          <span class="input-footer">
            <?php 
    if ($id == 16) {
        echo "Lab Admin comment";
    } elseif ($id == 19) {
        echo "Coordinating Unit comment";
    } elseif ($id == 20) {
        echo "Redistribute comment from Coordinating Unit";
    } elseif ($id == 21) {
        echo "Section Head comment";
    } elseif ($id == 23) {
        echo "Unit Head comment";
    } elseif ($id == 25) {
        echo "Pharmacist comment";
    } elseif ($id == 27) {
        echo "Analyst overall comment";
    }
    ?>
          </span>
        </label>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-11">
      <button class="btn btn-alert" onclick="content(<?php 
    echo $code;
    ?>
)"><i class="fa fa-arrow-left"></i> Back</button>
      <button class="btn btn-alert" onclick="showProduct(<?php 
    echo $sampleID;
    //$row['kod'];
    ?>
)"><i class="fa fa-info"></i> Product Details</button>
      <?php 
    if ($id == 16) {
        ?>
      <button class="btn btn-alert" onclick="receiveSample()"><i class="fa fa-check"></i> Receive Sample</button>
      <?php 
        if ($code == 1) {
            ?>
      <button class="btn btn-alert" onclick="rejectSample()"><i class="fa fa-close"></i> Reject Sample</button>
      <?php 
        }
    } else {
        ?>
      <button class="btn btn-alert" onclick="chronology(1,'<?php 
        echo $sampleID;
        ?>
')"><i class="fa fa-sort-alpha-asc"></i> Chronology</button>
      <?php 
        if ($id == 19) {
            ?>
      <button class="btn btn-alert" onclick="printBarcode('<?php 
            echo $sampleID;
            ?>
')"><i class="fa fa-print"></i> Print Barcode</button>
      <?php 
        }
        if ($id == 23 || $id == 25 || $id == 27) {
            ?>
        <div class="btn-group">
      <button stype="button" class="btn btn-alert dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
        <i class="fa fa-print"></i> Print
        <span class="caret ml5"></span>
      </button>
      <ul class="dropdown-menu" role="menu">
        <li><a style="cursor:pointer;" onclick="printBarcode('<?php 
            echo $sampleID;
            ?>
')">Barcode</a></li>
        <li><a style="cursor:pointer;" onclick="printDistribute('<?php 
            echo $sampleID;
            ?>
')">Distribution Detail</a></li>
      </ul>
    </div>
      <?php 
        }
        ?>
      <button class="btn btn-alert" onclick="submitSample('<?php 
        echo $sampleID;
        ?>
')"><i class="fa fa-send"></i> Submit</button>
      <?php 
        if (getSampleResult($sampleID, $_SESSION['ru_kod']) == true) {
            ?>
      <button class="btn btn-alert" onclick="approveResult()"><i class="fa fa-check"></i> Approve</button>
      <?php 
        }
        ?>
      <?php 
    }
    ?>
    </div>
  </div>
  <?php 
}
示例#2
0
function sampleDetail($id, $code, $sampleID)
{
    $status = 2;
    if ($id == 16) {
        if ($code == 1) {
            $status = screenStatus($sampleID);
            if ($status == 0) {
                $sql = "SELECT pp_nama AS sampleName,pp_kod AS sampleCode,rkatp_class,rkatp_desc,pp_osa_kod_holder,pp_osa_kod_owner FROM p_product\n              LEFT JOIN ref_kat_produk ON pp_rkatp_kod = rkatp_kod\n              WHERE pp_kod='{$sampleID}'";
            } else {
                $sql = "SELECT pp_nama AS sampleName,pp_kod AS sampleCode,rkatp_class,rkatp_desc,pp_osa_kod_holder,pp_osa_kod_owner FROM p_product,ref_kat_produk\n                WHERE pp_kod='{$sampleID}' AND pp_rkatp_kod=rkatp_kod";
            }
        } elseif ($code == 2) {
            $sql = "SELECT product_name AS sampleName,adrSampleID  AS sampleCode,remarks AS remark\n              ,quantity,batchno FROM adr_sample WHERE adrSampleID='{$sampleID}'";
        } elseif ($code == 3 || $code == 4) {
            $sql = "SELECT product_name AS sampleName,pSampleID AS sampleCode,remarks_to_lab AS remark\n              ,quantity,batchno FROM c_surv_sample WHERE pSampleID='{$sampleID}'";
        } elseif ($code == 6) {
            $sql = "SELECT *,kp_kuantiti_htr AS quantity,kp_batch_no AS batchno FROM k_produk WHERE kp_id='{$sampleID}'";
        }
    } else {
        $sql = "SELECT * FROM k_produk WHERE kp_id='{$sampleID}'";
    }
    ///echo $sql;
    $result = selQuery($sql);
    $row = mysqli_fetch_assoc($result);
    if ($id == 20) {
        $title = "Redistribute";
    } else {
        $title = sampleTitle($code);
    }
    ?>
<div class="tab-content pn br-n admin-form">
  <div class="row">
    <input type="hidden" id="mainTitle" value="<?php 
    echo $title;
    ?>
" />
    <input type="hidden" id="sampleID" value="<?php 
    echo $sampleID;
    ?>
">
    <div class="alert alert-sm alert-border-left alert-alert">Sample Information</div>
  </div>
  <div class="row">
    <?php 
    if ($id != 16) {
        ?>
    <div class="col-md-12" align="right">
      <?php 
        getBarcode($row['kp_sampel_no']);
        ?>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <?php 
    }
    if ($code == 1 and $id == 16) {
        ?>
      <div class="col-md-3">Call No</div>
      <div class="col-md-1">:</div>
      <div class="col-md-5"><?php 
        echo $sampleID;
        ?>
</div>
      <div class="col-md-12">&nbsp;</div>
    <?php 
    }
    if ($id != 16) {
        ?>
      <div class="col-md-3">Sample No</div>
      <div class="col-md-1">:</div>
      <div class="col-md-4"><?php 
        echo $row['kp_sampel_no'];
        ?>
</div>
      <div class="col-md-2" align="right">Store Status :</div>
      <div class="col-md-2" align="left">
        <?php 
        if ($row['kp_requestSpl'] == 0) {
            echo "<i class='fa fa-close text-danger'></i> Not Available";
        } else {
            echo "<i class='fa fa-check text-success'></i> Ready to collect";
        }
        ?>
      </div>
      <div class="col-md-12">&nbsp;</div>
    <?php 
    }
    ?>
      <div class="col-md-3">Product Name</div>
      <div class="col-md-1">:</div>
      <div class="col-md-8">
      <?php 
    if ($id == 16) {
        if ($code == 6) {
            echo $row['kp_product_name'];
            echo "<input type=\"hidden\" id=\"txt_code\" value=\"" . $row['kp_id'] . "\">";
            echo "<input type=\"hidden\" id=\"txt_name\" value=\"" . $row['kp_product_name'] . "\">";
        } else {
            echo $row['sampleName'];
            echo "<input type=\"hidden\" id=\"txt_code\" value=\"" . $row['sampleCode'] . "\">";
            echo "<input type=\"hidden\" id=\"txt_name\" value=\"" . $row['sampleName'] . "\">";
        }
    } else {
        echo $row['kp_product_name'];
    }
    ?>
    </div>
  <?php 
    if ($code == 1) {
        ?>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Product Category</div>
    <div class="col-md-1">:</div>
    <div class="col-md-5"><?php 
        echo $row['rkatp_desc'] . " - " . $row['rkatp_class'];
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Manufacturer</div>
    <div class="col-md-1">:</div>
    <div class="col-md-5"><?php 
        echo isempty(osaDetail($row['pp_osa_kod_owner']));
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Holder</div>
    <div class="col-md-1">:</div>
    <div class="col-md-5"><?php 
        echo isempty(osaDetail($row['pp_osa_kod_holder']));
        ?>
</div>
  <?php 
    }
    if ($code == 2 || $code == 3 || $code == 4) {
        ?>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Remarks</div>
    <div class="col-md-1">:</div>
    <div class="col-md-6">
      <label class="field prepend-icon">
        <textarea class="gui-textarea" id="txt_remark" readonly><?php 
        echo $row['remark'];
        ?>
</textarea>
        <label for="comment" class="field-icon">
          <i class="fa fa-comments"></i>
        </label>
        <span class="input-footer">Remarks from Pasca</span>
      </label>
    </div>
  <?php 
    }
    if ($id == 16) {
        ?>
    <div class="col-md-12">
      <div class="section-divider mb40">
        <span><b>To be filled by QCC Officer</b></span>
      </div>
    </div>
    <div class="col-md-3">Batch No <font style="color:red;">*</font></div>
    <div class="col-md-1">:</div>
    <div class="col-md-3">
      <label class="field prepend-icon">
        <input type="text" name="txt_batch" id="txt_batch" class="gui-input"  value="<?php 
        echo $row['batchno'];
        ?>
">
        <label for="txt_batch" class="field-icon">
          <i class="fa fa-calculator"></i>
        </label>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Quantity Received <font style="color:red;">*</font></div>
    <div class="col-md-1">:</div>
    <div class="col-md-3">
      <label class="field prepend-icon">
        <input type="text" name="txt_quantity" id="txt_quantity" class="gui-input" value="<?php 
        echo $row['quantity'];
        ?>
">
        <label for="txt_quantity" class="field-icon">
          <i class="fa fa-calculator"></i>
        </label>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Dosage</div>
    <div class="col-md-1">:</div>
    <div class="col-md-4">
      <label class="field select">
        <select id="txt_dosage">
          <?php 
        getDosage();
        ?>
        </select>
        <i class="arrow"></i>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Unit</div>
    <div class="col-md-1">:</div>
    <div class="col-md-4">
      <label class="field select">
        <select id="txt_unit">
          <?php 
        getSukatan();
        ?>
        </select>
        <i class="arrow"></i>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Expiry Date</div>
    <div class="col-md-1">:</div>
    <div class="col-md-3">
      <label class="field prepend-icon">
        <input type="text" name="txt_expiry" id="txt_expiry" class="gui-input" readonly <?php 
        if ($code == 6) {
            echo "value=\"" . displayDate($row['kp_tkh_luput']) . "\"";
        }
        ?>
>
        <label for="txt_expiry" class="field-icon">
          <i class="fa fa-calendar"></i>
        </label>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Received Date <font style="color:red;">*</font></div>
    <div class="col-md-1">:</div>
    <div class="col-md-3">
      <label class="field prepend-icon">
        <input type="text" name="txt_received" id="txt_received" class="gui-input" readonly <?php 
        if ($code == 6) {
            echo "value=\"" . displayDate($row['kp_tkh_htr']) . "\"";
        }
        ?>
>
        <label for="txt_received" class="field-icon">
          <i class="fa fa-calendar"></i>
        </label>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Expected Complete Day(s) <font style="color:red;">*</font></div>
    <div class="col-md-1">:</div>
    <div class="col-md-3">
      <label class="field prepend-icon">
        <input type="number" name="txt_complete" id="txt_complete" class="gui-input" <?php 
        if ($code == 6) {
            echo "value=\"" . $row['kp_complete_day'] . "\"";
        }
        ?>
>
        <label for="txt_complete" class="field-icon">
          <i class="fa fa-calculator"></i>
        </label>
      </label>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Sender <font style="color:red;">*</font></div>
    <div class="col-md-1">:</div>
    <div class="col-md-4">
      <label class="field prepend-icon">
        <input type="text" name="txt_sender" id="txt_sender" class="gui-input" <?php 
        if ($code == 6) {
            echo "value=\"" . $row['kp_sender'] . "\"";
        }
        ?>
>
        <label for="txt_sender" class="field-icon">
          <i class="fa fa-user"></i>
        </label>
      </label>
    </div>
  <?php 
    } else {
        ?>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Batch No</div>
    <div class="col-md-1">:</div>
    <div class="col-md-3"><?php 
        echo $row['kp_batch_no'];
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Quantity Received</div>
    <div class="col-md-1">:</div>
    <div class="col-md-3"><?php 
        echo $row['kp_kuantiti_htr'];
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Dosage</div>
    <div class="col-md-1">:</div>
    <div class="col-md-4"><?php 
        echo getSelDosage($row['kp_rdk_kod']);
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Unit</div>
    <div class="col-md-1">:</div>
    <div class="col-md-4"><?php 
        echo getSukatan($row['kp_rskt_kod']);
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Expiry Date</div>
    <div class="col-md-1">:</div>
    <div class="col-md-3"><?php 
        echo displayDate($row['kp_tkh_luput']);
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Received Date</div>
    <div class="col-md-1">:</div>
    <div class="col-md-3"><?php 
        echo displayDate($row['kp_tkh_terima']);
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Expected Complete Date</div>
    <div class="col-md-1">:</div>
    <div class="col-md-3"><?php 
        echo addDayswithdate($row['kp_tkh_terima'], $row['kp_complete_day']) . " (" . $row['kp_complete_day'] . " days)";
        ?>
</div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-3">Sender</div>
    <div class="col-md-1">:</div>
    <div class="col-md-4"><?php 
        echo $row['kp_sender'];
        ?>
</div>
  <?php 
    }
    ?>
  </div>
  <div class="row">
    <?php 
    if ($id == 19 || $id == 20) {
        ?>
      <div class="col-md-12">
        <div class="alert alert-sm alert-border-left alert-alert">Assign Sample</div>
      </div>
      <div class="col-md-3">Lab <font color="red">*</font></div>
      <div class="col-md-1">:</div>
      <div class="col-md-6">
        <select id="txt_lab" class="form-control">
            <option value='0'>-- Please Select --</option>
            <?php 
        getLab();
        ?>
        </select>
      </div>
      <div class="col-md-12">&nbsp;</div>
      <div class="col-md-3">Quantity <font color="red">*</font></div>
      <div class="col-md-1">:</div>
      <div class="col-md-3">
        <label class="field prepend-icon">
          <input type="text" name="txt_assign" id="txt_assign" class="gui-input">
          <label for="txt_assign" class="field-icon">
            <i class="fa fa-calculator"></i>
          </label>
        </label>
      </div>
      <div class="col-md-5">
        <button class="btn btn-alert" onclick="balance('<?php 
        echo $row['kp_id'];
        ?>
')"><i class="fa fa-plus"></i> Balance</button>
        <button class="btn btn-alert" onclick="assignSample('<?php 
        echo $sampleID;
        ?>
')"><i class="fa fa-pencil"></i> Assign Sample</button>
      </div>
      <div class="col-md-12">&nbsp;</div>
      <div class="col-md-12" id="sampleAssign"><?php 
        showTask($sampleID);
        ?>
</div>
      <div class="col-md-12">&nbsp;</div>
    <?php 
    } elseif ($id == 21 || $id == 23 || $id == 25 || $id == 27) {
        assignedTask($id, $sampleID, $_SESSION['ru_kod']);
    }
    if ($id != 27) {
        ?>
      <div class="col-md-12">&nbsp;</div>
      <div class="col-md-3"><?php 
        echo getComment($id);
        ?>
</div>
      <div class="col-md-1">:</div>
      <div class="col-md-6">
        <label class="field prepend-icon">
          <textarea class="gui-textarea" id="txt_comment" placeholder="Enter Comment..."><?php 
        echo getComments($id, $sampleID, $_SESSION['us_id']);
        ?>
</textarea>
          <label for="comment" class="field-icon">
            <i class="fa fa-comments"></i>
          </label>
          <span class="input-footer"><?php 
        echo getComment($id);
        ?>
</span>
        </label>
      </div>
      <div class="col-md-12"><font color="red">*</font> required field</div>
    <?php 
    }
    ?>
  </div>
  <div class="row">
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-12">
      <button class="btn btn-alert" onclick="content('<?php 
    echo $code;
    ?>
')"><i class="fa fa-arrow-left"></i> Back</button>
      <button class="btn btn-alert" onclick="showProduct('<?php 
    echo $code;
    ?>
')"><i class="fa fa-desktop"></i> Product Detail</button>
    <?php 
    if ($id == 16) {
        if (screenStatus($sampleID) != 1) {
            ?>
      <button class="btn btn-alert" onclick="receiveSample('<?php 
            echo $code;
            ?>
','<?php 
            echo $status;
            ?>
')"><i class="fa fa-check"></i> Receive Sample</button>
    <?php 
            if ($code == 1) {
                ?>
      <button class="btn btn-alert" onclick="rejectSample('<?php 
                echo $code;
                ?>
')"><i class="fa fa-close"></i> Reject Sample</button>
    <?php 
            }
        }
    } else {
        ?>
      <button class="btn btn-alert" onclick="printBarcode('<?php 
        echo $row['kp_sampel_no'];
        ?>
')"><i class="fa fa-print"></i> Print Barcode</button>
    <?php 
        if ($id == 23 and checkPharma($row['kp_id'], $_SESSION['ru_kod']) == 1) {
            ?>
      <button class="btn btn-alert" onclick="submitSample('<?php 
            echo $sampleID;
            ?>
','<?php 
            echo $row['kp_sampel_no'];
            ?>
','<?php 
            echo $code;
            ?>
')"><i class="fa fa-reply"></i> Send Back to Pharmacist</button>
    <?php 
        } elseif ($id == 25 and checkAssist($row['kp_id'], $_SESSION['ru_kod']) == 1) {
            ?>
      <button class="btn btn-alert" onclick="submitSample('<?php 
            echo $sampleID;
            ?>
','<?php 
            echo $row['kp_sampel_no'];
            ?>
','<?php 
            echo $code;
            ?>
')"><i class="fa fa-reply"></i> Send Back to Assistant Pharmacist</button>
    <?php 
        }
        ?>
      <button class="btn btn-alert" onclick="chronology(1,'<?php 
        echo $sampleID;
        ?>
')"><i class="fa fa-sort-alpha-asc"></i> Chronology</button>
    <?php 
        if ($id == 25 and checkAssist($row['kp_id'], $_SESSION['ru_kod']) == 1) {
            ?>
      <button class="btn btn-alert" onclick="approveAssist('<?php 
            echo $row['kp_id'];
            ?>
','<?php 
            echo $_SESSION['ru_kod'];
            ?>
','<?php 
            echo $code;
            ?>
')"><i class="fa fa-check"></i> Approve</button>
    <?php 
        } elseif ($id == 23 and checkPharma($row['kp_id'], $_SESSION['ru_kod']) == 1) {
            ?>
      <button class="btn btn-alert" onclick="approvePharma('<?php 
            echo $row['kp_id'];
            ?>
','<?php 
            echo $_SESSION['ru_kod'];
            ?>
','<?php 
            echo $code;
            ?>
')"><i class="fa fa-check"></i> Approve</button>
    <?php 
        } elseif ($id == 21) {
            ?>
      <button class="btn btn-alert" onclick="approveKU('<?php 
            echo $row['kp_id'];
            ?>
','<?php 
            echo $_SESSION['ru_kod'];
            ?>
','<?php 
            echo $code;
            ?>
')"><i class="fa fa-check"></i> Approve</button>
    <?php 
        } else {
            ?>
      <button class="btn btn-alert" onclick="submitSample('<?php 
            echo $sampleID;
            ?>
','<?php 
            echo $row['kp_sampel_no'];
            ?>
','<?php 
            echo $code;
            ?>
')"><i class="fa fa-send"></i> Submit</button>
    <?php 
        }
    }
    ?>
    </div>
  </div>
</div>
<?php 
}