Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <?php
  2.  
  3. session_start(); // Alltid överst på sidan
  4.  
  5. // Kolla om inloggad = sessionen satt
  6. if (!isset($_SESSION['sess_user'])){
  7.   header("Location: index.php");
  8.   exit;
  9. }
  10. ?>
  11. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type"
  15.   content="text/html; charset=iso-8859-1">
  16. <title>Time Battle - Admin Panel</title>
  17. </head>
  18. <body>
  19. <?php
  20.  
  21. include 'include/conn.php';
  22. include 'include/top.php';
  23. include "include/if.php";
  24.  
  25. $p_id=$r['position_id'];
  26.  
  27. $strQuery2 = mysql_query("
  28. SELECT * FROM position
  29. WHERE p_id = '$p_id'
  30. ") or exit(mysql_error());
  31. $rad = mysql_fetch_array($strQuery2);
  32.  
  33.  
  34. if($rad['p_panel'] == 1){
  35.  
  36. //Upddaterar Live
  37. if ( $_POST['a_live'] )
  38. {
  39.  
  40.    $result = mysql_query("UPDATE timebattle SET live='$_POST[a_live]'")
  41.    or die(mysql_error());
  42.  
  43.    header("Location: admin_panel.php");
  44. }
  45.  
  46.  
  47.  
  48. echo "<table border=0>
  49. <tr>
  50. <td width=200 valign=top>
  51. <a href='?live'>Ändra live.</a>
  52. </td>
  53. <td>";
  54. //Forumlär för ändra live
  55. if (isset($_GET['live'])){
  56. ?>
  57. <table width="400" border="0"  cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  58. <tr>
  59. <form id="form1" name="form1" method="post" action="admin_panel.php?live&ready">
  60. <td>
  61. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  62. <tr>
  63. <td colspan="3" bgcolor="#E6E6E6"><strong><a name="skapa">Ändra Live</a></strong> </td>
  64. </tr>
  65. <tr>
  66. <td valign="top"><strong>Live</strong></td>
  67. <td valign="top">:</td>
  68. <td><textarea name="a_live" cols="30" rows="1" id="a_live"></textarea></td>
  69. </tr>
  70. <tr>
  71. <td>&nbsp;</td>
  72. <td>&nbsp;</td>
  73. <td>
  74. <input type="submit" name="Submit" value="Skapa" />
  75. <input type="reset" name="Submit2" value="Ta bort" /></td>
  76. <?php
  77. }
  78.  
  79. echo"
  80. </td>
  81. </tr>
  82. </table>";
  83. }else{
  84. echo "<script language=\"JavaScript\">\n
  85. location.href = 'stan.php';
  86. alert(\"Du får inte vara här\");\n
  87. </script>";
  88. }
  89.  
  90.  
  91. include 'include/fotter.php';
  92.  
  93. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement