edit_package.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <a class="button button-secondary" id="btn-back" href="/list/package/">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
  7. </a>
  8. </div>
  9. <div class="toolbar-buttons">
  10. <button type="submit" class="button" form="vstobjects">
  11. <i class="fas fa-floppy-disk icon-purple"></i><?= _("Save") ?>
  12. </button>
  13. </div>
  14. </div>
  15. </div>
  16. <!-- End toolbar -->
  17. <div class="container animate__animated animate__fadeIn">
  18. <form
  19. x-data="{
  20. showWebOptions: false,
  21. showDnsOptions: false,
  22. showMailOptions: false,
  23. showDatabaseOptions: false,
  24. showSystemOptions: false,
  25. }"
  26. x-on:submit="App.Listeners.PACKAGE.submit()"
  27. id="vstobjects"
  28. name="v_edit_package"
  29. method="post"
  30. class="<?= $v_status ?>"
  31. >
  32. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  33. <input type="hidden" name="save" value="save">
  34. <div class="form-container">
  35. <h1 class="form-title"><?= _("Editing Package") ?></h1>
  36. <?php show_alert_message($_SESSION); ?>
  37. <div class="u-mb10">
  38. <label for="v_package_new" class="form-label"><?= _("Package Name") ?></label>
  39. <input type="text" class="form-control" name="v_package_new" id="v_package_new" value="<?= htmlentities(trim($v_package_new, "'")) ?>">
  40. <input type="hidden" name="v_package" value="<?= htmlentities(trim($v_package, "'")) ?>">
  41. </div>
  42. <div class="u-mb10">
  43. <label for="v_disk_quota" class="form-label">
  44. <?= _("Quota") ?> <span class="optional">(<?= _("in megabytes") ?>)</span>
  45. </label>
  46. <div class="u-pos-relative">
  47. <input type="text" class="form-control" name="v_disk_quota" id="v_disk_quota" value="<?= htmlentities(trim($v_disk_quota, "'")) ?>">
  48. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  49. </div>
  50. </div>
  51. <div class="u-mb10">
  52. <label for="v_bandwidth" class="form-label">
  53. <?= _("Bandwidth") ?> <span class="optional">(<?= _("in megabytes") ?>)</span>
  54. </label>
  55. <div class="u-pos-relative">
  56. <input type="text" class="form-control" name="v_bandwidth" id="v_bandwidth" value="<?= htmlentities(trim($v_bandwidth, "'")) ?>">
  57. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  58. </div>
  59. </div>
  60. <div class="u-mb10">
  61. <label for="v_backups" class="form-label"><?= _("Backups") ?></label>
  62. <input type="text" class="form-control" name="v_backups" id="v_backups" value="<?= htmlentities(trim($v_backups, "'")) ?>">
  63. </div>
  64. <h2 x-on:click="showWebOptions = !showWebOptions" class="section-title">
  65. <?= _("Web") ?>
  66. <i
  67. x-bind:class="showWebOptions ? 'fa-square-minus' : 'fa-square-plus'"
  68. class="fas icon-dim icon-maroon js-section-toggle-icon"
  69. ></i>
  70. </h2>
  71. <div x-cloak x-show="showWebOptions" id="web-options">
  72. <div class="u-mt15 u-mb10">
  73. <label for="v_web_domains" class="form-label"><?= _("Web Domains") ?></label>
  74. <div class="u-pos-relative">
  75. <input type="text" class="form-control" name="v_web_domains" id="v_web_domains" value="<?= htmlentities(trim($v_web_domains, "'")) ?>">
  76. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  77. </div>
  78. </div>
  79. <div class="u-mb10">
  80. <label for="v_web_aliases" class="form-label">
  81. <?= _("Web Aliases") ?> <span class="optional">(<?= _("per domain") ?>)</span>
  82. </label>
  83. <div class="u-pos-relative">
  84. <input type="text" class="form-control" name="v_web_aliases" id="v_web_aliases" value="<?= htmlentities(trim($v_web_aliases, "'")) ?>">
  85. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  86. </div>
  87. </div>
  88. <div class="u-mb10">
  89. <label for="v_web_template" class="form-label">
  90. <?= _("Web Template") . " <span class='optional'> " . strtoupper($_SESSION["WEB_SYSTEM"]) . "</span>" ?>
  91. </label>
  92. <select class="form-select" name="v_web_template" id="v_web_template">
  93. <?php
  94. foreach ($web_templates as $key => $value) {
  95. echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
  96. if ((!empty($v_web_template)) && ( $value == trim($v_web_template, "'"))){
  97. echo ' selected' ;
  98. }
  99. echo ">".htmlentities($value)."</option>\n";
  100. }
  101. ?>
  102. </select>
  103. </div>
  104. <?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
  105. <div class="u-mb10">
  106. <label for="v_backend_template" class="form-label">
  107. <?= _("Backend Template") . "<span class='optional'>" . strtoupper($_SESSION["WEB_BACKEND"]) . "</span>" ?>
  108. </label>
  109. <select class="form-select" name="v_backend_template" id="v_backend_template">
  110. <?php
  111. foreach ($backend_templates as $key => $value) {
  112. echo "\t\t\t\t<option value=\"".$value."\"";
  113. if ((!empty($v_backend_template)) && ( $value == trim($v_backend_template, "'"))){
  114. echo ' selected' ;
  115. }
  116. echo ">".htmlentities($value)."</option>\n";
  117. }
  118. ?>
  119. </select>
  120. </div>
  121. <?=""; }?>
  122. <?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
  123. <div class="u-mb10">
  124. <label for="v_proxy_template" class="form-label">
  125. <?= _("Proxy Template") . "<span class='optional'>" . strtoupper($_SESSION["PROXY_SYSTEM"]) . "</span>" ?>
  126. </label>
  127. <select class="form-select" name="v_proxy_template" id="v_proxy_template">
  128. <?php
  129. foreach ($proxy_templates as $key => $value) {
  130. echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
  131. if ((!empty($v_proxy_template)) && ( $value == trim($v_proxy_template, "'"))){
  132. echo ' selected' ;
  133. }
  134. echo ">".htmlentities($value)."</option>\n";
  135. }
  136. ?>
  137. </select>
  138. </div>
  139. <?=""; }?>
  140. </div>
  141. <h2 x-on:click="showDnsOptions = !showDnsOptions" class="section-title">
  142. <?= _("DNS") ?>
  143. <i
  144. x-bind:class="showDnsOptions ? 'fa-square-minus' : 'fa-square-plus'"
  145. class="fas icon-dim icon-maroon js-section-toggle-icon"
  146. ></i>
  147. </h2>
  148. <div x-cloak x-show="showDnsOptions" id="dns-options">
  149. <div class="u-mt15 u-mb10">
  150. <label for="v_dns_template" class="form-label">
  151. <?= _("DNS Template") . "<span class='optional'>" . strtoupper($_SESSION["DNS_SYSTEM"]) . "</span>" ?>
  152. </label>
  153. <select class="form-select" name="v_dns_template" id="v_dns_template">
  154. <?php
  155. foreach ($dns_templates as $key => $value) {
  156. echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
  157. if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
  158. echo ' selected' ;
  159. }
  160. if ((!empty($v_dns_template)) && ( $value == trim($v_dns_template, "'"))){
  161. echo ' selected' ;
  162. }
  163. echo ">".htmlentities($value)."</option>\n";
  164. }
  165. ?>
  166. </select>
  167. </div>
  168. <div class="u-mb10">
  169. <label for="v_dns_domains" class="form-label"><?= _("DNS domains") ?></label>
  170. <div class="u-pos-relative">
  171. <input type="text" class="form-control" name="v_dns_domains" id="v_dns_domains" value="<?= htmlentities(trim($v_dns_domains, "'")) ?>">
  172. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  173. </div>
  174. </div>
  175. <div class="u-mb10">
  176. <label for="v_dns_records" class="form-label">
  177. <?= _("DNS records") ?> <span class="optional">(<?= _("per domain") ?>)</span>
  178. </label>
  179. <div class="u-pos-relative">
  180. <input type="text" class="form-control" name="v_dns_records" id="v_dns_records" value="<?= htmlentities(trim($v_dns_records, "'")) ?>">
  181. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  182. </div>
  183. </div>
  184. <?php if (isset($_SESSION["DNS_SYSTEM"]) && !empty($_SESSION["DNS_SYSTEM"])) { ?>
  185. <p class="form-label u-mb10"><?= _("Name servers") ?></p>
  186. <div class="u-mb5">
  187. <input type="text" class="form-control" name="v_ns1" value="<?= htmlentities(trim($v_ns1, "'")) ?>">
  188. </div>
  189. <div class="u-mb5">
  190. <input type="text" class="form-control" name="v_ns2" value="<?= htmlentities(trim($v_ns2, "'")) ?>">
  191. </div>
  192. <?php
  193. if($v_ns3) {
  194. echo '<div class="u-side-by-side u-mb5">
  195. <input type="text" class="form-control" name="v_ns3" value="'.htmlentities(trim($v_ns3, "'")).'">
  196. <span class="u-ml10 js-remove-ns"><i class="fas fa-trash icon-dim icon-red"></i></span>
  197. </div>';
  198. }
  199. if($v_ns4) {
  200. echo '<div class="u-side-by-side u-mb5">
  201. <input type="text" class="form-control" name="v_ns4" value="'.htmlentities(trim($v_ns4, "'")).'">
  202. <span class="u-ml10 js-remove-ns"><i class="fas fa-trash icon-dim icon-red"></i></span>
  203. </div>';
  204. }
  205. if($v_ns5) {
  206. echo '<div class="u-side-by-side u-mb5">
  207. <input type="text" class="form-control" name="v_ns5" value="'.htmlentities(trim($v_ns5, "'")).'">
  208. <span class="u-ml10 js-remove-ns"><i class="fas fa-trash icon-dim icon-red"></i></span>
  209. </div>';
  210. }
  211. if($v_ns6) {
  212. echo '<div class="u-side-by-side u-mb5">
  213. <input type="text" class="form-control" name="v_ns6" value="'.htmlentities(trim($v_ns6, "'")).'">
  214. <span class="u-ml10 js-remove-ns"><i class="fas fa-trash icon-dim icon-red"></i></span>
  215. </div>';
  216. }
  217. if($v_ns7) {
  218. echo '<div class="u-side-by-side u-mb5">
  219. <input type="text" class="form-control" name="v_ns7" value="'.htmlentities(trim($v_ns7, "'")).'">
  220. <span class="u-ml10 js-remove-ns"><i class="fas fa-trash icon-dim icon-red"></i></span>
  221. </div>';
  222. }
  223. if($v_ns8) {
  224. echo '<div class="u-side-by-side u-mb5">
  225. <input type="text" class="form-control" name="v_ns8" value="'.htmlentities(trim($v_ns8, "'")).'">
  226. <span class="u-ml10 js-remove-ns"><i class="fas fa-trash icon-dim icon-red"></i></span>
  227. </div>';
  228. }
  229. ?>
  230. <div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
  231. <span class="form-link"><?= _("Add Name Server") ?></span>
  232. </div>
  233. <?php } ?>
  234. </div>
  235. <h2 x-on:click="showMailOptions = !showMailOptions" class="section-title">
  236. <?= _("Mail") ?>
  237. <i
  238. x-bind:class="showMailOptions ? 'fa-square-minus' : 'fa-square-plus'"
  239. class="fas icon-dim icon-maroon js-section-toggle-icon"
  240. ></i>
  241. </h2>
  242. <div x-cloak x-show="showMailOptions" id="mail-options">
  243. <div class="u-mt15 u-mb10">
  244. <label for="v_mail_domains" class="form-label"><?= _("Mail Domains") ?></label>
  245. <div class="u-pos-relative">
  246. <input type="text" class="form-control" name="v_mail_domains" id="v_mail_domains" value="<?= htmlentities(trim($v_mail_domains, "'")) ?>">
  247. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  248. </div>
  249. </div>
  250. <div class="u-mb10">
  251. <label for="v_mail_accounts" class="form-label">
  252. <?= _("Mail Accounts") ?> <span class="optional">(<?= _("per domain") ?>)</span>
  253. </label>
  254. <div class="u-pos-relative">
  255. <input type="text" class="form-control" name="v_mail_accounts" id="v_mail_accounts" value="<?= htmlentities(trim($v_mail_accounts, "'")) ?>">
  256. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  257. </div>
  258. </div>
  259. <div class="u-mb10">
  260. <label for="v_ratelimit" class="form-label">
  261. <?= _("Rate limit") ?> <span class="optional">(<?= _("per account / hour") ?>)</span>
  262. </label>
  263. <input type="text" class="form-control" name="v_ratelimit" id="v_ratelimit" value="<?= htmlentities(trim($v_ratelimit, "'")) ?>">
  264. </div>
  265. </div>
  266. <h2 x-on:click="showDatabaseOptions = !showDatabaseOptions" class="section-title">
  267. <?= _("Databases") ?>
  268. <i
  269. x-bind:class="showDatabaseOptions ? 'fa-square-minus' : 'fa-square-plus'"
  270. class="fas icon-dim icon-maroon js-section-toggle-icon"
  271. ></i>
  272. </h2>
  273. <div x-cloak x-show="showDatabaseOptions" id="database-options">
  274. <div class="u-mt15 u-mb10">
  275. <label for="v_databases" class="form-label"><?= _("Databases") ?></label>
  276. <div class="u-pos-relative">
  277. <input type="text" class="form-control" name="v_databases" id="v_databases" value="<?= htmlentities(trim($v_databases, "'")) ?>">
  278. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  279. </div>
  280. </div>
  281. </div>
  282. <h2 x-on:click="showSystemOptions = !showSystemOptions" class="section-title">
  283. <?= _("System") ?>
  284. <i
  285. x-bind:class="showSystemOptions ? 'fa-square-minus' : 'fa-square-plus'"
  286. class="fas icon-dim icon-maroon js-section-toggle-icon"
  287. ></i>
  288. </h2>
  289. <div x-cloak x-show="showSystemOptions" id="system-options">
  290. <div class="u-mt15 u-mb10">
  291. <label for="v_cron_jobs" class="form-label"><?= _("Cron Jobs") ?></label>
  292. <div class="u-pos-relative">
  293. <input type="text" class="form-control" name="v_cron_jobs" id="v_cron_jobs" value="<?= htmlentities(trim($v_cron_jobs, "'")) ?>">
  294. <i class="unlim-trigger fas fa-infinity" title="<?= _("Unlimited") ?>"></i>
  295. </div>
  296. </div>
  297. <div class="u-mb10">
  298. <label for="v_shell" class="form-label"><?= _("SSH Access") ?></label>
  299. <select class="form-select" name="v_shell" id="v_shell">
  300. <?php foreach ($shells as $key => $value): ?>
  301. <option value="<?= htmlentities($value) ?>"
  302. <?php if (!empty($v_shell) && $value == trim($v_shell, "''")): ?>
  303. selected
  304. <?php endif; ?>
  305. >
  306. <?= htmlentities($value) ?>
  307. </option>
  308. <?php endforeach; ?>
  309. </select>
  310. </div>
  311. </div>
  312. </div>
  313. </form>
  314. </div>