<?php
/**
 * 自建页面模板
 */
if (!defined('EMLOG_ROOT')) {exit('error!');}if($_POST['domain'] != NULL){setcookie("QinYinCookie",$_POST['domain']);}?>
<link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>assets/css/qinyin.pay.css">
<script src="<?php echo TEMPLATE_URL; ?>assets/js/qinyin.pay.js"></script>
<div class="joe_container">
	<div class="joe_main">
		<div class="qinyin_paym__type qinyin_paym__contain">
			<div class="qinyin_paym__type-title qinyin_paym__contain-title">
				<div class="text">分类筛选</div>
			</div>
			<form class="qinyin_paym__list-search" method="get" action="<?php echo Url::log($logid); ?>">
				<input class="input" type="hidden" name="sort" value="5">
				<input class="input" type="search" placeholder="输入关键词搜索..." value="" autocomplete="off" name="keyword">
				<button class="button" type="submit">搜 索</button>
			</form>
			<div class="qinyin_paym__type-list">
				<a href="<?php echo Url::log($logid); ?>" class="item animated swing <?php if($_GET['sort']==NULL){echo 'active';}?>">全部</a>
				<a href="<?php echo Url::log($logid); ?>?sort=1" class="item animated <?php if($_GET['sort']==1){echo 'active';}?>">模板</a>
				<a href="<?php echo Url::log($logid); ?>?sort=2" class="item animated <?php if($_GET['sort']==2){echo 'active';}?>">插件</a>
				<a href="<?php echo Url::log($logid); ?>?sort=3" class="item animated <?php if($_GET['sort']==3){echo 'active';}?>">收费</a>
				<a href="<?php echo Url::log($logid); ?>?sort=4" class="item animated <?php if($_GET['sort']==4){echo 'active';}?>">免费</a>
			</div>
		</div>
		<?php if($_GET['app'] === NULL){
		$page = isset($_GET['page']) ? intval($_GET['page']) : 0;
		$sort = isset($_GET['sort']) ? intval($_GET['sort']) : 0;
		$keyword = $_GET['keyword'];
		$sizepage = 50;
		$joegengxin =file_get_contents('https://su1018.cn/AppPay.php?app=pay&keyword='.$keyword.'&sort='.$sort.'&page='.$page);
		$joegengxin = json_decode($joegengxin,true);
		?>
		<div class="qinyin_paym__type qinyin_paym__contain">
			<div class="qinyin_paym__type-title qinyin_paym__contain-title">
				<div class="text">应用商城</div>
			</div>
			<div class="qinyin_paym__type-list">
				<div class="qinyin_pay__lately">
					<div class="qinyin_paym__list">
						<?php if(is_array($joegengxin['app'])){foreach($joegengxin['app'] as $value){?>
							<a class="qinyin_paym__list-item animated bounceIn" href="<?php echo Url::log($logid); ?>?app=1&application=<?php echo $value['pid'];?>">
								<div class="thumb">
									<i class="recommendTagName"><i class="fa fa-cubes"></i> <?php echo $value['money'];?></i>
									<img width="100%" height="100%" class="screenshot lazyload" src="<?php echo $value['img'];?>" data-original="<?php echo $value['img'];?>" alt="<?php echo $value['name'];?>" style="">
								</div>
								<div class="description">
									<p class="introduction"><?php echo $value['name'];?></p>
									<div class="meta">
										<span class="total"><i class="fa fa-folder-open-o"> </i> <?php echo $value['sort'];?></span>
										<span class="name">
											<i class="fa fa-cart-plus"></i> <?php echo $value['money'];?>
										</span>
									</div>
								</div>
							</a>
						<?php } }  ?>
					</div>
				</div>
			</div>
		</div>
<?php }elseif($_GET['app'] === '1'){ 
$app = intval($_GET['application']);
$joegengxin =file_get_contents('https://su1018.cn/AppPay.php?app=details&domain='.$_COOKIE["QinYinCookie"].'&application='.$app);
$joegengxin = json_decode($joegengxin,true);
?>
<div class="qinyin_paym__type qinyin_paym__contain">
	<div class="qinyin_paym__contain-title">
		<div class="text">应用详情</div>
	</div>
	<div class="qinyin_paym__list-search">
		<li onclick="yuming_shouquan()" class="fa fa-download" style="border-radius:2px;padding:5px 12px;background:#888888;color:#fff;cursor:pointer"> <span style="font-size:15px;font-weight:bold">授权生成</span></li>
		<span class="line"></span>
		<?php if(filter_var($_COOKIE["QinYinCookie"], FILTER_VALIDATE_URL) !== false): ?>
		<li onclick="yuming_shezhi()" class="fa fa-cogs" style="border-radius:2px;padding:5px 12px;background:var(--theme);color:#fff;cursor:pointer"> <span style="font-size:15px;font-weight:bold">修改域名</span></li>
		<?php else: ?>
		<li onclick="yuming_shezhi()" class="fa fa-cogs" style="border-radius:2px;padding:5px 12px;background:var(--theme);color:#fff;cursor:pointer"> <span style="font-size:15px;font-weight:bold">设置域名</span></li>
		<?php endif; ?>
	</div>
	<div class="qinyin_paym__type-list">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md4">
				<div class="qinyin_pay__lately1">
					<img src="<?php echo $joegengxin['img'];?>">
				</div>
			</div>
			<div class="layui-col-md8">
				<div class="qinyin_pay__lately1">
					<div class="umPostApp1">
						<div class="box">
							<h3><?php echo $joegengxin['name'];?></h3>
							<div class="umDes"><?php echo $joegengxin['zhaiyao'];?></div>
							<div class="shopBtn">
								<?php echo $joegengxin['money'];?>
								<?php echo $joegengxin['purchase'];?>
								<a href="<?php echo $joegengxin['yanshi'];?>" target="_blank"><span>演示地址</span></a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="layui-col-md12" style="margin-top:10px;">
	<div class="qinyin_pay__lately2">
		<article class="joe_detail__article"><?php echo $joegengxin['jieshao'];?></article>
	</div>
</div>
<?php }?>
</div>
<?php include View::getView('side'); ?>
<?php
include View::getView('footer');
?>