| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- class admin_blocks_model extends Model {
-
-
- public function getBoxes() {
- $result = $this->query("select * from azonics_blocks where box_status<>'0';");
- return $result;
- }
-
-
- public function loadBox() {
- $box_id = $this->escapeString($_REQUEST['id']);
- $row = $this->query("select * from azonics_blocks where box_id='".$box_id."';");
- return $row[0];
- }
-
-
- public function saveBox() {
- $data = $this->escapeArray($_REQUEST);
-
- if ($data['box_id']!='') {
- $this->execute("update azonics_blocks set "
- . "box_title='".$data['box_title']."', "
- . "box_subtitle='".$data['box_subtitle']."', "
- . "box_slug='".$data['box_slug']."' "
- . "where box_id='".$data['box_id']."';");
-
- return true;
- }
- else {
- $this->execute("insert into azonics_blocks set "
- . "box_title='".$data['box_title']."', "
- . "box_subtitle='".$data['box_subtitle']."', "
- . "box_slug='".$data['box_slug']."', "
- . "box_status='1', "
- . "box_user='".$_SESSION['admin_user']->admin_id."';");
- return true;
- }
- }
-
-
- public function deleteBox() {
- $box_id = $this->escapeString($_REQUEST['id']);
- $this->execute("update azonics_blocks set box_status='0' where box_id='".$box_id."';");
- return true;
- }
-
-
- }
|