|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/www/admin/Proc/ |
Upload File : |
<?include "$DOCUMENT_ROOT/conf/conf_dir.php";?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?
$table_names = "user_cash";
//$cafe_names = "xe_member"; //cafe table name
if($idx){
if($mode == 10){
$query = "INSERT INTO $table_names
(user_id,startdate,enddate,inning)
VALUES
('$idx',now(),date_add(now(), interval +365 day),$inning )";
$result = mysql_query($query,$db_con);
$cash_chk = get_db("select count(id) from $table_names where user_id='$idx'");
$datevalue = ",cash_chk='$cash_chk',m_startdate=now(),m_enddate=date_add(now(), interval +365 day)";
$tabs = "";
//정회원 번호 주기.
$memberCode_chk = get_db("select member_code from user where id='$idx'");
if(!$memberCode_chk){
$member_code = get_db("select max(member_code) from user where activated = 1")+1;
$datevalue .=",member_code = $member_code";
}
$queryupok = "update user set auth_code = '$mode' $datevalue where id = '$idx'";
$queryupok_result = mysql_query($queryupok,$db_con);
}else{
//유료회원 된걸 일반회원으로 수정하고 이전결제 처리 된 내용 삭제 하고 이전에 있는 결제 정보가 있다면 10유지 아니면 3으로 수정
$userinfo = Get_dbres("select * from user where id = '$idx'");
$rowF = mysql_fetch_array($userinfo);
//처리된 내용 삭제
$delqry = mysql_query("DELETE FROM $table_names where id = '$rowF[cash_chk]' and userid='$rowF[userid]' and flag='D'",$db_con);
//이전 결제 처리
$beforeCash = Get_dbres("select * from $table_names where flag = 'D' and user_id = '$idx' order by id desc");
$row = mysql_fetch_array($beforeCash);
if($row[id] && ($today < $row[enddate])){
$auth_code = 10;
$cash_chk = $row[id];
$m_startdate = $row[startdate];
$m_enddate = $row[enddate];
$member_code = $rowF[member_code];
}else{
$auth_code = 3;
$cash_chk = "";
$m_startdate = "";
$m_enddate = "";
$member_code = "";
}
//member table 결재 정보 수정
$queryupok = "update user set auth_code = '$auth_code',cash_chk='$cash_chk',m_startdate='$m_startdate',m_enddate='$m_enddate' ,member_code='$member_code' where id = '$idx'";
$queryupok_result = mysql_query($queryupok,$db_con);
}
//메일부분
if($mode == 10){
//module_name 3-창의, 2-시후, mode 1-회원가입 축하메일
$mail_qry = "SELECT * FROM user where id='$idx'";
$mresult = mysql_query($mail_qry,$db_con);
$row = mysql_fetch_array($mresult);
$mail_qry = "SELECT * FROM mail_form where module_name = 2 and mode = 2";
$mresult = mysql_query($mail_qry,$db_con);
$rows = mysql_fetch_array($mresult);
$message = $row[jname2]."様<br>";
//$message .= "会員番号 : ".$row[member_code]."<br>";
//$message .= "会員期間 : ".$row[m_startdate]."~".$row[m_enddate]."<br>";
$message .= $rows[contents];
$to = $row[email];
$subject = $rows[subject];
$from_email = $rows[from_email];
$from_name = $rows[from_email]; //송신자 명
//sendmail_jpn($to, $subject, $message, $from_email,$from_name,'');
//cafe member 가입
//$cafeChk = get_db("select count(member_srl) from `$cafe_names` where user_id='$row[userid]'");
/*if(!$cafeChk){
$mailArr = explode("@","$row[email]");
$id = $row[userid];
$insert_query="INSERT INTO `$cafe_names` (`member_srl`, `user_id`, `email_address`, `password`, `email_id`, `email_host`, `user_name`, `nick_name`, `homepage`, `blog`, `birthday`, `allow_mailing`, `allow_message`, `denied`, `limit_date`, `regdate`, `last_login`, `is_admin`, `description`, `extra_vars`) VALUES
($idx, '$id', '$row[email]', '$row[password]', '$mailArr[0]', '$mailArr[1]', '$row[jname]', '$row[nickname]', '', '', '$row[birthday]', 'N', 'N', 'N', '', now(), '', 'N', '', '')";
mysql_query($insert_query,$db_con);
}*/
//$pathURL="../memberlist1.php?act=2";
}else{
$pathURL="../memberlist.php?act=1&key=userid&key_word=$rowF[userid]";
}
}
?>
<script>
alert("保存しました.");
parent.location.href = "<?=$pathURL?>";
</script>