Jump to content

Recommended Posts

i wonder would any of you guys know how to make a if argument work , the database has be used for stock and some stock is marked with (1) for in stock and others marked as (0) for out of stock or sold id like to add a button on the left that would only show records with the stock field (1) or stock field (0) so its easier to work out at a glance whats sold and whats not ,,i know how to edit the xml and mysql but the syntax of the if argument to show or not show only records with either (1) or (0) in is not my level of knowledge

 

i currently got this and it shows these fields in the list view

below is the code from the xml that controls the fields viewed on screen

 

<form>

 

<title>Products List</title>

<border>true</border>

<width>800</width>

 

<fields>

<_count header="No" suffix="." width="25" align="center" />

<product_vendor type="relation" align="center" header="Location">

<relation table="vendors" id="vendor_id" text="vendor_name" />

</product_vendor>

<product_name align="center" header="item Name" />

<product_number align="center" header="Serial Number" />

<product_acrylic align="center" header="Colour" />

<product_cab align="center" header="Cab Colour" />

<product_count align="center" type="sql" header="Stock Level">

 

 

<sql>

<vars>

<table import="$this->tables[transactions]" type="eval" />

<product import="product_id" type="field" />

 

</vars>

 

<query>SELECT sum(trans_inventory) FROM {TABLE} WHERE trans_product='{PRODUCT}'</query>

<field>sum(trans_inventory)</field>

</sql>

 

</product_count>

 

</fields>

 

<header>

<titles>true</titles>

 

<buttons>

</buttons>

</header>

 

<buttons>

 

<details onclick="" button="details" >

<location>index.php?sub=products&action=details&section=1&product_id={PRODUCT_ID}&returnurl={CURRENT_PAGE}</location>

</details>

 

</buttons>

 

<items>50</items>

 

</form>

 

i need an argument in the bold area to limit display to either 0 or 1 stock

 

hope some one can help

 

have i explained myself correctly

 

mark

Link to comment
https://forums.phpfreaks.com/topic/207998-xml-calling-from-mysql-problemhelp/
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.