PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/areariservata/insert_sotmenu_link.php

https://code.google.com/p/bilugcms/
PHP | 215 lines | 172 code | 24 blank | 19 comment | 10 complexity | d678e6fd8b7a4a986c873be629375289 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception
  1. <? /* license
  2. BilugCMS (http://www.bilug.it) - Content Management System for dynamic web sites
  3. Copyright (C) 2005-2008 Federico Villa and Alessio Loro Piana
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 2 of the License.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. For reference, contact bilugcms@vilnet.it
  14. license */ ?>
  15. <?php
  16. $id = (int)$_GET['id'];
  17. $errore = null;
  18. $errore = $_GET["errore"];
  19. $tipoerr = $_GET["tipoerr"];
  20. if($errore=="si")
  21. echo "<h1><img src=\"./img/alert.png\" class=\"ico\" />$tipoerr<img src=\"./img/alert.png\" class=\"ico\" /></h1>";
  22. $annulla = "<input type=\"button\"
  23. class=\"medio\" name=\"Annulla\" value=\"Annulla\" onclick=\"javascript:window.location='area.php?pag=elenco_menu_new.php'\" />";
  24. $str = "SELECT titolo, tipo FROM menutipo WHERE id = '$id' LIMIT 1";
  25. $risultato = mysql_query($str);
  26. if ( mysql_num_rows($risultato) > 0 )
  27. $control = mysql_fetch_row($risultato);
  28. ?>
  29. <div class="contenitore">
  30. <form name="modify_link" method="post" action="insert_sotmenu_link_query.php">
  31. <input type="hidden" name="id" value="<?=$id?>"/>
  32. <!-- il valore di id lo passiamo alla pagina di action con un campo nascosto -->
  33. <h3>link:</h3>
  34. <div class="azzerafloat"></div>
  35. <div class="float100"> <h1>Titolo:</h1> </div>
  36. <div class="float200"> <?=$control[0]?> </div>
  37. <div class="float100"> <h1>Tipo:</h1> </div>
  38. <div class="float100"> <?=$control[1]?> </div>
  39. <br><br>
  40. <div class="float100"> <h1>link:</h1> </div>
  41. <div class="azzerafloat"></div>
  42. <br><br>
  43. <div class="float100"> &nbsp; </div>
  44. <div class="float100"> <h1>news:</h1> </div>
  45. <div class="float20"> <input type="radio" class="little" name="tipolink" value="nw"> </div>
  46. <div class="float500">
  47. <select name="news" onfocus="document.modify_link.tipolink[0].checked='true'">
  48. <option value="">--------</option>
  49. <?php
  50. $strs=" SELECT titolo, argomento, ID FROM notizie WHERE autorizza='si' ORDER BY argomento";
  51. $risultatos=mysql_query($strs);
  52. $argomento=0;
  53. $primo=0;
  54. while( $controls = mysql_fetch_row($risultatos) ) {
  55. if ($argomento != $controls[1]) {
  56. if ($primo!=0) {
  57. echo "</optgroup>";
  58. $primo =1;
  59. }
  60. $str1s=" SELECT argomenti FROM argomenti WHERE ID = '$controls[1]' LIMIT 1";
  61. $risultato2s=mysql_query($str1s);
  62. $control1s=mysql_fetch_row($risultato2s);
  63. echo "<optgroup label=\"$control1s[0]\">";
  64. $argomento=$controls[1];
  65. $link = rurl( $controls[1], 'argo' );
  66. echo "<option value=\"$link\">Argomento: $control1s[0]</option>";
  67. }
  68. $link = rurl( $controls[2], 'news' );
  69. echo "<option value=\"$link\">$controls[0]</option>";
  70. }
  71. ?>
  72. </select>
  73. </div>
  74. <br><br>
  75. <div class="float100"> &nbsp; </div>
  76. <div class="float100"> <h1>statiche:</h1> </div>
  77. <div class="float20"> <input type="radio" class="little" name="tipolink" value="st"></div>
  78. <div class="float500">
  79. <select name="statiche" onfocus="document.modify_link.tipolink[1].checked='true'">
  80. <option value="">--------</option>
  81. <?
  82. $stat=" SELECT id, titolo FROM statiche ORDER BY ordine";
  83. $ristat=mysql_query($stat);
  84. while($statiche=mysql_fetch_row($ristat)) {
  85. $link = rurl( $statiche[0], 'static' );
  86. echo "<option value=\"$link\">$statiche[1]</option>";
  87. }
  88. ?>
  89. </select>
  90. </div>
  91. <br><br>
  92. <div class="float100"> &nbsp; </div>
  93. <div class="float100"> <h1>gallerie:</h1> </div>
  94. <div class="float20"> <input type="radio" class="little" name="tipolink" value="gl"></div>
  95. <div class="float500">
  96. <select name="gallerie" onfocus="document.modify_link.tipolink[2].checked='true'">
  97. <option value="">--------</option>
  98. <?php
  99. $sql = "SELECT id, cartella FROM galleria WHERE id_padre = 0 ORDER BY cartella DESC";
  100. $rssql = mysql_query( $sql );
  101. if ( mysql_num_rows( $rssql ) > 0 ) {
  102. while ( $r = mysql_fetch_row( $rssql ) ){
  103. echo "<optgroup label=\"$r[1]\">";
  104. $link = rurl( $r[0], 'gals' );
  105. echo "<option value=\"$link\">Galleria: $r[1]</option>";
  106. $sql = "SELECT id, cartella FROM galleria WHERE id_padre = $r[0] ORDER BY cartella DESC";
  107. $rssql2 = mysql_query( $sql );
  108. while ( $k = mysql_fetch_row( $rssql2 ) ){
  109. $link = rurl( $k[0], 'gals-sub' );
  110. echo "<option value=\"$link\">$k[1]</option>";
  111. }
  112. echo "</optgroup>";
  113. }
  114. }
  115. ?>
  116. </select>
  117. </div>
  118. <br><br>
  119. <div class="float100"> &nbsp; </div>
  120. <div class="float100"> <h1>interno:</h1> </div>
  121. <div class="float20"> <input type="radio" class="little" name="tipolink" value="in"></div>
  122. <div class="float20">&nbsp;</div>
  123. <div class="float100"> <input type="text" name="int" value="" onfocus="document.modify_link.tipolink[3].checked='true'">
  124. </div>
  125. <br><br>
  126. <div class="float100"> &nbsp; </div>
  127. <div class="float100"> <h1>esterno:</h1> </div>
  128. <div class="float20"> <input type="radio" class="little" name="tipolink" value="ex"></div>
  129. <div class="float20">&nbsp;</div>
  130. <div class="float100"> <input type="text" name="ext" value="" onfocus="document.modify_link.tipolink[4].checked='true'">
  131. </div>
  132. <br><br>
  133. <div class="float100"> &nbsp; </div>
  134. <div class="float100"> <h1>Home:</h1> </div>
  135. <div class="float20"> <input type="radio" class="little" name="tipolink" value="hm"></div>
  136. <div class="float20">&nbsp;</div>
  137. <div class="float100"> &nbsp;
  138. </div>
  139. <br><br>
  140. <div class="float100"> &nbsp; </div>
  141. <div class="float100"> <h1>Scrivici:</h1> </div>
  142. <div class="float20"> <input type="radio" class="little" name="tipolink" value="sc"></div>
  143. <div class="float20">&nbsp;</div>
  144. <div class="float100"> &nbsp;
  145. </div>
  146. <br><br>
  147. <div class="float100"> &nbsp; </div>
  148. <div class="float100"> <h1>Ecommerce:</h1> </div>
  149. <div class="float20"> <input type="radio" class="little" name="tipolink" value="ec"></div>
  150. <div class="float500">
  151. <select name="ecommerce" onfocus="document.modify_link.tipolink[7].checked='true'">
  152. <option value="">--------</option>
  153. <?php
  154. $sql = "
  155. SELECT e.id, e.categoria, l.lingua
  156. FROM ecommercecategoria AS e
  157. INNER JOIN lingue AS l ON l.id = e.id_lingua
  158. WHERE e.id_padre = 0
  159. ";
  160. $rssql = mysql_query( $sql );
  161. if ( mysql_num_rows( $rssql ) > 0 ) {
  162. $link = rurl(0, 'ecommerce');
  163. echo "<option value=\"$link\">Tutti</option>";
  164. while ( $r = mysql_fetch_row( $rssql ) ){
  165. $link = rurl($r[0], 'ecommerce-categorie');
  166. echo "<option value=\"$link\">$r[1]</option>";
  167. select_categorie_ecommerce( $r[0], 0, 0 );
  168. }
  169. }
  170. ?>
  171. </select>
  172. </div>
  173. <br><br>
  174. <div class="float100"> &nbsp; </div>
  175. <div class="float100"> <h1>Nessuno:</h1> </div>
  176. <div class="float20"> <input type="radio" class="little" name="tipolink" value=""></div>
  177. <div class="float20">&nbsp;</div>
  178. <div class="float100"> &nbsp;
  179. </div>
  180. <br><br>
  181. <input class="medio" type="submit" value="invia"/>
  182. <?=$annulla?>
  183. </form>
  184. </div>