2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

cosmetics

This commit is contained in:
Alex
2015-12-02 02:12:58 +03:00
parent 549dfc144b
commit 946ad86fb0
3 changed files with 18 additions and 18 deletions

View File

@@ -57,9 +57,9 @@ function sRandomChars($length = 15,$pattern="23456789abcdefghijkmnpqrstuvwxyz")
for($i=0;$i<$length;$i++)
{
if(isset($key))
$key .= $pattern{mt_rand(0,$patternlength)};
$key .= $pattern{mt_rand(0,$patternlength)};
else
$key = $pattern{mt_rand(0,$patternlength)};
$key = $pattern{mt_rand(0,$patternlength)};
}
return $key;
}
@@ -354,19 +354,19 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing =
{
global $db;
$ttries = 0;
do {
$ttries = 0;
do {
$token = sRandomChars();
$sql = "SELECT count(*) as c
FROM `case`
WHERE token = '$token'";
$ttries++;
} while ($db->GetOne($sql) > 0 && $ttries < 10);
$sql = "SELECT count(*) as c
FROM `case`
WHERE token = '$token'";
$ttries++;
} while ($db->GetOne($sql) > 0 && $ttries < 10);
$sql = "INSERT INTO `case` (case_id, sample_id, questionnaire_id, last_call_id, current_operator_id, current_call_id, current_outcome_id,token)
VALUES (NULL, $sample_id, $questionnaire_id, NULL, $operator_id, NULL, '$current_outcome_id','$token')";
@@ -727,7 +727,7 @@ function get_case_id($operator_id, $create = false)
}
$r2 = $db->GetRow($sql);
if (empty($r2))
{