File: /www/exchange0old/exchange/classes/Model/MTradeNewUser.php
<?php
include_once('admin/classes/Model/base_actions.php');
class Model_MTradeNewUser extends Base_actions
{
function getOrganisation(){
$query = new Bin_Query();
$sql = "SELECT organisation_name FROM organisation_details WHERE user_id='".$_SESSION['user']['userid']."' LIMIT 1 ";
$query->executeQuery($sql);
$organisation = $query->records[0]['organisation_name'];
return $organisation;
}
function saveNewUser($type,$do)
{
$query = new Bin_Query();
$sql = "INSERT INTO organisation_users (`parent_id`,`first_name`,`last_name`,`organisation_name`,`email`,`created_at`) VALUES ('".$_SESSION['user']['userid']."','".$_POST['first_name']."','".$_POST['last_name']."','".addslashes($_POST['organisation_name'])."','".$_POST['email']."',NOW()) ";
$query->updateQuery($sql);
$user_id = $query->insertid;
if($type=='retail')
{
$clickhere= array('<a href="'.$_SESSION['http_base_url'].$type.'/investor/user.php?id='.$user_id.'">Click here </a>','Click here '.$_SESSION['http_base_url'].$type.'/investor/user.php?id='.$user_id);
}
else
{
$clickhere= array('<a href="'.$_SESSION['http_base_url'].$type.'/user.php?id='.$user_id.'">Click here </a>','Click here '.$_SESSION['http_base_url'].$type.'/user.php?id='.$user_id);
}
self::sendEmail(27,NULL,array(
'firstname'=>$_POST['first_name'],
'lastname'=>$_POST['lname'],
'clickhere'=>$clickhere,
'mail_to'=>$_POST['email']
));
}
}
?>