From ad3f49989534bf3622ebec1f195a862962fe0ec3 Mon Sep 17 00:00:00 2001 From: gabrielkheisa Date: Sun, 2 Oct 2022 16:13:30 +0700 Subject: [PATCH] first --- README.md | 27 ++++++++ config.php | 16 +++++ login.php | 156 +++++++++++++++++++++++++++++++++++++++++++++ logout.php | 14 ++++ register.php | 137 +++++++++++++++++++++++++++++++++++++++ reset-password.php | 106 ++++++++++++++++++++++++++++++ welcome.php | 133 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 589 insertions(+) create mode 100644 config.php create mode 100644 login.php create mode 100644 logout.php create mode 100644 register.php create mode 100644 reset-password.php create mode 100644 welcome.php diff --git a/README.md b/README.md index 8b13789..fba63d1 100644 --- a/README.md +++ b/README.md @@ -1 +1,28 @@ +

Tugas Kelompok PJPB - Smart Contracts

+ +

Anggota kelompok

+ + + +

Teknologi

+ + + + +

URL frontend: https://testapp.pjpb.gabrielkheisa.xyz/login.php

+ +

Video demonstrasi dan penjelasan: https://drive.google.com/drive/u/1/folders/1L0w71TZnqa41XFDGfoZ3mM8ILZQeZeXE

+ + + diff --git a/config.php b/config.php new file mode 100644 index 0000000..5348dc8 --- /dev/null +++ b/config.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..c711b45 --- /dev/null +++ b/login.php @@ -0,0 +1,156 @@ + + + + + + + Login + + + + +
+

Login

+

Please fill in your credentials to login.


+ + ' . $login_err . '
'; + } + ?> + +
" method="post"> +
+ + + +
+
+ + + +
+
+ +
+
+

Don't have an account? Sign up now.

+
+ + + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..84e222e --- /dev/null +++ b/logout.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/register.php b/register.php new file mode 100644 index 0000000..4b23307 --- /dev/null +++ b/register.php @@ -0,0 +1,137 @@ + + + + + + + Sign Up + + + + +
+

Sign Up

+

Please fill this form to create an account.

+
" method="post"> +
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+

Already have an account? Login here.

+
+
+ + \ No newline at end of file diff --git a/reset-password.php b/reset-password.php new file mode 100644 index 0000000..5ac762b --- /dev/null +++ b/reset-password.php @@ -0,0 +1,106 @@ + + + + + + + Reset Password + + + + +
+

Reset Password

+

Please fill out this form to reset your password.

+
" method="post"> +
+ + + +
+
+ + + +
+
+ + Cancel +
+
+
+ + \ No newline at end of file diff --git a/welcome.php b/welcome.php new file mode 100644 index 0000000..edb1c5c --- /dev/null +++ b/welcome.php @@ -0,0 +1,133 @@ + + + + + + + Welcome + + + + +
+ +

Hi, . Welcome to our site.

+

Your role is .

+

Your certificate hash is ";?>.

+

Download certificate here : .

+ + "; + echo ""; + +class TableRows extends RecursiveIteratorIterator { + function __construct($it) { + parent::__construct($it, self::LEAVES_ONLY); + } + + function current() { + return ""; + } + + function beginChildren() { + echo ""; + } + + function endChildren() { + echo "" . "\n"; + } +} + +// Include config file +require_once "config.php"; + +$servername = DB_SERVER; +$dbname = DB_USERNAME; +$username = DB_PASSWORD; +$password = DB_NAME; + +try { + $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("SELECT username, role, hash FROM user_pjpb"); + $stmt->execute(); + + // set the resulting array to associative + $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); + + foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) { + echo $v; + } +} +catch(PDOException $e) { + echo "Error: " . $e->getMessage(); +} +$conn = null; +echo "
UsernameRoleCertificate hash
" . parent::current(). "


"; + + + } + + + ?> + +

+ Reset Your Password

+ Sign Out of Your Account +

+ + + \ No newline at end of file