Example #1
0
 /**
  * This function is used to get  the  account dashboard information 
  *
  * .
  * 
  * @return string
  */
 function showDashboard()
 {
     include 'classes/Display/DUserAccount.php';
     $pagesize = 10;
     if (isset($_GET['page'])) {
         $start = trim($_GET['page'] - 1) * $pagesize;
         $end = $pagesize;
     } else {
         $start = 0;
         $end = $pagesize;
     }
     $total = 0;
     $sqlselect = "SELECT a.customers_id,a.orders_id,date_format(a.date_purchased,'%e/%c/%Y') as pdate,b.orders_status_name,c.user_display_name,a.order_total as total,a.currency_id FROM `orders_table` a,orders_status_table b,users_table c,order_products_table d where a.orders_status=b.orders_status_id and a.customers_id=c.user_id and a.orders_id=d.order_id and a.customers_id=" . $_SESSION['user_id'] . " group by a.orders_id order by a.date_purchased desc";
     $query = new Bin_Query();
     if ($query->executeQuery($sqlselect)) {
         $total = ceil($query->totrows / $pagesize);
         include 'classes/Lib/Paging.php';
         $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination');
         $this->data['paging'] = $tmp->output;
         $this->data['prev'] = $tmp->prev;
         $this->data['next'] = $tmp->next;
     }
     $sqlselect = "SELECT a.customers_id,a.orders_id,date_format(a.date_purchased,'%e/%c/%Y') as pdate,b.orders_status_name,c.user_display_name,a.order_total as total,a.currency_id,e.id,e.currency_tocken  FROM `orders_table` a,orders_status_table b,users_table c,order_products_table d,currency_master_table e where a.orders_status=b.orders_status_id and a.customers_id=c.user_id and a.orders_id=d.order_id and a.customers_id=" . $_SESSION['user_id'] . " and e.id=a.currency_id group by a.orders_id order by a.date_purchased desc LIMIT {$start},{$end}";
     $sqlUser = '******' . $_SESSION['user_id'];
     $sqlNews = "SELECT user_id,b.status FROM `users_table` a,newsletter_subscription_table b where a.user_email=b.email and a.user_status=1 and a.user_id=" . $_SESSION['user_id'];
     $obj = new Bin_Query();
     $objuser = new Bin_Query();
     $objNews = new Bin_Query();
     $obj->executeQuery($sqlselect);
     $objuser->executeQuery($sqlUser);
     $objNews->executeQuery($sqlNews);
     return Display_DUserAccount::showDashboard($obj->records, $objuser->records, $objNews->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start);
 }
Example #2
0
 /**
  * This function is used to show the all feartured product page.
  *
  * 
  * 
  * @return string
  */
 function showAllFeatured()
 {
     include 'classes/Display/DUserAccount.php';
     $pagesize = 8;
     if (isset($_GET['page'])) {
         $start = trim($_GET['page'] - 1) * $pagesize;
         $end = $pagesize;
     } else {
         $start = 0;
         $end = $pagesize;
     }
     $total = 0;
     $sql = "SELECT a.*,sum(c.rating)/count(c.user_id) as rating FROM `products_table` a left join product_reviews_table c on a.product_id=c.product_id WHERE category_id IN (SELECT b.category_id AS id FROM category_table a INNER JOIN category_table b ON a.category_id = b.category_parent_id ORDER BY rand()) and is_featured=1 and a.status=1 and a.intro_date <= '" . date('Y-m-d') . "' group by a.product_id";
     $query = new Bin_Query();
     if ($query->executeQuery($sql)) {
         $total = ceil($query->totrows / $pagesize);
         include 'classes/Lib/Paging.php';
         $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination');
         $this->data['paging'] = $tmp->output;
         $this->data['prev'] = $tmp->prev;
         $this->data['next'] = $tmp->next;
         $sql = "SELECT a.*,sum(c.rating)/count(c.user_id) as rating FROM `products_table` a left join product_reviews_table c on a.product_id=c.product_id WHERE category_id IN (SELECT b.category_id AS id FROM category_table a INNER JOIN category_table b ON a.category_id = b.category_parent_id ORDER BY rand()) and is_featured=1 and a.status=1 and a.intro_date <= '" . date('Y-m-d') . "' group by a.product_id limit {$start},{$end}";
         $obj = new Bin_Query();
         if ($obj->executeQuery($sql)) {
             return Display_DUserAccount::showAllFeatured($obj->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start);
         } else {
             return 'No Products Found!';
         }
     } else {
         return 'No Products Found!';
     }
 }
