Skip to content

Commit

Permalink
Added some missing parts of module, specially Additional Domain Field…
Browse files Browse the repository at this point in the history
…s and admin panel
  • Loading branch information
amiri27 committed Apr 30, 2015
1 parent b220354 commit 41fcfa1
Show file tree
Hide file tree
Showing 2 changed files with 234 additions and 0 deletions.
112 changes: 112 additions & 0 deletions includes/additionaldomainfields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php
/*
--------------------------------------------------------------------
/// WHMCS DOMAIN ADDITIONAL FIELDS \\\
--------------------------------------------------------------------
This is where you can define the TLD specific fields required to
register certain TLDs. Supported variables are:
Name - key name used to reference field in modules (required)
DisplayName - name displayed in client & admin interfaces
LangVar - the language file variable to use if set
Type - field type: text, dropdown, radio, tickbox (required)
Size - the length of the text field
Default - the default value the field should take
Required - force entry - true/false
--------------------------------------------------------------------
*/

// .US

$additionaldomainfields[".us"][] = array("Name" => "Nexus Category", "LangVar" => "ustldnexuscat", "Type" => "dropdown", "Options" => "C11,C12,C21,C31,C32", "Default" => "C11",);
$additionaldomainfields[".us"][] = array("Name" => "Nexus Country", "LangVar" => "ustldnexuscountry", "Type" => "text", "Size" => "20", "Default" => "", "Required" => true,);
$additionaldomainfields[".us"][] = array("Name" => "Application Purpose", "LangVar" => "ustldapppurpose", "Type" => "dropdown", "Options" => "Business use for profit,Non-profit business,Club,Association,Religious Organization,Personal Use,Educational purposes,Government purposes", "Default" => "Business use for profit",);

// .UK

$additionaldomainfields[".co.uk"][] = array("Name" => "Legal Type", "LangVar" => "uktldlegaltype", "Type" => "dropdown", "Options" => "Individual,UK Limited Company,UK Public Limited Company,UK Partnership,UK Limited Liability Partnership,Sole Trader,UK Registered Charity,UK Entity (other),Foreign Organization,Other foreign organizations", "Default" => "Individual",);
$additionaldomainfields[".co.uk"][] = array("Name" => "Company ID Number", "LangVar" => "uktldcompanyid", "Type" => "text", "Size" => "30", "Default" => "", "Required" => false,);
$additionaldomainfields[".co.uk"][] = array("Name" => "Registrant Name", "LangVar" => "uktldregname", "Type" => "text", "Size" => "30", "Default" => "", "Required" => true,);
$additionaldomainfields[".net.uk"] = $additionaldomainfields[".co.uk"];
$additionaldomainfields[".org.uk"] = $additionaldomainfields[".co.uk"];
$additionaldomainfields[".me.uk"] = $additionaldomainfields[".co.uk"];
$additionaldomainfields[".plc.uk"] = $additionaldomainfields[".co.uk"];
$additionaldomainfields[".ltd.uk"] = $additionaldomainfields[".co.uk"];
$additionaldomainfields[".co.uk"][] = array("Name" => "WHOIS Opt-out", "LangVar" => "uktldwhoisoptout", "Type" => "tickbox",);

// .CA

$additionaldomainfields[".ca"][] = array("Name" => "Legal Type", "LangVar" => "catldlegaltype", "Type" => "dropdown", "Options" => "Corporation,Canadian Citizen,Permanent Resident of Canada,Government,Canadian Educational Institution,Canadian Unincorporated Association,Canadian Hospital,Partnership Registered in Canada,Trade-mark registered in Canada,Canadian Trade Union,Canadian Political Party,Canadian Library Archive or Museum,Trust established in Canada,Aboriginal Peoples,Legal Representative of a Canadian Citizen,Official mark registered in Canada", "Default" => "Corporation", "Description" => "Legal type of registrant contact",);
$additionaldomainfields[".ca"][] = array("Name" => "CIRA Agreement", "LangVar" => "catldciraagreement", "Type" => "tickbox", "Description" => "Tick to confirm you agree to the CIRA Registration Agreement shown below<br /><blockquote>You have read, understood and agree to the terms and conditions of the Registrant Agreement, and that CIRA may, from time to time and at its discretion, amend any or all of the terms and conditions of the Registrant Agreement, as CIRA deems appropriate, by posting a notice of the changes on the CIRA website and by sending a notice of any material changes to Registrant. You meet all the requirements of the Registrant Agreement to be a Registrant, to apply for the registration of a Domain Name Registration, and to hold and maintain a Domain Name Registration, including without limitation CIRA's Canadian Presence Requirements for Registrants, at: www.cira.ca/assets/Documents/Legal/Registrants/CPR.pdf. CIRA will collect, use and disclose your personal information, as set out in CIRA's Privacy Policy, at: www.cira.ca/assets/Documents/Legal/Registrants/privacy.pdf</blockquote>",);
$additionaldomainfields[".ca"][] = array("Name" => "WHOIS Opt-out", "LangVar" => "catldwhoisoptout", "Type" => "tickbox", "Description" => "Tick to hide your contact information in CIRA WHOIS (only available to individuals)",);

