Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / data / customer.php
diff --git a/examples/data/customer.php b/examples/data/customer.php
new file mode 100644 (file)
index 0000000..c5dede2
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+$customers = array(array(
+        'id'=>1,
+        'name'=>'Bread Barn',
+        'phone'=>'8436-365-256'
+    ), array(
+        'id'=>2,
+        'name'=>'Icecream Island',
+        'phone'=>'8452-389-719'
+    ), array(
+        'id'=>3,
+        'name'=>'Pizza Palace',
+        'phone'=>'9378-255-743'
+    )
+);
+
+if (isset($_REQUEST['id'])) {
+    $id = $_REQUEST['id'];
+    foreach ($customers as &$customer) {
+        if ($customer['id'] == $id) {
+            echo json_encode($customer);
+            break;
+        }
+    }
+} else {
+    echo json_encode($customers);
+}
+?>
\ No newline at end of file