<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" lang="zh-CN">
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" lang="zh-CN">
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html lang="zh-CN">
 <!--<![endif]-->
 <head> 
  <meta charset="UTF-8" /> 
  <meta name="keywords" content="" /> 
  <meta name="description" content="" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
  <meta name="renderer" content="webkit" /> 
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta content="yes" name="apple-mobile-web-app-capable">
  <meta content="black" name="apple-mobile-web-app-status-bar-style">
  <meta content="telephone=no" name="format-detection">
  <title>我的<?php echo $typename;?>记录_{dede:global.cfg_webname/}</title> 
  <!--[if lt IE 9]>
    <script src="{dede:global.cfg_cmsurl/}/skin/1.0/js/html5.js" type="text/javascript"></script>
  <![endif]--> 
  <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/skin/1.0/css/font-awesome.min.css?ver=1.0" type="text/css" media="all" /> 
  <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/skin/1.0/css/style.css?ver=1.0" type="text/css" media="all" /> 
  <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/skin/1.0/css/dashboard.css?ver=1.0" type="text/css" media="all" /> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/jquery.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/jquery-migrate.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/m.js"></script> 
  <script language="javascript" type="text/javascript" src="{dede:global.cfg_cmsurl/}/i/ajax_main.js"></script>
  <style type="text/css">
  #header{background-color: #323232;}
  .dashboard .gird li .box{margin:0;margin-right:10px;}
  .dashboard-header{text-align:center; padding-bottom:10px; margin-bottom:10px; border-bottom:1px dotted #ccc;}
  .not-found{ text-align:center;}
  </style>
 </head> 
 <body> 
 <?php pasterTempletDiy("head.htm"); ?>
  <div id="container" class="container">
   <div class="content page dashboard space centralnav"> 
    <div id="primary" class="primary" role="main"> 
     <div class="area"> 
      <div class="page-wrapper"> 
       <div class="dashboard-main"> 
        <div class="dashboard-header">
         <p class="sub-title">您共<?php echo $typename;?>过<span><?php echo $datatj; ?></span>个模板</p>
         <?php echo $typemsg; ?>
         <a id="my" rel="18" style="display:none">演示</a>
        </div> 
        <div class="dashboard-wrapper select-favorites"> 
         <div id="favorites"> 
          <ul class="gird" id="list"></ul>
          <?php echo $nodata; ?>
          <nav class="navigation paging-navigation">
            <div class="pagination loop-pagination" id="pagecount"></div>
          </nav>
         </div> 
        </div> 
       </div> 
      </div> 
     </div> 
    <?php include(DEDEMEMBER."/templets/menu.php"); ?> 
    </div> 
   </div> 
  </div>
  <?php pasterTempletDiy("footer.htm"); ?>
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/functions.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/comment-reply.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/ajax-comments.min.js?ver=1.0"></script> 
  <script type="text/javascript">
	/* <![CDATA[ */
	var ajax_dashboard_object = {"ajaxurl":"","redirecturl":""};
	var heartbeat_object = {"nonce":""};
	var relove_object = {"nonce":""};
	/* ]]> */
  </script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/dashboard.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/loveit.min.js?ver=1.0"></script> 
<script language="javascript" type="text/javascript">
var curPage = 1; //当前页码
        var total,pageSize,totalPage;
        //获取数据
        function getData(page){ 
            $.ajax({
                type: 'POST',
                url: '{dede:global.cfg_cmsurl/}/i/json_user_index.php?type=<?php echo $type; ?>&uid=<?php echo $cfg_ml->M_LoginID; ?>',
                data: {'pageNum':page-1},
                dataType:'json',
                beforeSend:function(){
                    $("#list").append("<div id='loading'><img src='{dede:global.cfg_cmsurl/}/images/loadinglit.gif' /><br>loading...</div>");
                },
                success:function(json){
                    $("#list").empty();
                    total = json.total; //总记录数
					$i = total;
                    pageSize = json.pageSize; //每页显示条数
                    curPage = page; //当前页
                    totalPage = json.totalPage; //总页数
                    var li = "";
                    var list = json.list;
                    $.each(list,function(index,array){ //遍历json数据列
						li += "<li><div class='box'><div class='thumb'><a target='_blank' href='{dede:global.cfg_phpurl/}/view.php?aid="+array['id']+"' title='"+array['title']+"'><img width='280' height='180' src='"+array['litpic']+"' alt='"+array['title']+"' /></a><div class='actions'><a id='my' rel='"+array['id']+"' class='left heartbeat'><i class='fa fa-heartbeat'></i>取消</a></div><div class='loading'><i class='fa fa-spinner'></i></div></div><div class='title'><a target='_blank' href='{dede:global.cfg_phpurl/}/view.php?aid="+array['id']+"'>"+array['title']+"</a></div></div></li>";
                    });
                    $("#list").append(li);
                },
                complete:function(){ //生成分页条
                    getPageBar();
                },
                error:function(){
                    alert("数据加载失败");
                }
            });
        }
        
        //获取分页条
        function getPageBar(){
            //页码大于最大页数
            if(curPage>totalPage) curPage=totalPage;
            //页码小于1
            if(curPage<1) curPage=1;
            //pageStr = "<a class='page-numbers ym'>"+curPage+" / "+totalPage+"</a>";
            
            //如果是第一页
            if(curPage==1){
                //pageStr += "<span>首页</span><span>上一页</span>";
            }else{
                pageStr += "<a class='page-numbers' href='javascript:void(0)' rel='1'>首页</a><a class='prev page-numbers' href='javascript:void(0)' rel='"+(curPage-1)+"'><i class='fa fa-chevron-left'></i></a>";
            }
            
            //如果是最后页
            if(curPage>=totalPage){
                //pageStr += "<span>下一页</span><span>尾页</span>";
            }else{
                pageStr += "<a class='next page-numbers' href='javascript:void(0)' rel='"+(parseInt(curPage)+1)+"'><i class='fa fa-chevron-right'></i></a><a class='page-numbers' href='javascript:void(0)' rel='"+totalPage+"'>尾页</a>";
            }
                
            $("#pagecount").html(pageStr);
        }
        
        $(function(){
            getData(1);
            $("#pagecount a").live('click',function(){
                var rel = $(this).attr("rel");
                if(rel){
                    getData(rel);
                }
            });
        });
</script>  
</body>
</html>