You are on page 1of 14

Source Code Documentation

Project Name: Shoot at Site


By: Abdul Azeemuddin (912667)
Project Manager: Shah – (564549)
Date of implementation: 05-06-2021
SOURCE CODE
DOCUMENTATION
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

Contents
DESCRIPTION .............................................................. 2
OVERVIEW ..................................................................... 3
LANDING PAGE | SHOOT AT SITE ........................................................ 3
LOGIN PAGE | SHOOT AT SITE .............................................................. 3
ACCESSORIES PAGE | SHOOT AT SITE ................................................ 4
CHECKOUT PAGE | SHOOT AT SITE .................................................... 4
SOURCE CODES SNAPSHOTS | SHOOT AT SITE ............................ 5
HTML- .............................................................................................................. 5
CSS – ................................................................................................................ 5
JS – .................................................................................................................... 5
PHP – ............................................................................................................... 5
SQL - ................................................................................................................ 5
LANDING PAGE: .......................................................................................... 5
HTML ............................................................................................................... 5
CSS.................................................................................................................... 6
JS: ....................................................................................................................... 6
PHP: .................................................................................................................. 7
SQL: .................................................................................................................. 7
IMPORTANT CODES: ................................................................................. 8
XAAMP CONTROL PANEL: .................................................................. 12
REFERENCES: ............................................................................................. 13

CTS-ID-912667 Page 1 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

DESCRIPTION
To create a Website for photography and media, and this webpage will also be
used for hiring the accessories. With the help of shoot at site people can easily
book a photographer and can get their things done easily.

Keywords: Photography, Media, Accessories.


Languages used:
1. HTML (Hyper-Text-Markup-Language)
2. CSS (Cascading Style Sheets), JS(Java-Script)
3. MySQL
4. PHP
IDE’s Used:
1. Brackets
2. Visual Studio (for ASP.NET Web App)
Tools Used:
XAAMP Control Panel

CTS-ID-912667 Page 2 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

OVERVIEW
Landing Accessories
Login page Checkout
Page page

Landing Page | Shoot at Site

lleries include items that are designed to coordinate with the overall look of your document. You
can use these galleries to insert tables, headers, footers, lists, cover pages, and other document
building blocks. Most controls offer a choice of using the look from the current theme or using a
format that you specify directly.

The quote is bold and distinctive. The galleries include items that are
designed to coordinate with the overall look of your document.

Login Page | Shoot at Site

Use SmartArt and Charts to display your data. Go to the Insert Tab and you’ll find those two
options. Choose which one suits your needs

CTS-ID-912667 Page 3 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

ACCESSORIES PAGE | SHOOT AT SITE

CHECKOUT PAGE | SHOOT AT SITE

CTS-ID-912667 Page 4 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

SOURCE CODES SNAPSHOTS | SHOOT AT SITE


HTML-
CSS –
JS –
PHP –
SQL -

LANDING PAGE:
HTML

CTS-ID-912667 Page 5 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

CSS

JS:

CTS-ID-912667 Page 6 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

PHP:

SQL:

CTS-ID-912667 Page 7 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

IMPORTANT CODES:
<?php
require('db.php');
session_start();
// When form submitted, check and create user session.
if (isset($_POST['username'])) {
$username = stripslashes($_REQUEST['username']); // removes backslashes
$username = mysqli_real_escape_string($con, $username);
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con, $password);
// Check user is exist in the database
$query = "SELECT * FROM `users` WHERE username='$username'
AND password='" . md5($password) . "'";
$result = mysqli_query($con, $query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if ($rows == 1) {
$_SESSION['username'] = $username;
// Redirect to user dashboard page
header("Location: dashboardd.php");
} else {
echo "<div class='form'>
<h3>Incorrect Username/password.</h3><br/>
<p class='link'>Click here to <a href='inner-page.html'>Login</a> again.</p>
</div>";
}
} else {
?>
<form class="form" method="post" name="login">
<h1 class="login-title">Login</h1>
<input type="text" class="login-input" name="username" placeholder="Username"
autofocus="true"/>
<input type="password" class="login-input" name="password" placeholder="Password"/>
CTS-ID-912667 Page 8 of 14
<input type="submit" value="Login" name="submit" class="login-button"/>
<p class="link">Don't have an account? <a href="registration.php">Register Now</a></p>
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

@media (prefers-reduced-motion: no-preference) {


:root {
scroll-behavior: smooth;
}
}

body {
margin: 0;
font-family: var(--bs-font-sans-serif);
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}

hr:not([size]) {
height: 1px;
}

h6, .h6, h5, .h5, h4, .h4, h3, .h3, h2, .h2, h1, .h1 {
margin-top: 0;
CTS-ID-912667 Page 9 of 14
margin-bottom: 0.5rem;
font-weight: 500;
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

\ function Signup(){
var checkUsername = 0;
var id=idup;
var level=0;
var username = document.getElementById('usernameSignup').value;
var password = document.getElementById('passwordSignup').value;
var Repassword = document.getElementById('RepasswordSignup').value;
if (username != '' && password !='' && Repassword !='' && password == Repassword) {
for(let i = 0; i < account.length; i++) {
if (account[i].username== username) {

checkUsername = 1;
break;
}
}
if (checkUsername == 0) {
accountSignup = {id,username,password,level};
account.push(accountSignup);

localStorage.setItem("account", JSON.stringify(account));

checkLogin = id;
localStorage.setItem("checkLogin", JSON.stringify(checkLogin));

var id=idup++;
localStorage.setItem("idup", JSON.stringify(idup));
console.log(account);
document.getElementById("statusSignup").innerHTML="Logged in successfully";
document.getElementById("menu_account_login").innerHTML = username;
document.getElementById("menu_account_login").style.display = 'block';
document.getElementById("menu_login_button").style.display = 'none';
CTS-ID-912667 Page 10 of 14
document.getElementById("hello_user").innerHTML ="Hello "+username+" !";
document.getElementById("menu_logout").style.display = 'block';
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021
CREATE DATABASE adminlogin;
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`create_datetime` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

XAAMP and PhpMyAdmin:


--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `email`, `password`, `create_datetime`) VALUES


(6, 'admin', 'xyz@gmail.com', '202cb962ac59075b964b07152d234b70', '2021-06-03 17:40:06'),
(7, 'admin', 'admin123@gmail.com', 'azeem123', '2021-06-03 18:41:07'),
(8, 'admin', 'abc1233@gmail.com', '8b2e856caabd692a4ac4c8f026a15065', '2021-06-03 18:42:31'),
(9, 'rahul', 'rahul123@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b', '2021-06-03 19:10:44');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--CTS-ID-912667 Page 11 of 14
-- AUTO_INCREMENT for table `users`
--
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

XAAMP Control Panel and PhpMyAdmin:

CTS-ID-912667 Page 12 of 14
Azure IOT Boot Camp by SHAH Wednesday, June 16, 2021

REFERENCES

1. W3 Schools -
https://www.w3schools.com/html/default.asp

2. Tutorials point-
https://www.tutorialspoint.com/php/index.htm

3. W3 Schools -
https://www.w3schools.com/sql/default.asp

CTS-ID-912667 Page 13 of 14

You might also like