-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodify.php
More file actions
278 lines (241 loc) · 8.31 KB
/
modify.php
File metadata and controls
278 lines (241 loc) · 8.31 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php session_start(); ?>
<!DOCTYPE HTML>
<!--
Telemetry by Pixelarity
pixelarity.com | hello@pixelarity.com
License: pixelarity.com/license
-->
<html>
<head>
<title>Booth</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
<link rel="shortcut icon" href="images/booth-32.ico" type="image/x-icon" />
<link rel="stylesheet" href=" https://codemirror.net/3/theme/lesser-dark.css">
</head>
<body id="top">
<!-- Header -->
<header id="header">
<!-- Logo -->
<div class="logo">
<a href="index.php">Booth</a><span> By NCYU stud.</span>
</div>
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<?php
if(isset($_SESSION["user_name"])==null)
{
echo '<li><a href="login.html">登入</a></li>';
}
if(isset($_SESSION["user_name"])!=null)
{
echo '<li><a href="logout.php">登出</a></li>';
echo '<li><a href="member.php" class="icon fa-user" >';
echo $_SESSION["user_name"];
echo '</a></li>';
}
?>
<li>
<a href="intro.php" class="icon fa-angle-down">介紹</a>
<ul>
<li><a href="staff.php">成員介紹</a></li>
<li>
<a href="intro.php">專題介紹</a>
<ul>
<li><a href="frontend.php">修改介紹</a></li>
<li><a href="backend.php">轉換介紹</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#" class="icon fa-angle-down">教學</a>
<ul>
<li><a href="generic.php">LESS變數</a></li>
<li><a href="generic2.php">Bootstrap混合</a></li>
</ul>
</li>
</ul>
</nav>
</header>
<!-- Main -->
<section id="main" class="wrapper">
<div class="inner">
<header>
<h1>Modify</h1>
<p>Make your own design</p>
</header>
<a href="#" class="image main"><img src="images/brightwrite.jpg" style="-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;" alt="" /></a>
<?php
include("mysql_connect.inc.php");//連接資料庫
$p = @$_POST["project_select"];
if($p!="")
{
$_SESSION["project_name"]=$p;
$pname=$_SESSION["project_name"];
echo $pname;
}
$name=$_SESSION["user_name"];
$sql="SELECT * FROM `less_list` WHERE `person_name`='$name' AND `project_name`='$_SESSION[project_name]'";
$result=mysqli_query($db,$sql);
$num=1;
$row = mysqli_fetch_assoc($result);
if($row)
echo $name;
?>
<div class="select-wrapper">
<select name="version_select" id="version_select" onchange="showLess()" >
<option value="">- Category -</option>
<?php
$result=mysqli_query($db,$sql);
while($row = mysqli_fetch_assoc($result)):;
echo'<option value="';
echo $row['version_name'];
echo'">';
echo $row['version_name'];
echo'</option>';
endwhile;?>
</select>
</br>
</div>
<div class="12u$">
<div class="select-wrapper">
<select name="less" id="category" onchange="showLess()">
<option value="">- Category -</option>
<option value="1">Carousel</option>
<option value="2">Alerts</option>
<option value="3">Navbar</option>
<option value="4">Dropdowns</option>
<option value="5">Tables</option>
</select>
</div>
</br>
<div id="txtHint"></div>
</div>
</br>
</br>
<input type="button" value="獲取CSS" onclick="getUrl()">
</br>
</br>
<form method="post" action="add_version.php">
<div class="6u 12u$(xsmall)">
<input type="text" name="version_name" id="version_name" value="" placeholder="Template Name" />
</div>
</br>
<div class="6u 12u$(xsmall)">
<input type="submit" value="新增樣板" class="special" />
</div>
</form>
<script>
function HightLight()
{
var editableCodeMirror = CodeMirror.fromTextArea(document.getElementById('LessText'), {
theme: "default",
mode: "text/x-less",
matchBrackets: true,
lineNumbers: true
});
}
HightLight();
function showLess() //AJAX部分
{
var str = document.getElementById("category").value;
var str_v = document.getElementById("version_select").value;
if (str==""||str_v=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{
// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
xmlhttp=new XMLHttpRequest();
}
else
{
// IE6, IE5 浏览器执行代码
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
HightLight();
}
}
var params = 'q=' +str+'&v='+str_v;
xmlhttp.addEventListener("change",HightLight);
xmlhttp.open("POST","getless_mysql.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(params);
}
function getUrl()
{
var UserName = "<?php echo $name; ?>";
var ProjectName = "<?php echo $_SESSION['project_name']; ?>";
var VersionName = document.getElementById("version_select").value;
location.href="http://120.113.173.173/boot/nodejs/src/"+UserName+"/"+ProjectName+"/"+VersionName+"/custom-bootstrap.css";
}
</script>
</div>
</section>
<!-- Footer -->
<footer id="footer">
<div class="inner">
<div class="split style1">
<div class="contact">
<h2>Contact</h2>
<ul class="contact-icons">
<li class="icon fa-home"><a href="#">1234 Fictional Street #5432<br>Nashville, TN 00000-0000</a></li>
<li class="icon fa-phone"><a href="#">(000) 000-0000</a></li>
<li class="icon fa-envelope-o"><a href="#">info@untitled.tld</a></li>
</ul>
<ul class="icons-bordered">
<li><a class="icon fa-facebook" href="#">
<span class="label">Facebook</span>
</a></li>
<li><a class="icon fa-twitter" href="#">
<span class="label">Twitter</span>
</a></li>
<li><a class="icon fa-instagram" href="#">
<span class="label">Instagram</span>
</a></li>
<li><a class="icon fa-github" href="#">
<span class="label">GitHub</span>
</a></li>
<li><a class="icon fa-linkedin" href="#">
<span class="label">LinkedIn</span>
</a></li>
</ul>
</div>
</div>
<div class="copyright">
<p>© Untitled. All rights reserved.</p>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.dropotron.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/jquery.selectorr.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/addon/edit/matchbrackets.js"></script>
<script src="http://codemirror.net/addon/edit/continuecomment.js"></script>
<script src="https://codemirror.net/3/mode/less/less.js"></script>
</body>
</html>