├── !!!readme ├── 10.jpg ├── 11.jpg ├── 12.jpg ├── 13.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg ├── 7.jpg ├── 8.jpg └── 9.jpg ├── LICENSE ├── README.md ├── api.php ├── api └── checkcode.php ├── caches ├── caches_commons │ └── caches_data │ │ └── common.cache.php ├── configs │ ├── cache.php │ ├── database.php │ ├── route.php │ ├── sub_config.php │ └── system.php └── error_log.php ├── data └── sql_yuyue_lite_db.sql ├── index.php ├── source ├── base.php ├── libs │ ├── classes │ │ ├── application.class.php │ │ ├── cache_factory.class.php │ │ ├── cache_file.class.php │ │ ├── cache_memcache.class.php │ │ ├── checkcode.class.php │ │ ├── db.class.php │ │ ├── db_factory.class.php │ │ ├── form.class.php │ │ ├── model.class.php │ │ ├── mysql.class.php │ │ ├── param.class.php │ │ ├── session_files.class.php │ │ ├── session_mysql.class.php │ │ └── tree.class.php │ ├── data │ │ ├── dict │ │ │ └── dict.csv │ │ ├── font │ │ │ ├── Vineta.ttf │ │ │ ├── elephant.ttf │ │ │ └── georgia.ttf │ │ └── ipdata │ │ │ └── mini.Dat │ └── functions │ │ ├── dir.func.php │ │ ├── extention.func.php │ │ ├── global.func.php │ │ ├── iconv.func.php │ │ └── mail.func.php ├── model │ ├── admin_model.class.php │ ├── adminlogs_model.class.php │ ├── bmfz_model.class.php │ ├── bzks_model.class.php │ ├── diqu_model.class.php │ ├── edlogs_model.class.php │ ├── email_model.class.php │ ├── ipbanned_model.class.php │ ├── jzqk_model.class.php │ ├── log_model.class.php │ ├── lyfs_model.class.php │ ├── menu_model.class.php │ ├── pbqk_data_model.class.php │ ├── pbqk_model.class.php │ ├── session_model.class.php │ ├── site_model.class.php │ ├── times_model.class.php │ ├── wlxf_data_model.class.php │ ├── wlxf_model.class.php │ ├── wlzh_data_model.class.php │ ├── yuyue_data_model.class.php │ ├── yuyue_model.class.php │ ├── yytj_model.class.php │ ├── zjys_model.class.php │ └── zxzy_model.class.php └── modules │ └── admin │ ├── anls.php │ ├── classes │ ├── admin.class.php │ └── admin_op.class.php │ ├── comp.php │ ├── dyua.php │ ├── edlg.php │ ├── functions │ ├── admin.func.php │ └── comm.func.php │ ├── index.php │ ├── line.php │ ├── main.php │ ├── quer.php │ ├── repo.php │ ├── sysm.php │ ├── templates │ ├── anls_chart.tpl.php │ ├── anls_chart_column.tpl.php │ ├── anls_chart_line.tpl.php │ ├── anls_chart_pie.tpl.php │ ├── comp_wlxf_edit.tpl.php │ ├── comp_wlxf_list.tpl.php │ ├── dyua_edit.tpl.php │ ├── dyua_list.tpl.php │ ├── edlg_list.tpl.php │ ├── elem.tpl.php │ ├── footer.tpl.php │ ├── header.tpl.php │ ├── index.tpl.php │ ├── line_edit.tpl.php │ ├── line_list.tpl.php │ ├── login.tpl.php │ ├── main_edit.tpl.php │ ├── main_list.tpl.php │ ├── msdialog.tpl.php │ ├── navier.tpl.bak.php │ ├── navier.tpl.php │ ├── repo_comm.tpl.php │ ├── repo_dyuan.tpl.php │ ├── showmessage.tpl.php │ ├── sysm_commset.tpl.php │ ├── sysm_emailset.tpl.php │ ├── sysm_loginlogs.tpl.php │ ├── sysm_siteset.tpl.php │ ├── user_changepwd.tpl.php │ ├── user_edituser.tpl.php │ └── user_userlist.tpl.php │ ├── user.php │ └── webctrl.php ├── statics ├── css │ ├── daterangepicker-bs3.css │ └── master.css ├── images │ ├── sorter_asc.gif │ ├── sorter_bg.gif │ └── sorter_desc.gif └── js │ ├── date_metro.js │ ├── daterangepicker.js │ ├── highcharts.js │ ├── index.js │ ├── jquery.tablesorter.js │ ├── moment.js │ ├── moment.min.js │ ├── moo.fx.js │ ├── moo.fx.pack.js │ ├── plugin.js │ └── prototype.lite.js └── webctrl.php /!!!readme/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/10.jpg -------------------------------------------------------------------------------- /!!!readme/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/11.jpg -------------------------------------------------------------------------------- /!!!readme/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/12.jpg -------------------------------------------------------------------------------- /!!!readme/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/13.jpg -------------------------------------------------------------------------------- /!!!readme/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/2.jpg -------------------------------------------------------------------------------- /!!!readme/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/3.jpg -------------------------------------------------------------------------------- /!!!readme/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/4.jpg -------------------------------------------------------------------------------- /!!!readme/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/5.jpg -------------------------------------------------------------------------------- /!!!readme/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/6.jpg -------------------------------------------------------------------------------- /!!!readme/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/7.jpg -------------------------------------------------------------------------------- /!!!readme/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/8.jpg -------------------------------------------------------------------------------- /!!!readme/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/!!!readme/9.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##网络在线预约管理系统 2 | 3 | @(发布)[预约管理系统,预约系统,网络预约管理] 4 | >基于PHP MVC架构+Bootstrap前端的高效、简洁网络在线预约管理系统,灵活的交叉权限控制,多样的数据图表,各项数据的分类统计报表。 5 | 6 | ###环境 7 | PHP 5.26 **高版本的PHP环境会报错以后会修复** 8 | MYSQL >=5.1 9 | 10 | ###配置 11 | 12 | - sql数据文件:\data\sql_yuyue_lite_db 13 | - 系统配置:\caches\configs\system.php 14 | - 数据库配置:\caches\configs\database.php 15 | 16 | ###登录管理 17 | 18 | - 地址:/webctrl.php 19 | - 用户名:yltuan 20 | - 密码:123456 21 | 22 | ###特性 23 | 1. 灵活的权限分配; 24 | 2. 基于Bootstrap简洁精巧的管理界面; 25 | 4. 高效的数据查询导出管理; 26 | 3. 高效多样的数据分类统计图表、报表; 27 | 5. 预约数据编辑历史记录查看功能; 28 | 29 | ###更多支持 30 | - QQ182860914 31 | 32 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121052_fc9651b8_84445.jpeg "网络在线预约管理系统") 33 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121115_155ca39f_84445.jpeg "网络在线预约管理系统") 34 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121126_5ca91015_84445.jpeg "网络在线预约管理系统") 35 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121136_52056398_84445.jpeg "网络在线预约管理系统") 36 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121144_a2b7b238_84445.jpeg "网络在线预约管理系统") 37 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121152_0c4ffd00_84445.jpeg "网络在线预约管理系统") 38 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121214_53b3d95f_84445.jpeg "网络在线预约管理系统") 39 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121223_72b8bd8a_84445.jpeg "网络在线预约管理系统") 40 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121230_9c15ed95_84445.jpeg "网络在线预约管理系统") 41 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121238_6b8806ce_84445.jpeg "网络在线预约管理系统") 42 | ![网络在线预约管理系统](http://git.oschina.net/uploads/images/2016/0514/121245_d42399ca_84445.jpeg "网络在线预约管理系统") 43 | 44 | ###赞赏支持 45 | 你的赞赏是我的动力: 46 | ####普通赞赏通道—— 47 | 48 | ![微信赞赏](http://git.oschina.net/uploads/images/2016/0514/121324_a21f73bd_84445.jpeg "普通赞赏通道") 49 | 50 | ####土豪赞赏通道—— 51 | ![土豪赞赏通道](http://git.oschina.net/uploads/images/2016/0514/121408_7412cdf9_84445.jpeg "土豪赞赏通道") -------------------------------------------------------------------------------- /api.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api/checkcode.php: -------------------------------------------------------------------------------- 1 | code_len = intval($_GET['code_len']); 9 | if ($checkcode->code_len > 8 || $checkcode->code_len < 2) { 10 | $checkcode->code_len = 4; 11 | } 12 | if (isset($_GET['font_size']) && intval($_GET['font_size'])) $checkcode->font_size = intval($_GET['font_size']); 13 | if (isset($_GET['width']) && intval($_GET['width'])) $checkcode->width = intval($_GET['width']); 14 | if ($checkcode->width <= 0) { 15 | $checkcode->width = 130; 16 | } 17 | 18 | if (isset($_GET['height']) && intval($_GET['height'])) $checkcode->height = intval($_GET['height']); 19 | if ($checkcode->height <= 0) { 20 | $checkcode->height = 50; 21 | } 22 | $max_width = $checkcode->code_len * 28; 23 | $max_height = $checkcode->font_size * 2; 24 | if($checkcode->width > $max_width) $checkcode->width = $max_width; 25 | if($checkcode->height > $max_height) $checkcode->height = $max_height; 26 | 27 | if (isset($_GET['font_color']) && trim(urldecode($_GET['font_color'])) && preg_match('/(^#[a-z0-9]{6}$)/im', trim(urldecode($_GET['font_color'])))) $checkcode->font_color = trim(urldecode($_GET['font_color'])); 28 | if (isset($_GET['background']) && trim(urldecode($_GET['background'])) && preg_match('/(^#[a-z0-9]{6}$)/im', trim(urldecode($_GET['background'])))) $checkcode->background = trim(urldecode($_GET['background'])); 29 | $checkcode->doimage(); 30 | $_SESSION['code']=$checkcode->get_code(); -------------------------------------------------------------------------------- /caches/caches_commons/caches_data/common.cache.php: -------------------------------------------------------------------------------- 1 | 'admin@admin.cn', 5 | 'maxloginfailedtimes' => '8', 6 | 'minrefreshtime' => '2', 7 | 'mail_type' => '1', 8 | 'mail_server' => 'smtp.qq.com', 9 | 'mail_port' => '25', 10 | 'category_ajax' => '0', 11 | 'mail_user' => 'admin.cn@foxmail.com', 12 | 'mail_auth' => '1', 13 | 'mail_from' => 'admin.cn@foxmail.com', 14 | 'mail_password' => '', 15 | 'errorlog_size' => '20', 16 | ); 17 | ?> -------------------------------------------------------------------------------- /caches/configs/cache.php: -------------------------------------------------------------------------------- 1 | array ( 5 | 'type' => 'file', 6 | 'debug' => true, 7 | 'pconnect' => 0, 8 | 'autoconnect' => 0 9 | ), 10 | 'template' => array ( 11 | 'hostname' => '210.78.140.2', 12 | 'port' => 11211, 13 | 'timeout' => 0, 14 | 'type' => 'memcache', 15 | 'debug' => true, 16 | 'pconnect' => 0, 17 | 'autoconnect' => 0 18 | ) 19 | ); 20 | ?> -------------------------------------------------------------------------------- /caches/configs/database.php: -------------------------------------------------------------------------------- 1 | array ( 5 | 'hostname' => '127.0.0.1:3306', 6 | 'database' => 'sql_yuyue_lite_db', 7 | 'username' => 'root', 8 | 'password' => '123654', 9 | 'tablepre' => 'v9tb_', 10 | 'charset' => 'utf8', 11 | 'type' => 'mysql', 12 | 'debug' => true, 13 | 'pconnect' => 0, 14 | 'autoconnect' => 0 15 | ), 16 | ); 17 | 18 | ?> -------------------------------------------------------------------------------- /caches/configs/route.php: -------------------------------------------------------------------------------- 1 | array( 6 | * 'm'=>'main', 7 | * 'c'=>'index', 8 | * 'a'=>'init', 9 | * 'data'=>array( 10 | * 'POST'=>array( 11 | * 'catid'=>1 12 | * ), 13 | * 'GET'=>array( 14 | * 'contentid'=>1 15 | * ) 16 | * ) 17 | * ) 18 | * 基中“m”为模型,“c”为控制器,“a”为事件,“data”为其他附加参数。 19 | * data为一个二维数组,可设置POST和GET的默认参数。POST和GET分别对应PHP中的$_POST和$_GET两个超全局变量。在程序中您可以使用$_POST['catid']来得到data下面POST中的数组的值。 20 | * data中的所设置的参数等级比较低。如果外部程序有提交相同的名字的变量,将会覆盖配置文件中所设置的值。如: 21 | * 外部程序POST了一个变量catid=2那么你在程序中使用$_POST取到的值是2,而不是配置文件中所设置的1。 22 | */ 23 | return array( 24 | 'default'=>array('m'=>'content', 'c'=>'index', 'a'=>'init'), 25 | ); -------------------------------------------------------------------------------- /caches/configs/sub_config.php: -------------------------------------------------------------------------------- 1 | 1 //电话修改设置 0不能修改 1可以修改 >1分钟限制 4 | ); 5 | ?> -------------------------------------------------------------------------------- /caches/configs/system.php: -------------------------------------------------------------------------------- 1 | '/', 5 | //Session配置 6 | 'session_storage' => 'mysql', 7 | 'session_ttl' => 1800, 8 | 'session_savepath' => CACHE_PATH.'sessions/', 9 | 'session_n' => 0, 10 | //Cookie配置 11 | 'cookie_domain' => '', //Cookie 作用域 12 | 'cookie_path' => '', //Cookie 作用路径 13 | 'cookie_pre' => 'TPFct_', //Cookie 前缀,同一域名下安装多套系统时,请修改Cookie前缀 14 | 'cookie_ttl' => 0, //Cookie 生命周期,0 表示随浏览器进程 15 | //模板相关配置 16 | 'tpl_root' => 'templates/', //模板保存物理路径 17 | 'tpl_name' => 'default', //当前模板方案目录 18 | 'tpl_css' => 'default', //当前样式目录 19 | 'tpl_referesh' => 1, 20 | 'tpl_edit'=>0,//是否允许在线编辑模板 21 | 22 | //附件相关配置 23 | 'upload_path' => RUN_PATH.'uploadfile/', 24 | 'upload_url' => '/uploadfile/', //附件路径 25 | 'attachment_stat' => '1',//是否记录附件使用状态 0 统计 1 统计, 注意: 本功能会加重服务器负担 26 | 27 | 'js_path' => '/statics/js/', //CDN JS 28 | 'css_path' => '/statics/css/', //CDN CSS 29 | 'img_path' => '/statics/images/', //CDN img 30 | 'app_path' => '/',//动态域名配置地址 31 | 32 | 'charset' => 'utf-8', //网站字符集 33 | 'timezone' => 'Etc/GMT-8', //网站时区(只对php 5.1以上版本有效),Etc/GMT-8 实际表示的是 GMT+8 34 | 'debug' => 0, //是否显示调试信息 35 | 'admin_log' => 1, //是否记录后台操作日志 36 | 'errorlog' => 1, //1、保存错误日志到 cache/error_log.php | 0、在页面直接显示 37 | 'gzip' => 1, //是否Gzip压缩后输出 38 | 'auth_key' => 'UB3DPguSb6x88NnPnOsd', //密钥 39 | 'lang' => 'zh-cn', //网站语言包 40 | 'lock_ex' => '1', //写入缓存时是否建立文件互斥锁定(如果使用nfs建议关闭) 41 | 42 | 'admin_founders' => '1', //网站创始人ID,多个ID逗号分隔 43 | 'admin_super' => 'yltuan', //网站超级管理员CID 44 | 'execution_sql' => 0, //EXECUTION_SQL 45 | 46 | 'safe_card'=>'1',//是否启用口令卡 47 | 48 | 'plugin_debug' => '0', //插件测试 49 | 'admin_url' => '', //允许访问后台的域名 50 | ); 51 | ?> -------------------------------------------------------------------------------- /caches/error_log.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/caches/error_log.php -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | route_m()); 17 | define('ROUTE_C', $param->route_c()); 18 | define('ROUTE_A', $param->route_a()); 19 | $this->init(); 20 | } 21 | 22 | /** 23 | * 调用件事 24 | */ 25 | private function init() { 26 | $controller = $this->load_controller(); 27 | if (method_exists($controller, ROUTE_A)) { 28 | if (preg_match('/^[_]/i', ROUTE_A)) { 29 | exit('You are visiting the action is to protect the private action'); 30 | } else { 31 | call_user_func(array($controller, ROUTE_A)); 32 | } 33 | } else { 34 | exit('Action does not exist.'); 35 | } 36 | } 37 | 38 | /** 39 | * 加载控制器 40 | * @param string $filename 41 | * @param string $m 42 | * @return obj 43 | */ 44 | private function load_controller($filename = '', $m = '') { 45 | if (empty($filename)) $filename = ROUTE_C; 46 | if (empty($m)) $m = ROUTE_M; 47 | $filepath = PC_PATH.'modules'.DIRECTORY_SEPARATOR.$m.DIRECTORY_SEPARATOR.$filename.'.php'; 48 | //exit($filepath); 49 | if (file_exists($filepath)) { 50 | $classname = $filename; 51 | include $filepath; 52 | if ($mypath = pc_base::my_path($filepath)) { 53 | $classname = 'MY_'.$filename; 54 | include $mypath; 55 | } 56 | if(class_exists($classname)){ 57 | return new $classname; 58 | }else{ 59 | exit('Controller does not exist.'); 60 | } 61 | } else { 62 | exit('Controller does not exist.'); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /source/libs/classes/cache_factory.class.php: -------------------------------------------------------------------------------- 1 | cache_config = $cache_config; 43 | } 44 | } 45 | return cache_factory::$cache_factory; 46 | } 47 | 48 | /** 49 | * 获取缓存操作实例 50 | * @param $cache_name 缓存配置名称 51 | */ 52 | public function get_cache($cache_name) { 53 | if(!isset($this->cache_list[$cache_name]) || !is_object($this->cache_list[$cache_name])) { 54 | $this->cache_list[$cache_name] = $this->load($cache_name); 55 | } 56 | return $this->cache_list[$cache_name]; 57 | } 58 | 59 | /** 60 | * 加载缓存驱动 61 | * @param $cache_name 缓存配置名称 62 | * @return object 63 | */ 64 | public function load($cache_name) { 65 | $object = null; 66 | if(isset($this->cache_config[$cache_name]['type'])) { 67 | switch($this->cache_config[$cache_name]['type']) { 68 | case 'file' : 69 | $object = pc_base::load_sys_class('cache_file'); 70 | break; 71 | case 'memcache' : 72 | define('MEMCACHE_HOST', $this->cache_config[$cache_name]['hostname']); 73 | define('MEMCACHE_PORT', $this->cache_config[$cache_name]['port']); 74 | define('MEMCACHE_TIMEOUT', $this->cache_config[$cache_name]['timeout']); 75 | define('MEMCACHE_DEBUG', $this->cache_config[$cache_name]['debug']); 76 | 77 | $object = pc_base::load_sys_class('cache_memcache'); 78 | break; 79 | case 'apc' : 80 | $object = pc_base::load_sys_class('cache_apc'); 81 | break; 82 | default : 83 | $object = pc_base::load_sys_class('cache_file'); 84 | } 85 | } else { 86 | $object = pc_base::load_sys_class('cache_file'); 87 | } 88 | return $object; 89 | } 90 | 91 | } 92 | ?> -------------------------------------------------------------------------------- /source/libs/classes/cache_file.class.php: -------------------------------------------------------------------------------- 1 | '.cache.php', /*缓存文件后缀*/ 8 | 'type' => 'array', /*缓存格式:array数组,serialize序列化,null字符串*/ 9 | ); 10 | 11 | /*缓存路径*/ 12 | protected $filepath = ''; 13 | 14 | /** 15 | * 构造函数 16 | * @param array $setting 缓存配置 17 | * @return void 18 | */ 19 | public function __construct($setting = '') { 20 | $this->get_setting($setting); 21 | } 22 | 23 | /** 24 | * 写入缓存 25 | * @param string $name 缓存名称 26 | * @param mixed $data 缓存数据 27 | * @param array $setting 缓存配置 28 | * @param string $type 缓存类型 29 | * @param string $module 所属模型 30 | * @return mixed 缓存路径/false 31 | */ 32 | 33 | public function set($name, $data, $setting = '', $type = 'data', $module = ROUTE_M) { 34 | $this->get_setting($setting); 35 | if(empty($type)) $type = 'data'; 36 | if(empty($module)) $module = ROUTE_M; 37 | $filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/'; 38 | $filename = $name.$this->_setting['suf']; 39 | if(!is_dir($filepath)) { 40 | mkdir($filepath, 0777, true); 41 | } 42 | 43 | if($this->_setting['type'] == 'array') { 44 | $data = ""; 45 | } elseif($this->_setting['type'] == 'serialize') { 46 | $data = serialize($data); 47 | } 48 | if ($module == 'commons' || ($module == 'commons' && substr($name, 0, 16) != 'category_content')) { 49 | $db = pc_base::load_model('cache_model'); 50 | $datas = new_addslashes($data); 51 | if ($db->get_one(array('filename'=>$filename, 'path'=>'caches_'.$module.'/caches_'.$type.'/'), '`filename`')) { 52 | $db->update(array('data'=>$datas), array('filename'=>$filename, 'path'=>'caches_'.$module.'/caches_'.$type.'/')); 53 | } else { 54 | $db->insert(array('filename'=>$filename, 'path'=>'caches_'.$module.'/caches_'.$type.'/', 'data'=>$datas)); 55 | } 56 | } 57 | 58 | //是否开启互斥锁 59 | if(pc_base::load_config('system', 'lock_ex')) { 60 | $file_size = file_put_contents($filepath.$filename, $data, LOCK_EX); 61 | } else { 62 | $file_size = file_put_contents($filepath.$filename, $data); 63 | } 64 | 65 | return $file_size ? $file_size : 'false'; 66 | } 67 | 68 | /** 69 | * 获取缓存 70 | * @param string $name 缓存名称 71 | * @param array $setting 缓存配置 72 | * @param string $type 缓存类型 73 | * @param string $module 所属模型 74 | * @return mixed $data 缓存数据 75 | */ 76 | public function get($name, $setting = '', $type = 'data', $module = ROUTE_M) { 77 | $this->get_setting($setting); 78 | if(empty($type)) $type = 'data'; 79 | if(empty($module)) $module = ROUTE_M; 80 | $filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/'; 81 | $filename = $name.$this->_setting['suf']; 82 | if (!file_exists($filepath.$filename)) { 83 | return false; 84 | } else { 85 | if($this->_setting['type'] == 'array') { 86 | $data = @require($filepath.$filename); 87 | } elseif($this->_setting['type'] == 'serialize') { 88 | $data = unserialize(file_get_contents($filepath.$filename)); 89 | } 90 | 91 | return $data; 92 | } 93 | } 94 | 95 | /** 96 | * 删除缓存 97 | * @param string $name 缓存名称 98 | * @param array $setting 缓存配置 99 | * @param string $type 缓存类型 100 | * @param string $module 所属模型 101 | * @return bool 102 | */ 103 | public function delete($name, $setting = '', $type = 'data', $module = ROUTE_M) { 104 | $this->get_setting($setting); 105 | if(empty($type)) $type = 'data'; 106 | if(empty($module)) $module = ROUTE_M; 107 | $filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/'; 108 | $filename = $name.$this->_setting['suf']; 109 | if(file_exists($filepath.$filename)) { 110 | if ($module == 'commons' && substr($name, 0, 16) != 'category_content') { 111 | $db = pc_base::load_model('cache_model'); 112 | $db->delete(array('filename'=>$filename, 'path'=>'caches_'.$module.'/caches_'.$type.'/')); 113 | } 114 | return @unlink($filepath.$filename) ? true : false; 115 | } else { 116 | return false; 117 | } 118 | } 119 | 120 | /** 121 | * 和系统缓存配置对比获取自定义缓存配置 122 | * @param array $setting 自定义缓存配置 123 | * @return array $setting 缓存配置 124 | */ 125 | public function get_setting($setting = '') { 126 | if($setting) { 127 | $this->_setting = array_merge($this->_setting, $setting); 128 | } 129 | } 130 | 131 | public function cacheinfo($name, $setting = '', $type = 'data', $module = ROUTE_M) { 132 | $this->get_setting($setting); 133 | if(empty($type)) $type = 'data'; 134 | if(empty($module)) $module = ROUTE_M; 135 | $filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/'; 136 | $filename = $filepath.$name.$this->_setting['suf']; 137 | 138 | if(file_exists($filename)) { 139 | $res['filename'] = $name.$this->_setting['suf']; 140 | $res['filepath'] = $filepath; 141 | $res['filectime'] = filectime($filename); 142 | $res['filemtime'] = filemtime($filename); 143 | $res['filesize'] = filesize($filename); 144 | return $res; 145 | } else { 146 | return false; 147 | } 148 | } 149 | 150 | } 151 | 152 | ?> -------------------------------------------------------------------------------- /source/libs/classes/cache_memcache.class.php: -------------------------------------------------------------------------------- 1 | memcache = new Memcache; 9 | $this->memcache->connect(MEMCACHE_HOST, MEMCACHE_PORT, MEMCACHE_TIMEOUT); 10 | } 11 | 12 | public function memcache() { 13 | $this->__construct(); 14 | } 15 | 16 | public function get($name) { 17 | $value = $this->memcache->get($name); 18 | return $value; 19 | } 20 | 21 | public function set($name, $value, $ttl = 0, $ext1='', $ext2='') { 22 | return $this->memcache->set($name, $value, false, $ttl); 23 | } 24 | 25 | public function delete($name) { 26 | return $this->memcache->delete($name); 27 | } 28 | 29 | public function flush() { 30 | return $this->memcache->flush(); 31 | } 32 | } 33 | ?> -------------------------------------------------------------------------------- /source/libs/classes/checkcode.class.php: -------------------------------------------------------------------------------- 1 | doimage(); 8 | * //取得验证 9 | * $_SESSION['code']=$checkcode->get_code(); 10 | */ 11 | 12 | defined('IN_SYS') or exit('No permission resources.'); 13 | class checkcode { 14 | //验证码的宽度 15 | public $width=130; 16 | 17 | //验证码的高 18 | public $height=50; 19 | 20 | //设置字体的地址 21 | private $font; 22 | 23 | //设置字体色 24 | public $font_color; 25 | 26 | //设置随机生成因子 27 | public $charset = 'abcdefghkmnprstuvwyzABCDEFGHKLMNPRSTUVWYZ23456789'; 28 | 29 | //设置背景色 30 | public $background = '#EDF7FF'; 31 | 32 | //生成验证码字符数 33 | public $code_len = 4; 34 | 35 | //字体大小 36 | public $font_size = 20; 37 | 38 | //验证码 39 | private $code; 40 | 41 | //图片内存 42 | private $img; 43 | 44 | //文字X轴开始的地方 45 | private $x_start; 46 | 47 | function __construct() { 48 | $rand = rand(0,1); 49 | if($rand==0) { 50 | $this->font = PC_PATH.'libs'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'font'.DIRECTORY_SEPARATOR.'elephant.ttf'; 51 | } else { 52 | $this->font = PC_PATH.'libs'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'font'.DIRECTORY_SEPARATOR.'Vineta.ttf'; 53 | } 54 | } 55 | 56 | /** 57 | * 生成随机验证码。 58 | */ 59 | protected function creat_code() { 60 | $code = ''; 61 | $charset_len = strlen($this->charset)-1; 62 | for ($i=0; $i<$this->code_len; $i++) { 63 | $code .= $this->charset[rand(1, $charset_len)]; 64 | } 65 | $this->code = $code; 66 | } 67 | 68 | /** 69 | * 获取验证码 70 | */ 71 | public function get_code() { 72 | return strtolower($this->code); 73 | } 74 | 75 | /** 76 | * 生成图片 77 | */ 78 | public function doimage() { 79 | $code = $this->creat_code(); 80 | $this->img = imagecreatetruecolor($this->width, $this->height); 81 | if (!$this->font_color) { 82 | $this->font_color = imagecolorallocate($this->img, rand(0,156), rand(0,156), rand(0,156)); 83 | } else { 84 | $this->font_color = imagecolorallocate($this->img, hexdec(substr($this->font_color, 1,2)), hexdec(substr($this->font_color, 3,2)), hexdec(substr($this->font_color, 5,2))); 85 | } 86 | //设置背景色 87 | $background = imagecolorallocate($this->img,hexdec(substr($this->background, 1,2)),hexdec(substr($this->background, 3,2)),hexdec(substr($this->background, 5,2))); 88 | //画一个柜形,设置背景颜色。 89 | imagefilledrectangle($this->img,0, $this->height, $this->width, 0, $background); 90 | $this->creat_font(); 91 | $this->creat_line(); 92 | $this->output(); 93 | } 94 | 95 | /** 96 | * 生成文字 97 | */ 98 | private function creat_font() { 99 | $x = $this->width/$this->code_len; 100 | for ($i=0; $i<$this->code_len; $i++) { 101 | imagettftext($this->img, $this->font_size, rand(-30,30), $x*$i+rand(0,5), $this->height/1.4, $this->font_color, $this->font, $this->code[$i]); 102 | if($i==0)$this->x_start=$x*$i+5; 103 | } 104 | } 105 | 106 | /** 107 | * 画线 108 | */ 109 | private function creat_line() { 110 | imagesetthickness($this->img, 3); 111 | $xpos = ($this->font_size * 2) + rand(-5, 5); 112 | $width = $this->width / 2.66 + rand(3, 10); 113 | $height = $this->font_size * 2.14; 114 | 115 | if ( rand(0,100) % 2 == 0 ) { 116 | $start = rand(0,66); 117 | $ypos = $this->height / 2 - rand(10, 30); 118 | $xpos += rand(5, 15); 119 | } else { 120 | $start = rand(180, 246); 121 | $ypos = $this->height / 2 + rand(10, 30); 122 | } 123 | 124 | $end = $start + rand(75, 110); 125 | 126 | imagearc($this->img, $xpos, $ypos, $width, $height, $start, $end, $this->font_color); 127 | 128 | if ( rand(1,75) % 2 == 0 ) { 129 | $start = rand(45, 111); 130 | $ypos = $this->height / 2 - rand(10, 30); 131 | $xpos += rand(5, 15); 132 | } else { 133 | $start = rand(200, 250); 134 | $ypos = $this->height / 2 + rand(10, 30); 135 | } 136 | 137 | $end = $start + rand(75, 100); 138 | 139 | imagearc($this->img, $this->width * .75, $ypos, $width, $height, $start, $end, $this->font_color); 140 | } 141 | 142 | /** 143 | * 输出图片 144 | */ 145 | private function output() { 146 | header("content-type:image/png\r\n"); 147 | imagepng($this->img); 148 | imagedestroy($this->img); 149 | } 150 | } -------------------------------------------------------------------------------- /source/libs/classes/db.class.php: -------------------------------------------------------------------------------- 1 | curlink = $link; 11 | $dbcharset && mysql_query('SET sql_mode="",NAMES "'.$dbcharset.'",CHARACTER SET '.$dbcharset.',CHARACTER_SET_RESULTS='.$dbcharset.',COLLATION_CONNECTION="'.$dbcharset.'_general_ci"', $link); 12 | if ( !@$this->select_db($dbname, $link) ){ 13 | throw new Exception('mysql:open db error',E_USER_ERROR); 14 | } 15 | } 16 | $this->querynum = 0; 17 | } 18 | 19 | function delete($table,$where='', $limit = 0, $unbuffered = true){ 20 | $sql = 'DELETE FROM '.$table.($where ? " WHERE $where" : '').($limit ? " LIMIT $limit" : ''); 21 | return $this->query($sql, ($unbuffered ? 'UNBUFFERED' : '')); 22 | } 23 | 24 | function replace($table,$data,$where,$unbuffered=true){ 25 | $d = $this->fetch_first("SELECT count(*) as is_exists FROM {$table} WHERE {$where}"); 26 | if ( $d['is_exists'] ){ 27 | $this->update($table, $data, $where, $unbuffered); 28 | }else{ 29 | $this->insert($table, $data, $unbuffered); 30 | } 31 | } 32 | 33 | function update($table, $data,$where='', $unbuffered = false){ 34 | //$data=array('key'=>'value',...); 35 | $sql = ''; 36 | foreach ($data as $k => $v) { 37 | $sql && $sql .= ','; 38 | $sql .= "`$k`='$v'"; 39 | } 40 | $where && $sql .= " WHERE $where"; 41 | return $this->query("UPDATE {$table} SET {$sql}",$unbuffered ? 'UNBUFFERED' : ''); 42 | } 43 | 44 | function insert($table, $data, $return_insert_id = false){ 45 | //$data=array('key'=>'value',...); 46 | $sql1 = $sql2 = ''; 47 | foreach ($data as $k => $v) { 48 | if ( $sql1 ){ 49 | $sql1 .= ','; 50 | $sql2 .= ','; 51 | } 52 | $sql1 .= "`$k`"; 53 | $sql2 .= "'$v'"; 54 | } 55 | $return = $this->query("INSERT INTO {$table} ({$sql1}) VALUES ({$sql2})"); 56 | if ( $return && $return_insert_id ) { 57 | $return = $this->insert_id(); 58 | } 59 | return $return; 60 | } 61 | 62 | static function connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset='utf8') { 63 | return new db($dbhost, $dbuser, $dbpw, $dbname,$dbcharset); 64 | } 65 | 66 | function select_db($dbname) { 67 | return mysql_select_db($dbname, $this->curlink); 68 | } 69 | 70 | function fetch_array($query, $result_type = MYSQL_ASSOC) { 71 | return mysql_fetch_array($query, $result_type); 72 | } 73 | 74 | function fetch_first($sql) { 75 | return $this->fetch_array($this->query($sql)); 76 | } 77 | 78 | function result_first($sql) { 79 | return $this->result($this->query($sql), 0); 80 | } 81 | 82 | function query($sql, $type = '') { 83 | $func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ? 'mysql_unbuffered_query' : 'mysql_query'; 84 | if(!($query = $func($sql, $this->curlink))) { 85 | if(in_array($this->errno(), array(2006, 2013)) && substr($type, 0, 5) != 'RETRY') { 86 | $this->connect(); 87 | return $this->query($sql, 'RETRY'.$type); 88 | } 89 | if($type != 'SILENT' && substr($type, 5) != 'SILENT') { 90 | //$this->halt('语句错误', $sql); 91 | return false; 92 | } 93 | } 94 | //echo $sql.'
'; 95 | $this->querynum++; 96 | return $query; 97 | } 98 | 99 | function affected_rows() { 100 | return mysql_affected_rows($this->curlink); 101 | } 102 | 103 | function error() { 104 | return isset($this->curlink) ? mysql_error($this->curlink) : mysql_error(); 105 | } 106 | 107 | function errno() { 108 | return isset($this->curlink) ? mysql_errno($this->curlink) : mysql_errno(); 109 | } 110 | 111 | function result($query, $row = 0) { 112 | return @mysql_result($query, $row); 113 | } 114 | 115 | function num_rows($query) { 116 | return mysql_num_rows($query); 117 | } 118 | 119 | function num_fields($query) { 120 | return mysql_num_fields($query); 121 | } 122 | 123 | function free_result($query) { 124 | return mysql_free_result($query); 125 | } 126 | 127 | function insert_id() { 128 | return ($id = mysql_insert_id($this->curlink)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); 129 | } 130 | 131 | function fetch_row($query) { 132 | $query = mysql_fetch_row($query); 133 | return $query; 134 | } 135 | 136 | function fetch_fields($query) { 137 | return mysql_fetch_field($query); 138 | } 139 | 140 | function version() { 141 | if(empty($this->version)) { 142 | $this->version = mysql_get_server_info($this->curlink); 143 | } 144 | return $this->version; 145 | } 146 | 147 | function close() { 148 | return @mysql_close($this->curlink); 149 | } 150 | 151 | function halt($message='',$sql='') { 152 | if ( $sql ){ 153 | $sql = "\r\n".$sql; 154 | } 155 | $str = $message."\r\n".$this->errno().$sql."\r\n".$this->error(); 156 | throw new Exception($str,E_USER_ERROR); 157 | //write_log(__FILE__,__line__,$str); 158 | 159 | } 160 | 161 | function __destruct(){ 162 | $this->close(); 163 | } 164 | 165 | function escape_string($str) { 166 | if ( is_array($str) ) { 167 | return array_map(array($this,'escape_string'), $str); 168 | }else{ 169 | return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $str); 170 | } 171 | //return is_array($str) ? array_map('escape_string', $str) : mysql_real_escape_string($str, $this->curlink); 172 | } 173 | 174 | 175 | function unescape_string($str) { 176 | if ( is_array($str) ) { 177 | return array_map(array($this,'unescape_string'), $str); 178 | }else{ 179 | return str_replace(array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), $str); 180 | } 181 | } 182 | 183 | static function safe_string($str) { 184 | if ( is_array($str) ) { 185 | return array_map(array($this,'safe_string'), $str); 186 | }else{ 187 | return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), '', $str); 188 | } 189 | } 190 | 191 | } 192 | -------------------------------------------------------------------------------- /source/libs/classes/db_factory.class.php: -------------------------------------------------------------------------------- 1 | db_config) db_factory::$db_factory->db_config = array_merge($db_config, db_factory::$db_factory->db_config); 45 | return db_factory::$db_factory; 46 | } 47 | 48 | /** 49 | * 获取数据库操作实例 50 | * @param $db_name 数据库配置名称 51 | */ 52 | public function get_database($db_name) { 53 | if(!isset($this->db_list[$db_name]) || !is_object($this->db_list[$db_name])) { 54 | $this->db_list[$db_name] = $this->connect($db_name); 55 | } 56 | return $this->db_list[$db_name]; 57 | } 58 | 59 | /** 60 | * 加载数据库驱动 61 | * @param $db_name 数据库配置名称 62 | * @return object 63 | */ 64 | public function connect($db_name) { 65 | $object = null; 66 | switch($this->db_config[$db_name]['type']) { 67 | case 'mysql' : 68 | pc_base::load_sys_class('mysql', '', 0); 69 | $object = new mysql(); 70 | break; 71 | case 'mysqli' : 72 | $object = pc_base::load_sys_class('mysqli'); 73 | break; 74 | case 'access' : 75 | $object = pc_base::load_sys_class('db_access'); 76 | break; 77 | default : 78 | pc_base::load_sys_class('mysql', '', 0); 79 | $object = new mysql(); 80 | } 81 | $object->open($this->db_config[$db_name]); 82 | return $object; 83 | } 84 | 85 | /** 86 | * 关闭数据库连接 87 | * @return void 88 | */ 89 | protected function close() { 90 | foreach($this->db_list as $db) { 91 | $db->close(); 92 | } 93 | } 94 | 95 | /** 96 | * 析构函数 97 | */ 98 | public function __destruct() { 99 | $this->close(); 100 | } 101 | } 102 | ?> -------------------------------------------------------------------------------- /source/libs/classes/form.class.php: -------------------------------------------------------------------------------- 1 | 35 | 36 | 37 | 38 | '; 39 | } 40 | $str .= ' '; 41 | $str .= ''; 52 | return $str; 53 | } 54 | 55 | /** 56 | * 下拉选择框 57 | */ 58 | public static function select($array = array(), $id = 0, $str = '', $default_option = '') { 59 | $string = ''; 70 | return $string; 71 | } 72 | 73 | /** 74 | * 复选框 75 | * 76 | * @param $array 选项 二维数组 77 | * @param $id 默认选中值,多个用 '逗号'分割 78 | * @param $str 属性 79 | * @param $defaultvalue 是否增加默认值 默认值为 -99 80 | * @param $width 宽度 81 | */ 82 | public static function checkbox($array = array(), $id = '', $str = '', $defaultvalue = '', $width = 0, $field = '') { 83 | $string = ''; 84 | $id = trim($id); 85 | if($id != '') $id = strpos($id, ',') ? explode(',', $id) : array($id); 86 | if($defaultvalue) $string .= ''; 87 | $i = 1; 88 | foreach($array as $key=>$value) { 89 | $key = trim($key); 90 | $checked = ($id && in_array($key, $id)) ? 'checked' : ''; 91 | if($width) $string .= ''; 94 | $i++; 95 | } 96 | return $string; 97 | } 98 | 99 | /** 100 | * 单选框 101 | * 102 | * @param $array 选项 二维数组 103 | * @param $id 默认选中值 104 | * @param $str 属性 105 | */ 106 | public static function radio($array = array(), $id = 0, $str = '', $width = 0, $field = '') { 107 | $string = ''; 108 | foreach($array as $key=>$value) { 109 | $checked = trim($id)==trim($key) ? 'checked' : ''; 110 | if($width) $string .= ''; 113 | } 114 | return $string; 115 | } 116 | 117 | /** 118 | * 验证码 119 | * @param string $id 生成的验证码ID 120 | * @param integer $code_len 生成多少位验证码 121 | * @param integer $font_size 验证码字体大小 122 | * @param integer $width 验证图片的宽 123 | * @param integer $height 验证码图片的高 124 | * @param string $font 使用什么字体,设置字体的URL 125 | * @param string $font_color 字体使用什么颜色 126 | * @param string $background 背景使用什么颜色 127 | */ 128 | public static function checkcode($id = 'checkcode',$code_len = 4, $font_size = 20, $width = 130, $height = 36, $font = '', $font_color = '', $background = '') { 129 | return ""; 130 | } 131 | } 132 | 133 | ?> -------------------------------------------------------------------------------- /source/libs/classes/model.class.php: -------------------------------------------------------------------------------- 1 | db_config[$this->db_setting])) { 25 | $this->db_setting = 'default'; 26 | } 27 | $this->table_name = $this->db_config[$this->db_setting]['tablepre'].$this->table_name; 28 | $this->db_tablepre = $this->db_config[$this->db_setting]['tablepre']; 29 | $this->db = db_factory::get_instance($this->db_config)->get_database($this->db_setting); 30 | } 31 | 32 | /** 33 | * 执行sql查询 34 | * @param $where 查询条件[例`name`='$name'] 35 | * @param $data 需要查询的字段值[例`name`,`gender`,`birthday`] 36 | * @param $limit 返回结果范围[例:10或10,10 默认为空] 37 | * @param $order 排序方式 [默认按数据库默认方式排序] 38 | * @param $group 分组方式 [默认为空] 39 | * @param $key 返回数组按键名排序 40 | * @return array 查询结果集数组 41 | */ 42 | final public function select($where = '', $data = '*', $limit = '', $order = '', $group = '', $key='') { 43 | if (is_array($where)) $where = $this->sqls($where); 44 | return $this->db->select($data, $this->table_name, $where, $limit, $order, $group, $key); 45 | } 46 | 47 | /** 48 | * 查询多条数据并分页 49 | * @param $where 50 | * @param $order 51 | * @param $page 52 | * @param $pagesize 53 | * @return unknown_type 54 | */ 55 | final public function listinfo($where = '', $order = '', $page = 1, $pagesize = 20, $key='', $setpages = 10,$urlrule = '',$array = array(), $data = '*') { 56 | $where = to_sqls($where); 57 | $this->number = $this->count($where); 58 | $page = max(intval($page), 1); 59 | $offset = $pagesize*($page-1); 60 | $this->pages = pages($this->number, $page, $pagesize, $urlrule, $array, $setpages); 61 | $array = array(); 62 | if ($this->number > 0) { 63 | return $this->select($where, $data, "$offset, $pagesize", $order, '', $key); 64 | } else { 65 | return array(); 66 | } 67 | } 68 | 69 | /** 70 | * 获取单条记录查询 71 | * @param $where 查询条件 72 | * @param $data 需要查询的字段值[例`name`,`gender`,`birthday`] 73 | * @param $order 排序方式 [默认按数据库默认方式排序] 74 | * @param $group 分组方式 [默认为空] 75 | * @return array/null 数据查询结果集,如果不存在,则返回空 76 | */ 77 | final public function get_one($where = '', $data = '*', $order = '', $group = '') { 78 | if (is_array($where)) $where = $this->sqls($where); 79 | return $this->db->get_one($data, $this->table_name, $where, $order, $group); 80 | } 81 | 82 | /** 83 | * 直接执行sql查询 84 | * @param $sql 查询sql语句 85 | * @return boolean/query resource 如果为查询语句,返回资源句柄,否则返回true/false 86 | */ 87 | final public function query($sql) { 88 | $sql = str_replace('phpapp_', $this->db_tablepre, $sql); 89 | return $this->db->query($sql); 90 | } 91 | 92 | /** 93 | * 执行添加记录操作 94 | * @param $data 要增加的数据,参数为数组。数组key为字段值,数组值为数据取值 95 | * @param $return_insert_id 是否返回新建ID号 96 | * @param $replace 是否采用 replace into的方式添加数据 97 | * @return boolean 98 | */ 99 | final public function insert($data, $return_insert_id = false, $replace = false) { 100 | return $this->db->insert($data, $this->table_name, $return_insert_id, $replace); 101 | } 102 | 103 | /** 104 | * 获取最后一次添加记录的主键号 105 | * @return int 106 | */ 107 | final public function insert_id() { 108 | return $this->db->insert_id(); 109 | } 110 | 111 | /** 112 | * 执行更新记录操作 113 | * @param $data 要更新的数据内容,参数可以为数组也可以为字符串,建议数组。 114 | * 为数组时数组key为字段值,数组值为数据取值 115 | * 为字符串时[例:`name`='phpapp',`hits`=`hits`+1]。 116 | * 为数组时[例: array('name'=>'phpapp','password'=>'123456')] 117 | * 数组的另一种使用array('name'=>'+=1', 'base'=>'-=1');程序会自动解析为`name` = `name` + 1, `base` = `base` - 1 118 | * @param $where 更新数据时的条件,可为数组或字符串 119 | * @return boolean 120 | */ 121 | final public function update($data, $where = '') { 122 | if (is_array($where)) $where = $this->sqls($where); 123 | return $this->db->update($data, $this->table_name, $where); 124 | } 125 | 126 | /** 127 | * 执行删除记录操作 128 | * @param $where 删除数据条件,不充许为空。 129 | * @return boolean 130 | */ 131 | final public function delete($where) { 132 | if (is_array($where)) $where = $this->sqls($where); 133 | return $this->db->delete($this->table_name, $where); 134 | } 135 | 136 | /** 137 | * 计算记录数 138 | * @param string/array $where 查询条件 139 | */ 140 | final public function count($where = '') { 141 | $r = $this->get_one($where, "COUNT(*) AS num"); 142 | return $r['num']; 143 | } 144 | 145 | /** 146 | * 字段求和 147 | */ 148 | final public function sum($field, $where = '') { 149 | $r = $this->get_one($where, "SUM($field) AS total"); 150 | return $r['total']; 151 | } 152 | 153 | /** 154 | * 将数组转换为SQL语句 155 | * @param array $where 要生成的数组 156 | * @param string $font 连接串。 157 | */ 158 | final public function sqls($where, $font = ' AND ') { 159 | if (is_array($where)) { 160 | $sql = ''; 161 | foreach ($where as $key=>$val) { 162 | $sql .= $sql ? " $font `$key` = '$val' " : " `$key` = '$val'"; 163 | } 164 | return $sql; 165 | } else { 166 | return $where; 167 | } 168 | } 169 | 170 | /** 171 | * 获取最后数据库操作影响到的条数 172 | * @return int 173 | */ 174 | final public function affected_rows() { 175 | return $this->db->affected_rows(); 176 | } 177 | 178 | /** 179 | * 获取数据表主键 180 | * @return array 181 | */ 182 | final public function get_primary() { 183 | return $this->db->get_primary($this->table_name); 184 | } 185 | 186 | /** 187 | * 获取表字段 188 | * @param string $table_name 表名 189 | * @return array 190 | */ 191 | final public function get_fields($table_name = '') { 192 | if (empty($table_name)) { 193 | $table_name = $this->table_name; 194 | } else { 195 | $table_name = $this->db_tablepre.$table_name; 196 | } 197 | return $this->db->get_fields($table_name); 198 | } 199 | 200 | /** 201 | * 检查表是否存在 202 | * @param $table 表名 203 | * @return boolean 204 | */ 205 | final public function table_exists($table){ 206 | return $this->db->table_exists($this->db_tablepre.$table); 207 | } 208 | 209 | /** 210 | * 检查字段是否存在 211 | * @param $field 字段名 212 | * @return boolean 213 | */ 214 | public function field_exists($field) { 215 | $fields = $this->db->get_fields($this->table_name); 216 | return array_key_exists($field, $fields); 217 | } 218 | 219 | final public function list_tables() { 220 | return $this->db->list_tables(); 221 | } 222 | /** 223 | * 返回数据结果集 224 | * @param $query (mysql_query返回值) 225 | * @return array 226 | */ 227 | final public function fetch_array() { 228 | $data = array(); 229 | while($r = $this->db->fetch_next()) { 230 | $data[] = $r; 231 | } 232 | return $data; 233 | } 234 | 235 | /** 236 | * 返回数据库版本号 237 | */ 238 | final public function version() { 239 | return $this->db->version(); 240 | } 241 | } -------------------------------------------------------------------------------- /source/libs/classes/param.class.php: -------------------------------------------------------------------------------- 1 | route_config = pc_base::load_config('route', SITE_URL) ? pc_base::load_config('route', SITE_URL) : pc_base::load_config('route', 'default'); 22 | 23 | if(isset($this->route_config['data']['POST']) && is_array($this->route_config['data']['POST'])) { 24 | foreach($this->route_config['data']['POST'] as $_key => $_value) { 25 | if(!isset($_POST[$_key])) $_POST[$_key] = $_value; 26 | } 27 | } 28 | if(isset($this->route_config['data']['GET']) && is_array($this->route_config['data']['GET'])) { 29 | foreach($this->route_config['data']['GET'] as $_key => $_value) { 30 | if(!isset($_GET[$_key])) $_GET[$_key] = $_value; 31 | } 32 | } 33 | if(isset($_GET['page'])) { 34 | $_GET['page'] = max(intval($_GET['page']),1); 35 | $_GET['page'] = min($_GET['page'],1000000000); 36 | } 37 | return true; 38 | } 39 | 40 | /** 41 | * 获取模型 42 | */ 43 | public function route_m() { 44 | $m = isset($_GET['m']) && !empty($_GET['m']) ? $_GET['m'] : (isset($_POST['m']) && !empty($_POST['m']) ? $_POST['m'] : ''); 45 | $m = $this->safe_deal($m); 46 | if (empty($m)) { 47 | return $this->route_config['m']; 48 | } else { 49 | if(is_string($m)) return $m; 50 | } 51 | } 52 | 53 | /** 54 | * 获取控制器 55 | */ 56 | public function route_c() { 57 | $c = isset($_GET['c']) && !empty($_GET['c']) ? $_GET['c'] : (isset($_POST['c']) && !empty($_POST['c']) ? $_POST['c'] : ''); 58 | $c = $this->safe_deal($c); 59 | if (empty($c)) { 60 | return $this->route_config['c']; 61 | } else { 62 | if(is_string($c)) return $c; 63 | } 64 | } 65 | 66 | /** 67 | * 获取事件 68 | */ 69 | public function route_a() { 70 | $a = isset($_GET['a']) && !empty($_GET['a']) ? $_GET['a'] : (isset($_POST['a']) && !empty($_POST['a']) ? $_POST['a'] : ''); 71 | $a = $this->safe_deal($a); 72 | if (empty($a)) { 73 | return $this->route_config['a']; 74 | } else { 75 | if(is_string($a)) return $a; 76 | } 77 | } 78 | 79 | /** 80 | * 设置 cookie 81 | * @param string $var 变量名 82 | * @param string $value 变量值 83 | * @param int $time 过期时间 84 | */ 85 | public static function set_cookie($var, $value = '', $time = 0) { 86 | $time = $time > 0 ? $time : ($value == '' ? SYS_TIME - 3600 : 0); 87 | $s = $_SERVER['SERVER_PORT'] == '443' ? 1 : 0; 88 | $var = pc_base::load_config('system','cookie_pre').$var; 89 | $_COOKIE[$var] = $value; 90 | if (is_array($value)) { 91 | foreach($value as $k=>$v) { 92 | setcookie($var.'['.$k.']', sys_auth($v, 'ENCODE'), $time, pc_base::load_config('system','cookie_path'), pc_base::load_config('system','cookie_domain'), $s); 93 | } 94 | } else { 95 | setcookie($var, sys_auth($value, 'ENCODE'), $time, pc_base::load_config('system','cookie_path'), pc_base::load_config('system','cookie_domain'), $s); 96 | } 97 | } 98 | 99 | /** 100 | * 获取通过 set_cookie 设置的 cookie 变量 101 | * @param string $var 变量名 102 | * @param string $default 默认值 103 | * @return mixed 成功则返回cookie 值,否则返回 false 104 | */ 105 | public static function get_cookie($var, $default = '') { 106 | $var = pc_base::load_config('system','cookie_pre').$var; 107 | $value = isset($_COOKIE[$var]) ? sys_auth($_COOKIE[$var], 'DECODE') : $default; 108 | if(in_array($var,array('_userid','siteid'))) { 109 | $value = intval($value); 110 | } elseif($var=='_usename') { 111 | $value = safe_replace($value); 112 | } 113 | return $value; 114 | } 115 | 116 | /** 117 | * 安全处理函数 118 | * 处理m,a,c 119 | */ 120 | private function safe_deal($str) { 121 | return str_replace(array('/', '.'), '', $str); 122 | } 123 | 124 | } 125 | ?> -------------------------------------------------------------------------------- /source/libs/classes/session_files.class.php: -------------------------------------------------------------------------------- 1 | 0 ? pc_base::load_config('system', 'session_n').';'.pc_base::load_config('system', 'session_savepath') : pc_base::load_config('system', 'session_savepath'); 7 | ini_set('session.save_handler', 'files'); 8 | session_save_path($path); 9 | session_start(); 10 | } 11 | } 12 | ?> -------------------------------------------------------------------------------- /source/libs/classes/session_mysql.class.php: -------------------------------------------------------------------------------- 1 | db = pc_base::load_model('session_model'); 19 | $this->lifetime = pc_base::load_config('system','session_ttl'); 20 | session_set_save_handler(array(&$this,'open'), array(&$this,'close'), array(&$this,'read'), array(&$this,'write'), array(&$this,'destroy'), array(&$this,'gc')); 21 | session_start(); 22 | } 23 | /** 24 | * session_set_save_handler open方法 25 | * @param $save_path 26 | * @param $session_name 27 | * @return true 28 | */ 29 | public function open($save_path, $session_name) { 30 | 31 | return true; 32 | } 33 | /** 34 | * session_set_save_handler close方法 35 | * @return bool 36 | */ 37 | public function close() { 38 | return $this->gc($this->lifetime); 39 | } 40 | /** 41 | * 读取session_id 42 | * session_set_save_handler read方法 43 | * @return string 读取session_id 44 | */ 45 | public function read($id) { 46 | $r = $this->db->get_one(array('sessionid'=>$id), 'data'); 47 | return $r ? $r['data'] : ''; 48 | } 49 | /** 50 | * 写入session_id 的值 51 | * 52 | * @param $id session 53 | * @param $data 值 54 | * @return mixed query 执行结果 55 | */ 56 | public function write($id, $data) { 57 | $uid = isset($_SESSION['ctrl_userid']) ? $_SESSION['ctrl_userid'] : 0; 58 | $roleid = isset($_SESSION['ctrl_roleid']) ? $_SESSION['ctrl_roleid'] : 0; 59 | $groupid = isset($_SESSION['ctrl_groupid']) ? $_SESSION['ctrl_groupid'] : 0; 60 | $m = defined('ROUTE_M') ? ROUTE_M : ''; 61 | $c = defined('ROUTE_C') ? ROUTE_C : ''; 62 | $a = defined('ROUTE_A') ? ROUTE_A : ''; 63 | if(strlen($data) > 255) $data = ''; 64 | $ip = ip(); 65 | $sessiondata = array( 66 | 'sessionid'=>$id, 67 | 'userid'=>$uid, 68 | 'ip'=>$ip, 69 | 'lastvisit'=>SYS_TIME, 70 | 'roleid'=>$roleid, 71 | 'groupid'=>$groupid, 72 | 'm'=>$m, 73 | 'c'=>$c, 74 | 'a'=>$a, 75 | 'data'=>$data, 76 | ); 77 | return $this->db->insert($sessiondata, 1, 1); 78 | } 79 | /** 80 | * 删除指定的session_id 81 | * 82 | * @param $id session 83 | * @return bool 84 | */ 85 | public function destroy($id) { 86 | return $this->db->delete(array('sessionid'=>$id)); 87 | } 88 | /** 89 | * 删除过期的 session 90 | * 91 | * @param $maxlifetime 存活期时间 92 | * @return bool 93 | */ 94 | public function gc($maxlifetime) { 95 | $expiretime = SYS_TIME - $maxlifetime; 96 | return $this->db->delete("`lastvisit`<$expiretime"); 97 | } 98 | } 99 | ?> -------------------------------------------------------------------------------- /source/libs/data/dict/dict.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/source/libs/data/dict/dict.csv -------------------------------------------------------------------------------- /source/libs/data/font/Vineta.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/source/libs/data/font/Vineta.ttf -------------------------------------------------------------------------------- /source/libs/data/font/elephant.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/source/libs/data/font/elephant.ttf -------------------------------------------------------------------------------- /source/libs/data/font/georgia.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/source/libs/data/font/georgia.ttf -------------------------------------------------------------------------------- /source/libs/data/ipdata/mini.Dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/source/libs/data/ipdata/mini.Dat -------------------------------------------------------------------------------- /source/libs/functions/dir.func.php: -------------------------------------------------------------------------------- 1 | $id,'parentid'=>$parentid, 'name'=>basename($v), 'dir'=>$v.'/'); 135 | $dirs = dir_tree($v.'/', $id, $dirs); 136 | } 137 | } 138 | return $dirs; 139 | } 140 | 141 | /** 142 | * 删除目录及目录下面的所有文件 143 | * 144 | * @param string $dir 路径 145 | * @return bool 如果成功则返回 TRUE,失败则返回 FALSE 146 | */ 147 | function dir_delete($dir) { 148 | $dir = dir_path($dir); 149 | if (!is_dir($dir)) return FALSE; 150 | $list = glob($dir.'*'); 151 | foreach($list as $v) { 152 | is_dir($v) ? dir_delete($v) : @unlink($v); 153 | } 154 | return @rmdir($dir); 155 | } 156 | 157 | ?> -------------------------------------------------------------------------------- /source/libs/functions/extention.func.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/libs/functions/iconv.func.php: -------------------------------------------------------------------------------- 1 | 0x80) { 61 | $thisW = substr($gbstr, 0, 2); 62 | $gbstr = substr($gbstr, 2, strlen($gbstr)); 63 | $utf8 = ''; 64 | @$utf8 = unicode_to_utf8(hexdec($CODETABLE[hexdec(bin2hex($thisW)) - 0x8080])); 65 | if($utf8 != '') { 66 | for($i = 0; $i < strlen($utf8); $i += 3) $ret .= chr(substr($utf8, $i, 3)); 67 | } 68 | } else { 69 | $ret .= substr($gbstr, 0, 1); 70 | $gbstr = substr($gbstr, 1, strlen($gbstr)); 71 | } 72 | } 73 | return $ret; 74 | } 75 | /** 76 | * 繁体转简体 77 | * @param $Text 78 | */ 79 | function big5_to_gbk($Text) { 80 | global $BIG5_DATA; 81 | if(empty($BIG5_DATA)) { 82 | $filename = CODETABLEDIR.'big5-gb.table'; 83 | $fp = fopen($filename, 'rb'); 84 | $BIG5_DATA = fread($fp, filesize($filename)); 85 | fclose($fp); 86 | } 87 | $max = strlen($Text)-1; 88 | for($i = 0; $i < $max; $i++) { 89 | $h = ord($Text[$i]); 90 | if($h >= 0x80) { 91 | $l = ord($Text[$i+1]); 92 | if($h==161 && $l==64) { 93 | $gbstr = ' '; 94 | } else { 95 | $p = ($h-160)*510+($l-1)*2; 96 | $gbstr = $BIG5_DATA[$p].$BIG5_DATA[$p+1]; 97 | } 98 | $Text[$i] = $gbstr[0]; 99 | $Text[$i+1] = $gbstr[1]; 100 | $i++; 101 | } 102 | } 103 | return $Text; 104 | } 105 | /** 106 | * 简体转繁体 107 | * @param $Text 108 | */ 109 | function gbk_to_big5($Text) { 110 | global $GB_DATA; 111 | if(empty($GB_DATA)) { 112 | $filename = CODETABLEDIR.'gb-big5.table'; 113 | $fp = fopen($filename, 'rb'); 114 | $gb = fread($fp, filesize($filename)); 115 | fclose($fp); 116 | } 117 | $max = strlen($Text)-1; 118 | for($i = 0; $i < $max; $i++) { 119 | $h = ord($Text[$i]); 120 | if($h >= 0x80) { 121 | $l = ord($Text[$i+1]); 122 | if($h==161 && $l==64) { 123 | $big = ' '; 124 | } else { 125 | $p = ($h-160)*510+($l-1)*2; 126 | $big = $GB_DATA[$p].$GB_DATA[$p+1]; 127 | } 128 | $Text[$i] = $big[0]; 129 | $Text[$i+1] = $big[1]; 130 | $i++; 131 | } 132 | } 133 | return $Text; 134 | } 135 | /** 136 | * unicode转utf8 137 | * @param $c 138 | */ 139 | function unicode_to_utf8($c) { 140 | $str = ''; 141 | if($c < 0x80) { 142 | $str .= $c; 143 | } elseif($c < 0x800) { 144 | $str .= (0xC0 | $c >> 6); 145 | $str .= (0x80 | $c & 0x3F); 146 | } elseif($c < 0x10000) { 147 | $str .= (0xE0 | $c >> 12); 148 | $str .= (0x80 | $c >> 6 & 0x3F); 149 | $str .= (0x80 | $c & 0x3F); 150 | } elseif($c < 0x200000) { 151 | $str .= (0xF0 | $c >> 18); 152 | $str .= (0x80 | $c >> 12 & 0x3F); 153 | $str .= (0x80 | $c >> 6 & 0x3F); 154 | $str .= (0x80 | $c & 0x3F); 155 | } 156 | return $str; 157 | } 158 | /** 159 | * utf8转unicode 160 | * @param $c 161 | */ 162 | function utf8_to_unicode($c) { 163 | switch(strlen($c)) { 164 | case 1: 165 | return ord($c); 166 | case 2: 167 | $n = (ord($c[0]) & 0x3f) << 6; 168 | $n += ord($c[1]) & 0x3f; 169 | return $n; 170 | case 3: 171 | $n = (ord($c[0]) & 0x1f) << 12; 172 | $n += (ord($c[1]) & 0x3f) << 6; 173 | $n += ord($c[2]) & 0x3f; 174 | return $n; 175 | case 4: 176 | $n = (ord($c[0]) & 0x0f) << 18; 177 | $n += (ord($c[1]) & 0x3f) << 12; 178 | $n += (ord($c[2]) & 0x3f) << 6; 179 | $n += ord($c[3]) & 0x3f; 180 | return $n; 181 | } 182 | } 183 | 184 | /** 185 | * Ascii转拼音 186 | * @param $asc 187 | * @param $pyarr 188 | */ 189 | function asc_to_pinyin($asc,&$pyarr) { 190 | if($asc < 128)return chr($asc); 191 | elseif(isset($pyarr[$asc]))return $pyarr[$asc]; 192 | else { 193 | foreach($pyarr as $id => $p) { 194 | if($id >= $asc)return $p; 195 | } 196 | } 197 | } 198 | /** 199 | * gbk转拼音 200 | * @param $txt 201 | */ 202 | function gbk_to_pinyin($txt) { 203 | if(CHARSET != 'gbk') { 204 | $txt = iconv(CHARSET,'GBK',$txt); 205 | } 206 | $l = strlen($txt); 207 | $i = 0; 208 | $pyarr = array(); 209 | $py = array(); 210 | $filename = CODETABLEDIR.'gb-pinyin.table'; 211 | $fp = fopen($filename,'r'); 212 | while(!feof($fp)) { 213 | $p = explode("-",fgets($fp,32)); 214 | $pyarr[intval($p[1])] = trim($p[0]); 215 | } 216 | fclose($fp); 217 | ksort($pyarr); 218 | while($i<$l) { 219 | $tmp = ord($txt[$i]); 220 | if($tmp>=128) { 221 | $asc = abs($tmp*256+ord($txt[$i+1])-65536); 222 | $i = $i+1; 223 | } else $asc = $tmp; 224 | $py[] = asc_to_pinyin($asc,$pyarr); 225 | $i++; 226 | } 227 | return $py; 228 | } 229 | ?> -------------------------------------------------------------------------------- /source/libs/functions/mail.func.php: -------------------------------------------------------------------------------- 1 | 2, 41 | 'maildelimiter' => 1, 42 | 'mailusername' => 1, 43 | 'server' => $cfg['mail_server'], 44 | 'port' => $cfg['mail_port'], 45 | 'auth' => $cfg['mail_auth'], 46 | 'from' => $cfg['mail_from'], 47 | 'auth_username' => $cfg['mail_user'], 48 | 'auth_password' => $cfg['mail_password'] 49 | ); 50 | } 51 | //mail 发送模式 52 | if($mail_type==0) { 53 | $headers = 'MIME-Version: 1.0' . "\r\n"; 54 | $headers .= 'Content-type: text/html; charset='.CHARSET.'' . "\r\n"; 55 | $headers .= 'From: '.$sitename.' <'.$from.'>' . "\r\n"; 56 | mail($toemail, $subject, $message, $headers); 57 | return true; 58 | } 59 | //邮件头的分隔符 60 | $maildelimiter = $mail['maildelimiter'] == 1 ? "\r\n" : ($mail['maildelimiter'] == 2 ? "\r" : "\n"); 61 | //收件人地址中包含用户名 62 | $mailusername = isset($mail['mailusername']) ? $mail['mailusername'] : 1; 63 | //端口 64 | $mail['port'] = $mail['port'] ? $mail['port'] : 25; 65 | $mail['mailsend'] = $mail['mailsend'] ? $mail['mailsend'] : 1; 66 | 67 | //发信者 68 | $email_from = $from == '' ? '=?'.CHARSET.'?B?'.base64_encode($sitename)."?= <".$from.">" : (preg_match('/^(.+?) \<(.+?)\>$/',$from, $mats) ? '=?'.CHARSET.'?B?'.base64_encode($mats[1])."?= <$mats[2]>" : $from); 69 | 70 | $email_to = preg_match('/^(.+?) \<(.+?)\>$/',$toemail, $mats) ? ($mailusername ? '=?'.CHARSET.'?B?'.base64_encode($mats[1])."?= <$mats[2]>" : $mats[2]) : $toemail;; 71 | 72 | $email_subject = '=?'.CHARSET.'?B?'.base64_encode(preg_replace("/[\r|\n]/", '', '['.$sitename.'] '.$subject)).'?='; 73 | $email_message = chunk_split(base64_encode(str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", str_replace("\n\r", "\r", $message)))))); 74 | 75 | $headers = "From: $email_from{$maildelimiter}X-Priority: 3{$maildelimiter}X-Mailer: {$maildelimiter}MIME-Version: 1.0{$maildelimiter}Content-type: text/html; charset=".CHARSET."{$maildelimiter}Content-Transfer-Encoding: base64{$maildelimiter}"; 76 | 77 | if(!$fp = fsockopen($mail['server'], $mail['port'], $errno, $errstr, 30)) { 78 | runlog('SMTP', "($mail[server]:$mail[port]) CONNECT - Unable to connect to the SMTP server", 0); 79 | return false; 80 | } 81 | stream_set_blocking($fp, true); 82 | 83 | $lastmessage = fgets($fp, 512); 84 | if(substr($lastmessage, 0, 3) != '220') { 85 | runlog('SMTP', "$mail[server]:$mail[port] CONNECT - $lastmessage", 0); 86 | return false; 87 | } 88 | 89 | fputs($fp, ($mail['auth'] ? 'EHLO' : 'HELO')." \r\n"); 90 | $lastmessage = fgets($fp, 512); 91 | if(substr($lastmessage, 0, 3) != 220 && substr($lastmessage, 0, 3) != 250) { 92 | runlog('SMTP', "($mail[server]:$mail[port]) HELO/EHLO - $lastmessage", 0); 93 | return false; 94 | } 95 | 96 | while(1) { 97 | if(substr($lastmessage, 3, 1) != '-' || empty($lastmessage)) { 98 | break; 99 | } 100 | $lastmessage = fgets($fp, 512); 101 | } 102 | 103 | if($mail['auth']) { 104 | fputs($fp, "AUTH LOGIN\r\n"); 105 | $lastmessage = fgets($fp, 512); 106 | if(substr($lastmessage, 0, 3) != 334) { 107 | runlog('SMTP', "($mail[server]:$mail[port]) AUTH LOGIN - $lastmessage", 0); 108 | return false; 109 | } 110 | 111 | fputs($fp, base64_encode($mail['auth_username'])."\r\n"); 112 | $lastmessage = fgets($fp, 512); 113 | if(substr($lastmessage, 0, 3) != 334) { 114 | runlog('SMTP', "($mail[server]:$mail[port]) USERNAME - $lastmessage", 0); 115 | return false; 116 | } 117 | 118 | fputs($fp, base64_encode($mail['auth_password'])."\r\n"); 119 | $lastmessage = fgets($fp, 512); 120 | if(substr($lastmessage, 0, 3) != 235) { 121 | runlog('SMTP', "($mail[server]:$mail[port]) PASSWORD - $lastmessage", 0); 122 | return false; 123 | } 124 | 125 | $email_from = $mail['from']; 126 | } 127 | 128 | fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n"); 129 | $lastmessage = fgets($fp, 512); 130 | if(substr($lastmessage, 0, 3) != 250) { 131 | fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n"); 132 | $lastmessage = fgets($fp, 512); 133 | if(substr($lastmessage, 0, 3) != 250) { 134 | runlog('SMTP', "($mail[server]:$mail[port]) MAIL FROM - $lastmessage", 0); 135 | return false; 136 | } 137 | } 138 | 139 | fputs($fp, "RCPT TO: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $toemail).">\r\n"); 140 | $lastmessage = fgets($fp, 512); 141 | if(substr($lastmessage, 0, 3) != 250) { 142 | fputs($fp, "RCPT TO: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $toemail).">\r\n"); 143 | $lastmessage = fgets($fp, 512); 144 | runlog('SMTP', "($mail[server]:$mail[port]) RCPT TO - $lastmessage", 0); 145 | return false; 146 | } 147 | 148 | fputs($fp, "DATA\r\n"); 149 | $lastmessage = fgets($fp, 512); 150 | if(substr($lastmessage, 0, 3) != 354) { 151 | runlog('SMTP', "($mail[server]:$mail[port]) DATA - $lastmessage", 0); 152 | return false; 153 | } 154 | 155 | $headers .= 'Message-ID: <'.gmdate('YmdHs').'.'.substr(md5($email_message.microtime()), 0, 6).rand(100000, 999999).'@'.$_SERVER['HTTP_HOST'].">{$maildelimiter}"; 156 | 157 | fputs($fp, "Date: ".gmdate('r')."\r\n"); 158 | fputs($fp, "To: ".$email_to."\r\n"); 159 | fputs($fp, "Subject: ".$email_subject."\r\n"); 160 | fputs($fp, $headers."\r\n"); 161 | fputs($fp, "\r\n\r\n"); 162 | fputs($fp, "$email_message\r\n.\r\n"); 163 | $lastmessage = fgets($fp, 512); 164 | if(substr($lastmessage, 0, 3) != 250) { 165 | runlog('SMTP', "($mail[server]:$mail[port]) END - $lastmessage", 0); 166 | } 167 | fputs($fp, "QUIT\r\n"); 168 | return true; 169 | } 170 | ?> -------------------------------------------------------------------------------- /source/model/admin_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'admin'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/adminlogs_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'adminlogs'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/bmfz_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'bmfz'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/bzks_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'bzks'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/diqu_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'diqu'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/edlogs_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'edlogs'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/email_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'email'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/ipbanned_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 9 | $this->db_setting = 'default'; 10 | $this->table_name = 'ipbanned'; 11 | parent::__construct(); 12 | } 13 | 14 | /** 15 | * 16 | * 把IP进行格式化,统一为IPV4, 参数:$op --操作类型 max 表示格式为该段的最大值,比如:192.168.1.* 格式化为:192.168.1.255 ,其它任意值表示格式化最小值: 192.168.1.1 17 | * @param $op 操作类型,值为(min,max) 18 | * @param $ip 要处理的IP段(127.0.0.*) 或者IP值 (127.0.0.5) 19 | */ 20 | public function convert_ip($op,$ip){ 21 | $arr_ip = explode(".",$ip); 22 | $arr_temp = array(); 23 | $i = 0; 24 | $ip_val= $op== "max" ? "255":"1"; 25 | foreach($arr_ip as $key => $val ){ 26 | $i++; 27 | $val = $val== "*" ? $ip_val:$val; 28 | $arr_temp[]= $val; 29 | } 30 | for($i=4-$i;$i>0;$i--){ 31 | $arr_temp[]=$ip_val; 32 | } 33 | $comma = ""; 34 | foreach($arr_temp as $v){ 35 | $result.= $comma.$v; 36 | $comma = "."; 37 | } 38 | return $result; 39 | } 40 | 41 | /** 42 | * 43 | * 判断IP是否被限并返回 44 | * @param $ip 当前IP 45 | * @param $ip_from 开始IP段 46 | * @param $ip_to 结束IP段 47 | */ 48 | public function ipforbidden($ip,$ip_from,$ip_to){ 49 | $from = strcmp($ip,$ip_from); 50 | $to = strcmp($ip,$ip_to); 51 | if($from >=0 && $to <= 0){ 52 | return 0; 53 | } else { 54 | return 1; 55 | } 56 | } 57 | 58 | /** 59 | * 60 | * IP禁止判断接口,供外部调用 ... 61 | */ 62 | public function check_ip(){ 63 | $ip_array = array(); 64 | //当前IP 65 | $ip = ip(); 66 | //加载IP禁止缓存 67 | $ipbanned_cache = getcache('ipbanned','commons'); 68 | if(!empty($ipbanned_cache)) { 69 | foreach($ipbanned_cache as $data){ 70 | $ip_array[$data['ip']] = $data['ip']; 71 | //是否是IP段 72 | if(strpos($data['ip'],'*')){ 73 | $ip_min = $this->convert_ip("min",$data['ip']); 74 | $ip_max = $this->convert_ip("max",$data['ip']); 75 | $result = $this->ipforbidden($ip,$ip_min,$ip_max); 76 | if($result==0 && $data['expires']>SYS_TIME){ 77 | //被封 78 | showmessage('你在IP禁止段内,所以禁止你访问'); 79 | } 80 | } else { 81 | //不是IP段,用绝对匹配 82 | if($ip==$data['ip']&& $data['expires']>SYS_TIME){ 83 | showmessage('IP地址绝对匹配,禁止你访问'); 84 | } 85 | } 86 | } 87 | } 88 | } 89 | } 90 | ?> -------------------------------------------------------------------------------- /source/model/jzqk_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'jzqk'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/log_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'log'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/lyfs_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'lyfs'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/menu_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'menu'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/pbqk_data_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'pbqk_data'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/pbqk_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'pbqk'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/session_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'session'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/site_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'site'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/times_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'times'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/wlxf_data_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'wlxf_data'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/wlxf_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'wlxf'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/wlzh_data_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'wlzh_data'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/yuyue_data_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'yuyue_data'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/yuyue_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'yuyue'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/yytj_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'yytj'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/zjys_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'zjys'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/model/zxzy_model.class.php: -------------------------------------------------------------------------------- 1 | db_config = pc_base::load_config('database'); 8 | $this->db_setting = 'default'; 9 | $this->table_name = 'zxzy'; 10 | parent::__construct(); 11 | } 12 | } 13 | ?> -------------------------------------------------------------------------------- /source/modules/admin/classes/admin_op.class.php: -------------------------------------------------------------------------------- 1 | db = pc_base::load_model('admin_model'); 9 | } 10 | /* 11 | * 修改密码 12 | */ 13 | public function edit_password($userid, $password){ 14 | $userid = intval($userid); 15 | if($userid < 1) return false; 16 | if(!is_password($password)) 17 | { 18 | showmessdialog('密码不合法!'); 19 | return false; 20 | } 21 | $passwordinfo = password($password); 22 | return $this->db->update($passwordinfo,array('userid'=>$userid)); 23 | } 24 | /* 25 | * 检查用户名重名 26 | */ 27 | public function checkname($username) { 28 | $username = trim($username); 29 | if ($this->db->get_one(array('username'=>$username),'userid')){ 30 | return false; 31 | } 32 | return true; 33 | } 34 | } 35 | ?> -------------------------------------------------------------------------------- /source/modules/admin/comp.php: -------------------------------------------------------------------------------- 1 | db = pc_base::load_model('yuyue_model');*/ 11 | $this->wlxf_db = pc_base::load_model('wlxf_model'); 12 | $this->wlxf_db_dt = pc_base::load_model('wlxf_data_model'); 13 | $this->wlzh_db_dt = pc_base::load_model('wlzh_data_model'); 14 | } 15 | 16 | public function init () { 17 | self::public_list(); 18 | } 19 | 20 | public function public_wlxf_list() { 21 | $action=__FUNCTION__; 22 | 23 | //权限判断 24 | if(!admin::check_roid('|31,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 25 | 26 | /*$smonth=date('Y-m',SYS_TIME); 27 | $stdate=strtotime($smonth.'-1'); 28 | $endate=strtotime(date('Y-m-t',$stdate));*/ 29 | 30 | $rdate=getdaterange(trim($_GET['s'])); 31 | if($rdate['stdate']!=''&&$rdate['endate']!=''){ 32 | $stdate=$rdate['stdate']; 33 | $endate=$rdate['endate']; 34 | $where="rcdate >= '$stdate' and rcdate <= '$endate'"; 35 | } 36 | 37 | $arr_wlxf = $this->wlxf_db_dt->select($where, 'cname', '', 'cname desc', 'cname'); 38 | array_unshift($arr_wlxf,array('cname'=>'日期')); 39 | array_push($arr_wlxf,array('cname'=>'合计'));//横轴 40 | array_push($arr_wlxf,array('cname'=>'操作')); 41 | 42 | //表头设置 43 | $arr_thead=array(); 44 | 45 | foreach($arr_wlxf as $row){ 46 | foreach($row as $key=>$rowb){ 47 | //echo $key; 48 | //json_encode($rowb); 49 | $arr_thead[]=$row[$key]; 50 | } 51 | } 52 | 53 | $infos=array(); 54 | $arr=array(); 55 | $arr_wlzh = $this->wlzh_db_dt->select($where, 'id,rcdate', '', 'rcdate desc', 'rcdate'); 56 | $arr_wlzh[]=array('rcdate'=>'合计');//竖轴 57 | 58 | foreach($arr_wlzh as $row){//竖轴 59 | $arr=''; 60 | foreach($arr_wlxf as $rowb){//横轴 61 | if($rowb['cname']=='日期'){ 62 | $arr[]=$row['rcdate']=='合计' ? $row['rcdate'] : date('Y-m-d',$row['rcdate']); 63 | }elseif($rowb['cname']=='合计'){ 64 | if($row['rcdate']=='合计'){ 65 | $tdata=$this->wlxf_db_dt->sum('tgcost', $where); 66 | }else{ 67 | $tdata=$this->wlxf_db_dt->sum('tgcost', "rcdate='$row[rcdate]'"); 68 | } 69 | $arr[]=$tdata; 70 | }elseif($rowb['cname']=='操作'){ 71 | if($row['rcdate']=='合计'){ 72 | 73 | }else{ 74 | $arr[]='修改'; 75 | } 76 | }else{ 77 | if($row['rcdate']=='合计'){ 78 | $tdata=$this->wlxf_db_dt->sum('tgcost', "rcdate >= '$stdate' and rcdate <= '$endate' and cname='$rowb[cname]'"); 79 | }else{ 80 | $tdata=$this->wlxf_db_dt->sum('tgcost', "rcdate='$row[rcdate]' and cname='$rowb[cname]'"); 81 | } 82 | $arr[]=$tdata; 83 | } 84 | } 85 | $infos[]=$arr; 86 | } 87 | 88 | include $this->admin_tpl('comp_wlxf_list'); 89 | } 90 | 91 | public function public_wlxf_add() { 92 | $action=__FUNCTION__; 93 | 94 | //权限判断 95 | if(!admin::check_roid('|32,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 96 | 97 | if(isset($_GET['dosubmit'])) { 98 | $info = array(); 99 | $info = $_POST['info']; 100 | if($this->savepostedit($info)){ 101 | showmessdialog('操作成功!', 200,'./?m=admin&c=comp&a=public_wlxf_list&s=cmonth'); 102 | }else{ 103 | showmessdialog('操作出错!'); 104 | } 105 | }else{ 106 | 107 | $infos = $this->wlxf_db->listinfo('', 'listorder desc, id asc', 1, 100); 108 | $r=array(); 109 | $r['rcdate']=date('Y-m-d',strtotime('-1 day',SYS_TIME)); 110 | 111 | include $this->admin_tpl('comp_wlxf_edit'); 112 | } 113 | } 114 | 115 | public function public_wlxf_edit() { 116 | $action=__FUNCTION__; 117 | 118 | //权限判断 119 | if(!admin::check_roid('|32,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 120 | 121 | if(isset($_GET['dosubmit'])) { 122 | $info = array(); 123 | $info = $_POST['info']; 124 | $cid = intval($info['cid']); 125 | if($this->savepostedit($info, 'edit', $cid)){ 126 | showmessdialog('操作成功!', 200, './?m=admin&c=comp&a=public_wlxf_list&s=cmonth'); 127 | }else{ 128 | showmessdialog('操作出错!'); 129 | } 130 | }else{ 131 | $cid=intval($_GET['cid']); 132 | 133 | $arr_tem=array(); 134 | $infos = $this->wlxf_db_dt->listinfo("catid='$cid'", 'cname desc, id asc', 1, 100); 135 | $arr_wlxf = $this->wlxf_db->listinfo('', 'listorder desc, id asc', 1, 100); 136 | foreach($arr_wlxf as $row){ 137 | foreach($infos as $rowb){ 138 | if($rowb['cname']!=$row['cname']){ 139 | $arr_tem[]=$row; 140 | } 141 | } 142 | } 143 | $r=$this->wlzh_db_dt->get_one(array('id'=>$cid)); 144 | $r['rcdate']=date('Y-m-d',$r['rcdate']); 145 | 146 | include $this->admin_tpl('comp_wlxf_edit'); 147 | } 148 | } 149 | 150 | private function savepostedit($info, $ctrl='add', $cid=0){ 151 | 152 | if($ctrl=='edit'&&$cid==0 || $ctrl=='edit'&&$cid==''){ 153 | return false; 154 | } 155 | 156 | $info['rcdate']=strtotime($info['rcdate']); 157 | 158 | if($info['rcdate']==''){ 159 | showmessdialog('日期不能为空!'); 160 | } 161 | 162 | if($ctrl=='add'){ 163 | $r=$this->wlzh_db_dt->get_one(array('rcdate'=>$info['rcdate'])); 164 | if($r['id']!=''){ 165 | showmessdialog('当前日期已经存在记录!'); 166 | } 167 | 168 | $this->wlzh_db_dt->insert(array('rcdate'=>$info['rcdate'], 'addtime'=>SYS_TIME)); 169 | $cid=$this->wlzh_db_dt->insert_id(); 170 | if($cid){ 171 | $arr_wlxf = $this->wlxf_db->listinfo('', 'listorder desc, id asc', 1, 100); 172 | foreach($arr_wlxf as $row){ 173 | $tgcost=''; 174 | $tgcost=sprintf('%.2f', $info['wlxf'.$row['id']]); 175 | if($tgcost!=0){ 176 | $this->wlxf_db_dt->insert(array('catid'=>$cid, 'rcdate'=>$info['rcdate'], 'cname'=>$row['cname'], 'tgcost'=>$tgcost, 'addtime'=>SYS_TIME)); 177 | } 178 | } 179 | return true; 180 | }else{ 181 | return false; 182 | } 183 | } 184 | 185 | if($ctrl=='edit'){ 186 | /*$result=$this->wlxf_db->update($info, array('id'=>$cid)); 187 | if($result){ 188 | $this->wlxf_db_dt->update(array('jzremark'=>$jzremark), array('id'=>$cid)); 189 | return true; 190 | }else{ 191 | return false; 192 | }*/ 193 | } 194 | 195 | return false; 196 | } 197 | 198 | } 199 | ?> -------------------------------------------------------------------------------- /source/modules/admin/edlg.php: -------------------------------------------------------------------------------- 1 | db = pc_base::load_model('edlogs_model'); 10 | } 11 | 12 | public function init () { 13 | self::public_list(); 14 | } 15 | 16 | public function public_list() { 17 | $action=__FUNCTION__; 18 | $fromer=$_GET['c']; 19 | $ctrl=$action; 20 | 21 | $param = array(); 22 | $param = $_GET['p']; 23 | $param_fields = array('stdate', 'endate', 'keyword'); 24 | 25 | if(is_array($param)){ 26 | foreach ($param as $k=>$value) { 27 | $info[$k]=trim($value); 28 | if (!in_array($k, $param_fields)){ 29 | unset($param[$k]); 30 | } 31 | } 32 | } 33 | 34 | $sedate=date('Y-m-d',strtotime('-5 month',SYS_TIME)).' 至 '.date('Y-m-d',SYS_TIME); 35 | 36 | if($param['stdate']!=''&&$param['endate']!=''){ 37 | $stdate=strtotime($param['stdate']); 38 | $endate=strtotime($param['endate']); 39 | } 40 | 41 | //列表 42 | include $this->admin_tpl('edlg_list'); 43 | } 44 | 45 | } 46 | ?> -------------------------------------------------------------------------------- /source/modules/admin/functions/admin.func.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/modules/admin/functions/comm.func.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/modules/admin/index.php: -------------------------------------------------------------------------------- 1 | db = pc_base::load_model('admin_model'); 9 | $this->menu_db = pc_base::load_model('menu_model'); 10 | } 11 | public function init() { 12 | //代码 13 | } 14 | } 15 | ?> -------------------------------------------------------------------------------- /source/modules/admin/line.php: -------------------------------------------------------------------------------- 1 | db = pc_base::load_model('pbqk_model'); 11 | $this->db_dt = pc_base::load_model('pbqk_data_model'); 12 | } 13 | 14 | public function init () { 15 | self::public_list(); 16 | } 17 | 18 | public function public_list() { 19 | $action=__FUNCTION__; 20 | 21 | //权限判断 22 | if(!admin::check_roid('|51,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 23 | 24 | $cid=intval($_GET['s']); 25 | 26 | $arr_week=array('日','一','二','三','四','五','六'); 27 | $pbmonth=intval(date('m',SYS_TIME)); 28 | $maxday=intval(date('t',SYS_TIME)); 29 | $dclass=''; 30 | $dstyle=''; 31 | 32 | $thead=array(); 33 | $weeks=array(); 34 | $pbval=array(); 35 | 36 | for($i=1; $i<=31; $i++){ 37 | $thead[]=$i; 38 | } 39 | for($i=1; $i<=31; $i++){ 40 | $weeks[]=$arr_week[date('w',strtotime(date('Y-m',SYS_TIME)."-$i"))]; 41 | } 42 | for($i=1; $i<=31; $i++){ 43 | $pbval[]=$i; 44 | } 45 | 46 | $r = $this->db->get_one(array('id'=>$cid)); 47 | 48 | $pblist=''; 49 | $p = $this->db_dt->get_one(array('pbmonth'=>$pbmonth, 'pbsort'=>$r['cname'])); 50 | $pblist=unserialize($p['pbcontent']); 51 | 52 | for($i=1; $i<=31; $i++){ 53 | if($i>$maxday){ 54 | array_pop($thead); 55 | array_pop($weeks); 56 | array_pop($pblist); 57 | } 58 | } 59 | 60 | $actioname=$r['cname']; 61 | 62 | if($_GET['echo']=='export'){ 63 | $filename=str_replace(' ', '', $pbmonth.'月份'.$actioname); 64 | $csv_data = ','.implode(',',$thead)."\n"; 65 | 66 | ob_start(); 67 | echo $csv_data; 68 | $csv_data = ','.implode(',',$weeks)."\n"; 69 | echo $csv_data; 70 | foreach($pblist as $k=>$info) { 71 | $csv_data = ''; 72 | $csv_data .= $info[0][0]; 73 | $csv_data .= $info[0][1]."\n"; 74 | echo $csv_data; 75 | } 76 | export_csv($filename); 77 | } 78 | 79 | include $this->admin_tpl('line_list'); 80 | } 81 | 82 | public function public_pbset() { 83 | $action=__FUNCTION__; 84 | 85 | //权限判断 86 | if(!admin::check_roid('|52,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 87 | 88 | //排班设置 89 | if(isset($_GET['dosubmit'])) { 90 | $pbsort = isset($_POST['pbsort']{3}) && trim($_POST['pbsort']) ? trim($_POST['pbsort']) : showmessdialog('名称不能为空!'); 91 | $pbmonth = isset($_POST['pbmonth']) && trim($_POST['pbmonth']) ? trim($_POST['pbmonth']) : showmessdialog('月份不能为空!'); 92 | $pbdata = isset($_POST['pbdata']{3}) && trim($_POST['pbdata']) ? trim($_POST['pbdata']) : showmessdialog('排班内容不能为空!'); 93 | 94 | $pbdata_a=array(); 95 | $pbdata_b=array(); 96 | $pbdata_t=array(); 97 | 98 | $pbdata_t=explode('$',$pbdata); 99 | 100 | foreach($pbdata_t as $row) { 101 | if(trim($row)!=''){ 102 | $pbdata_b=''; 103 | $pbdata_b[]=explode('|',$row); 104 | $pbdata_a[]=$pbdata_b; 105 | } 106 | } 107 | 108 | $pbdata=serialize($pbdata_a); 109 | 110 | if($_POST['ctrl']=='modify' && $_POST['cid']!=''){ 111 | $cid=intval($_POST['cid']); 112 | $this->db_dt->update(array('pbsort'=>$pbsort, 'pbmonth'=>$pbmonth, 'pbcontent'=>$pbdata), array('id'=>$cid)); 113 | }else{ 114 | $this->db_dt->insert(array('pbsort'=>$pbsort, 'pbmonth'=>$pbmonth, 'pbcontent'=>$pbdata, 'addtime'=>SYS_TIME)); 115 | } 116 | 117 | showmessdialog('操作成功', 200, './?m=admin&c=line&a='.__FUNCTION__); 118 | 119 | }else{ 120 | $arr_week=array('日','一','二','三','四','五','六'); 121 | $maxday=intval(date('t',SYS_TIME)); 122 | $dclass=''; 123 | $dstyle=''; 124 | 125 | $thead=array(); 126 | $weeks=array(); 127 | $pblist=array(0); 128 | $pbval=array(); 129 | 130 | for($i=1; $i<=31; $i++){ 131 | $thead[]=$i; 132 | } 133 | 134 | for($i=1; $i<=31; $i++){ 135 | $weeks[]=$arr_week[date('w',strtotime(date('Y-m',SYS_TIME)."-$i"))]; 136 | } 137 | for($i=1; $i<=31; $i++){ 138 | $pbval[]=$i; 139 | } 140 | 141 | $pbqk_list = $this->db->listinfo('', 'listorder desc, id asc', 1, 100); 142 | 143 | if(isset($_GET['ctrl'])=='modify') { 144 | $pblist=''; 145 | $cid=intval($_GET['cid']); 146 | $r = $this->db_dt->get_one(array('id'=>$cid)); 147 | $r['cid']=$r['id']; 148 | $pblist=unserialize($r['pbcontent']); 149 | $ctrl='modify'; 150 | } 151 | 152 | $page = $_GET['page'] ? intval($_GET['page']) : '1'; 153 | $infos = $this->db_dt->listinfo('', 'id desc', $page, 20); 154 | $pages = $this->db_dt->pages; 155 | 156 | include $this->admin_tpl('line_edit'); 157 | } 158 | } 159 | 160 | public function deleteds(){ 161 | if(isset($_GET['dosubmit'])) { 162 | if(empty($_POST['ids'])) showmessdialog('您没有勾选信息!'); 163 | foreach($_POST['ids'] as $id) { 164 | $this->db->delete(array('id'=>$id)); 165 | } 166 | showmessdialog('操作成功', 200, 'reload'); 167 | } 168 | } 169 | 170 | } 171 | ?> -------------------------------------------------------------------------------- /source/modules/admin/quer.php: -------------------------------------------------------------------------------- 1 | userid = $_SESSION['userid']; 9 | } 10 | 11 | public function init () { 12 | $fromer = $_GET['fromer']; 13 | $ctrl = $_GET['ctrl']; 14 | $param = array(); 15 | $param = $_POST['p']; 16 | $param_fields = array('stdate', 'endate', 'keyword'); 17 | foreach ($param as $k=>$value) { 18 | $info[$k]=trim($value); 19 | if (!in_array($k, $param_fields)){ 20 | unset($param[$k]); 21 | } 22 | } 23 | //echo $fromer; 24 | if($fromer=='main'){ 25 | header("Location: ./?m=admin&c=main&p[stdate]=$param[stdate]&p[endate]=$param[endate]&p[keyword]=$param[keyword]"); 26 | } 27 | 28 | if($fromer=='edlg'){ 29 | header("Location: ./?m=admin&c=edlg&a=$ctrl&p[stdate]=$param[stdate]&p[endate]=$param[endate]&p[keyword]=$param[keyword]"); 30 | } 31 | 32 | if($fromer=='dyua'){ 33 | header("Location: ./?m=admin&c=dyua&p[stdate]=$param[stdate]&p[endate]=$param[endate]&p[keyword]=$param[keyword]"); 34 | } 35 | 36 | if($fromer=='anls'){ 37 | header("Location: ./?m=admin&c=anls&a=$ctrl&p[stdate]=$param[stdate]&p[endate]=$param[endate]"); 38 | } 39 | 40 | if($fromer=='repo'){ 41 | header("Location: ./?m=admin&c=repo&a=$ctrl&p[stdate]=$param[stdate]&p[endate]=$param[endate]"); 42 | } 43 | } 44 | 45 | } 46 | ?> -------------------------------------------------------------------------------- /source/modules/admin/templates/anls_chart.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

