Location: PHPKode > projects > Caleb's Code > Cafe_Cart/classes/sizes.php
<?php

$product_size_names = array(
  '1'  => 'Kids Small',
  '2'  => 'Kids Medium',
  '3'  => 'Kids Large',
  '4'  => 'Small',
  '5'  => 'Medium',
  '6'  => 'Large',
  '7'  => 'X-Large',
  '8'  => '2X-Large (+$3.00)',
  '9'  => '3X-Large (+$3.00)',
  '10' => '4X-Large (+$3.00)',
  '11' => 'X-Small'
  );

function showsizes($prod,$item) {
   global $pntable,$selected_size;
   $product_sizes = array(
      '1'  => '1|2|3|4|5|6|7|8|9|10',
      '2'  => '4|5|6|7|8|9|10',
      '3'  => '5|6|7|8',
      '4'  => '4|5|6|7',
      '5'  => '4|5|6|7|8|9',
      '6'  => '4|5|6|7|8',
      '7'  => '4|5|6|7',
      '8'  => '0',
      '9'  => '4|6',
      '10' => '0',
      '11' => '0',
      '12' => '0',
      '13' => '0'
      );

    $product_size_names = array(
      '1'  => 'Kids Small',
      '2'  => 'Kids Medium',
      '3'  => 'Kids Large',
      '4'  => 'Small',
      '5'  => 'Medium',
      '6'  => 'Large',
      '7'  => 'X-Large',
      '8'  => '2X-Large (+$3.00)',
      '9'  => '3X-Large (+$3.00)',
      '10' => '4X-Large (+$3.00)',
      '11' => 'X-Small'
      );

   if ($prod == '99') list($product_sizes[$prod]) = mysql_fetch_row(mysql_query("SELECT sizes FROM $pntable[cp_seasonal] WHERE prod='$item'"));
   if ($product_sizes[$prod]) {
      $sizes = explode("|", $product_sizes[$prod]);
      $output = "<td>Size:<br> <select name=\"size\">";
      foreach ($sizes as $size)
      { 
        if($size == $selected_size):
            $output .= "<option value=\"$size\" selected>$product_size_names[$size]</option>";
        else:
            $output .= "<option value=\"$size\">$product_size_names[$size]</option>";
        endif;
      }
      $output .= "</select></td>";
      }
   else $output = " ";
   return $output;
   }

?>
Return current item: Caleb's Code