-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fullcalendar, timeline, profile update, todo statics, regex password …
…control
- Loading branch information
1 parent
faf8432
commit d1bb185
Showing
15 changed files
with
520 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
<?php | ||
|
||
if (route(0) == 'home') { | ||
if (route(0) == 'home' && !route(1)) { | ||
|
||
view('home/home', [ | ||
'name' => 'Kutluhan', | ||
'surname' => 'Azaflı', | ||
]); | ||
$return = model('home', [], 'list'); | ||
|
||
view('home/home', $return['data']); | ||
} | ||
|
||
elseif (route(0) == 'home' && route(1) == 'calendar') { | ||
|
||
view('home/calendar'); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
view('profile/home'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
if ($process == 'list') { | ||
|
||
$q = $db->prepare('SELECT todos.*, category_title FROM todos | ||
LEFT JOIN categories on categories.category_id = todos.category_id | ||
WHERE todos.user_id = ? && todo_status =? ORDER BY todo_start_date ASC'); | ||
$q->execute([get_session('user_id'), 'c']); | ||
$todos = $q->fetchAll(PDO::FETCH_ASSOC); | ||
|
||
$q = $db -> prepare("SELECT todo_status, COUNT(todos.todo_id) as total, | ||
(COUNT(todos.todo_id) * 100 / (SELECT COUNT(todo_id) FROM todos WHERE user_id = ?)) as percentage | ||
FROM todos WHERE todos.user_id = ? | ||
GROUP BY todos.todo_status"); | ||
$get = $q -> execute([get_session('user_id'), get_session('user_id')]); | ||
|
||
if ($q -> rowCount()) { | ||
|
||
return [ | ||
'success' => true, | ||
'type' => 'success', | ||
'data' => array_merge(['stats' => $q -> fetchAll(PDO::FETCH_ASSOC)], ['continue' => $todos]) | ||
]; | ||
|
||
} else { | ||
|
||
return [ | ||
'success' => false, | ||
'type' => 'success', | ||
'data' => [] | ||
]; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php view('static/header'); ?> | ||
<div class="wrapper"> | ||
<nav class="main-header navbar navbar-expand navbar-white navbar-light"> | ||
<ul class="navbar-nav ml-auto"> | ||
<li class="nav-item d-none d-sm-inline-block"> | ||
<a href="<?= URL . 'logout'; ?>" class="nav-link">Logout</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
<?php view('static/sidebar'); ?> | ||
<div class="content-wrapper p-2"> | ||
<div class="content"> | ||
<div id="calendar"> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
<?php view('static/footer'); ?> | ||
</div> | ||
|
||
<script src="<?= assets('plugins/jquery/jquery.min.js'); ?>"></script> | ||
<script src="<?= assets('plugins/bootstrap/js/bootstrap.bundle.min.js'); ?>"></script> | ||
<script src="<?= assets('js/adminlte.min.js'); ?>"></script> | ||
<script src="<?= assets('plugins/fullcalendar/locales-all.js'); ?>"></script> | ||
<script src="<?= assets('plugins/fullcalendar/main.js'); ?>"></script> | ||
<script> | ||
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
var calendarEl = document.getElementById('calendar'); | ||
var calendar = new FullCalendar.Calendar(calendarEl, { | ||
initialView: 'dayGridMonth', | ||
locale: '<?= default_lang(); ?>', | ||
events : '<?= url('api/calendar/') ?>' | ||
}); | ||
calendar.render(); | ||
}); | ||
|
||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.