Exemple #1
0
    ?>
									</ul>
								<?php 
} else {
    ?>
								<p>Sorry! there are no orders have been made.</p>
								<?php 
}
?>
								</div>
								<?php 
if ($dist = isDistributor()) {
    ?>
								<div id="review_order_tab1">
									<?php 
    $dealers = getDealersByDistributor(isLogin());
    ?>
									<?php 
    $dealers = array_merge($dist, $dealers);
    ?>
									<?php 
    foreach ($dealers as $key => $dealer) {
        ?>
										<?php 
        $ordered_ids = getOrderedIdByUser($dealer->user_id);
        ?>
	
										<?php 
        if (count($ordered_ids)) {
            ?>
									<?php 
Exemple #2
0
/**
 * getOrders function
 * this funciton is to get the order's details o with a particluar id or  get all the orders of a that current logged in user.
 * it will also gives the order's detail of all the dealers if the current user is a distributor.
 * 
 * @param int id to get the details of the particular orde only.
 * @return void
 * @author Ankit Balyan - sf.ankit@gmail.com
 **/
function getOrders($id = NULL)
{
    global $wpdb;
    $table = "rw_orders";
    if ($id) {
        $sql = "SELECT * FROM {$table} where order_id = {$id} and created_by = " . isLogin();
    } else {
        $sql = "SELECT * FROM {$table} where created_by = " . isLogin();
        if (isDistributor(isLogin())) {
            $dealers = getDealersByDistributor(isLogin());
            foreach ($dealers as $dealer) {
                $sql .= " OR created_by =" . $dealer->user_id;
            }
        }
    }
    $sql .= " order by product_grade ";
    return $wpdb->get_results($sql);
}