-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/z_product.bk.230817/php/goods/
File Upload :
Current File : /var/www/html/z_product.bk.230817/php/goods/skn.list.php

<?
	$skins = $skin->skin ( array ( 'frm' => 'FORM' , 'tr' => 'TR' , 'td' => 'TD' , 'n_td' => 'N TD' , '/tr' => '/TR' , 'category' => 'CATEGORY' ) , $skinfile ) ;

	$info = array(
		'ps'				=> $ps
	) ;
	$now = date('Y-m-d');
	$max_row = 15 ;
	$max_col = 4 ;
	if ( is_numeric($ps)) $max_row = ceil( $ps/$max_col ) ;
	$total['pagesize'] = $max_row * $max_col ;

# event image
	$e_info = array();
	$c_eventQuery = " c1_no = '" . ( empty($c1) ? '0' : $c1 ) . "' and c2_no = '" . ( empty($c2) ? '0' : $c2 ) . "' and c3_no = '" . ( empty($c3) ? '0' : $c3 ) . "' " ;
	if ( !empty($c1)) {
		$event_info = array();
		$e_execute = $exe->qry_one(" from tbl_{$total[table]}_event where c1_no = '{$c1}' and ( display_type = 'Y' or ( display_type = 'P' and begindate >= '{$now}' and enddate <= '{$now}' )) order by numid " , " numid , c1_no , c2_no , c3_no , imagefile , link1 , link2 , link3 , link4 , link5 " ) ;
		while( $brs = $exe->fetch($e_execute)) $event_info[$brs['c1_no'] . '-' . $brs['c2_no'] . '-' . $brs['c3_no']] = $brs ;
		if ( array_key_exists( $c1 . '-' . $c2 . '-' . $c3 , $event_info ) !== false ) $e_info = $event_info[$c1 . '-' . $c2 . '-' . $c3] ;
		else if ( array_key_exists( $c1 . '-' . $c2 . '-0' , $event_info ) !== false ) $e_info = $event_info[$c1 . '-' . $c2 . '-0'] ;
		else if ( array_key_exists( $c1 . '-0-0' , $event_info ) !== false ) $e_info = $event_info[$c1 . '-0-0'] ;
	}
//	$c_eventQuery = " c1_no = '" . ( empty($c1) ? '0' : $c1 ) . "' " ; // and c2_no = '" . ( empty($c2) ? '0' : $c2 ) . "' and c3_no = '" . ( empty($c3) ? '0' : $c3 ) . "' " ;
	//$e_info = $exe->qry_fetch ( " from tbl_{$total[table]}_event where {$c_eventQuery} and ( display_type = 'Y' or ( display_type = 'P' and begindate >= '{$now}' and enddate <= '{$now}' )) order by numid desc limit 1 " , " numid , imagefile , link1 , link2 , link3 , link4 , link5 " ) ;
	if ( !empty($e_info['numid']) && !empty($e_info['imagefile']))
		$title_type['event_image'] = '<img src="/files/event/' . $e_info['imagefile'] . '" usemap="#Event_Map">
			<map name="Event_Map">
			<area shape="rect" coords="4,0,386,260"   ' . ((!empty($e_info['link1']))?'href="' . $e_info['link1'] . '" target="_blank"':'') . '>
			<area shape="rect" coords="388,0,796,259"  ' . ((!empty($e_info['link2']))?'href="' . $e_info['link2'] . '" target="_blank"':'') . '>
			<area shape="rect" coords="801,0,1222,265"  ' . ((!empty($e_info['link3']))?'href="' . $e_info['link3'] . '" target="_blank"':'') . '>
			<area shape="rect" coords="473,120,736,213" ' . ((!empty($e_info['link4']))?'href="' . $e_info['link4'] . '" target="_blank"':'') . '>
			<area shape="rect" coords="473,222,738,313" ' . ((!empty($e_info['link5']))?'href="' . $e_info['link5'] . '" target="_blank"':'') . '>
			</map>' ;

