<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="editVisitModal" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds95" style="max-width: 90%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form class="form-horizontal" role="form" action="" method="post" id="updateVisitForm">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="portlet blue-hoki box">
                                    <div class="portlet-body">
                                        <input type="hidden" id="mVisitId" value="" name="mVisitId"/>
                                        <div class="row" style="padding-left: 9px;padding-top:5px;overflow-y: scroll;">
                                            <table class="table table-bordered  table-hover rtl" style="margin-bottom: 0px;">
                                                <tr>
                                                    <th style="width: 10%;">رقم المريضة</th>
                                                    <th colspan="2" style="width: 50%;">اسم المريضة</th>
                                                    <th style="width: 10%;"> تاريخ الزيارة </th>
                                                    {if $programesetting->visitsform  != 1}
                                                    <th style="width: 15%;">نوع الكشف</th>
                                                    <th style="width: 10%;">قيمة الكشف</th>
                                                    {else}
                                                    <th style="width: 25%;">القسم</th>
                                                    {/if}
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <input type="hidden" id="patientvisitidNo" >

                                                    </td>
                                                    <td colspan="2">
                                                        <select  class="form-control  patientvisitidCheck" name="patientid" id="patientvisitid" placeholder="اختر المريضة " required="required">
                                                            <option value=""></option>
                                                            {foreach $allPatients as $row}
                                                            <option value="{$row->id}" {if $patientid == {$row->id}}selected{/if}>{$row->wifename} - {$row->husdandname}</option>
                                                            {/foreach}

                                                        </select>
                                                    </td>
                                                    <td>
                                                        <input class="form-control patientvisitidCheckDate  datepicker edited"  type="text"  id="visitdate" name="visitdate" required value="{$today}">
                                                    </td>

                                                    {if $programesetting->visitsform  != 1}
                                                    <td>
                                                        <select  class="form-control " name="detectionid" id="detectionid" placeholder="اختر نوع الكشف " required select-tableName="visits" data-tableName="visits" data-maintable = "detections" data-colName="detectionid" data-id="0">
                                                            <option value=""></option>
                                                            {assign var=i value=1}
                                                            {foreach $allDetections as $row}
                                                            {if $i == 1}{assign var=k value={$row->detectionval}}{/if}
                                                            <option value="{$row->id}" {if $i == 1}selected{/if}>{$row->title}</option>
                                                            {capture assign=i}{$i+1}{/capture}
                                                            {/foreach}
                                                            <option value="-1">إضافة كشف</option>
                                                            {if $smarty.session.role_id neq 3}<option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <input  class="form-control digitsOnly"  type="text"  id="detectionvalue" value="{$k}" name="detectionvalue" required="required">
                                                    </td>
                                                    {else}
                                                    <td colspan="2">
                                                        <select  class="form-control " name="detectionid" id="detectionid" placeholder="اختر القسم " required select-tableName="visits" data-tableName="visits" data-maintable = "detections" data-colName="detectionid" data-id="0">
                                                            <option value=""></option>
                                                            {assign var=i value=1}
                                                            {foreach $allDetections as $row}
                                                            {if $i == 1}{assign var=k value={$row->detectionval}}{/if}
                                                            <option value="{$row->id}" {if $i == 1}selected{/if}>{$row->title}</option>
                                                            {capture assign=i}{$i+1}{/capture}
                                                            {/foreach}
                                                            <option value="-1">إضافة قسم</option>
                                                            {if $smarty.session.role_id neq 3}<option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                        </select>
                                                    </td>

                                                    {/if}
                                                </tr>
                                            </table>
                                            <table class="table table-bordered  table-hover rtl">
                                                <tr>
                                                    <th style="width: 45%;">القسم</th>
                                                    <th id="invTypeHead" style="display: none; width: 10%;">النوع</th>
                                                    <th id="doctors_containers_head" style="display: none; width: 25%;">الاطباء</th>
                                                    <th id="time_containers_head" style="display: none; width: 25%;">وقت العمليه</th>
                                                    <th style="width: 10%;">Husband</th>
                                                    <th style="width: 10%;"></th>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <input type="hidden"    id="oldVisitDoctor"  value="0">
                                                        <select class="form-control" style="width: 75%;"  name="fordepartment" id="fordepartment" placeholder="اختر القسم " required >
                                                            {foreach $py_all_departs as $row}
                                                            {if $smarty.session.role_id eq 12}
                                                            {if $row->id eq 12}
                                                            <option value=""></option>
                                                            <option value="{$row->id}">{$row->name}</option>
                                                            {/if}
                                                            {elseif $smarty.session.role_id eq 5}
                                                            {if $row->id eq 5}
                                                            <option value=""></option>
                                                            <option value="{$row->id}">{$row->name}</option>
                                                            {/if}
                                                            {else}
                                                            <option value="{$row->id}">{$row->name}</option>
                                                            {/if}
                                                            {/foreach}
                                                        </select>
                                                    </td>
                                                    <td id="invTypeDiv" style="display: none;">
                                                        <input type="hidden"  name="roleId"  id="roleId"  value="{$smarty.session.role_id}">
                                                        <select  class="form-control" name="invType" id="invType" placeholder="اختر نوع " required>
                                                            <option value="0"   {if $programesetting->visittype  == 0} selected  {/if}>خارجى</option>
                                                            <option value="1"  {if $programesetting->visittype  == 1} selected  {/if}>داخلى</option>
                                                        </select>
                                                    </td>
                                                    <td id="doctors_containers" style="display: none;">
                                                        <select  class="form-control" name="for_doctor" id="for_doctor" placeholder="اختر طبيب " required>

                                                        </select>
                                                    </td>
                                                    <td id="time_containers" style="display: none;">
                                                        <input type="text" class="form-control timepicker timepicker-24"  name="operation_time" id="operation_time">
                                                    </td>
                                                    <td>
                                                        <input type="checkbox"  name="for_husband" id="forHusband" value="1"></span>
                                                    </td>
                                                    <td>
                                                        <input type="submit" name="submit" id="visitaddsubmit"  {if $found == 1}disabled="disabled"{/if}  class="btn blue btnsve addbtnvisit wds100" value="إضافة" />
                                                    </td>
                                                </tr>
                                            </table>

                                            <input type="hidden"  name="itr"  id="itr"  value="0">
                                            <input type="hidden"  name="itr_offer"  id="itr_offer"  value="0">

                                            <div class="col-md-12" id="selectedFromModel">

                                            </div>

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

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