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); } }
function index() { if ($_SERVER['REQUEST_METHOD'] == "GET") { $admin_auth = $this->session->userdata('admin_auth'); $login_error = $this->session->userdata('login_error'); $this->session->unset_userdata('login_error'); session_write_close(); if ($admin_auth) { redirect('admin/dashboard'); } $view['error'] = $login_error; $this->load->view(tpldir('admin/login/index_view'), $view); } else { $username = $this->input->post('username'); $password = hash('sha256', $this->input->post('password')); $adminRow = db_read('admin', array('username' => $username, 'password' => $password)); if ($adminRow) { $this->session->set_userdata('admin_auth', true); $this->session->set_userdata('adminid', $adminRow->id); $this->session->set_userdata('admin_user', $adminRow->username); // redirect(base_url('admin/dashboard')); } else { $this->session->set_userdata('login_error', 'Invalid Username / password'); } redirect('admin/login'); } }
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); } }
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); } }
function search($key = false) { $this->load->model('Search_model'); $this->load->model('Encryption_model'); if ($this->input->get('key')) { $key = $this->Encryption_model->encrypt($this->input->get('key')); redirect(base_url('page/search/' . $key)); } $search = $this->Encryption_model->decrypt($key); $view['search'] = $this->Search_model->reads($search); $view['search_count'] = $this->Search_model->reads($search, true); $this->load->view(tpldir('page/search'), $view); }
function add($category = false) { if (empty($_POST)) { $resultTemplate = $this->mod_template->get(); $view['templates'] = $resultTemplate['resultData']; $this->load->view(tpldir('admin/event/add_view'), $view); } else { $result = jsonSrc(); $result = $this->mod_event->post(); $result['resultData']['openUrl'] = base_url('admin/event'); echo json_encode($result); } }
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); } }
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); } }
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; }
function edit($id = false) { if (empty($_POST)) { $view['banner'] = db_read('mod_banner', array('id' => $id)); $this->load->view(tpldir('admin/extension/banner/edit_view'), $view); } else { $result = jsonSrc(); $id = $this->input->post('id'); $updateBanner['url'] = $this->input->post('url'); $updateBanner['status'] = $this->input->post('status'); db_update('mod_banner', array('id' => $id), $updateBanner); $result['resultCode'] = 1000; $result['resultMsg'] = "Banner Updated"; $result['resultData']['openUrl'] = base_url('admin/banner'); echo json_encode($result); } }
function add() { if (empty($_POST)) { $this->load->module('mod_page'); $view['page'] = false; $pageResult = $this->mod_page->gets(); if ($pageResult['resultCode'] == 1000) { $view['page'] = $pageResult['resultData']['page']; } $this->load->view(tpldir('admin/menu/add_view'), $view); } else { $result = jsonSrc(); $this->load->module('mod_menu'); $result = $this->mod_menu->post(); $result['resultData']['openUrl'] = $this->agent->referrer(); echo json_encode($result); } }
function add($type = false) { if (empty($_POST)) { $view['type'] = $type; $this->load->view(tpldir('admin/extension/footer/add_view'), $view); } else { $result = jsonSrc(); $id = $this->input->post('id'); $createFooter['url'] = $this->input->post('url'); $createFooter['name'] = $this->input->post('name'); $createFooter['type'] = $this->input->post('type'); db_create('mod_footer', $createFooter); $result['resultCode'] = 1000; $result['resultMsg'] = "Footer Created"; $result['resultData']['openUrl'] = base_url('admin/footer'); echo json_encode($result); } }
function edit($id = false) { if (empty($_POST)) { if ($id) { $newsticker = db_read('mod_newsticker', array('id' => $id)); if ($newsticker) { $view['newsticker'] = $newsticker; $this->load->view(tpldir('admin/newsticker/edit_view'), $view); } } } else { $result = jsonSrc(); $update['text'] = $this->input->post('text'); $update['url'] = $this->input->post('url'); $update['status'] = $this->input->post('status'); $id = $this->input->post('id'); db_update('mod_newsticker', array('id' => $id), $update); $result['resultCode'] = 1000; $result['resultMsg'] = "Newsticker Updated"; $result['resultData']['openUrl'] = base_url('admin/dashboard'); echo json_encode($result); } }
function outclient() { $view['banner'] = db_reads('mod_banner', array('status' => 1)); $this->load->view(tpldir('modules/mod_banner/index_view'), $view); }
function index() { $view['newsticker'] = db_reads('mod_newsticker'); $this->load->view(tpldir('admin/dashboard_view'), $view); }
<div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Surakarta.go.id</a> </div> <!-- Top Menu Items --> <ul class="nav navbar-right top-nav"> <!-- menu kanan --> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> Administrator <b class="caret"></b></a> <ul class="dropdown-menu"> <li> <a href="#"><i class="fa fa-fw fa-gear"></i> Settings</a> </li> <li class="divider"></li> <li> <a href="<?php echo base_url('admin/login/out'); ?> "><i class="fa fa-fw fa-power-off"></i> Log Out</a> </li> </ul> </li> </ul> <?php $this->load->view(tpldir('admin/sidebar_view')); ?> </nav>
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); }
function index() { $this->load->view(tpldir('admin/extension/index_view')); }
function outclient() { $view['sosmed'] = db_reads('mod_sosmed', array('status' => 1, 'name !=' => 'custom')); $this->load->view(tpldir('modules/mod_sosmed/index_view'), $view); }
echo "checked"; } ?> > active </label> </div> <div class="form-group"> <input type="hidden" name="sosmed" value="twitter"> <input type="hidden" name="relid" value="<?php echo $shareRow->relid; ?> "> <input class="btn btn-success" type="submit" value="Submit"> </div> <?php } ?> </form> </div> <!-- end: panel body --> </div> <!-- end: panel --> </div> </div> </div> <!-- end: page content container --> <script> formGeneral('#formNwsEdit'); </script> <?php $this->load->view(tpldir('admin/footer_view'));
function addfolder() { if (empty($_POST)) { $this->load->view(tpldir('admin/extension/asset/detail_view')); } }
function right() { $view['footer'] = db_reads('mod_footer', array('type' => 'right')); $this->load->view(tpldir('modules/mod_footer/index_view'), $view); }
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); }
function contentedit($id = false) { if (empty($_POST)) { if ($id) { $view['content'] = db_read('mod_microsite_content', array('id' => $id)); $this->load->view(tpldir('admin/extension/microsite/content/edit_view'), $view); } } else { $result = jsonSrc(); $mid = $this->input->post('mid'); $id = $this->input->post('id'); $insertContent['background'] = $this->input->post('background'); $insertContent['menu'] = $this->input->post('menu'); $insertContent['anchor'] = preg_replace('/[^a-zA-Z0-9]/', '', $this->input->post('menu')); $insertContent['content'] = $this->input->post('content'); db_update('mod_microsite_content', array('id' => $id), $insertContent); $result['resultCode'] = 1000; $result['resultMsg'] = "Content Updated"; $result['resultData']['openUrl'] = base_url('admin/microsite/edit/' . $mid); echo json_encode($result); } }
function outclient() { $this->load->model('Page_model'); $menu = $this->get(); $pageResult = $this->Page_model->get_page_list(); $pages = false; $main = false; if ($pageResult) { foreach ($pageResult as $pageRow) { $pages[$pageRow->id] = $pageRow->url; $main[$pageRow->id] = $pageRow->main; } } if ($menu['resultCode'] == 1000) { $view['menu'] = $menu['resultData']; $view['pages'] = $pages; $view['default'] = $main; $this->load->view(tpldir('modules/mod_menu/index_view'), $view); } }
<input type="text" class="form-control" placeholder="..."> </div> <div class="col-md-3"> <button class="btn btn-default">Search</button> </div> </div> </form> <div class="map-container"> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyASCGioUH_SgrfkGU5rkCECqeKxUCLkB20&callback=initMap"></script> <script> function initialize() { var mapCanvas = document.getElementById('map-canvas'); var mapOptions = { center: new google.maps.LatLng(-7.5667,110.8167), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(mapCanvas, mapOptions) } google.maps.event.addDomListener(window, 'load', initialize); </script> <div id="map-canvas"></div> </div> </div> </div> </div> <?php $this->load->view(tpldir('page/_blocks/footer'));
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); }