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/schedule1aGENERIC.php

<?php
//ini_set('display_errors', 1);
//error_reporting(E_ALL);
// 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' );
        include( '../inc/readnext.inc' );
        ?>
        <script language="JavaScript">
            <!--
            function MM_openBrWindow(theURL, winName, features) { //v2.0
                window.open(theURL, winName, features);
            }
            //-->
        </script>
        <title>Annual Declaration <?php echo $DeclarationYear; ?></title>
        <style type="text/css">
            <!--
            .style3 {
                font-size: 12px
            }
            .style5 {
                font-size: 10px
            }
            -->
        </style>
        <body bgcolor="#FFFFFF">
            <!-- Start Page Content Here -->
            <?php
            if ($dothingy == "completed") {
// Set the correct messages        *************************************************************
// *********************************************************************************************
                $submitbuttonactive = "no";

// Perform the checks              *************************************************************
// *********************************************************************************************

                if ($form['mainfirm']) {
                    $DoUpdate = "yes";
                } else {
                    $DoUpdate = "no";
                    $pageerrormessage = "<font color=red>ERROR !!! </font>Please complete the field <b> MAIN FIRM TO BE INVOICED </b>";
                }
                if ($DoUpdate == "yes") {
                    if ($form['group']) {
                        $DoUpdate = "yes";
                    } else {
                        $DoUpdate = "no";
                        $pageerrormessage = "<font color=red>ERROR !!! </font>Please complete the field <b> LIST OF FIRMS </b>";
                    }
                }
                if ($DoUpdate == "yes") {
// Perform the update              *************************************************************
// *********************************************************************************************
                    $errormessage = "Please close the window and return to the CONTROL PAGE";
                    $pageerrormessage = "";
                    mysql_connect("$host", "$user", "$password") or die("Unable to connect to SQL server");
                    mysql_select_db("$db") or die("Unable to select database");
                    $query1 = "SELECT FirmID, Prev_FirmID FROM ADec_tblMemberFirms WHERE  Prev_FirmID = '$MemberFirmID' AND DeclarationYear = $DeclarationYear";
                    $result1 = mysql_query($query1) or die("Select of id Failed");
                    $rs = mysql_fetch_array($result1);
                    $CurrentMemberFirmID = $rs['FirmID'];

                    $query = "UPDATE ADec_tblMemberFirms SET MainFirmInvoice = '" . $form['mainfirm'] . "',
GroupFirmsInvoice = '" . $form['group'] . "', DeclarationYear = $DeclarationYear
WHERE FirmID = '$CurrentMemberFirmID'";
                    $result = mysql_query($query) or die("Select of id Failed");

                    $reftype = "FirmID";
                    $refdoc = "Schedule1A";
                    $adecdate = date("Y-m-d H:i");

                    $query102 = "INSERT INTO ADec_Done (RefID,RefType,RefDoc,ADecDate, DeclarationYear)
  values('$CurrentMemberFirmID','$reftype','$refdoc','$adecdate', $DeclarationYear)";
                    $Jresult = mysql_query($query102) or die("Insert Failed");

                    // Get the first international office
                    $query = "SELECT * FROM ADec_tblMemberFirmOffices WHERE (Prev_FirmID = '$MemberFirmID' AND DeclarationYear = $DeclarationYear) AND (SaaceBranch = 'International')";
                    $result = mysql_query($query) or die("Select of id Failed");
                    if (($rs = mysql_fetch_array($result))) {
                        echo "<script language='Javascript'>document.location='schedule1b_page1GENERIC.php?officenum=1&SelectOfficeID=" . $rs['OfficeID'] . "';</script>";
                    } else {
                        echo "<script language='Javascript'>document.location='schedule1b_page1BLANK.php';</script>";
                    }
                    exit;
                } else {
                    $errormessage = "************** CLICK ON THE BACK BUTTON **************";
                }
            } else {
                $submitbuttonactive = "yes";
                $errormessage = "Please Complete All The Fields";
                ?>
                <?php
                include( '../inc/declaration_nav.php' );
                ?>
                <form method="post" action="<?php echo $PHP_SELF . "?dothingy=completed"; ?>" enctype="multipart/form-data">
                    <?php
                }
                ?>
                <table width="100%" border="1" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <div align="center"><font color="#000000"><b></b></font> </div>
                            <TABLE WIDTH=700 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0 bgcolor="#336699">
                                <TR>
                                    <TD COLSPAN=2 ROWSPAN=3> <IMG SRC="images/stepnum3.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 align="center" bgcolor="#336699"><font face="Arial, Helvetica, sans-serif"><span class="style1"><font color="white">FIRMS TO BE INVOICED AS ONE </font></span>
                                        </font>
                                <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/stepseq3.jpg" border="0" 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:general@cesa.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>        <b><font face="Times New Roman, Times, serif" size="2" color="#CCCCCC">
                    </font></b></td>
        </tr>
        <tr>
            <td>
                <table width="100%" border="0" cellspacing="1" cellpadding="0">
                    <tr>
                        <td width="9%"><font face="Times New Roman, Times, serif" size="1"><img width=66 height=84
                                                                                                src="images/image002.gif" v:shapes="_x0000_i1025"></font></td>
                        <td width="80%">
                            <p align="center"><font face="Times New Roman, Times, serif" size="2"><b>THE
                                    SOUTH AFRICAN ASSOCIATION OF CONSULTING ENGINEERS<br>
                                    FIRMS TO BE INVOICED AS ONE</b></font></p>
                        </td>
                        <td width="11%">
                            <div align="right"><font face="Times New Roman, Times, serif" size="2"><b>SCHEDULE
                                    1 A <br>
                                    <?php echo $DeclarationYear; ?></b></font></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <p style='text-align:justify'><font face="Times New Roman, Times, serif" size="1"><b>BY-LAW
                                    5.3 READS AS FOLLOWS:</b></font></p>
                            <p class=MsoBodyTextIndent align="center"><font face="Times New Roman, Times, serif" size="1">�����������
                                <i>�Should the Member so request, the Directorate shall calculate,
                                    subject to the approval of the Executive Committee, the annual subscription
                                    of a group of Firms as one Member.�</i></font></p>
                        </td>
                    </tr>
                    <tr>
                        <td width="9%">&nbsp;</td>
                        <td width="80%">
                            <div align="center"></div>
                        </td>
                        <td width="11%">&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <?php
                            if ($submitbuttonactive == "yes") {
                                // Check if the data has allready been written *************************************************
                                // *********************************************************************************************
//		  mysql_connect("$host","$user","$password") or die("Unable to connect to SQL server");
                                //        mysql_select_db("$db") or die("Unable to select database");
                                $query1 = "SELECT FirmID, Prev_FirmID, MainFirmInvoice, GroupFirmsInvoice FROM ADec_tblMemberFirms WHERE  Prev_FirmID = '$MemberFirmID' AND DeclarationYear = $DeclarationYear";
                                $result1 = mysql_query($query1) or die("Select of id Failed");
                                $rs = mysql_fetch_array($result1);
                                $CurrentMemberFirmID = $rs['FirmID'];
                                $IFMainFirm = $rs['MainFirmInvoice'];
                                $IFGroupFirm = $rs['GroupFirmsInvoice'];
                                if ($IFMainFirm) {
                                    $MemberFirmMainInvoice = $IFMainFirm;
                                }
                                if ($IFGroupFirm) {
                                    $MemberFirmGroupInvoice = $IFGroupFirm;
                                }
                                ?>
                                <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                        <td width="26%" bgcolor="#CCCCCC"><font size="2" face="Times New Roman, Times, serif"><b>Main
                                                Firm To Be Invoiced</b></font></td>
                                        <td width="74%">
                                            <input type="text" name="form[mainfirm]" size="40" value="<?php echo $MemberFirmMainInvoice; ?>">
                                            <font face="sans-serif"><font face="sans-serif" size="2"><b><font color="#CCCCCC"><font color="#FF0000">*</font></font></b></font></font>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" bgcolor="#CCCCCC">
                                            <div align="center"><font face="Times New Roman, Times, serif" size="1"><b>We
                                                    hereby request that the following firms be treated as one
                                                    Member for subscription purposes:</b></font> </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="26%" bgcolor="#CCCCCC"><font face="Times New Roman, Times, serif" size="2"><b>List
                                                of the Firms to be treated as one</b></font></td>
                                        <td width="74%">
                                            <textarea name="form[group]" cols="80" rows="8"><?php echo $MemberFirmGroupInvoice; ?></textarea>
                                            <font face="sans-serif"><font face="sans-serif" size="2"><b><font color="#CCCCCC"><font color="#FF0000">*</font></font></b></font></font>
                                        </td>
                                    </tr>
                                </table>
                                <div align="center">
                                    <p class="style5"><strong><font face="sans-serif"><br>
                                            <br>
                                            _________________________________________________<strong><font face="sans-serif">_________________________________________________</font></strong></font></strong></p>
                                    <p class="style3"><strong><font face="sans-serif">SIGNATURE OF MANDATED PRINCIPAL</font> </strong></p>
                                    <?php
                                } else {
                                    if ($DoUpdate == "no") {
                                        echo "<br>" . $pageerrormessage;
                                    }
                                }
                                ?></div>
                        </td>
                    </tr>
                    <tr>
                        <td width="9%">&nbsp;</td>
                        <td width="80%">&nbsp;</td>
                        <td width="11%">&nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>      <div align="center"><font color="#000000"><b><font face="Times New Roman, Times, serif" size="2" color="#CCCCCC"><?php echo $errormessage; ?>:</font></b></font>
                    <br>
                    <?php
                    if ($submitbuttonactive == "yes") {
                        // Get the first international office
                        $query = "SELECT * FROM ADec_tblMemberFirmOffices WHERE (Prev_FirmID = '$MemberFirmID' AND DeclarationYear = $DeclarationYear) AND (SaaceBranch = 'International')";
                        $result = mysql_query($query) or die("Select of id Failed");
                        if (($rs = mysql_fetch_array($result))) {
                            $NextPage = "schedule1b_page1GENERIC.php?officenum=1&SelectOfficeID=" . $rs['OfficeID'];
                        } else {
                            $NextPage = "schedule1b_page1GENERIC.php?AddNewOffice=yes&officenum=1";
                        }
                        ?>
                        <font color="#000000"><b><font face="sans-serif" size="2">
                            <input name="image" type="image" src="images/save.jpg" width="200" height="100">
                            OR <a href="<?php echo $NextPage ?>"><img src="images/skip.jpg" width="200" height="100" border="0"></a>
                            </font></b></font>		<?php
                    } else {
                        ?>
                        <font size = -2><a href="javascript:history.back(1)">BACK</a></font>

                        <?php
                    }
                    ?>
                </div>
            </td>
        </tr>
        </table>
        </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.cesa.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;
}
?>