-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
115 lines (104 loc) · 4.59 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
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
<?php
include 'config.php';
session_start()
?>
<!DOCTYPE html>
<html>
<head>
<title>Home | AppsyStore</title>
<link rel="stylesheet" href="styles/style.css">
<script src="https://kit.fontawesome.com/24b485c31a.js" crossorigin="anonymous"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!--navigation bar start-->
<div class="navcontainer">
<img src="images/logo.png" alt="logo" width="auto" height="50px">
<nav>
<ul>
<li><a href="index.php" id="active"><i class="fa-solid fa-house"></i> Home</a></li>
<li><a href="app.php">Apps</a></li>
<li><a href="game.php">Games</a></li>
<li><a href="contactUs.php">Contact us</a></li>
<li><a href="aboutUs.php">About us</a></li>
<li>
<form action="search.php" method="GET"><input type="search" placeholder="Search" class="search" name="search">
<input type="submit" value="Search" class="searchbtn"></form>
</li>
<li>
<p>Hello,<?php
if(isset($_SESSION['first_name']))
echo $_SESSION['first_name'] ?>
</p>
</li>
<div class="login">
<?php
if(isset($_SESSION['first_name'])){
echo '<a href="logout.php" id="logout">Log out</a>';
}else
echo '<a href="login.php" id="logout">Log in</a>';
?>
</div>
</ul>
</nav>
<!--navigation bar end-->
</div>
<br/>
<h3>Popular :</h3>
<div class="container">
<?php
$query = "SELECT * FROM apps a, developer d, rating r where d.developer_id = a.developer_id and r.app_id = a.app_id ORDER BY(r.rate) DESc";
$result = mysqli_query($conn,$query);
$count = 0;
while($row = mysqli_fetch_array($result)){
if($count >= 11){
break;
}
?>
<a href="download.php?action=add&id=<?php echo $row['app_id']?>" class="item">
<img src="images/<?php echo $row['app_image']?>" alt="appimage" width="100px">
<h4><?php echo $row['app_name'] ?></h4>
<h5><?php echo $row['company_name']?></h5>
</a>
<?php $count++; } ?>
</div>
<h3>Apps :</h3>
<div class="container">
<?php
$query = "SELECT * FROM apps a, developer d where d.developer_id = a.developer_id and cat_id = 100 ORDER BY RAND()";
$result = mysqli_query($conn,$query);
$count = 0;
while($row = mysqli_fetch_array($result)){
if($count >= 11){
break;
}?>
<a href="download.php?action=add&id=<?php echo $row['app_id']?>" class="item">
<img src="images/<?php echo $row['app_image']?>" alt="appimage" width="100px">
<h4><?php echo $row['app_name'] ?></h4>
<h5><?php echo $row['company_name']?></h5>
</a>
<?php $count++; } ?>
</div>
<h3>Games :</h3>
<div class="container">
<?php
$query = "SELECT * FROM apps a, developer d where d.developer_id = a.developer_id and cat_id = 200 ORDER BY RAND()";
$result = mysqli_query($conn,$query);
$count = 0;
while($row = mysqli_fetch_array($result)){
if($count >= 11){
break;
} ?>
<a href="download.php?action=add&id=<?php echo $row['app_id']?>" class="item">
<img src="images/<?php echo $row['app_image']?>" alt="appimage" width="100px">
<h4><?php echo $row['app_name'] ?></h4>
<h5><?php echo $row['company_name']?></h5>
</a>
<?php $count++;} ?>
</div>
<footer>
<h3>© MLB_07.01_06</h3>
<h4>All Right Reserved</h4>
</footer>
</body>
</html>