[ Index ]

PHP Cross Reference of Drupal 6 (heimberg)

title

Body

[close]

/ -> add_organization_handler.php (source)

   1  <?php
   2  
   3  if($_REQUEST[name] != null){
   4  
   5      $requestName = addslashes($_REQUEST[name]);
   6      $sql = "INSERT INTO organization (name, description, phone, url, state, catId) VALUES ('$requestName', ";
   7  
   8      if($_REQUEST[description] == ""){
   9          $sql = $sql . "null, ";
  10      } else {
  11          $requestDescription = addslashes($_REQUEST[description]);
  12          $sql = $sql . "'" . $requestDescription . "', ";
  13      }
  14  
  15      if($_REQUEST[phone] == ""){
  16          $sql = $sql . "null, ";
  17      } else {
  18          $requestPhone = addslashes($_REQUEST[phone]);
  19          $sql = $sql . "'" . $requestPhone . "', ";
  20      }
  21  
  22      if($_REQUEST[url] == ""){
  23          $sql = $sql . "null, ";
  24      } else {
  25          $requesturl = addslashes($_REQUEST[url]);
  26          $sql = $sql . "'" .$_REQUEST[url] . "', ";
  27      }
  28  
  29          if($_REQUEST[state] == ""){
  30                  $sql = $sql . "null, ";
  31          } else {
  32              $requeststate = addslashes($_REQUEST[state]);
  33                  $sql = $sql . "'" .$_REQUEST[state] . "', ";
  34          }
  35  
  36      if($_REQUEST[categoryList] == ""){
  37          $sql = $sql . "null)";
  38      } else {
  39          $sql = $sql . "'" . $_REQUEST[categoryList] . "')";
  40      }
  41      require_once ('DbLib-12.php');
  42      $db = &new DbLibMySQL;
  43      $db->OpenConnection();
  44      $db->Query($sql);
  45      $db->Query("Select id from organization WHERE name = '$requestName'");
  46      $db->GetNextRecord();
  47      $id = $db->GetField('id');
  48      $sql = "select name from category where id = $_REQUEST[categoryList]";
  49      $db->Query($sql);
  50      $db->GetNextRecord();
  51      $catName = $db->GetField('name');
  52      $db->CloseConnection();
  53      $msg = "The organization was added.";
  54  } else {
  55      //redirect

  56      header( 'Location: add_organization.php' ) ;
  57  }
  58  ?>
  59  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/content_mgt.dwt" codeOutsideHTMLIsLocked="false" -->
  60  <head>
  61  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  62  <!-- InstanceBeginEditable name="doctitle" -->
  63  <title>Handler for the Add Organization Form</title>
  64  <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
  65  <!-- InstanceEndEditable -->
  66  <link href="../css/styles_plus_one.css" rel="stylesheet" type="text/css" />
  67  <link href="../css/styles_plus_two.css" rel="stylesheet" type="text/css" />
  68  <link href="../css/styles.css" rel="stylesheet" type="text/css" />
  69  <script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
  70  <script src="../Scripts/utility.js" type="text/javascript"></script>
  71  
  72  <!-- InstanceBeginEditable name="head" -->
  73          
  74          <meta name="generator" content="Adobe GoLive 5" />
  75          
  76      <!-- InstanceEndEditable -->
  77  </head>
  78  
  79  <body>
  80  <div id="wrapper">
  81   <div id="topBar"><a href="../site_search.html">Search</a><a href="../faqs.html">FAQs</a><a href="../sitemap.html">Site Map</a></div> 
  82    <div id="headerBar"><script type="text/javascript">
  83  AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','770','height','120','src','../swf/header2','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','../swf/header2' ); //end AC code

  84  </script><noscript>
  85      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="770" height="120">
  86        <param name="movie" value="../swf/header2.swf" />
  87        <param name="quality" value="high" />
  88        <embed src="../swf/header2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="120"></embed>
  89      </object></noscript>
  90    </div> 
  91    <div id="navBar">
  92        <a href="../index.html" class="menuItem">Home</a>
  93      <a href="../firm/our_firm.html" class="menuItem">Our Firm</a>
  94      <a href="../results/verdicts_settlements.html" class="menuItem">Verdicts &amp; Settlements</a>
  95      <a href="../practices/our_practices.html" class="menuItem">Our Practices</a>
  96      <a href="../attorneys/attorneys_staff.html" class="menuItem">Our Attorneys</a>
  97      <a href="resources.html" class="menuItem">Resources</a>
  98      <a href="../community/community_outreach.html" class="menuItem">Community Outreach</a>
  99      <a href="../contact/contact.html" class="menuItem">Contact Us</a>
 100      
 101      
 102    </div>
 103    
 104    
 105    <div id="mainBody">
 106        <table width="100%" border="0" cellspacing="0" cellpadding="0">
 107    <tr>
 108      <td id="leftNav">
 109          <a href="the_guide.php" class="subNav">THE GUIDE</a>
 110        <br/>
 111        <a href="add_category.php" class="subNav">Add a Category</a>
 112        <a href="delete_category.php" class="subNav">Delete a Category</a>
 113          <a href="update_category_chooser.php" class="subNav">Modify a Category</a>
 114        <br/>
 115          <a href="add_organization.php" class="subNav">Add an Organization</a>
 116        <a href="delete_organization.php" class="subNav">Delete an Organization</a>
 117          <a href="update_organization_chooser.php" class="subNav">Modify an Organization</a>
 118        
 119        </td>
 120      <td id="contentArea">
 121          
 122  
 123      
 124      
 125      <!-- InstanceBeginEditable name="contentRegion" -->
 126          <h1>Add an Organization</h1>
 127      
 128          <p><?php echo $msg ?></p>
 129  
 130          <br />Name: <?php echo $_REQUEST[name] ?>
 131          <br />Description: <?php echo $_REQUEST[description] ?>
 132          <br />Phone: <?php echo $_REQUEST[phone] ?>
 133          <br />url: <a href="<?php echo $_REQUEST[url] ?>"><?php echo $_REQUEST[url] ?></a>
 134          <br />State: <?php echo $_REQUEST[state] ?>
 135          <br />Category: <?php echo $catName; ?>
 136  
 137          <p></p>
 138          <p><a href="update_organization.php?organizationList=<?php echo $id;?>">Modify Organization</a></p>
 139      <!-- InstanceEndEditable --></td>
 140    </tr>
 141  </table>
 142  </div>
 143  <div id="addressBar">1801 Century Park East - Suite 1920 - Los Angeles CA 90067 | TEL: (310) 553-1799 | Toll-Free: (800) 425-5557<br />
 144  2700 N. Central Avenue - Suite 1400 - Phoenix AZ 85004 | TEL:  (602) 285-4406 | Toll-Free: (800) 425-5557</div>
 145    <div id="footerBar">
 146      <table width="100%" border="0" cellspacing="0" cellpadding="0">
 147        <tr>
 148          <td style="padding-left:12px">&copy; Copyright 2006 Heimberg Law Group, LLP. &nbsp;All Rights Reserved. </td>
 149          <td align="right" style="padding-right:12px"><a href="../disclaimer.html">Disclaimer</a></td>
 150        </tr>
 151      </table>
 152    </div>
 153  </div>
 154  </body>
 155  <!-- InstanceEnd --></html>


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