Jump to content

Recommended Posts

hi,

 

I have a small problem,  how can i filter by kt_login_id in this codes.. plesase help.

kt_login_id  ids  recorded in : session_user column

 

 

 

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

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

// Make unified connection variable
$conn_vekipman = new KT_connection($vekipman, $database_vekipman);

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $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_listurunler7 = new TFI_TableFilter($conn_vekipman, "tfi_listurunler7");
$tfi_listurunler7->addColumn("urunler.urun_grubu", "STRING_TYPE", "urun_grubu", "%");
$tfi_listurunler7->addColumn("urunler.marka", "STRING_TYPE", "marka", "%");
$tfi_listurunler7->addColumn("urunler.model", "STRING_TYPE", "model", "%");
$tfi_listurunler7->addColumn("urunler.urun_durumu", "STRING_TYPE", "urun_durumu", "%");
$tfi_listurunler7->addColumn("urunler.fiyat", "STRING_TYPE", "fiyat", "%");
$tfi_listurunler7->addColumn("urunler.aciklama", "STRING_TYPE", "aciklama", "%");
$tfi_listurunler7->addColumn("urunler.foto", "STRING_TYPE", "foto", "%");
$tfi_listurunler7->Execute();

// Sorter
$tso_listurunler7 = new TSO_TableSorter("rsurunler1", "tso_listurunler7");
$tso_listurunler7->addColumn("urunler.urun_grubu");
$tso_listurunler7->addColumn("urunler.marka");
$tso_listurunler7->addColumn("urunler.model");
$tso_listurunler7->addColumn("urunler.urun_durumu");
$tso_listurunler7->addColumn("urunler.fiyat");
$tso_listurunler7->addColumn("urunler.aciklama");
$tso_listurunler7->addColumn("urunler.foto");
$tso_listurunler7->setDefault("urunler.urun_grubu");
$tso_listurunler7->Execute();

// Navigation
$nav_listurunler7 = new NAV_Regular("nav_listurunler7", "rsurunler1", "", $_SERVER['PHP_SELF'], 50);

//NeXTenesio3 Special List Recordset
$maxRows_rsurunler1 = $_SESSION['max_rows_nav_listurunler7'];
$pageNum_rsurunler1 = 0;
if (isset($_GET['pageNum_rsurunler1'])) {
  $pageNum_rsurunler1 = $_GET['pageNum_rsurunler1'];
}
$startRow_rsurunler1 = $pageNum_rsurunler1 * $maxRows_rsurunler1;

// Defining List Recordset variable
$NXTFilter_rsurunler1 = "1=1";
if (isset($_SESSION['filter_tfi_listurunler7'])) {
  $NXTFilter_rsurunler1 = $_SESSION['filter_tfi_listurunler7'];
}
// Defining List Recordset variable
$NXTSort_rsurunler1 = "urunler.urun_grubu";
if (isset($_SESSION['sorter_tso_listurunler7'])) {
  $NXTSort_rsurunler1 = $_SESSION['sorter_tso_listurunler7'];
}
mysql_select_db($database_vekipman, $vekipman);

$query_rsurunler1 = "SELECT urunler.urun_grubu, urunler.marka, urunler.model, urunler.urun_durumu, urunler.fiyat, urunler.aciklama, urunler.foto, urunler.id FROM urunler WHERE {$NXTFilter_rsurunler1} ORDER BY {$NXTSort_rsurunler1}";
$query_limit_rsurunler1 = sprintf("%s LIMIT %d, %d", $query_rsurunler1, $startRow_rsurunler1, $maxRows_rsurunler1);
$rsurunler1 = mysql_query($query_limit_rsurunler1, $vekipman) or die(mysql_error());
$row_rsurunler1 = mysql_fetch_assoc($rsurunler1);

if (isset($_GET['totalRows_rsurunler1'])) {
  $totalRows_rsurunler1 = $_GET['totalRows_rsurunler1'];
} else {
  $all_rsurunler1 = mysql_query($query_rsurunler1);
  $totalRows_rsurunler1 = mysql_num_rows($all_rsurunler1);
}
$totalPages_rsurunler1 = ceil($totalRows_rsurunler1/$maxRows_rsurunler1)-1;
//End NeXTenesio3 Special List Recordset

$nav_listurunler7->checkBoundries();
?>

Link to comment
https://forums.phpfreaks.com/topic/210392-how-to-filter-by-session_id/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.