统计分析

14 |
选择 -> 15 | 16 |
17 | 18 | 21 | 32 |
33 | 34 | 35 | 36 |
37 | 38 | 41 | 45 |
46 | 47 |
48 |
49 | 50 | 58 |
59 |
60 |
61 | 62 |
63 |
64 | 73 | 74 | 83 | 84 | 93 | 94 |
95 | 98 |
99 | 102 |
103 |
104 |
105 |
106 |

© Bootstrap Company 2013

107 |
108 |
109 | 110 |
111 | '; 113 | include PC_PATH.'modules'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'footer.tpl.php'; 114 | ?> -------------------------------------------------------------------------------- /source/modules/admin/templates/anls_chart_column.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/modules/admin/templates/anls_chart_line.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/modules/admin/templates/anls_chart_pie.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/modules/admin/templates/comp_wlxf_edit.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 | 14 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 | 25 | 26 |
27 |
28 |
* 注:日期默认为昨天
29 |
30 | 34 |
35 | 36 |
37 |
38 |
39 | 43 |
44 | 45 |
46 | 47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | 55 |
56 |

© Bootstrap Company 2013

57 |
58 |
59 | 60 |
61 | -------------------------------------------------------------------------------- /source/modules/admin/templates/comp_wlxf_list.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

推广费用数据

