Files
opensourcepos/application/controllers/person_controller.php
objecttothis d096028eb6 These commits affect the various controllers. They all have dependencies on other commits.
git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@60 c3eb156b-1dc0-44e1-88ae-e38439141b53
2013-07-05 20:07:34 +00:00

54 lines
1.3 KiB
PHP

<?php
require_once ("interfaces/iperson_controller.php");
require_once ("secure_area.php");
abstract class Person_controller extends Secure_area implements iPerson_controller
{
function __construct($module_id=null)
{
parent::__construct($module_id);
}
/*
This returns a mailto link for persons with a certain id. This is called with AJAX.
*/
function mailto()
{
$people_to_email=$this->input->post('ids');
if($people_to_email!=false)
{
$mailto_url='mailto:';
foreach($this->Person->get_multiple_info($people_to_email)->result() as $person)
{
$mailto_url.=$person->email.',';
}
//remove last comma
$mailto_url=substr($mailto_url,0,strlen($mailto_url)-1);
echo $mailto_url;
exit;
}
echo '#';
}
/** GARRISON ADDED 4/25/2013 IN PROGRESS **/
/*
Gives search suggestions based on what is being searched for
*/
function suggest()
{
$suggestions = $this->Person->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));
echo implode("\n",$suggestions);
}
/*
Gets one row for a person manage table. This is called using AJAX to update one row.
*/
function get_row()
{
$person_id = $this->input->post('row_id');
$data_row=get_person_data_row($this->Person->get_info($person_id),$this);
echo $data_row;
}
}
?>