or
<?php $sRootDir = "../.."; require_once ($sRootDir.'/lib/Kendo/DataSourceResult.php'); require_once ($sRootDir.'/lib/Kendo/Autoload.php'); require_once ($sRootDir."/include/includeDomain.php"); require_once ($sRootDir."/include/includeLib.php"); if ($_SERVER['REQUEST_METHOD'] == 'POST') { header('Content-Type: application/json'); $sType = $_GET["type"]; $sRequest = json_decode(file_get_contents('php://input')); //Password data removed $pResult = new DataSourceResult(**dns**, **user**, **password**); $aColumns = array('CLIENTEMEA', 'CLIENTNAME', 'CLIENTKVK'); switch($sType) { case 'create': $sResult = $pResult->create('RULES_CLIENTS', $aColumns, $sRequest->models, 'CLIENTEMEA'); break; case 'read': $sResult = $pResult->read('RULES_CLIENTS', $aColumns, $sRequest); break; case 'update': $sResult = $pResult->update('RULES_CLIENTS', $aColumns, $sRequest->models, 'CLIENTEMEA'); break; case 'destroy': $sResult = $pResult->destroy('RULES_CLIENTS', $sRequest->models, 'CLIENTEMEA'); break; } echo json_encode($sResult, JSON_NUMERIC_CHECK); $FileName = "testFile.txt"; $FileHandle = fopen($FileName, 'w') or die("can't open file"); fwrite($FileHandle, json_encode($sResult, JSON_NUMERIC_CHECK)); fclose($FileHandle); exit; } require_once($sRootDir."/html/tpbilling/client/index2.html");?><div id="grid"></div><script>jQuery(function(){jQuery("#grid").kendoGrid({"columns":[{"field":"CLIENTEMEA","width":100,"title":"Client EMEA"},{"field":"CLIENTNAME","width":400,"title":"Client Name"},{"field":"CLIENTKVK","width":100,"title":"KVK Number"}],"dataSource":{"transport":{"create":{"url":"../../tpbilling/client/test.php?type=create","contentType":"application\/json","type":"POST"},"read":{"url":"../../tpbilling/client/test.php?type=read","contentType":"application\/json","type":"POST"},"update":{"url":"../../tpbilling/client/test.php?type=update","contentType":"application\/json","type":"POST"},"destroy":{"url":"../../tpbilling/client/test.php?type=destroy","contentType":"application\/json","type":"POST"},"parameterMap":function(data) {return kendo.stringify(data);}},"batch":true,"pageSize":20,"schema":{"data":"data","errors":"errors","model":{"id":"CLIENTEMEA","fields":[{"field":"CLIENTEMEA","type":"number","validation":{"required":true}},{"field":"CLIENTNAME","type":"string","validation":{"required":true}},{"field":"CLIENTKVK","type":"number","validation":{"required":true}}]},"total":"total"}},"toolbar":[{"name":"create"}],"height":430,"editable":"popup","pageable":true});}); </script>
color: rgb(51,51,51); padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-color: rgb(51,51,51); border-right-color: rgb(51,51,51); border-bottom-color: rgb(51,51,51); border-left-color: rgb(51,51,51); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; display: block; background-image: none; background-attachment: scroll; background-repeat: repeat; background-position-x: 0%; background-position-y: 0%; background-color: transparent;