<?php

/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
include "../../include/cctvai.conn.php";
include "../function_common.php";
admincheck(3);
/*if(Smallfivesolution() == $_SERVER['SERVER_NAME']) {
} else {
    echo Smallfivesq();
    exit();
}*/
$dj=$db->num_rows($db->query("select * from " . tname('dj') . ""));
$video=$db->num_rows($db->query("select * from " . tname('video') . ""));
$user=$db->num_rows($db->query("select * from " . tname('user') . ""));

$sj=date('Ymd');
$sql="Select * from " . tname('system') . "";
$rowss=$db->getrow($sql);

if($rowss['cd_djdaytime']==$sj) {
	$db->query('update ' . tname('system') . " set cd_djmub=" . $dj . "");
} else {
	$db->query('update ' . tname('system') . " set cd_djdaymub=0 , cd_djmub=" . $dj . " , cd_djdaytime=" . $sj . "");
}
if($rowss['cd_videodaytime']==$sj) {
	$db->query('update ' . tname('system') . " set cd_videomub=" . $video . "");
} else {
	$db->query('update ' . tname('system') . " set cd_videodaymub=0 , cd_videomub=" . $video . " , cd_videodaytime=" . $sj . "");
}
if($rowss['cd_userdaytime']==$sj) {
	$db->query('update ' . tname('system') . " set cd_usermub=" . $user . "");
} else {
	$db->query('update ' . tname('system') . " set cd_userdaymub=0, cd_usermub=" . $user . " , cd_userdaytime=" . $sj . "");
}
echo "<script>window.location='../admin_index.php'</script>";
?>