diff --git a/assets/js/scripts.min.js b/assets/js/scripts.min.js index 5c89531..8e0c1b2 100644 --- a/assets/js/scripts.min.js +++ b/assets/js/scripts.min.js @@ -454,6 +454,7 @@ function modalEditDomain(id) { $("#d_me_term").val(result["term"]); $("#d_me_ns1").val(result["ns1"]); $("#d_me_ns2").val(result["ns2"]); + $("#d_me_attached_to").val(result["attached_to"]); } }); } diff --git a/class.php b/class.php index 5aa8af1..35cd131 100644 --- a/class.php +++ b/class.php @@ -1563,6 +1563,27 @@ class idlers extends helperFunctions $this->tagClose('div', 4); } + protected function attachDomainInput() + { + $this->rowColOpen('form-row', 'col-12'); + $this->tagOpen('div', 'input-group'); + $this->inputPrepend('Attached to'); + $this->selectElement('d_me_attached_to'); + $select_servers = $this->dbConnect()->prepare("SELECT `id`, `hostname` FROM `servers`;"); + $select_servers->execute(); + $this->selectOption('', '', true);//Empty option for when not attached + while ($row = $select_servers->fetch(PDO::FETCH_ASSOC)) { + $this->selectOption($row['hostname'], $row['id']); + } + $select_shared = $this->dbConnect()->prepare("SELECT `id`, `domain` FROM `shared_hosting`;"); + $select_shared->execute(); + while ($row = $select_shared->fetch(PDO::FETCH_ASSOC)) { + $this->selectOption($row['domain'], $row['id']); + } + $this->tagClose('select'); + $this->tagClose('div', 3); + } + public function editDomainModal() { $this->outputString('