I have the following select combo box: and i am trying to find, how the values getting popultade in it.
Please help:
the following is in the Template file:
<select name="s_type" style="">
{section name=s loop=$types}
<option value="{$smarty.section.s.index_next}" {if $types[s].sel}selected{/if}>{$types[s].value}</option>
{/section}
</select>
The above template files was called from here: a php file: and this is the function where $type at the bottom for loop its filling the values to select box: Please i want to add a new value to the select combo box: i am searching but unable to find.
function ListUser($err=""){
global $smarty, $dbconn, $config, $config_admin, $lang, $multi_lang, $field_name;
if(isset($_SERVER["PHP_SELF"]))
$file_name = AfterLastSlash($_SERVER["PHP_SELF"]);
else
$file_name = "admin_users.php";
AdminMainMenu($lang["users"]);
$page = $_GET["page"]?$_GET["page"]:$_POST["page"];
$letter = $_GET["letter"]?$_GET["letter"]:$_POST["letter"];
$sorter = $_GET["sorter"]?$_GET["sorter"]:$_POST["sorter"];
$search = $_GET["search"]?$_GET["search"]:$_POST["search"];
$s_type = $_GET["s_type"]?$_GET["s_type"]:$_POST["s_type"];
if( (strval($page) == "") || (strval($page) == "0")){ $page = 1;}else{
$page=intval($page);}
if( strval($letter) == "" || strval($letter) == "*"){ $letter = "*";}else{$letter=intval($letter);}
if( (strval($sorter) == "")){ $sorter = "1";}else{ $sorter=intval($sorter);}
if( (strval($s_type) == "")){ $s_type = "1";}else{ $s_type=intval($s_type);}
///////// search
if(strval($search)){
$search = strip_tags($search);
switch($s_type){
case "1": $search_str=" a.login like '%".$search."%'"; break;
case "2": $search_str=" a.fname like '%".$search."%'"; break;
case "3": $search_str=" a.sname like '%".$search."%'"; break;
case "4": $search_str=" a.email like '%".$search."%'"; break;
}
}
///////// search form
for($i=0;$i<4;$i++){
if($s_type==($i+1))$types[$i]["sel"]="1";
$types[$i]["value"]=$lang["users"]["type_".($i+1)];
}
$smarty->assign("types", $types);
$smarty->assign("search", $search);