idchk.php 5.58 KB
<?PHP 
//*****************************************************************************
//* 
//* プログラム名:ログインチェック
//* プログラムID:loginchk.php
//* 機能        :
//* 作成者      :K.Yoshimura(MTC)
//* 
//*****************************************************************************

header("Content-type: text/html; charset=Shift_JIS");

include("./include/dbcon2.inc");
include("./include/session_start.inc");
include("./include/mime.php");
include("./include/getWeekDay.inc");
include("./include/getDomain.inc");
include("./include/jcode.phps");

	$strSQL="";
	$objRecSet="null";

	$strSysDate = date("Ymd");
	
	$e_mail = $e_mail1."@".$e_mail2;
	//管理者処理
	$strSQL = "SELECT * " .
			  "FROM form_data_tbl,mst_kanri " .
			  "WHERE mst_kanri.user_name = '" . $group_name ."'".
			  "AND form_data_tbl.e_mail = '" . $e_mail . "' " .
			  "AND form_data_tbl.user_id  = mst_kanri.user_id " .
			  "AND mst_kanri.userflg = 0";
	$objRecSet = pg_exec($strSQL);
	if($objRecSet==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
	}
	
	if (pg_numrows($objRecSet) >= 1) {
		
		$user_pass=pg_result($objRecSet,0,"password");
		$user_name=pg_result($objRecSet,0,"user_name");
		$LoginID = pg_result($objRecSet,0,"user_id");


		$strSubmitAdd="webmaster@media-tek.co.jp";
		$strKenmei="め〜るNIポンご登録内容のお知らせ";
		$Header1 = "";

		$Header="";//ヘッダー部クリア

		$Headers['From']=$strSubmitAdd;
		$Headers['X-Mailer']="PHP/".phpversion(); //メール送信プログラムの表示
	    	  
		$strSubject = "=?iso-2022-jp?B?" . base64_encode(jcodeconvert(stripslashes($strKenmei), 0, 3)) . "?=";

		$strComment = jcodeconvert($user_name,0,2)." 様\n\n";
		$strComment .= "--ご登録内容------------------------------------\n";
		$strComment .= "ログインURL(PC版):http://www.mail-ni-pon.net/\n";
		$strComment .= "ログインURL(携帯版):http://125.206.112.127/mail_ni_pon_v2/\n";
		$strComment .= "ログインID:".$LoginID."\n";
		$strComment .= "Password:".$user_pass."\n";
		$strComment .= "------------------------------------------------\n";
		$strComment .= "\n";
		$strComment .= "不明な点等ございましたら、[ webmaster@media-tek.co.jp ]まで\n";
		$strComment .= "お気軽にお問合せください。\n";
		$strComment .= "\n";
		$strComment .= "今後とも、よろしくお願い申し上げます。\n";
		$strComment .= "\n";
		$strComment .= "==================================================================\n";
		$strComment .= "\n";
		$strComment .= "め〜るNIポン お問合せ: webmaster@media-tek.co.jp\n";
		$strComment .= "メディアテック株式会社 http://www.media-tek.co.jp\n";
		$strComment .= "\n";
		$strComment .= "==================================================================\n";
		$strComment .= "\n";

		$strComment = jcodeconvert($strComment, 0, 3);

		$Header="";//ヘッダー部クリア
		$Header1 = "";

		//PEARのmimeクラス設定
		$mime = new Mail_mime("\r\n");
		$mime->_build_params['text_charset'] = 'iso-2022-jp'; //本文テキストの文字コードをJISに設定する
		//本文のテキストの指定
		$mime->setTXTBody($strComment);

		$strComment = $mime->get();

		$Headers = $mime->headers($Headers);
		while (list($key,$val)=each($Headers)) {
			$Header1 .= $key.": ".$val."\r\n";
		}

		$intBool2 = mail($e_mail,$strSubject,$strComment,$Header1,"-f ".$strSubmitAdd);//携帯に送信
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="basefont.css">
<TITLE>め〜るNiポン!</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
	function chk(){
		document.forms[0].action="http://www.mail-ni-pon.net/";
		document.forms[0].method="POST"
		document.forms[0].submit();
		return false;
	}
-->
</SCRIPT>
</HEAD>
<body background="image/003_c.gif">  <form><CENTER>
    <TABLE border="0" height="275">
      <TR>
        <TD height="129" colspan="2" align="center"><img src="./admin/img/title_logo.gif" alt="めーるNiポン"></TD>
      </TR>
      <TR>
        <TD height="129" colspan="2" align="center"><B>メールを送信しました<br></B></TD>
      </TR>
      <TR>
        <TD colspan="2"><div align="center">
          <INPUT type="button" onclick="return chk();" value=" ログイン画面へ戻る " ><BR>
        </TD>
      </TR>
      <TR>
        <td colspan="2" align="center"><font size="-1" color="#666666"><BR><BR>Copyright (C) 2005
            Media Tech Inc. All rights reserved.</font></td>
      </TR>     
    </TABLE></CENTER>
  </form>
</body>
</HTML>	 
	 
<?PHP 
	}else{
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="basefont.css">
<TITLE>め〜るNiポン! 認証失敗</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
	function chk(){
		document.forms[0].action="pass_los.php";
		document.forms[0].method="POST"
		document.forms[0].submit();
		return false;
	}
-->
</SCRIPT>

<body background="image/003_c.gif">  <form><CENTER>
    <TABLE border="0" height="275">
      <TR>
        <TD height="129" colspan="2" align="center"><img src="./admin/img/title_logo.gif" alt="めーるNiポン"></TD>
      </TR>
      <TR>
        <TD height="129" colspan="2" align="center"><B>「団体名」「メールアドレス」が登録されていません<br></B></TD>
      </TR>
      <TR>
        <TD colspan="2"><div align="center">
          <INPUT type="button" onclick="return chk();" value=" 戻る " ><BR>
        </TD>
      </TR>
      <TR>
        <td colspan="2" align="center"><font size="-1" color="#666666"><BR><BR>Copyright (C) 2005
            Media Tech Inc. All rights reserved.</font></td>
      </TR>     
    </TABLE></CENTER>
  </form>
</body>
</HTML>
<?PHP 
	}

?>