-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcorpedit.php
125 lines (115 loc) · 2.94 KB
/
corpedit.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/************************************************
* Infinity Corp Manager Index Page
*
* Created by Harley Faggetter
*
*
*
*
*************************************************/
//Load config
include 'config.php';
session_start();
//make sure you're actually logged in
if($_SESSION['login']===1)
{
//make sure the db is alive
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
//select the db
mysql_select_db($dbname);
$user= $_SESSION['username'];
//Get a db query
$result = mysql_query("SELECT * FROM Test_Corporations WHERE CreatorName = \"" . $user . "\"");
//Get the results
$row = mysql_fetch_array($result);
//Pass the results into the forms
echo
("
<html>
<head>
<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />
</head>
<body>
<div class=\"menu\">
");
include "menu.php";
echo
("
</div>
<div class=\"main\">
<form name=\"input\" action=\"corpeditaction.php\" method=\"post\">
<table border='1'>
<tr>
<th>Ticker</th>
<td><input type=\"text\" id=\"Textbox\" name=\"CorpTicker\"/ value=\"" . $row['CorpTicker'] . "\" maxlength=\"6\" /></td>
</tr>
<tr>
<th>Logo URL</th>
<td><input type=\"text\" id=\"Textbox\" name=\"LogoURL\" value=\"" . $row['Logo'] . "\" maxlength=\"255\"/></td>
</tr>
<tr>
<th>Corp Name</th>
<td><input type=\"text\" id=\"Textbox\" name=\"CorpName\" value=\"" . $row['CorpName'] . "\" maxlength=\"255\" /></td>
</tr>
<tr>
<th>Description</th>
<td><textarea name=\"Desc\" cols=\"40\" rows=\"7\">" . $row['CorpDesc'] . "</textarea></td>
</tr>
<tr>
<th>Homepage</th>
<td><input type=\"text\" id=\"Textbox\" name=\"CorpURL\" value=\"" . $row['CorpURL'] . "\" maxlength=\"255\" /></td>
</tr>"
);
//check the checkboxes if they were checked originally.
if($row['AllowMulti'] = "Y")
{
echo(
"<tr>
<th>Allows Multiclanning?</th>
<td><input type=\"checkbox\" name=\"allowMulti\" value=\"Y\" checked=\"checked\" />(MUST be checked to continue to display as allowing Multiclanning)</td>
</tr>"
);
}
else echo(
"<tr>
<th>Allows Multiclanning?</th>
<td><input type=\"checkbox\" name=\"allowMulti\" value=\"Y\" />(MUST be checked to continue to display as allowing Multiclanning)</td>
</tr>"
);
if($row['IsOpen'] = "Y")
{
echo(
"<tr>
<th>Recruiting?</th>
<td><input type=\"checkbox\" name=\"isOpen\" value=\"Y\" checked=\"checked\" /> (MUST be checked to continue to display as Recruiting)</td>
</tr>"
);
}
else echo(
"<tr>
<th>Recruiting?</th>
<td><input type=\"checkbox\" name=\"isOpen\" value=\"Y\" /> (MUST be checked to continue to display as Recruiting)</td>
</tr>"
);
echo(
"</table>
<input type=\"submit\" value=\"Edit\" />
</form>
<br />
<a href=mycorp.php>Cancel and return to corp page</a><br />
<a href=index.php>Return to Main Page</a>
</div>
</body>
</html>"
);
}
else
{
//go to index
header( 'Location: http://test.phoeniximperium.org/index.php');
}
?>