# category
	$info['frm_categories'] = '' ;
	$title_type['navi'] = '' ;
	$topCateRep = array() ;
	if ( !empty($c1)) {
		if ( !empty($c2)) {
			$title_type['navi'] = '<a href="?c1=' . $c1 . '&c2=' . $c2 . '">' . $define_shop['ºÐ·ù'][$c1][1][$c2][0] . '</a>' ;
			 /*
			if ( empty($c3)) {
				$cateExe = $exe->qry_one(" from tbl_{$total[table]}_category where c1_no = '{$c1}' and c2_no = '{$c2}' order by sequence " , " numid , title " ) ;
				while ( $rs = $exe->fetch($cateExe)) {
					$topCateRep[] = '<a href="?c1=' . $c1 . '&c2=' . $c2 . '&c3=' . $rs['numid'] . '">' . $rs['title'] . '</a>' ;
				}
			} else {
				$cate3Depth = $exe->qry_fetch(" from tbl_{$total[table]}_category where c1_no = '{$c1}' and c2_no = '{$c2}' and numid = '{$c3}' " , " title " , "title" ) ;
				$title_type['navi'] .= empty($cate3Depth) ? '' : ' > <a href="?c1=' . $c1 . '&c2=' . $c2 . '&c3=' . $c3 . '">' . $cate3Depth . '</a>' ;
			}
			 *
			 */

			$cateExe = $exe->qry_one(" from tbl_{$total[table]}_category where c1_no = '{$c1}' and c2_no = '{$c2}' order by sequence " , " numid , title " ) ;
			while ( $rs = $exe->fetch($cateExe)) {
				$topCateRep[] = '<a href="?c1=' . $c1 . '&c2=' . $c2 . '&c3=' . $rs['numid'] . '">' . $rs['title'] . '</a>' ;
				if ( $rs['numid'] == $c3) {
					$title_type['navi'] .= empty($rs['title']) ? '' : ' > <a href="?c1=' . $c1 . '&c2=' . $c2 . '&c3=' . $c3 . '">' . $rs['title'] . '</a>' ;
				}
			}
		} else {
			$title_type['navi'] = '<a href="?c1=' . $c1 . '">' . $define_shop['ºÐ·ù'][$c1][0] . '</a>' ;
			foreach ( $define_shop['ºÐ·ù'][$c1][1] as $rs_no => $rs ) {
				$topCateRep[] = '<a href="?c1=' . $c1 . '&c2=' . $rs_no . '">' . $rs[0] . '</a>' ;
			}
		}
	}
	$info['frm_categories']  = count($topCateRep) > 0 ? str_foreach ( array( 'repeat' => implode('<!--span></span-->' , $topCateRep) ) , 'INFO' , $skins['category'] ) : '' ;

# order
	$oQuery = '' ;
	switch ( $ot ) {
		case 'title' : // »óǰ¸í¼ø
			$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' it.title asc ' ; break ;
		case 'asc' : // ³·Àº °¡°Ý¼ø
			$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' ( it.g_price + it.topprice + it.botprice ) asc ' ; break ;
		case 'desc' : // ³ôÀº °¡°Ý¼ø
			$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' ( it.g_price + it.topprice + it.botprice ) desc ' ; break ;
		case 'brand' : // ¾÷üº°¼ø
			$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' it.g_brand asc ' ; break ;
		case 'pop' : // ÀÎ±â¼ø
			$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' it.salecount desc ' ; break ;
		case 'new' : // µî·Ï¼ø
			$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' it.numid desc ' ; break ;
		default : // ¼ø¼­º°
			break ;
	}
	$oQuery .= (empty($oQuery) ? '' : ' , ' ) . ' it.seq desc ' ;

