Example #1
0
 /**
  * 权限列表
  */
 public function rule_list($page_id = 1)
 {
     $list = D('rule')->getTree();
     $data = data_page($list, $page_id);
     $this->assign('list', $data['list']);
     $this->assign('page', $data['page']);
     $this->display();
 }
Example #2
0
 /**
  * 角色列表
  */
 public function role_list($page_id = 1)
 {
     $model = D('Role');
     $list = $model->get_list(true);
     $data = data_page($list, $page_id);
     $this->assign('list', $data['list']);
     $this->assign('page', $data['page']);
     $this->display();
 }
Example #3
0
 /**
  * 显示用户列表
  */
 public function user_list($page_id = 1)
 {
     $list = M('user')->select();
     //获取用户列表所有数据
     $info = M('role')->field('re_id,re_name')->where(array('re_status' => '1'))->select();
     $data = data_page($list, $page_id);
     $this->assign('info', $info);
     $this->assign('list', $data['list']);
     $this->assign('page', $data['page']);
     $this->display();
 }
Example #4
0
 /**
  * 博客列表
  */
 public function bg_list($page_id = 1)
 {
     //取出文章的分类
     $catemodel = D('Category');
     $catedata = $catemodel->getTree();
     $this->assign('catedata', $catedata);
     $blogmodel = D('Blog');
     $blogdata = $blogmodel->order('bg_id desc')->select();
     //将cat_name加入到blogdata里面
     foreach ($blogdata as $k => $v) {
         $cat_name = $catemodel->where(array('cat_id' => $v['cat_id']))->find();
         $blogdata[$k]['cat_name'] = $cat_name['cat_name'];
     }
     $data = data_page($blogdata, $page_id);
     //p($data);
     $this->assign('blogdata', $data['list']);
     $this->assign('page', $data['page']);
     $this->display();
 }
Example #5
0
<?php

