$Entry) fputcsv($fhandle,$Entry); fclose($fhandle); } function AdminHeaderView() { global $Titles; global $GBadmin; global $GBpassword; echo "

$Titles[AdminHeader]

\n"; if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) { echo "
\n"; echo "

\n"; echo "
\n"; echo " $Titles[AdminHello], $GBadmin!\n"; } } function AdminEntriesView() { global $Titles; global $DataStatus; global $GBadmin; global $GBpassword; global $AdminEntries; if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) if ($DataStatus=="empty") echo "$Titles[EmptyFile]\n"; else if ($_SESSION["DeleteStatus"]=="deletion") { echo " $Titles[AdminSureDel] ",count($_SESSION["DeleteEntries"])," $Titles[AdminSureDelMessages]?\n"; echo "
\n"; echo " \n"; echo " \n"; echo "
\n"; } else if ($_SESSION["EditStatus"]) { echo " $Titles[AdminMessage] ", ($_SESSION["EditStatus"]),", ",date("j.m.Y, H:i",$AdminEntries[($_SESSION["EditStatus"]-1)][5]),":
\n"; echo "
\n"; echo " $Titles[AdminName]:
\n"; echo " $Titles[City]
\n"; echo " $Titles[Link]
\n"; echo " $Titles[Email]
\n"; echo " $Titles[AdminMessage]:
\n
\n"; echo " $Titles[Response]:
\n
\n"; echo " "; echo " "; echo "\n"; echo "
\n"; } else { echo "
\n"; echo "\n \n"; foreach($AdminEntries as $e=>$Entry) echo " \n"; echo "
$Titles[AdminName]$Titles[City]$Titles[Link]$Titles[Email]$Titles[AdminMessage]$Titles[Response]$Titles[AdminDate]
",($e+1),"$Entry[0]$Entry[1]$Entry[2]$Entry[3]",nl2br($Entry[4]),"",nl2br($Entry[6]),"",date("j.m.Y, H:i",$Entry[5]),"
\n"; echo " \n"; echo "
\n"; } else { if (($_POST["login"])&&(!$_SESSION["SessionStatus"])) echo "$Titles[WrongLogin]
\n"; echo "
\n"; echo " $Titles[Login]
\n"; echo " $Titles[Password]
\n"; echo " \n"; echo "
\n"; } } if ((($_POST["adminlogin"])==$GBadmin)&&(($_POST["adminpass"])==$GBpassword)) $_SESSION["SessionStatus"]=(md5($GBadmin.$GBpassword)); if ($_POST["exit"]) $_SESSION["SessionStatus"]=""; if ($_POST["canceldelete"]) { $_SESSION["DeleteStatus"]=""; Unset($_SESSION["DeleteEntries"]); } if ($_POST["canceledit"]) Unset($_SESSION["EditStatus"]); if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) { $AdminEntries=ReadEntries(); if ($_POST["submitdelete"]) { $_SESSION["DeleteStatus"]="deletion"; foreach($AdminEntries as $e=>$Entry) if ($_POST["cb$e"]) $_SESSION["DeleteEntries"][]=$e; if (!count($_SESSION["DeleteEntries"])) $_SESSION["DeleteStatus"]=""; } if (($_POST["submiteedit"])&&($_SESSION["EditStatus"])) { $AdminEntries[($_SESSION["EditStatus"]-1)][0]=$_POST["editname"]; $AdminEntries[($_SESSION["EditStatus"]-1)][1]=$_POST["editfrom"]; $AdminEntries[($_SESSION["EditStatus"]-1)][2]=$_POST["editlink"]; $AdminEntries[($_SESSION["EditStatus"]-1)][3]=$_POST["editmail"]; $AdminEntries[($_SESSION["EditStatus"]-1)][4]=$_POST["edittext"]; $AdminEntries[($_SESSION["EditStatus"]-1)][6]=$_POST["editresp"]; SaveEntries(); Unset($_SESSION["EditStatus"]); $AdminEntries=ReadEntries(); } if ($_POST["applydelete"]) { if ($_SESSION["EditStatus"]) { Unset($AdminEntries[($_SESSION["EditStatus"]-1)]); SaveEntries(); Unset($_SESSION["EditStatus"]); $AdminEntries=ReadEntries(); } if ($_SESSION["DeleteStatus"]) { foreach($_SESSION["DeleteEntries"] as $e=>$DelEnt) Unset($AdminEntries[$DelEnt]); SaveEntries(); Unset($_SESSION["DeleteEntries"]); $_SESSION["DeleteStatus"]=""; $AdminEntries=ReadEntries(); } } if (!$_SESSION["EditStatus"]) for ($e=0;$e <?php echo $Titles[HeadTitle];?>