<commit_before><?php namespace App\Http\Controllers;

use Illuminate\Support\Facades\Input;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;
use Auth;


class PengaturanController extends Controller {

	public function __construct()
	{
		$this->middleware('auth');
	}
	public function koperasi()
	{
		$data = \App\Koperasi::find(Auth::user()->assigned_koperasi);
		return view('pengaturan.koperasi')->withData($data);
	}

	public function save_koperasi()
	{
		$new = \App\Koperasi::find(Auth::user()->assigned_koperasi);	
		$new->nama = Input::get('nama');		
		$new->email = Input::get('email');		
		$new->no_telp = Input::get('no_telp');	
		$new->no_fax = Input::get('no_fax');	
		$new->alamat = Input::get('alamat');	
		$new->rtrw = Input::get('rtrw');	
		$new->kel = Input::get('kel');	
		$new->kec = Input::get('kec');	
		$new->kabkota = Input::get('kabkota');	
		$new->prov = Input::get('prov');	
		$new->kodepos = Input::get('kodepos');	
		$new->negara = Input::get('negara');	
		if(Input::hasFile('logo')){
			$logo = date("YmdHis")
			.uniqid()
			."."
			.Input::file('logo')->getClientOriginalExtension();

			Input::file('logo')->move(storage_path("images"),$logo);
			$new->logo = $logo;
		}
		$new->save();

		return redirect(url('anggota'));
	}

	public function index()
	{
		$data = \App\User::paginate(20);
		return view('pengaturan.allpengurus')->withData($data);
	}

	/**<commit_msg>update link<commit_after><?php namespace App\Http\Controllers;

use Illuminate\Support\Facades\Input;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;
use Auth;


class PengaturanController extends Controller {

	public function __construct()
	{
		$this->middleware('auth');
	}
	public function koperasi()
	{
		$data = \App\Koperasi::find(Auth::user()->assigned_koperasi);
		return view('pengaturan.koperasi')->withData($data);
	}

	public function save_koperasi()
	{
		$new = \App\Koperasi::find(Auth::user()->assigned_koperasi);	
		$new->nama = Input::get('nama');		
		$new->email = Input::get('email');		
		$new->no_telp = Input::get('no_telp');	
		$new->no_fax = Input::get('no_fax');	
		$new->alamat = Input::get('alamat');	
		$new->rtrw = Input::get('rtrw');	
		$new->kel = Input::get('kel');	
		$new->kec = Input::get('kec');	
		$new->kabkota = Input::get('kabkota');	
		$new->prov = Input::get('prov');	
		$new->kodepos = Input::get('kodepos');	
		$new->negara = Input::get('negara');	
		if(Input::hasFile('logo')){
			$logo = date("YmdHis")
			.uniqid()
			."."
			.Input::file('logo')->getClientOriginalExtension();

			Input::file('logo')->move(storage_path("images"),$logo);
			$new->logo = $logo;
		}
		$new->save();

		return redirect(url('pengaturan/koperasi'));
	}

	public function index()
	{
		$data = \App\User::paginate(20);
		return view('pengaturan.allpengurus')->withData($data);
	}

	/**
{'fraction_non_alphanumeric': 0.2180373185901866, 'fraction_numerical': 0.00138217000691085, 'mean_word_length': 4.778443113772455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4033238', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1110, 'n_words': 151}