⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin.php

📁 功能齐全
💻 PHP
字号:
<?php
require_once("config.inc.php");
require_once("include/DataSet.inc.php");
require_once("include/DB.inc.php");
require_once("include/Vant.inc.php");
require_once("include/OutputHtml.inc.php");
require_once("include/Language.inc.php");


$db   = & new DB(HOST,USERNAME,PASSWORD,DATABASE,'');
$db->connect();
$data = & new DataSet($db);
$tpl  = & new Vant("templates/");
$sys_lang = & new Language("include/language/");
$sys_lang->setLanguage();

require_once($sys_lang->getLangfile());
require_once("function.php");

$tpl->set("sitename","Friends!婚介交友系统管理中心");

$gourl=getFromUrl();
$admin = $_COOKIE['loginname'];
if($admin=='')
{
	$tpl->set("msg",$lang_sysmsg['nologin']);
	$tpl->set("gourl","index.php");
	$tpl->set("timesup","2000");
	$tpl->set("main_middle","sysmsg.html");
	$tpl->parse("admin_main.html");
	phpexit();
}
//$res = $db->query("select grade from friends_user where username='$admin'");
//$arr = $db->fetch_array($res);
//if($arr["grade"]>0)
if(!isAdmin($admin))
{
	$tpl->set("msg",$system_msg["2006"]);
	$tpl->set("gourl","index.php");
	$tpl->set("timesup","2000");
	$tpl->set("main_middle","sysmsg.html");
	$tpl->parse("admin_main.html");
	phpexit();
}
if($_GET['op'] == '' && $_POST['op'] == '')
{
	$tpl->set("main_middle","copyright.html");
	$tpl->parse("admin_main.html");
	phpexit();
}
$op = $_GET['op'] != '' ? $_GET['op']:$_POST['op'];
call_user_func($op);
phpexit();

function phpexit()
{
	global $db;
	$db->close();
	exit;
}

function FindMember()
{
	global $tpl;
	$tpl->set("main_middle","search.html");
	$tpl->parse("admin_main.html");
}

function DelMember()
{
	global $db,$tpl,$system_msg;
	$username = $_GET['name'];
	global $gourl;
	$str1 = "delete from friends_user where username='$username'";
	$str2 = "delete from album_user where username='$username'";
	$db->query($str1);
	$db->query($str2);
	$tpl->set("msg",$system_msg["2014"]);
	$tpl->set("gourl",$gourl);
	$tpl->set("timesup",2000);
	$tpl->set("main_middle","sysmsg.html");
	$tpl->parse("admin_main.html");
}

