Skip to content

Commit e711d9c

Browse files
committed
v1.2 structure re-organized
1 parent 0e7db3d commit e711d9c

File tree

345 files changed

+47334
-407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+47334
-407
lines changed

admin/.htaccess

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RewriteEngine on
2+
3+
RewriteRule ^inc/?$ - [F,L]

admin/dashboard.php

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
include "inc/header.php";
3+
?>
4+
<?php
5+
// Check if the user is already logged in, if yes then redirect him to MYPROFILE page
6+
if(!isset($_SESSION["admin"])){
7+
header("location: index.php");
8+
exit();
9+
}
10+
else
11+
{
12+
?>
13+
<body >
14+
<?php include "inc/navbar.php";?>
15+
<div class="container-fluid" style="max-width: 1200px;margin: 0 auto;">
16+
17+
18+
<!-- Navbar -->
19+
<?php
20+
include "inc/sidebar.php";
21+
?>
22+
<!-- End Navbar -->
23+
24+
<div class="col-md-10 content">
25+
<div class="panel panel-default">
26+
<div class="panel-heading">
27+
<?php echo $icon.' '.$title;?>
28+
</div>
29+
30+
<div class="panel-body">
31+
32+
<?php
33+
34+
include $content;
35+
36+
37+
?>
38+
39+
</div>
40+
</div>
41+
</div>
42+
43+
44+
45+
46+
<?php include "inc/footer.php";?>
47+
48+
</div>
49+
50+
<?php include "inc/jquery.php";?>
51+
52+
<script type="text/javascript">
53+
$(function () {
54+
$('.navbar-toggle-sidebar').click(function () {
55+
$('.navbar-nav').toggleClass('slide-in');
56+
$('.side-body').toggleClass('body-slide-in');
57+
$('#search').removeClass('in').addClass('collapse').slideUp(200);
58+
});
59+
60+
$('#search-trigger').click(function () {
61+
$('.navbar-nav').removeClass('slide-in');
62+
$('.side-body').removeClass('body-slide-in');
63+
$('.search-input').focus();
64+
});
65+
});
66+
67+
68+
</script>
69+
70+
</body>
71+
<?php
72+
}?>

admin/inc/add-download.php

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
<p id="msg-display"></p>
3+
<div class="col-md-9">
4+
<div class="card">
5+
<div class="card-body">
6+
7+
8+
<?php
9+
$product_code = substr(md5(uniqid(mt_rand(), true)) , 0, 8);
10+
?>
11+
12+
<div class="row">
13+
<div class="col-md-12 col-md-offset-2">
14+
<form id="add_dlink_form" method="post">
15+
16+
17+
18+
<div class="form-group row">
19+
20+
<div class="col-md-12">
21+
<label for="username" class="col-4 col-form-label">Product Code</label>
22+
<input id="pcode" name="pcode" placeholder="Code" value="<?php echo $product_code; ?>" class="form-control here" type="text">
23+
24+
<small>Enter your random 8 digit code.</small>
25+
</div>
26+
27+
28+
29+
</div>
30+
31+
<div class="form-group row">
32+
33+
<div class="col-md-12">
34+
<label for="username" class="col-4 col-form-label">File Download Path</label>
35+
<input id="url" name="url" placeholder="URL" class="form-control here" type="text">
36+
37+
<small>Enter your File Download Path or URL link.</small>
38+
</div>
39+
40+
41+
42+
</div>
43+
44+
45+
46+
<div class="form-group row">
47+
<div class="offset-4 col-8">
48+
<button type="submit" id="add_link" class="btn btn-primary pull-right"><i class="fas fa-plus"></i> Add</button>
49+
</div>
50+
</div>
51+
</form>
52+
</div>
53+
</div>
54+
55+
56+
<br/><br/>
57+
58+
59+
60+
</div>
61+
</div>
62+
</div>

admin/inc/curd/add_dlink.php

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
//var_dump($_POST);
3+
include('../../../include/connect.php');
4+
5+
//var_dump($_POST);
6+
7+
$pcode = mysqli_real_escape_string($dbc,$_POST['pcode']);
8+
$url = mysqli_real_escape_string($dbc,$_POST['url']);
9+
10+
//smtp
11+
12+
13+
if(isset($pcode,$url))
14+
{
15+
if(preg_match( '/^(http|https):\\/\\/[a-z0-9_]+([\\-\\.]{1}[a-z_0-9]+)*\\.[_a-z]{2,5}'.'((:[0-9]{1,5})?\\/.*)?$/i' ,$url))
16+
{
17+
18+
$stmt = $dbc->prepare("SELECT did FROM dlinks where d_link = ?");
19+
$stmt->bind_param("s", $url);
20+
$stmt->execute();
21+
$stmt->store_result();
22+
23+
if ($stmt->num_rows <= 0 )
24+
{
25+
$stmt = $dbc->prepare("INSERT INTO dlinks(p_code, d_link, cdate) VALUES (?, ?, ?)");
26+
$stmt->bind_param("sss", $pcode, $url, $date);
27+
28+
if($stmt->execute())
29+
{
30+
echo 'recevied';
31+
}else{
32+
echo 'ERROR';
33+
}
34+
35+
36+
}else
37+
{
38+
echo 'URL Exist!'; //record already inserted
39+
}
40+
41+
42+
43+
}
44+
else {
45+
echo 'Invalid URL. Try http:// | https://';
46+
}
47+
48+
49+
50+
51+
}else{
52+
header('location:../../dashboard.php');
53+
exit();
54+
}
55+
56+
57+
58+
59+
60+
61+
62+
63+
?>

