-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLookUpCustomInformation.php
More file actions
173 lines (145 loc) · 4.08 KB
/
Copy pathLookUpCustomInformation.php
File metadata and controls
173 lines (145 loc) · 4.08 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<link href="css/LookUpCustomInformation.css" rel=stylesheet type="text/css" >
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<?php
require_once("connect_mysql_class.php");
require_once("mysql_inc.php");
require_once("session.php");
$se=new session();
if(!$SerialNumbers=$se->get_value("SerialNumbers"))
{
echo "******************取得SerialNumbers失敗******************";
exit();
}
$ItemID=$_GET['ItemID'];
$selector=$_GET['selector'];
//$ID="ueuKJKpyMD";
//$store="5mrXWaA7wbYgindrQZmh";
$db=new DB();
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
if($selector=="")
{
$selector=0;
}
if($selector==-1)
{
$query="SELECT number,PhoneNumber,life FROM custom_information WHERE store='".$SerialNumbers."' and item='".$ItemID."'";
$t=0;
}
else
{
$query="SELECT number,PhoneNumber,life FROM custom_information WHERE store='".$SerialNumbers."' and item='".$ItemID."' and life='".$selector."'";
$t=(int)$selector+1;
}
$db->query($query);
$Selectcontent[$t]="selected";
?>
<body bgcolor="#FFCECD">
<div id="LookUpCustomInformationPage" >
<div>
<form name="SelectorForm">
<select name="Selector" onchange="LookUpCustomInformationSelector('<?php echo $ItemID ?>')">
<option value=-1 <?php echo $Selectcontent[0] ?>>全部
<option value=0 <?php echo $Selectcontent[1] ?>>未服務
<option value=1 <?php echo $Selectcontent[2] ?>>已服務
<option value=2 <?php echo $Selectcontent[3] ?>>已刪除
</select>
</form>
</div>
<div id ="LookUpCustomInformationTable">
<div class="TableTr">
<div class="TableTd">
號碼
</div>
<div class="TableTd">
客戶電話
</div>
<div class="TableTd">
狀態
</div>
<div class="TableTd">
動作
</div>
</div>
<?php
while(($temp=$db->fetch_assoc())!=null)
{
echo '<div class="TableTr">';
/***************************/
echo '<div class="TableTd">';
echo '<span class="Number">';
echo $temp['number'];
echo '</span>';
echo '</div>';
echo '<div class="TableTd">';
echo '<span class="CustomID">';
echo $temp['PhoneNumber'];
echo '</span>';
echo '</div>';
echo '<div class="TableTd">';
if( $temp['life']=="0")
echo "未服務";
else if( $temp['life']=="1")
echo "已服務";
else if($temp['life']=="2")
echo "已刪除";
else
echo "未定義";
echo '</div>';
/***************************/
echo ' <div class="TableTd">';
if($temp['life']==0)
{
echo '<button class="SkipButton">
叫號
</button>';
echo '<button class="DeleteButton">
刪除
</button>';
}
echo '</div>';
echo '</div>';
}
?>
</div>
<button id="CloseWindow" style="margin-top:20px;" onclick="javascript:window.close();">關閉視窗</button>
</div>
<script>
$('.SkipButton').click(function(){
var ItemID = "<?php echo $ItemID?>";
var EditValue = $(this).parent().parent().children('.TableTd').children('.Number').html();
$.post('EditNum.php',
{"ItemID":ItemID,"EditValue":EditValue},
function(data)
{
if(data==EditValue)
window.location.reload();
else
{
alert("跳號失敗");
}
},
"text" );
});
$('.DeleteButton').click(function(){
var ItemID="<?php echo $ItemID;?>";
var Value = $(this).parent().parent().children('.TableTd').children('.Number').html();
alert(Value);
$.post('ModifyCustomState.php',
{"ItemID":ItemID,"Value":Value},
function(data)
{
window.location.reload();
},
"text");
});
function LookUpCustomInformationSelector(ItemID)
{
var selector=document.SelectorForm.Selector.value;
//loadpage("#content","LookUpCustomInformation.php",{"ItemID":ItemID,"selector":selector});
location.href='LookUpCustomInformation.php?ItemID='+ItemID+'&selector='+selector;
}
</script>
</body>