function CheckReg()
{
	global $db,$data,$tpl,$lang_nav,$system_msg,$gourl;
	$result=$_GET['result']!=''?$_GET['result']:$_POST['result'];
	$select=$_GET['select']!=''?$_GET['select']:$_POST['select'];
	if ($result==1)
	{
		$n=count($select);
		for($i=0;$i<$n;$i++)
		{
			$id=$select[$i];
			$user=getUser($id);
			$to=$user[1];
			$db->query("update friends_user set active='1' where id='$id'");
			email_approved($to,1,1);
		}
		$tpl->set("msg",$system_msg['2015']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	elseif ($result==2)
	{
		$n=count($select);
		for($i=0;$i<$n;$i++)
		{
			$id=$select[$i];
			$user=getUser($id);
			$to=$user[1];			
			email_approved($to,2,1);
		}
		$tpl->set("msg",$system_msg['2016']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$str="select id,username,joindate,ip from friends_user where active='0'";
		$coObj = $data->getList($str,20);
		$coObj->navchar=$lang_nav;
		$tpl->set("navbar",$coObj->navbar(10));
		$tpl->set("list",$coObj->field);
		$tpl->set("pagejump",$coObj->pagejump());
		$tpl->set("main_middle","admin_checkreg.html");
		$tpl->parse("admin_main.html");
	}
}

function CheckPic()
{
	global $db,$data,$tpl,$lang_nav,$system_msg,$gourl;
	$result=$_GET['result']!=''?$_GET['result']:$_POST['result'];
	$select=$_GET['select']!=''?$_GET['select']:$_POST['select'];
	if($result==1)
	{
		$n=count($select);
		for($i=0;$i<$n;$i++)
		{
			$id=$select[$i];
			$db->query("update user_album set approved='1' where ID='$id'");
		}
		$tpl->set("msg",$system_msg['2019']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	elseif($result==2)
	{
		$n=count($select);
		for($i=0;$i<$n;$i++)
		{
			$id=$select[$i];
			$arr=$db->fetch_array($db->query("select path from user_album where ID='$id'"));
			$pic=$arr["path"];
			$db->query("delete from user_album where ID='$id'");
			@unlink($pic);
		}
		$tpl->set("msg",$system_msg['2018']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$str="select * from user_album where approved='0' order by username";
		$coObj = $data->getList($str,20);
		$coObj->navchar=$lang_nav;
		$tpl->set("navbar",$coObj->navbar(10));
		$tpl->set("list",$coObj->field);
		$tpl->set("pagejump",$coObj->pagejump());
		$tpl->set("main_middle","admin_checkpic.html");
		$tpl->parse("admin_main.html");
	}
}

function EditAlbum()
{
	global $db,$data,$tpl,$lang_nav,$system_msg;
	if($_GET['user']!='')
	{
		//setcookie("user",$_GET['user'],3600*24*20);
		session_start();
		if(isset($_SESSION['user']))
		{
			session_register('user');
		}
		$_SESSION['user']=$_GET['user'];
		$tpl->set("msg",sprintf($system_msg['2017'],$_SESSION['user']));
		$tpl->set("gourl","album.php");
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$name=$_POST['name'];
		$str="select * from friends_user where grade>0 ";
		if($name!='')$str .= "and username='$name' ";
		$str .= "order by joindate DESC";
		
		$coObj = $data->getList($str,20);
		$coObj->navchar=$lang_nav;
		$tpl->set("navbar",$coObj->navbar(10));
		$tpl->set("list",$coObj->field);
		$tpl->set("pagejump",$coObj->pagejump());
		$tpl->set("main_middle","admin_albumlist.html");
		$tpl->parse("admin_main.html");
	}
}

function SetPoint()
{
	global $db,$data,$tpl,$lang_nav,$system_msg,$gourl;
	if($_POST['Submit']!='')
	{
		$pnt=$_POST['pnt'];
		$n=count($pnt);
		for($i=1;$i<=$n;$i++)
		{
			$newnum=$pnt[$i-1];
			$db->query("update friends_setpnt set num='$newnum' where id='$i'");
		}
		$tpl->set("msg",$system_msg['2020']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$str="select * from friends_setpnt";
		$coObj = $data->getList($str,10);
		$coObj->navchar=$lang_nav;
		$tpl->set("navbar",$coObj->navbar(10));
		$tpl->set("list",$coObj->field);
		$tpl->set("pagejump",$coObj->pagejump());
		$tpl->set("main_middle","admin_setpoint.html");
		$tpl->parse("admin_main.html");
	}
}

function PutPoint()
{
	global $db,$tpl,$system_msg,$gourl;
	if($_POST["Submit"]!="")
	{
		$pnt = $_POST["pnt"];
		$usr = $_POST["usr"];
		$date = date("Y-m-d H:i:s");
		$db->query("update friends_user set money=money+'$pnt' where username='$usr'");
		$item = $system_msg['2025'];
		$db->query("insert into user_charge values('$usr','$item','$pnt','2','$date')");
		$tpl->set("msg",$system_msg['2024']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$tpl->set("main_middle","admin_putpoint.html");
		$tpl->parse("admin_main.html");
	}
}

function SetReward()
{
	global $db,$data,$tpl,$system_msg,$gourl;
	if($_POST['Submit']!='')
	{
		$r=$_POST['reward'];
		$n=count($r);
		for($i=1;$i<=$n;$i++)
		{
			$newnum=$r[$i-1];
			$db->query("update friends_conf set confvalue='$newnum' where id='$i'");
		}
		$tpl->set("msg",$system_msg['2021']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$str ="select * from friends_conf"; 
		$coObj = $data->getList($str,10);
		$tpl->set("list",$coObj->field);
		$tpl->set("main_middle","admin_reward.html");
		$tpl->parse("admin_main.html");
	}	
}

function NewWords()
{
	global $db,$tpl,$system_msg,$gourl;
	if($_POST['Submit']!="")
	{
		$writer=$_POST['writer'];
		$from=$_POST['from'];
		$category=$_POST['category'];
		$title=$_POST['title'];
		$words=$_POST['words'];
		$date=date("Y/m/d");
		$db->query("insert into friends_words values('','$writer','$from','$category','$title','$words','$date')");
		
		$tpl->set("msg",$system_msg['2022']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$tpl->set("main_middle","article_edit.html");
		$tpl->parse("admin_main.html");
	}
}
function DelWords()
{
	global $db,$data,$tpl,$system_msg,$lang_nav,$gourl;
	if($_POST["result"]==1)
	{
		$select=$_POST["select"];
		$n=count($select);
		for($i=0;$i<$n;$i++)
		{
			$id=$select[$i];
			$db->query("delete from friends_words where id='$id'");
		}
		$tpl->set("msg",$system_msg['2023']);
		$tpl->set("gourl",$gourl);
		$tpl->set("timesup","2000");
		$tpl->set("main_middle","sysmsg.html");
		$tpl->parse("admin_main.html");
	}
	else
	{
		$str = "select * from friends_words order by category";
		$coObj = $data->getList($str,20);
		$tpl->set("list",$coObj->field);
		$tpl->set("navbar",$coObj->navbar(10));
		$tpl->set("pagejump",$coObj->pagejump());
		$tpl->set("main_middle","article_list.html");
		$tpl->parse("admin_main.html");
	}
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -