工会web
This commit is contained in:
40
GonghuiWeb/inc/smarty.php
Normal file
40
GonghuiWeb/inc/smarty.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
include_once($GG['Config']['Folder']."../ppxq/Smarty.class.php");
|
||||
include_once($GG['Config']['Folder']."../ppxq/Config_File.class.php");
|
||||
include_once($GG['Config']['Folder']."../ppxq/Smarty_Compiler.class.php");
|
||||
$ppxq = new Smarty;
|
||||
$ppxq -> template_dir = $GG['Config']['Folder']."m/"; //模板存放目录
|
||||
$ppxq -> compile_dir = $GG['Config']['Folder']."m_c/"; //编译目录
|
||||
$ppxq -> config_dir = $GG['Config']['Folder']."configs/"; //常量 {config_load file='foo.conf'}
|
||||
$ppxq -> cache_dir = $GG['Config']['Folder']."cache/";//缓存目录
|
||||
$ppxq -> left_delimiter = "<!--{"; //左定界符
|
||||
$ppxq -> right_delimiter = "}-->"; //右定界符
|
||||
//通用配置
|
||||
$db = new yuwen;
|
||||
$db -> links();
|
||||
//自动切换上下学期
|
||||
if(in_array(date('m'),explode('-',$CONFIG['ALL']['yue']))){//上学期
|
||||
$CON['kg']=0;
|
||||
$CON['xq']=$db->getloop("*",TABLE."grade","cycle=0 && kg=0 && typeid=1","sort asc,id asc");
|
||||
$CON['gz']=$db->getloop("*",TABLE."grade","cycle=0 && kg=0 && typeid=2","sort asc,id asc");
|
||||
$CON['xx']=$db->getloop("*",TABLE."grade","cycle=0 && kg=0 && typeid=3","sort asc,id asc");
|
||||
$config_sxq=$CONFIG['ALL']['sxq'];
|
||||
for($i=1;$i<=$config_sxq;$i++){$zhou[]=sprintf("%02d", $i);}//上学期周数
|
||||
}else{//下学期
|
||||
$CON['kg']=1;
|
||||
$CON['xq']=$db->getloop("*",TABLE."grade","cycle=1 && kg=0 && typeid=1","sort asc,id asc");
|
||||
$CON['gz']=$db->getloop("*",TABLE."grade","cycle=1 && kg=0 && typeid=2","sort asc,id asc");
|
||||
$CON['xx']=$db->getloop("*",TABLE."grade","cycle=1 && kg=0 && typeid=3","sort asc,id asc");
|
||||
$config_xxq=$CONFIG['ALL']['xxq'];
|
||||
for($i=1;$i<=$config_xxq;$i++){$zhou[]=sprintf("%02d", $i);}//下学期周数
|
||||
}
|
||||
$ppxq -> assign('CON',$CON);//配置
|
||||
$ppxq -> assign('Zhou',$zhou);//周
|
||||
$ppxq -> assign('TOP',$db->getloop("*",TABLE."info","top=1","sort desc,id asc"));//导航
|
||||
$ppxq -> assign('BOTTOM',$db->getloop("*",TABLE."info","bottom=1","sort desc,id asc"));//页尾
|
||||
$ppxq -> assign('Week',$week = array('','星期一','星期二','星期三','星期四','星期五','周 末'));
|
||||
$ppxq -> assign('CONFIG',$CONFIG);//配置
|
||||
if($_COOKIE["XQ_USERNAME"]){
|
||||
$member_cid=substr($db->getdy("id",TABLE."member","username='".$_COOKIE["XQ_USERNAME"]."'"),-1);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user