function replace_user_action()
 {
     global $lang, $config;
     require_once $config['basepath'] . '/include/login.inc.php';
     $login = new login();
     switch ($_GET['action']) {
         case 'index':
             $_GET['PageID'] = 1;
             require_once $config['basepath'] . '/include/page_display.inc.php';
             $search = new page_display();
             $data = $search->display();
             break;
         case 'member_login':
             $data = $login->display_login('Member');
             break;
         case 'search_step_2':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->create_searchpage();
             break;
         case 'searchpage':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->create_search_page_logic();
             break;
         case 'searchresults':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->search_results();
             break;
         case 'listingview':
             require_once $config['basepath'] . '/include/listing.inc.php';
             $listing = new listing_pages();
             $data = $listing->listing_view();
             break;
         case 'addtofavorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->addtofavorites();
             break;
         case 'view_favorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->view_favorites();
             break;
         case 'view_saved_searches':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->view_saved_searches();
             break;
         case 'save_search':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->save_search();
             break;
         case 'delete_search':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->delete_search();
             break;
         case 'delete_favorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->delete_favorites();
             break;
         case 'page_display':
             require_once $config['basepath'] . '/include/page_display.inc.php';
             $search = new page_display();
             $data = $search->display();
             break;
         case 'calculator':
             require_once $config['basepath'] . '/include/calculators.inc.php';
             $calc = new calculators();
             $data = $calc->start_calc();
             break;
         case 'view_listing_image':
             require_once $config['basepath'] . '/include/images.inc.php';
             $image = new image_handler();
             $data = $image->view_image('listing');
             break;
         case 'view_user_image':
             require_once $config['basepath'] . '/include/images.inc.php';
             $image = new image_handler();
             $data = $image->view_image('userimage');
             break;
         case 'rss_featured_listings':
             require_once $config['basepath'] . '/include/rss.inc.php';
             $rss = new rss();
             $data = $rss->rss_view('featured');
             break;
         case 'rss_lastmodified_listings':
             require_once $config['basepath'] . '/include/rss.inc.php';
             $rss = new rss();
             $data = $rss->rss_view('lastmodified');
             break;
         case 'view_user':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             $data = $user->view_user();
             break;
         case 'view_users':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             $data = $user->view_users();
             break;
         case 'edit_profile':
             require_once $config['basepath'] . '/include/user_manager.inc.php';
             if (!isset($_GET['user_id'])) {
                 $_GET['user_id'] = 0;
             }
             $user_managment = new user_managment();
             $data = $user_managment->edit_member_profile($_GET['user_id']);
             break;
         case 'signup':
             if (isset($_GET['type'])) {
                 require_once $config['basepath'] . '/include/user_manager.inc.php';
                 $listing = new user_managment();
                 $data = $listing->user_signup($_GET['type']);
             }
             break;
         case 'show_vtour':
             if (isset($_GET['listingID'])) {
                 require_once $config['basepath'] . '/include/vtour.inc.php';
                 $vtour = new vtours();
                 $data = $vtour->show_vtour($_GET['listingID']);
             } else {
                 $data = 'No Listing ID';
             }
             break;
         case 'contact_friend':
             require_once $config['basepath'] . '/include/contact.inc.php';
             $contact = new contact();
             if (isset($_GET['listing_id'])) {
                 $data = $contact->ContactFriendForm($_GET['listing_id']);
             }
             break;
         case 'contact_agent':
             require_once $config['basepath'] . '/include/contact.inc.php';
             $contact = new contact();
             if (isset($_GET['listing_id']) && isset($_GET['agent_id'])) {
                 $data = $contact->ContactAgentForm($_GET['listing_id'], $_GET['agent_id']);
             } elseif (isset($_GET['listing_id'])) {
                 $data = $contact->ContactAgentForm($_GET['listing_id'], 0);
             } elseif (isset($_GET['agent_id'])) {
                 $data = $contact->ContactAgentForm(0, $_GET['agent_id']);
             } else {
                 $data = '';
             }
             break;
         case 'create_vcard':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             if (isset($_GET['user'])) {
                 $data = $user->create_vcard($_GET['user']);
             }
             break;
         case 'create_download':
             require_once $config['basepath'] . '/include/files.inc.php';
             $files = new file_handler();
             if (isset($_GET['ID']) && isset($_GET['file_id']) && isset($_GET['type'])) {
                 $data = $files->create_download($_GET['ID'], $_GET['file_id'], $_GET['type']);
             } elseif (isset($_POST['ID']) && isset($_POST['file_id']) && isset($_POST['type'])) {
                 $data = $files->create_download($_POST['ID'], $_POST['file_id'], $_POST['type']);
             }
             break;
         case 'blog_index':
             require_once $config['basepath'] . '/include/blog_display.inc.php';
             $blog = new blog_display();
             $data = $blog->disply_blog_index();
             break;
         case 'blog_view_article':
             require_once $config['basepath'] . '/include/blog_display.inc.php';
             $blog = new blog_display();
             $data = $blog->display();
             break;
         case 'verify_email':
             require_once $config['basepath'] . '/include/user_manager.inc.php';
             $user_manager = new user_managment();
             $data = $user_manager->verify_email();
             break;
         default:
             $addon_name = array();
             if (preg_match("/^addon_(.\\S*?)_.*/", $_GET['action'], $addon_name)) {
                 $file = $config['basepath'] . '/addons/' . $addon_name[1] . '/addon.inc.php';
                 if (file_exists($file)) {
                     include_once $file;
                     $function_name = $addon_name[1] . '_run_action_user_template';
                     $data = $function_name();
                 } else {
                     $data = $lang['addon_doesnt_exist'];
                 }
             } else {
                 $data = '';
             }
             break;
     }
     // End switch ($_GET['action'])
     return $data;
 }
Example #2
0
    /**
     * calculators::start_calc()
     * This is the function which displays the calculator.
     *
     * @return string Returns the html to dispaly the calculators
     */
    function start_calc()
    {
        global $conn, $config, $lang, $show;
        require_once $config['basepath'] . '/include/misc.inc.php';
        $misc = new misc();
        // required to show featured listings
        require_once $config['basepath'] . '/include/listing.inc.php';
        $listings = new listing_pages();
        $price = '100000';
        if (isset($_GET['price'])) {
            $price = intval($_GET['price']);
        }
        $display = '<!-- Call the jscript to operate the calcualtors -->';
        $display .= '<script src="' . $config['baseurl'] . '/include/calculator.js" type="text/javascript"></script>';
        $display .= '<table class="page_display">';
        $display .= '<tr>';
        $display .= '<!--only align the content to the top allow use of the admin area to set this as wanted that way -->';
        $display .= '<td class="page_display">';
        // write menu here allways visable
        $display .= calculators::writemenu();
        // If $_GET['show'] isnt set make it blank.
        if (!isset($_GET['show'])) {
            $_GET['show'] = '';
        }
        if ($_GET['show'] == '') {
            $display .= '<table  width="80%" border="0" cellspacing="2" cellpadding="2">';
            $display .= '<tr>';
            $display .= '<td> <p>&nbsp;</p>';
            $display .= '<p>' . $lang['calc_intro_para_one'] . '</p>';
            $display .= '<p>' . $lang['calc_intro_para_two'] . '</p>';
            $display .= '</td></tr></table>';
        }
        // ==================== LOAN TERM ============================== #
        if ($_GET['show'] == 'LoanTerm') {
            $display .= '<table width="80%" border="0" cellspacing="2" cellpadding="2">';
            $display .= '<tr>';
            $display .= '<td>';
            $display .= '<h1>' . $lang['calc_Loan_Term_header'] . '</h1>';
            $display .= '<p>' . $lang['calc_Loan_Term_intro'] . '</p>';
            $display .= '<form id="repay" method="post" action="#">';
            $display .= '<table cellspacing="0" cellpadding="2" border="0">';
            $display .= '<tr>';
            $display .= '<td valign="top">' . $lang['calc_term_Loan_amount'] . '</td>';
            $display .= '<td valign="top" rowspan="3" style="height:1px;"></td>';
            $display .= '<td valign="top"><input onblur="checkLoan(LoanAmt2);" size="12" value="' . $price . '" name="LoanAmt2" /> [' . $config['money_sign'] . ']</td></tr>';
            $display .= '<tr>';
            $display .= '<td valign="top">' . $lang['calc_term_Regular_repayment_amount'] . '</td>';
            $display .= '<td valign="top"><input onblur="checkRepay(RepayAmt2);" size="12" value="700" name="RepayAmt2" /> <select name="RepayFreq"> <option value="12" selected="selected">' . $lang['calc_term_per_month'] . '</option> <option value="26">' . $lang['calc_term_per_biweekly'] . '</option> ';
            $display .= '<option value="52">' . $lang['calc_term_per_week'] . '</option></select> </td></tr>';
            $display .= '<tr>';
            $display .= '<td valign="top">' . $lang['calc_term_Annual_interest_rate'] . '</td>';
            $display .= '<td valign="top"><input size="12" value="7.00" name="IntRate2" onblur="checkIntRate(IntRate2);" /> ';
            $display .= '[%]</td></tr></table>';
            $display .= '<table cellspacing="2" cellpadding="2" width="100%" border="0">';
            $display .= '<tr>';
            $display .= '<td valign="baseline" align="right"><input onclick="CalcTerm();" type="button" value="' . $lang['calc_button_Calculate'] . '" name="Calculate" /></td></tr>';
            $display .= '<tr>';
            $display .= '<td valign="top" align="right"><b>' . $lang['calc_term_It_will_take'] . ' <input size="5"  name="TermYear2" /> ' . $lang['calc_term_years_and'] . ' <input size="5" name="TermMonth2" />';
            $display .= $lang['calc__term_months_to_repay'] . '.</b></td></tr></table>';
            $display .= '</form><br /><br />';
            $display .= '</td> ';
            $display .= '</tr> ';
            $display .= '</table>';
        }
        //End
        // ================== Loan Qualifier ================================ #
        if ($_GET['show'] == 'LoanQualifier') {
            $display .= '<table width="80%" border="0" cellspacing="2" cellpadding="2">
					<tr>
					<td>
					<h1>' . $lang['calc_Qual_header'] . '</h1>
					<p></p>
					<p>' . $lang['calc_Qual_intro_para_one'] . '</p>
					<p>' . $lang['calc_Qual_intro_para_two'] . '</p>
					<form id="qualify" method="post" action="#">
					<table cellspacing="0" cellpadding="0" width="100%" border="0">

					<tr>
					<td valign="top">' . $lang['calc_Qual_Application_Type'] . ' </td>
					<td valign="top"><input type="radio" checked="checked" value="1"
					name="Applicants" /> ' . $lang['calc_Qual_Single'] . ' <input type="radio" value="2"
					name="Applicants" /> ' . $lang['calc_Qual_Joint'] . ' </td></tr>
					<tr>
					<td valign="top">' . $lang['calc_Qual_Loan_Type'] . ' </td>
					<td valign="baseline"><input
					onclick="checkLoanType(loanType);" type="radio" checked="checked"
					value="Home" name="loanType" />' . $lang['calc_Qual_Home_Investment_Loan'] . '<br /><input
					onclick="checkLoanType(loanType);" type="radio"
					value="Personal" name="loanType" />' . $lang['calc_Qual_Personal_Loan'] . ' </td></tr>
					<tr>
					<td colspan="2"><b>' . $lang['calc_Qual_Income'] . '</b> </td></tr>
					<tr>
					<td valign="top">' . $lang['calc_Qual_Enter_income_1_net_after_tax'] . ' </td>
					<td valign="top">
					<input size="12" name="IncOne" />
					<select name="income1">
					<option value="1" selected="selected">' . $lang['calc_Qual_per_year'] . '</option>
					<option value="12">' . $lang['calc_Qual_per_month'] . '</option>
					<option value="26">' . $lang['calc_Qual_per_fortnight'] . '</option>
					<option  value="52">' . $lang['calc_Qual_per_week'] . '</option>
					</select>
					</td></tr><tr>
					<td valign="top">' . $lang['calc_Qual_Enter_income_2_net_after_tax'] . '</td>
					<td valign="top">
					<input size="12" value="0" name="IncTwo" onclick="select()" />
					<select name="income2">
					<option value="1" selected="selected">' . $lang['calc_Qual_per_year'] . '</option>
					<option value="12">' . $lang['calc_Qual_per_month'] . '</option>
					<option value="26">' . $lang['calc_Qual_per_fortnight'] . '</option>
					<option value="52">' . $lang['calc_Qual_per_week'] . '</option>
					</select>
					</td></tr>
					<tr>
					<td valign="top">' . $lang['calc_Qual_Enter_other_income_net_after_tax'] . '</td>
					<td valign="top">
					<input size="12" value="0" name="OthInc" onclick="select()" />
					<select name="incomeother">
					<option value="1" selected="selected">' . $lang['calc_Qual_per_year'] . '</option>
					<option value="12">' . $lang['calc_Qual_per_month'] . '</option>
					<option value="26">' . $lang['calc_Qual_per_fortnight'] . '</option>
					<option value="52">' . $lang['calc_Qual_per_week'] . '</option>
					</select>
					</td></tr><tr>
					<td valign="top">' . $lang['calc_Qual_Enter_rental_investment_income'] . ' </td>
					<td valign="top"><input size="12" value="0" name="RentInc" onclick="select()" />
					<select name="incomerental">
					<option value="1" selected="selected">' . $lang['calc_Qual_per_year'] . '</option>
					<option value="12">' . $lang['calc_Qual_per_month'] . '</option>
					<option value="26">' . $lang['calc_Qual_per_fortnight'] . '</option>
					<option value="52">' . $lang['calc_Qual_per_week'] . '</option>
					</select>
					</td></tr><tr>
					<td colspan="2"><br /><b>' . $lang['calc_Qual_Expenses'] . '</b>
					</td></tr><tr>
					<td valign="top">' . $lang['calc_Qual_Enter_investment_loan_repayment'] . '</td>
					<td valign="top"><input size="12" value="0" name="HomeLoan" onclick="select()" /> [' . $lang['calc_Qual_per_month'] . ']
					 </td></tr><tr>
					<td valign="top">' . $lang['calc_Qual_Enter_other_loan_repayments'] . '
					</td>
					<td valign="top"><input size="12" value="0" name="OthLoan" onclick="select()" /> [' . $lang['calc_Qual_per_month'] . ']
					</td></tr><tr>
					<td valign="top">' . $lang['calc_Qual_Enter_your_total_credit_card_limit'] . '</td>
					<td valign="top"><input size="12" value="0" name="CardLim" onclick="select()" /> [' . $config['money_sign'] . '] </td></tr>
					<tr><td valign="top">' . $lang['calc_Qual_Enter_number_of_dependants'] . '
					</td>
					<td valign="top"><input size="12" value="0" name="NumbDep" onclick="select()" /> </td></tr>
					<tr>
					<td colspan="2"><i>
					' . $lang['calc_Qual_expense_note'] . '</i>
					</td></tr><tr>
					<td colspan="2"><br /><b>' . $lang['calc_Qual_Loan_Details'] . '</b> </td></tr>
					<tr>
					<td valign="top">' . $lang['calc_Qual_Qualification_Interest_Rate'] . ' </td>
					<td valign="baseline">
					<input size="6" value="8.16" name="IntRate" /> [' . $lang['calc_percentage_symbol'] . ']
					</td></tr><tr><td valign="top">' . $lang['calc_Qual_Enter_term_of_loan'] . ' </td>
					<td valign="top">
					<table cellspacing="0" cellpadding="0"><tr><td>
					<input size="6" value="25" name="TermYear" /></td>
					<td>
					<input size="2" name="TermMonth" />
					</td></tr><tr><td>[' . $lang['calc_Qual_Years'] . ']</td><td>[' . $lang['calc_Qual_Months'] . ']</td>
												</tr></table></td></tr></table>
					<table cellspacing="2" cellpadding="2" width="100%" border="0">

										<tr>
					<td valign="baseline" align="right"><input onclick="CalQualAmt();" type="button" value="' . $lang['calc_button_Calculate'] . '" name="Calculate" />
					</td></tr><tr>
					<td valign="top" align="right"><b>
					' . $lang['calc_Qual_The_amount_you_can_borrow_will_be_approximately'] . '
					<input value="0" name="LoanAmt" /></b> </td></tr></table></form><br /><br />
					  </td>
					  </tr>
					</table>
				';
        }
        //End
        if ($_GET['show'] == 'LoanRepayment') {
            $display .= '
					<table width="80%" border="0" cellspacing="2" cellpadding="2">
					<tr>
					<td>
					<h1>' . $lang['calc_repay_header'] . '</h1>
					<p></p>
					<p>' . $lang['calc_repay_intro'] . '</p>
					<form id="repay" method="post" action="#">
					<table cellspacing="0" cellpadding="2" border="0">
					<tr>
					<td valign="top">' . $lang['calc_repay_Loan_amount'] . '</td>
					<td valign="top" rowspan="4" style="height:1px;"></td>
					<td valign="top" colspan="2"><input
					onblur="checkLoan(LoanAmt1);" size="13" value="' . $price . '"
					name="LoanAmt1" /> [' . $config['money_sign'] . ']</td></tr>
					<tr>
					<td valign="top">' . $lang['calc_repay_Annual_interest_rate'] . '</td>
					<td valign="top" colspan="2"><input
					onblur="checkIntRate(IntRate1);" size="5" value="7.00"
					name="IntRate1" /> [' . $lang['calc_percentage_symbol'] . ']</td></tr>
					<tr>
					<td valign="top">' . $lang['calc_repay_Loan_term'] . '</td>
					<td valign="top"><input onblur="checkTermY(TermYear1);"
					size="3" value="25" name="TermYear1" /></td>
					<td valign="top"><input onblur="checkTermM(TermMonth1);"
					size="3" value="0" name="TermMonth1" /></td></tr>
					<tr>
					<td valign="top"></td>
					<td valign="baseline">[' . $lang['calc_Qual_Years'] . ']</td>
					<td valign="baseline">[' . $lang['calc_Qual_Months'] . ']</td></tr></table>
					<table cellspacing="2" cellpadding="2" width="100%" border="0">
					<tr>
					<td valign="baseline" align="right"><input onclick="CalcRepay();" type="button" value="' . $lang['calc_button_Calculate'] . '" name="Calculate" /></td></tr>
					<tr>
					<td valign="top" align="right"><b>' . $lang['calc_repay_Your_repayment_will_be_approximately'] . ' ' . $config['money_sign'] . ' <input size="10" value="0"
					name="RepayAmt1" /> ' . $lang['calc_Qual_per_month'] . '</b></td></tr></table>
					</form><br /><br />
					</td>
					</tr>
					</table>
				';
        }
        //End
        if ($_GET['show'] == 'LoanAmount') {
            $display .= '
					<table width="80%" border="0" cellspacing="2" cellpadding="2">
					<tr>
					<td>
					<h1>' . $lang['calc_amount_header'] . '</h1>
					<p></p>
					<p>' . $lang['calc_amount_intro'] . '</p>
					<form id="repay" method="post" action="#">
					<table cellspacing="0" cellpadding="1" border="0">
					<tr>
					<td valign="top">' . $lang['calc_amount_Regular_repayment_amount'] . '</td>
					<td valign="top" rowspan="4" style="height:1px;"></td>
					<td valign="top" colspan="2"><input
					onblur="checkRepay(RepayAmt3)" size="12" value="500"
					name="RepayAmt3" />' . $lang['calc_Qual_per_month'] . '</td></tr>
					<tr>
					<td valign="top">' . $lang['calc_amount_Annual_interest_rate'] . '</td>
					<td valign="top" colspan="2"><input
					onblur="checkIntRate(IntRate3)" size="5" value="7.00"
					name="IntRate3" /> [' . $lang['calc_percentage_symbol'] . ']</td></tr>
					<tr>
					<td valign="top">' . $lang['calc_amount_Loan_term'] . '</td>
					<td valign="top"><input onblur="checkTermY(TermYear3)"
					size="3" value="25" name="TermYear3" /></td>
					<td valign="top"><input onblur="checkTermM(TermMonth3)"
					size="3" value="0" name="TermMonth3" /></td></tr>
					<tr>
					<td valign="top"></td>
					<td valign="baseline">[' . $lang['calc_Qual_Years'] . ']</td>
					<td valign="baseline">[' . $lang['calc_Qual_Months'] . ']</td></tr></table>
					<table cellspacing="2" cellpadding="2" width="100%" border="0">
					<tr>
					<td valign="baseline" align="right"><input onclick="CalcLoan();" type="button" value="' . $lang['calc_button_Calculate'] . '" name="Calculate" /></td></tr>
					<tr>
					<td valign="top" align="right"><b>' . $lang['calc_amount_The_total_loan_amount_will_be'] . ' ' . $config['money_sign'] . ' <input size="10"
					name="LoanAmt3" /></b></td></tr></table></form>
					<br /><br />
					</td>
					</tr>
					</table>
				';
        }
        //End
        $display .= '<p style="font-size:10px;text-align: center;">' . $lang['calc_footer text'] . '</p>
				<!--Close the table colom this must remain! -->
				</td>
				<!--Close the table down. -->
				</tr>
				</table>
  				<!--Template closer -->';
        return $display;
    }