-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathupdate.php
More file actions
71 lines (66 loc) · 2.75 KB
/
update.php
File metadata and controls
71 lines (66 loc) · 2.75 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
<?php
session_start();
if(!isset( $_SESSION['myusername'] )){
header("location:index.php");
}
require 'includes/conn.php';
// get value of id that sent from address bar
$beerid=$_GET['beerid'];
// Retrieve data from database
$sql="SELECT * FROM $tbl_name WHERE beerid='$beerid'";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
<head>
<title>Beer List</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<table align="center">
<tr>
<form name="form1" method="post" action="push_update.php">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><strong>Update Your Beers Information</strong> </td>
</tr>
<tr>
<td align="center"> </td></tr>
<tr><td align="center"><strong>Tap Number</strong></td></tr>
<tr><td align="center"><input class="smallbox" name="tapnumber" type="text" id="tapnumber" value="<? echo $rows['tapnumber']; ?>"></td></tr>
<tr><td align="center"><strong>Name</strong></td></tr>
<tr><td align="center"><input class="mediumbox" name="name" type="text" id="name" value="<? echo $rows['name']; ?>"></td></tr>
<tr><td align="center"><strong>Style</strong></td></tr>
<tr><td align="center"><input class="mediumbox" name="style" type="text" id="style" value="<? echo $rows['style']; ?>"></td></tr>
<tr><td align="center"><strong>Notes</strong></td></tr>
<tr><td align="center"><textarea class="inputbox" name="notes" rows="5" cols="50"><? echo $rows['notes']; ?></textarea></td></tr>
<tr><td align="center"><strong>OG</strong></td> </tr>
<tr><td align="center"><input class="smallbox" name="og" type="text" id="og" value="<? echo $rows['og']; ?>"</td></tr>
<tr><td align="center"><strong>FG</strong></td></tr>
<tr><td align="center"><input class="smallbox" name="fg" type="text" id="fg" value="<? echo $rows['fg']; ?>"</td></tr>
<tr><td align="center"><strong>SRM</strong></td></tr>
<tr><td align="center"><input class="smallbox" name="srm" type="text" id="srm" value="<? echo $rows['srm']; ?>"></td></tr>
<tr><td align="center"><strong>IBU's</strong></td></tr>
<tr><td align="center"><input class="smallbox" name="ibu" type="text" id="ibu" value="<? echo $rows['ibu']; ?>"></td></tr>
<tr><td align="center"><strong>Active (1-Yes 2-No)</strong></td></tr>
<tr><td align="center"><input class="smallbox" name="active" type="text" id="active" value="<? echo $rows['active']; ?>" size="3"></td></tr>
<tr><td>
<input name="beerid" type="hidden" id="beerid" value="<? echo $rows['beerid']; ?>">
</td></tr>
<tr>
<td align="center">
<input type="submit" class="btn" name="Submit" value="Submit">   <input type="button" class="btn" onclick="window.history.back()" value="Go Back">
</td>
<td> </td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<?php
// close connection
mysql_close();
?>