Skip to content

Commit

Permalink
auto-complete working
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Biswas committed May 21, 2017
1 parent b772477 commit 273c10b
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion calldatastore.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,51 @@
'projectId' => $projectId
]);

/*
$transaction = $datastore->transaction();
$key = $datastore->key('SKU', '00001');
$product = $datastore->entity( $key, [
'name' => 'koushik dummy 1'
]);
$datastore->upsert($product);
$key = $datastore->key('SKU', '00002');
$product = $datastore->entity( $key, [
'name' => 'koushik dummy 2'
]);
$datastore->upsert($product);
$transaction->commit();
*/

/*
$key = $datastore->key('SKU', '00001');
$product = $datastore->lookup($key);
echo $product['name'];
*/

echo 'Matches:<br/>';
$queryval = $_GET['searchtext'];
if ($queryval[0]) {
$upperlimit = $queryval . json_decode('"\ufffd"');
$query = $datastore->query()
->kind('SKU')
->filter('name', '>=', $queryval)
->filter('name', '<', $upperlimit)
->order('name');
$result = $datastore->runQuery($query);
foreach ($result as $SKU) {
echo $SKU['name'];
echo '<br/>';
}
}


/*
date_default_timezone_set('UTC');
$timenow = date('l jS \of F Y h:i:s A');
$queryval = $_GET['searchtext'] . ' ' . $timenow;
echo $queryval;

*/



Expand Down

0 comments on commit 273c10b

Please sign in to comment.