Remove cart button and function - php

I already create a delete button, but when I click it no showing any error message and the cart item and the item in database no get deleted.
<td class="col-sm-1 col-md-1">
<button type="button" class="btn btn-sm btn-danger delete_cart_btn" value="<?= $citem['prod_id']; ?>">Delete</button>
</td>
This is the delete button function
if(isset($_POST['delete_cart_btn']))
{
$prod_id = mysqli_real_escape_string($con, $_POST['prod_id']);
$prod_query = "SELECT * FROM carts WHERE id='$prod_id' ";
$prod_query_run = mysqli_query($con, $prod_query);
$prod_data = mysqli_fetch_array($prod_query_run);
$image = $prod_data['image'];
$delete_query = "DELETE FROM carts WHERE id='$prod_id' ";
$delete_query_run = mysqli_query($con, $delete_query);
if($delete_query_run)
{
if(file_exists("../assets/images/products/".$image))
{
unlink("../assets/images/products/".$image);
}
echo 200;
}
else
{
echo 404;
}
}
Here my database
enter image description here
Here the button cart script and the button function
enter image description here
enter image description here
Here the full code the cart
<div id="fullCart" class="row">
<div class="col-sm-12 col-md-12 col-md-offset-1">
<table class="table table-hover">
<thead colspan="4">
<tr>
<p class="text-center"><strong><span style="font-size: 25px;"><i class="fa fa-shopping-cart" style="font-size:25px;color:black"></i> My Cart</span></strong></p>
</tr>
</thead>
<hr>
<thead>
<tr>
<th class="text-center">Product</th>
<th class="text-center">Quantity</th>
<th class="text-center">Price</th>
<th class="text-center">Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$subTotal = 0;
$quantity = 0;
$tax = 10;
$items = getCartItems();
foreach ($items as $citem) {
$subTotal += $citem['prod_qty'] * $citem['selling_price'];
$quantity += $citem['prod_qty'];
?>
<tr id="item_<?= $citem['prod_id']; ?>">
<td class="col-sm-8 col-md-6">
<div class="media">
<img class="media-object" src="assets/images/products/<?= $citem['image']; ?>" style="width: 100px; height: 100px;">
<h4 class="media-heading" style="position:relative; left:110px; top:-100px;"><?= $citem['name']; ?></h4>
</div>
</td>
<td class="col-sm-1 col-md-1 text-center">
<strong><?= $citem['prod_qty']; ?></strong>
</td>
<td class="col-sm-1 col-md-1 text-center">
<strong><span style="font-size: 18px;">$</span><span id="price"><?= number_format( $citem['selling_price'], 2 ); ?></span>
</strong>
</td>
<td class="col-sm-1 col-md-1 text-center">
<strong><span style="font-size: 18px;">$</span><span id="totalPrice_<?= $citem['prod_id']; ?>"><?= number_format( $citem['prod_qty'] * $citem['selling_price'], 2 ); ?></span>
</strong>
</td>
<td class="col-sm-1 col-md-1">
<button type="button" class="btn btn-sm btn-danger delete_cart_btn" name="delete_cart_btn" value="<?= $citem['prod_id']; ?>">Delete</button>
</td>
</tr>
<?php } ?>
<tr>
<td colspan="4" align="right">Subtotal</td>
<td class="text-right">
<strong><span style="font-size: 18px;">$</span>
<span id="subTotal"><?= number_format( $subTotal, 2 ); ?></span>
</strong>
</td>
</tr>
<tr>
<td colspan="4" align="right">Taxes</td>
<td class="text-right">
<strong><span style="font-size: 18px;">$</span>
<span id="taxes"><?= number_format( $tax * $quantity, 2 ); ?></span>
</strong>
</td>
</tr>
<tr>
<td colspan="4" align="right">Total</td>
<td class="text-right">
<strong><span style="font-size: 18px;">$</span>
<span id="finalPrice"><?= number_format( $subTotal+($tax * $quantity), 2 ); ?></span>
</strong>
</td>
</tr>
<tr>
<td colspan="4" align="right">
<a href="index.php" class="btn btn-default">
<span class="glyphicon glyphicon-shopping-cart"></span> Place Order
</a>
</td>
<td >
<a href="checkout.php" class="btn btn-success">
Order <span class="glyphicon glyphicon-play"></span>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>

