Merge branch 'master' of github.com:gnuboard/yc5

This commit is contained in:
whitedot
2014-01-28 18:20:04 +09:00
18 changed files with 582 additions and 36 deletions

View File

@ -206,7 +206,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
</td>
</tr>
<?php }
if ($i == 0) echo "<tr><td colspan=\"7\" class=\"empty_table\">자료가 한 건도 없습니다.</td></tr>\n";
if ($i == 0) echo "<tr><td colspan=\"8\" class=\"empty_table\">자료가 한 건도 없습니다.</td></tr>\n";
?>
</tbody>
</table>

View File

@ -289,15 +289,22 @@ if (mysql_num_rows($result) == 0)
$cnt = $sub_tot_qty = $sub_tot_price = 0;
while ($row2 = sql_fetch_array($res2))
{
if($row2['io_type'])
if($row2['io_type']) {
$it_price = $row2['io_price'];
$row2_tot_price = $row2['io_price'] * $row2['ct_qty'];
else
} else {
$it_price = $row2['ct_price'] + $row2['io_price'];
$row2_tot_price = ($row2['ct_price'] + $row2['io_price']) * $row2['ct_qty'];
}
$sub_tot_qty += $row2['ct_qty'];
$sub_tot_price += $row2_tot_price;
$it_name = stripslashes($row2['it_name']);
$it_name = "$it_name ({$row2['ct_option']})";
$price_plus = '';
if($row2['io_price'] >= 0)
$price_plus = '+';
$it_name = "$it_name ({$row2['ct_option']} ".$price_plus.display_price($row2['io_price']).")";
$ct_send_cost = ($row2['ct_send_cost'] ? '착불' : '선불');
$fontqty1 = $fontqty2 = "";
@ -310,18 +317,35 @@ if (mysql_num_rows($result) == 0)
?>
<tr>
<td><?php echo $it_name; ?></td>
<td class="td_num"><?php echo number_format($row2['ct_price']); ?></td>
<td class="td_num"><?php echo number_format($it_price); ?></td>
<td class="td_cntsmall"><?php echo $fontqty1; ?><?php echo number_format($row2['ct_qty']); ?><?php echo $fontqty2; ?></td>
<td class="td_num td_numsum"><?php echo number_format($row2_tot_price); ?></td>
<td class="td_sendcost_by"><?php echo $ct_send_cost; ?></td>
</tr>
<?php $cnt++; } ?>
<?php
$cnt++;
}
?>
<tr>
<td>배송비</td>
<td class="td_num"><?php echo number_format($row1['od_send_cost']); ?></td>
<td class="td_cntsmall"><?php echo $fontqty1; ?>1<?php echo $fontqty2; ?></td>
<td class="td_num td_numsum"><?php echo number_format($row1['od_send_cost']); ?></td>
<td class="td_sendcost_by"></td>
</tr>
<tr>
<td>추가 배송비</td>
<td class="td_num"><?php echo number_format($row1['od_send_cost2']); ?></td>
<td class="td_cntsmall"><?php echo $fontqty1; ?>1<?php echo $fontqty2; ?></td>
<td class="td_num td_numsum"><?php echo number_format($row1['od_send_cost2']); ?></td>
<td class="td_sendcost_by"></td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row" colspan="2">합계</th>
<td><?php echo number_format($sub_tot_qty); ?></td>
<td><?php echo number_format($sub_tot_price); ?></td>
<td><?php echo number_format($sub_tot_qty + 2); ?></td>
<td><?php echo number_format($sub_tot_price + $row1['od_send_cost'] + $row1['od_send_cost2']); ?></td>
<td></td>
</tr>
</tfoot>

View File

