[ PHPXref.com ] [ Generated: Sun Jul 20 19:31:32 2008 ] [ phpAdsNew 2.0.8 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/admin/ -> affiliate-zones.php (source)

   1  <?php // $Revision: 2.0.2.4 $
   2  
   3  /************************************************************************/
   4  /* phpAdsNew 2                                                          */
   5  /* ===========                                                          */
   6  /*                                                                      */
   7  /* Copyright (c) 2000-2006 by the phpAdsNew developers                  */
   8  /* For more information visit: http://www.phpadsnew.com                 */
   9  /*                                                                      */
  10  /* This program is free software. You can redistribute it and/or modify */
  11  /* it under the terms of the GNU General Public License as published by */
  12  /* the Free Software Foundation; either version 2 of the License.       */
  13  /************************************************************************/
  14  
  15  
  16  
  17  // Include required files
  18  require  ("config.php");
  19  require  ("lib-statistics.inc.php");
  20  require  ("lib-size.inc.php");
  21  require  ("lib-zones.inc.php");
  22  
  23  
  24  // Register input variables
  25  phpAds_registerGlobal ('listorder', 'orderdirection');
  26  
  27  
  28  // Security check
  29  phpAds_checkAccess(phpAds_Admin+phpAds_Affiliate);
  30  
  31  
  32  
  33  /*********************************************************/
  34  /* Affiliate interface security                          */
  35  /*********************************************************/
  36  
  37  if (phpAds_isUser(phpAds_Affiliate))
  38  {
  39      $affiliateid = phpAds_getUserID();
  40  }
  41  
  42  
  43  
  44  /*********************************************************/
  45  /* Get preferences                                       */
  46  /*********************************************************/
  47  
  48  if (!isset($listorder))
  49  {
  50      if (isset($Session['prefs']['affiliate-zones.php']['listorder']))
  51          $listorder = $Session['prefs']['affiliate-zones.php']['listorder'];
  52      else
  53          $listorder = '';
  54  }
  55  
  56  if (!isset($orderdirection))
  57  {
  58      if (isset($Session['prefs']['affiliate-zones.php']['orderdirection']))
  59          $orderdirection = $Session['prefs']['affiliate-zones.php']['orderdirection'];
  60      else
  61          $orderdirection = '';
  62  }
  63  
  64  
  65  
  66  /*********************************************************/
  67  /* HTML framework                                        */
  68  /*********************************************************/
  69  
  70  if (phpAds_isUser(phpAds_Admin))
  71  {
  72      if (isset($Session['prefs']['affiliate-index.php']['listorder']))
  73          $navorder = $Session['prefs']['affiliate-index.php']['listorder'];
  74      else
  75          $navorder = '';
  76      
  77      if (isset($Session['prefs']['affiliate-index.php']['orderdirection']))
  78          $navdirection = $Session['prefs']['affiliate-index.php']['orderdirection'];
  79      else
  80          $navdirection = '';
  81      
  82      
  83      // Get other affiliates
  84      $res = phpAds_dbQuery("
  85          SELECT
  86              *
  87          FROM
  88              ".$phpAds_config['tbl_affiliates']."
  89          ".phpAds_getAffiliateListOrder ($navorder, $navdirection)."
  90      ") or phpAds_sqlDie();
  91      
  92      while ($row = phpAds_dbFetchArray($res))
  93      {
  94          phpAds_PageContext (
  95              phpAds_buildAffiliateName ($row['affiliateid'], $row['name']),
  96              "affiliate-zones.php?affiliateid=".$row['affiliateid'],
  97              $affiliateid == $row['affiliateid']
  98          );
  99      }
 100      
 101      phpAds_PageShortcut($strAffiliateHistory, 'stats-affiliate-history.php?affiliateid='.$affiliateid, 'images/icon-statistics.gif');    
 102      
 103      phpAds_PageHeader("4.2.3");
 104          echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>".phpAds_getAffiliateName($affiliateid)."</b><br><br><br>";
 105          phpAds_ShowSections(array("4.2.2", "4.2.3"));
 106  }
 107  else
 108  {
 109      $sections[] = "2.1";
 110      if (phpAds_isAllowed(phpAds_ModifyInfo)) $sections[] = "2.2";
 111      
 112      phpAds_PageHeader("2.1");
 113          echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>".phpAds_getAffiliateName($affiliateid)."</b><br><br><br>";
 114          phpAds_ShowSections($sections);
 115  }
 116  
 117  
 118  
 119  /*********************************************************/
 120  /* Main code                                             */
 121  /*********************************************************/
 122  
 123  // Get clients & campaign and build the tree
 124  
 125  $res_zones = phpAds_dbQuery("
 126          SELECT 
 127              *
 128          FROM 
 129              ".$phpAds_config['tbl_zones']."
 130          WHERE
 131              affiliateid = '".$affiliateid."'
 132          ".phpAds_getZoneListOrder ($listorder, $orderdirection)."
 133          ") or phpAds_sqlDie();
 134  
 135  
 136  
 137  
 138  if (phpAds_isUser(phpAds_Admin) || phpAds_isAllowed(phpAds_AddZone))
 139  {
 140      echo "<img src='images/icon-zone-new.gif' border='0' align='absmiddle'>&nbsp;";
 141      echo "<a href='zone-edit.php?affiliateid=".$affiliateid."' accesskey='".$keyAddNew."'>".$strAddNewZone_Key."</a>&nbsp;&nbsp;";
 142      phpAds_ShowBreak();
 143  }
 144  
 145  
 146  
 147  echo "<br><br>";
 148  echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";    
 149  
 150  
 151  echo "<tr height='25'>";
 152  echo '<td height="25"><b>&nbsp;&nbsp;<a href="affiliate-zones.php?affiliateid='.$affiliateid.'&listorder=name">'.$GLOBALS['strName'].'</a>';
 153  
 154  if (($listorder == "name") || ($listorder == ""))
 155  {
 156      if  (($orderdirection == "") || ($orderdirection == "down"))
 157      {
 158          echo ' <a href="affiliate-zones.php?affiliateid='.$affiliateid.'&orderdirection=up">';
 159          echo '<img src="images/caret-ds.gif" border="0" alt="" title="">';
 160      }
 161      else
 162      {
 163          echo ' <a href="affiliate-zones.php?affiliateid='.$affiliateid.'&orderdirection=down">';
 164          echo '<img src="images/caret-u.gif" border="0" alt="" title="">';
 165      }
 166      echo '</a>';
 167  }
 168  
 169  echo '</b></td>';
 170  echo '<td height="25"><b><a href="affiliate-zones.php?affiliateid='.$affiliateid.'&listorder=id">'.$GLOBALS['strID'].'</a>';
 171  
 172  if ($listorder == "id")
 173  {
 174      if  (($orderdirection == "") || ($orderdirection == "down"))
 175      {
 176          echo ' <a href="affiliate-zones.php?affiliateid='.$affiliateid.'&orderdirection=up">';
 177          echo '<img src="images/caret-ds.gif" border="0" alt="" title="">';
 178      }
 179      else
 180      {
 181          echo ' <a href="affiliate-zones.php?affiliateid='.$affiliateid.'&orderdirection=down">';
 182          echo '<img src="images/caret-u.gif" border="0" alt="" title="">';
 183      }
 184      echo '</a>';
 185  }
 186  
 187  echo '</b>&nbsp;&nbsp;&nbsp;</td>';
 188  echo '<td height="25"><b><a href="affiliate-zones.php?affiliateid='.$affiliateid.'&listorder=size">'.$GLOBALS['strSize'].'</a>';
 189  
 190  if ($listorder == "size")
 191  {
 192      if  (($orderdirection == "") || ($orderdirection == "down"))
 193      {
 194          echo ' <a href="affiliate-zones.php?affiliateid='.$affiliateid.'&orderdirection=up">';
 195          echo '<img src="images/caret-ds.gif" border="0" alt="" title="">';
 196      }
 197      else
 198      {
 199          echo ' <a href="affiliate-zones.php?affiliateid='.$affiliateid.'&orderdirection=down">';
 200          echo '<img src="images/caret-u.gif" border="0" alt="" title="">';
 201      }
 202      echo '</a>';
 203  }
 204  
 205  echo "</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
 206  echo "<td height='25'>&nbsp;</td>";
 207  echo "</tr>";
 208  
 209  echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 210  
 211  
 212  if (phpAds_dbNumRows($res_zones) == 0)
 213  {
 214      echo "<tr height='25' bgcolor='#F6F6F6'><td height='25' colspan='4'>";
 215      echo "&nbsp;&nbsp;".$strNoZones;
 216      echo "</td></tr>";
 217      
 218      echo "<td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td>";
 219  }
 220  
 221  $i=0;
 222  while ($row_zones = phpAds_dbFetchArray($res_zones))
 223  {
 224      if ($i > 0) echo "<td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td>";
 225      echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"").">";
 226      
 227      echo "<td height='25'>&nbsp;&nbsp;";
 228      
 229      if ($row_zones['what'] != '')
 230      {
 231          if ($row_zones['delivery'] == phpAds_ZoneBanner)
 232              echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;";
 233          elseif ($row_zones['delivery'] == phpAds_ZoneInterstitial)
 234              echo "<img src='images/icon-interstitial.gif' align='absmiddle'>&nbsp;";
 235          elseif ($row_zones['delivery'] == phpAds_ZonePopup)
 236              echo "<img src='images/icon-popup.gif' align='absmiddle'>&nbsp;";
 237          elseif ($row_zones['delivery'] == phpAds_ZoneText)
 238              echo "<img src='images/icon-textzone.gif' align='absmiddle'>&nbsp;";
 239      }
 240      else
 241      {
 242          if ($row_zones['delivery'] == phpAds_ZoneBanner)
 243              echo "<img src='images/icon-zone-d.gif' align='absmiddle'>&nbsp;";
 244          elseif ($row_zones['delivery'] == phpAds_ZoneInterstitial)
 245              echo "<img src='images/icon-interstitial-d.gif' align='absmiddle'>&nbsp;";
 246          elseif ($row_zones['delivery'] == phpAds_ZonePopup)
 247              echo "<img src='images/icon-popup-d.gif' align='absmiddle'>&nbsp;";
 248          elseif ($row_zones['delivery'] == phpAds_ZoneText)
 249              echo "<img src='images/icon-textzone-d.gif' align='absmiddle'>&nbsp;";
 250      }
 251      
 252      if (phpAds_isUser(phpAds_Admin) || phpAds_isAllowed(phpAds_EditZone))
 253          echo "<a href='zone-edit.php?affiliateid=".$affiliateid."&zoneid=".$row_zones['zoneid']."'>".$row_zones['zonename']."</a>";
 254      else
 255          echo $row_zones['zonename'];
 256      
 257      echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 258      echo "</td>";
 259      
 260      // ID
 261      echo "<td height='25'>".$row_zones['zoneid']."</td>";
 262      
 263      // Size
 264      if ($row_zones['delivery'] == phpAds_ZoneText)
 265      {
 266          echo "<td height='25'>".$strCustom." (".$strTextAdZone.")</td>";
 267      }
 268      else
 269      {
 270          if ($row_zones['width'] == -1) $row_zones['width'] = '*';
 271          if ($row_zones['height'] == -1) $row_zones['height'] = '*';
 272          
 273          echo "<td height='25'>".phpAds_getBannerSize($row_zones['width'], $row_zones['height'])."</td>";
 274      }
 275      
 276      echo "<td>&nbsp;</td>";
 277      echo "</tr>";
 278      
 279      // Description
 280      echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"").">";
 281      echo "<td>&nbsp;</td>";
 282      echo "<td height='25' colspan='3'>".stripslashes($row_zones['description'])."</td>";
 283      echo "</tr>";
 284      
 285      echo "<tr height='1'>";
 286      echo "<td ".($i%2==0?"bgcolor='#F6F6F6'":"")."><img src='images/spacer.gif' width='1' height='1'></td>";
 287      echo "<td colspan='3' bgcolor='#888888'><img src='images/break-l.gif' height='1' width='100%'></td>";
 288      echo "</tr>";
 289      echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"").">";
 290      
 291      // Empty
 292      echo "<td>&nbsp;</td>";
 293      
 294      // Button 1, 2 & 3
 295      echo "<td height='25' colspan='3'>";
 296      if (phpAds_isUser(phpAds_Admin) || phpAds_isAllowed(phpAds_LinkBanners)) echo "<a href='zone-include.php?affiliateid=".$affiliateid."&zoneid=".$row_zones['zoneid']."'><img src='images/icon-zone-linked.gif' border='0' align='absmiddle' alt='$strIncludedBanners'>&nbsp;$strIncludedBanners</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 297      echo "<a href='zone-probability.php?affiliateid=".$affiliateid."&zoneid=".$row_zones['zoneid']."'><img src='images/icon-zone-probability.gif' border='0' align='absmiddle' alt='$strProbability'>&nbsp;$strProbability</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 298      echo "<a href='zone-invocation.php?affiliateid=".$affiliateid."&zoneid=".$row_zones['zoneid']."'><img src='images/icon-generatecode.gif' border='0' align='absmiddle' alt='$strInvocationcode'>&nbsp;$strInvocationcode</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 299      if (phpAds_isUser(phpAds_Admin) || phpAds_isAllowed(phpAds_DeleteZone)) echo "<a href='zone-delete.php?affiliateid=".$affiliateid."&zoneid=".$row_zones['zoneid']."&returnurl=affiliate-zones.php'".phpAds_DelConfirm($strConfirmDeleteZone)."><img src='images/icon-recycle.gif' border='0' align='absmiddle' alt='$strDelete'>&nbsp;$strDelete</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 300      echo "</td></tr>";
 301      
 302      $i++;
 303  }
 304  
 305  if (phpAds_dbNumRows($res_zones) > 0)
 306  {
 307      echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 308  }
 309  
 310  echo "</table>";
 311  echo "<br><br>";
 312  
 313  
 314  
 315  /*********************************************************/
 316  /* Store preferences                                     */
 317  /*********************************************************/
 318  
 319  $Session['prefs']['affiliate-zones.php']['listorder'] = $listorder;
 320  $Session['prefs']['affiliate-zones.php']['orderdirection'] = $orderdirection;
 321  
 322  phpAds_SessionDataStore();
 323  
 324  
 325  
 326  /*********************************************************/
 327  /* HTML framework                                        */
 328  /*********************************************************/
 329  
 330  phpAds_PageFooter();
 331  
 332  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]