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


<input disabled type="hidden" id="recNum" value="<?php echo $rec ?>"/>
<?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>
            </tr>
            </tr>
        </thead>
        <tbody>

            <?php
            foreach ($query as $qry => $row):
                ?>
                <tr>
                    <td><?= ($qry + 1) + $offset ?></td>
                    <td><?= $row['pi_num'] ?></td>                                    
                    <td><?= $row['pi_num2'] ?></td>
                    <td><?= date('Y-m-d', $row['pi_date_reg']) ?></td>
                    <td><?= $row['pi_name'] . ' ' . $row['pi_father'] . ' ' . $row['pi_family'] ?></td>   
                    <td><?= date('Y-m-d', $row['pi_borndate']) ?></td>   
                    <td><?= $row['branch_name'] ?></td>   
                    <td><?php echo ($row['pi_gender'] == 1) ? 'ذكر' : 'أنثي'; ?></td> 
                    <td><?= date('Y-m-d', $row['pi_created']) ?></td>

                    <td class="align-center">
                        <a href="<?= base_url() ?>patient/admin_photos/overview/<?= $row['pi_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_patient/edit/<?= $row['pi_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_patient/export_onepatient_reprt/<?= $row['pi_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 href="<?= base_url() ?>patient/admin_patient/remove/<?= $row['pi_id']; ?>" onclick="return confirm('هل تريد حذف هذا العنصر؟');"><img src="<?= base_url() ?>global/modules/admin/images/del.png" width="16" height="16" title="<?php echo $this->lang->line('delete'); ?>" alt="حذف"  /></a>                                        
                    </td>
                </tr>

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