Commit 589e93bc9af412407efdaf602b1273a3afe9bcfd

Authored by 山上
0 parents

移行前めーるNiポン

Too many changes to show.

To preserve performance only 32 of 32+ files are displayed.

  1 +php_flag register_globals On
  2 +php_flag display_errors On
  3 +php_value error_reporting 6135
  4 +AddDefaultCharset none
\ No newline at end of file
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:BUY0000.php
  6 +//* 機能 :ポイントの必要項目入力
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk2.inc");
  17 +include("./include/jcode.phps");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** 接続処理 **********//
  23 +include("./include/dbcon2.inc");
  24 +
  25 +$strSQL = "SELECT * FROM point_buy_history_tbl WHERE user_id = '".$PHP_POST_SYAIN_ID."' and flg = 1";
  26 +$objRecSet = pg_exec($strSQL);
  27 +if($objRecSet==false){
  28 + echo("SQL実行に失敗しました(INSERT)");
  29 + exit;
  30 +}
  31 +if (pg_numrows($objRecSet)>0){
  32 + $buy_flg = 1;
  33 +}else{
  34 + $buy_flg = 0;
  35 +}
  36 +
  37 +$o_smarty->assign('buy_flg' , $buy_flg);
  38 +
  39 +$o_smarty->display('BUY0000.tpl');
  40 +
  41 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:BUY0001.php
  6 +//* 機能 :ポイント購入確認
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk2.inc");
  17 +include("./include/dbcon.inc");
  18 +include("./include/jcode.phps");
  19 +
  20 +//********** ヘッダー処理 **********//
  21 +include("./include/headr_data.inc");
  22 +
  23 +switch ($_POST["point"]) {
  24 + case "1": $Point_Name = "500ポイント(2,000円)"; break;
  25 + case "2": $Point_Name = "1100ポイント(4,000円)"; break;
  26 + case "3": $Point_Name = "1700ポイント(6,000円)"; break;
  27 + case "4": $Point_Name = "3500ポイント(10,000円)"; break;
  28 + case "5": $Point_Name = "8000ポイント(20,000円)"; break;
  29 +}
  30 +
  31 +$o_smarty->assign('point' , $_POST["point"]);
  32 +$o_smarty->assign('Point_Name' , $Point_Name);
  33 +$o_smarty->assign('buy_name' , $_POST["buy_name"]);
  34 +$o_smarty->assign('mail_add1' , $_POST["mail_add1"]);
  35 +$o_smarty->assign('mail_add2' , $_POST["mail_add2"]);
  36 +$o_smarty->display('BUY0001.tpl');
  37 +
  38 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:BUY0002.php
  6 +//* 機能 :ポイントの必要項目メール送信
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/session_start.inc");
  15 +include("./include/SessionChk2.inc");
  16 +include("./include/jcode.phps");
  17 +include("./include/mime.php");
  18 +
  19 +//********** 接続処理 **********//
  20 +include("./include/dbcon2.inc");
  21 +
  22 +if($buy_point==1){
  23 + $Kingaku = "2,000円(500ポイント)";
  24 + $intPoint = 500;
  25 +}
  26 +if($buy_point==2){
  27 + $Kingaku = "4,000円(1100ポイント)";
  28 + $intPoint = 1100;
  29 +}
  30 +if($buy_point==3){
  31 + $Kingaku = "6,000円(1700ポイント)";
  32 + $intPoint = 1700;
  33 +}
  34 +if($buy_point==4){
  35 + $Kingaku = "10,000円(3500ポイント)";
  36 + $intPoint = 3500;
  37 +}
  38 +if($buy_point==5){
  39 + $Kingaku = "20,000円(8000ポイント)";
  40 + $intPoint = 8000;
  41 +}
  42 +
  43 +$strSQL = "INSERT INTO point_buy_history_tbl (user_id,buy_point,buy_date,flg,mail_add,name)" .
  44 + "VALUES ('".$PHP_POST_SYAIN_ID."'," .
  45 + $intPoint . ", " .
  46 + "'" . date("YmdHis") . "', " .
  47 + 1 . ",'".$buy_mail_add."','".$buy_name."')";
  48 +$objRecSet = pg_exec($strSQL);
  49 +if($objRecSet==false){
  50 + echo("SQL実行に失敗しました(INSERT)");
  51 + exit;
  52 +}
  53 +
  54 +//登録完了メール送信
  55 +$strToMob = $buy_mail_add;
  56 +$strSubmitAdd = "webmaster@media-tek.co.jp";
  57 +$Subject_name = "め〜るNiポン ポイント料金 お支払いのご案内";
  58 +$strSubject = "=?iso-2022-jp?B?" . base64_encode(jcodeconvert($Subject_name, 0, 3)) . "?=";
  59 +
  60 +$strComment .= $buy_name." 様\n";
  61 +$strComment .= "\n";
  62 +$strComment .= "ご請求金額の入金確認後に手続きを進めさせて頂きます。\n";
  63 +$strComment .= "下記の銀行口座までお振込をお願い致します。\n";
  64 +$strComment .= "なお、お振込手数料はお客様のご負担でお願い申し上げます。\n";
  65 +$strComment .= "お申し込み後、30日経過してもご入金の確認が取れない場合は、\n";
  66 +$strComment .= "申込取消しとさせて頂く場合がございます。\n";
  67 +$strComment .= "\n";
  68 +$strComment .= "------------------------------------------------\n";
  69 +$strComment .= "お支払い金額 ".$Kingaku."\n";
  70 +$strComment .= "------------------------------------------------\n";
  71 +$strComment .= "\n";
  72 +$strComment .= "お支払い方法 銀行振り込み \n";
  73 +$strComment .= "お振込み先 銀行名 :ジャパンネット銀行\n";
  74 +$strComment .= "支店名 :本店営業部\n";
  75 +$strComment .= "口座種別:普通口座\n";
  76 +$strComment .= "口座番号:6320201\n";
  77 +$strComment .= "口座名義:メディアテック株式会社\n";
  78 +$strComment .= "\n";
  79 +$strComment .= "※お振込み名義は、ご登録団体名を入力してください。\n";
  80 +$strComment .= "\n";
  81 +$strComment .= "------------------------------------------------\n";
  82 +$strComment .= "\n";
  83 +$strComment .= "\n";
  84 +$strComment .= "その他、「め〜るNiポン」に関してご不明点・弊社へのご要望などございましたら、\n";
  85 +$strComment .= "何なりとお申し付け下さい。\n";
  86 +$strComment .= "今後ともメディアテック株式会社をよろしくお願い申し上げます。\n";
  87 +$strComment .= "\n";
  88 +$strComment .= "==================================================================\n";
  89 +$strComment .= "\n";
  90 +$strComment .= "め〜るNiポン お問合せ: webmaster@media-tek.co.jp\n";
  91 +$strComment .= "メディアテック株式会社 http://www.media-tek.co.jp\n";
  92 +$strComment .= "\n";
  93 +$strComment .= "==================================================================\n";
  94 +$strComment .= "\n";
  95 +$strComment = jcodeconvert($strComment, 1, 3);
  96 +
  97 +$Header1 = "";
  98 +$Headers['From']=$strSubmitAdd;
  99 +$Headers['X-Mailer']="PHP/".phpversion(); //メール送信プログラムの表示
  100 +//PEARのmimeクラス設定
  101 +$mime = new Mail_mime("\r\n");
  102 +$mime->_build_params['text_charset'] = 'iso-2022-jp'; //本文テキストの文字コードをJISに設定する
  103 +//本文のテキストの指定
  104 +$mime->setTXTBody($strComment);
  105 +
  106 +$strComment = $mime->get();
  107 +
  108 +$Headers = $mime->headers($Headers);
  109 + while (list($key,$val)=each($Headers)) {
  110 + $Header1 .= $key.": ".$val."\r\n";
  111 +}
  112 +$intBool2 = mail($strToMob,$strSubject,$strComment,$Header1,"-f ".$strSubmitAdd);//登録者に送信
  113 +if(!$intBool2){
  114 + echo("メール送信に失敗しました。<tr>");
  115 + echo "宛先:".$strToMob."<BR>";
  116 + echo "件名:".$strSubject."<BR>";
  117 + echo "内容:".$strComment."<BR>";
  118 + echo "header:".$Header1."<BR>";
  119 + exit;
  120 +}
  121 +
  122 +$strToMob = "webmaster@media-tek.co.jp";
  123 +//$strSubmitAdd = "webmaster@media-tek.co.jp";
  124 +$strSubmitAdd = "a-kodera@media-tek.co.jp";
  125 +
  126 +$Subject_name = "め〜るNiポン ポイント申し込みがありました";
  127 +$strSubject = "=?iso-2022-jp?B?" . base64_encode(jcodeconvert($Subject_name, 0, 3)) . "?=";
  128 +$str = "団体名:".$PHP_POST_DB_USER_NAME."\n\n";
  129 +$strComment = jcodeconvert($str, 1, 3).$strComment;
  130 +$intBool2 = mail($strToMob,$strSubject,$strComment,$Header1,"-f ".$strSubmitAdd);//登録者に送信
  131 +if(!$intBool2){
  132 + echo("メール送信に失敗しました。<tr>");
  133 + echo "宛先:".$strToMob."<BR>";
  134 + echo "件名:".$strSubject."<BR>";
  135 + echo "内容:".$strComment."<BR>";
  136 + echo "header:".$Header1."<BR>";
  137 + exit;
  138 +}
  139 +
  140 +?>
  141 +
  142 +<HTML>
  143 +<HEAD>
  144 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  145 +<META http-equiv="Content-Style-Type" content="text/css">
  146 +<link rel="stylesheet" type="text/css" href="basefont.css">
  147 +<TITLE>ポイント購入</TITLE>
  148 +<SCRIPT LANGUAGE="JAVASCRIPT">
  149 +<!--
  150 +function load_screen(){
  151 + document.mailnipon.action = "BUY0003.php";
  152 + document.mailnipon.method="POST";
  153 + document.mailnipon.submit();
  154 +}
  155 +-->
  156 +</SCRIPT>
  157 +</HEAD>
  158 +<BODY onLoad="return load_screen();">
  159 +<form name="mailnipon">
  160 + <input type="hidden" name="Kingaku" value="<?PHP echo $Kingaku ?>">
  161 +</form>
  162 +</BODY>
  163 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:BUY0003.php
  6 +//* 機能 :ポイントの必要項目入力
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk2.inc");
  17 +include("./include/dbcon.inc");
  18 +include("./include/jcode.phps");
  19 +
  20 +//********** ヘッダー処理 **********//
  21 +include("./include/headr_data.inc");
  22 +
  23 +$o_smarty->assign('Kingaku' , $_POST["Kingaku"]);
  24 +$o_smarty->display('BUY0003.tpl');
  25 +
  26 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST0000.php
  6 +//* 機能 :配信した情報の一覧を表示する
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** カレンダー処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +//*** メールデータ取得 ***//
  26 +$strSQL = "SELECT ";
  27 +$strSQL .= " mail_data.mail_id , ";
  28 +$strSQL .= " mail_data.message_date, ";
  29 +$strSQL .= " mail_data.message_time, ";
  30 +$strSQL .= " mail_data.subject_name, ";
  31 +$strSQL .= " mail_data.contents , ";
  32 +$strSQL .= " mail_data.send_date , ";
  33 +$strSQL .= " mail_data.send_alarm , ";
  34 +$strSQL .= " mail_data.reserva_flg , ";
  35 +$strSQL .= " mail_data.reserva_date, ";
  36 +$strSQL .= " mail_data.reserva_time, ";
  37 +$strSQL .= " syain_tbl.name_kj_sei , ";
  38 +$strSQL .= " syain_tbl.name_kj_mei , ";
  39 +$strSQL .= " answer_data.name50_nm ";
  40 +$strSQL .= "FROM ";
  41 +$strSQL .= " (";
  42 +$strSQL .= " mail_data ";
  43 +$strSQL .= " LEFT JOIN syain_tbl ON mail_data.admin_cd = syain_tbl.syain_cd ";
  44 +$strSQL .= " )";
  45 +$strSQL .= " LEFT JOIN answer_data ON mail_data.mail_id = answer_data.mail_id ";
  46 +//$strSQL .= "WHERE ";
  47 +//$strSQL .= " mail_data.admin_cd = syain_tbl.syain_cd AND";
  48 +//$strSQL .= " mail_data.mail_id = answer_data.mail_id ";
  49 +$strSQL .= "ORDER BY ";
  50 +$strSQL .= " mail_data.Mail_id DESC";
  51 +$objRec = pg_exec($strSQL);
  52 +if($objRec==false){
  53 + echo("SQL実行に失敗しました(SELECT)");
  54 + exit;
  55 +}
  56 +
  57 +for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
  58 + $obData = pg_fetch_object($objRec, $intI);
  59 +
  60 + $MailData[$intI][0] = $obData->mail_id;
  61 + $MailData[$intI][1] = intval(substr($obData->send_date,0,4))."年";
  62 + $MailData[$intI][1] .= str_replace("*","&nbsp;",sprintf("%'*2s",intval(substr($obData->send_date,4,2))))."月";
  63 + $MailData[$intI][1] .= str_replace("*","&nbsp;",sprintf("%'*2s",intval(substr($obData->send_date,6,2))))."日";
  64 + $MailData[$intI][1] .= "&nbsp;";
  65 + $MailData[$intI][1] .= str_replace("*","&nbsp;",sprintf("%'*2s",intval(substr($obData->send_date,8,2))))."時";
  66 + $MailData[$intI][1] .= str_replace("*","&nbsp;",sprintf("%'*2s",intval(substr($obData->send_date,10,2))))."分";
  67 + $MailData[$intI][1] .= str_replace("*","&nbsp;",sprintf("%'*2s",intval(substr($obData->send_date,12,2))))."秒";
  68 + $MailData[$intI][2] = $obData->subject_name;
  69 +
  70 + switch ($obData->name50_nm) {
  71 + case "SC":
  72 + $DataSC[$intI][0] = "#DEFFD1";
  73 + $DataSC[$intI][1] = "<br>(スケジュール調整)";
  74 + $DataSC[$intI][2] = "LIST2000.php";
  75 + break;
  76 + case "QU":
  77 + $DataSC[$intI][0] = "#FFFF66";
  78 + $DataSC[$intI][1] = "<br>(アンケート)";
  79 + $DataSC[$intI][2] = "LIST3000.php";
  80 + break;
  81 + case "DM":
  82 + $DataSC[$intI][0] = "#E6E6FA";
  83 + $DataSC[$intI][1] = "<br>(お知らせ配信)";
  84 + $DataSC[$intI][2] = "LIST1000.php";
  85 + break;
  86 + default:
  87 + $DataSC[$intI][0] = "#FFFFFF";
  88 + $DataSC[$intI][1] = "";
  89 + $DataSC[$intI][2] = "LIST1000.php";
  90 + }
  91 +
  92 + //***** 閲覧情報取得 *****//
  93 + $strSQL = "SELECT ";
  94 + $strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id) AS all_cnt ,";
  95 + $strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg =0) AS n_read_cnt,";
  96 + $strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg<>0) AS read_cnt ,";
  97 + $strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND (chk1.check_flg<>0 AND chk1.check_flg<>99)) AS ans_cnt ,";
  98 + $strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg =100) AS not_cnt ";
  99 + $strSQL .= "FROM ";
  100 + $strSQL .= " mail_info AS M ";
  101 + $strSQL .= "WHERE";
  102 + $strSQL .= " M.mail_id=".$obData->mail_id;
  103 + $strSQL .= "GROUP BY ";
  104 + $strSQL .= " M.mail_id";
  105 + //echo $strSQL."<hr>";
  106 + $objCntRec = pg_exec($strSQL);
  107 + if($objCntRec==false){
  108 + echo("SQL実行に失敗しました(SELECT)");
  109 + exit;
  110 + }
  111 + if(pg_numrows($objCntRec)>0){
  112 + $objCntData = pg_fetch_object($objCntRec, 0);
  113 + $ALL_CNT = $objCntData->all_cnt;
  114 + $N_READ_CNT = $objCntData->n_read_cnt;
  115 + $READ_CNT = $objCntData->read_cnt;
  116 + $ANS_CNT = $objCntData->ans_cnt;
  117 + $NOT_CNT = $objCntData->not_cnt;
  118 + }else{
  119 + $ALL_CNT = 0;
  120 + $N_READ_CNT = 0;
  121 + $READ_CNT = 0;
  122 + $ANS_CNT = 0;
  123 + $NOT_CNT = 0;
  124 + }
  125 +
  126 + if ($obData->name50_nm=="DM"){
  127 + $MailData[$intI][3] = "配信済み";
  128 + }else{
  129 + if ($ALL_CNT==($READ_CNT+$NOT_CNT)){
  130 + $MailData[$intI][3] = "○全既読済";
  131 + }elseif ($ALL_CNT==($READ_CNT+$ANS_CNT+$NOT_CNT)){
  132 + $MailData[$intI][3] = "◇既読・回答済";
  133 + }elseif ($ALL_CNT==($ANS_CNT+$NOT_CNT)){
  134 + $MailData[$intI][3] = "☆全回答済";
  135 + }else{
  136 + $MailData[$intI][3] = "&nbsp;";
  137 + }
  138 + if ($NOT_CNT!=0){
  139 + $MailData[$intI][3] .= "<br />アドレス無し";
  140 + }
  141 + }
  142 + //***** アラーム情報取得 *****//
  143 + if ($obData->mail_id==1){
  144 + $strSQL = "SELECT ";
  145 + $strSQL .= " * ";
  146 + $strSQL .= "FROM ";
  147 + $strSQL .= " alarm_data ";
  148 + $strSQL .= "WHERE";
  149 + $strSQL .= " mail_id=".$obData->mail_id;
  150 + $objALRec = pg_exec($strSQL);
  151 + if($objALRec==false){
  152 + echo("SQL実行に失敗しました(SELECT)");
  153 + exit;
  154 + }
  155 + if(pg_numrows($objALRec)>0){
  156 + $objALData = pg_fetch_object($objALRec, 0);
  157 + if ($objALData->send_flg==1){
  158 + $MailData[$intI][4] = "送信済";
  159 + }else{
  160 + $MailData[$intI][4] = "設定済";
  161 + }
  162 + }else{
  163 + $MailData[$intI][4] = "";
  164 + }
  165 + }else{
  166 + $MailData[$intI][4] = "";
  167 + }
  168 +}
  169 +
  170 +$MailCnt=count($MailData);
  171 +
  172 +$o_smarty->assign('N_READ_CNT' , $N_READ_CNT);
  173 +
  174 +$o_smarty->assign('MailData' , $MailData);
  175 +$o_smarty->assign('MailCnt' , $MailCnt);
  176 +$o_smarty->assign('DataSC' , $DataSC);
  177 +
  178 +$o_smarty->display('LIST0000.tpl');
  179 +
  180 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST0001.php
  6 +//* 機能 :メール削除
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/session_start.inc");
  15 +include("./include/SessionChk.inc");
  16 +include("./include/dbcon.inc");
  17 +
  18 +$Delete_Key=split("#",$_POST["strChkDat"]);
  19 +for ($intI = 0 ; $intI < count($Delete_Key)-1 ; $intI++) {
  20 + //メールデータ削除
  21 + $strSQL = "DELETE FROM mail_data WHERE mail_id=".$Delete_Key[$intI];
  22 + //echo $strSQL."<hr>";
  23 + $objRec = pg_exec($strSQL);
  24 + if($objRec==false){
  25 + echo("SQL実行に失敗しました(DELETE)");
  26 + exit;
  27 + }
  28 +
  29 + //アラームデータ削除
  30 + $strSQL = "DELETE FROM alarm_data WHERE mail_id=".$Delete_Key[$intI];
  31 + $objRec = pg_exec($strSQL);
  32 + if($objRec==false){
  33 + echo("SQL実行に失敗しました(DELETE)");
  34 + exit;
  35 + }
  36 +
  37 + //メールINFO削除
  38 + $strSQL = "DELETE FROM mail_info WHERE mail_id=".$Delete_Key[$intI];
  39 + $objRec = pg_exec($strSQL);
  40 + if($objRec==false){
  41 + echo("SQL実行に失敗しました(DELETE)");
  42 + exit;
  43 + }
  44 +
  45 + //メールINF2O削除
  46 + $strSQL = "DELETE FROM mail_info2 WHERE mail_info2.mail_id = '" . $Delete_Key[$intI] . "'";
  47 + $objRecSet = pg_exec($strSQL);
  48 + if($objRecSet==false){
  49 + echo("SQL実行に失敗しました(DELETE)");
  50 + exit;
  51 + }
  52 +
  53 + //メール回答情報削除
  54 + $strSQL = "DELETE FROM answer_data WHERE mail_id=".$Delete_Key[$intI];
  55 + $objRec = pg_exec($strSQL);
  56 + if($objRec==false){
  57 + echo("SQL実行に失敗しました(DELETE)");
  58 + exit;
  59 + }
  60 +
  61 + //既読・未読自動再配信情報削除
  62 + $strSQL = "DELETE FROM kidok_data WHERE mail_id=".$Delete_Key[$intI];
  63 + $objRec = pg_exec($strSQL);
  64 + if($objRec==false){
  65 + echo("SQL実行に失敗しました(DELETE)");
  66 + exit;
  67 + }
  68 +
  69 + //配信機種情報削除
  70 + $strSQL = "DELETE FROM mail_send_tbl WHERE mail_id=".$Delete_Key[$intI];
  71 + $objRec = pg_exec($strSQL);
  72 + if($objRec==false){
  73 + echo("SQL実行に失敗しました(DELETE)");
  74 + exit;
  75 + }
  76 +}
  77 +
  78 +header("Location:./LIST0000.php");
  79 +exit;
  80 +
  81 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1000.php
  6 +//* 機能 :配信した情報を表示する
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** メイン処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  26 +
  27 +//表示項目を取得
  28 +$strSQL = "SELECT * FROM Mst_disp ORDER BY Mst_disp.Disp_id ASC";
  29 +$objRecSet = pg_exec($strSQL);
  30 +if($objRecSet==false){
  31 + echo("SQL実行に失敗しました(SELECT)a");
  32 + exit;
  33 +}
  34 +$strGroup = pg_result($objRecSet,1,"Disp_name");
  35 +$strKenmei = pg_result($objRecSet,2,"Disp_name");
  36 +
  37 +//***** メール配信情報 *****//
  38 +//*** 配信情報を取得 ***//
  39 +$strSQL = "SELECT ";
  40 +$strSQL .= " * ";
  41 +$strSQL .= "FROM ";
  42 +$strSQL .= " mail_data ";
  43 +$strSQL .= "WHERE ";
  44 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"];
  45 +$objRec = pg_exec($strSQL);
  46 +if($objRec==false){
  47 + echo("SQL実行に失敗しました(SELECT)");
  48 + exit;
  49 +}
  50 +
  51 +$objData = pg_fetch_object($objRec, 0);
  52 +$angou_id = $objData->angou_id;
  53 +
  54 +$message_date = $objData->message_date;
  55 +$message_time = $objData->message_time;
  56 +
  57 +if (trim($message_date)!=""){
  58 + $Kaisai_Date = substr($message_date,0,4)."年";
  59 + $Kaisai_Date .= intval(substr($message_date,4,2))."月";
  60 + $Kaisai_Date .= intval(substr($message_date,6,2))."日";
  61 + if ($message_time!=""){
  62 + $Kaisai_Date .= intval(substr($message_time,0,2)) . "時";
  63 + $Kaisai_Date .= intval(substr($message_time,2,2)) . "分";
  64 + }
  65 +}else{
  66 + $Kaisai_Date = "未設定";
  67 +}
  68 +
  69 +$subject_name = htmlspecialchars($objData->subject_name);
  70 +$contents = nl2br(htmlspecialchars($objData->contents));
  71 +$admin_cd = $objData->admin_cd;
  72 +$send_date = $objData->send_date;
  73 +$send_alarm = $objData->send_alarm;
  74 +switch ($objData->send_type) {
  75 + case "0": $send_type = "携帯/PC"; break;
  76 + case "1": $send_type = "携帯"; break;
  77 + case "2": $send_type = "PC"; break;
  78 +}
  79 +$reserva_flg = $objData->reserva_flg;
  80 +$reserva_date = $objData->reserva_date;
  81 +$reserva_time = $objData->reserva_time;
  82 +
  83 +if($reserva_date!=""){
  84 + $Send_Data = substr($reserva_date,0,4)."年";
  85 + $Send_Data .= substr($reserva_date,4,2)."月";
  86 + $Send_Data .= substr($reserva_date,6,2)."日";
  87 + $Send_Data .= substr($reserva_time,8,2)."時";
  88 + $Send_Data .= substr($reserva_time,10,2)."分";
  89 +}else{
  90 + if($reserva_flg!=1){
  91 + $Send_Data = substr($send_date,0,4)."年";
  92 + $Send_Data .= substr($send_date,4,2)."月";
  93 + $Send_Data .= substr($send_date,6,2)."日";
  94 + $Send_Data .= substr($send_date,8,2)."時";
  95 + $Send_Data .= substr($send_date,10,2)."分";
  96 + }
  97 +}
  98 +
  99 +$o_smarty->assign('message_date' , $message_date);
  100 +$o_smarty->assign('message_time' , $message_time);
  101 +$o_smarty->assign('Kaisai_Date' , $Kaisai_Date);
  102 +$o_smarty->assign('subject_name' , $subject_name);
  103 +$o_smarty->assign('contents' , $contents);
  104 +$o_smarty->assign('send_type' , $send_type);
  105 +$o_smarty->assign('reserva_flg' , $reserva_flg);
  106 +$o_smarty->assign('reserva_date' , $reserva_date);
  107 +$o_smarty->assign('reserva_time' , $reserva_time);
  108 +$o_smarty->assign('Send_Data' , $Send_Data);
  109 +
  110 +//*** アラーム ***
  111 +$Al_Set_Flg = "";
  112 +$Al_Send_Flg = "";
  113 +$Al_Send_Date = "";
  114 +$Al_Send_Time = "";
  115 +
  116 +if ($send_alarm==1){
  117 + //* アラーム設定有 *//
  118 + $Al_Set_Flg = "1";
  119 + $strSQL = "SELECT ";
  120 + $strSQL .= " * ";
  121 + $strSQL .= "FROM ";
  122 + $strSQL .= " alarm_data ";
  123 + $strSQL .= "WHERE ";
  124 + $strSQL .= " mail_id = " . (int)$_POST["mail_id"]." ";
  125 + $objRec = pg_exec($strSQL);
  126 + if($objRec==false){
  127 + echo("SQL実行に失敗しました(SELECT)");
  128 + exit;
  129 + }
  130 + $objData = pg_fetch_object($objRec, 0);
  131 + $Al_Send_Flg = $objData->send_flg;
  132 + $al_message_date = $objData->message_date;
  133 + $al_message_time = $objData->message_time;
  134 + $Al_Send_Date = substr($al_message_date, 0, 4)."年 ";
  135 + $Al_Send_Date .= substr($al_message_date, 4, 2)."月 ";
  136 + $Al_Send_Date .= substr($al_message_date, 6, 2)."日";
  137 + $Al_Send_Time = substr($al_message_time, 0, 2)."時";
  138 + $Al_Send_Time .= substr($al_message_time, 2, 2)."分に設定済み";
  139 +
  140 +}else{
  141 + //* アラーム設定無 *//
  142 + $Al_Send_flg = "";
  143 + $Al_Setflg = "";
  144 + $Al_Send_Date = "";
  145 + $Al_Send_Time = "";
  146 +
  147 + if($Kaisai_Date=="未設定"){
  148 + $Al_disable = "DISABLED";
  149 + }else{
  150 + $Al_disable = "";
  151 + }
  152 +}
  153 +$o_smarty->assign('Al_Set_Flg' , $Al_Set_Flg);
  154 +$o_smarty->assign('Al_Send_Flg' , $Al_Send_Flg);
  155 +$o_smarty->assign('Al_Send_Date' , $Al_Send_Date);
  156 +$o_smarty->assign('Al_Send_Time' , $Al_Send_Time);
  157 +$o_smarty->assign('Al_disable' , $Al_disable);
  158 +
  159 +
  160 +if ($Send_alarm==1){
  161 + $intAlarm_flg= 1;
  162 + $strSQL = "SELECT " .
  163 + "alarm_data.Message_date, " .
  164 + "alarm_data.Message_time, " .
  165 + "alarm_data.send_flg, " .
  166 + "alarm_data.answer_id " .
  167 + "FROM alarm_data " .
  168 + "WHERE alarm_data.Mail_id = " . (int)$_POST["mail_id"];
  169 +
  170 + $objRecSet2 = pg_exec($strSQL);
  171 + if($objRecSet==false){
  172 + echo("SQL実行に失敗しました(SELECT)");
  173 + exit;
  174 + }
  175 +
  176 + $Alarm_date = pg_result($objRecSet2,0,"Message_date");
  177 + $Alarm_time = pg_result($objRecSet2,0,"Message_time");
  178 + $Answer_ID = pg_result($objRecSet2,0,"answer_id");
  179 +
  180 +}else{
  181 + $strSysDate = date("YmdHi");
  182 +
  183 + if (strlen($strSysDate) == 10) {
  184 + $strSysDate = "20" . $strSysDate;
  185 + }
  186 + $strYear = substr($strSysDate, 0, 4);
  187 + $strMonth = "";
  188 + $strDate = "";
  189 + $strHour = "";
  190 + $strMinute ="";
  191 + $Alarm_flg = 0;
  192 + $Anser_ID = 0;
  193 +}
  194 +$strToday = substr($strSysDate, 0, 8);
  195 +
  196 +//*** 再送情報を取得 ***
  197 +$Kidoku_FLG = "";
  198 +$Kidoku_User = "";
  199 +$Kidoku_Date = "";
  200 +$Kidoku_Mode = "";
  201 +
  202 +$strSQL = "SELECT ";
  203 +$strSQL .= " * ";
  204 +$strSQL .= "FROM ";
  205 +$strSQL .= " kidok_data ";
  206 +$strSQL .= "WHERE ";
  207 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"]." ";
  208 +$strSQL .= "ORDER BY ";
  209 +$strSQL .= " check_id ASC ";
  210 +$objRec = pg_exec($strSQL);
  211 +if($objRec==false){
  212 + echo("SQL実行に失敗しました(SELECT)");
  213 + exit;
  214 +}
  215 +if(pg_numrows($objRec)!=0){
  216 + $Kidoku_FLG = "1";
  217 + for($intI = 0; $intI < pg_numrows($objRec) ; $intI++){
  218 + $objData = pg_fetch_object($objRec, $intI);
  219 + switch ($objData->check_id) {
  220 + case "0":
  221 + $Kidoku_User = "未読者へ";
  222 + break;
  223 + case "99":
  224 + if($Kidoku_User == ""){
  225 + $Kidoku_User = "既読者へ";
  226 + }else{
  227 + $Kidoku_User .= ":既読者へ";
  228 + }
  229 + break;
  230 + }
  231 + $Kidok_date = $objData->message_date;
  232 + $Kidok_time = $objData->message_time;
  233 + $Kidok_Send = $objData->send_flg;
  234 + }
  235 +
  236 + $Kidoku_Date = substr($Kidok_date,0,4)."年";
  237 + $Kidoku_Date .= substr($Kidok_date,4,2)."月";
  238 + $Kidoku_Date .= substr($Kidok_date,6,2)."日";
  239 + $Kidoku_Date .= substr($Kidok_time,0,2)."時";
  240 + $Kidoku_Date .= substr($Kidok_time,2,2)."分";
  241 +
  242 + if($Kidok_Send==1){
  243 + $Kidoku_Mode = "送信済み";
  244 + }else{
  245 + $Kidoku_Mode = "設定済み";
  246 + }
  247 +
  248 +}else{
  249 + $Kidoku_Mode = "未設定";
  250 + if($Kaisai_Date=="未設定"){
  251 + $Kidoku_disable = "DISABLED";
  252 + }else{
  253 + $Kidoku_disable = "";
  254 + }
  255 +
  256 +}
  257 +
  258 +$o_smarty->assign('Kidoku_FLG' , $Kidoku_FLG);
  259 +$o_smarty->assign('Kidoku_Date' , $Kidoku_Date);
  260 +$o_smarty->assign('Kidoku_User' , $Kidoku_User);
  261 +$o_smarty->assign('Kidoku_Mode' , $Kidoku_Mode);
  262 +$o_smarty->assign('Kidoku_disable' , $Kidoku_disable);
  263 +
  264 +
  265 +//*** 回答期限取得 ***//
  266 +$strSQL = "SELECT ";
  267 +$strSQL .= " * ";
  268 +$strSQL .= "FROM ";
  269 +$strSQL .= " res_time_tbl ";
  270 +$strSQL .= "WHERE ";
  271 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"]." AND ";
  272 +$strSQL .= " angou_id = '" . $angou_id."' ";
  273 +$objRec = pg_exec($strSQL);
  274 +if($objRec==false){
  275 + echo("SQL実行に失敗しました(SELECT)");
  276 + exit;
  277 +}
  278 +if(pg_numrows($objRec)!=0){
  279 + $objData = pg_fetch_object($objRec, 0);
  280 + $d1 = mktime (substr($objData->date,8,2), substr($objData->date,10,2) , 0 , substr($objData->date,4,2), substr($objData->date,6,2), substr($objData->date,0,4));
  281 + $limit_date=date("Y年m月d日 H時i分",$d1)."まで";
  282 +}else{
  283 + $strlimit_date="設定なし";
  284 +}
  285 +
  286 +$o_smarty->assign('limit_date' , $limit_date);
  287 +
  288 +//*** 送信者 ***//
  289 +$strSQL = "SELECT ";
  290 +$strSQL .= " * ";
  291 +$strSQL .= "FROM ";
  292 +$strSQL .= " syain_tbl ";
  293 +$strSQL .= "WHERE ";
  294 +$strSQL .= " syain_cd = ".$admin_cd;
  295 +$objRec = pg_exec($strSQL);
  296 +if($objRec==false){
  297 + echo("SQL実行に失敗しました(SELECT)");
  298 + exit;
  299 +}
  300 +if(pg_numrows($objRec)!=0){
  301 + $objData = pg_fetch_object($objRec, 0);
  302 + $admin_name = $objData->name_kj_sei." ".$objData->name_kj_mei;
  303 +}else{
  304 + $admin_name = "";
  305 +}
  306 +
  307 +$o_smarty->assign('admin_name' , $admin_name);
  308 +
  309 +//***** 現在回答数取得 *****//
  310 +$strSQL = "SELECT ";
  311 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 100) AS not_cnt ,";
  312 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 0) AS n_read_cnt,";
  313 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 99) AS read_cnt ,";
  314 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 98) AS send_cnt ";
  315 +$strSQL .= "FROM ";
  316 +$strSQL .= " mail_info AS M ";
  317 +$strSQL .= "WHERE";
  318 +$strSQL .= " M.mail_id=".$_POST["mail_id"]." ";
  319 +$strSQL .= "GROUP BY ";
  320 +$strSQL .= " M.mail_id";
  321 +//echo $strSQL."<hr>";
  322 +$objCntRec = pg_exec($strSQL);
  323 +if($objCntRec==false){
  324 + echo("SQL実行に失敗しました(SELECT)b");
  325 + exit;
  326 +}
  327 +$objCntData = pg_fetch_object($objCntRec, 0);
  328 +$NOT_CNT = $objCntData->not_cnt;
  329 +$N_READ_CNT = $objCntData->n_read_cnt;
  330 +$READ_CNT = $objCntData->read_cnt;
  331 +$SEND_CNT = $objCntData->send_cnt;
  332 +
  333 +if ($N_READ_CNT=="0"){
  334 + $btnSheep = "disabled";
  335 +}
  336 +
  337 +//***** 回答文言を取得 *****
  338 +$SYORI_MODE = "";
  339 +$strSQL = "SELECT * FROM answer_data WHERE mail_id = " . $_POST["mail_id"];
  340 +$objRec = pg_exec($strSQL);
  341 +if($objRec==false){
  342 + echo("SQL実行に失敗しました(SELECT)d");
  343 + exit;
  344 +}
  345 +if(pg_numrows($objRec)!=0){
  346 + $objData = pg_fetch_object($objRec,0);
  347 +
  348 + $SYORI_MODE = $objData->name50_nm;
  349 +
  350 + for($intI = 1; $intI <= $objData->select_nm; $intI++){
  351 + $idx = $intI-1;
  352 + $ANS_LIST[$idx][0] =pg_result($objRec, 0, "name" . $intI . "_id");
  353 + $ANS_LIST[$idx][1] =pg_result($objRec, 0, "name" . $intI . "_nm");
  354 + if ($SYORI_MODE=="SC"){
  355 + $strSQL = "SELECT ";
  356 + $strSQL .= " COUNT(*) AS dt_cnt ";
  357 + $strSQL .= "FROM ";
  358 + $strSQL .= " mail_info2 ";
  359 + $strSQL .= "WHERE";
  360 + $strSQL .= " mail_id = ".$_POST["mail_id"]." AND ";
  361 + $strSQL .= " check_flg = ".$ANS_LIST[$idx][0];
  362 + //echo $strSQL."<hr>";
  363 + $objCntRec = pg_exec($strSQL);
  364 + if($objCntRec==false){
  365 + echo("SQL実行に失敗しました(SELECT)c");
  366 + exit;
  367 + }
  368 + $objCntData = pg_fetch_object($objCntRec, 0);
  369 + $ANS_LIST[$idx][2] = $objCntData->dt_cnt;
  370 +
  371 + }else{
  372 + $strSQL = "SELECT ";
  373 + $strSQL .= " COUNT(*) AS dt_cnt ";
  374 + $strSQL .= "FROM ";
  375 + $strSQL .= " mail_info ";
  376 + $strSQL .= "WHERE";
  377 + $strSQL .= " mail_id = ".$_POST["mail_id"]." AND ";
  378 + $strSQL .= " check_flg = ".$ANS_LIST[$idx][0];
  379 + //echo $strSQL."<hr>";
  380 + $objCntRec = pg_exec($strSQL);
  381 + if($objCntRec==false){
  382 + echo("SQL実行に失敗しました(SELECT)c");
  383 + exit;
  384 + }
  385 + $objCntData = pg_fetch_object($objCntRec, 0);
  386 + $ANS_LIST[$idx][2] = $objCntData->dt_cnt;
  387 + }
  388 + }
  389 +}else{
  390 + $ANS_LIST=array();
  391 +}
  392 +
  393 +switch ($SYORI_MODE) {
  394 + case "DM":
  395 + $btnSheep = "disabled";
  396 + $btnSelect = "disabled";
  397 + $btnAdd = "disabled";
  398 + $btnSubject = "disabled";
  399 + $btnBody = "disabled";
  400 + break;
  401 +}
  402 +
  403 +$o_smarty->assign('SYORI_MODE' , $SYORI_MODE);
  404 +$o_smarty->assign('NOT_CNT' , $NOT_CNT);
  405 +$o_smarty->assign('N_READ_CNT' , $N_READ_CNT);
  406 +$o_smarty->assign('READ_CNT' , $READ_CNT);
  407 +$o_smarty->assign('SEND_CNT' , $SEND_CNT);
  408 +$o_smarty->assign('ANS_LIST' , $ANS_LIST);
  409 +$o_smarty->assign('btnSheep' , $btnSheep);
  410 +$o_smarty->assign('btnSelect' , $btnSelect);
  411 +$o_smarty->assign('btnAdd' , $btnAdd);
  412 +$o_smarty->assign('btnSubject' , $btnSubject);
  413 +$o_smarty->assign('btnBody' , $btnBody);
  414 +
  415 +//***** ユーザー回答状況 *****//
  416 +$strSQL = "SELECT ";
  417 +$strSQL .= " syain_tbl.syain_cd , ";
  418 +$strSQL .= " syain_tbl.Name_kj_sei , ";
  419 +$strSQL .= " syain_tbl.Name_kj_mei , ";
  420 +$strSQL .= " mail_info.check_flg , ";
  421 +$strSQL .= " mail_info.kousin , ";
  422 +$strSQL .= " mail_info.comment , ";
  423 +$strSQL .= " mail_send_tbl.send_flg ";
  424 +$strSQL .= "FROM ";
  425 +$strSQL .= " mail_info ,";
  426 +$strSQL .= " syain_tbl ,";
  427 +$strSQL .= " mail_send_tbl ";
  428 +$strSQL .= "WHERE ";
  429 +$strSQL .= " mail_info.syain_cd = syain_tbl.syain_cd AND ";
  430 +$strSQL .= " mail_info.syain_cd = mail_send_tbl.syain_cd AND ";
  431 +$strSQL .= " mail_info.mail_id = ".(int)$_POST["mail_id"]." AND ";
  432 +$strSQL .= " mail_send_tbl.mail_id = ".(int)$_POST["mail_id"]." ";
  433 +$strSQL .= "GROUP BY ";
  434 +$strSQL .= " mail_info.mail_id , ";
  435 +$strSQL .= " syain_tbl.syain_cd , ";
  436 +$strSQL .= " syain_tbl.Name_kj_sei , ";
  437 +$strSQL .= " syain_tbl.Name_kj_mei , ";
  438 +$strSQL .= " syain_tbl.name_kn_sei , ";
  439 +$strSQL .= " syain_tbl.name_kn_mei , ";
  440 +$strSQL .= " mail_info.check_flg , ";
  441 +$strSQL .= " mail_info.kousin , ";
  442 +$strSQL .= " mail_info.comment , ";
  443 +$strSQL .= " mail_send_tbl.send_flg ";
  444 +$strSQL .= "ORDER BY ";
  445 +$strSQL .= " mail_info.check_flg ASC, ";
  446 +$strSQL .= " syain_tbl.name_kn_sei ASC, ";
  447 +$strSQL .= " syain_tbl.name_kn_mei ASC, ";
  448 +$strSQL .= " syain_tbl.Syain_cd ASC ";
  449 +//echo $strSQL;
  450 +$objRec = pg_exec($strSQL);
  451 +if($objRec==false){
  452 + echo("SQL実行に失敗しました(SELECT)");
  453 + exit;
  454 +}
  455 +for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
  456 + $objData = pg_fetch_object($objRec,$intI);
  457 + $User_List[$intI][0] = $objData->syain_cd;
  458 + $User_List[$intI][1] = $objData->name_kj_sei." ".$objData->name_kj_mei;
  459 +
  460 + //*** グループ情報 ***
  461 + $User_List[$intI][2] = "";
  462 + $strSQL = "SELECT ";
  463 + $strSQL .= " mst_group.group_name ";
  464 + $strSQL .= "FROM ";
  465 + $strSQL .= " group_info,";
  466 + $strSQL .= " mst_group ";
  467 + $strSQL .= "WHERE ";
  468 + $strSQL .= " group_info.group_id = mst_group.group_id AND ";
  469 + $strSQL .= " group_info.syain_cd = ".$objData->syain_cd;
  470 + $objGrpRec = pg_exec($strSQL);
  471 + if($objGrpRec==false){
  472 + echo("SQL実行に失敗しました(SELECT)");
  473 + exit;
  474 + }
  475 + for($intJ = 0; $intJ < pg_numrows($objGrpRec) ; $intJ++) {
  476 + $objGrpData = pg_fetch_object($objGrpRec, $intJ);
  477 + if ($User_List[$intI][2]!=""){
  478 + $User_List[$intI][2] .= "<br />";
  479 + }
  480 + $User_List[$intI][2] .= JcodeConvert($objGrpData->group_name, 1, 1);
  481 + }
  482 +
  483 + switch ($objData->check_flg) {
  484 + case "0":
  485 + $User_List[$intI][3] = "未読";
  486 + $User_List[$intI][8] = "color='red'";
  487 + break;
  488 + case "98":
  489 + $User_List[$intI][3] = "送信済み";
  490 + $User_List[$intI][8] = "color='black'";
  491 + break;
  492 + case "99":
  493 + if ($SYORI_MODE=="SC"){
  494 + $strSQL = "SELECT ";
  495 + $strSQL .= " * ";
  496 + $strSQL .= "FROM ";
  497 + $strSQL .= " mail_info2 ";
  498 + $strSQL .= "WHERE";
  499 + $strSQL .= " mail_id = ".$_POST["mail_id"] ." AND ";
  500 + $strSQL .= " syain_cd = ".$objData->syain_cd." ";
  501 + //echo $strSQL."<hr>";
  502 + $objAnsRec = pg_exec($strSQL);
  503 + if($objAnsRec==false){
  504 + echo("SQL実行に失敗しました(SELECT)c");
  505 + exit;
  506 + }
  507 + if(pg_numrows($objAnsRec)!=0){
  508 + for($intJ = 0; $intJ < pg_numrows($objAnsRec) ; $intJ++) {
  509 + $objAnsData = pg_fetch_object($objAnsRec, $intJ);
  510 + for($intK = 0; $intK < count($ANS_LIST) ; $intK++) {
  511 + if ($objAnsData->check_flg==$ANS_LIST[$intK][0]){
  512 + if ($User_List[$intI][3]!=""){
  513 + $User_List[$intI][3] .= "<br />";
  514 + }
  515 + $User_List[$intI][3] .= $ANS_LIST[$intK][1];
  516 + break;
  517 + }
  518 + }
  519 + }
  520 + }else{
  521 + $User_List[$intI][3] = "既読";
  522 + $User_List[$intI][8] = "color='orange'";
  523 + }
  524 + }else{
  525 + $User_List[$intI][3] = "既読";
  526 + $User_List[$intI][8] = "color='orange'";
  527 + }
  528 + break;
  529 + case "100":
  530 + $User_List[$intI][3] = "アドレス未設定";
  531 + $User_List[$intI][8] = "color='orange'";
  532 + break;
  533 + default: $User_List[$intI][3] = $ANS_LIST[$objData->check_flg-1][1];
  534 + }
  535 +
  536 + if ($objData->kousin!=""){
  537 + $User_List[$intI][4] = intval(substr($objData->kousin,0,4))."年";
  538 + $User_List[$intI][4] .= intval(substr($objData->kousin,4,2))."月";
  539 + $User_List[$intI][4] .= intval(substr($objData->kousin,6,2))."日";
  540 + $User_List[$intI][4] .= intval(substr($objData->kousin,8,2))."時";
  541 + $User_List[$intI][4] .= intval(substr($objData->kousin,10,2))."分";
  542 + $User_List[$intI][5] = $objData->comment;
  543 + }else{
  544 + $User_List[$intI][4] = "&nbsp;";
  545 + $User_List[$intI][5] = "&nbsp;";
  546 + }
  547 +
  548 + switch ($objData->send_flg) {
  549 + case "0": $User_List[$intI][6] = "携帯/PC"; break;
  550 + case "1": $User_List[$intI][6] = "携帯"; break;
  551 + case "2": $User_List[$intI][6] = "PC"; break;
  552 + default : $User_List[$intI][6] = "-";
  553 + }
  554 +
  555 + //社員コード
  556 + $User_List[$intI][7] = $objData->syain_cd;
  557 +
  558 +}
  559 +$o_smarty->assign('User_List' , $User_List);
  560 +
  561 +
  562 +$o_smarty->display('LIST1000.tpl');
  563 +
  564 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1010.php
  6 +//* 機能 :未読者再送信
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/getDomain.inc");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +include("./include/dbcon.inc");
  19 +include("./include/mime.php");
  20 +include("./include/point.inc");
  21 +include("./include/logget.inc");
  22 +include("./include/mtcnews.inc");
  23 +
  24 +//mtcnews.incから取得
  25 +$Comment_tel = jcodeconvert($Mail_Keitai, 1, 3);
  26 +$Comment_pc = jcodeconvert($Mail_PC, 1, 3);
  27 +
  28 +?>
  29 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  30 +<HTML>
  31 +<HEAD>
  32 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  33 +<META http-equiv="Content-Style-Type" content="text/css">
  34 +<link href="./css/style.css" rel="stylesheet" type="text/css">
  35 +<TITLE>送信中</TITLE>
  36 +<script language="javascript">
  37 +function pageJump(){
  38 + document.frm.action = "LIST1011.php";
  39 + document.frm.method="POST";
  40 + document.frm.submit();
  41 +}
  42 +</script>
  43 +</HEAD>
  44 +<BODY onload="pageJump();">
  45 +<?PHP
  46 +//ヘッダー
  47 +include("./include/header.inc");
  48 +?>
  49 +<br>
  50 +<br>
  51 +<br>
  52 +<center>
  53 +<B><FONT color=blue size=5>送信中です。しばらく待ちください。</FONT></B>
  54 +<br>
  55 +<form name="frm">
  56 +<table>
  57 +<tr>
  58 +<br>
  59 +<br>
  60 +<td><FONT size=5><div id="maxcount"></div></FONT></td>
  61 +<td><FONT size=5>件中</FONT></td>
  62 +<td><FONT size=5><div id="count"></div></FONT></td>
  63 +<td><FONT size=5>件送信しました。</FONT></td>
  64 +<tr>
  65 +</table>
  66 +<br>
  67 +<B><FONT color=red size=5>※この画面で何か操作しますと、処理が正常におこなわれません。</FONT></B>
  68 +<br>
  69 +</form>
  70 +<br>
  71 +</center>
  72 +<?PHP
  73 +
  74 +//***************************
  75 +//* メイン処理
  76 +//***************************
  77 +
  78 +//送信日時
  79 +$strSubmitTime = date("Ymdhis");
  80 +
  81 +if (strlen($strSubmitTime) == 12) {
  82 + $strSubmitTime = "20" . $strSubmitTime;
  83 +}
  84 +
  85 +$strYear = substr($strSubmitTime, 0, 4);
  86 +$strMonth = substr($strSubmitTime, 4, 2);
  87 +$strDay = substr($strSubmitTime, 6, 2);
  88 +$strHour = substr($strSubmitTime, 8, 2);
  89 +$strMinute = substr($strSubmitTime, 10, 2);
  90 +
  91 +//送信者アドレス,名前
  92 +$strSQL = "SELECT ";
  93 +$strSQL .= " * ";
  94 +$strSQL .= "FROM ";
  95 +$strSQL .= " syain_tbl ";
  96 +$strSQL .= "WHERE ";
  97 +$strSQL .= " syain_cd = " . $_SESSION["PHP_POST_SYAIN_CD"]. " ";
  98 +$strSQL .= "ORDER BY";
  99 +$strSQL .= " syain_cd";
  100 +$objRecSet = pg_exec($strSQL);
  101 +if($objRecSet==false){
  102 + echo("SQL実行に失敗しました(INSERT)");
  103 + exit;
  104 +}
  105 +$objData = pg_fetch_object($objRecSet, 0);
  106 +$strSubmitAdd = $objData->pc_mail_addr;
  107 +if($strSubmitAdd==""){//pcメルアドが無かったら
  108 + $objData = pg_fetch_object($objRecSet, 0);
  109 + $strSubmitAdd = $objData->mail_addr;
  110 + if($strSubmitAdd==""){//どちらのメルアドも無かったら
  111 + $strSQL = "SELECT * FROM mst_dmain";
  112 + $objRecSet = pg_exec($strSQL);
  113 + if($objRecSet==false){
  114 + echo("SQL実行に失敗しました(INSERT)");
  115 + exit;
  116 + }
  117 + $objData = pg_fetch_object($objRecSet, 0);
  118 + $strSubmitAdd = $objData->mail_addr;
  119 + }
  120 +}
  121 +$strSubmitName=$strSubmitName=$objData->name_kj_sei . " " . $objData->name_kj_mei;
  122 +
  123 +//ドメイン
  124 +$strDomeName=getDomain();
  125 +
  126 +//********** メール情報取得 **********//
  127 +$strSQL = "SELECT ";
  128 +$strSQL .= " * ";
  129 +$strSQL .= "FROM ";
  130 +$strSQL .= " mail_data ";
  131 +$strSQL .= "WHERE ";
  132 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"];
  133 +$objRec = pg_exec($strSQL);
  134 +if($objRec==false){
  135 + echo("SQL実行に失敗しました(SELECT)");
  136 + exit;
  137 +}
  138 +$objData = pg_fetch_object($objRec, 0);
  139 +$Angou_id = $objData->angou_id;
  140 +$Mail_date = $objData->message_date;
  141 +$Mail_time = $objData->message_time;
  142 +$Subject_name = "[再]";
  143 +$Subject_name .= $objData->subject_name;
  144 +$Contents = $objData->contents;
  145 +$Send_type = $objData->send_type;
  146 +
  147 +$Header1 = "";
  148 +$Headers['From']=$strSubmitAdd;
  149 +$Headers['X-Mailer']="PHP/".phpversion(); //メール送信プログラムの表示
  150 +
  151 +//********** 未読者取得 **********//
  152 +$strSQL = "SELECT ";
  153 +$strSQL .= " syain_tbl.syain_cd , ";
  154 +$strSQL .= " syain_tbl.angou_cd , ";
  155 +$strSQL .= " syain_tbl.mail_addr , ";
  156 +$strSQL .= " syain_tbl.pc_mail_addr, ";
  157 +$strSQL .= " syain_tbl.name_kj_sei , ";
  158 +$strSQL .= " syain_tbl.name_kj_mei ";
  159 +$strSQL .= "FROM ";
  160 +$strSQL .= " mail_info, ";
  161 +$strSQL .= " syain_tbl ";
  162 +$strSQL .= "WHERE ";
  163 +$strSQL .= " mail_info.syain_cd = syain_tbl.syain_cd AND ";
  164 +$strSQL .= " mail_info.mail_id = ".(int)$_POST["mail_id"]." AND ";
  165 +$strSQL .= " mail_info.check_flg = 0 ";
  166 +$strSQL .= "ORDER BY ";
  167 +$strSQL .= " syain_tbl.syain_id ASC ";
  168 +$objRec = pg_exec($strSQL);
  169 +if($objRec==false){
  170 + echo("SQL実行に失敗しました(SELECT)");
  171 + exit;
  172 +}
  173 +for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
  174 + $objUsrData = pg_fetch_object($objRec, $intI);
  175 +
  176 + //*** 宛先情報取得 ***//
  177 + $Mail_Nasi = 0;
  178 + $strAngou = $objUsrData->angou_cd;
  179 + $strTo = $objUsrData->pc_mail_addr;
  180 + $strToMob = $objUsrData->mail_addr;
  181 + $strToName = $objUsrData->name_kj_sei.$objUsrData->name_kj_mei;
  182 +$strComment = "";
  183 + $strSubject = "=?iso-2022-jp?B?" . base64_encode(jcodeconvert($Subject_name, 0, 3)) . "?=";
  184 + $strComment .= $_SESSION["PHP_POST_DB_USER_NAME"]."の皆様(".$strToName."様)へ\n\n下記のアドレスからメール内容を確認してください。\n";
  185 + //$strComment .= "http://" . $strDomeName . "/mail_ni_pon/check_update/mail_check.php?";
  186 + $strComment .= $PONV2_URL_HEAD . "USER0000.php?";
  187 + $strComment .= "m=".$Angou_id."&";
  188 + $strComment .= "s=".$strAngou."&";
  189 + $strComment .= "d=".$_SESSION["PHP_POST_DB_ANGOU"]. "\n\n";
  190 +
  191 + $strComment = jcodeconvert($strComment, 1, 3);
  192 +
  193 + $Header = "";//ヘッダー部クリア
  194 + $Header1 = "";
  195 +
  196 + //***** 携帯電話へ送信 *****//
  197 + //PEARのmimeクラス設定
  198 + $mime = new Mail_mime("\r\n");
  199 + $mime->_build_params['text_charset'] = 'iso-2022-jp'; //本文テキストの文字コードをJISに設定する
  200 +
  201 + //本文のテキストの指定
  202 + $mime->setTXTBody($strComment);
  203 + $strComment = $mime->get();
  204 +
  205 + $Headers = $mime->headers($Headers);
  206 + while (list($key,$val)=each($Headers)) {
  207 + $Header1 .= $key.": ".$val."\r\n";
  208 + }
  209 +
  210 + if($Send_type==0 || $Send_type==1){
  211 + if($strToMob!=""){
  212 + $intBool2 = mail($strToMob,$strSubject,$strComment.$Comment_tel.$koukokuTEL,$Header1,"-f ".$strSubmitAdd);//携帯に送信
  213 + }else{
  214 + $intBool2 = true;
  215 + }
  216 + }else{
  217 + $intBool2 = true;
  218 + }
  219 +
  220 + //***** PCへ送信 *****//
  221 + //メールボディの取得
  222 + $strComment = $mime->get();
  223 +
  224 + //メールヘッダの取得
  225 + $Headers = $mime->headers($Headers);
  226 +
  227 + //メールヘッダの配列を文字列に組み立てる
  228 + while (list($key,$val)=each($Headers)) {
  229 + $Header .= $key.": ".$val."\r\n";
  230 + }
  231 +
  232 + if($Send_type==0 || $Send_type==2){
  233 + if($strTo!=""){
  234 + $intBool = mail($strTo, $strSubject, $strComment.$Comment_pc.$koukokuPC, $Header,"-f ".$strSubmitAdd);//PCに送信
  235 + }else{
  236 + $intBool = true;
  237 + }
  238 + }else{
  239 + $intBool = true;
  240 + }
  241 +
  242 + $Max_User = pg_numrows($objRec);
  243 + echo "<script language='javascript'>";
  244 + echo "document.getElementById('maxcount').innerHTML ='".$Max_User."';";
  245 + echo "document.getElementById('count').innerHTML ='".$intI."';";
  246 + echo "</script>";
  247 + ob_flush();
  248 + flush();
  249 +
  250 +}
  251 +
  252 +?>
  253 +</BODY>
  254 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1011.php
  6 +//* 機能 :メール配信完了(未読者再送信)
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +
  18 +//********** ヘッダー処理 **********//
  19 +include("./include/headr_data.inc");
  20 +
  21 +$o_smarty->display('LIST1011.tpl');
  22 +
  23 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1020.php
  6 +//* 機能 :選択者再送信
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/getDomain.inc");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +include("./include/dbcon.inc");
  19 +include("./include/mime.php");
  20 +include("./include/point.inc");
  21 +include("./include/logget.inc");
  22 +include("./include/mtcnews.inc");
  23 +
  24 +//mtcnews.incから取得
  25 +$Comment_tel = jcodeconvert($Mail_Keitai, 1, 3);
  26 +$Comment_pc = jcodeconvert($Mail_PC, 1, 3);
  27 +
  28 +?>
  29 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  30 +<HTML>
  31 +<HEAD>
  32 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  33 +<META http-equiv="Content-Style-Type" content="text/css">
  34 +<link href="./css/style.css" rel="stylesheet" type="text/css">
  35 +<TITLE>送信中</TITLE>
  36 +<script language="javascript">
  37 +function pageJump(){
  38 + document.frm.action = "LIST1021.php";
  39 + document.frm.method="POST";
  40 + document.frm.submit();
  41 +}
  42 +</script>
  43 +</HEAD>
  44 +<BODY onload="pageJump();">
  45 +<?PHP
  46 +//ヘッダー
  47 +include("./include/header.inc");
  48 +?>
  49 +<br>
  50 +<br>
  51 +<br>
  52 +<center>
  53 +<B><FONT color=blue size=5>送信中です。しばらく待ちください。</FONT></B>
  54 +<br>
  55 +<form name="frm">
  56 +<table>
  57 +<tr>
  58 +<br>
  59 +<br>
  60 +<td><FONT size=5><div id="maxcount"></div></FONT></td>
  61 +<td><FONT size=5>件中</FONT></td>
  62 +<td><FONT size=5><div id="count"></div></FONT></td>
  63 +<td><FONT size=5>件送信しました。</FONT></td>
  64 +<tr>
  65 +</table>
  66 +<br>
  67 +<B><FONT color=red size=5>※この画面で何か操作しますと、処理が正常におこなわれません。</FONT></B>
  68 +<br>
  69 +</form>
  70 +<br>
  71 +</center>
  72 +<?PHP
  73 +
  74 +//***************************
  75 +//* メイン処理
  76 +//***************************
  77 +
  78 +//送信日時
  79 +$strSubmitTime = date("Ymdhis");
  80 +
  81 +if (strlen($strSubmitTime) == 12) {
  82 + $strSubmitTime = "20" . $strSubmitTime;
  83 +}
  84 +
  85 +$strYear = substr($strSubmitTime, 0, 4);
  86 +$strMonth = substr($strSubmitTime, 4, 2);
  87 +$strDay = substr($strSubmitTime, 6, 2);
  88 +$strHour = substr($strSubmitTime, 8, 2);
  89 +$strMinute = substr($strSubmitTime, 10, 2);
  90 +
  91 +//送信者アドレス,名前
  92 +$strSQL = "SELECT ";
  93 +$strSQL .= " * ";
  94 +$strSQL .= "FROM ";
  95 +$strSQL .= " syain_tbl ";
  96 +$strSQL .= "WHERE ";
  97 +$strSQL .= " syain_cd = " . $_SESSION["PHP_POST_SYAIN_CD"]. " ";
  98 +$strSQL .= "ORDER BY";
  99 +$strSQL .= " syain_cd";
  100 +$objRecSet = pg_exec($strSQL);
  101 +if($objRecSet==false){
  102 + echo("SQL実行に失敗しました(INSERT)");
  103 + exit;
  104 +}
  105 +$objData = pg_fetch_object($objRecSet, 0);
  106 +$strSubmitAdd = $objData->pc_mail_addr;
  107 +if($strSubmitAdd==""){//pcメルアドが無かったら
  108 + $objData = pg_fetch_object($objRecSet, 0);
  109 + $strSubmitAdd = $objData->mail_addr;
  110 + if($strSubmitAdd==""){//どちらのメルアドも無かったら
  111 + $strSQL = "SELECT * FROM mst_dmain";
  112 + $objRecSet = pg_exec($strSQL);
  113 + if($objRecSet==false){
  114 + echo("SQL実行に失敗しました(INSERT)");
  115 + exit;
  116 + }
  117 + $objData = pg_fetch_object($objRecSet, 0);
  118 + $strSubmitAdd = $objData->mail_addr;
  119 + }
  120 +}
  121 +$strSubmitName=$strSubmitName=$objData->name_kj_sei . " " . $objData->name_kj_mei;
  122 +
  123 +//ドメイン
  124 +$strDomeName=getDomain();
  125 +
  126 +//********** メール情報取得 **********//
  127 +$strSQL = "SELECT ";
  128 +$strSQL .= " * ";
  129 +$strSQL .= "FROM ";
  130 +$strSQL .= " mail_data ";
  131 +$strSQL .= "WHERE ";
  132 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"];
  133 +$objRec = pg_exec($strSQL);
  134 +if($objRec==false){
  135 + echo("SQL実行に失敗しました(SELECT)");
  136 + exit;
  137 +}
  138 +$objData = pg_fetch_object($objRec, 0);
  139 +$Angou_id = $objData->angou_id;
  140 +$Mail_date = $objData->message_date;
  141 +$Mail_time = $objData->message_time;
  142 +$Subject_name = "[再]";
  143 +$Subject_name .= $objData->subject_name;
  144 +$Contents = $objData->contents;
  145 +$Send_type = $objData->send_type;
  146 +
  147 +$Header1 = "";
  148 +$Headers['From']=$strSubmitAdd;
  149 +$Headers['X-Mailer']="PHP/".phpversion(); //メール送信プログラムの表示
  150 +
  151 +//********** 選択者取得 **********//
  152 +$User_Key=split("#",$_POST["Chk_User"]);
  153 +for ($intI = 0 ; $intI < count($User_Key)-1 ; $intI++) {
  154 +
  155 + $strSQL = "SELECT ";
  156 + $strSQL .= " syain_tbl.syain_cd , ";
  157 + $strSQL .= " syain_tbl.angou_cd , ";
  158 + $strSQL .= " syain_tbl.mail_addr , ";
  159 + $strSQL .= " syain_tbl.pc_mail_addr, ";
  160 + $strSQL .= " syain_tbl.name_kj_sei , ";
  161 + $strSQL .= " syain_tbl.name_kj_mei ";
  162 + $strSQL .= "FROM ";
  163 + $strSQL .= " mail_info, ";
  164 + $strSQL .= " syain_tbl ";
  165 + $strSQL .= "WHERE ";
  166 + $strSQL .= " mail_info.syain_cd = syain_tbl.syain_cd AND ";
  167 + $strSQL .= " mail_info.syain_cd = ".(int)$User_Key[$intI]." AND ";
  168 + $strSQL .= " mail_info.mail_id = ".(int)$_POST["mail_id"]." ";
  169 +// $strSQL .= " mail_info.check_flg = 0 ";
  170 + $strSQL .= "ORDER BY ";
  171 + $strSQL .= " syain_tbl.syain_id ASC ";
  172 + $objRec = pg_exec($strSQL);
  173 + if($objRec==false){
  174 + echo("SQL実行に失敗しました(SELECT)");
  175 + exit;
  176 + }
  177 + $objUsrData = pg_fetch_object($objRec, 0);
  178 +
  179 + //*** 宛先情報取得 ***//
  180 + $Mail_Nasi = 0;
  181 + $strAngou = $objUsrData->angou_cd;
  182 + $strTo = $objUsrData->pc_mail_addr;
  183 + $strToMob = $objUsrData->mail_addr;
  184 + $strToName = $objUsrData->name_kj_sei.$objUsrData->name_kj_mei;
  185 +
  186 + $strSubject = "=?iso-2022-jp?B?" . base64_encode(jcodeconvert($Subject_name, 0, 3)) . "?=";
  187 +$strComment = "";
  188 + $strComment .= $_SESSION["PHP_POST_DB_USER_NAME"]."の皆様(".$strToName."様)へ\n\n下記のアドレスからメール内容を確認してください。\n";
  189 + //$strComment .= "http://" . $strDomeName . "/mail_ni_pon/check_update/mail_check.php?";
  190 + $strComment .= $PONV2_URL_HEAD . "USER0000.php?";
  191 + $strComment .= "m=".$Angou_id."&";
  192 + $strComment .= "s=".$strAngou."&";
  193 + $strComment .= "d=".$_SESSION["PHP_POST_DB_ANGOU"]. "\n\n";
  194 +
  195 + $strComment = jcodeconvert($strComment, 1, 3);
  196 +
  197 + $Header = "";//ヘッダー部クリア
  198 + $Header1 = "";
  199 +
  200 + //***** 携帯電話へ送信 *****//
  201 + //PEARのmimeクラス設定
  202 + $mime = new Mail_mime("\r\n");
  203 + $mime->_build_params['text_charset'] = 'iso-2022-jp'; //本文テキストの文字コードをJISに設定する
  204 +
  205 + //本文のテキストの指定
  206 + $mime->setTXTBody($strComment);
  207 + $strComment = $mime->get();
  208 +
  209 + $Headers = $mime->headers($Headers);
  210 + while (list($key,$val)=each($Headers)) {
  211 + $Header1 .= $key.": ".$val."\r\n";
  212 + }
  213 +
  214 + if($Send_type==0 || $Send_type==1){
  215 + if($strToMob!=""){
  216 + $intBool2 = mail($strToMob,$strSubject,$strComment.$Comment_tel.$koukokuTEL,$Header1,"-f ".$strSubmitAdd);//携帯に送信
  217 + }else{
  218 + $intBool2 = true;
  219 + }
  220 + }else{
  221 + $intBool2 = true;
  222 + }
  223 +
  224 + //***** PCへ送信 *****//
  225 + //メールボディの取得
  226 + $strComment = $mime->get();
  227 +
  228 + //メールヘッダの取得
  229 + $Headers = $mime->headers($Headers);
  230 +
  231 + //メールヘッダの配列を文字列に組み立てる
  232 + while (list($key,$val)=each($Headers)) {
  233 + $Header .= $key.": ".$val."\r\n";
  234 + }
  235 +
  236 + if($Send_type==0 || $Send_type==2){
  237 + if($strTo!=""){
  238 + $intBool = mail($strTo, $strSubject, $strComment.$Comment_pc.$koukokuPC, $Header,"-f ".$strSubmitAdd);//PCに送信
  239 + }else{
  240 + $intBool = true;
  241 + }
  242 + }else{
  243 + $intBool = true;
  244 + }
  245 +
  246 + $Max_User =count($User_Key)-1;
  247 + echo "<script language='javascript'>";
  248 + echo "document.getElementById('maxcount').innerHTML ='".$Max_User."';";
  249 + echo "document.getElementById('count').innerHTML ='".$intI."';";
  250 + echo "</script>";
  251 + ob_flush();
  252 + flush();
  253 +
  254 +}
  255 +
  256 +?>
  257 +</BODY>
  258 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1021.php
  6 +//* 機能 :メール配信完了(選択者再送信)
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +
  18 +//********** ヘッダー処理 **********//
  19 +include("./include/headr_data.inc");
  20 +
  21 +$o_smarty->display('LIST1021.tpl');
  22 +
  23 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1030.php
  6 +//* 機能 :追加配信
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//***************************
  23 +//* 初期処理
  24 +//***************************
  25 +include("./include/dbcon.inc");
  26 +
  27 +//表示項目名を取得
  28 +//$strSQL = "SELECT disp_id, disp_name FROM mst_disp ORDER BY disp_id";
  29 +//$objRec = pg_exec($strSQL);
  30 +//if($objRec==false){
  31 +// echo("SQL実行に失敗しました(SELECT)");
  32 +// exit;
  33 +//}
  34 +//for($intI = 0; $intI < pg_numrows($objRec) ; $intI++) {
  35 +// $objData = pg_fetch_object($objRec, $intI);
  36 +// $intDisp_id[$intI] = $objData->disp_id;
  37 +// $strDisp_Name[$intI] = JcodeConvert($objData->disp_name, 1, 1);
  38 +//}
  39 +
  40 +
  41 +//選択ユーザー
  42 +$Send_List = "";
  43 +
  44 +//表示情報取得
  45 +if ($_POST["Send_User"]!=""){
  46 + $User_List = split ("," , $_POST["Send_User"]);
  47 + for($intI = 0; $intI < count($User_List)-1; $intI++){
  48 + $strSQL = "SELECT name_kj_sei, name_kj_mei FROM syain_tbl WHERE syain_cd = ".$User_List[$intI]." ORDER BY syain_cd";
  49 + $objRec = pg_exec($strSQL);
  50 + if($objRec==false){
  51 + echo("SQL実行に失敗しました(SELECT)");
  52 + exit;
  53 + }
  54 + $objData = pg_fetch_object($objRec, 0);
  55 + $Send_List .= $objData->name_kj_sei." ".$objData->name_kj_mei."<br />";
  56 + }
  57 +}else{
  58 + $Send_List = "";
  59 +
  60 +}
  61 +
  62 +switch ($_POST["SendType"]) {
  63 + case "0":
  64 + $TypeChk[0] = "checked";
  65 + $TypeChk[1] = "";
  66 + $TypeChk[2] = "";
  67 + break;
  68 +
  69 + case "1":
  70 + $TypeChk[0] = "";
  71 + $TypeChk[1] = "checked";
  72 + $TypeChk[2] = "";
  73 + break;
  74 +
  75 + case "2":
  76 + $TypeChk[0] = "";
  77 + $TypeChk[1] = "";
  78 + $TypeChk[2] = "checked";
  79 + break;
  80 +
  81 + default:
  82 + $TypeChk[0] = "checked";
  83 + $TypeChk[1] = "";
  84 + $TypeChk[2] = "";
  85 +
  86 +}
  87 +
  88 +//*** 配信情報を取得 ***//
  89 +$strSQL = "SELECT ";
  90 +$strSQL .= " * ";
  91 +$strSQL .= "FROM ";
  92 +$strSQL .= " mail_data ";
  93 +$strSQL .= "WHERE ";
  94 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"];
  95 +$objRec = pg_exec($strSQL);
  96 +if($objRec==false){
  97 + echo("SQL実行に失敗しました(SELECT)");
  98 + exit;
  99 +}
  100 +$objData = pg_fetch_object($objRec, 0);
  101 +$subject_name = htmlspecialchars($objData->subject_name);
  102 +$contents = nl2br(htmlspecialchars($objData->contents));
  103 +
  104 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  105 +$o_smarty->assign('Send_List' , $Send_List);
  106 +$o_smarty->assign('Send_User' , $_POST["Send_User"]);
  107 +$o_smarty->assign('TypeChk' , $TypeChk);
  108 +$o_smarty->assign('subject_name', $subject_name);
  109 +$o_smarty->assign('contents' , $contents);
  110 +
  111 +$o_smarty->assign('intGroupCount', count($User_List));
  112 +$o_smarty->assign('PHP_POST_DB_FLG', (int)$PHP_POST_DB_FLG);
  113 +
  114 +$o_smarty->display('LIST1030.tpl');
  115 +
  116 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1031.php
  6 +//* 機能 :送信先選択(追加配信)
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +
  18 +//********** ヘッダー処理 **********//
  19 +include("./include/headr_data.inc");
  20 +
  21 +//***************************
  22 +//* 初期処理
  23 +//***************************
  24 +include("./include/dbcon.inc");
  25 +
  26 +$strWhere = "";
  27 +//*** 送信済みユーザー ***//
  28 +$strSQL = "SELECT ";
  29 +$strSQL .= " * ";
  30 +$strSQL .= "FROM ";
  31 +$strSQL .= " mail_info ";
  32 +$strSQL .= "WHERE ";
  33 +$strSQL .= " mail_id = ".(int)$_POST["mail_id"]." ";
  34 +//echo $strSQL;
  35 +$objRec = pg_exec($strSQL);
  36 +if($objRec==false){
  37 + echo("SQL実行に失敗しました(SELECT)");
  38 + exit;
  39 +}
  40 +for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
  41 + $objData = pg_fetch_object($objRec,$intI);
  42 + if ($strWhere==""){
  43 + $strWhere .= " WHERE syain_cd<>".$objData->syain_cd." ";
  44 + }else{
  45 + $strWhere .= " AND syain_cd<>".$objData->syain_cd." ";
  46 + }
  47 +}
  48 +
  49 +//*** 送信元選択 ***//
  50 +if ($_POST["Send_User"]!=""){
  51 + $User_List = split ("," , $_POST["Send_User"]);
  52 + for($intI = 0; $intI < count($User_List)-1; $intI++){
  53 + if ($strWhere==""){
  54 + $strWhere .= " WHERE syain_cd<>".$User_List[$intI]." ";
  55 + }else{
  56 + $strWhere .= " AND syain_cd<>".$User_List[$intI]." ";
  57 + }
  58 + }
  59 +}
  60 +$strSQL = "SELECT ";
  61 +$strSQL .= " * ";
  62 +$strSQL .= "FROM ";
  63 +$strSQL .= " syain_tbl ";
  64 +$strSQL .= $strWhere;
  65 +$strSQL .= "ORDER BY ";
  66 +$strSQL .= " name_kn_sei ASC,";
  67 +$strSQL .= " name_kn_mei ASC,";
  68 +$strSQL .= " syain_cd ASC";
  69 +//echo $strSQL;
  70 +$objRec = pg_exec($strSQL);
  71 +if($objRec==false){
  72 + echo("SQL実行に失敗しました(SELECT)");
  73 + exit;
  74 +}
  75 +for($intI = 0; $intI < pg_numrows($objRec) ; $intI++) {
  76 + $objData = pg_fetch_object($objRec, $intI);
  77 + $Select_List[$intI][0] = $objData->syain_cd;
  78 + $Select_List[$intI][1] = $objData->name_kj_sei." ".$objData->name_kj_mei;
  79 + $Select_List[$intI][2] = $objData->mail_addr;
  80 + $Select_List[$intI][3] = $objData->pc_mail_addr;
  81 +}
  82 +$o_smarty->assign('Select_List' , $Select_List);
  83 +
  84 +//*** 選択済みユーザー ***//
  85 +if ($_POST["Send_User"]!=""){
  86 + $strSQL = "SELECT ";
  87 + $strSQL .= " * ";
  88 + $strSQL .= "FROM ";
  89 + $strSQL .= " syain_tbl ";
  90 + $User_List = split ("," , $_POST["Send_User"]);
  91 + for($intI = 0; $intI < count($User_List)-1; $intI++){
  92 + if ($intI==0){
  93 + $strSQL .= " WHERE syain_cd=".$User_List[$intI];
  94 + }else{
  95 + $strSQL .= " OR syain_cd=".$User_List[$intI];
  96 + }
  97 + }
  98 + $strSQL .= " ORDER BY ";
  99 + $strSQL .= " name_kn_sei ASC,";
  100 + $strSQL .= " name_kn_mei ASC,";
  101 + $strSQL .= " syain_cd ASC";
  102 + $objRec = pg_exec($strSQL);
  103 + if($objRec==false){
  104 + echo("SQL実行に失敗しました(SELECT)");
  105 + exit;
  106 + }
  107 + for($intI = 0; $intI < pg_numrows($objRec) ; $intI++) {
  108 + $objData = pg_fetch_object($objRec, $intI);
  109 + $Send_List[$intI][0] = $objData->syain_cd;
  110 + $Send_List[$intI][1] = $objData->name_kj_sei." ".$objData->name_kj_mei;
  111 + $Send_List[$intI][2] = $objData->mail_addr;
  112 + $Send_List[$intI][3] = $objData->pc_mail_addr;
  113 + }
  114 +}else{
  115 +
  116 +}
  117 +$o_smarty->assign('Send_List' , $Send_List);
  118 +
  119 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  120 +$o_smarty->assign('Send_User' , $_POST["Send_User"]);
  121 +$o_smarty->assign('SendType' , $_POST["SendType"]);
  122 +
  123 +$o_smarty->display('LIST1031.tpl');
  124 +
  125 +
  126 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1032.php
  6 +//* 機能 :追加配信
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/getDomain.inc");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +include("./include/dbcon.inc");
  19 +include("./include/mime.php");
  20 +include("./include/point.inc");
  21 +include("./include/logget.inc");
  22 +include("./include/mtcnews.inc");
  23 +
  24 +//mtcnews.incから取得
  25 +$Comment_tel = jcodeconvert($Mail_Keitai, 1, 3);
  26 +$Comment_pc = jcodeconvert($Mail_PC, 1, 3);
  27 +
  28 +?>
  29 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  30 +<HTML>
  31 +<HEAD>
  32 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  33 +<META http-equiv="Content-Style-Type" content="text/css">
  34 +<link href="./css/style.css" rel="stylesheet" type="text/css">
  35 +<TITLE>送信中</TITLE>
  36 +<script language="javascript">
  37 +function pageJump(){
  38 + document.frm.action = "LIST1033.php";
  39 + document.frm.method="POST";
  40 + document.frm.submit();
  41 +}
  42 +</script>
  43 +</HEAD>
  44 +<BODY onload="pageJump();">
  45 +<?PHP
  46 +//ヘッダー
  47 +include("./include/header.inc");
  48 +?>
  49 +<br>
  50 +<br>
  51 +<br>
  52 +<center>
  53 +<B><FONT color=blue size=5>送信中です。しばらく待ちください。</FONT></B>
  54 +<br>
  55 +<form name="frm">
  56 +<table>
  57 +<tr>
  58 +<br>
  59 +<br>
  60 +<td><FONT size=5><div id="maxcount"></div></FONT></td>
  61 +<td><FONT size=5>件中</FONT></td>
  62 +<td><FONT size=5><div id="count"></div></FONT></td>
  63 +<td><FONT size=5>件送信しました。</FONT></td>
  64 +<tr>
  65 +</table>
  66 +<br>
  67 +<B><FONT color=red size=5>※この画面で何か操作しますと、処理が正常におこなわれません。</FONT></B>
  68 +<br>
  69 +</form>
  70 +<br>
  71 +</center>
  72 +<?PHP
  73 +
  74 +//***************************
  75 +//* メイン処理
  76 +//***************************
  77 +
  78 +//送信日時
  79 +$strSubmitTime = date("Ymdhis");
  80 +
  81 +if (strlen($strSubmitTime) == 12) {
  82 + $strSubmitTime = "20" . $strSubmitTime;
  83 +}
  84 +
  85 +$strYear = substr($strSubmitTime, 0, 4);
  86 +$strMonth = substr($strSubmitTime, 4, 2);
  87 +$strDay = substr($strSubmitTime, 6, 2);
  88 +$strHour = substr($strSubmitTime, 8, 2);
  89 +$strMinute = substr($strSubmitTime, 10, 2);
  90 +
  91 +//送信者アドレス,名前
  92 +$strSQL = "SELECT ";
  93 +$strSQL .= " * ";
  94 +$strSQL .= "FROM ";
  95 +$strSQL .= " syain_tbl ";
  96 +$strSQL .= "WHERE ";
  97 +$strSQL .= " syain_cd = " . $_SESSION["PHP_POST_SYAIN_CD"]. " ";
  98 +$strSQL .= "ORDER BY";
  99 +$strSQL .= " syain_cd";
  100 +$objRecSet = pg_exec($strSQL);
  101 +if($objRecSet==false){
  102 + echo("SQL実行に失敗しました(INSERT)");
  103 + exit;
  104 +}
  105 +$objData = pg_fetch_object($objRecSet, 0);
  106 +$strSubmitAdd = $objData->pc_mail_addr;
  107 +if($strSubmitAdd==""){//pcメルアドが無かったら
  108 + $objData = pg_fetch_object($objRecSet, 0);
  109 + $strSubmitAdd = $objData->mail_addr;
  110 + if($strSubmitAdd==""){//どちらのメルアドも無かったら
  111 + $strSQL = "SELECT * FROM mst_dmain";
  112 + $objRecSet = pg_exec($strSQL);
  113 + if($objRecSet==false){
  114 + echo("SQL実行に失敗しました(INSERT)");
  115 + exit;
  116 + }
  117 + $objData = pg_fetch_object($objRecSet, 0);
  118 + $strSubmitAdd = $objData->mail_addr;
  119 + }
  120 +}
  121 +$strSubmitName=$strSubmitName=$objData->name_kj_sei . " " . $objData->name_kj_mei;
  122 +
  123 +//ドメイン
  124 +$strDomeName=getDomain();
  125 +
  126 +//********** メール情報取得 **********//
  127 +$strSQL = "SELECT ";
  128 +$strSQL .= " * ";
  129 +$strSQL .= "FROM ";
  130 +$strSQL .= " mail_data ";
  131 +$strSQL .= "WHERE ";
  132 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"];
  133 +$objRec = pg_exec($strSQL);
  134 +if($objRec==false){
  135 + echo("SQL実行に失敗しました(SELECT)");
  136 + exit;
  137 +}
  138 +$objData = pg_fetch_object($objRec, 0);
  139 +$Angou_id = $objData->angou_id;
  140 +$Mail_date = $objData->message_date;
  141 +$Mail_time = $objData->message_time;
  142 +$Subject_name = $objData->subject_name;
  143 +$Contents = $objData->contents;
  144 +$Send_type = $objData->send_type;
  145 +
  146 +$Header1 = "";
  147 +$Headers['From']=$strSubmitAdd;
  148 +$Headers['X-Mailer']="PHP/".phpversion(); //メール送信プログラムの表示
  149 +
  150 +//********** 選択者取得 **********//
  151 +$User_List=split(",",$_POST["Send_User"]);
  152 +for ($intI = 0 ; $intI < count($User_List)-1 ; $intI++) {
  153 +
  154 + $strSQL = "SELECT ";
  155 + $strSQL .= " syain_cd , ";
  156 + $strSQL .= " angou_cd , ";
  157 + $strSQL .= " mail_addr , ";
  158 + $strSQL .= " pc_mail_addr, ";
  159 + $strSQL .= " name_kj_sei , ";
  160 + $strSQL .= " name_kj_mei ";
  161 + $strSQL .= "FROM ";
  162 + $strSQL .= " syain_tbl ";
  163 + $strSQL .= "WHERE ";
  164 + $strSQL .= " syain_cd = ".(int)$User_List[$intI]." ";
  165 + $strSQL .= "ORDER BY ";
  166 + $strSQL .= " syain_tbl.syain_id ASC ";
  167 + $objRec = pg_exec($strSQL);
  168 + if($objRec==false){
  169 + echo("SQL実行に失敗しました(SELECT)");
  170 + exit;
  171 + }
  172 + $objUsrData = pg_fetch_object($objRec, 0);
  173 +
  174 + //*** 宛先情報取得 ***//
  175 + $Mail_Nasi = 0;
  176 + $strAngou = $objUsrData->angou_cd;
  177 + $strTo = $objUsrData->pc_mail_addr;
  178 + $strToMob = $objUsrData->mail_addr;
  179 + $strToName = $objUsrData->name_kj_sei.$objUsrData->name_kj_mei;
  180 +
  181 + switch ($_POST["SendType"]) {
  182 + case "0":
  183 + if($objUsrData->pc_mail_addr=="" && $objUsrData->mail_addr==""){
  184 + $Mail_Nasi=100; //PCか携帯メールアドレスが未登録の人
  185 + $SendRes = 3;
  186 + }elseif($objUsrData->pc_mail_addr=="" && $objUsrData->mail_addr!=""){
  187 + $SendRes = 1;
  188 + }elseif($objUsrData->pc_mail_addr!="" && $objUsrData->mail_addr==""){
  189 + $SendRes = 2;
  190 + }elseif($objUsrData->pc_mail_addr!="" && $objUsrData->mail_addr!=""){
  191 + $SendRes = 0;
  192 + }
  193 +
  194 + break;
  195 +
  196 + case "1":
  197 + if($objUsrData->mail_addr==""){
  198 + $Mail_Nasi=100; //携帯メールアドレスが未登録の人
  199 + $SendRes = 3;
  200 + }else{
  201 + $SendRes = 1;
  202 + }
  203 +
  204 + break;
  205 +
  206 + case "2":
  207 + if($objUsrData->pc_mail_addr==""){
  208 + $Mail_Nasi=100; //PCメールアドレスが未登録の人
  209 + $SendRes = 3;
  210 + }else{
  211 + $SendRes = 2;
  212 + }
  213 +
  214 + break;
  215 +
  216 + }
  217 +
  218 + $strSubject = "=?iso-2022-jp?B?" . base64_encode(jcodeconvert($Subject_name, 0, 3)) . "?=";
  219 + $strComment = "";
  220 + $strComment .= $_SESSION["PHP_POST_DB_USER_NAME"]."の皆様(".$strToName."様)へ\n\n下記のアドレスからメール内容を確認してください。\n";
  221 + //$strComment .= "http://" . $strDomeName . "/mail_ni_pon/check_update/mail_check.php?";
  222 + $strComment .= $PONV2_URL_HEAD . "USER0000.php?";
  223 + $strComment .= "m=".$Angou_id."&";
  224 + $strComment .= "s=".$strAngou."&";
  225 + $strComment .= "d=".$_SESSION["PHP_POST_DB_ANGOU"]. "\n\n";
  226 +
  227 + $strComment = jcodeconvert($strComment, 1, 3);
  228 +
  229 + $Header = "";//ヘッダー部クリア
  230 + $Header1 = "";
  231 +
  232 + //***** 携帯電話へ送信 *****//
  233 + //PEARのmimeクラス設定
  234 + $mime = new Mail_mime("\r\n");
  235 + $mime->_build_params['text_charset'] = 'iso-2022-jp'; //本文テキストの文字コードをJISに設定する
  236 +
  237 + //本文のテキストの指定
  238 + $mime->setTXTBody($strComment);
  239 + $strComment = $mime->get();
  240 +
  241 + $Headers = $mime->headers($Headers);
  242 + while (list($key,$val)=each($Headers)) {
  243 + $Header1 .= $key.": ".$val."\r\n";
  244 + }
  245 +
  246 + if($Send_type==0 || $Send_type==1){
  247 + if($strToMob!=""){
  248 + $intBool2 = mail($strToMob,$strSubject,$strComment.$Comment_tel.$koukokuTEL,$Header1,"-f ".$strSubmitAdd);//携帯に送信
  249 + }else{
  250 + $intBool2 = true;
  251 + }
  252 + }else{
  253 + $intBool2 = true;
  254 + }
  255 +
  256 + //***** PCへ送信 *****//
  257 + //メールボディの取得
  258 + $strComment = $mime->get();
  259 +
  260 + //メールヘッダの取得
  261 + $Headers = $mime->headers($Headers);
  262 +
  263 + //メールヘッダの配列を文字列に組み立てる
  264 + while (list($key,$val)=each($Headers)) {
  265 + $Header .= $key.": ".$val."\r\n";
  266 + }
  267 +
  268 + if($Send_type==0 || $Send_type==2){
  269 + if($strTo!=""){
  270 + $intBool = mail($strTo, $strSubject, $strComment.$Comment_pc.$koukokuPC, $Header,"-f ".$strSubmitAdd);//PCに送信
  271 + }else{
  272 + $intBool = true;
  273 + }
  274 + }else{
  275 + $intBool = true;
  276 + }
  277 +
  278 + if($intBool && $intBool2){
  279 + //*** 回答情報 ***//
  280 + $strSQL = "INSERT INTO ";
  281 + $strSQL .= " mail_info (";
  282 + $strSQL .= " mail_id, ";
  283 + $strSQL .= " syain_cd, ";
  284 + $strSQL .= " check_flg ";
  285 + $strSQL .= ") VALUES (";
  286 + $strSQL .= $_POST["mail_id"].", ";
  287 + $strSQL .= $User_List[$intI].",";
  288 + $strSQL .= $Mail_Nasi;
  289 + $strSQL .= ")";
  290 + $objInsRet = pg_exec($strSQL);
  291 + if($objInsRet==false){
  292 + echo("SQL実行に失敗しました(INSERT)");
  293 + exit;
  294 + }
  295 +
  296 + //*** 送信パターン保存 ***//
  297 + $strSQL = "INSERT INTO ";
  298 + $strSQL .= " mail_send_tbl (";
  299 + $strSQL .= " mail_id , ";
  300 + $strSQL .= " syain_cd, ";
  301 + $strSQL .= " send_flg ";
  302 + $strSQL .= ")VALUES (";
  303 + $strSQL .= $_POST["mail_id"] . ", ";
  304 + $strSQL .= "'" . $User_List[$intI]. "', ";
  305 + $strSQL .= $SendRes;
  306 + $strSQL .= ")";
  307 + $objInsRet = pg_exec($strSQL);
  308 + if($objInsRet==false){
  309 + echo("SQL実行に失敗しました(INSERT)");
  310 + exit;
  311 + }
  312 +
  313 + }
  314 +
  315 + $SendPoint= $SendPoint+1; //何人に送ったか
  316 + $Max_User = count($User_List)-1;
  317 +
  318 + echo "<script language='javascript'>";
  319 + echo "document.getElementById('maxcount').innerHTML ='".$Max_User."';";
  320 + echo "document.getElementById('count').innerHTML ='".$intI."';";
  321 + echo "</script>";
  322 + ob_flush();
  323 + flush();
  324 +
  325 +}
  326 +
  327 +if($_SESSION["PHP_POST_DB_FLG"]==6){
  328 + func_point_decrement($_SESSION["PHP_POST_SYAIN_ID"],$SendPoint,0); //ポイント減算
  329 + //func_LogInput($_SESSION["PHP_POST_SYAIN_ID"],$logFrom,$logTo,$logType,$logDate,$intCountLog);
  330 +}
  331 +
  332 +?>
  333 +</BODY>
  334 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1033.php
  6 +//* 機能 :メール配信完了(追加配信)
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include('./include/smarty.conf');
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +
  18 +//********** ヘッダー処理 **********//
  19 +include("./include/headr_data.inc");
  20 +
  21 +$o_smarty->display('LIST1033.tpl');
  22 +
  23 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1710.php
  6 +//* 機能 :アラーム設定画面
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** カレンダー処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +//アラーム情報取得
  26 +$strSQL = "SELECT * FROM alarm_data WHERE mail_id = " . $_POST["mail_id"];
  27 +$objRecSet = pg_exec($strSQL);
  28 +if($objRecSet==false){
  29 + echo("SQL実行に失敗しました(SELECT)");
  30 + exit;
  31 +}
  32 +$ALARM_FLG = 0;
  33 +if(pg_numrows($objRecSet) > O){
  34 + $objData = pg_fetch_object($objRecSet,0);
  35 +
  36 + $ALARM_YEAR = substr($objData->message_date, 0, 4);
  37 + $ALARM_MONTH = substr($objData->message_date, 4, 2);
  38 + $ALARM_DAY = substr($objData->message_date, 6, 2);
  39 + $ALARM_HOUR = substr($objData->message_time, 0, 2);
  40 + $ALARM_MINUTE = substr($objData->message_time, 2, 2);
  41 + $ANSWER_ID = $objData->answer_id;
  42 + $ALARM_FLG = 1;
  43 +}else{
  44 + $strSysDate = date("YmdHi");
  45 + if (strlen($strSysDate) == 10) {
  46 + $strSysDate = "20" . $strSysDate;
  47 + }
  48 + $ALARM_YEAR = substr($strSysDate, 0, 4);
  49 + $ALARM_MONTH = "";
  50 + $ALARM_DAY = "";
  51 + $ALARM_HOUR = "";
  52 + $ALARM_MINUTE = "";
  53 + $ANSWER_ID = "";
  54 +}
  55 +
  56 +$opt_date_mm = make_option_md(12, $ALARM_MONTH);
  57 +$opt_date_dd = make_option_md(date(t,mktime(0,0,0,(int)$date_mm,1)), $ALARM_DAY);
  58 +$tempTimeArr = array("","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","00","01","02","03","04","05","06","07");
  59 +$opt_time_hh = make_option_time($tempTimeArr, $ALARM_HOUR);
  60 +$tempTimeArr = array("","00","30");
  61 +$opt_time_mm = make_option_time($tempTimeArr, $ALARM_MINUTE);
  62 +
  63 +$o_smarty->assign('ALARM_FLG' , $ALARM_FLG);
  64 +$o_smarty->assign('ALARM_YEAR' , $ALARM_YEAR);
  65 +$o_smarty->assign('opt_date_mm' , $opt_date_mm);
  66 +$o_smarty->assign('opt_date_dd' , $opt_date_dd);
  67 +$o_smarty->assign('opt_time_hh' , $opt_time_hh);
  68 +$o_smarty->assign('opt_time_mm' , $opt_time_mm);
  69 +
  70 +//回答文言を取得
  71 +$strSQL = "SELECT * FROM answer_data WHERE mail_id = " . $mail_id;
  72 +
  73 +$objRecSet = pg_exec($strSQL);
  74 +if($objRecSet==false){
  75 + echo("SQL実行に失敗しました(SELECT)");
  76 + exit;
  77 +}
  78 +$objData = pg_fetch_object($objRecSet,0);
  79 +$select_cnt=$objData->select_nm;
  80 +for($i = 1; $i <= $select_cnt; $i++){
  81 + $name_id =pg_result($objRecSet, 0, "name" . $i . "_id");
  82 + $kaito[$i-1] ="<TR><TD><FONT size=\"2\">".pg_result($objRecSet, 0, "name" . $i . "_nm")."<FONT size=\"2\">&nbsp;</FONT></TD>";
  83 + $kaito[$i-1] = $kaito[$i-1]."<TD ALIGN=\"CENTER\"><input type=\"radio\"";
  84 + if ($ANSWER_ID==$name_id ) {
  85 + $kaito[$i-1] = $kaito[$i-1]. " CHECKED " ;
  86 + }
  87 + $kaito[$i-1] = $kaito[$i-1]. "name=\"alarm_id\" value=\"".pg_result($objRecSet, 0, "name" . $i . "_id")."\"></TR>";
  88 +}
  89 +$o_smarty->assign('kaito' , $kaito);
  90 +
  91 +
  92 +//開催日取得
  93 +$strSQL = "SELECT * FROM mail_data WHERE mail_id = " . $mail_id;
  94 +$objRecSet = pg_exec($strSQL);
  95 +if($objRecSet==false){
  96 + echo("SQL実行に失敗しました(SELECT)");
  97 + exit;
  98 +}
  99 +if(pg_numrows($objRecSet) > O){
  100 + $objData = pg_fetch_object($objRecSet,0);
  101 + if (trim($objData->message_date) == ""){
  102 + $kaisai_yy = 0;
  103 + $kaisai_mm = 0;
  104 + $kaisai_dd = 0;
  105 + $kaisai_hh = 0;
  106 + }else{
  107 + $kaisai_yy = substr($objData->message_date, 0, 4);
  108 + $kaisai_mm = substr($objData->message_date, 4, 2);
  109 + $kaisai_dd = substr($objData->message_date, 6, 2);
  110 + $kaisai_hh = substr($objData->message_time, 0, 2);
  111 + }
  112 +}
  113 +
  114 +$o_smarty->assign('kaisai_yy' , $kaisai_yy);
  115 +$o_smarty->assign('kaisai_mm' , $kaisai_mm);
  116 +$o_smarty->assign('kaisai_dd' , $kaisai_dd);
  117 +$o_smarty->assign('kaisai_hh' , $kaisai_hh);
  118 +
  119 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  120 +
  121 +$o_smarty->display('LIST1710.tpl');
  122 +
  123 +
  124 +function make_option_time($arr,$strCmp){
  125 + $retString = "<OPTION value=''>--</OPTION>";
  126 + for($i=1;$i<count($arr);$i++){
  127 + if($arr[$i] == $strCmp){
  128 + $retString .= "<OPTION value='".$arr[$i]."' selected>".$arr[$i]."</OPTION>";
  129 + }else{
  130 + $retString .= "<OPTION value='".$arr[$i]."'>".$arr[$i]."</OPTION>";
  131 + }
  132 + }
  133 + return $retString;
  134 +}
  135 +
  136 +function make_option_md($pMax, $strCmp){
  137 + $retString = "<OPTION value=''>--</OPTION>";
  138 + for($i = 1; $i <= $pMax ; $i++){
  139 + if($i==$strCmp){
  140 + $retString .= "<OPTION value='".sprintf("%02d",$i)."' selected>".sprintf("%02d",$i)."</OPTION>";
  141 + }else{
  142 + $retString .= "<OPTION value='".sprintf("%02d",$i)."'>".sprintf("%02d",$i)."</OPTION>";
  143 + }
  144 + }
  145 + return $retString;
  146 +}
  147 +
  148 +
  149 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1711.php
  6 +//* 機能 :アラームデータDB更新
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +//***************************
  11 +//* インクルードファイル
  12 +//***************************
  13 +include("./include/getWeekDay.inc");
  14 +include("./include/jcode.phps");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +include("./include/dbcon.inc");
  18 +
  19 +//***************************
  20 +//* 初期処理
  21 +//***************************
  22 +$objConn = null; //接続オブジェクト
  23 +$objRecSet = null; //レコードセットオブジェクト
  24 +$objInsRet = null; //レコードセットオブジェクト
  25 +
  26 +$strSQL = ""; //SQL文
  27 +
  28 +$strMail_id = ""; //メールID
  29 +$strAlarm_Date = ""; //日付
  30 +$strKenmei = ""; //件名
  31 +$strAlarm_Text = ""; //本文
  32 +
  33 +//***************************
  34 +//* メイン処理
  35 +//***************************
  36 +
  37 +//メールID
  38 +$strMail_id = "'" . $mail_id . "'";
  39 +
  40 +//日付
  41 +$strAlarm_Date = $alarm_yyyy . $alarm_mm . $alarm_dd;
  42 +if (is_numeric($strAlarm_Date)==false) {
  43 + $strAlarm_Date = "";
  44 +}else{
  45 + $strAlarm_Date = "'" . $strAlarm_Date . "'";
  46 +}
  47 +
  48 +//画面時間
  49 +$strAlarm_Time = $alarm_hh . $alarm_time_mm;
  50 +if (is_numeric($strAlarm_Time)==false) {
  51 + $strAlarm_Time = "";
  52 +}else{
  53 + $strAlarm_Time = "'" . $strAlarm_Time . "'";
  54 +}
  55 +
  56 +//メール情報取得
  57 +$strSQL = "SELECT * FROM mail_data WHERE mail_id = " . $mail_id;
  58 +$objRecSet = pg_exec($strSQL);
  59 +if($objRecSet==false){
  60 + echo("SQL実行に失敗しました(SELECT)");
  61 + exit;
  62 +}
  63 +if(pg_numrows($objRecSet) > O){
  64 + $objData = pg_fetch_object($objRecSet,0);
  65 +
  66 + $i = strlen($objData->subject_name);
  67 + $Kenmei = substr($objData->subject_name, 4, $i);
  68 + $strKenmei = "'(〒お知らせ)" . $Kenmei . "'";
  69 +
  70 + $strAdmin_cd = $objData->admin_cd;
  71 +
  72 + //メール開催日
  73 + $strYear = substr($objData->message_date, 0, 4);
  74 + $strMonth = substr($objData->message_date, 4, 2);
  75 + $strDay = substr($objData->message_date, 6, 2);
  76 + $strHH = substr($objData->message_time, 0, 2);
  77 + $strMM = substr($objData->message_time, 2, 2);
  78 +
  79 + $strMes = $strYear . "年" . intval(substr($strMonth,0,2)) . "月" . intval(substr($strDay,0,2)) . "日";
  80 + if(mb_strlen($Mail_time)>0){
  81 + $strMes = $strMes . intval(substr($strHH,0,2)) . "時" . intval(substr($strMM,0,2)) . "分";
  82 + }
  83 +}
  84 +
  85 +//内容
  86 +$strAlarm_Text = "'「" . $Kenmei . "の開催日:" . $strMes . "」が近づいております。詳細は下記URLをご覧ください。" . "'";
  87 +if ($ALARM_FLG==0){
  88 + $strSQL = "INSERT INTO alarm_data (" .
  89 + "mail_id," .
  90 + "message_date," .
  91 + "message_time," .
  92 + "subject_name," .
  93 + "contents," .
  94 + "admin_cd," .
  95 + "send_date," .
  96 + "send_flg," .
  97 + "answer_id)" .
  98 + "VALUES (" .
  99 + $strMail_id . "," .
  100 + $strAlarm_Date . ", " .
  101 + $strAlarm_Time . ", " .
  102 + $strKenmei . ", " .
  103 + $strAlarm_Text . ", " .
  104 + $strAdmin_cd . ", " .
  105 + "'', " .
  106 + 0 . ", " .
  107 + $alarm_id . ")";
  108 + $objRecSet = pg_exec($strSQL);
  109 + if($objRecSet==false){
  110 + echo("SQL実行に失敗しました(INSERT)");
  111 + exit;
  112 + }
  113 +}else{
  114 + $strSQL = "UPDATE alarm_data SET " .
  115 + "message_date = " . $strAlarm_Date . ", " .
  116 + "message_time = " . $strAlarm_Time . ", " .
  117 + "subject_name = " . $strKenmei . ", " .
  118 + "contents = " . $strAlarm_Text . ", " .
  119 + "answer_id = " . $alarm_id . " " .
  120 + "WHERE alarm_data.mail_id = " . $strMail_id;
  121 + $objRecSet = pg_exec($strSQL);
  122 + if($objRecSet==false){
  123 + echo("SQL実行に失敗しました(UPDATE)");
  124 + exit;
  125 + }
  126 +}
  127 +//メールデータ更新
  128 +$strSQL = "UPDATE mail_data SET " .
  129 + "send_alarm = 1 " .
  130 + "WHERE mail_data.mail_id = " . $strMail_id ;
  131 +
  132 +
  133 +$objRecSet = pg_exec($strSQL);
  134 +if($objRecSet==false){
  135 + echo("SQL実行に失敗しました(UPDATE)");
  136 + exit;
  137 +}
  138 +
  139 +?>
  140 +<HTML>
  141 +<HEAD>
  142 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  143 +<META http-equiv="Content-Style-Type" content="text/css">
  144 +<link rel="stylesheet" type="text/css" href="basefont.css">
  145 +<TITLE>め〜るNiポン!</TITLE>
  146 +<SCRIPT LANGUAGE="JAVASCRIPT">
  147 +<!--
  148 +function load_screen(){
  149 + document.frm.action = "LIST1000.php";
  150 + document.frm.method="POST";
  151 + document.frm.submit();
  152 +}
  153 +-->
  154 +</SCRIPT>
  155 +</HEAD>
  156 +<BODY onLoad="return load_screen();">
  157 +<form name="frm">
  158 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  159 +</form>
  160 +</BODY>
  161 +</HTML>
  162 +
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1711.php
  6 +//* 機能 :アラームデータ削除
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +//***************************
  11 +//* インクルードファイル
  12 +//***************************
  13 +include("./include/session_start.inc");
  14 +include("./include/SessionChk.inc");
  15 +include("./include/dbcon.inc");
  16 +
  17 +//***************************
  18 +//* 内部変数
  19 +//***************************
  20 +$objConn = null; //接続オブジェクト
  21 +$objRecSet = null; //レコードセットオブジェクト
  22 +$strSQL = ""; //SQL文
  23 +$strInfo_No = "";
  24 +
  25 +//メールデータの削除
  26 +$strInfo_No = $mail_id;
  27 +
  28 +//アラームデータ削除
  29 +$strSQL = "DELETE FROM alarm_data WHERE alarm_data.mail_id = '" . $strInfo_No . "'";
  30 +$objRecSet = pg_exec($strSQL);
  31 +if($objRecSet==false){
  32 + echo("SQL実行に失敗しました(DELETE)");
  33 + exit;
  34 +}
  35 +//メールデータ更新
  36 +$strSQL = "UPDATE mail_data SET send_alarm = 0 WHERE mail_id = '" . $strInfo_No . "'";
  37 +$objRecSet = pg_exec($strSQL);
  38 +if($objRecSet==false){
  39 + echo("SQL実行に失敗しました(UPDATE)");
  40 + exit;
  41 +}
  42 +
  43 +?>
  44 +
  45 +<HTML>
  46 +<HEAD>
  47 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  48 +<META http-equiv="Content-Style-Type" content="text/css">
  49 +<link rel="stylesheet" type="text/css" href="basefont.css">
  50 +<TITLE>め〜るNiポン!</TITLE>
  51 +<SCRIPT LANGUAGE="JAVASCRIPT">
  52 +<!--
  53 +function load_screen(){
  54 + document.frm.action = "LIST1000.php";
  55 + document.frm.method="POST";
  56 + document.frm.submit();
  57 +}
  58 +-->
  59 +</SCRIPT>
  60 +</HEAD>
  61 +<BODY onLoad="return load_screen();">
  62 +<form name="frm">
  63 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  64 +</form>
  65 +</BODY>
  66 +</HTML>
  67 +
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1720.php
  6 +//* 機能 :自動配信設定
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** カレンダー処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +//メール開催日
  26 +$strSysDate = date("YmdHi");
  27 +
  28 +if (strlen($strSysDate) == 10) {
  29 + $strSysDate = "20" . $strSysDate;
  30 +}
  31 +$calYMD1 = $strSysDate;
  32 +$strYear = substr($strSysDate, 0, 4);
  33 +$strMonth = substr($strSysDate, 4, 2);
  34 +
  35 +$strSQL = "SELECT * FROM kidok_data WHERE kidok_data.mail_id = " . $_POST["mail_id"] .
  36 + " ORDER BY kidok_data.check_id";
  37 +
  38 +$objRecSet = pg_exec($strSQL);
  39 +if($objRecSet==false){
  40 + echo("SQL実行に失敗しました(SELECT)");
  41 + exit;
  42 +}
  43 +$Kidoku_Flg=0;
  44 +$Midoku_Flg=0;
  45 +
  46 +if(pg_numrows($objRecSet) > O){
  47 + $objData = pg_fetch_object($objRecSet,0);
  48 + if($objData->check_id == 0){
  49 + $Midoku_Flg = 1;
  50 + }else{
  51 + $Kidoku_Flg = 1;
  52 + }
  53 + $Kidok_YEAR = substr($objData->message_date, 0, 4);
  54 + $Kidok_MONTH = substr($objData->message_date, 4, 2);
  55 + $Kidok_DAY = substr($objData->message_date, 6, 2);
  56 + $Kidok_HOUR = substr($objData->message_time, 0, 2);
  57 + $Kidok_Minute = substr($objData->message_time, 2, 2);
  58 +
  59 +}else{
  60 + $Kidok_YEAR = $strYear;
  61 + $Kidok_MONTH = 0;
  62 + $Kidok_DAY = 0;
  63 + $Kidok_HOUR = "";
  64 + $Kidok_Minute = "";
  65 +}
  66 +
  67 +$opt_date_mm = make_option_md(12, $Kidok_MONTH);
  68 +$opt_date_dd = make_option_md(date(t,mktime(0,0,0,(int)$date_mm,1)), $Kidok_DAY);
  69 +$tempTimeArr = array("","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","00","01","02","03","04","05","06","07");
  70 +$opt_time_hh = make_option_time($tempTimeArr, $Kidok_HOUR);
  71 +$tempTimeArr = array("","00","30");
  72 +$opt_time_mm = make_option_time($tempTimeArr, $Kidok_Minute);
  73 +
  74 +
  75 +$o_smarty->assign('Kidok_YEAR' , $Kidok_YEAR);
  76 +$o_smarty->assign('opt_date_mm' , $opt_date_mm);
  77 +$o_smarty->assign('opt_date_dd' , $opt_date_dd);
  78 +$o_smarty->assign('opt_time_hh' , $opt_time_hh);
  79 +$o_smarty->assign('opt_time_mm' , $opt_time_mm);
  80 +
  81 +$o_smarty->assign('Kidoku_Flg' , $Kidoku_Flg);
  82 +$o_smarty->assign('Midoku_Flg' , $Midoku_Flg);
  83 +
  84 +$o_smarty->assign('calYMD1' , $calYMD1);
  85 +
  86 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  87 +
  88 +$o_smarty->display('LIST1720.tpl');
  89 +
  90 +
  91 +function make_option_time($arr,$strCmp){
  92 + $retString = "<OPTION value=''>--</OPTION>";
  93 + for($i=1;$i<count($arr);$i++){
  94 + if($arr[$i] == $strCmp){
  95 + $retString .= "<OPTION value='".$arr[$i]."' selected>".$arr[$i]."</OPTION>";
  96 + }else{
  97 + $retString .= "<OPTION value='".$arr[$i]."'>".$arr[$i]."</OPTION>";
  98 + }
  99 + }
  100 + return $retString;
  101 +}
  102 +
  103 +function make_option_md($pMax, $strCmp){
  104 + $retString = "<OPTION value=''>--</OPTION>";
  105 + for($i = 1; $i <= $pMax ; $i++){
  106 + if($i==$strCmp){
  107 + $retString .= "<OPTION value='".sprintf("%02d",$i)."' selected>".sprintf("%02d",$i)."</OPTION>";
  108 + }else{
  109 + $retString .= "<OPTION value='".sprintf("%02d",$i)."'>".sprintf("%02d",$i)."</OPTION>";
  110 + }
  111 + }
  112 + return $retString;
  113 +}
  114 +
  115 +
  116 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1721.php
  6 +//* 機能 :自動配信の更新
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +//***************************
  11 +//* インクルードファイル
  12 +//***************************
  13 +include("./include/session_start.inc");
  14 +include("./include/SessionChk.inc");
  15 +include("./include/dbcon.inc");
  16 +
  17 +//***************************
  18 +//* 初期処理
  19 +//***************************
  20 +$objConn = null; //接続オブジェクト
  21 +$objRecSet = null; //レコードセットオブジェクト
  22 +$objInsRet = null; //レコードセットオブジェクト
  23 +
  24 +$strSQL = ""; //SQL文
  25 +
  26 +$strMail_id = ""; //メールID
  27 +$strAlarm_Date = ""; //日付
  28 +$strKenmei = ""; //件名
  29 +$strAlarm_Text = ""; //本文
  30 +
  31 +//***************************
  32 +//* メイン処理
  33 +//***************************
  34 +
  35 +//メールID
  36 +$strMail_id = $mail_id ;
  37 +
  38 +//日付
  39 +$strResend_Date = $Resend_Year . $Resend_Month . $Resend_Date;
  40 +if (is_numeric($strResend_Date)==false) {
  41 + $strResend_Date = "";
  42 +}else{
  43 + $strResend_Date = "'" . $strResend_Date . "'";
  44 +}
  45 +
  46 +//時間
  47 +if (strlen($Resend_Hour) < 2) {
  48 + $Resend_Hour = "0" . $Resend_Hour;
  49 +}else{
  50 + $Resend_Hour = $Resend_Hour;
  51 +}
  52 +if (strlen($Resend_Minute) < 2) {
  53 + $Resend_Minute = "0" . $Resend_Minute;
  54 +}else{
  55 + $Resend_Minute = $Resend_Minute;
  56 +}
  57 +$strResend_Time = $Resend_Hour . $Resend_Minute;
  58 +if (is_numeric($strResend_Time)==false) {
  59 + $strResend_Time = "";
  60 +}else{
  61 + $strResend_Time = "'" . $strResend_Time . "'";
  62 +}
  63 +
  64 +//既読・未読自動配信情報削除
  65 +$strSQL = "DELETE FROM kidok_data WHERE kidok_data.mail_id = '" . $strMail_id . "'";
  66 +$objRecSet = pg_exec($strSQL);
  67 +if($objRecSet==false){
  68 + echo("SQL実行に失敗しました(DELETE)");
  69 + exit;
  70 +}
  71 +
  72 +if($kidok=="on"){
  73 + $strSQL = "INSERT INTO kidok_data (" .
  74 + "mail_id, " .
  75 + "check_id, " .
  76 + "message_date, " .
  77 + "message_time, " .
  78 + "send_date, " .
  79 + "send_flg) " .
  80 + "VALUES ('" .
  81 + $strMail_id . "', " .
  82 + 99 . ", " .
  83 + $strResend_Date . ", " .
  84 + $strResend_Time . ", " .
  85 + "Null" . ", " .
  86 + 0 . ") ";
  87 +}else{
  88 + $strSQL = "INSERT INTO kidok_data (" .
  89 + "mail_id, " .
  90 + "check_id, " .
  91 + "message_date, " .
  92 + "message_time, " .
  93 + "send_date, " .
  94 + "send_flg) " .
  95 + "VALUES ('" .
  96 + $strMail_id . "', " .
  97 + 0 . ", " .
  98 + $strResend_Date . ", " .
  99 + $strResend_Time . ", " .
  100 + "Null" . ", " .
  101 + 0 . ") ";
  102 +}
  103 +
  104 +$objRecSet = pg_exec($strSQL);
  105 +if($objRecSet==false){
  106 + echo("SQL実行に失敗しました(INSERT)");
  107 + exit;
  108 +}
  109 +?>
  110 +
  111 +<HTML>
  112 +<HEAD>
  113 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  114 +<META http-equiv="Content-Style-Type" content="text/css">
  115 +<link rel="stylesheet" type="text/css" href="basefont.css">
  116 +<TITLE>め〜るNiポン!</TITLE>
  117 +<SCRIPT LANGUAGE="JAVASCRIPT">
  118 +<!--
  119 +function load_screen(){
  120 + document.frm.action = "LIST1000.php";
  121 + document.frm.method="POST";
  122 + document.frm.submit();
  123 +}
  124 +-->
  125 +</SCRIPT>
  126 +</HEAD>
  127 +<BODY onLoad="return load_screen();">
  128 +<form name="frm">
  129 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  130 +</form>
  131 +</BODY>
  132 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1722.php
  6 +//* 機能 :自動配信削除
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +//***************************
  11 +//* インクルードファイル
  12 +//***************************
  13 +include("./include/session_start.inc");
  14 +include("./include/SessionChk.inc");
  15 +include("./include/dbcon.inc");
  16 +
  17 +
  18 +//***************************
  19 +//* 内部変数
  20 +//***************************
  21 +$objConn = null; //接続オブジェクト
  22 +$objRecSet = null; //レコードセットオブジェクト
  23 +$strSQL = ""; //SQL文
  24 +$strInfo_No = "";
  25 +
  26 +//メールデータの削除
  27 +$strInfo_No = $mail_id;
  28 +
  29 +
  30 +//既読データ削除
  31 +$strSQL = "DELETE FROM kidok_data WHERE kidok_data.mail_id = '" . $strInfo_No . "'";
  32 +$objRecSet = pg_exec($strSQL);
  33 +if($objRecSet==false){
  34 + echo("SQL実行に失敗しました(DELETE)");
  35 + exit;
  36 +}
  37 +?>
  38 +<HTML>
  39 +<HEAD>
  40 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  41 +<META http-equiv="Content-Style-Type" content="text/css">
  42 +<link rel="stylesheet" type="text/css" href="basefont.css">
  43 +<TITLE>め〜るNiポン!</TITLE>
  44 +<SCRIPT LANGUAGE="JAVASCRIPT">
  45 +<!--
  46 +function load_screen(){
  47 + document.frm.action = "LIST1000.php";
  48 + document.frm.method="POST";
  49 + document.frm.submit();
  50 +}
  51 +-->
  52 +</SCRIPT>
  53 +</HEAD>
  54 +<BODY onLoad="return load_screen();">
  55 +<form name="frm">
  56 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  57 +</form>
  58 +</BODY>
  59 +</HTML>
