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

title

Body

[close]

/admin/ -> client-index.php (source)

   1  <?php // $Revision: 2.1.2.8 $
   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  
  21  
  22  // Register input variables
  23  phpAds_registerGlobal ('expand', 'collapse', 'hideinactive', 'listorder', 'orderdirection');
  24  
  25  
  26  // Security check
  27  phpAds_checkAccess(phpAds_Admin);
  28  
  29  
  30  
  31  /*********************************************************/
  32  /* HTML framework                                        */
  33  /*********************************************************/
  34  
  35  phpAds_PageHeader("4.1");
  36  phpAds_ShowSections(array("4.1", "4.2", "4.3"));
  37  
  38  
  39  
  40  /*********************************************************/
  41  /* Get preferences                                       */
  42  /*********************************************************/
  43  
  44  if (!isset($hideinactive))
  45  {
  46      if (isset($Session['prefs']['client-index.php']['hideinactive']))
  47          $hideinactive = $Session['prefs']['client-index.php']['hideinactive'];
  48      else
  49          $hideinactive = ($phpAds_config['gui_hide_inactive'] == 't');
  50  }
  51  
  52  if (!isset($listorder))
  53  {
  54      if (isset($Session['prefs']['client-index.php']['listorder']))
  55          $listorder = $Session['prefs']['client-index.php']['listorder'];
  56      else
  57          $listorder = '';
  58  }
  59  
  60  if (!isset($orderdirection))
  61  {
  62      if (isset($Session['prefs']['client-index.php']['orderdirection']))
  63          $orderdirection = $Session['prefs']['client-index.php']['orderdirection'];
  64      else
  65          $orderdirection = '';
  66  }
  67  
  68  if (isset($Session['prefs']['client-index.php']['nodes']))
  69      $node_array = explode (",", $Session['prefs']['client-index.php']['nodes']);
  70  else
  71      $node_array = array();
  72  
  73  
  74  
  75  /*********************************************************/
  76  /* Main code                                             */
  77  /*********************************************************/
  78  
  79  // Get clients & campaign and build the tree
  80  if (phpAds_isUser(phpAds_Admin))
  81  {
  82      $res_clients = phpAds_dbQuery("
  83          SELECT 
  84              *
  85          FROM 
  86              ".$phpAds_config['tbl_clients']."
  87          ".phpAds_getListOrder ($listorder, $orderdirection)."
  88          ") or phpAds_sqlDie();
  89  }
  90  else
  91  {
  92      $res_clients = phpAds_dbQuery("
  93          SELECT 
  94              *
  95          FROM 
  96              ".$phpAds_config['tbl_clients']."
  97          WHERE
  98              clientid = ".$Session["clientid"]." OR
  99              parent = ".$Session["clientid"]."
 100          ".phpAds_getListOrder ($listorder, $orderdirection)."
 101          ") or phpAds_sqlDie();
 102  }
 103  
 104  while ($row_clients = phpAds_dbFetchArray($res_clients))
 105  {
 106      if ($row_clients['parent'] == 0)
 107      {
 108          $clients[$row_clients['clientid']] = $row_clients;
 109          $clients[$row_clients['clientid']]['expand'] = 0;
 110          $clients[$row_clients['clientid']]['count'] = 0;
 111          $clients[$row_clients['clientid']]['hideinactive'] = 0;
 112      }
 113      else
 114      {
 115          $campaigns[$row_clients['clientid']] = $row_clients;
 116          $campaigns[$row_clients['clientid']]['expand'] = 0;
 117          $campaigns[$row_clients['clientid']]['count'] = 0;
 118      }
 119  }
 120  
 121  
 122  // Get the banners for each campaign
 123  $res_banners = phpAds_dbQuery("
 124      SELECT 
 125          bannerid,
 126          clientid,
 127          alt,
 128          description,
 129          active,
 130          storagetype
 131      FROM 
 132          ".$phpAds_config['tbl_banners']."
 133          ".phpAds_getBannerListOrder ($listorder, $orderdirection)."
 134      ") or phpAds_sqlDie();
 135  
 136  while ($row_banners = phpAds_dbFetchArray($res_banners))
 137  {
 138      if (isset($campaigns[$row_banners['clientid']]))
 139      {
 140          $banners[$row_banners['bannerid']] = $row_banners;
 141          $campaigns[$row_banners['clientid']]['count']++;
 142      }
 143      
 144      if (isset($clients[$row_banners['clientid']]))
 145      {
 146          $clients[$row_banners['clientid']]['count']++;
 147      }
 148  }
 149  
 150  
 151  
 152  // Add ID found in expand to expanded nodes
 153  if (isset($expand) && $expand != '')
 154  {
 155      switch ($expand)
 156      {
 157          case 'all' :    $node_array   = array();
 158                          if (isset($clients)) while (list($key,) = each($clients)) $node_array[] = $key;
 159                          if (isset($campaigns)) while (list($key,) = each($campaigns)) $node_array[] = $key;
 160                          break;
 161                          
 162          case 'none':    $node_array   = array();
 163                          break;
 164                          
 165          default:        $node_array[] = $expand;
 166                          break;
 167      }
 168  }
 169  
 170  
 171  $node_array_size = sizeof($node_array);
 172  for ($i=0; $i < $node_array_size;$i++)
 173  {
 174      if (isset($collapse) && $collapse == $node_array[$i])
 175          unset ($node_array[$i]);
 176      else
 177      {
 178          if (isset($clients[$node_array[$i]]))
 179              $clients[$node_array[$i]]['expand'] = 1;
 180          if (isset($campaigns[$node_array[$i]]))
 181              $campaigns[$node_array[$i]]['expand'] = 1;
 182      }
 183  }
 184  
 185  
 186  
 187  // Build Tree
 188  $clientshidden = 0;
 189  
 190  if (isset($banners) && is_array($banners) && count($banners) > 0)
 191  {
 192      // Add banner to campaigns
 193      reset ($banners);
 194      while (list ($bkey, $banner) = each ($banners))
 195          if ($hideinactive == false || $banner['active'] == 't')
 196              $campaigns[$banner['clientid']]['banners'][$bkey] = $banner;
 197      
 198      unset ($banners);
 199  }
 200  
 201  if (isset($campaigns) && is_array($campaigns) && count($campaigns) > 0)
 202  {
 203      reset ($campaigns);
 204      while (list ($ckey, $campaign) = each ($campaigns))
 205      {
 206          if (!isset($campaign['banners']))
 207              $campaign['banners'] = array();
 208          
 209          if ($hideinactive == false || $campaign['active'] == 't' && 
 210             (count($campaign['banners']) != 0 || count($campaign['banners']) == $campaign['count']))
 211              $clients[$campaign['parent']]['campaigns'][$ckey] = $campaign;
 212          else
 213              $clients[$campaign['parent']]['hideinactive']++;
 214      }
 215      
 216      unset ($campaigns);
 217  }
 218  
 219  if (isset($clients) && is_array($clients) && count($clients) > 0)
 220  {
 221      reset ($clients);
 222      while (list ($key, $client) = each ($clients))
 223      {
 224          if (!isset($client['campaigns']))
 225              $client['campaigns'] = array();
 226          
 227          if (isset($client['campaigns']) && count($client['campaigns']) == 0 && $client['hideinactive'] > 0)
 228          {
 229              $clientshidden++;
 230              unset($clients[$key]);
 231          }
 232      }
 233  }
 234  
 235  
 236  
 237  echo "<img src='images/icon-client-new.gif' border='0' align='absmiddle'>&nbsp;";
 238  echo "<a href='client-edit.php' accesskey='".$keyAddNew."'>".$strAddClient_Key."</a>&nbsp;&nbsp;";
 239  phpAds_ShowBreak();
 240  
 241  
 242  
 243  echo "<br><br>";
 244  echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";    
 245  
 246  echo "<tr height='25'>";
 247  echo '<td height="25" width="40%"><b>&nbsp;&nbsp;<a href="client-index.php?listorder=name">'.$GLOBALS['strName'].'</a>';
 248  
 249  if (($listorder == "name") || ($listorder == ""))
 250  {
 251      if  (($orderdirection == "") || ($orderdirection == "down"))
 252      {
 253          echo ' <a href="client-index.php?orderdirection=up">';
 254          echo '<img src="images/caret-ds.gif" border="0" alt="" title="">';
 255      }
 256      else
 257      {
 258          echo ' <a href="client-index.php?orderdirection=down">';
 259          echo '<img src="images/caret-u.gif" border="0" alt="" title="">';
 260      }
 261      echo '</a>';
 262  }
 263  
 264  echo '</b></td>';
 265  echo '<td height="25"><b><a href="client-index.php?listorder=id">'.$GLOBALS['strID'].'</a>';
 266  
 267  if ($listorder == "id")
 268  {
 269      if  (($orderdirection == "") || ($orderdirection == "down"))
 270      {
 271          echo ' <a href="client-index.php?orderdirection=up">';
 272          echo '<img src="images/caret-ds.gif" border="0" alt="" title="">';
 273      }
 274      else
 275      {
 276          echo ' <a href="client-index.php?orderdirection=down">';
 277          echo '<img src="images/caret-u.gif" border="0" alt="" title="">';
 278      }
 279      echo '</a>';
 280  }
 281  
 282  echo '</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>';
 283  echo "<td height='25'>&nbsp;</td>";
 284  echo "<td height='25'>&nbsp;</td>";
 285  echo "<td height='25'>&nbsp;</td>";
 286  echo "</tr>";
 287  
 288  echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 289  
 290  
 291  if (!isset($clients) || !is_array($clients) || count($clients) == 0)
 292  {
 293      echo "<tr height='25' bgcolor='#F6F6F6'><td height='25' colspan='5'>";
 294      echo "&nbsp;&nbsp;".$strNoClients;
 295      echo "</td></tr>";
 296      
 297      echo "<td colspan='5' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td>";
 298  }
 299  else
 300  {
 301      $i=0;
 302      foreach (array_keys($clients) as $key)
 303      {
 304          $client = $clients[$key];
 305          
 306          if ($client['parent'] == 0)
 307          {
 308              echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"").">";
 309              
 310              // Icon & name
 311              echo "<td height='25'>";
 312              if (isset($client['campaigns']))
 313              {
 314                  if ($client['expand'] == '1')
 315                      echo "&nbsp;<a href='client-index.php?collapse=".$client['clientid']."'><img src='images/triangle-d.gif' align='absmiddle' border='0'></a>&nbsp;";
 316                  else
 317                      echo "&nbsp;<a href='client-index.php?expand=".$client['clientid']."'><img src='images/".$phpAds_TextDirection."/triangle-l.gif' align='absmiddle' border='0'></a>&nbsp;";
 318              }
 319              else
 320                  echo "&nbsp;<img src='images/spacer.gif' height='16' width='16' align='absmiddle'>&nbsp;";
 321                  
 322              echo "<img src='images/icon-client.gif' align='absmiddle'>&nbsp;";
 323              echo "<a href='client-edit.php?clientid=".$client['clientid']."'>".$client['clientname']."</a>";
 324              echo "</td>";
 325              
 326              // ID
 327              echo "<td height='25'>".$client['clientid']."</td>";
 328              
 329              // Button 1
 330              echo "<td height='25'>";
 331              if (($client['count'] == 0 && $client['expand'] == '1') || !isset($client['campaigns']))
 332                  echo "<a href='campaign-edit.php?clientid=".$client['clientid']."'><img src='images/icon-campaign-new.gif' border='0' align='absmiddle' alt='$strCreate'>&nbsp;$strCreate</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 333              else
 334                  echo "&nbsp;";
 335              echo "</td>";
 336              
 337              // Button 2
 338              echo "<td height='25'>";
 339              echo "<a href='client-campaigns.php?clientid=".$client['clientid']."'><img src='images/icon-overview.gif' border='0' align='absmiddle' alt='$strOverview'>&nbsp;$strOverview</a>&nbsp;&nbsp;";
 340              echo "</td>";
 341              
 342              // Button 3
 343              echo "<td height='25'>";
 344              echo "<a href='client-delete.php?clientid=".$client['clientid']."&returnurl=client-index.php'".phpAds_DelConfirm($strConfirmDeleteClient)."><img src='images/icon-recycle.gif' border='0' align='absmiddle' alt='$strDelete'>&nbsp;$strDelete</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 345              echo "</td></tr>";
 346              
 347              
 348              
 349              if (isset($client['campaigns']) && sizeof ($client['campaigns']) > 0 && $client['expand'] == '1')
 350              {
 351                  $campaigns = $client['campaigns'];
 352                  
 353                  foreach (array_keys($campaigns) as $ckey)
 354                  {
 355                      // Divider
 356                      echo "<tr height='1'>";
 357                      echo "<td ".($i%2==0?"bgcolor='#F6F6F6'":"")."><img src='images/spacer.gif' width='1' height='1'></td>";
 358                      echo "<td colspan='5' bgcolor='#888888'><img src='images/break-l.gif' height='1' width='100%'></td>";
 359                      echo "</tr>";
 360                      
 361                      // Icon & name
 362                      echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"")."><td height='25'>";
 363                      echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 364                      
 365                      if (isset($campaigns[$ckey]['banners']))
 366                      {
 367                          if ($campaigns[$ckey]['expand'] == '1')
 368                              echo "<a href='client-index.php?collapse=".$campaigns[$ckey]['clientid']."'><img src='images/triangle-d.gif' align='absmiddle' border='0'></a>&nbsp;";
 369                          else
 370                              echo "<a href='client-index.php?expand=".$campaigns[$ckey]['clientid']."'><img src='images/".$phpAds_TextDirection."/triangle-l.gif' align='absmiddle' border='0'></a>&nbsp;";
 371                      }
 372                      else
 373                          echo "<img src='images/spacer.gif' height='16' width='16' align='absmiddle'>&nbsp;";
 374                      
 375                      
 376                      if ($campaigns[$ckey]['active'] == 't')
 377                          echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;";
 378                      else
 379                          echo "<img src='images/icon-campaign-d.gif' align='absmiddle'>&nbsp;";
 380                      
 381                      echo "<a href='campaign-edit.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."'>".$campaigns[$ckey]['clientname']."</td>";
 382                      echo "</td>";
 383                      
 384                      // ID
 385                      echo "<td height='25'>".$campaigns[$ckey]['clientid']."</td>";
 386                      
 387                      // Button 1
 388                      echo "<td height='25'>";
 389                      if ($campaigns[$ckey]['expand'] == '1' || !isset($campaigns[$ckey]['banners']))
 390                          echo "<a href='banner-edit.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."'><img src='images/icon-banner-new.gif' border='0' align='absmiddle' alt='$strCreate'>&nbsp;$strCreate</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 391                      else
 392                          echo "&nbsp;";
 393                      echo "</td>";
 394                      
 395                      // Button 2
 396                      echo "<td height='25'>";
 397                      echo "<a href='campaign-banners.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."'><img src='images/icon-overview.gif' border='0' align='absmiddle' alt='$strOverview'>&nbsp;$strOverview</a>&nbsp;&nbsp;";
 398                      echo "</td>";
 399                      
 400                      // Button 3
 401                      echo "<td height='25'>";
 402                      echo "<a href='campaign-delete.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."&returnurl=client-index.php'".phpAds_DelConfirm($strConfirmDeleteCampaign)."><img src='images/icon-recycle.gif' border='0' align='absmiddle' alt='$strDelete'>&nbsp;$strDelete</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 403                      echo "</td></tr>";
 404                      
 405                      
 406                      
 407                      if ($campaigns[$ckey]['expand'] == '1' && isset($campaigns[$ckey]['banners']))
 408                      {
 409                          $banners = $campaigns[$ckey]['banners'];
 410                          foreach (array_keys($banners) as $bkey)
 411                          {
 412                              $name = $strUntitled;
 413                              if (isset($banners[$bkey]['alt']) && $banners[$bkey]['alt'] != '') $name = $banners[$bkey]['alt'];
 414                              if (isset($banners[$bkey]['description']) && $banners[$bkey]['description'] != '') $name = $banners[$bkey]['description'];
 415                              
 416                              $name = phpAds_breakString ($name, '30');
 417                              
 418                              // Divider
 419                              echo "<tr height='1'>";
 420                              echo "<td ".($i%2==0?"bgcolor='#F6F6F6'":"")."><img src='images/spacer.gif' width='1' height='1'></td>";
 421                              echo "<td colspan='4' bgcolor='#888888'><img src='images/break-l.gif' height='1' width='100%'></td>";
 422                              echo "</tr>";
 423                              
 424                              // Icon & name
 425                              echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"").">";
 426                              echo "<td height='25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 427                              
 428                              if ($banners[$bkey]['active'] == 't' && $campaigns[$ckey]['active'] == 't')
 429                              {
 430                                  if ($banners[$bkey]['storagetype'] == 'html')
 431                                      echo "<img src='images/icon-banner-html.gif' align='absmiddle'>";
 432                                  elseif ($banners[$bkey]['storagetype'] == 'txt')
 433                                      echo "<img src='images/icon-banner-text.gif' align='absmiddle'>";
 434                                  elseif ($banners[$bkey]['storagetype'] == 'url')
 435                                      echo "<img src='images/icon-banner-url.gif' align='absmiddle'>";
 436                                  else
 437                                      echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>";
 438                              }
 439                              else
 440                              {
 441                                  if ($banners[$bkey]['storagetype'] == 'html')
 442                                      echo "<img src='images/icon-banner-html-d.gif' align='absmiddle'>";
 443                                  elseif ($banners[$bkey]['storagetype'] == 'txt')
 444                                      echo "<img src='images/icon-banner-text-d.gif' align='absmiddle'>";
 445                                  elseif ($banners[$bkey]['storagetype'] == 'url')
 446                                      echo "<img src='images/icon-banner-url-d.gif' align='absmiddle'>";
 447                                  else
 448                                      echo "<img src='images/icon-banner-stored-d.gif' align='absmiddle'>";
 449                              }
 450                              
 451                              echo "&nbsp;<a href='banner-edit.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."&bannerid=".$banners[$bkey]['bannerid']."'>".$name."</a></td>";
 452                              
 453                              // ID
 454                              echo "<td height='25'>".$banners[$bkey]['bannerid']."</td>";
 455                              
 456                              // Empty
 457                              echo "<td>&nbsp;</td>";
 458                              
 459                              // Button 2
 460                              echo "<td height='25'>";
 461                              echo "<a href='banner-acl.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."&bannerid=".$banners[$bkey]['bannerid']."'><img src='images/icon-acl.gif' border='0' align='absmiddle' alt='$strACL'>&nbsp;$strACL</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 462                              echo "</td>";
 463                              
 464                              // Button 1
 465                              echo "<td height='25'>";
 466                              echo "<a href='banner-delete.php?clientid=".$client['clientid']."&campaignid=".$campaigns[$ckey]['clientid']."&bannerid=".$banners[$bkey]['bannerid']."&returnurl=client-index.php'".phpAds_DelConfirm($strConfirmDeleteBanner)."><img src='images/icon-recycle.gif' border='0' align='absmiddle' alt='$strDelete'>&nbsp;$strDelete</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 467                              echo "</td></tr>";
 468                          }
 469                      }
 470                  }
 471              }
 472              
 473              if ($client['count'] > 0)
 474              {
 475                  // Divider
 476                  echo "<tr height='1'>";
 477                  echo "<td ".($i%2==0?"bgcolor='#F6F6F6'":"")."><img src='images/spacer.gif' width='1' height='1'></td>";
 478                  echo "<td colspan='5' bgcolor='#888888'><img src='images/break-l.gif' height='1' width='100%'></td>";
 479                  echo "</tr>";
 480                  
 481                  echo "<tr height='25' ".($i%2==0?"bgcolor='#F6F6F6'":"").">";
 482                  echo "<td height='25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 483                  echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;";
 484                  echo "$strBannersWithoutCampaign</td>";
 485                  echo "<td height='25'>&nbsp;-&nbsp;</td>";
 486                  echo "<td height='25' colspan='3'>";
 487                  echo "<a href='campaign-edit.php?clientid=".$client['clientid']."&move=t'>";
 488                  echo "<img src='images/".$phpAds_TextDirection."/icon-update.gif' border='0' align='absmiddle' alt='$strMoveToNewCampaign'>&nbsp;$strMoveToNewCampaign</a>&nbsp;&nbsp;";
 489                  echo "</td>";
 490                  echo "</tr>";
 491              }
 492              
 493              echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 494              $i++;
 495          }
 496      }
 497  }
 498  
 499  echo "<tr><td height='25' colspan='3' align='".$phpAds_TextAlignLeft."' nowrap>";
 500  
 501  if ($hideinactive == true)
 502  {
 503      echo "&nbsp;&nbsp;<img src='images/icon-activate.gif' align='absmiddle' border='0'>";
 504      echo "&nbsp;<a href='client-index.php?hideinactive=0'>".$strShowAll."</a>";
 505      echo "&nbsp;&nbsp;|&nbsp;&nbsp;".$clientshidden." ".$strInactiveAdvertisersHidden;
 506  }
 507  else
 508  {
 509      echo "&nbsp;&nbsp;<img src='images/icon-hideinactivate.gif' align='absmiddle' border='0'>";
 510      echo "&nbsp;<a href='client-index.php?hideinactive=1'>".$strHideInactiveAdvertisers."</a>";
 511  }
 512  
 513  echo "</td><td height='25' colspan='2' align='".$phpAds_TextAlignRight."' nowrap>";
 514  echo "<img src='images/triangle-d.gif' align='absmiddle' border='0'>";
 515  echo "&nbsp;<a href='client-index.php?expand=all' accesskey='".$keyExpandAll."'>".$strExpandAll."</a>";
 516  echo "&nbsp;&nbsp;|&nbsp;&nbsp;";
 517  echo "<img src='images/".$phpAds_TextDirection."/triangle-l.gif' align='absmiddle' border='0'>";
 518  echo "&nbsp;<a href='client-index.php?expand=none' accesskey='".$keyCollapseAll."'>".$strCollapseAll."</a>&nbsp;&nbsp;";
 519  echo "</td></tr>";
 520  
 521  echo "</table>";
 522  
 523  
 524  
 525  // total number of clients
 526  $res_clients           = phpAds_dbQuery("SELECT count(*) AS count FROM ".$phpAds_config['tbl_clients']." WHERE parent = 0") or phpAds_sqlDie();
 527  $res_campaigns           = phpAds_dbQuery("SELECT count(*) AS count FROM ".$phpAds_config['tbl_clients']." WHERE parent > 0") or phpAds_sqlDie();
 528  $res_active_campaigns = phpAds_dbQuery("SELECT count(*) AS count FROM ".$phpAds_config['tbl_clients']." WHERE parent > 0 AND active='t'");
 529  $res_total_banners       = phpAds_dbQuery("SELECT count(*) AS count FROM ".$phpAds_config['tbl_banners']);
 530  $res_active_banners   = phpAds_dbQuery("SELECT count(*) AS count FROM ".$phpAds_config['tbl_banners']." as b, ".$phpAds_config['tbl_clients']." as c WHERE b.clientid=c.clientid AND c.active='t' AND b.active='t'");
 531  
 532  
 533  echo "<br><br><br><br>";
 534  echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
 535  echo "<tr><td height='25' colspan='3'>&nbsp;&nbsp;<b>".$strOverall."</b></td></tr>";
 536  echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 537  
 538  echo "<tr><td height='25'>&nbsp;&nbsp;".$strTotalBanners.": <b>".phpAds_dbResult($res_total_banners, 0, "count")."</b></td>";
 539  echo "<td height='25'>".$strTotalCampaigns.": <b>".phpAds_dbResult($res_campaigns, 0, "count")."</b></td>";
 540  echo "<td height='25'>".$strTotalClients.": <b>".phpAds_dbResult($res_clients, 0, "count")."</b></td></tr>";
 541  
 542  echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='images/break-el.gif' height='1' width='100%'></td></tr>";
 543  
 544  echo "<tr><td height='25'>&nbsp;&nbsp;".$strActiveBanners.": <b>".phpAds_dbResult($res_active_banners, 0, "count")."</b></td>";
 545  echo "<td height='25'>".$strActiveCampaigns.": <b>".phpAds_dbResult($res_active_campaigns, 0, "count")."</b></td>";
 546  echo "<td height='25'>&nbsp;</td></tr>";
 547  
 548  echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 549  
 550  echo "</table>";
 551  echo "<br><br>";
 552  
 553  
 554  
 555  /*********************************************************/
 556  /* Store preferences                                     */
 557  /*********************************************************/
 558  
 559  $Session['prefs']['client-index.php']['hideinactive'] = $hideinactive;
 560  $Session['prefs']['client-index.php']['listorder'] = $listorder;
 561  $Session['prefs']['client-index.php']['orderdirection'] = $orderdirection;
 562  $Session['prefs']['client-index.php']['nodes'] = implode (",", $node_array);
 563  
 564  phpAds_SessionDataStore();
 565  
 566  
 567  
 568  /*********************************************************/
 569  /* HTML framework                                        */
 570  /*********************************************************/
 571  
 572  phpAds_PageFooter();
 573  
 574  ?>


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