Hello all
Hopefully someone can help me with this issue.
I have some information from a database which i show in a table. In this table i have various columns that are filled out with some of the data from the database.
I have a column named status where the information i get from the database can have 4 different values - Not released, Released, Inner layers, Shipped.
What i need is some php code that tells not to show data when the value is Shipped.
Here is some code i use to retrieve the information from the database, if it is any help:
[PHP]if (trim($_SESSION['StatusREL']) == "Y") {
$query = $query . " AND (TrackingStatus = '" . trim($_SESSION['StatusREL']) . "'";
$andused = true;
}
if (trim($_SESSION['StatusSHP']) == "S") {
if (!$andused) {
$query = $query . " AND (TrackingStatus = '" . trim($_SESSION['StatusSHP']) . "'";
$andused = true;
} else {
$query = $query . " OR TrackingStatus = '" . trim($_SESSION['StatusSHP']) . "'";
}
}
if (trim($_SESSION['StatusINV']) == "I") {
if (!$andused) {
$query = $query . " AND (TrackingStatus = '" . trim($_SESSION['StatusINV']) . "'";
$andused = true;
} else {
$query = $query . " OR TrackingStatus = '" . trim($_SESSION['StatusINV']) . "'";
}
}
if (trim($_SESSION['StatusNR']) == "NR") {
if (!$andused) {
$query = $query . " AND (TrackingStatus = ' '" ;
$andused = true;
} else {
$query = $query . " OR TrackingStatus = ' '";
}
}
if (trim($_POST['FromDate']) != "" AND trim($_POST['ToDate']) != "") {
$query = $query . " AND (DockDate >= '" . trim($_POST['FromDate']) . "' AND DockDate <= '" . trim($_POST['ToDate']) . "')";
}
// Now put on the closing paren
if (trim($_SESSION['StatusREL']) == "Y" || trim($_SESSION['StatusNR']) == "NR"
|| trim($_SESSION['StatusSHP']) == "S" || trim($_SESSION['StatusINV']) == "I" ) {
$query = $query . " )";[/PHP]
And
[PHP]<?php
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "") { echo("Not Released"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "Y") { echo("Released"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "S") { echo("Shipped"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "I") { echo("Invoiced"); }
if (trim(ads_result($jtsstatus,"TrackingStatus")) == "L") { echo("Inner Layers"); }
?> [/PHP]