Exemplo n.º 1
0
 public function getSubServicesSelf($id)
 {
     $contServ = ContServ::find($id);
     $serv = Servicios::all();
     $title = "Modificación del Sub-servicio " . $contServ->nombre;
     return View::make('admin.editSubServiceSelf')->with('title', $title)->with('serv', $serv)->with('contServ', $contServ);
 }
Exemplo n.º 2
0
$app->post('/datos', function (Request $req, Response $res, $args = []) {
    $args = $req->getParsedBody();
    //var_dump($args);
    //echo $args['usr'];
    /*
    return $res->withHeader(
            'Content-Type',
            'application/json'
        );
    */
    //$cnxn = getCnxn();
    //var_dump($cnxn);
    return $res->withStatus(200)->withHeader('Content-Type', 'application/json')->write(json_encode(array("success" => 1, "data" => $args)));
});
$app->get('/orm', function () {
    $servicios = Servicios::all();
    //$log->addDebug('getServicio rs', var_export($servicios));
    foreach ($servicios as $servicio) {
        /*
                for ($i = 1; $i<=10; $i++) {
                    $oScore = new Score();
                    $oScore->round = $i;
                    $oScore->points = rand(0,10);
                    $oScore->user_id = $servicio->idx;
                    $oScore->save();
                }
        */
        echo $servicio->idx . "<br>";
    }
});
$app->get('/hello/{name}', function (Request $req, Response $res) {