<?php

include_once("_dirinfo.php");
$sessionHandling = true;
include_once(PATH_TO_ROOT."mystery/init.php");

/*
echo "<pre>";
var_dump($_REQUEST);
echo "</pre>";
*/


if (intval($_GET['id_project']) && intval($_GET['id_sample'])) {
 //echo "sample => ".intval($_GET['id_sample']); 
	$sql = "SELECT loginSID  FROM ".DB_WARPIT_WEBCATI_BASE."._www_ids WHERE id_project = ".intval($_GET['id_project'])." AND user_type = 3";
	$res = $db->SQLexecute($sql);
	$zad = $db->fetchAssoc($res);
	if ($zad['loginSID']) {
	//	echo "sample => ".intval($_GET['id_sample']);
		header("Location: ".WARPIT_WWW."survey/index.php?loginSID=".$zad['loginSID']."&id_sample=".intval($_GET['id_sample']) );
	} else echo "<h1>No popup link on this project</h1>";
} else {
	echo "<h1>Mystery Make Interview Redirection error: Please contact Administrator</h1>";
}

?>