示例#1
0
<?php

require "../include/init/init.php";
if (isset($_POST["addSubmit"])) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $link = trim($_POST["link"]) ? $_POST["link"] : "";
    $time = strtotime($_POST["time"]);
    $description = trim($_POST["description"]) ? $_POST["description"] : "";
    // 插入数据
    insert("INSERT INTO jl_news(news_name,news_link,news_description,news_time) VALUES('{$name}','{$link}','{$description}','{$time}')");
}
// 页数
$datacount = countNum("jl_news");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_news ORDER BY news_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_news", "news_id", $_SERVER["PHP_SELF"]);
}
?>
示例#2
0
<?php

require "../include/init/init.php";
// 页数
$datacount = countNum("jl_meg");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_meg ORDER BY meg_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_meg", "meg_id", $_SERVER["PHP_SELF"]);
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
示例#3
0
<?php

require "../include/init/init.php";
if (isset($_POST["addSubmit"])) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $link = trim($_POST["link"]) ? $_POST["link"] : "";
    $order = trim($_POST["order"]) ? $_POST["order"] : "";
    // 插入数据
    insert("INSERT INTO jl_nav(nav_name,nav_link,nav_order) VALUES('{$name}','{$link}','{$order}')");
}
// 页数
$datacount = countNum("jl_nav");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_nav ORDER BY nav_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_nav", "nav_id", $_SERVER["PHP_SELF"]);
}
?>
<!DOCTYPE html>
示例#4
0
<?php

require "../include/init/init.php";
if (isset($_POST["addSubmit"])) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $link = trim($_POST["link"]) ? $_POST["link"] : "";
    // 插入数据
    insert("INSERT INTO jl_friend(friend_name,friend_link) VALUES('{$name}','{$link}')");
}
// 页数
$datacount = countNum("jl_friend");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_friend ORDER BY friend_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_friend", "friend_id", $_SERVER["PHP_SELF"]);
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
示例#5
0
<?php

require "../include/init/init.php";
if (isset($_POST["addSubmit"])) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $pass = trim($_POST["pass"]) ? $_POST["pass"] : "";
    $email = trim($_POST["email"]) ? $_POST["email"] : "";
    // 插入数据
    insert("INSERT INTO jl_admin(admin_username,admin_password,admin_email) VALUES('{$name}','{$pass}','{$email}')");
}
// 页数
$datacount = countNum("jl_admin");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_admin ORDER BY admin_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_admin", "admin_id", $_SERVER["PHP_SELF"]);
}
?>
<!DOCTYPE html>
示例#6
0
<?php

require "../include/init/init.php";
if (isset($_POST["addSubmit"])) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $content = trim($_POST["products_content"]) ? $_POST["products_content"] : "";
    // 插入数据
    if ($_FILES) {
        upload_file("img");
        $img = $_FILES["img"]["name"];
    }
    insert("INSERT INTO jl_products(products_name,products_img,products_content) VALUES('{$name}','{$img}','{$content}')");
}
// 页数
$datacount = countNum("jl_products");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_products ORDER BY products_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_products", "products_id", $_SERVER["PHP_SELF"]);
示例#7
0
<?php

require "../include/init/init.php";
// 页数
$datacount = countNum("jl_document");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_document ORDER BY document_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_document", "document_id", $_SERVER["PHP_SELF"]);
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
示例#8
0
          <div class="left">
            <div class="lists">
              <ul>
                <?php 
$page_size = 10;
$sql = "select * from gift where xianshi<>-1 and xianshi>2 {$where} order by sort desc,id desc,begin_time DESC  ";
$result = mysql_query($sql);
$sum = mysql_num_rows($result);
$pages = new page($sum, $page_size, 5);
$sql = $sql . " limit {$pages->pagelimt},{$page_size}";
//echo $sql;
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
    $num_sq = countNum('choujiang', "cj_gid='" . $row['id'] . "'");
    //申请人数
    $num_getgoods = countNum('choujiang', "cj_gid='" . $row['id'] . "' and (cj_type = 1)");
    //
    $num_left = $row['num'] - $num_getgoods;
    ?>
                <li class="clearfix" >
                  <?php 
    if ($row['freight_payer'] == 'seller') {
        echo '<div class="postage"></div>';
    }
    ?>
                  <div class="bottom_line"></div>
                  <p class="cover"> <a href="v1choujiang_view.php?id=<?php 
    echo $row['id'];
    ?>
