Jump to content

[SOLVED] Pagination Filter


Recommended Posts

Hey, im having trouble trying to filter my saved messages to display the required messages to the required user, in this case kt_login_id; ive found the filter paryt of my code only im unaware of what code to use myself on how to do this, if anyone has any idea id be grateful! thanks

 

<?php require_once('Connections/db99.php'); ?>
<?php
// Load the common classes
require_once('includes/common/KT_common.php');

// Load the tNG classes
require_once('includes/tng/tNG.inc.php');

// Load the required classes
require_once('includes/tfi/TFI.php');
require_once('includes/tso/TSO.php');
require_once('includes/nav/NAV.php');

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");

// Make unified connection variable
$conn_db99 = new KT_connection($db99, $database_db99);

//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_db99, "");
//Grand Levels: Level
$restrict->addLevel("1");
$restrict->Execute();
//End Restrict Access To Page

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

// Filter
$tfi_listmessages_saved7 = new TFI_TableFilter($conn_db99, "tfi_listmessages_saved7");
$tfi_listmessages_saved7->addColumn("messages_saved.messages_saved_datetime", "DATE_TYPE", "messages_saved_datetime", "=");
$tfi_listmessages_saved7->addColumn("messages_saved.messages_saved_sender", "STRING_TYPE", "messages_saved_sender", "%");
$tfi_listmessages_saved7->addColumn("messages_saved.messages_saved_subject", "STRING_TYPE", "messages_saved_subject", "%");
$tfi_listmessages_saved7->Execute();

// Sorter
$tso_listmessages_saved7 = new TSO_TableSorter("rsmessages_saved1", "tso_listmessages_saved7");
$tso_listmessages_saved7->addColumn("messages_saved.messages_saved_datetime");
$tso_listmessages_saved7->addColumn("messages_saved.messages_saved_sender");
$tso_listmessages_saved7->addColumn("messages_saved.messages_saved_subject");
$tso_listmessages_saved7->setDefault("messages_saved.messages_saved_subject");
$tso_listmessages_saved7->Execute();

// Navigation
$nav_listmessages_saved7 = new NAV_Regular("nav_listmessages_saved7", "rsmessages_saved1", "", $_SERVER['PHP_SELF'], 10);

//NeXTenesio3 Special List Recordset
$maxRows_rsmessages_saved1 = $_SESSION['max_rows_nav_listmessages_saved7'];
$pageNum_rsmessages_saved1 = 0;
if (isset($_GET['pageNum_rsmessages_saved1'])) {
  $pageNum_rsmessages_saved1 = $_GET['pageNum_rsmessages_saved1'];
}
$startRow_rsmessages_saved1 = $pageNum_rsmessages_saved1 * $maxRows_rsmessages_saved1;

// Defining List Recordset variable
$NXTFilter_rsmessages_saved1 = "1=1";
if (isset($_SESSION['filter_tfi_listmessages_saved7'])) {
  $NXTFilter_rsmessages_saved1 = $_SESSION['filter_tfi_listmessages_saved7'];
}
// Defining List Recordset variable
$NXTSort_rsmessages_saved1 = "messages_saved.messages_saved_subject";
if (isset($_SESSION['sorter_tso_listmessages_saved7'])) {
  $NXTSort_rsmessages_saved1 = $_SESSION['sorter_tso_listmessages_saved7'];
}
mysql_select_db($database_db99, $db99);

$query_rsmessages_saved1 = "SELECT messages_saved.messages_saved_datetime, messages_saved.messages_saved_sender, messages_saved.messages_saved_subject, messages_saved.messages_saved_id FROM messages_saved WHERE {$NXTFilter_rsmessages_saved1} ORDER BY {$NXTSort_rsmessages_saved1}";
$query_limit_rsmessages_saved1 = sprintf("%s LIMIT %d, %d", $query_rsmessages_saved1, $startRow_rsmessages_saved1, $maxRows_rsmessages_saved1);
$rsmessages_saved1 = mysql_query($query_limit_rsmessages_saved1, $db99) or die(mysql_error());
$row_rsmessages_saved1 = mysql_fetch_assoc($rsmessages_saved1);

