Example #1
0
 function Contest_UpdateRecievedGroupUsed_Iterator($id = -1, $name, $table)
 {
     if ($id < 0) {
         $id = $_SESSION['WT_contest_id'];
     }
     $list = new CVCAppendingList();
     $list->Init($name);
     $list->SetItems($groups);
     $list->ReceiveItemsUsed();
     $glist = $list->GetItemsUsed();
     $n = count($glist);
     db_delete($table, "`contest_id`={$id}");
     for ($i = 0; $i < $n; $i++) {
         $gid = $glist[$i];
         if (db_count($table, "`contest_id`={$id} AND `group_id`={$gid}") > 0) {
             continue;
         }
         db_insert($table, array('contest_id' => $id, 'group_id' => $gid));
     }
 }