<th class="text-center">Nazwa</th></th> <th class="text-center">Numer Pesel</th></th> <th class="text-center">Ilość numerów</th> <th class="text-center">Opcje</th> </thead> <tbody class="text-center"> <?php $result = mysql_query("SELECT * FROM customers WHERE (" . $sql . ") AND (length(nr_pes_nip) = 11);") or die(mysql_error()); if ($result) { $i = 1; while ($row = mysql_fetch_assoc($result)) { echo "<tr>"; echo "<td>{$i}</td>"; echo "<td><a href=\"profil.php?id=" . $row['id'] . "\">" . $row['nazwa'] . "</a></td>"; echo "<td>" . $row['nr_pes_nip'] . "</a></td>"; echo "<td><span class=\"badge\">" . how_many_number($row['id']) . "</span></td>"; echo "<td><a href=\"profil.php?id=" . $row['id'] . "\" target=\"_blank\" class=\"btn btn-info btn-sm\">Opcje</a></td>"; echo "</tr>"; $i++; } } ?> </tbody> </table> <?php } ?> </div> </div> </div>
$i = 1; while ($row = mysql_fetch_assoc($result)) { if (!isset($customer)) { $customer = $row['customers_id']; } if ($customer == $row['customers_id'] and $i != 1) { echo "<tr>"; echo "<td class=\"text-center\"><a id=\"" . $i . "\">" . $i . "</a></td>"; echo "<td class=\"text-center\"> </td>"; echo "<td class=\"text-center\"><span class=\"fa fa-mobile\"></span> " . $row['nr_tel'] . "</td>"; echo "<td class=\"text-center\">" . $row['data_zawarcia'] . "</td>"; echo "<tr>"; } else { $customer = $row['customers_id']; echo "<tr>"; echo "<td colspan=\"4\"><h4><a href=\"profil.php?id=" . $row['customers_id'] . "\"><b>" . who_is_name($row['customers_id']) . "</b></a> " . who_is_number($row['customers_id']) . " <span class=\"badge\">" . how_many_number($row['customers_id']) . "</span></h4></td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"text-center\"><a id=\"" . $i . "\">" . $i . "</a></td>"; echo "<td class=\"text-center\"> </td>"; echo "<td class=\"text-center\"><span class=\"fa fa-mobile\"></span> " . $row['nr_tel'] . "</td>"; echo "<td class=\"text-center\">" . $row['data_zawarcia'] . "</td>"; echo "<tr>"; } $i++; } ?> </tbody> </table> <?php } else {
?> <table class="table table-striped table-hover"> <thead> <tr> <th>Imie nazwisko/Nazwa</th> <th class="text-center">Nr Pesel/NIP</th> <th class="text-center">Ilość numerów</th> </tr> </thead> <tbody> <?php while ($row = mysql_fetch_assoc($name_customer)) { echo "<tr>"; echo "<td><a href=\"profil.php?id=" . $row['id'] . "\">" . $row['nazwa'] . "</a></td>"; echo "<td class=\"text-center\">" . $row['nr_pes_nip'] . "</td>"; echo "<td class=\"text-center\"><span class=\"badge\">" . how_many_number($row['id']) . "</td>"; echo "<tr>"; } ?> </tbody> </table> <?php } break; } ?> </div> </div> <?php } else { ?>