<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		          |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com (C) 2005              |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "../includes/config.php";
include "../includes/session.php";
include "../includes/functions.php";

if (get_magic_quotes_gpc()) {
	$_POST = array_map('stripslashes_deep', $_POST);
	$_GET = array_map('stripslashes_deep', $_GET);
	$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}

if(isset( $_SESSION["sess_adminname"]) and $_SESSION["sess_adminname"]!= ""){
	$adminname = $_SESSION["sess_adminname"];
}else{
	header("Location:login.php");
	exit;
}

$adminCurrency	= GetAdminCurrency();

$adminSymbol	= $adminCurrency['currency_symbol'];

/*
 * Orders
*/

$sql = "SELECT o.order_id,o.order_date,
CONCAT(o.billing_first_name, ' ' ,o.billing_last_name) as user_name,
od.product_discount,
(o.order_total_price+o.taxrate) as total
FROM ".$tableprefix."orders o
INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id  WHERE o.vpayment_status='C'
GROUP BY o.order_id ORDER BY o.order_id DESC LIMIT 0,5";

$orderResult = mysql_query($sql) or die(mysql_error());

/*
 * Orders - End
*/

/*
 * Order Counts Start
*/
$totalOrders        = 0;
$pendingOrders      = 0;
$shippedOrders      = 0;
$deliveredOrders    = 0;

$baseQuery = "SELECT o.order_id
FROM ".$tableprefix."orders o WHERE 1=1 ";
//Total orders
$query = $baseQuery . " AND o.vpayment_status='C' AND (o.order_status = 1 OR o.order_status = 3 OR o.order_status = 4)";
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{

	while($row = mysql_fetch_object($result)) {

		 
		if(getOrderStatus($row->order_id)=="Pending") {
			$pendingOrders++;
		}
		if(getOrderStatus($row->order_id)=="Delivered") {
			$deliveredOrders++;
		}
		if(getOrderStatus($row->order_id)=="Shipped") {
			$shippedOrders++;
		}
		$totalOrders++;
	}
}

/*/*Pending orders
 $query = $baseQuery . " AND o.order_status = 1";

$result = mysql_query($query) or die(mysql_error());

if(mysql_num_rows($result) > 0)
{
$row = mysql_fetch_object($result);
$pendingOrders = $row->totalcount;
}

//Shipped orders
$query = $baseQuery . " AND o.order_status = 3";

$result = mysql_query($query) or die(mysql_error());

if(mysql_num_rows($result) > 0)
{
$row = mysql_fetch_object($result);
$shippedOrders = $row->totalcount;
}

//Delivered orders
$query = $baseQuery . " AND o.order_status = 4";

$result = mysql_query($query) or die(mysql_error());

if(mysql_num_rows($result) > 0)
{
$row = mysql_fetch_object($result);
$deliveredOrders = $row->totalcount;
}
*
*/
/*
 $totalOrders        = 1000;
$pendingOrders      = 9;
$shippedOrders      = 10;
$deliveredOrders    = 981;
*/
$pendingOrdersPerc   = 0;
$shippedOrdersPerc   = 0;
$deliveredOrdersPerc = 0;

if($pendingOrders > 0)
{
	$pendingOrdersPerc = round($pendingOrders * 100 / $totalOrders);
}

if($shippedOrders > 0)
{
	$shippedOrdersPerc = round($shippedOrders * 100 / $totalOrders);
}

if($deliveredOrders > 0)
{
	$deliveredOrdersPerc = round($deliveredOrders * 100 / $totalOrders);
}

//Today
$totalOrdersTodayCount = 0;

$sqlOrdCnt = "SELECT o.order_id
FROM ".$tableprefix."orders o
WHERE o.vpayment_status='C' AND o.order_date = DATE(NOW())";

$orderCntResult = mysql_query($sqlOrdCnt) or die(mysql_error());
if(mysql_num_rows($orderCntResult) > 0)
{
	$ordCntRow = mysql_fetch_object($orderCntResult);
	$totalOrdersTodayCount = mysql_num_rows($orderCntResult);
}

