[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_tmpl/ -> message.subscription.tmpl.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // ----------------------------------------------------------------
  24  // obligate check for phpwcms constants
  25  if (!defined('PHPWCMS_ROOT')) {
  26     die("You Cannot Access This Script Directly, Have a Nice Day.");
  27  }
  28  // ----------------------------------------------------------------
  29  
  30  
  31  // newsletter subscription
  32  
  33  echo '<div class="title" style="margin-bottom:10px">'.$BL['be_newsletter_title'].'</div>';
  34  
  35  if(!empty($_GET["s"]) && isset($_GET['active'])) {
  36  
  37      $sql  = "UPDATE ".DB_PREPEND."phpwcms_subscription SET ";
  38      $sql .= "subscription_active=".(intval($_GET["active"]) ? 1 : 0)." ";
  39      $sql .=    "WHERE subscription_id=".intval($_GET["s"]);
  40      @_dbQuery($sql, 'UPDATE');
  41  }
  42  
  43  if(isset($_GET["s"]) && isset($_GET['edit'])) {
  44      include_once (PHPWCMS_ROOT.'/include/inc_tmpl/subscription.form.tmpl.php');
  45  }
  46  
  47  
  48  ?>
  49  <table width="538" border="0" cellpadding="0" cellspacing="0" summary="newsletter susbcription listing">
  50      <tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="4"></td></tr>
  51      <tr><td colspan="3" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
  52  <?php
  53  // loop listing available subscriptions                                           
  54  $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_subscription ORDER BY subscription_name;";
  55  if($result = mysql_query($sql, $db) or die("error while listing subscriptions")) {
  56      $row_count = 0;
  57      while($row = mysql_fetch_assoc($result)) {
  58      
  59          echo '<tr'.( ($row_count % 2) ? ' bgcolor="#F3F5F8"' : '' ).">\n<td width=\"25\" style=\"padding:1px 0 1px 0;\">";
  60          
  61          echo '<img src="img/symbole/newsletter_susbcription.gif" width="25" height="16" alt="" /></td>'.LF;
  62          
  63          echo '<td width="473" class="dir">';
  64          echo '<a href="phpwcms.php?do=messages&amp;p=2&amp;s='.$row["subscription_id"].'&amp;edit=1">';
  65          echo '<strong>'.html_specialchars($row["subscription_name"])."</strong></a></td>\n";
  66          
  67          echo '<td align="right" nowrap="nowrap" class="button_td">';
  68  
  69          echo '<a href="phpwcms.php?do=messages&amp;p=2&amp;s='.$row["subscription_id"].'&amp;edit=1">';        
  70          echo '<img src="img/button/edit_22x13.gif" border="0" alt="" /></a>';
  71      
  72          echo '<a href="phpwcms.php?do=messages&amp;p=2&amp;s='.$row["subscription_id"].'&amp;active=';
  73          echo ($row['subscription_active']) ? '0' : '1';
  74          echo '">';        
  75          echo '<img src="img/button/aktiv_12x13_'.$row['subscription_active'].'.gif" border="0" alt="" /></a>';
  76          
  77          echo "</td>\n</tr>\n";
  78          
  79          $row_count++;
  80      }
  81      mysql_free_result($result);
  82  } // end listing
  83          
  84  ?>
  85      <tr><td colspan="3" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
  86      <tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="8"></td></tr>
  87      <tr><td colspan="3"><form action="phpwcms.php?do=messages&amp;p=2&amp;s=0&amp;edit=1" method="post"><input type="submit" value="<?php echo $BL['be_newsletter_new'] ?>" class="button10" title="<?php echo $BL['be_newsletter_add'] ?>"></form></td></tr>
  88  </table>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7