$val) { ${$key} = $val; } foreach($_GET as $key => $val) { ${$key} = $val; } function get_select_array($arraykey, $arrayval, $name) { // $sql = "select $id, $what from $table where $stat"; // $q = mysql_query($sql); $sel = ""; return $sel; } function mysql1($query) { $q = mysql_query($query); print(mysql_error()); $d = array(); while($r = mysql_fetch_assoc($q)) { $d[] = $r; } return($d); } function mysql2($query) { $q = mysql_query($query); print(mysql_error()); } function get_select($id, $what, $table, $stat, $name) { $sql = "select $id, $what from $table where $stat"; $q = mysql_query($sql); $sel = ""; return $sel; } function get_select_cat($id, $what, $table, $stat, $name, $multi = false) { print("*"); $temp = get_data('show_subcats_inselect','config','1'); if($multi) { $mul = "multiple"; $name = $name."[]"; } if($temp == 0) { $sql = "select $id, $what from $table where $stat order by $what"; $q = mysql_query($sql); $sel = ""; return $sel; } else { $sql = "select $id, $what from $table where parent_id=0 order by $what"; $q = mysql_query($sql); $sel = ""; return $sel; } } function get_select_cat_def($id, $what, $table, $stat, $name, $def, $multi = false) { $temp = get_data('show_subcats_inselect','config','1'); if($multi) { $mul = "multiple"; $name = $name."[]"; } else $mul = ""; if($temp == 0) { $sql = "select $id, $what from $table where $stat order by $what"; $q = mysql_query($sql); $sel = ""; return $sel; } else { $sql = "select $id, $what from $table where parent_id=0 order by $what"; $q = mysql_query($sql); $sel = ""; return $sel; } } function get_checkbox($id, $what, $table, $stat, $name) { $sql = "select $id, $what from $table where $stat"; $q = mysql_query($sql); //$sel = "".$d[$what]."
"; } // $sel .= ""; return $sel; } function get_select_def($id, $what, $table, $stat, $name, $def) { $sql = "select $id, $what from $table where $stat"; $q = mysql_query($sql); $sel = ""; return $sel; } function get_checkbox_def($id, $what, $table, $stat, $name, $def) { $sql = "select $id, $what from $table where $stat"; // print($def); $temp = split("#",$def); $def1 = array(); foreach($temp as $val) { $t = split("_",$val); $def1[] = $t[0]; } $q = mysql_query($sql); //$sel = "".$d[$what]."
"; } // $sel .= ""; return $sel; } function get_data($what, $table, $stat) { $sql = "select $what from $table where $stat LIMIT 1"; // print($sql); $q = mysql_query($sql); $d = mysql_fetch_assoc($q); return $d[$what]; } function get_man_name($id, $name) { global $name1; // print($id." ".$name."
"); $sql = "select name, manufacturers_id, parent_id from manufacturers where manufacturers_id = $id LIMIT 1"; $q = mysql_query($sql); $d = mysql_fetch_assoc($q); $name = "".$d['name']." -> ".$name; // print($name." ".$d['parent_id']."
"); if($d['parent_id'] == 0) { $name1 = substr($name,0,-4); return $name1; } else get_man_name($d['parent_id'], $name); } function get_brand_name($id, $name) { global $name1; // print($id." ".$name."
"); $sql = "select text from Brand_type where id = $id LIMIT 1"; $q = mysql_query($sql); $d = mysql_fetch_assoc($q); $name1 = $d['text']; return $name1; } ?>