[ Index ]

PHP Cross Reference of Drupal 6 (heimberg)

title

Body

[close]

/ -> view.php (source)

   1  <?php
   2  require_once ('DbLib-12.php');
   3  $dbCat = &new DbLibMySQL;
   4  $dbCat->OpenConnection();
   5  $sqlCat = "SELECT id, name FROM category WHERE parentCatId is null";
   6  $dbCat->Query($sqlCat);
   7  
   8  $dbSubs = &new DbLibMySQL;
   9  $dbSubs->OpenConnection();
  10  $dbOrgs = &new DbLibMySQL;
  11  $dbOrgs->OpenConnection();
  12  ?>
  13  
  14  <html>
  15  
  16      <head>
  17          <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
  18          <meta name="generator" content="Adobe GoLive 5">
  19          <title>View </title>
  20      </head>
  21  
  22      <body bgcolor="#ffffff">
  23  <?php
  24  while($dbCat->GetNextRecord()) { ?>
  25          <p><font size="+2"><?php echo $dbCat->GetField('name');?></font></p>
  26          <?php ///Begin
  27              $sqlSubs = "select id, name from category where parentCatId = ". $dbCat->GetField('id');
  28      $dbSubs->Query($sqlSubs);
  29      while($dbSubs->GetNextRecord()) { ?>
  30          <p><font size="+1"><?php echo $dbSubs->GetField('name'); ?></font></p>
  31          <?php } ?>
  32          <!-- end -->
  33  <?php
  34  }
  35  $dbCat->ResetRecordSet();
  36  
  37  while($dbCat->GetNextRecord()) { ?>
  38          <p><font size="+2"><?php echo $dbCat->GetField('name');?></font></p>
  39  <?php
  40  
  41  //display all orgs for this category

  42  
  43      $sqlOrgs = "SELECT * FROM organization WHERE catId = ". $dbCat->GetField('id');
  44      $dbOrgs->Query($sqlOrgs);
  45      while($dbOrgs->GetNextRecord()) { ?>
  46          <br><?php echo $dbOrgs->GetField('name');?>
  47          <br><?php echo $dbOrgs->GetField('description');?>
  48          <br><?php echo $dbOrgs->GetField('phone');?>
  49          <br><a href="<?php echo $dbOrgs->GetField('url');?>"><?php echo $dbOrgs->GetField('url');?></a>
  50  <?php     }
  51  
  52  //display all the subcategories for this category

  53  
  54      $sqlSubs = "select id, name from category where parentCatId = ". $dbCat->GetField('id');
  55      $dbSubs->Query($sqlSubs);
  56      while($dbSubs->GetNextRecord()) { ?>
  57          <p><font size="+1"><?php echo $dbSubs->GetField('name'); ?></font></p>
  58  <?php
  59  
  60  //display the orgs for the subcategory

  61  
  62          $sqlOrgs = "SELECT * FROM organization WHERE catId = ". $dbSubs->GetField('id');
  63          $dbOrgs->Query($sqlOrgs);
  64          while($dbOrgs->GetNextRecord()) { ?>
  65              <br><?php echo $dbOrgs->GetField('name');?>
  66              <br><?php echo $dbOrgs->GetField('description');?>
  67              <br><?php echo $dbOrgs->GetField('phone');?>
  68              <br><a href="<?php echo $dbOrgs->GetField('url');?>"><?php echo $dbOrgs->GetField('url');?></a>
  69  <?php     }
  70      }
  71  }
  72  ?>
  73      </body>
  74  </html>


Generated: Wed Mar 23 13:22:29 2011 Cross-referenced by PHPXref 0.7