-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModifyStoreInformation.php~
More file actions
126 lines (108 loc) · 4.05 KB
/
Copy pathModifyStoreInformation.php~
File metadata and controls
126 lines (108 loc) · 4.05 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
<?php
require_once("session.php");
$session=new session();
if(!$SerialNumbers=$session->get_value("SerialNumbers"))
{
echo "******************取得SerialNumbers失敗******************";
exit();
}
if(!$StoreType=$session->get_value("StoreType"))
{
echo "******************取得StoreType失敗******************";
exit();
}
require_once("connect_mysql_class.php");
require_once("mysql_inc.php");
if(count($_POST)==5)
{
$StoreName=$_POST['StoreName'];
$StoreAddress=$_POST['StoreAddress'];
$StoreTelephone=$_POST['StoreTelephone'];
$GPS_Longitude=$_POST['GPS_Longitude'];
$GPS_Latitude=$_POST['GPS_Latitude'];
$db=new DB();
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$query="UPDATE `store_information` SET `StoreName`=\"".$StoreName."\",`StoreAddress`=\"".$StoreAddress."\",`StoreTelephone`=\"".$StoreTelephone."\",`GPS_Longitude`=\"".$GPS_Longitude."\",`GPS_Latitude` =\"".$GPS_Latitude."\" where `SerialNumbers` =\"".$SerialNumbers."\"";
$db->query($query);
echo '<script>';
echo 'loadpage("#content","managepage.php");';
echo '</script>';
exit();
}
else
{
$db=new DB();
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$query="SELECT StoreName,StoreAddress,StoreTelephone,GPS_Longitude,GPS_Latitude FROM store_information where SerialNumbers='".$SerialNumbers."'";
$db->query($query);
$temp=$db->fetch_assoc();
}
?>
<div id="RegisterPage">
<div id="RegisterTitle">修改商家資料</div>
<form id="RegisterFormTable" method="post" action="">
<div class="Tr">
<div class="Td" style="text-align:right; width:160px;">
<div class="RegisterText">店家名稱:</div>
</div>
<div class="Td" style="text-align:left;">
<input type="text" class="RegisterTextArea" id="StoreName" maxlength="100" value="<?php echo $temp['StoreName']; ?>">
</div>
</div>
<div class="Tr">
<div class="Td" style="text-align:right;">
<div class="RegisterText">店家電話:</div>
</div>
<div class="Td" style="text-align:left;">
<input type="text" class="RegisterTextArea" id="StoreTelephone" maxlength="100" value="<?php echo $temp['StoreTelephone']; ?>" >
</div>
</div>
<div class="Tr">
<div class="Td" style="text-align:right;">
<div class="RegisterText" >店家地址:</div>
</div>
<div class="Td" style="text-align:left;">
<input type="text" class="RegisterTextArea" id="StoreAddress" name="StoreAddress" size="40" maxlength="100" onchange="codeAddress()" value="<?php echo $temp['StoreAddress']; ?>" >
</div>
</div>
<div class="Tr">
<div class="Td" style="text-align:right;">
<div class="RegisterText">經度:</div>
</div>
<div class="Td">
<input type="text" class="RegisterTextArea" name="GPS_Latitude" id="GPS_Latitude" value="<?php echo $temp['GPS_Latitude']; ?>" style="width:200px;">
</div>
</div>
<div class="Tr">
<div class="Td" style="text-align:right;">
<div class="RegisterText">緯度:</div>
</div>
<div class="Td">
<input type="text" class="RegisterTextArea" name="GPS_Longitude" id="GPS_Longitude" value="<?php echo $temp['GPS_Longitude']; ?>" style="width:200px;">
</div>
</div>
</form>
<button id="ModifySubmitButton" class="ButtonStyle" >修改</button>
<button id="BackButton" class="ButtonStyle" >返回</button>
</div>
</div>
<script>
$('#ModifySubmitButton').click(
function()
{
var StoreName=$('#StoreName').val();
var StoreTelephone=$('#StoreTelephone').val();
var StoreAddress=$('#StoreAddress').val();
var GPS_Latitude=$('#GPS_Latitude').val();
var GPS_Longitude=$('#GPS_Longitude').val();
$('#content').load('ModifyStoreInformation.php',
{
"StoreName":StoreName,"StoreTelephone":StoreTelephone,
"StoreAddress":StoreAddress,"GPS_Latitude":GPS_Latitude,
"GPS_Longitude":GPS_Longitude
});
});
$('#BackButton').click(function(){
loadpage("#content","managepage.php","<?php echo $StoreType ?>");
});
</script>