function registration_form()
{
    global $conf_this_server_country_code;
    global $conf_skin;
    global $pro_mysql_product_table;
    global $pro_mysql_vps_ip_table;
    global $pro_mysql_vps_server_table;
    global $conf_selling_conditions_url;
    global $secpayconf_currency_symbol;
    global $conf_main_domain;
    global $conf_provide_own_domain_hosts;
    get_secpay_conf();
    if (isset($_REQUEST["product_id"]) && isRandomNum($_REQUEST["product_id"])) {
        $q = "SELECT * FROM {$pro_mysql_product_table} WHERE id='" . $_REQUEST["product_id"] . "';";
        $r = mysql_query($q) or die("Cannot execute query \"{$q}\" ! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
        $n = mysql_num_rows($r);
        if ($n != 1) {
            die("Product ID not found here line " . __LINE__ . " file " . __FILE__);
        }
        $a = mysql_fetch_array($r);
        $heb_type_condition = " heb_type='" . $a["heb_type"] . "' ";
        $heb_type = $a["heb_type"];
    } else {
        $heb_type_condition = " 1 ";
        $heb_type = "all";
    }
    $prod_popup = "";
    $p_jscript = " prod_popup_htype = new Array();";
    $q = "SELECT * FROM {$pro_mysql_product_table} WHERE {$heb_type_condition} AND renew_prod_id='0' AND private='no' ORDER BY id";
    $r = mysql_query($q) or die("Cannot execute query \"{$q}\" ! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
    $n = mysql_num_rows($r);
    $prod_popup .= "<option value=\"-1\">" . _("Please select!") . "</optioon>";
    for ($i = 0; $i < $n; $i++) {
        $a = mysql_fetch_array($r);
        $p_jscript .= " prod_popup_htype[" . $a["id"] . "] = '" . $a["heb_type"] . "';\n";
        if (isset($_REQUEST["product_id"]) && $a["id"] == $_REQUEST["product_id"]) {
            $prod_popup .= "<option value=\"" . $a["id"] . "\" selected>" . $a["name"] . " / " . $a["price_dollar"] . "{$secpayconf_currency_symbol}</option>\n";
        } else {
            $prod_popup .= "<option value=\"" . $a["id"] . "\">" . $a["name"] . " / " . $a["price_dollar"] . "{$secpayconf_currency_symbol}</option>\n";
        }
    }
    $prod_popup = "<select onChange=\"hostingProductChanged();\" name=\"product_id\">" . $prod_popup . "</select>";
    /*	$q = "SELECT $pro_mysql_vps_server_table.hostname,$pro_mysql_vps_server_table.location
    	FROM $pro_mysql_vps_ip_table,$pro_mysql_vps_server_table
    	WHERE $pro_mysql_vps_ip_table.vps_server_hostname=$pro_mysql_vps_server_table.hostname
    	AND $pro_mysql_vps_ip_table.available='yes'
    	GROUP BY $pro_mysql_vps_server_table.location;";
    	$r = mysql_query($q)or die("Cannot execute query \"$q\" ! line: ".__LINE__." file: ".__FILE__." sql said: ".mysql_error());
    	$n = mysql_num_rows($r);
    	$vps_location_popup = "<option value=\"-1\">Please select!</optioon>";
    	for($i=0;$i<$n;$i++){
    		$a = mysql_fetch_array($r);
    		if(isset($_REQUEST["vps_server_hostname"]) && $_REQUEST["vps_server_hostname"] == $a["hostname"]){
    			$selected = " selected ";
    		}else{
    			$selected = "";
    		}
    		$vps_location_popup .= "<option value=\"".$a["hostname"]."\" $selected>".$a["location"]."</optioon>";
    	}*/
    $vps_location_popup = vpsLocationSelector();
    if (isset($_REQUEST["reqadm_login"])) {
        $frm_login = htmlspecialchars($_REQUEST["reqadm_login"]);
    } else {
        $frm_login = "";
    }
    if (isset($_REQUEST["domain_name"])) {
        $frm_domain_name = htmlspecialchars($_REQUEST["domain_name"]);
    } else {
        $frm_domain_name = "";
    }
    if (isset($_REQUEST["domain_tld"])) {
        $frm_domain_tld = htmlspecialchars($_REQUEST["domain_tld"]);
    } else {
        $frm_domain_tld = "";
    }
    if (isset($_REQUEST["firstname"])) {
        $frm_firstname = htmlspecialchars($_REQUEST["firstname"]);
    } else {
        $frm_firstname = "";
    }
    if (isset($_REQUEST["familyname"])) {
        $frm_family_name = htmlspecialchars($_REQUEST["familyname"]);
    } else {
        $frm_family_name = "";
    }
    if (isset($_REQUEST["compname"])) {
        $frm_compname = htmlspecialchars($_REQUEST["compname"]);
    } else {
        $frm_compname = "";
    }
    if (isset($_REQUEST["vat_num"])) {
        $frm_vat_num = htmlspecialchars($_REQUEST["vat_num"]);
    } else {
        $frm_vat_num = "";
    }
    if (isset($_REQUEST["email"])) {
        $frm_email = htmlspecialchars($_REQUEST["email"]);
    } else {
        $frm_email = "";
    }
    if (isset($_REQUEST["phone"])) {
        $frm_phone = htmlspecialchars($_REQUEST["phone"]);
    } else {
        $frm_phone = "";
    }
    if (isset($_REQUEST["fax"])) {
        $frm_fax = htmlspecialchars($_REQUEST["fax"]);
    } else {
        $frm_fax = "";
    }
    if (isset($_REQUEST["address1"])) {
        $frm_addr1 = htmlspecialchars($_REQUEST["address1"]);
    } else {
        $frm_addr1 = "";
    }
    if (isset($_REQUEST["address2"])) {
        $frm_addr2 = htmlspecialchars($_REQUEST["address2"]);
    } else {
        $frm_addr2 = "";
    }
    if (isset($_REQUEST["address3"])) {
        $frm_addr3 = htmlspecialchars($_REQUEST["address3"]);
    } else {
        $frm_addr3 = "";
    }
    if (isset($_REQUEST["zipcode"])) {
        $frm_zipcode = htmlspecialchars($_REQUEST["zipcode"]);
    } else {
        $frm_zipcode = "";
    }
    if (isset($_REQUEST["city"])) {
        $frm_city = htmlspecialchars($_REQUEST["city"]);
    } else {
        $frm_city = "";
    }
    if (isset($_REQUEST["state"])) {
        $frm_state = htmlspecialchars($_REQUEST["state"]);
    } else {
        $frm_state = "";
    }
    if (isset($_REQUEST["country"])) {
        $frm_country = htmlspecialchars($_REQUEST["country"]);
    } else {
        $frm_country = "";
    }
    if (isset($_REQUEST["custom_notes"])) {
        $frm_custom_notes = htmlspecialchars($_REQUEST["custom_notes"]);
    } else {
        $frm_custom_notes = "";
    }
    if ($heb_type == "all" || $heb_type == "shared" || $heb_type == "ssl") {
        $domname_hidden = " style=\"white-space:nowrap;\" ";
    } else {
        $domname_hidden = " style=\"display:none;visibility:hidden;white-space:nowrap;\" ";
    }
    if ($heb_type == "all" || $heb_type == "vps") {
        $vps_hidden = " ";
    } else {
        $vps_hidden = " style=\"display:none;visibility:hidden;\" ";
    }
    $debian_selected = " ";
    $debiandtc_selected = " ";
    $centos_selected = " ";
    $gentoo_selected = " ";
    $netbsd_selected = " ";
    if (isset($_REQUEST["vps_os"]) && $_REQUEST["vps_os"] == "debian") {
        $debian_selected = " selected ";
    }
    if (isset($_REQUEST["vps_os"]) && $_REQUEST["vps_os"] == "debian-dtc") {
        $debiandtc_selected = " selected ";
    }
    if (isset($_REQUEST["vps_os"]) && $_REQUEST["vps_os"] == "centos") {
        $centos_selected = " selected ";
    }
    if (isset($_REQUEST["vps_os"]) && $_REQUEST["vps_os"] == "netbsd") {
        $netbsd_selected = " selected ";
    }
    $tld_popup = "";
    if ($conf_provide_own_domain_hosts == "yes") {
        $tld_popup = "<option value=\".{$conf_main_domain}\">.{$conf_main_domain}</option>";
    }
    $tld_popup .= domainNamePopup($frm_domain_tld);
    $rek = "<font color=\"red\">*</font>";
    $prod_popup = "<table>\n<tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Product") . ": </td><td>" . $prod_popup . "</td>\n</td><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\"><div name=\"domname_text\" id=\"domname_text\" {$domname_hidden}>" . _("Desired domain name") . ":</div></td>\n\t<td><div name=\"domname_field\" id=\"domname_field\" {$domname_hidden}>www.<input type=\"text\" name=\"domain_name\" value=\"{$frm_domain_name}\"><select name=\"domain_tld\">" . $tld_popup . "</select></div></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\"><div name=\"vps_popup_text\" id=\"vps_popup_text\" {$vps_hidden}>" . _("VPS location: ") . "</div></td>\n\t<td><div name=\"vps_popup_field\" id=\"vps_popup_field\" {$vps_hidden}><select name=\"vps_server_hostname\">{$vps_location_popup}</select></div></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\"><div name=\"vps_ospopup_text\" id=\"vps_ospopup_text\" {$vps_hidden}></div></td>\n\t<td><div name=\"vps_ospopup_field\" id=\"vps_ospopup_field\" {$vps_hidden}><select name=\"vps_os\">\n\t\t<option value=\"debian\" {$debian_selected}>Debian (" . _("network install with debootstrap") . ")</option>\n\t\t<option value=\"debian-dtc\" {$debiandtc_selected}>Debian with DTC panel (" . _("network install with debootstrap") . ")</option>\n\t\t<option value=\"centos\" {$centos_selected}>CentOS (" . _("network install with yum") . ")</option>\n\t\t<option value=\"netbsd\" {$netbsd_selected}>NetBSD (" . _("network setup with install kernel") . ")</option></select></div></td>\n</tr></table>";
    $login_info = "<table>\n<tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Login: "******"</td>\n\t<td><input type=\"text\" name=\"reqadm_login\" value=\"{$frm_login}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Password: "******"</td>\n\t<td><input type=\"password\" name=\"reqadm_pass\" value=\"\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Confirm pass: "******"</td>\n\t<td><input type=\"password\" name=\"reqadm_pass2\" value=\"\"></td>\n</tr></table>";
    #	$login_skined = skin("frame",$login_info,"");
    $login_skined = $login_info;
    $compyes = "";
    $compno = "";
    if (isset($_REQUEST["iscomp"]) && $_REQUEST["iscomp"] == "yes") {
        $compyes = "checked";
    } else {
        if (isset($_REQUEST["iscomp"]) && $_REQUEST["iscomp"] == "no") {
            $compno = " checked";
        }
    }
    $client_info = "<table>\n<tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Familly name: ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"familyname\" value=\"{$frm_family_name}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("First name: ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"firstname\" value=\"{$frm_firstname}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Is it a company: ") . $rek . "</td>\n\t<td><input type=\"radio\" name=\"iscomp\" value=\"yes\"{$compyes}>" . _("Yes") . "\n<input type=\"radio\" name=\"iscomp\" value=\"no\"{$compno}>" . _("No") . "</td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Company name: ") . "</td>\n\t<td><input type=\"text\" name=\"compname\" value=\"{$frm_compname}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("VAT/GST Number: ") . "</td>\n\t<td><input type=\"text\" name=\"vat_num\" value=\"{$frm_vat_num}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Email: ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"email\" value=\"{$frm_email}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Phone number: ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"phone\" value=\"{$frm_phone}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Fax: ") . "</td>\n\t<td><input type=\"text\" name=\"fax\" value=\"{$frm_fax}\"></td>\n</tr></table>";
    $client_skined = $client_info;
    if ($frm_country == "" && !isset($db_product) || $frm_country == "" && $db_product["heb_type"] == "shared") {
        $frm_country = $conf_this_server_country_code;
    }
    $client_addr = "<table>\n<tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Address (line1): ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"address1\" value=\"{$frm_addr1}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Address (line2): ") . "</td>\n\t<td><input type=\"text\" name=\"address2\" value=\"{$frm_addr2}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Address (line3): ") . "</td>\n\t<td><input type=\"text\" name=\"address3\" value=\"{$frm_addr3}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Zipcode: ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"zipcode\" value=\"{$frm_zipcode}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("City: ") . $rek . "</td>\n\t<td><input type=\"text\" name=\"city\" value=\"{$frm_city}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("State: ") . "</td>\n\t<td><input type=\"text\" name=\"state\" value=\"{$frm_state}\"></td>\n</tr><tr>\n\t<td style=\"white-space: nowrap;text-align: right;\">" . _("Country: ") . $rek . "</td>\n\t<td><select name=\"country\">" . cc_code_popup($frm_country) . "</select></td>\n</tr></table>";
    #	$addr_skined = skin("frame",$client_addr,"");
    $addr_skined = $client_addr;
    if ($conf_selling_conditions_url != "none") {
        $conditions = "<input type=\"checkbox\" name=\"condition\" value=\"yes\"> " . $rek . _("I agree to the") . " <a href=\"{$conf_selling_conditions_url}\">" . _("selling conditions") . "</a>";
    } else {
        $conditions = "";
    }
    $HTML_admin_edit_data = "<a href=\"/dtc\">" . _("Go to login") . "</a>\n<script language=\"javascript\">\n\n{$p_jscript}\n\nvar DHTML = (document.getElementById || document.all || document.layers);\nfunction getObj(name){\n\tif (document.getElementById){\n\t\tthis.obj = document.getElementById(name);\n\t\tthis.style = document.getElementById(name).style;\n\t}else if(document.all){\n\t\tthis.obj = document.all[name];\n\t\tthis.style = document.all[name].style;\n\t}else{\n\t\tthis.obj = document.layers[name];\n\t\tthis.style = document.layers[name];\n\t}\n}\n\nfunction hostingProductChanged(){\n\tif (!DHTML) return;\n\tif(document.newuser_form.product_id.value == -1){\n\t\treturn;\n\t}\n\thosting_type = prod_popup_htype[document.newuser_form.product_id.value];\n\tvar a = new getObj('domname_field');\n\tvar b = new getObj('domname_text');\n\tvar c = new getObj('vps_popup_field');\n\tvar d = new getObj('vps_popup_text');\n\tvar e = new getObj('vps_ospopup_text');\n\tvar f = new getObj('vps_ospopup_field');\n\tif(hosting_type == 'vps'){\n\t\ta.style.visibility = 'hidden';\n\t\ta.style.display = 'none';\n\t\tb.style.visibility = 'hidden';\n\t\tb.style.display = 'none';\n\n\t\tc.style.visibility = 'visible';\n\t\tc.style.display = 'block';\n\t\td.style.visibility = 'visible';\n\t\td.style.display = 'block';\n\t\te.style.visibility = 'visible';\n\t\te.style.display = 'block';\n\t\tf.style.visibility = 'visible';\n\t\tf.style.display = 'block';\n\t}else{\n\t\ta.style.visibility = 'visible';\n\t\ta.style.display = 'block';\n\t\tb.style.visibility = 'visible';\n\t\tb.style.display = 'block';\n\n\t\tc.style.visibility = 'hidden';\n\t\tc.style.display = 'none';\n\t\td.style.visibility = 'hidden';\n\t\td.style.display = 'none';\n\t\te.style.visibility = 'hidden';\n\t\te.style.display = 'none';\n\t\tf.style.visibility = 'hidden';\n\t\tf.style.display = 'none';\n\t}\n}\n\n</script><br>\n<br>\n<i>" . _("Feilds with a <font color=\"red\">*</font> are mandatory.") . "</i><br>\n<form name=\"newuser_form\" action=\"" . $_SERVER["PHP_SELF"] . "\" methode=\"post\">\n<input type=\"hidden\" name=\"action\" value=\"new_user_request\">\n<table>\n<tr>\n\t<td valign=\"top\"><h3>" . _("Product:") . "</h3>\n\t{$prod_popup}<br>\n<h3>" . _("Login info") . ":</h3> " . $login_skined . "</td>\n\t<td width=\"4\" background=\"gfx/border_2.gif\"></td>\n\t<td valign=\"top\"><h3>" . _("Client info") . "</h3> {$client_skined}</td>\n\t<td width=\"4\" background=\"gfx/border_2.gif\"></td>\n\t<td valign=\"top\"><h3>" . _("Customer's address") . "</h3> {$addr_skined}</td>\n</tr></table>\n{$conditions}\n<table border=\"0\">\n<tr>\n\t<td>" . _("Leave a message describing any specific requirements you might have for your account:") . "</td>\n\t<td><textarea name=\"custom_notes\" cols=\"50\" rows=\"5\">{$frm_custom_notes}</textarea></td>\n\t<td><input type=\"submit\" name=\"Login\" value=\"Register\"></td>\n</tr>\n</table>\n</form>";
    //	return $login_skined;
    return $HTML_admin_edit_data;
}
Beispiel #2
0
function DTCRMeditClients()
{
    global $pro_mysql_client_table;
    if (isset($_REQUEST["id"])) {
        $cid = $_REQUEST["id"];
        // current customer id
    } else {
        return _("Select a customer.");
    }
    $iscomp_yes = "checked";
    $iscomp_no = "";
    if ($cid != 0 && isset($cid) && $cid != "") {
        $query = "SELECT * FROM {$pro_mysql_client_table} WHERE id='" . $_REQUEST["id"] . "';";
        $result = mysql_query($query) or die("Cannot query \"{$query}\" !!!" . mysql_error());
        $num_rows = mysql_num_rows($result);
        if ($num_rows != 1) {
            return "<font color=\"red\">Error : no row by that client ID (" . $_REQUEST["id"] . ") !!!</font>";
        }
        $row = mysql_fetch_array($result);
        $hidden_inputs = "<input type=\"hidden\" name=\"action\" value=\"edit_client\">";
        if ($row["is_company"] == "no") {
            $iscomp_yes = "";
            $iscomp_no = "checked";
        }
    } else {
        $hidden_inputs = "<input type=\"hidden\" name=\"action\" value=\"new_client\">";
        unset($row);
        $row["familyname"] = "";
        $row["christname"] = "";
        $row["company_name"] = "";
        $row["vat_num"] = "";
        $row["addr1"] = "";
        $row["addr2"] = "";
        $row["addr3"] = "";
        $row["city"] = "";
        $row["zipcode"] = "";
        $row["state"] = "";
        $row["country"] = "us";
        $row["phone"] = "+";
        $row["fax"] = "";
        $row["email"] = "";
        $row["special_note"] = "";
        $row["dollar"] = "";
        $row["disk_quota_mb"] = "80";
        $row["bw_quota_per_month_gb"] = "1";
    }
    if (isset($row["special_note"])) {
        $specnot = $row["special_note"];
    } else {
        $specnot = "";
    }
    $text = "<form action=\"" . $_SERVER["PHP_SELF"] . "\">\n<input type=\"hidden\" name=\"rub\" value=\"crm\">\n<input type=\"hidden\" name=\"id\" value=\"{$cid}\">{$hidden_inputs}\n";
    $text .= dtcFormTableAttrs();
    $text .= dtcFormLineDraw(_("Familly name: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_familyname\"value=\"" . stripcslashes($row["familyname"]) . "\">");
    $text .= dtcFormLineDraw(_("First name: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_christname\" value=\"" . stripcslashes($row["christname"]) . "\">", 0);
    $text .= dtcFormLineDraw(_("Is it a company: "), "<input type=\"radio\" name=\"ed_is_company\" value=\"yes\" {$iscomp_yes} > " . _("Yes") . "\n<input type=\"radio\" name=\"ed_is_company\" value=\"no\" {$iscomp_no} > " . _("No"));
    $text .= dtcFormLineDraw(_("Company name: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_company_name\" value=\"" . stripcslashes($row["company_name"]) . "\">", 0);
    $text .= dtcFormLineDraw(_("VAT number: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_vat_num\" value=\"" . stripcslashes($row["vat_num"]) . "\">");
    $text .= dtcFormLineDraw(_("Address (line1): "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_addr1\" value=\"" . stripcslashes($row["addr1"]) . "\">", 0);
    $text .= dtcFormLineDraw(_("Address (line2): "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_addr2\" value=\"" . stripcslashes($row["addr2"]) . "\">");
    $text .= dtcFormLineDraw(_("Address (line3): "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_addr3\" value=\"" . stripcslashes($row["addr3"]) . "\">", 0);
    $text .= dtcFormLineDraw(_("City: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_city\" value=\"" . stripcslashes($row["city"]) . "\">");
    $text .= dtcFormLineDraw(_("Zipcode: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_zipcode\" value=\"" . stripcslashes($row["zipcode"]) . "\">", 0);
    $text .= dtcFormLineDraw(_("State: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_state\" value=\"" . stripcslashes($row["state"]) . "\">");
    $text .= dtcFormLineDraw(_("Country: "), "<select class=\"dtcDatagrid_input_alt_color\" name=\"ed_country\">" . cc_code_popup($row["country"]) . "</select>", 0);
    $text .= dtcFormLineDraw(_("Phone number: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_phone\" value=\"" . stripcslashes($row["phone"]) . "\">");
    $text .= dtcFormLineDraw(_("Fax: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_fax\" value=\"" . stripcslashes($row["fax"]) . "\">", 0);
    $text .= dtcFormLineDraw(_("Email: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_email\" value=\"" . $row["email"] . "\">");
    $text .= dtcFormLineDraw(_("Notes: "), "<textarea class=\"dtcDatagrid_input_alt_color\" cols=\"40\" rows=\"5\" name=\"ed_special_note\">" . stripcslashes($specnot) . "</textarea>", 0);
    $text .= dtcFormLineDraw(_("Money remaining: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_dollar\" value=\"" . $row["dollar"] . "\">");
    $text .= dtcFormLineDraw(_("Quota (MB): "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"ed_disk_quota_mb\" value=\"" . $row["disk_quota_mb"] . "\">", 0);
    $text .= dtcFormLineDraw(_("Allowed data transfer (GB): "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"ed_bw_quota_per_month_gb\" value=\"" . $row["bw_quota_per_month_gb"] . "\">");
    $text .= "\n<tr><td align=\"right\"></td><td><div class=\"input_btn_container\" onMouseOver=\"this.className='input_btn_container-hover';\" onMouseOut=\"this.className='input_btn_container';\">\n <div class=\"input_btn_left\"></div>\n <div class=\"input_btn_mid\"><input class=\"input_btn\" type=\"submit\" value=\"Save\"></div>\n <div class=\"input_btn_right\"></div>\n</div></form>\n<form><form action=\"" . $_SERVER["PHP_SELF"] . "\">\n<input type=\"hidden\" name=\"rub\" value=\"crm\">\n<input type=\"hidden\" name=\"delete_id\" value=\"{$cid}\">\n<input type=\"hidden\" name=\"action\" value=\"delete_customer_id\">\n<input type=\"hidden\" name=\"del\" value=\"Del\">\n<div class=\"input_btn_container\" onMouseOver=\"this.className='input_btn_container-hover';\" onMouseOut=\"this.className='input_btn_container';\">\n <div class=\"input_btn_left\"></div>\n <div class=\"input_btn_mid\"><input class=\"input_btn\" type=\"submit\" value=\"" . _("Delete client") . "\"></div>\n <div class=\"input_btn_right\"></div>\n</div></td></tr>\n</table>\n</form>";
    return $text;
}
 $text .= dtcFormLineDraw(_("VPS OS: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"vps_os\" value=\"" . stripcslashes($b["vps_os"]) . "\">");
 $text .= dtcFormLineDraw(_("Login: "******"<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"reqadm_login\" value=\"" . stripcslashes($b["reqadm_login"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("Password: "******"<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"reqadm_pass\" value=\"" . stripcslashes($b["reqadm_pass"]) . "\">");
 $text .= dtcFormLineDraw(_("Domain Name: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"domain_name\" value=\"" . $b["domain_name"] . "\">", 0);
 $text .= dtcFormLineDraw(_("Familly name: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"family_name\"value=\"" . stripcslashes($b["family_name"]) . "\">");
 $text .= dtcFormLineDraw(_("First name: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"first_name\" value=\"" . stripcslashes($b["first_name"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("Is it a company: "), "<input type=\"radio\" name=\"iscomp\" value=\"yes\" {$iscomp_yes} > " . _("Yes") . "\n<input type=\"radio\" name=\"iscomp\" value=\"no\" {$iscomp_no} > " . _("No"));
 $text .= dtcFormLineDraw(_("Company name: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"comp_name\" value=\"" . stripcslashes($b["comp_name"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("VAT number: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"vat_num\" value=\"" . stripcslashes($b["vat_num"]) . "\">");
 $text .= dtcFormLineDraw(_("Address (line1): "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"addr1\" value=\"" . stripcslashes($b["addr1"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("Address (line2): "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"addr2\" value=\"" . stripcslashes($b["addr2"]) . "\">");
 $text .= dtcFormLineDraw(_("Address (line3): "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"addr3\" value=\"" . stripcslashes($b["addr3"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("City: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"city\" value=\"" . stripcslashes($b["city"]) . "\">");
 $text .= dtcFormLineDraw(_("Zipcode: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"zipcode\" value=\"" . stripcslashes($b["zipcode"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("State: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"state\" value=\"" . stripcslashes($b["state"]) . "\">");
 $text .= dtcFormLineDraw(_("Country: "), "<select class=\"dtcDatagrid_input_alt_color\" name=\"country\">" . cc_code_popup($b["country"]) . "</select>", 0);
 $text .= dtcFormLineDraw(_("Phone number: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"phone\" value=\"" . stripcslashes($b["phone"]) . "\">");
 $text .= dtcFormLineDraw(_("Fax: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"fax\" value=\"" . stripcslashes($b["fax"]) . "\">", 0);
 $text .= dtcFormLineDraw(_("Email: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"email\" value=\"" . $b["email"] . "\">");
 $text .= dtcFormLineDraw(_("Notes: "), "<textarea class=\"dtcDatagrid_input_alt_color\" cols=\"40\" rows=\"5\" name=\"custom_notes\">" . stripcslashes($b["custom_notes"]) . "</textarea>", 0);
 $text .= "<input type=\"hidden\" name=\"paiement_id\" value=\"" . $b["paiement_id"] . "\">";
 if ($has_payement == 1) {
     $text .= "<input type=\"hidden\" name=\"secpay_site\" value=\"" . $p["secpay_site"] . "\">";
     $text .= dtcFormLineDraw(_("Payment type: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"paiement_type\" value=\"" . $p["paiement_type"] . "\">");
     $text .= dtcFormLineDraw(_("Payment validated: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"valid\" value=\"" . $p["valid"] . "\">", 0);
     $text .= dtcFormLineDraw(_("Payment site: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"secpay_site\" value=\"" . $p["secpay_site"] . "\">");
     $text .= dtcFormLineDraw(_("Refund amount: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"refund_amount\" value=\"" . $p["refund_amount"] . "\">", 0);
     $text .= dtcFormLineDraw(_("Paiement cost: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"paiement_cost\" value=\"" . $p["paiement_cost"] . "\">");
     $text .= dtcFormLineDraw(_("Paiement total: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"paiement_total\" value=\"" . $p["paiement_total"] . "\">", 0);
     $text .= dtcFormLineDraw(_("Vat rate: "), "<input class=\"dtcDatagrid_input_color\" size=\"40\" type=\"text\" name=\"vat_rate\" value=\"" . $p["vat_rate"] . "\">");
     $text .= dtcFormLineDraw(_("Vat total: "), "<input class=\"dtcDatagrid_input_alt_color\" size=\"40\" type=\"text\" name=\"vat_total\" value=\"" . $p["vat_total"] . "\">", 0);
Beispiel #4
0
<?php

// List of all contries member of the European Union (used for VAT billing)
$cc_europe = array("AT" => 1, "BE" => 1, "BG" => 1, "CY" => 1, "CZ" => 1, "DK" => 1, "EE" => 1, "FI" => 1, "FR" => 1, "DE" => 1, "GR" => 1, "HU" => 1, "IE" => 1, "IT" => 1, "LV" => 1, "LT" => 1, "LU" => 1, "MT" => 1, "NL" => 1, "PL" => 1, "PT" => 1, "SK" => 1, "SI" => 1, "ES" => 1, "SE" => 1, "UK" => 1);
// This table sets the VAT for known countries (taken from http://en.wikipedia.org/wiki/Value_added_tax)
// If you know things that are not accurate (like a different rate for internet services)
// please get in touch (send a mail to thomas@goirand.fr)
$cc_code_vat = array("AR" => 21, "AU" => 10, "AT" => 20, "BE" => 21, "BA" => 17, "BG" => 20, "CA" => 6, "CL" => 19, "CN" => 17, "HR" => 22, "CY" => 15, "CZ" => 19, "DK" => 25, "DO" => 6, "EC" => 12, "SV" => 13, "EE" => 18, "FI" => 22, "FR" => 19.6, "GR" => 19, "GY" => 16, "HU" => 20, "IS" => 24.5, "IN" => 12.5, "IE" => 20, "IL" => 15.5, "IT" => 20, "JP" => 5, "KZ" => 14, "KR" => 10, "LV" => 18, "LB" => 10, "LT" => 18, "LU" => 15, "MO" => 17, "MK" => 18, "MY" => 5, "MT" => 18, "MX" => 15, "MD" => 20, "NL" => 19, "NZ" => 12.5, "NO" => 25, "PY" => 10, "PE" => 19, "PH" => 12, "PL" => 22, "PT" => 21, "RO" => 19, "RU" => 18, "RS" => 18, "SG" => 5, "SK" => 19, "SI" => 20, "ZA" => 14, "ES" => 16, "LK" => 15, "SE" => 25, "CH" => 7.6, "TH" => 7, "TR" => 18, "UA" => 20, "UK" => 17.5, "VE" => 16);
$cc_code_array = array("AF" => _("Afghanistan"), "AL" => _("Albania"), "DZ" => _("Algeria"), "AS" => _("American Samoa"), "AD" => _("Andorra"), "AO" => _("Angola"), "AI" => _("Anguilla"), "AQ" => _("Antarctica"), "AG" => _("Antigua And Barbuda"), "AR" => _("Argentina"), "AM" => _("Armenia"), "AW" => _("Aruba"), "AU" => _("Australia"), "AT" => _("Austria"), "AZ" => _("Azerbaijan"), "AC" => _("Ascension Island"), "BS" => _("Bahamas"), "BH" => _("Bahrain"), "BD" => _("Bangladesh"), "BB" => _("Barbados"), "BY" => _("Belarus"), "BE" => _("Belgium"), "BZ" => _("Belize"), "BJ" => _("Benin"), "BM" => _("Bermuda"), "BT" => _("Bhutan"), "BO" => _("Bolivia"), "BA" => _("Bosnia Hercegovina"), "BW" => _("Botswana"), "BV" => _("Bouvet Island"), "BR" => _("Brazil"), "IO" => _("British Indian Ocean Territory"), "BN" => _("Brunei Darussalam"), "BG" => _("Bulgaria"), "BF" => _("Burkina Faso"), "BI" => _("Burundi"), "KH" => _("Cambodia"), "CM" => _("Cameroon"), "CA" => _("Canada"), "CV" => _("Cape Verde"), "KY" => _("Cayman Islands"), "CF" => _("Central African Republic"), "TD" => _("Chad"), "CL" => _("Chile"), "CN" => _("China"), "CX" => _("Christmas Island"), "CC" => _("Cocos (Keeling) Islands"), "CO" => _("Colombia"), "KM" => _("Comoros"), "CG" => _("Congo"), "CK" => _("Cook Islands"), "CR" => _("Costa Rica"), "HR" => _("Croatia"), "CU" => _("Cuba"), "CY" => _("Cyprus"), "CZ" => _("Czech Republic"), "CS" => _("Czechoslovakia"), "DK" => _("Denmark"), "DJ" => _("Djibouti"), "DM" => _("Dominica"), "DO" => _("Dominican Republic"), "TP" => _("East Timor"), "EC" => _("Ecuador"), "EG" => _("Egypt"), "SV" => _("El Salvador"), "GQ" => _("Equatorial Guinea"), "ER" => _("Eritrea"), "EE" => _("Estonia"), "ET" => _("Ethiopia"), "FK" => _("Falkland Islands (Malvinas)"), "FO" => _("Faroe Islands"), "FJ" => _("Fiji"), "FI" => _("Finland"), "CS" => _("Former Czechoslovakia"), "su" => _("Former USSR"), "FR" => _("France"), "FX" => _("France (European Territories)"), "GF" => _("French Guiana"), "PF" => _("French Polynesia"), "TF" => _("French Southern Territories"), "GA" => _("Gabon"), "GM" => _("Gambia"), "GE" => _("Georgia"), "DE" => _("Germany"), "GH" => _("Ghana"), "GI" => _("Gibraltar"), "GB" => _("Great Britain"), "GR" => _("Greece"), "GL" => _("Greenland"), "GD" => _("Grenada"), "GP" => _("Guadeloupe (French)"), "GU" => _("Guam (USA)"), "GT" => _("Guatemela"), "GW" => _("Guinea Bissau"), "GY" => _("Guyana"), "GG" => _("Guernsey"), "HT" => _("Haiti"), "HM" => _("Heard and McDonald Islands"), "HN" => _("Honduras"), "HK" => _("Hong Kong"), "HU" => _("Hungary"), "IS" => _("Iceland"), "IN" => _("India"), "ID" => _("Indonesia"), "IR" => _("Iran (Islamic Republic Of)"), "IQ" => _("Iraq"), "IE" => _("Ireland"), "IM" => _("Isle Of Man"), "IL" => _("Israel"), "IT" => _("Italy"), "CI" => _("Ivory Coast (Cote D'Ivoire)"), "JM" => _("Jamaica"), "JP" => _("Japan"), "JO" => _("Jordan"), "JF" => _("Jothan Frakes Islands"), "JE" => _("Jersey"), "KZ" => _("Kazakhstan"), "KE" => _("Kenya"), "KI" => _("Kiribati"), "KW" => _("Kuwait"), "KP" => _("Korea, Democratic People's Republic Of"), "KR" => _("Korea, Republic Of"), "KG" => _("Kyrgyzstan"), "LA" => _("Lao People's Democratic Republic"), "LV" => _("Latvia"), "LB" => _("Lebanon"), "LS" => _("Lesotho"), "LR" => _("Liberia"), "LY" => _("Libyan Arab Jamahiriya"), "LI" => _("Liechtenstein"), "LT" => _("Lithuania"), "LU" => _("Luxembourg"), "MO" => _("Macau"), "MK" => _("Macedonia"), "MG" => _("Madagascar"), "MW" => _("Malawi"), "MY" => _("Malaysia"), "MV" => _("Maldives"), "ML" => _("Mali"), "MT" => _("Malta"), "MH" => _("Marshall Islands"), "MQ" => _("Martinique (French)"), "MR" => _("Mauritania"), "MU" => _("Mauritius"), "YT" => _("Mayotte"), "MX" => _("Mexico"), "FM" => _("Micronesia, Federated States Of"), "MD" => _("Moldova, Republic Of"), "MC" => _("Monaco"), "MN" => _("Mongolia"), "MS" => _("Montserrat"), "MA" => _("Morocco"), "MZ" => _("Mozambique"), "MM" => _("Myanmar"), "NA" => _("Namibia"), "NR" => _("Nauru"), "NP" => _("Nepal"), "NL" => _("Netherlands"), "AN" => _("Netherlands Antilles"), "NT" => _("Neutral Zone"), "NC" => _("New Caledonia (French)"), "NZ" => _("New Zealand"), "NI" => _("Nicaragua"), "NE" => _("Niger"), "NG" => _("Nigeria"), "NU" => _("Niue"), "NF" => _("Norfolk Island"), "MP" => _("Northern Mariana Islands"), "NO" => _("Norway"), "OM" => _("Oman"), "PK" => _("Pakistan"), "PW" => _("Palau"), "PS" => _("Palestine"), "PA" => _("Panama"), "PG" => _("Papua New Guinea"), "PY" => _("Paraguay"), "PE" => _("Peru"), "PH" => _("Philippines"), "PN" => _("Pitcairn"), "PL" => _("Poland"), "PT" => _("Portugal"), "ZN" => _("Prince Nizam Zambri Isle"), "PR" => _("Puerto Rico"), "QA" => _("Qatar"), "RE" => _("Reunion"), "RO" => _("Romania"), "RU" => _("Russian Federation"), "RW" => _("Rwanda"), "SH" => _("Saint Helena"), "KN" => _("Saint Kitts And Nevis"), "LC" => _("Saint Lucia"), "PM" => _("Saint Pierre and Miquelon"), "VC" => _("Saint Vincent and The Grenadines"), "WS" => _("Samoa"), "SM" => _("San Marino"), "ST" => _("Sao Tome and Principe"), "SA" => _("Saudi Arabia"), "SN" => _("Senegal"), "RS" => _("Serbia"), "SC" => _("Seychelles"), "SL" => _("Sierra Leone"), "SG" => _("Singapore"), "SK" => _("Slovakia (Republic)"), "SI" => _("Slovenia"), "SB" => _("Solomon Islands"), "SO" => _("Somalia"), "ZA" => _("South Africa"), "GS" => _("South Georgia and The Sandwich Islands"), "ES" => _("Spain"), "LK" => _("Sri Lanka"), "SD" => _("Sudan"), "SR" => _("Suriname"), "SJ" => _("Svalbard and Jan Mayen Islands"), "SZ" => _("Swaziland"), "SE" => _("Sweden"), "CH" => _("Switzerland"), "SY" => _("Syrian Arab Republic"), "TJ" => _("Tadjikistan"), "TW" => _("Taiwan"), "TZ" => _("Tanzania, United Republic Of"), "TH" => _("Thailand"), "TG" => _("Togo"), "TK" => _("Tokelau"), "TO" => _("Tonga"), "TT" => _("Trinidad and Tobago"), "TN" => _("Tunisia"), "TR" => _("Turkey"), "TM" => _("Turkmenistan"), "TC" => _("Turks and Caicos Islands"), "TV" => _("Tuvalu"), "UG" => _("Uganda"), "UA" => _("Ukraine"), "AE" => _("United Arab Emirates"), "UK" => _("United Kingdom"), "US" => _("United States"), "UM" => _("United States Minor Outlying Islands"), "UY" => _("Uruguay"), "UZ" => _("Uzbekistan"), "VU" => _("Vanuatu"), "VA" => _("Vatican City State"), "VE" => _("Venezuela"), "VN" => _("Vietnam"), "VG" => _("Virgin Islands (British)"), "VI" => _("Virgin Islands (U.S.)"), "WF" => _("Wallis and Futuna Islands"), "WG" => _("West Bank and Gaza"), "EH" => _("Western Sahara"), "YE" => _("Yemen, Republic of"), "YU" => _("Yugoslavia"), "ZR" => _("Zaire"), "ZM" => _("Zambia"), "ZW" => _("Zimbabwe"));
asort($cc_code_array);
function cc_code_popup($default = "US")
{
    global $cc_code_array;
    $out = "";
    $ar_keys = array_keys($cc_code_array);
    $nbr_cc_code = sizeof($ar_keys);
    for ($i = 0; $i < $nbr_cc_code; $i++) {
        if ($default == $ar_keys[$i]) {
            $sel = " selected ";
        } else {
            $sel = "";
        }
        $out .= '<option value="' . $ar_keys[$i] . '"' . $sel . '>' . $cc_code_array[$ar_keys[$i]] . '</option>\\n';
    }
    return $out;
}
$cc_code_popup = cc_code_popup();