function x4index_ajax($x4xAjax) { // For all raw access, there will be an array // of column values, and a table to hit. $row = rowFromGP('x4c_'); // values $whr = rowFromGP('x4w_'); // where clause values $table = gp('x4xTable'); // The table name $rr = gp('x4xRetRow', 0); // row return command // There are four different database functions, so there // are four library routines we might call. $ra = $r1 = false; switch (strtolower($x4xAjax)) { case 'del': x4sqlDel($table, $whr); break; case 'sel': $ra = x4sqlSel($table, $whr); break; case 'ins': $r1 = x4sqlIns($table, $row, $rr); break; case 'insset': x4sqlInsSet($table); break; case 'upd': $r1 = x4sqlUpd($table, $row, $whr, $rr); break; case 'bsrch': searchBrowse($table, $whr); break; case 'sql': x4sqlQuery(gp('x4xSQL')); break; } if (is_array($r1)) { foreach ($r1 as $key => $value) { if (is_numeric($key)) { unset($r1[$key]); } } ri('data', $table, $r1); } if (is_array($ra)) { foreach ($ra as $ra1) { ri('data', $table, $ra1); } } }
function index_hidden_x4DB() { // For all raw access, there will be an array // of column values, and a table to hit. $row = rowFromGP('x4c_'); // values $whr = rowFromGP('x4w_'); // where clause values $table = gp('x4Page'); // The table name $rr = gp('retrow', 0); // row return command // There are four different database functions, so there // are four library routines we might call. $ra = $r1 = false; switch (gp('db')) { case 'del': x4sqlDel($table, $whr); break; case 'sel': x4sqlSel($table, $whr); break; case 'ins': x4sqlIns($table, $row, $rr); break; case 'upd': x4sqlUpd($table, $row, $whr, $rr); break; } }