menu_id)); getChild(intval($row->menu_id)); } mysqli_free_result($result); } // Insert Query Function function table_insert($str_table_name, $str_field, $obj_values) { global $cn; $val_part=""; $recresult=""; $str_query = "insert into `$str_table_name` ("; $int_count = 0; while ( $int_count < count($str_field) ) { $str_query = $str_query .$str_field[$int_count]; $val_part = $val_part .$obj_values[$int_count]; if ( ($int_count + 1) != count($str_field) ) { $val_part = $val_part . ", "; $str_query = $str_query. ", "; } $int_count++; } $str_query = $str_query.") values(".$val_part.")"; $recresult=mysqli_query($cn, $str_query); return mysqli_affected_rows($cn); } // Update Query Function function table_update($str_table_name, $str_fields, $obj_values,$str_columnname,$obj_condition) { global $cn; $recresult=""; $columns =""; $str_query =""; $str_query .= "UPDATE `$str_table_name` SET "; $int_count = 1; foreach ($str_fields as $int_key=>$int_value) { if ($int_count != count($str_fields) ) { $str_query .= $str_fields[$int_key]; $str_query .= "=".$obj_values[$int_key].","; } else { $str_query .= $str_fields[$int_key]; $str_query .= "=".$obj_values[$int_key]; } $int_count++; } if(count($str_columnname)>0){ $str_query .= " WHERE " ; $int_count = 1; foreach ($str_columnname as $int_key=>$int_value) { if ($int_count != count($str_columnname) ) { $str_query .= $str_columnname[$int_key]; $str_query .= "=".$obj_condition[$int_key]." and "; } else { $str_query .= $str_columnname[$int_key]; $str_query .= "=".$obj_condition[$int_key]; } $int_count++; } } $recresult=mysqli_query($cn, $str_query); return mysqli_affected_rows($cn); } function getMenuDisplay($id, $urlprefix = '') { global $cn; $query = "SELECT * FROM l21_menu WHERE menu_parent=".$id." AND menu_active = 'Y' order by menu_order"; $result = mysqli_query($cn, $query); if($result && mysqli_num_rows($result) > 0) { if($id == 0) echo "\n"; else echo '"; mysqli_free_result($result); } } function getMenuList($id) { global $cn; global $plug; global $current_url; $query = "SELECT *, (select MAX(`menu_order`) from l21_menu where menu_parent = ". $id . ") as maxorder FROM l21_menu WHERE menu_parent=". $id . " order by menu_order"; $result = mysqli_query($cn, $query); if($result && mysqli_num_rows($result) > 0) { $i=0; while($row = mysqli_fetch_object($result)) { $i++; $loc = $row->menu_sublevel; $name = ''; for($j=0; $j < $loc; $j++) { $name .=".      "; } $name .= "|_  " . formatText($row->menu_item); if(!empty($row->menu_accesskey)) { $name .= ' ['. $row->menu_accesskey . ']'; } if($row->menu_active == 'Y') $style = ''; else $style = ' style="opacity:0.5"'; ?> > menu_order != '1') { if( $row->menu_order != $row->maxorder) { ?> menu_description); ?> menu_url); ?> menu_id); } mysqli_free_result($result); } } ?>