mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Added limesurvey token of number of answering machine messages left (outcome 23 - household answering machine, message left)
This can be used in conditions to define when to leave a message
This commit is contained in:
@@ -36,6 +36,39 @@
|
||||
require_once(dirname(__FILE__).'/../../config.inc.php');
|
||||
|
||||
|
||||
/**
|
||||
* Get the number of answering messages left for this case
|
||||
*
|
||||
* @param mixed $case_id
|
||||
*
|
||||
* @return number of answering messages left
|
||||
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
||||
* @since 2010-10-18
|
||||
*/
|
||||
function get_messages_left($case_id)
|
||||
{
|
||||
$db = newADOConnection(DB_TYPE);
|
||||
$db->Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
$db->SetFetchMode(ADODB_FETCH_ASSOC);
|
||||
|
||||
|
||||
$sql = "SELECT count(*) as count
|
||||
FROM `call`
|
||||
WHERE case_id = '$case_id'
|
||||
AND outcome_id = '23'";
|
||||
|
||||
$r = $db->GetRow($sql);
|
||||
|
||||
if (!empty($r))
|
||||
{
|
||||
return $r['count'];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the percent complete a questionnaire is, or 0 if not started
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user