-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisp_data.php
106 lines (80 loc) · 2.69 KB
/
disp_data.php
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?
include "./parts/db_initialize.php";
include "./parts/function.php";
session_start();
$error_string = array();
$message_string = array();
if( !isset( $_GET["id"] ) || !isset( $_SESSION["id"] ) ){
header( "Location:".URL_PLZ_SIGN );
exit();
}
$sig_id = $_GET["id"];
$user_id = $_SESSION["id"];
if( !is_numeric( $user_id ) || !is_numeric( $sig_id ) ){
header( "Location:".URL_PLZ_SIGN );
exit();
}
$query = "SELECT COUNT(*), title FROM ".TN_SIG_MAIN." WHERE user_id='$user_id' AND id='$sig_id'";
$result = mysql_query( $query, $db );
$datas = mysql_fetch_array( $result );
if( $datas[0] != 1 ){
header( "Location:".URL_PLZ_SIGN );
exit();
}
$title = htmlspecialchars( $datas["title"] );
$datas_array = array();
$table_name = make_sig_table_name( $sig_id );
$query = "SELECT id, nickname, name, email, address, comment, updated FROM ".$table_name." ORDER BY updated DESC";
$result = mysql_query( $query, $db );
if( $result ){
while( $datas = mysql_fetch_array( $result ) ){
array_push( $datas_array, $datas );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTlML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="NOFOLLOW,NOINDEX" />
<meta name="ROBOTS" content="NONE" />
<title>ウェブ署名運動支援 PLZ-SIGN:データ出力:<?=$title?></title>
<link href="stylesheet/plz-sign.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="content">
<h1>ウェブ署名運動支援 PLZ-SIGN:データ出力</h1>
<h2><?=$title?></h2>
<?
for( $i=0; $i < count( $error_string ); $i++ ){
echo '<p style="font-style:bold;color:red">'.$error_string[$i]."</p>\n";
}
for( $i=0; $i < count( $message_string ); $i++ ){
echo '<p>'.$message_string[$i]."</p>\n";
}
?>
<table border="1" cellpadding="2" cellspacing="2">
<?
for( $i=0; $i < count( $datas_array ); $i++ ){
$datas = $datas_array[$i];
$disp_nickname = htmlspecialchars( $datas["nickname"] );
$disp_name = htmlspecialchars( $datas["name"] );
$disp_email = htmlspecialchars( $datas["email"] );
$disp_comment = htmlspecialchars( $datas["comment"] );
$disp_updated = htmlspecialchars( $datas["updated"] );
$disp_address = htmlspecialchars( $datas["address"] );
echo "<tr>\n";
echo "<td>".$disp_nickname."</td><td>".$disp_comment."</td>\n";
echo "<td>".$disp_name."</td><td>".$disp_email."</td>\n";
echo "<td>".$disp_address."</td><td>".$disp_updated."</td>\n";
echo "</tr>\n";
}
?>
</table>
<? include "./parts/footer.php" ?>
</div>
</body>
</html>
<?
include "./parts/db_finalize.php";
?>