-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_issue.php
More file actions
148 lines (135 loc) · 4.78 KB
/
edit_issue.php
File metadata and controls
148 lines (135 loc) · 4.78 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
/*
This file is part of Scorecard, Copyright 2013-2014 Dan Robinson, Nancy Wallace and John Holland.
Scorecard is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Scorecard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Scorecard. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>legitit legislation add/edit page</title>
</head>
<body>
<?php
$id=$_GET["id"];
if (isset($id)){
$adding=false;
$text="Edit";
}elseif($_GET["add"]='T'){
$adding=true;
$text="Add";
}else{
header("location: index.php");
}
include ("connection_string.php");
$str_big_issues = "select * from tbl_big_issues ";
if($sql_big_issues = mysqli_query($link, $str_big_issues))
{
//echo "yes";
}
echo "<table bgcolor='#ECF6CE' width=880 cellpadding=0 cellspacing=0>";
echo "<tr>";
echo "<td><font size=5>".$text." Issue</td><td align=right><a href='index.php'>Home</a></td>";
echo "</tr>";
echo "</table>";
echo "<table width=880>";
echo "<form name='save_issue' action='save_issue.php' method=post>";
// echo "<th bgcolor=lightblue>Link</th><th bgcolor=pink>location</th>";
//$test=$row_issue["title"];
echo "<tr><td valign=top bgcolor=lightblue>".$text."ing</td>";
if(!$adding){
// Get and print menu links
$str_issue = "select * from tbl_issues ";
$str_issue .= "where id=".$id.";" ;
$sql_issue = mysqli_query($link, $str_issue);
// xxx
$row_issue = mysqli_fetch_assoc($sql_issue);
// echo $str_issue;
$title=htmlspecialchars($row_issue["title"], ENT_QUOTES);
$subtitle=htmlspecialchars($row_issue["subtitle"], ENT_QUOTES);
$description=htmlspecialchars($row_issue["description"], ENT_QUOTES);
$pro_environment_vote=htmlspecialchars($row_issue["pro_environment_vote"], ENT_QUOTES);
$synopsis=htmlspecialchars($row_issue["synopsis"], ENT_QUOTES);
echo "<td bgcolor=lightblue align=left>";
echo "<select name=big_issue>";
while($row_big_issues = mysqli_fetch_assoc($sql_big_issues))
{
if ($row_issue["big_issue_id"]==$row_big_issues["id"]){
$selected=" selected ";
}else{
$selected= "";
}
echo "<option value='".$row_big_issues["id"]."' ". $selected. ">".$row_big_issues["name"]."</option>";
}
echo "</select>";
echo "</td>";
echo"<td bgcolor=lightblue align=right><a href='edit_issue.php?add=T'>Add</a></td>";
}else{
echo "<td bgcolor=lightblue align=left>";
echo "<select name=big_issue>";
while($row_big_issues = mysqli_fetch_assoc($sql_big_issues))
{
echo "<option value='".$row_big_issues["id"]."' >".$row_big_issues["name"]."</option>";
}
echo "</select>";
echo "</td>";
echo"<td bgcolor=lightblue align=right> </td>";
$title="";
$subtitle="";
$description="";
$pro_environment_vote="";
$synopsis="";
}
echo "</tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#ACFA58>";
echo "Title: </td>";
echo "<td valign=top colspan=2 bgcolor=#ACFA58>";
echo "<input size=80 maxlength=255 type=text name='title' value='".$title."'></td></tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#ACFA58>";
echo "SubTitle: </td>";
echo "<td valign=top colspan=2 bgcolor=#ACFA58>";
echo "<input size=80 maxlength=255 type=text name='subtitle' value='".$subtitle."'></td></tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#ACFA58> ";
echo "Description: </td>";
echo "<td valign=top colspan=2 bgcolor=#ACFA58>";
echo "<textarea cols='50' rows='10' name='description'>".$description."</textarea></td></tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#ACFA58> ";
echo "Pro Environment Vote: </td>";
echo "<td valign=top colspan=2 bgcolor=#ACFA58>";
echo "<input type=text name='pro_environment_vote' value='".$pro_environment_vote."'></td></tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#ACFA58> ";
echo "Synopsis: </td>";
echo "<td valign=top colspan=2 bgcolor=#ACFA58>";
echo " <textarea name='synopsis' cols='50' rows='10' >".$synopsis."</textarea></td></tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#ACFA58 colspan=3> ";
if(!$adding){
mysqli_free_result($sql_issue);
echo " <input type=hidden name='event_id' value=".$id.">";
echo "<input type=submit value='Save Issue'>";
}else{
echo " <input type=hidden name='event_id' value='add'>";
echo "<input type=submit value='Add Issue'>";
}
echo "</td></tr>";
echo "</form>";
echo "</table>";
//$clean_string = mysql_real_escape_string($string);
// $output = stripslashes($db_string);
?>
</body>
</html>