<div class="row ulp-module-item" id="<?php echo 'moduleid_' . $data['id'];?>">
	<div class="col-8">


		<div id="<?php echo 'ulp_module_content_' . $data['id'];?>">
          <div class="ulp-course-module-top">
                <div class="ulp-course-module-order"><span class="ulp-module-order-display" id="<?php echo 'ulp_module_order_display_' . $data['id'];?>"><?php echo $data['module_order'] ;?></span></div>
				<div class="ulp-course-module-title">
					<input type="text" class="ulp-module-name" name="module_name[<?php echo $data['id'];?>]" value="<?php echo $data['module_name'];?>" placeholder="<?php _e('Section name...', 'ulp');?>"/>
                    <input type="hidden" name="module_new[<?php echo $data['id'];?>]" value="<?php echo $data['new'] ;?>" class="ulp_module_new" />
					<input type="hidden" name="module_id[]" value="<?php echo $data['id'] ;?>" class="ulp_module_id" />
					<input type="hidden" name="module_order[<?php echo $data['id'];?>]" value="<?php echo $data['module_order'] ;?>" class="ulp-module-order" />
				</div>
				<div class="ulp-course-module-options">
					<span id="<?php echo 'ulp_toggle_modukle_' . $data['id'];?>"><i title="<?php _e('Toggle Section', 'ulp');?>" class="fa-ulp fa-toggle_up-ulp"></i></span>
					<span id="" class="ulp-move-module-box"><i title="<?php _e('Shift Section', 'ulp');?>" class="fa-ulp fa-reorder-ulp"></i></span>
					<span id="<?php echo 'ulp_remove_modukle_' . $data['id'];?>"><i title="<?php _e('Remove Section', 'ulp');?>" class="fa-ulp fa-remove-ulp"></i></span>
				</div>
                <div class="ulp-clear"></div>
           </div>
				<div class="ulp-course-module-list" id="<?php echo 'ulp_module_content_inside_' . $data['id'];?>">
				<select id="<?php echo 'module_item_' . $data['id'];?>" multiple="multiple" name="module_items[<?php echo $data['id'];?>][]" style="width: 95%;min-height: 200px; margin-left:50px;">
						<?php if ($data['items']):?>
								<?php foreach ($data['items'] as $array):?>
										<?php
												if (in_array($array['ID'], $data['items_in'][$data['id']])){
														$labels [$array['ID']] = $array['post_title'];
														$post_types [$array['ID']] = $array['post_type'];
														continue;
												}
										 ?>
										 <?php
										 	$iconType = $array['post_type'];
											if ( $iconType == 'ulp_lesson' && get_post_meta( $array['ID'], 'ulp_lesson_is_video', true ) ){
													$iconType = 'ulp_lesson_video';
											}
										 ?>
										<option value="<?php echo $array['ID'];?>" data-post_type="<?php echo $iconType;?>"><?php echo $array['post_title'];?></option>
								<?php endforeach;?>
								<?php if (isset($data['items_in']) && isset($data['items_in'][$data['id']])):?>
											<?php foreach ($data['items_in'][$data['id']] as $item_id):?>
													<option value="<?php echo $item_id;?>" data-post_type="<?php echo $post_types[$item_id];?>"  selected><?php echo $labels[$item_id];?></option>
											<?php endforeach;?>
								<?php endif;?>
						<?php endif;?>
				</select>
                </div>
		</div>
	</div>
	<script>
		jQuery(<?php echo 'ulp_remove_modukle_' . $data['id'];?>).click(function(){
			ulpDoModuleRemove(<?php echo $data['id'];?>);
		});
		jQuery(<?php echo 'ulp_toggle_modukle_' . $data['id'];?>).click(function(){
			ulpDoModuleToggle(<?php echo $data['id'];?>);
		});
		jQuery(document).ready(function(){
			jQuery("#<?php echo 'module_item_' . $data['id'];?>").multiselect({sortable: true, searchable: true, dividerLocation: 0.5});
		});
	</script>

</div>
