Code Duplication    Length = 21-23 lines in 2 locations

src/filters/create.php 1 location

@@ 388-408 (lines=21) @@
385
{
386
    // generate list of states
387
388
    if ($template_id != 0)
389
    {
390
        $xml .= '<group title="' . get_html_resource(RES_STATES_ID) . '">'
391
              . '<control name="states[]">'
392
              . '<listbox size="10">';
393
394
        $rs = dal_query('states/list.sql', $template_id, 'state_name');
395
396
        while (($row = $rs->fetch()))
397
        {
398
            $xml .= (isset($states) && in_array($row['state_id'], $states)
399
                        ? '<listitem value="' . $row['state_id'] . '" selected="true">'
400
                        : '<listitem value="' . $row['state_id'] . '">')
401
                  . ustr2html($row['state_name'])
402
                  . '</listitem>';
403
        }
404
405
        $xml .= '</listbox>'
406
              . '</control>'
407
              . '</group>';
408
    }
409
410
    // generate list of submitters
411

src/filters/modify.php 1 location

@@ 351-373 (lines=23) @@
348
349
// generate list of states
350
351
if ($template_id != 0)
352
{
353
    $states = filter_states_get($id, $template_id);
354
355
    $xml .= '<group title="' . get_html_resource(RES_STATES_ID) . '">'
356
          . '<control name="states[]">'
357
          . '<listbox size="10">';
358
359
    $rs = dal_query('states/list.sql', $template_id, 'state_name');
360
361
    while (($row = $rs->fetch()))
362
    {
363
        $xml .= (in_array($row['state_id'], $states)
364
                    ? '<listitem value="' . $row['state_id'] . '" selected="true">'
365
                    : '<listitem value="' . $row['state_id'] . '">')
366
              . ustr2html($row['state_name'])
367
              . '</listitem>';
368
    }
369
370
    $xml .= '</listbox>'
371
          . '</control>'
372
          . '</group>';
373
}
374
375
// generate list of submitters
376