<?php if (empty($data['uid'])):?>
    <div class="ulp-additional-message"><?php echo $data['userNotLoggedErrorMessage'];?></div>
<?php else:?>
    <?php if ($data['submited']):?>



    <?php else:
    
    
    /* Added check by ocean to restrict user by accessing other tabs before completing his'her profile information */
        
        $flag = false;
		$userData = get_user_meta( $data['uid']);

// 		if(isset($userData['first_name'][0]) && $userData['first_name'][0] != '' &&  isset($userData['last_name'][0]) && $userData['last_name'][0] != '' && isset($userData['driverslicense'][0]) && $userData['driverslicense'][0] != '' && isset($userData['phone'][0]) && $userData['phone'][0] != '' && isset($userData['duidate'][0]) && $userData['duidate'][0] != '' && isset($userData['citation'][0]) && $userData['citation'][0] != '' && isset($userData['hearaboutus'][0]) && $userData['hearaboutus'][0] != '' && isset($userData['courtlocation1'][0]) && $userData['courtlocation1'][0] != '' && isset($userData['dateofbirth'][0]) && $userData['dateofbirth'][0] != ''){
		if(isset($userData['complete_profile'][0]) && $userData['complete_profile'][0] == 1){
		    $flag = true;
		}else{
		    if(isset($userData['first_name'][0]) && $userData['first_name'][0] != '' &&  isset($userData['last_name'][0]) && $userData['last_name'][0] != '' && isset($userData['driverslicense'][0]) && $userData['driverslicense'][0] != '' && isset($userData['phone'][0]) && $userData['phone'][0] != '' && isset($userData['duidate'][0]) && $userData['duidate'][0] != '' && isset($userData['citation'][0]) && $userData['citation'][0] != '' && isset($userData['hearaboutus'][0]) && $userData['hearaboutus'][0] != '' && isset($userData['courtlocation1'][0]) && $userData['courtlocation1'][0] != '' && isset($userData['dateofbirth'][0]) && $userData['dateofbirth'][0] != ''){
		        update_user_meta($data['uid'], 'complete_profile', '1');
		        $flag = true;
		    }else{
		        update_user_meta($data['uid'], 'complete_profile', '0');
		        $flag = false;
		    }
		}
		
        $current_url= $_SERVER['REQUEST_URI'];
        
		if(!$flag && !stripos($current_url,"ihc_ap_menu=profile")){
			wp_safe_redirect(get_home_url()."/arizona-dui-account-page/?ihc_ap_menu=profile");
	        exit;
		}
		
		if(!$flag){ ?>
		    <script>
		    setTimeout(function(){
		        jQuery('.ihc-ap-wrap h2 strong').css('color', '#dd3333');
		    }, 2000);
		        setTimeout(function(){ 
		            jQuery('.ihc-ap-wrap h2 strong').css('color', '#333333');
		        }, 5000);
		    </script>
		<?php }
		
		/* Ocean ends */
    ?>

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

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



        <div class="ulp-checkout-main-title"><?php _e('Your Order', 'ulp');?></div>

        <table class="ulp-table-general ulp-list-checkout">

         <thead>

            <tr>

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

              <th><?php echo Ulp_Global_Settings::get('ulp_messages_checkout_amount');?></th>

            </tr>

         </thead>

         <tbody>

           <tr>

             <td class="ulp-special-column"><?php echo $data ['course_label'];?></td>

             <td><?php echo ulp_format_price($data ['amount']);?></td>

          </tr>

         </tbody>

       </table>



        <div class="ulp-checkout-main-title"><?php echo Ulp_Global_Settings::get('ulp_messages_checkout_payment_type');?></div>

        <div class="ulp-checkout-payment-select-wrapper">

            <div class="ulp-checkout-payment-select">

            <?php foreach ($data['payment_types'] as $slug => $object):?>

                <div class="ulp-checkout-payment-option" id="ulp_checkout_payment_select">

                    <input type="radio" name="payment_type" value="<?php echo $slug;?>" /> <?php echo $object['label'];?>

                    <span><?php echo $object['description'];?></span>

                </div>

            <?php endforeach;?>

            </div>

        </div>


        <?php do_action('ulp_checkout_page_print_string_before_pay_bttn');?>

        <input type="submit" name="ulp_pay" value="<?php _e('Pay Order', 'ulp');?>" /><div class="ulp-spinner" id="js_ulp_checkout_loading_gif"></div>

    </form>

    <?php endif;?>

<?php endif;?>
