Location: PHPKode > projects > Absolut Engine > absolut-engine-33870/admin/modules/surveys/editsurvey.php
<?
define(TEMPDIR,"../../");
@include(TEMPDIR."coreclass.php");
@include("coreclass.php");
$ae=new CSurveys();
$ae->EngineInitialize();
$ae->RequestVariables();
$ae->UserVerifySession();
$ae->UserVerifyLevel(2);
@$ae->DBQuery("SELECT * FROM ".$ae->tablesurveys[1]." WHERE ID='".$ae->surveyID."'");
$ae->DBGetRow();
$title=$ae->access["title"];
$status=$ae->access["status"];
$answers=array($ae->access["ans1"],$ae->access["ans2"],$ae->access["ans3"],$ae->access["ans4"],$ae->access["ans5"]);
$votes=array($ae->access["vote1"],$ae->access["vote2"],$ae->access["vote3"],$ae->access["vote4"],$ae->access["vote5"]);
@include(TEMPDIR."header.php");
?>
<div id="content">
<form method="post" action="modify.php?command=4">
<table cellspacing="0" class="form">
<tr>
<td><strong><? echo $ae->textsurveys[2] ?></strong></td>
<td>
<input type="text" name="title" size="70" maxlength="255" value="<? echo $title ?>">
</td>
</tr>
<tr>
<td><strong><? echo $ae->textsurveys[3] ?></strong></td>
<td>
<select name="status">
<option value="1" <? if ($status==1) echo "selected"; ?>><? echo $ae->textsurveys[4] ?></option>
<option value="0" <? if ($status==0) echo "selected"; ?>><? echo $ae->textsurveys[5] ?></option>
</select>
</td>
</tr>
<tr>
<td><strong><? echo $ae->textsurveys[6] ?></strong></td>
<td>
<input type="text" name="ans1" value="<? echo $answers[0] ?>" size="20" maxlength="255">
</td>
</tr>
<tr>
<td><strong><? echo $ae->textsurveys[7] ?></strong></td>
<td>
<input type="text" name="ans2" value="<? echo $answers[1] ?>" size="20" maxlength="255">
</td>
</tr>
<tr>
<td><strong><? echo $ae->textsurveys[8] ?></strong></td>
<td>
<input type="text" name="ans3" value="<? echo $answers[2] ?>" size="20" maxlength="255">
</td>
</tr>
<tr>
<td><strong><? echo $ae->textsurveys[9] ?></strong></td>
<td>
<input type="text" name="ans4" value="<? echo $answers[3] ?>" size="20" maxlength="255">
</td>
</tr>
<tr>
<td><strong><? echo $ae->textsurveys[10] ?></strong></td>
<td>
<input type="text" name="ans5" value="<? echo $answers[4] ?>" size="20" maxlength="255">
</td>
</tr>
<?
if ($ae->currentuserposition==1)
   {
   echo '<tr><td><strong>',$ae->textsurveys[11],'</strong></td><td><input type="text" name="vote1" value="',$votes[0],'"></td></tr>';
   echo '<tr><td><strong>',$ae->textsurveys[12],'</strong></td><td><input type="text" name="vote2" value="',$votes[1],'"></td></tr>';
   echo '<tr><td><strong>',$ae->textsurveys[13],'</strong></td><td><input type="text" name="vote3" value="',$votes[2],'"></td></tr>';
   echo '<tr><td><strong>',$ae->textsurveys[14],'</strong></td><td><input type="text" name="vote4" value="',$votes[3],'"></td></tr>';
   echo '<tr><td><strong>',$ae->textsurveys[15],'</strong></td><td><input type="text" name="vote5" value="',$votes[4],'"></td></tr>';
}
?>
<tr>
<td colspan="2">
<?
if ($ae->currentuserposition<>1)
   {
   echo '<input type="hidden" name="vote1" value="',$votes[0],'">';
   echo '<input type="hidden" name="vote2" value="',$votes[1],'">';
   echo '<input type="hidden" name="vote3" value="',$votes[2],'">';
   echo '<input type="hidden" name="vote4" value="',$votes[3],'">';
   echo '<input type="hidden" name="vote5" value="',$votes[4],'">';
   }
?>
<input type="hidden" name="surveyID" value="<? echo $ae->surveyID ?>">
<input type="hidden" name="username" value="<? echo $ae->username ?>" />
<input type="hidden" name="session" value="<? echo $ae->session ?>" />
<input type="submit" name="Submit" value="<? echo $ae->textbasic[103] ?>" class="button" />
<input type="reset" name="Reset" value="<? echo $ae->textbasic[105] ?>" class="button" />
</td>
</tr>
</table>
</form>
</div>
<? @include(TEMPDIR.'footer.php'); ?>
Return current item: Absolut Engine