edit_package.php 13 KB

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