This code is working for me but by clicking the button, nothing changes. The delete results are seen only after I refresh again my page manually.
Is there anything to add to fix this issue?
<?php
foreach($results as $value){
echo "<tr>";
echo "<td class='posts column-posts'>".$value->id."</td>";
echo "<td class='email column-email'>".$value->email."</td>";
echo "<td class='description column-description'><div id='col-container'>".$value->details."</div></td>";
$delRow = "delete_registration_{$value->id}";
echo "<td class='posts column-posts'><input type='submit' name= $delRow value='delete'/></td>";
echo "</tr>";
if(isset($_POST[$delRow])){
$wpdb->delete( 'conference_register', array( 'id' => $value->id ) );
}
}
You need to skip outputting the row if you are deleting it. Something like this:
<?php
foreach($results as $value){
$delRow = "delete_registration_{$value->id}";
if(isset($_POST[$delRow])){
$wpdb->delete( 'conference_register', array( 'id' => $value->id ) );
} else {
echo "<tr>";
echo "<td class='posts column-posts'>".$value->id."</td>";
echo "<td class='email column-email'>".$value->email."</td>";
echo "<td class='description column-description'><div id='col-container'>".$value->details."</div></td>";
echo "<td class='posts column-posts'><input type='submit' name= $delRow value='delete'/></td>";
echo "</tr>";
}
}
You can avoid displaying the row if you are deleting the row.
foreach($results as $value){
if(isset($_POST[$delRow])){
$wpdb->delete( 'conference_register', array( 'id' => $value->id ) );
}
else {
echo "<tr>";
echo "<td class='posts column-posts'>".$value->id."</td>";
echo "<td class='email column-email'>".$value->email."</td>";
echo "<td class='description column-description'><div id='col-container'>".$value->details."</div></td>";
$delRow = "delete_registration_{$value->id}";
echo "<td class='posts column-posts'><input type='submit' name= $delRow value='delete'/></td>";
echo "</tr>";
}
}
Related
I wants my first row only display in big fonts and the other fetch data (rows) in small fonts...
this is my code:
<?php
$tasktable = mysql_query("SELECT * FROM tasks WHERE taskstatus != 'Done' AND assignedto = '". $uname ."' ORDER BY taskduedate,taskpriority,taskcategory");
echo "<table border = '0' align='center' style='font-family:Calibri;'>";
echo "<tr bgcolor='#82CAFF'><td align='center' style='font-size:15px;'><b>Assigned Date</b></td>
<td align='center' style='font-size:15px;' ><b>Task Time</b></td>
<td align='center' style='font-size:15px;' ><b>Task Name</b></td>
<td align='center' style='font-size:15px;' ><b>Category</b></td>
<td align='center' style='font-size:15px;' ><b>Priority</b></td>
<td align='center' style='font-size:15px;' ><b>Estimated Time</b></td>
<td align='center' style='font-size:15px;' ><b>Status</b></td>
<td align='center' style='font-size:15px;' ><b>Update</b></td></tr>";
$i=0;
while($task = MYSQL_FETCH_OBJECT($tasktable)){
if($i==0) {
$i=1;
echo 'active';}
echo "<tr bgcolor='#F0FFFF' font-family:Calibri>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskduedate = $task ['taskduedate'];
echo $taskduedate;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskduetime = $task ['taskduetime'];
echo $taskduetime;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskname = $task ['taskname'];
echo $taskname;
echo "</td><td style='font-family:Calibri; font-size:14px;'>";
$taskcategory = $task ['taskcategory'];
echo $taskcategory;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskpriority = $task ['taskpriority'];
echo $taskpriority;
echo "<td style='font-family:Calibri; font-size:14px;'>";
$estimatedtime = $task ['estimatedtime'];
echo $estimatedtime;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskstatus = $task ['taskstatus'];
echo $taskstatus;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:11px;'><a href='#'>";
echo "Update";
echo "</a></td>";
$i++;
}
echo "</tr>";
echo "</table>";
?>
But its not working. I don't get it. So,Please help me!
Thank you.
$i = 1;
$uname = $_SESSION['uname'];
$tasktable = mysql_query("SELECT * FROM tasks WHERE taskstatus != 'Done' AND assignedto = '". $uname ."' ORDER BY taskduedate,taskpriority,taskcategory");
echo "<table>";
while($task = mysql_fetch_array($tasktable))
{
if ($i == 1)
{
echo "<tr bgcolor='#F0FFFF' font-family:Calibri>";
echo "<td style='font-family:Calibri; font-size:25px;'>";
$taskduedate = $task ['taskduedate'];
echo $taskduedate;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:25px;'>";
$taskduetime = $task ['taskduetime'];
echo $taskduetime;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:25px;'>";
$taskname = $task ['taskname'];
echo $taskname;
echo "</td><td style='font-family:Calibri; font-size:25px;'>";
$taskcategory = $task ['taskcategory'];
echo $taskcategory;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:25px;'>";
$taskpriority = $task ['taskpriority'];
echo $taskpriority;
echo "<td style='font-family:Calibri; font-size:25px;'>";
$estimatedtime = $task ['estimatedtime'];
echo $estimatedtime;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:25px;'>";
$taskstatus = $task ['taskstatus'];
echo $taskstatus;
echo "</td>";
echo "<td><div>Time: <span id='time'></span></div><input type='button' value='start' onclick='show();start();'>
<input type='button' value='stop' onclick='stop();'>
<input type='button' value='reset' onclick='reset()'></td>";
}
else
{
echo "<tr bgcolor='#F0FFFF' font-family:Calibri>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskduedate = $task ['taskduedate'];
echo $taskduedate;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskduetime = $task ['taskduetime'];
echo $taskduetime;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskname = $task ['taskname'];
echo $taskname;
echo "</td><td style='font-family:Calibri; font-size:14px;'>";
$taskcategory = $task ['taskcategory'];
echo $taskcategory;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskpriority = $task ['taskpriority'];
echo $taskpriority;
echo "<td style='font-family:Calibri; font-size:14px;'>";
$estimatedtime = $task ['estimatedtime'];
echo $estimatedtime;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:14px;'>";
$taskstatus = $task ['taskstatus'];
echo $taskstatus;
echo "</td>";
echo "<td style='font-family:Calibri; font-size:11px;'><a href='#'>";
echo "Update";
echo "</a></td>";
}
$i = $i+1;
}
echo "</table>";
Hi i am trying to submit the multiple form values only from one button i have 10 records and one record has one button of submit and 10 records have 10 buttons of submit what i want there should be only one button of submit and i can submit he whole 10 records from one button:
echo "<table class='table table-hover table-responsive table-bordered'>";
// our table heading
echo "<tr>";
echo "<th class='textAlignLeft'>Product Name</th>";
echo "<th>Price</th>";
echo "<th style='width:5em;'>Quantity</th>";
echo "<th>Image</th>";
echo "<th>Action</th>";
echo "</tr>";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
//creating new table row per record
echo "<tr>";
echo "<td>";
echo "<div class='product-id' style='display:none;'>{$id}</div>";
echo "<div class='product-name'>{$name}</div>";
echo "</td>";
echo "<td>$" . number_format($price, 2, '.' , ',') . "</td>";
if(isset($quantity)){
echo "<td>";
echo "<input type='text' name='quantity' value='{$quantity}' disabled class='form-control' />";
echo "</td>";
echo "<td>";
echo "<td>";
echo "<button class='btn btn-success' disabled>";
echo "<span></span> Submitted!";
echo "</button>";
echo "</td>";
echo "</td>";
}else{
echo "<td>";
echo "<input type='number' name='quantity[]' value='1' class='form-control'/>";
echo "</td>";
echo "<td><img src='product-images/{$image}' width='60' height='60'</td>";
echo "<td>";
echo "<button class='btn btn-primary add-to-cart'>";
echo "<span></span>Submit to cart";
echo "</button>";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
}
what i want only one button from i can submit all my values: Any help would be high appreciated:
$action = isset($_GET['action']) ? $_GET['action'] : "";
$product_id = isset($_GET['product_id']) ? $_GET['product_id'] : "1";
$name = isset($_GET['name']) ? $_GET['name'] : "";
$quantity = isset($_GET['quantity']) ? $_GET['quantity'] : "1";
$image = isset($_GET['image']) ? $_GET['image'] : "1";
if($action=='added'){
echo "<div class='alert alert-info'>";
echo "<strong>{$name}</strong> added to your cart!";
echo "</div>";
}
else if($action=='failed'){
echo "<div class='alert alert-info'>";
echo "<strong>{$name}</strong> failed to add to your cart!";
echo "</div>";
}
// left join to select products
$query = "SELECT p.id, p.name, p.price, p.image, ci.quantity
FROM products p
LEFT JOIN cart_items ci
ON p.id = ci.product_id
ORDER BY p.name";
$stmt = $con->prepare( $query );
$stmt->execute();
// count number of products returned
$num = $stmt->rowCount();
HTML CODE
<?php
// connect to database
include 'config/db_connect.php';
// page headers
$page_title="Cart";
include 'layout_head.php';
// parameters
$action = isset($_GET['action']) ? $_GET['action'] : "";
$name = isset($_GET['name']) ? $_GET['name'] : "";
$image = isset($_GET['image']) ? $_GET['image'] : "";
// display a message
if($action=='removed'){
echo "<div class='alert alert-info'>";
echo "<strong>{$name}</strong> was removed from your cart!";
echo "</div>";
}
else if($action=='quantity_updated'){
echo "<div class='alert alert-info'>";
echo "<strong>{$name}</strong> quantity was updated!";
echo "</div>";
}
else if($action=='failed'){
echo "<div class='alert alert-info'>";
echo "<strong>{$name}</strong> quantity failed to updated!";
echo "</div>";
}
else if($action=='invalid_value'){
echo "<div class='alert alert-info'>";
echo "<strong>{$name}</strong> quantity is invalid!";
echo "</div>";
}
// select products in the cart
$query="SELECT p.id, p.name, p.price, p.image, ci.quantity, ci.quantity * p.price AS subtotal
FROM cart_items ci
LEFT JOIN products p
ON ci.product_id = p.id";
$stmt=$con->prepare( $query );
$stmt->execute();
// count number of rows returned
$num=$stmt->rowCount();
if($num>0){
//start table
echo "<table class='table table-hover table-responsive table-bordered'>";
// our table heading
echo "<tr>";
echo "<th class='textAlignLeft'>Product Name</th>";
echo "<th>Price</th>";
echo "<th style='width:15em;'>Quantity</th>";
echo "<th>Sub Total</th>";
echo "<th>Action</th>";
echo "</tr>";
$total=0;
while( $row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
echo "<tr>";
echo "<td>";
echo "<div class='product-id' style='display:none;'>{$id}</div>";
echo "<div class='product-name'>{$name}</div>";
echo "</td>";
echo "<td>$" . number_format($price, 2, '.', ',') . "</td>";
echo "<td>";
echo "<div class='input-group'>";
echo "<input type='number' name='quantity[]' value='{$quantity}' class='form-control'>";
echo "<span class='input-group-btn'>";
echo "<button class='btn btn-default update-quantity' type='button'>Update</button>";
echo "</span>";
echo "</div>";
echo "</td>";
echo "<td>$" . number_format($subtotal, 2, '.', ',') . "</td>";
echo "<td>";
echo "<a href='remove_from_cart.php?id={$id}&name={$name}' class='btn btn-danger'>";
echo "<span></span> Delete from cart";
echo "</a>";
echo "</td>";
echo "</tr>";
$total += $subtotal;
}
echo "<tr>";
echo "<td><b>Total</b></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td>$" . number_format($total, 2, '.', ',') . "</td>";
echo "<td>";
echo "</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
}else{
echo "<div class='alert alert-danger'>";
echo "<strong>No products found</strong> in your cart!";
echo "</div>";
}
include 'layout_foot.php';
?>
Use name quantity[] instead of quantity.By this way you can receive post data as an array. After the loop use only one submit button.
echo "<input type='number' name='quantity[]' value='1' class='form-control'/>";
Then receive it by using foreach
foreach($_POST['quantity'] as $qty)
{
echo $qty;
//Here you will receive all the quantities one by one.
}
Form the code
<?php
echo "<table class='table table-hover table-responsive table-bordered'>";
// our table heading
echo "<tr>";
echo "<th class='textAlignLeft'>Product Name</th>";
echo "<th>Price</th>";
echo "<th style='width:5em;'>Quantity</th>";
echo "<th>Image</th>";
echo "</tr>";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
//creating new table row per record
echo "<tr>";
echo "<td>";
echo "<div class='product-id' style='display:none;'>{$id}</div>";
echo "<div class='product-name'>{$name}</div>";
echo "</td>";
echo "<td>$" . number_format($price, 2, '.' , ',') . "</td>";
if(isset($quantity)){
echo "<td>";
echo "<input type='text' name='quantity[]' value='{$quantity}' disabled class='form-control' />";
echo "</td>";
echo "<td>";
echo "</td>";
echo "<td>";
echo "</td>";
}else{
echo "<td>";
echo "<input type='number' name='quantity[]' value='1' class='form-control'/>";
echo "</td>";
echo "<td><img src='product-images/{$image}' width='60' height='60'</td>";
echo "<td>";
echo "</td>";
}
echo "</tr>";
}
echo "<tr><td colspan='4'>";
echo "<button class='btn btn-primary add-to-cart' type='submit'>";
echo "<span></span>Submit to cart";
echo "</button>";
echo "</td></tr>";
echo "</table>";
I am writing an attendance system, where the name of the person working in a department will be shown and user will select respective attendance through radio buttons. I want to write the attendance record in a mysql data base.
For this i tried to prepare an array where i am unable to pass the value of selected radio button. Please help.
The sample code is as under:
<?php
$qry1="select * from master where office='ECZO_IT' order by cadre desc,srno";
$result1=mysql_query($qry1,$con);
$sl=1;
echo "<form method='post' action=''>";
echo "<table align='center' border='1' cellpadding='0' cellspacing='0' style='border- collapse: collapse' bordercolor='#111111' width='800' id='AutoNumber1' height='219'>";
echo "<tr><th colspan='14' bgcolor='#C0C0C0' align='center'>Attendance Report</th></tr>";
echo "<tr bgcolor='#C0C0C0' align='center'><th>Sl.</th>";
echo "<th >SR No.</th>";
echo "<th>Name</th>";
echo "<th>Designation</th>";
echo "<th colspan='10' align='center'>Attendance</th></tr>";
while ($data=mysql_fetch_row($result1))
{
echo "<tr><td align='center'>$sl</td>";
echo "<td align='center'>$data[0]</td>";
echo "<td>$data[1]</td>";
echo "<td align='center'>$data[4]</td>";
echo "<td bgcolor='#C0C0C0' align='center'>Present</td>";
echo "<td><input type='radio' name='r1[$sl]' value='PRESENT' id='at' checked></td>";
echo "<td bgcolor='#C0C0C0' align='center'>Training</td>";
echo "<td><input type='radio' name='r1[$sl]' value='TRAINING' id='at'></td>";
echo "<td bgcolor='#C0C0C0' align='center'>Tour</td>";
echo "<td><input type='radio' name='r1[$sl]' value='TOUR' id='at'></td>";
echo "<td bgcolor='#C0C0C0' align='center'>Leave</td>";
echo "<td><input type='radio' name='r1[$sl]' value='LEAVE' id='at'></td>";
echo "<td bgcolor='#C0C0C0' align='center'>Absent</td>";
echo "<td><input type='radio' name='r1[$sl]' value='ABSENT' id='at'></td></tr>";
$out[]= array ('srno' => $data['0'], 'ename' => $data[1], 'att' => $_POST['r1']);
$sl=$sl+1;
}
echo "</table>";
echo "<p align='center'><input type='submit' name ='s1' value='Submit'></p>";
echo "</form>";
foreach($out as $row)
{
echo $row['srno'].'----'.$row['ename'].'----'.$row['att']."<br/>";
}
?>
Please suggest if there is any other way out
Notes:
I tried to change the array as under
$out = array ('srno' => $data['0'], 'ename' => $data[1], 'att' => $_POST['r1']);
before modification the result was like this:
343587----SUNIL PRASAD OJHA----Array
343607----MUKESH KUMAR JHA----Array
343701----PRABHAT RANJAN----Array
After modification the result was as under:
3----3----3
P----P----P
I also tried to check output through the following code in foreach loop:
echo var_dump($out['att']);
but the result shows NULL only
Please help
I can access your radio button's value through:
var_dump($out[0]['att']);
Correct your array this way:
$out = array ('srno' => $data['0'], 'ename' => $data[1], 'att' => $_POST['r1']); //removed [] from $out
to accces it as:
echo $out['att'][1];
The 1 is because your radio buttons are an input array and your $sl value is 1
I have no idea why you need the foreach loop but you can also use it this way:
$data[1]='test';
$data2[1]='test2';
$out= array ('srno' => $data, 'ename' => $data2, 'att' => $_POST['r1']);
$i=1;
foreach($out as $key=>$val)
{
echo $key.'='.$val[$i]."<br/>";
}
//Prints: srno=test
// ename=test2
// att=TRAINING
I've a following html table which name contain array. How can i check this array if it's value is empty ?
echo "<input type='radio' name='ch[$roll][$sname][$class]' value='1' /> ";
echo "<input type='radio' name='ch[$id][$sname][$class]' value='0' />";
Currently i'm checking it with following code, it's not working but i know the name is array and it's must be compare with any array function. Can you guys give me a idea ?
if(isset($_POST['ch']))
{
$ch = $_POST['ch'];
if(empty($ch))
echo "<div class='error>Select attendence field. </div>";
}
Regards.
Update: (Full Code)
$action = htmlspecialchars($_SERVER['PHP_SELF'])."?class=$class_from";
echo "<form method='post' action='$action' name='attendence'/>";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr>";
echo "<td class='tdhead' valign='top' width='200'><b>Student Name</b></td>";
echo "<td class='tdhead' valign='top' width='250'><b>Roll No</b>
</td>";
echo "<td class='tdhead' valign='top' width='250'><b>Class Name</b>
</td>";
echo "<td class='tdhead' valign='top' width='200'><b>Present / Not present</b>
</td>";
echo "<td class='tdhead' valign='top' width='200'>
Present All <input type= 'checkbox'
onclick='checkAll(this)'</td>";
echo "</tr>";
//start the counter variable
$counter = 1;
while($res2 = mysql_fetch_array($sql2))
{
$id = (int) $res2['id'];
$sname = inputvalid($res2['sname']);
$roll = inputvalid($res2['roll']);
$class = inputvalid($res2['class']);
echo "<tr>";
echo "<td class='tdhead2' valign='top'>$sname</td>";
echo "<td class='tdhead2' valign='top'>$roll</td>";
echo "<td class='tdhead2' valign='top'>$class</td>";
echo "<td class='tdhead2' valign='top'>";
//echo each radio with the counter for this row
echo "<input type='radio' name='ch[$roll][$sname][$class]' value='1' /> ";
echo "<input type='radio' name='ch[$id][$sname][$class]' value='0' />";
echo "</td>";
echo "<td class='tdhead2' valign='top'> </td>";
echo "</tr>";
//add one to the counter
$counter++;
}
echo "<tr>";
echo "<td class='tdhead2'> </td>";
echo "<td class='tdhead2'> </td>";
echo "<td class='tdhead2'> </td>";
echo "<td class='tdhead2'> </td>";
echo "<td class='tdhead2'><input type='submit' value='Record' name='Submit'
class='submit' /></td>";
echo "</tr>";
echo "</table>";
echo "</form>";
if(isset($_POST['Submit']) && $_POST['Submit'] == "Record")
{
if(isset($_POST['ch']))
{
$ch = array_filter($_POST['ch']);
if (empty($ch))
{
echo "<div class='error>Select attendence field. </div>";
}
}
if(count($ch) == 0)
{
echo "<div class='error>Select attendence field. </div>";
}
else
{
foreach ($_POST['ch'] as $roll => $arr1)
{
$roll;
foreach ($arr1 as $name => $arr2)
{
$name;
foreach ($arr2 as $class => $value)
{
$class;
$value;
$sql = mysql_query("INSERT INTO e_attendence VALUES('', '$name', '$roll', '$class',
'$value', '$current_date')");
}
}
}
}
if($sql)
echo "<div class='success'>Succesfully recorded.
</div>";
}
empty() method work for finding whether the array is empty or not.
But for Your solution use below:-
if(isset($_POST['ch']) && $_POST['ch']=='1')
{
$ch = $_POST['ch'];
if(empty($ch))
echo "<div class='error>Select attendence field. </div>";
}
if You want to show a error message when no radio is selected then use below code:-
if(!isset($_POST['ch']) && $_POST['ch']=='')
{
echo "You have not selected any radio button";
}
use empty() instead of isset()
check the comparison table available at the below link
http://php.net/manual/en/types.comparisons.php
try this
print_r($_POST['ch']);
Try this
if(isset($_POST['ch'])){
$ch = array_filter($_POST['ch']);
if (empty($ch)) {
echo "<div class='error>Select attendence field. </div>";
}
}
I need to echo all rows from SQL column.
Here is my PHP
$query2="SELECT * FROM field_activity WHERE field_id='$fetch'";
$result2 = mysql_query($query2);
while($row = mysql_fetch_array($result2)){
$activity = $row['activity'];
$cr_date = date_create($row['date']);
$for_date = date_format($cr_date, 'F j, Y');
$amount = $row['amount'];
$acres_complete = $row['acres_complete'];
$duration = $row['duration'];
$status = $row['status'];
}
Here is my HTML output..
<?php
{
echo "<tr>";
echo "<td width='16%'><strong>Date</strong></td>";
echo "<td width='16%'>$for_date</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Activity</strong></td>";
echo "<td width='16%'>$activity</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Amount</strong></td>";
echo "<td width='16%'>$amount</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Acres Complete</strong></td>";
echo "<td width='16%'>$acres_complete</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Duration</strong></td>";
echo "<td width='16%'>$duration</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Status</strong></td>";
echo "<td width='16%'>$status</td>";
echo "</tr>";
}
?>
This only displays one of the rows (the latest row) from the column.. I want it to display all rows..
You need to actually do the echoing in the loop. If you move all of the echo statements to the end of the while loop, it will work exactly as you expect. You also need <table> and </table>.
Please embed your one row HTML echos into the while loop and everything will be done
OR
You can build your html string in the loop and echo your html string elsewhere.
You are overriding your variables in your while loop, so only the last value will be stored in your variables.
Try this:
$query2="SELECT * FROM field_activity WHERE field_id='$fetch'";
$result2 = mysql_query($query2);
while($row = mysql_fetch_array($result2)){
$activity = $row['activity'];
$cr_date = date_create($row['date']);
$for_date = date_format($cr_date, 'F j, Y');
$amount = $row['amount'];
$acres_complete = $row['acres_complete'];
$duration = $row['duration'];
$status = $row['status'];
echo "<tr>";
echo "<td width='16%'><strong>Date</strong></td>";
echo "<td width='16%'>$for_date</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Activity</strong></td>";
echo "<td width='16%'>$activity</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Amount</strong></td>";
echo "<td width='16%'>$amount</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Acres Complete</strong></td>";
echo "<td width='16%'>$acres_complete</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Duration</strong></td>";
echo "<td width='16%'>$duration</td>";
echo "</tr><tr>";
echo "<td width='16%'><strong>Status</strong></td>";
echo "<td width='16%'>$status</td>";
echo "</tr>";
}
Additionally, this is not very good code.