It seems you don't have a form to submit
There is no action when there is no form
Add a form tag and change your button type to submit
you need to data pass by POST so i 've added a method="POST" attribute to my form
<form>
<td class="col-sm-1 col-md-1" action="file_name.php" method="POST">
<button type="submit" class="btn btn-sm btn-danger delete_cart_btn" name="delete_cart_btn" value="<?= $citem['prod_id']; ?>">Delete</button>
</td>
</form>
instead of file_name.php put your php script file name

You did not name the button, so it doesn't send the data in the form.
<td class="col-sm-1 col-md-1">
<button type="button" class="btn btn-sm btn-danger delete_cart_btn" name="delete_cart_btn" value="<?= $citem['prod_id']; ?>">Delete</button>
</td>
if(isset($_POST['delete_cart_btn']))
{
$prod_id = mysqli_real_escape_string($con, $_POST['delete_cart_btn']);
$prod_query = "SELECT * FROM carts WHERE id='$prod_id' ";
$prod_query_run = mysqli_query($con, $prod_query);
$prod_data = mysqli_fetch_array($prod_query_run);
$image = $prod_data['image'];
$delete_query = "DELETE FROM carts WHERE id='$prod_id' ";
$delete_query_run = mysqli_query($con, $delete_query);
if($delete_query_run)
{
if(file_exists("../assets/images/products/".$image))
{
unlink("../assets/images/products/".$image);
}
echo 200;
}
else
{
echo 404;
}
}

Related

Enter multiple rows in an MySQL table by pressing the Submit button in a PHP Form

So to preface - I'm trying to implement a "Mark Attendance" feature on my website where I'm printing all the registered students in a table (that is wrapped in ) - each student has a "Present / Absent" radio button and once the admin has selected his preferred option, he presses "Submit" and the form should mark all students Present OR Absent i.e insert multiple rows (equal to the number of total students in the table) with their Attendance Status i.e Absent or Present.
Following is the HTML part of the code (mixed with some PHP):
<form action="adminmarkattendance.php" method="post">
<div class="row">
<div class="col">
<div class="card bg-default shadow">
<div class="card-header bg-transparent border-0">
<div class="form-inline">
<div class="col-lg-6">
<h3 class="text-white mb-0">Registered Students</h3>
</div>
<div class="col-lg-6">
<div class="form-group">
<input style="width: 100%;" class="form-control" name="attendancedate" type="date" required>
</div>
</div>
</div>
</div>
<div class="table-responsive" style="overflow-y: scroll; height: 600px;">
<table class="table align-items-center table-dark table-flush">
<thead class="thead-dark">
<tr>
<th scope="col" class="sort" data-sort="name">Avatar</th>
<th scope="col" class="sort" data-sort="name">Student Name</th>
<th scope="col" class="sort" data-sort="status">Phone Number</th>
<th scope="col" class="sort" data-sort="status">Age</th>
<th scope="col" class="sort" data-sort="status">Gender</th>
<th scope="col" class="sort" data-sort="status">Address</th>
<th scope="col" class="sort" data-sort="status">Action</th>
</tr>
</thead>
<tbody class="list">
<?php
foreach ($getRows as $row) {
$i = 0; ?>
<tr>
<td>
<img src="<?php echo '../profileImages/' . $row['profile_image'] ?>" width="45" height="45" alt="">
<input type="hidden" name="id" value="<?php echo $row['student_id']; ?>">
</td>
<th scope="row">
<div class="media align-items-center">
<div class="media-body">
<span class="name mb-0 text-sm"><?php echo $row['fname'] . ' ' . $row['lname']; ?></span>
</div>
</div>
</th>
<td>
<span class="badge badge-dot mr-4">
<span class="status"><?php echo $row['phonenumber']; ?></span>
</span>
</td>
<td>
<span class="badge badge-dot mr-4">
<span class="status"><?php echo $row['age']; ?></span>
</span>
</td>
<td>
<span class="badge badge-dot mr-4">
<span class="status"><?php echo $row['gender']; ?></span>
</span>
</td>
<td>
<span class="badge badge-dot mr-4">
<span class="status"><?php echo $row['address']; ?></span>
</span>
</td>
<td>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
<input type="radio" name="options" value="present" id="option1" autocomplete="off" checked> Present
</label>
<label class="btn btn-secondary">
<input type="radio" name="options" value="absent" id="option2" autocomplete="off"> Absent
</label>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="text-center">
<button type="submit" name="submit" style="width: 100%;" class="btn btn-warning">Mark Attendance</button>
</div>
</form>
PHP:
if (isset($_POST["submit"])) {
$student_id = $_POST["id"];
$date = $_POST['attendancedate'];
$date = date('Y-m-d', strtotime($date));
$status = $_POST['options'];
$queryInsert = $conn->prepare("INSERT
into attendance
(
student_id,
date,
status
)
values
(
$student_id,
'$date',
'$status'
)
");
$queryInsert->execute();
echo "<script> location.replace('adminmarkattendance.php'); </script>";
}
As you can probably see in the code - I'm only trying to insert the student's ID, date & his present/absent status.
Now, when I press submit, the information of only 1 student is inserted into the Attendance table. Usually, the last student. Which is not what I want - I want X number of rows inserted when I press submit, where X is equal to the number of students in the table.
How do I achieve this? Thank you for reading.
What you need is to submit whole data and then loop through it like this
<input type="hidden" name="id[]" value="<?php echo $row['student_id']; ?>">
<input type="radio" name="options[]" value="absent" id="option2" autocomplete="off"> Absent</label>
Then
if (isset($_POST["submit"]))
{
for($i=0;$i<count($_POST["id"]);$i++)
{
$student_id = $$_POST["id"][$i]];
$date = $_POST['attendancedate'];
$date = date('Y-m-d', strtotime($date));
$status = $_POST['options'][$i]];
$queryInsert = $conn->prepare("INSERT into attendance(student_id,date,status)
values ($student_id,'$date','$status')");
$queryInsert->execute();
}
}
Note Adjust the code according to your need.
Sadly, I can't comment on answers yet.
I feel like I do have something to improve on Adib Javed's answer (the back-end part).
Preferably - don't loop db requests, and try to make a single request.
So you can loop to create the request, and when the loop ends, send that single request:
if (isset($_POST["submit"]))
{
$query = "INSERT into attendance(student_id,date,status) values";
for($i=0;$i<count($_POST["id"]);$i++)
{
$student_id = $$_POST["id"][$i]];
$date = $_POST['attendancedate'];
$date = date('Y-m-d', strtotime($date));
$status = $_POST['options'][$i]];
$query .= " ($student_id,'$date','$status'),";
}
substr_replace($query ,";", -1);
$queryInsert = $conn->prepare($query);
$queryInsert->execute();
}

