コード例 #1
0
ファイル: simpleTime.php プロジェクト: stitch/RetroTV
 public function getDifferenceInMinutes($hours = 0, $minutes = 0)
 {
     $tmpTime = new time($hours, $minutes);
     $difference = $this->getSeconds - $tmpTime->getMinutes();
     unset($tmpTime);
     return $difference;
 }
コード例 #2
0
ファイル: htmlFunctions.php プロジェクト: printedheart/iwfms
 function html_timestamp($datetime)
 {
     $result = time::splitts($datetime);
     echo $result['date'];
     nbsp(2);
     echo '<span class="small">' . $result['time'] . '</span>';
 }
コード例 #3
0
ファイル: performance.php プロジェクト: printedheart/iwfms
 function message($msg)
 {
     $performanceMode = false;
     if ($performanceMode) {
         echo '<h3 class="debug">:&nbsp;' . $msg . ': ' . time::stoptiming() . '</h3>';
     }
 }
コード例 #4
0
ファイル: time.php プロジェクト: printedheart/iwfms
 function splitts($timestamp)
 {
     $datetime = time::ts_mysql_mysql_d($timestamp);
     list($date, $time) = explode(' ', $datetime);
     $result['time'] = $time;
     $result['date'] = $date;
     return $result;
 }
コード例 #5
0
ファイル: user.php プロジェクト: dalinhuang/zotop
 /**
  * 刷新用户状态,包括登录时间以及登录次数等
  *
  */
 public function refresh($id = '')
 {
     $id = empty($id) ? $this->id : $id;
     if (empty($id)) {
         return false;
     }
     $result = $this->update(array('id' => (int) $id, 'logintime' => time::current(), 'loginnum' => 'loginnum + 1', 'loginip' => ip::current()));
     return $result;
 }
コード例 #6
0
ファイル: main.php プロジェクト: dalinhuang/zotop
 public function onDefault()
 {
     $site = array();
     $site['name'] = zotop::config('zotop.site.name');
     $site['totalsize'] = zotop::config('zotop.ftp.size');
     $site['totalsize'] = (int) $site['totalsize'] == 0 ? '--' : format::byte($site['totalsize']);
     $database = array();
     $database['size'] = zotop::db()->size();
     $database['size'] = format::byte($database['size']);
     $page['title'] = '控制中心';
     $page['css'][] = url::module() . '/admin/css/main.css';
     zotop::add('zotop.main.main', array(&$this, 'notepad'));
     zotop::add('zotop.main.main', array(&$this, 'mylog'));
     page::header($page);
     page::top();
     page::navbar($this->navbar(), 'main');
     page::add('');
     page::add('<div id="user" class="clearfix">');
     page::add('	<div id="userface"><span class="image">' . html::image(zotop::user('image')) . '</span></div>');
     page::add('	<div id="userinfo">');
     page::add('	<h2 id="welcome">欢迎您,' . zotop::user('name') . ' <span id="sign">' . zotop::user('sign') . '</span></h2>');
     page::add('	<div id="login">登录时间:' . time::format(zotop::user('logintime')) . ' 登录次数:' . zotop::user('loginnum') . ' 登录IP:' . zotop::user('loginip') . '</div>');
     //加载hook
     zotop::run('zotop.main.action');
     page::add('');
     page::add('</div>');
     page::add('<div class="grid-m-s">');
     page::add('<div class="col-main">');
     page::add('<div class="col-main-inner">');
     zotop::run('zotop.main.main');
     page::add('</div>');
     page::add('</div>');
     page::add('<div class="col-sub">');
     zotop::run('zotop.main.sub');
     block::header(array('title' => '网站信息', 'action' => '<a class="more" href="' . zotop::url('zotop/info/site') . '">详细</a>'));
     echo '<table class="table">';
     echo '<tr><td class="w80">网站名称:</td><td>' . $site['name'] . '</td></tr>';
     echo '<tr><td class="w80">空间占用:</td><td>' . $site['totalsize'] . '</td></tr>';
     echo '<tr><td class="w80">已上传文件:</td><td></td></tr>';
     echo '<tr><td class="w80">数据库大小:</td><td>' . $database['size'] . '</td></tr>';
     echo '</table>';
     block::footer();
     block::header(array('title' => '系统信息', 'action' => '<a class="more" href="' . zotop::url('zotop/main/system') . '">详细</a>'));
     echo '<table class="table">';
     echo '<tr><td class="w80">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
     echo '<tr><td class="w80">程序设计:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
     echo '<tr><td class="w80">程序开发:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
     echo '<tr><td class="w80">官方网站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
     echo '<tr><td class="w80">安装时间:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
     echo '</table>';
     block::footer();
     page::add('</div>');
     page::add('</div>');
     page::bottom('<span class="zotop-tip">上次登录时间:' . time::format(zotop::user('logintime')) . '</span>');
     page::footer();
 }
コード例 #7
0
ファイル: message.php プロジェクト: ushahidi/SMS-Turks
 static function add_message($number, $sms)
 {
     $time = time::db_timestamp();
     $message = ORM::factory('message');
     $message->number = $number;
     $message->sms = $sms;
     $message->received = $time;
     $message->updated = $time;
     return $message->save();
 }
