PageRenderTime 109ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/config-catalogue-edit.php

https://gitlab.com/manuperazafa/habbofa2
PHP | 155 lines | 146 code | 9 blank | 0 comment | 11 complexity | edd05fb080007e2197029364ccae7b90 MD5 | raw file
  1. <?php
  2. require_once('core.php');
  3. require_once('web/templates/navbar.php');
  4. require_once('../heliocms/core.php');
  5. require_once('session.php');
  6. $user_id = $_GET['user'];
  7. $user_edit_a = mysql_query("SELECT * FROM catalog_pages WHERE id='$user_id'");
  8. if (mysql_num_rows($user_edit_a) == 0) {
  9. header ("Location: config-catalogue.php?error=$w");
  10. }
  11. $user_edit_q = mysql_fetch_assoc($user_edit_a);
  12. if (isset($_POST['save'])) {
  13. $id = $_POST['id'];
  14. $parent_id = $_POST['parent_id'];
  15. $caption = $_POST['caption'];
  16. $icon_image = $_POST['icon_image'];
  17. $visible = $_POST['visible'];
  18. $enabled = $_POST['enabled'];
  19. $min_rank = $_POST['min_rank'];
  20. $order_num = $_POST['order_num'];
  21. $page_link = $_POST['page_link'];
  22. $page_layout = $_POST['page_layout'];
  23. $page_strings_1 = $_POST['page_strings_1'];
  24. $page_strings_2 = $_POST['page_strings_2'];
  25. mysql_query ("UPDATE catalog_pages SET id='$id', parent_id='$parent_id', caption='$caption', icon_image='$icon_image', visible='$visible', enabled='$enabled', min_rank='$min_rank', order_num='$order_num', page_link='$page_link', page_layout='$page_layout', page_strings_1='$page_strings_1', page_strings_2='$page_strings_2' WHERE id=$user_edit_q[id]");
  26. header ("Location: config-catalogue.php?saved=$w");
  27. mysql_query("INSERT INTO stafflogs (action, message, note, userid, timestamp) VALUES ('Catálogo', 'Ha editado el catálogo (". $user_edit_q['caption'] .").', '". $user_q['rank'] ."', '". $user_q['id'] ."', '". time() ."')");
  28. }
  29. ?>
  30. <style>
  31. .box-info {
  32. color: #fff;
  33. width: 70px;
  34. padding-top: 9px;
  35. height: 80px;
  36. border-radius: 2px 0px 0px 2px;
  37. text-align: center;
  38. }
  39. .box-info .blue {background: #00bff1;}
  40. .box-info .red {background: #df4a32;}
  41. .box-info .orange {background: #f59d00;}
  42. .box-info .green {background: #00e67c;}
  43. .bantype {
  44. color: #fff;
  45. padding: 8px 0px;
  46. border-radius: 4px;
  47. }
  48. .bantype .red {background: #F44336;}
  49. .bantype .orange {background: #ff9800;}
  50. .bantype .blue {background: #2196F3;}
  51. input {
  52. background: #fff !important;
  53. border: 1px solid rgba(184, 183, 183, 0.72) !important;
  54. border-bottom: 2px solid rgba(184, 183, 183, 0.72) !important;
  55. border-radius: 3px !important;
  56. width: 100% !important;
  57. color: rgba(184, 183, 183, 0.72) !important;
  58. height: 35px !important;
  59. padding: 0px 0px 0px 2px !important;
  60. margin-bottom: 0px !important;
  61. }
  62. select {
  63. background: #fff !important;
  64. border: 1px solid rgba(184, 183, 183, 0.72) !important;
  65. border-bottom: 2px solid rgba(184, 183, 183, 0.72) !important;
  66. border-radius: 3px !important;
  67. width: 100% !important;
  68. color: rgba(184, 183, 183, 0.72) !important;
  69. height: 35px !important;
  70. padding: 0px 9px !important;
  71. margin-bottom: 0px !important;
  72. }
  73. input:focus {
  74. border-bottom: none 1px solid rgba(184, 183, 183, 0.72);
  75. box-shadow: none !important;
  76. }
  77. </style>
  78. <div class="container">
  79. <div class="row">
  80. <div class="col s12 m12">
  81. <div class="card blue-white darken-1">
  82. <div class="card-content black-text">
  83. <h5>Cátalogo > Editar página > <?php echo $user_edit_q['caption']; ?></h5>
  84. <table class="centered striped">
  85. <tbody>
  86. <form method="post">
  87. <tr>
  88. <td style="font-size: 12px;"><b>ID</b></td>
  89. <td><input name="id" value="<?php echo $user_edit_q['id']; ?>"></td>
  90. </tr>
  91. <tr>
  92. <td style="font-size: 12px;"><b>PARENT ID</b></td>
  93. <td><input name="parent_id" value="<?php echo $user_edit_q['parent_id']; ?>"></td>
  94. </tr>
  95. <tr>
  96. <td style="font-size: 12px;"><b>PÁGINA</b></td>
  97. <td><input name="caption" value="<?php echo $user_edit_q['caption']; ?>"></td>
  98. </tr>
  99. <tr>
  100. <td style="font-size: 12px;"><b>ICONO IMG</b></td>
  101. <td><input name="icon_image" value="<?php echo $user_edit_q['icon_image']; ?>"></td>
  102. </tr>
  103. <tr>
  104. <td style="font-size: 12px;"><b>VISIBILIDAD</b></td>
  105. <td><select name="visible"><?php if ($user_edit_q['visible'] == '0') { ?><option value="0">Oculto</option><option value="1">Mostrar</option><?php } ?><?php if ($user_edit_q['visible'] == '1') { ?><option value="1">Visible</option><option value="0">Ocultar</option><?php } ?></select></td>
  106. </tr>
  107. <tr>
  108. <td style="font-size: 12px;"><b>ESTADO</b></td>
  109. <td><select name="enabled"><?php if ($user_edit_q['enabled'] == '0') { ?><option value="0">Desactivado</option><option value="1">Activar</option><?php } ?><?php if ($user_edit_q['enabled'] == '1') { ?><option value="1">Activado</option><option value="0">Desactivar</option><?php } ?></select></td>
  110. </tr>
  111. <tr>
  112. <td style="font-size: 12px;"><b>RANGO</b></td>
  113. <td><select name="min_rank"><?php $b = mysql_query("SELECT * FROM ranks"); while($a = mysql_fetch_assoc($b)){ ?><option value="<?php echo $a['id']; ?>"><?php echo $a['name']; ?></option><?php } ?></select></td>
  114. </tr>
  115. <tr>
  116. <td style="font-size: 12px;"><b>ORDER NUM</b></td>
  117. <td><input name="order_num" value="<?php echo $user_edit_q['order_num']; ?>"></td>
  118. </tr>
  119. <tr>
  120. <td style="font-size: 12px;"><b>PAGE LINK</b></td>
  121. <td><input name="page_link" value="<?php echo $user_edit_q['page_link']; ?>"></td>
  122. </tr>
  123. <tr>
  124. <td style="font-size: 12px;"><b>PAGE LAYOUT</b></td>
  125. <td><input name="page_layout" value="<?php echo $user_edit_q['page_layout']; ?>"></td>
  126. </tr>
  127. <tr>
  128. <td style="font-size: 12px;"><b>PAGE STRINGS 1</b></td>
  129. <td><input name="page_strings_1" value="<?php echo $user_edit_q['page_strings_1']; ?>"></td>
  130. </tr>
  131. <tr>
  132. <td style="font-size: 12px;"><b>PAGE STRINGS 2</b></td>
  133. <td><input name="page_strings_2" value="<?php echo $user_edit_q['page_strings_2']; ?>"></td>
  134. </tr>
  135. <tr>
  136. <td></td>
  137. <td><button name="save" type="submit" class="btn" style="background: #1e282c;box-shadow: none;">Guardar cambios</button></td>
  138. </tr>
  139. </form>
  140. </tbody>
  141. </table>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>