admin/inc/curd/delete_link.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
include('../../../include/connect.php');
3+
4+
$id = mysqli_real_escape_string($dbc,$_POST['del_link']);
5+
6+
if(isset($id))
7+
{
8+
9+
$stmt = $dbc->prepare("delete from dlinks where did = ?");
10+
$stmt->bind_param("i", $id);
11+
if($stmt->execute())
12+
{
13+
header('location:../../dashboard.php?page=2');
14+
exit();
15+
}
16+
17+
18+
19+
}
20+
else
21+
{
22+
exit('BAD GATEWAY!');
23+
}
24+
25+
26+
?>

admin/inc/curd/smtp.php

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
//var_dump($_POST);
3+
include('../../../include/connect.php');
4+
5+
//var_dump($_POST);
6+
7+
$host = mysqli_real_escape_string($dbc,$_POST['host']);
8+
$h_username = mysqli_real_escape_string($dbc,$_POST['h_username']);
9+
$h_pass = mysqli_real_escape_string($dbc,$_POST['h_pass']);
10+
$s_mail = mysqli_real_escape_string($dbc,$_POST['s_mail']);
11+
$r_mail = mysqli_real_escape_string($dbc,$_POST['r_mail']);
12+
13+
//smtp
14+
15+
16+
17+
if(isset($host) && $host!=='')
18+
{
19+
$sql="update mailing set host='$host'";
20+
if($dbc->query($sql))
21+
{
22+
echo 'recevied';
23+
}
24+
25+
}else{
26+
header('location:../../dashboard.php');
27+
exit();
28+
}
29+
30+
if(isset($h_username) && $h_username!=='')
31+
{
32+
$sql="update mailing set user_name='$h_username'";
33+
if($dbc->query($sql))
34+
{
35+
echo 'recevied';
36+
}
37+
38+
}else{
39+
header('location:../../dashboard.php');
40+
exit();
41+
}
42+
43+
if(isset($h_pass) && $h_pass!=='')
44+
{
45+
$sql="update mailing set pass_word='$h_pass'";
46+
if($dbc->query($sql))
47+
{
48+
echo 'recevied';
49+
}
50+
51+
}else{
52+
header('location:../../dashboard.php');
53+
exit();
54+
}
55+
56+
57+
if(isset($s_mail) && $s_mail!=='')
58+
{
59+
$sql="update mailing set setFrom='$s_mail'";
60+
if($dbc->query($sql))
61+
{
62+
echo 'recevied';
63+
}
64+
65+
}else{
66+
header('location:../../dashboard.php');
67+
exit();
68+
}
69+
70+
71+
if(isset($r_mail) && $r_mail!=='')
72+
{
73+
$sql="update mailing set addAddress='$r_mail'";
74+
if($dbc->query($sql))
75+
{
76+
echo 'recevied';
77+
}
78+
79+
}else{
80+
header('location:../../dashboard.php');
81+
exit();
82+
}
83+
84+
85+
86+
87+
88+
89+
?>

admin/inc/curd/update_admin.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
//var_dump($_POST);
3+
include('../../../include/connect.php');
4+
5+
$uname = mysqli_real_escape_string($dbc,$_POST['username']);
6+
$pwd = mysqli_real_escape_string($dbc,$_POST['password']);
7+
8+
9+
if(isset($uname) && $uname!=='')
10+
{
11+
$sql="update admin_login set username='$uname'";
12+
if($dbc->query($sql))
13+
{
14+
echo 'success';
15+
}
16+
}else{
17+
header('location:../../dashboard.php');
18+
exit();
19+
}
20+
21+
if(isset($pwd) && $pwd!=='')
22+
{
23+
$sql="update admin_login set password='$pwd', encrypt_type='TXT'";
24+
if($dbc->query($sql))
25+
{
26+
echo 'success';
27+
28+
}
29+
}else
30+
{
31+
header('location:../../dashboard.php');
32+
exit();
33+
}
34+
35+
36+
37+
38+
39+
40+
?>

0 commit comments

Comments
 (0)