2 import(
'Dataface/dhtmlxGrid/activegrid.php');
22 if ( isset($_POST[
'--cleargrids']) and $_POST[
'--cleargrids'] == 1) Dataface_dhtmlXGrid_activegrid::clearGrids();
23 $cells = @$_REQUEST[
'cells'];
28 $gridid = @$_REQUEST[
'-gridid'];
29 $rowid = @$_REQUEST[
'-rowid'];
32 $grid = Dataface_dhtmlXGrid_activegrid::getGrid($gridid);
33 if ( !is_object($grid) ){
35 echo $this->
error(
'Could not find grid with id "'.$gridid.
'"');
39 if ( !is_array($cells) ){
40 echo $this->
notice(
'No cells were submitted to be updated.');
44 foreach (array_keys($cells) as $key){
45 $cells[$key] = trim($cells[$key],
"\x7f..\xff\x0..\x1f");
49 $res = $grid->setRowValues($rowid, $cells);
51 echo $this->
error($res->getMessage());
54 $grid2 = Dataface_dhtmlXGrid_activegrid::getGrid($gridid);
55 echo $this->
json(array(
'success'=>1));
62 return $this->
json(array(
'notice'=>$msg,
'success'=>0));
66 return $this->
json(array(
'warning'=>$msg,
'success'=>0));
70 return $this->
json(array(
'error'=>$msg,
'success'=>0));
74 if ( is_array($arr) ){
76 foreach ( $arr as $key=>$val){
77 $out[] =
"'".addslashes($key).
"': {$this->json($val)}";
79 return "{".implode(
', ',
$out).
"}";
80 }
else if ( is_int($arr) || is_float($arr) ){
82 }
else if ( is_bool($arr) ){
83 return ( $arr?
'1':
'0');
85 return "'".addslashes($arr).
"'";