Guest User

Untitled

a guest
Nov 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.02 KB | None | 0 0
  1. <?php
  2.  
  3. if (isset($_POST['checked_v']) && $_POST['checked_w']) {
  4.     $foo = array();
  5.     $foo = array_merge($_POST['checked_v'], $_POST['checked_w']);
  6.     $id_list = join(",",$foo );
  7.     $id_list2 = mysql_real_escape_string($id_list);
  8.     $ergebnis = mysql_query("SELECT * FROM asonators WHERE id IN ($id_list2)") or die(mysql_error());
  9. } elseif (!isset($_POST['checked_w']) && (isset($_POST['checked_v']))) {
  10. $foo = array();
  11. $foo = $_POST['checked_v'];
  12.     $id_list = join(",",$foo );
  13.     $id_list2 = mysql_real_escape_string($id_list);
  14.     $ergebnis = mysql_query("SELECT * FROM asonators WHERE id IN ($id_list2)") or die(mysql_error());
  15. } elseif (!isset($_POST['checked_v']) && (isset($_POST['checked_w']))) {
  16. $foo = array();
  17. $foo = $_POST['checked_w'];
  18.     $id_list = join(",",$foo );
  19.     $id_list2 = mysql_real_escape_string($id_list);
  20.     $ergebnis = mysql_query("SELECT * FROM asonators WHERE id IN ($id_list2)") or die(mysql_error());
  21. } elseif (!isset($_POST['checked_v']) && (!isset($_POST['checked_w']))) {
  22.     $ergebnis = mysql_query("SELECT * FROM asonators");
  23. }
  24.  
  25.  
  26.     while($row = mysql_fetch_object($ergebnis))
  27.     {
  28.            
  29.         switch($row->type)
  30.         {
  31.             case "E100":
  32.                 $aso_type = "E100.gif";
  33.                 break;
  34.            
  35.             case "100":
  36.                 $aso_type = "100.gif";
  37.                 break;
  38.        
  39.             case "600":
  40.                 $aso_type = "600_102_70.gif";
  41.                 break;
  42.                  
  43.             default:
  44.                 $aso_type = "nopic.gif";
  45.         }  
  46.      
  47.         echo "<br>";
  48.         echo "<table>";
  49.         echo "<td>";
  50.         echo "<b>Type: ";
  51.         echo $row->name;
  52.         echo "</td>";
  53.         echo "<td></b> <img src='gfx/$aso_type' width='50%' alt='$aso_type'><td>";
  54.         echo "<tr>";
  55.         echo "<td>ID: </td>";
  56.         echo "<td>",$row->id,"</td>";
  57.         echo "<tr>";
  58.         echo "<td><b>Typenreihe: </b></td>";
  59.         echo "<td><b>",$row->type,"</b></td>";
  60.         echo "<tr>";
  61.         echo "<td>min. Belastung F1: </td>";
  62.         echo "<td>",$row->minimum_load," N</td>";
  63.         echo "<tr>";
  64.         echo "<td>max. Belastung F2: </td>";
  65.         echo "<td>",$row->maximum_load," N</td>";
  66.         echo "<tr>";
  67.         echo "<td>Hoehe bei F1: </td>";
  68.         echo "<td>",$row->height_minimum_load," mm</td>";
  69.         echo "<tr>";
  70.         echo "<td>Hoehe bei F2: </td>";
  71.         echo "<td>",$row->height_maximum_load," mm</td>";
  72.         echo "<tr>";
  73.         echo "<td>Hoehe unbelastet: </td>";
  74.         echo "<td>",$row->hight_without_load," mm</td>";
  75.         echo "<tr>";
  76.         echo "<td>Federrate: </td>";
  77.         echo "<td>",$row->springrate," N/mm</td>";
  78.         echo "<tr>";
  79.         echo "<td>Gewicht: </td>";
  80.         echo "<td>",$row->weight," kg</td>";
  81.         echo "<tr>";
  82.         echo "<td>Preis (Brutto): </td>";
  83.         $price = $row->price*1.2;
  84.         echo "<td>$price Euro</td>";
  85.         echo "<tr>";
  86.         echo "</table>";
  87.         echo "<br/>";
  88.      
  89.     }
  90.   ?>
Add Comment
Please, Sign In to add comment