{include file="$template_path/html/header.html"}
</head>
<body class="bg-lgray">
{include file="$template_path/html/user-header-self.html"}

<div class="space-items clear bg-lgray b-b" id="items">
  <div class="container">
    <div class="row">
      <div class="container m-b-md text-center">
        <ul class="nav navbar-nav space-nav ">
          {include file="$template_path/users/tabsy.html"}
        </ul>

      </div>
    </div>
  </div>
</div>

<section class="clearfix">
  <div class="container pos-rlt m-t-lg m-b-sm">


    {$errorMessage}

    <div class="row">

      <div class="col-xs-12 col-md-8">
        <section class="panel panel-shadow">
          <div class="panel-body">
            {if $qnews_data}
            <h3 class="text-black h3 h3-xs m-b-md">快讯</h3>
            <div class="clearfix p-b-md">
              {foreach from=$qnews_data item=i}
              <a class="fastmsgimg pull-left m-r-md"{if $i.url} href="{$i.url}"{/if} title="{$i.name}">
              <img class="img-responsive" src="/{$i.thumb}" alt="{$i.name}" title="{$i.name}" />
              </a>
              <div class="clear">
                <h3 class="m-t-none"><a{if $i.url} href="{$i.url}"{/if} title="{$i.name}">{$i.name}</a></h3>
                <p>{$i.description}</p>
              </div>
              {/foreach}
            </div>
            {/if}




            <div class="line line-dashed b-b line-lg pull-in"></div>




            <div class="salesnum">
              <h3 class="text-black h3 h3-xs m-t-md m-b-md">销量</h3>
              <div class="general_table_border">
                <table id="sales_table" class="general_table box-shadow" cellspacing="0" cellpadding="0">
                  <thead>
                  <tr>
                    <th>{$lang.month}</th>
                    <th>{$lang.sales}</th>
                    <th>{$lang.earnings}</th>
                  </tr>
                  </thead>
                  <tbody>
                  {foreach from=$sales item=r key=year}
                  {foreach from=$r item=rr key=month}
                  <tr id="month_{$month}_{$year}" class="{$year}">
                    <td id="month_{$month}_{$year}_show"><a href="#" id="link_{$month}_{$year}" {literal}onclick="$.ajax({complete:function(request){ hideLoading(); jQuery(&quot;#ajax-feedback&quot;).animate({&quot;height&quot;: &quot;toggle&quot;, &quot;opacity&quot;: &quot;toggle&quot;}, &quot;slow&quot;); }, beforeStart: function() { showLoading(); }, data:'ajax=ok', dataType:'script', type:'post', url:'/{/literal}{$languageURL}users/earnings/{$month}/{$year}{literal}'}); jQuery(&quot;#ajax-feedback&quot;).hide(); jQuery(&quot;#ajax-feedback&quot;).animate({&quot;height&quot;: &quot;toggle&quot;, &quot;opacity&quot;: &quot;toggle&quot;}, &quot;slow&quot;);; return false;"{/literal}>{$lang.monthArr[$month]} {$year}</a></td>
                    <td id="month_{$month}_{$year}_hide" style="display: none;"><a href="#" onclick="$('#month_{$month}_{$year}_details').empty(); $('#month_{$month}_{$year}_hide').hide(); $('#month_{$month}_{$year}_show').show(); return false;">{$lang.monthArr[$month]} {$year}</a></td>
                    <td>{$rr.buy} {$lang.sales}</td>
                    <td class="earningsVal">{$currency.symbol}{$rr.total|string_format:"%.2f"}</td>
                  </tr>
                  <tbody id="month_{$month}_{$year}_details">
                  </tbody>
                  {/foreach}
                  {/foreach}
                  </tbody>
                  <tfoot>
                  <tr>
                    <td>{$lang.total_sales}</td>
                    <td>{$earnings.sales} {$lang.sales}</td>
                    <td class="earningsTotal">{$currency.symbol}{$earnings.sales_earning|string_format:"%.2f"}</td>
                  </tr>
                  </tfoot>
                </table>
              </div>
              <div class="line line-dashed b-b line-lg pull-in p-t-md"></div>
              <h3 class="text-black h3 h3-xs m-t-md m-b-md">{$lang.sales_graph}</h3>
              <div id="sales_graph" class="graph mt10">
                {foreach from=$sales item=r key=year}
                {foreach from=$r item=rr key=month}
                <div class="bar 2010">
                  <strong>{$lang.monthArr[$month]} {$year}</strong>
                  <div style="width:{math equation="x * y" x=$saleIndex y=$rr.buy}px;" class="graph_1"></div>
                <div class="value">{$rr.buy} {$lang.sales}</div>
              </div>
              {/foreach}
              {/foreach}
            </div>
            <div class="line line-dashed b-b line-lg pull-in p-t-md"></div>
            <h3 class="text-black h3 h3-xs m-t-md m-b-md">{$lang.earnings_graph}</h3>
            <div id="earnings_graph" class="graph mt10">
              {foreach from=$earningArr item=r key=year}
              {foreach from=$r item=rr key=month}
              <div class="bar 2010">
                <strong>{$lang.monthArr[$month]} {$year}</strong>
                <div style="width:{math equation="x * y" x=$earningIndex y=$rr}px;" class="graph_1"></div>
              <div class="value">{$currency.symbol}{$rr|string_format:"%.2f"}</div>
              {/foreach}
              {/foreach}
            </div>



          </div>

        </section>

      </div>

      <div class="col-xs-12 col-md-4">
        <section class="panel panel-shadow no-border">
          <div class="panel-heading bg-info text-white-i h4 h3-xs">上传作品</div>
          <div class="panel-body">
            <form id="begin-upload" action="/{$languageURL}" method="get" >
              <fieldset class="vertical-form">
              <div class="form-group">
                <div class="inputs">
                  <select class="form-control" id="category" name="category">
                    {if $mainCategories}
                    {foreach from=$mainCategories item=c}
                    <option value="{$c.id}">{$c.name}</option>
                    {/foreach}
                    {/if}
                  </select>
                </div>
              </div>
              <div>
                <a onclick="window.location='/{$languageURL}upload/form/?category=' + document.getElementById('category').options[document.getElementById('category').selectedIndex].value;" class="btn btn-default btn-sm">下一步</a>
                <a href="/{$languageURL}help/upload/" class="btn btn-link fs-14 btn-sm" target="_blank">帮助</a>
              </div>
              </fieldset>
            </form>

          </div>

        </section>

        <section class="panel panel-shadow no-border">
          <div class="panel-heading bg-black lter text-white-i h4 h3-xs">本周统计</div>
          <div class="panel-body">
            <p>获得收入：
              ￥<strong class="h4 m-l-sm fm-sf">{$weekStats.earning|string_format:"%.2f"}</strong>
              元
            </p>
            <p> 售出作品：
              <strong class="h4 m-l-md fm-sf">{$weekStats.sold}</strong>件
            </p>
          </div>

        </section>

      </div>


    </div>