コード例 #8
0
ファイル: module.php プロジェクト: dalinhuang/zotop
 public function onDefault()
 {
     $module = zotop::model('zotop.module');
     $list = $module->getAll(array('select' => '*', 'orderby' => 'updatetime desc'));
     $module->getStructure();
     $page['title'] = '模块管理';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header();
     $column = array();
     $column['status w30 center'] = '状态';
     $column['modulename'] = '模块ID';
     $column['name'] = '模块名称';
     $column['path'] = '安装目录';
     $column['varsion w60 center'] = '版本号';
     $column['updatetime w150'] = '更新时间';
     $column['manage lock'] = '锁定';
     $column['manage rename'] = '设置';
     $column['manage edit'] = '权限';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($list as $module) {
         $module['status-icon'] = $module['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/ok.gif');
         $column = array();
         $column['status w30 center'] = $module['status-icon'];
         $column['name w80'] = $module['id'];
         $column['modulename'] = '<a><b>' . $module['name'] . '</b></a><h5>' . $module['description'] . '</h5>';
         $column['loginnum w60'] = $module['path'];
         $column['loginip w60 center'] = $module['version'];
         $column['logintime w150'] = time::format($module['updatetime']);
         if ($module['status'] == -1) {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'], 'status' => 0)) . '">启用</a>';
         } else {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'])) . '">禁用</a>';
         }
         $column['manage setting'] = '<a href="' . zotop::url('zotop/module/setting', array('id' => $module['id'])) . '">设置</a>';
         $column['manage priv'] = '<a href="' . zotop::url('zotop/module/priv', array('id' => $module['id'])) . '">权限</a>';
         $column['manage delete'] = '<a>卸载</a>';
         table::row($column);
     }
     table::footer();
     form::buttons();
     form::footer();
     page::bottom();
     page::footer();
 }
コード例 #9
0
ファイル: user.php プロジェクト: dalinhuang/zotop
 public function onDefault()
 {
     $User = zotop::model('zotop.user');
     $list = $User->getAll(array('select' => '*', 'where' => array('modelid', '=', 'system'), 'orderby' => 'logintime desc'));
     $page['title'] = '系统用户管理';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header();
     $column = array();
     $column['status w30 center'] = '状态';
     $column['username'] = '******';
     $column['name'] = '姓名';
     $column['loginnum'] = '登录次数';
     $column['loginip w120'] = '登录IP';
     $column['logintime w150'] = '登录时间';
     $column['manage lock'] = '锁定';
     $column['manage rename'] = '修改密码';
     $column['manage edit'] = '编辑';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($list as $user) {
         $user['status-icon'] = $user['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/user.gif');
         $column = array();
         $column['status w30 center'] = $user['status-icon'];
         $column['username'] = '******' . $user['username'] . '</b></a><h5>' . $user['email'] . '</h5>';
         $column['name w60'] = $user['name'];
         $column['loginnum w60'] = $user['loginnum'];
         $column['loginip w120'] = $user['loginip'];
         $column['logintime w150'] = time::format($user['logintime']);
         if ($user['status'] == -1) {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/user/lock', array('id' => $user['id'], 'status' => 0)) . '">解锁</a>';
         } else {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/user/lock', array('id' => $user['id'])) . '">锁定</a>';
         }
         $column['manage rename'] = '<a href="' . zotop::url('zotop/user/changepassword', array('id' => $user['id'])) . '">修改密码</a>';
         $column['manage edit'] = '<a href="' . zotop::url('zotop/user/changeinfo', array('id' => $user['id'])) . '">编辑</a>';
         $column['manage delete'] = '<a>删除</a>';
         table::row($column);
     }
     table::footer();
     form::buttons();
     form::footer();
     page::bottom();
     page::footer();
 }
コード例 #10
0
ファイル: module.php プロジェクト: dalinhuang/zotop
 public function install($id, $path = '')
 {
     $path = empty($path) ? $id : $path;
     $modulePath = ZOTOP_MODULES . DS . $id;
     $modulePath = path::clean($modulePath);
     $moduleFile = $modulePath . DS . 'module.php';
     $module = @(include $moduleFile);
     $module['path'] = $path;
     $module['type'] = '1';
     $module['url'] = $path;
     $module['status'] = 1;
     $module['order'] = $this->max() + 1;
     $module['installtime'] = time::now();
     $module['updatetime'] = time::now();
     if (is_array($module)) {
         $insert = $this->insert($module);
         if ($insert) {
             return $this->reload();
         }
     }
     return false;
 }
コード例 #11
0
ファイル: system_footer.php プロジェクト: printedheart/iwfms
<br></td>
<td width="1" class="outliner"><img src="images/spacer.gif" border="0" width="1" height="1"></td>
</tr> </table> 
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr> 
    <td class="outliner"><img src="images/spacer.gif" border="0" width="1" height="1"></td>
  </tr>
</table></td>
</tr> </table> 
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
  <tr> 
    <td width="1" class="outliner"><img src="images/spacer.gif" border="0" width="1" height="1"></td>
    <td class="footerAndHeadercolour">&nbsp;</td>
    <td class="footerAndHeadercolour" align="right">
      Processing time:<?php 
echo time::stoptiming();
?>
&nbsp;
    </td>
      <td width="1" class="outliner"><img src="images/spacer.gif" border="0" width="1" height="1"></td>
  </tr>
   <tr> 
    <td colspan="4" class="outliner"><img src="images/spacer.gif" border="0" width="1" height="1"></td>
    </tr>
</table>
</body>
</html>

