From ce0d06f3de965c08b5be5c48735052b7593f8838 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 24 Feb 2015 02:13:24 +0300 Subject: [PATCH] Old bug forgotten to post much earlier: "312345678" is not good for replacement as could be a valid number (depending on prefixes and dial codes) filter phone number>0 because 0 is NOT NULL too --- functions/functions.operator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/functions.operator.php b/functions/functions.operator.php index 1b223c5c..77b361e6 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -383,6 +383,7 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = $sql = "SELECT val as phone FROM sample_var WHERE sample_id = '$sample_id' + AND val > 0 AND val is NOT NULL AND val != \"\" AND (`type` = 2 or `type` = 3) @@ -396,7 +397,7 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = foreach ($r5 as $r5v) { $tnum = preg_replace("/[^0-9]/", "",$r5v['phone']); - if (empty($tnum)) $tnum = "312345678"; //handle error condition + if (empty($tnum)) $tnum = "88888888"; //handle error condition $sql = "INSERT INTO contact_phone (case_id,priority,phone,description) VALUES ($case_id,$i,$tnum,'')"; $db->Execute($sql); @@ -406,7 +407,7 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = else { $sql = "INSERT INTO contact_phone (case_id,priority,phone,description) - VALUES ($case_id,1,312345678,'test only')"; + VALUES ($case_id,1,88888888,'test only')"; $db->Execute($sql); }