mlogget.inc
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?PHP
// 送信Logを保存する
//
// 戻り値 成功=True 失敗=False
function func_LogInput($angou,$logFrom,$logTo,$logType,$logDate,$intCountLog){
$res = "True";
$hostname="localhost";
$database="post_kanri";
if( !$pg_con2=pg_connect("host=$hostname dbname=$database user=pgsqladmin password=pgsqladmin") ) {
print "Error : connect to ${hostname}<br>";
exit;
}
//表示名称を取得
$strSQL = "SELECT user_id " .
"FROM mst_kanri " .
"WHERE angou = '".$angou."'";
$objRecSet = pg_exec($pg_con2,$strSQL);
if($objRecSet==false){
$res = "False";
}
if(pg_numrows($objRecSet)!=0){
$objRecData = pg_fetch_object($objRecSet, 0);
$user_id = $objRecData->user_id;
}
for($i=0;$i<$intCountLog;$i++){
if($logTo[$i]!=""){
$strSQL = "Insert into send_history_tbl ".
"(user_id,from_mail,to_mail,send_time,send_type) VALUES ".
"('".$user_id."',".
"'".$logFrom[$i]."',".
"'".$logTo[$i]."',".
"'".$logDate[$i]."',".
$logType[$i]."".
")";
$objRecSet = pg_exec($pg_con2,$strSQL);
if($objRecSet==false){
$res = "False";
}
}
}
return $res;
}
?>