Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
FarhanShares committed Nov 5, 2020
0 parents commit ba4bc0e
Show file tree
Hide file tree
Showing 16 changed files with 2,815 additions and 0 deletions.
Binary file added assets/img/farhan-avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/flowers.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/leaves.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/rose.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions blank-tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blood Bank | Farhan Israq</title>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.7.3/dist/alpine.min.js" defer></script>
</head>
<body class="bg-gray-200 antialiased">
<header class="relative w-full bg-gray-900 overflow-hidden sticky top-0" x-data="{navigationOpen: false}">
<div class=" flex justify-between items-center text-white px-6 container mx-auto">
<div class="flex items-center h-16 z-50 hover:text-red-500">
<a href="/">
Bloodbank.
</a>
</div>
<div class="flex justify-end items-center">
<div class="flex lg:mt-0 items-center lg:block py-16 scale lg:py-0 fixed lg:static w-2/3 lg:w-auto left-0 top-0 bottom-0 overflow-x-auto bg-gray-700 lg:bg-gray-900 z-30 transform transition-all duration-300 origin-top-left lg:origin-right" @click.away="navigationOpen = false" x-show="navigationOpen" x-transition:enter-start="opacity-0 lg:scale-75" x-transition:enter-end="opacity-100 lg:scale-100" x-transition:leave-start="opacity-100 lg:scale-100" x-transition:leave-end="opacity-0 lg:scale-75">
<ul class="flex text-white text-lg lg:text-sm flex-wrap items-center max-h-full overflow-auto">
<li class="lg:mx-2 w-full lg:w-auto shadow lg:shadow-none">
<a href="/search.php" class="p-4 block hover:text-red-500">Search</a>
</li>
<li class="lg:mx-2 w-full lg:w-auto shadow lg:shadow-none">
<a href="/request.php" class="p-4 block hover:text-red-500">Request</a>
</li>
<li class="lg:mx-2 w-full lg:w-auto shadow lg:shadow-none">
<a href="/profile.php" class="p-4 block hover:text-red-500">Profile</a>
</li>
<li class="lg:mx-2 w-full lg:w-auto shadow lg:shadow-none">
<a href="/logout.php" class="p-4 block hover:text-red-500">Logout</a>
</li>
</ul>
</div>
<button class="flex justify-center flex-col w-6 h-8 space-y-1 flex-wrap focus:outline-none" @click="navigationOpen = !navigationOpen">
<span class="h-1 w-6 bg-white rounded" x-show.transition="!navigationOpen"></span>
<span class="h-1 w-6 bg-white rounded"></span>
<span class="h-1 w-6 bg-white rounded" x-show.transition="!navigationOpen"></span>
</button>
</div>
</div>
</header>
<main class="px-5 mx-auto my-3 ">
<section class="rounded bg-white shadow my-2 h-screen">
Hello
</section>
</main>
<footer class="flex flex-col justify-between items-start px-6 py-2 bg-gray-900 sm:flex-row">
<div>
<a href="#" class="text-xl font-bold text-gray-100 hover:text-gray-400">Bloodbank.</a>
<br>
<a href="https://farhanshares.com" class="mt-1 flex items-center text-gray-500">
<span>
Created with
</span>
<span>
<svg class=" w-5 h-4 text-red-500 " fill="currentColor" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"></path>
</svg>
</span>
by Farhan Israq
</a>
</div>
<p class="py-2 text-gray-100 sm:py-0">All rights reserved &copy; 2020</p>
<div class="flex -mx-2">
<a href="https://linkedin.com/farhanshares" class="mx-2 text-gray-100 hover:text-gray-400" aria-label="Linkden">
<svg class="h-4 w-4 fill-current" viewBox="0 0 512 512">
<path d="M444.17,32H70.28C49.85,32,32,46.7,32,66.89V441.61C32,461.91,49.85,480,70.28,480H444.06C464.6,480,480,461.79,480,441.61V66.89C480.12,46.7,464.6,32,444.17,32ZM170.87,405.43H106.69V205.88h64.18ZM141,175.54h-.46c-20.54,0-33.84-15.29-33.84-34.43,0-19.49,13.65-34.42,34.65-34.42s33.85,14.82,34.31,34.42C175.65,160.25,162.35,175.54,141,175.54ZM405.43,405.43H341.25V296.32c0-26.14-9.34-44-32.56-44-17.74,0-28.24,12-32.91,23.69-1.75,4.2-2.22,9.92-2.22,15.76V405.43H209.38V205.88h64.18v27.77c9.34-13.3,23.93-32.44,57.88-32.44,42.13,0,74,27.77,74,87.64Z" />
</svg>
</a>
<a href="https://facebook.com/farhanshares" class="mx-2 text-gray-100 hover:text-gray-400" aria-label="Facebook">
<svg class="h-4 w-4 fill-current" viewBox="0 0 512 512">
<path d="M455.27,32H56.73A24.74,24.74,0,0,0,32,56.73V455.27A24.74,24.74,0,0,0,56.73,480H256V304H202.45V240H256V189c0-57.86,40.13-89.36,91.82-89.36,24.73,0,51.33,1.86,57.51,2.68v60.43H364.15c-28.12,0-33.48,13.3-33.48,32.9V240h67l-8.75,64H330.67V480h124.6A24.74,24.74,0,0,0,480,455.27V56.73A24.74,24.74,0,0,0,455.27,32Z" />
</svg>
</a>
<a href="https://twitter.com/farhanshares" class="mx-2 text-gray-100 hover:text-gray-400" aria-label="Twitter">
<svg class="h-4 w-4 fill-current" viewBox="0 0 512 512">
<path d="M496,109.5a201.8,201.8,0,0,1-56.55,15.3,97.51,97.51,0,0,0,43.33-53.6,197.74,197.74,0,0,1-62.56,23.5A99.14,99.14,0,0,0,348.31,64c-54.42,0-98.46,43.4-98.46,96.9a93.21,93.21,0,0,0,2.54,22.1,280.7,280.7,0,0,1-203-101.3A95.69,95.69,0,0,0,36,130.4C36,164,53.53,193.7,80,211.1A97.5,97.5,0,0,1,35.22,199v1.2c0,47,34,86.1,79,95a100.76,100.76,0,0,1-25.94,3.4,94.38,94.38,0,0,1-18.51-1.8c12.51,38.5,48.92,66.5,92.05,67.3A199.59,199.59,0,0,1,39.5,405.6,203,203,0,0,1,16,404.2,278.68,278.68,0,0,0,166.74,448c181.36,0,280.44-147.7,280.44-275.8,0-4.2-.11-8.4-.31-12.5A198.48,198.48,0,0,0,496,109.5Z" />
</svg>
</a>
</div>
</footer>
</body>
</html>
Empty file added blood-profile.php
Empty file.
59 changes: 59 additions & 0 deletions database/bloodbank-dump-0.1.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 11.0.0.5919
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


