Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ilość wyświetlanych rekordów
Marecki669
post
Post #1





Grupa: Zarejestrowani
Postów: 45
Pomógł: 0
Dołączył: 2.06.2012
Skąd: Jarocin

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


Witam, mam pytanie dlaczego jak mam pole select i teraz pierwsze wybiorę zamówienie z id 40 a później zamówienie z id 37 to pokazują się prawidłowo 2 zamówienia. A gdy najpierw zaznaczę zamówienie o id 37 a później o id 40 to wyświetla się tylko jeden. Dlaczego :/ ?

kod PHP pliku wyświetlającego wybrane zamówienia:
  1. function __autoload($class) {
  2. require_once('class/'.$class.'.class.php');
  3. }
  4.  
  5. require_once('config/config.php');
  6.  
  7. $controller = new controller;
  8.  
  9.  
  10.  
  11. $asd = implode(", ",array_keys($_POST['id']));
  12. $d = sizeof($_POST['id']);
  13.  
  14. $ar = explode(",", $asd);
  15.  
  16.  
  17. $html = '';
  18.  
  19. for ($i=0; $i < count($ar); $i++) {
  20.  
  21. mysql_connect("localhost", "~`", "~`") or die(mysql_error());
  22.  
  23.  
  24.  
  25. $db = mysql_query("SELECT * FROM Orders_local WHERE id = '".$ar[$i]."'")or die(mysql_error());
  26. $db1 = mysql_query("SELECT * FROM Orders_products WHERE id_orders_local = '".$ar[$i]."'")or die(mysql_error());
  27.  
  28. while ($ret = mysql_fetch_array($db)) {
  29.  
  30.  
  31.  
  32. if ($ret['fv'] == '1') {
  33. $fv = 'Tak';
  34. }else{
  35. $fv = 'Nie';
  36. }
  37.  
  38. if ($ret['send_form'] == '1') {
  39. $send_form = 'Przesyłka kurierska';
  40. }else if ($ret['send_form'] == '2') {
  41. $send_form = 'List polecony priorytetowy';
  42. }else if ($ret['send_form'] == '3') {
  43. $send_form = 'List polecony ekonomiczny';
  44. }else if ($ret['send_form'] == '4') {
  45. $send_form = 'Paczka pocztowa priorytetowa';
  46. }else if ($ret['send_form'] == '5') {
  47. $send_form = 'Paczka pocztowa ekonomiczna';
  48. }else if ($ret['send_form'] == '6') {
  49. $send_form = 'Paczka24';
  50. }else if ($ret['send_form'] == '7') {
  51. $send_form = 'Paczka48';
  52. }else if ($ret['send_form'] == '8') {
  53. $send_form = 'List ekonomiczny';
  54. }else if ($ret['send_form'] == '9') {
  55. $send_form = 'List priorytetowy';
  56. }else if ($ret['send_form'] == '10') {
  57. $send_form = 'Pocztex Kurier48';
  58. }else if ($ret['send_form'] == '11') {
  59. $send_form = 'Przesyłka pobraniowa priorytetowa / Paczka24 pobranie';
  60. }else if ($ret['send_form'] == '12') {
  61. $send_form = 'Przesyłka pobraniowa / Paczka48 pobranie';
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68. $html .= '
  69.  
  70. <table width="514" border="1">
  71. <tr>
  72. <td colspan="4">Kupujący: '.$ret['nick'].'; Adresat: '.$ret['adres'].'</td>
  73. <td width="127">Faktura: '.$fv.'</td>
  74. </tr>
  75. <tr>
  76. <td width="89">Nr transakcji</td>
  77. <td width="147">Nazwa przedmiotu (nr)</td>
  78. <td width="49">Sztuk</td>
  79. <td width="68">Cena</td>
  80. <td>Data sprzedaży</td>
  81. </tr>';
  82.  
  83. $html .= '
  84. <tr>
  85. <td rowspan="'.($ret['products_number']+1).'">'.$ret['nr_transakcji'].'</td>
  86. </tr>
  87. '; while ($ret1 = mysql_fetch_array($db1)) { for ($i=0; $i < $ret['products_number']-1; $i++) {
  88. $html .= '
  89. <tr>
  90.  
  91. <td>'.$ret1['products'].'</td>
  92. <td>'.$ret1['number'].'</td>
  93. <td>'.$ret1['prise'].'</td>
  94. <td>'.$ret['date_of_sale'].'</td>
  95. </tr>
  96. ';
  97. } }
  98. $html .= '
  99. <tr>
  100. <td colspan="3">Koszty wysyłki</td>
  101. <td>'.$ret['send_prise'].'</td>
  102. <td rowspan="2">&nbsp;</td>
  103. </tr>
  104. <tr>
  105. <td colspan="3">Suma do zapłaty</td>
  106. <td>'.$ret['suma_prise'].'</td>
  107. </tr>
  108. <tr>
  109. <td colspan="5"><p>Forma płatności: '.$ret['pay_form'].'</p>
  110. <p>Sposób dostawy: '.$send_form.'</p></td>
  111. </tr>
  112. </table>';
  113.  
  114. }
  115.  
  116.  
  117.  
  118. }
  119. echo $html;
  120. //include_once("mpdf/testpdf.php");


Ten post edytował Marecki669 21.06.2014, 12:25:18
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 19.08.2025 - 09:14