<?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">
        <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><?= date("Y-m-d", $row['chg_date']) ?></td>                               
                <td><?= $row['chg_pi_id'] ?></td>                                    
                <td><?= $row['pi_name'] . " " . $row['pi_father'] . " " . $row['pi_family'] ?></td>                                    
                <td><?= $row['chg_cost'] ?></td>                                    
                <td><?= $row['chg_type'] ?></td>                                    
                <td><?= $row['branch_name'] ?></td>                                    
                <td><?= $row['chg_steps'] ?></td>                                    
                <td><?= date('Y-m-d', $row['chg_created']) ?></td>
                <td class="align-center">     
                    <a href="<?= base_url() ?>charge/admin_files/overview/<?= $row['chg_id'] ?>" ><img src="<?= base_url() ?>global/modules/admin/images/add_images.png" title="رفع المستندات" alt="up"/></a>&nbsp;&nbsp; | &nbsp;&nbsp;
                    <a href="<?= base_url() ?>charge/admin_charge/edit/<?= $row['chg_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() ?>charge/admin_charge/export_onecharge_reprt/<?= $row['chg_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>
                </td>            </tr>

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