//Week
$totalOrdersWeekCount = 0;
$sqlOrdCnt = "SELECT o.order_id
FROM ".$tableprefix."orders o
INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id
WHERE o.vpayment_status='C' AND YEARWEEK(o.order_date) = YEARWEEK(NOW())  GROUP BY o.order_id";


$orderCntResult = mysql_query($sqlOrdCnt) or die(mysql_error());
if(mysql_num_rows($orderCntResult) > 0)
{
	$ordCntRow = mysql_fetch_object($orderCntResult);
	$totalOrdersWeekCount = mysql_num_rows($orderCntResult);
}

//Month
$totalOrdersMonthCount = 0;
$sqlOrdCnt = "SELECT o.order_id
FROM ".$tableprefix."orders o
INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id
WHERE o.vpayment_status='C' AND date_format(o.order_date,'%Y%m') = date_format(NOW(),'%Y%m')  GROUP BY o.order_id";


$orderCntResult = mysql_query($sqlOrdCnt) or die(mysql_error());
if(mysql_num_rows($orderCntResult) > 0)
{
	$ordCntRow = mysql_fetch_object($orderCntResult);
	$totalOrdersMonthCount = mysql_num_rows($orderCntResult);
}

//Last Month
$totalOrdersLastMonthCount = 0;
$sqlOrdCnt = "SELECT o.order_id
FROM ".$tableprefix."orders o
INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id
AND date_format(o.order_date,'%Y%m') = date_format(NOW() - INTERVAL 1 MONTH, '%Y%m')   WHERE o.vpayment_status='C'   GROUP BY o.order_id";
$orderCntResult = mysql_query($sqlOrdCnt) or die(mysql_error());
if(mysql_num_rows($orderCntResult) > 0)
{
	$ordCntRow = mysql_fetch_object($orderCntResult);
	$totalOrdersLastMonthCount = mysql_num_rows($orderCntResult);
}

if ( $totalOrdersLastMonthCount == 0 )
{
	$totalOrdersChangeCount = $totalOrdersMonthCount ;
}
else if ( $totalOrdersMonthCount == 0 )
{
	$totalOrdersChangeCount = '-'.$totalOrdersLastMonthCount ;
}
else
{
	$totalOrdersChangeCount = ( ( $totalOrdersMonthCount - $totalOrdersLastMonthCount )/ $totalOrdersLastMonthCount )*100 ;
}
//$totalOrdersChangeCount = number_format( $totalOrdersChangeCount,2,".","");



/*
 * Order Counts End
*/

//Amounts

$sellerAmountPending = 0;

$sql = "SELECT SUM(product_price - product_commission_amount) AS totalamount
FROM ".$tableprefix."order_details od
INNER JOIN ".$tableprefix."orders o ON o.order_id = od.order_id
AND o.vpayment_status != 'P'
AND od.item_status = 4";

$orderAmntResult = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($orderAmntResult) > 0)
{
	$row = mysql_fetch_object($orderAmntResult);
	$sellerAmountPending = $row->totalamount > 0 ? $row->totalamount : 0;
	 
}


//Vendor Count

$approveSellers = 0;
$query = "SELECT COUNT(a.artist_id) as totalcount
FROM ".$tableprefix."artists a
WHERE a.vapproved != 'Y' AND a.deleted='N'";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$approveSellers = $row->totalcount;
}


//Today
$totalVendorsTodayCount = 0;

$query = "SELECT COUNT(a.artist_id) as totalcount
FROM ".$tableprefix."artists a
WHERE a.date_registered = DATE(NOW())";
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalVendorsTodayCount = $row->totalcount;
}

//Today
$totalVendorsTodayCount = 0;

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalVendorsTodayCount = $row->totalcount;
}

//Week
$totalVendorsWeekCount = 0;
$query = "SELECT COUNT(a.artist_id) as totalcount
FROM ".$tableprefix."artists a
WHERE YEARWEEK(a.date_registered) = YEARWEEK(NOW())";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalVendorsWeekCount = $row->totalcount;
}

