1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<?php
class SociController extends BaseController {
public function soci()
{
//$associazione = Associazione::all();
//$target = Associazione::where('url','=',$sub);
return View::make('soci');
//->with('associazione',$associazione)
//->with('target',$target);
}
public function tutti()
{
/*$associati = Sedi::leftJoin('province_regioni', 'anagraficabroker.provincia', '=', 'province_regioni.sigla')
->where('province_regioni.regione','=','Lazio')
//->where('estinto','=',0)
//->where('f_associato','=',1)
->orderBy('nome')->get();*/
$associati = Sedi::where('tipo_sede','!=','1')->first();
echo '<pre>';
print_r($associati);
echo '</pre>';
return;
}
public function regione($regione)
{
$associati = Sedi::leftJoin('province_regioni', 'anagraficabroker.provincia', '=', 'province_regioni.sigla')
->where('province_regioni.regione','=',$regione)
->where('estinto','=',0)
->where('f_associato','=',1)
->orderBy('nome')->get();
return View::make('soci.regione')
->with('associati',$associati);
}
public function scheda($id)
{
$associato = Sedi::where('id','=',$id)->first();
return View::make('soci.scheda')
->with('associato',$associato);
}
public function cerca()
{
$nome = Input::get('nome');
$associati = Sedi::where('nome', 'LIKE', "%$nome%")
->where('estinto','=',0)
->where('f_associato','=',1)
->get();
return View::make('soci.cerca')
->with('associati',$associati);
}
}
|