public function getTitle($cat = 6, $nsx = 0) { if ($cat != 0) { $sql = $this->db->query("SELECT dtitle, dparent FROM " . $this->db->dbprefix('danhsach') . " WHERE did='{$cat}'"); $row = $sql->row_array(); if (count($row) > 0 && $row['dparent'] == 0) { $title_arr['text'] = array($row['dtitle']); if ($nsx != 0) { $title_arr['link'] = array(link_cat($cat) . link_nsx($nsx)); } else { $title_arr['link'] = array(link_cat($cat)); } } else { $sqlsub = $this->db->query("SELECT dtitle FROM " . $this->db->dbprefix('danhsach') . " WHERE did='{$row['dparent']}'"); $rowsub = $sqlsub->row_array(); $title_arr['text'] = array($rowsub['dtitle'], $row['dtitle']); if ($nsx != 0) { $title_arr['link'] = array(link_cat($row['dparent'] . link_nsx($nsx)), link_cat($cat) . link_nsx($nsx)); } else { $title_arr['link'] = array(link_cat($row['dparent']), link_cat($cat)); } $this->where .= " AND sploai='{$cat}'"; } return $title_arr; } }
function link_detail($spid = 0, $name = '', $cat = 6, $nid = 0) { $CI = get_instance(); $CI->load->model('mleft'); $path = base_url() . 'detail/' . remove_tv($name) . '/' . $spid . '/' . remove_tv($CI->mleft->getTitleCat($cat)) . '/' . $cat; if ($nid != 0) { $path .= link_nsx($nid); } return $path; }
} else { $temp = "<div class=\"bline fl\"></div>"; } if ($j == $check) { $temp = ""; } echo $temp; $j++; } } ?> </div> <div style="text-align:center;"> Bạn đang xem trang <select style="border:1px #c6c6c6 solid; width:50px" size="1" onchange="window.location='<?php echo link_cat($cat) . link_nsx($seg_nsx) . "/priceup/{$priceup}/pricedown/{$pricedown}"; ?> /page/'+this.options[this.selectedIndex].value;"> <?php $j = 1; for (; $j <= $product['num_pages']; ++$j) { if ($j == $page) { echo "<option value=\"" . $j . "\" selected style=\"font-weight:bold\">{$j}</option>"; } else { echo "<option value=\"" . $j . "\">{$j}</option>"; } } ?> </select> </div> </div>
<div class="ttblock"><b>Chọn theo giá sản phẩm (VNĐ) </b></div> <?php if (isset($price)) { if ($priceup != 0) { $price_select = "<a href=\"" . link_cat($cat) . link_nsx($seg_nsx) . "/priceup/0/pricedown/0" . "\" title=\"Bỏ chọn\"><img src=\"" . base_url('/style/images/delicon.png') . "\" width=\"17\" style=\"cursor:pointer;margin-left:10px\" align=\"absmiddle\"></a>"; } else { $price_select = ""; } $price['dgia05'] = $price['dgia04'] + 1; if (isset($priceup) && $priceup == 0) { echo "<div class=\"line\"><a href=\"" . link_cat($cat) . link_nsx($seg_nsx) . "/priceup/1/pricedown/" . $price['dgia01'] . "\">Dưới " . number_format($price['dgia01'], 0, ",", ".") . "</a></div>"; echo "<div class=\"line\"><a href=\"" . link_cat($cat) . link_nsx($seg_nsx) . "/priceup/" . $price['dgia01'] . "/pricedown/" . $price['dgia02'] . "\">" . number_format($price['dgia01'], 0, ",", ".") . " -> " . number_format($price['dgia02'], 0, ",", ".") . "</a></div>"; echo "<div class=\"line\"><a href=\"" . link_cat($cat) . link_nsx($seg_nsx) . "/priceup/" . $price['dgia02'] . "/pricedown/" . $price['dgia03'] . "\">" . number_format($price['dgia02'], 0, ",", ".") . " -> " . number_format($price['dgia03'], 0, ",", ".") . "</a></div>"; echo "<div class=\"line\"><a href=\"" . link_cat($cat) . link_nsx($seg_nsx) . "/priceup/" . $price['dgia03'] . "/pricedown/" . $price['dgia04'] . "\">" . number_format($price['dgia03'], 0, ",", ".") . " -> " . number_format($price['dgia04'], 0, ",", ".") . "</a></div>"; echo "<div class=\"line\"><a href=\"" . link_cat($cat) . link_nsx($seg_nsx) . "/priceup/" . $price['dgia05'] . "/pricedown/" . $price['dgia05'] . "\">Trên " . number_format($price['dgia04'], 0, ",", ".") . "</a></div>"; } else { if ($priceup == 1) { echo "<div class=\"line\"><a href=\"#\">Dưới " . number_format($price['dgia01'], 0, ",", ".") . "</a>{$price_select}</div>"; } if ($priceup == $price['dgia01']) { echo "<div class=\"line\"><a href=\"#\">" . number_format($price['dgia01'], 0, ",", ".") . " -> " . number_format($price['dgia02'], 0, ",", ".") . "</a>{$price_select}</div>"; } if ($priceup == $price['dgia02']) { echo "<div class=\"line\"><a href=\"#\">" . number_format($price['dgia02'], 0, ",", ".") . " -> " . number_format($price['dgia03'], 0, ",", ".") . "</a>{$price_select}</div>"; } if ($priceup == $price['dgia03']) { echo "<div class=\"line\"><a href=\"#\">" . number_format($price['dgia03'], 0, ",", ".") . " -> " . number_format($price['dgia04'], 0, ",", ".") . "</a>{$price_select}</div>"; } if ($priceup == $price['dgia05']) { echo "<div class=\"line\"><a href=\"#\">Trên " . number_format($price['dgia04'], 0, ",", ".") . "</a>{$price_select}</div>";