コード例 #1
0
    return View::make('table')->with(['pages' => $pages]);
});
Route::get('onePage', function () {
    $oldPage = Pages::where('id', '=', Input::get('id'))->first();
    return $oldPage->page_url;
});
Route::get('/tables', function () {
    $pages = Pages::all();
    return View::make('table')->with(['pages' => $pages]);
});
Route::get('/upload', function () {
    $sections = Sections::all();
    return View::make('upload')->with(['sections' => $sections]);
});
Route::get('/allUploads', function () {
    $uploads = Uploads::all();
    return $uploads;
});
Route::get('/uploadFiles', function () {
    chmod(public_path() . '\\' . 'uploads', 0777);
    $sections = Sections::all();
    $section_values = Sections::where('id', '=', Input::get('id'))->first();
    $path = public_path() . '\\' . 'sections\\' . $section_values->shortname;
    $zipFileName = $section_values->shortname . '.zip';
    touch(public_path() . '\\' . 'uploads\\' . $zipFileName);
    $zip = new ZipArchive();
    if ($zip->open(public_path() . '\\' . 'uploads\\' . $zipFileName, ZipArchive::CREATE) === TRUE) {
        // Copy all the files from the folder and place them in the archive.
        foreach (glob($path . '/*') as $fileName) {
            $file = basename($fileName);
            $zip->addFile(realpath($fileName), $file);