<?php namespace Pratik\Controllers;

use CodeIgniter\Controller;
use Pratik\Config\Users_Config;
use Pratik\Models\Pratik_Model;

class Dashboard extends Controller
{
	public $data = array();
	public $model = array();
    function __construct()
	{

        $this->model = new Pratik_Model();
        $this->session = \Config\Services::session();
		$this->request = \Config\Services::request();
    }
	public function index()
	{	
		$id =  $this->request->getPostget('id');
		$elements = new Users_Config();
		$model = new Pratik_Model();
		//$model->setupTable('users',$elements->basic);
		//$model->saveBasic('users',array('id'=>0,'name'=>'yeni 215>hmet'), $elements->basic );

		//$model->saveMetas(1, 'users',array('yetki'=>10,'resim'=>'yeni 215>hmet','level'=>array('A1','b1','x1')), $elements->metas );
		$this->data['basic'] = $model->getBasic('users', $id, $elements->basic,'',true );
		if($id==0)
		{
			$this->data['basic']['name']['val']=t_('Yeni Kayıt');
			
		}
		$this->data['metas']= $result = $model->getMetas(2, 'users', "",$elements->metas, 'tr_TR', 'meta', true, false);
		$this->data['page_title']='Kullanıcılar';
		$this->data['menu']=array('dash_board');
		return view('Admin\index', array('data'=>$this->data));
	}

	//--------------------------------------------------------------------

}
