<?php require_once('Connections/telmanik_press.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}


$page = $_GET['page_name'];

//convert profile out of database 

$page_space = str_replace(' ', '-', ''.$page.'');




//$colname_pages = "-1";
//if (isset($_GET['page_name'])) {
//  $colname_pages = $_GET['page_name'];
//}

$sub = $page;

$replace = str_replace('_', ' ', ''.$sub.'');



mysql_select_db($database_telmanik_press, $telmanik_press);
$query_pages = "SELECT * FROM pages WHERE page_name = '$replace'";
$pages = mysql_query($query_pages, $telmanik_press) or die(mysql_error());
$row_pages = mysql_fetch_assoc($pages);
$totalRows_pages = mysql_num_rows($pages);


$page_match = $row_pages['page_name'];




mysql_select_db($database_telmanik_press, $telmanik_press);
$query_show = "SELECT * FROM content WHERE page_name = '$page_match'";
$show = mysql_query($query_show, $telmanik_press) or die(mysql_error());
$row_show = mysql_fetch_assoc($show);
$totalRows_show = mysql_num_rows($show);



?>







<?php $title = $row_pages['page_title']; ?>
<?php require("header.php"); ?>
<div id="mid_section"> <p>&nbsp; </p>


<?php echo $row_show['block_content'];?>

 <p>&nbsp; </p>

</div>
<?php require("footer.php"); ?>
<?php
mysql_free_result($pages);
?>
