[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> new_attributes_include.php (source)

   1  <TR>
   2  <TD class="pageHeading" colspan="3"><?=$pageTitle?></TD>
   3  </TR>
   4  <FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="SUBMIT_ATTRIBUTES">
   5  <INPUT TYPE="HIDDEN" NAME="current_product_id" VALUE="<?=$current_product_id?>">
   6  <INPUT TYPE="HIDDEN" NAME="action" VALUE="change">
   7  <?php
   8  
   9  if ( $cPath ) echo "<INPUT TYPE=\"HIDDEN\" NAME=\"cPathID\" VALUE=\"" . $cPath . "\">";
  10  
  11  require ( 'new_attributes_functions.php');
  12  
  13  // Temp id for text input contribution.. I'll put them in a seperate array.
  14  $tempTextID= "1999043";
  15  
  16  // Lets get all of the possible options
  17  
  18  $query = "SELECT * FROM products_options where products_options_id LIKE '%' AND language_id = '$languageFilter'";
  19  
  20  $result = mysql_query($query) or die(mysql_error());
  21  
  22  $matches = mysql_num_rows($result);
  23  
  24  if ($matches) {
  25  
  26     while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  27                                                                 
  28          $current_product_option_name = $line['products_options_name'];
  29          $current_product_option_id = $line['products_options_id'];
  30  
  31  // Print the Option Name
  32          echo "<TR class=\"dataTableHeadingRow\">";
  33          echo "<TD class=\"dataTableHeadingContent\"><B>" . $current_product_option_name . "</B></TD>";
  34          echo "<TD class=\"dataTableHeadingContent\"><B>Value Price</B></TD>";
  35          echo "<TD class=\"dataTableHeadingContent\"><B>Price Prefix</B></TD>";
  36          
  37          if ( $optionTypeInstalled == "1" ) {
  38                  
  39                  echo "<TD class=\"dataTableHeadingContent\"><B>Option Type</B></TD>";
  40                  echo "<TD class=\"dataTableHeadingContent\"><B>Quantity</B></TD>";
  41                  echo "<TD class=\"dataTableHeadingContent\"><B>Order</B></TD>";
  42                  echo "<TD class=\"dataTableHeadingContent\"><B>Linked Attr.</B></TD>";
  43                  echo "<TD class=\"dataTableHeadingContent\"><B>ID</B></TD>";
  44                  
  45          }
  46          
  47          if ( $optionSortCopyInstalled == "1" ) {
  48                                                     
  49                  echo "<TD class=\"dataTableHeadingContent\"><B>Weight</B></TD>";
  50                  echo "<TD class=\"dataTableHeadingContent\"><B>Weight Prefix</B></TD>";
  51                  echo "<TD class=\"dataTableHeadingContent\"><B>Sort Order</B></TD>";
  52                  
  53          }
  54  
  55          echo "</TR>";
  56          
  57  // Find all of the Current Option's Available Values
  58          $query2 = "SELECT * FROM products_options_values_to_products_options WHERE products_options_id = '$current_product_option_id' ORDER BY products_options_values_id DESC";
  59  
  60          $result2 = mysql_query($query2) or die(mysql_error());
  61          
  62          $matches2 = mysql_num_rows($result2);
  63  
  64          if ($matches2) {
  65  
  66             $i = "0";
  67  
  68             while ($line = mysql_fetch_array($result2, MYSQL_ASSOC)) {
  69  
  70                  $i++;
  71                  
  72                  $rowClass = rowClass( $i );
  73  
  74                  $current_value_id = $line['products_options_values_id'];
  75  
  76                  $isSelected = checkAttribute( $current_value_id, $current_product_id, $current_product_option_id );
  77  
  78                  if ($isSelected) { $CHECKED = " CHECKED"; } else { $CHECKED = ""; }
  79                  
  80                  $query3 = "SELECT * FROM products_options_values WHERE products_options_values_id = '$current_value_id' AND language_id = '$languageFilter'";
  81                  
  82                  $result3 = mysql_query($query3) or die(mysql_error());
  83  
  84                  while($line = mysql_fetch_array($result3, MYSQL_ASSOC)) {
  85  
  86                          $current_value_name = $line['products_options_values_name'];
  87  
  88  // Print the Current Value Name
  89                          echo "<TR class=\"" . $rowClass . "\">";
  90                          echo "<TD class=\"main\">";
  91  
  92  // Add Support for multiple text input option types (for Chandra's contribution).. and using ' to begin/end strings.. less of a mess.
  93                          if ( $optionTypeTextInstalled == "1" && $current_value_id == $optionTypeTextInstalledID ) {
  94  
  95                                  $current_value_id_old = $current_value_id;
  96                                  $current_value_id = $tempTextID;
  97  
  98                                  echo '<input type="checkbox" name="optionValuesText[]" value="' . $current_value_id . '"' . $CHECKED . '>&nbsp;&nbsp;' . $current_value_name . '&nbsp;&nbsp;';
  99                                  echo '<input type="hidden" name="' . $current_value_id . '_options_id" value="' . $current_product_option_id . '">';
 100                                  
 101                          } else {
 102  
 103                          echo "<input type=\"checkbox\" name=\"optionValues[]\" value=\"" . $current_value_id . "\"" . $CHECKED . ">&nbsp;&nbsp;" . $current_value_name . "&nbsp;&nbsp;";
 104                          
 105                          }
 106  
 107                          echo "</TD>";
 108                          echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_price\" value=\"" . $attribute_value_price . "\" size=\"10\"></TD>";
 109  
 110                          if ( $optionTypeInstalled == "1" ) {
 111                                  
 112                                  extraValues( $current_value_id, $current_product_id );
 113  
 114                                  echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_prefix\" value=\"" . $attribute_prefix . "\" size=\"4\"></TD>";
 115                                  echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_type\">";
 116                                  displayOptionTypes( $attribute_type );
 117                                  echo "</SELECT></TD>";
 118                                  echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_qty\" value=\"" . $attribute_qty . "\" size=\"4\"></TD>";
 119                                  echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_order\" value=\"" . $attribute_order . "\" size=\"4\"></TD>";
 120                                  echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_linked\" value=\"" . $attribute_linked . "\" size=\"4\"></TD>";
 121                                  echo "<TD class=\"main\" align=\"left\">" . $current_value_id . "</TD>";
 122                                  
 123                          } else {
 124  
 125                                  echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-</SELECT></TD>";
 126                                  
 127                          if ( $optionSortCopyInstalled == "1" ) {
 128                                                                     
 129                                  getSortCopyValues( $current_value_id, $current_product_id );
 130  
 131                                  echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $attribute_weight . "\" size=\"10\"></TD>";
 132                                  echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_weight_prefix\">";
 133                                  sortCopyWeightPrefix( $attribute_weight_prefix );
 134                                  echo "</SELECT></TD>";
 135                                  echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_sort\" value=\"" . $attribute_sort . "\" size=\"4\"></TD>";
 136                                  
 137                          }
 138  
 139                          }
 140  
 141                          echo "</TR>";
 142  
 143                          if ( $optionTypeTextInstalled == "1" && $current_value_id_old == $optionTypeTextInstalledID ) {
 144  
 145                             $tempTextID++;
 146  
 147                          }
 148  
 149                  }
 150                  
 151                  if( $i == $matches2 ) { $i = "0"; }
 152  
 153             }
 154  
 155          } else {
 156            echo "<TR>";
 157            echo "<TD class=\"main\"><SMALL>No values under this option.</SMALL></TD>";
 158            echo "</TR>";
 159  
 160  
 161     }
 162  
 163  }
 164  }
 165  
 166  ?>
 167  <TR>
 168  <TD colspan="10" class="main"><BR><INPUT TYPE="image" src="<?=$adminImages?>button_save.gif">&nbsp;&nbsp;&nbsp;<?=$backLink?><img src="<?=$adminImages?>button_cancel.gif" border="0"></A></TD>
 169  </TR>
 170  </FORM>
 171  


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7