コード例 #1
0
ファイル: slim.php プロジェクト: rohitnathaiya/shiningfloor
$app->get('/shiningfloor/applications', function () use($app, $db) {
    $applications = array();
    //    $query = $db->products()->group('product_application');
    $query = $db->applications()->order('application_name ASC');
    foreach ($query as $application) {
        if ($application['application_name'] != "") {
            $applications[] = $application['application_name'];
        }
    }
    $app->response()->header('content-type', 'application/json');
    echo json_encode(array('applications' => $applications));
});
$app->get('/shiningfloor/looks', function () use($app, $db) {
    $looks = array();
    //$query = $db->products()->group('product_look');
    $query = $db->looks()->order('look_name ASC');
    foreach ($query as $look) {
        if ($look['look_name'] != "") {
            $looks[] = $look['look_name'];
        }
    }
    $app->response()->header('content-type', 'application/json');
    echo json_encode(array('looks' => $looks));
});
$app->get('/shiningfloor/materials', function () use($app, $db) {
    $product_materials = array();
    // $query = $db->products()->group('product_material');
    $query = $db->materials()->order('material_name ASC');
    foreach ($query as $material) {
        if ($material['material_name'] != "") {
            $product_materials[] = $material['material_name'];