<?php

class RemoveController extends BaseController {

    public function remove($url)
    {
        $removeData = RemoveWebSite::getLastRemoveCode($url);

        if(isset($removeData->remove_code)){
            return View::make('remove')
                ->with('removeCode', $removeData->remove_code)
                ->with('url', $url);
        }
        return Redirect::route('index');
    }

    public function downloadVerificationFile($url){
        $removeData = RemoveWebSite::getLastRemoveCode($url);
        if(isset($removeData->remove_code)){
            header('Content-type: text/html');
            header('Content-disposition: attachment; filename='. $removeData->remove_code .'.html');
            return "aws-" . $removeData->remove_code;
        }
        return Redirect::route('site.index');
    }




}