" target="_blank"> <img class="lazy" src="images/grey.jpg" data-original="<?php 
    echo $row['pic_url'];
示例#9
0
<?php

require "../include/init/init.php";
if (isset($_POST["addSubmit"])) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $time = strtotime($_POST["time"]);
    $content = trim($_POST["content"]) ? $_POST["content"] : "";
    // 插入数据
    insert("INSERT INTO jl_notice(notice_name,notice_content,notice_time) VALUES(\r\n      '{$name}',\r\n      '{$content}',\r\n      '{$time}')");
}
// 页数
$datacount = countNum("jl_notice");
$total_record = count($datacount);
// 每页记录数
$per_record = 5;
// 总页数(总记录数/每页记录数)
$page_num = ceil($total_record / $per_record);
// 当前页数
$cur_id = isset($_GET["page"]) ? (int) $_GET["page"] : 1;
$offset = ($cur_id - 1) * $per_record;
//  查询数据
$data = select_all("SELECT * FROM jl_notice ORDER BY notice_id DESC LIMIT {$offset},{$per_record}");
// 编号
$i = 1;
if (isset($_POST["delSubmit"])) {
    // var_dump($_POST);
    // 删除数据
    delMore("del", "jl_notice", "notice_id", $_SERVER["PHP_SELF"]);
}
?>
<!DOCTYPE html>
示例#10
0
function countAction()
{
    $sql = "select count(id) from action";
    return countNum($sql);
}
示例#11
0
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<?php 
function countNum()
{
    $count = 0;
    $arr = array(4, 2, 5, 19, 13, 0, 10);
    foreach ($arr as $i) {
        $count++;
    }
    return $count;
}
echo countNum() . "<br>";
?>
</body>
</html>
示例#12
0
<?php