# search Query
	$wQuery = array() ;
	$wQuery[] = " it.openstate = 'Y' " ;    // °ø°³µÈ »óǰ
	if ( !empty($c3)) 		$wQuery[] = " numid in ( select DISTINCT goods_no from tbl_{$total[table]}_itemc as itc where c1_no = '{$c1}' and c2_no = '{$c2}' and c3_no = '{$c3}' ) " ;
	else if ( !empty($c2)) $wQuery[] = " numid in ( select DISTINCT goods_no from tbl_{$total[table]}_itemc as itc where c1_no = '{$c1}' and c2_no = '{$c2}' ) " ;
	else if ( !empty($c1)) $wQuery[] = " numid in ( select DISTINCT goods_no from tbl_{$total[table]}_itemc as itc where c1_no = '{$c1}' ) " ;

	if ( $total['mode'] == 'search' ) {
		$title_type['navi'] = '°Ë»ö°á°ú' ;
		if ( !empty($search)) {
			$search = trim($search);
			$tSearch = explode(' ' , $search) ;
			$tSearch = array_unique ($tSearch);
			foreach ( $tSearch as $k=>$v ) { if ( empty($v)) unset($tSearch[$v]) ; }
			$wQuery[] = " it.searchkeyword " . ( count($tSearch) > 0 ? " REGEXP '" . implode('|' , str_replace('(','',$tSearch)) . "' " : " LIKE '%" . implode(' ' , $tSearch) . "' " ) ;
		}
	}

# get data
	$total = $exe->qry_list(" from tbl_{$total[table]}_item as it " . ( count($wQuery) > 0 ? ' where ' . implode( ' and ' , $wQuery ) : '' ) . ' order by ' . $oQuery ,
										    " it.numid , it.imglist , it.title , it.g_normalp , it.g_point , it.g_price , it.topprice , it.botprice , it.salestate , it.selecticons " , $total ) ;
	$rs = $exe->fetch($total['execute']) ;
	$repeat = '' ;
	if ( !empty($rs['numid'])) {
		for ( $i = 0 ; $i < $max_row ; $i++ ) {
			$repeat.= $skins['tr'] ;
			for ( $j = 0 ; $j < $max_col ; $j++ ) {
				if ( empty($rs['numid'])) { $repeat.= $skins['n_td'] ; continue ; }
				$rs['imglist'] = empty($rs['imglist']) ?  '' : create_image( 'files/' . $total['options']['list_dir'] . '/' . $rs['imglist'] , $total['options']['list_w'] , $total['options']['list_h']) ;
				$rs['w'] = $total['options']['list_w']  + 20 ;
				$rs['h'] = $total['options']['list_h']  + 10 ;
				$rs['sumprice'] = $rs['salestate'] == '1' ? '<strike>' . number_format($rs['g_normalp']) . '</strike>' . number_format($rs['g_price'] + $rs['topprice'] + $rs['botprice']) . '' : '<span style="color:#48BC2D">' . $define_shop['»óÅÂ'][$rs['salestate']] . '</span>' ;
				$rs['sumpoint'] = $rs['g_point'] == 'Y' && $rs['salestate'] == '1' ? '<img src="/img/icon_point.gif" style="vertical-align:top">' . number_format(($rs['g_price'] + $rs['topprice'] + $rs['botprice'])*$define_shop_point_p) : '' ;
				$rs['title'] = str_cut($rs['title'] . '' , 300)  ;
				$title_len = 20 ;
				if ( !empty($rs['selecticons'])) {
					$act_icons = explode( ',' , $rs['selecticons'] );
					$rs['selecticons'] = '<div style="padding-bottom:5px;">' ;
					foreach ( $act_icons as $v ) {
						$rs['selecticons'].= $define_shop_icons[$v] . ' ' ;
					}
					$rs['selecticons'].= '</div>' ;
				}
				$repeat.= str_foreach($rs , 'RS' , $skins['td']) ;
				$rs = $exe->fetch($total['execute']) ;
			}
			$repeat.= $skins['/tr'] ;
			if ( empty($rs['numid'])) break ;
		}
	}
	$info['repeat'] = $repeat ;
	$total = $exe->paging( $total['cmnval'] . ( $total['cmnval'] == $total['selfurl'] ? '?' : '&' ) . 'mode=' . $total['mode'] , $total ) ;
	$result = str_foreach( $info , 'INFO' , $skins['frm']) ;

?>

Copyright © 2017 || Recoded By Mr.Bumblebee