| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- class admin_seo_model extends Model {
-
-
- public function getSeo() {
- $result = $this->query("select * from rock_seo where seo_url<>'';");
- return $result;
- }
-
-
- public function loadSeo() {
- $seo_id = $this->escapeString($_REQUEST['id']);
- $row = $this->query("select * from rock_seo where seo_id='".$seo_id."';");
- return $row[0];
- }
-
-
- public function saveSeo() {
- $data = $this->escapeArray($_REQUEST);
-
- if ($data['seo_id']!='') {
- $this->execute("update rock_seo set "
- . "seo_url='".$data['seo_url']."', "
- . "seo_title='".$data['seo_title']."', "
- . "seo_keywords='".$data['seo_keywords']."', "
- . "seo_description='".$data['seo_description']."' "
- . "where seo_id='".$data['seo_id']."';");
-
- return true;
- }
- else {
- $this->execute("insert into rock_seo set "
- . "seo_url='".$data['seo_url']."', "
- . "seo_title='".$data['seo_title']."', "
- . "seo_keywords='".$data['seo_keywords']."', "
- . "seo_description='".$data['seo_description']."';");
- return true;
- }
- }
-
-
- public function deleteSeo() {
- $seo_id = $this->escapeString($_REQUEST['id']);
- $this->execute("delete from rock_seo where seo_id='".$seo_id."';");
- return true;
- }
-
-
- }
|