Exemplo n.º 1
0
 function delCarousel($id)
 {
     include_once 'connect.php';
     $db = db_Init();
     $sql_str = 'UPDATE Carousel SET Del = 1 WHERE ID="' . $id . '"';
     $db->query($sql_str);
     header('location:admin/carousel.php');
 }
Exemplo n.º 2
0
<?php

session_start();
include_once '../connect.php';
$db = db_Init();
$name = $_POST['Username'];
$pwd = $_POST['Password'];
$query_str = 'SELECT * FROM User WHERE Name="' . $name . '" and Password="******" limit 1';
$row = $db->get_row($query_str);
$login = count($row) > 0;
if ($login) {
    // 登录成功
    $_SESSION['user_id'] = $row->ID;
    $_SESSION['user_name'] = $row->Name;
    header('location:' . 'index.php');
    exit;
} else {
    //登录失败 返回
    $_SESSION['loginStatus'] = 0;
    header('location:' . 'login.php');
    exit;
}
Exemplo n.º 3
0
 function updateCarousel($req)
 {
     include_once 'connect.php';
     $db = db_Init();
     $sql_str = 'UPDATE Carousel SET Name="' . $req['set_name'] . '",Des="' . $req['set_content'] . '",Image="' . $req['set_img'] . '" WHERE ID=' . $req['set_id'];
     $db->query($sql_str);
     echo '更新信息成功';
     echo '<script>setTimeout(function(){window.location.href="/admin/carousel.php";},1000);</script>';
 }
Exemplo n.º 4
0
 function contactDetail($id)
 {
     include_once 'connect.php';
     $db = db_Init();
     $query_str = 'SELECT * FROM Contact WHERE Del=0 AND ID=' . $id . ' limit 1';
     $r = $db->get_results($query_str);
     $result = json_encode(array("status" => true, "message" => "查询团队数据", 'result' => $r));
     $this->_setHeader();
     echo $result;
 }
Exemplo n.º 5
0
 function addContact($req)
 {
     include_once 'connect.php';
     $db = db_Init();
     $sql_str = 'INSERT INTO Contact (Title,Content,Link,Type) VALUES ("' . $req['t_name'] . '","' . $req['t_content'] . '","' . $req['t_link'] . '",' . $req['t_type'] . ')';
     $db->query($sql_str);
     echo '添加成功';
     echo '<script>setTimeout(function(){window.location.href="/admin/contact.php";},1000);</script>';
 }