[ Index ]

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

title

Body

[close]

/include/inc_tmpl/ -> newsletter.list.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  if(isset($_GET["s"])) {
  32  
  33      include_once (PHPWCMS_ROOT.'/include/inc_lib/newsletter.form.inc.php');
  34      
  35      if(isset($_GET['edit'])) {
  36          include_once (PHPWCMS_ROOT.'/include/inc_tmpl/newsletter.form.tmpl.php');
  37      }
  38  
  39      if(isset($_GET['send']) && $show_nl_send) {
  40  
  41          include_once (PHPWCMS_ROOT.'/include/inc_tmpl/newsletter.send.tmpl.php');
  42  
  43      }
  44  
  45  } else {
  46  
  47      if(isset($_GET['duplicate_nl'])) {
  48          @_dbDuplicateRow(    'phpwcms_newsletter', 'newsletter_id', intval($_GET['duplicate_nl']), 
  49                              array('newsletter_active' => 0, 'newsletter_changed' => 'SQL:NOW()', 
  50                              'newsletter_lastsending' => '0000-00-00 00:00:00', 'newsletter_created' => 'SQL:NOW()', 
  51                              'newsletter_subject' => '--SELF-- (copy)'));
  52      }
  53  
  54  // check if subscription should be edited
  55  ?>
  56  
  57  <div class="title" style="margin-bottom:10px"><?php echo $BL['be_subnav_msg_newslettersend'] ?></div>
  58  
  59  <div class="navBarLeft imgButton chatlist">
  60      &nbsp;&nbsp;
  61      <a href="phpwcms.php?do=messages&amp;p=3&amp;s=0&amp;edit=1"><img src="img/famfamfam/email_add.gif" alt="Add" border="0" /><span><?php echo $BL['be_newsletter_new'] ?></span></a>
  62  </div>
  63  
  64  <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
  65      
  66      <tr class="tableHeadRow">
  67          <th>&nbsp;</th>
  68          <th style="text-align:left"><?php echo $BL['be_msg_subject'] ?></th>
  69          <th><?php echo $BL['be_newsletter_changed'] ?></th>
  70          <th><?php echo str_replace(' ', '<br />', $BL['be_last_sending']) ?></th>
  71          <th><?php echo $BL['be_total'].'/<br />'.$BL['be_cnt_queued'].'/<br />'.$BL['be_msg_senttop'] ?></th>
  72          <th>&nbsp;</th>
  73      </tr>
  74      
  75      <tr><td colspan="6" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  76      
  77  <?php
  78  
  79      // loop listing available newsletters
  80                                   
  81      $sql    = "SELECT * FROM ".DB_PREPEND."phpwcms_newsletter WHERE newsletter_trashed=0 ORDER BY newsletter_changed DESC";
  82      $result    = _dbQuery($sql);
  83      
  84      if($result) {
  85          
  86          $row_count = 0;
  87          
  88          foreach($result as $row) {
  89          
  90              $row['newsletter_vars'] = unserialize($row['newsletter_vars']);
  91          
  92              echo '<tr'.( ($row_count % 2) ? ' bgcolor="#F3F5F8"' : '' ).' class="listrow">'.LF;
  93              echo '<td width="2%" style="padding:2px 5px 2px 4px;">';
  94              
  95              // sent/queue status
  96              $count_sent          = _dbQuery('SELECT COUNT(*) FROM '.DB_PREPEND.'phpwcms_newsletterqueue WHERE queue_status=1 AND queue_pid='.$row["newsletter_id"], 'COUNT');
  97              $count_queue         = _dbQuery('SELECT COUNT(*) FROM '.DB_PREPEND.'phpwcms_newsletterqueue WHERE queue_status=0 AND queue_pid='.$row["newsletter_id"], 'COUNT');
  98              $count_recipient    = countNewsletterRecipients($row['newsletter_vars']['subscription']);
  99              
 100              if(empty($row["newsletter_active"]) || !$count_queue) {
 101                  echo '<img src="img/famfamfam/email.gif" alt="NL" title="ID:'.$row["newsletter_id"].'" />';
 102              } else {
 103                  echo '<a href="phpwcms.php?do=messages&amp;p=3&amp;s='.$row["newsletter_id"];
 104                  echo '&amp;send=1"><img src="img/famfamfam/email_go.gif" alt="Send" border="0" title="ID:'.$row["newsletter_id"].'"></a>';
 105              }
 106              
 107              echo '</td>'.LF;
 108                          
 109              echo '<td class="dir"><strong>'.html_specialchars($row["newsletter_subject"])."</strong></td>\n";
 110              
 111              // create date
 112              echo '<td nowrap="nowrap" class="v10" align="center">&nbsp;'.@date($BL['be_shortdatetime'], strtotime($row['newsletter_changed'])).'&nbsp;</td>';
 113              // last sending
 114              echo '<td nowrap="nowrap" class="v10" align="center">&nbsp;'.@date($BL['be_shortdatetime'], strtotime($row['newsletter_lastsending'])).'&nbsp;</td>';
 115              
 116              echo '<td nowrap="nowrap" class="v10" align="center">'.$count_recipient.'/'.$count_queue.'/'.$count_sent;
 117              if($count_sent && !$count_queue && $row["newsletter_active"]) {
 118                  echo '<img src="img/symbole/valid.gif" border="0" alt="valid" style="margin: 0 0 0 3px" />';
 119              }
 120              echo '&nbsp;</td>';
 121              
 122              // buttons
 123              echo '<td align="right" nowrap="nowrap" class="button_td">';
 124              
 125              // duplicate
 126              echo '<a href="phpwcms.php?do=messages&amp;p=3&amp;duplicate_nl='.$row["newsletter_id"];
 127              echo '"><img src="img/button/copy_11x11_0.gif" alt="Duplicate" border="0" style="margin:1px 3px 1px 0" /></a>';
 128              
 129              // edit
 130              echo '<a href="phpwcms.php?do=messages&amp;p=3&amp;s='.$row["newsletter_id"];
 131              echo '&amp;edit=1"><img src="img/button/edit_22x13.gif" alt="Edit" border="0" /></a>';
 132              
 133              // delete
 134              echo '<a href="phpwcms.php?do=messages&amp;p=3&amp;s='.$row["newsletter_id"].'&amp;del='.$row["newsletter_id"];
 135              echo '" title="delete: '.html_specialchars($row["newsletter_subject"]);            
 136              echo '" onclick="return confirm(\'Delete newsletter: '.js_singlequote(html_specialchars($row["newsletter_subject"])).'\');">';
 137              echo '<img src="img/button/trash_13x13_1.gif" border="0" alt="Delete" /></a>';
 138              
 139              echo "</td>\n</tr>\n";
 140  
 141              $row_count++;
 142              
 143          }
 144          
 145      } else {
 146      
 147          echo '<tr><td colspan="4">&nbsp;no newsletter available</td></tr>';
 148      
 149      }
 150          
 151  ?>
 152      <tr><td colspan="6" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 153      <tr><td colspan="6"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
 154  </table>
 155  <?php
 156  
 157  }
 158  
 159  
 160  ?>


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