Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/php/
Upload File :
Current File : /var/www/cesa.co.za/php/eventdecline_awards.php

<?php
die();

?>
<link rel="stylesheet" href="/autosuggest/css/autosuggest_inquisitor.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" src="/autosuggest/js/bsn.AutoSuggest_c_2.0.js"></script>
<SCRIPT LANGUAGE="JavaScript">
function IsEmpty(aTextField) {
   if ((aTextField.value.length==0) || (aTextField.value==null)) {
      return true;
   } else { 
	return false; 
	}
}

// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 7;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function ValidateForm(){
	var Phone=document.frmSample.txtPhone
	
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Phone Number")
		Phone.focus()
		return false
	}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}
	return true
 }

function formCheck(objForm) {
	bOK = true;

	if (IsEmpty(objForm.BookingName)) {
		bOK = false;
		alert('Please fill in your name.');
	} else if (IsEmpty(objForm.Organisation)) {
		bOK = false;
		alert('Please fill in your organisation.');
	} else if (IsEmpty(objForm.Address1)) {
		bOK = false;
		alert('Please fill in the address.');
	} else if (IsEmpty(objForm.City)) {
		bOK = false;
		alert('Please fill in the city.');
	} else if (IsEmpty(objForm.PostalCode)) {
		bOK = false;
		alert('Please fill in the postal code.');
	}
<?php
	for ($i=1; $i <= 10; $i++) {
?>		
	if (bOK && (objForm.DivDisplayed<?php echo $i; ?>.value == 1)) {
		if (IsEmpty(objForm.Surname<?php echo $i; ?>)) {
			bOK = false;
			alert('Please fill in attendee <?php echo $i; ?>\'s surname.');
		} else if (IsEmpty(objForm.FirstName<?php echo $i; ?>)) {
			bOK = false;
			alert('Please fill in attendee <?php echo $i; ?>\'s first name.');
		} else if (IsEmpty(objForm.Tel<?php echo $i; ?>) && IsEmpty(objForm.Mobile<?php echo $i; ?>)) {
			bOK = false;
			alert('Please fill in attendee <?php echo $i; ?>\'s telephone number.');
		}	else {
			bOK = emailCheck(objForm.Email<?php echo $i; ?>.value);
		}
	}
<?php
	}
?>
/*
	} else if (IsEmpty(objForm.OrderNumber)) {
		bOK = false;
		alert('Please fill in the order number.');
	} else if ((checkInternationalPhone(objForm.Tel.value)==false) && (checkInternationalPhone(objForm.Mobile.value)==false)) {
		bOK = false;
		alert('Please provide a valid telephone number.');
	} else if (!isInteger(objForm.PostalCode.value)) {
		bOK = false;
		alert('Please provide a numeric postal code.');
*/
	return bOK;
}

function emailCheck (emailStr) {

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=0;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("The email address contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("The email address contains invalid characters.");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("The email address doesn't seem to be valid.");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The email address does not seem to be valid.");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The email address must end in a well-known domain or two letter " + "country.");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
alert("The email address is missing a hostname!");
return false;
}

// If we've gotten this far, everything's valid!
return true;
}

</script>
<?php

//$id = intval($_REQUEST["id"]);

include( 'inc_db.php' );
$db = mysql_connect($loghost,$logid,$logpwd);

mysql_select_db($dbname,$db);

$sql = "SELECT MarketingEvents.EventName, MarketingEvents.Level, MarketingEvents.City, MarketingEvents.Venue, 
	MarketingEvents.AvailableSpaces, MarketingEvents.CostPerPerson, MarketingEvents.EventDescription, MarketingEvents.Hours, MarketingEvents.CPD, MarketingEvents.CODE, MarketingEvents.AccredNum, MarketingEvents.Province, MarketingEvents.RegDeadline,
	MarketingEvents.MemberDiscount, MarketingEvents.EarlyBirdDiscount, MarketingEvents.Cancelled, MarketingEvents.BankAccName,
	CourseVenues.CourseVenueCity, CourseVenues.CourseVenueArea
	FROM MarketingEvents LEFT JOIN CourseVenues ON MarketingEvents.Venue = CourseVenues.CourseVenueName
	WHERE MarketingEvents.EventID=".$id;

$queryresult = mysql_query($sql) or die(mysql_error());

if ($row = mysql_fetch_array($queryresult)) {
?>
<div style="width:500px; padding:0px 100px 0px 100px; color:#345eab">
  
  <?php

		$bShowForm = true;
		if (isset($_POST["ProcessForm"]) && ($_POST["ProcessForm"]==1)) {	
			include("declineeventreg.php");
			if (!$bFormErrors) $bShowForm = false;
		}
		
		if ($bShowForm) {
if ($bFormErrors) {
	echo "<p><font color=red><b>The following errors occurred:</b></font><br>".join("<br>",$sError)."<br><b>Please correct the errors and submit again. Thank you!</b></p>";
}
?>          
  <br>
        <p align=center style='text-align:center'><b>COMPANY DETAILS<br>
        </b><b>Tab to next field&nbsp;&nbsp;&nbsp; * Required fields</b></p>
<form name="form1" method="post" action="/awardsdecline">
  <input type="hidden" name="ProcessForm" value="1">
<input type="hidden" name="EventID" value="<? echo $id; ?>">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="type" value="<?php echo $_REQUEST["type"]; ?>">
<table border=0 cellpadding=2 cellspacing=0 bgcolor="#FFFFFF">
          <tr>
            <td valign=top nowrap="nowrap"><strong>Surname:</strong></td>
            <td valign=top><input name="Surname1" type="text" size="40" value="<?php echo $_POST["Surname1"]; ?>">&nbsp;*</td>
          </tr>
          <tr>
            <td valign=top nowrap="nowrap"><strong>First Name:</strong></td>
            <td valign=top><input name="FirstName1" type="text" size="40" value="<?php echo stripslashes($_POST["FirstName1"].""); ?>">&nbsp;*</td>
          </tr>
          <tr>
                <td valign=top nowrap="nowrap"><p><strong>Company Name: </strong></p></td>
              <td valign=top><input name="Organisation" id="Organisation" type="text" size="40" value="<?php echo stripslashes($_POST["Organisation"].""); ?>">&nbsp;*</td>
            </tr>
          <tr>
            <td valign=top nowrap="nowrap"><strong>E-mail:</strong></td>
            <td valign=top><input name="Email1" type="text" size="40" value="<?php echo $_POST["Email1"]; ?>">&nbsp;*</td>
          </tr>
          <tr>
            <td valign=top nowrap="nowrap"><strong>Mobile:</strong></td>
            <td valign=top><input name="Mobile1" type="text" size="40" value="<?php echo $_POST["Mobile1"]; ?>"></td>
          </tr>
          <tr>
            <td valign=top nowrap="nowrap"><strong>Telephone:</strong></td>
            <td valign=top><input name="Tel1" type="text" size="40" value="<?php echo $_POST["Tel1"]; ?>"></td>
          </tr>
        </table>
              <p>&nbsp;</p>
</form>
</div>
<!--<div style="background-image:url('/images/awards2017footer.jpg'); background-repeat:no-repeat; background-position:bottom center; width:650px; height:200px; padding-left:170px; background-color:white">-->
 <input type="image" name="imageField" id="imageField" src="/images/btnsubmit.jpg">&nbsp;<img src="/images/btnreset.jpg" width="153" height="40" alt="" onclick="this.form.reset()" /></div>
<?php
		}
} else {
	echo "Event not found.";
}
?>
</table>