Code Duplication    Length = 10-12 lines in 2 locations

ad/manager.php 2 locations

@@ 151-160 (lines=10) @@
148
	 * @param    array $ad_ids IDs of ads to increment views
149
	 * @return    void
150
	 */
151
	public function increment_ads_views($ad_ids)
152
	{
153
		if (!empty($ad_ids))
154
		{
155
			$sql = 'UPDATE ' . $this->ads_table . '
156
				SET ad_views = ad_views + 1
157
				WHERE ' . $this->db->sql_in_set('ad_id', $ad_ids);
158
			$this->db->sql_query($sql);
159
		}
160
	}
161
162
	/**
163
	 * Increment clicks for specified ad
@@ 264-275 (lines=12) @@
261
	 * @param    array $user_ids User IDs
262
	 * @return    void
263
	 */
264
	public function remove_ad_owner(array $user_ids)
265
	{
266
		if (empty($user_ids))
267
		{
268
			return;
269
		}
270
271
		$sql = 'UPDATE ' . $this->ads_table . '
272
			SET ad_owner = 0
273
			WHERE ' . $this->db->sql_in_set('ad_owner', $user_ids);
274
		$this->db->sql_query($sql);
275
	}
276
277
	/**
278
	 * Get all locations for specified advertisement