-- Dumping database structure for bloodbank
CREATE DATABASE IF NOT EXISTS `bloodbank` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `bloodbank`;

-- Dumping structure for table bloodbank.users
CREATE TABLE IF NOT EXISTS `users` (
`id` bigint(21) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`full_name` varchar(255) NOT NULL,
`age` int(5) DEFAULT NULL,
`sex` int(2) DEFAULT NULL,
`registered_at` datetime DEFAULT NULL,
`blood_group` int(2) DEFAULT NULL,
`donation_availability` int(2) DEFAULT NULL,
`donation_total_count` int(10) DEFAULT NULL,
`donation_last_date` datetime DEFAULT NULL,
`location_union` varchar(50) DEFAULT NULL,
`location_upozila` varchar(50) DEFAULT NULL,
`location_thana` varchar(50) DEFAULT NULL,
`location_district` varchar(50) DEFAULT NULL,
`location_division` varchar(50) DEFAULT NULL,
`contact_phone` int(11) DEFAULT NULL,
`contact_email` int(11) DEFAULT NULL,
`contact_facebook` int(11) DEFAULT NULL,
`contact_twitter` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

-- Dumping data for table bloodbank.users: ~8 rows (approximately)
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT IGNORE INTO `users` (`id`, `email`, `password`, `full_name`, `age`, `sex`, `registered_at`, `blood_group`, `donation_availability`, `donation_total_count`, `donation_last_date`, `location_union`, `location_upozila`, `location_thana`, `location_district`, `location_division`, `contact_phone`, `contact_email`, `contact_facebook`, `contact_twitter`) VALUES
(1, 'user@user.com', 'password', 'User 01', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 'asdf@amf.com', 'asdf', 'adsf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 'hello@hello.com', 'password', 'Hello', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(4, 'admin@admin.com', 'password', 'admin', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5, 'sdkjfhkjsd2kjsn@sdf.co', 'kjdasf', 'hell', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6, 'asd@asj.com', 'asdf', 'asdfjh', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(7, 'ishraaq21@gmail.com', '', 'Farhan Israq', 23, 1, NULL, NULL, NULL, NULL, NULL, 'asdfasd', 'dsafasdf', 'sdafasd', 'asdfas', 'sdf', 1717700433, NULL, 0, 0),
(8, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Empty file added edit.php
Empty file.
19 changes: 19 additions & 0 deletions includes/Database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

require 'Medoo.php';

use Medoo\Medoo;

$database = new Medoo([
// required
'database_type' => 'mysql',
'database_name' => 'bloodbank',
'server' => 'localhost',
'username' => 'root',
'password' => '',

// [optional]
// 'charset' => 'utf8mb4',
// 'collation' => 'utf8mb4_general_ci',
// 'port' => 3306,
]);
50 changes: 50 additions & 0 deletions includes/Functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php


// Get input or null
function getInput($key, $post = true)
{
if ($post === true) {
return isset($_POST[$key]) ? $_POST[$key] : null;
}
return isset($_GET[$key]) ? $_GET[$key] : null;
}

// Get input or empty string
function oldInput($key, $post = true)
{
if ($post === true) {
return isset($_POST[$key]) ? $_POST[$key] : '';
}
return isset($_GET[$key]) ? $_GET[$key] : '';
}

function getUserID()
{
return $_COOKIE['user_id'] ?? null;
}

function isAuthenticated()
{
return isset($_COOKIE['user_id']) ? true : false;
}




// Middlewares
function redirectIfAuthenticated()
{
if (!isAuthenticated()) {
header('Location: /signin.php');
exit;
}
}

function redirectIfNotAuthenticated()
{
if (isAuthenticated()) {
header('Location: /signin.php');
exit;
}
}
Loading

0 comments on commit ba4bc0e

Please sign in to comment.