<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

	public function index()
	{

/*
<a href="/lang/turkish">Türkçe</a>
*/		
$grup_sayi=genel::mice_gruplar();
//print_r($grup_sayi);
/*
if(count($grup_sayi)>0){
}*/
redirect("/groups");	


		$this->lang->load('information',$this->session->userdata('site_lang'));
		$this->load->view('welcome_message');
	}


public function tc_kontrol(){



/*
$tckimlik=$_POST["tckimlik"];
$isim=(string) $_POST["isim"];
$soyisim=(string) $_POST["soyisim"];
$dogumyili=(int) $_POST["dogum_yili"];
*/
/*
$tckimlik=15316570154;
$isim="ediz";
$soyisim="nural";
$dogumyili=1981;
*/
/*
$client = new SoapClient('https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL', array('trace' => 1));
//var_dump($client->__getFunctions());

try {

$parameters=array("TCKimlikNo"=>$tckimlik,
                  "Ad"=>tckontrol_degistir($isim),
                  "Soyad"=>tckontrol_degistir($soyisim),
                  "DogumYili"=>$dogumyili);

print_r($parameters);
$values = $client->TCKimlikNoDogrula($parameters);
//$sonuc=$values->LoginResult;
$sonuc["success"]=1;
$sonuc["description"]="";
$sonuc["result"]=$values->TCKimlikNoDogrulaResult;
echo json_encode($sonuc);
}

catch(Exception $e) {
  

$sonuc["success"]=0;
$sonuc["description"]=$e->getMessage();
$sonuc["result"]=false;
echo json_encode($sonuc);

}
*/


$bilgiler = array(
"isim"      => genel::tckontrol_degistir(trim($_POST["isim"])),
"soyisim"   => genel::tckontrol_degistir(trim($_POST["soyisim"])),
"dogumyili" =>trim($_POST["dogum_yili"]),
"tcno"      => trim($_POST["tckimlik"])
);
$sonuc = genel::tcno_dogrula($bilgiler);

if($sonuc=="true"){
$son_sonuc=true;
}else{
$son_sonuc=false;
}

$sonucum["success"]=1;
$sonucum["description"]="";
$sonucum["result"]=$son_sonuc;
echo json_encode($sonucum);
	
}

}