#Database connection:
include '../../config/connection.php';
#Constants:
DEFINE('D_TEMPLATE', 'template');
#Functions:
include '../../functions/data.php';
// It shows up in the browser's page tab
$site_title = 'ITTS "O. Belluzzi - L. da Vinci"';
if (isset($_GET['page'])) {
    $pageid = $_GET['page'];
    // Set with URL value
} else {
    $pageid = 1;
    //Set with 1 to reffer the Home default page
}
#Page variable setup:
$page = data_page($dbc, $pageid);
Example #6
0
         if ($result) {
             $message = '<p class="alert alert-success">User was ' . $action . '!</p>';
         } else {
             $message = '<p class="alert alert-danger">User could not be ' . $action . ' because: ' . mysqli_error($dbc);
             if ($verify == false) {
                 $message .= '<p class="alert alert-danger">Password fields empty and/or do not match.</p>';
             }
             $message .= '<p class="alert alert-warning">Query: ' . $query . '</p>';
         }
     }
     if (isset($_GET['id'])) {
         $opened = data_user($dbc, $_GET['id']);
     }
     break;
     if (isset($_GET['id'])) {
         $opened = data_page($dbc, $_GET['id']);
     }
     break;
 case 'navigation':
     if (isset($_POST['submitted']) == 1) {
         $label = mysqli_real_escape_string($dbc, $_POST['label']);
         $url = mysqli_real_escape_string($dbc, $_POST['url']);
         if (isset($_POST['id']) != '') {
             $action = 'updated';
             $query = "UPDATE navigation SET id = '{$_POST['id']}', label = '{$label}', url = '{$url}', position = {$_POST['position']}, status = {$_POST['status']} WHERE id = '{$_POST['openedid']}'";
             $result = mysqli_query($dbc, $query);
         }
         if ($result) {
             $message = '<p class="alert alert-success">Navigation Item was ' . $action . '!</p>';
         } else {
             $message = '<p class="alert alert-danger">Navigation Item could not be ' . $action . ' because: ' . mysqli_error($dbc);
Example #7
0
<?php

// setup database file;
# Database connection here
include 'config/connection.php';
//database connection file
#Constants
DEFINE('D_TEMPLATE', template);
#functions
include 'functions/data.php';
include 'functions/template.php';
include 'functions/sandbox.php';
#site setup
$debug = data_setting_value($dbc, 'debug-status');
//turn debug panel on or off
$path = get_path();
//call to clean url function
$site_title = 'Site Name';
//set site title
if (!isset($path['call_parts'][0]) || $path['call_parts'][0] == '') {
    //$path['call_parts'][0] = 'home';
    header('Location: home');
}
#page setup
$page = data_page($dbc, $path['call_parts'][0]);
Example #8
0
        <div class="row">
        <div class="col-md-8 col-md-offset-2">
        <div class="panel panel-default">
  		<div class="panel-body">
        <span style="float:left;margin-top:10px;">Competitive Coding<br/>Leaderboard<br/></span>
    	<img src="images/NIT_Silchar_logo.png" width="100" height="100" style="float:right"/>
  		</div>
		</div>
        </div>
		</div>
        <div class="row">
        <div class="col-md-5 col-md-offset-2">
        <div class="table-responsive">
        <div id="cover">
       	<?php 
data_page($dbc);
?>
        </div>
        </div>
        </div>
        <div class="col-md-3">
    
       <table style="margin-left:0px;" class="table table-bordered">
       <tr><td>Rating</td><td>Title</td></tr>
       <?php 
color_table($dbc);
?>
       </table>
      
        </div>
        </div>
Example #9
0
<?php

//setup
error_reporting(0);
$site_title = 'MyTailor';
require_once '../../config/connection.php';
# Constants :
define('D_TEMPLATE', 'template');
define('A_TEMPLATE', 'includes/template');
#function files:
include 'functions/sandbox.php';
include 'functions/data.php';
include 'functions/template.php';
include 'functions/function.php';
#Url Path
$path = get_path();
#page Setup
if (!isset($path['call_parts'][0]) || $path['call_parts'][0] == '') {
    $path['call_parts'][0] = 'dashboard';
}
$page = data_page($dbc, $path['call_parts'][0], 'admin');
if (!$page) {
    $page = data_page($dbc, 'dashboard', 'admin');
}
Example #10
0
<?php

// setup File:
# Database connection here...
include 'connection.php';
// functions
include 'functions/data.php';
include 'functions/mainNav.php';
include 'functions/settings.php';
include 'functions/user.php';
# page setup
if (isset($_GET['page'])) {
    $pageID = $_GET['page'];
} else {
    $pageID = "dashboard";
}
#page data
// this will only get set when a user click on a link from the list group to load the data into the form
if (isset($_GET['id'])) {
    $page = data_page($dbc, $_GET['id']);
}
#page settings
// settings table returns 1 or 0 to load / disable the debug option.
$debug = page_settings($dbc, 'debug-status');
# User:
$user = getUser($dbc, $_SESSION['username']);
// open uni phone:01908541066
?>

Example #11
0
File: setup.php Project: m1cl/CMS
//
# Database Connection...
$host = 'localhost';
$username = '******';
$password = '******';
$databasename = 'labsolutions';
$link = mysqli_connect($host, $username, $password, $databasename) or die('Could not connect because: ' . mysqli_connect_error());
# Constants:
DEFINE('D_TEMPLATE', 'template');
#
# Function
include 'functions/data.php';
include 'functions/template.php';
# Site Setup
$debug = data_setting_value($dbc, 'debug-status');
$site_title = "labsolutions";
if (isset($_GET['page'])) {
    // Set different languages for the page
    $pageid = $_GET['page'];
    // Set $pageid equal to value in URL
} else {
    $pageid = 1;
    // Set $pageid equal to 1 or the Home Page
}
$home_query = "SELECT * FROM pages WHERE id = {$pageid}";
$result = mysqli_query($link, $home_query);
$page = mysqli_fetch_assoc($result);
#
# Page setup
$page = data_page($link, $pageid);