| @@ 128-140 (lines=13) @@ | ||
| 125 | ||
| 126 | $this->validate($data); |
|
| 127 | ||
| 128 | if (empty($this->errors)) |
|
| 129 | { |
|
| 130 | // Insert the ad data to the database |
|
| 131 | $sql = 'INSERT INTO ' . $this->ads_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 132 | $this->db->sql_query($sql); |
|
| 133 | ||
| 134 | $this->success('ACP_AD_ADD_SUCCESS'); |
|
| 135 | } |
|
| 136 | else |
|
| 137 | { |
|
| 138 | $this->assign_errors(); |
|
| 139 | $this->assign_form_data($data); |
|
| 140 | } |
|
| 141 | } |
|
| 142 | ||
| 143 | // Set output vars for display in the template |
|
| @@ 169-182 (lines=14) @@ | ||
| 166 | ||
| 167 | $this->validate($data); |
|
| 168 | ||
| 169 | if (empty($this->errors)) |
|
| 170 | { |
|
| 171 | // Insert the ad data to the database |
|
| 172 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
| 173 | SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 174 | WHERE ad_id = ' . (int) $ad_id; |
|
| 175 | $this->db->sql_query($sql); |
|
| 176 | ||
| 177 | $this->success('ACP_AD_EDIT_SUCCESS'); |
|
| 178 | } |
|
| 179 | else |
|
| 180 | { |
|
| 181 | $this->assign_errors(); |
|
| 182 | } |
|
| 183 | } |
|
| 184 | else |
|
| 185 | { |
|