Пример #1
0
 public function delete_brand($id)
 {
     parent::model('delete');
     $this->db->table($this->db_table);
     $this->db->where('id = "' . $id . '"');
     return $this->db->build();
 }
Пример #2
0
 public function multilevel_menu($id = '')
 {
     $where_clause = '';
     if (strlen($id) > 0) {
         $where_clause = 'parent="' . $id . '"';
     }
     $query = parent::sql_query('select', $this->db_table, '', $where_clause);
     $num = parent::sql_query_exec('num_rows', $query);
     $i = 0;
     $data = '';
     while ($pcat = parent::sql_query_exec('fetch_array', $query)) {
         $pcat_name = strtolower(preg_replace('/\\s/', '_', $pcat['name']));
         $url = 'product-category-' . $pcat['id'] . '-' . $pcat_name . '.html';
         if ($i == 0) {
             if ($pcat['parent'] == 0) {
                 $data = '<ul>';
             } else {
                 $data = '<div><ul>';
             }
         }
         $i++;
         $data .= '<li><a href="' . $url . '">' . strtoupper($pcat['name']) . '</a>';
         $data .= $this->get_multilevel($pcat['id']);
         $data .= '</li>';
         if ($i == $num) {
             if ($pcat['parent'] == 0) {
                 $data .= '</ul>';
             } else {
                 $data .= '</ul></div>';
             }
         }
     }
     return $data;
 }
Пример #3
0
 public function update_profile($id)
 {
     parent::model('update');
     $date = date("Y-m-d") . ' ' . date("H:i:s", time());
     $data = array('site_name' => $_POST['site_name'], 'site_author' => $_POST['site_author'], 'site_slogan' => $_POST['site_slogan'], 'site_footer' => $_POST['site_footer'], 'site_meta_desc' => $_POST['site_meta_desc'], 'site_meta_key' => $_POST['site_meta_key'], 'site_status' => $_POST['site_status'], 'offline_message' => $_POST['offline_message'], 'date_updated' => $date);
     $this->db->table($this->db_table);
     $this->db->update($data);
     $this->db->where('id = "' . $id . '"');
     return $this->db->build();
 }
Пример #4
0
 public function get_all_msg()
 {
     parent::model('select');
     $this->db->select();
     $this->db->table($this->db_table);
     $query = $this->db->build();
     while ($menu = $this->db->fetch_array($query)) {
         $data[] = array('id' => $menu['id'], 'name' => $menu['name'], 'parent' => $menu['parent'], 'level' => $menu['level'], 'type' => $menu['type'], 'link' => $menu['link']);
     }
     return $data;
 }
Пример #5
0
 public function delete_review($mode = '', $id)
 {
     parent::model('delete');
     $this->db->table('product_review');
     if ($mode == 'parent') {
         $this->db->where('id = "' . $id . '"');
     } else {
         if ($mode == 'child') {
             $this->db->where('reply_to = "' . $id . '"');
         } else {
             if ($mode == 'product') {
                 $this->db->where('id_product = "' . $id . '"');
             }
         }
     }
     return $this->db->build();
 }
 public function __construct()
 {
     parent::__construct();
 }
Пример #7
0
 public function delete_customer($id)
 {
     parent::model('delete');
     $this->db->table('customer');
     $this->db->where('id = "' . $id . '"');
     return $this->db->build();
 }
Пример #8
0
 public function clear_cart()
 {
     parent::model('delete');
 }