instances.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. require('include/glob.php');
  3. require('include/muoribene.php');
  4. require('include/sessionstart.php');
  5. require('include/menu.php');
  6. buildmenu($menu);
  7. require('include/myconn.php');
  8. $res=mysqli_query($link,'SELECT * FROM Instances ORDER BY URI ASC')
  9. or muoribene(mysqli_error($link).'<br>'.$btl,false);
  10. mysqli_close($link);
  11. if (mysqli_num_rows($res)<1) {
  12. $out='<p>Nessuna istanza da mostrare.</p>'.N;
  13. } else {
  14. $out='<table>'.N;
  15. while ($row=mysqli_fetch_assoc($res)) {
  16. $out.='<tr><td>'.$row['URI'].'</td></tr>'.N;
  17. }
  18. $out.='</table>'.N;
  19. }
  20. ?>
  21. <!DOCTYPE HTML>
  22. <html lang="it">
  23. <head>
  24. <title>Mastodon Startpage Admin - Main Menu</title>
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <meta name="description" content="Admin pages for Mastodon Startpage">
  27. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  28. <link rel="icon" type="image/png" href="imgs/icona-32.png" sizes="32x32">
  29. <link rel="icon" type="image/png" href="imgs/icona-192.png" sizes="192x192">
  30. <link rel="icon" type="image/png" href="imgs/icona-512.png" sizes="512x512">
  31. <link rel="apple-touch-icon-precomposed" href="imgs/icona-180.png">
  32. <link rel="stylesheet" type="text/css" href="theme.css?v=<?php echo($cjrand); ?>">
  33. <script language="JavaScript">
  34. <!--
  35. function chulsh(el,sh) {
  36. if (sh)
  37. el.querySelector('ul').style='display:block';
  38. else
  39. el.querySelector('ul').style='display:none';
  40. }
  41. function ulsh(el,sh) {
  42. if (sh)
  43. el.style='display:block';
  44. else
  45. el.style='display:none';
  46. }
  47. function golang(lang) {
  48. var loc=document.location.href;
  49. loc=loc.replace(/#.*$/,'');
  50. loc=loc.replace(/\/$/,'');
  51. if (document.documentElement.lang=='en') {
  52. if (lang!='en')
  53. document.location.href=loc+'/'+lang;
  54. } else {
  55. if (lang!='en')
  56. document.location.href=loc.substr(0,loc.length-3)+'/'+lang;
  57. else
  58. document.location.href=loc.substr(0,loc.length-3);
  59. }
  60. }
  61. //-->
  62. </script>
  63. </head>
  64. <body>
  65. <nav>
  66. <div id="hmenu">
  67. <ul>
  68. <?php echo($menuout); ?>
  69. </ul>
  70. </div>
  71. </nav>
  72. <div id="fullscreenm">
  73. <div id="middlerow">
  74. <?php echo($out); ?>
  75. </div>
  76. </div>
  77. <div id="footer">
  78. <form action="edinst.php" name="addinst" method="post">
  79. <table><tr><td>Aggiungi un’istanza:</td><td><input type="text" name="URI" maxlength="512"></td><td><input type="button" value="Vai" onClick="ckaif();"></td></tr></table>
  80. </form>
  81. </div>
  82. </body>
  83. </html>