Code Duplication    Length = 8-8 lines in 5 locations

src/records/create.php 5 locations

@@ 101-108 (lines=8) @@
98
    $project_id     = $record['project_id'];
99
    $template_id    = $record['template_id'];
100
101
    if (DATABASE_DRIVER == DRIVER_ORACLE9)
102
    {
103
        $rs = dal_query('records/oracle/tfndid.sql', $_SESSION[VAR_USERID], $project_id, $template_id);
104
    }
105
    else
106
    {
107
        $rs = dal_query('records/tfndid.sql', $_SESSION[VAR_USERID], $project_id, $template_id);
108
    }
109
110
    if ($rs->rows == 0)
111
    {
@@ 138-145 (lines=8) @@
135
136
    $project_id = ustr2int(try_request('project'));
137
138
    if (DATABASE_DRIVER == DRIVER_ORACLE9)
139
    {
140
        $rs = dal_query('records/oracle/pfndid.sql', $_SESSION[VAR_USERID], $project_id);
141
    }
142
    else
143
    {
144
        $rs = dal_query('records/pfndid.sql', $_SESSION[VAR_USERID], $project_id);
145
    }
146
147
    if ($rs->rows == 0)
148
    {
@@ 172-179 (lines=8) @@
169
    $project_id     = ustr2int(try_request('project'));
170
    $template_id    = ustr2int(try_request('template'));
171
172
    if (DATABASE_DRIVER == DRIVER_ORACLE9)
173
    {
174
        $rs = dal_query('records/oracle/tfndid.sql', $_SESSION[VAR_USERID], $project_id, $template_id);
175
    }
176
    else
177
    {
178
        $rs = dal_query('records/tfndid.sql', $_SESSION[VAR_USERID], $project_id, $template_id);
179
    }
180
181
    if ($rs->rows == 0)
182
    {
@@ 211-218 (lines=8) @@
208
    $project_id  = ustr2int(try_request('project'));
209
    $template_id = ustr2int(try_request('template'));
210
211
    if (DATABASE_DRIVER == DRIVER_ORACLE9)
212
    {
213
        $rs = dal_query('records/oracle/tfndid.sql', $_SESSION[VAR_USERID], $project_id, $template_id);
214
    }
215
    else
216
    {
217
        $rs = dal_query('records/tfndid.sql', $_SESSION[VAR_USERID], $project_id, $template_id);
218
    }
219
220
    if ($rs->rows == 0)
221
    {
@@ 430-437 (lines=8) @@
427
              . '<label>' . get_html_resource(RES_TEMPLATE_ID) . '</label>'
428
              . '<combobox>';
429
430
        if (DATABASE_DRIVER == DRIVER_ORACLE9)
431
        {
432
            $rs = dal_query('records/oracle/tlist.sql', $_SESSION[VAR_USERID], $project_id);
433
        }
434
        else
435
        {
436
            $rs = dal_query('records/tlist.sql', $_SESSION[VAR_USERID], $project_id);
437
        }
438
439
        if ($rs->rows == 1)
440
        {