Your IP : 216.73.217.117


Current Path : /var/www/cesa.co.za/members/AnnualDeclaration/
Upload File :
Current File : /var/www/cesa.co.za/members/AnnualDeclaration/printschedules.php

<?php
// Configuration and Autentication
include( '../inc/auth.inc' );
include( '../inc/func.inc' );
switch ($auth) {
    case valid:
        // System Includes
        //include( '../inc/pref.inc' );
        // Variables Unique to page
        $title = "members.saace.co.za - Annual Declaration " & $DeclarationYear;
        $description = "South African Association of Consulting Engineers. Annual Declaration " & $DeclarationYear & ".";
        $keywords = "online, services, members, consulting, engineers";

        // Start Page Includes
        include( '../inc/conf.inc' );
        // include( '../inc/header.inc' );

        include( '../inc/db.inc' );
        ?>
        <!-- Start Page Content Here -->
        <script language="JavaScript">
            <!--
            function MM_openBrWindow(theURL, winName, features) { //v2.0
                window.open(theURL, winName, features);
            }
            //-->
        </script>
        <title>Annual Declaration <?php echo $DeclarationYear; ?></title><body bgcolor="#FFFFFF">
                <?php
                include( '../inc/declaration.inc' );
                include( '../inc/declaration_nav.php' );
                ?>
            <form method="post" action="<?php echo $PHP_SELF; ?>?action=yes" enctype="multipart/form-data">
                <table width="100%" border="1" cellspacing="1" cellpadding="0">
                    <tr>
                        <td>
                            <div align="center"><font color="#000000"><b></b></font> </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/stepnum6.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>
                                        <span class="style1"><font color="white" face="Arial, Helvetica, sans-serif">PRINT AND FAX DOCUMENTS </font></span>
                                    </center>              <center>
                                    </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> <a href="#" onClick="javascript:ShowNav();"><IMG SRC="images/stepseq6.jpg" WIDTH=227 HEIGHT=36 ALT="" usemap="#Map"></a></TD>
                                        <TD> <IMG SRC="images/navigation_17.jpg" WIDTH=52 HEIGHT=36 ALT=""></TD>
                                        <TD ROWSPAN=3 bgcolor="#336699"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"> Please complete the form below, then click the Save and Continue button at the bottom of the page.<br>
                                            Questions? <a href="mailto:julia@xe.co.za"><font color=white>Click here for help</font></a>. </font></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">&nbsp; </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>
                                <p>The final step is to <strong>print</strong> the following documents, complete and <strong>sign</strong> them, and <strong>fax</strong> them to SAACE on <strong>(011) 463 7383</strong>. </p>
                                <p>Click on the name of the document, below, to open the document in a new window.</p>
                                <p><a href="annualGENERIC4.php" target="_blank">Declaration to be signed by the Mandated Principal</a></p>
                                <p><a href="schedule1aGENERIC.php" target="_blank">Schedule 1A: Firms to be invoiced as one</a></p>
                                <p><a href="schedule3.php" target="_blank">Declaration of holding company (where applicable) </a></p>
                                <p>And <strong>finally</strong>, please <strong>click the button below</strong> to close this window and let us know that you are finished with your annual declaration!</p>
                                <p><a href="declcomplete.php"><img src="images/alldone.jpg" width="200" height="100"></a></p>
                                <p>&nbsp; </p>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top">
                            <?php
                            if ($action == "yes") {
                                $showbutton = "no";
                                $errormessage = "Thank you for completing the document. Please close this window and return to the Control Page to continue.";
// Perform the update
                                if ($checkbox1 == "checkbox") {
                                    $checkbox1 = 1;
                                } else {
                                    $checkbox1 = 0;
                                }
                                if ($checkbox2 == "checkbox") {
                                    $checkbox2 = 1;
                                } else {
                                    $checkbox2 = 0;
                                }
                                if ($checkbox3 == "checkbox") {
                                    $checkbox3 = 1;
                                } else {
                                    $checkbox3 = 0;
                                }
                                if ($checkbox4 == "checkbox") {
                                    $checkbox4 = 1;
                                } else {
                                    $checkbox4 = 0;
                                }
                                if ($checkbox5 == "checkbox") {
                                    $checkbox5 = 1;
                                } else {
                                    $checkbox5 = 0;
                                }
                                if ($checkbox6 == "checkbox") {
                                    $checkbox6 = 1;
                                } else {
                                    $checkbox6 = 0;
                                }
                                if ($checkbox7 == "checkbox") {
                                    $checkbox7 = 1;
                                } else {
                                    $checkbox7 = 0;
                                }
                                if ($checkbox8 == "checkbox") {
                                    $checkbox8 = 1;
                                } else {
                                    $checkbox8 = 0;
                                }
                                if ($checkbox9 == "checkbox") {
                                    $checkbox9 = 1;
                                } else {
                                    $checkbox9 = 0;
                                }
                                if ($checkbox10 == "checkbox") {
                                    $checkbox10 = 1;
                                } else {
                                    $checkbox10 = 0;
                                }
                                if ($checkbox11 == "checkbox") {
                                    $checkbox11 = 1;
                                } else {
                                    $checkbox11 = 0;
                                }
                                if ($checkbox12 == "checkbox") {
                                    $checkbox12 = 1;
                                } else {
                                    $checkbox12 = 0;
                                }
                                if ($checkbox13 == "checkbox") {
                                    $checkbox13 = 1;
                                } else {
                                    $checkbox13 = 0;
                                }
                                if ($checkbox14 == "checkbox") {
                                    $checkbox14 = 1;
                                } else {
                                    $checkbox14 = 0;
                                }
                                if ($checkbox15 == "checkbox") {
                                    $checkbox15 = 1;
                                } else {
                                    $checkbox15 = 0;
                                }
                                if ($checkbox16 == "checkbox") {
                                    $checkbox16 = 1;
                                } else {
                                    $checkbox16 = 0;
                                }
                                if ($checkbox17 == "checkbox") {
                                    $checkbox17 = 1;
                                } else {
                                    $checkbox17 = 0;
                                }
                                if ($checkbox18 == "checkbox") {
                                    $checkbox18 = 1;
                                } else {
                                    $checkbox18 = 0;
                                }
                                if ($checkbox19 == "checkbox") {
                                    $checkbox19 = 1;
                                } else {
                                    $checkbox19 = 0;
                                }
                                if ($checkbox20 == "checkbox") {
                                    $checkbox20 = 1;
                                } else {
                                    $checkbox20 = 0;
                                }
                                if ($checkbox21 == "checkbox") {
                                    $checkbox21 = 1;
                                } else {
                                    $checkbox21 = 0;
                                }
                                if ($checkbox22 == "checkbox") {
                                    $checkbox22 = 1;
                                } else {
                                    $checkbox22 = 0;
                                }
                                if ($checkbox23 == "checkbox") {
                                    $checkbox23 = 1;
                                } else {
                                    $checkbox23 = 0;
                                }
                                if ($checkbox24 == "checkbox") {
                                    $checkbox24 = 1;
                                } else {
                                    $checkbox24 = 0;
                                }
                                if ($checkbox25 == "checkbox") {
                                    $checkbox25 = 1;
                                } else {
                                    $checkbox25 = 0;
                                }
                                if ($checkbox26 == "checkbox") {
                                    $checkbox26 = 1;
                                } else {
                                    $checkbox26 = 0;
                                }
                                if ($checkbox27 == "checkbox") {
                                    $checkbox27 = 1;
                                } else {
                                    $checkbox27 = 0;
                                }

                                mysql_connect("$host", "$user", "$password") or die("Unable to connect to SQL server");
                                mysql_select_db("$db") or die("Unable to select database");
                                $query2 = "UPDATE ADec_tblMemberFirms SET Acoustics = '$checkbox1', Agricultural = '$checkbox2', BuildingServices = '$checkbox3',
	Chemical = '$checkbox4', Civil = '$checkbox5', Development = '$checkbox6', Electrical = '$checkbox7', Electronic = '$checkbox8',
	Environmental = '$checkbox9', Geotechnical = '$checkbox10', Industrial = '$checkbox11', Mechanical = '$checkbox12',
	Marine = '$checkbox13', Mining = '$checkbox14', Process = '$checkbox15', Structural = '$checkbox16',
	Transportation = '$checkbox17', Architecture = '$checkbox18', RuralDevelopment = '$checkbox19', ProjectManagement = '$checkbox20',
	QuantitySurveying = '$checkbox21', TownPlanning = '$checkbox22', DisputeResolution = '$checkbox23', ExpertWitness = '$checkbox24',
	InformationSystems = '$checkbox25', FacilitiesManagement = '$checkbox26', GIS = '$checkbox27',AcousticsName = '$textfield1',
	AgriculturalName = '$textfield2', BuildingServicesName = '$textfield3', ChemicalName = '$textfield4', CivilName = '$textfield5',
	DevelopmentName = '$textfield6', ElectricalName = '$textfield7', ElectronicName = '$textfield8', EnvironmentalName = '$textfield9',
	GeotechnicalName = '$textfield10', IndustrialName = '$textfield11', MechanicalName = '$textfield12', MarineName = '$textfield13',
	MiningName = '$textfield14', ProcessName = '$textfield15', StructuralName = '$textfield16', TransportationName = '$textfield17',
	ArchitectureName = '$textfield18', RuralDevelopmentName = '$textfield19', ProjectManagementName = '$textfield20',
	QuantitySurveyingName = '$textfield21', TownPlanningName = '$textfield22', DisputeResolutionName = '$textfield23',
	ExpertWitnessName = '$textfield24', InformationSystemsName = '$textfield25', FacilitiesManagementName = '$textfield26',
	GISName = '$textfield27' WHERE Prev_FirmID = '$MemberFirmID' AND DeclarationYear = $DeclarationYear";
                                mysql_query($query2) or die("Update of TABLE ADec_tblMemberFirms Failed");

                                $query101 = "SELECT FirmID, Prev_FirmID FROM ADec_tblMemberFirms WHERE Prev_FirmID = '$MemberFirmID' AND DeclarationYear = $DeclarationYear";
                                $Hresult = mysql_query($query101) or die("Select failed");
                                $Hrow = mysql_fetch_array($Hresult);
                                $Hf[1] = $Hrow['FirmID'];
                                $reftype = "FirmID";
                                $refdoc = "Schedule2";
                                $adecdate = date("Y-m-d H:i");
                                $query102 = "INSERT INTO ADec_Done (RefID,RefType,RefDoc,ADecDate, DeclarationYear) "
                                        . "values ('$Hf[1]','$reftype','$refdoc','$adecdate', $DeclarationYear)";
                                $Jresult = mysql_query($query102) or die("Insert Failed");

                                echo "<script language='Javascript'>document.location='printschedules.php';</script>";
                            } else {
                                $showbutton = "yes";
                                $errormessage = "Please complete the document and click on the button to continue";
                                ?>
                                <?php
                            }
                            ?></td>
                    </tr>
                    <tr>
                        <td bgcolor="#336699">
                            <div align="center"><font face="Times New Roman, Times, serif" size="2"><b><font color="#CCCCCC">
                                    </font></b></font></div>
                        </td>
                    </tr>
                </table>
                <INPUT TYPE="HIDDEN" NAME="MemberFirmID" VALUE ="<?php echo $MemberFirmID; ?>">
            </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( '../inc/footer2.inc' );
            break;
        case invalid:
            header("Location: http://www.saace.co.za/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 SAACE to report the problem.");
            break;
    }
    ?>