Code Duplication    Length = 13-16 lines in 2 locations

controller/admin_controller.php 2 locations

@@ 190-202 (lines=13) @@
187
		{
188
			$data = $this->get_form_data('phpbb/admanagement/add');
189
190
			if ($preview)
191
			{
192
				$this->ad_preview($data['ad_code']);
193
			}
194
			else if (empty($this->errors))
195
			{
196
				$ad_id = $this->manager->insert_ad($data);
197
				$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
198
199
				$this->log('ADD', $data['ad_name']);
200
201
				$this->success('ACP_AD_ADD_SUCCESS');
202
			}
203
204
			$this->assign_locations($data);
205
			$this->assign_form_data($data);
@@ 240-255 (lines=16) @@
237
			{
238
				$this->ad_preview($data['ad_code']);
239
			}
240
			else if (empty($this->errors))
241
			{
242
				$success = $this->manager->update_ad($ad_id, $data);
243
244
				if ($success)
245
				{
246
					// Only insert new ad locations to DB when ad exists
247
					$this->manager->delete_ad_locations($ad_id);
248
					$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
249
250
					$this->log('EDIT', $data['ad_name']);
251
252
					$this->success('ACP_AD_EDIT_SUCCESS');
253
				}
254
				$this->error('ACP_AD_DOES_NOT_EXIST');
255
			}
256
		}
257
		else
258
		{