@ -21,7 +21,10 @@ function print_line($save)
<td class="td_numsum"><?php echo number_format($save['orderprice']); ?></td>
<td class="td_numcoupon"><?php echo number_format($save['ordercoupon']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptbank']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptvbank']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptiche']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptcard']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receipthp']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptpoint']); ?></td>
<td class="td_numcancel1"><?php echo number_format($save['ordercancel']); ?></td>
<td class="td_numrdy"><?php echo number_format($save['misu']); ?></td>
@ -55,8 +58,11 @@ $result = sql_query($sql);
<th scope="col">주문수</th>
<th scope="col">주문합계</th>
<th scope="col">쿠폰</th>
<th scope="col">계좌입금</th>
<th scope="col">무통장</th>
<th scope="col">가상계좌</th>
<th scope="col">계좌이체</th>
<th scope="col">카드입금</th>
<th scope="col">휴대폰</th>
<th scope="col">포인트입금</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
@ -81,8 +87,14 @@ $result = sql_query($sql);
$save['orderprice'] += $row['orderprice'];
$save['ordercancel'] += $row['od_cancel_price'];
$save['ordercoupon'] += $row['couponprice'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
if($row['od_settle_case'] == '무통장')
$save['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$save['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$save['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$save['receipthp'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_price'];
$save['receiptpoint'] += $lines[$i]['od_receipt_point'];
@ -92,8 +104,14 @@ $result = sql_query($sql);
$tot['orderprice'] += $row['orderprice'];
$tot['ordercancel'] += $row['od_cancel_price'];
$tot['ordercoupon'] += $row['couponprice'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
if($row['od_settle_case'] == '무통장')
$tot['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$tot['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$tot['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$tot['receipthp'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_price'];
$tot['receiptpoint '] += $row['od_receipt_point'];
@ -101,7 +119,7 @@ $result = sql_query($sql);
}
if ($i == 0) {
echo '<tr><td colspan="9" class="empty_table">자료가 없습니다.</td></tr>';
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
} else {
print_line($save);
}
@ -114,7 +132,10 @@ $result = sql_query($sql);
<td><?php echo number_format($tot['orderprice']); ?></td>
<td><?php echo number_format($tot['ordercoupon']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptvbank']); ?></td>
<td><?php echo number_format($tot['receiptiche']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receipthp']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>

View File

@ -21,7 +21,10 @@ function print_line($save)
<td class="td_numsum"><?php echo number_format($save['orderprice']); ?></td>
<td class="td_numcoupon"><?php echo number_format($save['ordercoupon']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptbank']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptvbank']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptiche']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptcard']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receipthp']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptpoint']); ?></td>
<td class="td_numcancel1"><?php echo number_format($save['ordercancel']); ?></td>
<td class="td_numrdy"><?php echo number_format($save['misu']); ?></td>
@ -56,8 +59,11 @@ $result = sql_query($sql);
<th scope="col">주문수</th>
<th scope="col">주문합계</th>
<th scope="col">쿠폰</th>
<th scope="col">계좌입금</th>
<th scope="col">무통장</th>
<th scope="col">가상계좌</th>
<th scope="col">계좌이체</th>
<th scope="col">카드입금</th>
<th scope="col">휴대폰</th>
<th scope="col">포인트입금</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
@ -82,8 +88,14 @@ $result = sql_query($sql);
$save['orderprice'] += $row['orderprice'];
$save['ordercancel'] += $row['od_cancel_price'];
$save['ordercoupon'] += $row['couponprice'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
if($row['od_settle_case'] == '무통장')
$save['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$save['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$save['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$save['receipthp'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_price'];
$save['receiptpoint'] += $row['od_receipt_point'];
@ -93,8 +105,14 @@ $result = sql_query($sql);
$tot['orderprice'] += $row['orderprice'];
$tot['ordercancel'] += $row['od_cancel_price'];
$tot['ordercoupon'] += $row['couponprice'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
if($row['od_settle_case'] == '무통장')
$tot['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$tot['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$tot['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$tot['receipthp'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_price'];
$tot['receiptpoint'] += $row['od_receipt_point'];
@ -102,7 +120,7 @@ $result = sql_query($sql);
}
if ($i == 0) {
echo '<tr><td colspan="9" class="empty_table">자료가 없습니다.</td></tr>';
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
} else {
print_line($save);
}
@ -115,7 +133,10 @@ $result = sql_query($sql);
<td><?php echo number_format($tot['orderprice']); ?></td>
<td><?php echo number_format($tot['ordercoupon']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptvbank']); ?></td>
<td><?php echo number_format($tot['receiptiche']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receipthp']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>

View File

@ -35,8 +35,11 @@ $result = sql_query($sql);
<th scope="col">주문자</th>
<th scope="col">주문합계</th>
<th scope="col">쿠폰</th>
<th scope="col">계좌입금</th>
<th scope="col">무통장</th>
<th scope="col">가상계좌</th>
<th scope="col">계좌이체</th>
<th scope="col">카드입금</th>
<th scope="col">휴대폰</th>
<th scope="col">포인트입금</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
@ -53,9 +56,15 @@ $result = sql_query($sql);
$href = '<a href="./orderlist.php?sel_field=mb_id&amp;search='.$row['mb_id'].'">';
}
$receipt_bank = $receipt_card = 0;
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$receipt_bank = $receipt_card = $receipt_vbank = $receipt_iche = $receipt_hp = 0;
if($row['od_settle_case'] == '무통장')
$receipt_bank = $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$receipt_vbank = $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$receipt_iche = $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$receipt_hp = $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$receipt_card = $row['od_receipt_price'];
@ -66,7 +75,10 @@ $result = sql_query($sql);
<td class="td_numsum"><?php echo number_format($row['orderprice']); ?></td>
<td class="td_numcoupon"><?php echo number_format($row['couponprice']); ?></td>
<td class="td_numincome"><?php echo number_format($receipt_bank); ?></td>
<td class="td_numincome"><?php echo number_format($receipt_vbank); ?></td>
<td class="td_numincome"><?php echo number_format($receipt_iche); ?></td>
<td class="td_numincome"><?php echo number_format($receipt_card); ?></td>
<td class="td_numincome"><?php echo number_format($receipt_hp); ?></td>
<td class="td_numincome"><?php echo number_format($row['od_receipt_point']); ?></td>
<td class="td_numcancel1"><?php echo number_format($row['od_cancel_price']); ?></td>
<td class="td_numrdy"><?php echo number_format($row['od_misu']); ?></td>
@ -75,16 +87,17 @@ $result = sql_query($sql);
$tot['orderprice'] += $row['orderprice'];
$tot['ordercancel'] += $row['od_cancel_price'];
$tot['coupon'] += $row['couponprice'] ;
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receipt_bank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$tot['receipt_card'] += $row['od_receipt_price'];
$tot['receipt_bank'] += $receipt_bank;
$tot['receipt_vbank'] += $receipt_vbank;
$tot['receipt_iche'] += $receipt_iche;
$tot['receipt_card'] += $receipt_card;
$tot['receipt_hp'] += $receipt_hp;
$tot['receipt_point'] += $row['od_receipt_point'];
$tot['misu'] += $row['od_misu'];
}
if ($i == 0) {
echo '<tr><td colspan="9" class="empty_table">자료가 없습니다</td></tr>';
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다</td></tr>';
}
?>
</tbody>
@ -94,7 +107,10 @@ $result = sql_query($sql);
<td><?php echo number_format($tot['orderprice']); ?></td>
<td><?php echo number_format($tot['coupon']); ?></td>
<td><?php echo number_format($tot['receipt_bank']); ?></td>
<td><?php echo number_format($tot['receipt_vbank']); ?></td>
<td><?php echo number_format($tot['receipt_iche']); ?></td>
<td><?php echo number_format($tot['receipt_card']); ?></td>
<td><?php echo number_format($tot['receipt_hp']); ?></td>
<td><?php echo number_format($tot['receipt_point']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>

View File

@ -16,7 +16,10 @@ function print_line($save)
<td class="td_numsum"><?php echo number_format($save['orderprice']); ?></td>
<td class="td_numcoupon"><?php echo number_format($save['ordercoupon']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptbank']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptvbank']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptiche']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptcard']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receipthp']); ?></td>
<td class="td_numincome"><?php echo number_format($save['receiptpoint']); ?></td>
<td class="td_numcancel1"><?php echo number_format($save['ordercancel']); ?></td>
<td class="td_numrdy"><?php echo number_format($save['misu']); ?></td>
@ -50,8 +53,11 @@ $result = sql_query($sql);
<th scope="col">주문수</th>
<th scope="col">주문합계</th>
<th scope="col">쿠폰</th>
<th scope="col">계좌입금</th>
<th scope="col">무통장</th>
<th scope="col">가상계좌</th>
<th scope="col">계좌이체</th>
<th scope="col">카드입금</th>
<th scope="col">휴대폰</th>
<th scope="col">포인트입금</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
@ -76,8 +82,14 @@ $result = sql_query($sql);
$save['orderprice'] += $row['orderprice'];
$save['ordercancel'] += $row['od_cancel_price'];
$save['ordercoupon'] += $row['couponprice'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
if($row['od_settle_case'] == '무통장')
$save['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$save['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$save['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$save['receipthp'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_price'];
$save['receiptpoint'] += $row['od_receipt_point'];
@ -87,8 +99,14 @@ $result = sql_query($sql);
$tot['orderprice'] += $row['orderprice'];
$tot['ordercancel'] += $row['od_cancel_price'];
$tot['ordercoupon'] += $row['couponprice'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
if($row['od_settle_case'] == '무통장')
$tot['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$tot['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$tot['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '휴대폰')
$tot['receipthp'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_price'];
$tot['receiptpoint'] += $row['od_receipt_point'];
@ -96,7 +114,7 @@ $result = sql_query($sql);
}
if ($i == 0) {
echo '<tr><td colspan="9" class="empty_table">자료가 없습니다.</td></tr>';
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
} else {
print_line($save);
}
@ -109,7 +127,10 @@ $result = sql_query($sql);
<td><?php echo number_format($tot['orderprice']); ?></td>
<td><?php echo number_format($tot['ordercoupon']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptvbank']); ?></td>
<td><?php echo number_format($tot['receiptiche']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receipthp']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>

View File

@ -73,7 +73,7 @@ $result = sql_query($sql);
if ($is_admin == 'super')
$ip = $row['vi_ip'];
else
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row['vi_ip']);
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['vi_ip']);
if ($brow == '기타') { $brow = '<span title="'.$row['vi_agent'].'">'.$brow.'</span>'; }
if ($os == '기타') { $os = '<span title="'.$row['vi_agent'].'">'.$os.'</span>'; }

View File

@ -109,7 +109,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'">처음</a>'; //페이지 처음
if ($is_admin == 'super')
$ip = $row['vi_ip'];
else
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row['vi_ip']);
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['vi_ip']);
if ($brow == '기타') $brow = '<span title="'.$row['vi_agent'].'">'.$brow.'</span>';
if ($os == '기타') $os = '<span title="'.$row['vi_agent'].'">'.$os.'</span>';

View File

@ -169,7 +169,7 @@ if ($is_admin) {
} else {
// 관리자가 아니라면 IP 주소를 감춘후 보여줍니다.
if (isset($write['wr_ip'])) {
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $write['wr_ip']);
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $write['wr_ip']);
}
}

View File

@ -20,7 +20,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($is_admin)
$list[$i]['name'] = $row[lo_ip];
else
$list[$i]['name'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row['lo_ip']);
$list[$i]['name'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['lo_ip']);
}
$list[$i]['num'] = sprintf('%03d',$i+1);

View File

@ -56,7 +56,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
$list[$i]['ip'] = $row['wr_ip'];
if (!$is_admin)
$list[$i]['ip'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row['wr_ip']);
$list[$i]['ip'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['wr_ip']);
$list[$i]['is_reply'] = false;
$list[$i]['is_edit'] = false;

View File

@ -159,4 +159,12 @@ define('G5_LINK_COUNT', 2);
// 썸네일 jpg Quality 설정
define('G5_THUMB_JPG_QUALITY', 90);
// ip 숨김방법 설정
/* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은
\\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로
표시되는 부분은 \\1 과 같이 사용하시면 되고 숨길 부분은 ♡등의
다른 문자를 적어주시면 됩니다.
*/
define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4');
?>

View File

@ -13,7 +13,7 @@ label, input, button, select, img {vertical-align:middle}
input, button {margin:0;padding:0;font-size:1em}
button {cursor:pointer}
input[type=text], input[type=password], input[type=submit], input[type=image], button {border-radius:0;font-size:1em;-webkit-appearance:none}
textarea, select {font-size:1em}
textarea, select {font-size:1em;font-family:dotum}
textarea {border-radius:0;-webkit-appearance:none}
select {margin:0}
p {margin:0;padding:0;word-break:break-all}

44
g4_import.php Normal file
View File

@ -0,0 +1,44 @@
<?php
include_once('./_common.php');
$g5['title'] = '그누보드4 DB 데이터 이전';
include_once(G5_PATH.'/_head.php');
if(get_session('tables_copied') == 'done')
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
if($is_admin != 'super')
alert('최고관리자로 로그인 후 실행해 주십시오.', G5_URL);
?>
<div>
<p>이 프로그램은 그누보드5 설치 후 바로 실행하셔야만 합니다.<br>
만약 그누보드5 사이트를 운영 중에 이 프로그램을 실행하시면 DB 데이터가<br>
망실되거나 데이터의 오류가 발생할 수 있습니다. 또한 중복해서 실행하실<br>
경우에도 DB 데이터의 오류가 발생할 수 있으니 반드시 한번만 실행해 주십시오.
</p>
<p>프로그램을 실행하시려면 그누보드4의 config.php 파일 경로를 입력하신 후 확인을 클릭해 주십시오.</p>
<form name="fimport" method="post" action="./g4_import_run.php" onsubmit="return fimport_submit(this);">
<div>
<label for="file_path">config.php 파일 경로</label>
<input type="text" name="file_path" id="file_path" required class="frm_input required">
<input type="submit" value="확인">
</div>
<p>
경로는 그누보드5 설치 루트를 기준으로 그누보드4의 config.php 파일의 상대경로입니다.<br>
예를 들어 그누보드4를 웹루트에 설치하셨고 그누보드5를 g5라는 하위 폴더에 설치하셨다면<br>
입력하실 경로는 ../config.php 입니다.
</p>
</form>
</div>
<script>
function fimport_submit(f)
{
return confirm('그누보드4의 DB 데이터를 이전하시겠습니까?');
}
</script>
<?php
include_once(G5_PATH.'/_tail.php');
?>

387
g4_import_run.php Normal file
View File

@ -0,0 +1,387 @@
<?php
include_once('./_common.php');
set_time_limit ( 0 );
ini_set('memory_limit', '50M');
$g5['title'] = '그누보드4 DB 데이터 이전';
include_once(G5_PATH.'/_head.php');
if(empty($_POST))
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
if(get_session('tables_copied') == 'done')
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
if($is_admin != 'super')
alert('최고관리자로 로그인 후 실행해 주십시오.', G5_URL);
$g4_config_file = trim($_POST['file_path']);
if(!$g4_config_file)
alert('config.php 파일의 경로를 입력해 주십시오.');
if(!is_file($g4_config_file))
alert('입력하신 경로에 config.php 파일이 존재하지 않습니다.');
$is_euckr = false;
?>
<script>
// 새로고침 방지
function noRefresh()
{
/* CTRL + N키 막음. */
if ((event.keyCode == 78) && (event.ctrlKey == true))
{
event.keyCode = 0;
return false;
}
/* F5 번키 막음. */
if(event.keyCode == 116)
{
event.keyCode = 0;
return false;
}
}
document.onkeydown = noRefresh ;
</script>
<?php
flush();
// g4의 confing.php
require($g4_config_file);
if(preg_replace('/[^a-z]/', '', strtolower($g4['charset'])) == 'euckr')
$is_euckr = true;
// member table 복사
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['member_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$sql = " select * from {$g4['member_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
// 중복체크
$sql2 = " select count(*) as cnt from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
continue;
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
if($key == 'mb_no')
continue;
if(!in_array($key, $columns))
continue;
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['member_table']} SET $sql_common ");
}
echo '<p>member table 복사</p>'.PHP_EOL;
unset($columns);
unset($fiels);
// point table 복사
$sql = " select * from {$g4['point_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
if($key == 'po_id')
continue;
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['point_table']} SET $sql_common ");
}
echo '<p>point table 복사</p>'.PHP_EOL;
// login table 복사
$sql = " select * from {$g4['login_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
// 중복체크
$sql2 = " select count(*) as cnt from {$g5['login_table']} where lo_ip = '{$row['lo_ip']}' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
continue;
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['login_table']} SET $sql_common ");
}
echo '<p>login table 복사</p>'.PHP_EOL;
// visit table 복사
$sql = " select * from {$g4['visit_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
// 중복체크
$sql2 = " select count(*) as cnt from {$g5['visit_table']} where vi_ip = '{$row['vi_ip']}' and vi_date = '{$row['vi_date']}' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
continue;
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['visit_table']} SET $sql_common ");
}
echo '<p>visit table 복사</p>'.PHP_EOL;
// visit sum table 복사
$sql = " select * from {$g4['visit_sum_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
// 중복체크
$sql2 = " select count(*) as cnt from {$g5['visit_sum_table']} where vs_date = '{$row['vs_date']}' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
continue;
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['visit_sum_table']} SET $sql_common ");
}
echo '<p>visit sum table 복사</p>'.PHP_EOL;
// group table 복사
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['group_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$sql = " select * from {$g4['group_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
// 중복체크
$sql2 = " select count(*) as cnt from {$g5['group_table']} where gr_id = '{$row['gr_id']}' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
continue;
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
if(!in_array($key, $columns))
continue;
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['group_table']} SET $sql_common ");
}
echo '<p>group table 복사</p>'.PHP_EOL;
unset($columns);
unset($fiels);
// board 복사
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['board_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$sql = " select * from {$g4['board_table']} ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
// 중복체크
$sql2 = " select count(*) as cnt from {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
continue;
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
if(!in_array($key, $columns))
continue;
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
sql_query(" INSERT INTO {$g5['board_table']} SET $sql_common ");
// 게시판 테이블 생성
$bo_table = $row['bo_table'];
$file = file(G5_ADMIN_PATH.'/sql_write.sql');
$sql = implode($file, "\n");
$create_table = $g5['write_prefix'] . $bo_table;
$source = array('/__TABLE_NAME__/', '/;/');
$target = array($create_table, '');
$sql = preg_replace($source, $target, $sql);
// 게시글 복사
if(sql_query($sql, FALSE)) {
$write_table = $g4['write_prefix'].$bo_table;
$columns2 = array();
$fields2 = mysql_list_fields(G5_MYSQL_DB, $create_table);
$count2 = mysql_num_fields($fields2);
for ($j = 0; $j < $count2; $j++) {
$fld = mysql_field_name($fields2, $j);
$columns2[] = $fld;
}
$sql3 = " select * from $write_table ";
$result3 = sql_query($sql3);
for($k=0; $row3=sql_fetch_array($result3); $k++) {
if($is_euckr)
$row3 = array_map('iconv_utf8', $row3);
$comma3 = '';
$sql_common3 = '';
foreach($row3 as $key=>$val) {
if(!in_array($key, $columns2))
continue;
$sql_common3 .= $comma3 . " $key = '".addslashes($val)."' ";
$comma3 = ',';
}
// 첨부파일개수
$wr_id = $row3['wr_id'];
$sql4 = " select count(*) as cnt from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' ";
$row4 = sql_fetch($sql4);
$sql_common3 .= " , wr_file = '{$row4['cnt']}' ";
sql_query(" INSERT INTO $create_table SET $sql_common3 ");
}
echo '<p>'.str_replace(G5_TABLE_PREFIX.'write_', '', $create_table).' 게시글 복사</p>';
}
}
unset($columns);
unset($fiels);
// 그외 테이블 복사
$tables = array('board_file', 'board_new', 'board_good', 'mail', 'memo', 'group_member', 'auth', 'popular', 'poll', 'poll_etc', 'scrap');
foreach($tables as $table) {
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5[$table.'_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$src_table = $g4[$table.'_table'];
$dst_table = $g5[$table.'_table'];
$sql = " select * from $src_table ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
if($is_euckr)
$row = array_map('iconv_utf8', $row);
$comma = '';
$sql_common = '';
foreach($row as $key=>$val) {
if(!in_array($key, $columns))
continue;
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
$comma = ',';
}
$result2 = sql_query(" INSERT INTO $dst_table SET $sql_common ", false);
if(!$result2)
continue;
}
echo '<p>'.$table.' table 복사</p>'.PHP_EOL;
}
unset($columns);
unset($fiels);
echo '<p>&nbsp;</p>'.PHP_EOL;
echo '<p><b>그누보드4 DB 데이터 이전 완료</b></p>'.PHP_EOL;
// 실행완료 세션에 기록
set_session('tables_copied', 'done');
include_once(G5_PATH.'/_tail.php');
?>