how to update a whole (session) shopping cart not a single item in laravel

I having struggling for sometime to get this work!!!
I have a shopping cart created in laravel
This is the Shopping Cart image :
I want user to be able to edit the 'qty' field and 'update shopping cart' button should compute the item 'total' and final 'total' but I can't get to it work
here is my updatecart method;
public function updateCart(Request $request)
{
$cart = $request->session()->get('cart');
if(!$cart){
$cart = new Cart($cart);
}
$i = 0;
foreach($cart->items as $item){
$qty = $request->input($item['item']['id']);
$item['qty'] = $qty;
$item['total'] = $item['price'] * $qty;
$i++;
}
$cart->totalQty = array_sum($request->all());
$request->session()->put('cart', $cart);
//return $cart->items;
return redirect()->route('cart');
}
and my blade template;
<form method="post" action="{{route('updateCart')}}">
{{ csrf_field() }}
<table class="table table-hover">
<thead>
<tr>
<th class="text-center">Product</th>
<th class="text-center">Qty</th>
<th class="text-center">Rate</th>
<th class="text-center">Subtotal</th>
<th> </th>
</tr>
</thead>
<tbody>
#foreach($items as $item)
<tr>
<td class="col-sm-8 col-md-6 text-center">
<div class="media">
<a class="thumbnail pull-left" href="#"> <img class="media-object" src="{{asset('storage/'.$item['image'])}}" style="width: 100px; height: 72px;"> </a>
<div class="media-body">
<h4 class="media-heading">{{$item['item']['title']}}</h4>
</div>
</div>
</td>
<td class="col-sm-1 col-md-1" style="text-align: center">
<input type="number" class="form-control input-sm" name="{{$item['item']['id']}}" value="{{old($item['item']['id']) ? old($item['item']['id']) : $item['qty']}}">
</td>
<td class="col-sm-1 col-md-1 text-center">₦{{$item['price']}}</td>
<td class="col-sm-1 col-md-1 text-center"><strong>₦{{$item['total']}}</strong></td>
<td class="col-sm-1 col-md-1">
<a href="#"> <button type="button" class="btn btn-danger">
<span class="fa fa-remove"></span> Remove
</button>
</a>
</td>
</tr>
#endforeach
<tr>
<td> </td>
<td> </td>
<td>
<h3>Total</h3>
</td>
<td class="text-center">
<h3><strong>₦{{$total}}</strong></h3>
</td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> <button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-shopping-cart"></span>Update shopping Cart
</button> </td>
<td>
<a href="/"> <button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-shopping-cart"></span> Continue Shopping
</button>
</a>
</td>
<td>
<a href={{route( 'checkout')}} class="btn btn-success" role="button">
Checkout <span class="glyphicon glyphicon-play"></span>
</a>
</td>
</tr>
</tbody>
</table>
</form>
Thank you in advance!
Edited:
please note I don't want to update the cart per item but the whole cart!
You can use session()->forget('cart') before inserting into you cart.
$cart = $request->session()->forget('cart');
if(!$cart){
$cart = new Cart($cart);
}
$i = 0;
foreach($cart->items as $item){
$qty = $request->input($item['item']['id']);
$item['qty'] = $qty;
$item['total'] = $item['price'] * $qty;
$i++;
}
$cart->totalQty = array_sum($request->all());
$request->session()->put('cart', $cart);
After removing insert again into cart. It will work in your scenario
Hope this helps

