PriceFile = file("prices.txt"); } function EditPrice($i) { $retVal = TRUE; if ($this->NewPrices[$i] == "") { $this->ErrorMsg("Price Cannot be Blank"); $retVal = FALSE; } return $retVal; } function UpdatePrices() { $filename = 'prices.txt'; $handle = fopen($filename, 'w+'); for ($i = 0; $i <= count($this->NewPrices) - 1 ; $i++) { fwrite($handle, $this->NewPrices[$i] . "\n"); } $this->BuildHTMLFile(); fclose($handle); } function DisplayPrices() { $this->GetPrices(); $this->FormatHtmlHeader(); for ($i = 0; $i <= count($this->PriceFile) - 1 ; $i++) { $this->FormatHTML($i); } $this->FormatHtmlFooter(); } function DisplayUpdateSuccess() { $this->htmlContent .= ''; $this->htmlContent = ''; $this->htmlContent .= ''; $this->htmlContent .= 'Prices Successfully Maintained'; $this->htmlContent .= ''; $this->htmlContent .= ''; $this->htmlContent .= ''; } function FormatHtmlHeader() { $this->htmlContent .= ''; $this->htmlContent .= ''; $this->htmlContent .= ''; $this->htmlContent .= ''; $this->htmlContent .= ''; $this->htmlContent .= ''; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= '
'; $this->htmlContent .= ''; $this->htmlContent .= 'Price File Maintenance'; $this->htmlContent .= ' '; $this->htmlContent .= '
'; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; } function FormatHTML($i) { $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; } function FormatHTMLFooter() { $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= ' '; $this->htmlContent .= '
Apartment TypeCurrent PriceRevised Price
' . $this->PlanType[$i] . '' . $this->PriceFile[$i] . '

' . $this->strErrorMsg .'

'; $this->htmlContent .= '

'; $this->htmlContent .= '
'; } function BuildHTMLFile() { $filename = 'availability2.html'; $handle = fopen($filename,'w+'); fwrite($handle, ''); fwrite($handle, ''); fwrite($handle, 'CASA Availability'); fwrite($handle, ''); fwrite($handle, ''); fwrite($handle, ''); fwrite($handle, ''); fwrite($handle, ''); fwrite($handle, ''); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, ' '); fwrite($handle, '
' . $this->NewPrices[0] . '
' . $this->NewPrices[1] . '
' . $this->NewPrices[2] . '
'); fwrite($handle, ''); fwrite($handle, ''); fclose($handle); } function ErrorMsg($strErrMsg) { $this->strErrorMsg .= ' '; $this->strErrorMsg .= '» ' . $strErrMsg . '
'; $this->strErrors = TRUE; } } ?>