Commit 72838a0b authored by Erma Safira Nurmasyita's avatar Erma Safira Nurmasyita
Browse files
parents 2c00233c b8df4bff
......@@ -131,15 +131,28 @@ Jika ada pertanyaan silakan tanyakan lewat milis.
*Setiap anggota kelompok diwajibkan untuk mengerjakan bagian tampilan dan fungsionalitas.*
**Tampilan**
1. Login : 1351xxxx, 135xxxxx
2. Register : 135xxxxx
3. Lanjutkan ...
1. Login-logout : 13516006
2. Register : 13516072
3. Profile : 13516012
4. Edit profile : 13516006
5. Browse/ Search : 13516012
6. Search result : 13516006
7. Book detail : 13516072
8. History : 13516012
9. Review : 13516072
10. Header-menu: 13516012
**Fungsionalitas**
1. Login : 135xxxxx, 135xxxxx
2. Register : 135xxxxx
3. Fungsionalitas : 135xxxxx,135xxxxx
4. Lanjutkan...
1. Login-logout : 13516006
2. Register : 13516072
3. Profile : 13516012
4. Edit profile : 13516006
5. Browse/ Search : 13516012
6. Search result : 13516006
7. Book detail : 13516072
8. History : 13516012
9. Review : 13516072
10. Header-menu: 13516012
## About
......
......@@ -5,6 +5,7 @@
.left2{
flex-basis: 28%;
padding-left: 20px;
padding-top: 2.5%;
}
.right{
......@@ -18,7 +19,7 @@
.right2{
flex-basis: 72%;
align-content: left;
padding-right: 200px;
padding-right: 15%;
padding-top: 30px;
}
......@@ -41,7 +42,7 @@
flex-direction: row;
justify-content: space-around;
margin-left: 10px;
height: 300px;
height: 250px;
}
.rows2{
......@@ -66,7 +67,7 @@
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
margin-top: 50px;
margin-top: 5%;
}
.left_button{
flex-basis: 250px;
......@@ -122,8 +123,11 @@ input[type=file]{
color: transparent;
}
input[type=text]{
.profpict_dummy{
width: 500px;
}
input[type=text]{
width: 625px;
font-family: 'Arial';
font-weight: 500;
letter-spacing: 1px;
......@@ -131,7 +135,7 @@ input[type=text]{
}
textarea{
width: 500px;
width: 625px;
font-size: 32px;
}
......@@ -144,6 +148,10 @@ textarea{
height: 80px;
float: right;
}
#submit:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
}
#back{
border: 1px solid #F16303;
......@@ -154,4 +162,21 @@ textarea{
font-size: 40px;
height: 80px;
float: left;
}
\ No newline at end of file
}
#back:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
}
#warning-1{
visibility: hidden;
width: 625px;
}
#warning-2{
visibility: hidden;
width: 625px;
}
#warning-3{
visibility: hidden;
width: 625px;
}
......@@ -79,6 +79,10 @@ button{
border-radius: 4px;
}
button:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
}
.tRight{
font-size: 30px;
font-family: 'Arial Narrow';
......
......@@ -22,11 +22,11 @@
}
// echo $update_name;
$update = setUserProfile($user_id, $update_name, $update_address, $update_phone, $name, $tmp_name);
if ($update == 0){
echo "<script type='text/javascript'>alert 'Update Failed';</script>";
} else{
echo "<script type='text/javascript'>alert 'Update Success';</script>";
}
// if ($update == 0){
// echo "<script type='text/javascript'>alert 'Update Failed';</script>";
// } else{
// echo "<script type='text/javascript'>alert 'Update Success';</script>";
// }
header('Location: ../profile');
exit;
?>
\ No newline at end of file
......@@ -40,7 +40,7 @@
echo "<div class=\"right\">" ;
echo "<p>Update profile picture</p>" ;
echo "<input id=\"profpict_dummy\" type=\"text\" name=\"profile_picture2\" readonly>" ;
echo "<input id=\"profpict_dummy\" class=\"profpict_dummy\"type=\"text\" name=\"profile_picture2\" readonly>" ;
echo "<div class=\"upload-btn-wrapper\">" ;
echo "<button class=\"btn\">Browse ...</button>" ;
echo "<input id=\"profpict\" type=\"file\" name=\"profile_picture\" onchange=\"showname()\" >" ;
......@@ -51,6 +51,7 @@
echo "<div class=\"rows2\">" ;
echo "<p class=\"left2\">Name</p>" ;
echo "<div class=\"right2\">" ;
echo '<p id="warning-1" class="red-theme alert-box text-size-20 add-nunito-font c-round">Input can\'t be empty</p>';
echo "<input type=\"text\" id = \"name\" name=\"name\" value=\"$user_name\">" ;
echo "</div>" ;
echo "</div>" ;
......@@ -58,6 +59,7 @@
echo "<div class=\"rows\">" ;
echo "<p class=\"left2\">Address</p>" ;
echo "<div class=\"right2\">" ;
echo '<p id="warning-2" class="red-theme alert-box text-size-20 add-nunito-font c-round">Input can\'t be empty</p>';
echo "<textarea name=\"address\" id = \"address\" rows=\"5\" cols=\"1\">$user_address</textarea>" ;
echo "</div>" ;
echo "</div>" ;
......@@ -65,6 +67,7 @@
echo "<div class=\"rows2\">" ;
echo "<p class=\"left2\">Phone number</p>" ;
echo "<div class=\"right2\">" ;
echo '<p id="warning-3" class="red-theme alert-box text-size-20 add-nunito-font c-round">Input can\'t be empty</p>';
echo "<input type=\"text\" id = \"phone\" name=\"phone\" value=\"$user_phone\">" ;
echo "</div>" ;
echo "</div>" ;
......
......@@ -15,19 +15,46 @@ function validateForm(){
if (phone==def[3]){
unchanged += "Phone unchanged.";
}
empty = "";
isNameEmpty = false;
isAddressEmpty = false;
isPhoneEmpty = false;
isPhoneNotValid = false;
isPhoneDigitNotValid = false;
isNameTooLong = false;
if (name == ""){
empty += "Name ";
isNameEmpty = true;
}
if (address == ""){
empty += "Address ";
isAddressEmpty = true;
}
if (phone == ""){
empty += "Phone ";
isPhoneEmpty = true;
}
empty += "empty."
isnum = /^[0-9]*$/gm.test(phone);
$ret = true;
if (empty != "empty."){
// alert(empty);
$ret = $ret & false;
}
if (name.length > 20){
alert("Name exceed maximum. Please enter not more than 20 characters.");
// alert("Name exceed maximum. Please enter not more than 20 characters.");
$ret = $ret & false;
isNameTooLong = true;
}
if (!isnum){
alert("Please enter valid phone number (only numbers).");
// alert("Please enter valid phone number (only numbers).");
$ret = $ret & false;
isPhoneNotValid = true;
}
if (phone.length < 9 || phone.length > 12){
alert("Please enter valid phone number (9 - 12 digits).");
// alert("Please enter valid phone number (9 - 12 digits).");
$ret = $ret & false;
isPhoneDigitNotValid = true;
}
if (pp=="" ){
alert("Profile picture unchanged.");
......@@ -37,7 +64,28 @@ function validateForm(){
alert(unchanged);
// $ret = $ret & false;
}
return $ret;
if ($ret == true){
// alert(true);
return true;
} else{
// alert(false);
if (isNameEmpty == true){
document.getElementById("warning-1").style.visibility = 'visible';
}
if (isAddressEmpty == true){
document.getElementById("warning-2").style.visibility = 'visible';
}
if (isPhoneEmpty == true){
document.getElementById("warning-3").style.visibility = 'visible';
} else if (isPhoneDigitNotValid == true){
document.getElementById("warning-3").style.visibility = 'visible';
document.getElementById("warning-3").innerHTML = 'Phone number must be between 9 - 12 digits.';
} else if (isPhoneNotValid == true){
document.getElementById("warning-3").style.visibility = 'visible';
document.getElementById("warning-3").innerHTML = 'Phone number must be numbers.';
}
return false;
}
}
function getDefault() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment