1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once("Secure_Controller.php");
abstract class Persons extends Secure_Controller
{
public function __construct($module_id = NULL)
{
parent::__construct($module_id);
}
public function index()
{
$data['table_headers'] = $this->xss_clean(get_people_manage_table_headers());
$this->load->view('people/manage', $data);
}
public function suggest()
{
$suggestions = $this->xss_clean($this->Person->get_search_suggestions($this->input->post('term')));
echo json_encode($suggestions);
}
public function get_row($row_id)
{
$data_row = $this->xss_clean(get_person_data_row($this->Person->get_info($row_id), $this));
echo json_encode($data_row);
}
protected function nameize($str, $a_char = array("'", "-", " "))
{
$string = strtolower($str);
foreach($a_char as $temp)
{
$pos = strpos($string, $temp);
if($pos)
{
$mend = '';
$a_split = explode($temp, $string);
foreach($a_split as $temp2)
{
$mend .= ucfirst($temp2).$temp;
}
$string = substr($mend, 0, -1);
}
}
return ucfirst($string);
}
}
?>