// .ES

$additionaldomainfields[".es"][] = array("Name" => "ID Form Type", "LangVar" => "estldidformtype", "Type" => "dropdown", "Options" => "Other Identification,Tax Identification Number,Tax Identification Code,Foreigner Identification Number", "Default" => "Other Identification",);
$additionaldomainfields[".es"][] = array("Name" => "ID Form Number", "LangVar" => "estldidformnum", "Type" => "text", "Size" => "30", "Default" => "", "Required" => true,);

// .SG

$additionaldomainfields[".sg"][] = array("Name" => "RCB/Singapore ID", "LangVar" => "sgtldrcbid", "Type" => "text", "Size" => "30", "Default" => "", "Required" => true,);
$additionaldomainfields[".sg"][] = array("Name" => "Registrant Type", "LangVar" => "sgtldregtype", "Type" => "dropdown", "Options" => "Individual,Organisation", "Default" => "Individual",);
$additionaldomainfields[".com.sg"] = $additionaldomainfields[".sg"];
$additionaldomainfields[".edu.sg"] = $additionaldomainfields[".sg"];
$additionaldomainfields[".net.sg"] = $additionaldomainfields[".sg"];
$additionaldomainfields[".org.sg"] = $additionaldomainfields[".sg"];
$additionaldomainfields[".per.sg"] = $additionaldomainfields[".sg"];

// .TEL

$additionaldomainfields[".tel"][] = array("Name" => "Legal Type", "LangVar" => "teltldlegaltype", "Type" => "dropdown", "Options" => "Natural Person,Legal Person", "Default" => "Natural Person",);
$additionaldomainfields[".tel"][] = array("Name" => "WHOIS Opt-out", "LangVar" => "teltldwhoisoptout", "Type" => "tickbox",);

// .IT

$additionaldomainfields[".it"][] = array("Name" => "Legal Type", "LangVar" => "ittldlegaltype", "Type" => "dropdown", "Options" => "Italian and foreign natural persons,Companies/one man companies,Freelance workers/professionals,non-profit organizations,public organizations,other subjects,non natural foreigners", "Default" => "Italian and foreign natural persons", "Description" => "Legal type of registrant",);
$additionaldomainfields[".it"][] = array("Name" => "Tax ID", "LangVar" => "ittldtaxid", "Type" => "text", "Size" => "20", "Default" => "", "Required" => true,);
$additionaldomainfields[".it"][] = array("Name" => "Publish Personal Data", "LangVar" => "ittlddata", "Type" => "tickbox",);
$additionaldomainfields[".it"][] = array("Name" => "Accept Section 3 of .IT registrar contract", "LangVar" => "ittldsec3", "Type" => "tickbox",);
$additionaldomainfields[".it"][] = array("Name" => "Accept Section 5 of .IT registrar contract", "LangVar" => "ittldsec5", "Type" => "tickbox",);
$additionaldomainfields[".it"][] = array("Name" => "Accept Section 6 of .IT registrar contract", "LangVar" => "ittldsec6", "Type" => "tickbox",);
$additionaldomainfields[".it"][] = array("Name" => "Accept Section 7 of .IT registrar contract", "LangVar" => "ittldsec7", "Type" => "tickbox",);

// .DE

$additionaldomainfields[".de"][] = array("Name" => "Tax ID", "LangVar" => "detldtaxid", "Type" => "text", "Size" => "20", "Default" => "", "Required" => true,);

// .AU

