<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;
use App\Http\Controllers\Logs;


class Indicateurs  {



	//getNB Etablissements
	static public function getNbImmat($an="") {
		if($an=="") $nb=DB::table('vehicules')->distinct('numero')->count('numero');
		else $nb=DB::table('vehicules')->where('date_emission','like',$an.'%')->distinct('numero')->count('numero');
		return $nb;
	}

	//getNB Update du jour
	static public function getDayUpdate() {
		$nb=DB::table('vehicules')->where('updated_at','like',date('Y-m-d').'%')->count('numero');
		return $nb;
	}
	//getNB Create du jour
	static public function getDayCreate() {
		$nb=DB::table('vehicules')->where('created_at','like',date('Y-m-d').'%')->count('numero');
		return $nb;
	}



}