Your IP : 216.73.217.117


Current Path : /var/www/cesa.co.za/members/AnnualDeclaration_Part1/
Upload File :
Current File : /var/www/cesa.co.za/members/AnnualDeclaration_Part1/schedule1_page2GENERIC.php

<?php
// ini_set('display_errors', 1);
// error_reporting(E_ALL);
// Configuration and Autentication
include_once('../inc/auth.inc');
include_once('../inc/func.inc');
// Start Page Includes
include_once('../inc/conf.inc');
// include_once( '../inc/header.inc' );
include_once('../inc/db.inc');
include_once('../inc/declaration.inc');
include_once($_SERVER['DOCUMENT_ROOT'] . '/cesanet/inc_shared.php');

switch ($auth) {
    case 'valid':
        // System Includes
        //include_once( '../inc/pref.inc' );
        // Variables Unique to page
        $title = "cesa.co.za - Annual Declaration " . $DeclarationYear;
        $description = "South African Association of Consulting Engineers. Annual Declaration " . $DeclarationYear . ".";
        $keywords = "online, services, members, consulting, engineers";

?>
        <!-- Start Page Content Here -->

        <head>
            <script language="JavaScript">
                <!--
                function MM_openBrWindow(theURL, winName, features) { //v2.0
                    window.open(theURL, winName, features);
                }
                //
                -->
            </script>
            <title>Annual Declaration <?php echo $DeclarationYear; ?></title>
            <link rel="stylesheet" href="adecstyles.css" type="text/css">
            <style type="text/css">
                <!--
                body,
                td {
                    font-family: Arial, Helvetica, sans-serif;
                    font-size: 10pt;
                }

                .style2 {
                    font-family: Arial, Helvetica, sans-serif
                }

                .style3 {
                    font-size: 12px;
                    font-weight: bold;
                }

                .style4 {
                    font-size: 12px
                }

                .style60 {
                    font-size: 11px
                }
                -->
            </style>
        </head>

        <body bgcolor="#FFFFFF">
            <?php
            $aDecOfficeContactObj = new ADec_OfficeContacts($sqlf);

            // Get the Prev_OfficeID
            $query = "SELECT Prev_OfficeID 
                FROM ADec_tblMemberFirmOffices 
                WHERE OfficeID = '$SelectOfficeID'";
            if (!($result = mysql_query($query))) {
                throw new Exception("Select Id Failed: " . $query);
            }
            $row = mysql_fetch_array($result);
            $OldOfficeID = $row[0];

            $aDecOfficeContactObj->getOrCreate($SelectOfficeID, $OldOfficeID, $DeclarationYear);
            // mysql_connect("$host", "$user", "$password") or die("Unable to connect to SQL server");
            // mysql_select_db("$db") or die("Unable to select database");
            // start page updates here
            // ACTION X ************************************************************************
            // SAVE CHANGES TO PERSON'S INFO
            // *********************************************************************************
            if ($action == "X") {
                $section = "A";
                if ($form['principal'] == "No") {
                    $Oprincipal = 0;
                } else {
                    $Oprincipal = 1;
                }
                $query = "UPDATE ADec_OfficeContacts SET ContactPosition = '" . $form['pos'] . "', Principal = '$Oprincipal', YPF='" . $form['ypf'] . "', Email = '" . $form['email'] . "', "
                    . "DeclarationYear = $DeclarationYear "
                    . "WHERE ContactsID = '$therightid'";
                if (!($result = mysql_query($query))) {
                    throw new Exception("Update Failed on ADec_OfficeContacts in schedule1_page2GENERIC.php: " . $query);
                }
                // UPDATE Contacts.
                $query2 = "UPDATE ADec_Contacts SET ContactSurname = '" . $form['surname'] . "', ContactInitials = '" . $form['initials'] . "', ContactFirstName = '" . $form['alsoknown'] . "', "
                    . "ProfessionalRegistrations = '" . $form['proffreg'] . "', Qualifications = '" . $form['qual'] . "', "
                    . "Comments = '" . $form['fields'] . "', PreferredEmail = '" . $form['email'] . "', IDNumber = '" . $form['idnum'] . "', CellPhone = '" . $form['cellphone'] . "', "
                    . "DeclarationYear = $DeclarationYear "
                    . "WHERE ContactsID = '$therightid'";
                if (!($result2 = mysql_query($query2))) {
                    throw new Exception("Update Failed on ADec_Contacts in schedule1_page2GENERIC.php: " . $query2);
                }
            }
            // *********************************** END *****************************************
            // ACTION NX ************************************************************************
            // SAVE NEW PERSON'S INFO
            // *********************************************************************************
            if ($action == "NX") {
                $section = "A";
                if ($form['principal'] == "No") {
                    $Oprincipal = 0;
                } else {
                    $Oprincipal = 1;
                }
                // INSERT INTO Contacts.
                $query2 = "INSERT INTO ADec_Contacts (ContactSurname, ContactInitials, ContactFirstName, ProfessionalRegistrations, Qualifications, Comments, PreferredEmail, IDNumber, "
                    . "CellPhone, ContactType, DeclarationYear) "
                    . "VALUES ('" . $form['surname'] . "', '" . $form['initials'] . "', '" . $form['alsoknown'] . "', '" . $form['proffreg'] . "', '" . $form['qual'] . "', "
                    . "'" . $form['fields'] . "', '" . $form['email'] . "', '" . $form['idnum'] . "', '" . $form['cellphone'] . "', 'OFFICE', $DeclarationYear)";
                if (!($result2 = mysql_query($query2))) {
                    throw new Exception("Insert of id Failed on ADec_Contacts in schedule1_page2GENERIC.php: " . $query2);
                }

                // Get the ContactsID
                $therightid = mysql_insert_id();

                // INSERT INTO OfficeContacts.
                $query = "INSERT INTO ADec_OfficeContacts (ContactsID, OfficeID, Prev_OfficeID, ContactPosition, Principal, Email, YPF, DeclarationYear) "
                    . "VALUES ('$therightid', '$SelectOfficeID', '$OldOfficeID', '" . $form['pos'] . "', '$Oprincipal', '" . $form['email'] . "', '" . $form['ypf'] . "', $DeclarationYear)";
                if (!($result = mysql_query($query))) {
                    throw new Exception("Insert of id Failed on ADec_OfficeContacts in schedule1_page2GENERIC.php: " . $query);
                }
            }
            // *********************************** END *****************************************
            // ACTION D ************************************************************************
            // DELETE A CONTACT
            // *********************************************************************************
            if ($action == "D") {
                $section = "A";
                $query = "UPDATE ADec_Contacts SET ContactID = 1 WHERE ContactsID = '$therightid'";
                if (!($result = mysql_query($query))) {
                    throw new Exception("Delete of id Failed on ADec_Contacts in schedule1_page2GENERIC.php: " . $query);
                }
            }
            // *********************************** END *****************************************
            // ACTION U ************************************************************************
            // UNDELETE A CONTACT
            // *********************************************************************************
            if ($action == "U") {
                $section = "A";
                $query = "UPDATE ADec_Contacts SET ContactID = 0 WHERE ContactsID = '$therightid'";
                if (!($result = mysql_query($query))) {
                    throw new Exception("Delete of id Failed on ADec_Contacts in schedule1_page2GENERIC.php: " . $query);
                }
            }
            // *********************************** END *****************************************
            // ACTION A ************************************************************************
            // DISPLAY THE FIRST PAGE
            // *********************************************************************************
            if ($action == "A") {
                $section = "A";
            }
            // *********************************** END *****************************************
            // ACTION C ************************************************************************
            // SAVE THE SECOND PAGE
            // *********************************************************************************
            if ($action == "C") {
                $section = "X";
                $displaybutton = "no";
                $messages = "You have completed the document. Please close this window and continue with the next office in the list. ";
                $query9 = "UPDATE ADec_tblMemberFirmOffices SET ProfessionalStaff = '" . ($form['proff'] + 0) . "', "
                . "NonProfTechStaff = '" . ($form['nonprof'] + 0) . "', OtherStaff = '" . ($form['other'] + 0) . "', "
                    . "DeclarationYear = $DeclarationYear "
                    . "WHERE OfficeID = '$SelectOfficeID'";
                if (!($result = mysql_query($query9))) {
                    throw new Exception("Update of office on ADec_tblMemberFirmOffices in schedule1_page2GENERIC.php: " . $query9);
                }

                $query101 = "SELECT OfficeID, Prev_OfficeID 
                    FROM ADec_tblMemberFirmOffices 
                    WHERE OfficeID = '$SelectOfficeID'";
                if (!($Hresult = mysql_query($query101))) {
                    throw new Exception("Select failed on ADec_tblMemberFirmOffices in schedule1_page2GENERIC.php: " . $query101);
                }
                $Hrow = mysql_fetch_array($Hresult);
                $Hf[1] = $Hrow['OfficeID'];
                $reftype = "OfficeID";
                $refdoc = "Schedule1P2";
                $adecdate = date("Y-m-d H:i");
                $query102 = "INSERT INTO ADec_Done (RefID,RefType,RefDoc,ADecDate, DeclarationYear) "
                    . "values('$Hf[1]','$reftype','$refdoc','$adecdate', $DeclarationYear)";
                if (!($Jresult = mysql_query($query102))) {
                    throw new Exception("Insert Failed on ADec_Done in schedule1_page2GENERIC.php: " . $query102);
                }

                // *** NEXT OFFICE ***
                /*
                  $query = "SELECT * FROM ADec_tblMemberFirmOffices WHERE (Prev_FirmID = '$MemberFirmID') AND (SaaceBranch <> 'International' OR SaaceBranch IS NULL) ORDER BY OfficeID";
                  $result = mysql_query($query) or die("Select of id Failed");
                  $OfficeCount = mysql_num_rows($result);
                  if ($officenum < $OfficeCount) {
                  for ($i = 1; $i <= $officenum; $i++) {
                  mysql_fetch_row($result);
                  }
                  if ($rs = mysql_fetch_array($result)) {
                  $officenum = $officenum + 1;
                  echo "<script language='Javascript'>document.location='schedule1_page1GENERIC.php?officenum=$officenum&SelectOfficeID=".$rs['OfficeID']."';</script>";
                  } else {
                  $officenum = $officenum + 1;
                  echo "<script language='Javascript'>document.location='schedule1b_page1BLANK.php?officenum=$officenum';</script>";
                  }
                  } else {
                  $officenum = $officenum + 1;
                  echo "<script language='Javascript'>document.location='schedule1_page1BLANK.php?officenum=$officenum';</script>";
                  }
                  exit;
                 */
            }
            // *********************************** END *****************************************
            // ACTION B ************************************************************************
            // DISPLAY THE SECOND PAGE
            // *********************************************************************************
            if ($action == "B") {
                $section = "B";
            }
            // *********************************** END *****************************************
            // ACTION N ************************************************************************
            // DISPLAY THE SCREEN TO ADD A PERSON
            // *********************************************************************************
            if ($action == "N") {
                $section = "N";
                $messages = "Please fill in the fields and SUBMIT.";
            }

            // ACTION E ************************************************************************
            // DISPLAY THE SCREEN TO CHANGE A PERSON'S INFO
            // *********************************************************************************
            if ($action == "E") {
                $section = "E";

                // get the relevant data
                $query = "SELECT * FROM ADec_OfficeContacts WHERE ContactsID = '$therightid'";
                if (!($result = mysql_query($query))) {
                    throw new Exception("Select of id Failed on ADec_OfficeContacts in schedule1_page2GENERIC.php: " . $query);
                }
                $rs = mysql_fetch_array($result);
                $ContactPosition = $rs['ContactPosition'] . "";
                if ($rs['Principal'] == 0) {
                    $selected1 = "selected";
                    $selected2 = "";
                } else {
                    $selected1 = "";
                    $selected2 = "selected";
                }
                if ($rs['YPF'] == 'y') {
                    $selected3 = "selected";
                    $selected4 = "";
                } else {
                    $selected3 = "";
                    $selected4 = "selected";
                }
                // get the rest of the results
                $query2 = "SELECT ContactsID, ContactSurname, ContactInitials, ContactFirstName, ProfessionalRegistrations, Qualifications, Comments, PreferredEmail, IDNumber, CellPhone, "
                    . "ContactID FROM ADec_Contacts WHERE ContactsID = '$therightid'";
                if (!($result2 = mysql_query($query2))) {
                    throw new Exception("Select of id Failed on ADec_Contacts in schedule1_page2GENERIC.php: " . $query2);
                }
                $ps = mysql_fetch_array($result2);
                $messages = "Please edit the fields you want to change and SUBMIT.";
            }
            // *********************************** END *****************************************
            ?>
            <?php
            include_once('../inc/declaration_nav.php');
            ?>
            <form method="post" action="<?php echo $PHP_SELF; ?>?officenum=<?php echo $officenum; ?>" enctype="multipart/form-data">
                <table width="100%" border="1" cellspacing="1" cellpadding="0">
                    <tr>
                        <td>
                            <div align="center"> </div>
                            <div align="left">
                                <table width=700 border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#336699">
                                    <tr>
                                        <td colspan=2 rowspan=3><img src="images/stepnum2.jpg" width=65 height=60 alt=""></td>
                                        <td> <img src="images/navigation_02.jpg" width=20 height=16 alt=""></td>
                                        <td> <img src="images/navigation_03.jpg" width=155 height=16 alt=""></td>
                                        <td> <img src="images/navigation_04.jpg" width=52 height=16 alt=""></td>
                                        <td> <img src="images/navigation_05.jpg" width=387 height=16 alt=""></td>
                                        <td> <img src="images/navigation_06.jpg" width=21 height=16 alt=""></td>
                                    </tr>
                                    <tr>
                                        <td> <img src="images/navigation_07.jpg" width=20 height=29 alt=""></td>
                                        <td colspan=3 bgcolor="#336699">
                                            <center class="style2">
                                                <font color="white">OFFICES WITHIN SOUTH AFRICA: PAGE 2 </font>
                                            </center>
                                        </td>
                                        <td> <img src="images/navigation_09.jpg" width=21 height=29 alt=""></td>
                                    </tr>
                                    <tr>
                                        <td> <img src="images/navigation_10.jpg" width=20 height=15 alt=""></td>
                                        <td> <img src="images/navigation_11.jpg" width=155 height=15 alt=""></td>
                                        <td> <img src="images/navigation_12.jpg" width=52 height=15 alt=""></td>
                                        <td> <img src="images/navigation_13.jpg" width=387 height=15 alt=""></td>
                                        <td> <img src="images/navigation_14.jpg" width=21 height=15 alt=""></td>
                                    </tr>
                                    <tr>
                                        <td> <img src="images/navigation_15.jpg" width=13 height=36 alt=""></td>
                                        <td colspan=3><img src="images/spacer.gif" width=227 height=36 alt=""></td>
                                        <td> <img src="images/navigation_17.jpg" width=52 height=36 alt=""></td>
                                        <td rowspan=3 bgcolor="#336699"><span class="style2">
                                                <font color="#FFFFFF" size="2"> Please complete the form below, then click the Save and Continue button at the bottom of the page.<br>
                                                    Questions? <a href="mailto:general@cesa.co.za">
                                                        <font color=white>Click here for help</font>
                                                    </a>. </font>
                                            </span></td>
                                        <td> <img src="images/navigation_19.jpg" width=21 height=36 alt=""></td>
                                    </tr>
                                    <tr>
                                        <td> <img src="images/navigation_20.jpg" width=13 height=5 alt=""></td>
                                        <td> <img src="images/navigation_21.jpg" width=52 height=5 alt=""></td>
                                        <td> <img src="images/navigation_22.jpg" width=20 height=5 alt=""></td>
                                        <td> <img src="images/navigation_23.jpg" width=155 height=5 alt=""></td>
                                        <td> <img src="images/navigation_24.jpg" width=52 height=5 alt=""></td>
                                        <td> <img src="images/navigation_25.jpg" width=21 height=5 alt=""></td>
                                    </tr>
                                    <tr>
                                        <td> <img src="images/navigation_26.jpg" width=13 height=18 alt=""></td>
                                        <TD COLSPAN=3 bgcolor="#336699">
                                            <table border=0 width=100%>
                                                <tr>
                                                    <td align="left" style="color:#FFFFFF; font-size:11px; font-weight:bold;">Office <?php echo $officenum; ?> of <?php echo $OfficeCount; ?> </td>
                                                    <td align="right"><a href="#" onClick="javascript:ShowOffices();" style="color:#FFFFFF; font-size:11px; font-weight:bold;">View all</a></td>
                                                </tr>
                                            </table>
                                        </TD>
                                        <td> <img src="images/navigation_28.jpg" width=52 height=18 alt=""></td>
                                        <td> <img src="images/navigation_29.jpg" width=21 height=18 alt=""></td>
                                    </tr>
                                    <tr>
                                        <td> <img src="images/navigation_30.jpg" width=13 height=11 alt=""></td>
                                        <td> <img src="images/navigation_31.jpg" width=52 height=11 alt=""></td>
                                        <td> <img src="images/navigation_32.jpg" width=20 height=11 alt=""></td>
                                        <td> <img src="images/navigation_33.jpg" width=155 height=11 alt=""></td>
                                        <td> <img src="images/navigation_34.jpg" width=52 height=11 alt=""></td>
                                        <td> <img src="images/navigation_35.jpg" width=387 height=11 alt=""></td>
                                        <td> <img src="images/navigation_36.jpg" width=21 height=11 alt=""></td>
                                    </tr>
                                </table>
                                <font face="sans-serif"></font>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="10%">
                                        <div align="left">
                                            <font size="1" face="sans-serif"><img width=202 height=80
                                                    src="images/image002.gif" v:shapes="_x0000_i1026"></font>
                                        </div>
                                    </td>
                                    <td width="79%">
                                        <div align="center">
                                            <font face="sans-serif"><span class="style4">CONSULTING ENGINEERS OF SOUTH AFRICA<br>
                                                    PRINCIPALS AND PROFESSIONAL STAFF</span></font>
                                            <font size="1" face="sans-serif"><br>
                                            </font>
                                        </div>
                                    </td>
                                    <td width="11%">
                                        <div align="right" class="style3">
                                            <font face="sans-serif">SCHEDULE 1<br>
                                                <?php echo $DeclarationYear; ?><br>
                                                Page 2</font>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <font face="sans-serif" size="2"> <b>
                                                <?php
                                                // ALL PAGE CONTENT STARTS HERE ****************************************
                                                // *********************************************************************
                                                // SECTION X ************************************************************************
                                                // *********************************************************************************
                                                if ($section == "X") {
                                                ?>
                                            </b></font>
                                        <div align="center">
                                            <p><b>
                                                    <font face="sans-serif" size="2">Thank you for completing
                                                        this document.</font>
                                                </b>
                                        </div>
                                        <p>
                                        <?php
                                                }
                                                // *********************************** END *****************************************
                                                // SECTION E ***********************************************************
                                                // *********************************************************************
                                                if ($section == "E") {
                                                    $action = "X";
                                        ?>
                                        </p>

                                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Surname</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[surname]" size="30" value="<?php echo $ps[1]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699" height="27">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Initials</font>
                                                </td>
                                                <td width="50%" height="27">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[initials]" size="30" value="<?php echo $ps[2]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Known As(e.g. &#147;Bill&#148; for &#147;William&#148;)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[alsoknown]" size="30" value="<?php echo $ps[3]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Professional
                                                        Registration (if any) number and date (PrEng, PrTechEng,Quantity
                                                        Surveyor, Architect, CA(SA) etc; full Membership of Institutions etc)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[proffreg]" size="30" value="<?php echo $ps[4]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Qualifications
                                                        (Degrees/Diplomas)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[qual]" size="30" value="<?php echo $ps[5]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Field/s
                                                        of Expertise</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[fields]" size="30" value="<?php echo $ps[6]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Active position
                                                        in firm(e.g. company director, partner, office manager, other)(**See
                                                        Note Below)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[pos]" size="30" value="<?php echo $ContactPosition; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">E-mail
                                                        address</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[email]" size="30" value="<?php echo $ps[7]; ?>">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Principal</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <select name="form[principal]">
                                                            <option value="No" <?php echo $selected1; ?>>No</option>
                                                            <option value="Yes" <?php echo $selected2; ?>>Yes</option>
                                                        </select>
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Young Professional (YPF)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <select name="form[ypf]">
                                                            <option value="n" <?php echo $selected3; ?>>No</option>
                                                            <option value="y" <?php echo $selected4; ?>>Yes</option>
                                                        </select>
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">ID Number </font>
                                                </td>
                                                <td>
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input name="form[idnum]" type="text" id="form[idnum]" value="<?php echo $ps[8]; ?>" size="30">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Cellphone Number </font>
                                                </td>
                                                <td>
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input name="form[cellphone]" type="text" id="form[cellphone]" value="<?php echo $ps[9]; ?>" size="30">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2"> </td>
                                            </tr>
                                        </table>
                                    <?php
                                                }
                                                // ****************   END **********************************************
                                                // SECTION N ***********************************************************
                                                // *********************************************************************
                                                if ($section == "N") {
                                                    $action = "NX";
                                    ?>
                                        </p>

                                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Surname</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[surname]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699" height="27">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Initials</font>
                                                </td>
                                                <td width="50%" height="27">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[initials]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Known As(e.g. &#147;Bill&#148; for &#147;William&#148;)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[alsoknown]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Professional
                                                        Registration (if any) number and date (PrEng, PrTechEng,Quantity
                                                        Surveyor, Architect, CA(SA) etc; fullMembership of Institutions)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[proffreg]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Qualifications
                                                        (Degrees/Diplomas)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[qual]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Field/s
                                                        of Expertise</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[fields]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Active position
                                                        in firm(e.g. company director, partner, office manager, other)(**See
                                                        Note Below)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[pos]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">E-mail
                                                        address</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input type="text" name="form[email]" size="30" value="">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Principal</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <select name="form[principal]">
                                                            <option value="No">No</option>
                                                            <option value="Yes">Yes</option>
                                                        </select>
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="55%" bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Young Professional (YPF)</font>
                                                </td>
                                                <td width="50%">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <select name="form[ypf]">
                                                            <option value="n">No</option>
                                                            <option value="y">Yes</option>
                                                        </select>
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">ID Number </font>
                                                </td>
                                                <td>
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input name="form[idnum]" type="text" id="form[idnum]" value="" size="30">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td bgcolor="#336699">
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">Cellphone Number </font>
                                                </td>
                                                <td>
                                                    <font face="Times New Roman, Times, serif" size="1" color="#CCCCCC">
                                                        <input name="form[cellphone]" type="text" id="form[cellphone]" value="" size="30">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2"> </td>
                                            </tr>
                                        </table>
                                    <?php
                                                }
                                                // ****************   END **********************************************
                                                // SECTION B ***********************************************************
                                                // *********************************************************************
                                                if ($section == "B") {
                                                    $action = "C";
                                    ?>
                                        <p>
                                            <font size="1" face="Times New Roman, Times, serif"><b>
                                                    B. TOTAL STAFF <i><u>AT THIS BRANCH ONLY</u></i></b></font>
                                        <table border=1 cellspacing=0 cellpadding=0 width="100%">
                                            <tr>
                                                <td colspan=2 valign=top class="Normal" bgcolor="#336699">
                                                    <p align=left style='text-align:center'><b>
                                                            <font size="1" face="Times New Roman, Times, serif" color="#CCCCCC"><span
                                                                    style='font-size:10.0pt;font-family:"Times New Roman"'>TOTAL OF ALL PRINCIPALS,
                                                                    PROFESSIONAL AND CONTRACT STAFF LISTED IN A ABOVE</span></font>
                                                        </b></p>
                                                </td>
                                                <td width=182 valign=top class="Normal">
                                                    <font size="1" face="Times New Roman, Times, serif">
                                                        <input type="text" name="form[proff]" value="<?php echo $MemberProffStaff; ?>" size="10">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan=2 valign=top class="Normal" bgcolor="#336699">
                                                    <p align=left style='
                                                           text-align:center'><b>
                                                            <font size="1" face="Times New Roman, Times, serif" color="#CCCCCC"><span
                                                                    style='font-size:10.0pt;font-family:"Times New Roman"'>TOTAL OF NON-PROFESSIONAL
                                                                    TECHNICAL AND CONTRACT STAFF (e.g. graduates, draughtsperson,
                                                                    laboratory assistants, etc)</span></font>
                                                        </b></p>
                                                </td>
                                                <td width=182 valign=top class="Normal">
                                                    <font size="1" face="Times New Roman, Times, serif">
                                                        <input type="text" name="form[nonprof]" value="<?php echo $MemberNonProff; ?>" size="10">
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan=2 valign=top class="Normal" bgcolor="#336699">
                                                    <p align=left style='
                                                           text-align:center'><b>
                                                            <font size="1" face="Times New Roman, Times, serif" color="#CCCCCC"><span
                                                                    style='font-size:10.0pt;font-family:"Times New Roman"'>TOTAL OF OTHER STAFF
                                                                    AND CONTRACT STAFF (e.g. secretaries, bookkeepers etc)</span></font>
                                                        </b></p>
                                                </td>
                                                <td width=182 valign=top class="Normal">
                                                    <font size="1" face="Times New Roman, Times, serif">
                                                        <input type="text" name="form[other]" value="<?php echo $MemberOtherStaff; ?>" size="10">
                                                    </font>
                                                </td>
                                            </tr>
                                        </table>
                                    <?php
                                                }
                                                // ****************   END **********************************************
                                                // SECTION A ***********************************************************
                                                // *********************************************************************
                                                if ($section == "A") {
                                                    $action = "C";
                                    ?>
                                        <p>
                                            <font size="1" face="sans-serif"> <b> A. DETAILS OF ALL PRINCIPALS
                                                    AND PROFESSIONAL STAFF <i><u>AT THIS BRANCH ONLY</u></i> </b> </font>
                                        </p>
                                        <?php
                                                    $messages = "";

                                                    $query = "SELECT * FROM ADec_OfficeContacts WHERE OfficeID = '$SelectOfficeID'";
                                                    $result = mysql_query($query) or die(__LINE__ . "Select of id Failed");
                                        ?>
                                        <b>
                                            <font size=2>NB: Please click on the <i>CHANGE</i> link in the last row below the individual whose details you want to amend!</font>
                                        </b><br>
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <?php
                                                    $iRecordNum = 0;
                                                    $iCellNum = 0;
                                                    while ($rs = mysql_fetch_array($result)) {
                                                        $iRecordNum++;
                                                        $iCellNum++;
                                                        $therightid = $rs['ContactsID'];
                                                        $principal = $rs['Principal'];
                                                        if ($rs['Principal'] == 0) {
                                                            $yesno = "no";
                                                        } else {
                                                            $yesno = "yes";
                                                        }
                                                        if ($rs['YPF'] == 'y') {
                                                            $yesno2 = "yes";
                                                        } else {
                                                            $yesno2 = "no";
                                                        }

                                                        // Get the relevant details to display
                                                        //		  mysql_connect("$host","$user","$password") or die("Unable to connect to SQL server");
                                                        //        mysql_select_db("$db") or die("Unable to select database");
                                                        $query2 = "SELECT ContactsID, ContactSurname, ContactInitials, ContactFirstName, ProfessionalRegistrations, Qualifications, Comments, "
                                                            . "PreferredEmail, IDNumber, CellPhone, ContactID FROM ADec_Contacts WHERE ContactsID = '$therightid'";
                                                        $result2 = mysql_query($query2) or die(__LINE__ . "Select of id Failed");
                                                        $ps = mysql_fetch_array($result2);
                                                        // Show deleted people as struck out
                                                        if ($ps['ContactID'] == 1) {
                                                            $strikeout = "text-decoration:line-through;";
                                                        } else {
                                                            $strikeout = "";
                                                        }

                                                        $bBeginRow = false;
                                                        $bEndRow = false;

                                                        if ($iCellNum == 1)
                                                            $bBeginRow = true;
                                                        if ($iCellNum == 4) {
                                                            $bEndRow = true;
                                                            $iCellNum = 0;
                                                        }

                                                        if ($bBeginRow) {
                                            ?>
                                                    <tr>
                                                        <td valign="top" width="25%">
                                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <td>&nbsp;</td>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Surname</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Initials</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=40></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Known As </font>
                                                                        <font color="#CCCCCC"><span class="style60">(e.g. &ldquo;Bill&rdquo; for &ldquo;William&rdquo;)</span></font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=90></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Professional Registration (if any) number and date </font>
                                                                        <font color="#CCCCCC"><span class="style60">(PrEng, PrTechEng,Quantity Surveyor, Architect, CA(SA) etc; full Membership of Institutions etc)</span></font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=65></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Qualifications </font>
                                                                        <font color="#CCCCCC"><span class="style60">(Degrees/Diplomas)</span></font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=65></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Field/s of Expertise</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=47></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Active position in firm </font>
                                                                        <font color="#CCCCCC"><span class="style60">(e.g. partner, office manager, YPF, other) (**See Note Below)</span></font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=40></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">E-mail address</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Principal</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">YPF</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">ID Number </font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=24></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">Cellphone Number</font>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td><img src=images/spacer.gif width="1" height=65></td>
                                                                    <th align="left" valign="top" bgcolor="#336699" style="border:1px solid black">
                                                                        <font color="#CCCCCC" size="2">ACTION</font>
                                                                    </th>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    <?php
                                                        }
                                                    ?>
                                                    <td valign="top" width="25%">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td bgcolor="#EEEEEE">
                                                                    <center>
                                                                        <b><?php echo $iRecordNum; ?></b>
                                                                    </center>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td style="border:1px solid black;"><span style=" <?php echo $strikeout; ?>"><?php echo $ps[1]; ?></span>&nbsp;<?php if ($ps['ContactID'] == 1) echo "*&nbsp;DELETED&nbsp;*"; ?></td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td valign=top style="border:1px solid black; <?php echo $strikeout; ?>"> <?php echo $ps[2]; ?>&nbsp; </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=40></td>
                                                                <td valign=top style="border:1px solid black; <?php echo $strikeout; ?>"> <?php echo $ps[3]; ?>&nbsp; </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=90></td>
                                                                <td valign=top style="border:1px solid black"> <?php echo $ps[4]; ?>&nbsp; </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=65></td>
                                                                <td valign=top style="border:1px solid black"> <?php echo $ps[5]; ?>&nbsp; </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=65></td>
                                                                <td valign=top style="border:1px solid black"> <?php echo $ps[6]; ?> &nbsp;&nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=47></td>
                                                                <td valign=top style="border:1px solid black"> <?php echo $rs[2]; ?>&nbsp; </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=40></td>
                                                                <td valign=top style="border:1px solid black"> <?php echo $ps[7]; ?> &nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td valign=top style="border:1px solid black">
                                                                    <font size="2"><?php echo $yesno; ?></font>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td valign=top style="border:1px solid black">
                                                                    <font size="2"><?php echo $yesno2; ?></font>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td valign=top nowrap style="border:1px solid black"><?php echo $ps[8]; ?>&nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=24></td>
                                                                <td valign=top style="border:1px solid black"><?php echo $ps[9]; ?>&nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                                <td><img src=images/spacer.gif width="1" height=65></td>
                                                                <td valign="top" bgcolor="#EEEEEE" style="border:1px solid black">
                                                                    <font size="2">
                                                                        <?php
                                                                        $thisguysname = $ps[2] . " " . $ps[1];
                                                                        $NewFile = "schedule1_page2GENERIC.php";
                                                                        printf("<a href=\"%s?officenum=%s&SelectOfficeID=%s&action=E&therightid=%s\")'>CHANGE %s's Details</a>\n", $NewFile, $officenum, $SelectOfficeID, $therightid, $thisguysname);
                                                                        ?>
                                                                        <br>
                                                                        <br>
                                                                        <?php
                                                                        if ($ps['ContactID'] != 1) {
                                                                            printf("<a href=\"%s?officenum=%s&SelectOfficeID=%s&action=D&therightid=%s\")'>DELETE %s</a>\n", $NewFile, $officenum, $SelectOfficeID, $therightid, $thisguysname);
                                                                        } else {
                                                                            printf("<a href=\"%s?officenum=%s&SelectOfficeID=%s&action=U&therightid=%s\")'>UNDELETE %s</a>\n", $NewFile, $officenum, $SelectOfficeID, $therightid, $thisguysname);
                                                                        }
                                                                        ?>
                                                                    </font>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <?php
                                                        if ($bEndRow) {
                                                    ?>
                                                    </tr>
                                                <?php
                                                        }
                                                        // here we end the while
                                                    }
                                                    // was the row properly ended?
                                                    if (!$bEndRow) {
                                                        for ($i = $iCellNum + 1; $i <= 4; $i++) {
                                                ?>
                                                    <td>&nbsp;</td>
                                                <?php
                                                        }
                                                ?>
                                </tr>
                            <?php
                                                    }
                            ?>
                            </table>
                        <?php
                                                }
                                                // ****************   END **********************************************

                                                echo "<p align=center style='text-align:center'><font size=2 face=sans-serif><b>";
                                                printf("<a href=\"%s?officenum=%s&SelectOfficeID=%s&action=N\")'>CLICK HERE TO ADD A STAFF MEMBER</a>\n", $NewFile, $officenum, $SelectOfficeID);
                                                echo "</b></font></p>";

                                                // ALL PAGE CONTENT ENDS HERE *****************************************
                                                // ********************************************************************
                        ?>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <p align=center style='text-align:center'>
                                <font size="1" face="sans-serif"><b><span style='font-size:10.0pt;font-family: Times New Roman'>NOTE:</span></b><span> </span><b>A FULL CURRICULUM
                                        VITAE IN RESPECT OF EACH PRINCIPAL MUST <br>
                                        BE ATTACHED UNLESS ALREADY SUPPLIED TO THE ASSOCIATION</b></font>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <div align="center">
                                <font size="1" face="sans-serif">** <b><i>At
                                            least 50% of the company directors, partners, members of the close
                                            corporation for the firm as a whole must be professionally registered
                                            in accordance with Clause 2.1.6<br>
                                            A Principal of a Firm shall be any of the following who is in active practice in the firm:
                                            A sole practitioner, where the firm is a partnership, all the partners;
                                            where the Firm is a close corporation, all the members;
                                            where the Firm is a company, all the directors appointed in terms of the Companies Act
                                            or equivalent in the country of operation</i></b></font>
                            </div>
                        </td>
                    </tr>
                </table>
                </td>
                </tr>
                <tr bgcolor="#336699">
                    <td bgcolor="#336699">
                        <div align="center">
                            <p><b>
                                    <font color="white">
                                        <?php echo $messages; ?>
                                    </font>
                            </p>
                            <?php
                            if ($displaybutton == "no") {
                                echo "";
                            } else {
                            ?>
                                </b></font>
                                <font color="#000000"><b>
                                        <font face="sans-serif" size="2">
                                            <input name="imageField" type="image" src="images/save.jpg" width="200" height="100" border="0">
                                        </font>
                                    </b></font>
                                <font face="sans-serif" size="2"><b>
                                    <?php
                                }
                                    ?>
                                    </b></font>
                        </div>
                    </td>
                </tr>
                </table>
                <INPUT TYPE="HIDDEN" NAME="SelectOfficeID" VALUE="<?php echo $SelectOfficeID; ?>">
                <INPUT TYPE="HIDDEN" NAME="therightid" VALUE="<?php echo $therightid; ?>">
                <INPUT TYPE="HIDDEN" NAME="principal" VALUE="<?php echo $principal; ?>">
                <INPUT TYPE="HIDDEN" NAME="Qofficeid" VALUE="<?php echo $Qofficeid; ?>">
                <INPUT TYPE="HIDDEN" NAME="action" VALUE="<?php echo $action; ?>">
                <INPUT TYPE="HIDDEN" NAME="officenum" VALUE="<?php echo $officenum; ?>">
            </form>
            <!-- End Page Content Here -->
            <map name="Map">
                <area shape="circle" coords="68,19,16" href="#" onClick="javascript:ShowNav();" alt="Annual Declaration">
                <area shape="circle" coords="96,18,13" href="#" onClick="javascript:ShowNav();" alt="Schedule 1: Offices within South Africa">
                <area shape="circle" coords="124,17,13" href="#" onClick="javascript:ShowNav();" alt="Schedule 1A: Firms to be treated as one">
                <area shape="circle" coords="148,18,14" href="#" onClick="javascript:ShowNav();" alt="Schedule 1B: Offices outside South Africa">
                <area shape="circle" coords="175,17,13" href="#" onClick="javascript:ShowNav();" alt="Schedule 2: Fields of expertise">
                <area shape="circle" coords="201,18,14" href="#" onClick="javascript:ShowNav();" alt="Documents to be printed">
            </map>
    <?php
        // End page Includes
        include_once('../inc/footer2.inc');
        break;
    case 'invalid':
        header("Location: /login.php?pageurl=" . $_SERVER['REQUEST_URI']);
        //systemerror("Login Error","Initial Login Failure",getenv ("PATH_INFO"), $authorized);
        break;
    default:
        systemerror("System Error", "System Failure on Authentication", getenv("PATH_INFO"), "There is a problem logging into our system. Try again later or if the problem persists, please contact CESA to report the problem.");
        break;
}