?
Path : /home/admin/public_html/modules/users/ |
Current File : /home/admin/public_html/modules/users/function.php |
<? function select_cat($db_resource,$table,$name,$key_field,$value_field,$chk){ $html="<select name=$name class=\"backend_inputbox\">"; $result=$db_resource->Query("SELECT * FROM $table order by $value_field DESC"); while($data=mysql_fetch_array($result)){ $v=$data[$value_field]; $k=$data[$key_field]; if($chk==$v && $chk!=''){ $html.="<option value=$v selected>$k</option>"; }else{ $html.="<option value=\"$v\">$k</option>"; } } $html.="</select>"; return $html; } function chang_field($db_resource,$table,$field,$field_change,$key){ $result=$db_resource->Query("SELECT $field_change FROM $table where $field='$key'"); $data=mysql_fetch_array($result); $return=$data[$field_change]; return $return; } function CountData($db_resource,$table,$condition){ $arr=$db_resource->Query("SELECT COUNT(*) FROM $table $condition"); $data=mysql_fetch_array($arr); return $data[0]; } ?>