$additionaldomainfields[".com.au"][] = array("Name" => "Registrant Name", "LangVar" => "autldregname", "Type" => "text", "Size" => "20", "Default" => "", "Required" => true,);
$additionaldomainfields[".com.au"][] = array("Name" => "Registrant ID", "LangVar" => "autldregid", "Type" => "text", "Size" => "20", "Default" => "", "Required" => true,);
$additionaldomainfields[".com.au"][] = array("Name" => "Registrant ID Type", "LangVar" => "autldregidtype", "Type" => "dropdown", "Options" => "ABN,ACN,Business Registration Number", "Default" => "ABN",);
$additionaldomainfields[".com.au"][] = array("Name" => "Eligibility Name", "LangVar" => "autldeligname", "Type" => "text", "Size" => "20", "Default" => "", "Required" => false,);
$additionaldomainfields[".com.au"][] = array("Name" => "Eligibility ID", "LangVar" => "autldeligid", "Type" => "text", "Size" => "20", "Default" => "", "Required" => false,);
$additionaldomainfields[".com.au"][] = array("Name" => "Eligibility ID Type", "LangVar" => "autldeligidtype", "Type" => "dropdown", "Options" => ",Australian Company Number (ACN),ACT Business Number,NSW Business Number,NT Business Number,QLD Business Number,SA Business Number,TAS Business Number,VIC Business Number,WA Business Number,Trademark (TM),Other - Used to record an Incorporated Association number,Australian Business Number (ABN)", "Default" => "",);
$additionaldomainfields[".com.au"][] = array("Name" => "Eligibility Type", "LangVar" => "autldeligtype", "Type" => "dropdown", "Options" => "Charity,Citizen/Resident,Club,Commercial Statutory Body,Company,Incorporated Association,Industry Body,Non-profit Organisation,Other,Partnership,Pending TM Owner ,Political Party,Registered Business,Religious/Church Group,Sole Trader,Trade Union,Trademark Owner,Child Care Centre,Government School,Higher Education Institution,National Body,Non-Government School,Pre-school,Research Organisation,Training Organisation", "Default" => "Company",);
$additionaldomainfields[".com.au"][] = array("Name" => "Eligibility Reason", "LangVar" => "autldeligreason", "Type" => "radio", "Options" => "Domain name is an Exact Match Abbreviation or Acronym of your Entity or Trading Name.,Close and substantial connection between the domain name and the operations of your Entity.", "Default" => "Domain name is an Exact Match Abbreviation or Acronym of your Entity or Trading Name.",);

$additionaldomainfields[".net.au"] = $additionaldomainfields[".com.au"];
$additionaldomainfields[".org.au"] = $additionaldomainfields[".com.au"];
$additionaldomainfields[".asn.au"] = $additionaldomainfields[".com.au"];
$additionaldomainfields[".id.au"] = $additionaldomainfields[".com.au"];

// .IR
$additionaldomainfields[".ir"][] = array("Name" => "NIC Handle", "LangVar" => "NIC Handle", "Type" => "text", "Size" => "30", "Default" => "", "Required" => true);

$additionaldomainfields[".co.ir"] = $additionaldomainfields[".ir"];
$additionaldomainfields[".ac.ir"] = $additionaldomainfields[".ir"];
$additionaldomainfields[".net.ir"] = $additionaldomainfields[".ir"];
$additionaldomainfields[".org.ir"] = $additionaldomainfields[".ir"];
$additionaldomainfields[".id.ir"] = $additionaldomainfields[".ir"];
$additionaldomainfields[".sch.ir"] = $additionaldomainfields[".ir"];
$additionaldomainfields[".gov.ir"] = $additionaldomainfields[".ir"];

// .ASIA

$additionaldomainfields[".asia"][] = array("Name" => "Legal Type", "LangVar" => "asialegaltype", "Type" => "dropdown", "Options" => "naturalPerson,corporation,cooperative,partnership,government,politicalParty,society,institution", "Default" => "naturalPerson",);
$additionaldomainfields[".asia"][] = array("Name" => "Identity Form", "LangVar" => "asiaidentityform", "Type" => "dropdown", "Options" => "passport,certificate,legislation,societyRegistry,politicalPartyRegistry", "Default" => "passport",);
$additionaldomainfields[".asia"][] = array("Name" => "Identity Number", "LangVar" => "asiaidentitynumber", "Type" => "text", "Size" => "20", "Default" => "", "Required" => true,);

