[insert_php]require_once(‘Connections/affect.php’);[/insert_php]
[insert_php]

if ((isset($_POST[“phd_start_year”]))) {
$lowYear = $_POST[“phd_start_year”];
}

if ((isset($_POST[“phd_year”]))) {
$highYear = $_POST[“phd_year”];

}

echo ‘

Currently displaying members with PhDs ‘;
if ( ((isset($_POST[“phd_start_year”]))) && $lowYear > 0) {
echo ‘from ‘ . $lowYear;
}

if (((isset($_POST[“phd_year”]))) && $highYear > 0) {
echo ‘ through ‘ . $highYear;
}

if (
(((isset($_POST[“phd_year”]))) && $highYear > 0)

OR

( ((isset($_POST[“phd_start_year”]))) && $lowYear > 0)
)

{
echo ‘

(Note: this will ONLY display women who have reported their PhD Year)

‘;
}

if (($lowYear < 1900) && ($highYear < 2100) && ((!isset($_POST["phd_year"])))) { echo 'from all years.'; } echo '

‘;
[/insert_php]

[insert_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_Affect01, $Affect01); if ($highYear > 1900) {$endYear = $highYear;}
else
{
$endYear = 2100;
}

if ($lowYear > 1900) {$startYear = $lowYear;}
else
{
$startYear = 1900;
}

if (
( ( (isset($_POST[“phd_year”])) ) || ( (isset($_POST[“phd_start_year”])) ) )

&&

(
(($_POST[“phd_year”]) > 0) ||

(($_POST[“phd_start_year”]) > 0)

)

)

{

$query_documentListRS = “SELECT *
FROM wp_participants_database
WHERE phd_year <= $endYear AND phd_year >= $startYear AND approved = ‘yes’ AND research_area LIKE ‘%financial intermediation%’
ORDER BY phd_year, last_name”;
$clearButtonFlag = 1;
//echo ‘ the clearButtonFlag: ‘ . $clearButtonFlag;
}
else
{
$query_documentListRS = “SELECT *
FROM wp_participants_database
WHERE approved = ‘yes’ AND research_area LIKE ‘%financial intermediation%’
ORDER BY last_name”;
$clearButtonFlag = 0;
}

if (($lowYear < 1900) && ($highYear < 2100)) { } else { } $documentListRS = mysql_query($query_documentListRS, $Affect01) or die(mysql_error()); $query_documentListRS1 = $query_documentListRS; $documentListRS1 = mysql_query($query_documentListRS1, $Affect01) or die(mysql_error()); $minimumYear = 2020; $maximumYear = 1960; while ($row = mysql_fetch_array($documentListRS1, MYSQL_ASSOC)) { if ($row["phd_year"] < $minimumYear) {$minimumYear = $row["phd_year"];} if ($row["phd_year"] > $maximumYear) {$maximumYear = $row[“phd_year”];}

}

$row_documentListRS = mysql_fetch_assoc($documentListRS);

if (($lowYear < 1900) && ($highYear < 2100) && ((!isset($_POST["phd_year_variable"])))) { //echo 'Full Range'; } if ( ((isset($_POST["phd_start_year"]))) && $lowYear > 0) {

//echo ‘from ‘ . $lowYear;
}

if (((isset($_POST[“phd_year”]))) && $highYear > 0) {

//echo ‘ to ‘ . $highYear;
}

$totalRows_documentListRS = mysql_num_rows($documentListRS);
echo ‘

‘;
echo ‘Total results ‘ . $totalRows_documentListRS ;
//echo ‘
‘;
///echo ‘

666 clearButtonFlag: ‘ . $clearButtonFlag . ‘

‘;
[/insert_php]

To search within a [insert_php] if ((((isset($_POST[“phd_year”]))) && $highYear > 0) || (((isset($_POST[“phd_start_year”]))) && $lowYear > 0) ){
// echo ‘ different ‘;
}[/insert_php]range of PhD years
[insert_php] //echo ‘

888 clearButtonFlag: ‘ . $clearButtonFlag . ‘

‘;
[/insert_php]

[insert_php] //echo ‘

999 clearButtonFlag: ‘ . $clearButtonFlag . ‘

‘;
[/insert_php] [insert_php] //echo ‘

101010 clearButtonFlag: ‘ . $clearButtonFlag . ‘

‘;

if ($clearButtonFlag > 0) {

//echo ‘ gt 0 ‘;

echo ‘

‘;
}
else
{
//echo ‘ lt 1 ‘;

}

[/insert_php] [insert_php] echo ‘

abc clearButtonFlag: ‘ . $clearButtonFlag .

‘;
if ($clearButtonFlag >= 1) {
echo ‘ yes clearButtonFlag: ‘ . $clearButtonFlag;

echo ‘

‘;

}

else

{

echo ‘ b clearButtonFlag: ‘ . $clearButtonFlag;

}

[/insert_php]

[insert_php] echo ‘

‘;

echo ‘

‘;

if ($totalRows_documentListRS > 0) {
do {
//echo “

DO xxx

“;
if (((isset($_POST[“phd_year”]))) || ((isset($_POST[“phd_start_year”])))) {
if ($row_documentListRS[‘phd_year’] != $last_year) {
echo ‘

‘;
echo $row_documentListRS[‘phd_year’];
$last_year = $row_documentListRS[‘phd_year’];
echo ‘

‘;
}
}
echo ‘

‘;

//FIRST NAME AND LAST NAME
echo ‘

‘;

//TITLE
if (!empty($row_documentListRS[‘title’])) {
echo ‘

‘;
echo ‘Title‘;
echo $row_documentListRS[‘title’];
echo ‘

‘;
}

//INSTITUTION
echo’

‘;
echo’Institution‘;
echo’‘;
echo $row_documentListRS[‘institution’];
echo ‘

‘;

//PHD DATE
echo’

‘;
echo’PhD Year‘;
echo’‘;
echo $row_documentListRS[‘phd_year’];
echo ‘

‘;

//EMAIL
echo ‘

‘;
echo ‘Email‘;
echo ‘‘;
echo $row_documentListRS[’email’];
echo ‘
‘;
echo ‘

‘;

//PERSONAL WEBSITE
if (!empty($row_documentListRS[‘personal_web_site’])) {
echo ‘

‘;
}

//SPECIFIC RESEARCH AREAS
echo ‘

‘;
echo ‘Specific Research Areas‘;
echo ‘‘;
//echo ‘fixed income, Fed -x- ‘;
echo $row_documentListRS[‘specific_research_areas’];
echo ‘
‘;
echo ‘

‘;

//GENERAL RESEARCH AREAS
echo ‘

‘;
echo ‘General Research Area‘;
echo ‘‘;
//echo ‘Asset Pricing -x- ‘;
//echo $row_documentListRS[‘research_area’];
//echo ‘ -yy- ‘;
$data = unserialize($row_documentListRS[‘research_area’]);
//$json = $row_documentListRS[‘research_area’];
//echo ‘ data: ‘ . $data;
//var_dump(json_decode($json));
//var_dump(json_decode($json, true));
//print_r ($data);
//echo $data;
$commaList = implode(‘, ‘, $data );
echo $commaList;
echo ‘
‘;
echo ‘

‘;
echo ‘

‘;

//echo ‘

‘;

} while ($row_documentListRS = mysql_fetch_assoc($documentListRS));
}
echo ‘

‘;
echo ‘

‘;

[/insert_php]