From 12c9ea82a1447014701142e2bc59e9c5f603fb79 Mon Sep 17 00:00:00 2001 From: cp6 Date: Mon, 25 Jan 2021 13:28:18 +1100 Subject: [PATCH 01/19] Fixed delete labels Fixed delete labels --- class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/class.php b/class.php index db5d040..8e09f06 100644 --- a/class.php +++ b/class.php @@ -1168,7 +1168,7 @@ class idlers extends helperFunctions $this->outputString('
'); $this->rowColOpen('form-row', 'col-8'); - $this->outputString(''); + $this->outputString(''); $this->tagClose('div'); $this->colOpen('col-4'); $this->outputString(''); @@ -1285,7 +1285,7 @@ class idlers extends helperFunctions $this->outputString(''); $this->rowColOpen('form-row', 'col-8'); - $this->outputString(''); + $this->outputString(''); $this->tagClose('div'); $this->colOpen('col-4'); $this->outputString(''); From a89d125f7c798f286bf5805e03b7cb850bb8674e Mon Sep 17 00:00:00 2001 From: cp6 Date: Mon, 25 Jan 2021 13:32:46 +1100 Subject: [PATCH 02/19] Domain terms annual & above Domain terms options to be Annual, Biennial and Triennial --- class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/class.php b/class.php index 8e09f06..cd52793 100644 --- a/class.php +++ b/class.php @@ -198,6 +198,13 @@ class elementHelpers extends idlersConfig $this->selectOption('Triennial (3 years)', '6'); } + protected function domainTermSelectOptions() + { + $this->selectOption('Annual (yearly)', '4', true); + $this->selectOption('Biennial (2 years)', '5'); + $this->selectOption('Triennial (3 years)', '6'); + } + protected function CurrencySelectOptions() { $this->selectOption('AUD', 'AUD'); @@ -1318,7 +1325,7 @@ class idlers extends helperFunctions $this->tagOpen('div', 'input-group'); $this->inputPrepend('Term'); $this->selectElement('d_me_term'); - $this->termSelectOptions(); + $this->domainTermSelectOptions(); $this->tagClose('select'); $this->tagClose('div', 3); From ee8651b82eaafb364dbb9c5d33e5ea12bcf94c1d Mon Sep 17 00:00:00 2001 From: cp6 Date: Tue, 26 Jan 2021 00:15:46 +1100 Subject: [PATCH 03/19] Fixed all speed tests being bust cases query failure Added has_st col (has speed test) this means you can now have YABs data, YABs data but no speedtest (becasue they were all busy) or no YABs data. --- class.php | 32 +++++++++++++++++++++++++------- update.sql | 16 +++++++++++++++- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/class.php b/class.php index cd52793..5774c95 100644 --- a/class.php +++ b/class.php @@ -693,13 +693,13 @@ class idlers extends helperFunctions public function serverData(string $id) { - $select = $this->dbConnect()->prepare("SELECT `has_yabs` FROM `servers` WHERE `id` = ? LIMIT 1;"); + $select = $this->dbConnect()->prepare("SELECT `has_yabs`, `has_st` FROM `servers` WHERE `id` = ? LIMIT 1;"); $select->execute([$id]); $row = $select->fetch(); - if ($row['has_yabs'] == 1) { + if ($row['has_yabs'] == 1 && $row['has_st'] == 1) { $select = $this->dbConnect()->prepare(" SELECT servers.id as server_id,hostname,ipv4,ipv6,`cpu`,cpu_type,cpu_freq,ram,ram_type,swap,swap_type,`disk`,disk_type,bandwidth,bandwidth_type,gb5_single,gb5_multi,gb5_id,aes_ni,amd_v, - is_dedicated,is_cpu_dedicated,was_special,os,ssh_port,still_have,tags,notes,virt,has_yabs,ns1,ns2,DATE_FORMAT(`owned_since`, '%M %Y') as owned_since, `owned_since` as owned_since_raw, `4k`,`4k_type`,`64k`,`64k_type`,`512k`,`512k_type`,`1m`,`1m_type`, + is_dedicated,is_cpu_dedicated,was_special,os,ssh_port,still_have,tags,notes,virt,has_yabs,has_st,ns1,ns2,DATE_FORMAT(`owned_since`, '%M %Y') as owned_since, `owned_since` as owned_since_raw, `4k`,`4k_type`,`64k`,`64k_type`,`512k`,`512k_type`,`1m`,`1m_type`, loc.name as location,send,send_type,recieve,recieve_type,price,currency,term,as_usd,per_month,next_dd,pr.name as provider FROM servers INNER JOIN disk_speed ds on servers.id = ds.server_id INNER JOIN speed_tests st on servers.id = st.server_id INNER JOIN locations loc on servers.location = loc.id @@ -711,6 +711,17 @@ class idlers extends helperFunctions $speed_tests = $sel_st->fetchAll(PDO::FETCH_ASSOC); $final = array_merge($speed_tests, $data); return json_encode($final); + } elseif ($row['has_yabs'] == 1 && $row['has_st'] == 0) { + $select = $this->dbConnect()->prepare(" + SELECT servers.id as server_id,hostname,ipv4,ipv6,`cpu`,cpu_type,cpu_freq,ram,ram_type,swap,swap_type,`disk`,disk_type,bandwidth,bandwidth_type,gb5_single,gb5_multi,gb5_id,aes_ni,amd_v, + is_dedicated,is_cpu_dedicated,was_special,os,ssh_port,still_have,tags,notes,virt,has_yabs,has_st,ns1,ns2,DATE_FORMAT(`owned_since`, '%M %Y') as owned_since, `owned_since` as owned_since_raw, `4k`,`4k_type`,`64k`,`64k_type`,`512k`,`512k_type`,`1m`,`1m_type`, + loc.name as location,price,currency,term,as_usd,per_month,next_dd,pr.name as provider + FROM servers INNER JOIN disk_speed ds on servers.id = ds.server_id + INNER JOIN locations loc on servers.location = loc.id + INNER JOIN providers pr on servers.provider = pr.id INNER JOIN pricing on servers.id = pricing.server_id WHERE servers.id = ? LIMIT 1;"); + $select->execute([$id]); + $data = $select->fetchAll(PDO::FETCH_ASSOC)[0]; + return json_encode($data); } else { $select = $this->dbConnect()->prepare(" SELECT servers.id as server_id,hostname,ipv4,ipv6,`cpu`,cpu_type,cpu_freq,ram,ram_type,swap,swap_type,`disk`,disk_type, @@ -1891,6 +1902,7 @@ class idlers extends helperFunctions $ipv6 = $data['ipv6']; } ($data['has_yabs'] == 1) ? $has_yabs = true : $has_yabs = false; + ($data['has_st'] == 1) ? $has_st = true : $has_st = false; $this->tagOpen('div', 'modal-header'); $this->HTMLphrase('h4', 'modal-title w-100', $data['hostname'], 'view_more_header'); $this->outputString(''); @@ -2109,7 +2121,7 @@ class idlers extends helperFunctions $this->colOpen('col-2'); $this->HTMLphrase('p', 'm-value', $data['virt']); $this->tagClose('div', 2); - if ($has_yabs) { + if ($has_yabs && $has_st) { $this->rowColOpen('row m-section-row', 'col-12 text-center'); $this->HTMLphrase('p', 'm-section-text', 'Network test'); $this->tagClose('div', 2); @@ -2137,7 +2149,7 @@ class idlers extends helperFunctions $this->rowColOpen('row m-section-row', 'col-12 text-center'); $this->htmlPhrase('p', 'm-section-text', 'Notes'); $this->outputString("