Example #3
0
 /**
  * This function is used to get  the  user product review
  *
  * .
  * 
  * @return string
  */
 function showProductReview()
 {
     include 'classes/Display/DUserAccount.php';
     $userid = $_SESSION['user_id'];
     $pagesize = 10;
     if (isset($_GET['page'])) {
         $start = trim($_GET['page'] - 1) * $pagesize;
         $end = $pagesize;
     } else {
         $start = 0;
         $end = $pagesize;
     }
     $total = 0;
     $sqlselect = "SELECT date_format(review_date,'%e/%c/%Y') as rdate,b.title,review_caption FROM product_reviews_table a,products_table b where a.product_id=b.product_id and a.user_id=" . $userid;
     $query = new Bin_Query();
     $query->executeQuery($sqlselect);
     $total = ceil($query->totrows / $pagesize);
     include 'classes/Lib/Paging.php';
     $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination');
     $this->data['paging'] = $tmp->output;
     $this->data['prev'] = $tmp->prev;
     $this->data['next'] = $tmp->next;
     $sqlselect = "SELECT a.product_id,date_format(review_date,'%e/%c/%Y') as rdate,b.title,review_caption,rating,case when review_status=1 then 'Active' else 'In Active' end as rstatus FROM product_reviews_table a,products_table b where a.product_id=b.product_id and a.user_id=" . $userid . " LIMIT {$start},{$end}";
     $obj = new Bin_Query();
     $obj->executeQuery($sqlselect);
     return Display_DUserAccount::showProductReview($obj->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start);
 }
Example #4
0
 /**
  * This function is used to show the all new product page.
  *
  * 
  * 
  * @return string
  */
 function showAllNew()
 {
     include 'classes/Display/DUserAccount.php';
     $pagesize = 8;
     if (isset($_GET['page'])) {
         $start = trim($_GET['page'] - 1) * $pagesize;
         $end = $pagesize;
     } else {
         $start = 0;
         $end = $pagesize;
     }
     $total = 0;
     $sql = " SELECT a.product_id, a.title, a.thumb_image, a.msrp, a.intro_date,b.soh,sum(c.rating)/count(c.user_id) as\n\t\t\trating FROM products_table a INNER JOIN\tproduct_inventory_table b ON a.product_id=b.product_id left join product_reviews_table c on a.product_id=c.product_id WHERE a.intro_date <= '" . date('Y-m-d') . "' and a.status=1 group by a.product_id";
     $query = new Bin_Query();
     if ($query->executeQuery($sql)) {
         $total = ceil($query->totrows / $pagesize);
         include 'classes/Lib/Paging.php';
         $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination');
         $this->data['paging'] = $tmp->output;
         $this->data['prev'] = $tmp->prev;
         $this->data['next'] = $tmp->next;
         $sql = " SELECT a.product_id, a.title, a.thumb_image, a.msrp, a.intro_date,b.soh,sum(c.rating)/count(c.user_id) as\n\t\t\trating \tFROM products_table a INNER JOIN product_inventory_table b ON a.product_id=b.product_id left join product_reviews_table c on a.product_id=c.product_id WHERE a.intro_date <= '" . date('Y-m-d') . "' and a.status=1 group by a.product_id order by a.intro_date desc limit {$start},{$end}";
         $obj = new Bin_Query();
         if ($obj->executeQuery($sql)) {
             return Display_DUserAccount::showAllNew($obj->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start);
         } else {
             return 'No Products Found!';
         }
     } else {
         return 'No Products Found!';
     }
 }