<?php 
if ($db != '') {
    debug::message("disconnecting from database");
コード例 #12
0
ファイル: div01.php プロジェクト: karu/SmallTime
<?php

/********************************************************************************
* Small Time - Plugin : Kalender Absenzenansicht der Mitarbeiter
/*******************************************************************************
* Version 0.896
* Author:  IT-Master GmbH
* www.it-master.ch / info@it-master.ch
* Copyright (c), IT-Master GmbH, All rights reserved
*******************************************************************************/
$_last = new time();
$_last->set_timestamp($_time->get_lastmonth());
$_last->set_monatsname($_settings->_array[11][1]);
$_next = new time();
$_next->set_timestamp($_time->get_nextmonth());
$_next->set_monatsname($_settings->_array[11][1]);
?>
<table width='390' border='0' cellpadding='2' cellspacing='0'>
	<tr>
		<td valign='middle'></td>
		<td valign='middle' align='right'>
			<img src='images/icons/calendar_view_month.png' border=0>
		</td>
		<td valign='middle' align='left'>
			<a title='Monat <?php 
echo $_last->_monatname;
?>
' href='?action=plugins&timestamp=<?php 
echo $_last->_timestamp;
?>
'>
コード例 #13
0
<?php

include "exe3.php";
function outputComment($output)
{
    $arr = createComment('Ram', 'Awesome Program!', '6:30');
    echo 'Name : ' . $arr[0] . '<br>';
    echo 'Comment : ' . $arr[1] . '<br>';
    echo 'Time : ' . $arr[2] . '<br>';
}
outputComment($output);
$time1 = new time('07:08:00');
$time2 = new time();
$interval = $time1->diff($time2);
echo $interval->format('%R%a days');
コード例 #14
0
ファイル: index.php プロジェクト: dalinhuang/zotop
form::header(array('valid' => 'false', 'class' => 'list', 'action' => zotop::url('system/file/action')));
$column = array();
$column['select'] = html::checkbox(array('name' => 'table', 'class' => 'selectAll'));
$column['w40 center'] = '图标';
$column['name'] = '名称';
$column['user_name'] = '用户名';
//$column['type'] = '类型';
$column['size w60'] = '大小';
$column['atime w120'] = '创建时间';
table::header('list', $column);
foreach ($files as $file) {
    $column = array();
    $column['select'] = html::checkbox(array('name' => 'id[]', 'value' => $file['id'], 'class' => 'select'));
    $column['center w40'] = $file['type'] == 'image' ? '<div class="image">' . html::image($file['path'], array('style' => 'display:none;')) . '</div>' : '<div class="zotop-icon zotop-icon-file ' . file::ext($file['path']) . '"></div>';
    $column['name'] = '<div><b>' . $file['name'] . '</b></div>';
    $column['name'] .= '<h5>';
    $column['name'] .= '<a href="' . zotop::url('system/file/down/' . $file['id']) . '">下载</a>';
    $column['name'] .= '&nbsp;&nbsp;<a href="' . zotop::url('system/file/edit/' . $file['id']) . '" class="dialog">编辑</a>';
    $column['name'] .= '&nbsp;&nbsp;<a href="' . zotop::url('system/file/delete/' . $file['id']) . '" class="confirm">删除</a>';
    $column['name'] .= '</h5>';
    $column['user_name w100'] = '<a><b>' . $file['user_username'] . '</b></a><div class="textflow w100">' . $file['user_name'] . '</div>';
    //$column['type w60'] = ''.$file['type'].'';
    $column['size w60'] = '' . format::byte($file['size']) . '';
    $column['atime w120'] = '' . time::format($file['createtime']) . '';
    table::row($column);
}
table::footer();
form::buttons(array('type' => 'submit', 'value' => '永久删除'));
form::footer($pagination);
$this->bottom();
$this->footer();
コード例 #15
0
 function make_show_action() {
     header('Cache-control: private, must-revalidate');
     @set_time_limit(0);
     $submit = front::post('submit') ? front::post('submit') : front::get('submit');
     if (!$submit)
         return;
     chkpw('cache_content');
     //time::start();
     $post = front::$post + front::$get;
     unset($post['submit']);
     $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']);
     $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&catid=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&submit=(\d+)#', '', $c_url);
     $c_url = 'index.php?' . $c_url;
     $c_url.='&submit=1';
     
     $category = category::getInstance(); //实例化栏目类
     
     if ($post['aid_start']) {
         $aid_start = $post['aid_start'];
         $aid_end = $post['aid_end'];
         $where = "aid>=$aid_start and aid<=$aid_end AND checked=1 AND (ishtml IS NULL OR ishtml!=2)";
         $c_url.='&aid_start=' . $aid_start . '&aid_end=' . $aid_end;
     } elseif (isset($post['catid'])) {
         $catid = $post['catid'];
         $categories = $category->sons($catid);
         $categories[] = $catid;
         $categories = implode(',', $categories);
         $where = "catid in(" . $categories . ') and checked=1 AND (ishtml IS NULL OR ishtml!=2)';
         $c_url.='&catid=' . $catid;
     }else
         return;
     $case = 'archive';
     $act = 'show';
     $_GET = array('case' => $case, 'act' => $act);
     $front = new front();
     front::$admin = false;
     front::$html = true;
     front::$rewrite = false;
     $case = $case . '_act';
     $case = new $case();
     $case->init();
     $method = $act . '_action';
     //$time_start = time::getTime();
     
     $archive = new archive(); //实例化文章类
     
     if (config::get('group_on')) { //启用分组生成
         $make_page = $post['make_page'] == '' ? 1 : $post['make_page'];
         $archive->getrows($where);
         $archive_num = $archive->record_count;
         $group_count = config::get('group_count');
         $make_page_num = ceil($archive_num / $group_count);
         $totalpage = (($make_page - 1) * $group_count) . ',' . $group_count;
         $c_url.='&make_page=' . ($make_page + 1);
     } else {
         $totalpage = "";
     }
     
     $archives = $archive->getrows($where, $totalpage, '1'); //取到要生成的所有文章
     
     $cpage = 0;
     foreach ($archives as $arc) {
         if (!category::getarcishtml($arc))  //如果文章设置不生成则跳过
             continue;
         if($arc['linkto']){ //如果有跳转连接则跳过生成
         	continue;
         }
         $case->view->archive = $arc;
         front::$get['aid'] = $case->view->aid = $case->view->archive['aid'];
         $case->view->catid = $case->view->archive['catid'];
         
         $case->view->topid = category::gettopparent($case->view->catid);
         $case->view->parentid = $category->getparent($case->view->catid);
         
         $template = $case->view->archive['template'];
         $content = $case->view->archive['content'];
         
         $case->view->categories = category::getpositionlink2($case->view->catid);
         
         //关键字连接
         $linkword = new linkword();
         $linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
         foreach ($linkwords as $linkword) {
             if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
                 $linkword['linktimes'] = (int) $linkword['linktimes'];
                 $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>";
             } else {
                 $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>";
             }
             if (isset($link)) {
                 $content = preg_replace("%(?!\"]*>)$linkword[linkword](?!\s*\")%i", "\\1$link\\2", $content, $linkword['linktimes']);
             }
             unset($link);
         }
         
         //相关文章
         $case->view->likenews = $case->getLike($case->view->archive['tag'], $case->view->archive['keyword']);
         
         //内容分页
         $contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
         if (!empty($contents)) {
             $case->view->pages = count($contents);
             front::$record_count = $case->view->pages * config::get('list_pagesize');
             $case->view->pages = count($contents);
         } else {
             $case->view->pages = 1;
         }
         
         //标签连接
         $taghtml = '';
         $tag_table = new tag();
         foreach ($tag_table->urls($case->view->archive['tag']) as $tag => $url) {
             $taghtml.="<a href='$url' target='_blank'>$tag</a>&nbsp;&nbsp;";
         }
         $case->view->archive['tag'] = $taghtml;
         
         //专题连接
         $case->view->archive['special'] = null;
         if ($case->view->archive['spid']) {
             $spurl = special::url($case->view->archive['spid'],special::getishtml($case->view->archive['spid']));
             $sptitle = special::gettitle($case->view->archive['spid']);
             $case->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a>&nbsp;&nbsp;";
         }
         
         //分类连接
         $case->view->archive['type'] = null;
         if ($case->view->archive['typeid']) {
             $typeurl = type::url($case->view->archive['typeid'],1);
             $typetitle = type::name($case->view->archive['typeid']);
             $case->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a>&nbsp;&nbsp;";
         }
         
         //地区连接
         $case->view->archive['area'] = null;
         $case->view->archive['area'] = area::getpositonhtml($case->view->archive['province_id'], $case->view->archive['city_id'], $case->view->archive['section_id']);
         
         //$arc = $case->view->archive;
         for ($c = 1; $c <= $case->view->pages; $c++) {
             front::$get['page'] = $c;
             $case->view->page = $c;
             if (!empty($contents)) {
                 $content = $contents[$c - 1];
             }
             $case->view->archive['content'] = $content;
             
             //自定义字段
             cb_data($case->view->archive);
             $str = "";
             foreach( $case->view->archive as $key => $value){
             	if(!preg_match('/^my/',$key) || !$value)
             		continue;
             	$sonids = $category->sons(setting::$var['archive'][$key]['catid']);
             	$sonids[] = setting::$var['archive'][$key]['catid'];
             	if(!in_array($case->view->archive['catid'],$sonids) && intval(setting::$var['archive'][$key]['catid'])){
             		//unset($case->view->field[$key]);
             		continue;
             	}
             	$str .= '<p> '.setting::$var['archive'][$key]['cname'].':'. $value.'</p>';
             }
             $arc['my_fields'] = $str;
             
             //上一篇,下一篇
             $aid = $case->view->archive['aid'];
             $catid = $case->view->archive['catid'];
             $sql1 = "SELECT * FROM `{$archive->name}` WHERE catid = '$catid' AND aid > '$aid' ORDER BY aid ASC LIMIT 0,1";
             $sql2 = "SELECT * FROM `{$archive->name}` WHERE catid = '$catid' AND aid < '$aid' ORDER BY aid DESC LIMIT 0,1";
             $n = $archive->rec_query_one($sql1);
             $p = $archive->rec_query_one($sql2);
             $case->view->archive['p'] = $p;
             $case->view->archive['n'] = $n;
             $case->view->archive['p']['url'] = archive::url($p);
             $case->view->archive['n']['url'] = archive::url($n);
             
             //评级
             $case->view->archive['strgrade'] = archive::getgrade($arc['grade']);
             
             //图片
             $case->view->archive['pics'] = unserialize($case->view->archive['pics']);
             if(is_array($case->view->archive['pics']) && !empty($case->view->archive['pics'])){
             	foreach ($case->view->archive['pics'] as $k => $v){
             		if(strtolower(substr($v,0,7)) == 'http://'){
             			$case->view->archive['pics'][$k] = $v;
             		}else{
             			$case->view->archive['pics'][$k] = $v;
             		}
             	}
             }
             $case->view->archive['pics'] = serialize($case->view->archive['pics']);
             
             if ($template && file_exists(TEMPLATE . '/' . $case->view->_style . '/' . $template))
                 $tpl = $template;
             else
                 $tpl = category::gettemplate($case->view->catid, 'showtemplate');
             $content = $case->fetch($tpl);
             $path = ROOT . archive::url($case->view->archive, front::$get['page'] > 1 ? front::$get['page'] : null, true);
             if (!preg_match('/\.[a-zA-Z]+$/', $path))
                 $path = rtrim(rtrim($path, '/'), '\\') . '/index.html';
             $path = rtrim($path, '/');
             $path = rtrim($path, '\\');
             $path = str_replace('//', '/', $path);
             tool::mkdir(dirname($path));
             file_put_contents($path, $content);
             $cpage++;
             if ($case->view->pages > 1 && $c == 1) {
                 $path = ROOT . archive::url($case->view->archive, 1, true);
                 if (!preg_match('/\.[a-zA-Z]+$/', $path))
                     $path = rtrim(rtrim($path, '/'), '\\') . '/index.html';
                 $path = rtrim($path, '/');
                 $path = rtrim($path, '\\');
                 $path = str_replace('//', '/', $path);
                 tool::mkdir(dirname($path));
                 //file_put_contents('logs.txt', file_get_contents('logs.txt')."\r\n".$path);
                 $f = fopen($path,'w');
                 fwrite($f, $content);
                 fclose($f);
                 $cpage++;
             }
         }
     }
     $totalpage = count($archives);
     if (!isset($archives[0]))
         $totalpage = 0;
     if ($make_page >= $make_page_num) {
         $show_msg = "本组生成html <b>{$cpage}</b> 页!  生成html完毕,本次共生成 <b>{$archive_num}</b> 页! 3秒后自动返回内容生成首页面!\n";
         $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']);
         $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url);
         $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url);
         $c_url = preg_replace('#&catid=(\d+)#', '', $c_url);
         $c_url = preg_replace('#&submit=(\d+)#', '', $c_url);
         $c_url = 'index.php?' . $c_url;
     } else {
         $show_msg = "第 <b>{$make_page}</b> 组成功生成html <b>{$cpage}</b> 页! 本次共需生成 <b>{$archive_num}</b> 页! 已经生成 <b>" . ($make_page * $group_count) . "</b> 页! 3秒后自动跳入下组生成!\n";
     }
     $getnexturl = "<script>";
     $getnexturl.="var t=4;\n";
     $getnexturl.="setInterval('testTime()',3000);\n";
     $getnexturl.="function testTime() \n";
     $getnexturl.=" { \n";
     $getnexturl.="if(t == 0) location = '" . $c_url . "'; \n";
     $getnexturl.=" t--;\n";
     $getnexturl.="}\n</script> \n";
     if ($cpage > 0) {
         if (!config::get('group_on')) {
             front::flash("成功生成html <b>{$cpage}</b> 页!用时".time::getTime()."!\n");
         } else {
             front::flash($show_msg . "\n" . $getnexturl);
         }
     } else {
         front::flash("没有需要生成的html,可能您选择的栏目暂无内容或者网站并未开启内容生成静态功能!");
     }
     front::$admin = true;
     front::$post = $post;
 }
