Пример #1
0
$app->get('/shiningfloor/finish_types', function () use($app, $db) {
    $finish_types = array();
    // $query = $db->products()->group('product_finish_type');
    $query = $db->finishes()->order('finish_name ASC');
    foreach ($query as $finish) {
        if ($finish['finish_name'] != "") {
            $finish_types[] = $finish['finish_name'];
        }
    }
    $app->response()->header('content-type', 'application/json');
    echo json_encode(array('finish_types' => $finish_types));
});
$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'];