<?php

  function get_database_connection()
  {
    // Create connection
    $sn = $_SERVER['SERVER_NAME'];
    //echo $sn;
    if ($sn=="localhost")
	$con=mysqli_connect("localhost","root","root","MobileSELECT");
    else if (strpos($sn, "mappage"))
      $con=mysqli_connect("localhost","mappagen_u2","1W}*9gF%U9UL","mappagen_m1");
    else
	$con=mysqli_connect("localhost","u567","p567","MobileSELECT");
      

  // Check connection
  if (mysqli_connect_errno($con))
    echo "Failed to connect to MySQL: " . mysqli_connect_error();

    return $con;
  }

  function include_jquery()
  {
    echo '<script src="http://code.jquery.com/jquery-1.9.1.js"></script>';
    echo '<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>';
  }
  function include_googles_jquery()
  {
    echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>';
  }
?>
