<? include_once "../config.php"; $query3 = "SELECT * FROM ".$_gl['voter_info_table']." WHERE vote_serial='' AND vote_winner='N||DELIVERY'"; $result3 = mysqli_query($my_db, $query3); $i=0; while ($data = mysqli_fetch_array($result3)) { print_r($i); $serial = BA_getSerial("N||DELIVERY"); $query = "UPDATE ".$_gl['voter_info_table']." SET vote_serial='".$serial."' WHERE idx='".$data['idx']."'"; $result = mysqli_query($my_db, $query); $i++; } ?>
$vote_name = $_REQUEST['vote_name']; $vote_phone = $_REQUEST['vote_phone']; $vote_idx = $_REQUEST['vote_idx']; $media = $_SESSION['ss_media']; $dupli_query = "SELECT * FROM " . $_gl['voter_info_table'] . " WHERE vote_phone='" . $vote_phone . "' AND vote_regdate like '%" . date("Y-m-d") . "%'"; $dupli_result = mysqli_query($my_db, $dupli_query); $dupli_cnt = mysqli_num_rows($dupli_result); $all_query = "SELECT * FROM " . $_gl['voter_info_table'] . " WHERE vote_phone='" . $vote_phone . "'"; $all_result = mysqli_query($my_db, $all_query); $all_cnt = mysqli_num_rows($all_result); if ($dupli_cnt > 0) { $flag = "D||no"; } else { $winnerYN = BA_winner_draw($vote_phone); //$winnerYN2 = "N||DISCOUNT"; $serial = BA_getSerial($winnerYN); $query = "INSERT INTO " . $_gl['voter_info_table'] . "(vote_ipaddr,vote_name,vote_phone,vote_sel_idx,vote_winner,vote_regdate,vote_gubun,vote_media,vote_serial) values('" . $_SERVER['REMOTE_ADDR'] . "','" . $vote_name . "','" . $vote_phone . "','" . $vote_idx . "','" . $winnerYN . "','" . date("Y-m-d H:i:s") . "','" . $gubun . "','" . $media . "','" . $serial . "')"; $result = mysqli_query($my_db, $query); $query2 = "UPDATE " . $_gl['member_info_table'] . " SET mb_vote=mb_vote+1 WHERE idx='" . $vote_idx . "'"; $result2 = mysqli_query($my_db, $query2); $nominee_query = "SELECT * FROM " . $_gl['member_info_table'] . " WHERE mb_phone='" . $vote_phone . "'"; $nominee_result = mysqli_query($my_db, $nominee_query); $nominee_cnt = mysqli_num_rows($nominee_result); if ($all_cnt == 0) { if ($nominee_cnt == 0) { send_lms2($vote_phone, $serial); } } if ($winnerYN == "N||DELIVERY") { if ($nominee_cnt == 0) { send_lms2($vote_phone, $serial);