<commit_before><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Defunti extends MY_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->model('model_defunti');
		$this->load->model('model_persone');
		$this->load->model('model_cappella_gentilizia');
		$this->load->library('fkms');
		$this->data['breadcrumb']['Home'] = site_url('home');
		$this->data['breadcrumb']['Defunti'] = site_url('defunti');
	}

	public function index(){
		$this->data['title'] = 'Defunti';
		$this->data['breadcrumb'][$this->data['title']] = '';
		$this->load->view('heading/view_head', $this->data);
		$this->load->view('pages/view_defunti');
		$this->load->view('heading/view_footer');
	}

	public function nuovo_defunto($idDefunto = 0){
		if($idDefunto != 0){
			$query = array('id_defunto' => $idDefunto);
			$result = $this->model_defunti->cercaDefuntiResult($query);
			if(!isset($result[0])){
				die('ERRORE: Persona inesistente.');
			}
			$result = $result[0]; //prendo la prima ed unica riga
			$result['data_nascita'] = $this->sqlToDate($result['data_nascita']);
			$result['data_professione'] = $this->sqlToDate($result['data_professione']);
			$result['data_decesso'] = $this->sqlToDate($result['data_decesso']);
			$result['data_sepoltura'] = $this->sqlToDate($result['data_inizio_sepoltura']);
			//conversione in modo da tener conto dell'id del modal celletta
			$result['id_celletta0'] = $result['id_celletta'];
			if($result['id_celletta'] == 0){
				$result['celletta_description0'] = '';
			}else{
				$result['celletta_description0'] = $result['celletta_description']; 
			}
			// dati responsabile
			$result['id_persona0'] = $result['id_responsabile'];
			if($result['id_responsabile'] == 0){
				$result["responsabile_description"] = '';
			}else{
				$result["responsabile_description"] = $result["cognome_responsabile"] . " " . $result["nome_responsabile"];
			}
			$result['data_inizio_responsabilita'] = $this->sqlToDate($result['data_inizio_responsabilita']);<commit_msg>Fix wrong reference to responsible id<commit_after><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Defunti extends MY_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->model('model_defunti');
		$this->load->model('model_persone');
		$this->load->model('model_cappella_gentilizia');
		$this->load->library('fkms');
		$this->data['breadcrumb']['Home'] = site_url('home');
		$this->data['breadcrumb']['Defunti'] = site_url('defunti');
	}

	public function index(){
		$this->data['title'] = 'Defunti';
		$this->data['breadcrumb'][$this->data['title']] = '';
		$this->load->view('heading/view_head', $this->data);
		$this->load->view('pages/view_defunti');
		$this->load->view('heading/view_footer');
	}

	public function nuovo_defunto($idDefunto = 0){
		if($idDefunto != 0){
			$query = array('id_defunto' => $idDefunto);
			$result = $this->model_defunti->cercaDefuntiResult($query);
			if(!isset($result[0])){
				die('ERRORE: Persona inesistente.');
			}
			$result = $result[0]; //prendo la prima ed unica riga
			$result['data_nascita'] = $this->sqlToDate($result['data_nascita']);
			$result['data_professione'] = $this->sqlToDate($result['data_professione']);
			$result['data_decesso'] = $this->sqlToDate($result['data_decesso']);
			$result['data_sepoltura'] = $this->sqlToDate($result['data_inizio_sepoltura']);
			//conversione in modo da tener conto dell'id del modal celletta
			$result['id_celletta0'] = $result['id_celletta'];
			if($result['id_celletta'] == 0){
				$result['celletta_description0'] = '';
			}else{
				$result['celletta_description0'] = $result['celletta_description']; 
			}
			// dati responsabile
			$result['id-persona0'] = $result['id_responsabile'];
			if($result['id_responsabile'] == 0){
				$result["responsabile_description"] = '';
			}else{
				$result["responsabile_description"] = $result["cognome_responsabile"] . " " . $result["nome_responsabile"];
			}
			$result['data_inizio_responsabilita'] = $this->sqlToDate($result['data_inizio_responsabilita']);
{'fraction_non_alphanumeric': 0.20510948905109488, 'fraction_numerical': 0.004866180048661801, 'mean_word_length': 6.027350427350427, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '4822177', 'n_tokens_mistral': 1582, 'n_tokens_neox': 1457, 'n_words': 196}