#209 쿠폰관리 기능 추가
This commit is contained in:
@ -1116,6 +1116,29 @@ function insert_mileage($mb_id, $point, $content='', $od_id, $ct_id)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 쿠폰번호 생성함수
|
||||
function get_coupon_id()
|
||||
{
|
||||
$len = 16;
|
||||
$chars = "ABCDEFGHJKLMNPQRSTUVWXYZ123456789";
|
||||
|
||||
srand((double)microtime()*1000000);
|
||||
|
||||
$i = 0;
|
||||
$str = '';
|
||||
|
||||
while ($i < $len) {
|
||||
$num = rand() % strlen($chars);
|
||||
$tmp = substr($chars, $num, 1);
|
||||
$str .= $tmp;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$str = preg_replace("/([0-9A-Z]{4})([0-9A-Z]{4})([0-9A-Z]{4})([0-9A-Z]{4})/", "\\1-\\2-\\3-\\4", $str);
|
||||
|
||||
return $str;
|
||||
}
|
||||
//==============================================================================
|
||||
// 쇼핑몰 함수 모음 끝
|
||||
//==============================================================================
|
||||
|
||||
Reference in New Issue
Block a user