?>
122 changes: 122 additions & 0 deletions modules/admin/redreseller_addon/redreseller_addon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?php
if (!defined('WHMCS')) {
exit('This file cannot be accessed directly');
}

$maxRows_log = 20;
$pageNum_log = 0;

if (isset($_GET['page'])) {
$pageNum_log = $_GET['page'] - 1;
}

$startRow_log = $pageNum_log * $maxRows_log;
$query_log = 'SELECT * FROM redreseller_log ORDER BY id DESC';
$query_limit_log = sprintf('%s LIMIT %d, %d', $query_log, $startRow_log, $maxRows_log);

if (!($log = @mysql_query($query_limit_log))) {
mysql_query('CREATE TABLE IF NOT EXISTS `redreseller_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`domain` varchar(32) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
`email` varchar(32) NOT NULL,
`handle` varchar(32) NOT NULL,
`duration` varchar(8) NOT NULL,
`ns1` varchar(32) NOT NULL,
`ns2` varchar(32) NOT NULL,
`type` varchar(32) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
`result` varchar(32) NOT NULL,
`date` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM');
}

$all_log = @mysql_query($query_log);
$totalRows_log = @mysql_num_rows($all_log);
$totalPages_log = ceil($totalRows_log / $maxRows_log) - 1;
echo '
<style>
fieldset{
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
border: 4px solid #ccc;
padding: 5px;
margin: 10px 0;
direction: rtl;
font-family: Tahoma;
text-align: right;
}
fieldset *{
font-family: Tahoma;
}
fieldset legend{
padding: 5px 30px;
background-color: #ccc;
font-weight: 900;
margin-right: 14px;
}
</style>
<fieldset>
<legend>دامین های ثبت شده</legend>
';

if ($totalRows_log == 0) {
echo 'فاقد فعاليت';
return 1;
}


if (0 < $pageNum_log) {
echo '<a href="addonmodules.php?module=redreseller_addon&logs&page=' . (max(0, $pageNum_log - 1) + 1) . '">صفحه قبل</a> | ';
}

if (1 < $totalPages_log) {
for ($i = 0; $i <= $totalPages_log; $i++) {
$abc = $i + 1;
if ($pageNum_log == $i) {
echo '(' . $abc . ') ';
} else {
echo '<a href=\'addonmodules.php?module=redreseller_addon&logs&page=' . $abc . '\'>' . $abc . '</a> ';
}
}
}

if ($pageNum_log < $totalPages_log) {
echo '| <a href="addonmodules.php?module=redreseller_addon&logs&page=' . (min($totalPages_log, $pageNum_log + 1) + 1) . '">صفحه بعد</a>';
}

echo '<table width=\'70%\'>'
. '<tr>'
. '<td><b>دامین</b></td><td><b>ایمیل</b></td><td><b>نیک هندل</b></td><td><b>مدت</b></td><td><b>ns1</b></td><td><b>ns2</b></td><td><b>نوع</b></td><td><b>نتیجه</b></td><td><b>زمان</b></td>'
. '</tr>';
while ($row_log = mysql_fetch_assoc($log)) {
echo '<tr>'
. '<td style=\'border:1px solid black;\'>' . $row_log['domain'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['email'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['handle'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['duration'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['ns1'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['ns2'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['result'] . '</td><td style=\'border:1px solid black;\'>' . $row_log['type'] . '</td>'
. '<td style=\'border:1px solid black;\'>' . date('Y-m-d, G:i', $row_log['date']) . '</td>'
. '</tr>';
}

echo '</table><br />';

if (0 < $pageNum_log) {
echo '<a href="addonmodules.php?module=redreseller_addon&logs&page=' . (max(0, $pageNum_log - 1) + 1) . '">صفحه قبل</a> | ';
}

if (1 < $totalPages_log) {
for ($i = 0; $i <= $totalPages_log; $i++) {
$abc = $i + 1;
if ($pageNum_log == $i) {
echo '(' . $abc . ') ';
} else {
echo '<a href=\'addonmodules.php?module=redreseller_addon&logs&page=' . $abc . '\'>' . $abc . '</a> ';
}
}
}
if ($pageNum_log < $totalPages_log) {
echo '| <a href="addonmodules.php?module=redreseller_addon&logs&page=' . (min($totalPages_log, $pageNum_log + 1) + 1) . '">صفحه بعد</a><br /><br />';
}
return 1;
?>

0 comments on commit 41fcfa1

Please sign in to comment.