MemberShip Database port to PHP4


/ -> add_committee.php

1  <?php
2 
3  // get application functions
4  require('include/variables.php');
5  require('include/app_functions.php');
6 
7  include('include/win95.scheme.php');
8 
9  siteHeader("Committees Script");
10 
11  pageTop("Membership Database Application: ADD COMMITTEE");
12 
13  bodyTag();
14 
15  // Define $conn
16  $conn = connect();
17 
18  // if this is a submit process
19  if($submit) {
20    // Error Checking
21    $ErrorArr = array();
22    if(!$CommitteeName) $ErrorArr[] = "Committee Name is Required";
23    if(!$CommitteeDescription) $ErrorArr[] = "Committee Description is Required";
24    foreach($ErrorArr as $Errors) {
25          print "<LI>" .$Errors."\n";
26    }
27 
28    $insert_qry = "INSERT INTO Committees";
29    $insert_qry .= " VALUES ('', '$CommitteeName','$CommitteeDescription')";
30       
31    $result = query($insert_qry);
32    if(!$result) {
33          print error();
34          } else {
35          print "Data was entered";
36          }
37 
38  } else {
39 
40   
41     formActionBegin("$PHP_SELF");
42       formInput("hidden","CommitteID","''");
43       print "Committee Name<br>";
44       formInput("text","CommitteeName");
45       print "<br>";
46       print "Committee Description<br>";
47       formTextArea("CommitteeDescription");
48     formActionEnd("submit","Submit Committee");
49  }
50 
51 
52 
53  pageBottom();
54  siteFooter();
55 
56 
57  ?>
58 


Generated: Sat Jan 27 16:28:07 2001 Generated by PHPXref 0.1.2
PCCS-Linux.COM ::ource Advocate Articles catalogue
2000 2002