Witam, mam prośbę, chciałbym zrobić taką rzecz a mianowicie chodzi mi o to aby jednym przyciskiem na stronie "włączać-wyłączać" czyli wczytywać jakiś skrypt np formularz na stronie, proszę was o pomoc
dziękuje
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script language="Javascript"> function sh(id) { /* predefiniowana tablica z elementami obslugiwanymi przez menu */ modules = new Array('galeria', 'home'); for (i = 0; i < modules.length; i++) { if (i != id) { //alert(modules[i] + ' != ' + modules[id]); document.getElementById(modules[i]).style.display = 'none'; } else { //alert(modules[i] + ' == ' + modules[id]); document.getElementById(modules[i]).style.display = 'block'; } } } </script> </head> <body> </body> </html>
<script type="text/javascript"> <!-- function pokazUkryj(id) { document.getElementById(id).style.display = (document.getElementById(id).style.display == "none") ? "block" : "none"; } --> </script> <!-- UZYCIE --> <input type="button" onclick="javascript:pokazUkryj('menu_1');pokazUkryj('menu_2')" value="Przełącz">
<script type="text/javascript"> <!-- function pokazUkryj(id) { document.getElementById(id).style.display = (document.getElementById(id).style.display == "none") ? "block" : "none"; } --> </script> <!-- UZYCIE --> <input type="button" onclick="javascript:pokazUkryj('menu_1');pokazUkryj('menu_2')" value="Przełącz"> <script language="JavaScript"> <!-- function pokazUkryj(id) { document.getElementById(id).style.display = (document.getElementById(id).style.display == "none") ? "block" : "none"; } function add1textarea(A){ document.nazwa.opis.value+=" "+A+" " } --> </script> <script language="JavaScript"> function add1textarea(A){ document.nazwa_formularza.nazwa_textarea.value+=" "+A+" " } function add2textarea(A){ document.nazwa_formularza.nazwa_textarea.value+=" "+A+" " } </script> <?php print"<form name='nazwa_formularza' method='post' action='usterkiwstaw.php?id=$id&&login=$login&&haslo=$haslo'>"; print" Numer abonenta "; print"<input type='text' name='numer_ust' size='10' style='background-color: #FFFF99; color: red; font-weight:bold; font-size: 12pt'>"; print" Numer kontaktowy: "; print"<input type='text' name='tel_kontaktowy' size='10' style='background-color: #FFFF99; color: red; font-weight:bold; font-size: 12pt'>"; print" Godziny dost. ab.: "; #print "<select name='od_gdz' style='background-color: #CCFF99'>"; #for ($gdz=1; $gdz<=24; $gdz++) { #print "<option value=\"$gdz\">$gdz</option>\n"; #} #print "</select>"; print "od: "; print "<select name='od_gdz' style='background-color: #CCFF99'>"; print"</select>"; print " do: "; print "<select name='gdz' style='background-color: #CCFF99'>"; print"</select>"; #print"<br>"; print "<input type='hidden' name='login' value='$login'>"; print "<input type='hidden' name='haslo' value='$haslo'>"; print"<input type='submit' value=' wyślij dane !!!'>"; print"</form>"; ?> <br> <input type="button" onclick="javascript:add1textarea('zajętość,');" value=" zajętość "> <br> <input type="button" onclick="javascript:add2textarea('brak sygnału,');" value="brak sygnału"> <?php // tabela wyników $polaczenie = odbc_connect('aaa', 'bbb', 'ccc'); if ($polaczenie == true) { $wynik = odbc_exec($polaczenie, 'SELECT * FROM usterki WHERE pobral is null ORDER BY data DESC'); $sql1 = "select count(*) as result from usterki where (pobral is null) "; $wynik1 = odbc_exec($polaczenie,$sql1); $vol = odbc_result($wynik1,1); $field=odbc_num_fields($wynik); $rows =odbc_num_rows($wynik); print "<table border cellspacing='2' cellpadding='2'>"; { } } while ($line = odbc_fetch_array($wynik)) { print "<tr>"; OnClick =\"location.href='usterkiusun.php?id=$line[id] && login=$login && haslo=$haslo'\" onMouseOver=\"this.style.background='#f2f4c6'\" onMouseOut =\"this.style.background='#f3c6bb'\"></td>"; print "</tr>"; } ?> </div> <?php { #print"<br><br>"; $polaczenie = odbc_connect('aaa', 'bbb', 'ccc'); $wynik = odbc_exec($polaczenie, 'select * FROM test WHERE (wykonal is null) ORDER BY data ASC'); $sql1 = "select count(*) as result from test where (wykonal is null) "; $wynik1 = odbc_exec($polaczenie,$sql1); $vol = odbc_result($wynik1,1); $sek=$vol*5; if ($sek>60) { $czas=$sek/60; } $field=odbc_num_fields($wynik); $rows =odbc_num_rows($wynik); print "<table border cellspacing='2' cellpadding='2'>"; { } } while ($line = odbc_fetch_array($wynik)) { print "<tr>"; OnClick =\"location.href='wykonajpotwierdzenie.php?id=$line[id]&&login=$login&&haslo=$haslo&&numer=$line[numer]&&profil=$line[profil]&¢rala=$line[centrala]&&plan=$line[plan]'\" onMouseOver=\"this.style.background='#f2f4c6'\" onMouseOut =\"this.style.background='#f3c6bb'\"></td>"; OnClick =\"location.href='komentarzedycja.php?id=$line[id]&&login=$login&&haslo=$haslo'\" onMouseOver=\"this.style.background='#f2f4c6'\" onMouseOut =\"this.style.background='#f3c6bb'\"></td>"; OnClick =\"window.open('szukajip1.php?search=$line[numer]', 'Wiadomości', 'toolbar,menubar,scrollbars,resizable,height=320,width=520,left=300,top=300')\" onMouseOver=\"this.style.background='#f2f4c6'\" onMouseOut =\"this.style.background='#f3c6bb'\"></td>"; print "</tr>"; } ?> </div>
<body onLoad="javascript:pokazUkryj('menu_1');pokazUkryj('menu_2')">
<?php $polaczenie = odbc_connect('profile', 'projektant', 'sosNa'); if ($polaczenie == true) { $wstaw = "INSERT INTO usterki (data,wystawil,numer,opis,tel_kontaktowy,gdz_dost_ab) VALUES (NOW(),'$login', '$numer_ust','$nazwa_textarea','$tel_kontaktowy','$od_gdz - $do_gdz' )"; $res=odbc_exec($polaczenie,$wstaw); if (odbc_num_rows($res)!=0) { } else { } } #else # echo 'Nie udalo sie polaczyc'; ?>