Milliseconds are now fully supported

This commit is contained in:
Pinga 2023-11-09 00:33:02 +02:00
parent ea754362f8
commit 63aa36ff0a
13 changed files with 425 additions and 321 deletions

View file

@ -338,15 +338,15 @@ class ContactsController extends Controller
]);
}
$disclose_voice = isset($data['disclose_voice']) ? 1 : 0;
$disclose_fax = isset($data['disclose_fax']) ? 1 : 0;
$disclose_email = isset($data['disclose_email']) ? 1 : 0;
$disclose_name_int = isset($data['disclose_name_int']) ? 1 : 0;
$disclose_name_loc = isset($data['disclose_name_loc']) ? 1 : 0;
$disclose_org_int = isset($data['disclose_org_int']) ? 1 : 0;
$disclose_org_loc = isset($data['disclose_org_loc']) ? 1 : 0;
$disclose_addr_int = isset($data['disclose_addr_int']) ? 1 : 0;
$disclose_addr_loc = isset($data['disclose_addr_loc']) ? 1 : 0;
$disclose_voice = isset($data['disclose_voice']) ? 1 : 0;
$disclose_fax = isset($data['disclose_fax']) ? 1 : 0;
$disclose_email = isset($data['disclose_email']) ? 1 : 0;
$disclose_name_int = isset($data['disclose_name_int']) ? 1 : 0;
$disclose_name_loc = isset($data['disclose_name_loc']) ? 1 : 0;
$disclose_org_int = isset($data['disclose_org_int']) ? 1 : 0;
$disclose_org_loc = isset($data['disclose_org_loc']) ? 1 : 0;
$disclose_addr_int = isset($data['disclose_addr_int']) ? 1 : 0;
$disclose_addr_loc = isset($data['disclose_addr_loc']) ? 1 : 0;
if ($data['nin']) {
$nin = $data['nin'];
@ -365,6 +365,8 @@ class ContactsController extends Controller
$db->beginTransaction();
try {
$currentDateTime = new DateTime();
$crdate = $currentDateTime->format('Y-m-d H:i:s.v');
$db->insert(
'contact',
[
@ -378,7 +380,7 @@ class ContactsController extends Controller
'nin_type' => $nin_type ?? null,
'clid' => $clid,
'crid' => $clid,
'crdate' => date('Y-m-d H:i:s'),
'crdate' => $crdate,
'disclose_voice' => $disclose_voice,
'disclose_fax' => $disclose_fax,
'disclose_email' => $disclose_email

View file

@ -335,8 +335,12 @@ class DomainsController extends Controller
try {
$db->beginTransaction();
$crdate = date('Y-m-d H:i:s'); // Current timestamp
$exdate = date('Y-m-d H:i:s', strtotime("+$date_add months")); // Expiry timestamp after $date_add months
$currentDateTime = new DateTime();
$crdate = $currentDateTime->format('Y-m-d H:i:s.v'); // Current timestamp
$currentDateTime = new DateTime();
$currentDateTime->modify("+$date_add months");
$exdate = $currentDateTime->format('Y-m-d H:i:s.v'); // Expiry timestamp after $date_add months
$db->insert('domain', [
'name' => $domainName,
@ -499,11 +503,13 @@ class DomainsController extends Controller
$from = $row['crdate'];
$to = $row['exdate'];
$currentDateTime = new DateTime();
$stdate = $currentDateTime->format('Y-m-d H:i:s.v');
$db->insert(
'statement',
[
'registrar_id' => $clid,
'date' => date('Y-m-d H:i:s'),
'date' => $stdate,
'command' => 'create',
'domain_name' => $domainName,
'length_in_months' => $date_add,
@ -534,16 +540,20 @@ class DomainsController extends Controller
]
);
} else {
$currentDateTime = new DateTime();
$logdate = $currentDateTime->format('Y-m-d H:i:s.v');
$db->insert(
'error_log',
[
'registrar_id' => $clid,
'log' => "Domain : $domainName ; hostName : $nameserver - is duplicated",
'date' => date('Y-m-d H:i:s')
'date' => $logdate
]
);
}
} else {
$currentDateTime = new DateTime();
$host_date = $currentDateTime->format('Y-m-d H:i:s.v');
$host_id = $db->insert(
'host',
[
@ -551,7 +561,7 @@ class DomainsController extends Controller
'domain_id' => $domain_id,
'clid' => $clid,
'crid' => $clid,
'crdate' => date('Y-m-d H:i:s')
'crdate' => $host_date
]
);

View file

@ -127,6 +127,8 @@ class HostsController extends Controller
$db->beginTransaction();
try {
$currentDateTime = new DateTime();
$crdate = $currentDateTime->format('Y-m-d H:i:s.v');
$db->insert(
'host',
[
@ -134,7 +136,7 @@ class HostsController extends Controller
'domain_id' => $superordinate_dom,
'clid' => $clid,
'crid' => $clid,
'crdate' => date('Y-m-d H:i:s')
'crdate' => $crdate
]
);
$host_id = $db->getLastInsertId();
@ -201,13 +203,15 @@ class HostsController extends Controller
'registrars' => $registrars,
]);
} else {
$currentDateTime = new DateTime();
$crdate = $currentDateTime->format('Y-m-d H:i:s.v');
$db->insert(
'host',
[
'name' => $hostName,
'clid' => $clid,
'crid' => $clid,
'crdate' => date('Y-m-d H:i:s')
'crdate' => $crdate
]
);
$host_id = $db->getLastInsertId();