<?php if (!defined('APP_PATH')) exit;?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="http://127.0.0.5/magic/Data/Public/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://127.0.0.5/magic/Data/Public/js/jquery.js"></script>
<script src="http://127.0.0.5/Data/Public/layer/layer.js"></script>
<script src="http://127.0.0.5/magic/Data/Public/js/main.js"></script>
<script src="http://127.0.0.5/magic/Data/Public/js/jquery.nicescroll.min.js"></script>
</head>
<body>
<script>
  $(document).ready(function() {    
	$("html").niceScroll();
  });
</script>
<div class="rightinfo">
    <div class="tools">
		<ul class="toolbar">
			<li><a <?php if(Q('get.table')){ ?> href="?r=database-fields&table=<?php echo Q('get.table');?>" <?php }else{ ?> style="color:#ccc" <?php }?>><span><img src="http://127.0.0.5/magic/Data/Public/images/t10.png" /></span>对象浏览器</a></li>
			<li><a <?php if(Q('get.table')){ ?> href="?r=database-fields-data&table=<?php echo Q('get.table');?>" <?php }else{ ?> style="color:#ccc" <?php }?>><span><img src="http://127.0.0.5/magic/Data/Public/images/t11.png" /></span>数据浏览器</a></li>
			<li><a href="?r=database-sql&table=<?php echo Q('get.table');?>"><span><img src="http://127.0.0.5/magic/Data/Public/images/t02.png" /></span>SQL编辑器</a></li>
			<li><a href="?r=database-export&table=<?php echo Q('get.table');?>"><span><img src="http://127.0.0.5/magic/Data/Public/images/t13.png" /></span>导出</a></li>
			<li><a href="?r=database-import&table=<?php echo Q('get.table');?>"><span><img src="http://127.0.0.5/magic/Data/Public/images/t12.png" /></span>导入</a></li>
		</ul>
    </div>
	
	<?php if($step=='index'){ ?>
	<style type="text/css">
		.option{margin:15px 0;}
		.option ul{margin-left:80px}
		.option li{margin:5px 0;}
		.option_list{display:none}
	</style>
		<div class="formtitle1"><span>导出方式</span></div>
		<form method="get" id="form1" > 
			<input type="hidden" name="r" value="database-export-start">
			<input type="hidden" name="table" value="<?php echo Q('get.table',0);?>">
			<input type="hidden" name="reurl" value="<?php echo $_SERVER['HTTP_REFERER'];?>">
			<div class="option">
				<ul>
					<li><input type="radio" value="quick"  id="quick" name="export-type" checked onclick="$('.option_list').hide();"> <label for="quick">快速 - 显示最少的选项</label></li>
					<li><input type="radio" value="custom" id="custom" name="export-type" onclick="$('.option_list').show();"> <label for="custom">自定义 - 显示可用的选项</label></li>
				</ul>
			</div>
			
			<div class="option option_list">
			<div class="formtitle1"><span>数据分卷</span></div>
				<ul>
					<li><input type="radio" value="novolume"  id="novolume" name="export-volume" > <label for="novolume">不分卷</label></li>
					<li><input type="radio" value="volume" id="volume" name="export-volume" checked> <label for="volume">分卷行数：  <input type="text" class="insty" size="10" name="export-volume-num" value="10000"></label></li>
				</ul>
			</div>
    		<div class="option option_list">
			<div class="formtitle1"><span>格式特定选项</span></div>
				<ul>
					<li>转储数据表：
						<input type="radio" value="structure"  id="structure" name="export-strdata" onclick="$('.s2').hide();$('.s1').show();"> <label for="structure">结构</label>
						<input type="radio" value="data"       id="data"      name="export-strdata" onclick="$('.s1').hide();$('.s2').show();"> <label for="data">数据</label>
						<input type="radio" value="strdata"    id="strdata"   name="export-strdata" checked onclick="$('.s1,.s2').show();"> <label for="strdata">结构和数据</label>
					</li>
				</ul>

				
				<ul style="margin-left:155px">
					<li class="s1"><input type="checkbox" value="1" name="export-drop-table" > <label>添加 DROP TABLE 语句</label></li>
					<li class="s1"><input type="checkbox" value="1" name="export-notexists-table" checked> <label>为CREATE TABLE 添加 IF NOT EXISTS</label></li>
					<li class="s2"><label for="data">转储数据时所使用的函数：
						<select name="export-type" class="selectbox">
							<option value="INSERT" selected="selected">INSERT</option>
							<option value="UPDATE">UPDATE</option>
							<option value="REPLACE">REPLACE</option>
						</select>
					</label>
					</li>
				</ul>

			</div>
			
			<input type="submit" class="scbtn1" value="执行"  style="margin-left:80px">
				
	<?php }?>

	<?php if($step=='start'){ ?>
		<style type="text/css">
			.hintsbox{width:500px;margin:70px auto;text-align:center}
			.hints p{font-size:22px;margin:10px}
			.hints b{font-size:22px;}
			#indicatorContainer{width:120px;margin:35px auto;}
		</style>
		<script src="http://127.0.0.5/magic/Data/Public/js/radialindicator.js"></script>
		<div class="hintsbox">
			<div class="hints"><?php echo $msg;?></div>
			<div id="indicatorContainer"></div> 
		</div>
		<script type="text/javascript">
			$('#indicatorContainer').radialIndicator({
				initValue : <?php echo $schedule;?>,
				barWidth:10,
				barColor: {
				0: '#c82e25',
				33: '#FFFF00',
				66: '#ffaa00',
				100: '#83a700'
			},
			percentage: true
		});
		</script>
	<?php }?>
</body>
</html>
