<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
    <div class="page-content">
        <!-- BEGIN PAGE HEADER-->
        <h3 class="page-title">
            {$shcontrollname}
        </h3>
        <div class="page-bar">
            <ul class="page-breadcrumb">
                {$breadcrumbs}
            </ul>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <div class="portlet light bg-inverse">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="icon-equalizer font-red-sunglo"></i>
                            <span class="caption-subject font-red-sunglo bold uppercase">Edit in {$shcontrollname}</span>
                        </div>
                        <div class="actions">
                            <a class="btn default btn-xs blue tooltips" href="{$hosturl}/controllers/{$controllname}.php?ac=show" data-container="body" data-placement="top" data-original-title="Show">
                                <i class="icon-list"></i>
                                Show items
                            </a>
                        </div>
                    </div>
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->
                        <form action="{$hosturl}/controllers/{$controllname}.php?ac=updateit" method="post" class="form-horizontal" id="role_form">
                            <div class="form-body">
                                <div class="alert alert-danger display-hide">
                                    <button class="close" data-close="alert"></button>
                                    You have errors, see it again.
                                </div>
                                <div class="alert alert-success display-hide">
                                    <button class="close" data-close="alert"></button>
                                    You are good, GO ON.
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-11">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="fa fa-users"></i>
                                            </span>
                                            <input type="text" class="form-control" placeholder="Role name" name="name" value="{$role->name}">
                                            <label for="form_control_1">Role name </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" data-content=' اسم القسم '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-11">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="fa fa-users"></i>
                                            </span>
                                            <select  class="form-control input-xlarge select2me input-sm select2-multiple noborder"   name="related_dr_depts[]" multiple >
                                                <option value=""></option>
                                                {foreach $roles as $single}
                                                <option value="{$single->id}"   {if in_array($single->id, $drRoles)} selected="selected" {/if} >{$single->name}</option>
                                                {/foreach}
                                            </select>
                                            <label for="form_control_1">Roles of  Members appear in doctors select  in  visits add </label>
                                        </div>
                                    </div>
                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' الاقسام التى يظهر الاطباء خاصتها فى حقل الطبيب فى اضافة  زيارة عند اختيار القسم الجارى تعديله   '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-8">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="fa fa-users"></i>
                                            </span>
                                            <select  class="form-control input-xlarge select2me input-sm select2-multiple noborder"   
                                                     name="index_visits_depts[]" multiple >
                                                <option value=""></option>
                                                {foreach $roles as $single}
                                                <option value="{$single->id}"   {if in_array($single->id, $indexVisitsRoles)} selected="selected" {/if} >
                                                    {$single->name}</option>
                                                {/foreach}
                                            </select>
                                            <label for="form_control_1">Roles of  visits appear in index Page  </label>
                                        </div>
                                    </div>

                                    <label class="wds10  fleft " style="text-align: center !important; margin-top: 20px;">OR  </label>

                                    <div class="form-group form-md-line-input has-info col-md-2">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="index_visits_depts_all" value="1" 
                                                   {if $role->index_visits_depts_all == 1 } checked="" {/if}>
                                            <label for="form_control_1">Show All Visits  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' الاقسام التى تظهر زياراتها فى الصفحة الرئيسية   '></i> 
                                </div>


                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-8">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="fa fa-users"></i>
                                            </span>
                                            <select multiple class="form-control input-xlarge select2me input-sm select2-offscreen noborder"   
                                                    data-placeholder="Choose" name="custom_detections[]">
                                                <option value=""></option>
                                                {foreach $detections as $single}
                                                <option value="{$single->id}"  {if in_array($single->id, $customDetections)} selected="selected" {/if}>{$single->title}</option>
                                                {/foreach}
                                            </select>
                                            <label for="form_control_1">Show visits with custom detections in index page </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' أنواع  الكشف المطلوب عرضها فى الصفحة الرئيسية بغض النظر عن القسم الخاص بالزيارة '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="fa fa-users"></i>
                                            </span>
                                            <select  class="form-control input-xlarge select2me input-sm select2-offscreen noborder"  
                                                     data-placeholder="Choose" name="redirect_to">
                                                {foreach $index_redirect as $single}
                                                <option value="{$single->id}"  {if $role->redirect_to == $single->id } selected {/if} >
                                                    {$single->name}</option>
                                                {/foreach}
                                            </select>
                                            <label for="form_control_1">Index Links Redirected To Control  </label>
                                        </div>
                                    </div>
                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content='  المسار الذى يذهب اليه عند الضغط على اسم المريض فى الصفحة الرئيسية  '></i> 

                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="fa fa-users"></i>
                                            </span>
                                            <select  class="form-control input-xlarge select2me input-sm select2-offscreen noborder"   
                                                     data-placeholder="Choose" name="external_lab">
                                                <option value=""></option>
                                                {foreach $external_labs as $single}
                                                <option value="{$single->id}" {if $role->external_lab == $single->id } selected {/if} >{$single->name}</option>
                                                {/foreach}
                                            </select>
                                            <label for="form_control_1">External Labs  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' المعمل الخارجى الذى يمثله القسم   '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="doctor_show" value="1" {if $role->doctor_show == 1 } checked="" {/if} >
                                            <label for="form_control_1">Show doctors select  in  visits add  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' عرض خانة الطبيب عند اختيار القسم فى اضافة زيارة   '></i> 

                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="screen_show" value="1" {if $role->screen_show == 1 } checked="" {/if}>
                                            <label for="form_control_1">Show in  screen   </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content='  عرض على الشاشات  '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="visit_show" value="1"  
                                                   {if $role->visit_show == 1 } checked="" {/if} >
                                            <label for="form_control_1">Show in  visits add  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' ظهور القسم فى خانة الاقسام فى اضافة زيارة   '></i> 

                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="doctor_visit_show" value="1"  
                                                   {if $role->doctor_visit_show == 1 } checked="" {/if} >
                                            <label for="form_control_1">Show in  Doctor visits Report  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content='  ظهور القسم فى خانة الاقسام فى تقرير زيارات الاطباء  '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="is_doctor" value="1" 
                                                   {if $role->is_doctor == 1 } checked="" {/if}  >
                                            <label for="form_control_1">Is a  doctor  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' الاشخاص المنتمين لهذا القسم  => أطباء   '></i> 

                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="today_list" value="1" 
                                                   {if $role->today_list == 1 } checked="" {/if}  >
                                            <label for="form_control_1">Show in Today's List   </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content='  اظهار القسم فى عرض Today List  '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="user_visits_only" value="1" 
                                                   {if $role->user_visits_only == 1 } checked="" {/if}>
                                            <label for="form_control_1">Show Only User Visits in index Page   </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' الاشخاص المنتمين لهذا القسم يعرض الزيارات الخاصة بهم فقط فى الصفحة الرئيسية   '></i> 

                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="index_search" value="1" 
                                                   {if $role->index_search == 1 } checked="" {/if}>
                                            <label for="form_control_1">Show Only User Patients in index Search   </label>
                                        </div>
                                    </div>

                                    <div class="form-group form-md-line-input has-info col-md-5">
                                        <div class="input-group">
                                            <input type="checkbox" class="form-control" name="heart_reports_show" value="1" {if $role->heart_reports_show == 1 } checked="" {/if}>
                                            <label for="form_control_1">Show in  heart reports  </label>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content='  الاشخاص المنتمين لهذا القسم يعرض لهم المرضى  الخاصين  بهم فقط كطبيب معالج  فى بحث  الصفحة الرئيسية      '></i> 
                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input has-info col-md-11">
                                        <label class="col-md-3 txtl " style="color: black;">Visits in Financial Report  </label>
                                        <div class="col-md-9">
                                            <div class="radio-list">
                                                <label class="radio-inline">
                                                    <input type="radio" name="financial_visits" value="0" 
                                                           {if $role->financial_visits == 0 } checked="" {/if}>  All Visits </label>
                                                <label class="radio-inline">
                                                    <input type="radio" name="financial_visits" value="1" 
                                                           {if $role->financial_visits == 1 } checked="" {/if}>   Only My Department Visits </label>
                                                <label class="radio-inline">
                                                    <input type="radio" name="financial_visits" value="2" 
                                                           {if $role->financial_visits == 2 } checked="" {/if}>   Only My  Visits </label>
                                            </div>
                                        </div>
                                    </div>

                                    <i class="fa fa-question-circle inputDeclare col-md-1" 
                                       data-content=' يحدد الزيارات التى تظهر فى التقرير المالى للاشخاص المنتمين لهذا القسم   '></i> 
                                </div>

                                <input type="hidden" id="hasRecord" value="1" />
                                <input type="hidden" id="hasRecord" value="1" />
                                <div class="form-actions col-md-12">
                                    <div class="col-md-4">
                                        <div id="controls">
                                            <button class="recordButtom" id="recordButton">Record</button>
                                            <button class="recordButtom" id="pauseButton" disabled>Pause</button>
                                            <button class="recordButtom" id="stopButton" disabled>Stop</button>
                                        </div>

                                        <!--div id="formats">Format: start recording to see sample rate</div-->
                                    </div>

                                    <div class="col-md-6">
                                        <p><strong>Voice Record:</strong></p>
                                        <ol id="recordingsList">
                                            {if $voiceRecord == 1 } 
                                            <li>
                                                <audio controls  src="{$hosturl}/../upload/rolerecords/{$role->id}.wav"> </audio>
                                            </li>
                                            {/if}
                                        </ol>
                                    </div>
                                </div>


                                <input type="hidden" id="id" name="id" value="{$role->id}" />
                                <input type="hidden" name="ptntid" id="ptntid" value="{$role->id}" />
                                <input type="hidden" name="dirName" id="dirName"   value="rolerecords"/>


                            </div>
                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-offset-3 col-md-4">
                                        <button type="submit" class="btn green">Update</button>
                                        <button type="button" class="btn default rtnshow" data-controll="{$controllname}">Cancel</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <!-- END FORM-->
                    </div>
                </div>
            </div>
        </div>
        <!-- END PAGE CONTENT-->
    </div>
</div>
<!-- END CONTENT -->