| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- class admin_faq_model extends Model {
-
-
- public function getBoxes() {
- $result = $this->query("select * from azonics_faq where box_status<>'0';");
- return $result;
- }
-
-
- public function loadBox() {
- $box_id = $this->escapeString($_REQUEST['id']);
- $row = $this->query("select * from azonics_faq where box_id='".$box_id."';");
- return $row[0];
- }
-
-
- public function saveBox() {
- $data = $this->escapeArray($_REQUEST);
-
- if ($data['box_id']!='') {
- $this->execute("update azonics_faq set "
- . "box_title='".$data['box_title']."', "
- . "box_subtitle='".$data['box_subtitle']."' "
- . "where box_id='".$data['box_id']."';");
-
- return true;
- }
- else {
- $this->execute("insert into azonics_faq set "
- . "box_title='".$data['box_title']."', "
- . "box_subtitle='".$data['box_subtitle']."', "
- . "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_faq set box_status='0' where box_id='".$box_id."';");
- return true;
- }
-
-
- }
|