Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zekena
/
Unit-calculator
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f1f29dab
authored
May 14, 2019
by
zekena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contact+styles
parent
3ab4db56
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
205 additions
and
121 deletions
categories/contact.php
categories/contact_data.csv
contact_data.csv
css/simp-Volume.css
css/simp-area.css
css/simp-length.css
css/simp-speed.css
css/simp-temp.css
css/simp-weight.css
home.html → home.php
categories/contact.php
0 → 100644
View file @
f1f29dab
<?php
if
(
isset
(
$_POST
[
"submit"
]))
{
if
(
empty
(
$_POST
[
"name"
]))
{
$error
.=
'<p><label class="text-danger">Please Enter your Name</label></p>'
;
}
else
{
$name
=
clean_text
(
$_POST
[
"name"
]);
if
(
!
preg_match
(
"/^[a-zA-Z ]*$/"
,
$name
))
{
$error
.=
'<p><label class="text-danger">Only letters and white space allowed</label></p>'
;
}
}
if
(
empty
(
$_POST
[
"email"
]))
{
$error
.=
'<p><label class="text-danger">Please Enter your Email</label></p>'
;
}
else
{
$email
=
clean_text
(
$_POST
[
"email"
]);
if
(
!
filter_var
(
$email
,
FILTER_VALIDATE_EMAIL
))
{
$error
.=
'<p><label class="text-danger">Invalid email format</label></p>'
;
}
}
if
(
empty
(
$_POST
[
"message"
]))
{
$error
.=
'<p><label class="text-danger">Message is required</label></p>'
;
}
else
{
$message
=
clean_text
(
$_POST
[
"message"
]);
}
if
(
$error
==
''
)
{
$file_open
=
fopen
(
"contact_data.csv"
,
"a"
);
$no_rows
=
count
(
file
(
"contact_data.csv"
));
if
(
$no_rows
>
1
)
{
$no_rows
=
(
$no_rows
-
1
)
+
1
;
}
$form_data
=
array
(
'sr_no'
=>
$no_rows
,
'name'
=>
$name
,
'email'
=>
$email
,
'message'
=>
$message
);
fputcsv
(
$file_open
,
$form_data
);
$error
=
'<label class="text-success">Thank you for contacting us</label>'
;
$name
=
''
;
$email
=
''
;
$message
=
''
;
}
}
categories/contact_data.csv
0 → 100644
View file @
f1f29dab
Name,Email,Message
contact_data.csv
0 → 100644
View file @
f1f29dab
zeyad
23facas
zida@gma.com
3,zeyad,zida@gma.com,23facas
4,zeyad,zida@gma.com,23facas
5,zeyad,zida@gma.com,23facas
6,zeyad,zida@gma.com,23facas
css/simp-Volume.css
View file @
f1f29dab
...
...
@@ -137,7 +137,7 @@ body{background-image: url("../Volume.jpg");
border-radius
:
17px
;
width
:
50%
;
position
:
relative
;
top
:
1
5
0px
;
top
:
10px
;
}
#theme
{
position
:
relative
;
...
...
css/simp-area.css
View file @
f1f29dab
...
...
@@ -137,7 +137,7 @@ body{ background-image: url("../Area.jpg");
border-radius
:
17px
;
width
:
50%
;
position
:
relative
;
top
:
1
5
0px
;
top
:
10px
;
}
#theme
{
position
:
relative
;
...
...
css/simp-length.css
View file @
f1f29dab
...
...
@@ -133,13 +133,12 @@ body{
-moz-box-shadow
:
16px
1px
15px
-1px
rgba
(
0
,
0
,
0
,
0.61
);
box-shadow
:
16px
1px
15px
-1px
rgba
(
0
,
0
,
0
,
0.61
);
background-color
:
#3FB74F
;
padding
:
25px
32px
;
padding
:
5px
32px
;
height
:
50%
;
border-radius
:
17px
;
width
:
5
0%
;
width
:
8
0%
;
position
:
relative
;
top
:
1
5
0px
;
top
:
10px
;
}
#theme
{
position
:
relative
;
...
...
css/simp-speed.css
View file @
f1f29dab
...
...
@@ -139,7 +139,7 @@ body{
border-radius
:
17px
;
width
:
50%
;
position
:
relative
;
top
:
1
5
0px
;
top
:
10px
;
}
#theme
{
position
:
relative
;
...
...
css/simp-temp.css
View file @
f1f29dab
...
...
@@ -135,9 +135,9 @@ body{background-image: url("../temp.jpg");
height
:
50%
;
border-radius
:
17px
;
width
:
5
0%
;
width
:
8
0%
;
position
:
relative
;
top
:
1
5
0px
;
top
:
10px
;
}
#theme
{
position
:
relative
;
...
...
css/simp-weight.css
View file @
f1f29dab
...
...
@@ -139,7 +139,7 @@ body{
border-radius
:
17px
;
width
:
50%
;
position
:
relative
;
top
:
1
5
0px
;
top
:
10px
;
}
#theme
{
position
:
relative
;
...
...
home.
html
→
home.
php
View file @
f1f29dab
<?php
$name
=
''
;
$email
=
''
;
$message
=
''
;
if
(
$_POST
[
'submit'
])
{
$name
=
$_POST
[
'name'
];
$message
=
$_POST
[
'message'
];
$email
=
$_POST
[
'email'
];
}
$file_open
=
fopen
(
"contact_data.csv"
,
"a"
);
$no_rows
=
count
(
file
(
"contact_data.csv"
));
if
(
$no_rows
>
1
)
{
$no_rows
=
(
$no_rows
-
1
)
+
1
;
}
$form_data
=
array
(
'sr_no'
=>
$no_rows
,
$name
,
$email
,
$message
);
fputcsv
(
$file_open
,
$form_data
);
$error
=
'<label class="text-success">Thank you for contacting us</label>'
;
$name
=
''
;
$email
=
''
;
$subject
=
''
;
$message
=
''
;
?>
<!DOCTYPE html>
<!--
This is the front page of the unit calculator,
the user can choose between three themes:
Simple, Fancy and Currency conversion
-->
This is the front page of the unit calculator,
the user can choose between three themes:
Simple, Fancy and Currency conversion
-->
<html
lang=
"en"
>
<head>
<head>
<title>
Unit Calc.
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"description"
content=
"Unit Calc."
>
<meta
name=
"author"
content=
"Yusef,Zeyad"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<!--Browsing for Tablet or Phone dimensions-->
<link
rel=
"stylesheet"
href=
"css/style.css"
/>
<style>
@import
url('https://fonts.googleapis.com/css?family=Passion+One|Roboto+Slab')
;
#myBtn
{
display
:
none
;
position
:
fixed
;
bottom
:
20px
;
right
:
30px
;
z-index
:
99
;
font-size
:
18px
;
border
:
none
;
outline
:
none
;
background-color
:
rgb
(
108
,
53
,
176
);
color
:
white
;
cursor
:
pointer
;
padding
:
15px
;
border-radius
:
4px
;
}
#myBtn
:hover
{
background-color
:
#555
;
}
</style>
</head>
<body>
<button
onclick=
"topFunction()"
id=
"myBtn"
title=
"Go to top"
>
Top
</button>
<script>
// When the user scrolls down 20px from the top of the document, show the button
window
.
onscroll
=
function
()
{
scrollFunction
()};
function
scrollFunction
()
{
if
(
document
.
body
.
scrollTop
>
20
||
document
.
documentElement
.
scrollTop
>
20
)
{
<!--Browsing for Tablet or Phone dimensions-->
<link
rel=
"stylesheet"
href=
"css/style.css"
/>
<style>
@import
url('https://fonts.googleapis.com/css?family=Passion+One|Roboto+Slab')
;
#myBtn
{
display
:
none
;
position
:
fixed
;
bottom
:
20px
;
right
:
30px
;
z-index
:
99
;
font-size
:
18px
;
border
:
none
;
outline
:
none
;
background-color
:
rgb
(
108
,
53
,
176
);
color
:
white
;
cursor
:
pointer
;
padding
:
15px
;
border-radius
:
4px
;
}
#myBtn
:hover
{
background-color
:
#555
;
}
</style>
</head>
<body>
<button
onclick=
"topFunction()"
id=
"myBtn"
title=
"Go to top"
>
Top
</button>
<script>
// When the user scrolls down 20px from the top of the document, show the button
window
.
onscroll
=
function
()
{
scrollFunction
()
};
function
scrollFunction
()
{
if
(
document
.
body
.
scrollTop
>
20
||
document
.
documentElement
.
scrollTop
>
20
)
{
document
.
getElementById
(
"myBtn"
).
style
.
display
=
"block"
;
}
else
{
}
else
{
document
.
getElementById
(
"myBtn"
).
style
.
display
=
"none"
;
}
}
// When the user clicks on the button, scroll to the top of the document
function
topFunction
()
{
document
.
body
.
scrollTop
=
0
;
document
.
documentElement
.
scrollTop
=
0
;
}
}
// When the user clicks on the button, scroll to the top of the document
function
topFunction
()
{
document
.
body
.
scrollTop
=
0
;
document
.
documentElement
.
scrollTop
=
0
;
}
</script>
<a
class=
"navbar"
>
<span
class
=
"open-slide"
>
<a
class=
"navbar"
>
<span
class
=
"open-slide"
>
<a
href=
"#"
onclick=
"openSlideMenu()"
>
<svg
width=
"30"
height=
"30"
>
<path
d=
"M0,5 30,5"
stroke=
"#000"
stroke-width=
"5"
/>
<path
d=
"M0,14 30,14"
stroke=
"#000"
stroke-width=
"5"
/>
<path
d=
"M0,23 30,23"
stroke=
"#000"
stroke-width=
"5"
/>
<path
d=
"M0,5 30,5"
stroke=
"#000"
stroke-width=
"5"
/>
<path
d=
"M0,14 30,14"
stroke=
"#000"
stroke-width=
"5"
/>
<path
d=
"M0,23 30,23"
stroke=
"#000"
stroke-width=
"5"
/>
</svg>
</a>
</span>
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
</span>
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href
=
"#"
>
About Us
</a>
<a
href=
"#"
>
About Us
</a>
<a
href=
"categories/length.php"
>
Length
</a>
<a
href=
"categories/temperature.php"
>
Temperature
</a>
<a
href=
"categories/area.php"
>
Area
</a>
...
...
@@ -79,90 +112,90 @@ Simple, Fancy and Currency conversion
<a
href=
"categories/speed.php"
>
Speed
</a>
<a
href=
"login"
>
Log in
</a>
<a
href=
"login/signup.php"
>
Sign up
</a>
</div>
<script
src=
"js/frontSide.js"
></script>
<section
id=
"banner"
>
<div
class=
"inner"
>
</div>
<script
src=
"js/frontSide.js"
></script>
<section
id=
"banner"
>
<div
class=
"inner"
>
<header>
<h1>
Unit Calc.
</h1>
<p>
An interactive Unit Calculator for all your needs.
</p>
<a
href=
"#main"
class=
"more"
>
Choose Conversion
</a>
</header>
<a
class=
"log"
href=
"/login/index.html"
>
login
<p>
Restore your calculations
</p></a>
</div>
</section>
<div
id=
"main"
>
<div
class=
"inner"
>
<div
id=
"items"
class
=
"box"
>
<p>
Restore your calculations
</p></a>
</div>
</section>
<div
id=
"main"
>
<div
class=
"inner"
>
<div
id=
"items"
class
=
"box"
>
<div
class=
"box"
>
<a
href=
""
class=
"image fit"
><img
src=
"icons/length.png"
width=
"400"
height=
"355"
alt=
"Length"
/></a>
<div
class=
"inner"
>
<h2>
Length
</h2>
<a
href=
"categories/length.php"
class=
"button style3 fit"
>
Select
</a>
</div>
<a
href=
""
class=
"image fit"
><img
src=
"icons/length.png"
width=
"400"
height=
"355"
alt=
"Length"
/></a>
<div
class=
"inner"
>
<h2>
Length
</h2>
<a
href=
"categories/length.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
<div
class=
"box"
>
<a
href=
""
class=
"image fit"
><img
src=
"icons/area.png"
width=
"400"
height=
"355"
alt=
"Area"
/></a>
<div
class=
"inner"
>
<h2>
Area
</h2>
<a
href=
"categories/area.php"
class=
"button style3 fit"
>
Select
</a>
</div>
<a
href=
""
class=
"image fit"
><img
src=
"icons/area.png"
width=
"400"
height=
"355"
alt=
"Area"
/></a>
<div
class=
"inner"
>
<h2>
Area
</h2>
<a
href=
"categories/area.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
<div
class=
"box"
>
<a
href=
""
class=
"image fit"
><img
src=
"icons/temperature.png"
width=
"400"
height=
"355"
alt=
"Temperature"
/></a>
<div
class=
"inner"
>
<h2>
Temperature
</h2>
<a
href=
"categories/temperature.php"
class=
"button style3 fit"
>
Select
</a>
</div>
<a
href=
""
class=
"image fit"
><img
src=
"icons/temperature.png"
width=
"400"
height=
"355"
alt=
"Temperature"
/></a>
<div
class=
"inner"
>
<h2>
Temperature
</h2>
<a
href=
"categories/temperature.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
<div
class=
"box"
>
<a
href=
""
class=
"image fit"
><img
src=
"icons/volume.png"
width=
"400"
height=
"355"
alt=
"Volume"
/></a>
<div
class=
"inner"
>
<h2>
Volume
</h2>
<a
href=
"categories/volume.php"
class=
"button style3 fit"
>
Select
</a>
</div>
<a
href=
""
class=
"image fit"
><img
src=
"icons/volume.png"
width=
"400"
height=
"355"
alt=
"Volume"
/></a>
<div
class=
"inner"
>
<h2>
Volume
</h2>
<a
href=
"categories/volume.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
<div
class=
"box"
>
<a
href=
""
class=
"image fit"
><img
src=
"icons/weight.png"
width=
"400"
height=
"355"
alt=
"Weight"
/></a>
<div
class=
"inner"
>
<h2>
Weight
</h2>
<a
href=
"categories/weight.php"
class=
"button style3 fit"
>
Select
</a>
</div>
<a
href=
""
class=
"image fit"
><img
src=
"icons/weight.png"
width=
"400"
height=
"355"
alt=
"Weight"
/></a>
<div
class=
"inner"
>
<h2>
Weight
</h2>
<a
href=
"categories/weight.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
<div
class=
"box"
>
<a
href=
""
class=
"image fit"
><img
src=
"icons/speed.png"
width=
"400"
height=
"355"
alt=
"speed"
/></a>
<div
class=
"inner"
>
<h2>
Speed
</h2>
<a
href=
"categories/speed.php"
class=
"button style3 fit"
>
Select
</a>
<a
href=
"categories/speed.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<footer
id=
"footer"
>
</div>
<footer
id=
"footer"
>
<div
class=
"inner"
>
<section>
<h3>
Contact Us
</h3>
<form
method=
"POST"
action=
""
>
<div
class=
"entry"
>
<input
id=
"Input"
class=
"Input-text"
name=
"name"
placeholder=
"Name"
>
<input
id=
"Input"
class=
"Input-text"
type=
"email"
name=
"email"
placeholder=
"Email"
>
<input
id=
"Input"
class=
"Input-text"
name=
"message"
placeholder=
"Message"
>
</div>
<div
class=
"registerSubmit"
>
<input
type=
"submit"
name=
"submit"
value=
"Submit"
>
</div>
<form
id=
"Contact_form"
method=
"POST"
action=
""
>
<div
class=
"entry"
>
<input
id=
"Input-name"
class=
"Input-text"
name=
"name"
placeholder=
"Name"
required
>
<input
id=
"Input-email"
class=
"Input-text"
type=
"email"
name=
"email"
placeholder=
"Email"
required
>
<input
id=
"Input-message"
class=
"Input-text"
name=
"message"
placeholder=
"Message"
required
>
</div>
<div
class=
"registerSubmit"
>
<input
type=
"submit"
name=
"submit"
value=
"Submit"
>
</div>
</form>
<div
id=
"results"
></div>
</section>
</footer>
</body>
</footer>
</body>
</html>
\ No newline at end of file
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment