File: /www/exchange0old/exchange/classes/Controller/CIntermediaryInvOrg.php
<?php
class Controller_CIntermediaryInvOrg
{
function addInvestorCurrencyOne()
{
include('classes/Lib/HandleErrors.php');
include("classes/Model/MIntermediaryInvOrg.php");
include("classes/Model/MTradeApplication.php");
$output['errmsg'] = $Err->messages;
$output['errval'] = $Err->values;
$objHome =new Model_MIntermediaryInvOrg();
if(isset($_REQUEST['user_id'])){
$_SESSION['user']['invuserid'] = $_REQUEST['user_id'];
}
Model_MIntermediaryInvOrg::inCompleteForm($_REQUEST['id']);
if($_SESSION['organisation_id'] !=''){
$redirect = Model_MIntermediaryInvOrg::orgStepRedirect($_SESSION['organisation_id'], 1);
}
$output['addressDrop'] = $objHome->getAddressDropDown($output["errval"]["address_select"]);
$_SESSION['addressDrop'] = $output['addressDrop'];
$output['org_type'] = $objHome->orgType('org_orgtype',$output["errval"]['org_orgtype'],'labels_settings');
$output['busi_entity'] = $objHome->CreateOptionBusinessentitytype('org_bentitytype',$output["errval"]['org_bentitytype'],'labels_settings');
//$output['juris_org'] = $objHome->CreateOptionJurOrg('org_jurorg',$output["errval"]['org_jurorg'],'labels_settings');
$output['branch'] = $objHome->addBranch(count($output["errval"]['orgb_email']),$output['errmsg'],$output['errval']);
$output['ccountry'] = $output["errval"]['orgc_country'];
$output['pcountry'] = $output["errval"]['orgp_country'];
$output['org_jurorg'] = $output["errval"]['org_jurorg'];
$help = Model_MTradeApplication::getHelpLinks(17); // Help LInks
$output['help'] = $help;
$_SESSION['help_2'] = $help;
$output['currencies']=Model_MTradeApplication::getCurrencies(NULL,NULL);
Bin_Template::createTemplate("intermedinv_application_form_1.html",$output);
unset($_SESSION['org_notify']);
}
function validateIntrmInvCurrencyOne()
{
include("classes/Model/Validation/CheckInputs.php");
include('classes/Model/Validation/FormValidation.php');
include("classes/Model/MIntermediaryInvOrg.php");
foreach( $_POST as $key => $value ){
if( !is_array($_POST[$key]) ){
$_POST[$key] = stripslashes($value);
}
}
new Model_Validation_CheckInputs("addintrminvestorone");
foreach( $_POST as $key => $value ){
if( !is_array($_POST[$key]) ){
$_POST[$key] = mysql_real_escape_string($value);
}
}
$objHome = new Model_MIntermediaryInvOrg();
$output['stepone'] = $objHome->insertInvestorCurrencyOne();
}
function addInvestorCurrencyTwo()
{
include('classes/Lib/HandleErrors.php');
include("classes/Model/MIntermediaryInvOrg.php");
include("classes/Model/MTradeApplication.php");
if(count($Err->messages) != 0)
{
$output["errmsg"] = $Err->messages;
$output["errval"] = $Err->values;
$output["style"] = $Err->style;
$_SESSION['berror'] = $Err->messages;
$_SESSION['bvalues'] = $Err->values;
}else{
unset($_SESSION['berror']);
unset($_SESSION['bvalues']);
}
$objHome =new Model_MIntermediaryInvOrg();
$_SESSION['organisation_id'] = $_REQUEST['id'];
Model_MIntermediaryInvOrg::inCompleteForm($_REQUEST['id']);
if(isset($_SESSION['organisation_id'])){
$address = array();
$address[0] = Model_MIntermediaryInvOrg::getOrgDetails($_SESSION['organisation_id']);
$address[1] = Model_MTradeApplication::getOrgBranchAddressDetails($_SESSION['organisation_id']);
$output['addressDrop'] = $objHome->getAddressDropDownForm2($address, $output["errval"]["address_select"]);
$_SESSION['addressDrop'] = $output['addressDrop'];
}
$output['regid'] = $objHome->selectRegid();
$output['primary'] = $objHome->selectPrimary();
$output['branch'] = $objHome->selectBranch();
$output['branch1'] = $output['branch'][0];
$output['branch2'] = $output['branch'][1];
$output['branch3'] = $output['branch'][2];
$_SESSION['branchcount'] =count($_SESSION['branch_id']);
$output['contact'] = $objHome->addContact(count($output["errval"]['cp_fname']),$output['errmsg'],$output['errval']);
$help = Model_MTradeApplication::getHelpLinks(18); // Help LInks
$output['help'] = $help;
if(!isset($_SESSION['organisation_id']))
header('location: index.php?do=intrminvapplication1');
Bin_Template::createTemplate("intermedinv_application_form_2.html",$output);
unset($_SESSION['org_notify']);
}
function validateIntrmInvCurrencyTwo()
{
include("classes/Model/Validation/CheckInputs.php");
include('classes/Model/Validation/FormValidation.php');
include("classes/Model/MIntermediaryInvOrg.php");
foreach( $_POST as $key => $value ){
if( !is_array($_POST[$key]) ){
$_POST[$key] = stripslashes($value);
}
}
new Model_Validation_CheckInputs("addintrminvestortwo");
foreach( $_POST as $key => $value ){
if( !is_array($_POST[$key]) ){
$_POST[$key] = mysql_real_escape_string($value);
}
}
$objHome =new Model_MIntermediaryInvOrg();
$output['steptwo'] = $objHome->validateInvestorCurrencyTwo();
}
function showIntrmInvCurrency()
{
include("classes/Model/MIntermediaryInvOrg.php");
include("classes/Display/DIntermediaryInvOrg.php");
$objHome = new Model_MIntermediaryInvOrg();
$output['viewinvestorcurrency'] = $objHome->showIntrmInvCurrency();
Bin_Template::createTemplate("viewintermedinvcurrency.html",$output);
}
}
?>