<?
define(TEMPDIR,"../../");
@include(TEMPDIR."coreclass.php");
@include("coreclass.php");
$ae=new CSurveys();
$ae->EngineInitialize();
$ae->RequestVariables();
$ae->UserVerifySession();
$ae->UserVerifyLevel(2);
@include(TEMPDIR."header.php");
echo '<div id="content">';
echo '<table cellspacing="0" id="data">';
echo '<thead>';
echo '<tr>';
echo '<td width="15%"><h2>',$ae->textsurveys[0],'</h2></td>';
echo '<td width="45%"><h2>',$ae->textsurveys[18],'</h2></td>';
echo '<td width="8%"><h2>',$ae->textsurveys[19],'</h2></td>';
echo '<td width="32%"> </td>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i=0;
$running=0;
if (!$ae->surveynumber) $ae->surveynumber=10;
$ae->GetSurvey(0,$ae->surveynumber);
while ($ae->DBGetRow())
{
if ($ae->status==1) $running=1;
$color=fmod($i,2);
$i++;
if ($color==1) echo '<tr>'; else echo '<tr>';
$ae->GetSurveyVariables();
if ($ae->status) $status=$ae->textsurveys[16]; else $status=$ae->textsurveys[17];
echo '<td width="13%">',$status,'</td>';
echo '<td width="45%" class="title"><a href="../',TEMPDIR,'showsurvey.php?surveyID=',$ae->GetSurveyID(),' "target="preview" onClick="window.open(\'../showsurvey.php?surveyID=',$ae->GetSurveyID(),'\',\'preview\',\'scrollbars=yes,width=640,height=400\');">';
$ae->GetSurveyTitle();
echo '</a></td>';
echo '<td width="8%">';
$ae->GetSurveyTotal();
echo '</td>';
echo '<td width="32%" class="action">';
if ($ae->status) echo '<a href="modify.php?command=2&surveyID=',$ae->GetSurveyID(),'&username=',$ae->username,'&session=',$ae->session,'">',$ae->textsurveys[21],'</a>';
echo '<a href="editsurvey.php?surveyID=',$ae->GetSurveyID(),'&username=',$ae->username,'&session=',$ae->session,'">',$ae->textsurveys[22],'</a>';
echo '<a href="modify.php?command=3&surveyID=',$ae->GetSurveyID(),'&username=',$ae->username,'&session=',$ae->session,'" onclick="return confirm(\'',$ae->textbasic[53],'\')">',$ae->textsurveys[26],'</a>';
echo '</td></tr>';
}
if (!$running)
{
$color=fmod($i,2);
$i++;
if ($color==1) echo '<tr>'; else echo '<tr>';
echo '<td colspan="4">';
echo '<form method="post" action="addsurvey.php">';
echo '<p>';
echo '<input type="hidden" name="username" value="',$ae->username,'">';
echo '<input type="hidden" name="session" value="',$ae->session,'">';
echo '<input type="submit" name="Submit" value="',$ae->textsurveys[23],'" class="button" />';
echo '</p>';
echo '</form>';
echo '</td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
echo '</div>';
@include(TEMPDIR.'footer.php');
?>