<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
?>

<a href="<?= base_url() ?>patient/admin_checkupinfo/filter_dylayed" class="button sub inlineBlock rnd3 lightTextShadow">
    <span>المعاينات المعلقة</span>
</a>
<input disabled type="hidden" id="recNum" value="<?php echo $rec->num_rows ?>"/>
<?php if ($query == FALSE) : ?>
    <br/>
    <p class="block boxStyle notice attention"><a href="javascript:void(0)" class="close"></a><b>تنبيه!</b>لا توجد بيانات مضافة<p>
    <?php else : ?>
    <table  cellspacing="1" cellpadding="1" class="dataGrid">
        <thead>
            <tr>
                <th>مسلسل</th>
                <th>تاريخ المعاينة</th>
                <th>تاريخ المعاينة القادمة</th>
                <th>رقم الحالة</th>
                <th>اسم المريض</th>
                <th>التكلفة</th>
                <th>نوع المعاينة</th>
                <th>الفرع</th>
                <th>الاجراءات</th>
    <!--                            <th>ترتيب</th>-->
                <th>خيارات</th>
            </tr>
        </thead>
        <tbody>

            <?php foreach ($query as $qry => $row): ?>
                <tr>
                    <td><?= ($qry + 1) + $offset ?></td>
                    <td><?= date("Y-m-d", $row['chi_date']) ?></td>
                    <td><?php
                        if ($row['chi_nextdate'] !== "0") {
                            echo date("Y-m-d", $row['chi_nextdate']);
                        } else {
                            echo "";
                        }
                        ?></td>
                    <td><?= $row['chi_pi_id'] ?></td>
                    <td><?= $row['pi_name'] . " " . $row['pi_father'] . " " . $row['pi_family'] ?></td>
                    <td><?= $row['chi_cost'] ?></td>
                    <td><?= $row['type_name'] ?></td>
                    <td><?= $row['branch_name'] ?></td>
                    <td><?= $row['chi_steps'] ?></td>
                    <td class="align-center">
                        <a href="<?= base_url() ?>patient/admin_files/overview/<?= $row['chi_id'] ?>" ><img src="<?= base_url() ?>global/modules/admin/images/add_images.png" title="رفع المستندات" alt="up"/></a>&nbsp;&nbsp; | &nbsp;&nbsp;
                        <a href="<?= base_url() ?>patient/admin_checkupinfo/edit/<?= $row['chi_id']; ?>"><img src="<?= base_url() ?>global/modules/admin/images/edit2.png" width="16" height="16" title="<?php echo $this->lang->line('edit'); ?>" alt="تعديل" /></a>&nbsp;&nbsp; | &nbsp;&nbsp;
                        <a href="<?= base_url() ?>patient/admin_checkupinfo/export_onecheckupinfo_reprt/<?= $row['chi_id']; ?>" ><img src="<?= base_url() ?>global/modules/admin/images/pdf_document.png" width="16" height="16" title="<?php echo $this->lang->line('export'); ?>" alt="'استخراج"  /></a> | &nbsp;&nbsp;
                       <a onclick="return confirm('هل تريد حذف هذا العنصر؟');" href="<?= base_url() ?>patient/admin_checkupinfo/remove/<?= $row['chi_id']; ?>">
                            <img width="16" height="16" alt="حذف" title="حذف" src="<?php echo base_url(); ?>global/modules/admin/images/del.png"></a>

                    </td>
                </tr>

            <?php endforeach; ?>
        </tbody>
    </table>
<?php endif; ?>
