Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor directory structure and update script paths #118

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 9 additions & 52 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,61 +1,18 @@
# Disable directory browsing
Options All -Indexes

# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------

# force HTTPS
# RewriteCond %{HTTPS} !on
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

# <IfModule mod_headers.c>
# Header always set Strict-Transport-Security "max-age=31536000;includeSubDomains"
# </IfModule>

# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

# If you installed CodeIgniter in a subfolder, you will need to
# change the following line to match the subfolder you need.
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
# RewriteBase /
RewriteEngine On

# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1

# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to the front controller, index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

# Ensure Authorization header is passed along
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
ErrorDocument 404 index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php
</IfModule>

# Disable server signature start
ServerSignature Off
# Disable server signature end

# block access
RedirectMatch 403 .env
RedirectMatch 403 .gitattributes
Expand Down
2 changes: 1 addition & 1 deletion app/Views/admin/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
</div>
</div>
<!-- Chartist JS -->
<script src="<?= base_url('public/assets/js/plugins/chartist.min.js') ?>"></script>
<script src="<?= base_url('assets/js/plugins/chartist.min.js') ?>"></script>
<script>
$(document).ready(function() {
initDashboardPageCharts();
Expand Down
2 changes: 1 addition & 1 deletion app/Views/admin/generate-laporan/laporan-guru.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?= $this->section('content') ?>
<table>
<tr>
<td><img src="<?= base_url('public/assets/img/logo_sekolah.jpg'); ?>" width="100px" height="100px"></img></td>
<td><img src="<?= base_url('assets/img/logo_sekolah.jpg'); ?>" width="100px" height="100px"></img></td>
<td width="100%">
<h2 align="center">DAFTAR HADIR GURU</h2>
<h4 align="center"><?= $namaSekolah; ?></h4>
Expand Down
2 changes: 1 addition & 1 deletion app/Views/admin/generate-laporan/laporan-siswa.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?= $this->section('content') ?>
<table>
<tr>
<td><img src="<?= base_url('public/assets/img/logo_sekolah.jpg'); ?>" width="100px" height="100px"></img></td>
<td><img src="<?= base_url('assets/img/logo_sekolah.jpg'); ?>" width="100px" height="100px"></img></td>
<td width="100%">
<h2 align="center">DAFTAR HADIR SISWA</h2>
<h4 align="center"><?= $namaSekolah; ?></h4>
Expand Down
6 changes: 3 additions & 3 deletions app/Views/scan/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
</div>
</div>

<script type="text/javascript" src="<?= base_url('public/assets/js/plugins/zxing/zxing.min.js') ?>"></script>
<script src="<?= base_url('public/assets/js/core/jquery-3.5.1.min.js') ?>"></script>
<script type="text/javascript" src="<?= base_url('assets/js/plugins/zxing/zxing.min.js') ?>"></script>
<script src="<?= base_url('assets/js/core/jquery-3.5.1.min.js') ?>"></script>
<script type="text/javascript">
let selectedDeviceId = null;
let audio = new Audio("<?= base_url('public/assets/audio/beep.mp3'); ?>");
let audio = new Audio("<?= base_url('assets/audio/beep.mp3'); ?>");
const codeReader = new ZXing.BrowserMultiFormatReader();
const sourceSelect = $('#pilihKamera');

Expand Down
8 changes: 4 additions & 4 deletions app/Views/templates/css.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- CSS Files -->
<link href="<?= base_url('public/assets/fonts/fonts.css'); ?>" rel="stylesheet" />
<link href="<?= base_url('public/assets/css/material-dashboard.css'); ?>" rel="stylesheet" />
<link href="<?= base_url('assets/fonts/fonts.css?v=1.0.0'); ?>" rel="stylesheet" />
<link href="<?= base_url('assets/css/material-dashboard.css'); ?>" rel="stylesheet" />

<link rel="apple-touch-icon" sizes="76x76" href="<?= base_url('public/assets/img/apple-icon.png'); ?>">
<link rel="icon" type="image/png" href="<?= base_url('public/assets/img/favicon.png'); ?>">
<link rel="apple-touch-icon" sizes="76x76" href="<?= base_url('assets/img/apple-icon.png'); ?>">
<link rel="icon" type="image/png" href="<?= base_url('assets/img/favicon.png'); ?>">
8 changes: 4 additions & 4 deletions app/Views/templates/fixed_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
<li class="header-title">Background Image</li>
<li class="active">
<a class="img-holder switch-trigger" href="javascript:void(0)">
<img src="<?= base_url('public/assets/img/sidebar/sidebar-1.jpg'); ?>" alt="">
<img src="<?= base_url('assets/img/sidebar/sidebar-1.jpg'); ?>" alt="">
</a>
</li>
<li>
<a class="img-holder switch-trigger" href="javascript:void(0)">
<img src="<?= base_url('public/assets/img/sidebar/sidebar-2.jpg'); ?>" alt="">
<img src="<?= base_url('assets/img/sidebar/sidebar-2.jpg'); ?>" alt="">
</a>
</li>
<li>
<a class="img-holder switch-trigger" href="javascript:void(0)">
<img src="<?= base_url('public/assets/img/sidebar/sidebar-3.jpg'); ?>" alt="">
<img src="<?= base_url('assets/img/sidebar/sidebar-3.jpg'); ?>" alt="">
</a>
</li>
<li>
<a class="img-holder switch-trigger" href="javascript:void(0)">
<img src="<?= base_url('public/assets/img/sidebar/sidebar-4.jpg'); ?>" alt="">
<img src="<?= base_url('assets/img/sidebar/sidebar-4.jpg'); ?>" alt="">
</a>
</li>
</ul>
Expand Down
14 changes: 7 additions & 7 deletions app/Views/templates/js.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Core JS Files -->
<script src="<?= base_url('public/assets/js/core/jquery-3.5.1.min.js') ?>"></script>
<script src="<?= base_url('public/assets/js/core/bootstrap.bundle.min.js') ?>"></script>
<script src="<?= base_url('public/assets/js/core/popper.min.js') ?>"></script>
<script src="<?= base_url('public/assets/js/core/bootstrap-material-design.min.js') ?>"></script>
<script src="<?= base_url('assets/js/core/jquery-3.5.1.min.js') ?>"></script>
<script src="<?= base_url('assets/js/core/bootstrap.bundle.min.js') ?>"></script>
<script src="<?= base_url('assets/js/core/popper.min.js') ?>"></script>
<script src="<?= base_url('assets/js/core/bootstrap-material-design.min.js') ?>"></script>

<script src="<?= base_url('public/assets/js/plugins/perfect-scrollbar.jquery.min.js') ?>"></script>
<script src="<?= base_url('assets/js/plugins/perfect-scrollbar.jquery.min.js') ?>"></script>
<!-- Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script src="<?= base_url('public/assets/js/plugins/nouislider.min.js') ?>"></script>
<script src="<?= base_url('assets/js/plugins/nouislider.min.js') ?>"></script>
<!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->
<script src="<?= base_url('public/assets/js/material-dashboard.js') ?>" type="text/javascript"></script>
<script src="<?= base_url('assets/js/material-dashboard.js') ?>" type="text/javascript"></script>
2 changes: 1 addition & 1 deletion app/Views/templates/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
break;
}
?>
<div class="sidebar" data-color="<?= $sidebarColor; ?>" data-background-color="black" data-image="<?= base_url('public/assets/img/sidebar/sidebar-1.jpg'); ?>">
<div class="sidebar" data-color="<?= $sidebarColor; ?>" data-background-color="black" data-image="<?= base_url('assets/img/sidebar/sidebar-1.jpg'); ?>">
<!--
Tip 1: You can change the color of the sidebar using: data-color="purple | azure | green | orange | danger"

Expand Down
2 changes: 1 addition & 1 deletion app/Views/templates/starting_page_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Absensi QR Code</title>
<style>
.bg {
background: url(<?= base_url('public/assets/img/bg2.jpg'); ?>) center;
background: url(<?= base_url('assets/img/bg2.jpg'); ?>) center;
opacity: 0.1;
background-size: cover;
height: 100vh;
Expand Down
56 changes: 0 additions & 56 deletions index.php

This file was deleted.

14 changes: 7 additions & 7 deletions public/assets/fonts/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('material-icons.woff2') format('woff2');
src: url('./material-icons.woff2') format('woff2');
}

.material-icons {
Expand All @@ -25,7 +25,7 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: url('Roboto-Light.ttf');
src: url('./Roboto-Light.ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

Expand All @@ -35,7 +35,7 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: url('Roboto-Regular.ttf');
src: url('./Roboto-Regular.ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

Expand All @@ -45,7 +45,7 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: url('Roboto-Medium.ttf');
src: url('./Roboto-Medium.ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

Expand All @@ -54,7 +54,7 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: url('Roboto-Bold.ttf');
src: url('./Roboto-Bold.ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

Expand All @@ -63,7 +63,7 @@
font-family: 'Roboto Slab';
font-style: normal;
font-weight: 400;
src: url('RobotoSlab-Regular.ttf');
src: url('./RobotoSlab-Regular.ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

Expand All @@ -72,6 +72,6 @@
font-family: 'Roboto Slab';
font-style: normal;
font-weight: 700;
src: url('RobotoSlab-Bold.ttf');
src: url('./RobotoSlab-Bold.ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
4 changes: 2 additions & 2 deletions spark
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert #63 spark

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ini_set('display_errors', '1');
*/

// Path to the front controller
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);

// Ensure the current directory is pointing to the front controller's directory
chdir(FCPATH);
Expand All @@ -73,7 +73,7 @@ chdir(FCPATH);

// LOAD OUR PATHS CONFIG FILE
// This is the line that might need to be changed, depending on your folder structure.
require FCPATH . 'app/Config/Paths.php';
require FCPATH . '../app/Config/Paths.php';
// ^^^ Change this line if you move your application folder

$paths = new Config\Paths();
Expand Down