[go: up one dir, main page]

0% found this document useful (0 votes)
64 views2 pages

$ - Session $ - Session

This document is the code for a PHP dashboard. It checks if the user is logged in with a username and password stored in sessions. If not logged in, it redirects to the login page. If logged in, it includes files for the header, navbar, and content based on a GET parameter, and links to Bootstrap, icons, and JavaScript files for the dashboard functionality.

Uploaded by

Siau Tong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views2 pages

$ - Session $ - Session

This document is the code for a PHP dashboard. It checks if the user is logged in with a username and password stored in sessions. If not logged in, it redirects to the login page. If logged in, it includes files for the header, navbar, and content based on a GET parameter, and links to Bootstrap, icons, and JavaScript files for the dashboard functionality.

Uploaded by

Siau Tong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

7/18/22, 1:55 PM dashboard.

php

1 <?php
2  session_start();
3  if (!isset($_SESSION['username']) || !isset($_SESSION['password'])) {
4    ?>
5      <script language="javascript">
6        alert('Login dulu')
7        document.location='index.php';
8      </script>
9    <?php
10 } else {
11 ?>
12 <!doctype html>
13 <html lang="en">
14  <head>
15    <meta charset="utf-8">
16    <meta name="viewport" content="width=device-width, initial-scale=1">
17    <meta name="description" content="">
18    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap
contributors">
19    <meta name="generator" content="Hugo 0.88.1">
20    <title>Dashboard - Kampus.com</title>
21
22    <!-- Bootstrap CSS -->
23    <link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-
1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous">
24    <link rel="canonical"
href="https://getbootstrap.com/docs/5.1/examples/dashboard/">
25    <!-- Icon Bootstrap CSS -->
26    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-
icons@1.8.1/font/bootstrap-icons.css">
27
28    <!-- Trix Editor -->
29    <link rel="stylesheet" type="text/css" href="trix.css">
30    <script type="text/javascript" src="trix.js"></script>
31
32    <style>
33      .bd-placeholder-img {
34        font-size: 1.125rem;
35        text-anchor: middle;
36        -webkit-user-select: none;
37        -moz-user-select: none;
38        user-select: none;
39     }
40      @media (min-width: 768px) {
41        .bd-placeholder-img-lg {
42          font-size: 3.5rem;
43       }
44     }
45    </style>
46    <link href="dashboard.css" rel="stylesheet">
47  </head>
48  <body>
49    <?php include "header.php";?>
50    <div class="container-fluid">
51      <div class="row">
52        <?php include "navbar.php";?>

localhost:4649/?mode=php 1/2
7/18/22, 1:55 PM dashboard.php

53        <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">


54          <?php
55            if(isset($_GET['dashboard'])){
56              include $_GET['dashboard'].".php";
57           }
58              else{
59                include "none.php";
60             }
61          ?>
62        </main>
63      </div>
64    </div>
65    <script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
66
67    <script src="https://cdn.jsdelivr.net/npm/feather-
icons@4.28.0/dist/feather.min.js" integrity="sha384-
uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE"
crossorigin="anonymous"></script>
68    <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"
integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha"
crossorigin="anonymous"></script>
69    <script src="dashboard.js"></script>
70  </body>
71 </html>
72 <?php
73 }
74 ?>

localhost:4649/?mode=php 2/2

You might also like