Exemple #1
0
 function edit($id = false)
 {
     if (empty($_POST)) {
         $category = db_read('category');
         if (!$category) {
             redirect(base_url('admin/category/add'));
         }
         if (!$id) {
             $id = $category->id;
         }
         $view['blogs'] = db_reads('page', array('type' => 'blog', 'catid' => $id));
         $view['categories'] = db_reads('category', array('type' => 'blog'));
         $view['category'] = db_read('category', array('id' => $id, 'type' => 'blog'));
         $this->load->view(tpldir('admin/category/edit_view'), $view);
     } else {
         $result = jsonSrc();
         $id = $this->input->post('id');
         $updatecat['name'] = $this->input->post('name');
         db_update('category', array('id' => $id), $updatecat);
         $result['resultCode'] = 1000;
         $result['resultMsg'] = "Success!!";
         $result['resultData']['openUrl'] = base_url('admin/category/edit/' . $id);
         echo json_encode($result);
     }
 }
Exemple #2
0
 function index()
 {
     $this->load->helper('xml');
     $order['date'] = 'desc';
     $configurationsResult = db_reads('configurations');
     $config = false;
     if ($configurationsResult) {
         foreach ($configurationsResult as $row) {
             $config[$row->name] = $row->value;
         }
     }
     $news = db_reads('page', array('type' => 'news', 'status' => 1), $order);
     $xml['channel'] = false;
     $xml['title'] = isset($config['websitename']) ? $config['websitename'] : false;
     $xml['link'] = base_url();
     $xml['item'] = false;
     if ($news) {
         $index = 0;
         foreach ($news as $newsrow) {
             if ($index < 5) {
                 $temp = false;
                 $temp['title'] = $newsrow->title;
                 $temp['link'] = base_url($newsrow->url);
                 $temp['description'] = $newsrow->content;
                 $xml['item'][] = $temp;
             }
             $index++;
         }
     }
     header("Content-Type: text/xml");
     echo toXML($xml, 'rss version="2.0"');
 }
Exemple #3
0
 function googleplus()
 {
     $share = db_read('mod_share', array('status' => 1, 'name' => 'googleplus'));
     if ($share) {
         $view['share'] = $share;
         $view['sharedetail'] = $share ? db_reads('mod_share_detail', array('relid' => $share->id)) : false;
         $this->load->view(tpldir('modules/mod_share/googleplus_view'), $view);
     }
 }
Exemple #4
0
 function edit($id = false)
 {
     if (empty($_POST)) {
         $shareRow = db_read('mod_share', array('id' => $id));
         if ($shareRow->name == 'twitter') {
             $shareDetails = db_reads('mod_share_detail', array('relid' => $id));
             $view['share_details'] = $shareDetails;
             $view['share'] = $shareRow;
             $this->load->view(tpldir('admin/extension/share/edit/twitter_view'), $view);
         } elseif ($shareRow->name == 'facebook') {
             $shareDetails = db_reads('mod_share_detail', array('relid' => $id));
             $view['share_details'] = $shareDetails;
             $view['share'] = $shareRow;
             $this->load->view(tpldir('admin/extension/share/edit/facebook_view'), $view);
         } elseif ($shareRow->name == 'googleplus') {
             $shareDetails = db_reads('mod_share_detail', array('relid' => $id));
             $view['share_details'] = $shareDetails;
             $view['share'] = $shareRow;
             $this->load->view(tpldir('admin/extension/share/edit/googleplus_view'), $view);
         }
     } else {
         $result = jsonSrc();
         $relid = $this->input->post('relid');
         $sosmed = $this->input->post('sosmed');
         if ($sosmed == 'twitter') {
             $updateContent = false;
             $updateContent['name'] = 'tweettext';
             $updateContent['value'] = $this->input->post('tweettext');
             db_update('mod_share_detail', array('relid' => $relid, 'name' => 'tweettext'), $updateContent);
             $updateContent = false;
             $updateContent['name'] = 'username';
             $updateContent['value'] = $this->input->post('username');
             db_update('mod_share_detail', array('relid' => $relid, 'name' => 'username'), $updateContent);
             $updateContent = false;
             $updateContent['name'] = 'hashtag';
             $updateContent['value'] = $this->input->post('hashtag');
             db_update('mod_share_detail', array('relid' => $relid, 'name' => 'hashtag'), $updateContent);
             $updateContent = false;
             $updateContent['status'] = $this->input->post('status');
             db_update('mod_share', array('id' => $relid), $updateContent);
         } elseif ($sosmed == 'facebook') {
             $updateContent = false;
             $updateContent['status'] = $this->input->post('status');
             db_update('mod_share', array('id' => $relid), $updateContent);
         } elseif ($sosmed == 'googleplus') {
             $updateContent = false;
             $updateContent['status'] = $this->input->post('status');
             db_update('mod_share', array('id' => $relid), $updateContent);
         }
         $result['resultCode'] = 1000;
         $result['resultMsg'] = "Content Updated";
         $result['resultData']['openUrl'] = base_url('admin/share');
         echo json_encode($result);
     }
 }
