<input type="hidden" id="controllName" value="adddevices"/>

<table class="table table-bordered table-striped table-hover " >
    <thead>
        <tr>
            <th>اليوم : </th>
            <td> {$dayName}</td>
            <th> التاريخ :  </th>
            <td> {$dayDate}</td>
        </tr>
        <tr><td colspan="4"> Operation List </td></tr>
    </thead>
</table>


<div      style="max-width: 1650px;max-height: 600px;overflow: auto;white-space: nowrap;">   
    <table class="table table-bordered table-striped table-hover " >
        <thead>
            <tr>
                <th>م</th>
                <th>رقم الحالة</th>
                <th> اسم الحالة  </th>
                <th> الطبيب  </th>
                <th>نوع العملية    </th>
                {if $allowCostCol  == 1} <th> التكلفة  </th> {/if}
                <th> وقت الحالة </th>
                <th> وصول  </th>
                <th> الدخول </th>
                <th> الخروج </th>
                <th> دخول الكشف  </th>
                <th> خروج  الكشف  </th>
                <th> دخول الإقامة   </th>
                <th> ملاحظات</th>
                <th> مكالمة </th>
                <th> الموظف </th>
                {if $allowEditVisit  == 1}   <th class="wds3"> </th>  {/if}
                {if $allowDeleteVisit  == 1}   <th class="wds3"> </th>  {/if}
            </tr>
        </thead>
        <tbody>
            {assign var=i value=1}
            {foreach $visitsAll as $lab}

            <tr  {if $lab.minutes > 60 } style="background-color: #eec5c0;"   {/if}>
                <td> {$i}</td>

                {if  $lab.patientId > 0 }

                <td> {$lab.statusno}</td>
                <td> 
                    <ul style="margin-bottom: 22px;">
                        <li style="float: right;    margin-right: -15%;">{$lab.wifename}</li>
                    </ul>
                    <ul style="margin-bottom: 22px;">
                        <li style="float: right;    margin-right: -15%;">{$lab.husdandname}</li>
                    </ul>
                </td>

                {else}
                <td>      
                    <input type="text" class="form-control updateElement"   data-id="{$lab.id}"
                           data-colName="status_no"  data-tableName="{$lab.tableName}" 
                           value="{$lab.status_no}"  id="status_no{$lab.id}" /> 
                </td>

                <td>      
                    <input type="text" class="form-control updateElement"   data-id="{$lab.id}"
                           data-colName="patient_name"  data-tableName="{$lab.tableName}" 
                           value="{$lab.patientName}"   id="patient_name{$lab.id}" /> 
                </td>
                {/if}


                <td> {$lab.drName}</td>
                <td> {$lab.detectionType}</td>
                {if $allowCostCol  == 1}
                <td>      
                    <input type="text" class="form-control updateElement"   data-id="{$lab.id}"
                           data-colName="case_cost"  data-tableName="{$lab.tableName}"    id="case_cost{$lab.id}"
                           value="{$lab.case_cost}" style="width: 50px !important;" /> 
                </td>
                {/if}
                <td>      
                    <input type="text" class="form-control updateElement"   data-id="{$lab.id}"
                           data-colName="case_time"  data-tableName="{$lab.tableName}"    id="case_time{$lab.id}"
                           value="{$lab.case_time}" style="width: 50px !important;" /> 
                </td>

                <td  id="arrived_time{$lab.id}">
                    {$lab.arrived_time}
                    <a class="btn blue-hoki btn-sm    arrivedOperation" data-id="{$lab.id}"     
                       data-btn="manualOperationSearchBtn"   id="arrivedOperation{$lab.id}"  
                       {if $lab.arrived_userid  > 0 || $allowArriveBtn  != 1  }  style="display: none;"  {/if}   > وصول   
                    </a>
                </td>

                <td  id="enter_time{$lab.id}">     
                    {$lab.enter_time}
                    <a class="btn blue-hoki btn-sm    enterOperation" data-id="{$lab.id}"    
                       data-btn="manualOperationSearchBtn"   id="enterOperation{$lab.id}"      
                       {if $lab.enter_userid  > 0  || $allowRecEnterBtn  != 1  }  style="display: none;"  {/if}   > دخول   
                    </a>
                </td>

                <td  id="exit_time{$lab.id}">
                    {$lab.exit_time}
                    <a class="btn blue-hoki btn-sm    exitOperation" data-id="{$lab.id}"    
                       data-btn="manualOperationSearchBtn"   id="exitOperation{$lab.id}"        
                       {if $lab.exit_userid  > 0  || $allowRecExitBtn  != 1  }  style="display: none;"  {/if}   > خروج   
                    </a>
                </td>

                <td> {$lab.kashfEnter}</td>

                <td  id="kashf_exit_time{$lab.id}">
                    {$lab.kashf_exit_time}
                    <a class="btn blue-hoki btn-sm    kashfExitOperation" data-id="{$lab.id}"    
                       data-btn="manualOperationSearchBtn"   id="kashfExitOperation{$lab.id}"        
                       {if $lab.kashf_exit_userid  > 0 }  style="display: none;"  {/if}   > خروج   
                    </a>
                </td>

                <td> {$lab.resEnter}</td>


                <td>      
                    <textarea class="form-control txtc updateElement" rows="1" data-id="{$lab.id}" 
                              data-colName="case_note" data-tableName="{$lab.tableName}" placeholder="ملاحظات"
                              data-toggle="popover" data-trigger="hover" data-placement="bottom"     id="case_note{$lab.id}"
                              data-content="{$lab.case_note}" style="width: 95px !important;">{$lab.case_note}
                    </textarea>
                </td>          
                <td>      
                    <input type="text" class="form-control updateElement"   data-id="{$lab.id}"
                           data-colName="case_call"  data-tableName="{$lab.tableName}"     id="case_call{$lab.id}"
                           value="{$lab.case_call}" style="width: 50px !important;" /> 
                </td>
                {if $lab.enter_userid  > 0 } 
                <td  id="enter_userid{$lab.id}"> {$lab.enter_userName}</td>
                {else}
                <td  id="enter_userid{$lab.id}"> </td>
                {/if}

                {if $allowEditVisit  == 1}  
                <td>
                    <a class=" bg-green dltbtn  editManualOp" data-id="{$lab.id}"  id="editManualOp{$lab.id}" > 
                        <i class="fa fa-pencil"></i></a>
                </td>
                {/if}

                {if $allowDeleteVisit  == 1}  
                <td>
                    <a class="btn grey-cascade btn-xs deletemsgEX delManualOp" data-id="{$lab.id}" 
                       style=" float: left;" href="#" data-link="adddevices" data-fn="del" data-tableName="manual_operation">
                        <i class="fa fa-close"></i>
                    </a>
                </td>
                {/if}
            </tr>
            {capture assign=i}{$i+1}{/capture}
            {/foreach}
        </tbody>
    </table>

</div>