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
314e902d
authored
May 14, 2019
by
yuward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setting for reload page and login
parent
4b4fca48
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
5 deletions
calc/categories/length.php
calc/js/slide.js
calc/login/ajaxjs.php
calc/login/login.php
calc/login/validate.php
calc/categories/length.php
View file @
314e902d
<?php
if
(
file_exists
(
'dbconnect.php'
))
{
require
(
'dbconnect.php'
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error ('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
}
//Add function files
require
(
'options.php'
);
if
(
file_exists
(
'../includes/functions.php'
))
{
...
...
@@ -159,15 +161,15 @@ function length_options(){
<!-- calculator input and output-->
<!--Add function to recieve number,
Be able to input number from either box.-->
<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>
<input
id=
"
from_value
"
class=
"Input-text"
placeholder=
"Enter amount"
name=
"from_value"
value=
"
<?php
echo
$from_value
;
?>
"
/>
<label
for=
"Input"
class=
"Input-label"
>
Your entry
</label>
<label
for=
"input"
class=
"Input-label"
>
Your Entry
</label>
<select
name=
"from_unit"
>
<select
id=
"from_unit"
name=
"from_unit"
>
<?php
echo
length_options
();
?>
</select>
<br>
<input
id=
"Input"
class=
"Input-text"
placeholder=
"Wait for it"
name=
"to_value"
value=
"
<?php
echo
$to_value
;
?>
"
/>
<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"
>
<select
id =
"to_unit"
name=
"to_unit"
>
<?php
echo
length_options
();
?>
</select>
...
...
calc/js/slide.js
View file @
314e902d
...
...
@@ -6,4 +6,18 @@ function openSlideMenu(){
function
closeSlideMenu
(){
document
.
getElementById
(
'side-menu'
).
style
.
width
=
'0'
;
document
.
getElementById
(
'main'
).
style
.
marginLeft
=
'0'
;
}
function
checkForm
(){
var
from_unit
=
document
.
getElementById
(
"from_unit"
).
value
;
var
to_unit
=
document
.
getElementById
(
"to_unit'"
).
value
;
var
from_value
=
document
.
getElementById
(
"from_value"
).
value
;
var
to_value
=
document
.
getElementById
(
"to_value"
).
value
;
//
if
(
isNaN
(
num1
)){
document
.
w
}
document
.
getElementById
(
"myForm"
).
submit
();
}
\ No newline at end of file
calc/login/ajaxjs.php
0 → 100644
View file @
314e902d
<?php
$from_value
=
$_POST
[
'from_value'
];
$from_unit
=
$_POST
[
'from_unit'
];
$to_unit
=
$_POST
[
'to_unit'
];
if
(
is_numeric
((
$from_unit
))){
echo
"Must be a digit"
;
};
?>
calc/login/login.php
View file @
314e902d
...
...
@@ -69,7 +69,6 @@ function protect($string){
var
username
=
$
(
"#username"
).
val
();
var
email
=
$
(
"#email"
).
val
();
var
password
=
$
(
"#password"
).
val
();
var
continue
=
$
(
"#continue"
).
val
();
if
(
email
.
length
==
0
||
password
.
length
==
0
||
username
.
length
==
0
)
alert
(
'Please check input'
);
else
{
...
...
calc/login/validate.php
0 → 100644
View file @
314e902d
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