[TEP-COMMIT] [CVS admin] store the newsletter setting in the database
hpdl-OfajU3CKLf1/[email protected] 17 Aug 2004 23:49:02 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit in admin/admin on MAIN
customers.php +3 -2 1.87 -> 1.88
templates/pages/customers.php +1 -2 1.1 -> 1.2
/customers_edit.php +1 -1 1.1 -> 1.2
+5 -5
3 modified files
store the newsletter setting in the database
----------
admin /admin
customers.php 1.87 -> 1.88
diff -u -r1.87 -r1.88
--- customers.php 2004/07/22 23:28:09 1.87
+++ customers.php 2004/08/17 23:49:00 1.88
@@ -206,10 +206,10 @@
if (isset($_GET['cID']) && is_numeric($_GET['cID'])) {
$customer_id = $_GET['cID'];
- $Qcustomer = $osC_Database->query('update :table_customers set customers_gender = :customers_gender, customers_firstname = :customers_firstname, customers_lastname = :customers_lastname, customers_email_address = :customers_email_address, customers_dob = :customers_dob, customers_status = :customers_status where customers_id = :customers_id');
+ $Qcustomer = $osC_Database->query('update :table_customers set customers_gender = :customers_gender, customers_firstname = :customers_firstname, customers_lastname = :customers_lastname, customers_email_address = :customers_email_address, customers_dob = :customers_dob, customers_newsletter = :customers_newsletter, customers_status = :customers_status where customers_id = :customers_id');
$Qcustomer->bindInt(':customers_id', $customer_id);
} else {
- $Qcustomer = $osC_Database->query('insert into :table_customers (customers_gender, customers_firstname, customers_lastname, customers_email_address, customers_dob, customers_status) values (:customers_gender, :customers_firstname, :customers_lastname, :customers_email_address, :customers_dob, :customers_status)');
+ $Qcustomer = $osC_Database->query('insert into :table_customers (customers_gender, customers_firstname, customers_lastname, customers_email_address, customers_dob, customers_newsletter, customers_status) values (:customers_gender, :customers_firstname, :customers_lastname, :customers_email_address, :customers_dob, :customers_newsletter, :customers_status)');
}
$Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcustomer->bindValue(':customers_gender', (((ACCOUNT_GENDER > -1) && isset($_POST['gender']) && (($_POST['gender'] == 'm') || ($_POST['gender'] == 'f'))) ? $_POST['gender'] : ''));
@@ -217,6 +217,7 @@
$Qcustomer->bindValue(':customers_lastname', $_POST['lastname']);
$Qcustomer->bindValue(':customers_email_address', $_POST['email_address']);
$Qcustomer->bindValue(':customers_dob', ((ACCOUNT_DATE_OF_BIRTH > -1) ? adodb_date('Ymd', $dob) : ''));
+ $Qcustomer->bindInt(':customers_newsletter', (isset($_POST['newsletter']) && ($_POST['newsletter'] == 'on') ? '1' : '0'));
$Qcustomer->bindInt(':customers_status', (isset($_POST['status']) && ($_POST['status'] == 'on') ? '1' : '0'));
$Qcustomer->execute();
----------
admin /admin /templates /pages
customers.php 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- customers.php 2004/07/22 23:28:09 1.1
+++ customers.php 2004/08/17 23:49:00 1.2
@@ -96,8 +96,7 @@
echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, (isset($_GET['search']) ? 'search=' . $_GET['search'] . '&' : '') . 'page=' . $_GET['page'] . '&cID=' . $Qcustomers->valueInt('customers_id') . '&action=cDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a> ';
}
- echo '<a href="#" onClick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, 'cID=' . $Qcustomers->valueInt('customers_id')) . '\';">' . tep_image('templates/' . $template . '/images/icons/16x16/orders.png', IMAGE_ORDERS, '16', '16') . '</a> ' .
- '<a href="#" onClick="document.location.href=\'' . tep_href_link(FILENAME_MAIL, 'customers_email_address=' . $Qcustomers->value('customers_email_address')) . '\';">' . tep_image('templates/' . $template . '/images/icons/16x16/email_send.png', IMAGE_EMAIL, '16', '16') . '</a>';
+ echo '<a href="#" onClick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, 'cID=' . $Qcustomers->valueInt('customers_id')) . '\';">' . tep_image('templates/' . $template . '/images/icons/16x16/orders.png', IMAGE_ORDERS, '16', '16') . '</a>';
?>
</td>
</tr>
----------
admin /admin /templates /pages
customers_edit.php 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- customers_edit.php 2004/07/22 23:28:09 1.1
+++ customers_edit.php 2004/08/17 23:49:00 1.2
@@ -79,7 +79,7 @@
?>
<tr>
<td class="main" width="30%"><?php echo ENTRY_NEWSLETTER; ?></td>
- <td class="main" width="70%"><?php echo osc_draw_checkbox_field('newsletter', '1', (isset($Qaccount) ? $Qaccount->value('customers_newsletter') : '')); ?></td>
+ <td class="main" width="70%"><?php echo osc_draw_checkbox_field('newsletter', '', (isset($Qaccount) && ($Qaccount->valueInt('customers_newsletter') === 1) ? true : false)); ?></td>
</tr>
<?php
}
CVSspam 0.2.9
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285