#209 쿠폰관리 기능 추가

This commit is contained in:
chicpro
2013-06-04 14:13:49 +09:00
parent 828b2e08d1
commit cbb278bef6
11 changed files with 807 additions and 0 deletions

View File

@ -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;
}
//==============================================================================
// 쇼핑몰 함수 모음 끝
//==============================================================================