<?php require_once('connections/reg_conn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_reg_conn, $reg_conn);
$query_rsOK = "SELECT * FROM `kp_questioner` ORDER BY id DESC LIMIT 1";
$rsOK = mysql_query($query_rsOK, $reg_conn) or die(mysql_error());
$row_rsOK = mysql_fetch_assoc($rsOK);
$totalRows_rsOK = mysql_num_rows($rsOK);

$my_activation = $row_rsOK['activation'];
$my_regcode = $row_rsOK['regcode'];
$to = $row_rsOK['email'];
$subject = "Mohon Pengisian Kuesioner";
$body = "<html><body>" .
		
"Kepada Yth.<br>
Bapak/Ibu {Nama Kontak Person}<br>
Di<br>
Tempat<br>
<br>
Dalam rangka peningkatan kualitas mutu pelayanan institusi kami dan untuk memperoleh gambaran sekilas mengenai tingkat kepuasan anda terhadap apa yang sudah kami kerjakan kepada institusi/perusahaan anda, kami Mengharapkan anda dapat memberikan masukan-masukan dengan objektif, karena kuesioner ini ditujukan untuk semata-mata hal yang bersifat konstruktif dan positif, dan sangat penting bagi perbaikan kinerja PKSPL IPB. <br>
<br>
Terkait hal tersebut, kami mohon bantuan Bapak/Ibu untuk mengisi Quesioner Survey Kepuasan Pelanggan yang kami sertakan link di bawah ini. <br><br>" 


."http://192.168.1.253/db_inventaris/home.php?ref=questioner?quest=".$my_activation."".
		
"<br><br>
Atas bantuan dan kerjasamanya saya ucapkan terima kasih.<br><br>
Salam,<br>

{Nama Pimpro} <br><br><br><br><br><br><br>

<strong>Pusat Kajian Sumberdaya Pesisir dan Lautan</strong><br>
Institut Pertanian Bogor<br>
Kampus IPB Baranangsiang, Jl. Raya Pajajaran No. 1 Bogor, 16127<br>
Jawa Barat - Indonesia";


$headers = 	"From: PKSPL-IPB <noreply@pksplipb.or.id>\r\n" .  
			"MIME-Version: 1.0\r\n" .
			"Content-type: text/html; charset=UTF-8";
			
			
if (!mail($to, $subject, $body, $headers)) {
	$redirect= "register_error.php";
  header( "Location: ".$redirect ) ;
 } 

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Success</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>

<body>
<div class="container">
  <div class="header"></div>
  <div class="content">
    <h2>Thank you for your registration.</h2>
    <h3>To continue with online registration, you need confirm your email that you provided (<?php echo "$to" ?>). An email with <span class="style1">confirmation link</span> and &quot;<span class="style1">Registration Code</span>&quot; already sent to your e-mail.</h3>
    
    If you didn't receive any email, please check your spam folder. <br /><br />
  </div>
  <div class="footer"><a href="http://pksplipb.or.id/int/icmmbt/">Home</a> | <a href="http://pkspl.ipb.ac.id">About</a> | <a href="mailto:icmmbt@pksplipb.or.id">Contact Us</a> | <a href="login.php">Login</a> | <a href="admin.php">Admin</a> | Log Out</div>
</div>
</body>
</html>
<?php
mysql_free_result($rsOK);
?>