Update shopping cart quantity without update other products

I'm trying to work out how to update my shopping cart without updating other products. Should I be working with sessions here or not? MY current issue is that whenever I change the quantity it updates the other products as well and sets the quantity in the box back to 1. How would I go about changing this?
This is what I currently have, I understand why it updates all the products but I can't figure out how to do it otherwise.
<?php
session_start();
include("header.php");
include_once("dbconnect.php");
include("functies.php");
if (empty($_SESSION['cart'])) {
echo "U heeft geen producten in uw winkelwagen";
} else {
$items = $_SESSION['cart'];
$cartitems = explode(",", $items);
?>
<div align="center">
<?php titel(); ?>
<h1 Winkelwagen <h1>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-10 col-md-offset-1">
<table class="table table-hover">
<thead>
<tr>
<th>Product</th>
<th>Quantity</th>
<th class="text-center">Price</th>
<th class="text-center">Total</th>
<th> </th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
$i=1;
foreach ($cartitems as $key=>$id) {
$sql = "SELECT * FROM products WHERE id = $id";
$res=mysqli_query($conn, $sql);
$r = mysqli_fetch_assoc($res);
$sqlb = "SELECT * FROM brewery WHERE code = $r[brewery_code]";
$resb=mysqli_query($conn, $sqlb);
$rb = mysqli_fetch_assoc($resb);
if (isset($_POST['submit'])) {
$amount = $_POST['amount'];
} else $amount = 1;
?>
<tr>
<td class="col-sm-8 col-md-6">
<div class="media">
<img class="thumbnail pull-left" src="Images/<?php echo $r['name'] ?>.jpg" width="85" height="152" alt="..." >
<div class="media-body">
<h4 class="media-heading"><?php echo $r['name']; ?></h4>
<h5 class="media-heading"> by <?php echo $rb['name'];; ?></a></h5>
<span>Status: </span><span class="text-success"><strong>In Stock</strong></span>
</div>
</div></td>
<td class="col-sm-1 col-md-1" style="text-align: center">
<form action="" method="post">
<input type="number" class="form-control" name="amount" value="1" min="1">
<input type="submit" name="submit" class="btn btn-primary btn-sm">
</form>
</td>
<?php
$total = $total + $r['price'];
$i++;
$producttotal = $amount * $r['price'];
?>
<td class="col-sm-1 col-md-1 text-center"><strong>€ <?php echo number_format($r['price'],2);?> </strong></td>
<td class="col-sm-1 col-md-1 text-center"><strong>€ <?php echo number_format($producttotal,2);?> </strong></td>
<td class="col-sm-1 col-md-1">
<button type="button" class="btn btn-danger">
Verwijderen
</button></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<td>   </td>
<td>   </td>
<td>   </td>
<td><h5>Subtotal<br>Estimated shipping</h5><h3>Total</h3></td>
<td class="text-right"><h5><strong>$24.59<br>$6.94</strong></h5><h3>$31.53</h3></td>
</tr>
<tr>
<td>   </td>
<td>   </td>
<td>   </td>
<td>
<button type="button" class="btn btn-primary"> Continue Shopping </button></td>
<td>
<button type="button" class="btn btn-primary"> Checkout </button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<?php } ?>
Your form needs to contain an indicator for which product you want to increase the quantity. For example, like this:
<form action="" method="post">
<input type="number" class="form-control" name="amount[<?php echo $id;?>]" value="1" min="1">
<input type="submit" name="submit" class="btn btn-primary btn-sm">
</form>
You can then evaluate the id like this:
if (isset($_POST['submit']) && isset($_POST['amount'][$id])) {
$amount = $_POST['amount'][$id];
} else {
$amount = 1;
}
I don't understand why you would set the amount to 1 if it hasn't be set in the $_POST. I think you have to store the amount per product in the session, not just the ids as you are doing now.
Maybe like this:
if (isset($_POST['submit']) && isset($_POST['amount'][$id])) {
$amount = intval($_POST['amount'][$id]);
} else {
if(isset($_SESSION['amounts'][$id])) {
$amount = $_SESSION['amounts'][$id];
} else {
$amount = 1;
}
}
if(!isset($_SESSION['amounts'])) $_SESSION['amounts'] = array();
$_SESSION['amounts'][$id] = $amount;

how to use div tag inside <td> in php code

I want to know how should we use div tags inside a table in PHP code. This is my code. Please tell me how to use it properly.
<tbody>
<?php
$result = mysqli_query($conn,$sql);
while($row = mysqli_fetch_array($result,MYSQLI_BOTH)) {
echo "<tr>
<td>{$row['id']}</td>
<td><img width='90px' height='90px' src='imageView.php?id=".$row["id"]."' /> </td>
<td>{$row['item_name']}</td>
<td>{$row['description']}</td>
<td>{$row['quantity']}</td>
<td>echo '<div class="col-md-1 col-sm-3 col-xs-6 c-cart-qty">
<div class="c-input-group c-spinner">
<input type="text" class="form-control c-item-1" value="1">
<div class="c-input-group-btn-vertical">
<button class="btn btn-default" type="button" data_input="c-item-1">
<i class="fa fa-caret-up"></i>
</button>
<button class="btn btn-default" type="button" data_input="c-item-1">
<i class="fa fa-caret-down"></i>
</button>
</div>
</div>
</div>
</td>';
<td> <button>submit</button> </td>
</tr>";
}?>
</tbody>
I have tried using inverted comma's and braces but still, it shows error. What needs to be done here?
You can write the div inside table. Don't put all table inside php tag. remove html outside the <?php ?> php code. after that whenever you want to echo any value just used the php.
Customize your code like below,
<table>
<tbody>
<?php
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) {
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><img width='90px' height='90px' src='imageView.php?id=<?php echo $row["id"]; ?>' /> </td>
<td><?php echo $row['item_name']; ?></td>
<td><?php echo $row['description']; ?></td>
<td><?php echo $row['quantity']; ?></td>
<td>
<div class="col-md-1 col-sm-3 col-xs-6 c-cart-qty">
<div class="c-input-group c-spinner">
<input type="text" class="form-control c-item-1" value="1">
<div class="c-input-group-btn-vertical">
<button class="btn btn-default" type="button" data_input="c-item-1">
<i class="fa fa-caret-up"></i>
</button>
<button class="btn btn-default" type="button" data_input="c-item-1">
<i class="fa fa-caret-down"></i>
</button>
</div>
</div>
</div>
</td>
<td> <button>submit</button> </td>
</tr>
<?php } ?>
</tbody>
</table>
Within a double quote you can use a single quote
<tbody>
<?php
$result = mysqli_query($conn,$sql);
while($row = mysqli_fetch_array($result,MYSQLI_BOTH)) {
echo "<tr>
<td>{$row['id']}</td>
<td><img width='90px' height='90px' src='imageView.php?id=".$row["id"]."' /> </td>
<td>{$row['item_name']}</td>
<td>{$row['description']}</td>
<td>{$row['quantity']}</td>
<td><div class='col-md-1 col-sm-3 col-xs-6 c-cart-qty'>
<div class='c-input-group c-spinner'>
<input type='text' class='form-control c-item-1' value='1'>
<div class='c-input-group-btn-vertical'>
<button class='btn btn-default' type='button' data_input='c-item-1'>
<i class='fa fa-caret-up'></i>
</button>
<button class='btn btn-default' type='button' data_input='c-item-1'>
<i class='fa fa-caret-down'></i>
</button>
</div>
</div>
</div>
</td>;
<td> <button>submit</button> </td>
</tr>";
}?>
</tbody>

