Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Form i checboxy w funkcji
giz0l
post
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
 
Start new topic
Odpowiedzi
giz0l
post
Post #2





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

Posty w temacie
- giz0l   Form i checboxy w funkcji   17.07.2018, 08:58:14
- - StrefaPi   https://www.johnmorrisonline.com/php-multip...arra...   17.07.2018, 09:04:03
- - giz0l   kiedy tworzę nowy plik php i tam na czysto wklejam...   17.07.2018, 09:14:55
- - StrefaPi   Pokaż całe funkcje   17.07.2018, 09:25:18
- - giz0l   przepraszam jeżeli jest trochę namieszanę ale star...   17.07.2018, 09:30:46
- - nospor   Ale wiesz, ze checkbox jak nie jest zaznaczony to ...   17.07.2018, 10:02:16
- - giz0l   dziękuję za znalezienie literówki a co do wysłaniu...   17.07.2018, 10:38:26
- - nospor   Mozesz pokazac zrodlo wygenerowanej strony w przeg...   17.07.2018, 11:06:40
- - giz0l   przycisk to "edytuj" żrodło: [HTML] pobi...   17.07.2018, 11:19:40
- - nospor   Nie </br> a : <br> ewentualnie <br ...   17.07.2018, 11:25:46
- - giz0l   to nie jest cały kod nie wiem czy jest sens wysyła...   17.07.2018, 11:45:06
- - nospor   Nadal nie poprawiles </br> A pytam o caly ko...   17.07.2018, 11:48:53
- - giz0l   dzielić na pół stronę? bo post jest za długi [HTM...   17.07.2018, 12:17:50
- - nospor   A mozesz jeszcze pokazac co zwraca print_r($_...   17.07.2018, 12:39:48
- - giz0l   Notice: Undefined index: mail_kl in C:\xampp...   17.07.2018, 12:48:28
- - nospor   I wcisnales checkbox? Kurcze, nie widze tam zadneg...   17.07.2018, 12:59:21
- - giz0l   wywalałem już, nawet czystego jednego checkboxa z...   17.07.2018, 13:09:31
- - Toshikatsu   A w celu przetestowania, weź zamień linie [PHP] p...   17.07.2018, 13:34:06
- - giz0l   print na samym początku checbox zaznaczony i zablo...   17.07.2018, 13:38:59


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

 



RSS Aktualny czas: 15.10.2025 - 02:03