<?php  $GLOBALS["conn"] = $conn; function vt_getServices(){ $conn = $GLOBALS["conn"]; $result = $conn->query("SELECT display_name,name,image FROM service WHERE active='1' ORDER BY display_name"); if($result->num_rows > 0){ while($row = $result->fetch_assoc()){ $service[] = $row;; } return $service; }else{ return false; } } function vt_getServicesByCategory($id){ $conn = $GLOBALS["conn"]; $result = $conn->query("SELECT display_name,name,image FROM service WHERE active='1' AND category='$id' ORDER BY display_name"); if($result->num_rows > 0){ while($row = $result->fetch_assoc()){ $service[] = $row;; } return $service; }else{ return false; } } function vt_category(){ $conn = $GLOBALS["conn"]; $result = $conn->query("SELECT display_name,name,icon,id FROM category WHERE active='1' ORDER BY display_name"); if($result->num_rows > 0){ while($row = $result->fetch_assoc()){ $category[] = $row;; } return $category; }else{ return false; } } ?>  