add_package.php 13 KB

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