//Month
$totalVendorsMonthCount = 0;
$query = "SELECT COUNT(a.artist_id) as totalcount
FROM ".$tableprefix."artists a
WHERE date_format(a.date_registered,'%Y%m') = date_format(NOW(),'%Y%m')";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalVendorsMonthCount = $row->totalcount;
}


//Last Month
$totalVendorsLastMonthCount = 0;
$query = "SELECT COUNT(a.artist_id) as totalcount
FROM ".$tableprefix."artists a
WHERE date_format(a.date_registered,'%Y%m') = date_format(NOW() - INTERVAL 1 MONTH, '%Y%m')";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalVendorsLastMonthCount = $row->totalcount;
}
//Change


$totalVendorsChangeCount = 0;
if ( $totalVendorsLastMonthCount == 0 )
{
	$totalVendorsChangeCount = $totalVendorsMonthCount ;
}
else if ( $totalVendorsMonthCount == 0 )
{
	$totalVendorsChangeCount = '-'.$totalVendorsLastMonthCount ;
}
else
{
	$totalVendorsChangeCount = ( ( $totalVendorsMonthCount - $totalVendorsLastMonthCount )/ $totalVendorsLastMonthCount )*100 ;
}
//Vendor Count - End

//Products Count

$baseQuery = "SELECT COUNT(p.product_id) as totalcount
FROM ".$tableprefix."products p WHERE ";
 
$query = $baseQuery . " p.date_added = DATE(NOW())";

//Today
$totalProductsTodayCount = 0;

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalProductsTodayCount = $row->totalcount;
}

//Week
$totalProductsWeekCount = 0;
$query = $baseQuery . " YEARWEEK(p.date_added) = YEARWEEK(NOW())";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalProductsWeekCount = $row->totalcount;
}

//Month
$totalProductsMonthCount = 0;
$query = $baseQuery . " date_format(p.date_added,'%Y%m') = date_format(NOW(),'%Y%m')";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalProductsMonthCount = $row->totalcount;
}


//Last Month
$totalProductsLastMonthCount = 0;
$query = $baseQuery . " date_format(p.date_added,'%Y%m') = date_format(NOW() - INTERVAL 1 MONTH, '%Y%m')";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$totalProductsLastMonthCount = $row->totalcount;
}
//Change

$totalProductsChangeCount = 0;
if ( $totalProductsLastMonthCount == 0 )
{
	$totalProductsChangeCount = $totalProductsMonthCount ;
}
else if ( $totalProductsMonthCount == 0 )
{
	$totalProductsChangeCount = '-'.$totalProductsLastMonthCount ;
}
else
{
	$totalProductsChangeCount = ( ( $totalProductsMonthCount - $totalProductsLastMonthCount )/ $totalProductsLastMonthCount )*100 ;
}
//Products Count - End

//Commission
$commissionAmount = 0;
/*$sql = "SELECT sum((od.product_price-(od.product_price*od.product_discount/100) * a.commission/100) * od.product_quantity) as totalamount
 FROM ".$tableprefix."order_details od
INNER JOIN ".$tableprefix."orders o ON o.order_id = od.order_id
AND o.vpayment_status != 'P'
AND o.order_status = 4
INNER JOIN ".$tableprefix."artists a ON a.artist_id = od.artist_id
WHERE od.artist_payment_status = 1";*/

$sql = "SELECT SUM(product_commission_amount) AS adminCommission
FROM ".$tableprefix."order_details od
INNER JOIN ".$tableprefix."orders o ON o.order_id = od.order_id
AND o.vpayment_status != 'P'
AND od.item_status = 4";

$orderAmntResult = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($orderAmntResult) > 0)
{
	$row = mysql_fetch_object($orderAmntResult);
	$commissionAmount = $row->adminCommission > 0 ? $row->adminCommission : 0;
	 
}
//Commission End
$approveAffiliates = 0;
$query = "SELECT COUNT(a.affiliate_id) as totalcount
FROM ".$tableprefix."affiliates a
WHERE a.vapproved != 'Y' AND a.deleted='N'";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$approveAffiliates = $row->totalcount;
}

