<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-users"></i>Operation Report
                        </div>
                    </div>
                    <div class="portlet-body all">
                        <input type="hidden" id="reportPage" value="1"/>
                        <input type="hidden" id="tdate" value="{$today}">
                        <input type="hidden" id="controllName" value="operationreport"/>
                        <!--Begin Semen-->

                        <div class="row">
                            <div class="row clinick posre">
                                <div class="col-md-3">
                                    <div class="form-group form-md-line-input form-md-floating-label has-info">
                                        <input type="text" class="form-control datepicker txtc finSearch" id="findate" value="{$today}"/>
                                        <label for="form_control_1">Date From </label>
                                    </div>
                                </div>
                                <div class="col-md-3"></div>
                                <div class="col-md-3">
                                    <div class="form-group form-md-line-input form-md-floating-label has-info">
                                        <input type="text" class="form-control datepicker txtc finSearch" id="tofindate" value="{$today}"/>
                                        <label for="form_control_1">Date To </label>
                                    </div>
                                </div>

                            </div>

                            <div class="clearfix"></div>

                            <div class="portlet box white">
                                <div class="portlet-title">
                                    <div class="actions">
                                        <a class="btn btn-default btn-sm" id="printfi" >
                                            <i class="fa fa-print"></i> Print </a>

                                    </div>
                                </div>

                                <div class="portlet-body form" id="financialDiv">
                                    <div>
                                        <h3 class="text-center" style="direction: rtl;">عمليات يوم
                                            {if {$today|date_format:"%A"} eq 'Saturday'} السبت
                                            {elseif {$today|date_format:"%A"} eq 'Sunday'} الاحد
                                            {elseif {$today|date_format:"%A"} eq 'Monday'} الاثنين
                                            {elseif {$today|date_format:"%A"} eq 'Tuesday'} الثلاثاء
                                            {elseif {$today|date_format:"%A"} eq 'Wednesday'} الاربعاء
                                            {elseif {$today|date_format:"%A"} eq 'Thursday'} الخميس
                                            {elseif {$today|date_format:"%A"} eq 'Friday'} الجمعه
                                            {/if}
                                            بتاريخ {$today|date_format:"%Y/%m/%d"} </h3>
                                    </div>
                                    <table class="table table-hover portlet light bg-inverse " id="controllpropr" 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>


                                </div>

                                <div class="row">
                                    <div class="col-md-3 pull-right">
                                        <div class="form-group ">
                                            <label class="col-md-4 pull-right text-right" style="padding-right: 5px;">النائب</label>
                                            <div class="col-md-8 pull-right">
                                                <select class="form-control operation_rslt" id="nab_1_users" placeholder="أختر .. ">
                                                    <option value=""></option>
                                                    {foreach $all_users_th as $user}
                                                    {if $user.role_id eq 4}
                                                    <option value="{$user.user_id}" >{$user.name}</option>
                                                    {/if}
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>

                                    </div>

                                    <div class="col-md-3 pull-right">
                                        <div class="form-group ">
                                            <label class="col-md-4 pull-right text-right" style="padding-right: 5px;">المعمل</label>
                                            <div class="col-md-8 pull-right">
                                                <select class="form-control operation_rslt" id="lab_1_users" placeholder="أختر .. ">
                                                    <option value=""></option>
                                                    {foreach $all_users_th as $user}
                                                    {if $user.role_id eq 12}
                                                    <option value="{$user.user_id}" >{$user.name}</option>
                                                    {/if}
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-md-3 pull-right">
                                        <div class="form-group ">
                                            <label class="col-md-4 pull-right text-right" style="padding-right: 5px;">التخدير</label>
                                            <div class="col-md-8 pull-right">
                                                <select class="form-control operation_rslt" id="sleep_1_users" placeholder="أختر .. ">
                                                    <option value=""></option>
                                                    {foreach $all_users_th as $user}
                                                    {if $user.role_id eq 7}
                                                    <option value="{$user.user_id}" >{$user.name}</option>
                                                    {/if}
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>

                                    </div>

                                    <div class="col-md-3 pull-right">
                                        <div class="form-group ">
                                            <label class="col-md-4 pull-right text-right" style="padding-right: 5px;">الجراح</label>
                                            <div class="col-md-8 pull-right">
                                                <select class="form-control operation_rslt" id="sug_1_users" placeholder="أختر .. ">
                                                    <option value=""></option>
                                                    {foreach $all_users_th as $user}
                                                    {if $user.role_id eq 4}
                                                    <option value="{$user.user_id}" >{$user.name}</option>
                                                    {/if}
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>

                                    </div>

                                    <div class="clearfix" style="margin:  6px;"></div>
                                    <div class="col-md-3 pull-right">
                                        <div class="form-group ">
                                            <label class="col-md-4 pull-right text-right" style="padding-right: 5px;">النائب</label>
                                            <div class="col-md-8 pull-right">
                                                <select class="form-control operation_rslt" id="nab_2_users" placeholder="أختر .. ">
                                                    <option value=""></option>
                                                    {foreach $all_users_th as $user}
                                                    {if $user.role_id eq 4}
                                                    <option value="{$user.user_id}" >{$user.name}</option>
                                                    {/if}
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>

                                    </div>

                                    <div class="col-md-3 pull-right">
                                        <div class="form-group ">
                                            <label class="col-md-4 pull-right text-right" style="padding-right: 5px;">المعمل</label>
                                            <div class="col-md-8 pull-right">
                                                <select class="form-control operation_rslt" id="lab_2_users" placeholder="أختر .. ">
                                                    <option value=""></option>
                                                    {foreach $all_users_th as $user}
                                                    {if $user.role_id eq 12}
                                                    <option value="{$user.user_id}" >{$user.name}</option>
                                                    {/if}
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>

                                    </div>

                                    <div class="clearfix" style="margin:  6px;"></div>


                                </div>
                            </div>
                        </div>

                    </div>

                    <!--End Semen-->


                    <div class="clearfix"></div>

                </div>
            </div>
        </div>
    </div>
</div>

<div class="clearfix"></div>
<div id="financialPrint"></div>
