| @@ 126-133 (lines=8) @@ | ||
| 123 | ||
| 124 | $this->validate($data); |
|
| 125 | ||
| 126 | if (empty($this->errors)) |
|
| 127 | { |
|
| 128 | // Insert the ad data to the database |
|
| 129 | $sql = 'INSERT INTO ' . $this->ads_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 130 | $this->db->sql_query($sql); |
|
| 131 | ||
| 132 | $this->success('ACP_AD_ADD_SUCCESS'); |
|
| 133 | } |
|
| 134 | ||
| 135 | $this->assign_form_data($data); |
|
| 136 | } |
|
| @@ 163-172 (lines=10) @@ | ||
| 160 | ||
| 161 | $this->validate($data); |
|
| 162 | ||
| 163 | if (empty($this->errors)) |
|
| 164 | { |
|
| 165 | // Insert the ad data to the database |
|
| 166 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
| 167 | SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 168 | WHERE ad_id = ' . (int) $ad_id; |
|
| 169 | $this->db->sql_query($sql); |
|
| 170 | ||
| 171 | $this->success('ACP_AD_EDIT_SUCCESS'); |
|
| 172 | } |
|
| 173 | } |
|
| 174 | else |
|
| 175 | { |
|