Your IP : 216.73.217.79


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

<p>This facility has been replaced by: <a href="https://www.cesa.co.za/unemployed-eng-practitioners/">https://www.cesa.co.za/unemployed-eng-practitioners/</a></p>
<?php
die();
?>
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
<?php
include($_SERVER['DOCUMENT_ROOT'] . "/php/inc_db.php");
?>
<h1>Unemployed Graduate Database</h1>
<p>Are you an engineering graduate looking for employment? Add your details and CV using our form below. Only our members will be able to access your information.</p>
<?php
$bDisplayForm = true;
if (isset($_REQUEST["go"]) && ($_REQUEST["go"] == 1)) {
  $err = array();
  $filename = "";
  if (!reCaptcha($_POST["g-recaptcha-response"])) {
    $err[] = "You could not be verified as not being a robot, please tick the reCaptcha verification option at the bottom of the form.";
  } else {
    if (isset($_FILES["strresume"]["name"])) {
      $strresume_name = $_FILES["strresume"]["name"];
      $strresume_type = $_FILES["strresume"]["type"];
      $strresume_size = $_FILES["strresume"]["size"];
      $strresume_temp = $_FILES["strresume"]["tmp_name"];

      $fp = fopen($strresume_temp, "rb");
      $file = fread($fp, $strresume_size);

      $filename = "cvfiles/" . date("YmdHi") . str_replace("'", "", $strresume_name);

      touch($filename);
      $fp2 = fopen($filename, "wb");
      fwrite($fp2, $file);
      fclose($fp);
      fclose($fp2);
      chmod($filename, 0x777);
    }
  }
  if (empty($filename)) {
    $err[] = "Please upload your CV";
  }
  if (empty($_REQUEST["firstname"])) {
    $err[] = "Your name is required";
  }
  if (empty($_REQUEST["surname"])) {
    $err[] = "Your name is required";
  }
  if (empty($_REQUEST["qualification"])) {
    $err[] = "Your qualification is required";
  }
  if (empty($_REQUEST["province"])) {
    $err[] = "Your province is required";
  }
  if (empty($_REQUEST["email"])) {
    $err[] = "Your email address is required";
  }
  if (!isset($_REQUEST["unemployed"]) || empty($_REQUEST["unemployed"])) {
    $err[] = "Please indicate whether you are unemployed or not";
  }
  if (!isset($_REQUEST["declarecorrect"]) || empty($_REQUEST["declarecorrect"])) {
    $err[] = "Please confirm that the information is correct by ticking the box next to the declaration";
  }
  if (count($err) == 0) {

    $sql = "SELECT * FROM UnempGraduates WHERE firstname='" . addslashes($_REQUEST["firstname"]) . "' AND surname='" . addslashes($_REQUEST["surname"]) . "' AND email='" . addslashes($_REQUEST["email"]) . "'";
    $rec = mysql_query($sql);
    if (mysql_num_rows($rec) > 0) {
      $err[] = "An entry with the supplied name and email address already exists in our database.";
    }
  }

  if (count($err) == 0) {

    $sql = "insert into UnempGraduates (title, firstname, surname,  
		qualification, institution, yearqual, province, location, 
		cvfile, telnum, email, fromdate, jobtype, qualiflevel, specialisation, unemployed, declarecorrect) 
		values ('" . addslashes($_REQUEST["title"]) . "', '" . addslashes($_REQUEST["firstname"]) . "', '" . addslashes($_REQUEST["surname"]) . "', 
		'" . addslashes($_REQUEST["qualification"]) . "', '" . addslashes($_REQUEST["institution"]) . "', " . intval($_REQUEST["yearqual"]) . ",
		'" . addslashes($_REQUEST["province"]) . "',
		'" . addslashes($_REQUEST["location"]) . "', '" . $filename . "', '" . addslashes($_REQUEST["telnum"]) . "', '" . addslashes($_REQUEST["email"]) . "', 
		'" . date("Y-m-d", strtotime($_REQUEST["fromdate"])) . "', '" . addslashes($_REQUEST["jobtype"]) . "', '" . addslashes($_REQUEST["qualiflevel"]) . "', 
		'" . addslashes($_REQUEST["specialisation"]) . "', '" . $_REQUEST["unemployed"] . "', '" . $_REQUEST["declarecorrect"] . "')";
    if (mysql_query($sql)) {
      echo "<p><b style='color:red'>Thank you, your information has been added to our database.</b></p><p>Once we have approved it, it will be visible to our members.</p>";
      $bDisplayForm = false;

      mail("chris@cesa.co.za,ann-marie@cesa.co.za", "Unemployed Graduate added to database", "The following person has submitted their information to the Unemployed Graduate database:
			
" . $_REQUEST["firstname"] . " " . $_REQUEST["surname"] . "

Please login to the CESA member database to review and approve this submission.", "From: webmaster@cesa.co.za");
    }
  } else {
    echo "<p><b style='color:red'>Your information has NOT been saved, please correct the errors below:</b></p><ul><li>" . implode("</li><li>", $err) . "</li></ul>";;
  }
}
if ($bDisplayForm) {
?>
  <form action="/unempgrad" method="post" enctype="multipart/form-data" name="form1" id="form1">
    <input type="hidden" name="go" value="1" />
    <p><b>Your Details:</b> (fields marked with a <strong>*</strong> are required)</p>
    <table width="530" border="1" cellspacing="0" cellpadding="5">
      <tr>
        <td width="174">Title:</td>
        <td width="330">
          <table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td nowrap>Prof.<input type="radio" name="title" value="Prof" <?php if ($_POST["title"] == "Prof") echo " checked"; ?>></td>
              <td nowrap style="padding:0px 10px 0px 5px">Dr.<input type="radio" name="title" value="Dr" <?php if ($_POST["title"] == "Dr") echo " checked"; ?>></td>
              <td nowrap style="padding:0px 10px 0px 5px">Mr.<input name="title" type="radio" value="Mr" <?php if (!isset($_POST["title"]) || ($_POST["title"] == "Mr")) echo " checked"; ?>></td>
            </tr>
            <tr>
              <td nowrap style="padding:0px 10px 0px 5px">Mrs.
                <input type="radio" name="title" value="Mrs" <?php if ($_POST["title"] == "Mrs") echo " checked"; ?>>
              </td>
              <td nowrap style="padding:0px 0px 0px 5px">Ms.
                <input type="radio" name="title" value="Ms" <?php if ($_POST["title"] == "Ms") echo " checked"; ?>>
              </td>
              <td nowrap style="padding:0px 10px 0px 5px">&nbsp;</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>First Name:</td>
        <td><input type="text" name="firstname" id="firstname" size="50" value="<?php echo $_REQUEST["firstname"]; ?>" required /> <strong>*</strong></td>
      </tr>
      <tr>
        <td>Surname:</td>
        <td><input name="surname" type="text" id="surname" value="<?php echo $_REQUEST["surname"]; ?>" size="50" required />
          <strong>*</strong>
        </td>
      </tr>
      <tr>
        <td>Qualification Level:</td>
        <td><select name="qualiflevel" id="qualiflevel">
            <option<?php if ($_REQUEST["qualiflevel"] == "Diploma / Certificate") echo " selected"; ?>>Diploma / Certificate</option>
              <option<?php if ($_REQUEST["qualiflevel"] == "National Diploma") echo " selected"; ?>>National Diploma</option>
                <option<?php if ($_REQUEST["qualiflevel"] == "Degree") echo " selected"; ?>>Degree</option>
          </select></td>
      </tr>
      <tr>
        <td>Your Qualification:</td>
        <td><input name="qualification" type="text" id="qualification" size="50" value="<?php echo $_REQUEST["qualification"]; ?>" required /> <strong>*</strong></td>
      </tr>
      <tr>
        <td>Institution Where You Obtained Your Qualification:</td>
        <td><input name="institution" type="text" id="institution" size="50" value="<?php echo $_REQUEST["institution"]; ?>" /></td>
      </tr>
      <tr>
        <td>Year of Qualification:</td>
        <td><input name="yearqual" type="text" id="yearqual" size="50" value="<?php echo $_REQUEST["yearqual"]; ?>" /></td>
      </tr>
      <tr>
        <td>Specialisation Field:</td>
        <td>
          <select name="specialisation" id="specialisation">
            <option<?php if ($_REQUEST["specialisation"] == "Acoustics") echo " selected"; ?>>Acoustics</option>
              <option<?php if ($_REQUEST["specialisation"] == "Agricultural") echo " selected"; ?>>Agricultural</option>
                <option<?php if ($_REQUEST["specialisation"] == "Building Services") echo " selected"; ?>>Building Services</option>
                  <option<?php if ($_REQUEST["specialisation"] == "Chemical") echo " selected"; ?>>Chemical</option>
                    <option<?php if ($_REQUEST["specialisation"] == "Civil") echo " selected"; ?>>Civil</option>
                      <option<?php if ($_REQUEST["specialisation"] == "Development") echo " selected"; ?>>Development</option>
                        <option<?php if ($_REQUEST["specialisation"] == "Electrical") echo " selected"; ?>>Electrical</option>
                          <option<?php if ($_REQUEST["specialisation"] == "Electronic") echo " selected"; ?>>Electronic</option>
                            <option<?php if ($_REQUEST["specialisation"] == "Environmental") echo " selected"; ?>>Environmental</option>
                              <option<?php if ($_REQUEST["specialisation"] == "Geotechnical") echo " selected"; ?>>Geotechnical</option>
                                <option<?php if ($_REQUEST["specialisation"] == "Industrial") echo " selected"; ?>>Industrial</option>
                                  <option<?php if ($_REQUEST["specialisation"] == "Mechanical") echo " selected"; ?>>Mechanical</option>
                                    <option<?php if ($_REQUEST["specialisation"] == "Marine") echo " selected"; ?>>Marine</option>
                                      <option<?php if ($_REQUEST["specialisation"] == "Mining") echo " selected"; ?>>Mining</option>
                                        <option<?php if ($_REQUEST["specialisation"] == "Process") echo " selected"; ?>>Process</option>
                                          <option<?php if ($_REQUEST["specialisation"] == "Structural") echo " selected"; ?>>Structural</option>
                                            <option<?php if ($_REQUEST["specialisation"] == "Transportation") echo " selected"; ?>>Transportation</option>
                                              <option<?php if ($_REQUEST["specialisation"] == "Architecture") echo " selected"; ?>>Architecture</option>
                                                <option<?php if ($_REQUEST["specialisation"] == "Rural Development") echo " selected"; ?>>Rural Development</option>
                                                  <option<?php if ($_REQUEST["specialisation"] == "Project Management") echo " selected"; ?>>Project Management</option>
                                                    <option<?php if ($_REQUEST["specialisation"] == "Quantity Surveying") echo " selected"; ?>>Quantity Surveying</option>
                                                      <option<?php if ($_REQUEST["specialisation"] == "Town Planning") echo " selected"; ?>>Town Planning</option>
                                                        <option<?php if ($_REQUEST["specialisation"] == "Multidisciplinary") echo " selected"; ?>>Multidisciplinary</option>
                                                          <option<?php if ($_REQUEST["specialisation"] == "Dispute Resolution") echo " selected"; ?>>Dispute Resolution</option>
                                                            <option<?php if ($_REQUEST["specialisation"] == "Expert Witness") echo " selected"; ?>>Expert Witness</option>
                                                              <option<?php if ($_REQUEST["specialisation"] == "Information Systems") echo " selected"; ?>>Information Systems</option>
                                                                <option<?php if ($_REQUEST["specialisation"] == "Facilities Management") echo " selected"; ?>>Facilities Management</option>
                                                                  <option<?php if ($_REQUEST["specialisation"] == "GIS") echo " selected"; ?>>GIS</option>
          </select>
        </td>
      </tr>
      <tr>
        <td>Type of job you are looking for:</td>
        <td><input name="jobtype" type="text" id="jobtype" size="50" value="<?php echo $_REQUEST["jobtype"]; ?>" /></td>
      </tr>
      <tr>
        <td>Province:</td>
        <td><input name="province" type="text" id="province" size="50" value="<?php echo $_REQUEST["province"]; ?>" required />
          <strong>*</strong>
        </td>
      </tr>
      <tr>
        <td>Preferred Location / City:</td>
        <td><input name="location" type="text" id="location" size="50" value="<?php echo $_REQUEST["location"]; ?>" /></td>
      </tr>
      <tr>
        <td>Available From (Date):</td>
        <td><input type="text" name="fromdate" id="fromdate" size="50" value="<?php echo $_REQUEST["fromdate"]; ?>" placeholder="YYYY-MM-DD" /></td>
      </tr>
      <tr>
        <td>Telephone:</td>
        <td><input type="text" name="telnum" id="telnum" size="50" value="<?php echo $_REQUEST["telnum"]; ?>" /></td>
      </tr>
      <tr>
        <td>Email:</td>
        <td><input name="email" type="text" id="email" size="50" value="<?php echo $_REQUEST["email"]; ?>" required />
          <strong>*</strong>
        </td>
      </tr>
      <tr>
        <td>Upload your CV:</td>
        <td><input type="file" name="strresume" id="strresume" /> <strong>*</strong></td>
      </tr>
      <tr>
        <td>I am currently unemployed</td>
        <td><input name="unemployed" type="radio" value="Y" <?php if ($_REQUEST["unemployed"] == "Y") echo " checked"; ?> required>Yes<br>
          <input name="unemployed" type="radio" value="N" <?php if ($_REQUEST["unemployed"] == "N") echo " checked"; ?>>No
        </td>
      </tr>
      <tr>
        <td colspan="2" align="center">
          <p><input type="checkbox" value="Y" name="declarecorrect" <?php if ($_REQUEST["declarecorrect"] == "Y") echo " checked"; ?> required> I declare that the information given is true and correct. I am aware that it is an offence to wilfully make a false statement.</p>
          <div class="g-recaptcha" data-sitekey="6LcoIWUrAAAAAKBLHpjS7GyroBey9G6yhilbpyNa"></div>
          <br>
          <input name="button" type="submit" id="button" value="Submit" />
        </td>
      </tr>
    </table>
    <p>&nbsp;</p>
  </form>
<?php
}

include_once($_SERVER['DOCUMENT_ROOT'] . "/php/templates/inc_footer.php");