File: /www/备份的/www.mnbola.site/ht.php
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<div style="text-align:center;clear:both;">
<style>
*{
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
td,tr,a{font-size:16px;text-decoration:none}
td{height:45px;line-height:45px;}
td input{height:35px;width:90%;border:0px;background:none;font-size:16px}
input{font-size:16px}
body{
font-family: Helvetica;
-webkit-font-smoothing: antialiased;
/*background: rgba( 71, 147, 227, 1);*/
font-size: 16px;
}
h2{
text-align: center;
font-size: 16px;
letter-spacing: 1px;
color: #00ff5a;
padding: 10px 0; background: #324960;
}
/* Table Styles */
.table-wrapper{
margin: 10px 70px 70px;
box-shadow: 0px 35px 50px rgba( 0, 0, 0, 0.2 );
width: 1300px;margin: 0 auto;
}
.fl-table {
border-radius: 5px;
font-size: 12px;
font-weight: normal;
border: none;
border-collapse: collapse;
width: 100%;
max-width: 100%;
white-space: nowrap;
background-color: white;
}
.fl-table td, .fl-table th {
text-align: center;
/*padding: 8px;*/
}
.fl-table td {
border-right: 1px solid #f8f8f8;
font-size: 12px;
}
.fl-table thead th {
color: #ffffff;
background: #324960;
}
.fl-table thead th:nth-child(odd) {
color: #ffffff;
background: #324960;
}
.fl-table tr:nth-child(even) {
background: #eee;
}
.qingkong{background: #324960;
color: #fff;
padding: 5px;}
.xiugai{ background: #324960;
color: #fff;
padding-left: 5px;
padding-right: 5px; font-size: 15px;}
.ssxx{color: #fff;
background: red;
padding: 5px; font-size: 15px;}
.xxxx{ background: #000000;
color: #fff;
padding: 5px; font-size: 15px;}
/* Responsive */
@media screen and (min-width:320px) and (max-width:640px){
.yy{display:none}
.table-wrapper{margin:0px !important;width:100% !important; }
}
</style>
<?php
if(isset($_POST['password'])){
$password = $_POST['password'];
if($password=="admin2023"){
setcookie("hduser" ,"gzhd2019", time()+3600*24);
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
header("Location: {$url}");
}
echo ' <script>alert("密码错误") </script><form method="post"> 请输入密码:<input type="password" name="password"><input type="submit"></form> ';
exit();
}
if(!isset( $_COOKIE["hduser"])){
echo '
<style>
body{
background: #ebebeb;
font-family: "Helvetica Neue","Hiragino Sans GB","Microsoft YaHei","\9ED1\4F53",Arial,sans-serif;
color: #222;
font-size: 12px;
}
*{padding: 0px;margin: 0px;}
.top_div{
background: #008ead;
width: 100%;
height: 100px;
}
.ipt{
border: 1px solid #d3d3d3;
padding: 10px 10px;
width: 290px;
border-radius: 4px;
padding-left: 35px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s
}
.ipt:focus{
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)
}
.u_logo{
background: url("/static/image/username.png") no-repeat;
padding: 10px 10px;
position: absolute;
top: 43px;
left: 40px;
}
.p_logo{
background: url("/static/image/password.png") no-repeat;
padding: 10px 10px;
position: absolute;
top: 12px;
left: 40px;
}
a{
text-decoration: none;
}
.tou{
background: url("/static/image/tou.png") no-repeat;
width: 97px;
height: 92px;
position: absolute;
top: -87px;
left: 140px;
}
.left_hand{
background: url("/static/image/left_hand.png") no-repeat;
width: 32px;
height: 37px;
position: absolute;
top: -38px;
left: 150px;
}
.right_hand{
background: url("/static/image/right_hand.png") no-repeat;
width: 32px;
height: 37px;
position: absolute;
top: -38px;
right: -64px;
}
.initial_left_hand{
background: url("/static/image/hand.png") no-repeat;
width: 30px;
height: 20px;
position: absolute;
top: -12px;
left: 100px;
}
.initial_right_hand{
background: url("/static/image/hand.png") no-repeat;
width: 30px;
height: 20px;
position: absolute;
top: -12px;
right: -112px;
}
.left_handing{
background: url("/static/image/left-handing.png") no-repeat;
width: 30px;
height: 20px;
position: absolute;
top: -24px;
left: 139px;
}
.right_handinging{
background: url("/static/image/right_handing.png") no-repeat;
width: 30px;
height: 20px;
position: absolute;
top: -21px;
left: 210px;
}
</style>
';
echo '<body><div class="top_div"></div>
<div style="width: 400px;height: 200px;margin: auto auto;background: #ffffff;text-align: center;margin-top: 100px;border: 1px solid #e7e7e7">
<div style="width: 165px;height: 96px;position: absolute">
<div class="tou"></div>
<div id="left_hand" class="initial_left_hand"></div>
<div id="right_hand" class="initial_right_hand"></div>
</div>
<form method="post">
<p style="position: relative;padding-top:28px">
<span class="p_logo"></span>
<input type="password" name="password" class="ipt">
</p>
';
echo ' <input type="submit" style="background: #008ead;padding: 7px 10px;border-radius: 4px;border: 1px solid #1a7598;color: #FFF;font-weight: bold;" >
</span>
</p>
</div>
</div>
</form> </body>';
exit();
}
?>
</head>
<body>
<?php
include 'conn.php';
?>
<?php
$sqlbbtt = "SELECT * FROM biaotifb WHERE id=1 ";
$resultbbtt = $conn->query($sqlbbtt);
if ($resultbbtt->num_rows > 0) {
// 输出数据
while($rowbbtt = $resultbbtt->fetch_assoc()) {
$biaoti=$rowbbtt['title'];
$daima2=$rowbbtt['daima'];
$daima=htmlspecialchars_decode($daima2);
}
} else {
echo "0 结果";
}
?>
<h2><?php echo $biaoti;?></h2>
<div class="table-wrapper">
<table class="fl-table">
<thead>
<tr style="height:55px">
<th>状态</th>
<th style="width:15%">备注</th>
<th style="width:10%">Line号</th>
<th>line链接</th>
<th style="width:5%" class="yy">显示数</th>
<th style="width:5%" class="yy">点击数</th>
<th style="width:5%" class="yy">显示总数</th>
<th style="width:8%"> <font class="cc" onkeydown="cc()">展开</font></th>
</tr>
</thead>
<tbody>
<tr style="height:45px">
<td> <a href="ht.php?action=qingkong" class="qingkong">清空点击</a></td>
<form method="post" name="add-form">
<td><input type="text" name="weixin" required="" value=""></td>
<td><input type="text" name="linehao" required="" value=""></td>
<td><input type="text" name="linelj" required="" value=""></td>
<td class="yy"><input type="number" value="0" disabled=""></td>
<td class="yy"> <input type="number" value="0" disabled="" ></td>
<td class="yy"><input type="number" value="0" disabled=""></td>
<input type="hidden" value="add" name="add">
<td><input type="submit" value="添加"></td>
</form>
</tr>
<?php
$sqlxs = "SELECT * FROM xiao order by zhuantai";
$resultsz = $conn->query($sqlxs);
if ($resultsz->num_rows > 0) {
// 输出数据
while($rowsz = $resultsz->fetch_assoc()) {
echo '<tr>';
echo "<td>";
if($rowsz['zhuantai']==0){
echo '<a href="ht.php?action=shangxian&id='.$rowsz['id'].'" class="ssxx">在线状态</a>';
}else{
echo '<a href="ht.php?action=xaixiang&id='.$rowsz['id'].'" class="xxxx">离线状态</a>';
}
echo '</td><form method="post" name="add-form">' ;
echo '<td><input type="text" name="weixin" required="" value="'.$rowsz['weixin'].'"></td>' ;
echo '<td><input type="text" name="linehao" required="" value="'.$rowsz['linehao'].'"></td>' ;
echo '<td><input type="text" name="linelj" required="" value="'.$rowsz['linelj'].'"></td>' ;
echo '<td class="yy"><input type="text" name="cishu" required="" value="'.$rowsz['cishu'].'"></td>' ;
echo '<td class="yy"><input type="text" name="dianji" required="" value="'.$rowsz['dianji'].'"></td>' ;
echo '<td class="yy"><input type="text" name="zongshu" required="" value="'.$rowsz['zongshu'].'"></td>
<input type="hidden" name="id" required="" value="'.$rowsz['id'].'">' ;
echo '<td> <input type="submit" value="修改" style="width:45%" class="xiugai"> <a href="ht.php?action=del&id='.$rowsz['id'].'" style="width:45%">删除</a>';
echo '' ;
echo '</tr></form>';
}
} else {
echo "0 结果";
}
?>
<tbody>
</table>
<form action="/dr/shuju.php" method="post" enctype="multipart/form-data"style="width: 100%;padding: 10px;background: #324960;color: #fff; ">
<input type="file" name="excel"> <input type="submit" value="导入" >
</form>
<div style="background:#fff">
<a onclick="if(confirm('确认删除所有客服号码?')==false)return false;location.href='/ht.php?shangchu=111'">删除所有号</a>
</div>
<form method="post" name="add-form" style=" background: #324960;padding-bottom: 50px;">
<h2 style="font-size:18px">标题:<input type="text" name="title" required="" value="<?php echo $biaoti;?>" style="background:none;border:1px solid #fff ;color:#fff;font-weight:500;font-size:18px; height:35px;line-height:35px;border-radius:5px"></h2>
<h2 style="font-size:18px">代码:<textarea cols="100%" rows="10" name="daima"><?php echo $daima;?></textarea></h2>
<input type="submit" value="提交" style=" height: 38px;
width: 180px;
background: #fff;">
</form>
<?php
$shangchu=$_GET['shangchu'];
if($shangchu=='111'){
$sqlsc = "DELETE FROM xiao WHERE id>0 ";
if ($conn->query($sqlsc) === TRUE) {
// echo "删除成功";
// $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
// header("Location: {$url}");
echo "<script>alert('全部删除成功');location.href='/ht.php';</script>";
} else {
echo "Error: " . $sqlsc . "<br>" . $conn->error;
}
}
?>
<br><br><br><br><br><br>
</div>
<!--linehao-->
<!--linelj-->
<!--cishu-->
<!--zongshu-->
<!--dianji-->
<?php
//添加
if (isset($_POST['add'])){
$weixin=$_POST['weixin'];
$linehao=$_POST['linehao'];
$linelj=$_POST['linelj'];
$sql = "INSERT INTO xiao (linehao, weixin,linelj, cishu,zongshu,dianji,zhuantai) VALUES ('".$linehao."','".$weixin."', '".$linelj."', '0', '0', '0', '0')";
if ($conn->query($sql) === TRUE) {
// echo "新记录插入成功";
// $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
// header("Location: {$url}");
echo "<script>alert('新记录插入成功');location.href='/ht.php';</script>";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
//添加
//删除
if(isset($_GET["action"]) && $_GET["action"]=="del"){
$id=$_GET['id'];
$sqlsc = "DELETE FROM xiao WHERE id='".$id."'";
if ($conn->query($sqlsc) === TRUE) {
// echo "删除成功";
// $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
// header("Location: {$url}");
echo "<script>alert('删除成功');location.href='/ht.php';</script>";
} else {
echo "Error: " . $sqlsc . "<br>" . $conn->error;
}
}
//删除
//修改
if(isset($_POST["title"])){//改标题
$title=$_POST['title'];
$text=$_POST['daima'];
$daima= mysqli_real_escape_string($conn, $text);
$sqlbt ="UPDATE `biaotifb` SET `title` = '" . $title. "' , `daima` = '" . $daima . "' WHERE `id` =1 ";
if ($conn->query($sqlbt) === TRUE) {
echo "<script>alert('修改成功');location.href='/ht.php';</script>";
} else { echo "Error: " . $sqlbt . "<br>" . $conn->error;}
}
if(isset($_POST["id"])){
$id=$_POST['id'];
$weixin=$_POST['weixin'];
$linehao=$_POST['linehao'];
$linelj=$_POST['linelj'];
$cishu=$_POST['cishu'];
$zongshu=$_POST['zongshu'];
$dianji=$_POST['dianji'];
echo $linelj;
$sqlxg ="UPDATE `xiao` SET `weixin` = '" . $weixin. "' , `linehao` = '" . $linehao . "' ,`linelj` = '" . $linelj . "', `cishu` = '" . $cishu . "' ,`zongshu` = '" . $zongshu . "' WHERE `id` = " . $id . "";
// $sqlxg ="UPDATE xiao SET 'linehao'='".$linehao."' 'linelj'=''".$linelj."' 'cishu'='".$cishu."' 'zongshu'= '".$zongshu."' 'dianji'='".$dianji."' WHERE id='".$id."' " ;
if ($conn->query($sqlxg) === TRUE) {
echo "<script>alert('修改成功');location.href='/ht.php';</script>";
} else { echo "Error: " . $sqlxg . "<br>" . $conn->error;}
}
//修改
//清空
if(isset($_GET["action"]) && $_GET["action"]=="qingkong"){
$resultqk = $conn->query($sqlxs);
if ($resultqk->num_rows > 0) {
// 输出数据
while($rowqk = $resultqk->fetch_assoc()) {
$id=$rowqk['id'];
$sqlxg ="UPDATE `xiao` SET `cishu` =0 ,`dianji` =0 WHERE `id` = " . $id . "";
if ($conn->query($sqlxg) === TRUE) {
}
}
}
// $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
// header("Location: {$url}");
echo "<script>alert('清空成功');location.href='/ht.php';</script>";
}
//清空
//上线
if(isset($_GET["action"]) && $_GET["action"]=="shangxian"){
$id=$_GET['id'];
$sqlxg ="UPDATE `xiao` SET `zhuantai` =1 WHERE `id` = " . $id . "";
if ($conn->query($sqlxg) === TRUE) {
// echo "<script>alert('!');history.go(-1);</script>";
echo "<script>alert('下线成功');location.href='/ht.php';</script>";
}
}
//上线
//下线
if(isset($_GET["action"]) && $_GET["action"]=="xaixiang"){
$id=$_GET['id'];
$sqlxg ="UPDATE `xiao` SET `zhuantai` =0 WHERE `id` = " . $id . "";
if ($conn->query($sqlxg) === TRUE) {
// echo "<script>alert('上线成功!');history.go(-1);</script>";
echo "<script>alert('上线成功');location.href='/ht.php';</script>";
}
}
//下线
?>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".cc").click(function(){
$(".yy").slideToggle("slow");
});
});
</script>