Esempio n. 1
0
 /**
  * @param string $key
  * @param null   $default
  * @return mixed|null
  */
 function input($key = '', $default = null)
 {
     return Illuminate\Support\Facades\Input::has($key) ? Illuminate\Support\Facades\Input::get($key) : $default;
 }
            }
        }
    }
    return response()->json(['questions' => $randomq, 'answers' => $as]);
});
Route::get('answers/get', function () {
});
Route::post('score/save', function () {
    $table = '<table class="table table-bordered"><thead><tr><th>Pos</th><th>User</th><th>Score</th><th>Time</th></tr></thead>';
    $i = 0;
    $s = Illuminate\Support\Facades\Input::get('time');
    $minutes = substr($s, 0, 2);
    $seconds = substr($s, 2, 4);
    $seconds = str_replace(':', '', $seconds);
    $seconds = $minutes * 60 + $seconds;
    $score = Illuminate\Support\Facades\Input::get('score');
    if ($seconds > 60) {
        $scores = $score - $seconds * 2;
    } elseif ($seconds > 30) {
        $scores = $score - $seconds;
    } else {
        $scores = $score + $seconds * 2;
    }
    $score = new Flatland\Score();
    $score->score = $scores;
    $score->user_id = Flatland\User::where('name', $_COOKIE['username'])->firstOrFail()->id;
    $score->time = $seconds;
    $score->save();
    $leaderboard = Flatland\Score::orderBy('score', 'desc')->take(5)->get();
    foreach ($leaderboard as $key) {
        $user = Flatland\User::find($key['user_id']);
Esempio n. 3
0
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
        
    </head>
    <body>

        <div class="container">
            
            <div class="row">
                <div class="col-md-12">&nbsp;</div>
            </div>
            
            <div class="jumbotron">
                <h1>CSS Stats</h1>
                <p class="lead">Get cool stats on about your CSS file.</p>
                <?php 
echo Illuminate\Support\Facades\Input::get('error');
?>
                <p>
                    <form action="{{ url('upload') }}" method="post" enctype="multipart/form-data">
                        <?php 
echo csrf_field();
?>
                        <div class="form-group">
                            <input type="file" name="css_file" style="display: inline; width: 180px;">
                        </div>
                        <button type="submit" class="btn btn-lg btn-success"><span class="glyphicon glyphicon-upload" aria-hidden="true"></span> Upload CSS File</button>
                    </form>
                </p>
            </div>
    
        </div> <!-- /container -->
Esempio n. 4
0
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => 'web'], function () {
    Route::auth();
    Route::get('/', 'HomeController@index');
    Route::get('/home', 'HomeController@index');
    Route::get('transactions/charts/{year?}', ['uses' => 'TransactionsController@charts']);
    //    Route::get('transactions/charts', 'TransactionsController@charts\2016');
    Route::resource('transactions', 'TransactionsController');
    Route::resource('accounts', 'AccountsController');
    Route::resource('categories', 'CategoriesController');
    Route::resource('subcategories', 'SubcategoriesController');
    Route::resource('entities', 'EntitiesController');
    Route::get('/user/profile', 'UsersController@index');
});
//n6:1801161422> agrego grupo admin
Route::group(['middleware' => ['web', 'vixit\\Http\\Middleware\\AdminMiddleware'], 'prefix' => 'admin', 'namespace' => 'Admin'], function () {
    //n6:1501162356> agrego ruta del tipo recurso
    Route::resource('users', 'UsersController');
});
Route::get('api/dropdown/subcategories', function () {
    $id = Illuminate\Support\Facades\Input::get('category_id');
    $subcategories = \vixit\Subcategory::where('category_id', $id);
    return $subcategories->lists('name', 'id');
});