Vor zurückbutton

This commit is contained in:
aschwarz
2023-03-18 12:52:17 +01:00
parent f0a0848c5d
commit 15ec7a0a34
8 changed files with 530 additions and 16 deletions

View File

@ -34,7 +34,7 @@ if(isset($_POST['save'])){
WHERE ufid = $frage;");
$row_multiple = $result_multiple->fetch_array();
if($row_multiple['multiple'] == '0'){
echo "Antwort: $_POST[antwort]<br>";
# echo "Antwort: $_POST[antwort]<br>";
}
if($row_multiple['multiple'] == '1'){
$query = "SELECT uaid
@ -45,7 +45,7 @@ if(isset($_POST['save'])){
while ($row = $result->fetch_array()){
$antwort = $_POST['antwort_'.$row['uaid']];
if($antwort != ''){
echo "Antwort: $antwort<br>";
# echo "Antwort: $antwort<br>";
}
}
}
@ -55,10 +55,31 @@ if(isset($_POST['save'])){
$rowperpage = 1;
$row1234 = 0;
// Previous Button
if(isset($_POST['but_prev'])){
$row1234 = $_POST['row'];
$row1234 -= $rowperpage;
if( $row1234 < 0 ){
$row1234 = 0;
}
}
// Next Button
if(isset($_POST['but_next'])){
$row1234 = $_POST['row'];
$allcount = $_POST['allcount'];
$val = $row1234 + $rowperpage;
if( $val < $allcount ){
$row1234 = $val;
}
}
$smarty->assign('pagination_row', $row1234);
@ -80,22 +101,18 @@ if(isset($_POST['save'])){
WHERE umid = $umid;");
$row = $result->fetch_array();
$smarty->assign('umfrage_progress', $row['progress']);
$total = $row['total'];
$allcount = $row['total'];
$smarty->assign('pagination_allcount', $allcount);
#$show = ceil($total/$limit); //Seitenzahlen aufrunden
if(isset($_POST['start'])){
echo "hier|$total|$limit|$start";
#echo "hier|$total|$limit|$start";
$start = ($_POST['start'] >= $total) ? $total - $limit : $start;
}else{
$start = 0;
}
echo"
<hr>
$start
<hr>
";
#echo "$row[Anz_limit]<br>";
@ -104,7 +121,7 @@ $query = "SELECT ufid, frage, multiple
FROM jumi_umfragen_fragen
WHERE umid = 1
ORDER BY ufid ASC
LIMIT ".$start.",1";
LIMIT ".$row1234.",1";
$result = $db->query( $query);
// Ergebnisse lesen und an den Client ausgeben
@ -141,6 +158,7 @@ $smarty->assign('table_data', $table_data);
// Zurück- und Vorblättern
if ($start > 0){
$newStart = ($start - $limit < 0) ? 0 : ($start-$limit); // wenn $start-$limit kleiner 0 dann $newstart=0 sonst $start-$limit
echo "<br>1: ".$newStart;
$smarty->assign('umfrage_start0', "1");
$smarty->assign('umfrage_start_newstart', "$newStart");
}else{
@ -150,6 +168,7 @@ $smarty->assign('table_data', $table_data);
if ($start + $limit < $total){
$newStart = $start + $limit;
echo "<br>2: ".$newStart;
$smarty->assign('umfrage_end0', "1");
$smarty->assign('umfrage_end_newstart', "$newStart");
$smarty->assign('umfrage_end_last', "$last");