public function fused_has_user_bought($user_id, $product_id)
 {
     $ordered_products = Wooclass::fused_get_all_products_ordered_by_user($user_id);
     //print_r($ordered_products);
     if (in_array($product_id, (array) $ordered_products)) {
         return true;
     }
     return false;
 }
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $product;
global $wpdb;
$config = parse_ini_file("config.ini");
$course_url = $config["canvasurl"];
//echo $course_url;
$user_ID = wp_get_current_user();
$woo_class = new Wooclass();
$result = $woo_class->fused_has_user_bought($user_ID->ID, $product->id);
$get_lmsid = "select lms_id from wp_posts where ID=" . $product->id;
$getlms = $wpdb->get_row($get_lmsid);
//echo $getlms->lms_id;
if (!$product->is_in_stock() && !$result) {
    ?>

	<a href="<?php 
    echo apply_filters('out_of_stock_add_to_cart_url', get_permalink($product->id));
    ?>
" class="button"><?php 
    echo apply_filters('out_of_stock_add_to_cart_text', __('Read More', 'woocommerce'));
    ?>
</a>
    ?>
</div>
	
</li>
<?php 
    $today = date("Y-m-d");
    //echo $today;
    $NewDate = Date('Y-m-d', strtotime("-15 days"));
    //echo $NewDate;
    //$get_courseid="SELECT * FROM wp_posts WHERE  (enrollstart BETWEEN '".$NewDate."' AND '".$today."') and instructor_type='".$userid."'";
    $get_courseid = "SELECT * FROM wp_posts WHERE instructor_type='" . $userid . "'";
    $getcourse_detail = $wpdb->get_results($get_courseid);
    $direct = ABSPATH;
    require_once $direct . "/wp-content/plugins/woocommerce/classes/wooclass.php";
    $user_ID = wp_get_current_user();
    $woo_class = new Wooclass();
    ?>

<li class="list_item clearfix">
<div class="content clearfix" style="text-align:center;">
<h1 class="txt_head">Currently Teaching</h1>

<p style="text-align:center";>The next session of the course starts on following dates - there are also other sessions to choose from to ensure you find the course that is most convenient for </p>
<p style="text-align:center";>To buy a place on this course, please select the session that you would like to enroll on:</p>
<ul class="enroll  overflow_fix">
	
	<?php 
    foreach ($getcourse_detail as $res) {
        ?>
	<li style="list-style:none;">
<div class="enroll_column1">
<p class="myaccount_user">
	<?php 
/*
printf(
	__( 'Hello, <strong>%s</strong>. From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">change your password</a>.', 'woocommerce' ),
	$current_user->display_name,
	get_permalink( woocommerce_get_page_id( 'change_password' ) )
);
*/
printf(__('Hello, <strong>%s</strong>.You are entered into your dashboard.', 'woocommerce'), $current_user->display_name, get_permalink(woocommerce_get_page_id('change_password')));
global $woocommerce;
$customer_orders = get_posts(array('numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => 'shop_order', 'post_status' => 'publish'));
$direct = ABSPATH;
require_once $direct . "/wp-content/plugins/woocommerce/classes/wooclass.php";
$woo_class = new Wooclass();
//$user_ID=wp_get_current_user();
$user_ID = $current_user->ID;
//echo $user_ID;
global $wpdb;
$config = parse_ini_file("config.ini");
$course_url = $config["canvasurl"];
//echo $course_url;
//print_r($product);
//echo $current_user->ID;
//$user_ID=wp_get_current_user();
if ($customer_orders) {
    ?>

	<h2><?php 
    echo apply_filters('woocommerce_my_account_my_orders_title', __('My Course', 'woocommerce'));
        the_title();
    }
}
?>
<ul class="list_course">
        
        
          <br><br>

 
 
<?php 
$direct = ABSPATH;
require_once $direct . "/wp-content/plugins/woocommerce/classes/wooclass.php";
$user_ID = get_current_user_id();
$woo_class = new Wooclass();
$args = array('post_type' => 'product');
$category_posts = new WP_Query($args);
$category_posts->query('showposts=10000&post_type=product');
//print_r($category_posts);
if ($category_posts->have_posts()) {
    while ($category_posts->have_posts()) {
        $category_posts->the_post();
        //print_r($values);
        $regularprice = get_post_meta(get_the_ID(), '_regular_price', true);
        if ($regularprice == "" || $regularprice == "0") {
            ?>
<li class="list_item grey_border clearfix">

    <div class="title">