the data is pulled from the database as follows
[php]mysql_select_db($database_connect, $connect);
$query_listing = “SELECT * FROM listings WHERE aptRef = ‘$aptRef’”;
$listing = mysql_query($query_listing, $connect) or die(mysql_error());
$row_listing = mysql_fetch_assoc($listing);
$totalRows_listing = mysql_num_rows($listing);
include(“users/ListCfg/”.$row_listing[‘aptRef’].".php");[/php]
the line
[php]include(“users/ListCfg/”.$row_listing");[/php]
is a static page I learnt how to do from this forum see
http://phphelp.com/forums/viewtopic.php?t=7461&highlight=
This files contains the details for the selected apartment
While the database contains contact information and the apartment ref
The calander is pulled by the following
[php]
header(“Expires: “.gmdate(“D, d M Y H:i:s”).” GMT”);
header(“Last-Modified: “.gmdate(“D, d M Y H:i:s”).” GMT”);
header(“Cache-Control: no-cache, must-revalidate”);
header(“Pragma: no-cache”);
header(“Cache-Control: post-check=0, pre-check=0”);
$month = array( “01” => “January”,
“02” => “February”,
“03” => “March”,
“04” => “April”,
“05” => “May”,
“06” => “June”,
“07” => “July”,
“08” => “August”,
“09” => “September”,
“10” => “October”,
“11” => “November”,
“12” => “December”
);
$v_month = array( “01” => “Jan”,
“02” => “Feb”,
“03” => “Mar”,
“04” => “Apr”,
“05” => “May”,
“06” => “Jun”,
“07” => “Jul”,
“08” => “Aug”,
“09” => “Sep”,
“10” => “Oct”,
“11” => “Nov”,
“12” => “Dec”
);
if (!$dbh = @mysql_connect($db_addr, $db_user, $db_pass)):
die (“Connection to the data base server could not be made.”);
endif;
if (!$dbdat = @mysql_select_db($db_name, $dbh)):
die (“Unable to establish a connection to the database.”);
endif;
function table_exists($table) {
GLOBAL $db_name;
$result = mysql_list_tables ($db_name);
if (!$result) {echo "Examination of the tables could not be accomplished.
";}
else {
while($row = mysql_fetch_row($result)){
if ($row[0] == $table) return true;
} }
return false;
}
function check_date($d, $m, $Y){
if (date(“m-d-Y”, mktime(0, 0, 0, $m, $d, $Y)) == “$m-$d-$Y”) return true;
return false;
}
function daysinmonth($month, $year)
{
if(checkdate($month, 31, $year)) return 31;
if(checkdate($month, 30, $year)) return 30;
if(checkdate($month, 29, $year)) return 29;
if(checkdate($month, 28, $year)) return 28;
return 0; // error
}
function weeksinmonth($month, $year){
$firstDey = array (“01”, $month, $year);
$lastDey = array (daysinmonth($month, $year), $month, $year);
$tst1 = mktime (1, 0, 0, $firstDey[1], $firstDey[0], $firstDey[2]);
$tst2 = mktime (1, 0, 0, $lastDey[1], $lastDey[0], $lastDey[2]);
$wa = date(“W”, $tst1);
$we = date(“W”, $tst2);
if ($wa == 53) $wa = 1;
$weeks = $we - $wa;
return array($weeks, $wa, $we);
}
function get_time ($tst){
Global $timestring;
$lok = date($timestring, $tst);
return (!empty ($tst)) ? $lok : “”;
}
$plan_nr = (empty($_GET[‘plan_nr’])) ? $aptNo : $_GET[‘plan_nr’];
$year = (empty($_GET[‘year’])) ? date(“Y”, time()) : $_GET[‘year’];
$month = (empty($_GET[‘month’])) ? date(“m”, time()) : $_GET[‘month’];
$error = false; $alloc_year = array();
$query = "SELECT * FROM $main_table_name WHERE plan_nr = ‘$plan_nr’ AND YEAR(alloc) = ‘$year’ ";
if ($result = mysql_query($query)) {
while ($row = mysql_fetch_array ($result)){
$alloc_year[] = $row[“alloc”];
}
}
asort($alloc_year);
if (!empty ($_POST[‘submit’])){
$alloc = $_POST[‘alloc’];
if (!is_array($alloc)) $alloc = array();
foreach ($alloc AS $insert_value){
if (!in_array($insert_value, $alloc_year)){
$query = "INSERT INTO $main_table_name SET plan_nr = '$plan_nr', alloc = '$insert_value'";
if (!mysql_query($query) && !$error) {
$error = true;
die ("Database error: INSERT could not be accomplished. Line: ".__LINE__);
}
}
}
foreach ($alloc_year AS $delete_value){
if (!in_array($delete_value, $alloc)){
$query = "DELETE FROM $main_table_name WHERE alloc = '$delete_value' AND plan_nr = $plan_nr LIMIT 1";
if (!mysql_query($query) && !$error) {
$error = true;
die ("Database error: DELETE could not be accomplished. Line: ".__LINE__);
}
}
}
$error = false; $alloc_year = array();
$query = "SELECT * FROM $main_table_name WHERE plan_nr = ‘$plan_nr’ AND YEAR(alloc) = ‘$year’ ";
if ($result = mysql_query($query)) {
while ($row = mysql_fetch_array ($result)){
$alloc_year[] = $row[“alloc”];
}
}
$query = “SELECT plan_nr FROM $times_table_name WHERE plan_nr = $plan_nr”;
$num_rows = mysql_num_rows(mysql_query($query));
if ($num_rows > 0){
$query = “UPDATE $times_table_name SET last_mod = “.time().” WHERE plan_nr = $plan_nr”;
}else {
$query = “INSERT INTO $times_table_name SET last_mod = “.time().”, plan_nr = $plan_nr”;
}
if (!mysql_query($query) && !$error) {
die ("Database error: “.(($num_rows > 0) ? “Update” : “Insert”).” could not be accomplished. Line: ".LINE);
}
}
$query = “SELECT last_mod FROM $times_table_name WHERE plan_nr = $plan_nr”;
if ($result = mysql_query($query)){
while ($row = mysql_fetch_array ($result)){
$last_mod = get_time($row[“last_mod”]);
}
}
if (empty($last_mod)) $last_mod = “Not available”;
[/php]
This is the error message I am now getting
Parse error: parse error, unexpected ‘=’, expecting T_VARIABLE or ‘$’ in /data/members/paid/s/u/******.com/htdocs/******/users/ListCfg/.php on line 2