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
afb01805
authored
5 years ago
by
zekena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs
parent
50a1bd7b
master
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
234 additions
and
120 deletions
categories/area.php
categories/length.php
categories/speed.php
categories/temperature.php
categories/volume.php
categories/weight.php
contact_data.csv
categories/area.php
View file @
afb01805
...
...
@@ -75,17 +75,17 @@ if ($_POST['submit']) {
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href=
"
categories/
length.php"
>
Length
</a>
<a
href=
"
categories/
temperature.php"
>
Temperature
</a>
<a
href=
"
categories/
area.php"
>
Area
</a>
<a
href=
"
categories/
volume.php"
>
Volume
</a>
<a
href=
"
categories/
weight.php"
>
Weight
</a>
<a
href=
"
categories/
speed.php"
>
Speed
</a>
<a
href=
"login/login.php"
>
Log in
</a>
<a
href=
"length.php"
>
Length
</a>
<a
href=
"temperature.php"
>
Temperature
</a>
<a
href=
"area.php"
>
Area
</a>
<a
href=
"volume.php"
>
Volume
</a>
<a
href=
"weight.php"
>
Weight
</a>
<a
href=
"speed.php"
>
Speed
</a>
<a
href=
"
../
login/login.php"
>
Log in
</a>
</div>
<script
src=
"../js/
sl
ide.js"
></script>
<script
src=
"../js/
frontS
ide.js"
></script>
<div
id=
"title"
>
<h1>
Area
</h1>
</div>
...
...
This diff is collapsed.
Click to expand it.
categories/length.php
View file @
afb01805
...
...
@@ -133,16 +133,16 @@ function length_options(){
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href=
"
categories/
length.php"
>
Length
</a>
<a
href=
"categories/
temperature.php"
>
Temperature
</a>
<a
href=
"categories/
area.php"
>
Area
</a>
<a
href=
"categories/
volume.php"
>
Volume
</a>
<a
href=
"categories/
weight.php"
>
Weight
</a>
<a
href=
"categories/
speed.php"
>
Speed
</a>
<a
href=
"
login/login.php"
>
Log in
</a>
<a
href=
"length.php"
>
Length
</a>
<a
href=
"
temperature.php"
>
Temperature
</a>
<a
href=
"
area.php"
>
Area
</a>
<a
href=
"
volume.php"
>
Volume
</a>
<a
href=
"
weight.php"
>
Weight
</a>
<a
href=
"
speed.php"
>
Speed
</a>
<a
href=
"../
login/login.php"
>
Log in
</a>
</div>
<script
src=
"../js/
sl
ide.js"
></script>
<script
src=
"../js/
fronts
ide.js"
></script>
<div
id=
"title"
>
<h1>
Length
</h1>
</div>
...
...
This diff is collapsed.
Click to expand it.
categories/speed.php
View file @
afb01805
<?php
if
(
file_exists
(
'dbconnect.php'
))
{
require
(
'dbconnect.php'
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
if
(
file_exists
(
'dbconnect.php'
))
{
require
(
'dbconnect.php'
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
}
//Add function file
if
(
file_exists
(
'../includes/functions.php'
))
{
require_once
(
'../includes/functions.php'
);
...
...
@@ -24,9 +24,9 @@ if ($_POST['submit']) {
$to_value
=
convert_speed
(
$from_value
,
$from_unit
,
$to_unit
);
$sql
=
"INSERT INTO speed_entry(from_unit,to_unit,from_value,to_value) VALUES ('
$from_unit
','
$to_unit
','
$from_value
','
$to_value
');"
;
if
(
!
mysqli_query
(
$link
,
$sql
))
{
die
(
'An error occurred when submitting your review.'
);
}
if
(
!
mysqli_query
(
$link
,
$sql
))
{
die
(
'An error occurred when submitting your review.'
);
}
}
$speed_options
=
array
(
...
...
@@ -64,17 +64,17 @@ $speed_options = array(
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href=
"
categories/
length.php"
>
Length
</a>
<a
href=
"categories/
temperature.php"
>
Temperature
</a>
<a
href=
"categories/
area.php"
>
Area
</a>
<a
href=
"categories/
volume.php"
>
Volume
</a>
<a
href=
"categories/
weight.php"
>
Weight
</a>
<a
href=
"categories/
speed.php"
>
Speed
</a>
<a
href=
"
login/login.php"
>
Log in
</a>
<a
href=
"length.php"
>
Length
</a>
<a
href=
"
temperature.php"
>
Temperature
</a>
<a
href=
"
area.php"
>
Area
</a>
<a
href=
"
volume.php"
>
Volume
</a>
<a
href=
"
weight.php"
>
Weight
</a>
<a
href=
"
speed.php"
>
Speed
</a>
<a
href=
"../
login/login.php"
>
Log in
</a>
</div>
<script
src=
"../js/
sl
ide.js"
></script>
<script
src=
"../js/
fronts
ide.js"
></script>
<div
id=
"title"
>
<h1>
Speed
</h1>
</div>
...
...
This diff is collapsed.
Click to expand it.
categories/temperature.php
View file @
afb01805
...
...
@@ -2,7 +2,7 @@
if
(
file_exists
(
'dbconnect.php'
))
{
require
(
'dbconnect.php'
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
}
//Add function file
...
...
@@ -25,7 +25,7 @@ if ($_POST['submit']) {
$to_value
=
convert_temp
(
$from_value
,
$from_unit
,
$to_unit
);
$sql
=
"INSERT INTO temperature_entry(from_unit,to_unit,from_value,to_value) VALUES ('
$from_unit
','
$to_unit
','
$from_value
','
$to_value
');"
;
if
(
!
mysqli_query
(
$link
,
$sql
))
{
die
(
'An error occurred when submitting your review.'
);
die
(
'An error occurred when submitting your review.'
);
}
}
...
...
@@ -111,17 +111,17 @@ $temp_options = array(
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href=
"
categories/
length.php"
>
Length
</a>
<a
href=
"categories/
temperature.php"
>
Temperature
</a>
<a
href=
"categories/
area.php"
>
Area
</a>
<a
href=
"categories/
volume.php"
>
Volume
</a>
<a
href=
"categories/
weight.php"
>
Weight
</a>
<a
href=
"categories/
speed.php"
>
Speed
</a>
<a
href=
"
login/login.php"
>
Log in
</a>
<a
href=
"length.php"
>
Length
</a>
<a
href=
"
temperature.php"
>
Temperature
</a>
<a
href=
"
area.php"
>
Area
</a>
<a
href=
"
volume.php"
>
Volume
</a>
<a
href=
"
weight.php"
>
Weight
</a>
<a
href=
"
speed.php"
>
Speed
</a>
<a
href=
"../
login/login.php"
>
Log in
</a>
</div>
<script
src=
"../js/
sl
ide.js"
></script>
<script
src=
"../js/
fronts
ide.js"
></script>
<div
id=
"title"
>
<h1>
Temperature
</h1>
</div>
...
...
This diff is collapsed.
Click to expand it.
categories/volume.php
View file @
afb01805
...
...
@@ -2,7 +2,7 @@
if
(
file_exists
(
'dbconnect.php'
))
{
require
(
'dbconnect.php'
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
}
//Add function file
...
...
@@ -25,8 +25,8 @@ if ($_POST['submit']) {
$to_value
=
convert_volume
(
$from_value
,
$from_unit
,
$to_unit
);
$sql
=
"INSERT INTO volume_entry(from_unit,to_unit,from_value,to_value) VALUES ('
$from_unit
','
$to_unit
','
$from_value
','
$to_value
');"
;
if
(
!
mysqli_query
(
$link
,
$sql
))
{
die
(
'An error occurred when submitting your review.'
);
}
die
(
'An error occurred when submitting your review.'
);
}
}
$volume_options
=
array
(
'cubic inches'
,
...
...
@@ -79,17 +79,17 @@ $volume_options = array(
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href=
"
categories/
length.php"
>
Length
</a>
<a
href=
"categories/
temperature.php"
>
Temperature
</a>
<a
href=
"categories/
area.php"
>
Area
</a>
<a
href=
"categories/
volume.php"
>
Volume
</a>
<a
href=
"categories/
weight.php"
>
Weight
</a>
<a
href=
"categories/
speed.php"
>
Speed
</a>
<a
href=
"
login/login.php"
>
Log in
</a>
<a
href=
"length.php"
>
Length
</a>
<a
href=
"
temperature.php"
>
Temperature
</a>
<a
href=
"
area.php"
>
Area
</a>
<a
href=
"
volume.php"
>
Volume
</a>
<a
href=
"
weight.php"
>
Weight
</a>
<a
href=
"
speed.php"
>
Speed
</a>
<a
href=
"../
login/login.php"
>
Log in
</a>
</div>
<script
src=
"../js/
sl
ide.js"
></script>
<script
src=
"../js/
fronts
ide.js"
></script>
<div
id=
"title"
>
<h1>
Volume
</h1>
</div>
...
...
@@ -105,25 +105,63 @@ $volume_options = array(
<input
id=
"Input"
class=
"Input-text"
placeholder=
"Enter amount"
name=
"from_value"
value=
"
<?php
echo
$from_value
;
?>
"
/>
<label
for=
"Input"
class=
"Input-label"
>
Your entry
</label>
<select
name=
"from_unit"
>
<option
value=
"cubic_inches"
<?php
if
(
$from_unit
==
'cubic_inches'
)
{
echo
" selected"
;
}
?>
>
cubic inches
</option>
<option
value=
"cubic_feet"
<?php
if
(
$from_unit
==
'cubic_feet'
)
{
echo
" selected"
;
}
?>
>
cubic feet
</option>
<option
value=
"cubic_meters"
<?php
if
(
$from_unit
==
'cubic_meters'
)
{
echo
" selected"
;
}
?>
>
cubic meters
</option>
<option
value=
"cubic_centimeres"
<?php
if
(
$from_unit
==
'cubic_centimeters'
)
{
echo
" selected"
;
}
?>
>
cubic centimeters
</option>
<option
value=
"imperial_gallons"
<?php
if
(
$from_unit
==
'imperial_gallons'
)
{
echo
" selected"
;
}
?>
>
imperial gallons
</option>
<option
value=
"imperial_quarts"
<?php
if
(
$from_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"imperial_pints"
<?php
if
(
$from_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"imperial_cups"
<?php
if
(
$from_unit
==
'imperial_cups'
)
{
echo
" selected"
;
}
?>
>
imperial cups
</option>
<option
value=
"imperial_ounces"
<?php
if
(
$from_unit
==
'imperial_ounces'
)
{
echo
" selected"
;
}
?>
>
imperial ounces
</option>
<option
value=
"imperial_tablespoons"
<?php
if
(
$from_unit
==
'imperial_tablespoons'
)
{
echo
" selected"
;
}
?>
>
imperial tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$from_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"us_quarts"
<?php
if
(
$from_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"us_pints"
<?php
if
(
$from_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"us_cups"
<?php
if
(
$from_unit
==
'us_cups'
)
{
echo
" selected"
;
}
?>
>
US cups
</option>
<option
value=
"us_ounces"
<?php
if
(
$from_unit
==
'us_ounces'
)
{
echo
" selected"
;
}
?>
>
US ounces
</option>
<option
value=
"us_tablespoons"
<?php
if
(
$from_unit
==
'us_tablespoons'
)
{
echo
" selected"
;
}
?>
>
US tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$from_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"liters"
<?php
if
(
$from_unit
==
'liters'
)
{
echo
" selected"
;
}
?>
>
liters
</option>
<option
value=
"millimeters"
<?php
if
(
$from_unit
==
'millimeters'
)
{
echo
" selected"
;
}
?>
>
millimeters
</option>
<option
value=
"cubic_inches"
<?php
if
(
$from_unit
==
'cubic_inches'
)
{
echo
" selected"
;
}
?>
>
cubic inches
</option>
<option
value=
"cubic_feet"
<?php
if
(
$from_unit
==
'cubic_feet'
)
{
echo
" selected"
;
}
?>
>
cubic feet
</option>
<option
value=
"cubic_meters"
<?php
if
(
$from_unit
==
'cubic_meters'
)
{
echo
" selected"
;
}
?>
>
cubic meters
</option>
<option
value=
"cubic_centimeres"
<?php
if
(
$from_unit
==
'cubic_centimeters'
)
{
echo
" selected"
;
}
?>
>
cubic centimeters
</option>
<option
value=
"imperial_gallons"
<?php
if
(
$from_unit
==
'imperial_gallons'
)
{
echo
" selected"
;
}
?>
>
imperial gallons
</option>
<option
value=
"imperial_quarts"
<?php
if
(
$from_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"imperial_pints"
<?php
if
(
$from_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"imperial_cups"
<?php
if
(
$from_unit
==
'imperial_cups'
)
{
echo
" selected"
;
}
?>
>
imperial cups
</option>
<option
value=
"imperial_ounces"
<?php
if
(
$from_unit
==
'imperial_ounces'
)
{
echo
" selected"
;
}
?>
>
imperial ounces
</option>
<option
value=
"imperial_tablespoons"
<?php
if
(
$from_unit
==
'imperial_tablespoons'
)
{
echo
" selected"
;
}
?>
>
imperial tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$from_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"us_quarts"
<?php
if
(
$from_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"us_pints"
<?php
if
(
$from_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"us_cups"
<?php
if
(
$from_unit
==
'us_cups'
)
{
echo
" selected"
;
}
?>
>
US cups
</option>
<option
value=
"us_ounces"
<?php
if
(
$from_unit
==
'us_ounces'
)
{
echo
" selected"
;
}
?>
>
US ounces
</option>
<option
value=
"us_tablespoons"
<?php
if
(
$from_unit
==
'us_tablespoons'
)
{
echo
" selected"
;
}
?>
>
US tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$from_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"liters"
<?php
if
(
$from_unit
==
'liters'
)
{
echo
" selected"
;
}
?>
>
liters
</option>
<option
value=
"millimeters"
<?php
if
(
$from_unit
==
'millimeters'
)
{
echo
" selected"
;
}
?>
>
millimeters
</option>
</select>
</div>
...
...
@@ -131,25 +169,63 @@ $volume_options = array(
<input
readonly
id=
"Input"
class=
"Input-text"
placeholder=
"Wait for it"
name=
"to_value"
value=
"
<?php
echo
$to_value
;
?>
"
/>
<label
for=
"Input"
class=
"input-label"
>
Converted Result
</label>
<select
name=
"to_unit"
>
<option
value=
"cubic_inches"
<?php
if
(
$to_unit
==
'cubic_inches'
)
{
echo
" selected"
;
}
?>
>
cubic inches
</option>
<option
value=
"cubic_feet"
<?php
if
(
$to_unit
==
'cubic_feet'
)
{
echo
" selected"
;
}
?>
>
cubic feet
</option>
<option
value=
"cubic_meters"
<?php
if
(
$tounit
==
'cubic_meters'
)
{
echo
" selected"
;
}
?>
>
cubic meters
</option>
<option
value=
"cubic_centimeres"
<?php
if
(
$to_unit
==
'cubic_centimeters'
)
{
echo
" selected"
;
}
?>
>
cubic centimeters
</option>
<option
value=
"imperial_gallons"
<?php
if
(
$to_unit
==
'imperial_gallons'
)
{
echo
" selected"
;
}
?>
>
imperial gallons
</option>
<option
value=
"imperial_quarts"
<?php
if
(
$to_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"imperial_pints"
<?php
if
(
$to_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"imperial_cups"
<?php
if
(
$to_unit
==
'imperial_cups'
)
{
echo
" selected"
;
}
?>
>
imperial cups
</option>
<option
value=
"imperial_ounces"
<?php
if
(
$to_unit
==
'imperial_ounces'
)
{
echo
" selected"
;
}
?>
>
imperial ounces
</option>
<option
value=
"imperial_tablespoons"
<?php
if
(
$to_unit
==
'imperial_tablespoons'
)
{
echo
" selected"
;
}
?>
>
imperial tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$to_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"us_quarts"
<?php
if
(
$to_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"us_pints"
<?php
if
(
$to_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"us_cups"
<?php
if
(
$to_unit
==
'us_cups'
)
{
echo
" selected"
;
}
?>
>
US cups
</option>
<option
value=
"us_ounces"
<?php
if
(
$to_unit
==
'us_ounces'
)
{
echo
" selected"
;
}
?>
>
US ounces
</option>
<option
value=
"us_tablespoons"
<?php
if
(
$to_unit
==
'us_tablespoons'
)
{
echo
" selected"
;
}
?>
>
US tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$to_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"liters"
<?php
if
(
$to_unit
==
'liters'
)
{
echo
" selected"
;
}
?>
>
liters
</option>
<option
value=
"millimeters"
<?php
if
(
$to_unit
==
'millimeters'
)
{
echo
" selected"
;
}
?>
>
millimeters
</option>
<option
value=
"cubic_inches"
<?php
if
(
$to_unit
==
'cubic_inches'
)
{
echo
" selected"
;
}
?>
>
cubic inches
</option>
<option
value=
"cubic_feet"
<?php
if
(
$to_unit
==
'cubic_feet'
)
{
echo
" selected"
;
}
?>
>
cubic feet
</option>
<option
value=
"cubic_meters"
<?php
if
(
$tounit
==
'cubic_meters'
)
{
echo
" selected"
;
}
?>
>
cubic meters
</option>
<option
value=
"cubic_centimeres"
<?php
if
(
$to_unit
==
'cubic_centimeters'
)
{
echo
" selected"
;
}
?>
>
cubic centimeters
</option>
<option
value=
"imperial_gallons"
<?php
if
(
$to_unit
==
'imperial_gallons'
)
{
echo
" selected"
;
}
?>
>
imperial gallons
</option>
<option
value=
"imperial_quarts"
<?php
if
(
$to_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"imperial_pints"
<?php
if
(
$to_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"imperial_cups"
<?php
if
(
$to_unit
==
'imperial_cups'
)
{
echo
" selected"
;
}
?>
>
imperial cups
</option>
<option
value=
"imperial_ounces"
<?php
if
(
$to_unit
==
'imperial_ounces'
)
{
echo
" selected"
;
}
?>
>
imperial ounces
</option>
<option
value=
"imperial_tablespoons"
<?php
if
(
$to_unit
==
'imperial_tablespoons'
)
{
echo
" selected"
;
}
?>
>
imperial tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$to_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"us_quarts"
<?php
if
(
$to_unit
==
'imperial_quarts'
)
{
echo
" selected"
;
}
?>
>
imperial quarts
</option>
<option
value=
"us_pints"
<?php
if
(
$to_unit
==
'imperial_pints'
)
{
echo
" selected"
;
}
?>
>
imperial pints
</option>
<option
value=
"us_cups"
<?php
if
(
$to_unit
==
'us_cups'
)
{
echo
" selected"
;
}
?>
>
US cups
</option>
<option
value=
"us_ounces"
<?php
if
(
$to_unit
==
'us_ounces'
)
{
echo
" selected"
;
}
?>
>
US ounces
</option>
<option
value=
"us_tablespoons"
<?php
if
(
$to_unit
==
'us_tablespoons'
)
{
echo
" selected"
;
}
?>
>
US tablespoons
</option>
<option
value=
"us_gallons"
<?php
if
(
$to_unit
==
'us_gallons'
)
{
echo
" selected"
;
}
?>
>
US gallons
</option>
<option
value=
"liters"
<?php
if
(
$to_unit
==
'liters'
)
{
echo
" selected"
;
}
?>
>
liters
</option>
<option
value=
"millimeters"
<?php
if
(
$to_unit
==
'millimeters'
)
{
echo
" selected"
;
}
?>
>
millimeters
</option>
</select>
</div>
...
...
This diff is collapsed.
Click to expand it.
categories/weight.php
View file @
afb01805
<?php
if
(
file_exists
(
'dbconnect.php'
))
{
if
(
file_exists
(
'dbconnect.php'
))
{
require
(
'dbconnect.php'
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
}
//Add function file
...
...
@@ -25,7 +25,7 @@ if ($_POST['submit']) {
$to_value
=
convert_mass
(
$from_value
,
$from_unit
,
$to_unit
);
$sql
=
"INSERT INTO weight_entry(from_unit,to_unit,from_value,to_value) VALUES ('
$from_unit
','
$to_unit
','
$from_value
','
$to_value
');"
;
if
(
!
mysqli_query
(
$link
,
$sql
))
{
die
(
'An error occurred when submitting your review.'
);
die
(
'An error occurred when submitting your review.'
);
}
}
...
...
@@ -117,17 +117,17 @@ $mass_options = array(
</nav>
<div
id=
"side-menu"
class=
"side-nav"
>
<a
href=
"#"
class=
"btn-close"
onclick=
"closeSlideMenu()"
>
×
</a>
<a
href=
"categories/
length.php"
>
Length
</a>
<a
href=
"categories/
temperature.php"
>
Temperature
</a>
<a
href=
"categories/
area.php"
>
Area
</a>
<a
href=
"categories/
volume.php"
>
Volume
</a>
<a
href=
"categories/
weight.php"
>
Weight
</a>
<a
href=
"categories/
speed.php"
>
Speed
</a>
<a
href=
"
login/login.php"
>
Log in
</a>
<a
href=
"
length.php"
>
Length
</a>
<a
href=
"
temperature.php"
>
Temperature
</a>
<a
href=
"
area.php"
>
Area
</a>
<a
href=
"
volume.php"
>
Volume
</a>
<a
href=
"
weight.php"
>
Weight
</a>
<a
href=
"
speed.php"
>
Speed
</a>
<a
href=
"../
login/login.php"
>
Log in
</a>
</div>
<script
src=
"../js/
sl
ide.js"
></script>
<script
src=
"../js/
fronts
ide.js"
></script>
<div
id=
"title"
>
<h1>
Weight
</h1>
</div>
...
...
@@ -143,15 +143,33 @@ $mass_options = array(
<input
id=
"Input"
class=
"Input-text"
placeholder=
"Enter amount"
name=
"from_value"
value=
"
<?php
echo
$from_value
;
?>
"
/>
<label
for=
"Input"
class=
"Input-label"
>
Your entry
</label>
<select
name=
"from_unit"
>
<option
value=
"ounces"
<?php
if
(
$from_unit
==
'ounces'
)
{
echo
" selected"
;
}
?>
>
ounces
</option>
<option
value=
"pounds"
<?php
if
(
$from_unit
==
'pounds'
)
{
echo
" selected"
;
}
?>
>
pounds
</option>
<option
value=
"stones"
<?php
if
(
$from_unit
==
'stones'
)
{
echo
" selected"
;
}
?>
>
stones
</option>
<option
value=
"long_tons"
<?php
if
(
$from_unit
==
'long_tons'
)
{
echo
" selected"
;
}
?>
>
long tons
</option>
<option
value=
"short_tons"
<?php
if
(
$from_unit
==
'short_tons'
)
{
echo
" selected"
;
}
?>
>
short tons
</option>
<option
value=
"milligrams"
<?php
if
(
$from_unit
==
'milligrams'
)
{
echo
" selected"
;
}
?>
>
milligrams
</option>
<option
value=
"grams"
<?php
if
(
$from_unit
==
'grams'
)
{
echo
" selected"
;
}
?>
>
grams
</option>
<option
value=
"kilograms"
<?php
if
(
$from_unit
==
'kilograms'
)
{
echo
" selected"
;
}
?>
>
kilograms
</option>
<option
value=
"metric_tonnes"
<?php
if
(
$from_unit
==
'metric_tonnes'
)
{
echo
" selected"
;
}
?>
>
metric tonnes
</option>
<option
value=
"ounces"
<?php
if
(
$from_unit
==
'ounces'
)
{
echo
" selected"
;
}
?>
>
ounces
</option>
<option
value=
"pounds"
<?php
if
(
$from_unit
==
'pounds'
)
{
echo
" selected"
;
}
?>
>
pounds
</option>
<option
value=
"stones"
<?php
if
(
$from_unit
==
'stones'
)
{
echo
" selected"
;
}
?>
>
stones
</option>
<option
value=
"long_tons"
<?php
if
(
$from_unit
==
'long_tons'
)
{
echo
" selected"
;
}
?>
>
long tons
</option>
<option
value=
"short_tons"
<?php
if
(
$from_unit
==
'short_tons'
)
{
echo
" selected"
;
}
?>
>
short tons
</option>
<option
value=
"milligrams"
<?php
if
(
$from_unit
==
'milligrams'
)
{
echo
" selected"
;
}
?>
>
milligrams
</option>
<option
value=
"grams"
<?php
if
(
$from_unit
==
'grams'
)
{
echo
" selected"
;
}
?>
>
grams
</option>
<option
value=
"kilograms"
<?php
if
(
$from_unit
==
'kilograms'
)
{
echo
" selected"
;
}
?>
>
kilograms
</option>
<option
value=
"metric_tonnes"
<?php
if
(
$from_unit
==
'metric_tonnes'
)
{
echo
" selected"
;
}
?>
>
metric tonnes
</option>
</select>
</div>
...
...
@@ -159,15 +177,33 @@ $mass_options = array(
<input
readonly
id=
"Input"
class=
"Input-text"
placeholder=
"Wait for it"
name=
"to_value"
value=
"
<?php
echo
float_to_string
(
$to_value
);
?>
"
/>
<label
for=
"Input"
class=
"input-label"
>
Converted Result
</label>
<select
name=
"to_unit"
>
<option
value=
"ounces"
<?php
if
(
$to_unit
==
'ounces'
)
{
echo
" selected"
;
}
?>
>
ounces
</option>
<option
value=
"pounds"
<?php
if
(
$to_unit
==
'pounds'
)
{
echo
" selected"
;
}
?>
>
pounds
</option>
<option
value=
"stones"
<?php
if
(
$to_unit
==
'stones'
)
{
echo
" selected"
;
}
?>
>
stones
</option>
<option
value=
"long_tons"
<?php
if
(
$to_unit
==
'long_tons'
)
{
echo
" selected"
;
}
?>
>
long tons/option>
<option
value=
"short_tons"
<?php
if
(
$to_unit
==
'short_tons'
)
{
echo
" selected"
;
}
?>
>
short tons
</option>
<option
value=
"milligrams"
<?php
if
(
$to_unit
==
'milligrams'
)
{
echo
" selected"
;
}
?>
>
milligrams
</option>
<option
value=
"grams"
<?php
if
(
$to_unit
==
'grams'
)
{
echo
" selected"
;
}
?>
>
grams
</option>
<option
value=
"kilograms"
<?php
if
(
$to_unit
==
'kilograms'
)
{
echo
" selected"
;
}
?>
>
kilograms
</option>
<option
value=
"metric_tonnes"
<?php
if
(
$to_unit
==
'metric_tonnes'
)
{
echo
" selected"
;
}
?>
>
metric tonnes
</option>
<option
value=
"ounces"
<?php
if
(
$to_unit
==
'ounces'
)
{
echo
" selected"
;
}
?>
>
ounces
</option>
<option
value=
"pounds"
<?php
if
(
$to_unit
==
'pounds'
)
{
echo
" selected"
;
}
?>
>
pounds
</option>
<option
value=
"stones"
<?php
if
(
$to_unit
==
'stones'
)
{
echo
" selected"
;
}
?>
>
stones
</option>
<option
value=
"long_tons"
<?php
if
(
$to_unit
==
'long_tons'
)
{
echo
" selected"
;
}
?>
>
long tons/option>
<option
value=
"short_tons"
<?php
if
(
$to_unit
==
'short_tons'
)
{
echo
" selected"
;
}
?>
>
short tons
</option>
<option
value=
"milligrams"
<?php
if
(
$to_unit
==
'milligrams'
)
{
echo
" selected"
;
}
?>
>
milligrams
</option>
<option
value=
"grams"
<?php
if
(
$to_unit
==
'grams'
)
{
echo
" selected"
;
}
?>
>
grams
</option>
<option
value=
"kilograms"
<?php
if
(
$to_unit
==
'kilograms'
)
{
echo
" selected"
;
}
?>
>
kilograms
</option>
<option
value=
"metric_tonnes"
<?php
if
(
$to_unit
==
'metric_tonnes'
)
{
echo
" selected"
;
}
?>
>
metric tonnes
</option>
</select>
</div>
...
...
This diff is collapsed.
Click to expand it.
contact_data.csv
View file @
afb01805
...
...
@@ -7,3 +7,5 @@
6,,,
7,,,
8,,,
9,,,
10,,,
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