close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with Mysqli show region utility and page navigation

Thread began 7/21/2021 1:26 am by Rokon | Last modified 7/23/2021 10:24 am by Ray Borduin | 25 views | 9 replies |

Rokon

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:
<?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);
}
?>
Sign in to reply to this post

Ray BorduinWebAssist

The issue is probably on the page:
navigation/page-navigation.php

I'm probably going to need a url to see the issue and FTP access to debug this one.

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Originally Said By: Ray Borduin
  The issue is probably on the page:
navigation/page-navigation.php

I'm probably going to need a url to see the issue and FTP access to debug this one.  


the ftp infor is in the PM

Sign in to reply to this post

Ray BorduinWebAssist

What is the website url and steps to get to the page including usernames and passwords if necessary?

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Pls find the info in PM

Sign in to reply to this post

Ray BorduinWebAssist

The FTP information provided doesn't seem to be working for me.

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

Can you pls try with new info in PM

Sign in to reply to this post

Ray BorduinWebAssist

Still no luck with that FTP information. Maybe you have IP address restrictions in place?

Sign in to reply to this post
Did this help? Tips are appreciated...

Rokon

I have no idea what's going on. Anyhow I am attaching the both file here in PM.

Sign in to reply to this post

Ray BorduinWebAssist

You have the entire page wrapped in the code:
if ("".($userList->getColumnVal("userLevel")) ."" == "10") { // WebAssist Show If

That checks the first row of the results and would only show if it equals 10, otherwise the entire page won't show.

I'm not sure what you were going for with that line, but I think you should remove lines 59-61 and 168-170

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...