I'm trying to find a way to have the php code display a message if there is no inventory listed in the box, I just want it to say something like "User has no inventory listed"
You can see the actual box http://modern-wireless-inc.wassociation.com titled Inventory Wizard. Its on the right.
I want all the content in the box disappear if there is nothing in the inventory and only display the message. Is it hard to do?
Code: <?PHP if (!$item)
{
?>
<div class="account-left-column"><div><img src="images/account-left-column-back-top.gif" alt="" /></div>
<div class="account-left-column-header">Inventory Wizard Items</div>
<div class="account-left-column-content">
<form action="search.php" method="get" >
<p>Search <?PHP echo $vuser->co_name; ?> Inventory:</p>
<input type="text" name="q" size="30" maxlength="250" accesskey="S" />
<input name="Submit" type="submit" class="button" value="SEARCH" />
<input name="onlyinventory" type="hidden" value="yes" />
<input name="searchuserid" type="hidden" value="<?PHP echo $v_id; ?>" />
</form>
<table width="260" align="left" cellpadding="2" cellspacing="2">
<tr>
<td colspan="6" align="left" valign="top"> <p>Last 10 inventory items added:</p> </td>
</tr>
<tr>
<td colspan="3" align="left" valign="top"> </td>
</tr>
<tr>
<td align="left" valign="top"><strong>Category</strong></td>
<td align="left" valign="top"><strong>Model</strong></td>
<td align="left" valign="top"><strong>Description</strong></td>
</tr>
<?php
}
$inventories = $db->get_results("SELECT id,category,brand,model,description,qty,price,price_negotiable,picture_1,picture_2,inventory_timestamp FROM inventory where user_id in ($allempids) and status = 'active' order by id desc limit 10 ");
if ($inventories)
{
foreach ( $inventories as $invt )
{
$selected_category_phone = "";
$selected_category_accessory = "";
$selected_category_parts = "";
if ($invt->category == "phone"){$selected_category_phone = ' selected="selected" '; }
if ($invt->category == "accessory"){$selected_category_accessory = ' selected="selected" '; }
if ($invt->category == "parts"){$selected_category_parts = ' selected="selected" '; }
if (!$item)
{
$invt->description = substr($invt->description,0,25);
?>
<tr onmouseover="this.bgColor='#f1f0f0'" onmouseout="this.bgColor='#FFFFFF'">
<td align="left" valign="top">
<?PHP echo $invt->category; ?> </td>
<td align="left" valign="top">
<?PHP echo $invt->model; ?></td>
<td align="left" valign="top">
<a href="inventory.php?view_id=<?PHP echo $v_id; ?>&item=<?PHP echo $invt->id; ?>">
<?PHP echo $invt->description; ?>...</a></td>
</tr>
<?php
}
else
{
?>
<?php
}
}
}
?>
</table>
<div class="account-button"><a href="inventory.php?view_id=<?PHP echo $v_id; ?>">See All Inventory</a></div></div>
<!-- end of .account-left-column -->
<div><img src="images/account-left-column-back-bottom.gif" alt=""/></div></div>
Echoing ASCII code
I have a php page that splits a string into chars and then echoes the ASCII code for each char. I'm trying to get it print the original value => ASCII code, splitted by :, like:A => 65:
Get keys and values from an array
Hellow,I have an array $Data with keys and values. With a foreach I can display all the values:foreach($Data as $var){ echo $var;}but I also want to display al the keys... how can i do that?
how to get sn motherboard
Hello.
If statement help please.
Hello on my site I have 2 content boxes. 1 is for the main content (which is the biggest one) and the second one is for a sub navigation (which is a small box). I am trying to write an IF statement so
check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard method used for checking to see if a value exists in a database before inserting a value? I have a form,
Deleting a record php
Attempting to setup delete a record page. The below code I put together doesn't seem to work. | <?$delid=$_GET['delid'];echo $delid;if(isset($_POST['submit'])){$delquery="DELETE FROM table
Pagination won't carry results past page 2.
Hi all,I've worked out my pagination script and its paginating fine until I click next from page 2 at which point it stops displaying results. I know its something really simple, but can't see what
Count number of records in all the tables with a querry URGENT PLEASE...
I downloaded ORACLE 9I DATA DUMP into my comp. There are number of tables. I need to find out the tables with records more than say 100 or so at on go. Can it be possible... If so kindly let me
Local file browser with php
Halo..So this is what i want to create. I have a folder that i share and it has many movies..So i will setup a local web browser and i want to make a .php file that after you login it will saw you the
progress bar...need expert opinion of experienced webmaster
Hey guys, quick question:I want to display a progress bar when I upload files, but I am not sure how to approach it. I have searched for hours and have found various ways of doing it. One was with