</section>

{literal}
<style>
  table {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
  }
  td, th {
    padding: 0.75em 1.5em;
    text-align: left;
  }
  td.err {
    background-color: #e992b9;
    color: #fff;
    font-size: 0.75em;
    text-align: center;
    line-height: 1;
  }
  th {
    background-color: #1ccacc;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
  }
  tbody th {
    background-color: #2ea879;
  }
  tbody tr:nth-child(2n-1) {
    background-color: #f5f5f5;
    transition: all .125s ease-in-out;
  }
  tbody tr:hover {
    background-color: #d8f1f1;
  }
  .graph{
    overflow:hidden;
    clear:both;
    padding-top:1px
  }
  .graph .bar{
    clear:both
  }
  .graph .bar strong{
    float:left;
    width:130px;
    height:19px
  }
  .graph .bar .graph_1{
    height:25px;
    background-color:#db592b;
    border:1px solid;
    border-color:#a42d19;
    float:left;
    margin-top:-1px
  }
  .graph .bar .graph_2{
    height:25px;
    background-color:#db592b;
    border:1px solid;
    border-color:#a42d19;
    float:left;
    margin-top:-1px
  }
  .graph .bar .value{
    float:left;
    margin-left:10px;
    font-size:12px;
    text-transform:uppercase;
    color:#898989;
    padding-top:4px
  }
</style>
{/literal}

{literal}
<script type="text/javascript">
  seajs.use(["jq"], function($){
    $("textarea").on("keyup keydown",function(){
      var h=$(this);
      h.height(20).height(h[0].scrollHeight);
    });
  });
</script>
{/literal}

<!-- Easy Pie Chart -->
<!-- Sparkline Chart -->
<script src="/mbthemes/js/charts/sparkline/jquery.sparkline.min.js"></script>
{include file="$template_path/html/user-footer.html"}
</body>
</html>