Exemple #5
0
 function detail($id = false)
 {
     if ($id) {
         $_GET['nooffset'] = true;
         $view['asset_dir'] = db_read('mod_asset_dir', array('id' => $id));
         $_GET['nooffset'] = false;
         if (!$view['asset_dir']) {
             redirect(base_url('admin/asset'));
         }
         $view['asset'] = db_reads('mod_asset', array('dirid' => $id));
         $view['count_asset'] = count_db_reads('mod_asset', array('dirid' => $id));
         $this->load->view(tpldir('admin/extension/asset/detail_view'), $view);
     }
 }
Exemple #6
0
 function video($id = false)
 {
     if ($id) {
         $video = db_read('mod_video', array('status' => 1, 'id' => $id));
         $view['video'] = $video;
         $this->load->view(tpldir('page/video'), $view);
     } else {
         $video = db_reads('mod_video', array('status' => 1));
         $count_video = count_db_reads('mod_video', array('status' => 1));
         $view['video'] = $video;
         $view['count_video'] = $count_video;
         $this->load->view(tpldir('page/video-list'), $view);
     }
 }
Exemple #7
0
 function add()
 {
     if (empty($_POST)) {
         $resultTemplate = $this->mod_template->get();
         $view['templates'] = $resultTemplate['resultData'];
         $view['pages'] = db_reads('page');
         $this->load->view(tpldir('admin/page/add_view'), $view);
     } else {
         $result = jsonSrc();
         $result = $this->mod_page->post();
         $result['resultData']['openUrl'] = $this->agent->referrer();
         echo json_encode($result);
     }
 }
Exemple #8
0
 function index($url = false)
 {
     if ($url) {
         $microsite = db_read('mod_microsite', array('url' => $url));
         if ($microsite) {
             $view['microsite'] = $microsite;
             $view['template'] = db_read('mod_microsite_template', array('mid', $microsite->id));
             $view['contact'] = db_read('mod_microsite_contact', array('mid', $microsite->id));
             $view['content'] = db_reads('mod_microsite_content', array('mid', $microsite->id));
             $this->load->view(tpldir('page/microsite'), $view);
             return true;
         }
     }
     return false;
 }
Exemple #9
0
 function get()
 {
     $result = jsonSrc();
     $theme = $this->config->item('theme');
     $templates = db_reads('templates', array('theme' => $theme));
     $result['resultData'] = false;
     if ($templates) {
         foreach ($templates as $templateRow) {
             $result['resultData'][] = $templateRow->name;
         }
     }
     $result['resultCode'] = 1000;
     $result['resultMsg'] = "OK";
     return $result;
 }
Exemple #10
0
 function edit($id = false)
 {
     if (empty($_POST)) {
         $view['microsite'] = db_read('mod_microsite', array('id' => $id));
         $view['template'] = db_read('mod_microsite_template', array('mid' => $id));
         $view['contact'] = db_read('mod_microsite_contact', array('mid' => $id));
         $view['content'] = db_reads('mod_microsite_content', array('mid' => $id));
         $this->load->view(tpldir('admin/extension/microsite/edit_view'), $view);
     } else {
         $result = jsonSrc();
         $insert['menu'] = $this->input->post('template_title');
         $insert['title'] = $this->input->post('template_title');
         $insert['status'] = $this->input->post('status');
         $insert['url'] = $this->input->post('url');
         $mid = db_update('mod_microsite', array('id' => $id), $insert);
         if (!$mid) {
             $result['resultMsg'] = "create section failed";
             echo json_encode($result);
         }
         $insertTemplate['mid'] = $mid;
         $insertTemplate['title'] = $this->input->post('template_title');
         $insertTemplate['logo'] = $this->input->post('template_logo');
         $insertTemplate['judul'] = $this->input->post('template_judul');
         $insertTemplate['slogan'] = $this->input->post('template_slogan');
         $insertTemplate['navbar'] = $this->input->post('template_navbar');
         $insertTemplate['header'] = $this->input->post('template_header');
         $insertTemplate['header_border'] = $this->input->post('template_header_border');
         $insertTemplate['footer'] = $this->input->post('template_footer');
         db_update('mod_microsite_template', array('mid' => $id), $insertTemplate);
         $insertContact['mid'] = $mid;
         $insertContact['facebook'] = $this->input->post('contact_facebook');
         $insertContact['twitter'] = $this->input->post('contact_twitter');
         $insertContact['instagram'] = $this->input->post('contact_instagram');
         $insertContact['googleplus'] = $this->input->post('contact_googleplus');
         $insertContact['contact'] = $this->input->post('contact_image');
         $insertContact['phone'] = $this->input->post('contact_phone');
         $insertContact['email'] = $this->input->post('contact_email');
         $insertContact['address'] = $this->input->post('contact_address');
         db_update('mod_microsite_contact', array('mid' => $id), $insertContact);
         $result['resultCode'] = 1000;
         $result['resultMsg'] = "Section Updated";
         $result['resultData']['openUrl'] = base_url('admin/microsite/edit/' . $mid);
         echo json_encode($result);
     }
 }