if (isset($_GET['totalRows_rsmessages_saved1'])) {
  $totalRows_rsmessages_saved1 = $_GET['totalRows_rsmessages_saved1'];
} else {
  $all_rsmessages_saved1 = mysql_query($query_rsmessages_saved1);
  $totalRows_rsmessages_saved1 = mysql_num_rows($all_rsmessages_saved1);
}
$totalPages_rsmessages_saved1 = ceil($totalRows_rsmessages_saved1/$maxRows_rsmessages_saved1)-1;
//End NeXTenesio3 Special List Recordset

// Make a logout transaction instance
$logoutTransaction = new tNG_logoutTransaction($conn_db99);
$tNGs->addTransaction($logoutTransaction);
// Register triggers
$logoutTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "GET", "KT_logout_now");
$logoutTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "index.php");
// Add columns
// End of logout transaction instance

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rscustom = $tNGs->getRecordset("custom");
$row_rscustom = mysql_fetch_assoc($rscustom);
$totalRows_rscustom = mysql_num_rows($rscustom);

$nav_listmessages_saved7->checkBoundries();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>99Jobs.co.uk ©</title>

<style type="text/css">

body    {
margin:0;
}
.style2 {
}


.style2 {
color: #666666;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.featuredtext {
font-size: 12px;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #333333;
}
.Headertext {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bolder;
color: #FFFFFF;
}
.welcometable {
border: 1px solid #999999;
}
.intro_text {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: bolder;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: 0;
border-right-style: 0;
border-bottom-style: 0;
border-left-style: 0;
}
.intro_text {
font-family: Arial, Helvetica, sans-serif;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
.logreg {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bolder;
color: #666666;
text-decoration: underline;
}
.links {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #FFFFFF;
}
.cpcontent {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.cpcontenttop {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: solid;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.cpcontentleft {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: solid;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.text1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.cplinks {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.profilehdr {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #3B5A9A;
}
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="includes/common/js/base.js" type="text/javascript"></script>
<script src="includes/common/js/utility.js" type="text/javascript"></script>
<script src="includes/skins/style.js" type="text/javascript"></script>
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style4 {color: #F4F5F5}
-->
</style>
<script src="includes/nxt/scripts/list.js" type="text/javascript"></script>
<script src="includes/nxt/scripts/list.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_LIST_SETTINGS = {
  duplicate_buttons: false,
  duplicate_navigation: false,
  row_effects: false,
  show_as_buttons: true,
  record_counter: false
}
</script>
<style type="text/css">
  /* Dynamic List row settings */
  .KT_col_messages_saved_datetime {width:140px; overflow:hidden;}
  .KT_col_messages_saved_sender {width:140px; overflow:hidden;}
  .KT_col_messages_saved_subject {width:140px; overflow:hidden;}
.style7 {font-size: 12}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
</style>
</head>

<BODY MARGINWIDTH="0" MARGINHEIGHT="0">
<?php include'member_header.php';?>
<table width="800" height="81" border="0" align="center" cellpadding="0" cellspacing="0" vspace="0">
  
  
  <tr>
    <td width="269" height="52" align="center" valign="middle"><div align="left">
      <p>
        <?php 
// Show IF Conditional region2 
if (@$_SESSION['kt_login_user'] == "") {
?>
        <a href="index.php"><img src="images/logo.gif" alt="" width="149" height="35" hspace="5" border="0" usemap="#MapMap" /></a>
        <?php 
// else Conditional region2
} else { ?>
        <a href="member_area.php"><img src="images/logo.gif" alt="" width="149" height="35" hspace="5" border="0" usemap="#MapMap" /></a>
        <?php } 
// endif Conditional region2
?>
      </p>
    </div></td>
  </tr>
  <tr>
    <td height="29" align="center" valign="middle"><?php include'navbar.php';?></td>
  </tr>
</table>
<br />
<table width="800" align="center" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td colspan="4" valign="middle" nowrap="nowrap" bgcolor="#F1F1F1" class="style2"><img src="images/corner2.gif" width="28" height="15" /><strong>My Account</strong></td>
  </tr>
  <tr>
    <td width="26" height="200" valign="top" bgcolor="#f1f1f1"><p><span class="style4"></span></p>    </td>
    <td width="154" height="200" valign="middle" bgcolor="#f1f1f1"><?php include'cp_links.php';?>  </td>
    <td width="13" height="200" valign="middle" nowrap="nowrap" class="cpcontenttop"> </td>
    <td width="607" rowspan="2" valign="top" class="cpcontent"><p class="profilehdr">Mail Center<br />
      Saved Messages
| 
        <span class="profilehdr">Listing Messages</span>
          <span class="profilehdr">
          <?php
  $nav_listmessages_saved7->Prepare();
  require("includes/nav/NAV_Text_Statistics.inc.php");
?>
        </span>        <div id="listmessages_saved7">
        <div>
          <form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" id="form1">
            <div class="KT_options"></div>
            <table width="100%" cellpadding="2" cellspacing="0">
              <thead>
                <tr class="KT_row_order">
                  <th valign="middle" class="message_header">Check</th>
                  <th width="100" align="left" class="message_header" id="messages_saved_datetime"> <a href="<?php echo $tso_listmessages_saved7->getSortLink('messages_saved.messages_saved_datetime'); ?>" class="message_header">Date</a> </th>
                  <th width="185" align="left" class="message_header" id="messages_saved_sender"> <a href="<?php echo $tso_listmessages_saved7->getSortLink('messages_saved.messages_saved_sender'); ?>" class="message_header">From</a></th>
                  <th align="left" class="message_header" id="messages_saved_subject"> <a href="<?php echo $tso_listmessages_saved7->getSortLink('messages_saved.messages_saved_subject'); ?>" class="message_header">Subject</a> </th>
                </tr>
              </thead>
              <tbody>
                <?php if ($totalRows_rsmessages_saved1 == 0) { // Show if recordset empty ?>
                  <tr valign="middle">
                    <td colspan="4"><?php echo NXT_getResource("The table is empty or the filter you've selected is too restrictive."); ?></td>
                  </tr>
                  <?php } // Show if recordset empty ?>
                <?php if ($totalRows_rsmessages_saved1 > 0) { // Show if recordset not empty ?>
                  <?php do { ?>
                    <tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>">
                      <td valign="middle" class="message_rows"><div align="center">
                        <input type="checkbox" name="kt_pk_messages_saved" class="id_checkbox" value="<?php echo $row_rsmessages_saved1['messages_saved_id']; ?>" />
                        <input type="hidden" name="messages_saved_id" class="id_field" value="<?php echo $row_rsmessages_saved1['messages_saved_id']; ?>" />                      
                      </div></td>
                      <td width="100" class="message_rows"><div class="KT_col_messages_saved_datetime"><?php echo KT_formatDate($row_rsmessages_saved1['messages_saved_datetime']); ?></div></td>
                      <td width="185" class="message_rows"><div class="KT_col_messages_saved_sender"><?php echo KT_FormatForList($row_rsmessages_saved1['messages_saved_sender'], 20); ?></div></td>
                      <td class="message_rows"><div class="KT_col_messages_saved_subject"><?php echo KT_FormatForList($row_rsmessages_saved1['messages_saved_subject'], 20); ?></div></td>
                    </tr>
                    <?php } while ($row_rsmessages_saved1 = mysql_fetch_assoc($rsmessages_saved1)); ?>
                  <?php } // Show if recordset not empty ?>
              </tbody>
            </table>
            <div>
              <div>
                <?php
            $nav_listmessages_saved7->Prepare();
            require("includes/nav/NAV_Text_Navigation.inc.php");
          ?>
              </div>
            </div>
            <div class="KT_bottombuttons">
              <div class="KT_operations"><a class="KT_delete_op_link" href="#" onClick="nxt_list_delete_link_form(this); return false;"><?php echo NXT_getResource("delete_all"); ?></a></div>
<span> </span></div>
          </form>
        </div>
        <br class="clearfixplain" />
      </div>
      <p> </p>
      <br />
      </p>
<p class="text1"></a><br />
        </p>
      </td>
  </tr>
  
  <tr>
    <td colspan="2" valign="top" nowrap="nowrap" bgcolor="#Ffffff" class="style2"> </td>
    <td width="13" valign="middle" nowrap="nowrap" class="cpcontentleft"> </td>
  </tr>
</table>
<br />
<br />
<p align="center"> <span class="style2">Copyright © 2008 | 99jobs.co.uk</span></p>

</body>
</html>
<?php
mysql_free_result($rsmessages_saved1);
?>

Link to comment
https://forums.phpfreaks.com/topic/108276-solved-pagination-filter/
Share on other sites

ive just noticed my query doesnt grab my reciever column from my table, in this case if i add it in would it be something such as .. ?  ???

 


SELECT * FROM messages_saved WHERE {$NXTFilter_rsmessages_saved1} ORDER BY {$NXTSort_rsmessages_saved1} AND messages_saved.messages_saved_reciever = {SESSION kt_login_id},";

 

im trying my best to understand this php code but its really hard so sorry if my initial message came across as bone-idle  ;)

 

 

okay this is ***** me right off, ive tried this

 

"SELECT messages_saved.messages_saved_datetime, messages_saved.messages_saved_sender, messages_saved.messages_saved_reciever, messages_saved.messages_saved_subject, messages_saved.messages_saved_id FROM messages_saved WHERE {$NXTFilter_rsmessages_saved1} AND messages_saved.messages_saved_reciever = $_SESSION['kt_login_id'] ORDER BY {$NXTSort_rsmessages_saved1}";

 

yet it just breaks my php and nothing appears in my browser, i then tried

 

"SELECT messages_saved.messages_saved_datetime, messages_saved.messages_saved_sender, messages_saved.messages_saved_reciever, messages_saved.messages_saved_subject, messages_saved.messages_saved_id FROM messages_saved WHERE {$NXTFilter_rsmessages_saved1} ORDER BY {$NXTSort_rsmessages_saved1} AND messages_saved.messages_saved_reciever = $_SESSION['kt_login_id']";

 

to which also broke my browser :@ there has to be some way to filter dynamic lists?!

tried this

 

<?php require_once('Connections/db99.php'); ?>
<?php
session_start();
$user = $_SESSION['kt_login_id'];

// Load the common classes
require_once('includes/common/KT_common.php');

// Load the tNG classes
require_once('includes/tng/tNG.inc.php');

// Load the required classes
require_once('includes/tfi/TFI.php');
require_once('includes/tso/TSO.php');
require_once('includes/nav/NAV.php');

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");

// Make unified connection variable
$conn_db99 = new KT_connection($db99, $database_db99);

//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_db99, "");
//Grand Levels: Level
$restrict->addLevel("1");
$restrict->Execute();
//End Restrict Access To Page

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

// Filter
$tfi_listmessages_saved7 = new TFI_TableFilter($conn_db99, "tfi_listmessages_saved7");
$tfi_listmessages_saved7->addColumn("messages_saved.messages_saved_datetime", "DATE_TYPE", "messages_saved_datetime", "=");
$tfi_listmessages_saved7->addColumn("messages_saved.messages_saved_sender", "STRING_TYPE", "messages_saved_sender", "%");
$tfi_listmessages_saved7->addColumn("messages_saved.messages_saved_subject", "STRING_TYPE", "messages_saved_subject", "%");
$tfi_listmessages_saved7->Execute();

// Sorter
$tso_listmessages_saved7 = new TSO_TableSorter("rsmessages_saved1", "tso_listmessages_saved7");
$tso_listmessages_saved7->addColumn("messages_saved.messages_saved_datetime");
$tso_listmessages_saved7->addColumn("messages_saved.messages_saved_sender");
$tso_listmessages_saved7->addColumn("messages_saved.messages_saved_subject");
$tso_listmessages_saved7->setDefault("messages_saved.messages_saved_subject");
$tso_listmessages_saved7->Execute();

// Navigation
$nav_listmessages_saved7 = new NAV_Regular("nav_listmessages_saved7", "rsmessages_saved1", "", $_SERVER['PHP_SELF'], 10);

//NeXTenesio3 Special List Recordset
$maxRows_rsmessages_saved1 = $_SESSION['max_rows_nav_listmessages_saved7'];
$pageNum_rsmessages_saved1 = 0;
if (isset($_GET['pageNum_rsmessages_saved1'])) {
  $pageNum_rsmessages_saved1 = $_GET['pageNum_rsmessages_saved1'];
}
$startRow_rsmessages_saved1 = $pageNum_rsmessages_saved1 * $maxRows_rsmessages_saved1;

// Defining List Recordset variable
$NXTFilter_rsmessages_saved1 = "1=1";
if (isset($_SESSION['filter_tfi_listmessages_saved7'])) {
  $NXTFilter_rsmessages_saved1 = $_SESSION['filter_tfi_listmessages_saved7'];
}
// Defining List Recordset variable
$NXTSort_rsmessages_saved1 = "messages_saved.messages_saved_subject";
if (isset($_SESSION['sorter_tso_listmessages_saved7'])) {
  $NXTSort_rsmessages_saved1 = $_SESSION['sorter_tso_listmessages_saved7'];
}
mysql_select_db($database_db99, $db99);

$query_rsmessages_saved1 = "SELECT messages_saved.messages_saved_datetime, messages_saved.messages_saved_sender, messages_saved.messages_saved_reciever, messages_saved.messages_saved_subject, messages_saved.messages_saved_id FROM messages_saved WHERE AND messages_saved.messages_saved_reciever = '$user'";
$query_limit_rsmessages_saved1 = sprintf("%s LIMIT %d, %d", $query_rsmessages_saved1, $startRow_rsmessages_saved1, $maxRows_rsmessages_saved1);
$rsmessages_saved1 = mysql_query($query_limit_rsmessages_saved1, $db99) or die(mysql_error());
$row_rsmessages_saved1 = mysql_fetch_assoc($rsmessages_saved1);

if (isset($_GET['totalRows_rsmessages_saved1'])) {
  $totalRows_rsmessages_saved1 = $_GET['totalRows_rsmessages_saved1'];
} else {
  $all_rsmessages_saved1 = mysql_query($query_rsmessages_saved1);
  $totalRows_rsmessages_saved1 = mysql_num_rows($all_rsmessages_saved1);
}
$totalPages_rsmessages_saved1 = ceil($totalRows_rsmessages_saved1/$maxRows_rsmessages_saved1)-1;
//End NeXTenesio3 Special List Recordset

// Make a logout transaction instance
$logoutTransaction = new tNG_logoutTransaction($conn_db99);
$tNGs->addTransaction($logoutTransaction);
// Register triggers
$logoutTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "GET", "KT_logout_now");
$logoutTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "index.php");
// Add columns
// End of logout transaction instance

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rscustom = $tNGs->getRecordset("custom");
$row_rscustom = mysql_fetch_assoc($rscustom);
$totalRows_rscustom = mysql_num_rows($rscustom);

$nav_listmessages_saved7->checkBoundries();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>99Jobs.co.uk ©</title>

<style type="text/css">

body    {
margin:0;
}
.style2 {
}


.style2 {
color: #666666;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.featuredtext {
font-size: 12px;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #333333;
}
.Headertext {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bolder;
color: #FFFFFF;
}
.welcometable {
border: 1px solid #999999;
}
.intro_text {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: bolder;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: 0;
border-right-style: 0;
border-bottom-style: 0;
border-left-style: 0;
}
.intro_text {
font-family: Arial, Helvetica, sans-serif;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
.logreg {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bolder;
color: #666666;
text-decoration: underline;
}
.links {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #FFFFFF;
}
.cpcontent {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.cpcontenttop {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: solid;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.cpcontentleft {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: solid;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.text1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.cplinks {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
}
.profilehdr {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #3B5A9A;
}
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="includes/common/js/base.js" type="text/javascript"></script>
<script src="includes/common/js/utility.js" type="text/javascript"></script>
<script src="includes/skins/style.js" type="text/javascript"></script>
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style4 {color: #F4F5F5}
-->
</style>
<script src="includes/nxt/scripts/list.js" type="text/javascript"></script>
<script src="includes/nxt/scripts/list.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_LIST_SETTINGS = {
  duplicate_buttons: false,
  duplicate_navigation: false,
  row_effects: false,
  show_as_buttons: true,
  record_counter: false
}
</script>
<style type="text/css">
  /* Dynamic List row settings */
  .KT_col_messages_saved_datetime {width:140px; overflow:hidden;}
  .KT_col_messages_saved_sender {width:140px; overflow:hidden;}
  .KT_col_messages_saved_subject {width:140px; overflow:hidden;}
.style7 {font-size: 12}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
</style>
</head>

<BODY MARGINWIDTH="0" MARGINHEIGHT="0">
<?php include'member_header.php';?>
<table width="800" height="81" border="0" align="center" cellpadding="0" cellspacing="0" vspace="0">
  
  
  <tr>
    <td width="269" height="52" align="center" valign="middle"><div align="left">
      <p>
        <?php 
// Show IF Conditional region2 
if (@$_SESSION['kt_login_user'] == "") {
?>
        <a href="index.php"><img src="images/logo.gif" alt="" width="149" height="35" hspace="5" border="0" usemap="#MapMap" /></a>
        <?php 
// else Conditional region2
} else { ?>
        <a href="member_area.php"><img src="images/logo.gif" alt="" width="149" height="35" hspace="5" border="0" usemap="#MapMap" /></a>
        <?php } 
// endif Conditional region2
?>
      </p>
    </div></td>
  </tr>
  <tr>
    <td height="29" align="center" valign="middle"><?php include'navbar.php';?></td>
  </tr>
</table>
<br />
<table width="800" align="center" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td colspan="4" valign="middle" nowrap="nowrap" bgcolor="#F1F1F1" class="style2"><img src="images/corner2.gif" width="28" height="15" /><strong>My Account</strong></td>
  </tr>
  <tr>
    <td width="26" height="200" valign="top" bgcolor="#f1f1f1"><p><span class="style4"></span></p>    </td>
    <td width="154" height="200" valign="middle" bgcolor="#f1f1f1"><?php include'cp_links.php';?>  </td>
    <td width="13" height="200" valign="middle" nowrap="nowrap" class="cpcontenttop"> </td>
    <td width="607" rowspan="2" valign="top" class="cpcontent"><p class="profilehdr">Mail Center<br />
      Saved Messages
| 
        <span class="profilehdr">Listing Messages</span>
          <span class="profilehdr">
          <?php
  $nav_listmessages_saved7->Prepare();
  require("includes/nav/NAV_Text_Statistics.inc.php");
?>
        </span>        <div id="listmessages_saved7">
        <div>
          <form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" id="form1">
            <div class="KT_options"></div>
            <table width="100%" cellpadding="2" cellspacing="0">
              <thead>
                <tr class="KT_row_order">
                  <th valign="middle" class="message_header">Check</th>
                  <th width="100" align="left" class="message_header" id="messages_saved_datetime"> <a href="<?php echo $tso_listmessages_saved7->getSortLink('messages_saved.messages_saved_datetime'); ?>" class="message_header">Date</a> </th>
                  <th width="185" align="left" class="message_header" id="messages_saved_sender"> <a href="<?php echo $tso_listmessages_saved7->getSortLink('messages_saved.messages_saved_sender'); ?>" class="message_header">From</a></th>
                  <th align="left" class="message_header" id="messages_saved_subject"> <a href="<?php echo $tso_listmessages_saved7->getSortLink('messages_saved.messages_saved_subject'); ?>" class="message_header">Subject</a> </th>
                </tr>
              </thead>
              <tbody>
                <?php if ($totalRows_rsmessages_saved1 == 0) { // Show if recordset empty ?>
                  <tr valign="middle">
                    <td colspan="4"><?php echo NXT_getResource("The table is empty or the filter you've selected is too restrictive."); ?></td>
                  </tr>
                  <?php } // Show if recordset empty ?>
                <?php if ($totalRows_rsmessages_saved1 > 0) { // Show if recordset not empty ?>
                  <?php do { ?>
                    <tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>">
                      <td valign="middle" class="message_rows"><div align="center">
                        <input type="checkbox" name="kt_pk_messages_saved" class="id_checkbox" value="<?php echo $row_rsmessages_saved1['messages_saved_id']; ?>" />
                        <input type="hidden" name="messages_saved_id" class="id_field" value="<?php echo $row_rsmessages_saved1['messages_saved_id']; ?>" />                      
                      </div></td>
                      <td width="100" class="message_rows"><div class="KT_col_messages_saved_datetime"><?php echo KT_formatDate($row_rsmessages_saved1['messages_saved_datetime']); ?></div></td>
                      <td width="185" class="message_rows"><div class="KT_col_messages_saved_sender"><?php echo KT_FormatForList($row_rsmessages_saved1['messages_saved_sender'], 20); ?></div></td>
                      <td class="message_rows"><div class="KT_col_messages_saved_subject"><?php echo KT_FormatForList($row_rsmessages_saved1['messages_saved_subject'], 20); ?></div></td>
                    </tr>
                    <?php } while ($row_rsmessages_saved1 = mysql_fetch_assoc($rsmessages_saved1)); ?>
                  <?php } // Show if recordset not empty ?>
              </tbody>
            </table>
            <div>
              <div>
                <?php
            $nav_listmessages_saved7->Prepare();
            require("includes/nav/NAV_Text_Navigation.inc.php");
          ?>
              </div>
            </div>
            <div class="KT_bottombuttons">
              <div class="KT_operations"><a class="KT_delete_op_link" href="#" onClick="nxt_list_delete_link_form(this); return false;"><?php echo NXT_getResource("delete_all"); ?></a></div>
<span> </span></div>
          </form>
        </div>
        <br class="clearfixplain" />
      </div>
      <p> </p>
      <br />
      </p>
<p class="text1"></a><br />
        </p>
      </td>
  </tr>
  
  <tr>
    <td colspan="2" valign="top" nowrap="nowrap" bgcolor="#Ffffff" class="style2"> </td>
    <td width="13" valign="middle" nowrap="nowrap" class="cpcontentleft"> </td>
  </tr>
</table>
<br />
<br />
<p align="center"> <span class="style2">Copyright © 2008 | 99jobs.co.uk</span></p>

</body>
</html>
<?php
mysql_free_result($rsmessages_saved1);
?>

 

using

 

session_start();

$user = $_SESSION['kt_login_id'];

 

but now im getting the output (in my browser window)

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND messages_saved.messages_saved_reciever = '27' LIMIT 0, 10' at line 1"

 

??? ??? ???

my filter wont filter anything out, can somebody explain why?, my query seems fine!!  >:( :-\

 

$query_rsmessages_saved1 = "SELECT messages_saved.messages_saved_id, messages_saved.messages_saved_member_id, messages_saved.messages_saved_datetime, messages_saved.messages_saved_reciever, messages_saved.messages_saved_sender, messages_saved.messages_saved_subject FROM messages_saved WHERE {$NXTFilter_rsmessages_saved1} ORDER BY {$NXTSort_rsmessages_saved1} AND messages_saved_member_id = '$user'";

 

where

 

session_start();

$user = $_SESSION['kt_login_id'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.