Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $types = Type::all();
     $types->toarray();
     $tips = Tip::all();
     $tips->toarray();
     $breeds = Breed::all();
     $breeds->toarray();
     // $tips = DB::table('pet_tips')
     // 		->where('breed_id', '=', $breed_id)
     //    		->get();
     return View::make('tips.tips', compact('types', 'breeds', 'tips'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $types_data = Type::all();
     return View::make('admin.type.list')->with('types', $types_data);
 }
Exemplo n.º 3
0
 public function getEdit($BranchId)
 {
     // 区域
     //
     $area = Area::all();
     // 线路
     //
     $line = Line::all();
     // 客户类型
     //
     $type = Type::all();
     // 业务员
     //
     $users = User::where('grade', '10')->where('disable', '0')->get();
     return View::make('branch.edit')->with('branch', Branch::find($BranchId))->with(compact('area'))->with(compact('line'))->with(compact('type'))->with(compact('users'));
 }
Exemplo n.º 4
0
 public function getEdit($id)
 {
     $type = Type::all();
     $data = Room::find($id);
     return View::make('home/dashboard', array())->nest('content', 'room/edit', array('data' => $data, 'type' => $type));
 }
Exemplo n.º 5
0
            $img->save();
        }
    }
    $app->redirect($app->urlFor("accueil"));
})->name('depot');
//Avoir le détail d'une annonce
$app->get('/:id', function ($id) use($app) {
    $annonce = Annonce::with('image', 'type', 'quartier', 'quartier.ville', 'vendeur')->where("id_annonce", "=", $id)->get();
    $app->render('annonce.twig', array('annonce' => $annonce));
})->name("annonce");
//Ouverture page de modification
$app->post('/modification/:id/', function ($id) use($app) {
    $annonce = Annonce::with('vendeur', 'quartier', 'quartier.ville')->where("id_annonce", "=", $id)->get();
    $types = Type::all();
    $villes = Ville::all();
    $types = Type::all();
    $quartiers = Quartier::all();
    $app->render('modification.twig', array('types' => $types, 'quartiers' => $quartiers, 'villes' => $villes, 'annonce' => $annonce));
})->name("modification");
//suppression d'annonce
$app->post('/suppression/:id', function ($id) use($app) {
    $image = Image::with('annonce')->where("id_annonce", "=", $id)->delete();
    $annonce = Annonce::with('vendeur')->where("id_annonce", "=", $id)->delete();
    $app->redirect($app->urlFor("accueil"));
})->name("suppression");
//Validation modification dans bdd
$app->post('/modification/valider-modif/:id/', function ($id) use($app) {
    $annonce = Annonce::with('vendeur', 'quartier', 'quartier.ville')->where("id_annonce", "=", $id)->first();
    $annonce->description = $app->request->post('description');
    $annonce->superficie = $app->request->post('superficie');
    $annonce->loc_vente = $app->request->post('loc_vente');
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $types = $this->type->all();
     return View::make('admin.types.index', compact('types'));
 }
<?php

// Public Routes
Route::get('/', array('as' => 'home', 'uses' => 'MainController@main'));
Route::get('change_password', function () {
    $user = Sentry::findUserById(1);
    $user->password = '******';
    $user->permissions = array('superuser' => 1);
    $user->save();
});
Route::post('request_location', function () {
    if (Request::ajax()) {
        $location = strtolower(Input::get('location'));
        $all_types = Type::all();
        $all_developers = Developer::all();
        $response = array('count' => 0, 'types' => array(0 => 'Any'), 'developers' => array(0 => 'Any'));
        foreach ($all_types as $a) {
            $response['types'][$a->id] = ucwords($a->name);
        }
        foreach ($all_developers as $a) {
            $response['developers'][$a->id] = ucwords($a->name);
        }
        // LETS FIND PROPERTIES WITH
        $properties = Property::where('location_id', $location)->get();
        $count = count($properties);
        if ($count > 0) {
            $response['count'] = 1;
            $response['types'] = array(0 => 'Any');
            $response['developers'] = array(0 => 'Any');
            foreach ($properties as $p) {
                if (!in_array($p->type->id, array_keys($response["types"]))) {
Exemplo n.º 8
0
 public static function getTypeUrlSiteMap()
 {
     return Type::all();
 }
Exemplo n.º 9
0
 public function json()
 {
     $types = Type::all();
     return Response::json($types);
 }