public function postDelete()
 {
     if (Session::get('logininfo')->level == 3) {
         return view('admin.error');
     }
     $ads = ads::find(Input::get('id'));
     if ($ads->delete()) {
         return json_encode(array('result' => 1));
     } else {
         return json_encode(array('result' => -1, 'message' => 'Có lỗi. Xóa thất bại'));
     }
 }
 public static function getAdsWhereType($type)
 {
     $ads = new ads();
     return $ads->where('type', '=', $type)->get();
 }