Skip to content
Snippets Groups Projects
Commit cc40f2ca authored by Genvictus's avatar Genvictus
Browse files

rfc: code cleanup

parent 57c3e740
Branches
Tags
No related merge requests found
...@@ -20,7 +20,8 @@ class PDOHandler ...@@ -20,7 +20,8 @@ class PDOHandler
$option = [ $option = [
PDO::ATTR_PERSISTENT => true, PDO::ATTR_PERSISTENT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
]; ];
$retry = CONNECT_RETRIES; $retry = CONNECT_RETRIES;
......
<?php
require_once PAGE_PATH . "/templates/navbar.php";
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
...@@ -5,31 +9,14 @@ ...@@ -5,31 +9,14 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home</title> <title>Home</title>
<link rel="stylesheet" href="../../public/css/home.css" /> <link rel="stylesheet" href="/public/css/home.css" />
<link rel="stylesheet" href="/public/css/shared.css" />
</head> </head>
<body> <body>
<div class="layout"> <?php
<div class="layout__left-sidebar"> echo Navbar();
<img src="../../public/assets/github_home_logo.png" class="brand" /> ?>
<div class="sidebar-menu">
<div class="sidebar-menu__item sidebar-menu__item--active">
<img src="../../public/assets/home.svg" class="sidebar-menu__item-icon" />
Home
</div>
<div class="sidebar-menu__item">
<img src="../../public/assets/followed.jpg" class="sidebar-menu__item-icon" />
Followed
</div>
<div class="../../public/assets/sidebar-menu__item">
<img src="../../public/assets/profile.svg" class="sidebar-menu__item-icon" />
Profile
</div>
</div>
</div>
<div id="list-post">
</div>
</div>
<script src="/public/js/home.js"></script> <script src="/public/js/home.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
src/public/assets/github_home_logo.png

7.83 KiB

src/public/assets/github_post_logo.jpg

41.3 KiB

...@@ -73,7 +73,7 @@ function createPost(data,totalsemuapage,pagenow){ ...@@ -73,7 +73,7 @@ function createPost(data,totalsemuapage,pagenow){
makePagination(totalsemuapage,pagenow); makePagination(totalsemuapage,pagenow);
} }
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
const url = 'http://localhost:8008/api/getpost/0'; const url = '/api/getpost/0';
xhr.open('GET', url, true); xhr.open('GET', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
...@@ -154,7 +154,7 @@ function klikPagination(totalPages,page){ ...@@ -154,7 +154,7 @@ function klikPagination(totalPages,page){
function changePage(page){ function changePage(page){
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
var getpage = (page-1); var getpage = (page-1);
const url = 'http://localhost:8008/api/getpost/'+getpage.toString(); const url = '/api/getpost/'+getpage.toString();
xhr.open('GET', url, true); xhr.open('GET', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment