Changeset 693 for trunk/phpbms/modules/bms/products_saleshistory.php
- Timestamp:
- 12/31/09 13:36:45 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/bms/products_saleshistory.php
r606 r693 40 40 include("include/fields.php"); 41 41 42 if(!hasRights("role:259ead9f-100b-55b5-508a-27e33a6216bf")) goURL(APP_PATH."noaccess.php"); 43 44 if(!isset($_POST["fromdate"])) $_POST["fromdate"]=dateToString(strtotime("-1 year")); 45 if(!isset($_POST["todate"])) $_POST["todate"]=dateToString(mktime()); 46 if(!isset($_POST["status"])) $_POST["status"]="Orders/Invoices"; 47 if(!isset($_POST["command"])) $_POST["command"]="show"; 48 if(!isset($_POST["date_order"])) $_POST["date_order"]="DESC"; 42 if(!hasRights("role:259ead9f-100b-55b5-508a-27e33a6216bf")) 43 goURL(APP_PATH."noaccess.php"); 44 45 if(!isset($_POST["fromdate"])) 46 $_POST["fromdate"] = dateToString(strtotime("-1 year")); 47 48 if(!isset($_POST["todate"])) 49 $_POST["todate"] = dateToString(mktime()); 50 51 if(!isset($_POST["status"])) 52 $_POST["status"] = "Orders and Invoices"; 53 54 if(!isset($_POST["command"])) 55 $_POST["command"] = "show"; 56 57 if(!isset($_POST["date_order"])) 58 $_POST["date_order"] = "DESC"; 49 59 50 60 if($_POST["command"]=="print") { 51 $_SESSION["printing"]["whereclause"]="WHERE products.id=".$_GET["id"]; 52 $_SESSION["printing"]["dataprint"]="Single Record"; 53 $fromProduct=true; 54 require("report/products_saleshistory.php"); 61 62 $_SESSION["printing"]["whereclause"]="products.id=".$_GET["id"]; 63 $_SESSION["printing"]["dataprint"]="Single Record"; 64 65 goURL("report/products_saleshistory.php?rid=".urlencode("rpt:a278af28-9c34-da2e-d81b-4caa36dfa29f")."&tid=".urlencode("tbld:7a9e87ed-d165-c4a4-d9b9-0a4adc3c5a34")."&status=".urlencode($_POST["status"])."&fromdate=".urlencode($_POST["fromdate"])."&todate=".urlencode($_POST["todate"])); 66 55 67 } else { 56 $thestatus="(invoices.type =\""; 57 switch($_POST["status"]){ 58 case "Orders/Invoices": 59 $thestatus.="Order\" or invoices.type=\"Invoice\")"; 60 $searchdate="orderdate"; 61 break; 68 69 $thestatus="(invoices.type =\""; 70 switch($_POST["status"]){ 71 72 case "Orders and Invoices": 73 $thestatus.="Order\" or invoices.type=\"Invoice\")"; 74 $searchdate="orderdate"; 75 break; 76 62 77 case "Invoices": 63 $thestatus.="Invoice\")"; 64 $searchdate="invoicedate"; 65 break; 78 $thestatus.="Invoice\")"; 79 $searchdate="invoicedate"; 80 break; 81 66 82 case "Orders": 67 $thestatus.="Order\")"; 68 $searchdate="orderdate"; 69 break; 70 } 83 $thestatus.="Order\")"; 84 $searchdate="orderdate"; 85 break; 86 87 }//endswitch 71 88 $dateOrder = ($_POST['date_order'] == 'DESC') ? 'ASC' : 'DESC'; 72 89 … … 132 149 <label for="status">type</label><br /> 133 150 <select name="status" id="status"> 134 <option value="Orders /Invoices" <?php if($_POST["status"]=="Orders/Invoices") echo "selected=\"selected\""?>>Orders/Invoices</option>151 <option value="Orders and Invoices" <?php if($_POST["status"]=="Orders and Invoices") echo "selected=\"selected\""?>>Orders and Invoices</option> 135 152 <option value="Invoices" <?php if($_POST["status"]=="Invoices") echo "selected=\"selected\""?>>Invoices</option> 136 153 <option value="Orders" <?php if($_POST["status"]=="Orders") echo "selected=\"selected\""?>>Orders</option> … … 143 160 144 161 <p id="printP"><br /><input id="print" name="command" type="submit" value="print" class="Buttons" /></p> 145 <p id="changeTimelineP"><br /><input name="command" type="submit" value=" change timeframe/view" class="smallButtons" /></p>162 <p id="changeTimelineP"><br /><input name="command" type="submit" value="update" class="smallButtons" /></p> 146 163 <input name="date_order" id="date_order" type="hidden" value="<?php echo $_POST["date_order"]; ?>" /> 147 164 </div>