예제 #1
0
 public function buildPathProduct($connection, $productID, $type)
 {
     $objRetailer = new Model_Retailer($connection);
     $inPrices = $objRetailer->getRetailerByProduct($productID);
     //'<a href="#" class="link">Chi tiết sản phẩm</a> =>
     //<a href="#" class="link">Hàng mới từ 12.000.000đ</a> |
     //<span>Hàng mới cũ 10.000.000đ</span> | <a href="#" class="link">Hàng refurbished từ 12.000.000đ</a> ';
     $path = '<a href="' . global_common::buildProductLink($productID) . '" class="link">Chi tiết sản phẩm</a> =>';
     $priceNew = 0;
     $priceUsed = 0;
     $priceRefur = 0;
     foreach ($inPrices as $item) {
         if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_NEW) {
             $priceNew = global_common::FormatPrice($item[global_mapping::Price]);
         }
         if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_USED) {
             $priceUsed = global_common::FormatPrice($item[global_mapping::Price]);
         }
         if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_Refurbished) {
             $priceRefur = global_common::FormatPrice($item[global_mapping::Price]);
         }
     }
     if ($type == global_common::STATUS_PRODUCT_NEW) {
         $path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_NEW) . '" class="link active">Hàng mới từ ' . $priceNew . '</a> | ';
     } else {
         $path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_NEW) . '" class="link">Hàng mới từ ' . $priceNew . '</a> | ';
     }
     if ($type == global_common::STATUS_PRODUCT_USED) {
         $path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_USED) . '" class="link active">Hàng cũ từ ' . $priceUsed . '</a> | ';
     } else {
         $path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_USED) . '" class="link">Hàng cũ từ ' . $priceUsed . '</a> | ';
     }
     if ($type == global_common::STATUS_PRODUCT_Refurbished) {
         $path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_Refurbished) . '" class="link active">Hàng Refurbished từ ' . $priceRefur . '</a>';
     } else {
         $path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_Refurbished) . '" class="link">Hàng Refurbished từ ' . $priceRefur . '</a>';
     }
     return $path;
 }
예제 #2
0
 echo 'Ngày bán';
 echo '</th>';
 echo '<th>';
 echo 'Ngày cập nhật';
 echo '</th>';
 echo '<th>';
 echo 'Action';
 echo '</th>';
 echo '</thead>';
 foreach ($allRetailers as $item) {
     echo '<tr>';
     echo '<td>';
     echo $item[global_mapping::ProductName];
     echo '</td>';
     echo '<td style="padding:0;width:200px">';
     echo global_common::FormatPrice($item[global_mapping::Price]);
     echo '</td>';
     echo '<td>';
     echo $item[global_mapping::CreatedBy][global_mapping::UserName];
     echo '</td>';
     echo '<td>';
     echo global_common::formatDateTimeVN($item[global_mapping::CreatedDate]);
     echo '</td>';
     echo '<td>';
     echo global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]);
     echo '</td>';
     echo '<td style="padding:0;width:180px">';
     echo '<a href="' . global_common::buildRetailerLink($item[global_mapping::RetailerID], true) . '" target="_blank" class="btn btn-mini"> View</a> ';
     if ($item[global_mapping::StatusID] == global_common::STATUS_INACTIVE) {
         echo '<a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_ACTIVE . ', retailer.AdminPage)" class="btn btn-mini">Bán lại</a>';
     } else {
예제 #3
0
									<table class="table table-bordered table-hover article-profile">
										<thead>
											<tr>
												<th class="span4">Tên sản phẩm</th>
												<th class="span2">Giá bán</th>
												<th style="width:120px">Tình trạng</th>
                                                <th style="width:100px">Cập nhật</th>
												<th style="width:120px"></th>
											</tr>
										</thead>
										<tbody>
<?php 
foreach ($allRetailers as $item) {
    echo '								<tr>';
    echo '									<td><a href="' . global_common::buildProductLink($item[global_mapping::ProductID]) . '" >' . $item[global_mapping::ProductName] . '</a></td>';
    echo '									<td class="">' . global_common::FormatPrice($item[global_mapping::Price]) . '</td>';
    echo '									<td class="">' . $item[global_mapping::ProductStatus] . ' ' . $item[global_mapping::StatusDetail] . '</td>';
    echo '									<td >' . global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]) . '</td>';
    echo '									<td class="article-control">';
    echo '										<a href="post_price.php?pid=' . $item[global_mapping::ProductID] . '&rid=' . $item[global_mapping::RetailerID] . '" class="btn btn-mini">Sửa</a>';
    //echo '										<a href="javascript:article.refreshArticle(\''.$item[global_mapping::ArticleID].'\')" class="btn btn-mini">Làm mới</a>';
    echo '										<a href="javascript:retailer.deleteRetailer(\'' . $item[global_mapping::ProductName] . '\',\'' . $item[global_mapping::RetailerID] . '\')" class="btn btn-mini">Xóa</a>';
    if ($item[global_mapping::StatusID] == global_common::STATUS_INACTIVE) {
        echo '							        <a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_INACTIVE . ')" class="btn btn-mini">Bán lại</a>';
    } else {
        echo '							        <a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_ACTIVE . ')" class="btn btn-mini">Dừng bán</a>';
    }
    echo '									</td>';
    echo '								</tr>';
}
?>