PENGURUSAN GYM
Versi Tarikh Diluluskan Pemilik
1.0 14/3/2024 MOHAMAD HARIDZ BIN
MOHAMED HAIRUDDIN
1. Tujuan
Dokumentasi ini bertujuan sebagai keperluan untuk mengurus kod sumber, memastikan
kawalan versi, mengurus dokumen berkaitan dan mengawal risiko kehilangan kod
sumber.
2. Maklumat Asas
2.1 Sistem
• Configurasi system
-HTML
-CSS
-Javascript
Website : GYMBROS.COM
2.3 Hubungi
3. Kod Sumber
Skrin pertama:
Keterangan : Ini adalah untuk pengguna login apabila mereka ada member.
Jika tidak ada member boleh menekan butang sign up
Kod Sumber:
TEMPLATE SOURCE CODE
Html :
<html>
<head>
<title> LOGIN Validationm </title>
<!-- Include CSS File Here -->
<link rel="stylesheet" href="logStyle.css"/>
<!-- Include JS File Here -->
<script src="login2.js"></script>
</head>
<body>
<body style="background-color:powderblue;">
<div class="container">
<div class="main">
<h2>Javascript Login Form Validation</h2>
<!--INI ADALAH UNTUK MEMBUAT FORM LOGIN-->
<form id="form_id" method="post" name="myform"> <br>
<label>User Name :</label>
<input type="text" name="username" id="username"/>
<label>Password :</label>
<input type="password" name="password" id="password">
</body>
</html>
CSS :
/* Below line is used for online Google font */
@import url(http://fonts.googleapis.com/css?family=Raleway);
h2{
background-color: #FEFFED;
padding: 30px 35px;
margin: -10px -50px;
text-align:center;
border-radius: 10px 10px 0 0;
}
hr{
margin: 10px -50px;
border: 0;
border-top: 1px solid #ccc;
margin-bottom: 40px;
}
div.container{
width: 900px;
height: 610px;
margin:35px auto;
font-family: 'Raleway', sans-serif;
}
div.main{
background-color: #EBF5FB ;
width: 300px;
TEMPLATE SOURCE CODE
padding: 10px 50px 25px;
border: 2px solid gray;
border-radius: 10px;
font-family: raleway;
float:left;
margin-top:50px;
}
input[type=text],input[type=password]{
width: 100%;
height: 40px;
padding: 5px;
margin-bottom: 25px;
margin-top: 5px;
border: 2px solid #ccc;
color: #4f4f4f;
font-size: 16px;
border-radius: 5px;
}
label{
color: #464646;
text-shadow: 0 1px 0 #fff;
font-size: 14px;
font-weight: bold;
}
center{
font-size:32px;
}
.note{
color:red;
}
.valid{
color:green;
}
.back{
text-decoration: none;
border: 1px solid rgb(0, 143, 255);
background-color: rgb(0, 214, 255);
padding: 3px 20px;
border-radius: 2px;
color: black;
}
input[type=button]{
font-size: 16px;
background: linear-gradient(#ffbc00 5%, #ffdd7f 100%);
border: 1px solid #e5a900;
color: #4E4D4B;
font-weight: bold;
cursor: pointer;
width: 100%;
border-radius: 5px;
padding: 10px 0;
outline:none;
}
input[type=button]:hover{
background: linear-gradient(#ffdd7f 5%, #ffbc00 100%);
}
Javascript :
var attempt = 3; // Variable to count number of attempts.
// Below function Executes on click of login button.
function validate(){
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if ( username == "Formget" && password == "formget#123"){
alert ("Login successfully");
TEMPLATE SOURCE CODE
window.location = "BMI_kira.html"; // Redirecting to other page.
return false;
}
else{
attempt --;// Decrementing by one.
alert("You have left "+attempt+" attempt;");
// Disabling fields after 3 attempts.
if( attempt == 0){
document.getElementById("username").disabled = true;
document.getElementById("password").disabled = true;
document.getElementById("submit").disabled = true;
return false;
}
}
}
Skrin kedua:
Keterangan : Paparan ini adalah untuk pengguna gym yang ingin menjadi
TEMPLATE SOURCE CODE
member dan paparan kedua adalah apabila pengguna sudah menekan
butang submit
Kod Sumber:
<!DOCTYPE html>
<html>
<head>
<title>Web Form</title>
<!--link rel='stylesheet' type='text/css' href=''/>
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'
type='text/css'-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"> </script>
<!--script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script-->
<!--script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script--
>
<script >
function display() {
DispWin = window.open('','NewWin','toolbar=yes,status=yes,width=700,height=500')
var items=document.getElementsByName('langz');
var selectItems="";
for(var i=0; i<items.length; i++){
if(items[i].type=='checkbox' && items[i].checked==true)
selectItems+= " ~ " + items[i].value;
}
/* INI ADALAH CARA UNTUK MEMBUAT PAPARAN SELEPAS MENEKAN BUTANG SUBMIT */
message = "<b>THANK YOU!</b><BR> Now you can enjoy membership benefits. Here are
your details upon registration:- <pre>" ;
message += "<ul><li>Fisrst NAME: <b>" + document.answer.firstName.value + "</b>";
message += "<li> Last Name : <b>" + document.answer.lastName.value + "</b>";
message += "<li> E-mail : <b>" + document.answer.email.value + "</b>";
message += "<li> Gender : <b>" + document.answer.gen.value + "</b>";
message += "<li> Address : <b>" + document.answer.addr.value + "</b>";
message += "<li> Nationality : <b>" + document.answer.nation.value + "</b>";
message += "<li> Birthday : <b>" + document.answer.bday.value + "</b>";
message += "<li> Contact no. : <b>" + document.answer.telno.value + "</b>";
message += "<li> Language :" + (selectItems) + "</ul>" + "<br>" +
'<br> <input type="button" value="Print" onclick="window.print()" />' ;
DispWin.document.write(message);
}
</script> </head>
<body>
<body style="background-color:powderblue;"> <center>
<div style="background-color:#0F0F8C ;height:45px">
<CENTER><h1 style="color:white">PUSAT GYM</h1> </CENTER>
</div>
Skrin ketiga:
Keterangan : Paparan ini adalah selepas pengguna berjaya log masuk dan
ini adalah untuk pengguna mengira BMI
Kod Sumber:
<!DOCTYPE html>
<html>
TEMPLATE SOURCE CODE
<head>
<title> </title>
</head>
<body>
<body style="background-color:powderblue;">
<div style="background-color:#0F0F8C ;height:45px">
<CENTER><h1 style="color:white">PUSAT GYM</h1> </CENTER>
</div>
<div header style="background-color:#EBDEF0;" ><center>
<marquee>
<p id="demo"></p>
</marquee>
</div>
<center><br>
Enter your weight in kilograms and your height in centimeters in the form below and press
the "See Result" button (Please read disclaimer below before using this form)
<P> <br>
<FORM NAME="BMI" method=POST>
<TABLE border=1>
<TR>
<TD><DIV ALIGN=CENTER> Your Weight (kg)</DIV></TD>
<TD><DIV ALIGN=CENTER> Your Height (cm)</DIV></TD>
</TR>
<TR>
<TD><INPUT TYPE=TEXT NAME=weight SIZE=15 onFocus="this.form.weight.value=''"
maxlength=3></TD>
<TD><INPUT TYPE=TEXT NAME=height SIZE=15 onFocus="this.form.height.value=''"
maxlength=3></TD>
</TR>
</TABLE>
<P>
<INPUT TYPE="button" VALUE="See Result" onClick="computeform(this.form)" style="font-
weight:bold; font-size:17px; width:auto; background-color:salmon" >
<INPUT TYPE="reset" VALUE="Reset" onClick="ClearForm(this.form)" style="font-weight:bold;
font-size:17px; width:auto; background-color:salmon" >
<!--/FORM-->
<TABLE border=1>
<TR>
<TD><DIV ALIGN=CENTER> Your BMI </DIV></TD>
<TD ><DIV ALIGN=CENTER> Comments </DIV></TD>
</TR>
<TR>
</TABLE>
</FORM>
<P><HR>
<B>Disclaimer</B>: This form is based on the calculation of
<A HREF="http://phaster.com/unpretentious/bmi.html"><I>"Body Mass Index"</I></A>
and is only meant to be a demonstration of how Javascript(tm) could be used
on a Web Page.
TEMPLATE SOURCE CODE
<br>Information it contains may not be accurate and is not designed or intended to serve as
medical advice. I am not liable for any physical or psychological damages suffered as a
result of using this script.
<SCRIPT LANGUAGE="JAVASCRIPT">
<!-- hide this script tag's contents from old browsers
function ClearForm(form){
form.weight.value = "";
form.height.value = "";
form.bmi.value = "";
form.my_comment.value = "";
bmindx=weight/eval(height*height);
return bmindx;
}
function checkform(form) {
if (form.weight.value==null||form.weight.value.length==0 || form.height.value==null||
form.height.value.length==0){
alert("\nPlease complete the form first");
return false;
}
function computeform(form) {
if (checkform(form)) {
yourbmi=Math.round(bmi(form.weight.value, form.height.value/100));
form.bmi.value=yourbmi;
if (yourbmi >40) {
form.my_comment.value="You are grossly obese, consult your physician!";
}
TEMPLATE SOURCE CODE
}
return;
}
// -- done hiding from old browsers -->
</SCRIPT>
</body>
</html>
TEMPLATE SOURCE CODE