<form action="" method="post">

	<div class="ulp-stuffbox">

		<h3 class="ulp-h3"><?php _e('Certificates', 'ulp');?></h3>

		<div class="inside">

		<div class="ulp-inside-item">

              <div class="row">

               <div class="col-xs-6">

			<div class="ulp-form-line">

					<h2><?php _e('Activate Courses Certificates', 'ulp');?></h2>

				<label class="ulp_label_shiwtch" style="margin:10px 0 10px -10px;">

					<?php $checked = ($data['metas']['ulp_certificates_enable']) ? 'checked' : '';?>

					<input type="checkbox" class="ulp-switch" onClick="UltimateLearningPro.checkAndH(this, '#ulp_certificates_enable');" <?php echo $checked;?> />

					<div class="switch" style="display:inline-block;"></div>

				</label>

				<input type="hidden" name="ulp_certificates_enable" value="<?php echo $data['metas']['ulp_certificates_enable'];?>" id="ulp_certificates_enable" />

			</div>



			<div>

            	<h4><?php _e('How it works', 'ulp');?></h4>

				<div><?php _e('Enabling this feature will let you add certificates for courses.', 'ulp');?></div>

				<div><?php _e('Example: If your students finish “Course A”, they are awarded a certificate.', 'ulp');?></div>

			</div>



			<div class="ulp-submit-form" style="margin-top: 30px;">

				<input type="submit" value="<?php _e('Save Changes', 'ulp');?>" name="submit" class="btn btn-primary pointer" />

			</div>

		 </div>

       </div>

      </div>

		</div>

	</div>





	<div class="ulp-stuffbox">

		<h3 class="ulp-h3"><?php _e('Give Certificate to User', 'ulp');?></h3>

		<div class="inside">

		<div class="ulp-inside-item">

              <div class="row">

               <div class="col-xs-6">

			<div class="ulp-form-line">

            <p><?php _e('You can manually assign a certificate to Students from this section', 'ulp');?></p>

					<label><?php _e('Course', 'ulp');?></label>

					<div>

							<select name="cid" class="form-control">

								  <option value="-1" >...</option>

									<?php if ($data ['courses']):?>

											<?php foreach ($data ['courses'] as $course_array):?>

													<option value="<?php echo $course_array ['ID'];?>" ><?php echo $course_array ['post_title'];?></option>

											<?php endforeach;?>

									<?php endif;?>

							</select>

					</div>

			</div>

			<div class="ulp-form-line">

					<label><?php _e('Student', 'ulp');?></label>

					<input type="text" class="form-control" value="" name="username" id="username"/>

			</div>



			<div class="ulp-submit-form" style="margin-top: 30px;">

				<input type="submit" value="<?php _e('Assign Certificate', 'ulp');?>" name="submit" class="btn btn-primary pointer" />

			</div>

		 </div>

       </div>

      </div>

		</div>

	</div>



</form>



<script>

jQuery(document).ready(function(){

    jQuery( "#username" ).bind( "keydown", function( event ) {

      if ( event.keyCode === jQuery.ui.keyCode.TAB &&

        jQuery( this ).autocomplete( "instance" ).menu.active ) {

        event.preventDefault();

      }

    }).autocomplete({

    		minLength: 0,

    		source: decodeURI(window.ulp_url)+'/wp-admin/admin-ajax.php?action=ulp_autocomplete_users&term=',

    		focus: function() {},

    		select: function( event, ui ) {}

    });

});

</script>

