Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Form i checboxy w funkcji
giz0l
post 17.07.2018, 08:58:14
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


Witam, z góry przepraszam za wszelkie błędy w konstruowaniu tego posta ale do rzeczy.

Posiadam funkcje która dla forum skróciłem, mam w niej warunki jeden z nich wygląda tak:

  1. if(isset($_GET['info']) && $_GET['info'] == 'edytuj.id'.$row['id'].''){
  2.  
  3.  
  4.  
  5. echo '
  6.  
  7. <form action="dor-eks.php?info=zatwierdz.id'.$row['id'].'" method="POST">
  8. <div class="box-body">
  9.  
  10.  
  11. <input type="checkbox" name="test" class="flat-g" />
  12.  
  13.  
  14. </br>
  15. <input class="btn btn-success" type="submit" value="Edytuj" />
  16. <a class="btn btn-primary" onclick="karta()">Zamknij Proces</a>
  17. <a class="btn btn-primary" href="dor-eks.php">Cofnij</a>
  18. <a class="btn btn-danger" onclick="alert()">Usuń</a>
  19. </div>
  20. </from>';


oraz drugi warunek w funkcji który wywołuję postem:

  1.  
  2. if(isset($_GET['info']) && $_GET['info'] == 'zatwierdz.id'.$row['id'].''){
  3.  
  4.  
  5. print_r($_POST['test']);
  6.  
  7. $this->db->query("UPDATE doreks SET osoba='$osoba', doradca='$doradca', ekspert='$ekspert', data_przek='$data_przek', termin_kon='$termin_kon', tel='$tel', mail='$mail', mail_kl='$mail_kl', zglosz='$zglosz', telcok='$telcok', koneks='$koneks', uwagi='$uwagi' WHERE id='$id'") ;
  8.  
  9. }
  10.  


i problem jest taki że inputy typu "text" post odbiera bez problemu natomiast pole typu checbox nie widzi totalnie printem dostaje informację ": Undefined index: test... " zastanawiam się czy to jest wina że wszystko jest zawarte w funkcji. Czy ktoś ma jakiś pomysł dlaczego tak się dzieje, nie zwracajcie uwagi na inne rzeczy bo tak jak wspomniałem celowo usunąłem niektóre linijki aby było bardziej czytelnie. Na koniec napiszę jeszcze jaki jest mój cel w tym wszystkim. Potrzebuję 4 checkboxów których wartości będą wpisywane do bazy danych czyli np. 1=zaznaczony 0 niezaznaczony. Pozdrawiam
Go to the top of the page
+Quote Post
StrefaPi
post 17.07.2018, 09:04:03
Post #2





Grupa: Zarejestrowani
Postów: 232
Pomógł: 50
Dołączył: 2.03.2013

Ostrzeżenie: (0%)
-----


https://www.johnmorrisonline.com/php-multip...array-handling/


--------------------
https://studiostawki.com - studio fotograficzne i filmowe - ul. Inflancka 11, Warszawa
Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 09:14:55
Post #3





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


kiedy tworzę nowy plik php i tam na czysto wklejam zwykłęgo posta np.
  1. <?php
  2. print_r($_POST);
  3. ?>
  4. <form method="post">
  5. Car <input type="checkbox" name="stuff[car]" value="1" />
  6. Dog <input type="checkbox" name="stuff[dog]" value="1" />
  7. <input type="submit" value="Submit" />
  8. </form>

to wszystko pięknie działa i to już dawno sprawdzałem. Problem ,że nie chce działać w moich warunkach funkcji.
Go to the top of the page
+Quote Post
StrefaPi
post 17.07.2018, 09:25:18
Post #4





Grupa: Zarejestrowani
Postów: 232
Pomógł: 50
Dołączył: 2.03.2013

Ostrzeżenie: (0%)
-----


Pokaż całe funkcje


--------------------
https://studiostawki.com - studio fotograficzne i filmowe - ul. Inflancka 11, Warszawa
Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 09:30:46
Post #5





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


przepraszam jeżeli jest trochę namieszanę ale starałem się jakoś rozwiązać ten problem jeżeli coś jest nie jasne proszę pytać.
  1.  
  2. public function doreks()
  3. {
  4.  
  5. define('PERSON_PER_PAGE', 20);
  6.  
  7. $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
  8. $stan=NULL;
  9.  
  10. $tmp = $this->db->query("SELECT * FROM doreks WHERE stan='$stan' ORDER BY id ASC LIMIT " . ($page -1) * PERSON_PER_PAGE . ', ' . PERSON_PER_PAGE);
  11. $r = $this->db->query("SELECT * FROM doreks WHERE stan='$stan'");
  12.  
  13.  
  14. if (!$tmp->num_rows) {
  15. return false;
  16. }
  17. while($row = mysqli_fetch_array($tmp)) {
  18.  
  19. if(isset($_GET['info']) && $_GET['info'] == 'usun.id'.$row['id'].''){
  20.  
  21. $id = $row['id'];
  22.  
  23. $this->db->query("DELETE FROM doreks WHERE id='$id'") ;
  24. header('Location: ../CokPanel/dor-eks.php'); exit;
  25. }
  26.  
  27.  
  28.  
  29. if(isset($_GET['info']) && $_GET['info'] == 'zatwierdz.id'.$row['id'].''){
  30.  
  31.  
  32.  
  33. $id = $row['id'];
  34. $osoba = $_POST['osoba'];
  35. $doradca = $_POST['doradca'];
  36. $ekspert = $_POST['ekspert'];
  37. $data_przek = $_POST['data_przek'];
  38. $termin_kon = $_POST['termin_kon'];
  39. $tel = $_POST['tel'];
  40. $mail = $_POST['mail'];
  41. //$mail_kl= $_POST['mail_kl'];
  42. //$zglosz = $_POST['zglosz'];
  43. //$telcok = $_POST['telcok'];
  44. //$koneks = $_POST['koneks'];
  45.  
  46.  
  47. if(!empty($_POST['uwagi'])){
  48. $uwagi = $row['uwagi'].' '.$_POST['uwagi'].'</br><i>'.date('h:i \ d-m-Y').'</i></br></br>';
  49. }else{
  50. $uwagi = $row['uwagi'];
  51. }
  52.  
  53.  
  54.  
  55.  
  56. print_r($_POST);
  57.  
  58.  
  59. $this->db->query("UPDATE doreks SET osoba='$osoba', doradca='$doradca', ekspert='$ekspert', data_przek='$data_przek', termin_kon='$termin_kon', tel='$tel', mail='$mail', mail_kl='$mail_kl', zglosz='$zglosz', telcok='$telcok', koneks='$koneks', uwagi='$uwagi' WHERE id='$id'") ;
  60. //header('Location: ../CokPanel/dor-eks.php'); exit;
  61. }
  62. // Zakladanie kary klienta
  63. if(isset($_GET['info']) && $_GET['info'] == 'karta.id'.$row['id'].''){
  64. $id = $row['id'];
  65.  
  66.  
  67. $this->db->query("UPDATE doreks SET stan='1' WHERE id='$id'");
  68.  
  69.  
  70. header('Location: ../CokPanel/dor-eks.php'); exit;
  71. }
  72. if(isset($_GET['info']) && $_GET['info'] == 'edytuj.id'.$row['id'].''){
  73.  
  74. if($row['mail_kl']==1){
  75. $check1="checked";
  76. }else{
  77. $check1="";
  78. }
  79. if($row['telcok']==1){
  80. $check2="checked";
  81. }else{
  82. $check2="";
  83. }
  84. if($row['koneks']==1){
  85. $check3="checked";
  86. }else{
  87. $check3="";
  88. }
  89. if($row['zglosz']==1){
  90. $check4="checked";
  91. }else{
  92. $check4="";
  93. }
  94.  
  95. echo '
  96. <script>
  97. function alert() {
  98. if(confirm("Czy napewno chcesz usunąć tego klienta?")){
  99. window.location = "dor-eks.php?info=usun.id'.$row['id'].'";
  100. }
  101. else
  102. {
  103. window.location = "dor-eks.php?info=edytuj.id'.$row['id'].'";
  104. }
  105.  
  106. }
  107. function karta() {
  108. if(confirm("Czy napewno chcesz zakończyć proces?")){
  109. window.location = "dor-eks.php?info=karta.id'.$row['id'].'";
  110. }
  111. else
  112. {
  113. window.location = "dor-eks.php?info=edytuj.id'.$row['id'].'";
  114. }
  115.  
  116. }
  117. </script>
  118. <form action="dor-eks.php?info=zatwierdz.id'.$row['id'].'" method="POST">
  119. <div class="box-body">
  120.  
  121. <label for="osoba">Imię i Nazwisko:<input class="form-control" type="text" name="osoba" value="'.$row['osoba'].'" id="osoba" required></label>
  122. <label for="doradca">Doradca:<input class="form-control" type="text" value="'.$row['doradca'].'" name="doradca" id="doradca"></label>
  123. <label for="ekspert">Ekspert:<input class="form-control" type="text" value="'.$row['ekspert'].'" name="ekspert" id="ekspert"></label>
  124. <label for="data_przek">Data Przekazania:<input class="form-control" type="data" value="'.$row['data_przek'].'" name="data_przek" id="data_przek"></label>
  125. <label for="termin_kon">Termin Kontaktu:<input class="form-control" type="data" name="termin_kon" value="'.$row['termin_kon'].'" id="termin_kon" ></label>
  126. <label for="tel">Telefon:<input class="form-control" type="text" name="tel" value="'.$row['tel'].'" id="tel" ></label>
  127. <label for="mail">Mail:<input class="form-control" type="text" name="mail" id="mail" value="'.$row['mail'].'"> </label>
  128.  
  129.  
  130. </br>
  131. <span style="margin: 1.3%; color: green;" ><i class="fa fa-envelope" ></i></span>
  132. <span style="margin: 1.2%; color: blue;" ><i class="fa fa-phone" ></i></span>
  133. <span style="margin: 1.7%; color: purple;" ><i class="fa fa-phone-square" ></i></span>
  134. <span style="margin: 0.9%; color: red;" ><i class="fa fa-exclamation-triangle" ></i></span>
  135.  
  136.  
  137. </br>
  138. <span style="margin: 1%;" ><input type="checkbox" name="mail_kl" value="1" class="flat-g" '.$check1.' /></span>
  139. <span style="margin: 1%;" ><input type="checkbox" name="telcok" value="1" id="telcok" class="flat-g" '.$check2.'/></span>
  140. <span style="margin: 1%;" ><input type="checkbox" name="koneks" value="1" id="koneks" class="flat-g" '.$check3.'/></span>
  141. <span style="margin: 1%;" ><input type="checkbox" name="zglosz" value="1" id="zglosz" class="flat-g" '.$check4.'/></span>
  142.  
  143.  
  144. </br></br>
  145. <p>'.$row['uwagi'].'</p>
  146. <label for="uwagi">Uwagi:</label>
  147. <textarea class="form-control" name="uwagi" id="uwagi" rows="2" cols="50"></textarea>
  148.  
  149. </br>
  150. <input class="btn btn-success" type="submit" value="Edytuj" />
  151. <a class="btn btn-primary" onclick="karta()">Zamknij Proces</a>
  152. <a class="btn btn-primary" href="dor-eks.php">Cofnij</a>
  153. <a class="btn btn-danger" onclick="alert()">Usuń</a>
  154. </div>
  155. </from>
  156.  
  157. ';
  158. }
  159. else
  160. {
  161. $atrybuty=array();
  162. if($row['mail_kl'] == 1){
  163. $atrybuty[]='<span style="margin: 4%; color: green;" ><i class="fa fa-envelope" ></i></span>';
  164. }
  165. if($row['telcok'] == 1){
  166. $atrybuty[]='<span style="margin: 4%; color: blue;" ><i class="fa fa-phone" ></i></span>';
  167. }
  168. if($row['koneks'] == 1){
  169. $atrybuty[]='<span style="margin: 4%; color: purple;" ><i class="fa fa-phone-square" ></i></span>';
  170. }
  171. if($row['zglosz'] == 1){
  172. $atrybuty[]='<span style="margin: 4%; color: red;" ><i class="fa fa-exclamation-triangle" ></i></span>';
  173. }
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180. echo '
  181. <tr>
  182. <td>'.$row['osoba'].'</td>
  183. <td>'.$row['doradca'].'</td>
  184. <td>'.$row['ekspert'].'</td>
  185. <td>'.$row['data_przek'].'</td>
  186. <td>';
  187. $n = count($atrybuty);
  188. for ($i=0;$i<$n; $i++)
  189. echo $atrybuty[$i];
  190.  
  191.  
  192. </td>
  193.  
  194.  
  195.  
  196. <td><a class="btn btn-primary" href="dor-eks.php?info=edytuj.id'.$row['id'].'#'.$row['id'].'">Wiecej</a></td>
  197. </tr>
  198. ';
  199.  
  200.  
  201.  
  202. }
  203.  
  204.  
  205. }
  206.  
  207. $articles = mysqli_num_rows($r);
  208. $pages = ceil($articles / PERSON_PER_PAGE);
  209.  
  210. echo '
  211. <div class="box-tools">
  212.  
  213. <div class="box-tools pull-right">
  214. <ul class="pagination pagination-sm inline">
  215. ';
  216. if($pages > 1 && $page != 1) echo '<li><a href="dor-eks.php?page=' . (intval($page) - 1) . ' class="active"">&laquo;</a></li>';
  217. // for($i = 1; $i <= $pages; $i++) echo '<li><a href="baza.php?page=' . $i . '">' . $i . '</a><li>';
  218. echo '<li class="disabled"><a>'.$page.'</a></li>';
  219. if($pages > 1 && $page != $pages) echo '<li><a href="dor-eks.php?page=' . (intval($page) + 1) . '">&raquo;</a><li>';
  220. echo '
  221. </ul>
  222. </div>
  223. </div>';
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. }
  231.  


Ten post edytował giz0l 17.07.2018, 09:44:20
Go to the top of the page
+Quote Post
nospor
post 17.07.2018, 10:02:16
Post #6





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




Ale wiesz, ze checkbox jak nie jest zaznaczony to NIE JEST wysylany a tym samym nie ma go w $_POST? Pojawia sie tam dopiero gdy go wcisniesz.

Kolejna sprawa:
nie ma czegos takiego jak </from>
Jest </form>

ps: Przenosze


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 10:38:26
Post #7





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


dziękuję za znalezienie literówki a co do wysłaniu checboxa tak zdaję sobie z tego sprawę tworzyłem nawet taki kod:

  1. if(empty($_POST['mail_kl'])){
  2. $mail_kl=2;
  3. }else{
  4. $mail_kl = $_POST['mail_kl'];
  5. }
  6.  
  7. if(empty($_POST['zglosz'])){
  8. $zglosz=0;
  9. }else{
  10. $zglosz = $_POST['zglosz'];
  11. }
  12.  
  13. if(empty($_POST['telcok'])){
  14. $telcok=0;
  15. }else{
  16. $telcok = $_POST['telcok'];
  17. }
  18.  
  19. if(empty($_POST['koneks'])){
  20. $koneks=0;
  21. }else{
  22. $koneks = $_POST['koneks'];
  23. }

ale narazie jest zawieszony ze względu że i tak POST nie pobiera mi nawet zaznaczonego checboxa zawsze zwraca wartość ze nie ma czegoś takiego jak np. telcok czy zglosz pomimo ze chcebox jest zaznaczony
Go to the top of the page
+Quote Post
nospor
post 17.07.2018, 11:06:40
Post #8





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




Mozesz pokazac zrodlo wygenerowanej strony w przegladarce? (CTRL+U w wiekszosci przegladarek) I ktory guzik wciskasz by wyslac tego forma?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 11:19:40
Post #9





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


przycisk to "edytuj"
żrodło:
  1. <form action="dor-eks.php?info=zatwierdz.id0" method="POST">
  2. <div class="box-body">
  3.  
  4. <label for="osoba">Imię i Nazwisko:<input class="form-control" type="text" name="osoba" value="Marek Krzak" id="osoba" required></label>
  5. <label for="doradca">Doradca:<input class="form-control" type="text" value="Piotr" name="doradca" id="doradca"></label>
  6. <label for="ekspert">Ekspert:<input class="form-control" type="text" value="Paweł" name="ekspert" id="ekspert"></label>
  7. <label for="data_przek">Data Przekazania:<input class="form-control" type="data" value="2018-07-11" name="data_przek" id="data_przek"></label>
  8. <label for="termin_kon">Termin Kontaktu:<input class="form-control" type="data" name="termin_kon" value="2018-07-16" id="termin_kon" ></label>
  9. <label for="tel">Telefon:<input class="form-control" type="text" name="tel" value="7657334765" id="tel" ></label>
  10. <label for="mail">Mail:<input class="form-control" type="text" name="mail" id="mail" value="marekkrzak@wp.pl"> </label>
  11.  
  12.  
  13.  
  14. </br>
  15. <span style="margin: 1.3%; color: green;" ><i class="fa fa-envelope" ></i></span>
  16. <span style="margin: 1.2%; color: blue;" ><i class="fa fa-phone" ></i></span>
  17. <span style="margin: 1.7%; color: purple;" ><i class="fa fa-phone-square" ></i></span>
  18. <span style="margin: 0.9%; color: red;" ><i class="fa fa-exclamation-triangle" ></i></span>
  19.  
  20.  
  21. </br>
  22. <span style="margin: 1%;" ><input type="checkbox" name="mail_kl" value="1" class="flat-g" /></span>
  23. <span style="margin: 1%;" ><input type="checkbox" name="telcok" value="1" id="telcok" class="flat-g" /></span>
  24. <span style="margin: 1%;" ><input type="checkbox" name="koneks" value="1" id="koneks" class="flat-g" /></span>
  25. <span style="margin: 1%;" ><input type="checkbox" name="zglosz" value="1" id="zglosz" class="flat-g" /></span>
  26.  
  27.  
  28. </br></br>
  29. <p>jakies tam uwagi dodaje uwage</br><i>09:52 11-07-2018</i></br></br> kolejna uwaga test</br><i>09:52 11-07-2018</i></br></br></p>
  30. <label for="uwagi">Uwagi:</label>
  31. <textarea class="form-control" name="uwagi" id="uwagi" rows="2" cols="50"></textarea>
  32.  
  33. </br>
  34. <input class="btn btn-success" type="submit" value="Edytuj" />
  35. <a class="btn btn-primary" onclick="karta()">Zamknij Proces</a>
  36. <a class="btn btn-primary" href="dor-eks.php">Cofnij</a>
  37. <a class="btn btn-danger" onclick="alert()">Usuń</a>
  38. </div>
  39. </form>


sytuacja jest o tyle ciekawa że inputy text są pobierane bez problemu natomiast checkbox już nie. Na początku myślałem ,że to wina odczytywania wielu checboxow wiec bawiłem sie też w tablice typu test[] i próbowałem odczytywać foreach'em ale to bez sensu bo i tak blokujemy się na tym że post nie pobiera tych inputów
Go to the top of the page
+Quote Post
nospor
post 17.07.2018, 11:25:46
Post #10





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




Nie </br>
a : <br> ewentualnie <br />

Czy to jest caly kod strony? Nie ma tam nic wiecej/wczesniej/pozniej?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 11:45:06
Post #11





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


to nie jest cały kod nie wiem czy jest sens wysyłać cały więc wyśle sekcje
  1. <section class="content">
  2.  
  3. <div class="row">
  4.  
  5.  
  6. </br>
  7.  
  8.  
  9. <div class="col-xs-12">
  10. <div class="box">
  11. <div class="box-header">
  12. <h3 class="box-title">Doradca - Ekspert</h3>
  13. <div class="box-tools">
  14. </div>
  15. </div><!-- /.box-header -->
  16. <div class="box-body table-responsive no-padding">
  17. <table class="table table-bordered table-striped">
  18. <tr>
  19. <th style="cursor: pointer;" onclick="attachSorting()" class="ISort" >Imię i Nazwisko</th>
  20. <th style="cursor: pointer;" onclick="attachSorting()" class="SSort" >Doradca</th>
  21. <th style="cursor: pointer;" onclick="attachSorting()" class="SSort" >Ekspert</th>
  22. <th style="cursor: pointer;" onclick="attachSorting()" class="ISort" >Data Przekazania</th>
  23. <th></th>
  24. <th></th>
  25. </tr>
  26.  
  27. function alert() {
  28. if(confirm("Czy napewno chcesz usunąć tego klienta?")){
  29. window.location = "dor-eks.php?info=usun.id0";
  30. }
  31. else
  32. {
  33. window.location = "dor-eks.php?info=edytuj.id0";
  34. }
  35.  
  36. }
  37. function karta() {
  38. if(confirm("Czy napewno chcesz zakończyć proces?")){
  39. window.location = "dor-eks.php?info=karta.id0";
  40. }
  41. else
  42. {
  43. window.location = "dor-eks.php?info=edytuj.id0";
  44. }
  45.  
  46. }
  47. </script>
  48. <form action="dor-eks.php?info=zatwierdz.id0" method="POST">
  49. <div class="box-body">
  50.  
  51. <label for="osoba">Imię i Nazwisko:<input class="form-control" type="text" name="osoba" value="Marek Krzak" id="osoba" required></label>
  52. <label for="doradca">Doradca:<input class="form-control" type="text" value="Piotr" name="doradca" id="doradca"></label>
  53. <label for="ekspert">Ekspert:<input class="form-control" type="text" value="Paweł" name="ekspert" id="ekspert"></label>
  54. <label for="data_przek">Data Przekazania:<input class="form-control" type="data" value="2018-07-11" name="data_przek" id="data_przek"></label>
  55. <label for="termin_kon">Termin Kontaktu:<input class="form-control" type="data" name="termin_kon" value="2018-07-16" id="termin_kon" ></label>
  56. <label for="tel">Telefon:<input class="form-control" type="text" name="tel" value="7657334765" id="tel" ></label>
  57. <label for="mail">Mail:<input class="form-control" type="text" name="mail" id="mail" value="marekkrzak@wp.pl"> </label>
  58.  
  59.  
  60.  
  61. </br>
  62. <span style="margin: 1.3%; color: green;" ><i class="fa fa-envelope" ></i></span>
  63. <span style="margin: 1.2%; color: blue;" ><i class="fa fa-phone" ></i></span>
  64. <span style="margin: 1.7%; color: purple;" ><i class="fa fa-phone-square" ></i></span>
  65. <span style="margin: 0.9%; color: red;" ><i class="fa fa-exclamation-triangle" ></i></span>
  66.  
  67.  
  68. </br>
  69. <span style="margin: 1%;" ><input type="checkbox" name="mail_kl" value="1" class="flat-g" /></span>
  70. <span style="margin: 1%;" ><input type="checkbox" name="telcok" value="1" id="telcok" class="flat-g" /></span>
  71. <span style="margin: 1%;" ><input type="checkbox" name="koneks" value="1" id="koneks" class="flat-g" /></span>
  72. <span style="margin: 1%;" ><input type="checkbox" name="zglosz" value="1" id="zglosz" class="flat-g" /></span>
  73.  
  74.  
  75. </br></br>
  76. <p>jakies tam uwagi dodaje uwage</br><i>09:52 11-07-2018</i></br></br> kolejna uwaga test</br><i>09:52 11-07-2018</i></br></br></p>
  77. <label for="uwagi">Uwagi:</label>
  78. <textarea class="form-control" name="uwagi" id="uwagi" rows="2" cols="50"></textarea>
  79.  
  80. </br>
  81. <input class="btn btn-success" type="submit" value="Edytuj" />
  82. <a class="btn btn-primary" onclick="karta()">Zamknij Proces</a>
  83. <a class="btn btn-primary" href="dor-eks.php">Cofnij</a>
  84. <a class="btn btn-danger" onclick="alert()">Usuń</a>
  85. </div>
  86. </form>
  87.  
  88.  
  89. <div class="box-tools">
  90.  
  91. <div class="box-tools pull-right">
  92. <ul class="pagination pagination-sm inline">
  93. <li class="disabled"><a>1</a></li>
  94. </ul>
  95. </div>
  96. </div>
  97.  
  98.  
  99.  
  100. </table>
  101. </div><!-- /.box-body -->
  102. </div><!-- /.box -->
  103. </div>
  104.  
  105. </div>
  106.  
  107. </section><!-- /.content -->

niestety nie wiem czemu kod się tak rozpada po wklejeniu tutaj i jest trochę nieczytelny.
Go to the top of the page
+Quote Post
nospor
post 17.07.2018, 11:48:53
Post #12





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




Nadal nie poprawiles </br>
A pytam o caly kod bo moze tam sa dodatkowe bledy ktore wplywaja na formularz. Na chwile obecna procz </br> nie widze nic zlego


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 12:17:50
Post #13





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


dzielić na pół stronę? bo post jest za długi

  1.  
  2. <!DOCTYPE html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title> Panel</title>
  6. <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  7. <!-- Bootstrap 3.3.2 -->
  8. <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  9. <!-- FontAwesome 4.3.0 -->
  10. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  11. <!-- Ionicons 2.0.0 -->
  12. <link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />
  13. <!-- Theme style -->
  14. <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
  15. <!-- AdminLTE Skins. Choose a skin from the css/skins
  16. folder instead of downloading all of them to reduce the load. -->
  17. <link href="dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
  18. <!-- iCheck -->
  19. <link href="plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
  20. <!-- Morris chart -->
  21. <link href="plugins/morris/morris.css" rel="stylesheet" type="text/css" />
  22. <!-- jvectormap -->
  23. <link href="plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
  24. <!-- Date Picker -->
  25. <link href="plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
  26. <!-- Daterange picker -->
  27. <link href="plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
  28. <!-- bootstrap wysihtml5 - text editor -->
  29. <link href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />
  30. <link rel="shortcut icon" href="../../assets/ico/favicon.png">
  31. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  32. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  33. <!--[if lt IE 9]>
  34. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  35. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  36. <![endif]-->
  37. </head>
  38. <body class="skin-blue">
  39. <div class="wrapper">
  40.  
  41. <header class="main-header">
  42. <!-- Logo -->
  43. <a href="index.php" class="logo"><b>hhh</b>hhh</a>
  44. <!-- Header Navbar: style can be found in header.less -->
  45. <nav class="navbar navbar-static-top" role="navigation">
  46. <!-- Sidebar toggle button-->
  47. <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
  48. </a>
  49. <div class="navbar-custom-menu">
  50. <ul class="nav navbar-nav">
  51. <!-- User Account: style can be found in dropdown.less -->
  52. <li class="dropdown user user-menu">
  53. <a href="../../skrypty/logout.php"">
  54. <img src="dist/img/n.jpg" class="user-image" alt="User Image"/> <!-- <img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image"/> -->
  55. <span >Wyloguj Się</span>
  56. </a>
  57. </li>
  58. </ul>
  59. </div>
  60. </nav>
  61. </header>
  62. <!-- Left side column. contains the logo and sidebar -->
  63. <aside class="main-sidebar">
  64. <!-- sidebar: style can be found in sidebar.less -->
  65. <section class="sidebar">
  66. <!-- Sidebar user panel -->
  67. <div class="user-panel">
  68. <div class="pull-left image">
  69. <img src="dist/img/n.jpg" class="img-circle" alt="User Image"/>" </div>
  70. <div class="pull-left info">
  71. <p>Imie Nazwisko</p>
  72. <p style="font-weight: 500; color: grey;" >Centrum Obsługi<br> Klienta</p>
  73. </div>
  74. </div>
  75. <!-- /.search form -->
  76. <!-- sidebar menu: : style can be found in sidebar.less -->
  77. <ul class="sidebar-menu">
  78. <li class="header">Menu</li>
  79. <li>
  80. <a href="index.php"><i class="fa fa-home"></i> <span>Strona Głowna</span></a>
  81. <a href="baza.php"><i class="fa fa-database"></i> <span>Baza</span></a>
  82. <a href="klienci.php"><i class="fa fa-users"></i> <span>Klienci ddd</span></a>
  83. <a href="dor-eks.php"><i class="fa fa-exchange"></i> <span>Doradca - Ekspert</span></a>
  84. <a href="szukaj.php"><i class="fa fa-search"></i> <span>Wyszukiwarka</span></a>
  85.  
  86. </li>
  87. <li class="header">Zarządzanie</li>
  88. <li><a href="billing.php"><i class="fa fa-phone"></i> Dodaj Billling</a></li>
  89. </ul>
  90. </section>
  91. <!-- /.sidebar -->
  92. </aside>
  93.  
  94. <!-- Right side column. Contains the navbar and content of the page -->
  95. <div class="content-wrapper">
  96. <!-- Content Header (Page header) -->
  97. <section class="content-header">
  98. <h1>Centrum Obsługi Klienta</h1>
  99. </section>
  100. <!-- Main content -->
  101. <section class="content">
  102.  
  103. <div class="row">
  104.  
  105.  
  106.  
  107.  
  108.  
  109. <br>
  110.  
  111.  
  112. <div class="col-xs-12">
  113. <div class="box">
  114. <div class="box-header">
  115. <h3 class="box-title">Doradca - Ekspert</h3>
  116. <div class="box-tools">
  117. </div>
  118. </div><!-- /.box-header -->
  119. <div class="box-body table-responsive no-padding">
  120. <table class="table table-bordered table-striped">
  121. <tr>
  122. <th style="cursor: pointer;" onclick="attachSorting()" class="ISort" >Imię i Nazwisko</th>
  123. <th style="cursor: pointer;" onclick="attachSorting()" class="SSort" >Doradca</th>
  124. <th style="cursor: pointer;" onclick="attachSorting()" class="SSort" >Ekspert</th>
  125. <th style="cursor: pointer;" onclick="attachSorting()" class="ISort" >Data Przekazania</th>
  126. <th></th>
  127. <th></th>
  128. </tr>




  1. function alert() {
  2. if(confirm("Czy napewno chcesz usunąć tego klienta?")){
  3. window.location = "dor-eks.php?info=usun.id0";
  4. }
  5. else
  6. {
  7. window.location = "dor-eks.php?info=edytuj.id0";
  8. }
  9.  
  10. }
  11. function karta() {
  12. if(confirm("Czy napewno chcesz zakończyć proces?")){
  13. window.location = "dor-eks.php?info=karta.id0";
  14. }
  15. else
  16. {
  17. window.location = "dor-eks.php?info=edytuj.id0";
  18. }
  19.  
  20. }
  21. </script>
  22. <form action="dor-eks.php?info=zatwierdz.id0" method="POST">
  23. <div class="box-body">
  24.  
  25. <label for="osoba">Imię i Nazwisko:<input class="form-control" type="text" name="osoba" value="Marek Krzak" id="osoba" required></label>
  26. <label for="doradca">Doradca:<input class="form-control" type="text" value="Piotr" name="doradca" id="doradca"></label>
  27. <label for="ekspert">Ekspert:<input class="form-control" type="text" value="Paweł" name="ekspert" id="ekspert"></label>
  28. <label for="data_przek">Data Przekazania:<input class="form-control" type="data" value="2018-07-11" name="data_przek" id="data_przek"></label>
  29. <label for="termin_kon">Termin Kontaktu:<input class="form-control" type="data" name="termin_kon" value="2018-07-16" id="termin_kon" ></label>
  30. <label for="tel">Telefon:<input class="form-control" type="text" name="tel" value="7657334765" id="tel" ></label>
  31. <label for="mail">Mail:<input class="form-control" type="text" name="mail" id="mail" value="marekkrzak@wp.pl"> </label>
  32.  
  33.  
  34.  
  35. <br>
  36. <span style="margin: 1.3%; color: green;" ><i class="fa fa-envelope" ></i></span>
  37. <span style="margin: 1.2%; color: blue;" ><i class="fa fa-phone" ></i></span>
  38. <span style="margin: 1.7%; color: purple;" ><i class="fa fa-phone-square" ></i></span>
  39. <span style="margin: 0.9%; color: red;" ><i class="fa fa-exclamation-triangle" ></i></span>
  40.  
  41.  
  42. <br>
  43. <span style="margin: 1%;" ><input type="checkbox" name="mail_kl" value="1" class="flat-g" /></span>
  44. <span style="margin: 1%;" ><input type="checkbox" name="telcok" value="1" id="telcok" class="flat-g" /></span>
  45. <span style="margin: 1%;" ><input type="checkbox" name="koneks" value="1" id="koneks" class="flat-g" /></span>
  46. <span style="margin: 1%;" ><input type="checkbox" name="zglosz" value="1" id="zglosz" class="flat-g" /></span>
  47.  
  48.  
  49. <br><br>
  50. <p>jakies tam uwagi dodaje uwage<br><i>09:52 11-07-2018</i><br><br> kolejna uwaga test<br><i>09:52 11-07-2018</i><br><br></p>
  51. <label for="uwagi">Uwagi:</label>
  52. <textarea class="form-control" name="uwagi" id="uwagi" rows="2" cols="50"></textarea>
  53.  
  54. <br>
  55. <input class="btn btn-success" type="submit" value="Edytuj" />
  56. <a class="btn btn-primary" onclick="karta()">Zamknij Proces</a>
  57. <a class="btn btn-primary" href="dor-eks.php">Cofnij</a>
  58. <a class="btn btn-danger" onclick="alert()">Usuń</a>
  59. </div>
  60. </form>
  61.  
  62.  
  63. <div class="box-tools">
  64.  
  65. <div class="box-tools pull-right">
  66. <ul class="pagination pagination-sm inline">
  67. <li class="disabled"><a>1</a></li>
  68. </ul>
  69. </div>
  70. </div>
  71.  
  72.  
  73.  
  74. </table>
  75. </div><!-- /.box-body -->
  76. </div><!-- /.box -->
  77. </div>
  78.  
  79. </div>
  80.  
  81. </section><!-- /.content -->
  82. </div><!-- /.content-wrapper -->
  83. </div><!-- ./wrapper -->
  84.  
  85. <!-- jQuery 2.1.3 -->
  86. <script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
  87. <!-- jQuery UI 1.11.2 -->
  88. <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.min.js" type="text/javascript"></script>
  89. <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  90. $.widget.bridge('uibutton', $.ui.button);
  91. </script>
  92. <script src="bootstrap/js/main.js" type="text/javascript"></script>
  93. <!-- Bootstrap 3.3.2 JS -->
  94. <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
  95. <!-- Morris.js charts -->
  96. <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
  97. <script src="plugins/morris/morris.min.js" type="text/javascript"></script>
  98. <!-- Sparkline -->
  99. <script src="plugins/sparkline/jquery.sparkline.min.js" type="text/javascript"></script>
  100. <!-- jvectormap -->
  101. <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" type="text/javascript"></script>
  102. <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js" type="text/javascript"></script>
  103. <!-- jQuery Knob Chart -->
  104. <script src="plugins/knob/jquery.knob.js" type="text/javascript"></script>
  105. <!-- daterangepicker -->
  106. <script src="plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
  107. <!-- datepicker -->
  108. <script src="plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
  109. <!-- Bootstrap WYSIHTML5 -->
  110. <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
  111. <!-- iCheck -->
  112. <script src="plugins/iCheck/icheck.min.js" type="text/javascript"></script>
  113. <!-- Slimscroll -->
  114. <script src="plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
  115. <!-- FastClick -->
  116. <script src='plugins/fastclick/fastclick.min.js'></script>
  117. <!-- AdminLTE App -->
  118. <script src="dist/js/app.min.js" type="text/javascript"></script>
  119.  
  120. <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  121. <script src="dist/js/pages/dashboard.js" type="text/javascript"></script>
  122.  
  123. <!-- AdminLTE for demo purposes -->
  124. <script src="dist/js/demo.js" type="text/javascript"></script>
  125. </body>
  126. </html>
  127.  


Ten post edytował giz0l 17.07.2018, 12:17:03
Go to the top of the page
+Quote Post
nospor
post 17.07.2018, 12:39:48
Post #14





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




A mozesz jeszcze pokazac co zwraca
print_r($_POST);
Gdy zaznaczysz jakies checkbox i wyslesz forma?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 12:48:28
Post #15





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


Notice: Undefined index: mail_kl in C:\xampp\htdocs\Panel\skrypty\includes\functions.php on line 4592

Notice: Undefined index: zglosz in C:\xampp\htdocs\Panel\skrypty\includes\functions.php on line 4593

Notice: Undefined index: telcok in C:\xampp\htdocs\Panel\skrypty\includes\functions.php on line 4594

Notice: Undefined index: koneks in C:\xampp\htdocs\Panel\skrypty\includes\functions.php on line 4595
Array ( [osoba] => Marek Krzak [doradca] => Piotr [ekspert] => Paweł [data_przek] => 2018-07-11 [termin_kon] => 2018-07-16 [tel] => 7657334765 [mail] => marekkrzak@wp.pl [uwagi] => )

linijki to:
  1. $mail_kl = $_POST['mail_kl'];
  2. $zglosz = $_POST['zglosz'];
  3. $telcok = $_POST['telcok'];
  4. $koneks = $_POST['koneks'];
Go to the top of the page
+Quote Post
nospor
post 17.07.2018, 12:59:21
Post #16





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




I wcisnales checkbox? Kurcze, nie widze tam zadnego bledu w kodzie :/ Wywal moze jeszcze te SPAN dookola tych checkbox


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 13:09:31
Post #17





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


wywalałem już, nawet czystego jednego checkboxa zostawiałem i sprawdzałem ale też nic testowałem na polu select działa normalnie ;/ Jestem z osób które naprawdę jak piszą posta na forum to mają duży problem bo zazwyczaj wszystko jest w internecie tylko trzeba poświecić czas ale 2 dni to już trochę długo a terminy gonią smile.gif Miałem też przypuszczenia że w momencie wysyłania/przekierowywania te checkboxy się odznaczają same ale nie wiem czy to wgl możliwe biggrin.gif
Go to the top of the page
+Quote Post
Toshikatsu
post 17.07.2018, 13:34:06
Post #18





Grupa: Zarejestrowani
Postów: 26
Pomógł: 3
Dołączył: 18.10.2017

Ostrzeżenie: (0%)
-----


A w celu przetestowania, weź zamień linie

  1. <span style="margin: 1%;" ><input type="checkbox" name="koneks" value="1" id="koneks" class="flat-g" /></span>
  2. <span style="margin: 1%;" ><input type="checkbox" name="zglosz" value="1" id="zglosz" class="flat-g" /></span>


na:

  1. <span style="margin: 1%;" ><input type="checkbox" name="koneks" value="1" id="koneks" class="flat-g" checked disabled/></span>
  2. <span style="margin: 1%;" ><input type="checkbox" name="zgloszcheckbox" value="1" id="zglosz" class="flat-g" /></span>


I podaj co zwraca
print_r($_POST);
Najlepiej by było jakbyś wrzucił w ogóle tego printa na początek funkcji w której obrabiasz POST'a
Go to the top of the page
+Quote Post
giz0l
post 17.07.2018, 13:38:59
Post #19





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 17.07.2018

Ostrzeżenie: (0%)
-----


print na samym początku checbox zaznaczony i zablokowany sytuacja dalej ta sama wgl nie znajduję takiego i inputa
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.03.2024 - 19:46