public function postAdicionar()
 {
     $emprestimo = new TabelaEmprestimo();
     $usuemp = new TabelaUsuEmp();
     $emprestimo->id_clientedois = Input::get('id_clientedois');
     $data = Input::get('data_provavel_devolucao');
     if ($data == '') {
     } else {
         $data = date("Y-m-d", strtotime(str_replace('/', '-', $data)));
     }
     $emprestimo->data_emprestimo = date("Y.m.d");
     $emprestimo->data_provavel_devolucao = $data;
     $valida = Validator::make($emprestimo->toArray(), $this->rules);
     if ($valida->fails()) {
         return Redirect::to('emprestimo/adicionar')->withErrors($valida)->withInput();
     }
     $emprestimo->save();
     $livEmp = Input::get('id_exemplar');
     foreach ($livEmp as $value) {
         $exememp = new TabelaExemEmp();
         $exememp->emprestimo = DB::table('emprestimo')->max('id_emprestimo');
         $exememp->exemplar = $value;
         $livro = DB::table('exemplar')->where('id_exemplar', '=', $value)->first();
         $exememp->livro = $livro->id_livrodois;
         $exemplar = TabelaExemplar::find($value);
         $exemplar->emprestado = 1;
         $exememp->save();
         $exemplar->save();
     }
     $usuemp->cliente = Input::get('id_clientedois');
     $usuemp->emprestimo = DB::table('emprestimo')->max('id_emprestimo');
     $usuemp->usuario = Auth::id();
     $usuemp->save();
     return Redirect::to('emprestimo/comprovante');
 }