From 6bc4df1b688ef5893fce6f0970a1eb2c33334f89 Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Tue, 18 Nov 2008 23:03:55 +0000 Subject: [PATCH] Will create a respondent even if no firstName or lastName is given --- functions/functions.operator.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions/functions.operator.php b/functions/functions.operator.php index d1a296ba..d53a696e 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -405,11 +405,9 @@ function get_case_id($operator_id, $create = true) $sql = "INSERT INTO respondent (case_id,firstName,lastName,Time_zone_name) SELECT $case_id as case_id, s1.val as firstName, s2.val as lastName, s3.Time_zone_name as Time_zone_name - FROM sample_var as s1 + FROM sample as s3 LEFT JOIN sample_var as s2 on (s2.sample_id = '{$r3['sample_id']}' and s2.type = 7) - LEFT JOIN sample as s3 on (s3.sample_id = '{$r3['sample_id']}') - WHERE s1.sample_id = '{$r3['sample_id']}' and s1.type = 6 - AND (s1.val IS NOT NULL AND s2.val IS NOT NULL)"; + LEFT JOIN sample_var as s1 on (s1.sample_id = '{$r3['sample_id']}' and s1.type = 6) WHERE s3.sample_id = '{$r3['sample_id']}'"; $db->Execute($sql);