forked from johnhckuo/3D_Modeling_System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.php
105 lines (79 loc) · 4.03 KB
/
image.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
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
<?php
//$Account=$_SESSION['Account'];
//$data = array();
// 清空伺服器緩存
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
require_once("/var/www/db/dblogin.php");
require_once("/var/www/db/dbconnect.php");
$db=new DB();
$link=$db->connect_db($_DB['host'],$_DB['username'],$_DB['password'],$_DB['dbname']);
if(isset($_GET['categoryNo'])){
$categoryNo=$_GET['categoryNo'];
$sql="SELECT pictureName,3dimageLink,2dimageLink FROM platform WHERE categoryNo='$categoryNo' "; //要加圖片是否授權
$keys = array();
$keys2 = array();
$result = $db->query($link,$sql);
while ($row = mysqli_fetch_row($result) )
{
//$keys[]= $row;
echo $row[0].'+'.$row[1].'+'.$row[2].'+';
/*
$sql2="SELECT Nickname FROM member WHERE memberNo ='$row[7]'";
$result2= $db->query($link,$sql2);//Nickname
while ($row2 = mysqli_fetch_row($result2)){
$keys2[]=$row2;
} */
}
//變換位置圖片位置使得第一張出現所點擊圖片
/*
for($i=0;$i<4;$i++){
for($j=1;$j<4;$j++){
if($i<$j){
$temp=$keys[$j];
$keys[$j]=$keys[$i];
$keys[$i]=$temp;
$temp2=$keys2[$j];
$keys2[$j]=$keys2[$i];
$keys2[$i]=$temp2;
}
}
}*/
//for($i=0;$i<10;$i++){
// echo $keys[$i][0].'+'.$keys[$i][1].'+'.$keys[$i][2].'+';
//}
}
/*
if(isset($_GET['pictureNo']) && isset($_GET['folderNo']) && $_GET['categoryNo']==-1){ //從個人頁面連結
$pictureNo=$_GET['pictureNo'];
$folderNo=$_GET['folderNo'];
$sql=" SELECT pictureNo, pictureName,3dimageLink,2dimageLink,productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE pictureNo = $pictureNo UNION (SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE personalFolderNo='$folderNo' AND pictureNo != $pictureNo ORDER BY RAND() LIMIT 9) ";
}
else if(isset($_GET['pictureNo']) && $_GET['categoryNo']!=0 && $_GET['folderNo']==-1){ //從展覽頁面連結
$pictureNo=$_GET['pictureNo'];
$categoryNo=$_GET['categoryNo'];
$sql="SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE pictureNo = $pictureNo UNION (SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE categoryNo='$categoryNo' AND pictureNo != $pictureNo ORDER BY RAND() LIMIT 9)";
}
else if(isset($_GET['pictureNo']) && $_GET['categoryNo']!=0 && $_GET['folderNo']==-3){ //從搜尋頁面連結
$pictureNo=$_GET['pictureNo'];
$categoryNo=$_GET['categoryNo'];
$sql="SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE pictureNo = $pictureNo UNION (SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE categoryNo='$categoryNo' AND pictureNo != $pictureNo ORDER BY RAND() LIMIT 9)";
}
else if($_GET['folderNo']==-1 && $_GET['categoryNo']==0 ){ //從展覽頁面連結(熱門)
$pictureNo=$_GET['pictureNo'];
$categoryNo=$_GET['categoryNo'];
$sql="SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE pictureNo = $pictureNo UNION (SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform WHERE pictureNo != $pictureNo AND Score ORDER by Score/rateNumber DESC LIMIT 9)";
}
else{ //一進到展覽模式
$sql="SELECT pictureNo, pictureName, 3dimageLink,2dimageLink, productInfo,Score,rateNumber,memberNo,authorizePrice FROM platform ORDER BY pictureNo DESC LIMIT 10";
}*/
//$image3D = $row[$i]['3dimageLink'];
//$image2D = $row[$i]['2dimageLink'];
//$imagePhysical = $row[$i]['physicalImage'];
/*echo "<figure id=\"figure0\" >
<img src=\"".$image2D."\" width=\"180\" height=\"240\" alt=\"\">
<span id=\"imageInfo0\" ></span>
</figure>";*/
?>