[TEP-COMMIT] [CVS catalog] the new account newsletters page based on a CSS layout, and the new account
hpdl-OfajU3CKLf1/[email protected] 29 Mar 2005 23:38:20 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt>content/pages/<a href="#file1"><span id="added">account_newsletters.php</span></a></tt></td><td align="right" id="added">+45</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_newsletters.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr class="alt"><td><tt>modules/account/<a href="#file2"><span id="added">newsletters.php</span></a></tt></td><td align="right" id="added">+77</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account/newsletters.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td></td><td align="right" id="added">+122</td><td></td><td></td></tr>
</table>
<small id="info">2 added files</small><br />
<pre class="comment">
the new account newsletters page based on a CSS layout, and the new account
newsletters module to handle the processing logic
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content">content</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages">pages</a><br /></span>
<div class="fileheader" id="added"><big><b>account_newsletters.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_newsletters.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N account_newsletters.php
--- /dev/null Wed Mar 30 01:38:16 2005
+++ /tmp/cvsAAAz3ay6C Wed Mar 30 01:38:16 2005
@@ -0,0 +1,45 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+?>
+
+<div class="pageHeading">
+ <span class="pageHeadingImage"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE_NEWSLETTERS, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></span>
+
+ <h1><?php echo HEADING_TITLE_NEWSLETTERS; ?></h1>
+</div>
+
+<form name="account_newsletter" action="<?php echo tep_href_link(FILENAME_ACCOUNT, 'newsletters=save', 'SSL'); ?>" method="post">
+
+<div class="moduleBox">
+ <div class="outsideHeading"><?php echo MY_NEWSLETTERS_TITLE; ?></div>
+
+ <div class="content">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr class="moduleRow" onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="checkBox('newsletter_general');">
+ <td width="30"><?php echo osc_draw_checkbox_field('newsletter_general', '1', $Qnewsletter->value('customers_newsletter'), 'onclick="checkBox(\'newsletter_general\')"'); ?></td>
+ <td><b><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER; ?></b></td>
+ </tr>
+ <tr>
+ <td width="30">&nbsp;</td>
+ <td><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION; ?></td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<div class="submitFormButtons">
+ <span style="float: right;"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></span>
+
+ <?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?>
+</div>
+
+</form>
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account">account</a><br /></span>
<div class="fileheader" id="added"><big><b>newsletters.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account/newsletters.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N newsletters.php
--- /dev/null Wed Mar 30 01:38:18 2005
+++ /tmp/cvsAAAljaydD Wed Mar 30 01:38:18 2005
@@ -0,0 +1,77 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class osC_Account_Newsletters {
+
+/* Public variables */
+
+ var $page_contents = 'account_newsletters.php';
+
+/* Private variables */
+
+ var $_module = 'newsletters';
+
+/* Class constructor */
+
+ function osC_Account_Newsletters() {
+ global $osC_Services, $breadcrumb, $osC_Database, $osC_Customer, $Qnewsletter;
+
+ if ($osC_Services->isStarted('breadcrumb')) {
+ $breadcrumb->add(NAVBAR_TITLE_NEWSLETTERS, tep_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
+ }
+
+/////////////////////// HPDL /////// Should be moved to the customers class!
+ $Qnewsletter = $osC_Database->query('select customers_newsletter from :table_customers where customers_id = :customers_id');
+ $Qnewsletter->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qnewsletter->bindInt(':customers_id', $osC_Customer->id);
+ $Qnewsletter->execute();
+
+ if ($_GET[$this->_module] == 'save') {
+ $this->_process();
+ }
+ }
+
+/* Public methods */
+
+ function getPageContentsFile() {
+ return $this->page_contents;
+ }
+
+/* Private methods */
+
+ function _process() {
+ global $messageStack, $osC_Database, $osC_Customer, $Qnewsletter;
+
+ if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
+ $newsletter_general = $_POST['newsletter_general'];
+ } else {
+ $newsletter_general = '0';
+ }
+
+ if ($newsletter_general != $Qnewsletter->valueInt('customers_newsletter')) {
+ $newsletter_general = (($Qnewsletter->value('customers_newsletter') == '1') ? '0' : '1');
+
+ $Qupdate = $osC_Database->query('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id');
+ $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qupdate->bindInt(':customers_newsletter', $newsletter_general);
+ $Qupdate->bindInt(':customers_id', $osC_Customer->id);
+ $Qupdate->execute();
+
+ if ($Qupdate->affectedRows() === 1) {
+ $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
+ }
+ }
+
+ tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+ }
+ }
+?>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click