$approveProducts = 0;
$query = "SELECT COUNT(p.product_id) as totalcount
FROM ".$tableprefix."products p
WHERE p.vapproved != 'Y'  AND p.deleted='N'";

$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_object($result);
	$approveProducts = $row->totalcount;
}

/***************/
$productCountSql = "SELECT COUNT(product_id) AS totalcount
    FROM " . $tableprefix . "products p         
            WHERE 
                p.publish_status = 'N' AND product_category != 1";
$productCountResult = mysql_query($productCountSql) or die(mysql_error());
if (mysql_num_rows($productCountResult) > 0) {
    $uppublishedRow = mysql_fetch_object($productCountResult);
    $unPublishCount = $uppublishedRow->totalcount;
}
/***************/

$sql="select count(r.refund_id) as totalcount
from ".$tableprefix."refunds r
INNER JOIN ".$tableprefix."orders o
ON o.order_id=r.order_id
INNER JOIN ".$tableprefix."artists a ON a.artist_id=r.seller_id
where r.Status is NULL ";

$CountRefundResult = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($CountRefundResult) > 0)
{
	$ordRow = mysql_fetch_object($CountRefundResult);
	$refundCount = $ordRow->totalcount;
}

//Messages Count
$newMessages = 0;
$sql = "SELECT COUNT(message_to_seller_id) AS total
FROM ".$tableprefix."message_to_seller
WHERE `read` ='N'";

$orderAmntResult = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($orderAmntResult) > 0)
{
	$row = mysql_fetch_object($orderAmntResult);
	$newMessages = $row->total;
}
//Messages Count - End

//Seller Feedback Count
$sellerFeedbacks = 0;
$sql = "SELECT COUNT(af.artist_feedback_id) AS total
FROM ".$tableprefix."artist_feedbacks af
INNER JOIN ".$tableprefix."users u ON af.user_id = u.user_id
INNER JOIN ".$tableprefix."artists a ON af.artist_id = a.artist_id
WHERE af.published !='Y'";

$orderAmntResult = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($orderAmntResult) > 0)
{
	$row = mysql_fetch_object($orderAmntResult);
	$sellerFeedbacks = $row->total;
}
//Seller Feedback Count - End

//Site Feedback
$siteFeedbacks = false;
$sql = "SELECT CONCAT(first_name, ' ' ,last_name) AS name,feedback_content, date_added
FROM ".$tableprefix."feedbacks
ORDER BY feedback_id DESC
LIMIT 0,3";

$result = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($result) > 0)
{
	$siteFeedbacks = $result;
}
//Seller Feedback Count - End
include "../includes/htmltop.php";
?>
<script language="javascript" type="text/javascript">
    $(document).ready(function(){
       $(".jqPendingProgress").animate({width:'<?php echo $pendingOrdersPerc ?>%'}, 1500) ;
       $(".jqShippedProgress").animate({width:'<?php echo $shippedOrdersPerc ?>%'}, 1500) ;
       $(".jqDeliveredProgress").animate({width:'<?php echo $deliveredOrdersPerc ?>%'}, 1500) ;
       
    });
    
