-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
88 lines (78 loc) · 2.96 KB
/
Copy pathfunctions.php
File metadata and controls
88 lines (78 loc) · 2.96 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
<?php
require 'feng.conf';
$searchUrl = $host."search.php";
function companyUrl($Id) {
global $host;
return $host."company.php?id=".$Id;
}
// open mysql connection
function openMysql() {
$DBlink = mysql_connect("106.186.18.220","root","19861022",1) or die("Could not connect: ".mysql_error());
mysql_select_db("zxfdb",$DBlink) or die("Could not select database");
mysql_query("SET NAMES UTF8");
return $DBlink;
}
function queryShopById($DBlink, $id) {
$query = "select * from shop where Id=".$id;
$result = mysql_query($query, $DBlink) or die("Query failed:" .mysql_error());
return mysql_fetch_array($result, MYSQL_ASSOC);
}
function queryShops($DBlink, $keyword, $distinct) {
// TODO(junhaozhang): implement.
$query = "select * from shop";
$result = mysql_query($query, $DBlink) or die("Query failed:".mysql_error());
return mysql_fetch_array($result, MYSQL_ASSOC);
}
function getShopInfo($row) {
global $Id, $shopname, $district, $zone, $dp_star, $dp_price, $dp_reviewnum;
global $headshopid, $shopsite, $abstract, $shoptype, $score_all, $foundtime, $score_service, $staffnum;
global $price, $pomo, $score_worth, $score_design, $score_material, $score_construction, $review, $addr, $tel, $contactinfo, $tag, $addtime;
global $updatetime, $opentime, $dp_url, $shopid_img, $shopImg;
$Id = $row['Id'];
$shopname = $row['shopname'];
$district = $row['district'];
$zone = $row['zone'];
$dp_star = $row['dp_star'];
$dp_price = $row['dp_price'];
$dp_reviewnum = $row['dp_reviewnum'];
$headshopid = $row['headshopid'];
$shopsite = $row['shopsite'];
$abstract = $row['abstract'];
$shoptype = $row['shoptype'];
$score_all = $row['score_all'];
$foundtime = $row['foundtime'];
$score_service = $row['score_service'];
$staffnum = $row['staffnum'];
$price = $row['price'];
$promo = $row['promo'];
$score_worth = $row['score_worth'];
$score_design = $row['score_design'];
$score_material = $row['score_material'];
$score_construction = $row['score_construction'];
$review = $row['review'];
$addr = $row['addr'];
$tel = $row['tel'];
$contactinfo = $row['contactinfo'];
$tag = $row['tag'];
$addtime = $row['addtime'];
$updatetime = $row['updatetime'];
$opentime = $row['opentime'];
$dp_url = $row['dp_url'];
$shopImg = $row['image'];
if ($shopImg != "") {
$shopImg = "/images/shop/".$Id."/".$shopImg;
} else {
$shopImg = getRandomImage();
}
if ($headshopid!=0) { // NOTE(junhaozhang): need evaluated.
$shopid_img=$headshopid;
} else {
$shopid_img=$Id;
}
}
function getRandomImage() {
$imgRandNum=rand(1,2007);
//ÎļþÅúÁ¿ÖØÃüÃûhttp://jingyan.baidu.com/album/d8072ac438484dec95cefdaf.html?picindex=3
return "/images/shop_rand/rand (".$imgRandNum.").jpg";
}
?>