Esempio n. 1
0
 function after_processing_html($orderID)
 {
     $res = '';
     $order = ordGetOrder($orderID);
     $order_amount = roundf(PaymentModule::_convertCurrency($order['order_amount'], 0, $this->_getSettingValue('CONF_CHRONOPAY_CURCODE')));
     $currency = currGetCurrencyByID($this->_getSettingValue('CONF_CHRONOPAY_CURCODE'));
     $zone_iso2 = $order['billing_state'];
     $countries = cnGetCountries(array('offset' => 0, 'CountRowOnPage' => 1000000), $count_row);
     foreach ($countries as $country) {
         if ($country['country_name'] == $order['billing_country']) {
             $country_iso3 = $country['country_iso_3'];
             $zones = znGetZones($country['countryID']);
             foreach ($zones as $zone) {
                 if ($zone['zone_name'] == $zone_iso2) {
                     $zone_iso2 = $zone['zone_code'];
                     break;
                 }
             }
             break;
         }
     }
     $post_1 = array('product_id' => $this->_getSettingValue('CONF_CHRONOPAY_PRODUCT_ID'), 'product_name' => CONF_SHOP_NAME, 'product_price' => $order_amount, 'product_price_currency' => $currency['currency_iso_3'], 'f_name' => $order['billing_firstname'], 's_name' => $order['billing_lastname'], 'street' => $order['billing_address'], 'city' => $order['billing_city'], 'state' => $zone_iso2, 'country' => $country_iso3, 'email' => $order['customer_email'], 'cb_url' => getTransactionResultURL('success'), 'cb_type' => 'P', 'decline_url' => getTransactionResultURL('failure'));
     $hidden_fields_html = '';
     reset($post_1);
     while (list($k, $v) = each($post_1)) {
         $hidden_fields_html .= '<input type="hidden" name="' . $k . '" value="' . $v . '" />' . "\n";
     }
     $res = '
                             <form method="post" action="' . xHtmlSpecialChars($this->processing_url) . '" style="text-align:center;">
                                     ' . $hidden_fields_html . '
                                     <input type="submit" value="' . CHRONOPAY_TXT_SUBMIT . '" />
                             </form>
                             ';
     return $res;
 }
Esempio n. 2
0
 function setting_ZONE_SELECT($_CountryID, $_SettingID)
 {
     $Zones = znGetZones($_CountryID);
     $Options = array(array("title" => STR_ANY_ZONE, "value" => 0));
     if (!count($Zones) && $_CountryID) {
         setting_SELECT_BOX($Options, $_SettingID);
         return STR_ZONES_NOTDEFINED . '<input type="hidden" name="setting_' . settingGetConstNameByID($_SettingID) . '" value="0" />';
     }
     foreach ($Zones as $_Zone) {
         $Options[] = array("title" => $_Zone['zone_name'], "value" => $_Zone['zoneID']);
     }
     return setting_SELECT_BOX($Options, $_SettingID);
 }
Esempio n. 3
0
function setting_ZONE_SELECT($_CountryID, $_Params, $_SettingID = null)
{
    $Mode = '';
    if (!isset($_SettingID)) {
        $_SettingID = $_Params;
        $Mode = 'simple';
    } elseif (isset($_Params['mode'])) {
        $Mode = $_Params['mode'];
    }
    $Zones = znGetZones($_CountryID);
    $Options = array(array("title" => '-', "value" => 0));
    switch ($Mode) {
        default:
        case 'simple':
            break;
        case 'notdef':
            if (!count($Zones)) {
                return STR_ZONES_NOTDEFINED;
            }
            break;
    }
    foreach ($Zones as $_Zone) {
        $Options[] = array("title" => $_Zone['zone_name'], "value" => $_Zone['zoneID']);
    }
    return setting_SELECT_BOX($Options, $_SettingID);
}
Esempio n. 4
0
            $code = $_POST["new_zone_code"];
            $countryID = $_GET["countryID"];
            if ($name != "") {
                znAddZone($name, $code, $countryID);
            }
            // update zones list
            $data = ScanPostVariableWithId(array("zone_name", "zone_code"));
            foreach ($data as $key => $val) {
                znUpdateZone($key, $data[$key]["zone_name"], $data[$key]["zone_code"], $countryID);
            }
            Redirect(ADMIN_FILE . "?dpt=conf&sub=zones&countryID=" . $_GET["countryID"]);
        }
        //if country is not selected, select the first country from the database
        if (!isset($_GET["countryID"])) {
            $q = db_query("select countryID from " . COUNTRIES_TABLE);
            $row = db_fetch_row($q);
            Redirect(ADMIN_FILE . "?dpt=conf&sub=zones&countryID=" . $row[0]);
        }
        $callBackParam = null;
        $count_row = 0;
        $navigatorParams = null;
        $countries = cnGetCountries($callBackParam, $count_row, $navigatorParams);
        $smarty->assign("countries", $countries);
        $zones = znGetZones($_GET["countryID"]);
        $smarty->assign("zones", $zones);
        $smarty->assign("zones_count", count($zones));
        $smarty->assign("countryID", $_GET["countryID"]);
        //set sub-department template
        $smarty->assign("admin_sub_dpt", "conf_zones.tpl");
    }
}