#378 분류 출력순서 추가

This commit is contained in:
chicpro
2014-06-03 15:56:09 +09:00
parent bb368956c7
commit 281c9ad87e
22 changed files with 53 additions and 26 deletions

View File

@ -104,6 +104,13 @@ if(!sql_query(" select ca_skin_dir from {$g5['g5_shop_category_table']} limit 1
ADD `ca_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_name`,
ADD `ca_mobile_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_skin_dir` ", true);
}
// 분류 출력순서 필드 추가
if(!sql_query(" select ca_order from {$g5['g5_shop_category_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
ADD `ca_order` int(11) NOT NULL DEFAULT '0' AFTER `ca_name` ", true);
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}` ADD INDEX(`ca_order`) ", true);
}
?>
<form name="fcategoryform" action="./categoryformupdate.php" onsubmit="return fcategoryformcheck(this);" method="post" enctype="multipart/form-data">
@ -147,6 +154,13 @@ if(!sql_query(" select ca_skin_dir from {$g5['g5_shop_category_table']} limit 1
<th scope="row"><label for="ca_name">분류명</label></th>
<td><input type="text" name="ca_name" value="<?php echo $ca['ca_name']; ?>" id="ca_name" size="38" required class="required frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="ca_order">출력순서</label></th>
<td>
<?php echo help("숫자가 작을 수록 상위에 출력됩니다. 음수 입력도 가능하며 입력 가능 범위는 -2147483648 부터 2147483647 까지입니다.\n<b>입력하지 않으면 자동으로 출력됩니다.</b>"); ?>
<input type="text" name="ca_order" value="<?php echo $ca['ca_order']; ?>" id="ca_order" class="frm_input" size="12">
</td>
</tr>
<tr>
<th scope="row"><?php if ($is_admin == 'super') { ?><label for="ca_mb_id"><?php } ?>관리 회원아이디<?php if ($is_admin == 'super') { ?></label><?php } ?></th>
<td>

View File

@ -40,7 +40,8 @@ $g5['category_path'] = G5_DATA_PATH."/category";
if ($ca_image1_del) @unlink("{$g5['category_path']}/{$ca_id}_1");
if ($ca_image0_del) @unlink("{$g5['category_path']}/{$ca_id}_0");
$sql_common = " ca_skin_dir = '$ca_skin_dir',
$sql_common = " ca_order = '$ca_order',
ca_skin_dir = '$ca_skin_dir',
ca_mobile_skin_dir = '$ca_mobile_skin_dir',
ca_skin = '$ca_skin',
ca_mobile_skin = '$ca_mobile_skin',

View File

@ -111,6 +111,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<th scope="col" id="sct_imgw">이미지 폭</th>
<th scope="col" id="sct_imgh">이미지 높이</th>
<th scope="col" id="sct_imgcol">1행이미지수</th>
<th scope="col" id="sct_mobileimg">모바일이미지수</th>
<th scope="col" id="sct_pcskin">PC스킨지정</th>
<th scope="col" rowspan="2">관리</th>
</tr>
@ -120,6 +121,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<th scope="col" id="sct_hpcert">본인인증</th>
<th scope="col" id="sct_adultcert">성인인증</th>
<th scope="col" id="sct_imgrow">이미지 행수</th>
<th scope="col" id="sct_order">순서</th>
<th scope="col" id="sct_mskin">모바일스킨지정</th>
</tr>
</thead>
@ -179,6 +181,10 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<label for="ca_lineimg_num<?php echo $i; ?>" class="sound_only">1줄당 이미지 수</label>
<input type="text" name="ca_list_mod[<?php echo $i; ?>]" size="3" value="<?php echo $row['ca_list_mod']; ?>" id="ca_lineimg_num<?php echo $i; ?>" required class="required frm_input"> <span class="sound_only">개</span>
</td>
<td headers="sct_mobileimg" class="td_output">
<label for="ca_mobileimg_num<?php echo $i; ?>" class="sound_only">모바일 이미지 수</label>
<input type="text" name="ca_mobile_list_mod[<?php echo $i; ?>]" size="3" value="<?php echo $row['ca_mobile_list_mod']; ?>" id="ca_mobileimg_num<?php echo $i; ?>" required class="required frm_input"> <span class="sound_only">개</span>
</td>
<td headers="sct_pcskin">
<label for="ca_skin_dir<?php echo $i; ?>" class="sound_only">PC스킨폴더</label>
<select id="ca_skin_dir<?php echo $i; ?>" name="ca_skin_dir[<?php echo $i; ?>]" class="skin_dir">
@ -222,6 +228,10 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<label for="ca_imgline_num<?php echo $i; ?>" class="sound_only">이미지 줄 수</label>
<input type="text" name="ca_list_row[<?php echo $i; ?>]" value='<?php echo $row['ca_list_row']; ?>' id="ca_imgline_num<?php echo $i; ?>" required class="required frm_input" size="3"> <span class="sound_only">줄</span>
</td>
<td headers="sct_order" class="td_output">
<label for="ca_order<?php echo $i; ?>" class="sound_only">출력순서</label>
<input type="text" name="ca_order[<?php echo $i; ?>]" value='<?php echo $row['ca_order']; ?>' id="ca_order<?php echo $i; ?>" required class="required frm_input" size="3">
</td>
<td headers="sct_mskin">
<label for="ca_mobile_skin_dir<?php echo $i; ?>" class="sound_only">모바일스킨폴더</label>
<select id="ca_mobile_skin_dir<?php echo $i; ?>" name="ca_mobile_skin_dir[<?php echo $i; ?>]" class="skin_dir">
@ -234,7 +244,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
</td>
</tr>
<?php }
if ($i == 0) echo "<tr><td colspan=\"8\" class=\"empty_table\">자료가 한 건도 없습니다.</td></tr>\n";
if ($i == 0) echo "<tr><td colspan=\"9\" class=\"empty_table\">자료가 한 건도 없습니다.</td></tr>\n";
?>
</tbody>
</table>

View File

@ -18,6 +18,7 @@ for ($i=0; $i<count($_POST['ca_id']); $i++)
$sql = " update {$g5['g5_shop_category_table']}
set ca_name = '{$_POST['ca_name'][$i]}',
ca_order = '{$_POST['ca_order'][$i]}',
ca_mb_id = '{$_POST['ca_mb_id'][$i]}',
ca_img_width = '{$_POST['ca_img_width'][$i]}',
ca_list_mod = '{$_POST['ca_list_mod'][$i]}',

View File

@ -27,14 +27,14 @@ if($_GET['sch_target'] == 1) {
if($_GET['sch_word'])
$sql_where .= " and ca_name like '%$sch_word%' ";
$sql_select = " select ca_id as t_id, ca_name as t_name ";
$sql_order = " order by ca_name ";
$sql_order = " order by ca_order, ca_name ";
} else {
$sql_common = " from {$g5['g5_shop_item_table']} ";
$sql_where = " where it_use = '1' and it_nocoupon = '0' ";
if($_GET['sch_word'])
$sql_where .= " and it_name like '%$sch_word%' ";
$sql_select = " select it_id as t_id, it_name as t_name ";
$sql_order = " order by it_name ";
$sql_order = " order by it_order, it_name ";
}
// 테이블의 전체 레코드수만 얻음

View File

@ -49,7 +49,7 @@ $category_select = '';
$sql = " select * from {$g5['g5_shop_category_table']} ";
if ($is_admin != 'super')
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
$sql .= " order by ca_id ";
$sql .= " order by ca_order, ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

View File

@ -96,7 +96,7 @@ if($ev_id) {
<select name="sel_ca_id" id="sel_ca_id">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++)
{

View File

@ -19,7 +19,7 @@ if ($w == "")
$it['ca_id3'] = get_cookie("ck_ca_id3");
if (!$it['ca_id'])
{
$sql = " select ca_id from {$g5['g5_shop_category_table']} order by ca_id limit 1 ";
$sql = " select ca_id from {$g5['g5_shop_category_table']} order by ca_order, ca_id limit 1 ";
$row = sql_fetch($sql);
if (!$row['ca_id'])
alert("등록된 분류가 없습니다. 우선 분류를 등록하여 주십시오.", './categorylist.php');
@ -70,7 +70,7 @@ $script = '';
$sql = " select * from {$g5['g5_shop_category_table']} ";
if ($is_admin != 'super')
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
$sql .= " order by ca_id ";
$sql .= " order by ca_order, ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
@ -1321,7 +1321,7 @@ $(function(){
$sql = " select * from {$g5['g5_shop_category_table']} ";
if ($is_admin != 'super')
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
$sql .= " order by ca_id ";
$sql .= " order by ca_order, ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

View File

@ -12,7 +12,7 @@ $ca_list = '<option value="">선택</option>'.PHP_EOL;
$sql = " select * from {$g5['g5_shop_category_table']} ";
if ($is_admin != 'super')
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
$sql .= " order by ca_id ";
$sql .= " order by ca_order, ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
@ -105,7 +105,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sca" id="sca">
<option value="">전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=sql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -68,7 +68,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sca" id="sca">
<option value="">전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -73,7 +73,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sel_ca_id" id="sel_ca_id">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -68,7 +68,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sel_ca_id" id="sel_ca_id">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -92,7 +92,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sca" id="sca">
<option value="">전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=sql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -68,7 +68,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sca" id="sca">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -69,7 +69,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sel_ca_id" id="sel_ca_id">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -64,7 +64,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<select name="sel_ca_id" id="sel_ca_id">
<option value=''>전체분류</option>
<?php
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_id ";
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
$result1 = sql_query($sql1);
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
$len = strlen($row1['ca_id']) / 2 - 1;

View File

@ -115,7 +115,8 @@ CREATE TABLE IF NOT EXISTS `g5_shop_category` (
`ca_8` varchar(255) NOT NULL DEFAULT '',
`ca_9` varchar(255) NOT NULL DEFAULT '',
`ca_10` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`ca_id`)
PRIMARY KEY (`ca_id`),
KEY `ca_order` (`ca_order`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------

View File

@ -16,7 +16,7 @@ if($ca) {
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']}
$sql_where
and ca_use = '1'
order by ca_id ";
order by ca_order, ca_id ";
$result = sql_query($sql);
?>

View File

@ -11,14 +11,14 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
<ul id="gnb_1dul">
<?php
// 1단계 분류 판매 가능한 것만
$hsql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where length(ca_id) = '2' and ca_use = '1' order by ca_id ";
$hsql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where length(ca_id) = '2' and ca_use = '1' order by ca_order, ca_id ";
$hresult = sql_query($hsql);
$gnb_zindex = 999; // gnb_1dli z-index 값 설정용
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
$gnb_zindex -= 1; // html 구조에서 앞선 gnb_1dli 에 더 높은 z-index 값 부여
// 2단계 분류 판매 가능한 것만
$sql2 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where LENGTH(ca_id) = '4' and SUBSTRING(ca_id,1,2) = '{$row['ca_id']}' and ca_use = '1' order by ca_id ";
$sql2 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where LENGTH(ca_id) = '4' and SUBSTRING(ca_id,1,2) = '{$row['ca_id']}' and ca_use = '1' order by ca_order, ca_id ";
$result2 = sql_query($sql2);
$count = mysql_num_rows($result2);
?>

View File

@ -8,7 +8,7 @@ $ca_id_len = strlen($ca_id);
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_id ";
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {

View File

@ -22,7 +22,7 @@ if (!$exists) {
$row = sql_fetch($sql);
$cnt = $row['cnt'];
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$tmp_ca_id%' and ca_use = '1' and length(ca_id) = $len2 order by ca_id ";
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$tmp_ca_id%' and ca_use = '1' and length(ca_id) = $len2 order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$sct_ct_here = '';
@ -32,7 +32,7 @@ if (!$exists) {
$str .= '<li>';
if ($cnt) {
$str .= '<a href="./list.php?ca_id='.$row['ca_id'].'" class="sct_ct_parent '.$sct_ct_here.'">'.$row['ca_name'].'</a>';
$sql2 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '{$row['ca_id']}%' and ca_use = '1' and length(ca_id) = $len4 order by ca_id ";
$sql2 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '{$row['ca_id']}%' and ca_use = '1' and length(ca_id) = $len4 order by ca_order, ca_id ";
$result2 = sql_query($sql2);
$k=0;
while ($row2=sql_fetch_array($result2)) {

View File

@ -6,7 +6,7 @@ $exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '${depth2_ca_id}%' and length(ca_id) = 4 and ca_use = '1' order by ca_id ";
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '${depth2_ca_id}%' and length(ca_id) = 4 and ca_use = '1' order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
if (preg_match("/^{$row['ca_id']}/", $ca_id))