PHP 常用函数

/**
 * 返回经addslashes处理过的字符串或数组
 * @param $string 需要处理的字符串或数组
 * @return mixed
 */
function new_addslashes($string){
if(!is_array($string)) return addslashes($string);
foreach($string as $key => $val) $string[$key] = new_addslashes($val);
return $string;
}

/**
 * 返回经stripslashes处理过的字符串或数组
 * @param $string 需要处理的字符串或数组
 * @return mixed
 */
function new_stripslashes($string) {
if(!is_array($string)) return stripslashes($string);
foreach($string as $key => $val) $string[$key] = new_stripslashes($val);
return $string;
}

/**
 * 返回经addslashe处理过的字符串或数组
 * @param $obj 需要处理的字符串或数组
 * @return mixed
 */
function new_html_special_chars($string) {
if(!is_array($string)) return htmlspecialchars($string);
foreach($string as $key => $val) $string[$key] = new_html_special_chars($val);
return $string;
}
/**
 * 安全过滤函数
 *
 * @param $string
 * @return string
 */
function safe_replace($string) {
$string = str_replace('%20','',$string);
$string = str_replace('%27','',$string);
$string = str_replace('%2527','',$string);
$string = str_replace('*','',$string);
$string = str_replace('"','"',$string);
$string = str_replace("'",'',$string);
$string = str_replace('"','',$string);
$string = str_replace(';','',$string);
$string = str_replace('<','&lt;',$string);
$string = str_replace('>','&gt;',$string);
$string = str_replace("{",'',$string);
$string = str_replace('}','',$string);
return $string;
}



/**
 * 过滤ASCII码从0-28的控制字符
 * @return String
 */
function trim_unsafe_control_chars($str) {
$rule = '/[' . chr ( 1 ) . '-' . chr ( 8 ) . chr ( 11 ) . '-' . chr ( 12 ) . chr ( 14 ) . '-' . chr ( 31 ) . ']*/';
return str_replace ( chr ( 0 ), '', preg_replace ( $rule, '', $str ) );
}

/**
 * 格式化文本域内容
 *
 * @param $string 文本域内容
 * @return string
 */
function trim_textarea($string) {
$string = nl2br ( str_replace ( ' ', '&nbsp;', $string ) );
return $string;
}

/**
 * 将文本格式成适合js输出的字符串
 * @param string $string 需要处理的字符串
 * @param intval $isjs 是否执行字符串格式化,默认为执行
 * @return string 处理后的字符串
 */
function format_js($string, $isjs = 1)
{
$string = addslashes(str_replace(array("\r", "\n"), array('', ''), $string));
return $isjs ? 'document.write("'.$string.'");' : $string;
}

/**
 * 转义 javascript 代码标记
 *
 * @param $str
 * @return mixed
 */
function trim_script($str) {
$str = preg_replace ( '/\<([\/]?)script([^\>]*?)\>/si', '&lt;\\1script\\2&gt;', $str );
$str = preg_replace ( '/\<([\/]?)iframe([^\>]*?)\>/si', '&lt;\\1iframe\\2&gt;', $str );
$str = preg_replace ( '/\<([\/]?)frame([^\>]*?)\>/si', '&lt;\\1frame\\2&gt;', $str );
$str = preg_replace ( '/]]\>/si', ']] >', $str );
return $str;
}
/**
 * 获取当前页面完整URL地址
 */
function get_url() {
$sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$php_self = $_SERVER['PHP_SELF'] ? safe_replace($_SERVER['PHP_SELF']) : safe_replace($_SERVER['SCRIPT_NAME']);
$path_info = isset($_SERVER['PATH_INFO']) ? safe_replace($_SERVER['PATH_INFO']) : '';
$relate_url = isset($_SERVER['REQUEST_URI']) ? safe_replace($_SERVER['REQUEST_URI']) : $php_self.(isset($_SERVER['QUERY_STRING']) ? '?'.safe_replace($_SERVER['QUERY_STRING']) : $path_info);
return $sys_protocal.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '').$relate_url;
}
/**
 * 字符截取 支持UTF8/GBK
 * @param $string
 * @param $length
 * @param $dot
 */