$pageTitle = "个人中心";
require_once 'includes/header.php';
if ($uid != 1) {
    echo "<p style='padding-top:20px;font-size:15px'>权限不足,无法访问本页面</p><meta http-equiv='refresh' content='1;url=user.php'/>";
    exit;
}
$rows = getAllUsers();
echo '<table class="admin_table">';
echo '<tr><th>uid</th><th>名字</th><th>记录数</th><th>消息数</th><th>注册时间</th><th>操作</th></tr>';
foreach ($rows as $row) {
    $postsCount = getPostNumByUid($row['uid']);
    $notifyCount = countNum("zhx_notify", "nuid=" . $row['uid'] . "")['count(*)'];
    // display the the page
    echo '<tr"><td>' . $row['uid'] . '</td>';
    echo '<td><strong><a href="viewUser.php?target_uid=' . $row['uid'] . '">' . $row['name'] . '</a></strong></td>';
    echo '<td>' . $postsCount . '</td>';
    echo '<td>' . $notifyCount . '</td>';
    echo '<td>' . substr($row['regTime'], 0, 10) . '</td>';
    if ($row['uid'] != 1) {
        //check if the user is superamdin
        echo '<td><a href="#" onclick="deleteUser(' . $row['uid'] . ')">删除</a>';
    } else {
        echo '<td><i>管理员</i>';
        //super admin can not be deleted!
    }
    echo '</td></tr>';
}
echo '</table>';
require_once 'includes/footer.php';
示例#13
0
                    $where2 = setUser($where2, $dump_user);
                }
                if (setInsertTime1($fromTime, $toTime)) {
                    $where2 = getInsertTime1($where2, $fromTime, $toTime);
                }
            }
        }
    }
} else {
    echo "something wrong happens";
    exit;
}
$sql1 = $sql . $where1;
$sql2 = $sql . $where2;
$sum[0] = countNum($sql1);
$sum[1] = countNum($sql2);
$arr_multiple = array();
$arr_multiple[0] = $sum[0] == 0 ? "No comparison" : sprintf("%.2f", $sum[1] / $sum[0]);
$arr_all = array();
$arr_all[0] = $sum;
$arr_all[1] = $arr_multiple;
print_r(json_encode($arr_all));
function setInsertTime1($startTime, $endTime)
{
    if ($startTime == "" && $endTime == "") {
        return false;
    } else {
        return true;
    }
}
function getInsertTime1($where, $startTime, $endTime)
示例#14
0
                if (hasUser($user)) {
                    $where = setUser($where, $user);
                }
                for ($i = 0; $i < $count_group; $i++) {
                    if (hasTimeGroup($timeGroup1[$i])) {
                        $where1 = setInsertTimeGroup1($where, $timeGroup1[$i]);
                    } else {
                        $where1 = $where;
                    }
                    if (hasTimeGroup($timeGroup2[$i])) {
                        $where2 = setInsertTimeGroup2($where1, $timeGroup2[$i]);
                    } else {
                        $where2 = $where1;
                    }
                    $dump_sql = $sql . $where2;
                    $sum[] = countNum($dump_sql);
                }
            }
        }
    }
} else {
    echo "something wrong happens";
    exit;
}
$combineTime = array();
for ($i = 0; $i < $count_group; $i++) {
    $combineTime[$i] = $timeGroup1[$i] . "~" . $timeGroup2[$i];
}
$arr_multiple = array();
for ($i = 0; $i < $count_group - 1; $i++) {
    $arr_multiple[] = $sum[0] == 0 ? "No comparison" : sprintf("%.2f", $sum[$i + 1] / $sum[0]);
示例#15
0
                    $where .= " and isfirst = 'T' ";
                    if (hasCondition($sex, $state, $country)) {
                        $where = setCondition($where, $sex, $state, $country);
                    }
                    if (hasTime($startMonth, $endMonth, $beforeMonth, $afterMonth, $onMonth)) {
                        $where = setInsertTime($where, $startMonth, $endMonth, $beforeMonth, $afterMonth, $onMonth);
                    }
                    if (hasUser($user)) {
                        $where = setUser($where, $user);
                    }
                } else {
                    echo "something wrong happens";
                    exit;
                }
            }
        }
    }
} else {
    echo "something wrong happens";
    exit;
}
$sql1 = $sql1 . $where;
$sql2 = $sql2 . $where;
// echo $sql1;
// echo PHP_EOL;
// echo $sql2;
// echo PHP_EOL;
$arr = createArr($sql1);
$count_distinct = countNum($sql2);
$result = array("count_distinct" => $count_distinct, "arr" => $arr);
print_r(json_encode($result));
示例#16
0
            <ul>
                

<?php 
$page_size = 10;
$sql = "select * from shiyong where pindao_id = 1 and xianshi>2 {$where} ORDER BY sort desc,begin_time DESC  ";
$result = mysql_query($sql);
$sum = mysql_num_rows($result);
$pages = new page($sum, $page_size, 5);
$sql = $sql . " limit {$pages->pagelimt},{$page_size}";
//echo $sql;
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
    $num_sq = countNum('user_shiyong', "shiyongid='" . $row['id'] . "'");
    //申请人数
    $num_getgoods = countNum('user_shiyong', "shiyongid='" . $row['id'] . "' and (status > 3 or status = -3 )");
    //
    $num_left = $row['num'] - $num_getgoods;
    ?>
                    <li class="clearfix" >
                        <?php 
    if ($row['freight_payer'] == 'seller') {
        echo '<div class="postage"></div>';
    }
    ?>
                        <div class="bottom_line"></div>
                        <p class="cover">
                            <a href="/v1list_view.php?id=<?php 
    echo $row['id'];
    ?>
" target="_blank">