scrupul0us
02-05-2007, 09:05 PM
CSS:
<style media="all" type="text/css">
html, body {
margin: 7 7 0 7; padding:0;
background-color: #EEECE1;
font-family: tahoma, arial, verdana;
text-align: center;
}
input {
font-family: tahoma, arial, verdana;
margin: 0; padding:0;
}
.listinput {
border: 1px solid #8CACBB;
margin: 3px;
text-align: center;
}
.listinputdis {
border: none;
margin: 3px;
text-align: right;
background-color: transparent;
}
table {
border: 1px solid #8CACBB;
background-color: #FCFCFC;
border-bottom: none;
width: 700px;
}
table>thead>tr>td {
background-color: #DEE7EC;
border-bottom: 1px solid #8CACBB;
color: #666666;
font-weight: bold;
}
table>tbody>tr:hover {
background-color: #E5E9EC;
}
table>tbody>tr>td {
border-bottom: 1px solid #8CACBB;
font-size: 14px;
}
#submitDIV {
width:700px;
margin-top: 10px;
text-align: center;
}
#submitDIV>input {
border: 1px solid #8CACBB;
background-color: #DEE7EC;
}
#footer {
text-align: center;
font-size: x-small;
}
</style>
PHP/HTML
<body>
<div align="center">
<?php
// Connecting, selecting database
$dbhost = 'xxx.xxx.xxx.xxx';
$dbuser = 'xxx';
$dbpass = 'xxx';
$dbname = 'xxx';
$dbtabl = 'xxx';
$link = mysql_connect($dbhost, $dbuser, $dbpass)
or die('Could not connect: ' . mysql_error());
mysql_select_db($dbname) or die('Could not select database');
// Performing SQL query
$query = "SELECT * FROM $dbtabl";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
?>
<form name="inventory" action="update.php" method="post" onsubmit="return validate(document.inventory);">
<table width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td align="center" width="50px">ID</td>
<td align="center" width="75px">CODE</td>
<td align="left" width="auto">NAME</td>
<td colspan="2" align="center" width="150px">IN STOCK</td>
<td align="center" width="25"> </td>
<td align="center" width="100px">QTY USED</td>
<td align="center" width="100px">ADD STOCK</td>
</tr>
</thead>
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
?>
<tbody>
<tr>
<td align="center"><?php echo $row['invID']; ?></td>
<td align="center"><?php echo $row['invCODE']; ?></td>
<td align="left"><?php echo $row['invNAME']; ?></td>
<td align="right">
<input class="listinputdis" type="textbox" value="<?php echo $row['invSTOCK']; ?>" size="6" onfocus="this.blur();" />
</td>
<td align="left" width="50px"> <?php echo $row['invUNIT']; ?></td>
<td align="center">
<?php
if ($row['invSTOCK'] == 0) {
echo "<img src=\"images/critical.gif\" />";
}
elseif ($row['invSTOCK'] <= 10) {
echo "<img src=\"images/caution.gif\" />";
} else {
echo "<img src=\"images/ok.gif\" />";
}
?>
</td>
<td align="center">
<input class="listinput" type="textbox" name="R<?php echo $row['invCODE']; ?>" size="6" value="0" />
</td>
<td align="center">
<input class="listinput" type="textbox" name="A<?php echo $row['invCODE']; ?>" size="6" value="0" />
</td>
</tr>
</tbody>
<?php
}
?>
</table>
<div id="submitDIV">
<input type="submit" name="UPDATE" value="UPDATE" style="width:200px;" />
</div>
<div id="footer">
Created By:
</div>
</form>
<?php
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>
</div>
</body>
this is an intranet site so heres images
FIREFOX:
http://codingforums.com/attachment.php?attachmentid=5037&stc=1&d=1170709485
IE:
http://codingforums.com/attachment.php?attachmentid=5038&stc=1&d=1170709493
<style media="all" type="text/css">
html, body {
margin: 7 7 0 7; padding:0;
background-color: #EEECE1;
font-family: tahoma, arial, verdana;
text-align: center;
}
input {
font-family: tahoma, arial, verdana;
margin: 0; padding:0;
}
.listinput {
border: 1px solid #8CACBB;
margin: 3px;
text-align: center;
}
.listinputdis {
border: none;
margin: 3px;
text-align: right;
background-color: transparent;
}
table {
border: 1px solid #8CACBB;
background-color: #FCFCFC;
border-bottom: none;
width: 700px;
}
table>thead>tr>td {
background-color: #DEE7EC;
border-bottom: 1px solid #8CACBB;
color: #666666;
font-weight: bold;
}
table>tbody>tr:hover {
background-color: #E5E9EC;
}
table>tbody>tr>td {
border-bottom: 1px solid #8CACBB;
font-size: 14px;
}
#submitDIV {
width:700px;
margin-top: 10px;
text-align: center;
}
#submitDIV>input {
border: 1px solid #8CACBB;
background-color: #DEE7EC;
}
#footer {
text-align: center;
font-size: x-small;
}
</style>
PHP/HTML
<body>
<div align="center">
<?php
// Connecting, selecting database
$dbhost = 'xxx.xxx.xxx.xxx';
$dbuser = 'xxx';
$dbpass = 'xxx';
$dbname = 'xxx';
$dbtabl = 'xxx';
$link = mysql_connect($dbhost, $dbuser, $dbpass)
or die('Could not connect: ' . mysql_error());
mysql_select_db($dbname) or die('Could not select database');
// Performing SQL query
$query = "SELECT * FROM $dbtabl";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
?>
<form name="inventory" action="update.php" method="post" onsubmit="return validate(document.inventory);">
<table width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td align="center" width="50px">ID</td>
<td align="center" width="75px">CODE</td>
<td align="left" width="auto">NAME</td>
<td colspan="2" align="center" width="150px">IN STOCK</td>
<td align="center" width="25"> </td>
<td align="center" width="100px">QTY USED</td>
<td align="center" width="100px">ADD STOCK</td>
</tr>
</thead>
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
?>
<tbody>
<tr>
<td align="center"><?php echo $row['invID']; ?></td>
<td align="center"><?php echo $row['invCODE']; ?></td>
<td align="left"><?php echo $row['invNAME']; ?></td>
<td align="right">
<input class="listinputdis" type="textbox" value="<?php echo $row['invSTOCK']; ?>" size="6" onfocus="this.blur();" />
</td>
<td align="left" width="50px"> <?php echo $row['invUNIT']; ?></td>
<td align="center">
<?php
if ($row['invSTOCK'] == 0) {
echo "<img src=\"images/critical.gif\" />";
}
elseif ($row['invSTOCK'] <= 10) {
echo "<img src=\"images/caution.gif\" />";
} else {
echo "<img src=\"images/ok.gif\" />";
}
?>
</td>
<td align="center">
<input class="listinput" type="textbox" name="R<?php echo $row['invCODE']; ?>" size="6" value="0" />
</td>
<td align="center">
<input class="listinput" type="textbox" name="A<?php echo $row['invCODE']; ?>" size="6" value="0" />
</td>
</tr>
</tbody>
<?php
}
?>
</table>
<div id="submitDIV">
<input type="submit" name="UPDATE" value="UPDATE" style="width:200px;" />
</div>
<div id="footer">
Created By:
</div>
</form>
<?php
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>
</div>
</body>
this is an intranet site so heres images
FIREFOX:
http://codingforums.com/attachment.php?attachmentid=5037&stc=1&d=1170709485
IE:
http://codingforums.com/attachment.php?attachmentid=5038&stc=1&d=1170709493