forked from zarkostanisic/iptv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
92 lines (83 loc) · 3.2 KB
/
admin.php
File metadata and controls
92 lines (83 loc) · 3.2 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
<?php
session_start();
include_once('./class/iptv.php');
include_once('./class/user.php');
$iptv = new Iptv();
$user = new user();
?>
<!DOCTYPE html>
<html>
<head>
<title>Admin | IPTV</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php"><span class="glyphicon glyphicon-home"></span></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<?php
$channels_f = $iptv->getFavourite();
while($ch = mysqli_fetch_array($channels_f)){
echo "<li><a href='index.php?channel=" . $ch['url_name'] . "#" . $ch['url_name'] . "'><p class='glyphicon glyphicon-play-circle'></p> " . strtoupper($ch['name']) . "</a></li>";
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<?php
if(isset($_POST['login'])){
$username = $_POST['username'];
$password = md5($_POST['password']);
$user = $user->login($username, $password);
$u = mysqli_num_rows($user);
if($u == 1){
$_SESSION['loged'] = 'loged';
header('Location:upload.php');
}else{
echo '<div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
Invalid login!
</div>';
}
}
?>
<form method="POST" action="admin.php">
<div class="form-group"><label for="file">Username</label><input type="text" name="username" class="form-control"></div>
<div class="form-group"><label for="file">Password</label><input type="password" name="password" class="form-control"></div>
<button type="submit" class="btn btn-primary form-control" name="login">Login</button>
</form>
</div>
<div class="col-md-4"></div>
</div>
</div>
<nav class="navbar navbar-inverse" style="margin-top:10px;">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="mailto:zarkostanisic@live.com">©® Žarko Stanišić</a></li>
</ul>
</div><!-- /.container-fluid -->
</nav>
</body>
</html>