<div>
    <h3 class="text-center" style="direction: rtl;">عمليات يوم
        {if {$fdate|date_format:"%A"} eq 'Saturday'} السبت
        {elseif {$fdate|date_format:"%A"} eq 'Sunday'} الاحد
        {elseif {$fdate|date_format:"%A"} eq 'Monday'} الاثنين
        {elseif {$fdate|date_format:"%A"} eq 'Tuesday'} الثلاثاء
        {elseif {$fdate|date_format:"%A"} eq 'Wednesday'} الاربعاء
        {elseif {$fdate|date_format:"%A"} eq 'Thursday'} الخميس
        {elseif {$fdate|date_format:"%A"} eq 'Friday'} الجمعه
        {/if}
        الى
        {if {$todate|date_format:"%A"} eq 'Saturday'} السبت
        {elseif {$todate|date_format:"%A"} eq 'Sunday'} الاحد
        {elseif {$todate|date_format:"%A"} eq 'Monday'} الاثنين
        {elseif {$todate|date_format:"%A"} eq 'Tuesday'} الثلاثاء
        {elseif {$todate|date_format:"%A"} eq 'Wednesday'} الاربعاء
        {elseif {$todate|date_format:"%A"} eq 'Thursday'} الخميس
        {elseif {$todate|date_format:"%A"} eq 'Friday'} الجمعه
        {/if}

        بتاريخ
        {$fdate|date_format:"%Y/%m/%d"}
        الي
        {$todate|date_format:"%Y/%m/%d"}
    </h3>
</div>
<table class="table table-hover portlet light bg-inverse" id="repTable" style="direction: rtl;text-align: center;">
    <thead>
        <tr>
            <th class="wds1">
                م
            </th>
            <th>
                اسم الحالة
            </th>
            <th class="wds13">
                الطبيب المعالج
            </th>
            <th class="wds15">
                نوع العمليه
            </th>
            <th class="wds10">
                رقم الغرفة
            </th>
            <th class="wds10">
                الدخول
            </th>
            <th class="wds10">
                الخروج
            </th>
            <th class="wds5">
                رقم الملف
            </th>
            <th class="wds7">
                التوقيت
            </th>
            <th class="wds5">
                الترتيب
            </th>
            <th class="wds5">
                الحضور 
            </th>

        </tr>
    </thead>
    <tbody>
        {assign var="i" value="1"}
        {foreach $allData as $data}
        <tr class="odd " id="operationTr{$data.visit_id}" {if $data.attend == 1} style="background-color: #d8eac6 ;" {/if}  >
            <td>{$i}</td>
            <td>
                <a href="{$hosturl}/controllers/patients.php?ac=edit&id={$data.patientid}" target="_new">
                    {if  $data.for_husband == 1 }
                    {$data.husdandname}
                    {else}
                    {$data.wifename}
                    {/if}
                </a>
            </td>
            <td>
                {$data.for_doctor_name}
            </td>
            <td>
                {$data.type}
            </td>
            <td>
                <input type="text" class="form-control updateElement" data-id="{$data.visit_id}"  
                       data-colName="room_no" data-tableName="visits"
                       value="{$data.room_no}">
            </td>
            <td>
                <input type="text" class="form-control updateElement" data-id="{$data.visit_id}"  
                       data-colName="enterance" data-tableName="visits"
                       value="{$data.enterance}">
            </td>
            <td>
                <input type="text" class="form-control updateElement" data-id="{$data.visit_id}"  
                       data-colName="p_exit" data-tableName="visits"
                       value="{$data.p_exit}">
            </td>
            <td>
                {$data.statusno}
            </td>
            <td style="direction: ltr;">
                {$data.operation_time|date_format:'%I:%M %p'}
            </td>
            <td>
                <input type="text" class="form-control updateElement" data-id="{$data.visit_id}"  
                       data-colName="printorder" data-tableName="visits"
                       value="{$data.printorder}">
            </td>

            <td>
                <!-- Rounded switch -->
                <input type="checkbox"  value="1" class="form-control operation_attend" 
                       data-id="{$data.visit_id}"   data-colName="operation_attend" 
                       data-tableName="visits"
                       {if $data.attend == 1} checked {/if} >
            </td>
        </tr>
        {assign var="i" value={$i+1}}
        {/foreach}

    </tbody>
</table>








{literal}
<script type="text/javascript" >
    $('#repTable').dataTable();
</script>
{/literal}