I am modding order editor to incoporate my lead time addon that shows if the product carries a lead time and how many days, during editing the order the operatoer can change these the specs:
this piece of code refers to a checkbox that shows which product(s) have lead times
<td class="dataTableContent" valign="top"><input type="checkbox" title="Lead time Active: <?php echo $order->products[$i]['lead_time_days']; ?> DAYS" name="<?php echo "update_products[" . $orders_products_id . "][lead_time]"; ?>" <?php if (ORDER_EDITOR_USE_AJAX == 'true') { ?>onClick="updateProductsField('update', '<?php echo $orders_products_id; ?>', 'products_lead_time', this.checked, this)"<?php } ?> <?php if($order->products[$i]['lead_time']=='1'){ echo "checked=\"true\""; }?>"></td>
The problem i am having is the data form the check box enters mySQL as " true " or " false" - is all well and good but i would like it to go in as "1" or "0"
If i deactivate AJAX, it goes in as "on"....
My db is currently VARCHAR (5).
I have googled searched high and low but not found a straight forward solution.
All this is carried out on edit_orders.php:
// Update orders_products Table
$Query = "UPDATE " . TABLE_ORDERS_PRODUCTS . " SET
products_model = '" . $products_details['model'] . "',
products_name = '" . oe_html_quotes($products_details['name']) . "',
products_price = '" . $products_details['price'] . "',
final_price = '" . $products_details['final_price'] . "',
products_tax = '" . $products_details['tax'] . "',
products_quantity = '" . $products_details['qty'] . "',
products_lead_time = '" . $products_details['lead_time'] . "',
products_lead_time_days = '" . $products_details['lead_time_days'] . "'
WHERE orders_id = '" . (int)$oID . "'
AND orders_products_id = '$orders_products_id';";
tep_db_query($Query);
Any ideas folks??