Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.82 KB | None | 0 0
  1. <link rel="stylesheet" type="text/css" media="all" href="css/style-nav.css">
  2. <?php
  3. /*
  4. ##########################################################################
  5. # #
  6. # Version 4 / / / #
  7. # -----------__---/__---__------__----__---/---/- #
  8. # | /| / /___) / ) (_ ` / ) /___) / / #
  9. # _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
  10. # Free Content / Management System #
  11. # / #
  12. # #
  13. # #
  14. # Copyright 2005-2015 by webspell.org #
  15. # #
  16. # visit webSPELL.org, webspell.info to get webSPELL for free #
  17. # - Script runs under the GNU GENERAL PUBLIC LICENSE #
  18. # - It's NOT allowed to remove this copyright-tag #
  19. # -- http://www.fsf.org/licensing/licenses/gpl.html #
  20. # #
  21. # Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
  22. # Far Development by Development Team - webspell.org #
  23. # #
  24. # visit webspell.org #
  25. # #
  26. ##########################################################################
  27. */
  28.  
  29. $_language->readModule('moduls', false, true);
  30.  
  31. if (!ispageadmin($userID) || mb_substr(basename($_SERVER[ 'REQUEST_URI' ]), 0, 15) != "admincenter.php") {
  32. die($_language->module[ 'access_denied' ]);
  33. }
  34.  
  35. if (isset($_GET[ 'delete' ])) {
  36. $CAPCLASS = new \webspell\Captcha;
  37. if ($CAPCLASS->checkCaptcha(0, $_GET[ 'captcha_hash' ])) {
  38. $modulID = (int)$_GET[ 'modulID' ];
  39. safe_query("DELETE FROM " . PREFIX . "moduls WHERE modulID='" . $modulID . "' ");
  40.  
  41. } else {
  42. echo $_language->module[ 'transaction_invalid' ];
  43. }
  44. } elseif (isset($_POST[ 'sortieren' ])) {
  45. $CAPCLASS = new \webspell\Captcha;
  46. if ($CAPCLASS->checkCaptcha(0, $_POST[ 'captcha_hash' ])) {
  47. $sort = $_POST[ 'sort' ];
  48. foreach ($sort as $sortstring) {
  49. $sorter = explode("-", $sortstring);
  50. safe_query("UPDATE " . PREFIX . "moduls SET sort='".$sorter[1]."' WHERE modulID='".$sorter[0]."' ");
  51. }
  52. } else {
  53. echo $_language->module[ 'transaction_invalid' ];
  54. }
  55. } elseif (isset($_POST[ 'save' ])) {
  56. $CAPCLASS = new \webspell\Captcha;
  57. if ($CAPCLASS->checkCaptcha(0, $_POST[ 'captcha_hash' ])) {
  58. $module = $_POST[ 'module' ];
  59.  
  60. if (isset($_POST[ "le_activated" ])) {
  61. $le_activated = 1;
  62. } else {
  63. $le_activated = 0;
  64. }
  65.  
  66. if (isset($_POST[ "re_activated" ])) {
  67. $re_activated = 1;
  68. } else {
  69. $re_activated = 0;
  70. }
  71.  
  72. if (isset($_POST[ "activated" ])) {
  73. $activated = 1;
  74. } else {
  75. $activated = 0;
  76. }
  77.  
  78.  
  79. safe_query(
  80. "INSERT INTO
  81. `" . PREFIX . "moduls` (
  82. `module`,
  83. `le_activated`,
  84. `re_activated`,
  85. `activated`,
  86. `sort`
  87. )
  88. VALUES (
  89. '$module',
  90. '" . $le_activated . "',
  91. '" . $re_activated . "',
  92. '" . $activated . "',
  93. '1'
  94. )"
  95. );
  96. $id = mysqli_insert_id($_database);
  97.  
  98.  
  99. } else {
  100. echo $_language->module[ 'transaction_invalid' ];
  101. }
  102. } elseif (isset($_POST[ 'saveedit' ])) {
  103. $CAPCLASS = new \webspell\Captcha;
  104. if ($CAPCLASS->checkCaptcha(0, $_POST[ 'captcha_hash' ])) {
  105. $module = $_POST[ 'module' ];
  106.  
  107. if (isset($_POST[ "le_activated" ])) {
  108. $le_activated = 1;
  109. } else {
  110. $le_activated = 0;
  111. }
  112.  
  113. if (isset($_POST[ "re_activated" ])) {
  114. $re_activated = 1;
  115. } else {
  116. $re_activated = 0;
  117. }
  118.  
  119. if (isset($_POST[ "activated" ])) {
  120. $activated = 1;
  121. } else {
  122. $activated = 0;
  123. }
  124.  
  125.  
  126. $modulID = (int)$_POST[ 'modulID' ];
  127. $id = $modulID;
  128.  
  129. safe_query(
  130. "UPDATE
  131. `" . PREFIX . "moduls`
  132. SET
  133. `module` = '" . $module . "',
  134. `le_activated` = '" . $le_activated . "',
  135. `re_activated` = '" . $re_activated . "',
  136. `activated` = '" . $activated . "'
  137. WHERE
  138. `modulID` = '" . $modulID . "'"
  139. );
  140.  
  141.  
  142. } else {
  143. echo $_language->module[ 'transaction_invalid' ];
  144. }
  145. }
  146.  
  147. $_language->readModule('moduls', false, true);
  148.  
  149. if (isset($_GET[ 'action' ])) {
  150. $action = $_GET[ 'action' ];
  151. } else {
  152. $action = '';
  153. }
  154.  
  155. if ($action == "add") {
  156. $CAPCLASS = new \webspell\Captcha;
  157. $CAPCLASS->createTransaction();
  158. $hash = $CAPCLASS->getHash();
  159.  
  160. echo'<div class="panel panel-default">
  161. <div class="panel-heading">
  162. <i class="fa fa-thumbs-up"></i> '.$_language->module['styles'].'
  163. </div>
  164. </div>
  165. <div class="panel panel-default">
  166.  
  167. <ul class="nav nav-tabs-primary">
  168. <li role="presentation"><a href="/admin/admincenter.php?site=styles">Style</a></li>
  169. <li role="presentation"><a href="/admin/admincenter.php?site=buttons">Buttons</a></li>
  170. <li role="presentation" class="active"><a href="/admin/admincenter.php?site=moduls">Module</a></li>
  171. <li role="presentation"><a href="/admin/admincenter.php?site=css">.css</a></li>
  172. </ul>
  173. <ol class="breadcrumb-primary"> </ol>
  174. &nbsp;&nbsp;<a href="admincenter.php?site=moduls" class="white">'.$_language->module['module'].'</a> &raquo; '.$_language->module['add_modul'].'<br><br>';
  175.  
  176. echo'<form class="form-horizontal" method="post" action="admincenter.php?site=moduls" enctype="multipart/form-data">
  177.  
  178. <div class="row">
  179.  
  180. <div class="col-md-12">
  181.  
  182. <div class="form-group">
  183. <label class="col-sm-2 control-label">'.$_language->module['modul_name'].':</label>
  184. <div class="col-sm-8"><span class="text-muted small"><em>
  185. <input type="text" class="form-control" name="module" size="60" /></em></span>
  186. </div>
  187. </div>
  188.  
  189.  
  190.  
  191.  
  192. <div class="form-group">
  193. <label class="col-sm-2 control-label"></label>
  194. <div class="col-sm-8"><span class="text-muted small"><em>
  195. <label for="le_activated">'.$_language->module['left_is_activated'].'</label>
  196. <input id="le_activated" type="radio" name="radio1" value="le_activated">
  197. <label for="re_activated">'.$_language->module['right_is_activated'].'</label>
  198. <input id="re_activated" type="radio" name="radio1" value="re_activated">
  199. <label for="activated">'.$_language->module['activated'].'</label>
  200. <input id="activated" type="radio" name="radio1" value="activated">
  201. </em></span>
  202. </div>
  203. </div>
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210. <div class="form-group">
  211. <div class="col-sm-offset-2 col-sm-10">
  212. <input type="hidden" name="captcha_hash" value="'.$hash.'" />
  213. <button class="btn btn-success btn-xs" type="submit" name="save" />'.$_language->module['add_modul'].'</button>
  214. <br><br>
  215. </div>
  216. </div>
  217.  
  218. </div>
  219. </div>
  220.  
  221. </form></div>
  222. </div>';
  223. } elseif ($action == "edit") {
  224. $CAPCLASS = new \webspell\Captcha;
  225. $CAPCLASS->createTransaction();
  226. $hash = $CAPCLASS->getHash();
  227.  
  228. echo'<div class="panel panel-default">
  229. <div class="panel-heading">
  230. <i class="fa fa-thumbs-up"></i> '.$_language->module['styles'].'
  231. </div>
  232. </div>
  233. <div class="panel panel-default">
  234.  
  235. <ul class="nav nav-tabs-primary">
  236. <li role="presentation"><a href="/admin/admincenter.php?site=styles">Style</a></li>
  237. <li role="presentation"><a href="/admin/admincenter.php?site=buttons">Buttons</a></li>
  238. <li role="presentation" class="active"><a href="/admin/admincenter.php?site=moduls">Module</a></li>
  239. <li role="presentation"><a href="/admin/admincenter.php?site=css">.css</a></li>
  240. </ul>
  241. <ol class="breadcrumb-primary"> </ol>
  242. &nbsp;&nbsp;<a href="admincenter.php?site=moduls" class="white">'.$_language->module['module'].'</a> &raquo; '.$_language->module['edit_modul'].'<br><br>';
  243.  
  244. $modulID = $_GET[ 'modulID' ];
  245. $ergebnis = safe_query("SELECT * FROM " . PREFIX . "moduls WHERE modulID='$modulID'");
  246. $ds = mysqli_fetch_array($ergebnis);
  247.  
  248. if ($ds[ 'le_activated' ] == '1') {
  249. $le_activated = '<input type="radio" name="radio1" value="1" checked="checked" />';
  250. } else {
  251. $le_activated = '<input type="radio" name="radio1" value="1" />';
  252. }
  253.  
  254. if ($ds[ 're_activated' ] == '1') {
  255. $re_activated = '<input type="radio" name="radio1" value="1" checked="checked" />';
  256. } else {
  257. $re_activated = '<input type="radio" name="radio1" value="1" />';
  258. }
  259.  
  260. if ($ds[ 'activated' ] == '1') {
  261. $activated = '<input type="radio" name="radio1" value="1" checked="checked" />';
  262. } else {
  263. $activated = '<input type="radio" name="radio1" value="1" />';
  264. }
  265.  
  266. echo'<form class="form-horizontal" method="post" action="admincenter.php?site=moduls" enctype="multipart/form-data">
  267.  
  268.  
  269. <div class="row">
  270.  
  271. <div class="col-md-12">
  272.  
  273.  
  274. <div class="form-group">
  275. <label class="col-sm-2 control-label">'.$_language->module['modul_name'].':</label>
  276. <div class="col-sm-8"><span class="text-muted small"><em>
  277. <input type="text" class="form-control" name="module" value="'.getinput($ds['module']).'" /></em></span>
  278. </div>
  279. </div>
  280.  
  281.  
  282.  
  283. <div class="form-group">
  284. <label class="col-sm-2 control-label"></label>
  285. <div class="col-sm-8"><span class="text-muted small"><em>
  286. <label for="le_activated">'.$_language->module['left_is_activated'].'</label>
  287. '.$le_activated.'
  288. <label for="re_activated">'.$_language->module['right_is_activated'].'</label>
  289. '.$re_activated.'
  290. <label for="activated">'.$_language->module['activated'].'</label>
  291. '.$activated.'
  292. </em></span>
  293. </div>
  294. </div>
  295.  
  296. <div class="form-group">
  297. <div class="col-sm-offset-2 col-sm-10">
  298. <input type="hidden" name="captcha_hash" value="'.$hash.'" /><input type="hidden" name="modulID" value="'.$modulID.'" />
  299. <button class="btn btn-primary btn-xs" type="submit" name="saveedit" />'.$_language->module['edit_modul'].'</button>
  300. </div>
  301. </div>
  302.  
  303. </div>
  304. </div>
  305.  
  306. </form></div>
  307. </div>';
  308. }
  309.  
  310. else {
  311.  
  312. echo'<div class="panel panel-default">
  313. <div class="panel-heading">
  314. <i class="fa fa-thumbs-up"></i> '.$_language->module['styles'].'
  315. </div>
  316. </div>
  317. <div class="panel panel-default">
  318.  
  319. <ul class="nav nav-tabs-primary">
  320. <li role="presentation"><a href="/admin/admincenter.php?site=styles">Style</a></li>
  321. <li role="presentation"><a href="/admin/admincenter.php?site=buttons">Buttons</a></li>
  322. <li role="presentation" class="active"><a href="/admin/admincenter.php?site=moduls">Module</a></li>
  323. <li role="presentation"><a href="/admin/admincenter.php?site=css">.css</a></li>
  324. </ul>
  325. <ol class="breadcrumb-primary"> </ol>
  326. <div class="panel-body">';
  327.  
  328. echo'<a href="admincenter.php?site=moduls&amp;action=add" class="btn btn-primary btn-xs" type="button">' . $_language->module[ 'new_modul' ] . '</a><br /><br />';
  329.  
  330. echo'<form method="post" action="admincenter.php?site=moduls">
  331. <table class="table table-striped">
  332. <thead>
  333. <th><b>'.$_language->module['module'].'</b></th>
  334.  
  335. <th class="hidden-sm hidden-xs"><b>'.$_language->module['left_is_activated'].'</b></th>
  336. <th class="hidden-sm hidden-xs"><b>'.$_language->module['right_is_activated'].'</b></th>
  337. <th class="hidden-sm hidden-xs"><b>'.$_language->module['activated'].'</b></th>
  338. <th><b>'.$_language->module['actions'].'</b></th>
  339. <th><b>'.$_language->module['sort'].'</b></th>
  340. </thead>';
  341.  
  342. $moduls = safe_query("SELECT * FROM " . PREFIX . "moduls ORDER BY sort");
  343. $tmp = mysqli_fetch_assoc(safe_query("SELECT count(modulID) as cnt FROM " . PREFIX . "moduls"));
  344. $anzmoduls = $tmp[ 'cnt' ];
  345. $CAPCLASS = new \webspell\Captcha;
  346. $CAPCLASS->createTransaction();
  347. $hash = $CAPCLASS->getHash();
  348.  
  349. $CAPCLASS->createTransaction();
  350. $hash_2 = $CAPCLASS->getHash();
  351.  
  352. $i = 1;
  353. while ($db = mysqli_fetch_array($moduls)) {
  354. if ($i % 2) {
  355. $td = 'td1';
  356. } else {
  357. $td = 'td2';
  358. }
  359.  
  360. $db[ 'le_activated' ] == 1 ? $le_activated = '<font color="green"><b>' . $_language->module[ 'yes' ] . '</b></font>' :
  361. $le_activated = '<font color="red"><b>' . $_language->module[ 'no' ] . '</b></font>';
  362. $db[ 're_activated' ] == 1 ? $re_activated = '<font color="green"><b>' . $_language->module[ 'yes' ] . '</b></font>' :
  363. $re_activated = '<font color="red"><b>' . $_language->module[ 'no' ] . '</b></font>';
  364. $db[ 'activated' ] == 1 ? $activated = '<font color="green"><b>' . $_language->module[ 'yes' ] . '</b></font>' :
  365. $activated = '<font color="red"><b>' . $_language->module[ 'no' ] . '</b></font>';
  366.  
  367.  
  368.  
  369.  
  370. echo '<tr>
  371. <td>'.getinput($db['module']).'</td>
  372.  
  373. <td>'.$le_activated.'</td>
  374. <td>'.$re_activated.'</td>
  375. <td>'.$activated.'</td>
  376.  
  377. <td><a href="admincenter.php?site=moduls&amp;action=edit&amp;modulID='.$db['modulID'].'" class="hidden-xs hidden-sm btn btn-warning btn-xs" type="button">' . $_language->module[ 'edit' ] . '</a>
  378.  
  379. <input class="hidden-xs hidden-sm btn btn-danger btn-xs" type="button" onclick="MM_confirm(\'' . $_language->module['really_delete'] . '\', \'admincenter.php?site=moduls&amp;delete=true&amp;modulID='.$db['modulID'].'&amp;captcha_hash='.$hash.'\')" value="' . $_language->module['delete'] . '" />
  380.  
  381. <a href="admincenter.php?site=moduls&amp;action=edit&amp;modulID='.$db['modulID'].'" class="mobile visible-xs visible-sm" type="button"><i class="fa fa-pencil"></i></a>
  382. <a class="mobile visible-xs visible-sm" type="button" onclick="MM_confirm(\'' . $_language->module['really_delete'] . '\', \'admincenter.php?site=moduls&amp;delete=true&amp;modulID='.$db['modulID'].'&amp;captcha_hash='.$hash.'\')" /><i class="fa fa-times"></i></a>
  383.  
  384.  
  385. </td>
  386. <td>
  387. <select name="sort[]">';
  388.  
  389. for ($j = 1; $j <= $anzmoduls; $j++) {
  390. if ($db[ 'sort' ] == $j) {
  391. echo '<option value="' . $db[ 'modulID' ] . '-' . $j . '" selected="selected">' . $j . '</option>';
  392. } else {
  393. echo '<option value="' . $db[ 'modulID' ] . '-' . $j . '">' . $j . '</option>';
  394. }
  395. }
  396.  
  397. echo '</select>
  398. </td>
  399. </tr>';
  400. $i++;
  401.  
  402. }
  403. echo'<tr class="td_head">
  404. <td colspan="5" align="right"><input type="hidden" name="captcha_hash" value="'.$hash_2.'" /><button class="btn btn-primary btn-xs" type="submit" name="sortieren" />'.$_language->module['to_sort'].'</button></td>
  405. </tr>
  406. </table>
  407. </form>';
  408. }
  409. echo '</div></div>';
  410. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement