userInfo update system is done
This commit is contained in:
parent
5d8f633fcc
commit
9a8cd9b3fc
@ -58,4 +58,19 @@
|
|||||||
mysqli_stmt_close($stmt);
|
mysqli_stmt_close($stmt);
|
||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function query_getUserInfo($conn, $uid) {
|
||||||
|
$sql = "Select * From userInfo Where C_ID= ? ";
|
||||||
|
$stmt = mysqli_stmt_init($conn);
|
||||||
|
if (!mysqli_stmt_prepare($stmt, $sql)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
mysqli_stmt_bind_param($stmt, "s", $uid);
|
||||||
|
mysqli_stmt_execute($stmt);
|
||||||
|
|
||||||
|
$resultData = mysqli_stmt_get_result($stmt);
|
||||||
|
mysqli_stmt_close($stmt);
|
||||||
|
return $resultData;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12" id="shopping_cart">
|
<div class="col-sm-12" id="shopping_cart">
|
||||||
<form action="userInfo.php" method="get">
|
<form action="cart.php" method="get">
|
||||||
<table class="cartTable">
|
<table class="cartTable">
|
||||||
<thead>
|
<thead>
|
||||||
<!-- <tr style="margin:auto; border: 2px solid black;">
|
<!-- <tr style="margin:auto; border: 2px solid black;">
|
||||||
|
|||||||
0
shopping/checkout.php
Normal file
0
shopping/checkout.php
Normal file
@ -2,8 +2,11 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<?php
|
<?php
|
||||||
require_once '../php/connection.php';
|
require_once '../php/connection.php';
|
||||||
|
require_once '../php/functions.php';
|
||||||
$conn = connectMysql();
|
$conn = connectMysql();
|
||||||
require_once '../php/logged_in_header.php';
|
require_once '../php/logged_in_header.php';
|
||||||
|
$resultData = query_getUserInfo($conn, $_SESSION['username']);
|
||||||
|
$row = $resultData->fetch_assoc();
|
||||||
?>
|
?>
|
||||||
<head>
|
<head>
|
||||||
<!-- Required meta tags -->
|
<!-- Required meta tags -->
|
||||||
@ -41,34 +44,34 @@
|
|||||||
<form class="row g-3" action="../php/saveUserInfo.php" method="post">
|
<form class="row g-3" action="../php/saveUserInfo.php" method="post">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label for="inputEmail4" class="form-label">Email</label>
|
<label for="inputEmail4" class="form-label">Email</label>
|
||||||
<input type="email" class="form-control" name="email" id="inputEmail">
|
<input type="email" class="form-control" name="email" id="inputEmail" value="<?php echo $row["C_EMAIL"]?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label for="inputPhone4" class="form-label">Phone</label>
|
<label for="inputPhone4" class="form-label">Phone</label>
|
||||||
<input type="tel" class="form-control" name="phone" id="inputPhone" placeholder="123-456-7890" maxlength="12">
|
<input type="tel" class="form-control" name="phone" id="inputPhone" placeholder="123-456-7890" maxlength="12" value="<?php echo $row["C_PHONE"]?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label for="inputAddress" class="form-label">Address</label>
|
<label for="inputAddress" class="form-label">Address</label>
|
||||||
<input type="text" class="form-control" name="address" id="inputAddress" placeholder="1234 Main St">
|
<input type="text" class="form-control" name="address" id="inputAddress" placeholder="1234 Main St" value="<?php echo $row["C_ADDRESS"]?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label for="inputAddress2" class="form-label"></label>
|
<label for="inputAddress2" class="form-label"></label>
|
||||||
<input type="text" class="form-control" name="unit" id="inputAddress2" placeholder="Apartment, studio, or floor">
|
<input type="text" class="form-control" name="unit" id="inputAddress2" placeholder="Apartment, studio, or floor" value="<?php echo $row["C_UNIT"]?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label for="inputCity" class="form-label">City</label>
|
<label for="inputCity" class="form-label">City</label>
|
||||||
<input type="text" class="form-control" name="city" id="inputCity">
|
<input type="text" class="form-control" name="city" id="inputCity" value="<?php echo $row["C_CITY"]?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label for="inputState" class="form-label">State</label>
|
<label for="inputState" class="form-label">State</label>
|
||||||
<select id="inputState" class="form-select" name="country">
|
<select id="inputState" class="form-select" name="country">
|
||||||
<option selected>Choose...</option>
|
<option <?php if ($row["C_COUNTRY"] === '') echo 'selected'; ?> >Choose...</option>
|
||||||
<option>...</option>
|
<option <?php if ($row["C_COUNTRY"] === 'Canada') echo 'selected'; ?> >Canada</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<label for="inputZip" class="form-label">Zip</label>
|
<label for="inputZip" class="form-label">Zip</label>
|
||||||
<input type="text" class="form-control" name="zip" id="inputZip">
|
<input type="text" class="form-control" name="zip" id="inputZip" value="<?php echo $row["C_ZIP"]?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
@ -84,6 +87,10 @@
|
|||||||
if($_GET['error'] === "notChecked") {
|
if($_GET['error'] === "notChecked") {
|
||||||
echo '<div class="errorFont">Please check the box!</div>';
|
echo '<div class="errorFont">Please check the box!</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($_GET['error'] === '0') {
|
||||||
|
echo '<div class="successFont">Updated Successfully!</div>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -28,3 +28,6 @@ video
|
|||||||
|
|
||||||
.errorFont
|
.errorFont
|
||||||
color: red
|
color: red
|
||||||
|
|
||||||
|
.successFont
|
||||||
|
color: green
|
||||||
@ -35,6 +35,10 @@ video {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.successFont {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
.index-page {
|
.index-page {
|
||||||
background-color: #edeae8;
|
background-color: #edeae8;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user