<? global $vis_language; ?>
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title"><? echo $vis_language['TXTEDITPAGE']; ?></h4>
        </div>
        <div class="modal-body">
            <div class="row">
                <div class="col-sm-12">
                <form method="post" role="form" class="form-horizontal" name="vis_facebook_page_form" id="vis_facebook_page_form">
			      <div class="form-group">
                     <label class="col-sm-2 control-label"><? echo $vis_language['TXTPAGE']; ?></label>
                       <div class="col-sm-10">
                          <label class="control-label"><?= $pages_details[0]['page_name'];?></label>
                       </div>
                  </div>
                  <div class="form-group">
                       <label class="col-sm-2 control-label"><? echo $vis_language['TXTDEPARTMENT']; ?></label>
                       <div class="col-sm-10">
                        <select class="form-control selectpicker" name="vis_department_id" id="vis_department_id" <? if(count($department_details) > 10) echo 'data-live-search="true"' ?>>
                          <? for($i=0;$i<count($department_details);$i++){
							   if($pages_details[0]['department_id']==$department_details[$i]['department_id'])
							   		$chk='selected';
							   else
							   		$chk= '';	
							     echo '<option value="'.$department_details[$i]['department_id'].'" '.$chk.'>'.$department_details[$i]['domain_name'].' : '.$department_details[$i]['department_name'].'</option>';
						     }?>
                        </select>
                       </div>
                  </div>
                 <div class="form-group">
                       <label class="col-sm-2 control-label"><? echo $vis_language['TXTSTATUS']; ?></label>
                       <div class="col-sm-1">
                          <label class="switch  <? if($pages_details[0]['is_enabled']==0) echo 'radio-no-uncheck'; ?>  ">
                          <input type="checkbox"  name="vis_status"  id="vis_status" <? if($pages_details[0]['is_enabled']==1) echo ' checked="checked"'; ?>   > 
                          <span ></span>
                          </label>
                       </div>
                 </div> 
			   <input type="hidden" name="vis_page_id" id="vis_page_id" value="<?= $pages_details[0]['page_id'];?>">
               <input type="hidden" name="vis_page_name" id="vis_page_name" value="<?= $pages_details[0]['page_name'];?>">
               <input type="hidden" name="vis_app_id" id="vis_app_id" value="<?= $pages_details[0]['app_id'];?>">
              </form>
              </div>
            </div>
        </div>
        <div class="modal-footer">
			<a class="btn btn-default" data-dismiss="modal"><? echo $vis_language['TXTCANCEL']; ?></a>
            <a class="btn btn-primary" onclick="$(this).visExecution('submit_form',{'vis_module':'subsetting', 'vis_operation':'update_facebook_page', 'vis_form':'vis_facebook_page_form'});"><? echo $vis_language['TXTSAVE']; ?></a>
        </div>
    </div>
</div>
<script type="text/javascript">
	$('.selectpicker').selectpicker();	
</script>