14 |
15 | 导出excel 16 |
17 |
18 | 19 |
20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 | 29 | 30 | 34 | 35 | 39 | 40 | 41 | 42 | 46 | 47 | {$1}'; 50 | }else{ 51 | $boldst='{$1}'; 52 | } 53 | if(is_array($info)){ 54 | foreach($info as $arr){ 55 | ?> 56 | 57 | 61 | 62 | 66 | 67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |

© Bootstrap Company 2013

75 |
76 |
77 | 78 |
79 | -------------------------------------------------------------------------------- /source/modules/admin/templates/dyua_list.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

到院数据

14 |
列表 -> 15 | 16 | 到院日期[] 17 | 18 | 19 | 20 | 关键字[] 21 | 22 | 23 | 24 | 导出excel 25 | 26 |
27 |
28 | 43 |
44 |
45 |
46 | 47 |
48 |
49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 107 | 108 | 109 | 114 | 115 | 119 | 120 |
日期患者信息登记姓名地区电话病种预约号接诊专家咨询员预约途径就诊情况实际消费备注操作
|| 91 | '.$info['jzqk'].''; 94 | 95 | if($info['jzqk']=='消费|不足50元') 96 | $info['jzqk']=''.$info['jzqk'].''; 97 | 98 | if($info['jzqk']=='挂号没消费') 99 | $info['jzqk']=''.$info['jzqk'].''; 100 | 101 | if($info['sjxf']<50) 102 | $info['jzqk']=''.$info['jzqk'].''; 103 | 104 | echo $info['jzqk']; 105 | ?> 106 |
110 | 111 | 修改 112 | 113 |
121 |
122 |
123 | 124 | 125 | 126 | 127 |
128 |
129 |
130 |
131 | 134 | 143 |
144 |
145 |
146 |
147 |
148 |

