Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    2

    Unanswered: help with a argument

    im currently showing a list of stock 4 or 5 fields , the last is a stock indicator which shows either 1 or 0

    my problem is getting the list to show either only items marked 1 or only items marked 0

    its controlled by a list.xml can anyone help me with the syntax

    im hoping to make 2 list.xml files one only showing items marked as 0
    and one showing items marked as 1

    can any of you guys help

    <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&se ction=1&product_id={PRODUCT_ID}&returnurl={CURRENT _PAGE}</location>
    </details>

    </buttons>

    <items>50</items>

    </form>

    thank you guys

    mark

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    Get rid of the miscellaneous code and show the sql code only, then worry about adding your application code later.

    why not merely get all records and order them by the stock indicator column?

  3. #3
    Join Date
    Jul 2010
    Posts
    2
    Thanks for getting back to me do you only need to see the section that controls the list.XML or the table/ field layout

    Sorry I'm very new to this picking it up fast but really new and find myself running before I even start crawling

    What you said about getting them to order by stock sounds the best way yes

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •