Problem with Mysqli show region utility and page navigation
Hello
I have a page where I put the repeat region inside a conditional mysqli show region utilty so that if the user level is admin then that repeat region portion should show, but the problem comes when in order to navigate the record I hit the next page like pageNum_userList=1&totalRows_userList=28 then all become blank and nothings shows.
Example
- /user/Index.php - this is my main page
- I put repeat region of all the users in this page and per page 10 record should show
- I put show conditional region so that if a user level is admin then this repeat region part should be visible
So normally the 1st page is showing 10 record without any problem if the user level is admin, but when I am clicking to next page (pageNum_userList=1&totalRows_userList=28) then nothing is visible anymore, I am not sure what it is causing the problem. please help me.
---------------------------------------------
<?php require_once('../../webassist/framework/framework.php'); ?>
<?php require_once('../../webassist/framework/library.php'); ?>
<?php require_once('../../Connections/hadithbd.php'); ?>
<?php require_once('../../webassist/mysqli/rsobj.php'); ?>
<?php require_once('../../webassist/mysqli/queryobj.php'); ?>
<?php require_once('../../webassist/mysqli/authentication.php'); ?>
<?php
if (true) {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "LoggedIn";
$RestricAccessRedirect = "login.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
?>
<?php
if (isset($_POST["deluser"]) || isset($_POST["deluser_x"])) {
$DeleteQuery = new WA_MySQLi_Query($hadithbd);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "users";
$DeleteQuery->addFilter("UserID", "=", "i", "".((isset($_POST["userid"]))?$_POST["userid"]:"") ."");
$DeleteQuery->execute();
$DeleteGoTo = "../done.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo?rel2abs($DeleteGoTo,dirname(__FILE__)):"";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
<?php
$userList = new WA_MySQLi_RS("userList",$hadithbd,10);
$userList->setQuery("SELECT users.* FROM users ORDER BY users.UserID ASC");
$userList->execute();
?>
<?php
if("" == ""){
$WA_hadithbd_template_1626822995751_Content_Empty = "";
$WA_hadithbd_template_1626822995751_Content = new WA_Include(__FILE__);
$WA_hadithbd_template_1626822995751_Template = new WA_Include("../../Templates{$WA_hadithbd_template_1626822995751_Content_Empty}/hadithbd-template.dwt.php");
require($WA_hadithbd_template_1626822995751_Template->BaseName);
$WA_hadithbd_template_1626822995751_Template->Initialize(true);
}
?>
<!doctype html>
<html lang="bn"><!-- InstanceBegin template="/Templates/Themes/hadithbd-template_fw_theme.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- InstanceBeginEditable name="doctitle" -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>
<!-- InstanceBeginEditable name="Main-body-area" -->
<main>
<?php
if ("".($userList->getColumnVal("userLevel")) ."" == "10") { // WebAssist Show If
?>
<div class="container mt-4 mb-5">
<div class="card bg-light shadow">
<div class="card-header shadow h4">User Info</div>
<div class="card-body">
<h5 class="card-title">Light card title</h5>
<div class="card-text">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">User#</th>
<th scope="col">Full Name</th>
<th scope="col">Signup</th>
<th scope="col">E-Mail</th>
<th scope="col">Level</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$wa_startindex = 0;
while(!$userList->atEnd()) {
$wa_startindex = $userList->Index;
?>
<tr>
<td><?php echo($userList->getColumnVal("UserID")); ?></td>
<td><?php echo($userList->getColumnVal("UserFullName")); ?></td>
<td><?php echo($userList->getColumnVal("UserRegistrationDate")); ?></td>
<td><?php echo($userList->getColumnVal("UserEmail")); ?></td>
<td><?php
if ("".($userList->getColumnVal("userLevel")) ."" == "10") { // WebAssist Show If
?>
<i class="fas fa-crown text-warning"> </i>
<?php
} // ("".($userList->getColumnVal("userLevel")) ."" == "10")
?>
<?php
if ("".($userList->getColumnVal("userLevel")) ."" == "2") { // WebAssist Show If
?>
<i class="fas fa-user-graduate text-success"></i>
<?php
} // ("".($userList->getColumnVal("userLevel")) ."" == "10")
?>
<?php
if ("".($userList->getColumnVal("userLevel")) ."" == "1") { // WebAssist Show If
?>
<i class="fas fa-user text-primary"></i>
<?php
} // ("".($userList->getColumnVal("userLevel")) ."" == "10")
?>
<?php
if ("".($userList->getColumnVal("userLevel")) ."" == "0") { // WebAssist Show If
?>
<i class="fas fa-user text-danger"></i>
<?php
} // ("".($userList->getColumnVal("userLevel")) ."" == "10")
?></td>
<td><?php
if ("".($userList->getColumnVal("userActive")) ."" == "1") { // WebAssist Show If
?>
<i class="fas fa-user-check text-success"></i>
<?php }else{ ?>
<i class="fas fa-user-times text-danger"></i>
<?php
} // ("".($userList->getColumnVal("userActive")) ."" == "1")
?></td>
<td><?php
if ("".($userList->getColumnVal("userLevel")) ."" != "10") { // WebAssist Show If
?>
<div class="form-row">
<div class="form-group mr-1">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post" enctype="multipart/form-data" id="edituser">
<button name="edituser" class="btn btn-warning" role="button" data-toggle="tooltip" data-html="true" title="এই একাউন্ট সংশোধন করুন"><i class="fas fa-user-edit"></i></button>
<input name="userid" type="hidden" id="userid" value="<?php echo($userList->getColumnVal("UserID")); ?>">
</form>
</div>
<div class="form-group">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post" enctype="multipart/form-data" id="deluser">
<button name="deluser" onclick="return confirm('আপনি কি মুছে ফেলতে চান?')" class="btn btn-danger" role="button" data-toggle="tooltip" data-html="true" title="এই একাউন্ট মুছে ফেলুন"><i class="fas fa-user-slash"></i></button>
<input name="userid" type="hidden" id="userid" value="<?php echo($userList->getColumnVal("UserID")); ?>">
</form>
</div>
</div>
<?php
} // ("".($userList->getColumnVal("userLevel")) ."" != "10")
?></td>
</tr>
<?php
$userList->moveNext();
}
$userList->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
<?php
$rs = $userList; // recordset name
require_once("../../navigation/page-navigation.php");
?>
</div>
</div>
</div>
</div>
<?php
} // ("".($userList->getColumnVal("userLevel")) ."" == "10")
?>
</main>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
<?php
if(isset($WA_hadithbd_template_1626822995751_Template)){
$WA_hadithbd_template_1626822995751_Content->Initialize();
$WA_hadithbd_template_1626822995751_Template->ReplaceTemplateRegions($WA_hadithbd_template_1626822995751_Content);
print($WA_hadithbd_template_1626822995751_Template->Content);
}
?>