HEX
Server: Apache/2.2.15 (CentOS)
System: Linux ip-10-0-2-146.eu-west-1.compute.internal 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64
User: root (0)
PHP: 5.6.40
Disabled: NONE
Upload Files
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']
        ));
	}
}
?>