Jump to content

[SOLVED] form in table


didgydont

Recommended Posts

hi all for some reason when i add a form to my table it makes the hight about 3 times bigger and uglyer. does anyone know how to make it skinny again ?

 

before

b4.jpg

After

after.jpg

 

  <html>
                 <?php
$con = mysql_connect("localhost","my_user","my pass");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }mysql_select_db("my_db", $con);

echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">
    <tr> 
        <td width=\"40\"><b>Job #</b></td>
        <td><b>Client</b></td>
        <td><b> Item</b></td>
        <td><b> Cost</b></td>
        <td><b> Deposit</b></td>
        <td><b> Owing</b></td>
        <td><b> Ordered</b></td>
        <td><b> Status</b></td>
    </tr>";

$color1 = "#F0F8FF";
$color2 = "#CCFFFF";
$row_count = 0; 

$result = mysql_query("SELECT * FROM jobs
ORDER BY jobnumber");

while($row = mysql_fetch_array($result)) {
    $customer = $row['clientid'];
    $cost = $row['cost'];
    $depos  = $row['deposit'];
    $oweing = ($cost - $depos);
    $result2 = mysql_query("SELECT * FROM clients WHERE Uid='$customer'");
    $row2 = mysql_fetch_array($result2);
    $status = $row['status'];
    $jobno = $row['jobnumber'];
    $custname = $row2['FirstName'] ." ". $row2['LastName'];
    $item = $row['item'];
    $orderd = $row['ordered'];

    $row_color = ($row_count % 2) ? $color1 : $color2;

    echo "<tr>
    <td width=\"40\" bgcolor=\"$row_color\" align=\"center\" nowrap>
    <form action=\"jobsearch.php\" method=\"post\" > <br/>
    <input type=\"hidden\" name=\"jobnumber\" value=\"$jobno\">
    <input type=\"submit\" VALUE=\"$jobno\">
    </form>
    </td>
    <td bgcolor=\"$row_color\">$custname</td>
    <td bgcolor=\"$row_color\">$item</td>
    <td bgcolor=\"$row_color\">\$$cost</td>
    <td bgcolor=\"$row_color\">\$$depos</td>
    <td bgcolor=\"$row_color\">\$$oweing</td>
    <td bgcolor=\"$row_color\">$orderd</td>
    <td bgcolor=\"$row_color\">$status</td>
    </tr>";

    $row_count++; 
} 


echo "</table>";
mysql_close($con);
?>



</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.