';
$result .='
';
// $result .='
';
// $result .='
';
// $result .=' ';
// $result .='
';
$result .='
';
}
if($now_z == 0 and ($use_type == 4)){
$result .='
';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
$result .= $option_html;
$result .=' ';
$result .=' ';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
// $result .='
';
// $result .='
';
// $result .=' ';
// $result .='
';
$result .='
';
}
if($use_type == 1){
if($now_z == 0){
$result .='
';
$result .='
';
$result .='
';
$result .=' ';
$result .=' ';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
}
}
else if($use_type == 2){
if($now_z == 0){
$result .='
';
$result .='
';
$result .='
';
$result .=' ';
$result .=' ';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
}
}
else if($use_type == 3){
if($now_z == 0){
$result .='
';
$result .='
';
$result .='
';
$result .=' ';
$result .=' ';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
}
}
else if($use_type == 4){
if($now_z == 0){
$result .='
';
$result .='
';
$result .='
';
$result .=' ';
$result .=' ';
$result .='
';
$result .='
';
$result .='
';
$result .='
';
}
}
if($now_z == $z_cnt-1){
$result .='
';
$result .='
';
$result .='
';
$result .='
';
}
return $result;
}
function front_html_z_g5_multy_table_wr_id_data($use_type,$data_list,$total_cnt,$now_i,$z_cnt,$now_z,$z_group_cnt,$get_z_group_now_cnt){
if($use_type == 1){
$result .='
'.$data_list['z_tmp_2'].'';
}
if($use_type == 2){
$result .='
';
$result .=' '.$data_list['z_tmp_2'].'';
$result .=' '.$data_list['z_tmp_3'].'';
$result .=' ';
}
if($use_type == 3){
if($get_z_group_now_cnt == 0){
$result .='
';
$result .=' '.$data_list['z_tmp_2'].'';
$result .=' ';
}
$result .=' ';
$result .=' '.$data_list['z_tmp_3'].'';
$result .=' '.$data_list['z_tmp_4'].'';
$result .=' ';
if($get_z_group_now_cnt == $z_group_cnt-1){
$result .='
';
$result .=' ';
}
}
if($use_type == 4){
if($data_list['z_tmp_2'] != ""){
$data_list_html_1 = '
'.$data_list['z_tmp_2'].' | ';
$data_list_html_1_1 = '
'.$data_list['z_tmp_10'].' | ';
}
if($data_list['z_tmp_3'] != ""){
$data_list_html_2 = '
'.$data_list['z_tmp_3'].' | ';
$data_list_html_2_1 = '
'.$data_list['z_tmp_11'].' | ';
}
if($data_list['z_tmp_4'] != ""){
$data_list_html_3 = '
'.$data_list['z_tmp_4'].' | ';
$data_list_html_3_1 = '
'.$data_list['z_tmp_12'].' | ';
}
if($data_list['z_tmp_5'] != ""){
$data_list_html_4 = '
'.$data_list['z_tmp_5'].' | ';
$data_list_html_4_1 = '
'.$data_list['z_tmp_13'].' | ';
}
if($data_list['z_tmp_6'] != ""){
$data_list_html_5 = '
'.$data_list['z_tmp_6'].' | ';
$data_list_html_5_1 = '
'.$data_list['z_tmp_14'].' | ';
}
if($data_list['z_tmp_7'] != ""){
$data_list_html_6 = '
'.$data_list['z_tmp_7'].' | ';
$data_list_html_6_1 = '
'.$data_list['z_tmp_15'].' | ';
}
if($data_list['z_tmp_8'] != ""){
$data_list_html_7 = '
'.$data_list['z_tmp_8'].' | ';
$data_list_html_7_1 = '
'.$data_list['z_tmp_16'].' | ';
}
if($data_list['z_tmp_9'] != ""){
$data_list_html_8 = '
'.$data_list['z_tmp_9'].' | ';
$data_list_html_8_1 = '
'.$data_list['z_tmp_17'].' | ';
}
if($now_z == 0){
$result .='
';
$result .=' '.$data_list['z_tmp_1'].'';
$result .=' ';
$result .=' ';
$result .=' ';
$result .=' ';
$result .=' ';
$result .=' ';
$result .=' ';
$result .= $data_list_html_1;
$result .= $data_list_html_2;
$result .= $data_list_html_3;
$result .= $data_list_html_4;
$result .= $data_list_html_5;
$result .= $data_list_html_6;
$result .= $data_list_html_7;
$result .= $data_list_html_8;
$result .='
';
$result .=' ';
$result .=' ';
}
$result .=' ';
$result .= $data_list_html_1_1;
$result .= $data_list_html_2_1;
$result .= $data_list_html_3_1;
$result .= $data_list_html_4_1;
$result .= $data_list_html_5_1;
$result .= $data_list_html_6_1;
$result .= $data_list_html_7_1;
$result .= $data_list_html_8_1;
$result .='
';
if($now_z == $z_cnt-1){
$result .=' ';
$result .='
';
}
}
return $result;
}
function front_html_set_use_type_head_tail($use_type,$data_list,$type,$refer_str=null){
if($refer_str != ""){
if(find_char($refer_str,"")){
$refer_str_ex = explode("",$refer_str);
$refer_str_cnt = count($refer_str_ex)-1;
for($i=0;$i<$refer_str_cnt;$i++){
$result_refer .='
'.$refer_str_ex[$i].'';
}
}
else{
$result_refer .='
'.$refer_str.'';
}
}
if($use_type == 1 and $type == "head"){
$result .='
';
$result .='
';
$result .='
'.$data_list['z_tmp_1'].'
';
$result .=' ';
$result .='
';
$result .='
';
}
if($use_type == 1 and $type == "tail"){
//refer_str
$result .='
';
$result .='
';
if($refer_str != ""){
$result .='
';
$result .='
';
$result .= $result_refer;
$result .='
';
$result .='
';
}
$result .='
';
}
if($use_type == 2 and $type == "head"){
$result .='
';
$result .='
';
$result .='
'.$data_list['z_tmp_1'].'
';
$result .=' ';
$result .='
';
$result .='
';
}
if($use_type == 2 and $type == "tail"){
$result .='
';
$result .='
';
if($refer_str != ""){
$result .='
';
$result .='
';
$result .= $result_refer;
$result .='
';
$result .='
';
}
$result .='
';
}
if($use_type == 3 and $type == "head"){
$result .='
';
$result .='
';
$result .='
'.$data_list['z_tmp_1'].'
';
$result .=' ';
$result .='
';
$result .='
';
}
if($use_type == 3 and $type == "tail"){
$result .='
';
$result .='
';
if($refer_str != ""){
$result .='
';
$result .='
';
$result .= $result_refer;
$result .='
';
$result .='
';
}
$result .='
';
}
if($use_type == 4 and $type == "head"){
$result .='
';
$result .='
';
$result .='
'.$data_list['z_tmp_1'].'
';
$result .=' ';
$result .='
';
$result .='
';
}
if($use_type == 4 and $type == "tail"){
$result .='
';
$result .='
';
if($refer_str != ""){
$result .='
';
$result .='
';
$result .= $result_refer;
$result .='
';
$result .='
';
}
$result .='
';
}
return $result;
}
function front_html_z_g5_fix_table_wr_id_data($use_type,$z_tmp_array,$view_type){
if($view_type == 0){
$tag = "span";
}
else if($view_type == 1){
$tag = "li";
}
if($use_type == 4){
if($view_type == 1){
$n = 2;
$k = 6;
for($i=0;$i<4;$i++){
if($z_tmp_array['z_tmp_'.$n] != ""){
$result .='
';
$result .=' - '.$z_tmp_array['z_tmp_'.$n].'
';
$result .=' - ';
$result .='
';
for($z=0;$z<$z_tmp_array['z_tmp_'.$k.'_cnt'];$z++){
$result .=' <'.$tag.'>'.$z_tmp_array['z_tmp_'.$k][$z].''.$tag.'>';
}
$result .='
';
$result .=' ';
$result .='
';
}
$n++;
$k++;
}
}
if($view_type == 0){
$total_cnt = $z_tmp_array['z_tmp_max_cnt'];
for($i=0;$i<$total_cnt;$i++){
if($z_tmp_array['z_tmp_6'][$i]){
$k=0;
$z_tmp_array['z_tmp_6']['rowspan'][$i]="";
$z=$i;
}
$k++;
$z_tmp_array['z_tmp_6']['rowspan'][$z] = $k;
}
for($i=0;$i<$total_cnt;$i++){
if($i==0){
$result .='
';
$result .=' ';
if($z_tmp_array['z_tmp_2']){
$result .=' | '.$z_tmp_array['z_tmp_2'].' | ';
$z_tmp_2 = true;
}
if($z_tmp_array['z_tmp_3']){
$result .=' '.$z_tmp_array['z_tmp_3'].' | ';
$z_tmp_3 = true;
}
if($z_tmp_array['z_tmp_4']){
$result .=' '.$z_tmp_array['z_tmp_4'].' | ';
$z_tmp_4 = true;
}
if($z_tmp_array['z_tmp_5']){
$result .=' '.$z_tmp_array['z_tmp_5'].' | ';
$z_tmp_5 = true;
}
$result .='
';
$result .=' ';
//$result .='
';
}
$result .=' ';
if($z_tmp_2){
if($z_tmp_array['z_tmp_6']['rowspan'][$i] > 1){
$result .=' | '.$z_tmp_array['z_tmp_6'][$i].' | ';
}
else{
if($z_tmp_array['z_tmp_6'][$i] != ""){
$result .=' '.$z_tmp_array['z_tmp_6'][$i].' | ';
}
}
}
if($z_tmp_3){
$result .=' '.$z_tmp_array['z_tmp_7'][$i].' | ';
}
if($z_tmp_4){
$result .=' '.$z_tmp_array['z_tmp_8'][$i].' | ';
}
if($z_tmp_5){
$result .=' '.$z_tmp_array['z_tmp_9'][$i].' | ';
}
$result .='
';
if($i==count($total_cnt)-1){
//$result .=' ';
}
}
}
}
return $result;
}
function front_html_set_use_type_head_tail_fix($use_type,$z_tmp_array,$type,$view_type,$refer_str=null){
if($refer_str != ""){
if(find_char($refer_str,"")){
$refer_str_ex = explode("",$refer_str);
$refer_str_cnt = count($refer_str_ex)-1;
for($i=0;$i<$refer_str_cnt;$i++){
$result_refer .='
'.$refer_str_ex[$i].'';
}
}
else{
$result_refer .='
'.$refer_str.'';
}
}
$z_tmp_use_cnt = $z_tmp_array['z_tmp_use_cnt'];
$dlbox_col = " col".$z_tmp_use_cnt;
if($view_type == 1){
$type2 = ' type2';
$img_scr = '
!['.$z_tmp_array['z_tmp_1'].']('.G5_URL.'/img/accommodations/bg_box.jpg)
';
if($use_type == 4 and $type == "head"){
$result .='
';
$result .='
';
$result .='
'.$z_tmp_array['z_tmp_1'].'
';
$result .=' ';
$result .='
';
$result .='
';
}
if($use_type == 4 and $type == "tail"){
$result .='
';
$result .= $img_scr;
$result .='
';
$result .='
';
if($refer_str != ""){
$result .='
';
$result .='
';
$result .= $result_refer;
$result .='
';
$result .='
';
}
$result .='
';
$result .='
';
}
}
else if($view_type == 0){
$type2 = ' table';
$img_scr = '
!['.$z_tmp_array['z_tmp_1'].']('.G5_URL.'/img/dining/bg_topvisual.jpg)
';
if($use_type == 4 and $type == "head"){
$result .='
';
$result .='
';
$result .='
'.$z_tmp_array['z_tmp_1'].'
';
$result .=' ';
$result .='
';
$result .='
';
}
if($use_type == 4 and $type == "tail"){
$result .='
';
$result .='
';
$result .= $img_scr;
$result .='
';
if($refer_str != ""){
$result .='
';
$result .='
';
$result .= $result_refer;
$result .='
';
$result .='
';
}
$result .='
';
$result .='
';
}
}
return $result;
}
// 이미지 가져오기
function get_list_img_file($bo_table,$wr_id){
$t_sql = " select * from g5_board_file where bo_table = '$bo_table' and wr_id = '$wr_id' limit 1";
$row_t = sql_fetch($t_sql);
$result = get_file_path($bo_table,$row_t['bf_file']);
return $result;
}
// 이미지 가져오기
function get_list_img_file2($bo_table,$wr_id){
$t_sql = " select * from g5_board_file where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '1' limit 1";
$row_t = sql_fetch($t_sql);
$result = get_file_path($bo_table,$row_t['bf_file']);
return $result;
}
function get_bo_subject($bo_table){
$t_sql = " select * from g5_board where bo_table='$bo_table' ";
$t_row = sql_fetch($t_sql);
$result = $t_row['bo_subject'];
return $result;
}
// 사용될 아이콘 전부 가져오기.
function get_adm_icon_data($bo_table,$wr_id){
$t_sql = " select a.*,b.* from g5_write_icon_management as a left join g5_board_file as b on a.wr_id = b.wr_id where b.bo_table = 'icon_management' and a.wr_subject='$bo_table' and a.wr_id = '$wr_id' ; ";
$result_t = sql_query($t_sql);
$array = array();
while($row_t = sql_fetch_array($result_t)){
$array['wr_1'] = $row_t['wr_1'];
$array['wr_subject'] = $row_t['wr_subject'];
$array['bf_source'] = $row_t['bf_source'];
$array['bf_file'] = get_file_path("icon_management",$row_t['bf_file']);
}
return $array;
}
function get_g5_content_content($co_id){
$sql = " select * from g5_content where co_id = '$co_id' ";
$co = sql_fetch($sql);
$result = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
return $result;
}
function get_g5_content_subject($co_id){
$sql = " select * from g5_content where co_id = '$co_id' ";
$co = sql_fetch($sql);
$result = $co['co_subject'];
return $result;
}
function find_char($string,$find){
if(strpos($string, $find) !== false) {
$result = true;
}
else{
$result = false;
}
return $result;
}
function find_char_cnt($string,$find){
$result = substr_count($string, $find);
return $result;
}
function checkImgFile($url) {
if($url == ""){
$result = G5_URL."/img/rihga_noimg.jpg";
}
else{
if(filechecker($url,"img")){
$ex = "/data/file/";
// if(preg_match("/$ex/", $url)){
if(strpos($url,$ex)){
$url_ex = explode($ex,$url);
$url_chk = G5_PATH.$ex.$url_ex[1];
$is_file_exist = is_file($url_chk);
if ($is_file_exist == true) {
$result = $url;
}
else {
$result = G5_URL."/img/rihga_noimg.jpg";
}
}
else{
$result = $url;
}
}
else{
$result = G5_URL."/img/rihga_noimg.jpg";
}
}
return $result;
}
function filechecker($filename, $type = 'img') {
// 파일명 검증
if (empty($filename)) {
return false;
}
/*
// 확장자 분리
$tmp = explode('.', $filename);
$ext = $tmp[1];
*/
$ext = substr( $filename, -3 );
// 파일 형식 설정
$haystack = array();
switch($type) {
case 'img':
$haystack = array('jpg', 'jpeg', 'png', 'gif', 'svg');
break;
case 'pdf':
$haystack = array('pdf');
break;
// 필요한 파일형식 조건 추가
}
// 확장자 검증
if (in_array( strtolower($ext), $haystack)) {
return true;
}
return false;
}
function formatSizeUnits($bytes){
if ($bytes >= 1073741824)
{
$bytes = number_format($bytes / 1073741824, 0) . ' GB';
}
elseif ($bytes >= 1048576)
{
$bytes = number_format($bytes / 1048576, 0) . ' MB';
}
elseif ($bytes >= 1024)
{
$bytes = number_format($bytes / 1024, 0) . ' KB';
}
elseif ($bytes > 1)
{
$bytes = $bytes . ' bytes';
}
elseif ($bytes == 1)
{
$bytes = $bytes . ' byte';
}
else
{
$bytes = '0 bytes';
}
return $bytes;
}
function get_config_img_file_chk(){
$bo_table = "g5_config";
$sql = " SELECT cf_image_extension FROM g5_config limit 1";
$t_row = sql_fetch($sql);
$result = $t_row['cf_image_extension'];
return $result;
}
function contact_mail_html_create($r_content,$r_name){
$content = '
Pacific Islands Club
고객님 문의에 대해 답변 드립니다.
안녕하세요 고객님, '.$r_name.'입니다.
'.$r_content.'
본 메일은 발신전용 메일로 회신되지 않습니다.
Copyright ⓒ Pacific Islands Club Co, Ltd. All right reserved.
';
return $content;
}
function get_board_main_list($bo_table,$big=''){
global $g5, $config, $g5_object;
global $qstr;
$bo_sort_field = get_g5_board_field($bo_table,"bo_sort_field");
if($bo_sort_field == ""){
$bo_sort_field = "wr_num, wr_reply";
}
$order_sql = "order by ".$bo_sort_field;
// 노출 비노출 설정 사용함이면 1
$adm_get_board_bo_7 = adm_get_board_bo_7($bo_table);
if($adm_get_board_bo_7 > 0){
$sql_search_7 = "where wr_19 = '1' ";
}
$t_sql = " select * from g5_write_$bo_table $sql_search_7 $order_sql ";
$result_t = sql_query($t_sql);
$array = array();
$z=0;
$n=0;
while($row_t = sql_fetch_array($result_t)){
$n++;
$array[$z]['wr_id'] = $row_t['wr_id'];
$array[$z]['wr_subject'] = $row_t['wr_subject'];
// 태그 삭제 인데 현재 메인에서 쓰고 있는 부분으로 메인 스페샬 오퍼에만 적용함 strip_tags($get_board_specialoffers[$i]['wr_content']) /index.php
// strip_tags($row_t['wr_content'])
$array[$z]['wr_content'] = $row_t['wr_content'];
$array[$z]['wr_2'] = $row_t['wr_2'];
$array[$z]['ca_name'] = $row_t['ca_name'];
$get_board_thumnail = get_board_thumnail($bo_table,$row_t['wr_id'],$big);
$array[$z]['bf_source'] = $get_board_thumnail['bf_source'];
$array[$z]['bf_file'] = $get_board_thumnail['bf_file'];
$array[$z]['bf_file_url'] = $get_board_thumnail['bf_file_url'];
$array[$z]['bf_filesize'] = $get_board_thumnail['bf_filesize'];
$array[$z]['href'] = get_pretty_url($bo_table, $row_t['wr_id'], $qstr);
$array[$z]['href2'] = get_pretty_url($bo_table, $row_t['wr_id'], "");
$array[$z]['href_sca'] = get_pretty_url($bo_table, $row_t['wr_id'], "sca=".$row_t['ca_name']);
$z++;
}
$array['count'] = $n;
return $array;
}
function get_g5_board_field($bo_table,$field){
$sql= " select $field from g5_board where bo_table='$bo_table' ";
//echo $sql;
$t_row = sql_fetch($sql);
$result = $t_row[$field];
return $result;
}
function get_board_field($bo_table,$wr_id,$field){
$sql = " SELECT $field from g5_write_$bo_table where wr_id = '$wr_id' ";
$t_row = sql_fetch($sql);
$result = $t_row[$field];
return $result;
}
function get_board_thumnail($bo_table,$wr_id,$big=''){
if($big){
$big='1';
}
else{
$big='0';
}
$t_sql = " select * from g5_board_file where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$big' ";
//echo $t_sql;
$t_row = sql_fetch($t_sql);
$array = array();
$array['bf_source'] = $t_row['bf_source'];
$array['bf_file'] = $t_row['bf_file'];
$array['bf_file_url'] = get_file_path($bo_table,$t_row['bf_file']);
$array['bf_filesize'] = $t_row['bf_filesize'];
return $array;
}
function get_bo_category_list_style($bo_table,$sca,$add_sca=null){
if($sca == ""){
$bo_category_list = get_g5_board_field($bo_table,"bo_category_list");
if($bo_category_list){
$find_char = find_char($bo_category_list,"|");
if($find_char){
$bo_category_list = explode("|",$bo_category_list);
$sca = $bo_category_list[0];
}
else{
$sca = $bo_category_list;
}
}
}
$bo_category_list = get_g5_board_field($bo_table,"bo_category_list");
if($bo_category_list){
$find_char = find_char($bo_category_list,"|");
if($find_char){
$bo_category_list = explode("|",$bo_category_list);
for($i=0;$i
'.$bo_category_list[$i].'';
}
}
else{
if($bo_category_list != ""){
$class_on = "";
if($bo_category_list == $sca){
$class_on = " class='on' ";
}
$notice_href = (get_pretty_url($bo_table,'','sca='.$sca));
$result .= ''.$bo_category_list.'';
}
}
}
return $result;
}
function find_create_z_g5_member_lv_rename(){
$sql = " SHOW TABLES LIKE z_g5_member_lv_rename' ";
$query = sql_query($sql);
$total_count = sql_num_rows($query);
if(!$total_count){
$t_sql = "
CREATE TABLE `z_g5_member_lv_rename` (
`idx` int(11) NOT NULL AUTO_INCREMENT,
`mb_rename1` varchar(255) NOT NULL DEFAULT '',
`mb_rename2` varchar(255) NOT NULL DEFAULT '',
`mb_rename3` varchar(255) NOT NULL DEFAULT '',
`mb_rename4` varchar(255) NOT NULL DEFAULT '',
`mb_rename5` varchar(255) NOT NULL DEFAULT '',
`mb_rename6` varchar(255) NOT NULL DEFAULT '',
`mb_rename7` varchar(255) NOT NULL DEFAULT '',
`mb_rename8` varchar(255) NOT NULL DEFAULT '',
`mb_rename9` varchar(255) NOT NULL DEFAULT '',
`mb_rename10` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
sql_query($t_sql);
}
}
function z_g5_member_lv_rename_find(){
$t_sql = " SELECT count(*) as cnt FROM z_g5_member_lv_rename ";
//echo $t_sql;
$t_row = sql_fetch($t_sql);
$result = $t_row['cnt'];
return $result;
}
function z_g5_member_lv_rename_del(){
$sql = " delete from z_g5_member_lv_rename ";
$query = sql_query($sql);
if($query) $result = true;
return $result;
}
function z_g5_member_lv_rename_insert($rename_1,$rename_2,$rename_3,$rename_4,$rename_5,$rename_6,$rename_7,$rename_8,$rename_9,$rename_10){
if(z_g5_member_lv_rename_find() > 0){
z_g5_member_lv_rename_del();
}
$sql = "insert into z_g5_member_lv_rename values('','$rename_1','$rename_2','$rename_3','$rename_4','$rename_5','$rename_6','$rename_7','$rename_8','$rename_9','$rename_10')";
//echo $sql;
$query = sql_query($sql);
if($query) $result = true;
return $result;
}
function get_z_g5_member_lv_rename_data($id=null){
$t_sql = " SELECT * FROM z_g5_member_lv_rename ";
//echo $t_sql;
$t_row = sql_fetch($t_sql);
$mb_rename1 = $t_row['mb_rename1'];
$mb_rename2 = $t_row['mb_rename2'];
$mb_rename3 = $t_row['mb_rename3'];
$mb_rename4 = $t_row['mb_rename4'];
$mb_rename5 = $t_row['mb_rename5'];
$mb_rename6 = $t_row['mb_rename6'];
$mb_rename7 = $t_row['mb_rename7'];
$mb_rename8 = $t_row['mb_rename8'];
$mb_rename9 = $t_row['mb_rename9'];
$mb_rename10 = $t_row['mb_rename10'];
if($id){
$get_g5_config_cf_admin = get_g5_config_cf_admin();
if($get_g5_config_cf_admin == $id){
$result = "최고관리자";
}
else{
$lv = get_g5_member_id_to_lv($id);
$result = ${"mb_rename".$lv};
}
}
else{
$result = "$mb_rename1;;$mb_rename2;;$mb_rename3;;$mb_rename4;;$mb_rename5;;$mb_rename6;;$mb_rename7;;$mb_rename8;;$mb_rename9;;$mb_rename10";
}
return $result;
}
function get_g5_config_cf_admin(){
$t_sql = " SELECT * FROM g5_config ";
//echo $t_sql;
$t_row = sql_fetch($t_sql);
$result = $t_row['cf_admin'];
return $result;
}
function get_g5_member_id_to_lv($id){
$t_sql = " SELECT * FROM g5_member where mb_id = '$id'";
//echo $t_sql;
$t_row = sql_fetch($t_sql);
$result = $t_row['mb_level'];
return $result;
}
function print_r2_dev($data,$ip='219.248.207.204'){
if($ip == $_SERVER["REMOTE_ADDR"]){
print_r2($data."
");
}
}
function get_front_snb_list($bo_table){
global $g5, $config, $g5_object;
global $qstr;
$bo_sort_field = get_g5_board_field($bo_table,"bo_sort_field");
if($bo_sort_field == ""){
$bo_sort_field = "wr_num, wr_reply";
}
$order_sql = "order by ".$bo_sort_field;
// 노출 비노출 설정 사용함이면 1
$adm_get_board_bo_7 = adm_get_board_bo_7($bo_table);
if($adm_get_board_bo_7 > 0){
$sql_search_7 = "where wr_19 = '1' ";
}
$t_sql = " select * from g5_write_$bo_table $sql_search_7 $order_sql ";
$result_t = sql_query($t_sql);
$array = array();
$z=0;
$n=0;
while($row_t = sql_fetch_array($result_t)){
$n++;
$array[$z]['wr_id'] = $row_t['wr_id'];
$array[$z]['wr_subject'] = $row_t['wr_subject'];
$array[$z]['wr_content'] = $row_t['wr_content'];
$array[$z]['wr_2'] = $row_t['wr_2'];
$get_board_thumnail = get_board_thumnail($bo_table,$row_t['wr_id']);
$array[$z]['bf_source'] = $get_board_thumnail['bf_source'];
$array[$z]['bf_file'] = $get_board_thumnail['bf_file'];
$array[$z]['bf_file_url'] = $get_board_thumnail['bf_file_url'];
$array[$z]['bf_filesize'] = $get_board_thumnail['bf_filesize'];
$array[$z]['href'] = get_pretty_url($bo_table, $row_t['wr_id'], $qstr);
$array[$z]['href2'] = get_pretty_url($bo_table, $row_t['wr_id'], "");
$array[$z]['href_sca'] = get_pretty_url($bo_table, $row_t['wr_id'], "sca=".$row_t['ca_name']);
$z++;
}
$array['count'] = $n;
return $array;
}
function get_sub_menu_db_custom($link,$bo_table,$board_exception){
global $g5;
static $cache = array();
// 한글깨짐을 고침
$link = urldecode($link);
//echo "link : $link
";
//echo "bo_table : $bo_table
";
/*
if (strpos($link, '/') == 0) {
$me_depth1_link = explode("/",$link)[1];
$me_depth1_link = "/".$me_depth1_link;
}
*/
$sql_depth_now = " select * from {$g5['menu_table']} where me_use = '1' and me_link = '{$link}' order by me_id desc limit 1; ";
$row_depth_now = sql_fetch($sql_depth_now);
$depth_now_name = $row_depth_now['me_name'];
$depth_now_code = $row_depth_now['me_code'];
/*
if(strlen($depth_now_code) == 3){
// 1뎁스
}
*/
if(strlen($depth_now_code) == 3 or strlen($depth_now_code) == 5){
// 2뎁스
$sql_depth2 = " select * from {$g5['menu_table']} where me_use = '1' and length(me_code) = '5' and left(me_code,3) = left('$depth_now_code',3) order by me_order asc ";
$row_depth2 = sql_query($sql_depth2);
//echo $sql_depth2;
if(count($row_depth2) > 0){
$active = "";
$result .= "";
for ($i=0; $row=sql_fetch_array($row_depth2); $i++) {
($row['me_link'] == $link)? $active = 'current' : $active = '';
$result .= "- ".$row['me_name']."
";
}
$result .= "
";
}
}
/*
if(strlen($depth_now_code) == 6){
// 3뎁스
}
*/
echo $result;
}
function get_sub_depth_chk($link,$bo_table,$exception){
global $g5;
// 한글깨짐을 고침
$link = urldecode($link);
$sql_depth_now = " select * from {$g5['menu_table']} where me_use = '1' and me_link = '{$link}' order by me_id desc limit 1; ";
$row_depth_now = sql_fetch($sql_depth_now);
$depth_now_name = $row_depth_now['me_name'];
$depth_now_code = $row_depth_now['me_code'];
/*
if(strlen($depth_now_code) == 3){
// 1뎁스
}
*/
if(strlen($depth_now_code) == 3 or strlen($depth_now_code) == 5){
// 2뎁스
$sql_depth2 = " select count(*) as cnt from {$g5['menu_table']} where me_use = '1' and length(me_code) = '5' and left(me_code,3) = left('$depth_now_code',3) order by me_order asc ";
$row_depth2 = sql_fetch($sql_depth2);
if($row_depth2['cnt'] > 0){
$result = true;
}
}
/*
if(strlen($depth_now_code) == 6){
// 3뎁스
}
*/
return $result;
}
function get_isDetail_title($link){
global $g5;
// 한글깨짐을 고침
$link = urldecode($link);
$sql_depth_now = " select * from {$g5['menu_table']} where me_use = '1' and me_link = '{$link}' order by me_id desc limit 1; ";
$row_depth_now = sql_fetch($sql_depth_now);
$depth_now_name = $row_depth_now['me_name'];
$depth_now_code = $row_depth_now['me_code'];
$search_depth1_code = substr($depth_now_code, 0,3);
$sql_depth1 = " select * from {$g5['menu_table']} where me_use = '1' and left(me_code,3) = '$search_depth1_code' limit 1 ";
$row_depth1 = sql_fetch($sql_depth1);
$depth1_name = $row_depth1['me_name'];
$depth1_code = $row_depth1['me_code'];
$result = $depth1_name;
return $result;
}
function get_board_wr_seo_title($bo_table,$wr_id){
$t_sql = " SELECT wr_seo_title FROM g5_write_$bo_table where wr_id = '$wr_id' ";
$t_row = sql_fetch($t_sql);
$result = "/$bo_table/".$t_row['wr_seo_title']."/";
return $result;
}
function get_z_g5_board_pcode_management_list_data($wr_2,$bo_table="pcode_management"){
$adm_get_board_field_category = get_g5_board_field($bo_table,"bo_category_list");
$adm_get_board_field_category = explode("|",$adm_get_board_field_category)[0];
$t_sql = " SELECT * FROM g5_write_$bo_table where ca_name = '$adm_get_board_field_category' and wr_1 = '' order by wr_id desc";
//echo $t_sql;
$result_t = sql_query($t_sql);
$array = array();
$t_sql2 = " SELECT * FROM g5_write_$bo_table where ca_name = '$adm_get_board_field_category' and wr_subject = '$wr_2' ";
//echo $t_sql2;
$result_t2 = sql_fetch($t_sql2);
$z= 0;
while($row_t = sql_fetch_array($result_t)){
if($z == 0){
if($result_t2['wr_id']){
$array[$z]['wr_id'] = $result_t2['wr_id'];
$array[$z]['wr_subject'] = $result_t2['wr_subject'];
$array[$z]['wr_datetime'] = $result_t2['wr_datetime'];
$array[$z]['wr_1'] = $result_t2['wr_1'];
$array[$z]['ca_name'] = $result_t2['ca_name'];
$z++;
}
}
if($result_t2['wr_id'] != $row_t['wr_id']){
$array[$z]['wr_id'] = $row_t['wr_id'];
$array[$z]['wr_subject'] = $row_t['wr_subject'];
$array[$z]['wr_datetime'] = $row_t['wr_datetime'];
$array[$z]['wr_1'] = $row_t['wr_1'];
$array[$z]['ca_name'] = $row_t['ca_name'];
$z++;
}
}
// 만약 게시물을 가져오는 위 부분에서 가져올 코드가 없다면 연동 되어 있는 코드를 보냄.
if($z == 0){
if($result_t2['wr_id']){
$array[$z]['wr_id'] = $result_t2['wr_id'];
$array[$z]['wr_subject'] = $result_t2['wr_subject'];
$array[$z]['wr_datetime'] = $result_t2['wr_datetime'];
$array[$z]['wr_1'] = $result_t2['wr_1'];
$array[$z]['ca_name'] = $result_t2['ca_name'];
$z++;
}
}
//print_r2($array);
return $array;
}
function get_pcode_data($wr_id,$bo_table="pcode_management"){
$t_sql2 = " SELECT * FROM g5_write_$bo_table where wr_2 = '$wr_id' ";
//echo $t_sql2;
$result_t2 = sql_fetch($t_sql2);
if($result_t2['wr_id']){
$array['wr_id'] = $result_t2['wr_id'];
$array['wr_subject'] = $result_t2['wr_subject'];
$array['wr_datetime'] = $result_t2['wr_datetime'];
$array['wr_1'] = $result_t2['wr_1'];
$array['wr_2'] = $result_t2['wr_2'];
$array['ca_name'] = $result_t2['ca_name'];
}
return $array;
}
function pcode_management_update($array){
$bo_table="pcode_management";
$nowdate = date("Y-m-d H:i:s");
$ip = $_SERVER["REMOTE_ADDR"];
$adm_get_board_field_category = get_g5_board_field($bo_table,"bo_category_list");
$adm_get_board_field_category = explode("|",$adm_get_board_field_category);
if($array['now_mode'] == "new"){
if($array['wr_1'] == 1){
$sql_query = " update g5_write_$bo_table set
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".trim($array['wr_subject'])."',
wr_2 = '".$array['wr_id']."'
where wr_subject = '".$array['wr_2']."' and wr_id = '".$array['wr_3']."' ";
// print_r2($array);
$query_up = sql_query($sql_query);
if($query_up) $result = true;
}
else{
$t_sql = " SELECT wr_id FROM g5_write_specialoffers where ca_name = '".$array['ca_name']."' and wr_subject = '".$array['wr_subject']."' and wr_2 = '".trim($array['wr_2'])."' ";
$result_t = sql_fetch($t_sql);
$result_t_wr_id = $result_t['wr_id'];
$sql = " insert into g5_write_$bo_table
set wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".$array['wr_subject']."',
wr_2 = '".$result_t_wr_id."',
wr_subject = '".trim($array['wr_2'])."',
wr_content = '".trim($array['wr_2'])."',
ca_name = '".$adm_get_board_field_category[1]."',
wr_datetime = '$nowdate',
wr_last = '$nowdate',
wr_ip = '$ip' ";
$query = sql_query($sql);
if($query) $last_id = sql_insert_id();
if($last_id){
// last_id 값을 스페셜 오퍼 데이터 업데이트
$t_sql_2 = " update g5_write_specialoffers
set wr_3 = '$last_id'
where ca_name = '".$array['ca_name']."' and wr_subject = '".$array['wr_subject']."' and wr_2 = '".trim($array['wr_2'])."' ";
$query_up2 = sql_query($t_sql_2);
$sql_update = " update g5_write_$bo_table
set wr_num = '-$last_id',
wr_parent = '$last_id',
wr_ip = '$ip'
where wr_id = '$last_id' ";
$query_up = sql_query($sql_update);
if($query_up) $result = true;
}
}
$query_up = sql_query($sql_query);
if($query_up) $result = true;
}
else{
if($array['wr_1'] == 1 and $array['wr_1_old'] == 1){
$sql_update1 = " update g5_write_$bo_table
set wr_1 = '',
wr_2 = '',
wr_4 = '',
wr_5 = ''
where wr_id = '".$array['wr_3_old']."' ";
$query_up1 = sql_query($sql_update1);
//print_r2($sql_update1);
$sql_update2 = " update g5_write_$bo_table set
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".trim($array['wr_subject'])."',
wr_2 = '".$array['wr_id']."'
where wr_subject = '".$array['wr_2']."' and wr_id = '".$array['wr_3']."' ";
$query_up2 = sql_query($sql_update2);
}
else if($array['wr_1'] == 2 and $array['wr_1_old'] == 2){
$sql_update2 = " update g5_write_$bo_table set
ca_name = '".$adm_get_board_field_category[1]."',
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".trim($array['wr_subject'])."',
wr_2 = '".$array['wr_id']."'
where wr_subject = '".$array['wr_2']."' and wr_id = '".$array['wr_3']."' ";
$query_up2 = sql_query($sql_update2);
}
else if($array['wr_1'] == 1 and $array['wr_1_old'] == 2){
$sql_update1 = " delete from g5_write_$bo_table where wr_id = '".$array['wr_3_old']."' ";
$query_up1 = sql_query($sql_update1);
$sql_update2 = " update g5_write_$bo_table set
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".trim($array['wr_subject'])."',
wr_2 = '".$array['wr_id']."'
where wr_subject = '".$array['wr_2']."' and wr_id = '".$array['wr_3']."' ";
$query_up2 = sql_query($sql_update2);
}
else if($array['wr_1'] == 2 and $array['wr_1_old'] == 1){
$sql_update1 = " update g5_write_$bo_table
set wr_1 = '',
wr_2 = '',
wr_4 = '',
wr_5 = ''
where wr_id = '".$array['wr_3_old']."' ";
$query_up1 = sql_query($sql_update1);
$t_sql = " SELECT wr_id FROM g5_write_specialoffers where ca_name = '".$array['ca_name']."' and wr_subject = '".$array['wr_subject']."' and wr_2 = '".trim($array['wr_2'])."' ";
$result_t = sql_fetch($t_sql);
$result_t_wr_id = $result_t['wr_id'];
$sql = " insert into g5_write_$bo_table
set wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".$array['wr_subject']."',
wr_2 = '".$result_t_wr_id."',
wr_subject = '".trim($array['wr_2'])."',
wr_content = '".trim($array['wr_2'])."',
ca_name = '".$adm_get_board_field_category[1]."',
wr_datetime = '$nowdate',
wr_last = '$nowdate',
wr_ip = '$ip' ";
$query = sql_query($sql);
if($query) $last_id = sql_insert_id();
if($last_id){
// last_id 값을 스페셜 오퍼 데이터 업데이트
$t_sql_2 = " update g5_write_specialoffers
set wr_3 = '$last_id'
where ca_name = '".$array['ca_name']."' and wr_subject = '".$array['wr_subject']."' and wr_2 = '".trim($array['wr_2'])."' ";
$query_up2 = sql_query($t_sql_2);
$sql_update = " update g5_write_$bo_table
set wr_num = '-$last_id',
wr_parent = '$last_id',
wr_ip = '$ip'
where wr_id = '$last_id' ";
$query_up = sql_query($sql_update);
if($query_up) $result = true;
}
//echo $sql_query."
";
// print_r2($array);
}
}
/*
if($array['wr_1'] == 1){
if($array['now_mode'] == "new"){
$sql_query = " update g5_write_$bo_table set
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".trim($array['wr_subject'])."',
wr_2 = '".$array['wr_id']."'
where wr_subject = '".$array['wr_2']."' ";
}
else{
$sql_query = " update g5_write_$bo_table set
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".$array['wr_subject']."' ,
wr_subject = '".trim($array['wr_2'])."' ,
wr_content = '".trim($array['wr_2'])."'
where wr_2 = '".$array['wr_id']."' ";
}
echo $sql_query;
$query_up = sql_query($sql_update);
if($query_up) $result = true;
}
else{
$adm_get_board_field_category = get_g5_board_field($bo_table,"bo_category_list");
$adm_get_board_field_category = explode("|",$adm_get_board_field_category)[1];
if($array['now_mode'] == "new"){
$sql = " insert into g5_write_$bo_table
set wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".$array['wr_subject']."',
wr_2 = '".$array['wr_id']."',
wr_subject = '".trim($array['wr_2'])."',
wr_content = '".trim($array['wr_2'])."',
ca_name = '$adm_get_board_field_category',
wr_datetime = '$nowdate',
wr_last = '$nowdate',
wr_ip = '$ip' ";
//echo $sql;
$query = sql_query($sql);
// if($query) $last_id = last_insert_id();
if($query) $last_id = sql_insert_id();
if($last_id){
$sql_update = " update g5_write_$bo_table
set wr_num = '-$last_id',
wr_parent = '$last_id',
wr_ip = '$ip'
where wr_id = '$last_id' ";
//echo $sql_update;
$query_up = sql_query($sql_update);
if($query_up) $result = true;
}
}
else{
$sql_update = " update g5_write_$bo_table set
wr_4 = '".$array['wr_4']."',
wr_5 = '".$array['wr_5']."',
wr_1 = '".$array['wr_subject']."' ,
wr_subject = '".trim($array['wr_2'])."' ,
wr_content = '".trim($array['wr_2'])."'
where wr_2 = '".$array['wr_id']."' ";
$query_up = sql_query($sql_update);
if($query_up) $result = true;
}
}
*/
return $result;
}
function get_pcode_ing_str($wr_4,$wr_5,$wr_1){
$day_now_date = date("Y-m-d") . " 23:59:59";
//테스트
//$day_now_date = date("2022-11-15") . " 23:59:59";
$day_now_datetime = strtotime(date("Y-m-d H:i:s"));
$start_date_default = date("Y-m-d H:i:s" ,strtotime($wr_4." 00:00:00 "));
$end_date_default = date("Y-m-d H:i:s" ,strtotime($wr_5." 23:59:59"));
if($wr_1){
/*
if($end_date_default < $day_now_date){
$result = "종료";
}
else if($end_date_default > $day_now_date){
$result = "진행 중";
}
*/
if($end_date_default < $day_now_date){
$result = "종료";
}
if($end_date_default >= $day_now_date){
$result = "진행 중";
}
if($start_date_default > $day_now_date and $end_date_default > $day_now_date){
$result = "진행 전";
}
}
else{
$result = "진행 전";
}
return $result;
}
function get_promotion_ing_str($wr_4,$wr_5){
$day_now_date = date("Y-m-d") . " 23:59:59";
//테스트
//$day_now_date = date("2022-11-15") . " 23:59:59";
$day_now_datetime = strtotime(date("Y-m-d H:i:s"));
$start_date_default = date("Y-m-d H:i:s" ,strtotime($wr_4." 00:00:00 "));
$end_date_default = date("Y-m-d H:i:s" ,strtotime($wr_5." 23:59:59"));
if($end_date_default < $day_now_date){
$result = "종료";
}
if($end_date_default >= $day_now_date){
$result = "진행 중";
}
if($start_date_default > $day_now_date and $end_date_default > $day_now_date){
$result = "진행 전";
}
return $result;
}
function promotion_code_finder($bo_table,$wr_id){
$t_sql2 = " SELECT * FROM g5_write_$bo_table where wr_id = '$wr_id' ";
//echo $t_sql2;
$result_t2 = sql_fetch($t_sql2);
if($result_t2['wr_id']){
// if($bo_table == "pcode_management" or $bo_table == "specialoffers"){
$array['wr_id'] = $result_t2['wr_id'];
$array['wr_subject'] = $result_t2['wr_subject'];
$array['wr_datetime'] = $result_t2['wr_datetime'];
$array['wr_1'] = $result_t2['wr_1'];
$array['wr_2'] = $result_t2['wr_2'];
$array['wr_3'] = $result_t2['wr_3'];
$array['ca_name'] = $result_t2['ca_name'];
}
return $array;
}
function get_adm_pcode_chk($str,$type,$wr_id){
$bo_table="pcode_management";
if($type == "new"){
$t_sql = " SELECT count(*) as cnt FROM g5_write_$bo_table where wr_subject = '$str' ";
}
else{
$t_sql = " SELECT count(*) as cnt FROM g5_write_$bo_table where wr_subject = '$str' and wr_id != '$wr_id' ";
}
//echo $t_sql;
$t_row = sql_fetch($t_sql);
if($t_row['cnt'] > 0 ){
$result = true;
}
else{
$result = false;
}
// $result = $t_sql;
return $result;
}
function test_chk1(){
echo "연결확인";
}
?>