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>
Print 'a' to 'z' via for loop
A very simple problem..How Can I print a to z NOT a to y ?It is a part of a code where | $alpha= 'a';for($alpha='a';$alpha!='z';$alpha++){echo $alpha.' ';} Output: a b c d e f g h i j k l m n o p q
line breaks in between fetched file names
Hi,I have this code:Code: <?php if($dir = opendir('files')){ while (($file = readdir($dir) )!== false){ if ($file !='.' && $file !='..'){ echo
foreach and array need help combining
Hi guys.Here's the codeCode: array( 'tag' => 'code', 'type' => 'unparsed_content', 'content' => '<div
switch not getting value
what am i doing wrong?i want to populate the country list according to the categoryi want to switch in case CategoryID=1 and CatID2=2 in the country_list tablethen call on "alpha" to
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I have a method, that is supposed to open a file and write to the file, but I am having issues. Each
firefox wouldnt stream mp3 files completely from my php page
hi everyone,I have a php file trying to read and stream mp3 files. It works fine in IE but my problem is Firefox streams only 3 seconds of them.$direction =
Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want to go to when logged in.
Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.when I go to this sort of url I get what I want.http://www.example.com/test.php?id=1234567890I want the url to be
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords aligned by our active directory to the same as those used to access the Network. My query is that we
Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the data into database.Why can this happen? how to prevent this?