<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="<?php echo getJsFile('jquery/mobile/jquery.mobile-1.0rc1.min.css');?>" rel="stylesheet" type="text/css" />
<script src="<?php echo getJsFile('jquery/mobile/jquery.min.js');?>"></script>
<script src="<?php echo getJsFile('jquery/mobile/jquery.mobile-1.0rc1.min.js');?>"></script>
<title><?php echo $chaptername;?> - <?php echo $bookinfo['bookname'];?> - <?php echo setting('webname');?></title>
</head>
<body>

<div data-role="header" data-position="inline">
	<a data-rel="back" data-icon="back" data-direction="reverse" class="ui-btn-left">返回</a>
	<h1 class="ui-title" tabindex="0" role="heading" aria-level="1">阅读内容</h1>

    <?php if ($isAutoProgress):?>
        <a style="margin-right: 80px;" class="ui-btn-right" data-icon="back" href="<?php echo url('system',array('s'=>'member','c'=>'my','a'=>'progress'));?>" data-theme="a">回进度</a>
    <?php else:?>
	    <a style="margin-right: 80px;" class="ui-btn-right" data-icon="plus" href="<?php echo url('system',array('s'=>'member','a'=>'progress','bid'=>$bookid,'cid'=>$chapterid,'sp'=>S::gp('sp','G',2)));?>">存进度</a>
    <?php endif;?>
    <a data-icon="back" class="ui-btn-right" href="<?php echo url('system', array('s'=>'member'));?>">回书房</a>
</div>


<div data-role="content" class="ui-content" role="main">
	<h1 class="title"><?php echo $chaptername;?></h1>
	<p style="color:#666;font-size:x-small;">当前 <?php echo date('H时i分');?> (约<mark><?php echo $chapterSize;?></mark>个字)</p>
	<div class="TextContent">
        <?php echo analyzeText($content);?>
	</div>
</div>
<br/><br/>

<div class="ui-grid-d">
    <a data-iconpos="left" data-icon="back" data-inline="true" data-role="button" href="<?php echo url('system',array('s'=>'member'));?>">书房</a>
    <a data-iconpos="left" data-icon="back" data-inline="true" data-role="button" href="<?php echo url('chapter', array('bid'=>$bookid,'page'=>$currentChapterPage));?>">目录</a>
    <a data-iconpos="left" data-icon="back" data-inline="true" data-role="button" href="<?php echo url('bookshow',array('bid'=>$bookid));?>">书页</a>
    <a data-iconpos="left" data-icon="back" data-inline="true" data-role="button" href="<?php echo url('index');?>">首页</a>
</div>
<div data-role="footer" data-id="foo1" data-position="fixed">
    <div data-role="navbar">
		<ul>
            <?php if ($subpage != $subtotalpage && $subpage < $subtotalpage):?>
			    <li><a href="<?php echo url('read', array('bid'=>$bookid,'cid'=>$chapterid,'sp'=>$subpage + 1));?>">下页</a></li>
            <?php endif;?>
            <?php if ($subpage > 1 && $subtotalpage > 1):?>
			    <li><a href="<?php echo url('read', array('bid'=>$bookid,'cid'=>$chapterid,'sp'=>$subpage - 1));?>">上页</a>
            <?php endif;?>
            <?php if (!empty($next_row)):?>
			    <li><a href="<?php echo url('read', array('bid'=>$bookid,'cid'=>$next_row['chapterid']));?>">下章</a>
            <?php endif;?>
            <?php if (!empty($prev_row)):?>
			    <li><a href="<?php echo url('read', array('bid'=>$bookid,'cid'=>$prev_row['chapterid']));?>">上章</a>
            <?php endif;?>
            <?php if ($isAutoProgress):?>
                <li><a href="<?php echo url('system',array('s'=>'member','c'=>'my','a'=>'progress'));?>">回进度</a>
            <?php else:?>
                <li><a href="<?php echo url('system',array('s'=>'member','a'=>'progress','bid'=>$bookid,'cid'=>$chapterid,'sp'=>S::gp('sp','G',2)));?>">存进度</a>
            <?php endif;?>
		</ul>
	</div>
</div>
</body>
</html>