I'm having diffiiculty with this as I'm following on from somebody elses code, if somebody could help me with this I would appreciate it.
Basically I have a Jqgrid that displays a list of bookings, when you double click a row it opens a jqdialog that displays all the details about their booking.
I have a variable defined which is the booking reference which I want to pass to a php script.
var brData = rowData['bookref'];
I am then trying to send this via ajax:
function getGridRow(brData) {
$.ajax({
// Request sent from control panel, so send to cp.request.php (which is the handler)
url: 'scripts/php/bootstrp/all.request.php',
type: 'POST',
data: {
ft: "getDGRow",
type: 'POST',
data: 'fnme=getDGRow&row_data='+brData,
//row_data: rowData,
id: null,
condition: null
},
dataType: 'xml',
timeout: 20000,
error: function(){
$('#cp-div-error').html('');
$('#cp-div-error').append('<p>There was an error inserting the data, please try again later.</p>');
$('#cp-div-error').dialog('open');
},
success: function(response){
}
});
this is the case in all.request.php:
case 'getDGRow':
header('Content-type: text/xml');
DatagridController::getGridRow($_REQUEST['row_data']);
break;
and this is where I want to pass the variable 'brData':
public static function getGridRow($row_data) {
$pdo = new SQL();
$dbh = $pdo->connect(Database::$serverIP, Database::$serverPort, Database::$dbName, Database::$user, Database::$pass);
try {
$query = "SELECT * FROM tblbookings WHERE bookref = '$row_data'";
I'm finding this very confusing at the moment, so any help would be much appreciated. At the moment $row_data is my php function is blank so obviously it isn't selecting any row from the database.