public function postUpdate()
 {
     $ponderacion = Ponderacion::find(Input::get('id'));
     $ponderacion->condicion_1 = Input::get('condicion_1');
     $ponderacion->condicion_2 = Input::get('condicion_2');
     $ponderacion->save();
     $clientes = Cliente::all();
     foreach ($clientes as $cliente) {
         if ($cliente->ranking()->count() > 0) {
             $ranking_cliente = RankingCliente::find($cliente->ranking->id);
             $ranking_cliente->valoracion = $ponderacion->condicion_1 * round(rand(1000, 10000000)) + $ponderacion->condicion_2 * round(rand(100, 1000000));
             $ranking_cliente->save();
         } else {
             $ranking_cliente = new RankingCliente();
             $ranking_cliente->valoracion = $ponderacion->condicion_1 * round(rand(1000, 10000000)) + $ponderacion->condicion_2 * round(rand(100, 1000000));
             $ranking_cliente->cliente_rut = $cliente->rut;
             $ranking_cliente->save();
         }
     }
     return self::getIndex();
 }
 public function getIndex()
 {
     $bills = FacturaVenta::whereStatus('En Espera')->get();
     $cotizaciones = RankingCliente::orderBy('valoracion', 'Desc')->get();
     return View::make('home_admin')->with('bills', $bills)->with('cotizaciones', $cotizaciones);
 }