-
Notifications
You must be signed in to change notification settings - Fork 0
/
cust_srch.php
53 lines (52 loc) · 1.74 KB
/
cust_srch.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
<?php
header("Content-Type: text/html; charset=UTF-8");
define('__ZBXE__', true);
include("../files/config/db.config.php");
$dbname=$db_info->master_db['db_userid'];
$dbpass=$db_info->master_db['db_password'];
class DBConnection{
function getConnection($dbname,$dbpass){
//change to your database server/user name/password
mysql_connect("localhost",$dbname,$dbpass) or
die("Could not connect: " . mysql_error());
//change to your database name
mysql_select_db($dbname) or
die("Could not select database: " . mysql_error());
}
}
$db = new DBConnection();
$db->getConnection($dbname,$dbpass);
mysql_query("set session character_set_connection=utf8;");
mysql_query("set session character_set_results=utf8;");
mysql_query("set session character_set_client=utf8;");
include_once("functions.php");
$sql = "select `CUST_CNUM`, `CUST_NAME`, `CUST_IDEN`, `CUST_HAND`, `CUST_MEMO` from `toto_customer` where `CUST_NAME` LIKE '%" . $_GET["cust_name"]."%'";
$handle = mysql_query($sql);
while($row = mysql_fetch_array($handle)){
echo "<a href='#' onclick='in_box(\"".$row[0]."\",\"".$row[1]."\",\"".$row[2]."\",\"".$row[3]."\",\"".$row[4]."\");'>".$row[1]."</a> ".$row[2]."<br />";
}
?>
<html>
<head>
<script>
// if(opener.name==""){
// self.close();
// }else{
// }
var cc=opener.document.getElementById("CUST_CNUM");
var cn=opener.document.getElementById("CUST_NAME");
var ci=opener.document.getElementById("CUST_IDEN");
var ch=opener.document.getElementById("CUST_TELE");
var cm=opener.document.getElementById("CUST_MEMO");
function in_box(cnum, name, ssn, cp, memo){
cc.value = cnum;
cn.value = name;
ci.value = ssn;
ch.value = cp;
cm.value = memo;
self.close();
}
</script>
</head>
</body>
</html>