Example #5
0
 /**
  * This function is used to get  the  news letter
  *
  * .
  * 
  * @return string
  */
 function showNewsLetter()
 {
     include 'classes/Display/DUserAccount.php';
     $sqlselect = "SELECT user_id,b.status,b.subsciption_id FROM `users_table` a,newsletter_subscription_table b where  a.user_status=1 and a.user_id=" . $_SESSION['user_id'];
     $obj = new Bin_Query();
     if ($obj->executeQuery($sqlselect)) {
         return Display_DUserAccount::showNewsLetter($obj->records);
     }
 }
Example #6
0
 /**
  * This function is used to get  the  digital product list for my downloads
  *
  * .
  * 
  * @return string
  */
 function showDigitalProduct()
 {
     include 'classes/Display/DUserAccount.php';
     if (isset($_GET['totrec']) && $_GET['totrec'] > 0) {
         $pagesize = $_GET['totrec'];
     } else {
         $pagesize = 10;
     }
     //$pagesize=10;
     if (isset($_GET['page'])) {
         $start = trim($_GET['page'] - 1) * $pagesize;
         $end = $pagesize;
     } else {
         $start = 0;
         $end = $pagesize;
     }
     $total = 0;
     $id = $_SESSION['user_id'];
     //$id=51;
     $sqlselect = "SELECT a.orders_id, b.product_id, c.title,date_format(a.date_purchased,'%e/%c/%Y') as pdate,date_format(date_add(a.date_purchased,INTERVAL 7 DAY),'%e/%c/%Y') as expdate\n\t\tFROM orders_table a\n\t\tINNER JOIN order_products_table b ON a.orders_id = b.order_id\n\t\tINNER JOIN products_table c ON c.product_id = b.product_id\n\t\tAND c.digital =1\n\t\tWHERE a.customers_id =" . $id;
     $query = new Bin_Query();
     if ($query->executeQuery($sqlselect)) {
         $total = ceil($query->totrows / $pagesize);
         include 'classes/Lib/Paging.php';
         $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination');
         $this->data['paging'] = $tmp->output;
         $this->data['prev'] = $tmp->prev;
         $this->data['next'] = $tmp->next;
     }
     $sqlselect = "SELECT a.orders_id, b.product_id, c.title,date_format(a.date_purchased,'%e/%c/%Y') as pdate,date_format(date_add(a.date_purchased,INTERVAL 7 DAY),'%e/%c/%Y') as expdate\n\t\tFROM orders_table a\n\t\tINNER JOIN order_products_table b ON a.orders_id = b.order_id\n\t\tINNER JOIN products_table c ON c.product_id = b.product_id\n\t\tAND c.digital =1\n\t\tWHERE a.customers_id =" . $id . " LIMIT {$start},{$end}";
     $obj = new Bin_Query();
     $obj->executeQuery($sqlselect);
     return Display_DUserAccount::showDigitalProduct($obj->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start);
 }
Example #7
0
    /**
     * This function is used to send wishlist 
     *
     * .
     * 
     * @return string
     */
    function sendWishlist()
    {
        include_once 'classes/Core/CHome.php';
        include_once 'classes/Display/DUserAccount.php';
        $skin = Core_CHome::skinName();
        $userid = $_SESSION['user_id'];
        $sqlselect = "SELECT a.product_id,image,title,msrp,date_format(date_added,'%e/%c/%Y') as adate FROM `wishlist_table` a, products_table b where a.product_id=b.product_id and a.user_id=" . $userid . " order by date_added desc";
        $obj = new Bin_Query();
        $obj->executeQuery($sqlselect);
        $content = Display_DUserAccount::getWishList($obj->records);
        $fileName = "css/" . $skin . "/styles.css";
        $data = '<style type="text/css">' . implode('', file($fileName)) . "</style>";
        $result = $data . $content;
        //Get User Mail Address
        $sqlselect = "SELECT b.email FROM `users_table` a,newsletter_subscription_table b where  a.user_status=1 and a.user_id=" . $_SESSION['user_id'];
        $obj->executeQuery($sqlselect);
        $from = $obj->records[0]['email'];
        $to_addr = $_POST['txtEmail'];
        $title = $_SESSION['user'] . "Wishlsit";
        $mail_content = $result;
        include 'classes/Lib/Mail.php';
        $mail = new Lib_Mail();
        $mail->From($from);
        $mail->ReplyTo($from);
        $mail->To($to_addr);
        $mail->Subject($title);
        $mail->Body($mail_content);
        $mail->Send();
        return '<div class="alert alert-success">
		<button data-dismiss="alert" class="close" type="button">×</button>
		' . Core_CLanguage::_(MAIL_HAS_BEEN_SENT) . '
		</div>';
    }