View File

@ -35,8 +35,8 @@ sigungu['경기도'] = '가평군,고양시 덕양구,고양시 일산동구,고
sigungu['강원도'] = '강릉시,고성군,동해시,삼척시,속초시,양구군,양양군,영월군,원주시,인제군,정선군,철원군,춘천시,태백시,평창군,홍천군,화천군,횡성군';
sigungu['충청북도'] = '괴산군,단양군,보은군,영동군,옥천군,음성군,제천시,증평군,진천군,청원군,청주시 상당구,청주시 흥덕구,충주시';
sigungu['충청남도'] = '계룡시,공주시,금산군,논산시,당진시,보령시,부여군,서산시,서천군,아산시,예산군,천안시 동남구,천안시 서북구,청양군,태안군,홍성군';
sigungu['전라북도'] = '전주시 완산구,전주시 덕진구,군산시,익산시,정읍시,남원시,김제시 완주군,진안군,무주군,장수군,임실군,순창군,고창군,부안군';
sigungu['전라남도'] = '강진군,고흥군,곡성군,광양시,구례군,나주시,담양군,목포시,무안군,보성군,순천시,신안군 여수시,영광군,영암군,완도군,장성군,장흥군,진도군,함평군,해남군,화순군';
sigungu['전라북도'] = '전주시 완산구,전주시 덕진구,군산시,익산시,정읍시,남원시,김제시,완주군,진안군,무주군,장수군,임실군,순창군,고창군,부안군';
sigungu['전라남도'] = '강진군,고흥군,곡성군,광양시,구례군,나주시,담양군,목포시,무안군,보성군,순천시,신안군,여수시,영광군,영암군,완도군,장성군,장흥군,진도군,함평군,해남군,화순군';
sigungu['경상북도'] = '경산시,경주시,고령군,구미시,군위군,김천시,문경시,봉화군,상주시,성주군,안동시,영덕군,영양군,영주시,영천시,예천군,울릉군,울진군,의성군,청도군,청송군,칠곡군,포항시 남구,포항시 북구';
sigungu['경상남도'] = '거제시,거창군,고성군,김해시,남해군,밀양시,사천시,산청군,양산시,의령군,진주시,창녕군,창원시 마산합포구,창원시 마산회원구,창원시 성산구,창원시 의창구,창원시 진해구,통영시,하동군,함안군,함양군,합천군';
sigungu['제주특별자치도'] = '서귀포시,제주시';

View File

@ -135,6 +135,8 @@ function put_data(zip1, zip2, addr1, addr3, jibeon)
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}

View File

@ -132,6 +132,8 @@ function put_data(zip1, zip2, addr1, addr3, jibeon)
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}