<?php

namespace App\Http\Controllers;
use Auth;
use DB;
use Illuminate\Http\Request;
use Validator;
use App\Http\Model\ModuleModel;

class DeveloperController extends Controller
{
	public function __construct()
    {
        $this->Mod = new ModuleModel;
       
    }
	public function Modules()
    { 
	    $data['Mod']=DB::table('modules')->get();
    	return view('modules',compact('data'));
    }
	public function CreateModule()
    { 
	    return view('Createmodules');
	   // return view('customerView');
    }
	public function createMod(Request $request)
    { 
	    $data['Val1']=$request->input('text-input1');
	    $data['Val2']=$request->input('text-input2');
	    $data['Val3']=$request->input('text-input3');
	    $data['Val4']=$request->input('text-input4');
		return $id=$this->Mod->createMod($data);
    }	

	public function permission()
    {
		$data['permission']=$this->Mod->permission();
    	return view('permission',compact('data'));
    }
	public function Viewpermision(Request $request)
    {
		$data['val']=$request->input('val');
		$data['Pid']=$request->input('Pid');
		return $id=$this->Mod->Viewpermision($data);
    }
	public function Crreatepermision(Request $request)
    {
		$data['val']=$request->input('val');
		$data['Pid']=$request->input('Pid');
		return $id=$this->Mod->Crreatepermision($data);
    }
	public function Editpermision(Request $request)
    {
		$data['val']=$request->input('val');
		$data['Pid']=$request->input('Pid');
		return $id=$this->Mod->Editpermision($data);
    }
	public function Deletepermision(Request $request)
    {
		$data['val']=$request->input('val');
		$data['Pid']=$request->input('Pid');
		return $id=$this->Mod->Deletepermision($data);
    }
	public function designat()
    {
		$data['UserType']=DB::table('ut_usertype')->get();
    	return view('usertype',compact('data'));
    }
	
}