return the array of the selected id after the edit

I'm sorry but i kind of find some difficulties while editing my data , the problem is when i click the button edit, it works but when you go back to the previous page, it's like the id isn't stocked anymore so the array stays unknowns of this specific id.
Here is it's code:
<?php
include_once 'dbconfig.php';
$id = $_GET['quotauser'];
if (isset($id)) {
extract($crud->getQUOTA($id));
}
include_once 'headerQ.php';
?>
<div class="clearfix"></div>
<div class="container">
<a href="add-quota.php?add-quota" class="btn btn-large btn-info">
<i class="glyphicon glyphicon-plus"></i> Add Quota
</a>
</div>
<div class="clearfix"></div><br />
<div class="container">
<table class='table table-bordered table-responsive'>
<tr>
<th>id</th>
<th>QTANAME</th>
<th>SRVNAME</th>
<th>QTAVALUE</th>
<th colspan="3" align="center">Actions</th>
</tr>
<?php
$query = "SELECT quota.* FROM quota,user WHERE user.id=quota.id_user AND quota.id_user= '.$id.' ";
$records_per_page = 10;
$newquery = $crud->paging($query, $records_per_page);
$crud->quotaID($newquery);
?>
<tr>
<td colspan="10" align="center">
<div class="pagination-wrap">
<?php $crud->paginglink($query, $records_per_page); ?>
</div>
</td>
</tr>
</table>
</div>
<?php include_once 'footer.php'; ?>
and when the button show quota is clicked, the page that contains quota contain two options edit and delete
and the edit button takes u to this page
Edit's code is :
<?php
include_once 'dbconfig.php';
if (isset($_POST['btn-update'])) {
$id = $_GET['edit_quota'];
$QTANAME = $_POST['QTANAME'];
$SRVNAME = $_POST['SRVNAME'];
$QTAVALUE = $_POST['QTAVALUE'];
if ($crud->updateQ($id, $QTANAME, $SRVNAME, $QTAVALUE)) {
$msg = "<div class='alert alert-info'>
<strong>WOW!</strong> Quota was updated successfully <a href='UserQuota.php'>HOME</a>!
</div>";
} else {
$msg = "<div class='alert alert-warning'>
<strong>SORRY!</strong> ERROR while updating Quota !
</div>";
}
}
if (isset($_GET['edit_quota'])) {
$id = $_GET['edit_quota'];
extract($crud->getQUOTA($id));
}
?>
<?php include_once 'headerQ.php'; ?>
<div class="clearfix"></div>
<div class="container">
<?php
if (isset($msg)) {
echo $msg;
}
?>
</div>
<div class="clearfix"></div><br />
<div class="container">
<form method='post'>
<table class='table table-bordered'>
<tr>
<td>QTANAME</td>
<td><input type='text' name='QTANAME' class='form-control' value="<?php echo $QTANAME; ?>" required></td>
</tr>
<tr>
<td>SRVNAME</td>
<td><input type='text' name='SRVNAME' class='form-control' value="<?php echo $SRVNAME; ?>" required></td>
</tr>
<tr>
<td>QTAVALUE</td>
<td><input type='number' name='QTAVALUE' class='form-control' value="<?php echo $QTAVALUE; ?>" required></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-primary" name="btn-update">
<span class="glyphicon glyphicon-edit"></span> Update this Record
</button>
<i class="glyphicon glyphicon-backward"></i> CANCEL
</td>
</tr>
</table>
</form>
</div>
<?php include_once 'footer.php'; ?>

Categories