www.webdeveloper.com
Results 1 to 11 of 11

Thread: Need help in setFilterGrid with total qty at the last row

  1. #1
    Join Date
    Oct 2011
    Posts
    350

    Need help in setFilterGrid with total qty at the last row

    Hi...

    Good day!

    I already had codes on setFilterGrid on my table, now I need to add the total qty at the row which is i don't have any idea if it is possible using javascript and how. I want to happen is every time I filter the item code the Quantity will SUM and display on the last row.

    here is my code:

    Code:
    <?php                                
    include('connection.php');     
    ?>
    <html>
    <title>Raw Materials Inventory</title>
    <head>
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
    
    <style>
    table {
        font: 14px/28px Verdana, Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        }
    
    th {
        padding: 0 0.6em;
        text-align: left;
        }
    
    tr.yellow th {
        border-top: 1px solid #FB7A31;
        border-bottom: 1px solid #FB7A31;
        background: #FFC;
        }
    
    td {
        border-bottom: 1px solid #CCC;
        padding: 0 0.6em;
        }
    
    td+td {
        border-left: 1px solid #CCC;
        text-align: center;
        }
    </style>
    </head>
    <body>
    <form>
    <?php
    $current = "in";
    include("menu.php");
    
    echo "<div style='clear: both;'>&nbsp;</div><div style='clear: both;'>&nbsp;</div>";
    $result = mysql_query("SELECT s.bin_location, s.shelved_qty, s.issued_qty, r.wh_code, m.component, m.mat_code, m.description, m.uom FROM wms_shelving AS s LEFT JOIN wms_receiving AS r ON s.rm_id = r.rm_id LEFT JOIN bom_material AS m ON r.uid_mat = m.uid_mat WHERE s.shelved_qty > s.issued_qty OR ISNULL(s.issued_qty) ORDER BY m.component, m.mat_code");
    
    
    echo "<table id='inventory'>";
    echo "<tr class='yellow'>
    <th>Component</th>
    <th>Item Code</th>
    <th>Description</th>
    <th>WH Location</th>
    <th>UoM</th>
    <th>Quantity</th>
    </tr>";
    while($row = mysql_fetch_array($result))
        {
            $component = $row['component'];
            $itemcode = $row['mat_code'];
            $description = $row['description'];
            $wh_location = $row['bin_location'];
            $uom = $row['uom'];
            $remaining_qty = $row["shelved_qty"] - $row["issued_qty"]; 
    echo "<tr>";
    echo "<td>$component</td>";
    echo "<td>$itemcode</td>";
    echo "<td>$description</td>";
    echo "<td>$wh_location</td>";
    echo "<td>$uom</td>";
    echo "<td>$remaining_qty</td>";
    echo "</tr>" ;
        }
    echo "</table>";
    ?>
    </form>
    <script language="javascript" type="text/javascript">
        var fnsFilters = {
            sort_select: true,
            loader: true,
            col_5: "none",
            col_4: "none",
            col_3: "select",
            col_2: "none",
            col_1: "select",  
            col_0: "select",
            on_change: true,
            display_all_text: "Filter",
            rows_counter: false,
            btn_reset: false,
            alternate_rows: false,
            btn_reset_text: "Display Existing Item Code",
            col_width: ["auto","auto","auto", "auto", "auto", "auto"]
        }
        setFilterGrid("inventory",fnsFilters);
    </script>
    </body>
    
    </html>
    Any help is highly appreciated.

    Thank you so much.

  2. #2
    Join Date
    Dec 2012
    Location
    NSW Australia
    Posts
    73
    I am lost as to what you are actually after.. because you have posted PHP and not the final generated HTML.

    JavaScript works only on the clients machine when the html page finally loads and the user does not see how it is put together... PHP puts all the raw data together into html format as your request code shows.....

    Php will be able to add another row with the quantity included... BUT you already have a remaing_qty row...

    What do you mean by
    ***I want to happen is every time I filter the item code the Quantity will SUM and display on the last row.***

    Maybe you need to explain what your filtering does.. cause I see only a reordering of the columns and not adding/changing any items...

  3. #3
    Join Date
    Oct 2011
    Posts
    350
    I'm sorry, if my question is not cleared.
    I need to filter the item_code then the quantity will be sum.

    Thank you

  4. #4
    Join Date
    Dec 2012
    Location
    NSW Australia
    Posts
    73
    All you have done is repeat your original question...

    look at my last reply for awhile longer and see if you can explain things a bit better..

    a step by step explanation and with the generated html table...

  5. #5
    Join Date
    Oct 2011
    Posts
    350
    this is the htmk code from view source after I filter the Item Code

    Code:
    <html>
    <title>Raw Materials Inventory</title>
    <head>
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
     
    <style> 
    table {
        font: 14px/28px Verdana, Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        }
     
    th {
        padding: 0 0.6em;
        text-align: left;
        }
     
    tr.yellow th {
        border-top: 1px solid #FB7A31;
        border-bottom: 1px solid #FB7A31;
        background: #FFC;
        }
     
    td {
        border-bottom: 1px solid #CCC;
        padding: 0 0.6em;
        }
     
    td+td {
        border-left: 1px solid #CCC;
        text-align: center;
        }
    </style>
    </head>
    <body>
    <form>
    <!--<div id="ddcolortabs">
    <ul>
    <li> <a href="SalesOrder.php" title="Sales Order"><span>Order Management</span></a></li>  
    <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li>
    <li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li>
    <li><a href="fsn.php" title="Finished Stock Note"><span>WMS FG</span></a></li>
    <li id="current"><a href="ReceivingMaterials.php" title="WMS RM"><span>WMS RM</span></a></li> 
    <li><a href="StockRequisition1.php" title="Stock Requisition"><span>Stock Requisition</span></a></li>    
    <li><a href="calendar_days.php" title="Calendar Days"><span>Calendar Days</span></a></li>
    </ul>
    </div>
    -->
    <div id="ddcolortabs1">
    <ul>
    <li><a href="ReceivingMaterials.php" title="Raw Materials"><span>Raw Materials</span></a></li>
    <li><a href="Shelving.php" title="Shelving"><span>Shelving</span></a></li>
    <li><a href="Picking.php" title="Picking"><span>Picking</span></a></li> 
    <li><a href="Issuance.php" title="Issuance"><span>Issuance</span></a></li>
    <li id="current"><a href="wmsinventory.php" title="Inventory"><span>Inventory</span></a></li
    </ul>
    </div><div style='clear: both;'>&nbsp;</div><div style='clear: both;'>&nbsp;</div><table id='inventory'><tr class='yellow'>
    <th>Component</th>
    <th>Item Code</th>
    <th>Description</th>
    <th>WH Location</th>
    <th>UoM</th>
    <th>Quantity</th>
    </tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 1</td><td>kg</td><td>250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>625</td></tr></table></form>
    <script language="javascript" type="text/javascript"> 
        var fnsFilters = {
            sort_select: true,
            loader: true,
            col_5: "none",
            col_4: "none",
            col_3: "select",
            col_2: "none",
            col_1: "select",  
            col_0: "select",
            on_change: true,
            display_all_text: "Filter",
            rows_counter: false,
            btn_reset: false,
            alternate_rows: false,
            btn_reset_text: "Display Existing Item Code",
            col_width: ["auto","auto","auto", "auto", "auto", "auto"]
        }
        setFilterGrid("inventory",fnsFilters);
    </script>
    </body>
     
    </html>
    Thank you so much

  6. #6
    Join Date
    Oct 2011
    Posts
    350
    Hi..

    I found code that has a sum below from this link :
    http://tablefilter.free.fr/ex.php#tbl9

    Sample Table 7:

    Code:
    <script language="javascript" type="text/javascript">
    //<![CDATA[
    var totRowIndex = tf_Tag(tf_Id('table7'),"tr").length;
    	var table7_Props = 	{
    					rows_counter: true,
    					loader: true,
    					loader_text: "Filtering data...",
    					col_operation: { 
    								id: ["table8Tot1","table8Tot2"],
    								col: [2,4],
    								operation: ["sum","sum"],
    								write_method: ["innerHTML","setValue"],
    								exclude_row: [totRowIndex],
    								decimal_precision: [1,0]
    							},
    					rows_always_visible: [totRowIndex]						
    				};
    var tf7 = setFilterGrid( "table7",table7_Props );
    //*** Note ***
    //You can also write operation results in elements outside the table.	
    //]]>
    </script>
    Honestly, I cannot understand the whole code because it has no html code or sample code of table.
    So it's to hard for me to adopt that code in my present code:

    Code:
    <html>
    <title>Raw Materials Inventory</title>
    <head>
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
     
    <style> 
    table {
        font: 14px/28px Verdana, Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        }
     
    th {
        padding: 0 0.6em;
        text-align: left;
        }
     
    tr.yellow th {
        border-top: 1px solid #FB7A31;
        border-bottom: 1px solid #FB7A31;
        background: #FFC;
        }
     
    td {
        border-bottom: 1px solid #CCC;
        padding: 0 0.6em;
        }
     
    td+td {
        border-left: 1px solid #CCC;
        text-align: center;
        }
    </style>
    </head>
    <body>
    <form>
    <!--<div id="ddcolortabs">
    <ul>
    <li> <a href="SalesOrder.php" title="Sales Order"><span>Order Management</span></a></li>  
    <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li>
    <li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li>
    <li><a href="fsn.php" title="Finished Stock Note"><span>WMS FG</span></a></li>
    <li id="current"><a href="ReceivingMaterials.php" title="WMS RM"><span>WMS RM</span></a></li> 
    <li><a href="StockRequisition1.php" title="Stock Requisition"><span>Stock Requisition</span></a></li>    
    <li><a href="calendar_days.php" title="Calendar Days"><span>Calendar Days</span></a></li>
    </ul>
    </div>
    -->
    <div id="ddcolortabs1">
    <ul>
    <li><a href="ReceivingMaterials.php" title="Raw Materials"><span>Raw Materials</span></a></li>
    <li><a href="Shelving.php" title="Shelving"><span>Shelving</span></a></li>
    <li><a href="Picking.php" title="Picking"><span>Picking</span></a></li> 
    <li><a href="Issuance.php" title="Issuance"><span>Issuance</span></a></li>
    <li id="current"><a href="wmsinventory.php" title="Inventory"><span>Inventory</span></a></li
    </ul>
    </div><div style='clear: both;'>&nbsp;</div><div style='clear: both;'>&nbsp;</div><table id='inventory'><tr class='yellow'>
    <th>Component</th>
    <th>Item Code</th>
    <th>Description</th>
    <th>WH Location</th>
    <th>UoM</th>
    <th>Quantity</th>
    </tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>325</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>250</td></tr><tr><td>Ringpull</td><td>PAC-EZO-0050</td><td>Ringpull, SONOCO 300dia; EOE part # 115-0356-56</td><td>WAREHOUSE 2</td><td>pc</td><td>151800</td></tr><tr><td>Sticker</td><td>PAC-STK-0080A</td><td>Blank Label Sticker, 3"X4",sheet form (additional carton label for SHIREBROOK order)</td><td>WAREHOUSE 3</td><td>pc</td><td>464</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 1</td><td>pc</td><td>94500</td></tr></table><table id=''></form>
    <script language="javascript" type="text/javascript"> 
        var fnsFilters = {
            sort_select: true,
            loader: true,
            col_5: "none",
            col_4: "none",
            col_3: "select",
            col_2: "none",
            col_1: "select",  
            col_0: "select",
            on_change: true,                
            display_all_text: "Filter",
            rows_counter: false,
            btn_reset: false,
            alternate_rows: false,
            btn_reset_text: "Display Existing Item Code",
            col_width: ["auto","auto","auto", "auto", "auto", "auto"]
        }
        setFilterGrid("inventory",fnsFilters);
    </script>
    </body>
     
    </html>
    I hope somebody can help me. To merge the two javascript. So that after I filter the Item Code below the Quantiy will display the SUM.

    Thank you so much

  7. #7
    Join Date
    Dec 2012
    Location
    NSW Australia
    Posts
    73
    I have done some homework that you should have done..

    Finally found the JavaScript module you are using.

    ARE you using the late-test version? VERY IMPORTANT.....the latest version with ALL the extra modules...
    if so then you can do what you are wanting to do.



    NOW TO DO WHAT YOU WANT...

    you need to setup/include an extra row on you table... LIKE THIS

    HTML Code:
    <tr>
            <td>Total:</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td id="totalHERE"></td>
    </tr>

    then you need to replace you JS properties with this one...ONLY THIS ONE


    Code:
    var totalRowDex = tf_Tag(tf_Id('inventory'), "tr").length;
    var inventProp = {
    	rows_counter: true,
    	loader: true,
    	loader_text: "FilterING DaTa....",
    	col_operation: {
    	    id: ["totalHERE"],
    		col: [5],
    		operation: ["sum"],
    		write_method: ["innerHTML"],
    		exclude_row: [totalRowDex],
    		decimal_precision: [1]
    
    	},
    	rows_always_visible: [totalRowDex]
    };
    setFilterGrid("inventory", inventProp);

    DO NOT USE THIS ONE below till you test the one above

    Code:
    var fnsFilters = {
        sort_select: true,
        loader: true,
        col_5: "none",
        col_4: "none",
        col_3: "select",
        col_2: "none",
        col_1: "select",
        col_0: "select",
        on_change: true,
        display_all_text: "Filter",
        rows_counter: false,
        btn_reset: false,
        alternate_rows: false,
        btn_reset_text: "Display Existing Item Code",
        col_width: ["auto", "auto", "auto", "auto", "auto", "auto"]
    };
    setFilterGrid("inventory", fnsFilters);
    it is IMPORTANT that you
    1: use the latest version (2.5).
    2: test with my bit of JS object properties.
    3: you research this a little yourself.

    GOOD Luck

  8. #8
    Join Date
    Oct 2011
    Posts
    350
    Hi,

    What do you mean latest version?Is it the tablefilter.js?

    I test your code:

    Code:
    <html>
    <title>Raw Materials Inventory</title>
    <head>
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
     
    <style> 
    table {
        font: 14px/28px Verdana, Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        }
     
    th {
        padding: 0 0.6em;
        text-align: left;
        }
     
    tr.yellow th {
        border-top: 1px solid #FB7A31;
        border-bottom: 1px solid #FB7A31;
        background: #FFC;
        }
     
    td {
        border-bottom: 1px solid #CCC;
        padding: 0 0.6em;
        }
     
    td+td {
        border-left: 1px solid #CCC;
        text-align: center;
        }
    </style>
    </head>
    <body>
    <form>
    <!--<div id="ddcolortabs">
    <ul>
    <li> <a href="SalesOrder.php" title="Sales Order"><span>Order Management</span></a></li>  
    <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li>
    <li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li>
    <li><a href="fsn.php" title="Finished Stock Note"><span>WMS FG</span></a></li>
    <li id="current"><a href="ReceivingMaterials.php" title="WMS RM"><span>WMS RM</span></a></li> 
    <li><a href="StockRequisition1.php" title="Stock Requisition"><span>Stock Requisition</span></a></li>    
    <li><a href="calendar_days.php" title="Calendar Days"><span>Calendar Days</span></a></li>
    </ul>
    </div>
    -->
    <div id="ddcolortabs1">
    <ul>
    <li><a href="ReceivingMaterials.php" title="Raw Materials"><span>Raw Materials</span></a></li>
    <li><a href="Shelving.php" title="Shelving"><span>Shelving</span></a></li>
    <li><a href="Picking.php" title="Picking"><span>Picking</span></a></li> 
    <li><a href="Issuance.php" title="Issuance"><span>Issuance</span></a></li>
    <li id="current"><a href="wmsinventory.php" title="Inventory"><span>Inventory</span></a></li
    </ul>
    </div><div style='clear: both;'>&nbsp;</div><div style='clear: both;'>&nbsp;</div><table id='inventory'><tr class='yellow'>
    <th>Component</th>
    <th>Item Code</th>
    <th>Description</th>
    <th>WH Location</th>
    <th>UoM</th>
    <th>Quantity</th>
    </tr><tr><td></td><td></td><td></td><td>WAREHOUSE 1</td><td></td><td>225</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0001</td><td>Aktiplast T, 20kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>400</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0008</td><td>Aqualine DC 321</td><td>WAREHOUSE 1</td><td>kg</td><td>225</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 1</td><td>kg</td><td>150</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 2</td><td>kg</td><td>250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0041</td><td>CBS (Delac-S)</td><td>WAREHOUSE 3 </td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0060</td><td>DPG 96%, 20 kgs./bag</td><td>WAREHOUSE 2</td><td>kg</td><td>440</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 1</td><td>kg</td><td>1250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 2</td><td>kg</td><td>75</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 1</td><td>kg</td><td>350</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>5000</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>150</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 2</td><td>kg</td><td>1000</td></tr><tr><td>Packaging</td><td>PAC-BAG-0090</td><td>3B Polybag</td><td>WAREHOUSE 1</td><td>pc</td><td>500</td></tr><tr><td>Packaging</td><td>PAC-BAG-0090</td><td>3B Polybag</td><td>WAREHOUSE 2</td><td>pc</td><td>500</td></tr><tr><td>Rubber</td><td>MAT-RUB-0010</td><td>Masterbatch Black GPF, 30</td><td>WAREHOUSE 3</td><td>kg</td><td>500</td></tr><tr><td>Rubber</td><td>MAT-RUB-0010</td><td>Masterbatch Black GPF, 30</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0903</td><td>Dlp Club AC 3B (no RG logo - revised); EAN; 5013317120892</td><td>WAREHOUSE 3</td><td>pc</td><td>230</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0903</td><td>Dlp Club AC 3B (no RG logo - revised); EAN; 5013317120892</td><td>WAREHOUSE 03</td><td>pc</td><td>600</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0991</td><td>Dlp Champ AS 3B(w/o RG logo) barcode: 045566907394</td><td>WAREHOUSE 1</td><td>pc</td><td>200</td></tr><tr><td>Sticker - Tripack</td><td>PAC-STK-0581</td><td>Squash 3B PET label; PRO</td><td>WAREHOUSE 1 </td><td>pc</td><td>100</td></tr><tr><td>Sticker - Tripack</td><td>PAC-STK-0581</td><td>Squash 3B PET label; PRO</td><td>WAREHOUSE 2</td><td>pc</td><td>50</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 1</td><td>pc</td><td>10000</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 3</td><td>pc</td><td>20000</td></tr>
        <tr>
            <td>Total:</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td id='totalHERE'></td>
    </tr> </table><table id=''></form>
    <script language="javascript" type="text/javascript"> 
           var totalRowDex = tf_Tag(tf_Id('inventory'), "tr").length;
    var inventProp = {
        rows_counter: true,
        loader: true,
        loader_text: "FilterING DaTa....",
        col_operation: {
            id: ["totalHERE"],
            col: [5],
            operation: ["sum"],
            write_method: ["innerHTML"],
            exclude_row: [totalRowDex],
            decimal_precision: [1]
     
        },
        rows_always_visible: [totalRowDex]
    };
    setFilterGrid("inventory", inventProp);
    </script>
    </body>
     
    </html>
    and I got an error: object expected.

    Thank you so much.

  9. #9
    Join Date
    Oct 2011
    Posts
    350
    Hi.

    I already download the latest version and I also call the .js
    like:
    Code:
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <link rel="stylesheet" type="text/css" href="filtergrid.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
    <script language="javascript" type="text/javascript" src="tablefilter_all.js"></script>
    <script language="javascript" type="text/javascript" src="tablefilter_all_min.js"></script>
    <script language="javascript" type="text/javascript" src="tablefilter_min.js"></script>
    so now here is my code:

    Code:
    <html>
    <title>Raw Materials Inventory</title>
    <head>
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <link rel="stylesheet" type="text/css" href="filtergrid.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
    <script language="javascript" type="text/javascript" src="tablefilter_all.js"></script>
    <script language="javascript" type="text/javascript" src="tablefilter_all_min.js"></script>
    <script language="javascript" type="text/javascript" src="tablefilter_min.js"></script>      
     
    <style> 
    table {
        font: 14px/28px Verdana, Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        }
     
    th {
        padding: 0 0.6em;
        text-align: left;
        }
     
    tr.yellow th {
        border-top: 1px solid #FB7A31;
        border-bottom: 1px solid #FB7A31;
        background: #FFC;
        }
     
    td {
        border-bottom: 1px solid #CCC;
        padding: 0 0.6em;
        }
     
    td+td {
        border-left: 1px solid #CCC;
        text-align: center;
        }
    </style>
    </head>
    <body>
    <form>
    <!--<div id="ddcolortabs">
    <ul>
    <li> <a href="SalesOrder.php" title="Sales Order"><span>Order Management</span></a></li>  
    <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li>
    <li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li>
    <li><a href="fsn.php" title="Finished Stock Note"><span>WMS FG</span></a></li>
    <li id="current"><a href="ReceivingMaterials.php" title="WMS RM"><span>WMS RM</span></a></li> 
    <li><a href="StockRequisition1.php" title="Stock Requisition"><span>Stock Requisition</span></a></li>    
    <li><a href="calendar_days.php" title="Calendar Days"><span>Calendar Days</span></a></li>
    </ul>
    </div>
    -->
    <div id="ddcolortabs1">
    <ul>
    <li><a href="ReceivingMaterials.php" title="Raw Materials"><span>Raw Materials</span></a></li>
    <li><a href="Shelving.php" title="Shelving"><span>Shelving</span></a></li>
    <li><a href="Picking.php" title="Picking"><span>Picking</span></a></li> 
    <li><a href="Issuance.php" title="Issuance"><span>Issuance</span></a></li>
    <li id="current"><a href="wmsinventory.php" title="Inventory"><span>Inventory</span></a></li
    </ul>
    </div><div style='clear: both;'>&nbsp;</div><div style='clear: both;'>&nbsp;</div><table id='inventory'><tr class='yellow'>
    <th>Component</th>
    <th>Item Code</th>
    <th>Description</th>
    <th>WH Location</th>
    <th>UoM</th>
    <th>Quantity</th>
    </tr><tr><td></td><td></td><td></td><td>WAREHOUSE 1</td><td></td><td>225</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0001</td><td>Aktiplast T, 20kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>400</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0008</td><td>Aqualine DC 321</td><td>WAREHOUSE 1</td><td>kg</td><td>225</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 1</td><td>kg</td><td>150</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 2</td><td>kg</td><td>250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0041</td><td>CBS (Delac-S)</td><td>WAREHOUSE 3 </td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0060</td><td>DPG 96%, 20 kgs./bag</td><td>WAREHOUSE 2</td><td>kg</td><td>440</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 1</td><td>kg</td><td>1250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 2</td><td>kg</td><td>75</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 1</td><td>kg</td><td>350</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>5000</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>150</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 2</td><td>kg</td><td>1000</td></tr><tr><td>Packaging</td><td>PAC-BAG-0090</td><td>3B Polybag</td><td>WAREHOUSE 1</td><td>pc</td><td>500</td></tr><tr><td>Packaging</td><td>PAC-BAG-0090</td><td>3B Polybag</td><td>WAREHOUSE 2</td><td>pc</td><td>500</td></tr><tr><td>Rubber</td><td>MAT-RUB-0010</td><td>Masterbatch Black GPF, 30</td><td>WAREHOUSE 3</td><td>kg</td><td>500</td></tr><tr><td>Rubber</td><td>MAT-RUB-0010</td><td>Masterbatch Black GPF, 30</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0903</td><td>Dlp Club AC 3B (no RG logo - revised); EAN; 5013317120892</td><td>WAREHOUSE 3</td><td>pc</td><td>230</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0903</td><td>Dlp Club AC 3B (no RG logo - revised); EAN; 5013317120892</td><td>WAREHOUSE 03</td><td>pc</td><td>600</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0991</td><td>Dlp Champ AS 3B(w/o RG logo) barcode: 045566907394</td><td>WAREHOUSE 1</td><td>pc</td><td>200</td></tr><tr><td>Sticker - Tripack</td><td>PAC-STK-0581</td><td>Squash 3B PET label; PRO</td><td>WAREHOUSE 1 </td><td>pc</td><td>100</td></tr><tr><td>Sticker - Tripack</td><td>PAC-STK-0581</td><td>Squash 3B PET label; PRO</td><td>WAREHOUSE 2</td><td>pc</td><td>50</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 1</td><td>pc</td><td>10000</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 3</td><td>pc</td><td>20000</td></tr>
        <tr>
            <td>Total:</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td id='totalHERE'></td>
    </tr> </table><table id=''></form>
    <script language="javascript" type="text/javascript"> 
           var totalRowDex = tf_Tag(tf_Id('inventory'), "tr").length;
    var inventProp = {
        rows_counter: true,
        loader: true,
        loader_text: "FilterING DaTa....",
        col_operation: {
            id: ["totalHERE"],
            col: [5],
            operation: ["sum"],
            write_method: ["innerHTML"],
            exclude_row: [totalRowDex],
            decimal_precision: [1]
     
        },
        rows_always_visible: [totalRowDex]
    };
    setFilterGrid("inventory", inventProp);
    </script>
    </body>
     
    </html>
    but still it did not work.

    I got an error:
    Object doesn't support this property or method
    tablefiter_min.js line 91 char 16

    Thank you

  10. #10
    Join Date
    Oct 2011
    Posts
    350
    Hi..

    It's works now.

    By this code:

    Code:
    <html>
    <title>Raw Materials Inventory</title>
    <head>
    <link rel="stylesheet" type="text/css" href="css/kanban.css" />
    <link rel="stylesheet" type="text/css" href="filtergrid.css" />
    <script language="javascript" type="text/javascript" src="tablefilter.js"></script>  
    <script language="javascript" type="text/javascript" src="tablefilter_all.js"></script>
    <script language="javascript" type="text/javascript" src="tablefilter_all_min.js"></script>
    <!--<script language="javascript" type="text/javascript" src="tablefilter_min.js"></script>  -->    
     
    <style> 
    table {
        font: 14px/28px Verdana, Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        }
     
    th {
        padding: 0 0.6em;
        text-align: left;
        }
     
    tr.yellow th {
        border-top: 1px solid #FB7A31;
        border-bottom: 1px solid #FB7A31;
        background: #FFC;
        }
     
    td {
        border-bottom: 1px solid #CCC;
        padding: 0 0.6em;
        }
     
    td+td {
        border-left: 1px solid #CCC;
        text-align: center;
        }
    </style>
    </head>
    <body>
    <form>
    <!--<div id="ddcolortabs">
    <ul>
    <li> <a href="SalesOrder.php" title="Sales Order"><span>Order Management</span></a></li>  
    <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li>
    <li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li>
    <li><a href="fsn.php" title="Finished Stock Note"><span>WMS FG</span></a></li>
    <li id="current"><a href="ReceivingMaterials.php" title="WMS RM"><span>WMS RM</span></a></li> 
    <li><a href="StockRequisition1.php" title="Stock Requisition"><span>Stock Requisition</span></a></li>    
    <li><a href="calendar_days.php" title="Calendar Days"><span>Calendar Days</span></a></li>
    </ul>
    </div>
    -->
    <div id="ddcolortabs1">
    <ul>
    <li><a href="ReceivingMaterials.php" title="Raw Materials"><span>Raw Materials</span></a></li>
    <li><a href="Shelving.php" title="Shelving"><span>Shelving</span></a></li>
    <li><a href="Picking.php" title="Picking"><span>Picking</span></a></li> 
    <li><a href="Issuance.php" title="Issuance"><span>Issuance</span></a></li>
    <li id="current"><a href="wmsinventory.php" title="Inventory"><span>Inventory</span></a></li
    </ul>
    </div><div style='clear: both;'>&nbsp;</div><div style='clear: both;'>&nbsp;</div><table id='inventory'><tr class='yellow'>
    <th>Component</th>
    <th>Item Code</th>
    <th>Description</th>
    <th>WH Location</th>
    <th>UoM</th>
    <th>Quantity</th>
    </tr><tr><td></td><td></td><td></td><td>WAREHOUSE 1</td><td></td><td>225</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0001</td><td>Aktiplast T, 20kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>400</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0008</td><td>Aqualine DC 321</td><td>WAREHOUSE 1</td><td>kg</td><td>225</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 1</td><td>kg</td><td>150</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 2</td><td>kg</td><td>250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0041</td><td>CBS (Delac-S)</td><td>WAREHOUSE 3 </td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0060</td><td>DPG 96%, 20 kgs./bag</td><td>WAREHOUSE 2</td><td>kg</td><td>440</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 1</td><td>kg</td><td>1250</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 2</td><td>kg</td><td>75</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 1</td><td>kg</td><td>350</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>5000</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 1</td><td>kg</td><td>150</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0240</td><td>Suprex Clay 25kg/bag</td><td>WAREHOUSE 2</td><td>kg</td><td>1000</td></tr><tr><td>Packaging</td><td>PAC-BAG-0090</td><td>3B Polybag</td><td>WAREHOUSE 1</td><td>pc</td><td>500</td></tr><tr><td>Packaging</td><td>PAC-BAG-0090</td><td>3B Polybag</td><td>WAREHOUSE 2</td><td>pc</td><td>500</td></tr><tr><td>Rubber</td><td>MAT-RUB-0010</td><td>Masterbatch Black GPF, 30</td><td>WAREHOUSE 3</td><td>kg</td><td>500</td></tr><tr><td>Rubber</td><td>MAT-RUB-0010</td><td>Masterbatch Black GPF, 30</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0903</td><td>Dlp Club AC 3B (no RG logo - revised); EAN; 5013317120892</td><td>WAREHOUSE 3</td><td>pc</td><td>230</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0903</td><td>Dlp Club AC 3B (no RG logo - revised); EAN; 5013317120892</td><td>WAREHOUSE 03</td><td>pc</td><td>600</td></tr><tr><td>Sleeve</td><td>PAC-SLV-0991</td><td>Dlp Champ AS 3B(w/o RG logo) barcode: 045566907394</td><td>WAREHOUSE 1</td><td>pc</td><td>200</td></tr><tr><td>Sticker - Tripack</td><td>PAC-STK-0581</td><td>Squash 3B PET label; PRO</td><td>WAREHOUSE 1 </td><td>pc</td><td>100</td></tr><tr><td>Sticker - Tripack</td><td>PAC-STK-0581</td><td>Squash 3B PET label; PRO</td><td>WAREHOUSE 2</td><td>pc</td><td>50</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 1</td><td>pc</td><td>10000</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 3</td><td>pc</td><td>20000</td></tr>
        <tr>
            <td>Total:</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td id='totalHERE'></td>
    </tr> </table><table id=''></form>
    <script language="javascript" type="text/javascript"> 
           var totalRowDex = tf_Tag(tf_Id('inventory'), "tr").length;
    var inventProp = {
        rows_counter: true,
        loader: true,
        loader_text: "FilterING DaTa....",
        col_operation: {
            id: ["totalHERE"],
            col: [5],
            operation: ["sum"],
            write_method: ["innerHTML"],
            exclude_row: [totalRowDex],
            decimal_precision: [1]
     
        },
        rows_always_visible: [totalRowDex]
    };
    setFilterGrid("inventory", inventProp);
    </script>
    </body>
     
    </html>
    My question is.how can i make the textbox become select option? and how can I remove the ? at the top right side?

    Thank you so much

  11. #11
    Join Date
    Oct 2011
    Posts
    350
    Hi,

    I have this code for setFilterGrid and it works fine:

    Code:
    <form name="material_form" action="<?php echo $PHP_SELF; ?>" method="post" autocomplete="off">
    <div id="WH_list">
    <table id="mat_list">
    <thead>
    <tr>
    <th>DATE ENTRY</th>
    <th>PO NUMBER</th>
    <th>KIND</th>
    <th>ITEM CODE</th>
    <th>DESCRIPTION</th>
    <th>UoM</th>
    <th>SUPPLIER</th>
    <th>QTY</th>
    <th>WH #</th>
    <th>ROW #</th>
    <th>RACK #</th>
    <th>LEVEL</th>
    <th>RECEIVED BY</th>
    </tr>
    </thead>
    
    <?php
    $sql = "SELECT m.date_entry, m.po_number, m.kind, r.item_code, r.sup_code, u.uom, s.supplier_name, ";
    $sql .= "m.qty, w.whse, w.row, w.rack, w.level, o.employee ";
    $sql .= "FROM material_data_in AS m LEFT JOIN raw_material AS r ON (m.mat_id = r.item_code) ";
    $sql .= "LEFT JOIN uom_list AS u ON (u.uom_id = m.uom_id) ";
    $sql .= "LEFT JOIN supplier AS s ON (s.supplier_id = m.supplier_id) ";
    $sql .= "LEFT JOIN warehouse AS w ON (w.id = warehouse_id) ";
    $sql .= "LEFT JOIN rm_receiver AS o ON (o.emp_id = m.received_by)";
    $res = mysql_query($sql);
    
    while($row_mat_list = mysql_fetch_assoc($res)){
    $date_entry           = $row_mat_list['date_entry'];
    $po_number            = $row_mat_list['po_number'];
    //$unique_id            = $row_mat_list['unique_id'];
    $kind                 = $row_mat_list['kind'];
    $item_code            = $row_mat_list['item_code'];
    $description          = $row_mat_list['sup_code'];   
    $uom                  = $row_mat_list['uom'];
    $supplier             = $row_mat_list['supplier_name'];
    $qty                  = $row_mat_list['qty'];
    $qty                  = number_format($qty, 2);
    $whse                 = $row_mat_list['whse'];
    $row                  = $row_mat_list['row'];
    $rack                 = $row_mat_list['rack'];
    $level                = $row_mat_list['level'];
    $received_by          = utf8_encode($row_mat_list['employee']);
    
    echo "<tr>";
    echo "<td>$date_entry</td>";
    echo "<td>$po_number</td>";
    echo "<td>$kind</td>";
    echo "<td>$item_code</td>";
    echo "<td>$description</td>";
    echo "<td>$uom</td>";
    echo "<td>$supplier</td>";
    echo "<td>$qty</td>";
    echo "<td>$whse</td>";
    echo "<td>$row</td>";
    echo "<td>$rack</td>";
    echo "<td>$level</td>";
    echo "<td>$received_by</td>";
    echo "</tr>";
    }         
    
    echo "<tr>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td id='totalHERE' style='color:red;border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "<td style='border:none;'></td>";
    echo "</tr>";
    ?>
    </table>
    <table id=''>
    </form>
    <script language="javascript" type="text/javascript">
    var totalRowDex = tf_Tag(tf_Id('mat_list'), "tr").length;
    var inventProp = {
        rows_counter: true,
        loader: true,
        loader_text: "FilterING DaTa....",
        col_operation: {
            id: ["totalHERE"],
            col: [7],
            operation: ["sum"],
            write_method: ["innerHTML"],
            exclude_row: [totalRowDex],
            decimal_precision: [2]
    
        },
        rows_always_visible: [totalRowDex]
    };
    setFilterGrid("mat_list", inventProp);
    </script>
    </form>
    now my problem is, how can I make the total qty has a comma every 3 digits. Because the Total = 80000000.00 how can I make it 80,000,000.00

    I hope somebody can help me.

    Thank you so much.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles