<?php namespace App\Http\Controllers;

use App\Models\Repadministrativodetusuarios;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Validator, Input, Redirect ; 
use Illuminate\Support\Facades\Auth;

class RepadministrativodetusuariosController extends Controller {

	protected $layout = "layouts.main";
	protected $data = array();	
	public $module = 'repadministrativodetusuarios';
	static $per_page	= '10';

	public function __construct()
	{
		parent::__construct();
		$this->model = new Repadministrativodetusuarios();
		$this->info = $this->model->makeInfo( $this->module);
		$this->access = array();
	
		$this->data = array_merge(array(
			'pageTitle'	=> 	$this->info['title'],
			'pageNote'	=>  $this->info['note'],
			'pageModule'=> 'repadministrativodetusuarios',
			'return'	=> self::returnUrl()
			
		),$this->data);

		
	}

	public function index( Request $request )
	{		
	    
	      $id = Auth::id();

		$dbcon = 0;
		$sql = \DB::table('tb_users')->where('id',$id)->get();
		if(count($sql)){
			$row = $sql[0];
			$dbname =$row->dbname;
		
		}	
	    
	    
	 if($dbname== 'tempdpe5_gomezduran'){    
	    
	    
		return view('repadministrativodetusuarios.indexgodur',$this->data);
		
		
	 }else{   
	     
	     return view('repadministrativodetusuarios.index',$this->data);
	     
	 }	
		
		
		
	}
	function show(Request $request, $id = null)
	{
		return view('repadministrativodetusuarios.view',$this->data);
	}	
	public function create( $id = null)
	{		
		return view('repadministrativodetusuarios.form',$this->data);	
	}	
	public function edit( $id = null)
	{		
		return view('repadministrativodetusuarios.form',$this->data);	
	}	
	function store( Request $request)
	{		
	
	}
	public function destroy( Request $request)
	{
		
		
	}			


}