</script>
<body>
	<center>

		<div align="left" id="layout">

			<!--header area start -->

			<?php

			include_once("../includes/topheader_admin.php")

			?>

			<!--header area end -->


			<div align="left" class="main_body">
				<!--main body start -->

				<?php
				include_once("../includes/admintopmenu.php");
				?>


				<div align="left" class="content_area_dashboard">
					<!--content area start -->

					<div class="admincontent_wrap">

						<div class="adminscnt_top" style="margin-bottom: 21px;">

							<div class="adminscnt_top_lft">

								<div class="adminsct_lft_blk1">
									<h1><?php echo ADMIN_PANEL;?></h1>

									<div class="clear"></div>
								</div>
								<div class="adminsct_lft_blk2">

									<div class="adminlft_blk2_status">
										<h3><?php echo ORDER_STATUS;?></h3>

										<!-- Order Status Bar section start -->
										<div class="status_div">
											<!-- Status Bar Delivered open -->
											<div class="statusshipp_div">
												<div class="statustxt">
													<?php echo DELIVERED;?> <span><?php echo $deliveredOrdersPerc ?>%</span>
												</div>

												<div class="progress_ship">
													<div class="gree_progress jqDeliveredProgress" style="width:<?php echo 0 ?>%">
													</div>
													<div class="clear"></div>
												</div>
												<div class="clear"></div>
											</div>
											<!-- Status Bar Delivered close -->
											<!-- Status Bar Shipped open -->
											<div class="statusshipp_div">
												<div class="statustxt_blue">
													<?php echo SHIPPED;?> <span><?php echo $shippedOrdersPerc ?>%</span>
												</div>

												<div class="progress_ship">
													<div class="blue_progress jqShippedProgress" style="width:<?php echo 0 ?>%">
													</div>
													<div class="clear"></div>
												</div>
												<div class="clear"></div>
											</div>
											<!-- Status Bar Shipped close -->





											<!-- Status Bar Pending open -->
											<div class="statusshipp_div">
												<div class="statustxt_red">
													<?php echo PENDING;?> <span><?php echo $pendingOrdersPerc ?>%</span>
												</div>

												<div class="progress_ship">
													<div class="red_progress jqPendingProgress" style="width:<?php echo 0 ?>%">
													</div>
													<div class="clear"></div>
												</div>
												<div class="clear"></div>
											</div>
											<!-- Status Bar Pending close -->



											<div class="clear"></div>
										</div>
										<!-- Order Status Bar section end -->


									</div>
									<div class="adminlft_blk2_salestotal">
										<h3><?php echo TOTAL_SALES;?></h3>

										<img src="graph_sales.php">

									</div>



									<div class="clear"></div>
								</div>

								<div class="adminsct_lft_blk3">
									<div class="dashboard_recent_orders">
										<h2><?php echo RECENT_ORDERS;?></h2>
										<table width="638" border="0" cellspacing="0" cellpadding="0"
											class="rcnt_orders">
											<tr>
												<th valign="top" align="left"><?php echo ORDER_ID;?></th>
												<th valign="top" align="left"><?php echo USER_NAME;?></th>
												<th valign="top" align="left"><?php echo ORDER_STATUS;?></th>
												<th valign="top" align="left"><?php echo DATE_ADDED;?></th>
												<th valign="top" align="left"><?php echo ORDER_TOTAL;?></th>
												<th width="5%" valign="top" align="left">&nbsp;</th>
											</tr>
											<?php if(mysql_num_rows($orderResult) > 0){ ?>

											<?php while($ordRow = mysql_fetch_array($orderResult)){

												$orderTotal=$ordRow["total"];

												// added for including the shipping total
												/*  $totalshippingcost = 0;
												 $select_shipping_cost = "SELECT sd.vshipping_name, sd.nshipping_cost,od.product_name
												FROM ".$tableprefix."shipping_details sd,".$tableprefix."order_details  od
												WHERE od.product_id=sd.nshp_productid
												AND norder_id = ".$ordRow['order_id']."
												AND nshp_status = 'C'
												GROUP BY sd.nshp_productid order by  od.product_name";

												$result_shipping_cost = mysql_query($select_shipping_cost);
												if(mysql_num_rows($result_shipping_cost) > 0)
												{
												$totalshippingcost = 0;
												while($shipping_row=mysql_fetch_array($result_shipping_cost))
												{
												$totalshippingcost+=$shipping_row['nshipping_cost'];
												}
												}
												$orderTotal += $totalshippingcost;*/

												$link = 'vieworder.php?orderid='.$ordRow["order_id"];

												?>
											<tr>
												<td valign="top" align="left"><?php echo htmlentities($ordRow["order_id"]); ?>
												</td>
												<td valign="top" align="left"><?php echo ($ordRow["user_name"]); ?>
												</td>
												<td valign="top" align="left"><?php echo getOrderStatus($ordRow["order_id"]); ?>
												</td>
												<td valign="top" align="left"><?php echo dateFormat($ordRow["order_date"], "Y-m-d", "m/d/Y") ?>
												</td>
												<td valign="top" align="left"><?php echo $adminSymbol;?>
													&nbsp;<?php echo htmlentities(number_format($orderTotal, 2, '.', '')); ?>
												</td>
												<td><a href="<?php echo $link; ?>"><?php echo VIEW;?></a></td>

											</tr>
											<?php } ?>
											<?php }else{ ?>
											<tr>
												<td valign="top" colspan="5" align="left"><?php echo NO_ORDRES_FOUND;?></td>
											</tr>
											<?php } ?>
										</table>
										<a href="orders.php"><?php echo VIEW_ALL_ORDERS;?></a>
									</div>

									<div class="clear"></div>
								</div>




								<div class="clear"></div>
							</div>

							<div class="adminscnt_top_right">

								<div class="quick_links">
									<div class="brdrcrnr_topleft"></div>
									<div class="brdrcrnr_topright"></div>
									<div class="brdrcrnr_btmleft"></div>
									<div class="brdrcrnr_btmright"></div>

									<ul>
										<li class="approv_sell_icon"><a
											href="sellers.php?rghtMenu=rghtMenu6"><?php echo APPROVE_SELLERS;?> <span>(<?php echo $approveSellers;?>)
											</span>
										</a></li>
										<li class="approv_prod_icon"><a
											href="product_approve.php?rghtMenu=rghtMenu6"><?php echo APPROVE_PRODUCTS;?> <span>(<?php echo $approveProducts;?>)
											</span>
										</a></li>
										<li class="approv_publish_icon"><a
											href="listProducts.php?rghtMenu=rghtMenu5&displayDiv=Product Management"><?php echo PUBLISH_PRODUCTS;?> <span>(<?php echo $unPublishCount;?>)
											</span>
										</a></li>                                                                                
										<li class="approv_affil_icon"><a
											href="affiliates_approval.php?rghtMenu=rghtMenu6htMenu5"><?php echo APPROVE_AFFILIATES;?><span>(<?php echo $approveAffiliates;?>)
											</span>
										</a></li>
										<li class="approv_feedbk_icon"><a
											href="artistfeedbacks.php?rghtMenu=rghtMenu10"><?php echo SELLER_FEEDBACK;?><span>(<?php echo $sellerFeedbacks;?>)
											</span>
										</a></li>
										<li class="rma_icn"><a href="refunds_requests.php"><?php echo RMAS_TO_BE_APPROVED;?> <span>(<?php echo $refundCount;?>)
											</span>
										</a></li>
										<li class="mail_icn"><a href="messages.php"><?php echo EMAIL_FROM_USERS;?> <span>(<?php echo $newMessages;?>)
											</span>
										</a></li>
										<li class="ordr_icn no_brdr"><a href="orders.php"><?php echo ORDERS_TO_BE_SHIPPED;?> <span>(<?php echo $pendingOrders; ?>)
											</span>
										</a></li>
									</ul>

								</div>


								<div class="feedback_listing">
									<h5><?php echo RECENT_SITE_FEEDBACK;?></h5>
									<?php if($siteFeedbacks != false){
										while($row = mysql_fetch_object($siteFeedbacks)){
											?>
									<div class="feedbklist">
										<p>
											<?php echo substr($row->feedback_content,0,80); ?>
										</p>
										<div class="feedbk">
											<p>
												<?php echo $row->name; ?>
											</p>
											<span><?php echo date('m/d/Y', strtotime($row->date_added)); ?>
											</span>
											<div class="clear"></div>
										</div>
										<div class="clear"></div>

									</div>


									<?php }
                                        }else{ ?>
									<?php echo NO_FEEDBACK_FOUND;?>
									<?php } ?>
									<div class="viewlinks">
										<a href="feedbacks.php?rghtMenu=rghtMenu10"><?php echo VIEW_ALL; ?></a>
									</div>

									<div class="clear"></div>
								</div>



								<div class="clear"></div>
							</div>



							<div class="clear"></div>
						</div>


						<div class="adminscnt_btm">
							<div class="dashboard_boxes">
								<div class="dashboard_boxes_hdr">
									<h2><?php echo ORDERS;?></h2>
								</div>
								<table width="90%" border="0" cellspacing="0" cellpadding="0"
									class="dashboard_tble" align="center">
									<tr>
										<td width="50%" align="left" valign="top"><?php echo TODAY;?></td>
										<td valign="top" align="left" width="50%">:&nbsp;<?php echo $totalOrdersTodayCount; ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo THIS_WEEK;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalOrdersWeekCount; ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo THIS_MONTH;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalOrdersMonthCount; ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo LAST_MONTH;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalOrdersLastMonthCount; ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo CHANGE;?> %</td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalOrdersChangeCount; ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo VENDOR_AMOUNT;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $adminSymbol;?>
											&nbsp; <?php echo number_format($sellerAmountPending, 2, '.', ''); ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left" class="row_no_brdr"><?php echo COMMISSION;?></td>
										<td valign="top" align="left" class="row_no_brdr">:&nbsp;<?php echo $adminSymbol;?>
											&nbsp;<?php echo number_format($commissionAmount, 2, '.', ''); ?>
										</td>
									</tr>
								</table>

							</div>
							<div class="dashboard_boxes">
								<div class="dashboard_boxes_hdr">
									<h2><?php echo VENDORS;?></h2>
								</div>
								<table width="90%" border="0" cellspacing="0" cellpadding="0"
									class="dashboard_tble" align="center">
									<tr>
										<td width="50%" align="left" valign="top"><?php echo TODAY;?></td>
										<td valign="top" align="left" width="50%">:<?php echo $totalVendorsTodayCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo THIS_WEEK;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalVendorsWeekCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo THIS_MONTH;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalVendorsMonthCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo LAST_MONTH;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalVendorsLastMonthCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo CHANGE;?> %</td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalVendorsChangeCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left">&nbsp;</td>
										<td valign="top" align="left">&nbsp;</td>
									</tr>
									<tr>
										<td valign="top" align="left" class="row_no_brdr">&nbsp;</td>
										<td valign="top" align="left" class="row_no_brdr">&nbsp;</td>
									</tr>
								</table>

							</div>
							<div class="dashboard_boxes2">
								<div class="dashboard_boxes_hdr">
									<h2><?php echo PRODUCTS;?></h2>
								</div>
								<table width="90%" border="0" cellspacing="0" cellpadding="0"
									class="dashboard_tble" align="center">
									<tr>
										<td width="50%" align="left" valign="top"><?php echo TODAY;?></td>
										<td valign="top" align="left" width="50%">:&nbsp;<?php echo $totalProductsTodayCount; ?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo THIS_WEEK;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalProductsWeekCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo THIS_MONTH;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalProductsMonthCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo LAST_MONTH;?></td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalProductsLastMonthCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left"><?php echo CHANGE;?> %</td>
										<td valign="top" align="left">:&nbsp;<?php echo $totalProductsChangeCount;?>
										</td>
									</tr>
									<tr>
										<td valign="top" align="left">&nbsp;</td>
										<td valign="top" align="left">&nbsp;</td>
									</tr>
									<tr>
										<td valign="top" align="left" class="row_no_brdr">&nbsp;</td>
										<td valign="top" align="left" class="row_no_brdr">&nbsp;</td>
									</tr>
								</table>

							</div>

						</div>


						<div class="clear"></div>
					</div>




					<!--content area ends -->





				</div>

				<div align="left" class="clear_float">
					<img src="images/clear_admin.gif" alt="" width="1" height="1" />
				</div>
				<!--main body end -->
			</div>


			<?php
			include "../includes/footer.php";
			?>