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
5 years ago
by
zekena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contact+styles
parent
3ab4db56
master
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
119 additions
and
35 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
=
''
;
}
}
This diff is collapsed.
Click to expand it.
categories/contact_data.csv
0 → 100644
View file @
f1f29dab
Name,Email,Message
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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"
/>
<!--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
;
...
...
@@ -36,12 +66,15 @@ Simple, Fancy and Currency conversion
background-color
:
#555
;
}
</style>
</head>
<body>
</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
()};
window
.
onscroll
=
function
()
{
scrollFunction
()
};
function
scrollFunction
()
{
if
(
document
.
body
.
scrollTop
>
20
||
document
.
documentElement
.
scrollTop
>
20
)
{
...
...
@@ -58,19 +91,19 @@ Simple, Fancy and Currency conversion
}
</script>
<a
class=
"navbar"
>
<span
class
=
"open-slide"
>
<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"
>
<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>
...
...
@@ -94,13 +127,13 @@ Simple, Fancy and Currency conversion
</section>
<div
id=
"main"
>
<div
class=
"inner"
>
<div
id=
"items"
class
=
"box"
>
<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>
<a
href=
"categories/length.php"
class=
"button style3 fit"
>
Select
</a>
</div>
</div>
...
...
@@ -150,19 +183,19 @@ Simple, Fancy and Currency conversion
<div
class=
"inner"
>
<section>
<h3>
Contact Us
</h3>
<form
method=
"POST"
action=
""
>
<form
id=
"Contact_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"
>
<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>
</body>
</html>
\ No newline at end of file
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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