I've got two sort of problems, first is that AJAX CRUD doesn't work properly and I don't know why. I've spend all weekend trying to solve that but nothing. The problem is that I can add something to the DB dynamicaly without refreshing website, but I can't delete it and edit and update without refreshing it. Next thing is that sign of my language doesn't show properly.
I've tried to add and still nothing.
Here is my website code
<?php
//demo the issue
require_once('preheader.php'); // <-- this include file MUST go first before any HTML/output
require_once('ajaxCRUD.class.php');
?>
<html>
<head>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-2">
<link rel="stylesheet" type="text/css" href="menugora.css" />
<link rel="stylesheet" type="text/css" href="login_success.css" />
</head>
<body>
<div id=menu>
<li> <a href="login_success.php?menu=2">Item</a> </li>
</div>
<?php
$arg = (int)$_GET['menu'];
switch ($arg)
{
case 1:
include('Item.php');
break;
}
?>
</body>
</html>
and here is my item.php
<html>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-2">
<link rel="stylesheet" href="format.css" type="text/css">
<body>
<?php
# this one line of code is how you implement the class
$tblCustomer = new ajaxCRUD("Towar","Towar", "Tow_id");
# don't show the primary key in the table
$tblCustomer->omitPrimaryKey();
# my db fields all have prefixes;
# display headers as reasonable titles
$tblCustomer->displayAs("Tow_nazwa", "Nazwa");
$tblCustomer->displayAs("Tow_opis", "Opis");
$tblCustomer->displayAs("Tow_producent", "Producent");
$tblCustomer->displayAs("Tow_nr_czesci", "Numer części");
$tblCustomer->displayAs("Tow_cena", "Cena");
$tblCustomer->displayAs("Tow_ilosc", "Ilość");
$tblCustomer->displayAs("Kat_id", "Numer kategorii");
# add the filter box (above the table)
$tblCustomer->addAjaxFilterBox("Tow_nazwa");
# add validation to certain fields (via jquery in validation.js)
$tblCustomer->modifyFieldWithClass("Tow_nazwa", "Nazwa produktu");
# actually show to the table
$tblCustomer->showTable();
?>
</body>
</html>
also link for ajaxcrud is here http://ajaxcrud.com/ I want to add that db charset is utf8_polish_ci. Thanks for all clues, advice and help generally.
Ajaxcrud does some dynamic requests behind the scenes to the same page url you'r viewing but might not always keep the part after ? intact. Seeing how you're handline the inclusion of item.php try some other way and check out the code of ajaxcrud. I've been working with it on large system and it has few kinks when used in this kind of way.
Also as to the encoding, there are encodings at least in the preheader.php, javascript file, your php.ini, mysql database and webpage itself. All should be set to UTF-8 for convenience.
Ok here is the trick to keep track of your filter. Ajaxcrud creates a bunch of $_SESSIONS variables so 1st load the where clause before using the class:
$_SESSION['ajaxcrud_where_clause']=$WhereClause;
You probably experienced some warning then after calling the display (showtable) add this short sequence..
$tblCustomer->showTable();
if(isset($_SESSION['ajaxcrud_where_clause']))
{
$WhereClause =$_SESSION['ajaxcrud_where_clause'];
}