コード例 #16
0
function getURL()
{
    global $HTTP_HOST;
    global $REQUEST_URI;
    return "http://{$HTTP_HOST}{$REQUEST_URI}";
}
function getURLData($type)
{
    $URL = getURL();
    $urlPacket = parse_url($URL);
    return $urlPacket[$type];
}
function currentPage()
{
    $match = array();
    $path = getURLData('path');
    $page = preg_match('/[.]*[^\\/]*$/', $path, $match);
    $pageref = $match[0];
    return preg_replace('/.php/', '', $pageref);
}
$root = "C:/Program Files/Apache Group/Apache2/htdocs/iwfms/";
include_once $root . 'includes/configuration/database.php';
include_once $root . 'includes/configuration/core_includes.php';
// set date and time stuff
$today = gmdate("d-m-y");
$mysql_today = gmdate("Y-m-d");
$time = date("H:i");
$time_full = date("H:i:s");
$year = date("Y");
$modified = time::ts_unix_mysql(time::timestamp());
コード例 #17
0
ファイル: test.php プロジェクト: Longcnttbkhn/Project1
<?php

require 'libraries/time.php';
$time = "2014-10-1";
$currentDate = "2015-11-22";
// $array1=explode("-",$time);
// $array2=explode("-", $currentDate);
// $tg=($array2[0]-$array1[0])*365+($array2[1]-$array1[1])*30+($array2[2]-$array1[2]);
// echo $tg;
$time1 = new time($time, $currentDate);
echo $time1->day();
コード例 #18
0
ファイル: index.php プロジェクト: Newleatk/ist
    $r = $db->prepare($sql);
    $r->execute(array($tag));
    $issues = array();
    if ($r->rowCount() > 0) {
        require_once 'classes/class.user.php';
        require_once 'classes/class.status.php';
        require_once 'classes/class.time.php';
    }
    $priority = array(1 => "trivial", 2 => "very-low", 3 => "low", 4 => "normal", 5 => "high", 6 => "very-high", 7 => "urgent");
    while ($d = $r->fetch()) {
        $issues[formatId($d['id'])] = $d;
        $issues[formatId($d['id'])]['deadline_has_passed'] = $d['deadline'] < time() ? true : false;
        $issues[formatId($d['id'])]['author'] = (new User($d['author']))->informations();
        $issues[formatId($d['id'])]['status'] = $GLOBALS['status_cache'][$d['status']];
        $issues[formatId($d['id'])]['priority'] = $priority[$d['priority']];
        $diff = new time();
        $diff->setDiffTime($d['creation']);
        $issues[formatId($d['id'])]['formated'] = $diff->textTimeDiff();
    }
    $params = $request->query->all();
    $params["show"] = $count;
    $params["page"] = $base_start;
    $params['tag'] = $tag;
    $time = floor((microtime() - $timer) * 100) / 100;
    $time = $time < 0 ? 0 : $time;
    return $app['twig']->render('issues.twig', array("global_start" => IST_BUG_LABEL_START, "show_allowed" => $counts, "time_elapsed" => $time, "issues" => $issues, "issues_count" => $n, "params" => $params));
})->value('tag', 'all')->bind("issues");
/*---------------------------------------------------------------------------------------
------------------------------------ISSUE VIEWING PAGE-----------------------------------
---------------------------------------------------------------------------------------*/
$app->get('/issue/{id}', function (Request $request, $id) use($db, $timer, $app) {
コード例 #19
0
ファイル: sites04_year.php プロジェクト: karu/SmallTime
* Copyright (c), IT-Master GmbH, All rights reserved
*******************************************************************************/
//-----------------------------------------------------------------------------
// Anzeige der Summen aus der Statistik
//-----------------------------------------------------------------------------
$_data[0][0] = "SummeSollProMonat";
$_data[1][0] = "SummeWorkProMonat";
$_data[2][0] = "SummeAbsenzProMona";
$_data[3][0] = "SummeSaldoProMonat";
$_data[4][0] = "Auszahlung";
$_summe_calc_absenz = array();
for ($i = 0; $i < 12; $i++) {
    // ----------------------------------------------------------------------------
    // Anzahl der Tage im Monat
    // ----------------------------------------------------------------------------
    $_temp_time = new time();
    $_temp_time->set_timestamp(mktime(0, 0, 0, $i + 1, 1, $_time->_jahr));
    $time_month = new time_month($_settings->_array[12][1], $_temp_time->_letzterTag, $_user->_ordnerpfad, $_time->_jahr, $i + 1, $_user->_arbeitstage, $_user->_feiertage, $_user->_SollZeitProTag, $_user->_BeginnDerZeitrechnung, $_settings->_array[21][1], $_settings->_array[22][1], $_settings->_array[27][1]);
    $_temp_time = NULL;
    $_data[0][1] += $time_month->_SummeSollProMonat;
    $_data[1][1] += $time_month->_SummeWorkProMonat;
    $_data[2][1] += $time_month->_SummeAbsenzProMonat;
    $_data[3][1] += $time_month->_SummeSaldoProMonat;
    $_data[4][1] += $_jahr->get_auszahlung($i + 1, $_time->_jahr);
    //-------------------------------------------------------------------------
    // Summen der Absenzen berechnen (ab 0.87 erweiterbar pro Mitarbeiter)
    //-------------------------------------------------------------------------
    if (!$_summe_calc_absenz) {
        $_summe_calc_absenz = $time_month->get_calc_absenz();
    } else {
        $tp = 0;
コード例 #20
0
ファイル: index.php プロジェクト: dalinhuang/zotop
//$column['path'] = '安装目录';
$column['varsion w60 center'] = '版本号';
$column['updatetime'] = '更新时间';
$column['manage rename'] = '设置';
$column['manage edit'] = '权限';
$column['manage lock'] = '禁用';
$column['manage delete'] = '卸载';
table::header('list', $column);
foreach ($modules as $module) {
    $column = array();
    $column['status w30 center'] = $module['status'] == -1 ? '<span class="zotop-icon zotop-icon-lock"></span>' : '<span class="zotop-icon zotop-icon-ok"></span>';
    $column['logo center'] = empty($module['icon']) ? '<div class="zotop-icon zotop-icon-module"></div>' : html::image($module['icon'], array('width' => '32px'));
    $column['name'] = '<a class="dialog" href="' . zotop::url('system/module/about/' . $module['id']) . '"><b>' . $module['name'] . ' ( ' . $module['id'] . ' )</b></a><h5>' . $module['description'] . '</h5>';
    //$column['loginnum w60'] = $module['path'];
    $column['loginip w60 center'] = $module['version'];
    $column['logintime w130'] = time::format($module['updatetime']);
    $column['manage setting'] = file::exists($module['path'] . DS . 'admin' . DS . 'setting.php') ? '<a href="' . zotop::url($module['id'] . '/setting') . '">设置</a>' : '<span class="disabled">设置</span>';
    $column['manage priv'] = file::exists($module['path'] . DS . 'admin' . DS . 'priv.php') ? '<a href="' . zotop::url($module['id'] . '/priv') . '">权限</a>' : '<span class="disabled">权限</span>';
    if ($module['type'] == 'core') {
        $column['manage lock'] = '<span class="disabled">禁用</span>';
    } else {
        if ($module['status'] == -1) {
            $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/module/status/' . $module['id'] . '/0') . '">启用</a>';
        } else {
            $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/module/status/' . $module['id'] . '/-1') . '">禁用</a>';
        }
    }
    $column['manage delete'] = $module['type'] == 'core' ? '<span class="disabled">卸载</span>' : '<a class="confirm" href="' . zotop::url('system/module/uninstall/' . $module['id']) . '">卸载</a>';
    table::row($column);
}
table::footer();
コード例 #21
0
ファイル: main.php プロジェクト: dalinhuang/zotop
				<a>修改资料</a> 
				<a>修改密码</a>
				<a>修改图像</a>
			</div>
		</span>
	</div>
	<div id="userinfo">
		<h2 id="welcome">欢迎您,<?php 
echo $user['name'];
?>
 <span id="sign"><?php 
echo $user['sign'];
?>
</span></h2>
		<div id="login">登录时间:<?php 
echo time::format($user['logintime']);
?>
 登录次数:<?php 
echo $user['loginnum'];
?>
 登录IP:<?php 
echo $user['loginip'];
?>
</div>
		<div>
				
				<a href="<?php 
echo zotop::url('system/mine/changeinfo');
?>
">修改我的资料</a> 
				<a href="<?php 
コード例 #22
0
ファイル: index_view.php プロジェクト: phill104/branches
            echo table::td(html::span(html::bold(Lang::item('home.child_boards')) . forum::child_board_list($board['childs'])), 5, 'tablef');
        }
    }
    if (count($category['boards']) == 0) {
        echo table::td(Lang::item('home.no_board'), 5, 'tableb');
    }
    echo table::close();
    echo html::spacer();
}
echo table::open(0);
echo table::tds(array('text' => html::img('plugins/forum/forum/html/images/icon_board_new.gif') . html::span(Lang::item('home.new_posts')) . html::img('plugins/forum/forum/html/images/icon_board.gif') . html::span(Lang::item('home.no_new_posts'))));
echo table::close();
echo table::open();
echo table::td(Lang::item('home.latest_posts'), 2);
foreach ($recents as $recent) {
    echo table::tds(array(array('class' => 'tableb', 'text' => table::open(2) . table::tds(array(array('text' => sprintf(Lang::item('home.latest_post'), html::message_anchor($recent['msg_id'], $recent['subject']), html::profile_anchor($recent['poster_id'], $recent['poster_name']))), array('align' => 'right', 'text' => time::decode($recent['poster_time'])))) . table::close())));
}
echo table::close();
// left
$left_table = '';
$left_table .= table::open(3);
$left_table .= table::td(Lang::item('home.visitor_stats'), 4);
$left_table .= table::tds(array(array('class' => 'tableb', 'text' => Lang::item('home.t_r_m')), array('class' => 'tableb', 'text' => $stats['t_r_m']), array('class' => 'tableb', 'text' => Lang::item('home.t_li_u')), array('class' => 'tableb', 'text' => $stats['t_li_u'])));
$left_table .= table::tds(array(array('class' => 'tableb', 'text' => Lang::item('home.t_t')), array('class' => 'tableb', 'text' => $stats['t_t']), array('class' => 'tableb', 'text' => Lang::item('home.t_a_u')), array('class' => 'tableb', 'text' => $stats['t_a_u'])));
$left_table .= table::tds(array(array('class' => 'tableb', 'text' => Lang::item('home.t_r')), array('class' => 'tableb', 'text' => $stats['t_r']), array('class' => 'tableb', 'text' => '&nbsp;'), array('class' => 'tableb', 'text' => '&nbsp;')));
$left_table .= table::close();
// right
foreach ($newest_members as $k => $v) {
    $newest_members[$k] = html::profile_anchor($v['user_id'], $v['user_name']);
}
$newest_members = implode(', ', $newest_members);
コード例 #23
0
ファイル: android.php プロジェクト: karu/SmallTime
 include_once './include/class_group.php';
 include_once './include/class_login.php';
 include_once './include/class_template.php';
 include_once './include/class_time.php';
 include_once './include/class_month.php';
 include_once './include/class_jahr.php';
 include_once './include/class_feiertage.php';
 include_once './include/class_filehandle.php';
 include_once './include/class_rapport.php';
 include_once './include/class_show.php';
 include_once './include/class_settings.php';
 include "./include/time_funktionen.php";
 $_users = new time_filehandle("./Data/", "users.txt", ";");
 $_groups = new time_filehandle("./Data/", "group.txt", ";");
 $_settings = new time_settings();
 $_time = new time();
 $_time->set_monatsname($_settings->_array[11][1]);
 $_user = new time_user();
 $_user->load_data_session();
 $_absenz = new time_absenz($_user->_ordnerpfad, $_time->_jahr);
 $_monat = new time_month($_settings->_array[12][1], $_time->_letzterTag, $_user->_ordnerpfad, $_time->_jahr, $_time->_monat, $_user->_arbeitstage, $_user->_feiertage, $_user->_SollZeitProTag, $_user->_BeginnDerZeitrechnung, $_settings->_array[21][1], $_settings->_array[22][1], $_settings->_array[27][1]);
 $_jahr = new time_jahr($_user->_ordnerpfad, 0, $_user->_BeginnDerZeitrechnung, $_user->_Stunden_uebertrag, $_user->_Ferienguthaben_uebertrag, $_user->_Ferien_pro_Jahr, $_user->_Vorholzeit_pro_Jahr, $_user->_modell, $_time->_timestamp);
 // ----------------------------------------------------------------------------------------------
 // Controller action - Handling
 // ----------------------------------------------------------------------------------------------
 $_action = "";
 if (isset($_GET['action'])) {
     $_action = $_GET['action'];
 }
 switch ($_action) {
     case "monat":
コード例 #24
0
ファイル: index.php プロジェクト: dalinhuang/zotop
    $column['name'] = '<a href="' . zotop::url('webftp/index/index', array('dir' => rawurlencode($dir . '/' . $folder))) . '"><b>' . $folder . '</b></a>';
    $column['name'] .= '<h5>';
    $column['name'] .= '<a href="' . zotop::url('webftp/folder/rename', array('dir' => rawurlencode($dir), 'file' => $file)) . '" class="dialog">重命名</a>';
    $column['name'] .= '&nbsp;&nbsp;<a href="' . zotop::url('webftp/folder/delete', array('dir' => rawurlencode($dir), 'file' => $file)) . '" class="dialog">删除</a>';
    $column['name'] .= '</h5>';
    $column['type w60'] = '文件夹';
    $column['encoding w60'] = '';
    $column['size w60'] = '--';
    $column['atime w120'] = time::format(@fileatime($path . DS . $folder));
    $column['mtime w120'] = time::format(@filemtime($path . DS . $folder));
    table::row($column);
}
foreach ($files as $file) {
    $column = array();
    $column['center'] = '<div class="zotop-icon zotop-icon-file ' . file::ext($file) . '"></div>';
    $column['name'] = '<div><b>' . $file . '</b></div>';
    $column['name'] .= '<h5>';
    $column['name'] .= '<a href="' . zotop::url('webftp/file/edit', array('file' => url::encode($dir . '/' . $file))) . '" class="dialog">编辑</a>';
    $column['name'] .= '&nbsp;&nbsp;<a href="' . zotop::url('webftp/file/rename', array('file' => url::encode($dir . '/' . $file))) . '" class="dialog">重命名</a>';
    $column['name'] .= '&nbsp;&nbsp;<a href="' . zotop::url('webftp/file/delete', array('file' => url::encode($dir . '/' . $file))) . '" class="dialog">删除</a>';
    $column['name'] .= '</h5>';
    $column['type w60'] = '文件';
    $column['encoding w60'] = file::isUTF8($path . DS . $file) ? 'UTF8' : '';
    $column['size w60'] = format::byte(@filesize($path . DS . $file));
    $column['atime w120'] = time::format(@fileatime($path . DS . $file));
    $column['mtime w120'] = time::format(@filemtime($path . DS . $file));
    table::row($column);
}
table::footer();
$this->bottom();
$this->footer();
コード例 #25
0
ファイル: tickets.php プロジェクト: labrack/helpdesk
 public function ticket_replies($ticket)
 {
     $_link = $this->getDBH();
     $query = $_link->prepare('SELECT * FROM `ticket_replies` WHERE `ticket_id` = :uniqid');
     $query->bindParam(':uniqid', $ticket, PDO::PARAM_STR);
     $query->execute();
     $users = new users();
     $time = new time();
     while ($result = $query->fetch(PDO::FETCH_ASSOC)) {
         if ($users->idtocolumn($result['user'], 'user_group') == 1) {
             $level = 'Administrator';
         } else {
             $level = 'General user';
         }
         echo '<div class="row">
             		<div class="ticket-insert">
             			<div class="columns three">
             				<div class="profile">				
             					<img src="//gravatar.com/avatar/' . md5($users->idtocolumn($result['user'], 'email')) . '?s=100">
             					<ul>
             						<li><b>' . $users->idtocolumn($result['user'], 'nick_name') . '</b></li>
             						<li>' . $level . '</li>';
         if ($users->idtocolumn($result['user'], 'id') == $_COOKIE['user']) {
             echo '<li><a href="#">Edit Account</a></li>';
         }
         echo '</ul>
             				</div>
             			</div>
             		
             			<div class="columns nine">
             				<div class="reply-text-wrap" style="word-wrap:break-word;">
             				' . $result['text'] . '
             				<ul>
             					
             					<li>Posted ' . $time->ago($result['date']) . '</li>
             				</ul>
             				</div>
             			</div>
             		</div>
             	</div>';
     }
 }
コード例 #26
0
ファイル: createWorkflow.php プロジェクト: printedheart/iwfms
        $stoptime = time::stoptiming();
        performance::message("Stop Prolog Planner parsing");
        if ($model['workflowCaching']) {
            saveCachePlans($planGraphList, $keyinserted, $modelId);
        } else {
            savePlans($planGraphList, $keyinserted, true);
        }
        $newstoptime = time::stoptiming() - $stoptime;
        performance::message("Database updating");
        echo '<br><Br>';
        systemMessages::message("Plan generation complete!");
        systemMessages::message("Number of plans:" . sizeof($planGraphList));
    }
} else {
    $workFlowvalues = array();
    $workFlowvalues['timestamp'] = $modified = time::ts_unix_mysql(time::timestamp());
    //Create a new workflow item
    $keyinserted = dbs::irrecord('workflow', $workFlowvalues, false);
    $planGraphList = dbs::selrecord('plan', 'workflowcachingstore', "modelId={$modelId}", 0, 3);
    savePlans($planGraphList, $keyinserted, false);
    echo '<br><Br>';
    systemMessages::message("Plan generation using caching feature complete!");
    systemMessages::message("Number of plans:" . sizeof($planGraphList));
}
function savePlans($planGraphList, $workflowKey, $seralise)
{
    $planValues = array();
    $dbValues = array();
    for ($index = 0; $index < sizeof($planGraphList); $index++) {
        if ($seralise) {
            $plan = addslashes(serialize($planGraphList[$index]));
コード例 #27
0
ファイル: time.php プロジェクト: dalinhuang/zotop
 /**
  * 等同于 time::current() 函数
  *
  */
 public static function now($format = false)
 {
     return time::current($format);
 }
コード例 #28
0
ファイル: index.php プロジェクト: dalinhuang/zotop
    $column['usergroup'] = '用户组';
    $column['name'] = '姓名';
    $column['loginnum'] = '登录次数';
    $column['loginip'] = '最后登录IP/登录时间';
    $column['manage lock'] = '锁定';
    $column['manage edit'] = '编辑';
    $column['manage delete'] = '删除';
    table::header('list', $column);
    foreach ($users as $user) {
        $column = array();
        $column['status w30 center'] = $user['status'] == -1 ? '<span class="zotop-icon zotop-icon-lock"></span>' : '<span class="zotop-icon zotop-icon-ok"></span>';
        $column['username'] = '******' . $user['username'] . '</b></a><h5>' . $user['email'] . '</h5>';
        $column['usergroup w100'] = $usergroups[$user['groupid']];
        $column['name w80'] = $user['name'];
        $column['loginnum w60'] = $user['loginnum'];
        $column['loginip w140'] = $user['loginip'] . '<h5>' . time::format($user['logintime']) . '</h5>';
        if ($user['status'] == -1) {
            $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/user/lock/' . $user['id'] . '/0') . '">' . zotop::t('解锁') . '</a>';
        } else {
            $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/user/lock/' . $user['id']) . '">' . zotop::t('锁定') . '</a>';
        }
        $column['manage edit'] = '<a href="' . zotop::url('system/user/changeinfo/' . $user['id']) . '">' . zotop::t('编辑') . '</a>';
        $column['manage delete'] = '<a href="' . zotop::url('system/user/delete/' . $user['id']) . '" class="confirm">' . zotop::t('删除') . '</a>';
        table::row($column);
    }
    table::footer();
    //form::footer();
}
?>

<?php 
コード例 #29
0
ファイル: list.php プロジェクト: dalinhuang/zotop
					<li>
						<div class="title">
							<h2><?php 
    echo html::a(zotop::url('blog/' . $blog['id']), $blog['title'], array('style' => $blog['style']));
    ?>
</h2>
							<h3>
								类别:<a href="<?php 
    echo zotop::url("blog/list/{$blog['categoryid']}");
    ?>
"><?php 
    echo $categorys[$blog['categoryid']]['title'];
    ?>
</a>
								时间:<?php 
    echo time::format($blog['createtime']);
    ?>
								<?php 
    echo (int) $blog['comment'] >= 0 ? html::a('', zotop::t('评论') . ':(' . (int) $blog['comment'] . ')') : '';
    ?>
							</h3>
						</div>						
						<?php 
    if (!empty($blog['description'])) {
        ?>
						<div class="summary"><?php 
        echo $blog['description'];
        ?>
</div>
						<?php 
    }
コード例 #30
0
ファイル: index.php プロジェクト: dalinhuang/zotop
?>
</td></tr>
			<tr><td class="w80">程序设计:</td><td><?php 
echo zotop::config('zotop.author');
?>
</td></tr>
			<tr><td class="w80">程序开发:</td><td><?php 
echo zotop::config('zotop.authors');
?>
</td></tr>
			<tr><td class="w80">官方网站:</td><td><a href="<?php 
echo zotop::config('zotop.homepage');
?>
" target="_blank"><?php 
echo zotop::config('zotop.homepage');
?>
</a></td></tr>
			<tr><td class="w80">安装时间:</td><td><?php 
echo zotop::config('zotop.install.time');
?>
</td></tr>
		</table>
	</div>
	<div class="block-footer"></div>
</div>

</div>
</div>
<?php 
$this->bottom('<span class="zotop-tip">上次登录时间:' . time::format($this->user['logintime']) . '</span>');
$this->footer();