-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
65 lines (61 loc) · 1.77 KB
/
index.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
<!DOCTYPE html>
<?php include "template/pdo.php";
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/bootstrap.min.css" type="text/css" rel="stylesheet" >
<link href="css/bootstrap-theme.min.css" type="text/css" rel="stylesheet" >
<link href="css/style.css" type="text/css"rel="stylesheet" >
<title>CodeSpace</title>
</head>
<body class="col-lg-12">
<div align="center">
<div class="container">
<?php require "template/menu.php"; ?><!--I'm Menu Bar-->
<div class="ct"><!--This is Container -->
<BR><br><h2>New Sorce</h2><br>
<table class="table-responsive table" border="1">
<tr>
<th style="max-width:20px;">#</th><th>Title</th><th>Owner</th><th>Date</th>
<?php
if(isset($_SESSION["username"])){
$username=$_SESSION["username"];
$sql="select * from source where status ='public' or own ='$username' order by id DESC";
}else{
$sql="select * from source where status ='public' order by id DESC";
}
$temp=$pdo->query($sql);
$i=0;
while($data=$temp->fetch()){
if($i==10){
break;
}
$title=$data["name"];
$owner=$data["own"];
$date=$data["cur_date"];
$id=$data["id"];
$num=$i+1;
echo"
<tr>
<td style='max-width:20px;'>$num</td>
<td><a href='viewSource.php?id=$id'>$title</a></td>
<td>$owner</td>
<td>$date</td>
</tr>
";
$i++;
}
?>
</tr>
</table>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</div>
</div>
<hr>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</html>