Pomoc - Szukaj - U¿ytkownicy - Kalendarz
Pe³na wersja: [jportal]co Jest ¼le?
Forum PHP.pl > Forum > Gotowe rozwi±zania
nightspirit
Zroi³em skrypt jPORTALA i nie wiem co jest ¿le
Ps To mój pierszy skrypt
2 Fotki
http://www.korp.pl/~zibi/w/1.gif < Jaki¶ B³±d
http://www.korp.pl/~zibi/w/2.gif < Nie chce dodawaæ sad.gif

module/webdesign.inc.php
  1. <?
  2.  
  3. /*****************************************************/
  4. /* jPORTAL - internetowy system portalowy            */
  5. /*****************************************************/
  6. /* autor: Pawel 'jaco' Jaczewski                     */
  7. /* email: info@websys.pl                             */
  8. /*****************************************************/
  9.  
  10.  
  11. function webdesign_index() {
  12.  
  13. global $webdesign_tbl ;
  14. mysql_query(&#092;"SELECT * FROM $webdesign_tbl ORDER BY id, autor, cena, zobacz1, zobacz2, za
    m
  15. w\");
  16.     $result = mysql_query($query);
  17.     while($r=mysql_fetch_array($result)) {
  18.  
  19. echo'<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\"
  20. style=\"text-align: left;\">
  21. <tbody>
  22. <tr>
  23. <td
  24. style=\"text-align: center; vertical-align: middle; color: rgb(255, 255, 255);\"
  25. rowspan=\"3\" colspan=\"1\"><font size=\"-1\"><img
  26. style=\"width: 135px; height: 123px;\" alt=\"\"
  27. src=\"'.$r[zobacz1].'\"><br>
  28. </font></td>
  29. <td
  30. style=\"color: rgb(255, 255, 255); text-align: justify; vertical-align: middle;\"><font
  31. size=\"-1\">Autor:<br>
  32. </font> </td>
  33. <td
  34. style=\"color: rgb(255, 255, 255); text-align: justify; vertical-align: middle;\"><font
  35. size=\"-1\">'.$r[autor].'<br>
  36. </font></td>
  37. </tr>
  38. <tr>
  39. <td style=\"color: rgb(255, 255, 255); vertical-align: middle;\"><font
  40. size=\"-1\">ID:<br>
  41. </font></td>
  42. <td style=\"color: rgb(255, 255, 255); vertical-align: middle;\"><font
  43. size=\"-1\"><b>'.$r[id].'<br>
  44. </b></font></td>
  45. </tr>
  46. <tr>
  47. <td
  48. style=\"color: rgb(255, 255, 255); text-align: justify; vertical-align: middle;\"><font
  49. size=\"-1\">Cena:<br>
  50. </font> </td>
  51. <td
  52. style=\"color: rgb(255, 255, 255); text-align: justify; vertical-align: middle;\"><font
  53. size=\"-1\">'.$r[cena].'PLN<br>
  54. </font></td>
  55. </tr>
  56. <tr>
  57. <td
  58. style=\"vertical-align: top; color: rgb(255, 255, 255); text-align: center;\"><font
  59. size=\"-1\">[ <a href=\"mailto:'.$r[zamow].'\">zamów</a> ] [ <a
  60. href=\"'.$r[zobacz2].'\">zobacz</a> ]</font> </td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. <hr color=\"#FFFFFF\" align=\"center\" size=\"-1\" width=\"75%\">';
  65.  
  66.  
  67.         
  68.     }
  69. }
  70. ?>


admin/webdesign.adm.php
  1. <?
  2. /*****************************************************/
  3. /*      jPORTAL - internetowy system portalowy       */
  4. /*****************************************************/
  5. /* autor: Pawel 'jaco' Jaczewski                     */
  6. /* email: info@websys.pl                             */
  7. /*****************************************************/
  8.  
  9. function module_start($cmd) {
  10. if($cmd=='dodaj') { dodaj(); }
  11. if($cmd=='edytuj') { edytuj(); }
  12. if($cmd=='usun_nazwa') { usun_nazwa(); }
  13. }
  14.  
  15. function module_main($cmd) {
  16.  
  17. if($cmd=='') {
  18. mn_title_open();
  19. echo 'Zarz&plusmn;dzanie';
  20. mn_title_close();
  21. mn_text_open();
  22. echo '<br>';
  23. zarz();
  24. echo '<br>';
  25. mn_text_close();
  26. }
  27. if($cmd=='') {
  28. mn_title_open(); 
  29. echo 'Dodaj';
  30. mn_title_close();
  31. mn_text_open();
  32. webdesign();
  33. mn_text_close();
  34. }
  35. if($cmd=='edytuj_nazwa') {
  36. mn_title_open();
  37. echo 'Edycja wpisu';
  38. mn_title_close();
  39. mn_text_open();
  40. echo '<br>';
  41. edytuj_nazwa();
  42. echo '<br>';
  43. mn_text_close();
  44. }
  45. }
  46.  
  47. function zarz() {
  48.  
  49. global $PHP_SELF, $webdesign_tbl, $access, $color, $op, $goto;
  50.  
  51. if($access=='root') {
  52. $result = mysql_query(&#092;"SELECT * FROM $webdesign_tbl ORDER BY id, autor, cena, zobacz1, zobacz2, za
    m
  53. w\");
  54. $il = mysql_num_rows($result);
  55.  
  56. if($il==0) {
  57. echo '<table align=\"center\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">
  58. <tr>
  59. <td align=\"right\" valign=\"top\" class=\"uni_01\"><B>Brak</B></td></tr>
  60. </table>';
  61. } else { 
  62. echo '
  63. <table width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" align=\"center\">
  64. <tr> 
  65. <td>
  66. <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#aaaaaa\" align=\"center\">
  67. <tr> 
  68. <td>
  69. <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">';
  70.  
  71.  while($r = mysql_fetch_array($result)) {
  72.  
  73.     $id = $r['id'];
  74.     $autor = $r['autor'];
  75.     $cena = $r['cena'];
  76.     $zobacz1 = $r['zobacz1'];
  77.     $zobacz2 = $r['zobacz2'];
  78.         $zamow = $r['zamow'];
  79.  
  80.  
  81. $akcje = '[ <a href=\"'.$PHP_SELF.'?op='.$op.'&id='.$id.'&cmd=edytuj_nazwa\">edytuj</a> | <a href=\"'.$PHP_SELF.'?op='.$op.'&id='.$id.'&cmd=usun_nazwa\">usuñ</a> ] ';
  82.  
  83. echo '<tr>
  84. <td bgcolor=\"'.$bg.'\" class=\"uni_01\" width=\"28%\">'.$autor.'</td>
  85. <td bgcolor=\"'.$bg.'\" class=\"uni_01\" width=\"28%\">'.$cena.'</td>
  86. <td bgcolor=\"'.$bg.'\" class=\"uni_01\" width=\"28%\">'.$zobacz1.'</td>
  87. <td bgcolor=\"'.$bg.'\" class=\"uni_01\" width=\"28%\">'.$zobacz2.'</td>
  88. <td bgcolor=\"'.$bg.'\" class=\"uni_01\" width=\"28%\">'.$zamow.'</td>
  89. <td bgcolor=\"'.$bg.'\" class=\"uni_01\">'.$akcje.'</td>
  90. </tr>'; 
  91. } echo '</table>
  92. </td>
  93. </tr>
  94. </table>
  95. </td>
  96. </tr>
  97. </table>'; 
  98. }
  99. } else { echo '<b>Nie masz odpowiednich uprawnieñ do wykonywania tej czynno&para;ci.</b><BR>'; }
  100. }
  101.  
  102. function webdesign() {
  103.  
  104. global $PHP_SELF, $access, $op, $goto;
  105.  
  106. if($access=='root') {
  107.  
  108. echo '<form name=\"form1\" method=\"post\" action=\"admin.php?op='.$op.'\">
  109. <table align=\"center\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">
  110. <tr>
  111. <td align=\"right\" class=\"uni_01\">Autor</td>
  112. <td class=\"next\"><input type=\"text\" name=\"autor\" size=\"35\"></td>
  113. </tr>
  114. <td align=\"right\" class=\"uni_01\">Cena</td>
  115. <td class=\"next\"><input type=\"text\" name=\"cena\" size=\"35\"></td>
  116. </tr>
  117. <tr>
  118. <td align=\"right\" class=\"uni_01\">Min img</td>
  119. <td class=\"next\"><input type=\"text\" name=\"zobacz1\" size=\"35\"></td>
  120. </tr>
  121. <tr>
  122. <td align=\"right\" class=\"uni_01\">Big img</td>
  123. <td class=\"next\"><input type=\"text\" name=\"zobacz2\" size=\"15\"></td>
  124. </tr>
  125. <tr>
  126. <td align=\"right\" class=\"uni_01\">E-Mail</td>
  127. <td class=\"next\"><input type=\"text\" name=\"zamow\" size=\"15\"></td>
  128. </tr>
  129. </table><BR><div class=\"uni_01\" align=\"center\">
  130. <input style=\"font-weight: bold;\" type=\"submit\" name=\"ok\" value=\"dodaj\">
  131. <input type=\"hidden\" name=\"goto\" value=\"'.$goto.'\">
  132. <input type=\"hidden\" name=\"cmd\" value=\"dodaj\"></div>
  133. </form>';
  134. } else { echo '<b>Nie masz odpowiednich uprawnieñ do wykonywania tej czynno&para;ci.</b><BR>'; }
  135. }
  136.  
  137. function dodaj() {
  138.  
  139. global $autor, $cena, $zobacz1, $zobacz2, $zamow, $webdesign_tbl, $PHP_SELF, $ac
    cess, $op, $goto;
  140.  
  141. if($access=='root') { 
  142. $result = mysql_query(\"INSERT INTO $webdesign_tbl VALUES(NULL, '$autor', '$cena', '$zobacz1', '$zobacz2', '$zamow')\");
  143.  
  144.  
  145. if($goto=='') header(\"Location: admin.php?op=$op\"); else header(\"Location: $goto\"); exit;
  146. }
  147. }
  148.  
  149. function edytuj_nazwa() {
  150.  
  151. global $PHP_SELF, $webdesign_tbl, $access, $op, $goto, $id;
  152.  
  153. if($access=='root') {
  154.  
  155. $result = mysql_query(\"SELECT * FROM $webdesign_tbl WHERE id=$id\");
  156. $r = mysql_fetch_array($result);
  157.  
  158. $autor = $r['autor'];
  159. $cena = $r['cena'];
  160. $zobacz1 = $r['zobacz1'];
  161. $zobacz2 = $r['zobacz2'];
  162. $zamow = $r['zamow'];
  163.   
  164.  
  165. echo'<form name=\"form2\" method=\"post\" action=\"admin.php?op='.$op.'\">
  166. <table align=\"center\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">
  167. <tr>
  168. <td align=\"right\" class=\"uni_01\">Autor:</td>
  169. <td class=\"next\">
  170. <input type=\"text\" name=\"autor\" size=\"35\" value=\"'.$autor.'\"><input type=\"hidden\" name=\"z\" value=\"'.autor.'\">
  171. </td>
  172. </tr>
  173. <tr>
  174. <td align=\"right\" class=\"uni_01\">Cena:</td>
  175. <td class=\"next\">
  176. <input type=\"text\" name=\"cena\" size=\"35\" value=\"'.$cena.'\"><input type=\"hidden\" value=\"'.$cena.'\">
  177. </td>
  178. </tr>
  179. <tr>
  180. <td align=\"right\" class=\"uni_01\">Min img</td>
  181. <td class=\"next\">
  182. <input type=\"text\" name=\"zobacz1\" size=\"35\" value=\"'.$zobacz1.'\"><input type=\"hidden\" value=\"'.$zobacz1.'\">
  183. </td>
  184. </tr>
  185. <tr>
  186. <td align=\"right\" class=\"uni_01\">Big img</td>
  187. <td class=\"next\">
  188. <input type=\"text\" name=\"zobacz2\" size=\"15\" value=\"'.$zobacz2.'\"><input type=\"hidden\" value=\"'.$zobacz2.'\">
  189. </td>
  190. </tr>
  191. <tr>
  192. <td align=\"right\" class=\"uni_01\">E-Mail</td>
  193. <td class=\"next\">
  194. <input type=\"text\" name=\"zamow\" size=\"15\" value=\"'.$zamow.'\"><input type=\"hidden\" value=\"'.$zamow.'\">
  195. </td>
  196. </tr>
  197. </table><BR><div class=\"uni_01\" align=\"center\">
  198. <input style=\"font-weight: bold;\" type=\"submit\" name=\"ok\" value=\"zapisz\">
  199. <input type=\"hidden\" name=\"goto\" value=\"'.$goto.'\">
  200. <input type=\"hidden\" name=\"cmd\" value=\"edytuj\">
  201. <input type=\"hidden\" name=\"id\" value=\"'.$id.'\">
  202. </div>
  203. </form>
  204. <div class=\"uni_01\" align=\"center\">[<a href=\"javascript:history.back();\"> powrót </a>]</div>';
  205. }
  206. }
  207.  
  208. function edytuj() {
  209.  
  210. global $PHP_SELF, $webdesign_tbl, $id, $autor, $cena, $zobacz1, $zobacz2, $zamow
    , $z, $op, $goto, $access;
  211.  
  212. if($access=='root') {
  213.  
  214. $result = mysql_query(\"UPDATE $webdesign_tbl SET autor='$autor', cena='$cena', zobacz1='$zobacz1', zobacz2='$zobacz2', zamow='$zamow', WHERE id=$id\");
  215.  
  216.  
  217. if($goto=='') header(\"Location: admin.php?op=$op\"); else header(\"Location: $goto\"); exit;
  218. }
  219. }
  220.  
  221. function usun_nazwa() {
  222.  
  223. global $PHP_SELF, $access, $id, $webdesign_tbl, $op, $goto;
  224.  
  225. if($access=='root') { 
  226. $result = mysql_query(\"DELETE FROM $webdesign_tbl WHERE id='$id'\");
  227.  
  228. if($goto=='') header(\"Location: admin.php?op=$op\"); else header(\"Location: $goto\"); exit;
  229. }
  230. }
  231. ?>


admin/webdesign.name
Kod
Webdesign


  1. <?
  2. /*****************************************************/
  3. /*      jPORTAL - internetowy system portalowy       */
  4. /*****************************************************/
  5. /* autor: Pawel 'jaco' Jaczewski                     */
  6. /* email: info@websys.pl                             */
  7. /*****************************************************/
  8.  
  9. include('config.php');
  10. include('module/webdesign.inc.php');
  11.  
  12. function site_main() {
  13.  
  14. global $cmd;
  15.  
  16. if($cmd=='') {
  17. main_title_open(); 
  18. echo 'Webdesign';
  19. main_title_close();
  20. main_text_open(); 
  21. echo '<br>'; 
  22. webdesign_index();
  23. echo '<br>'; 
  24. main_text_close();
  25. }
  26. }
  27. #=====================================================#
  28.  
  29. $site_title = 'Webdesign';
  30. $meta_info = '';
  31.  
  32. include(&#092;"theme/$theme/index.php\");
  33. ?>


Prosze O pomoc co tu jest ¿le exclamation.gif

PS
Zapytnaie SQL
  1. CREATE TABLE webdesign (
  2. id int(4) UNSIGNED NOT NULL AUTO_INCREMENT,
  3. autor varchar(255) NOT NULL DEFAULT '',
  4. cena varchar(255) NOT NULL DEFAULT '',
  5. zobacz1 varchar(255) NOT NULL DEFAULT '',
  6. zobacz2 varchar(255) NOT NULL DEFAULT '',
  7. zamow varchar(255) NOT NULL DEFAULT '',
  8. PRIMARY KEY (id)
  9. ) TYPE=MyISAM;
Riklaunim
a dzia³a jako niezale¿ny skrypt?
To jest wersja lo-fi g³ównej zawarto¶ci. Aby zobaczyæ pe³n± wersjê z wiêksz± zawarto¶ci±, obrazkami i formatowaniem proszê kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.