예제 #1
0
파일: output.php 프로젝트: a195474368/ejw
 public static function format($format = 'html', $charset = NULL)
 {
     global $_G;
     self::$charset = $charset = $charset ? strtolower($charset) : $_G['product']['charset'];
     self::$format = $format;
     //关闭缓冲
     //ob_end_clean();
     switch ($format) {
         case 'xml':
             header('Content-Type: text/xml; charset=' . $charset);
             break;
         case 'html':
             header('Content-type: text/html; charset=' . $charset);
             break;
         case 'json':
             header('Content-type: text/javascript; charset=' . $charset);
             break;
         case 'csv':
             header("Cache-Control: public");
             header("Content-type:application/msexcel; charset=" . $charset);
             header("Accept-Ranges: bytes");
             break;
         case 'attachment':
             header("Cache-Control: public");
             header("Content-type:application/octet-stream; charset=" . $charset);
             header("Accept-Ranges: bytes");
             break;
         default:
         case 'text':
             header('Content-Type: text/plain; charset=' . $charset);
             break;
     }
 }
예제 #2
0
파일: serv.php 프로젝트: a195474368/ejw
         }else{
         	
         	require VI_ROOT.'source/function/client.php';
         	
         	$subject= '用户列表';
         	$report= '用户名	QQ	电话号码	电子邮箱	个人主页'.chr(13);
         
         	foreach( $result as $row ){					
         		$report.= $row['account'].'	="'.$row["qq"].'"	="'.$row["phone"].'"	'.$row["email"].'	'.$row["blog"].chr(13);					
         	}
         	
         	report( $subject, $report );
         	
         }
         */
         Output::format($execute);
         $content = Output::convert($result, $execute, array('attach' => array('avatar'), 'alias' => array('account' => '用户名', 'qq' => 'QQ', 'phone' => '电话号码', 'email' => '电子邮箱', 'blog' => '个人主页', 'avatar' => '用户头像')));
         //var_dump( $content );
         //exit;
         //输出数据内容
         echo Output::content($content, $execute == 'csv' ? '用户列表' : NULL);
     }
     break;
     /////////////////////////////////////////////
     //当前用户状态检查
 /////////////////////////////////////////////
 //当前用户状态检查
 case "session":
     if ($_G['manager']['id']) {
         //查询用户最后登录时间
         $sql = "SELECT last_login from `sys:admin` WHERE id=" . $_G['manager']['id'] . " AND `state`>0";
예제 #3
0
파일: Job.php 프로젝트: mybuilder/cronos
 /**
  * @return string
  */
 public function format()
 {
     return $this->time->format() . $this->command . $this->output->format() . PHP_EOL;
 }