}
    if ($_POST['cd_custom_contract'] && !$access['Data']['cd_custom_contract']['Value']) {
        $Rates = new rates_fees();
        $contract = $Rates->get_Merchant_Contract($en_ID);
        $sql = "insert into cs_email_templates \n\t\t\tset et_name='merchant_contract', \n\t\t\tet_custom_id='" . $company_id . "', \n\t\t\tet_title='" . quote_smart($access['Data']['en_company']['Value']) . " Contract', \n\t\t\tet_access='admin', \n\t\t\tet_to_title='" . quote_smart($access['Data']['en_company']['Value']) . "', \n\t\t\tet_subject='Custom Merchant Contract for " . quote_smart($access['Data']['en_company']['Value']) . "', \n\t\t\tet_htmlformat='" . quote_smart($contract['et_htmlformat']) . "', \n\t\t\tet_catagory='Merchant'";
        $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ sql");
        $_POST['cd_custom_contract'] = mysql_insert_id();
    } else {
        if (!$_POST['cd_custom_contract'] && $access['Data']['cd_custom_contract']['Value']) {
            $sql = "delete from cs_email_templates where et_name='merchant_contract' and et_custom_id='" . $company_id . "'";
            $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ sql");
            $access['Data']['cd_custom_contract']['AddHtml'] = NULL;
        }
    }
}
$res = check_merchant_conflict($_POST, $en_ID);
if (!$res['status']) {
    $access['HeaderMessage'] .= nl2br($res['msg']);
    foreach ($res['res'] as $key => $val) {
        if ($val) {
            $_POST[$key] = $access['Data'][$key]['Value'];
            $access['Data'][$key]['Highlight'] = true;
        }
    }
}
// Submit
$affiliate_data = en_get_affiliates($en_ID);
$emaildata['email'] = $access['Data']['en_email']['Value'];
if ($affiliate_data) {
    foreach ($affiliate_data as $type => $group) {
        if (in_array($type, array('Reseller', 'Representative'))) {
Beispiel #2
0
function step_1($en_ID, $skipIfComplete = true)
{
    global $etel_timezone, $curUserInfo;
    // Step 1
    $access['SerializedData']['Source'] = 'en_info';
    $access['SerializedData']['Data'] = array('Sex' => array('General_Info', 'Sex'), 'Date_of_Birth' => array('General_Info', 'Date_of_Birth'), 'Contact_IM' => array('General_Info', 'Contact_IM'), 'Time_Zone' => array('General_Info', 'Time_Zone'), 'Personal_Phone' => array('General_Info', 'Personal_Phone'), 'Cell_Phone' => array('General_Info', 'Cell_Phone'), 'Personal_Address' => array('General_Info', 'Personal_Address'), 'Personal_Zip_Code' => array('General_Info', 'Personal_Zip_Code'), 'Personal_City' => array('General_Info', 'Personal_City'), 'Personal_State' => array('General_Info', 'Personal_State'), 'Personal_Country' => array('General_Info', 'Personal_Country'));
    $access = getAccessInfo("\r\n\t\r\n\tuserId,\r\n\ten_ID,\r\n\ten_info,\r\n\t\r\n\t'Personal Info' as access_header,\r\n  en_firstname , en_lastname, en_email , '' as 'Contact_IM', '' as 'Date_of_Birth',\r\n'' as 'Sex', '' as 'Personal_Phone', '' as 'Cell_Phone', '' as 'Personal_Address', '' as 'Personal_Zip_Code', '' as 'Personal_City', '' as 'Personal_Country', '' as 'Personal_State', '' as 'Time_Zone'\r\n\r\n\t\r\n\t\r\n\t", "cs_entities left join cs_companydetails on en_type='merchant' and en_type_ID = userId", "en_ID = '{$en_ID}'", array('Size' => 30, 'Rows' => 2, 'HideIfEmpty' => true, 'Valid' => 'req'), $access);
    if ($access == -1) {
        dieLog("Invalid Company" . print_r($curUserInfo, true), "Invalid Company en_ID = '{$en_ID}' ");
    }
    $res = check_merchant_conflict($_POST, $en_ID);
    if (!$res['status']) {
        $access['HeaderMessage'] .= $res['msg'] . "<BR>";
        $access['Data']['en_email']['Highlight'] = true;
        $_POST['en_email'] = $access['Data']['en_email']['Value'];
    }
    $access['Data']['Contact_IM']['DisplayName'] = 'Contact Instant Messenger';
    $access['Data']['Contact_IM']['req'] = false;
    $access['Data']['Date_of_Birth']['DisplayName'] = 'Date of Birth';
    $access['Data']['Sex']['DisplayName'] = 'Sex';
    $access['Data']['en_email']['DisplayName'] = 'Personal Email';
    $access['Data']['en_lastname']['DisplayName'] = 'Last Name';
    $access['Data']['en_firstname']['DisplayName'] = 'First Name';
    $access['Data']['userId']['Input'] = "hidden";
    $access['Data']['userId']['disable'] = 1;
    $access['Data']['en_ID']['Input'] = "hidden";
    $access['Data']['en_ID']['disable'] = 1;
    $access['Data']['Time_Zone']['Input_Custom'] = $etel_timezone;
    $access['Data']['Time_Zone']['Input'] = 'selectcustomarray';
    $access['Data']['Time_Zone']['DisplayName'] = 'Your Time Zone';
    $access['Data']['Time_Zone']['Style'] = 'width:205px;';
    $access['Data']['Personal_Country']['Input'] = 'selectcustom';
    $access['Data']['Personal_Country']['Style'] = 'width:205px;';
    $access['Data']['Personal_Country']['Input_Custom'] = "Select co_ISO,co_full From cs_country";
    $access['Data']['Personal_State']['DisplayName'] = 'State or Province';
    $access['Data']['Personal_State']['req'] = false;
    $access['Data']['Personal_State']['Input'] = 'selectcustom';
    $access['Data']['Personal_State']['Style'] = 'width:205px;';
    $access['Data']['Personal_State']['Input_Custom'] = "Select st_abbrev,st_full From cs_states";
    $access['SubmitValue'] = 'Update Information';
    if ($skipIfComplete) {
        $access['SubmitValue'] = 'Continue to Step 2';
    }
    $access['SubmitName'] = 'submit_step1';
    // Submit
    $showvalidation = false;
    if ($_POST[$access['SubmitName']]) {
        $result = processAccessForm(&$access);
        $showvalidation = true;
    }
    $access['Columns'] = 1;
    // Validate
    $valid = true;
    foreach ($access['Data'] as $key => $data) {
        if (!$data['Value'] && $data['Valid']) {
            $valid = false;
            if ($showvalidation) {
                $access['Data'][$key]['Highlight'] = true;
            }
        }
    }
    if (!$valid || !$skipIfComplete) {
        draw_step_buttons(1, $skipIfComplete);
        $access['HeaderMessage'] .= "Please Complete all required fields to continue.";
        beginTable();
        writeAccessForm(&$access);
        endTable("Step #1 - Personal Information", "");
        include "includes/footer.php";
        die;
    }
}
Beispiel #3
0
function add_new_merchant($companyInfo, $sendmail = true, $getmail = false)
{
    $returnInfo = array('status' => true, 'msg' => 'Company Created Successfully');
    //foreach($companyInfo as $key=>$data)
    //	$companyInfo[$key] = quote_smart($data);
    $res = check_merchant_conflict($companyInfo);
    if (!$res['status']) {
        return $res;
    }
    if ($res['res']['ref']) {
        $companyInfo['en_ref'] = substr(strtoupper(md5(time() + rand(1, 1000000))), 0, 8);
    }
    $qry_insert_user = "******";
    $qry_insert_user .= " values('" . $companyInfo['en_username'] . "','" . $companyInfo['en_password'] . "','" . $companyInfo['en_company'] . "','" . $companyInfo['en_ref'] . "','" . $companyInfo['en_email'] . "','" . $companyInfo['volumenumber'] . "',0,'" . $companyInfo['transaction_type'] . "','" . $companyInfo['how_about_us'] . "',NOW(),'" . $companyInfo['phonenumber'] . "','" . $companyInfo['contact_phone'] . "','" . $companyInfo['cd_contact_im'] . "','" . $companyInfo['en_gateway_ID'] . "','" . $companyInfo['url1'] . "','" . $companyInfo['cd_timezone'] . "')";
    $show_sql = sql_query_write($qry_insert_user) or dieLog(mysql_error() . " ~ {$str_qry}");
    $is_success = 0;
    $user_id = mysql_insert_id();
    $user_reference_num = func_User_Ref_No($user_id);
    $is_success = func_update_single_field('cs_companydetails', 'ReferenceNumber', $user_reference_num, false, 'userId', $user_id);
    $sql = "Insert into cs_entities\r\n\t\t\tset \r\n\t\t\t\ten_username = '******'en_username'] . "',\r\n\t\t\t\ten_password = MD5('" . ($companyInfo['en_username'] . $companyInfo['en_password']) . "'),\r\n\t\t\t\ten_ref = '" . $companyInfo['en_ref'] . "',\r\n\t\t\t\ten_email = '" . $companyInfo['en_email'] . "',\r\n\t\t\t\ten_company = '" . $companyInfo['en_company'] . "',\r\n\t\t\t\ten_gateway_ID = '" . $companyInfo['en_gateway_ID'] . "',\r\n\t\t\t\ten_signup = NOW(),\r\n\t\t\t\ten_type = 'merchant',\r\n\t\t\t\ten_type_id = '" . quote_smart($user_id) . "'\r\n\t\t\t";
    sql_query_write($sql) or dieLog(mysql_error() . " ~ {$str_qry}");
    $en_ID = mysql_insert_id();
    $returnInfo['en_ID'] = $en_ID;
    $sql = "insert into cs_company_banks set cb_en_ID = '{$en_ID}',bank_id=0;";
    $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ {$sql}");
    $cb_ID = mysql_insert_id();
    if ($companyInfo['etel_reseller_ref']) {
        $sql = "SELECT \r\n\t\t\t\ten_ID,en_info from cs_entities where\r\n\t\t\t\ten_ref = '" . $companyInfo['etel_reseller_ref'] . "'";
        $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
        $resellerInfo = mysql_fetch_assoc($result);
        $resellerInfo['en_info'] = etel_unserialize($resellerInfo['en_info']);
        $returnInfo['ea_affiliate_ID'] = $resellerInfo['en_ID'];
        set_affiliate($en_ID, $resellerInfo['en_ID'], 'Reseller', array('Disc_Markup' => $resellerInfo['en_info']['Reseller']['Default_Disc_Markup'], 'Trans_Markup' => $resellerInfo['en_info']['Reseller']['Default_Trans_Markup']));
    }
    if ($companyInfo['etel_affiliate_ref']) {
        $sql = "SELECT \r\n\t\t\t\ten_ID from cs_entities where\r\n\t\t\t\ten_ref = '" . $companyInfo['etel_affiliate_ref'] . "'";
        $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
        $affiliateMerchantInfo = mysql_fetch_assoc($result);
        set_affiliate($affiliateMerchantInfo['en_ID'], $en_ID, 'Affiliate', array('Disc_Markup' => $companyInfo['discount_markup'], 'Trans_Markup' => $companyInfo['transaction_markup']));
    }
    if ($sendmail || $getmail) {
        $emailData["email"] = $companyInfo['en_email'];
        $emailData["full_name"] = "Merchant";
        $emailData["companyname"] = $companyInfo['en_company'];
        $emailData["username"] = $companyInfo['en_username'];
        $emailData["password"] = $companyInfo['en_password'];
        $emailData["Reference_ID"] = $companyInfo['en_ref'];
        $emailData["gateway_select"] = $companyInfo['en_gateway_ID'];
        $emailData['tmpl_custom_id'] = $companyInfo['en_gateway_ID'];
        $letterTempate = 'merchant_welcome_letter';
    }
    if ($sendmail) {
        send_email_template($letterTempate, $emailData);
    }
    if ($getmail) {
        $returnInfo['email_info'] = get_email_template($letterTempate, $emailData);
    }
    return $returnInfo;
}