Commit 02bb060c authored by Hamidi Ayoub's avatar Hamidi Ayoub 📈
Browse files

upload project

parent 109c07b2
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Cle extends Model
{
//
protected $fillable =['id','cleFr','cleEn'];
}
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AdministrationController extends Controller
{
//
function AjoutParamettres(Request $request){
return view('');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
<?php
namespace App\Http\Controllers;
use App\Http\Outils\ServiceRequetteur;
use App\Http\Outils\Traitement;
use App\Http\Outils\TraitementUrl;
use http\Params;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
/**
* permet d'afficher la liste des clés
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View fonction permet de retourne la vue requetteurOSM avec la liste des cles
*/
public function afficheCles(){
try {
$cles = array();
$serviceReq = new ServiceRequetteur();
$cles = $serviceReq->getListeCles();// collection
if (isset($cles)) {//$cles->isNotEmpty()
return view('listeCles')->with('cles',$cles);
} else {
return redirect('listeCles')->with('attention', "aucune cle n'existe ");
}
} catch (\Exception $e) {
return redirect('listeCles')->with('erreur', "Erreur");
}
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function affichelisteRequetes(){
try{
$requetes = array();
$cle = array();
$serviceReq = new ServiceRequetteur();
$requetes = $serviceReq->getListeRequetes();
$cles = $serviceReq->getListeCles();
//dd($requetes);
if($requetes != null){
return view('extracteurOSM')->with('requetes',$requetes);
}
else{
return view('insererRequeteAvance')->with('cles',$cles);
}
}catch (\Exception $e)
{
return redirect('extracteurOSM')->with('attention',"aucune requête");
}
}
/**
* fonction permet d'inserer une clé
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function insererCle(Request $request){
try{
$estInserer = false;
$serviceReq = new ServiceRequetteur();
$estInserer = $serviceReq->insererCle($request["cle"],$request["key"]);
if($estInserer) {
return redirect('afficheCles ')->with('ok','la clé est ajouté');
}
else{
return redirect('afficheCles ')->with('erreur','la clé existe');
}
}catch(\Exception $e)
{
return redirect('afficheCles ')->with('erreur','Erreur');
}
}
/**
* fonction permet de supprimer une clé
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function supprimerCle(Request $request){
try{
$estSupprimer = false;
$serviceReq = new ServiceRequetteur();
$estSupprimer = $serviceReq->supprimerCle($request['idCleSupp']);
$serviceReq->supprimerValeurs($request['idCleSupp']);
$serviceReq->supprimerThematiques($request['idCleSupp']);
if($estSupprimer){
return redirect('afficheCles ')->with('ok','la clé est supprimé');
}else{
return redirect('afficheCles ')->with('erreur','Erreur else');
}
}catch(\Exception $e)
{
return redirect('afficheCles ')->with('erreur','Erreur catch');
}
}
/**
* fonction permet de supprimer une requête
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function supprimerRequete(Request $request){
try{
$estSupprimer = false;
$serviceReq = new ServiceRequetteur();
$estSupprimer = $serviceReq->supprimerRequete($request["idRequete"]);
if($estSupprimer == true){
return back()->with('ok','La requête est supprimé');
}else{
return back()->with('erreur',"La requête n'est pas supprimé");
}
}
catch(\Exception $e){
return redirect('listeRequete')->with('erreur','Exception');// view listeRequete
}
}
/**
* fonction permet d'inserer une valeur pour une clé
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function insererValeur(Request $request){
try{
$estInsere = false;
$idThematique = null;
$idThematique = ($request["thematiques"] != 0 ? $request["thematiques"]:0);
$serviceReq = new ServiceRequetteur();
$estInsere = $serviceReq->insererValeur($request["valeurFr"],$request["valeurEn"],$request["idCle"],$idThematique);
if($estInsere){
return redirect('afficheCles ')->with('ok','la valeur est ajouté');
}else{
return redirect('afficheCles ')->with('erreur','la valeur existe');
}
}catch(\Exception $e){
return redirect('afficheCles ')->with('erreur','Erreur');
}
}
/**
* fonction permet de supprimer une valeur
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function supprimerValeur(Request $request){
try{
$estSupprimer = false;
$serviceReq = new ServiceRequetteur();
$estSupprimer = $serviceReq->supprimerValeur($request['idCleSupp']);
if($estSupprimer){
return back();
}else{
return back();
}
}catch(\Exception $e)
{
return back();
}
}
/**
* fonction permet de recuperer la liste des valeurs associer a une clé
* @param $idCle
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function afficheValeursCle($idCle){
try{
$valeurs = array();
$serviceReq = new ServiceRequetteur();
$valeurs = $serviceReq->getListeValeursCle($idCle);
if (isset($valeurs)) {//$cles->isNotEmpty()
return view('listeValeurs')->with('valeurs',$valeurs);
} else {
return redirect('afficheCles')->with('attention', "aucune valeurs n'existe ");
}
}catch(\Exception $e){
return redirect('afficheCles')->with('Erreur', "Erreur");
}
}
/**
* fonction permet de generer une liste déroulonte avec les valeurs d'une clé
* @param $idCle
* @return string
*/
public function creerListeValeur($idCle){
try{
$valeurs = array();
$select = " ";
$serviceReq = new ServiceRequetteur();
$valeurs = $serviceReq->getListeValeursCle($idCle);
if(isset($valeurs)){
$select .= "<select class='form-control' id='valeurs' name='valeurs' onchange='ajouteValeur()' required> ";
$select .="<option value='0'>Choisir une valeur</option>";
foreach ($valeurs as $valeur)
{
$select .= " <option value='$valeur->id'>$valeur->valeurFr</option>";
}
$select .= "</select>";
return $select;
}
else{
return "<label style='color:red'>Clé sans valeur</label>";
}
}
catch(\Exception $e){
return ":///";
}
}
/**
* fonction permet l'ajoute d'une thematique
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function insererThematique(Request $request){
try{
$estInsere = false;
$serviceReq = new ServiceRequetteur();
$estInsere = $serviceReq->insererThematique($request["thematiqueFr"],$request["thematiqueEn"],$request["idCleThematique"]);
if($estInsere){
return redirect('afficheCles ')->with('ok','la thématique est ajouté');
}else{
return redirect('afficheCles ')->with('erreur','la thématique existe');
}
}catch(\Exception $e){
return redirect('afficheCles ')->with('erreur','Erreurs');
}
}
/**
* Fonction permet de retourn une liste deroulante des thematique
* @return string
*/
public function creerListeThematique($id)
{
try{
$select = " ";