function str_cut($string, $length, $dot = '...') {
$strlen = strlen($string);
if($strlen <= $length) return $string;
$string = str_replace(array(' ','&nbsp;', '&amp;', '&quot;', '&#039;', '&ldquo;', '&rdquo;', '&mdash;', '&lt;', '&gt;', '&middot;', '&hellip;'), array('∵',' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), $string);
$strcut = '';
if(strtolower(CHARSET) == 'utf-8') {
$length = intval($length-strlen($dot)-$length/3);
$n = $tn = $noc = 0;
while($n < strlen($string)) {
$t = ord($string[$n]);
if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) {
$tn = 1; $n++; $noc++;
} elseif(194 <= $t && $t <= 223) {
$tn = 2; $n += 2; $noc += 2;
} elseif(224 <= $t && $t <= 239) {
$tn = 3; $n += 3; $noc += 2;
} elseif(240 <= $t && $t <= 247) {
$tn = 4; $n += 4; $noc += 2;
} elseif(248 <= $t && $t <= 251) {
$tn = 5; $n += 5; $noc += 2;
} elseif($t == 252 || $t == 253) {
$tn = 6; $n += 6; $noc += 2;
} else {
$n++;
}
if($noc >= $length) {
break;
}
}
if($noc > $length) {
$n -= $tn;
}
$strcut = substr($string, 0, $n);
$strcut = str_replace(array('∵',' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), array(' ','&nbsp;', '&amp;', '&quot;', '&#039;', '&ldquo;', '&rdquo;', '&mdash;', '&lt;', '&gt;', '&middot;', '&hellip;'), $strcut);
} else {
$dotlen = strlen($dot);
$maxi = $length - $dotlen - 1;
$current_str = '';
$search_arr = array('&',' ', '"', "'", '“', '”', '—', '<', '>', '·', '…','∵');
$replace_arr = array('&amp;','&nbsp;', '&quot;', '&#039;', '&ldquo;', '&rdquo;', '&mdash;', '&lt;', '&gt;', '&middot;', '&hellip;',' ');
$search_flip = array_flip($search_arr);
for ($i = 0; $i < $maxi; $i++) {
$current_str = ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
if (in_array($current_str, $search_arr)) {
$key = $search_flip[$current_str];
$current_str = str_replace($search_arr[$key], $replace_arr[$key], $current_str);
}
$strcut .= $current_str;
}
}
return $strcut.$dot;
}



/**
 * 获取请求ip
 *
 * @return ip地址
 */
function ip() {
if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
$ip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
$ip = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
$ip = $_SERVER['REMOTE_ADDR'];
}
return preg_match ( '/[\d\.]{7,15}/', $ip, $matches ) ? $matches [0] : '';
}

function get_cost_time() {
$microtime = microtime ( TRUE );
return $microtime - SYS_START_TIME;
}
/**
 * 程序执行时间
 *
 * @return int 单位ms
 */
function execute_time() {
$stime = explode ( ' ', SYS_START_TIME );
$etime = explode ( ' ', microtime () );
return number_format ( ($etime [1] + $etime [0] - $stime [1] - $stime [0]), 6 );
}

/**
* 产生随机字符串
*
* @param    int        $length  输出长度 
* @param    string     $chars   可选的 ,默认为 0123456789
* @return   string     字符串
*/
function random($length, $chars = '0123456789') {
$hash = '';
$max = strlen($chars) - 1;
for($i = 0; $i < $length; $i++) {
$hash .= $chars[mt_rand(0, $max)];
}
return $hash;
}

/**
* 将字符串转换为数组
*
* @param string $data 字符串
* @return array 返回数组格式,如果,data为空,则返回空数组
*/
function string2array($data) {
if($data == '') return array();
eval("\$array = $data;");
return $array;
}
/**
* 将数组转换为字符串
*
* @param array $data 数组
* @param bool $isformdata 如果为0,则不使用new_stripslashes处理,可选参数,默认为1
* @return string 返回字符串,如果,data为空,则返回空
*/
function array2string($data, $isformdata = 1) {
if($data == '') return '';
if($isformdata) $data = new_stripslashes($data);
return addslashes(var_export($data, TRUE));
}

/**
* 转换字节数为其他单位
*
*
* @param string $filesize 字节大小
* @return string 返回大小
*/
function sizecount($filesize) {
if ($filesize >= 1073741824) {
$filesize = round($filesize / 1073741824 * 100) / 100 .' GB';
} elseif ($filesize >= 1048576) {
$filesize = round($filesize / 1048576 * 100) / 100 .' MB';
} elseif($filesize >= 1024) {
$filesize = round($filesize / 1024 * 100) / 100 . ' KB';
} else {
$filesize = $filesize.' Bytes';
}
return $filesize;
}
/**
* 字符串加密、解密函数
*
*
* @param string $txt 字符串
* @param string $operation ENCODE为加密,DECODE为解密,可选参数,默认为ENCODE,
* @param string $key 密钥:数字、字母、下划线
* @return string
*/
function sys_auth($txt, $operation = 'ENCODE', $key = '') {
$key = $key ? $key : pc_base::load_config('system', 'auth_key');
$txt = $operation == 'ENCODE' ? (string)$txt : base64_decode($txt);
$len = strlen($key);
$code = '';
for($i=0; $i<strlen($txt); $i++){
$k = $i % $len;
$code  .= $txt[$i] ^ $key[$k];
}
$code = $operation == 'DECODE' ? $code : base64_encode($code);
return $code;
}

/**
* 语言文件处理
*
* @param string $language 标示符
* @param array $pars 转义的数组,二维数组 ,'key1'=>'value1','key2'=>'value2',
* @param string $modules 多个模块之间用半角逗号隔开,如:member,guestbook
* @return string 语言字符
*/
function L($language = 'no_language',$pars = array(), $modules = '') {
static $LANG = array();
static $LANG_MODULES = array();
$lang = pc_base::load_config('system','lang');
if(!$LANG) {
require_once PC_PATH.'languages'.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR.'system.lang.php';
if(defined('IN_ADMIN')) require_once PC_PATH.'languages'.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR.'system_menu.lang.php';
if(file_exists(PC_PATH.'languages'.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR.ROUTE_M.'.lang.php')) require PC_PATH.'languages'.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR.ROUTE_M.'.lang.php';
}
if(!empty($modules)) {
$modules = explode(',',$modules);
foreach($modules AS $m) {
if(!isset($LANG_MODULES[$m])) require PC_PATH.'languages'.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR.$m.'.lang.php';
}
}
if(!array_key_exists($language,$LANG)) {
return $LANG['no_language'].'['.$language.']';
} else {
$language = $LANG[$language];
if($pars) {
foreach($pars AS $_k=>$_v) {
$language = str_replace('{'.$_k.'}',$_v,$language);
}
}
return $language;
}
}

/**
 * 模板调用
 * 
 * @param $module
 * @param $template
 * @param $istag
 * @return unknown_type
 */
function template($module = 'content', $template = 'index', $style = '') {
if(!empty($style) && !defined('STYLE')) {
define('STYLE', $style);
} elseif (empty($style) && !defined('STYLE')) {
if(defined('SITEID')) {
$siteid = SITEID;
} else {
$siteid = param::get_cookie('websiteid');
}
$sitelist = getcache('sitelist','commons');
if(!empty($siteid)) {
$style = $sitelist[$siteid]['default_style'];
}
} elseif (empty($style) && defined('STYLE')) {
$style = STYLE;
} else {
$style = 'default';
}
if(!$style) $style = 'default';
$template_cache = pc_base::load_sys_class('template_cache');
$compiledtplfile = PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_template'.DIRECTORY_SEPARATOR.$style.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.php';
if(file_exists(PC_PATH.'templates'.DIRECTORY_SEPARATOR.$style.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html')) {
if(!file_exists($compiledtplfile) || (@filemtime(PC_PATH.'templates'.DIRECTORY_SEPARATOR.$style.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html') > @filemtime($compiledtplfile))) {
$template_cache->template_compile($module, $template, $style);
}
} else {
$compiledtplfile = PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_template'.DIRECTORY_SEPARATOR.'default'.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.php';
if(!file_exists($compiledtplfile) || (file_exists(PC_PATH.'templates'.DIRECTORY_SEPARATOR.'default'.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html') && filemtime(PC_PATH.'templates'.DIRECTORY_SEPARATOR.'default'.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html') > filemtime($compiledtplfile))) {
$template_cache->template_compile($module, $template, 'default');
} elseif (!file_exists(PC_PATH.'templates'.DIRECTORY_SEPARATOR.'default'.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html')) {
showmessage('Template does not exist.'.DIRECTORY_SEPARATOR.$style.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html');
}
}
return $compiledtplfile;
}

/**
 * 输出自定义错误
 * 
 * @param $errno 错误号
 * @param $errstr 错误描述
 * @param $errfile 报错文件地址
 * @param $errline 错误行号
 * @return string 错误提示
 */

function my_error_handler($errno, $errstr, $errfile, $errline) {
if($errno==8) return '';
$errfile = str_replace(PHPCMS_PATH,'',$errfile);
if(pc_base::load_config('system','errorlog')) {
error_log(date('m-d H:i:s',SYS_TIME).' | '.$errno.' | '.str_pad($errstr,30).' | '.$errfile.' | '.$errline."\r\n", 3, CACHE_PATH.'error_log.php');
} else {
$str = '<div style="font-size:12px;text-align:left; border-bottom:1px solid #9cc9e0; border-right:1px solid #9cc9e0;padding:1px 4px;color:#000000;font-family:Arial, Helvetica,sans-serif;"><span>errorno:' . $errno . ',str:' . $errstr . ',file:<font color="blue">' . $errfile . '</font>,line' . $errline .'<br /><a href="http://faq.phpcms.cn/?type=file&errno='.$errno.'&errstr='.urlencode($errstr).'&errfile='.urlencode($errfile).'&errline='.$errline.'" target="_blank" style="color:red">Need Help?</a></span></div>';
echo $str;
}
}

/**
 * 提示信息页面跳转,跳转地址如果传入数组,页面会提示多个地址供用户选择,默认跳转地址为数组的第一个值,时间为5秒。
 * showmessage('登录成功', array('默认跳转地址'=>'http://www.phpcms.cn'));
 * @param string $msg 提示信息
 * @param mixed(string/array) $url_forward 跳转地址
 * @param int $ms 跳转等待时间
 */
function showmessage($msg, $url_forward = 'goback', $ms = 1250, $dialog = '', $returnjs = '') {
if(defined('IN_ADMIN')) {
include(admin::admin_tpl('showmessage', 'admin'));
} else {
include(template('content', 'message'));
}
exit;
}
/**
 * 查询字符是否存在于某字符串
 * 
 * @param $haystack 字符串
 * @param $needle 要查找的字符
 * @return bool
 */
function str_exists($haystack, $needle)
{
return !(strpos($haystack, $needle) === FALSE);
}

/**
 * 取得文件扩展
 * 
 * @param $filename 文件名
 * @return 扩展名
 */
function fileext($filename) {
return strtolower(trim(substr(strrchr($filename, '.'), 1, 10)));
}

/**
 * 加载模板标签缓存
 * @param string $name 缓存名
 * @param integer $times 缓存时间
 */
function tpl_cache($name,$times = 0) {
$filepath = 'tpl_data';
$info = getcacheinfo($name, $filepath);
if (SYS_TIME - $info['filemtime'] >= $times) {
return false;
} else {
return getcache($name,$filepath);
}
}

/**
 * 写入缓存,默认为文件缓存,不加载缓存配置。
 * @param $name 缓存名称
 * @param $data 缓存数据
 * @param $filepath 数据路径(模块名称) caches/cache_$filepath/
 * @param $type 缓存类型[file,memcache,apc]
 * @param $config 配置名称
 * @param $timeout 过期时间
 */
function setcache($name, $data, $filepath='', $type='file', $config='', $timeout='') {
pc_base::load_sys_class('cache_factory','',0);
if($config) {
$cacheconfig = pc_base::load_config('cache');
$cache = cache_factory::get_instance($cacheconfig)->get_cache($config);
} else {
$cache = cache_factory::get_instance()->get_cache($type);
}

return $cache->set($name, $data, $timeout, '', $filepath);
}

/**
 * 读取缓存,默认为文件缓存,不加载缓存配置。
 * @param string $name 缓存名称
 * @param $filepath 数据路径(模块名称) caches/cache_$filepath/
 * @param string $config 配置名称
 */
function getcache($name, $filepath='', $type='file', $config='') {
pc_base::load_sys_class('cache_factory','',0);
if($config) {
$cacheconfig = pc_base::load_config('cache');
$cache = cache_factory::get_instance($cacheconfig)->get_cache($config);
} else {
$cache = cache_factory::get_instance()->get_cache($type);
}
return $cache->get($name, '', '', $filepath);
}

/**
 * 删除缓存,默认为文件缓存,不加载缓存配置。
 * @param $name 缓存名称
 * @param $filepath 数据路径(模块名称) caches/cache_$filepath/
 * @param $type 缓存类型[file,memcache,apc]
 * @param $config 配置名称
 */
function delcache($name, $filepath='', $type='file', $config='') {
pc_base::load_sys_class('cache_factory','',0);
if($config) {
$cacheconfig = pc_base::load_config('cache');
$cache = cache_factory::get_instance($cacheconfig)->get_cache($config);
} else {
$cache = cache_factory::get_instance()->get_cache($type);
}
return $cache->delete($name, '', '', $filepath);
}

/**
 * 读取缓存,默认为文件缓存,不加载缓存配置。
 * @param string $name 缓存名称
 * @param $filepath 数据路径(模块名称) caches/cache_$filepath/
 * @param string $config 配置名称
 */
function getcacheinfo($name, $filepath='', $type='file', $config='') {
pc_base::load_sys_class('cache_factory');
if($config) {
$cacheconfig = pc_base::load_config('cache');
$cache = cache_factory::get_instance($cacheconfig)->get_cache($config);
} else {
$cache = cache_factory::get_instance()->get_cache($type);
}
return $cache->cacheinfo($name, '', '', $filepath);
}

/**
 * 生成sql语句,如果传入$in_cloumn 生成格式为 IN('a', 'b', 'c')
 * @param $data 条件数组或者字符串
 * @param $front 连接符
 * @param $in_column 字段名称
 * @return string
 */
function to_sqls($data, $front = ' AND ', $in_column = false) {
if($in_column && is_array($data)) {
$ids = '\''.implode('\',\'', $data).'\'';
$sql = "$in_column IN ($ids)";
return $sql;
} else {
if ($front == '') {
$front = ' AND ';
}
if(is_array($data) && count($data) > 0) {
$sql = '';
foreach ($data as $key => $val) {
$sql .= $sql ? " $front `$key` = '$val' " : " `$key` = '$val' ";
}
return $sql;
} else {
return $data;
}
}
}

/**
 * 分页函数
 * 
 * @param $num 信息总数
 * @param $curr_page 当前分页
 * @param $perpage 每页显示数
 * @param $urlrule URL规则
 * @param $array 需要传递的数组,用于增加额外的方法
 * @return 分页
 */
function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(),$setpages = 10) {
if(defined('URLRULE')) {
$urlrule = URLRULE;
$array = $GLOBALS['URL_ARRAY'];
} elseif($urlrule == '') {
$urlrule = url_par('page={$page}');
}
$multipage = '';
if($num > $perpage) {
$page = $setpages+1;
$offset = ceil($setpages/2-1);
$pages = ceil($num / $perpage);
if (defined('IN_ADMIN') && !defined('PAGES')) define('PAGES', $pages);
$from = $curr_page - $offset;
$to = $curr_page + $offset;
$more = 0;
if($page >= $pages) {
$from = 2;
$to = $pages-1;
} else {
if($from <= 1) {
$to = $page-1;
$from = 2;
}  elseif($to >= $pages) { 
$from = $pages-($page-2);  
$to = $pages-1;  
}
$more = 1;
$multipage .= '<a class="a1">'.$num.L('page_item').'</a>';
if($curr_page>0) {
$multipage .= ' <a href="'.pageurl($urlrule, $curr_page-1, $array).'" class="a1">'.L('previous').'</a>';
if($curr_page==1) {
$multipage .= ' <span>1</span>';
} elseif($curr_page>6 && $more) {
$multipage .= ' <a href="'.pageurl($urlrule, 1, $array).'">1</a>..';
} else {
$multipage .= ' <a href="'.pageurl($urlrule, 1, $array).'">1</a>';
}
}
for($i = $from; $i <= $to; $i++) { 
if($i != $curr_page) { 
$multipage .= ' <a href="'.pageurl($urlrule, $i, $array).'">'.$i.'</a>'; 
} else { 
$multipage .= ' <span>'.$i.'</span>'; 
if($curr_page<$pages) {
if($curr_page<$pages-5 && $more) {
$multipage .= ' ..<a href="'.pageurl($urlrule, $pages, $array).'">'.$pages.'</a> <a href="'.pageurl($urlrule, $curr_page+1, $array).'" class="a1">'.L('next').'</a>';
} else {
$multipage .= ' <a href="'.pageurl($urlrule, $pages, $array).'">'.$pages.'</a> <a href="'.pageurl($urlrule, $curr_page+1, $array).'" class="a1">'.L('next').'</a>';
}
} elseif($curr_page==$pages) {
$multipage .= ' <span>'.$pages.'</span> <a href="'.pageurl($urlrule, $curr_page, $array).'" class="a1">'.L('next').'</a>';
} else {
$multipage .= ' <a href="'.pageurl($urlrule, $pages, $array).'">'.$pages.'</a> <a href="'.pageurl($urlrule, $curr_page+1, $array).'" class="a1">'.L('next').'</a>';
}
}
return $multipage;
}
/**
 * 返回分页路径
 * 
 * @param $urlrule 分页规则
 * @param $page 当前页
 * @param $array 需要传递的数组,用于增加额外的方法
 * @return 完整的URL路径
 */
function pageurl($urlrule, $page, $array = array()) {
if(strpos($urlrule, '~')) {
$urlrules = explode('~', $urlrule);
$urlrule = $page < 2 ? $urlrules[0] : $urlrules[1];
}
$findme = array('{$page}');
$replaceme = array($page);
if (is_array($array)) foreach ($array as $k=>$v) {
$findme[] = '{$'.$k.'}';
$replaceme[] = $v;
}
$url = str_replace($findme, $replaceme, $urlrule);
$url = str_replace(array('http://','//','~'), array('~','/','http://'), $url);
return $url;
}

/**
 * URL路径解析,pages 函数的辅助函数
 *
 * @param $par 传入需要解析的变量 默认为,page={$page}
 * @param $url URL地址
 * @return URL
 */
function url_par($par, $url = '') {
if($url == '') $url = get_url();
$pos = strpos($url, '?');
if($pos === false) {
$url .= '?'.$par;
} else {
$querystring = substr(strstr($url, '?'), 1);
parse_str($querystring, $pars);
$query_array = array();
foreach($pars as $k=>$v) {
$query_array[$k] = $v;
}
$querystring = http_build_query($query_array).'&'.$par;
$url = substr($url, 0, $pos).'?'.$querystring;
}
return $url;
}

/**
 * 判断email格式是否正确
 * @param $email
 */
function is_email($email) {
return strlen($email) > 6 && preg_match("/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $email);
}

/**
 * iconv 编辑转换
 */
if (!function_exists('iconv')) {
function iconv($in_charset, $out_charset, $str) {
$in_charset = strtoupper($in_charset);
$out_charset = strtoupper($out_charset);
if (function_exists('mb_convert_encoding')) {
return mb_convert_encoding($str, $out_charset, $in_charset);
} else {
pc_base::load_sys_func('iconv');
$in_charset = strtoupper($in_charset);
$out_charset = strtoupper($out_charset);
if ($in_charset == 'UTF-8' && ($out_charset == 'GBK' || $out_charset == 'GB2312')) {
return utf8_to_gbk($str);
}
if (($in_charset == 'GBK' || $in_charset == 'GB2312') && $out_charset == 'UTF-8') {
return gbk_to_utf8($str);
}
return $str;
}
}
}

/**
 * 代码广告展示函数
 * @param intval $siteid 所属站点
 * @param intval $id 广告ID
 * @return 返回广告代码
 */
function show_ad($siteid, $id) {
$siteid = intval($siteid);
$id = intval($id);
if(!$id || !$siteid) return false;
$p = pc_base::load_model('poster_model');
$r = $p->get_one(array('spaceid'=>$id, 'siteid'=>$siteid), 'setting', '`id` ASC');
if ($r['setting']) {
$c = string2array($r['setting']);
} else {
$r['code'] = '';
}
return $c['code'];
}

/**
 * 获取当前的站点ID
 */
function get_siteid() {
static $siteid;
if (!empty($siteid)) return $siteid;
if (defined('IN_ADMIN')) {
if ($d = param::get_cookie('siteid')) {
$siteid = $d;
} else {
return '';
}
} else {
$data = getcache('sitelist', 'commons');
$site_url = SITE_PROTOCOL.SITE_URL;
foreach ($data as $v) {
if ($v['url'] == $site_url.'/') $siteid = $v['siteid'];
}
}
if (empty($siteid)) $siteid = 1;
return $siteid;
}

/**
 * 获取用户昵称
 * 不传入userid取当前用户nickname,如果nickname为空取username
 * 传入field,取用户$field字段信息
 */
function get_nickname($userid='', $field='') {
$return = '';
if(is_numeric($userid)) {
$member_db = pc_base::load_model('member_model');
$memberinfo = $member_db->get_one(array('userid'=>$userid));
if(!empty($field) && $field != 'nickname' && isset($memberinfo[$field]) &&!empty($memberinfo[$field])) {
$return = $memberinfo[$field];
} else {
$return = isset($memberinfo['nickname']) && !empty($memberinfo['nickname']) ? $memberinfo['nickname'].'('.$memberinfo['username'].')' : $memberinfo['username'];
}
} else {
if ($return = param::get_cookie('_nickname')) {
$return .= '('.param::get_cookie('_username').')';
}
}
return $return;
}

/**
 * 获取用户信息
 * 不传入$field返回用户所有信息,
 * 传入field,取用户$field字段信息
 */
function get_memberinfo($userid, $field='') {
if(!is_numeric($userid)) {
return false;
} else {
$member_db = pc_base::load_model('member_model');
$memberinfo = $member_db->get_one(array('userid'=>$userid));
if(!empty($field) && !empty($memberinfo[$field])) {
return $memberinfo[$field];
} else {
return $memberinfo;
}
}
}

/**
 * 获取用户头像,建议传入phpssouid
 * @param $uid 默认为phpssouid 
 * @param $is_userid $uid是否为v9 userid,如果为真,执行sql查询此用户的phpssouid
 * @param $size 头像大小 有四种[30x30 45x45 90x90 180x180] 默认30
 */
function get_memberavatar($uid, $is_userid='', $size='30') {
if($is_userid) {
$db = pc_base::load_model('member_model');
$memberinfo = $db->get_one(array('userid'=>$uid));
if(isset($memberinfo['phpssouid'])) {
$uid = $memberinfo['phpssouid'];
} else {
return false;
}
}
pc_base::load_app_class('client', '', 0);
define('APPID', pc_base::load_config('system', 'phpsso_appid'));
$phpsso_api_url = pc_base::load_config('system', 'phpsso_api_url');
$phpsso_auth_key = pc_base::load_config('system', 'phpsso_auth_key');
$client = new client($phpsso_api_url, $phpsso_auth_key);
$avatar = $client->ps_getavatar($uid);
if(isset($avatar[$size])) {
return $avatar[$size];
} else {
return false;
}
}

/**
 * 调用关联菜单
 * @param $linkageid
 * @param $id
 * @param $defaultvalue
 */
function menu_linkage($linkageid = 0, $id = 'linkid', $defaultvalue = 0) {
$linkageid = intval($linkageid);
$datas = array();
$datas = getcache($linkageid,'linkage');
$infos = $datas['data'];
if($datas['style']=='1') {
$title = $datas['title'];
$container = 'content'.random(3).date('is');
if(!defined('DIALOG_INIT_1')) {
define('DIALOG_INIT_1', 1);
$string .= '<script type="text/javascript" src="'.JS_PATH.'dialog.js"></script>';
//TODO $string .= '<link href="'.CSS_PATH.'dialog.css" rel="stylesheet" type="text/css">';
}
if(!defined('LINKAGE_INIT_1')) {
define('LINKAGE_INIT_1', 1);
$string .= '<script type="text/javascript" src="'.JS_PATH.'linkage/js/pop.js"></script>';
}
$var_div = $defaultvalue && (ROUTE_A=='edit' || ROUTE_A=='account_manage_info') ? menu_linkage_level($defaultvalue,$linkageid,$infos) : $datas['title'];
$var_input = $defaultvalue && (ROUTE_A=='edit' || ROUTE_A=='account_manage_info') ? '<input type="hidden" name="info['.$id.']" value="'.$defaultvalue.'">' : '<input type="hidden" name="info['.$id.']" value="">';
$string .= '<div name="'.$id.'" value="" id="'.$id.'" class="ib">'.$var_div.'</div>'.$var_input.' <input type="button" name="btn_'.$id.'" class="button" value="选择" οnclick="open_linkage(\''.$id.'\',\''.$title.'\','.$container.',\''.$linkageid.'\')">';
$string .= '<script type="text/javascript">';
$string .= 'var returnid_'.$id.'= \''.$id.'\';';
$string .= 'var returnkeyid_'.$id.' = \''.$linkageid.'\';';
$string .=  'var '.$container.' = new Array(';
foreach($infos AS $k=>$v) {
if($v['parentid'] == 0) {
$s[]='new Array(\''.$v['linkageid'].'\',\''.$v['name'].'\',\''.$v['parentid'].'\')';
} else {
continue;
}
}
$s = implode(',',$s);
$string .=$s;
$string .= ')';
$string .= '</script>';
} else {
$title = $defaultvalue ? $infos[$defaultvalue]['name'] : $datas['title'];
$colObj = random(3).date('is');
$string = '';
if(!defined('LINKAGE_INIT')) {
define('LINKAGE_INIT', 1);
$string .= '<script type="text/javascript" src="'.JS_PATH.'linkage/js/mln.colselect.js"></script>';
if(defined('IN_ADMIN')) {
$string .= '<link href="'.JS_PATH.'linkage/style/admin.css" rel="stylesheet" type="text/css">';
} else {
$string .= '<link href="'.JS_PATH.'linkage/style/css.css" rel="stylesheet" type="text/css">';
}
}
$string .= '<input type="hidden" name="info['.$id.']" value="1"><div id="'.$id.'"></div>';
$string .= '<script type="text/javascript">';
$string .= 'var colObj'.$colObj.' = {"Items":[';
foreach($infos AS $k=>$v) {
$s .= '{"name":"'.$v['name'].'","topid":"'.$v['parentid'].'","colid":"'.$k.'","value":"'.$k.'","fun":function(){}},';
}
$string .= substr($s, 0, -1);
$string .= ']};';
$string .= '$("#'.$id.'").mlnColsel(colObj'.$colObj.',{';
$string .= 'title:"'.$title.'",';
$string .= 'value:"'.$defaultvalue.'",';
$string .= 'width:100';
$string .= '});';
$string .= '</script>';
}
return $string;
}

/**
 * 联动菜单层级
 */

function menu_linkage_level($linkageid,$keyid,$infos,$result=array()) {
if(array_key_exists($linkageid,$infos)) {
$result[]=$infos[$linkageid]['name'];
return menu_linkage_level($infos[$linkageid]['parentid'],$keyid,$infos,$result);
}
krsort($result);
return implode(' > ',$result);
}

/**
 * IE浏览器判断
 */

function is_ie() {
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if((strpos($useragent, 'opera') !== false) || (strpos($useragent, 'konqueror') !== false)) return false;
if(strpos($useragent, 'msie ') !== false) return true;
return false;
}


/**
 * 文件下载
 * @param $filepath 文件路径
 * @param $filename 文件名称
 */

function file_down($filepath, $filename = '') {
if(!$filename) $filename = basename($filepath);
if(is_ie()) $filename = rawurlencode($filename);
$filetype = fileext($filename);
$filesize = sprintf("%u", filesize($filepath));
if(ob_get_length() !== false) @ob_end_clean();
header('Pragma: public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: binary');
header('Content-Encoding: none');
header('Content-type: '.$filetype);
header('Content-Disposition: attachment; filename="'.$filename.'"');
header('Content-length: '.$filesize);
readfile($filepath);
exit;
}

/**
 * 判断字符串是否为utf8编码,英文和半角字符返回ture
 * @param $string
 * @return bool
 */
function is_utf8($string) {
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)*$%xs', $string);
}

/**
 * 组装生成ID号
 * @param $modules 模块名
 * @param $contentid 内容ID
 * @param $siteid 站点ID
 */
function id_encode($modules,$contentid, $siteid) {
return urlencode($modules.'-'.$contentid.'-'.$siteid);
}

/**
 * 解析ID
 * @param $id 评论ID
 */
function id_decode($id) {
return explode('-', $id);
}

/**
 * 对用户的密码进行加密
 * @param $password
 * @param $encrypt //传入加密串,在修改密码时做认证
 * @return array/password
 */
function password($password, $encrypt='') {
$pwd = array();
$pwd['encrypt'] =  $encrypt ? $encrypt : create_randomstr();
$pwd['password'] = md5(md5(trim($password)).$pwd['encrypt']);
return $encrypt ? $pwd['password'] : $pwd;
}
/**
 * 生成随机字符串
 * @param string $lenth 长度
 * @return string 字符串
 */
function create_randomstr($lenth = 6) {
return random($lenth, '123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ');
}

/**
 * 检查密码长度是否符合规定
 *
 * @param STRING $password
 * @return  TRUE or FALSE
 */
function is_password($password) {
$strlen = strlen($password);
if($strlen >= 6 && $strlen <= 20) return true;
return false;
}

 /**
 * 检测输入中是否含有错误字符
 *
 * @param char $string
 * @return TRUE or FALSE
 */
function is_badword($string) {
$badwords = array("\\",'&',' ',"'",'"','/','*',',','<','>',"\r","\t","\n","#");
foreach($badwords as $value){
if(strpos($string, $value) !== FALSE) {
return TRUE;
}
}
return FALSE;
}

/**
 * 检查用户名是否符合规定
 *
 * @param STRING $username
 * @return  TRUE or FALSE
 */
function is_username($username) {
$strlen = strlen($username);
if(is_badword($username) || !preg_match("/^[a-zA-Z0-9_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+$/", $username)){
return false;
} elseif ( 20 <= $strlen || $strlen < 2 ) {
return false;
}
return true;
}

/**
 * 检查id是否存在于数组中
 * 
 * @param $id
 * @param $ids
 * @param $s
 */
function check_in($id, $ids = '', $s = ',') {
if(!$ids) return false;
$ids = explode($s, $ids);
return is_array($id) ? array_intersect($id, $ids) : in_array($id, $ids);
}

/**
 * 对数据进行编码转换
 * @param array/string $data       数组
 * @param string $input     需要转换的编码
 * @param string $output    转换后的编码
 */
function array_iconv($data, $input = 'gbk', $output = 'utf-8') {
if (!is_array($data)) {
return iconv($input, $output, $data);
} else {
foreach ($data as $key=>$val) {
if(is_array($val)) {
$data[$key] = array_iconv($val, $input, $output);
} else {
$data[$key] = iconv($input, $output, $val);
}
}
return $data;
}
}

/**
 * 生成缩略图函数
 * @param unknown_type $imgurl 图片路径
 * @param unknown_type $width  缩略图宽度
 * @param unknown_type $height 缩略图高度
 * @param unknown_type $autocut 是否自动裁剪 默认裁剪,当高度或宽度有一个数值为0是,自动关闭
 * @param unknown_type $smallpic 无图片是默认图片路径
 */
function thumb($imgurl, $width = 100, $height = 100 ,$autocut = 1, $smallpic = 'nopic.gif') {
global $image;
$upload_url = pc_base::load_config('system','upload_url');
$upload_path = pc_base::load_config('system','upload_path');
if(empty($imgurl)) return IMG_PATH.$smallpic;
$imgurl_replace= str_replace($upload_url, '', $imgurl);
if(!extension_loaded('gd') || strpos($imgurl_replace, '://')) return $imgurl;
if(!file_exists($upload_path.$imgurl_replace)) return IMG_PATH.$smallpic;
list($width_t, $height_t, $type, $attr) = getimagesize($upload_path.$imgurl_replace);
if($width>=$width_t || $height>=$height_t) return $imgurl;
$newimgurl = dirname($imgurl_replace).'/thumb_'.$width.'_'.$height.'_'.basename($imgurl_replace);
if(file_exists($upload_path.$newimgurl)) return $upload_url.$newimgurl;
if(!is_object($image)) {
pc_base::load_sys_class('image','','0');
$image = new image(1,0);
}
return $image->thumb($upload_path.$imgurl_replace, $upload_path.$newimgurl, $width, $height, '', $autocut) ? $upload_url.$newimgurl : $imgurl;
}

/**
 * 水印添加
 * @param $source 原图片路径
 * @param $target 生成水印图片途径,默认为空,覆盖原图
 * @param $siteid 站点id,系统需根据站点id获取水印信息
 */
function watermark($source, $target = '',$siteid) {
global $image_w;
if(empty($source)) return $source;
if(!extension_loaded('gd') || strpos($source, '://')) return $source;
if(!$target) $target = $source;
if(!is_object($image_w)){
pc_base::load_sys_class('image','','0');
$image_w = new image(0,$siteid);
}
$image_w->watermark($source, $target);
return $target;
}

/**
 * 当前路径 
 * 返回指定栏目路径层级
 * @param $catid 栏目id
 * @param $symbol 栏目间隔符
 * @param $urlrule url规则
 */
function catpos($catid, $symbol=' > '){
$category_arr = array();
$category_arr = getcache('category_content','commons');
if(!isset($category_arr[$catid])) return '';
$pos = '';
$siteurl = siteurl($category_arr[$catid]['siteid']);
$arrparentid = array_filter(explode(',', $category_arr[$catid]['arrparentid'].','.$catid));
foreach($arrparentid as $catid) {
$url = $category_arr[$catid]['url'];
if(strpos($url, '://') === false) $url = $siteurl.$url;
$pos .= '<a href="'.$url.'">'.$category_arr[$catid]['catname'].'</a>'.$symbol;
}
return $pos;
}

/**
 * 根据catid获取子栏目数据的sql语句
 * @param string $module 缓存文件名
 * @param intval $catid 栏目ID
 */

function get_sql_catid($module = 'category_content', $catid = 0) {
$category = getcache($module,'commons');
$catid = intval($catid);
if(!isset($category[$catid])) return false;
return $category[$catid]['child'] ? " `catid` IN(".$category[$catid]['arrchildid'].") " : " `catid`=$catid ";
}

/**
 * 获取子栏目
 * Enter description here ...
 * @param $module
 * @param $parentid
 * @param $type
 */
function subcat($parentid = NULL, $type = NULL,$self = '0', $siteid = '') {
if (empty($siteid)) $siteid = get_siteid();
$category = getcache('category_content','commons');
foreach($category as $id=>$cat) {
if($cat['siteid'] == $siteid && ($parentid === NULL || $cat['parentid'] == $parentid) && ($type === NULL || $cat['type'] == $type)) $subcat[$id] = $cat;
if($self == 1 && $cat['catid'] == $parentid && !$cat['child'])  $subcat[$id] = $cat;
}
return $subcat;
}

/**
 * 获取内容地址
 * @param $catid   栏目ID
 * @param $id      文章ID
 * @param $allurl  是否以绝对路径返回
 */
function go($catid,$id, $allurl = 0) {
static $category;
if(empty($category)) $category = getcache('category_content','commons');
$id = intval($id);
if(!$id || !isset($category[$catid])) return '';
$modelid = $category[$catid]['modelid'];
if(!$modelid) return '';
$db = pc_base::load_model('content_model');
$db->set_model($modelid);
$r = $db->get_one(array('id'=>$id), '`url`');
if (!empty($allurl)) {
if (strpos($r['url'], '://')===false) {
if (strpos($category[$catid]['url'], '://') === FALSE) {
$site = siteinfo($category[$catid]['siteid']);
$r['url'] = substr($site['domain'], 0, -1).$r['url'];
} else {
$r['url'] = $category[$catid]['url'].$r['url'];
}
}
}
return $r['url'];
}

/**
 * 将附件地址转换为绝对地址
 * @param $path
 */
function atturl($path) {
if(strpos($path, ':/')) {
return $path;
} else {
$sitelist = getcache('sitelist','commons');
$siteid =  get_siteid();
$siteurl = $sitelist[$siteid]['domain'];
$domainlen = strlen($sitelist[$siteid]['domain'])-1;
$path = $siteurl.$path;
$path = substr_replace($path, '/', strpos($path, '//',$domainlen),2);
return  $path;
}
}

/**
 * 判断模块是否安装
 * @param $m 模块名称
 */
function module_exists($m = '') {
if ($m=='admin') return true;
$modules = getcache('modules', 'commons');
$modules = array_keys($modules);
return in_array($m, $modules);
}

/**
 * 生成SEO
 * @param $siteid       站点ID
 * @param $catid        栏目ID
 * @param $title        标题
 * @param $description  描述
 * @param $keyword      关键词
 */
function seo($siteid, $catid = '', $title = '', $description = '', $keyword = '') {
if (!empty($title))$title = strip_tags($title);
if (!empty($description)) $description = strip_tags($description);
if (!empty($keyword)) $keyword = str_replace(' ', ',', strip_tags($keyword));
$sites = getcache('sitelist', 'commons');
$site = $sites[$siteid];
$cat = array();
if (!empty($catid)) {
$categorys = getcache('category_content','commons');
$cat = $categorys[$catid];
$cat['setting'] = string2array($cat['setting']);
}
$seo['site_title'] =isset($site['site_title']) && !empty($site['site_title']) ? $site['site_title'] : $site['name'];
$seo['keyword'] = !empty($keyword) ? $keyword : '';
$seo['description'] = isset($description) && !empty($description) ? $description : (isset($cat['setting']['meta_description']) && !empty($cat['setting']['meta_description']) ? $cat['setting']['meta_description'] : (isset($site['description']) && !empty($site['description']) ? $site['description'] : ''));
$seo['title'] =  (isset($title) && !empty($title) ? $title.' - ' : '').(isset($cat['setting']['meta_title']) && !empty($cat['setting']['meta_title']) ? $cat['setting']['meta_title'].' - ' : (isset($cat['catname']) && !empty($cat['catname']) ? $cat['catname'].' - ' : ''));
foreach ($seo as $k=>$v) {
$seo[$k] = htmlspecialchars(str_replace(array("\n","\r"), '', $v));
}
return $seo;
}

/**
 * 获取站点的信息
 * @param $siteid   站点ID
 */
function siteinfo($siteid) {
static $sitelist;
if (empty($sitelist)) $sitelist  = getcache('sitelist','commons');
return isset($sitelist[$siteid]) ? $sitelist[$siteid] : '';
}

/**
 * 生成CNZZ统计代码
 */

function tjcode() {
if(!module_exists('cnzz')) return false;
$config = getcache('cnzz', 'commons');
if (empty($config)) {
return false;
} else {
return '<script src=\'http://pw.cnzz.com/c.php?id='.$config['siteid'].'&l=2\' language=\'JavaScript\' charset=\'gb2312\'></script>';
}
}

/**
 * 生成标题样式
 * @param $style   样式
 * @param $html    是否显示完整的STYLE
 */
function title_style($style, $html = 1) {
$str = '';
if ($html) $str = ' style="';
$style_arr = explode(';',$style);
if (!empty($style_arr[0])) $str .= 'color:'.$style_arr[0].';';
if (!empty($style_arr[1])) $str .= 'font-weight:'.$style_arr[1].';';
if ($html) $str .= '" ';
return $str;
}

/**
 * 获取站点域名
 * @param $siteid   站点id
 */
function siteurl($siteid) {
static $sitelist;
if(!$siteid) return WEB_PATH;
if(empty($sitelist)) $sitelist = getcache('sitelist','commons');
return substr($sitelist[$siteid]['domain'],0,-1);
}
/**
 * 生成上传附件验证
 */

function upload_key($args, $operation = 'ENCODE') {
$pc_auth_key = md5(pc_base::load_config('system','auth_key').$_SERVER['HTTP_USER_AGENT']);
$authkey = sys_auth($args, $operation, $pc_auth_key);
return $authkey;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
毕业设计,基于SpringBoot+Vue+MySQL开发的纺织品企业财务管理系统,源码+数据库+毕业论文+视频演示 在如今社会上,关于信息上面的处理,没有任何一个企业或者个人会忽视,如何让信息急速传递,并且归档储存查询,采用之前的纸张记录模式已经不符合当前使用要求了。所以,对纺织品企业财务信息管理的提升,也为了对纺织品企业财务信息进行更好的维护,纺织品企业财务管理系统的出现就变得水到渠成不可缺少。通过对纺织品企业财务管理系统的开发,不仅仅可以学以致用,让学到的知识变成成果出现,也强化了知识记忆,扩大了知识储备,是提升自我的一种很好的方法。通过具体的开发,对整个软件开发的过程熟练掌握,不论是前期的设计,还是后续的编码测试,都有了很深刻的认知。 纺织品企业财务管理系统通过MySQL数据库与Spring Boot框架进行开发,纺织品企业财务管理系统能够实现对财务人员,员工,收费信息,支出信息,薪资信息,留言信息,报销信息等信息的管理。 通过纺织品企业财务管理系统对相关信息的处理,让信息处理变的更加的系统,更加的规范,这是一个必然的结果。已经处理好的信息,不管是用来查找,还是分析,在效率上都会成倍的提高,让计算机变得更加符合生产需要,变成人们不可缺少的一种信息处理工具,实现了绿色办公,节省社会资源,为环境保护也做了力所能及的贡献。 关键字:纺织品企业财务管理系统,薪资信息,报销信息;SpringBoot
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值