Current Projects

dnes alebo datum ukoncenia nie je vlozeny), 0 = vsetky projekty, 2 skoncene projekty (vsetky), 3 skoncene projekty (ukoncene projekty za ostatnych 5 rokov)
//$actual = “1”; //0
$actual = “1”; //0

//zoradovanie podla mena = 0, zoradovanie podla datumu konca projektu = 1
$sort = “1”; //0

//typ projektov medzinarodny/narodny
//$project_type = “international”; //national

//polozky, ktore chceme nacitat z exportu
$items_array = array(“project_id”, “name_sk”, “name_en”, “program_name”, “project_type”, “acronym”, “solver”, “start_date”, “end_date”, “description_sk”, “description_en”, “web”);
//*********************************************************************

//kompletna adresa pre XML
$requrl = “https://www.sav.sk/export/projects.php?institute_no=”.$institute_no.”&charset=”.$charset.”&program_id=”.$program_id.”&actual=”.$actual.”&project_id=”.$project_id.”&sort=”.$sort.”&project_type=”.$project_type;

$record = 0;

//nacitanie exportu
$ch = curl_init($requrl);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$out = curl_exec($ch);
curl_close($ch);
$data = explode(“\n”,$out);

//parsovanie dat po riadkoch
foreach ($data as $key => $value) {

//zvysovanie poctu zaznamov
if (strstr($value, “”)) $record++;

//parsovanie samotnych poloziek
foreach ($items_array as $i => $value_items) {
$start = “”;
$end = “”;
$value_items_tmp = $value_items.”_”.$record;
if (strstr($value, $start)) $$value_items_tmp = substr($value, strpos($value, $start)+strlen($start), strpos($value, $end)-(strpos($value, $start)+strlen($start)));
}

}

//vypis
$aaa=0;
for ($a=1; $a $value_items) {
$tmp = $value_items.”_”.$a;
$$value_items = $tmp;
}

if ($$acronym) $$acronym = $$acronym.” – “;
if ($$project_type == ‘international’ and $aaa==0) {$nadpis=”International”; $aaa=1;}
elseif ($$project_type==’national’ and ($aaa==0 or $aaa==1)) { $nadpis=”National”; $aaa=2; }

//vypis do html
if ($nadpis) echo “

“.$nadpis.”

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
if ($$description_en) echo “

“;
if ($$web) echo “

“;
echo “

“;
echo “

“.$$acronym.$$name_sk.”
“.$$name_en.”
Program: “.$$program_name.”
Principal Investigator: “.$$solver.”
Annotation: “.$$description_en.”
Web page of the project: “.$$web.”
Duration: “.$$start_date.” – “.$$end_date.”

“;

unset($nadpis);
}
echo “

“;
?>