Source for file person.php

Documentation is available at person.php

  1. <?php
  2. /**************************************************************
  3. * This file is part of CompInaBox. *
  4. * Copyright 2001-2003. Eric D. Nielsen, All rights reserverd *
  5. * CompInaBox is availible for license under the GPL, see *
  6. * the COPYING file in the root directory of the install for *
  7. * the full terms of the GPL. *
  8. * *
  9. * *
  10. * File: index.php *
  11. * Type: Serveable Page *
  12. * Author: Eric D. Nielsen *
  13. * Description: Main result tracker page
  14. * Change Log: 4/23/03 -- created -- edn *
  15. ****************************************************************/
  16.  
  17. // cib_header will setup $user if logged in, otherwise $user is unset
  18. // cib_header also establishes the database connection
  19. // cib_header does not create the CIB_Display object as many scripts
  20. // use this header as well as viewable pages
  21.  
  22. include("include_others.inc");
  23. include("$CIB_CLASS_PATH/database/ResultsDB.inc");
  24. include("$CIB_CLASS_PATH/html-formatting/ResultDisplay.inc");
  25. $db = new ResultsDB($db->getDBName(), $db->getDBuser(), $db->getDBPass());
  26. $display = new ResultDisplay($db);
  27. $page = $display->beginPage("CompInaBox",
  28. "Result Tracker");
  29. if (!isset($_POST["personID"]) || $_POST["personID"]=="")
  30. {
  31. $lookupName=$_POST["name"]; // not sanitized yet
  32. $lookupName=str_replace(array("<",">"),array("",""),$lookupName);
  33. $personIDs = $db->getPeopleByName($lookupName);
  34. if (count($personIDs)==0)
  35. {
  36. $page .= <<<END_PAGE
  37. No matching people for $lookupName
  38. <form action="person.php" method="post">
  39. <input type="text" name="name" value="" \>
  40. <input type="submit" name="submit" value="Get Personal Results" \>
  41. </form>
  42. END_PAGE; }
  43. else if (count($personIDs)>1)
  44. {
  45. $personDetails = $db->getIdentificationByID($personIDs);
  46. $page .= $display->formatPersonChoice($personDetails);
  47. }
  48. else
  49. {
  50. $personID=$personIDs[0];
  51. localRedirect("Location: {$CIB_BASE_URL}results/summary/$personID");
  52. exit;
  53. }
  54. }
  55.  
  56.  
  57. // footer matter, OK to be below the fold
  58. $page .= $display->sectionBreak();
  59. $page .= $display->compinaboxBox();
  60. $page .= $display->endPage();
  61. echo $page;
  62. clean_up_session();
  63. ?>

Documentation generated on Tue, 25 Apr 2006 13:07:43 -0400 by phpDocumentor 1.3.0RC3