© Bootstrap Company 2013

149 |
150 |
151 | 152 |
153 | -------------------------------------------------------------------------------- /source/modules/admin/templates/edlg_list.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

历史编辑

14 |
列表 -> 15 | 18 | 日期范围[] 19 | 22 | 25 | 关键字[] 26 | 29 | 30 |
31 |
32 | 47 |
48 |
49 |
50 | 51 |
52 |
53 |
模块正在开发中,敬请期待!…
54 |
55 |
56 |
57 |
58 |

© Bootstrap Company 2013

59 |
60 |
61 | 62 |
63 | -------------------------------------------------------------------------------- /source/modules/admin/templates/elem.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/modules/admin/templates/footer.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source/modules/admin/templates/index.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/modules/admin/templates/line_list.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

14 |
15 | 导出excel 16 |
17 |
18 | 19 |
20 |
21 |
22 | 23 |
24 |
25 |
26 | 27 |
28 |
29 |

30 |
31 |
32 | 33 | 34 | 35 | 36 | $info){ 39 | $dstyle=''; 40 | if($key>($maxday-1)){ 41 | $dstyle=' style="display:none;"'; 42 | } 43 | ?> 44 | 45 | 49 | 50 | 51 | $info){ 54 | $dstyle=''; 55 | if($key>($maxday-1)){ 56 | $dstyle=' style="display:none;"'; 57 | } 58 | ?> 59 | 60 | 64 | 65 | $info){ 68 | $pbv=explode(',', $info[0][1]); 69 | ?> 70 | 71 | 72 | $value){ 75 | $dstyle=''; 76 | if($index>($maxday-1)){ 77 | $dstyle=' style="display:none;"'; 78 | } 79 | ?> 80 | 81 | 85 | 86 | 90 | 91 |
日期
    姓名
>
>日',$info) ?>
>
92 |
93 | 94 |
95 |
96 |
97 |
98 |

© Bootstrap Company 2013

99 |
100 |
101 | 102 |
103 | -------------------------------------------------------------------------------- /source/modules/admin/templates/login.tpl.php: -------------------------------------------------------------------------------- 1 | 5 |
6 |
7 | 24 |
25 | 26 |
27 | -------------------------------------------------------------------------------- /source/modules/admin/templates/main_list.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

预约数据

14 |
列表 -> 15 | 16 | 17 | 预约日期[] 18 | 19 | 20 | 21 | 关键字[] 22 | 23 | 24 | 25 | 导出excel 26 | 27 |
28 |
29 | 44 |
45 |
46 |
47 | 48 |
49 |
50 |
51 |
52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 101 | 102 | 106 | 107 |
日期患者信息地区电话病种预约号预计时间预约专家咨询员预约途径关键词回访结果备注操作
aria-label="选择" />||~
95 | 96 | 97 | 98 | | 到院 99 | 100 |
108 |
109 |
110 | 111 | 112 | 113 | 114 |
115 |
116 |
117 |
118 | 121 | 130 |
131 |
132 |
133 |
134 |
135 |

© Bootstrap Company 2013

136 |
137 |
138 | 139 |
140 | -------------------------------------------------------------------------------- /source/modules/admin/templates/msdialog.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 |
8 |
9 | 10 |
11 | -------------------------------------------------------------------------------- /source/modules/admin/templates/navier.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 35 | -------------------------------------------------------------------------------- /source/modules/admin/templates/repo_comm.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

14 |
15 | 16 | 选择 -> 17 | 18 |
19 | 20 | 23 | 34 |
35 | 36 | 37 | 38 | 39 | 日期范围[] 40 | 41 | 42 | 导出excel 43 |
44 |
45 | 46 | 54 | 55 |
56 |
57 |
58 | 59 |
60 |
61 | 66 |
67 |
68 | 69 | 70 | 71 | 75 | 76 | 80 | 81 | 82 | 83 | 87 | 88 | '; 90 | ?> 91 | 92 | 93 | {$1}'; 96 | }else{ 97 | $boldst='{$1}'; 98 | } 99 | if(is_array($info)){ 100 | foreach($info as $arr){ 101 | ?> 102 | 103 | 107 | 108 | 109 | '; 111 | ?> 112 | 113 | 117 | 118 |
119 |
120 |
121 | 124 |
125 |
126 |
127 |
128 |

© Bootstrap Company 2013

129 |
130 |
131 | 132 |
133 | '; 135 | include PC_PATH.'modules'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'footer.tpl.php'; 136 | ?> -------------------------------------------------------------------------------- /source/modules/admin/templates/repo_dyuan.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

14 |
15 | 16 | 日期范围[] 17 | 18 | 导出excel 19 |
20 |
21 | 22 | 30 | 31 |
32 |
33 |
34 | 35 |
36 |
37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 81 | 82 | 83 | 84 | 88 | 89 |
日期患者姓名性别/年龄预约号科室病种接诊专家咨询员预约途径就诊情况实际消费关键词
72 | '.$info['jzqk'].''; 75 | 76 | if($info['jzqk']=='挂号没消费') 77 | $info['jzqk']=''.$info['jzqk'].''; 78 | echo $info['jzqk']; 79 | ?> 80 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |

© Bootstrap Company 2013

98 |
99 |
100 | 101 |
102 | -------------------------------------------------------------------------------- /source/modules/admin/templates/showmessage.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 信息提示 8 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 |
29 | 30 | [] 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 |
44 |
45 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /source/modules/admin/templates/sysm_commset.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 | 14 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 | 34 | 35 | 36 |
37 |
38 |
39 |
40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 89 | 90 |
排序记录ID创建时间操作
修改
91 |
92 | 93 | 94 | 95 | 新增 96 |
97 |
98 |
99 |
100 |
101 |
102 | 103 |
104 |

© Bootstrap Company 2013

105 |
106 |
107 | 108 |
109 | -------------------------------------------------------------------------------- /source/modules/admin/templates/sysm_emailset.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 | 14 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 |
39 |
40 |
41 | 42 |
43 | 44 | 45 | 46 |
47 |
48 |
49 |
50 | 51 |
52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 86 | 87 |
排序记录ID生效邮箱名称邮箱地址备注说明创建时间操作
'; }else{ echo ''; } ?>修改
88 |
89 | 90 | 91 | 92 |
93 |
94 |
95 |
96 |
97 |
98 | 99 |
100 |

© Bootstrap Company 2013

101 |
102 |
103 | 104 |
105 | -------------------------------------------------------------------------------- /source/modules/admin/templates/sysm_loginlogs.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

用户登录日志

14 |
15 |
16 |
17 |
18 |
19 | 20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 53 | 54 |
记录ID登录名部门登录IP登录时浏览器登录时间
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |

© Bootstrap Company 2013

66 |
67 |
68 | 69 |
70 | -------------------------------------------------------------------------------- /source/modules/admin/templates/sysm_siteset.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 | 14 | 17 |
18 |
19 |
基于Bootstrap前端的信息管理系统 由Yokit开发 QQ182860914。
20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 |
29 |
* 单位:小时
30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 | 38 |
39 |
40 |
41 |
42 | 43 |
44 | 47 |
48 |
49 |
50 |
51 | 52 |
53 |
54 |
55 |
56 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |

© Bootstrap Company 2013

66 |
67 |
68 | 69 |
70 | -------------------------------------------------------------------------------- /source/modules/admin/templates/user_changepwd.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 | 14 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 |

© Bootstrap Company 2013

49 |
50 |
51 | 52 |
53 | -------------------------------------------------------------------------------- /source/modules/admin/templates/user_userlist.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 | 11 |
12 |
13 |

用户列表

14 |
15 |
16 |
17 |
18 |
19 | 20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 |
生效用户名部门★★★操作范围★★★(点击表头展开操作范围 点'修改'查看描述)最近登录时间最近登录IP创建时间操作
'; }else{ echo ''; } ?>
复制 修改
59 |
60 | 61 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |

© Bootstrap Company 2013

70 |
71 |
72 | 73 |
74 | -------------------------------------------------------------------------------- /source/modules/admin/user.php: -------------------------------------------------------------------------------- 1 | db = ''; 11 | $this->admin_db = pc_base::load_model('admin_model'); 12 | $this->bmfz_db = pc_base::load_model('bmfz_model'); 13 | $this->op = pc_base::load_app_class('admin_op'); 14 | } 15 | 16 | public function init () { 17 | } 18 | 19 | public function public_userlist(){ 20 | $action=__FUNCTION__; 21 | 22 | //权限判断 23 | if(!admin::check_roid('|62,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 24 | 25 | $page = $_GET['page'] ? intval($_GET['page']) : '1'; 26 | $infos = $this->admin_db->listinfo('', 'useing desc, depart desc', $page, 20); 27 | $pages = $this->admin_db->pages; 28 | include $this->admin_tpl('user_userlist'); 29 | } 30 | 31 | public function public_changepwd(){ 32 | $action=__FUNCTION__; 33 | 34 | //权限判断 35 | if(!admin::check_roid('|61,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 36 | 37 | $userid=self::$userid; 38 | if(isset($_GET['dosubmit'])) { 39 | $info = array(); 40 | $info = $_POST['info']; 41 | if(isset($info['password']) && !empty($info['password'])) 42 | { 43 | if($info['password']!=$info['pwdconfirm']) showmessdialog('两次密码不一致!'); 44 | $this->op->edit_password($userid, $info['password']); 45 | } 46 | showmessdialog('操作成功', 200); 47 | }else{ 48 | $action=__FUNCTION__; 49 | $r = $this->admin_db->get_one(array('userid'=>$userid)); 50 | include $this->admin_tpl('user_changepwd'); 51 | } 52 | } 53 | 54 | public function public_adduser(){ 55 | $action=__FUNCTION__; 56 | 57 | //权限判断 58 | if(!admin::check_roid('|62,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 59 | 60 | if(isset($_GET['dosubmit'])) { 61 | $purview = array(); 62 | $info = array(); 63 | 64 | $purview = $_POST['purview']; 65 | $info = $_POST['info']; 66 | if($this->savepostedit($info, $purview)){ 67 | showmessdialog('操作成功!', 200, './?m=admin&c=user&a=public_userlist'); 68 | }else{ 69 | showmessdialog('操作出错!'); 70 | } 71 | }else{ 72 | 73 | $purview = array(); 74 | //复制权限 75 | $ctrl=$_GET['ctrl']; 76 | if($ctrl=='copy'){ 77 | $userid = intval($_GET['cid']); 78 | if($userid < 1) return false; 79 | 80 | $r = $this->admin_db->get_one(array('userid'=>$userid)); 81 | 82 | unset($r['username']); 83 | unset($r['depart']); 84 | 85 | $purview = explode(',',$r['purview']); 86 | } 87 | 88 | $infos = $this->bmfz_db->listinfo('', 'listorder desc, id asc'); 89 | include $this->admin_tpl('user_edituser'); 90 | } 91 | } 92 | 93 | public function public_edituser(){ 94 | $action=__FUNCTION__; 95 | 96 | //权限判断 97 | if(!admin::check_roid('|62,')) showmessdialog('无权操作!', 300, HTTP_REFERER, 'noajax'); 98 | 99 | $purview = array(); 100 | $info = array(); 101 | $userid = 0; 102 | 103 | if(isset($_GET['dosubmit'])) { 104 | $info = $_POST['info']; 105 | $purview = $_POST['purview']; 106 | 107 | $cid = intval($info['cid']); 108 | 109 | if($this->savepostedit($info, $purview, 'edit', $cid)){ 110 | showmessdialog('操作成功!', 200, './?m=admin&c=user&a=public_userlist'); 111 | }else{ 112 | showmessdialog('操作出错!'); 113 | } 114 | }else{ 115 | $userid = intval($_GET['cid']); 116 | if($userid < 1) return false; 117 | 118 | $infos = $this->bmfz_db->listinfo('', 'listorder desc, id asc'); 119 | $r = $this->admin_db->get_one(array('userid'=>$userid)); 120 | 121 | $purview = explode(',',$r['purview']); 122 | 123 | include $this->admin_tpl('user_edituser'); 124 | } 125 | } 126 | 127 | private function savepostedit($info, $purview, $ctrl='add', $cid=0){ 128 | 129 | if($ctrl=='edit'&&$cid==0 || $ctrl=='edit'&&$cid==''){ 130 | return false; 131 | } 132 | $bool=false; 133 | 134 | $purview = implode('',$purview); 135 | $username = trim($info['username']); 136 | $useing = $info['useing']=='true' ? 1:0; 137 | $depart = $info['depart']; 138 | $password = trim($info['password']); 139 | $pwdconfirm = trim($info['pwdconfirm']); 140 | 141 | if($ctrl=='add'){ 142 | if(isset($password) && !empty($password)){ 143 | if($password!=$pwdconfirm) showmessdialog('两次密码不一致!'); 144 | } 145 | if(!is_password($password)){ 146 | showmessdialog('密码不合法!'); 147 | return false; 148 | } 149 | if(!$this->op->checkname($username)){ 150 | showmessdialog('用户名已经存在!'); 151 | return false; 152 | } 153 | 154 | $this->admin_db->insert(array('username'=>$username, 'useing'=>$useing, 'depart'=>$depart, 'purview'=>$purview, 'addtime'=>SYS_TIME)); 155 | $cid=$this->admin_db->insert_id(); 156 | if($cid){ 157 | $this->op->edit_password($cid, $password); 158 | $bool=true; 159 | } 160 | } 161 | 162 | if($ctrl=='edit'){ 163 | if(isset($password) && !empty($password)){ 164 | if($password!=$pwdconfirm) showmessdialog('两次密码不一致!'); 165 | $this->op->edit_password($cid, $password); 166 | } 167 | 168 | $result=$this->admin_db->update(array('username'=>$username, 'useing'=>$useing, 'depart'=>$depart, 'purview'=>$purview), array('userid'=>$cid)); 169 | if($result) $bool=true; 170 | } 171 | return $bool; 172 | } 173 | 174 | public function deleteds(){ 175 | 176 | //权限判断 177 | if(!admin::check_roid('|62,')) showmessdialog('无权操作!'); 178 | 179 | if(isset($_GET['dosubmit'])) { 180 | if(empty($_POST['ids'])) showmessdialog('您没有勾选信息!'); 181 | foreach($_POST['ids'] as $id) { 182 | $this->db->delete(array('userid'=>$id)); 183 | } 184 | showmessdialog('操作成功', 200, 'reload'); 185 | } 186 | } 187 | 188 | } 189 | ?> -------------------------------------------------------------------------------- /statics/css/daterangepicker-bs3.css: -------------------------------------------------------------------------------- 1 | /*样式*/ 2 | /*! 3 | * Stylesheet for the Date Range Picker, for use with Bootstrap 3.x 4 | * 5 | * Copyright 2013 Dan Grossman ( http://www.dangrossman.info ) 6 | * Licensed under the Apache License v2.0 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Built for http://www.improvely.com 10 | */ 11 | .clearf{ clear: both;} 12 | .daterangepicker.dropdown-menu { 13 | max-width: none; 14 | z-index: 3000; 15 | } 16 | 17 | .daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar { 18 | float: left; 19 | margin: 4px; 20 | } 21 | 22 | .daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar { 23 | float: right; 24 | margin: 4px; 25 | } 26 | 27 | .daterangepicker .ranges { 28 | width: 160px; 29 | text-align: left; 30 | } 31 | 32 | .daterangepicker .ranges .range_inputs>div { 33 | float: left; 34 | } 35 | 36 | .daterangepicker .ranges .range_inputs>div:nth-child(2) { 37 | padding-left: 11px; 38 | } 39 | 40 | .daterangepicker .calendar { 41 | display: none; 42 | max-width: 270px; 43 | } 44 | 45 | .daterangepicker.show-calendar .calendar { 46 | display: block; 47 | } 48 | 49 | .daterangepicker .calendar.single .calendar-date { 50 | border: none; 51 | } 52 | 53 | .daterangepicker .calendar th, .daterangepicker .calendar td { 54 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 55 | white-space: nowrap; 56 | text-align: center; 57 | min-width: 32px; 58 | } 59 | 60 | .daterangepicker .daterangepicker_start_input label, 61 | .daterangepicker .daterangepicker_end_input label { 62 | color: #333; 63 | display: block; 64 | font-size: 11px; 65 | font-weight: normal; 66 | height: 20px; 67 | line-height: 20px; 68 | margin-bottom: 2px; 69 | text-shadow: #fff 1px 1px 0px; 70 | text-transform: uppercase; 71 | width: 74px; 72 | } 73 | 74 | .daterangepicker .ranges input { 75 | font-size: 11px; 76 | } 77 | 78 | .daterangepicker .ranges .input-mini { 79 | background-color: #eee; 80 | border: 1px solid #ccc; 81 | border-radius: 4px; 82 | color: #555; 83 | display: block; 84 | font-size: 11px; 85 | height: 30px; 86 | line-height: 30px; 87 | vertical-align: middle; 88 | margin: 0 0 10px 0; 89 | padding: 0 6px; 90 | width: 74px; 91 | } 92 | 93 | .daterangepicker .ranges ul { 94 | list-style: none; 95 | margin: 0; 96 | padding: 0; 97 | } 98 | 99 | .daterangepicker .ranges li { 100 | font-size: 13px; 101 | background: #f5f5f5; 102 | border: 1px solid #f5f5f5; 103 | color: #08c; 104 | padding: 3px 12px; 105 | margin-bottom: 8px; 106 | -webkit-border-radius: 5px; 107 | -moz-border-radius: 5px; 108 | border-radius: 5px; 109 | cursor: pointer; 110 | } 111 | 112 | .daterangepicker .ranges li.active, .daterangepicker .ranges li:hover { 113 | background: #08c; 114 | border: 1px solid #08c; 115 | color: #fff; 116 | } 117 | 118 | .daterangepicker .ranges .range_mlist span { 119 | float: left; 120 | margin-right: 5px; 121 | font-size: 13px; 122 | background: #f5f5f5; 123 | border: 1px solid #f5f5f5; 124 | color: #08c; 125 | padding: 3px 12px; 126 | margin-bottom: 8px; 127 | -webkit-border-radius: 5px; 128 | -moz-border-radius: 5px; 129 | border-radius: 5px; 130 | cursor: pointer; 131 | } 132 | 133 | .daterangepicker .ranges .range_mlist span.monthsele { 134 | padding: 3px 0px; 135 | width: 35px; 136 | text-align: center; 137 | } 138 | 139 | .daterangepicker .ranges .range_mlist span.active, .daterangepicker .ranges .range_mlist span:hover { 140 | background: #08c; 141 | border: 1px solid #08c; 142 | color: #fff; 143 | } 144 | 145 | .daterangepicker .calendar-date { 146 | border: 1px solid #ddd; 147 | padding: 4px; 148 | border-radius: 4px; 149 | background: #fff; 150 | } 151 | 152 | .daterangepicker .calendar-time { 153 | text-align: center; 154 | margin: 8px auto 0 auto; 155 | line-height: 30px; 156 | } 157 | 158 | .daterangepicker { 159 | position: absolute; 160 | background: #fff; 161 | top: 100px; 162 | left: 20px; 163 | padding: 4px; 164 | margin-top: 1px; 165 | -webkit-border-radius: 4px; 166 | -moz-border-radius: 4px; 167 | border-radius: 4px; 168 | } 169 | 170 | .daterangepicker.opensleft:before { 171 | position: absolute; 172 | top: -7px; 173 | right: 9px; 174 | display: inline-block; 175 | border-right: 7px solid transparent; 176 | border-bottom: 7px solid #ccc; 177 | border-left: 7px solid transparent; 178 | border-bottom-color: rgba(0, 0, 0, 0.2); 179 | content: ''; 180 | } 181 | 182 | .daterangepicker.opensleft:after { 183 | position: absolute; 184 | top: -6px; 185 | right: 10px; 186 | display: inline-block; 187 | border-right: 6px solid transparent; 188 | border-bottom: 6px solid #fff; 189 | border-left: 6px solid transparent; 190 | content: ''; 191 | } 192 | 193 | .daterangepicker.opensright:before { 194 | position: absolute; 195 | top: -7px; 196 | left: 9px; 197 | display: inline-block; 198 | border-right: 7px solid transparent; 199 | border-bottom: 7px solid #ccc; 200 | border-left: 7px solid transparent; 201 | border-bottom-color: rgba(0, 0, 0, 0.2); 202 | content: ''; 203 | } 204 | 205 | .daterangepicker.opensright:after { 206 | position: absolute; 207 | top: -6px; 208 | left: 10px; 209 | display: inline-block; 210 | border-right: 6px solid transparent; 211 | border-bottom: 6px solid #fff; 212 | border-left: 6px solid transparent; 213 | content: ''; 214 | } 215 | 216 | .daterangepicker table { 217 | width: 100%; 218 | margin: 0; 219 | } 220 | 221 | .daterangepicker td, .daterangepicker th { 222 | text-align: center; 223 | width: 20px; 224 | height: 20px; 225 | -webkit-border-radius: 4px; 226 | -moz-border-radius: 4px; 227 | border-radius: 4px; 228 | cursor: pointer; 229 | white-space: nowrap; 230 | } 231 | 232 | .daterangepicker td.off { 233 | color: #999; 234 | } 235 | 236 | .daterangepicker td.disabled { 237 | color: #999; 238 | } 239 | 240 | .daterangepicker td.available:hover, .daterangepicker th.available:hover { 241 | background: #eee; 242 | } 243 | 244 | .daterangepicker td.in-range { 245 | background: #ebf4f8; 246 | -webkit-border-radius: 0; 247 | -moz-border-radius: 0; 248 | border-radius: 0; 249 | } 250 | 251 | .daterangepicker td.active, .daterangepicker td.active:hover { 252 | background-color: #357ebd; 253 | border-color: #3071a9; 254 | color: #fff; 255 | } 256 | 257 | .daterangepicker td.week, .daterangepicker th.week { 258 | font-size: 80%; 259 | color: #ccc; 260 | } 261 | 262 | .daterangepicker select.monthselect, .daterangepicker select.yearselect { 263 | font-size: 12px; 264 | padding: 1px; 265 | height: auto; 266 | margin: 0; 267 | cursor: default; 268 | } 269 | 270 | .daterangepicker select.monthselect { 271 | margin-right: 2%; 272 | width: 56%; 273 | } 274 | 275 | .daterangepicker select.yearselect { 276 | width: 40%; 277 | } 278 | 279 | .daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.ampmselect { 280 | width: 50px; 281 | margin-bottom: 0; 282 | } 283 | 284 | .daterangepicker_start_input { 285 | float: left; 286 | } 287 | 288 | .daterangepicker_end_input { 289 | float: left; 290 | padding-left: 11px 291 | } 292 | 293 | .daterangepicker th.month { 294 | width: auto; 295 | } 296 | -------------------------------------------------------------------------------- /statics/css/master.css: -------------------------------------------------------------------------------- 1 | /*文档*/ 2 | html, body{font-family: "Microsoft YaHei" !important; background: #EEEEEE;} 3 | h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6{font-family: "Microsoft YaHei" !important;} 4 | label { font-weight: normal;} 5 | .fs12{font-size: 12px;} 6 | .mt0{margin-top: 0px;} 7 | .mr0{margin-right: 0px;} 8 | .mb0{margin-bottom: 0px;} 9 | .ml0{margin-left: 0px;} 10 | .mb-1{ margin-bottom: -1px;} 11 | .disno{display: none;} 12 | 13 | .red{color: #F80000;} 14 | .blue{color: #428BCA;} 15 | .orange{color: #FF6600;} 16 | .green{color: #008000;} 17 | .golds{color: #AA6708;} 18 | 19 | .blank5{ line-height: 0px; height: 5px;} 20 | .alert .label{ vertical-align: baseline;} 21 | 22 | .modal{} 23 | 24 | /* .navbar-brand{ color:#FFFFFF !important;} */ 25 | .cs_nav-sub .breadcrumb{margin-bottom: 10px;} 26 | .cs_nav-sub .breadcrumb li.active a{ color: #FF3300 !important;} 27 | 28 | .cs_navbar .v1{ margin-top: 12px;} 29 | .cs_navbar .v2{ margin-top: 12px; padding-left: 8px;} 30 | .cs_navbar .v3{} 31 | .cs_navbar .cs_navbar_btn-group{ margin-top: -3px;} 32 | 33 | .form-group{margin-bottom: 12px !important;} 34 | .cs_form-group_st01{ margin-bottom: 5px !important;} 35 | .cs_form-group_st01 label{ padding-top: 0px !important;} 36 | 37 | .sc_fithd_btn{padding: 4px 12px;} 38 | .sc_readonly-nbg{cursor: pointer !important; background-color: #FFF !important;} 39 | .sc_label_tb01{ font-weight: bold; color: #FF3300;} 40 | .sc_label_tb02{ color: #FF3300;} 41 | .sc_spline01{ border-top: 2px solid #E3E3E3;} 42 | 43 | .sc_panel_drop_st01{ position: absolute; left: 54px; top: 33px; z-index: 5;} 44 | .sc_panel_drop_st01 .sc_panel_drop_vc{ background: #FFFFFF; border: 1px solid #CCC; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; padding: 2px; 45 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); 46 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); 47 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); 48 | } 49 | .sc_mselect_st01{} 50 | .sc_mselect_st01 ul{ padding: 0px; margin: 0px;} 51 | .sc_mselect_st01 ul li{ list-style: none; padding: 0px; margin: 0px; line-height: 26px;} 52 | .sc_mselect_st01 .sc_mselect_data1{ float: left; width: 40%; background: #F1F1F1;} 53 | .sc_mselect_st01 .sc_mselect_data1 ul li{ border-bottom: 1px solid #E1E1E1; border-top: 1px solid #FFFFFF; padding-left: 10px;} 54 | .sc_mselect_st01 .sc_mselect_data1 ul li:first-child{border-top: none;} 55 | .sc_mselect_st01 .sc_mselect_data1 ul li:last-child{border-bottom: none;} 56 | .sc_mselect_st01 .sc_mselect_data1 ul li.on{ background: #FFFFFF;} 57 | .sc_mselect_st01 .sc_mselect_data2{ float: left; width: 60%; background: #FFFFFF;} 58 | .sc_mselect_st01 .sc_mselect_data2 ul{} 59 | .sc_mselect_st01 .sc_mselect_data2 ul li{ border-bottom: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF; padding-left: 10px;} 60 | .sc_mselect_st01 .sc_mselect_data2 ul li:hover{ color: #428BCA; cursor: pointer;} 61 | .sc_mselect_st01 .sc_mselect_data2 ul li:first-child{border-top: none;} 62 | 63 | .cs_table_panel-scroll{ overflow-x: hidden; margin-bottom: 10px;} 64 | .cs_table-gray{ background: #f9f9f9;} 65 | .cs_table-gray thead{ background: #FFFFFF;} 66 | 67 | .cs_table-st1{ margin-bottom: 10px; position: relative;} 68 | 69 | /*.cs_text-clip{text-overflow:ellipsis;}*/ 70 | .cs_table-st1 tr:hover td{ background: #ECFBFF !important;} 71 | .cs_table-st1 th{font-size: 13px !important; white-space: nowrap; overflow:hidden; text-overflow:ellipsis;} 72 | .cs_table-st1 td{font-size: 13px !important; white-space: nowrap; overflow:hidden; text-overflow:ellipsis;} 73 | .cs_table-st1 td .txt_fixed_lb{ cursor: pointer;} 74 | .cs_table-st1 td .txt_fixed{ width: 80px; overflow:hidden; text-overflow:ellipsis; cursor: pointer;} 75 | .cs_table-st1 td .txt_fixed2{ width: 380px; overflow:hidden; text-overflow:ellipsis; cursor: pointer;} 76 | 77 | .cs_table-st1 .cs_listorder{width: auto; height: 22px; padding: 3px 6px;} 78 | .cs_table-st1 .cs_table-subtr{ color: #999999; background: #FFFFFF;} 79 | .cs_table-st1 .cs_table-subtr a{ color: #999999;} 80 | 81 | .tablesorter th.header{ background: url(../images/sorter_bg.gif) no-repeat right center;} 82 | .tablesorter th.header_sortup{ background: url(../images/sorter_asc.gif) no-repeat right center;} 83 | .tablesorter th.header_sortdown{ background: url(../images/sorter_desc.gif) no-repeat right center;} 84 | 85 | /*排班表*/ 86 | .cs_hdti-pbedit{ padding: 8px; margin-bottom: 0px;} 87 | .cs_hdti-pbedit .i1{ font-size: 22px; line-height: 32px;} 88 | .month_h .cur_month{ color: #F30; font-weight: bold;} 89 | .cs_table-pbedit tr.cellst2{background: #EEE !important;} 90 | .cs_table-pbedit td{ padding: 3px !important;} 91 | .cs_table-pbedit .pbinput_name{ padding: 2px 2px; width: 56px; height: 28px; text-align: center; font-size: 12px;} 92 | .cs_table-pbedit .pbinput_button{ padding: 1px 2px; width: 42px; height: 28px; text-align: center; font-size: 12px;} 93 | .cs_table-pbedit .pbinput{ padding: 1px 2px; width: 30px; height: 28px; text-align: center; font-size: 12px;} 94 | 95 | .pagelist{ text-align:center;} 96 | 97 | .jumbotron{ background: #FFFFFF;} 98 | #signpage .container{max-width: 330px; padding: 15px; margin: 0px auto; padding-bottom: 40px; padding-top: 60px;} 99 | #signpage .container .login_panel .form-control{height: auto; padding: 10px;} 100 | #signpage .container .login_panel .i1{margin-bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0;} 101 | #signpage .container .login_panel .i2{border-top-left-radius: 0; border-top-right-radius: 0;} 102 | #signpage .container .login_panel .sc_form-signin_group01{margin-top: 8px;} 103 | #signpage .container .login_panel .sc_form-signin_group01 .btn{ padding: 2px;} -------------------------------------------------------------------------------- /statics/images/sorter_asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/statics/images/sorter_asc.gif -------------------------------------------------------------------------------- /statics/images/sorter_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/statics/images/sorter_bg.gif -------------------------------------------------------------------------------- /statics/images/sorter_desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Johnhacker/FromX/7d3c413d1cee837341edc9e6876484b71458f7f6/statics/images/sorter_desc.gif -------------------------------------------------------------------------------- /statics/js/index.js: -------------------------------------------------------------------------------- 1 | //文档 QQ182860914 2 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 2l=4(c){1==$("#2f").j("k")?$("y[s=\'"+c+"\']").x(4(){$(3).j("k",!0)}):$("y[s=\'"+c+"\']").x(4(){$(3).j("k",!1)})},1T=4(c,d){$.1w.1u("1t",{2g:c,2o:4(){$("#1t-2w").p(4(){$.1w.J();d()})}})};$(20).24(4(){$("#2e z").p(4(){$(3).1s("z").1r("1q");$(3).1p("1q");$("#1o-1n 1m").J();$("#1o-1n 1m:7("+$(3).1l()+")").1k()});9 c={};$(".2h").x(4(a){$(3).p(4(){c=$(".2v:7("+a+")");c.1x("2y");2A("1y"==c.E("1S")){9 b=c.K(".q:7(0) P").o(),e=c.K(".C:7(0)").o();e>b?c.K(".q:7(0)").E("o",e):c.K(".q:7(0)").E("o",b)}})});$(".2i").2m(4(){$(3).2n()});$(".i").x(4(a){$(".i:7("+a+") .q z").2t(4(){$(3).1s().1r("T");$(3).1p("T");$(".i:7("+a+") .C P").1i().J();$(".i:7("+a+") .C P:7("+$(3).1l()+")").1i().1k();9 b=$(".i:7("+a+") .q P").o(),c=$(".i:7("+a+") .C").o();c>b?$(".i:7("+a+") .q").E("o",c):$(".i:7("+a+") .q").E("o",b)});$(".i:7("+a+") .C z").p(4(){9 b=$(".i:7("+a+")").h("1h");0= this.options.duration+this.startTime) { 26 | this.now = this.to; 27 | clearInterval (this.timer); 28 | this.timer = null; 29 | if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10); 30 | } 31 | else { 32 | var Tpos = (time - this.startTime) / (this.options.duration); 33 | this.now = this.options.transition(Tpos) * (this.to-this.from) + this.from; 34 | } 35 | this.increase(); 36 | }, 37 | 38 | custom: function(from, to) { 39 | if (this.timer != null) return; 40 | this.from = from; 41 | this.to = to; 42 | this.startTime = (new Date).getTime(); 43 | this.timer = setInterval (this.step.bind(this), 13); 44 | }, 45 | 46 | hide: function() { 47 | this.now = 0; 48 | this.increase(); 49 | }, 50 | 51 | clearTimer: function() { 52 | clearInterval(this.timer); 53 | this.timer = null; 54 | } 55 | } 56 | 57 | //stretchers 58 | fx.Layout = Class.create(); 59 | fx.Layout.prototype = Object.extend(new fx.Base(), { 60 | initialize: function(el, options) { 61 | this.el = $(el); 62 | this.el.style.overflow = "hidden"; 63 | this.iniWidth = this.el.offsetWidth; 64 | this.iniHeight = this.el.offsetHeight; 65 | this.setOptions(options); 66 | } 67 | }); 68 | 69 | fx.Height = Class.create(); 70 | Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), { 71 | increase: function() { 72 | this.el.style.height = this.now + "px"; 73 | }, 74 | 75 | toggle: function() { 76 | if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0); 77 | else this.custom(0, this.el.scrollHeight); 78 | } 79 | }); 80 | 81 | fx.Width = Class.create(); 82 | Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), { 83 | increase: function() { 84 | this.el.style.width = this.now + "px"; 85 | }, 86 | 87 | toggle: function(){ 88 | if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0); 89 | else this.custom(0, this.iniWidth); 90 | } 91 | }); 92 | 93 | //fader 94 | fx.Opacity = Class.create(); 95 | fx.Opacity.prototype = Object.extend(new fx.Base(), { 96 | initialize: function(el, options) { 97 | this.el = $(el); 98 | this.now = 1; 99 | this.increase(); 100 | this.setOptions(options); 101 | }, 102 | 103 | increase: function() { 104 | if (this.now == 1 && (/Firefox/.test(navigator.userAgent))) this.now = 0.9999; 105 | this.setOpacity(this.now); 106 | }, 107 | 108 | setOpacity: function(opacity) { 109 | if (opacity == 0 && this.el.style.visibility != "hidden") this.el.style.visibility = "hidden"; 110 | else if (this.el.style.visibility != "visible") this.el.style.visibility = "visible"; 111 | if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + opacity*100 + ")"; 112 | this.el.style.opacity = opacity; 113 | }, 114 | 115 | toggle: function() { 116 | if (this.now > 0) this.custom(1, 0); 117 | else this.custom(0, 1); 118 | } 119 | }); 120 | 121 | //transitions 122 | fx.sinoidal = function(pos){ 123 | return ((-Math.cos(pos*Math.PI)/2) + 0.5); 124 | //this transition is from script.aculo.us 125 | } 126 | fx.linear = function(pos){ 127 | return pos; 128 | } 129 | fx.cubic = function(pos){ 130 | return Math.pow(pos, 3); 131 | } 132 | fx.circ = function(pos){ 133 | return Math.sqrt(pos); 134 | } -------------------------------------------------------------------------------- /statics/js/plugin.js: -------------------------------------------------------------------------------- 1 | //文档 QQ182860914 2 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2N.1Q({z:9(){q c=$(\'<2 4="5 2L" 2J="-1" 2C="F" x-2A="2y" x-l="D">\'),b="";j{Z:9(d,a){2v(d){V"A":b=\'<2 4="5-F"><2 4="5-P"><2 4="5-T" O="K:J;S:l;"><7 n="7" 4="Q" t-E="5" x-l="D">\\L\\1w\\1B\\1h\\1k<2 4="5-M">

\'+a.m+"

";11;V"1x":b=\'<2 4="5-F"><2 4="5-P"><2 4="5-T" O="K:J;S:l;"><7 n="7" 4="Q" t-E="5" x-l="D">\\L\\1y\\1z\\2u\\2r<2 4="5-M">

\'+a.m+"

";11;V"G":b=\'<2 4="5-F"><2 4="5-P"><2 4="5-T" O="K:J;S:l;"><7 n="7" 4="Q" t-E="5" x-l="D">\\L\\1i\\2q\\1y\\1z<2 4="5-M">

\'+a.m+\'

<2 4="5-1n"><7 n="7" 4="w w-1a" t-E="5">\\2m\\2l<7 n="7" 4="w w-2k" 2j="G-w">\\1i\\2i\';11;V"1E":b=\'<2 4="5-F"><2 4="5-P"><2 4="5-T" O="K:J;S:l;"><7 n="7" 4="Q" t-E="5" x-l="D">\\L\'+a.26+\'<2 4="5-M">\'+a.m+\'<2 4="5-1n"><7 n="7" 4="w w-1a" t-E="5">\\25\\24\';11;1a:b=\'<2 4="5-F"><2 4="5-P"><2 4="5-T" O="K:J;S:l;"><7 n="7" 4="Q" t-E="5" x-l="D">\\L\\1w\\1B\\1h\\1k<2 4="5-M">

\'+$(a).3("m")+"

"}c.23(b);c.5({22:!0});c.1f("1Z.1Y.5",9(b){"1W"==1m a&&"9"==1m a.X&&a.X()})},N:9(){c.5("N")}}}()});9 1V(c){1U.1S.1R=9(b,a){j 8.18(1P 1M(b,"1L"),a)};q b=9(b,a){q c=10(a.3("1I")),f=10(a.3("1G")),e=a.3("2e");"1F"!=a.3("n")&&a.k()&&a.k(a.k().18(/^\\s+/i,"").18(/\\s+$/i,""));o("1H"==a.1c(0).1J.1K()&&e&&""==$(a).k())j{B:!1,m:a.3("Y")};o("1N"==a.3("n")){o(e&&!$(a).3("1O"))j{B:!1,m:a.3("Y")}}1v o(!e&&""==a.k())j{B:!0};o(e&&(""==a.k()||!a.k())||a.3("17")&&""!=a.3("17")&&a.k()!=$("#"+a.3("17")).k()||0c||0 3 | * Prototype is freely distributable under the terms of an MIT-style license. 4 | * For details, see the Prototype web site: http://prototype.conio.net/ 5 | /*--------------------------------------------------------------------------*/ 6 | 7 | //note: modified & stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). 8 | 9 | var Class = { 10 | create: function() { 11 | return function() { 12 | this.initialize.apply(this, arguments); 13 | } 14 | } 15 | } 16 | 17 | Object.extend = function(destination, source) { 18 | for (property in source) destination[property] = source[property]; 19 | return destination; 20 | } 21 | 22 | Function.prototype.bind = function(object) { 23 | var __method = this; 24 | return function() { 25 | return __method.apply(object, arguments); 26 | } 27 | } 28 | 29 | Function.prototype.bindAsEventListener = function(object) { 30 | var __method = this; 31 | return function(event) { 32 | __method.call(object, event || window.event); 33 | } 34 | } 35 | 36 | function $() { 37 | if (arguments.length == 1) return get$(arguments[0]); 38 | var elements = []; 39 | $c(arguments).each(function(el){ 40 | elements.push(get$(el)); 41 | }); 42 | return elements; 43 | 44 | function get$(el){ 45 | if (typeof el == 'string') el = document.getElementById(el); 46 | return el; 47 | } 48 | } 49 | 50 | if (!window.Element) var Element = new Object(); 51 | 52 | Object.extend(Element, { 53 | remove: function(element) { 54 | element = $(element); 55 | element.parentNode.removeChild(element); 56 | }, 57 | 58 | hasClassName: function(element, className) { 59 | element = $(element); 60 | if (!element) return; 61 | var hasClass = false; 62 | element.className.split(' ').each(function(cn){ 63 | if (cn == className) hasClass = true; 64 | }); 65 | return hasClass; 66 | }, 67 | 68 | addClassName: function(element, className) { 69 | element = $(element); 70 | Element.removeClassName(element, className); 71 | element.className += ' ' + className; 72 | }, 73 | 74 | removeClassName: function(element, className) { 75 | element = $(element); 76 | if (!element) return; 77 | var newClassName = ''; 78 | element.className.split(' ').each(function(cn, i){ 79 | if (cn != className){ 80 | if (i > 0) newClassName += ' '; 81 | newClassName += cn; 82 | } 83 | }); 84 | element.className = newClassName; 85 | }, 86 | 87 | cleanWhitespace: function(element) { 88 | element = $(element); 89 | $c(element.childNodes).each(function(node){ 90 | if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) Element.remove(node); 91 | }); 92 | }, 93 | 94 | find: function(element, what) { 95 | element = $(element)[what]; 96 | while (element.nodeType != 1) element = element[what]; 97 | return element; 98 | } 99 | }); 100 | 101 | var Position = { 102 | cumulativeOffset: function(element) { 103 | var valueT = 0, valueL = 0; 104 | do { 105 | valueT += element.offsetTop || 0; 106 | valueL += element.offsetLeft || 0; 107 | element = element.offsetParent; 108 | } while (element); 109 | return [valueL, valueT]; 110 | } 111 | }; 112 | 113 | document.getElementsByClassName = function(className) { 114 | var children = document.getElementsByTagName('*') || document.all; 115 | var elements = []; 116 | $c(children).each(function(child){ 117 | if (Element.hasClassName(child, className)) elements.push(child); 118 | }); 119 | return elements; 120 | } 121 | 122 | //useful array functions 123 | Array.prototype.iterate = function(func){ 124 | for(var i=0;i --------------------------------------------------------------------------------