<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false" 
     id="drVisitsModel" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds90">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close closeDrug" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title txtc"> {$doctorName} </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form class="form-horizontal" role="form" action="" method="post" id="gynaDrugs" enctype="multipart/form-data">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="portlet blue-hoki box">

                                    <div class="portlet-body  scroll_y showNum isheight" style="padding: 0 7px 0  7px;">
                                        <table class="table table-striped table-hover table-bordered"  id="repTable"
                                               style="direction: rtl;">
                                            <thead>
                                                <tr>
                                                    <th class="txtc">م</th>
                                                    <th class="txtc" style="width: 50px;"> التاريخ </th>
                                                    <th class="txtc" style="width: 40px;"> الوقت  </th>
                                                    <th>   RFC </th>
                                                    <th class="txtc" style="width: 150px;">اسم الحالة</th>
                                                    <th class=" txtc">رقم الحالة</th>
                                                    <th class="txtc"> الموبايل  </th>
                                                    {if $confirmed ==  1} 
                                                    <th class="txtc">وقت الوصول   </th>
                                                    <th class="txtc">وقت الحضور  </th>
                                                    {else if $attended ==  1} 
                                                    <th class="txtc">وقت الوصول   </th>
                                                    <th class="txtc">وقت الحضور  </th>
                                                    <th class="txtc">وقت الكشف  </th>
                                                    {else}
                                                    <th class="txtc">وقت الوصول   </th>
                                                    {/if}

                                                    <th class="txtc"> نوع الكشف </th>
                                                    <th class="txtc" style="width: 40px;"> القسم </th>
                                                    {if $programesetting->system_lang  == 1}    
                                                    <th class="txtc"> المريض </th>
                                                    {/if}
                                                    {if $attended ==  1} 
                                                    <th class="txtc"> الإنتظار  </th>
                                                    {/if}
                                                </tr>
                                            </thead>
                                            <tbody>
                                                {assign var=i value=1}
                                                {foreach $visits as $row}
                                                <tr>
                                                    <td> {$row.visit_order}</td>
                                                    <td> {$row.visitdate}</td>
                                                    <td> {$row.visit_time}</td>
                                                    <td>{$row.rfc}</td>
                                                    <td>     
                                                        <ul style="padding-right: unset;"> 
                                                            <li>{$row.patientName}</li>
                                                            <li>{$row.husbandName}</li>
                                                        </ul> 
                                                    </td>

                                                    <td> {$row.statusno}</td>

                                                    <td>     
                                                        <ul style="padding-right: unset;"> 
                                                            <li>{$row.phone}</li>
                                                            <li>{$row.mobile}</li>
                                                        </ul> 
                                                    </td>

                                                    {if $confirmed ==  1} 
                                                    <td>{$row.arrivedTime}   </td>
                                                    <td>{$row.recep_p_exit}   </td>
                                                    {else if $attended ==  1} 
                                                    <td>{$row.arrivedTime}   </td>
                                                    <td>{$row.recep_p_exit}   </td>
                                                    <td> {$row.kashf_enterance}  </td>
                                                    {else}

                                                    {if $row.arrived_userid > 0} 
                                                    <td  id="arrivedHos{$row.visitId}" >{$row.arrivedTime}   </td>
                                                    {else}
                                                    <td  id="arrivedHos{$row.visitId}">       
                                                        <a class="btn btn-primary  btn-sm    arrivedHos" data-id="{$row.visitId}"     
                                                           > وصول    </a>  
                                                    </td>
                                                    {/if}

                                                    {/if}

                                                    <td> {$row.detectionName}</td>
                                                    <td> {$row.deptName}</td>
                                                    {if $programesetting->system_lang  == 1}    
                                                    <td> {if $row->for_husband eq 1} الزوج{else} الزوجه{/if}</td>
                                                    {/if}
                                                    {if $attended ==  1} 
                                                    <td style="direction: ltr;"> {$row.waiting}</td>
                                                    {/if}
                                                </tr>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}
                                            </tbody>
                                        </table>

                                        {if $attended ==  1} 
                                        <table class="table table-striped table-hover table-bordered">
                                            <td> {$waitingAvg}</td>
                                            <th>متوسط وقت الإنتظار </th>
                                        </table>
                                        {/if}
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


{literal}
<script type="text/javascript" >
    $('#repTable').dataTable({
        dom: 'Blfrtip',
        buttons: [
            {
                extend: 'excel'
                , text: 'excel '
                , title: 'Cases  Excel'
            }
        ],
        "lengthMenu": [
            [10, 25, 50, 100, 150, -1],
            [10, 25, 50, 100, 150, "All"] // change per page values here
        ],
        //     "scrollX": true
    });


</script>
{/literal}