 <form class="form-horizontal" id="vis_ci_product_form" name="vis_ci_product_form" method="post" >
            <input type="hidden" name="vis_product_id" value="<? echo $ci_product_details['product_id']; ?>" />	
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTNAME']; ?></label>
               <div class="col-sm-10">
                  <input class="form-control input-sm" type="text" name="vis_name" id="vis_name" value="<? echo htmlentities($ci_product_details['name'], ENT_COMPAT, 'UTF-8'); ?>">
               </div>
            </div>
			<div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTCITYPE']; ?></label>
               <div class="col-sm-10">
                <select class="form-control selectpicker" name="vis_ci_type_id" id="vis_ci_type_id" <? if(count($citype_details) > 10) echo 'data-live-search="true"' ?>>
				<option value=""> <? echo $vis_language['TXTSELECT']; ?> </option>
				  <?
				  for($i=0;$i<count($citype_details);$i++) {
					  ?>
                  <option value="<? echo $citype_details[$i]['item_id']; ?>" <? echo $ci_product_details['ci_type_id']==$citype_details[$i]['item_id'] ? ' selected="selected"' : ''; ?>> <? echo $citype_details[$i]['name']; ?></option>
                  <? } ?>
				</select>
               </div>
            </div>
			<div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTMANUFACTURER']; ?></label>
               <div class="col-sm-10">
                  <input class="form-control input-sm" type="text" name="vis_manufacturer" id="vis_manufacturer" value="<? echo $ci_product_details['manufacturer']; ?>">
               </div>
            </div>
			<div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTCIPRODSTATUS']; ?></label>
               <div class="col-sm-10">
				<select class="form-control selectpicker" name="vis_product_status_id" id="vis_product_status_id" <? if(count($productstatus_details) > 10) echo 'data-live-search="true"' ?>>
				<option value=""> <? echo $vis_language['TXTSELECT']; ?> </option>
				  <?
				  for($i=0;$i<count($productstatus_details);$i++) {
					  ?>
                  <option style="color:<? echo $productstatus_details[$i]['color']?>" value="<? echo $productstatus_details[$i]['product_status_id']; ?>" <? echo $ci_product_details['product_status_id']==$productstatus_details[$i]['product_status_id'] ? ' selected="selected"' : ''; ?>> <? echo $productstatus_details[$i]['name']; ?></option>
                  <? } ?>
				</select>
               </div>
            </div>
			<div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTPROCUREMODE']; ?></label>
               <div class="col-sm-10">
				<select class="form-control selectpicker" name="vis_procurement_id" id="vis_procurement_id" <? if(count($procuremode_details) > 10) echo 'data-live-search="true"'?>>
				<option value=""> <? echo $vis_language['TXTSELECT']; ?> </option>
				  <?
				  for($i=0;$i<count($procuremode_details);$i++) {
					  ?>
                  <option style="color:<? echo $procuremode_details[$i]['color']?>"  value="<? echo $procuremode_details[$i]['procurement_id']; ?>" <? echo $ci_product_details['procurement_id']==$procuremode_details[$i]['procurement_id'] ? ' selected="selected"' : ''; ?>> <? echo $procuremode_details[$i]['name']; ?></option>
                  <? } ?>
				</select>
               </div>
            </div>
		    <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTDESCRIPTION']; ?></label>
               <div class="col-sm-10">
                  <textarea class="form-control input-sm" type="text" name="vis_description" id="vis_description"><? echo $ci_product_details['description']; ?></textarea>
			  </div>
            </div>
			<div id="department_access123">
				<div class="form-group">
				   <label class="col-sm-2 control-label"><? echo $vis_language['TXTDEPARTMENTACCESS']; ?></label>
				   <div class="col-sm-10">
					  <label class="checkbox-inline i-checks">
					  <input type="checkbox" value="1" id="vis_department_all" onChange="toggle_dept_list();" name="vis_department_all"  <? if($ci_product_details['department_access']==0) echo ' checked="checked"'; ?> ><i></i> <? echo $vis_language['TXTALLDEPARTMENTS']; ?>
					  </label>
				   </div>
				</div>
				<div id="vis_dept_list_section" class="form-group" style="<?= ($ci_product_details['department_access']==0)?'display:none':'';?>">
				   <label class="col-sm-2 control-label"></label>
				   <div class="col-sm-10"> 
					   <div class="dept_access_list">
					  <? $dept_list=array();
						  for($i=0;$i<count($department_details);$i++) {?>
					  <label class="checkbox-inline i-checks">
					  <input type="checkbox" id="vis_department" name="vis_department[]" <? if(in_array($department_details[$i]['department_id'], $ci_product_department)) echo ' checked="checked"'; ?>value="<? echo $department_details[$i]['department_id']; ?>" /> <i></i><? echo $department_details[$i]['domain_name'].' :: '.$department_details[$i]['department_name']; ?></label><br/>
					  <?
						 $dept_list[]=$department_details[$i]['department_id'];
						 } ?>
				   </div>
				  </div>
				</div>
            </div>
            <div class="line b-b line-lg pull-in"></div>
            <br/> 
            <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($ci_product_details['is_enabled']==0) echo 'radio-no-uncheck'; ?>  ">
                  <input type="checkbox"  name="vis_status"  id="vis_status" <? if($ci_product_details['is_enabled']==1) echo ' checked="checked"'; ?>   > 
                  <span ></span>
                  </label>
               </div>
            </div>
            <div class="line b-b line-lg pull-in"></div>
            <br/>             
            <div class="form-group">
               <div class="col-sm-4 col-sm-offset-2">
                  <button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'subsetting', 'vis_operation':'update_ci_product', 'vis_form':'vis_ci_product_form'})"><? echo $vis_language['TXTUPDATE']; ?></button>
               </div>
            </div>
      </div>
      </form>
<script type="text/javascript">
		 $(".selectpicker").selectpicker();
   function toggle_dept_list(){
       if($('#vis_department_all').is(":checked")){ $('#vis_dept_list_section').hide();
							}else{ $('#vis_dept_list_section').show();
							$('.dept_access_list').each(function(index) {
        $(this).find('input[type="checkbox"]').removeAttr('checked');
       });
							}
   }
</script>