Exemple #11
0
 function edit($id = false)
 {
     if (empty($_POST)) {
         $resultPages = db_reads('page', array('type' => 'event'));
         $resultPage = db_read('page', array('id' => $id, 'type' => 'event'));
         if (!$resultPages) {
             redirect(base_url('admin/event/add'));
         }
         $resultTemplate = $this->mod_template->get();
         $view['categories'] = db_reads('category', array('type' => 'event'));
         $view['templates'] = $resultTemplate['resultData'];
         $view['blogs'] = $resultPages;
         $view['blog'] = $resultPage ? $resultPage : $resultPages[0];
         $this->load->view(tpldir('admin/event/edit_view'), $view);
     } else {
         $result = jsonSrc();
         $id = $this->input->post('id');
         $result = $this->mod_event->put($id);
         $result['resultData']['openUrl'] = $this->agent->referrer();
         echo json_encode($result);
     }
 }
Exemple #12
0
 function related($id = false)
 {
     $view['video'] = db_reads('mod_video', array('status' => 1, 'id !=' => $id));
     $this->load->view(tpldir('modules/mod_video/related_view'), $view);
 }
Exemple #13
0
 function index()
 {
     $view['slidebanner'] = db_reads('mod_slidebanner');
     $this->load->view(tpldir('admin/extension/slidebanner/index_view'), $view);
 }
Exemple #14
0
 function outclient()
 {
     $_GET['limit'] = 4;
     $order['date'] = 'desc';
     $view['event'] = db_reads('page', array('type' => 'event', 'status' => 1), $order);
     $_GET['limit'] = false;
     $this->load->view(tpldir('modules/mod_event/index_view'), $view);
 }
Exemple #15
0
 function index()
 {
     $view['banner'] = db_reads('mod_banner', array('type' => 'front'));
     $view['side'] = db_reads('mod_banner', array('type' => 'side'));
     $this->load->view(tpldir('admin/extension/banner/index_view'), $view);
 }
Exemple #16
0
 function announce($id = false)
 {
     $order['date'] = 'desc';
     $_GET['nopage'] = true;
     $view['news'] = db_reads('page', array('type' => 'news', 'status' => 1, 'catid' => 9), $order);
     $_GET['nopage'] = false;
     $this->load->view(tpldir('modules/mod_news/announce_view'), $view);
 }
Exemple #17
0
 function outclient()
 {
     $view['banner'] = db_reads('mod_banner', array('status' => 1));
     $this->load->view(tpldir('modules/mod_banner/index_view'), $view);
 }
Exemple #18
0
 function index()
 {
     $view['sosmed'] = db_reads('mod_sosmed');
     $this->load->view(tpldir('admin/extension/sosmed/index_view'), $view);
 }
Exemple #19
0
 function index()
 {
     $view['newsticker'] = db_reads('mod_newsticker');
     $this->load->view(tpldir('admin/dashboard_view'), $view);
 }
Exemple #20
0
 function index()
 {
     $view['video'] = db_reads('mod_video');
     $view['count_video'] = count_db_reads('mod_video');
     $this->load->view(tpldir('admin/extension/video/index_view'), $view);
 }
Exemple #21
0
 function outclient()
 {
     $view['sosmed'] = db_reads('mod_sosmed', array('status' => 1, 'name !=' => 'custom'));
     $this->load->view(tpldir('modules/mod_sosmed/index_view'), $view);
 }
Exemple #22
0
 function right()
 {
     $view['footer'] = db_reads('mod_footer', array('type' => 'right'));
     $this->load->view(tpldir('modules/mod_footer/index_view'), $view);
 }
Exemple #23
0
 function index()
 {
     $view['middle'] = db_reads('mod_footer', array('type' => 'middle'));
     $view['right'] = db_reads('mod_footer', array('type' => 'right'));
     $this->load->view(tpldir('admin/extension/footer/index_view'), $view);
 }