|
PhP runner doesn't have fully customizable pulldowns. to do so you need to add a snippet from the editor then goto the event , so if you put it in a list page goto list events for that table.
*PLEASE NOTE**
This is for build 5.2 and earlier,
using the latest build the value [a] from my understanding has changed also buttons work on java preloads now, so its all changed. I have not upgraded to the new version because the very fundimentals of how the backend works has changed, leaving customization I have done (tons of it) absolete. You could however use the following and whatever the new value of [a] is, just change to that value. From there you can add the following for a pulldown, Please note you will have to modify for your needs. I added //notations for your understanding. /////////////////BUTTON////////////
//building your $str value
$str = "";
//This is your pulldown build, here we name the pulldown values that are static, show all is part of the built in showall statement of php runner.
$str.= "<select onchange=\"window.location.href=this.options[this.selectedIndex].value;\"><option value=\"\">Categories</option>";
//for whatever page you are doing this pulldown in, use that page url below inplace of what I have, this is for the showall statement option.
$str.="<option value='order_sales_item_list_list.php?a=showall'>Show all</option>";
//going global to call a value from a table
global $conn;
//for me, the items_cat_menu is a table I made in mysql that refers to values that = names, for instances itemcatid=1,itemcatname=concessions,itemcatnum=1,itemcatsub=1... i use these variables to refer to other tables and on and on it goes.
$strSQL = "select * from items_cat_menu";
$rs = db_query($strSQL,$conn);
// the while statement here is key, to build a pulldown tree you need to read all related data
while ($data = db_fetch_array($rs))
//because of the while statement, the $data["ItemCatID"]and $data["ItemCatName"] as you can see below. will repeat in my table, my itemcatid is a number value and the name is for naming. Now you can do the same by adding all the values for your first ,middle, last then making it one main value if you like, that really is up to you, allot of ways you can make that.
$str.="<option value=\"order_sales_item_list_list.php?ctlSearchFor=&srchOptShowStatus=1&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&type1=&value11=".$data["ItemCatID"]."&field1=ItemCatID&option1=Equals¬1=\">
".$data["ItemCatName"]."</option>";
$str.="</select>";
echo $str;
Because builds have change drastically sense 5.2, in my 5.2 current project (5.2 build 5482 to be percise) I also use the following to nulify issues of searches over-riding my pulldowns or custom searches... IE... /////////////////list page: before process////////////
if (@$_REQUEST["a"] && @$_REQUEST["a"]!="delete" && @$_REQUEST["a"]!="search" && @$_REQUEST["a"]!="advsearch" && @$_REQUEST["a"]!="showall")
{
$arr = explode(",",$_REQUEST["a"]);
if (count($arr)>1)
{
}
Finally if I make custom buttons to do other things such as a customized cancel button (why? Because I need it to do del as well)... then I do the following...
if (@$_REQUEST["a"]=="cancel") {
global $conn;
$str5 = "select Order_status from order_sales where Order_num =".$_SESSION[$strTableName."_masterkey1"];
$rs5 = db_query($str5,$conn);
$data5 = db_fetch_array($rs5); if ($data5["Order_status"]!=2) {
global $conn;
$str = "select Order_num from order_items where Order_num =".$_SESSION[$strTableName."_masterkey1"];
$rs = CustomQuery($str);
while($data = db_fetch_array($rs))
{
//remove detail records for selected master record
$strDelete = "delete from order_items where Order_num =".$_SESSION[$strTableName."_masterkey1"];
db_exec($strDelete,$conn);
}
global $conn;
$str = "select Order_ID from event_times where Order_ID =".$_SESSION[$strTableName."_masterkey1"];
$rs = CustomQuery($str);
while($data = db_fetch_array($rs))
{
//remove detail records for selected master record
$strDelete = "delete from event_times where Order_ID =".$_SESSION[$strTableName."_masterkey1"];
db_exec($strDelete,$conn);
}
global $conn;
$str = "select Order_num from order_sales where Order_num =".$_SESSION[$strTableName."_masterkey1"];
$rs = CustomQuery($str);
while($data = db_fetch_array($rs))
{
//remove detail records for selected master record
$strDelete = "delete from order_sales where Order_num =".$_SESSION[$strTableName."_masterkey1"];
db_exec($strDelete,$conn);
}
echo "<script>alert('You Have Cancelled the Order')</script>";
echo "<script>window.location.href='order_sales_list.php?a=return';</script>";
//header("Location: order_sales_list.php?a=return");
exit();
}
else
{
echo "Unable to delete this invoice, invoice has been previously processed";
} } else
Conclude: If you need all 2 type of interactions on a page make sure to do them in the right order, IE as I pasted the code, it would be last 2nd. basilcy go in reverse in which i posted, so custom buttons code first, then request explode 2nd and the pulldown last. Eh hope this helps you out, there is no simple solution, (never is)< phprunner is a great tool for getting the simple things done, but when it comes to fully customizing all possible scenarios, I don't know an editor out there that could cover all bases, this is by far the best, thou I do argue that any build past 5.2 just becomes a pain. hehe but that's personal preferance at this point. GL!
|