Code Duplication    Length = 16-16 lines in 2 locations

class/dbupdater.php 1 location

@@ 141-156 (lines=16) @@
138
     * @return bool true if success, false if an error occured
139
     *
140
     */
141
    public function addData()
142
    {
143
        global $xoopsDB;
144
145
        foreach ($this->getData() as $data) {
146
            $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data);
147
            $ret   = $xoopsDB->query($query);
148
            if (!$ret) {
149
                echo "<li class='err'>" . sprintf(_AM_SPARTNER_DB_MSG_ADD_DATA_ERR, $this->name()) . '</li>';
150
            } else {
151
                echo "<li class='ok'>" . sprintf(_AM_SPARTNER_DB_MSG_ADD_DATA, $this->name()) . '</li>';
152
            }
153
        }
154
155
        return $ret;
156
    }
157
158
    /**
159
     * Add a field to be added

class/smartdbupdater.php 1 location

@@ 230-245 (lines=16) @@
227
     * @return bool true if success, false if an error occured
228
     *
229
     */
230
    public function addData()
231
    {
232
        global $xoopsDB;
233
234
        foreach ($this->getData() as $data) {
235
            $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data);
236
            $ret   = $xoopsDB->query($query);
237
            if (!$ret) {
238
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>';
239
            } else {
240
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>';
241
            }
242
        }
243
244
        return $ret;
245
    }
246
247
    /**
248
     * Add a field to be added