... ...
  1 +<?PHP
  2 +
  3 +//*****************************************************************************
  4 +//*
  5 +//* プログラム名:アラーム設定、回答文言新規登録
  6 +//* プログラムID:alarm_ansreg3.php
  7 +//* 機能 :アラーム設定、回答文言を登録する
  8 +//*
  9 +//*****************************************************************************
  10 +header("Content-type: text/html; charset=EUC-JP");
  11 +
  12 +//***************************
  13 +//* インクルードファイル
  14 +//***************************
  15 +include("./include/smarty.conf");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk2.inc");
  18 +include("./include/dbcon.inc");
  19 +include("./include/jcode.phps");
  20 +
  21 +//********** ヘッダー処理 **********//
  22 +include("./include/headr_data.inc");
  23 +
  24 +//********** メイン処理 **********//
  25 +include("./include/dbcon.inc");
  26 +
  27 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  28 +
  29 +//配信情報を取得
  30 +$strSQL = "SELECT * FROM mail_data WHERE mail_id = ".(int)$_POST["mail_id"];
  31 +$objRec = pg_exec($strSQL);
  32 +if($objRec==false){
  33 + echo("SQL実行に失敗しました(SELECT)");
  34 + exit;
  35 +}
  36 +
  37 +$objData = pg_fetch_object($objRec, 0);
  38 +$Reserva_Year = substr($objData->reserva_date, 0, 4);
  39 +$ReservaMonth = substr($objData->reserva_date, 4, 2);
  40 +$ReservaDay = substr($objData->reserva_date, 6, 2);
  41 +$ReservaHour = substr($objData->reserva_time, 0, 2);
  42 +$ReservaMinute = substr($objData->reserva_time, 2, 2);
  43 +
  44 +$Month_Data = '<OPTION value="">--</OPTION>';
  45 +for($intI = 1; $intI < 13 ; $intI++){
  46 + $Month_Data .= '<OPTION value="'.sprintf('%02d', $intI).'" ';
  47 + if ($ReservaMonth==sprintf('%02d', $intI)){
  48 + $Month_Data .= 'selected';
  49 + }
  50 + $Month_Data .= '>'.sprintf('%02d', $intI).'</OPTION>';
  51 +}
  52 +
  53 +$Day_Data = '<OPTION value="">--</OPTION>';
  54 +for($intI = 1; $intI < 32 ; $intI++){
  55 + $Day_Data .= '<OPTION value="'.sprintf('%02d', $intI).'" ';
  56 + if ($ReservaDay==sprintf('%02d', $intI)){
  57 + $Day_Data .= 'selected';
  58 + }
  59 + $Day_Data .= '>'.sprintf('%02d', $intI).'</OPTION>';
  60 +}
  61 +
  62 +$Hour_List=array("--","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","00","01","02","03","04","05","06","07");
  63 +for ($intI=0; $intI < count($Hour_List); $intI++){
  64 + if ($intI==0){
  65 + $Hour_Data.='<option value="" ';
  66 + }else{
  67 + $Hour_Data.='<option value="'.$Hour_List[$intI].'" ';
  68 + }
  69 + if ($ReservaHour==$Hour_List[$intI]){
  70 + $Hour_Data.="selected";
  71 + }
  72 + $Hour_Data.='>'.$Hour_List[$intI].'</option>';
  73 +}
  74 +
  75 +$Minute_List=array("--","00","30");
  76 +for ($intI=0; $intI < count($Minute_List); $intI++){
  77 + if ($intI==0){
  78 + $Minute_Data.='<option value="" ';
  79 + }else{
  80 + $Minute_Data.='<option value="'.$Minute_List[$intI].'" ';
  81 + }
  82 + if ($ReservaMinute==$Minute_List[$intI]){
  83 + $Minute_Data.="selected";
  84 + }
  85 + $Minute_Data.='>'.$Minute_List[$intI].'</option>';
  86 +}
  87 +
  88 +$o_smarty->assign('Reserva_Year' , $Reserva_Year);
  89 +$o_smarty->assign('Month_Data' , $Month_Data);
  90 +$o_smarty->assign('Day_Data' , $Day_Data);
  91 +$o_smarty->assign('Hour_Data' , $Hour_Data);
  92 +$o_smarty->assign('Minute_Data' , $Minute_Data);
  93 +
  94 +$o_smarty->display('LIST1730.tpl');
  95 +
  96 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:アラームデータDB更新
  5 +//* プログラムID:LIST1731.php
  6 +//* 機能 :アラーム内容を更新
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/jcode.phps");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +include("./include/dbcon.inc");
  18 +
  19 +//メールデータ更新
  20 +$strSQL = "UPDATE";
  21 +$strSQL .= " mail_data ";
  22 +$strSQL .= "SET ";
  23 +$strSQL .= " reserva_flg = 1, ";
  24 +$strSQL .= " reserva_date = '".$_POST["Reserva_Year"].$_POST["Reserva_Month"].$_POST["Reserva_Date"]."', ";
  25 +$strSQL .= " reserva_time = '".$_POST["Reserva_Hour"].$_POST["Reserva_Minute"]."' ";
  26 +$strSQL .= "WHERE ";
  27 +$strSQL .= " mail_id = " . $_POST["mail_id"];
  28 +$objRec = pg_exec($strSQL);
  29 +if($objRec==false){
  30 + echo("SQL実行に失敗しました(UPDATE)");
  31 + exit;
  32 +}
  33 +
  34 +?>
  35 +<HTML>
  36 +<HEAD>
  37 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  38 +<META http-equiv="Content-Style-Type" content="text/css">
  39 +<link rel="stylesheet" type="text/css" href="basefont.css">
  40 +<TITLE>ポイント購入</TITLE>
  41 +<SCRIPT LANGUAGE="JAVASCRIPT">
  42 +<!--
  43 +function load_screen(){
  44 + document.frm.action = "LIST1000.php";
  45 + document.frm.method="POST";
  46 + document.frm.submit();
  47 +}
  48 +-->
  49 +</SCRIPT>
  50 +</HEAD>
  51 +<BODY onLoad="return load_screen();">
  52 +<form name="frm">
  53 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  54 +</form>
  55 +</BODY>
  56 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:配信内容編集
  5 +//* プログラムID:LIST1740.php
  6 +//* 機能 :送信先種類を変更する
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk2.inc");
  17 +include("./include/dbcon.inc");
  18 +include("./include/jcode.phps");
  19 +
  20 +//********** ヘッダー処理 **********//
  21 +include("./include/headr_data.inc");
  22 +
  23 +//********** メイン処理 **********//
  24 +include("./include/dbcon.inc");
  25 +
  26 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  27 +
  28 +//配信情報を取得
  29 +$strSQL = "SELECT * FROM mail_data WHERE mail_id = ".(int)$_POST["mail_id"];
  30 +$objRec = pg_exec($strSQL);
  31 +if($objRec==false){
  32 + echo("SQL実行に失敗しました(SELECT)");
  33 + exit;
  34 +}
  35 +$objData = pg_fetch_object($objRec, 0);
  36 +switch ($objData->send_type) {
  37 + case "0":
  38 + $send_chk[0] = "checked";
  39 + $send_chk[1] = "";
  40 + $send_chk[2] = "";
  41 + break;
  42 +
  43 + case "1":
  44 + $send_chk[0] = "";
  45 + $send_chk[1] = "checked";
  46 + $send_chk[2] = "";
  47 + break;
  48 +
  49 + case "2":
  50 + $send_chk[0] = "";
  51 + $send_chk[1] = "";
  52 + $send_chk[2] = "checked";
  53 + break;
  54 +
  55 +}
  56 +
  57 +$o_smarty->assign('send_chk' , $send_chk);
  58 +$o_smarty->display('LIST1740.tpl');
  59 +
  60 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:メールデータDB更新
  5 +//* プログラムID:mail_edit.php
  6 +//* 機能 :配信内容内容を更新
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/jcode.phps");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +include("./include/dbcon.inc");
  18 +
  19 +//***** ユーザー回答状況 *****//
  20 +$strSQL = "SELECT ";
  21 +$strSQL .= " mail_info.mail_id , ";
  22 +$strSQL .= " syain_tbl.syain_cd , ";
  23 +$strSQL .= " syain_tbl.mail_addr , ";
  24 +$strSQL .= " syain_tbl.pc_mail_addr ";
  25 +$strSQL .= "FROM ";
  26 +$strSQL .= " mail_info ,";
  27 +$strSQL .= " syain_tbl ,";
  28 +$strSQL .= " mail_send_tbl ";
  29 +$strSQL .= "WHERE ";
  30 +$strSQL .= " mail_info.syain_cd = syain_tbl.syain_cd AND ";
  31 +$strSQL .= " mail_info.syain_cd = mail_send_tbl.syain_cd AND ";
  32 +$strSQL .= " mail_info.mail_id = ".(int)$_POST["mail_id"]." AND ";
  33 +$strSQL .= " mail_send_tbl.mail_id = ".(int)$_POST["mail_id"]." ";
  34 +$strSQL .= "GROUP BY ";
  35 +$strSQL .= " mail_info.mail_id , ";
  36 +$strSQL .= " syain_tbl.syain_cd , ";
  37 +$strSQL .= " syain_tbl.mail_addr , ";
  38 +$strSQL .= " syain_tbl.pc_mail_addr ";
  39 +$strSQL .= "ORDER BY ";
  40 +$strSQL .= " mail_info.mail_id ASC, ";
  41 +$strSQL .= " syain_tbl.syain_cd ASC, ";
  42 +$strSQL .= " syain_tbl.mail_addr ASC, ";
  43 +$strSQL .= " syain_tbl.pc_mail_addr ASC ";
  44 +//echo $strSQL;
  45 +$objRec = pg_exec($strSQL);
  46 +if($objRec==false){
  47 + echo("SQL実行に失敗しました(SELECT)");
  48 + exit;
  49 +}
  50 +for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
  51 + $objData = pg_fetch_object($objRec,$intI);
  52 +
  53 + if($_POST["SendType"]==0){
  54 + if($objData->pc_mail_addr=="" && $objData->mail_addr==""){
  55 + $Mail_Nasi=1; //PCか携帯メールアドレスが未登録の人
  56 + $SendRes = 3;
  57 + }elseif($objData->pc_mail_addr=="" && $objData->mail_addr!=""){
  58 + $SendRes = 1;
  59 + }elseif($objData->pc_mail_addr!="" && $objData->mail_addr==""){
  60 + $SendRes = 2;
  61 + }elseif($objData->pc_mail_addr!="" && $objData->mail_addr!=""){
  62 + $SendRes = 0;
  63 + }
  64 + }elseif($_POST["SendType"]==1){
  65 + if($objData->mail_addr==""){
  66 + $Mail_Nasi=1; //携帯メールアドレスが未登録の人
  67 + $SendRes = 3;
  68 + }else{
  69 + $SendRes = 1;
  70 + }
  71 + }elseif($_POST["SendType"]==2){
  72 + if($objData->pc_mail_addr==""){
  73 + $Mail_Nasi=1; //PCメールアドレスが未登録の人
  74 + $SendRes = 3;
  75 + }else{
  76 + $SendRes = 2;
  77 + }
  78 + }
  79 +
  80 + if($Mail_Nasi != 1){
  81 + $add_flg=0;
  82 + }else{
  83 + $add_flg=100;
  84 + }
  85 +
  86 + $strSQL = "UPDATE";
  87 + $strSQL .= " mail_info ";
  88 + $strSQL .= "SET ";
  89 + $strSQL .= " check_flg = ".$add_flg." ";
  90 + $strSQL .= "WHERE ";
  91 + $strSQL .= " mail_id = ".$_POST["mail_id"]." AND ";
  92 + $strSQL .= " syain_cd = ".$objData->syain_cd;
  93 + $objInsRet = pg_exec($strSQL);
  94 + if($objInsRet==false){
  95 + echo("SQL実行に失敗しました(INSERT)");
  96 + exit;
  97 + }
  98 +
  99 + //送信機種保存
  100 + $strSQL = "UPDATE";
  101 + $strSQL .= " mail_send_tbl ";
  102 + $strSQL .= "SET ";
  103 + $strSQL .= " send_flg = ".$SendRes." ";
  104 + $strSQL .= "WHERE ";
  105 + $strSQL .= " mail_id = ".$_POST["mail_id"]." AND ";
  106 + $strSQL .= " syain_cd = ".$objData->syain_cd;
  107 + $objInsRet = pg_exec($strSQL);
  108 + if($objInsRet==false){
  109 + echo("SQL実行に失敗しました(INSERT)");
  110 + exit;
  111 + }
  112 +}
  113 +
  114 +//メールデータ更新
  115 +$strSQL = "UPDATE";
  116 +$strSQL .= " mail_data ";
  117 +$strSQL .= "SET ";
  118 +$strSQL .= " send_type = ".$_POST["SendType"]." ";
  119 +$strSQL .= "WHERE ";
  120 +$strSQL .= " mail_id = " . $_POST["mail_id"];
  121 +$objRec = pg_exec($strSQL);
  122 +if($objRec==false){
  123 + echo("SQL実行に失敗しました(UPDATE)");
  124 + exit;
  125 +}
  126 +
  127 +?>
  128 +<HTML>
  129 +<HEAD>
  130 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  131 +<META http-equiv="Content-Style-Type" content="text/css">
  132 +<link rel="stylesheet" type="text/css" href="basefont.css">
  133 +<TITLE>ポイント購入</TITLE>
  134 +<SCRIPT LANGUAGE="JAVASCRIPT">
  135 +<!--
  136 +function load_screen(){
  137 + document.frm.action = "LIST1000.php";
  138 + document.frm.method="POST";
  139 + document.frm.submit();
  140 +}
  141 +-->
  142 +</SCRIPT>
  143 +</HEAD>
  144 +<BODY onLoad="return load_screen();">
  145 +<form name="frm">
  146 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  147 +</form>
  148 +</BODY>
  149 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1750.php
  6 +//* 機能 :配信内容を登録する
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk2.inc");
  17 +include("./include/jcode.phps");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** メイン処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  26 +
  27 +//表示項目名を取得
  28 +//$strSQL = "SELECT disp_id, disp_name FROM mst_disp ORDER BY disp_id";
  29 +//$objRec = pg_exec($strSQL);
  30 +//if($objRec==false){
  31 +// echo("SQL実行に失敗しました(SELECT)");
  32 +// exit;
  33 +//}
  34 +//for($intI = 0; $intI < pg_numrows($objRec) ; $intI++) {
  35 +// $objData = pg_fetch_object($objRecSet, $intI);
  36 +// $intDisp_id[$intI] = $objData->disp_id;
  37 +// $strDisp_Name[$intI] = JcodeConvert($objData->disp_name, 1, 1);
  38 +//}
  39 +
  40 +
  41 +//配信情報を取得
  42 +$strSQL = "SELECT * FROM mail_data WHERE mail_id = ".(int)$_POST["mail_id"];
  43 +$objRec = pg_exec($strSQL);
  44 +if($objRec==false){
  45 + echo("SQL実行に失敗しました(SELECT)");
  46 + exit;
  47 +}
  48 +$objData = pg_fetch_object($objRec, 0);
  49 +$subject_name = $objData->subject_name;
  50 +$contents = $objData->contents;
  51 +
  52 +$o_smarty->assign('subject_name' , $subject_name);
  53 +$o_smarty->assign('contents' , $contents);
  54 +
  55 +
  56 +$o_smarty->display('LIST1750.tpl');
  57 +
  58 +
  59 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:メールデータDB更新
  5 +//* プログラムID:LIST1750.php
  6 +//* 機能 :配信内容内容を更新
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/jcode.phps");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +include("./include/dbcon.inc");
  18 +
  19 +//***************************
  20 +//* メイン処理
  21 +//***************************
  22 +//メールデータ更新
  23 +$strSQL = "UPDATE";
  24 +$strSQL .= " mail_data ";
  25 +$strSQL .= "SET ";
  26 +$strSQL .= " subject_name = '".$_POST["subject_name"]."', ";
  27 +$strSQL .= " contents = '".$_POST["contents"]."' ";
  28 +$strSQL .= "WHERE ";
  29 +$strSQL .= " mail_id = " . $_POST["mail_id"];
  30 +$objRec = pg_exec($strSQL);
  31 +if($objRec==false){
  32 + echo("SQL実行に失敗しました(UPDATE)");
  33 + exit;
  34 +}
  35 +
  36 +?>
  37 +<HTML>
  38 +<HEAD>
  39 +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  40 +<META http-equiv="Content-Style-Type" content="text/css">
  41 +<link rel="stylesheet" type="text/css" href="basefont.css">
  42 +<TITLE>ポイント購入</TITLE>
  43 +<SCRIPT LANGUAGE="JAVASCRIPT">
  44 +<!--
  45 +function load_screen(){
  46 + document.frm.action = "LIST1000.php";
  47 + document.frm.method="POST";
  48 + document.frm.submit();
  49 +}
  50 +-->
  51 +</SCRIPT>
  52 +</HEAD>
  53 +<BODY onLoad="return load_screen();">
  54 +<form name="frm">
  55 +<INPUT type="hidden" name="mail_id" value="<?PHP echo $_POST["mail_id"]; ?>">
  56 +</form>
  57 +</BODY>
  58 +</HTML>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1760.php
  6 +//* 機能 :ユーザー情報を閲覧する
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk2.inc");
  17 +include("./include/jcode.phps");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** メイン処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +
  26 +//***************************
  27 +//* 初期処理
  28 +//***************************
  29 +$objConn = null; //接続オブジェクト
  30 +$objRecSet = null; //レコードセットオブジェクト
  31 +
  32 +$strSQL = ""; //SQL文
  33 +$intIdx = 0;
  34 +
  35 +$strYubin_no1 ="";
  36 +$strYubin_no2 ="";
  37 +$intGroup_Count = 0;
  38 +$intGroup_Id = array(); //上位グループID
  39 +$strGroup_Name = array(); //上位グループ名
  40 +$strAdmin ="f"; //管理者フラグ
  41 +$lngSyainCd = 0;
  42 +
  43 +//キーの受け渡し
  44 +$lngSyainCd = $usr_key;
  45 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  46 +
  47 +//表示名称を取得
  48 +$strSQL = "SELECT disp_id,disp_name " .
  49 + "FROM mst_disp " .
  50 + "WHERE disp_id = '2' " .
  51 + "ORDER BY disp_id DESC";
  52 +
  53 +$objRecSet = pg_exec($strSQL);
  54 +if($objRecSet==false){
  55 + echo("SQL実行に失敗しました(SELECT)");
  56 + exit;
  57 +}
  58 +
  59 +$intDisp_Count = pg_numrows($objRecSet);
  60 +$objData = pg_fetch_object($objRecSet, 0);
  61 +$strDisp_Name = JcodeConvert($objData->disp_name, 1, 1);
  62 +
  63 +$o_smarty->assign('strDisp_Name' , $strDisp_Name);
  64 +
  65 +
  66 +//上位グループを取得
  67 +$strSQL = "SELECT group_id, group_name " .
  68 + "FROM mst_group " .
  69 + "ORDER BY group_id";
  70 +
  71 +$objRecSet = pg_exec($strSQL);
  72 +if($objRecSet==false){
  73 + echo("SQL実行に失敗しました(SELECT)");
  74 + exit;
  75 +}
  76 +$intGroup_Count = pg_numrows($objRecSet);
  77 +for($intIdx = 0; $intIdx < $intGroup_Count ; $intIdx++) {
  78 + $objData = pg_fetch_object($objRecSet, $intIdx);
  79 + $intGroup_Id[$intIdx] = $objData->group_id;
  80 + $strGroup_Name[$intIdx] = JcodeConvert($objData->group_name, 1, 1);
  81 +}
  82 +
  83 +//GROUP_INFO
  84 +$strSQL = "SELECT group_info.* " .
  85 + "FROM group_info " .
  86 + "WHERE group_info.syain_cd = '" . $lngSyainCd . "' " .
  87 + "ORDER BY group_info.group_id";
  88 +
  89 +$objRecSet = pg_exec($strSQL);
  90 +if($objRecSet==false){
  91 + echo("SQL実行に失敗しました(SELECT)");
  92 + exit;
  93 +}
  94 +$intInfo_Count = pg_numrows($objRecSet);
  95 +for($intIdx = 0; $intIdx < $intInfo_Count ; $intIdx++) {
  96 + $objData = pg_fetch_object($objRecSet, $intIdx);
  97 + $intG_Info_Cd[$intIdx] = $objData->group_id;
  98 +}
  99 +//グループ名
  100 +$intJ = 0;
  101 +for($intCount = 0; $intCount < $intGroup_Count; $intCount++){
  102 + for($intIdx = 0; $intIdx < $intInfo_Count; $intIdx++){
  103 + if ($intG_Info_Cd[$intIdx]==$intGroup_Id[$intCount]){
  104 + $Group_Name[$intJ] = $strGroup_Name[$intCount]."<BR>" ;
  105 + $intJ = $intJ + 1;
  106 + break;
  107 + }
  108 + }
  109 +}
  110 +$o_smarty->assign('Group_Name' , $Group_Name);
  111 +
  112 +
  113 +//管理者フラグ取得
  114 +$strSQL = "SELECT COUNT(*) FROM mail_admin WHERE syain_cd = '" . $lngSyainCd . "'";
  115 +$objRecSet = pg_exec($strSQL);
  116 +if($objRecSet==false){
  117 + echo("SQL実行に失敗しました(INSERT)");
  118 + exit;
  119 +}
  120 +
  121 +$intDataCount = pg_fetch_array($objRecSet, 0);
  122 +if ($intDataCount[0] > 0){
  123 + $strAdmin = "t";
  124 +}
  125 +
  126 +//***************************
  127 +//* メイン処理
  128 +//***************************
  129 +
  130 +$strYear = "";
  131 +$strMonth = "";
  132 +
  133 +//ユーザー情報
  134 +$strSQL = "SELECT syain_tbl.* " .
  135 + "FROM syain_tbl " .
  136 + "WHERE syain_tbl.syain_cd = '" . $lngSyainCd . "'";
  137 +
  138 +$objRecSet = pg_exec($strSQL);
  139 +if($objRecSet==false){
  140 + echo("SQL実行に失敗しました(SELECT)");
  141 + exit;
  142 +}
  143 +$objData = pg_fetch_object($objRecSet, 0);
  144 +$strJyusyoPref=$objData->addr_pref;
  145 +
  146 +$name_kj_sei =$objData->name_kj_sei;
  147 +$name_kj_mei =$objData->name_kj_mei;
  148 +$name_kn_sei =$objData->name_kn_sei;
  149 +$name_kn_mei =$objData->name_kn_mei;
  150 +$sei =$objData->sex;
  151 +if($sei == "t"){
  152 + $sei = "男";
  153 +}else{
  154 + $sei = "女";
  155 +}
  156 +$yubin_no = ($objData->yubin_no);
  157 +if ($yubin_no == "NULL"){
  158 + $strYubin_no1 = "";
  159 + $strYubin_no2 = "";
  160 +}else{
  161 + $strYubin_no1=substr($objData->yubin_no, 0 , 3);
  162 + $strYubin_no2=substr($objData->yubin_no, 3 , 4);
  163 +}
  164 +
  165 +$addr_city = $objData->addr_city;
  166 +$addr_banti = $objData->addr_banti;
  167 +$addr_apart =$objData->addr_apart;
  168 +$tel_no =$objData->tel_no;
  169 +$keitai_no =$objData->keitai_no;
  170 +$mail_addr =$objData->mail_addr;
  171 +$pc_mail_addr =$objData->pc_mail_addr;
  172 +
  173 +$o_smarty->assign('strJyusyoPref' , $strJyusyoPref);
  174 +$o_smarty->assign('name_kj_sei' , $name_kj_sei);
  175 +$o_smarty->assign('name_kj_mei' , $name_kj_mei);
  176 +$o_smarty->assign('name_kn_sei' , $name_kn_sei);
  177 +$o_smarty->assign('name_kn_mei' , $name_kn_mei);
  178 +$o_smarty->assign('sei' , $sei);
  179 +$o_smarty->assign('strYubin_no1' , $strYubin_no1);
  180 +$o_smarty->assign('strYubin_no2' , $strYubin_no2);
  181 +$o_smarty->assign('addr_city' , $addr_city);
  182 +$o_smarty->assign('addr_banti' , $addr_banti);
  183 +$o_smarty->assign('addr_apart' , $addr_apart);
  184 +$o_smarty->assign('tel_no' , $tel_no);
  185 +$o_smarty->assign('keitai_no' , $keitai_no);
  186 +$o_smarty->assign('mail_addr' , $mail_addr);
  187 +$o_smarty->assign('pc_mail_addr' , $pc_mail_addr);
  188 +
  189 +
  190 +//メモ情報取得
  191 +$strSQL = "SELECT syain_biko_tbl.biko " .
  192 + "FROM syain_biko_tbl " .
  193 + "WHERE syain_biko_tbl.syain_cd = '" . $lngSyainCd . "'";
  194 +
  195 +$objRecSet = pg_exec($strSQL);
  196 +if($objRecSet==false){
  197 + echo("SQL実行に失敗しました(SELECT)");
  198 + exit;
  199 +}
  200 +
  201 +if (pg_numrows($objRecSet)>0){
  202 + $objBiko = pg_fetch_object($objRecSet, 0);
  203 + $biko=nl2br($objBiko->biko);
  204 +}else{
  205 + $biko="";
  206 +}
  207 +$o_smarty->assign('biko' , $biko);
  208 +
  209 +$o_smarty->display('LIST1760.tpl');
  210 +
  211 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1801.php
  6 +//* 機能 :配信情報(削除)
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/jcode.phps");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +include("./include/dbcon.inc");
  18 +
  19 +//メール件数選択
  20 +$strSQL = "SELECT * FROM mail_info WHERE mail_id = '" . $_POST["mail_id"] . "'";
  21 +$objRecSet = pg_exec($strSQL);
  22 +if($objRecSet==false){
  23 + echo("SQL実行に失敗しました(DELETE)");
  24 + exit;
  25 +}
  26 +$intDataCount = pg_numrows($objRecSet);
  27 +
  28 +//後日配信確認
  29 +$strSQL = "SELECT reserva_flg FROM Mail_data WHERE mail_id = '" . $_POST["mail_id"] . "'";
  30 +$objRecSet = pg_exec($strSQL);
  31 +if($objRecSet==false){
  32 + echo("SQL実行に失敗しました(DELETE)");
  33 + exit;
  34 +}
  35 +$reserva_flg = pg_result($objRecSet,0,"reserva_flg");
  36 +
  37 +$strSQL = "DELETE FROM mail_data WHERE mail_data.mail_id = '" . $_POST["mail_id"] . "'";
  38 +$objRecSet = pg_exec($strSQL);
  39 +if($objRecSet==false){
  40 + echo("SQL実行に失敗しました(DELETE)");
  41 + exit;
  42 +}
  43 +
  44 +//アラームデータ削除
  45 +$strSQL = "DELETE FROM alarm_data WHERE alarm_data.mail_id = '" . $_POST["mail_id"] . "'";
  46 +$objRecSet = pg_exec($strSQL);
  47 +if($objRecSet==false){
  48 + echo("SQL実行に失敗しました(DELETE)");
  49 + exit;
  50 +}
  51 +
  52 +//メールINFO削除
  53 +$strSQL = "DELETE FROM mail_info WHERE mail_info.mail_id = '" . $_POST["mail_id"] . "'";
  54 +$objRecSet = pg_exec($strSQL);
  55 +if($objRecSet==false){
  56 + echo("SQL実行に失敗しました(DELETE)");
  57 + exit;
  58 +}
  59 +
  60 +//メール回答情報削除
  61 +$strSQL = "DELETE FROM answer_data WHERE answer_data.mail_id = '" . $_POST["mail_id"] . "'";
  62 +$objRecSet = pg_exec($strSQL);
  63 +if($objRecSet==false){
  64 + echo("SQL実行に失敗しました(DELETE)");
  65 + exit;
  66 +}
  67 +
  68 +//既読・未読自動配信情報削除
  69 +$strSQL = "DELETE FROM kidok_data WHERE kidok_data.mail_id = '" . $_POST["mail_id"] . "'";
  70 +$objRecSet = pg_exec($strSQL);
  71 +if($objRecSet==false){
  72 + echo("SQL実行に失敗しました(DELETE)");
  73 + exit;
  74 +}
  75 +
  76 +//配信機種情報削除
  77 +$strSQL = "DELETE FROM mail_send_tbl WHERE mail_send_tbl.mail_id = '" . $_POST["mail_id"] . "'";
  78 +$objRecSet = pg_exec($strSQL);
  79 +if($objRecSet==false){
  80 + echo("SQL実行に失敗しました(DELETE)");
  81 + exit;
  82 +}
  83 +
  84 +//メールポイント復元
  85 +if($reserva_flg==1){
  86 + $hostname="localhost";
  87 + $database="post_kanri";
  88 +
  89 + if( !$pg_con2=pg_connect("host=$hostname dbname=$database user=pgsqladmin password=pgsqladmin") ) {
  90 + print "Error : connect to ${hostname}<br>";
  91 + exit;
  92 + }
  93 + $strSQL = "SELECT use_point,max_point " .
  94 + "FROM point_tbl " .
  95 + "WHERE user_id = '".$PHP_POST_SYAIN_ID."'";
  96 + $objRecSet = pg_exec($strSQL);
  97 + if($objRecSet==false){
  98 + echo("SQL実行に失敗しました(DELETE)");
  99 + exit;
  100 + }
  101 + $use_point = pg_result($objRecSet,0,"use_point");
  102 + $max_point = pg_result($objRecSet,0,"max_point");
  103 +
  104 + if($max_point < 1000){
  105 + $use_point = $use_point + $intDataCount;
  106 + $max_point = $max_point - $intDataCount;
  107 + $strSQL = "Update point_tbl Set use_point=".$use_point." ,max_point=".$max_point." where user_id='".$PHP_POST_SYAIN_ID."'";
  108 +
  109 + $objRecSet = pg_exec($strSQL);
  110 + if($objRecSet==false){
  111 + echo("SQL実行に失敗しました(DELETE)");
  112 + exit;
  113 + }
  114 + }
  115 +}
  116 +
  117 +if($backFlg!=1){
  118 + header("Location:LIST0000.php");
  119 +}else{
  120 + header("Location:LIST0000.php");
  121 +}
  122 +
  123 +?>
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST1901.php
  6 +//* 機能 :CSVファイルにデータを吐き出す
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/jcode.phps");
  15 +include("./include/session_start.inc");
  16 +include("./include/SessionChk.inc");
  17 +include("./include/dbcon.inc");
  18 +
  19 +//********** 表示項目 ************//
  20 +$strSQL = "SELECT Disp_id,Disp_name FROM Mst_disp ORDER BY Disp_id ASC";
  21 +$objRecSet1 = pg_exec($strSQL);
  22 +if($objRecSet1==false){
  23 + echo("SQL実行に失敗しました(SELECT)");
  24 + exit;
  25 +}
  26 +$strKenmei = pg_result($objRecSet1,2,"Disp_name");
  27 +
  28 +//********** 回答文言 ************//
  29 +$strSQL = "SELECT * FROM answer_data WHERE mail_id = " . $_POST["mail_id"];
  30 +$objRecSet2 = pg_exec($strSQL);
  31 +if($objRecSet2==false){
  32 + echo("SQL実行に失敗しました(SELECT)");
  33 + exit;
  34 +}
  35 +if(pg_numrows($objRecSet2)!=0){
  36 + $objData = pg_fetch_object($objRecSet2,0);
  37 + $select_cnt=$objData->select_nm;
  38 + $SYORI_MODE = $objData->name50_nm;
  39 +
  40 + for($intIdx = 1; $intIdx <= $objData->select_nm; $intIdx++){
  41 + $name_id[$intIdx]=pg_result($objRecSet2, 0, "name" . $intIdx . "_id");
  42 + $name_nm[$intIdx]=pg_result($objRecSet2, 0, "name" . $intIdx . "_nm");
  43 + }
  44 +}else{
  45 + $select_cnt=0;
  46 +}
  47 +
  48 +//********** 配信情報 ************//
  49 +$strSQL = "SELECT Message_date, Message_time, Subject_name, Contents, Admin_cd, send_date, send_alarm, send_type, " .
  50 + "reserva_flg, reserva_date, reserva_time FROM Mail_data WHERE Mail_id = " . (int)$_POST["mail_id"];
  51 +$objRecSet3 = pg_exec($strSQL);
  52 +if($objRecSet3==false){
  53 + echo("SQL実行に失敗しました(SELECT)");
  54 + exit;
  55 +}
  56 +$intDataCount = pg_numrows($objRecSet3);
  57 +$Mail_date = pg_result($objRecSet3,0,"Message_date");
  58 +$Mail_time = pg_result($objRecSet3,0,"Message_time");
  59 +$Subject_name = pg_result($objRecSet3,0,"Subject_name");
  60 +$Contents = pg_result($objRecSet3,0,"Contents");
  61 +$Admin_cd = pg_result($objRecSet3,0,"Admin_cd");
  62 +$send_date = pg_result($objRecSet3,0,"send_date");
  63 +$Send_alarm = pg_result($objRecSet3,0,"send_alarm");
  64 +$send_type = pg_result($objRecSet3,0,"send_type");
  65 +$reserva_flg = pg_result($objRecSet3,0,"reserva_flg");
  66 +$reserva_date = pg_result($objRecSet3,0,"reserva_date");
  67 +$reserva_time = pg_result($objRecSet3,0,"reserva_time");
  68 +
  69 +//********** 既読・未読自動再送情報 ************//
  70 +$Auto_Name="";
  71 +$strSQL = "SELECT * FROM kidok_data WHERE mail_id = " . (int)$_POST["mail_id"] . " ORDER BY kidok_data.check_id";
  72 +$objRecSet4 = pg_exec($strSQL);
  73 +if($objRecSet4==false){
  74 + echo("SQL実行に失敗しました(SELECT)");
  75 + exit;
  76 +}
  77 +$intKidokCount = pg_numrows($objRecSet4);
  78 +if($intKidokCount!=0){
  79 + $Kidok_date = pg_result($objRecSet4,0,"Message_date");
  80 + $Kidok_time = pg_result($objRecSet4,0,"Message_time");
  81 + $Send_flg = pg_result($objRecSet4,0,"send_flg");
  82 +}
  83 +
  84 +//********** グループ情報 ************//
  85 +$strSQL = "SELECT group_info.syain_cd,group_info.group_id,mst_group.group_name FROM group_info,mst_group " .
  86 + "WHERE group_info.group_id = mst_group.group_id ORDER BY group_info.syain_cd";
  87 +$objRecSet5 = pg_exec($strSQL);
  88 +if($objRecSet5==false){
  89 + echo("SQL実行に失敗しました(SELECT)");
  90 + exit;
  91 +}
  92 +$intInfo_Count = pg_numrows($objRecSet5);
  93 +
  94 +for($intIdx = 0; $intIdx < $intInfo_Count ; $intIdx++) {
  95 + $objData = pg_fetch_object($objRecSet5, $intIdx);
  96 + $intInfo_Cd[$intIdx] = $objData->syain_cd;
  97 + $strGroup_Name[$intIdx] = JcodeConvert($objData->group_name, 1, 1);
  98 +}
  99 +
  100 +//********** ユーザ情報 ************//
  101 +$strSQL = "SELECT Name_kj_sei, Name_kj_mei FROM Syain_tbl WHERE Syain_cd = " . $Admin_cd . " ORDER BY Syain_id ASC";
  102 +$objRecSet6 = pg_exec($strSQL);
  103 +if($objRecSet6==false){
  104 + echo("SQL実行に失敗しました(SELECT)");
  105 + exit;
  106 +}
  107 +$intDataCount = pg_numrows($objRecSet6);
  108 +$Admin_sei = pg_result($objRecSet6,0,"Name_kj_sei");
  109 +$Admin_mei = pg_result($objRecSet6,0,"Name_kj_mei");
  110 +
  111 +//********** 個人別回答内容 ************//
  112 +$Mcnt=0;
  113 +$Kcnt=0;
  114 +$Ncnt=0;
  115 +$Scnt=0;
  116 +$strSQL = "SELECT Mail_info.Check_flg, Mail_info.Kousin, Mail_info.comment, Syain_tbl.Syain_id, Syain_tbl.Syain_cd, Syain_tbl.Name_kj_sei, Syain_tbl.Name_kj_mei, " .
  117 + "Syain_tbl.mail_addr, Syain_tbl.pc_mail_addr, mail_send_tbl.send_flg FROM (Mail_info left join Syain_tbl on Mail_info.Syain_cd = Syain_tbl.Syain_cd) " .
  118 + "left join mail_send_tbl on Mail_info.Mail_id = mail_send_tbl.Mail_id and Mail_info.Syain_cd = mail_send_tbl.Syain_cd ".
  119 + "WHERE Mail_info.Mail_id = " . (int)$_POST["mail_id"] . " ORDER BY Mail_info.check_flg , Syain_tbl.name_kn_sei, Syain_tbl.name_kn_mei, Syain_tbl.Syain_cd ASC";
  120 +$objRecSet7 = pg_exec($strSQL);
  121 +if($objRecSet7==false){
  122 + echo("SQL実行に失敗しました(SELECT)");
  123 + exit;
  124 +}
  125 +$intDataCount7 = pg_numrows($objRecSet7);
  126 +for($intIdx = 1; $intIdx <= $select_cnt; $intIdx++){
  127 + $Cnt[$intIdx]=0;
  128 +}
  129 +for ($intCount = 0; $intCount < $intDataCount7; $intCount++) {
  130 + $Syain_id[$intCount] = pg_result($objRecSet7,$intCount,"Syain_id");
  131 + $Syain_cd[$intCount] = pg_result($objRecSet7,$intCount,"Syain_cd");
  132 + $Name_kj_sei[$intCount] = pg_result($objRecSet7,$intCount,"Name_kj_sei");
  133 + $Name_kj_mei[$intCount] = pg_result($objRecSet7,$intCount,"Name_kj_mei");
  134 + $mail_addr[$intCount] = pg_result($objRecSet7,$intCount,"mail_addr");
  135 + $pc_mail_addr[$intCount] = pg_result($objRecSet7,$intCount,"pc_mail_addr");
  136 + $Check_flg[$intCount] = pg_result($objRecSet7,$intCount,"Check_flg");
  137 + $Send_flg[$intCount] = pg_result($objRecSet7,$intCount,"send_flg");
  138 + //件数カウント
  139 + if(pg_result($objRecSet7,$intCount,"Check_flg")==0){
  140 + $Mcnt=$Mcnt + 1;
  141 + }elseif(pg_result($objRecSet7,$intCount,"Check_flg")==98){
  142 + $Scnt=$Scnt + 1;
  143 + }elseif(pg_result($objRecSet7,$intCount,"Check_flg")==99){
  144 + $Kcnt=$Kcnt + 1;
  145 + }elseif(pg_result($objRecSet7,$intCount,"Check_flg")==100){
  146 + $Ncnt=$Ncnt + 1;
  147 + }else{
  148 + for($intIdx = 1; $intIdx <= $select_cnt; $intIdx++){
  149 + if($name_id[$intIdx]==pg_result($objRecSet7,$intCount,"Check_flg")){
  150 + $Cnt[$intIdx]=$Cnt[$intIdx] + 1;
  151 + break;
  152 + }
  153 + }
  154 + }
  155 + $Kousin[$intCount] = pg_result($objRecSet7,$intCount,"Kousin");
  156 + $Comment[$intCount] = pg_result($objRecSet7,$intCount,"comment");
  157 +}
  158 +
  159 +//********** 回答期限 ************//
  160 +$strSQL="SELECT * FROM res_time_tbl WHERE mail_id = " . (int)$_POST["mail_id"] . " ORDER BY mail_id";
  161 +$objRecSet8 = pg_exec($strSQL);
  162 +if($objRecSet8==false){
  163 + echo("SQL実行に失敗しました(UPDATE)");
  164 + exit;
  165 +}
  166 +if(pg_numrows($objRecSet8)!=0){
  167 + $objData = pg_fetch_object($objRecSet8, 0);
  168 + $d1 = mktime (substr($objData->date,8,2), substr($objData->date,10,2) , 0 , substr($objData->date,4,2), substr($objData->date,6,2), substr($objData->date,0,4));
  169 + $strlimit_date=date("Y年m月d日 H時i分",$d1)."まで";
  170 + $limit_date = $objData->date;
  171 + $NowDate = date("YmdHi",mktime(date("H"),date("i"),0,(date("m")),date("d"),date("Y")));
  172 +}else{
  173 + $limit_date = "1";
  174 + $strlimit_date="設定なし";
  175 + $NowDate = "0";
  176 +}
  177 +
  178 +//********** ファイル作成 ************//
  179 +$strWk = str_replace("/","",$Subject_name);
  180 +$strWk = str_replace("|","",$strWk);
  181 +$strWk = str_replace("<","",$strWk);
  182 +$strWk = str_replace(">","",$strWk);
  183 +$strWk = str_replace("?","",$strWk);
  184 +$strWk = str_replace(":","",$strWk);
  185 +$strWk = str_replace(";","",$strWk);
  186 +$strWk = str_replace("*","",$strWk);
  187 +$strWk = str_replace("$","",$strWk);
  188 +$strWk = str_replace("&","",$strWk);
  189 +$strWk = str_replace("%","",$strWk);
  190 +$strWk = str_replace("_","",$strWk);
  191 +$strWk = str_replace(chr(92),"",$strWk);
  192 +$strWk = str_replace(chr(34),"",$strWk);
  193 +
  194 +
  195 +$filename = str_replace(chr(35),"",$strWk);
  196 +$filename = "め〜るNiポン!(".$strWk.").csv";
  197 +//ブラウザ判定
  198 +$Agent = getenv( "HTTP_USER_AGENT" );
  199 +if( ereg( "MSIE", $Agent ) ){
  200 + $filename = JcodeConvert($filename, 1, 2);
  201 +} elseif( ereg( "Firefox", $Agent ) ) {
  202 +} elseif( ereg( "Safari", $Agent ) ) {
  203 +} else {
  204 + $filename = JcodeConvert($filename, 1, 2);
  205 +}
  206 +Header("Content-Disposition: attachment; filename=\"$filename\"");
  207 +Header("Content-Type: text/csv");
  208 +session_start();
  209 +
  210 +//********** 配信情報 ************//
  211 +//ヘッダー行出力
  212 +$strWk="【配信情報】";
  213 +echo JcodeConvert($strWk, 1, 2);
  214 +echo "\n";
  215 +//自動再配信日
  216 +$strWk="自動再配信";
  217 +echo JcodeConvert($strWk, 1, 2);
  218 +echo ",";
  219 +if($intKidokCount>0){
  220 + $strWk=substr($Kidok_date,0,4)."年".substr($Kidok_date,4,2)."月".substr($Kidok_date,6,2)."日 ".substr($Kidok_time,0,2)."時".substr($Kidok_time,2,2)."分";
  221 + echo JcodeConvert($strWk, 1, 2);
  222 + if($Send_flg==1){
  223 + $strWk=" 送信済み";
  224 + echo JcodeConvert($strWk, 1, 2);
  225 + }else{
  226 + $strWk=" 設定済み";
  227 + echo JcodeConvert($strWk, 1, 2);
  228 + }
  229 +}else{
  230 + $strWk="未設定";
  231 + echo JcodeConvert($strWk, 1, 2);
  232 +}
  233 +echo "\n";
  234 +//配信日時
  235 +$strWk="配信日時";
  236 +echo JcodeConvert($strWk, 1, 2);
  237 +echo ",";
  238 +if($reserva_date!=""){
  239 + $strWk=substr($reserva_date,0,4)."年".substr($reserva_date,4,2)."月".substr($reserva_date,6,2)."日 ".substr($reserva_time,0,2)."時".substr($reserva_time,2,2)."分";
  240 + echo JcodeConvert($strWk, 1, 2);
  241 +}else{
  242 + if($reserva_flg!=1){
  243 + $strWk=substr($send_date,0,4)."年".substr($send_date,4,2)."月".substr($send_date,6,2)."日 ".substr($send_date,8,2)."時".substr($send_date,10,2)."分";
  244 + echo JcodeConvert($strWk, 1, 2);
  245 + }
  246 +}
  247 +if($reserva_flg!=1){
  248 + $strWk=" 配信済み";
  249 + echo JcodeConvert($strWk, 1, 2);
  250 +}else{
  251 + $strWk=" 配信予定";
  252 + echo JcodeConvert($strWk, 1, 2);
  253 + if($reserva_date==""){
  254 + $strWk=" なし";
  255 + echo JcodeConvert($strWk, 1, 2);
  256 + }
  257 +}
  258 +echo "\n";
  259 +//作成者
  260 +$strWk="作成者";
  261 +echo JcodeConvert($strWk, 1, 2);
  262 +echo ",";
  263 +$strWk=$Admin_sei." ".$Admin_mei;
  264 +echo JcodeConvert($strWk, 1, 2);
  265 +echo "\n";
  266 +//開催日時
  267 +$strWk="開催日時";
  268 +echo JcodeConvert($strWk, 1, 2);
  269 +echo ",";
  270 +if(intval(substr($Mail_date,4,2))!=0 && intval(substr($Mail_date,6,2))!=0){
  271 + //日付
  272 + $strWk=substr($Mail_date,0,4)."年".substr($Mail_date,4,2)."月".substr($Mail_date,6,2)."日 ";
  273 + echo JcodeConvert($strWk, 1, 2);
  274 +}
  275 +if(mb_strlen($Mail_time)>0){
  276 + //時
  277 + $strWk=substr($Mail_time,0,2);
  278 + echo JcodeConvert($strWk, 1, 2);
  279 + $strWk="時";
  280 + echo JcodeConvert($strWk, 1, 2);
  281 +}
  282 +if(mb_strlen($Mail_time)>2){
  283 + //分
  284 + $strWk=substr($Mail_time,2,2);
  285 + echo JcodeConvert($strWk, 1, 2);
  286 + $strWk="分";
  287 + echo JcodeConvert($strWk, 1, 2);
  288 +}
  289 +echo "\n";
  290 +//送信先種類
  291 +$strWk="送信先種類";
  292 +echo JcodeConvert($strWk, 1, 2);
  293 +echo ",";
  294 +if($send_type==0){
  295 + $strWk="携帯/PC";
  296 + echo JcodeConvert($strWk, 1, 2);
  297 +}elseif($send_type==1){
  298 + $strWk="携帯";
  299 + echo JcodeConvert($strWk, 1, 2);
  300 +}elseif($send_type==2){
  301 + $strWk="PC";
  302 + echo JcodeConvert($strWk, 1, 2);
  303 +}
  304 +echo "\n";
  305 +//回答期限
  306 +$strWk="回答期限";
  307 +echo JcodeConvert($strWk, 1, 2);
  308 +echo ",";
  309 +echo JcodeConvert($strlimit_date, 1, 2);
  310 +echo "\n";
  311 +//件名
  312 +echo JcodeConvert($strKenmei, 1, 2);
  313 +echo ",";
  314 +if($Subject_name != ""){
  315 + $strWk = str_replace(",",",",$Subject_name);
  316 + $strWk = str_replace(chr(34)," ",$strWk);
  317 + echo JcodeConvert($strWk, 1, 2);
  318 +}
  319 +echo "\n";
  320 +//内容
  321 +$strWk="内容";
  322 +echo JcodeConvert($strWk, 1, 2);
  323 +echo ",";
  324 +if($Contents != ""){
  325 + $strWk = str_replace(chr(34),"”",$Contents);
  326 + $strWk = chr(34) .$strWk. chr(34) ;
  327 + $strWk = str_replace(",",",",$strWk);
  328 + echo JcodeConvert($strWk, 1, 2);
  329 +}
  330 +echo "\n";
  331 +echo "\n";
  332 +
  333 +//********** 閲覧状況 ************//
  334 +//タイトル
  335 +$strWk="【閲覧状況】";
  336 +echo JcodeConvert($strWk, 1, 2);
  337 +echo "\n";
  338 +//件数
  339 +$strWk="アドレス未設定";
  340 +echo JcodeConvert($strWk, 1, 2);
  341 +echo ",";
  342 +echo JcodeConvert($Ncnt, 1, 2);
  343 +$strWk="件";
  344 +echo JcodeConvert($strWk, 1, 2);
  345 +echo "\n";
  346 +
  347 +if($SYORI_MODE =="DM"){
  348 + $strWk="送信済み";
  349 + echo JcodeConvert($strWk, 1, 2);
  350 + echo ",";
  351 + echo JcodeConvert($Scnt, 1, 2);
  352 + $strWk="件";
  353 + echo JcodeConvert($strWk, 1, 2);
  354 + echo "\n";
  355 +}else{
  356 + $strWk="未読";
  357 + echo JcodeConvert($strWk, 1, 2);
  358 + echo ",";
  359 + echo JcodeConvert($Mcnt, 1, 2);
  360 + $strWk="件";
  361 + echo JcodeConvert($strWk, 1, 2);
  362 + echo "\n";
  363 +
  364 + $strWk="既読";
  365 + echo JcodeConvert($strWk, 1, 2);
  366 + echo ",";
  367 + echo JcodeConvert($Kcnt, 1, 2);
  368 + $strWk="件";
  369 + echo JcodeConvert($strWk, 1, 2);
  370 + echo "\n";
  371 + for($intIdx = 1; $intIdx <= $select_cnt; $intIdx++){
  372 + echo JcodeConvert($name_nm[$intIdx], 1, 2);
  373 + echo ",";
  374 + echo JcodeConvert($Cnt[$intIdx], 1, 2);
  375 + $strWk="件";
  376 + echo JcodeConvert($strWk, 1, 2);
  377 + echo "\n";
  378 +
  379 + }
  380 +
  381 +}
  382 +echo "\n";
  383 +echo "\n";
  384 +
  385 +//********** 個人回答状況 ************//
  386 +//タイトル
  387 +$strWk="【個人回答状況】";
  388 +echo JcodeConvert($strWk, 1, 2);
  389 +echo "\n";
  390 +//項目
  391 +$strWk="氏名,グループ,閲覧,確認日付,確認時間,コメント,送信先";
  392 +echo JcodeConvert($strWk, 1, 2);
  393 +echo "\n";
  394 +//詳細データ出力
  395 +for ($i = 0; $i < $intDataCount7; $i++){
  396 + //社員名
  397 + $strWk=$Name_kj_sei[$i]." ".$Name_kj_mei[$i];
  398 + echo JcodeConvert($strWk, 1, 2);
  399 + echo ",";
  400 + //グループ名
  401 + $strGname="";
  402 + for($intCount1 = 0; $intCount1 < $intInfo_Count; $intCount1++){
  403 + if ($Syain_cd[$i] == $intInfo_Cd[$intCount1]){
  404 + if ($strGname==""){
  405 + $strGname = $strGroup_Name[$intCount1];
  406 + }else{
  407 + $strGname = $strGname . "\r\n" . $strGroup_Name[$intCount1];
  408 + }
  409 + }
  410 + }
  411 + $strGname = chr(34) . $strGname . chr(34);
  412 + echo JcodeConvert($strGname, 1, 2);
  413 + echo ",";
  414 + //閲覧状況
  415 + if($Check_flg[$i] == 0){
  416 + $strWk="未読";
  417 + echo JcodeConvert($strWk, 1, 2);
  418 + }else if($Check_flg[$i] == 98){
  419 + $strWk="送信済み";
  420 + echo JcodeConvert($strWk, 1, 2);
  421 + }else if($Check_flg[$i] == 99){
  422 + $strWk="既読";
  423 + echo JcodeConvert($strWk, 1, 2);
  424 + }else if($Check_flg[$i] == 100){
  425 + if($send_type == 0){
  426 + if($mail_addr[$i]!="" || $pc_mail_addr[$i]!=""){
  427 + $strWk="未送信";
  428 + echo JcodeConvert($strWk, 1, 2);
  429 + }else{
  430 + $strWk="アドレス無";
  431 + echo JcodeConvert($strWk, 1, 2);
  432 + }
  433 + }elseif($send_type == 1){
  434 + if($mail_addr[$i]!=""){
  435 + $strWk="未送信";
  436 + echo JcodeConvert($strWk, 1, 2);
  437 + }else{
  438 + $strWk="アドレス無";
  439 + echo JcodeConvert($strWk, 1, 2);
  440 + }
  441 + }elseif($send_type == 2){
  442 + if($pc_mail_addr[$i]!=""){
  443 + $strWk="未送信";
  444 + echo JcodeConvert($strWk, 1, 2);
  445 + }else{
  446 + $strWk="アドレス無";
  447 + echo JcodeConvert($strWk, 1, 2);
  448 + }
  449 + }else{
  450 + $strWk="アドレス無";
  451 + echo JcodeConvert($strWk, 1, 2);
  452 + }
  453 + }else{
  454 + for ($j = 0; $j <= $select_cnt; $j++){
  455 + if($name_id[$j] == $Check_flg[$i]){
  456 + echo JcodeConvert($name_nm[$j], 1, 2);
  457 + }
  458 + }
  459 + }
  460 + echo ",";
  461 + //更新日時
  462 + if($Kousin[$i] != ""){
  463 + //日付
  464 + $strWk=chr(34) .substr($Kousin[$i],0,4) . "/". substr($Kousin[$i],4,2) . "/" . substr($Kousin[$i],6,2) . chr(34);
  465 + echo JcodeConvert($strWk, 1, 2);
  466 + echo ",";
  467 + //時間
  468 + $strWk=chr(34) .substr($Kousin[$i],8,2) .":" . substr($Kousin[$i],10,2) .chr(34);
  469 + echo JcodeConvert($strWk, 1, 2);
  470 + }else{
  471 + echo ",";
  472 + }
  473 + echo ",";
  474 + //コメント
  475 + if($Comment[$i] != ""){
  476 + $strWk = str_replace(chr(34),"”",$Comment[$i]);
  477 + $strWk = chr(34) .$strWk. chr(34) ;
  478 + $strWk = str_replace(",",",",$strWk);
  479 + echo JcodeConvert($strWk, 1, 2);
  480 + }
  481 + echo ",";
  482 + //送信先
  483 + if($send_type==0){
  484 + $strWk="携帯/PC";
  485 + echo JcodeConvert($strWk, 1, 2);
  486 + }elseif($send_type==1){
  487 + $strWk="携帯";
  488 + echo JcodeConvert($strWk, 1, 2);
  489 + }elseif($send_type==2){
  490 + $strWk="PC";
  491 + echo JcodeConvert($strWk, 1, 2);
  492 + }
  493 + echo "\n";
  494 +}
  495 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:め〜るNiポン!V2
  5 +//* プログラムID:LIST2000.php
  6 +//* 機能 :配信した情報を表示する
  7 +//*
  8 +//*****************************************************************************
  9 +header("Content-type: text/html; charset=EUC-JP");
  10 +
  11 +//***************************
  12 +//* インクルードファイル
  13 +//***************************
  14 +include("./include/smarty.conf");
  15 +include("./include/jcode.phps");
  16 +include("./include/session_start.inc");
  17 +include("./include/SessionChk.inc");
  18 +
  19 +//********** ヘッダー処理 **********//
  20 +include("./include/headr_data.inc");
  21 +
  22 +//********** メイン処理 **********//
  23 +include("./include/dbcon.inc");
  24 +
  25 +$o_smarty->assign('mail_id' , $_POST["mail_id"]);
  26 +
  27 +//表示項目を取得
  28 +$strSQL = "SELECT * FROM Mst_disp ORDER BY Mst_disp.Disp_id ASC";
  29 +$objRecSet = pg_exec($strSQL);
  30 +if($objRecSet==false){
  31 + echo("SQL実行に失敗しました(SELECT)a");
  32 + exit;
  33 +}
  34 +$strGroup = pg_result($objRecSet,1,"Disp_name");
  35 +$strKenmei = pg_result($objRecSet,2,"Disp_name");
  36 +
  37 +//***** メール配信情報 *****//
  38 +//*** 配信情報を取得 ***//
  39 +$strSQL = "SELECT ";
  40 +$strSQL .= " * ";
  41 +$strSQL .= "FROM ";
  42 +$strSQL .= " mail_data ";
  43 +$strSQL .= "WHERE ";
  44 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"];
  45 +$objRec = pg_exec($strSQL);
  46 +if($objRec==false){
  47 + echo("SQL実行に失敗しました(SELECT)");
  48 + exit;
  49 +}
  50 +
  51 +$objData = pg_fetch_object($objRec, 0);
  52 +$angou_id = $objData->angou_id;
  53 +
  54 +$message_date = $objData->message_date;
  55 +$message_time = $objData->message_time;
  56 +
  57 +if (trim($message_date)!=""){
  58 + $Kaisai_Date = substr($message_date,0,4)."年";
  59 + $Kaisai_Date .= intval(substr($message_date,4,2))."月";
  60 + $Kaisai_Date .= intval(substr($message_date,6,2))."日";
  61 + if ($message_time!=""){
  62 + $Kaisai_Date .= intval(substr($message_time,0,2)) . "時";
  63 + $Kaisai_Date .= intval(substr($message_time,2,2)) . "分";
  64 + }
  65 +}else{
  66 + $Kaisai_Date = "未設定";
  67 +}
  68 +
  69 +$subject_name = htmlspecialchars($objData->subject_name);
  70 +$contents = nl2br(htmlspecialchars($objData->contents));
  71 +$contentsSC = htmlspecialchars($objData->contents);
  72 +$admin_cd = $objData->admin_cd;
  73 +$send_date = $objData->send_date;
  74 +$send_alarm = $objData->send_alarm;
  75 +switch ($objData->send_type) {
  76 + case "0": $send_type = "携帯/PC"; break;
  77 + case "1": $send_type = "携帯"; break;
  78 + case "2": $send_type = "PC"; break;
  79 +}
  80 +$int_send_type = $objData->send_type;
  81 +$reserva_flg = $objData->reserva_flg;
  82 +$reserva_date = $objData->reserva_date;
  83 +$reserva_time = $objData->reserva_time;
  84 +
  85 +if($reserva_date!=""){
  86 + $Send_Data = substr($reserva_date,0,4)."年";
  87 + $Send_Data .= substr($reserva_date,4,2)."月";
  88 + $Send_Data .= substr($reserva_date,6,2)."日";
  89 + $Send_Data .= substr($reserva_time,8,2)."時";
  90 + $Send_Data .= substr($reserva_time,10,2)."分";
  91 +}else{
  92 + if($reserva_flg!=1){
  93 + $Send_Data = substr($send_date,0,4)."年";
  94 + $Send_Data .= substr($send_date,4,2)."月";
  95 + $Send_Data .= substr($send_date,6,2)."日";
  96 + $Send_Data .= substr($send_date,8,2)."時";
  97 + $Send_Data .= substr($send_date,10,2)."分";
  98 + }
  99 +}
  100 +
  101 +$o_smarty->assign('message_date' , $message_date);
  102 +$o_smarty->assign('message_time' , $message_time);
  103 +$o_smarty->assign('Kaisai_Date' , $Kaisai_Date);
  104 +$o_smarty->assign('subject_name' , $subject_name);
  105 +$o_smarty->assign('contents' , $contents);
  106 +$o_smarty->assign('send_type' , $send_type);
  107 +$o_smarty->assign('int_send_type' , $int_send_type);
  108 +$o_smarty->assign('reserva_flg' , $reserva_flg);
  109 +$o_smarty->assign('reserva_date' , $reserva_date);
  110 +$o_smarty->assign('reserva_time' , $reserva_time);
  111 +$o_smarty->assign('Send_Data' , $Send_Data);
  112 +
  113 +//*** アラーム ***
  114 +$Al_Set_Flg = "";
  115 +$Al_Send_Flg = "";
  116 +$Al_Send_Date = "";
  117 +$Al_Send_Time = "";
  118 +
  119 +if ($send_alarm==1){
  120 + //* アラーム設定有 *//
  121 + $Al_Set_Flg = "1";
  122 + $strSQL = "SELECT ";
  123 + $strSQL .= " * ";
  124 + $strSQL .= "FROM ";
  125 + $strSQL .= " alarm_data ";
  126 + $strSQL .= "WHERE ";
  127 + $strSQL .= " mail_id = " . (int)$_POST["mail_id"]." ";
  128 + $objRec = pg_exec($strSQL);
  129 + if($objRec==false){
  130 + echo("SQL実行に失敗しました(SELECT)");
  131 + exit;
  132 + }
  133 + $objData = pg_fetch_object($objRec, 0);
  134 + $Al_Send_Flg = $objData->send_flg;
  135 + $al_message_date = $objData->message_date;
  136 + $al_message_time = $objData->message_time;
  137 + $Al_Send_Date = substr($al_message_date, 0, 4)."年 ";
  138 + $Al_Send_Date .= substr($al_message_date, 4, 2)."月 ";
  139 + $Al_Send_Date .= substr($al_message_date, 6, 2)."日";
  140 + $Al_Send_Time = substr($al_message_time, 0, 2)."時";
  141 + $Al_Send_Time .= substr($al_message_time, 2, 2)."分に設定済み";
  142 +
  143 +}else{
  144 + //* アラーム設定無 *//
  145 + $Al_Send_flg = "";
  146 + $Al_Setflg = "";
  147 + $Al_Send_Date = "";
  148 + $Al_Send_Time = "";
  149 +
  150 + if($Kaisai_Date=="未設定"){
  151 + $Al_disable = "DISABLED";
  152 + }else{
  153 + $Al_disable = "";
  154 + }
  155 +}
  156 +$o_smarty->assign('Al_Set_Flg' , $Al_Set_Flg);
  157 +$o_smarty->assign('Al_Send_Flg' , $Al_Send_Flg);
  158 +$o_smarty->assign('Al_Send_Date' , $Al_Send_Date);
  159 +$o_smarty->assign('Al_Send_Time' , $Al_Send_Time);
  160 +$o_smarty->assign('Al_disable' , $Al_disable);
  161 +
  162 +
  163 +if ($Send_alarm==1){
  164 + $intAlarm_flg= 1;
  165 + $strSQL = "SELECT " .
  166 + "alarm_data.Message_date, " .
  167 + "alarm_data.Message_time, " .
  168 + "alarm_data.send_flg, " .
  169 + "alarm_data.answer_id " .
  170 + "FROM alarm_data " .
  171 + "WHERE alarm_data.Mail_id = " . (int)$_POST["mail_id"];
  172 +
  173 + $objRecSet2 = pg_exec($strSQL);
  174 + if($objRecSet==false){
  175 + echo("SQL実行に失敗しました(SELECT)");
  176 + exit;
  177 + }
  178 +
  179 + $Alarm_date = pg_result($objRecSet2,0,"Message_date");
  180 + $Alarm_time = pg_result($objRecSet2,0,"Message_time");
  181 + $Answer_ID = pg_result($objRecSet2,0,"answer_id");
  182 +
  183 +}else{
  184 + $strSysDate = date("YmdHi");
  185 +
  186 + if (strlen($strSysDate) == 10) {
  187 + $strSysDate = "20" . $strSysDate;
  188 + }
  189 + $strYear = substr($strSysDate, 0, 4);
  190 + $strMonth = "";
  191 + $strDate = "";
  192 + $strHour = "";
  193 + $strMinute ="";
  194 + $Alarm_flg = 0;
  195 + $Anser_ID = 0;
  196 +}
  197 +$strToday = substr($strSysDate, 0, 8);
  198 +
  199 +//*** 再送情報を取得 ***
  200 +$Kidoku_FLG = "";
  201 +$Kidoku_User = "";
  202 +$Kidoku_Date = "";
  203 +$Kidoku_Mode = "";
  204 +
  205 +$strSQL = "SELECT ";
  206 +$strSQL .= " * ";
  207 +$strSQL .= "FROM ";
  208 +$strSQL .= " kidok_data ";
  209 +$strSQL .= "WHERE ";
  210 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"]." ";
  211 +$strSQL .= "ORDER BY ";
  212 +$strSQL .= " check_id ASC ";
  213 +$objRec = pg_exec($strSQL);
  214 +if($objRec==false){
  215 + echo("SQL実行に失敗しました(SELECT)");
  216 + exit;
  217 +}
  218 +if(pg_numrows($objRec)!=0){
  219 + $Kidoku_FLG = "1";
  220 + for($intI = 0; $intI < pg_numrows($objRec) ; $intI++){
  221 + $objData = pg_fetch_object($objRec, $intI);
  222 + switch ($objData->check_id) {
  223 + case "0":
  224 + $Kidoku_User = "未読者へ";
  225 + break;
  226 + case "99":
  227 + if($Kidoku_User == ""){
  228 + $Kidoku_User = "既読者へ";
  229 + }else{
  230 + $Kidoku_User .= ":既読者へ";
  231 + }
  232 + break;
  233 + }
  234 + $Kidok_date = $objData->message_date;
  235 + $Kidok_time = $objData->message_time;
  236 + $Kidok_Send = $objData->send_flg;
  237 + }
  238 +
  239 + $Kidoku_Date = substr($Kidok_date,0,4)."年";
  240 + $Kidoku_Date .= substr($Kidok_date,4,2)."月";
  241 + $Kidoku_Date .= substr($Kidok_date,6,2)."日";
  242 + $Kidoku_Date .= substr($Kidok_time,0,2)."時";
  243 + $Kidoku_Date .= substr($Kidok_time,2,2)."分";
  244 +
  245 + if($Kidok_Send==1){
  246 + $Kidoku_Mode = "送信済み";
  247 + }else{
  248 + $Kidoku_Mode = "設定済み";
  249 + }
  250 +
  251 +}else{
  252 + $Kidoku_Mode = "未設定";
  253 + if($Kaisai_Date=="未設定"){
  254 + $Kidoku_disable = "DISABLED";
  255 + }else{
  256 + $Kidoku_disable = "";
  257 + }
  258 +
  259 +}
  260 +
  261 +$o_smarty->assign('Kidoku_FLG' , $Kidoku_FLG);
  262 +$o_smarty->assign('Kidoku_Date' , $Kidoku_Date);
  263 +$o_smarty->assign('Kidoku_User' , $Kidoku_User);
  264 +$o_smarty->assign('Kidoku_Mode' , $Kidoku_Mode);
  265 +$o_smarty->assign('Kidoku_disable' , $Kidoku_disable);
  266 +
  267 +
  268 +//*** 回答期限取得 ***//
  269 +$strSQL = "SELECT ";
  270 +$strSQL .= " * ";
  271 +$strSQL .= "FROM ";
  272 +$strSQL .= " res_time_tbl ";
  273 +$strSQL .= "WHERE ";
  274 +$strSQL .= " mail_id = " . (int)$_POST["mail_id"]." AND ";
  275 +$strSQL .= " angou_id = '" . $angou_id."' ";
  276 +$objRec = pg_exec($strSQL);
  277 +if($objRec==false){
  278 + echo("SQL実行に失敗しました(SELECT)");
  279 + exit;
  280 +}
  281 +if(pg_numrows($objRec)!=0){
  282 + $objData = pg_fetch_object($objRec, 0);
  283 + $d1 = mktime (substr($objData->date,8,2), substr($objData->date,10,2) , 0 , substr($objData->date,4,2), substr($objData->date,6,2), substr($objData->date,0,4));
  284 + $limit_date=date("Y年m月d日 H時i分",$d1)."まで";
  285 +}else{
  286 + $strlimit_date="設定なし";
  287 +}
  288 +
  289 +$o_smarty->assign('limit_date' , $limit_date);
  290 +
  291 +//*** 送信者 ***//
  292 +$strSQL = "SELECT ";
  293 +$strSQL .= " * ";
  294 +$strSQL .= "FROM ";
  295 +$strSQL .= " syain_tbl ";
  296 +$strSQL .= "WHERE ";
  297 +$strSQL .= " syain_cd = ".$admin_cd;
  298 +$objRec = pg_exec($strSQL);
  299 +if($objRec==false){
  300 + echo("SQL実行に失敗しました(SELECT)");
  301 + exit;
  302 +}
  303 +if(pg_numrows($objRec)!=0){
  304 + $objData = pg_fetch_object($objRec, 0);
  305 + $admin_name = $objData->name_kj_sei." ".$objData->name_kj_mei;
  306 +}else{
  307 + $admin_name = "";
  308 +}
  309 +
  310 +$o_smarty->assign('admin_name' , $admin_name);
  311 +
  312 +//***** 現在回答数取得 *****//
  313 +$strSQL = "SELECT ";
  314 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 100) AS not_cnt ,";
  315 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 0) AS n_read_cnt,";
  316 +$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 99) AS read_cnt ";
  317 +$strSQL .= "FROM ";
  318 +$strSQL .= " mail_info AS M ";
  319 +$strSQL .= "WHERE";
  320 +$strSQL .= " M.mail_id=".$_POST["mail_id"]." ";
  321 +$strSQL .= "GROUP BY ";
  322 +$strSQL .= " M.mail_id";
  323 +//echo $strSQL."<hr>";
  324 +$objCntRec = pg_exec($strSQL);
  325 +if($objCntRec==false){
  326 + echo("SQL実行に失敗しました(SELECT)b");
  327 + exit;
  328 +}
  329 +$objCntData = pg_fetch_object($objCntRec, 0);
  330 +$NOT_CNT = $objCntData->not_cnt;
  331 +$N_READ_CNT = $objCntData->n_read_cnt;
  332 +$READ_CNT = $objCntData->read_cnt;
  333 +
  334 +if ($N_READ_CNT=="0"){
  335 + $btnSheep = "disabled";
  336 +}
  337 +
  338 +//***** 回答文言を取得 *****
  339 +$SYORI_MODE = "";
  340 +$strSQL = "SELECT * FROM answer_data WHERE mail_id = " . $_POST["mail_id"];
  341 +$objRec = pg_exec($strSQL);
  342 +if($objRec==false){
  343 + echo("SQL実行に失敗しました(SELECT)d");
  344 + exit;
  345 +}
  346 +if(pg_numrows($objRec)!=0){
  347 + $objData = pg_fetch_object($objRec,0);
  348 +
  349 + $SYORI_MODE = $objData->name50_nm;
  350 +
  351 + for($intI = 1; $intI <= $objData->select_nm; $intI++){
  352 + $idx = $intI-1;
  353 + $ANS_LIST[$idx][0] = pg_result($objRec, 0, "name" . $intI . "_id");
  354 + $ANS_LIST[$idx][1] = pg_result($objRec, 0, "name" . $intI . "_nm");
  355 + if($ANS_LIST[$idx][0] == 1){
  356 + $ANS_LIST[$idx][4][0] = $ANS_LIST[$idx][1];
  357 + }else{
  358 + $ANS_LIST[$idx][4] = dateEdit(pg_result($objRec, 0, "name" . $intI . "_nm"));
  359 + }
  360 + if ($SYORI_MODE=="SC"){
  361 + $strSQL = "SELECT ";
  362 + $strSQL .= " COUNT(*) AS dt_cnt ";
  363 + $strSQL .= "FROM ";
  364 + $strSQL .= " mail_info2 ";
  365 + $strSQL .= "WHERE";
  366 + $strSQL .= " mail_id = ".$_POST["mail_id"]." AND ";
  367 + $strSQL .= " check_flg = ".$ANS_LIST[$idx][0];
  368 + //echo $strSQL."<hr>";
  369 + $objCntRec = pg_exec($strSQL);
  370 + if($objCntRec==false){
  371 + echo("SQL実行に失敗しました(SELECT)c");
  372 + exit;
  373 + }
  374 + $objCntData = pg_fetch_object($objCntRec, 0);
  375 + $ANS_LIST[$idx][2] = $objCntData->dt_cnt;
  376 +
  377 + //人
  378 + $strSQL = "SELECT";
  379 + $strSQL .= " syain_tbl.name_kj_sei, ";
  380 + $strSQL .= " syain_tbl.name_kj_mei ";
  381 + $strSQL .= "FROM ";
  382 + $strSQL .= " mail_info2 ";
  383 + $strSQL .= "JOIN ";
  384 + $strSQL .= " syain_tbl ";
  385 + $strSQL .= "ON ";
  386 + $strSQL .= " syain_tbl.syain_cd = mail_info2.syain_cd ";
  387 + $strSQL .= "WHERE ";
  388 + $strSQL .= " mail_id = ".(int)$_POST["mail_id"]." AND ";
  389 + $strSQL .= " check_flg = ".$ANS_LIST[$idx][0]." ";
  390 + $strSQL .= "ORDER BY syain_tbl.syain_cd";
  391 + $objMan = pg_exec($strSQL);
  392 + if($objMan==false){
  393 + echo("SQL実行に失敗しました(SELECT)c");
  394 + exit;
  395 + }
  396 + $ANS_LIST[$idx][3] = "";
  397 + if(pg_numrows($objMan) > 0){
  398 + for($i=0;$i<pg_numrows($objMan);$i++){
  399 + $objManData = pg_fetch_object($objMan, $i);
  400 + $ANS_LIST[$idx][3][$i] = "【".$objManData->name_kj_sei." ".$objManData->name_kj_mei."】 ";
  401 + //if($i < pg_numrows($objMan) -1){
  402 + // $ANS_LIST[$idx][3][$i] .= "<br>";
  403 + //}
  404 + }
  405 + }
  406 + }else{
  407 + $strSQL = "SELECT ";
  408 + $strSQL .= " COUNT(*) AS dt_cnt ";
  409 + $strSQL .= "FROM ";
  410 + $strSQL .= " mail_info ";
  411 + $strSQL .= "WHERE";
  412 + $strSQL .= " mail_id = ".$_POST["mail_id"]." AND ";
  413 + $strSQL .= " check_flg = ".$ANS_LIST[$idx][0];
  414 + //echo $strSQL."<hr>";
  415 + $objCntRec = pg_exec($strSQL);
  416 + if($objCntRec==false){
  417 + echo("SQL実行に失敗しました(SELECT)c");
  418 + exit;
  419 + }
  420 + $objCntData = pg_fetch_object($objCntRec, 0);
  421 + $ANS_LIST[$idx][2] = $objCntData->dt_cnt;
  422 + }
  423 + }
  424 +}else{
  425 + $ANS_LIST=array();
  426 +}
  427 +
  428 +function dateEdit($prm){
  429 + $retValue = "";
  430 + $s = substr($prm, 0, 4)."年".(int)substr($prm, 4, 2)."月".(int)substr($prm, 6, 2)."日";
  431 + if(trim(substr($prm, 8, 2)) != ""){
  432 + $s .= " ".(int)substr($prm, 8, 2).":".substr($prm, 10, 2);
  433 + }
  434 +
  435 + $e = "";
  436 + if(trim(substr($prm, 12, 4)) != ""){
  437 + $e = substr($prm, 12, 4)."年".(int)substr($prm, 16, 2)."月".(int)substr($prm, 18, 2)."日";
  438 + }
  439 + if(trim(substr($prm, 20, 2)) != ""){
  440 + $e .= " ".(int)substr($prm, 20, 2).":".substr($prm, 22, 2);
  441 + }
  442 + $retValue[0] = $s;
  443 + $retValue[1] = $e;
  444 + return $retValue;
  445 +}
  446 +function dateEditMin($prm){
  447 + $retValue = "";
  448 + $s = substr($prm, 0, 4)."/".(int)substr($prm, 4, 2)."/".(int)substr($prm, 6, 2)."";
  449 + if(trim(substr($prm, 8, 2)) != ""){
  450 + $s .= " ".(int)substr($prm, 8, 2).":".substr($prm, 10, 2);
  451 + }
  452 +
  453 + $e = "";
  454 + if(trim(substr($prm, 12, 4)) != ""){
  455 + $e = substr($prm, 12, 4)."/".(int)substr($prm, 16, 2)."/".(int)substr($prm, 18, 2)."";
  456 + }
  457 + if(trim(substr($prm, 20, 2)) != ""){
  458 + $e .= " ".(int)substr($prm, 20, 2).":".substr($prm, 22, 2);
  459 + }
  460 + $retValue = $s." - ".$e;
  461 + return $retValue;
  462 +}
  463 +
  464 +$o_smarty->assign('NOT_CNT' , $NOT_CNT);
  465 +$o_smarty->assign('N_READ_CNT' , $N_READ_CNT);
  466 +$o_smarty->assign('READ_CNT' , $READ_CNT);
  467 +$o_smarty->assign('ANS_LIST' , $ANS_LIST);
  468 +$o_smarty->assign('btnSheep' , $btnSheep);
  469 +
  470 +//***** ユーザー回答状況 *****//
  471 +$strSQL = "SELECT ";
  472 +$strSQL .= " syain_tbl.syain_cd , ";
  473 +$strSQL .= " syain_tbl.Name_kj_sei , ";
  474 +$strSQL .= " syain_tbl.Name_kj_mei , ";
  475 +$strSQL .= " mail_info.check_flg , ";
  476 +$strSQL .= " mail_info.kousin , ";
  477 +$strSQL .= " mail_info.comment , ";
  478 +$strSQL .= " mail_send_tbl.send_flg ";
  479 +$strSQL .= "FROM ";
  480 +$strSQL .= " mail_info ,";
  481 +$strSQL .= " syain_tbl ,";
  482 +$strSQL .= " mail_send_tbl ";
  483 +$strSQL .= "WHERE ";
  484 +$strSQL .= " mail_info.syain_cd = syain_tbl.syain_cd AND ";
  485 +$strSQL .= " mail_info.syain_cd = mail_send_tbl.syain_cd AND ";
  486 +$strSQL .= " mail_info.mail_id = ".(int)$_POST["mail_id"]." AND ";
  487 +$strSQL .= " mail_send_tbl.mail_id = ".(int)$_POST["mail_id"]." ";
  488 +$strSQL .= "GROUP BY ";
  489 +$strSQL .= " mail_info.mail_id , ";
  490 +$strSQL .= " syain_tbl.syain_cd , ";
  491 +$strSQL .= " syain_tbl.Name_kj_sei , ";
  492 +$strSQL .= " syain_tbl.Name_kj_mei , ";
  493 +$strSQL .= " syain_tbl.name_kn_sei , ";
  494 +$strSQL .= " syain_tbl.name_kn_mei , ";
  495 +$strSQL .= " mail_info.check_flg , ";
  496 +$strSQL .= " mail_info.kousin , ";
  497 +$strSQL .= " mail_info.comment , ";
  498 +$strSQL .= " mail_send_tbl.send_flg ";
  499 +$strSQL .= "ORDER BY ";
  500 +$strSQL .= " mail_info.check_flg ASC, ";
  501 +$strSQL .= " (comment is null), mail_info.comment ASC, ";
  502 +$strSQL .= " syain_tbl.name_kn_sei ASC, ";
  503 +$strSQL .= " syain_tbl.name_kn_mei ASC, ";
  504 +$strSQL .= " syain_tbl.Syain_cd ASC ";
  505 +//echo $strSQL;
  506 +$objRec = pg_exec($strSQL);
  507 +if($objRec==false){
  508 + echo("SQL実行に失敗しました(SELECT)");
  509 + exit;
  510 +}
  511 +$SendUser = "";
  512 +for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
  513 + $objData = pg_fetch_object($objRec,$intI);
  514 + $User_List[$intI][0] = $objData->syain_cd;
  515 + $SendUser .= $User_List[$intI][0].",";
  516 + $User_List[$intI][1] = $objData->name_kj_sei." ".$objData->name_kj_mei;
  517 +
  518 + //*** グループ情報 ***
  519 + $User_List[$intI][2] = "";
  520 + $strSQL = "SELECT ";
  521 + $strSQL .= " mst_group.group_name ";
  522 + $strSQL .= "FROM ";
  523 + $strSQL .= " group_info,";
  524 + $strSQL .= " mst_group ";
  525 + $strSQL .= "WHERE ";
  526 + $strSQL .= " group_info.group_id = mst_group.group_id AND ";
  527 + $strSQL .= " group_info.syain_cd = ".$objData->syain_cd;
  528 + $objGrpRec = pg_exec($strSQL);
  529 + if($objGrpRec==false){
  530 + echo("SQL実行に失敗しました(SELECT)");
  531 + exit;
  532 + }
  533 + for($intJ = 0; $intJ < pg_numrows($objGrpRec) ; $intJ++) {
  534 + $objGrpData = pg_fetch_object($objGrpRec, $intJ);
  535 + if ($User_List[$intI][2]!=""){
  536 + $User_List[$intI][2] .= "<br />";
  537 + }
  538 + $User_List[$intI][2] .= JcodeConvert($objGrpData->group_name, 1, 1);
  539 + }
  540 +
  541 + switch ($objData->check_flg) {
  542 + case "0":
  543 + $User_List[$intI][3] = "未読";
  544 + $User_List[$intI][8] = "color='red'";
  545 + break;
  546 + case "99":
  547 + if ($SYORI_MODE=="SC"){
  548 + $strSQL = "SELECT ";
  549 + $strSQL .= " * ";
  550 + $strSQL .= "FROM ";
  551 + $strSQL .= " mail_info2 ";
  552 + $strSQL .= "WHERE";
  553 + $strSQL .= " mail_id = ".$_POST["mail_id"] ." AND ";
  554 + $strSQL .= " syain_cd = ".$objData->syain_cd." ";
  555 + //echo $strSQL."<hr>";
  556 + $objAnsRec = pg_exec($strSQL);
  557 + if($objAnsRec==false){
  558 + echo("SQL実行に失敗しました(SELECT)c");
  559 + exit;
  560 + }
  561 + if(pg_numrows($objAnsRec)!=0){
  562 + for($intJ = 0; $intJ < pg_numrows($objAnsRec) ; $intJ++) {
  563 + $objAnsData = pg_fetch_object($objAnsRec, $intJ);
  564 + for($intK = 0; $intK < count($ANS_LIST) ; $intK++) {
  565 + if ($objAnsData->check_flg==$ANS_LIST[$intK][0]){
  566 + if ($User_List[$intI][3]!=""){
  567 + $User_List[$intI][3] .= "<br />";
  568 + }
  569 + if($objAnsData->check_flg != 1){
  570 + $User_List[$intI][3] .= dateEditMin($ANS_LIST[$intK][1]);
  571 + }else{
  572 + $User_List[$intI][3] .= $ANS_LIST[$intK][1];
  573 + }
  574 + break;
  575 + }
  576 + }
  577 + }
  578 + $User_List[$intI][8] = "#FFFFFF";
  579 + }else{
  580 + $User_List[$intI][3] = "既読";
  581 + $User_List[$intI][8] = "color='orange'";
  582 + }
  583 + }else{
  584 + $User_List[$intI][3] = "既読";
  585 + $User_List[$intI][8] = "color='orange'";
  586 + }
  587 + break;
  588 + case "100":
  589 + $User_List[$intI][3] = "アドレス未設定";
  590 + $User_List[$intI][8] = "color='orange'";
  591 + break;
  592 + default: $User_List[$intI][3] = $ANS_LIST[$objData->check_flg-1][1];
  593 + }
  594 +
  595 + if ($objData->kousin!=""){
  596 + $User_List[$intI][4] = intval(substr($objData->kousin,0,4))."年";
  597 + $User_List[$intI][4] .= intval(substr($objData->kousin,4,2))."月";
  598 + $User_List[$intI][4] .= intval(substr($objData->kousin,6,2))."日";
  599 + $User_List[$intI][4] .= intval(substr($objData->kousin,8,2))."時";
  600 + $User_List[$intI][4] .= intval(substr($objData->kousin,10,2))."分";
  601 + $User_List[$intI][5] = nl2br(htmlspecialchars($objData->comment));
  602 + }else{
  603 + $User_List[$intI][4] = "&nbsp;";
  604 + $User_List[$intI][5] = "&nbsp;";
  605 + }
  606 +
  607 + switch ($objData->send_flg) {
  608 + case "0": $User_List[$intI][6] = "携帯/PC"; break;
  609 + case "1": $User_List[$intI][6] = "携帯"; break;
  610 + case "2": $User_List[$intI][6] = "PC"; break;
  611 + default : $User_List[$intI][6] = "-";
  612 + }
  613 +
  614 + //社員コード
  615 + $User_List[$intI][7] = $objData->syain_cd;
  616 +
  617 +}
  618 +$o_smarty->assign('User_List' , $User_List);
  619 +
  620 +
  621 +$o_smarty->assign('intGroupCount', count($User_List));
  622 +$o_smarty->assign('PHP_POST_DB_FLG', (int)$PHP_POST_DB_FLG);
  623 +$o_smarty->assign('SendUser', $SendUser);
  624 +
  625 +$o_smarty->display('LIST2000.tpl');
  626 +
  627 +?>
... ...
Please register or login to post a comment