Jump to content

xml calling from mysql problem/help


markrday

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.