Example #8
0
 /**
  * This function is used to get  the   user account information
  *
  * .
  * 
  * @return string
  */
 function showChangePassword()
 {
     include 'classes/Display/DUserAccount.php';
     return Display_DUserAccount::showChangePassword();
 }
Example #9
0
    /**
     * This function is used to Display the User Wishlist
     * @param mixed $arr
     * @param int $paging
     * @param int $prev
     * @param int $next	
     * @param int $val
     * @param mixed $result
     * @return string
     */
    function showDigitalProduct($arr, $paging, $prev, $next, $val, $result)
    {
        $output .= $result . '<div class="title_fnt">
		<h1>' . Core_CLanguage::_('MY_DOWNLOADS') . '</h1>
		</div>
		<div id="myaccount_div">
		
		<table class="rt cf" id="rt1">
			<thead class="cf">
				<tr>
					
					<th>' . Core_CLanguage::_('ORDER') . '</th>
					<th>' . Core_CLanguage::_('PRODUCT') . ' </th>
					<th>' . Core_CLanguage::_('ORDER_DATE') . '</th>
					<th>' . Core_CLanguage::_('EXPIRE_DATE') . '</th>
					<th>' . Core_CLanguage::_('DOWNLOAD') . '</th>	
				</tr>
			</thead>
			<tbody>';
        if (count($arr) > 0) {
            for ($i = 0; $i < count($arr); $i++) {
                if (file_exists($arr[$i]['image'])) {
                    $img = $arr[$i]['image'];
                } else {
                    $img = "'" . $_SESSION['base_url'] . "/index.phpimages/noimage.jpg";
                }
                $output .= '<tr>
					
					<td>#' . $arr[$i]['orders_id'] . '</td><td><a href="?do=prodetail&action=showprod&prodid=' . $arr[$i]['product_id'] . '">' . $arr[$i]['title'] . '</a></td>
					<td>' . $arr[$i]['pdate'] . '</td>';
                if (Display_DUserAccount::dateDiff("/", date("j/n/Y"), $arr[$i]['expdate']) > 0) {
                    $output .= '<td bgcolor="#FFFFFF" >Download Expired</td>';
                } else {
                    $output .= '<td bgcolor="#FFFFFF" >' . $arr[$i]['expdate'] . '</td>';
                }
                $output .= '<td><a class="btn btn-mini" href="?do=prodown&rid=' . $arr[$i]['orders_id'] . '&pid=' . $arr[$i]['product_id'] . '">Download</a></td></tr>';
            }
        } else {
            $output .= '<tr><td colspan="6"><div class="alert alert-info">
				<button data-dismiss="alert" class="close" type="button">×</button>
				<strong>' . Core_CLanguage::_('NO_PRODUCT_FOUND') . '</strong> 
				</div></td></tr>';
        }
        $output .= '</tbody>
					</table>
					</div>';
        $_SESSION['wishList'] = $output;
        return $output;
    }
Example #10
0
 /**
  * This function is used to get  the  address from check out process
  *
  * .
  * 
  * @return string
  */
 function showAddAddressFromCheckout()
 {
     include 'classes/Display/DUserAccount.php';
     $sqlCountry = "SELECT * from country_table";
     $objCountry = new Bin_Query();
     $objCountry->executeQuery($sqlCountry);
     $userid = $_SESSION['user_id'];
     if ($_GET['id'] != '') {
         $sql = "select * from addressbook_table where user_id=" . $userid . " and contact_name='" . $_GET['id'] . "'";
         $query = new Bin_Query();
         $query->executeQuery($sql);
         return Display_DUserAccount::showAddAddressFromCheckout($objCountry->records, $query->records);
     } else {
         return Display_DUserAccount::showAddAddressFromCheckout($objCountry->records);
     }
 }