<?php

/*
* @package BANANA WARS
* @copyright: (c) 2017 G.P. aka Mvcshka (mvcshka@yandex.ru)
* @license: GNU General Public License version 2; see LICENSE.txt
* @files: /theme/users_block.php
*
*/

?>

<table width="243" border="0" cellspacing="0" cellpadding="0">
   <tbody>
      <tr>
         <td align="left" valign="top"></td>
      </tr>
      <tr>
         <td align="left" valign="top" style="padding-top:13px">
            <div id="getoninner">
               <table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-top:42px">
                  <tbody>
                     <tr>
                        <td align="left" valign="top">
                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tbody>
                                 <tr></tr>
                                 <tr>
                                    <td align="left" valign="top">
                                       <table width="200" border="0" cellspacing="0" cellpadding="0">
                                          <tbody>
                                             <tr>
                                                <td width="200" align="left" valign="top" style="">
                                                   <div align="center" style="width:186;text-align:center;font-size:18px;font-weight: normal;">
                                                      <a href="/account/"><?=$User['Login']; ?></a> [<?=GetUser('Level', $_SESSION['id']); ?>]
                                                      <table id="progressbar-table" width="192" border="0" cellpadding="0" cellspacing="0" style="padding-top:10px;">
                                                         <tbody>
                                                            <tr>
                                                               <td><img src="/images/jeton_bar/left.gif"></td>
                                                               <td>
                                                                  <div id="progressbar">
                                                                  <?php
                                                                    if(GetUser('Level', $_SESSION['id']) != 12)
                                                                    $width = (100 / $Lev[GetUser('Level', $_SESSION['id'])] * GetUser('Reuting', $_SESSION['id']));
                                                                    else $width = 100;
                                                                    ?>
                                                                    <span id="led"><span id="strip" class="progress" style="width:<?=$width; ?>%;">
                                                                    <?php if(GetUser('Level', $_SESSION['id']) != 12) { ?>

                                                                    <span id="exp-one" class="text"><?=GetUser('Reuting', $_SESSION['id']); ?></span>/<?=$Lev[GetUser('Level', $_SESSION['id'])]; ?></span></span>
                                                                    
                                                                    <?php } else { ?>
                                                                        
                                                                        <span id="exp-one"><?=GetUser('Reuting', $_SESSION['id']); ?></span>/&infin; max</span></span>
                                                                        
                                                                    <?php } ?>
                                                                  </div>
                                                               </td>
                                                               <td><img src="/images/jeton_bar/right.gif"></td>
                                                            </tr>
                                                         </tbody>
                                                      </table>
                                                   </div>
                                                </td>
                                             </tr>
                                             <tr>
                                                <td style="padding-top:7px">
                                                   <table width="200" border="0" cellspacing="0" cellpadding="0">
                                                      <tbody>
                                                         <tr>
                                                            <td width="90" valign="top" style="padding-top:5px"><a href="/account/"><img src="/images/no_avatar.jpg" width="75" height="75" border="0" class="smallavatar"></a></td>
                                                            <td class="getonmenu">
                                                               <ul class="jeton">
                                                                  <li><a href="/account/">Профиль</a></li>
                                                                  <li><a href="/exchanger/">Обменник</a></li>
                                                                  <li><a href="/bonus/">Бонусы</a></li>
                                                                  <li><a href="/konkurs/">Конкурс</a></li>
                                                               </ul>
                                                               <br>
                                                            </td>
                                                         </tr>
                                                      </tbody>
                                                   </table>
                                                </td>
                                             </tr>
                                          </tbody>
                                       </table>
                                    </td>
                                 </tr>
                              </tbody>
                           </table>
                        </td>
                     </tr>
                  </tbody>
               </table>
            </div>
         </td>
      </tr>
      <tr>
         <td style="padding-left:38px">
            <script>
               function timeToString(time)
               {
               	var minutes = Math.floor(time/60);
               	var seconds = time%60;
                   var result = (minutes <= 9) ? "0"+minutes+":" : minutes+":";
                   result += (seconds <= 9) ? "0"+seconds : seconds;
                   return result;
               }
               
               var builderTime = 0*60+0;
               
               function builderTimerOnTimer()
               {
               builderTime = (builderTime) > 0 ? (builderTime-1) : 0;
                   $("#builderTimer").html(timeToString(builderTime));
                           if (builderTime<=60) 
                   	$("#builderTimer").css('color','red');            
               }
               $(document).everyTime(1000, builderTimerOnTimer);
               
            </script>
         </td>
      </tr>
      <tr>
         <!--good2-->
         <td align="left" valign="top">
            <h3 style="margin-bottom:10px;margin-left:38px;margin-top:20px">Характеристики</h3>
            <table width="190" border="0" cellspacing="0" cellpadding="4" style="margin-left:38px" id="stat-table">
               
                  <tr bgcolor="#e8dcc4">
                     <td align="right" valign="middle"><img src="/images/index-icons/opit.jpg" width="31" height="23"></td>
                     <td align="left" valign="bottom"><span class="menu2"><a href="/levels/">Уровень:</a></span> <span class="stats"><a href="/levels/" class="stats"><?=GetUser('Level', $_SESSION['id']); ?></a></span>
                     </td>
                     <td width="12" valign="middle">
                        <a href="/levels/" onmousedown="ChangeImg('opit','/images/icons/button_plus03.gif');" onmouseover="ChangeImg('opit','/images/icons/button_plus02.gif');" onmouseout="ChangeImg('opit','/images/icons/button_plus01.gif');">
                        <img src="/images/icons/button_plus01.gif" name="opit" border="0" title="Для повышения уровня, следуйте сюжетным заданиям">
                        </a>
                     </td>
                  </tr>
                  <tr>
                     <td align="right" valign="middle"><img src="/images/icons/gold.png" width="31" height="23"></td>
                     <td align="left" valign="bottom"><span class="menu2"><a href="/enter/">Бустеры:</a></span> <span class="stats">
                        <a id="bonusLbl" href="/enter/"><span title="0 + 0 (платные + бесплатные)"><?=intval($User['MoneyIn']); ?></span></a></span> 
                     </td>
                     <td valign="middle">
                        <a href="/enter/" onmousedown="ChangeImg('booster','/images/icons/button_plus03.gif');" onmouseover="ChangeImg('booster','/images/icons/button_plus02.gif');" onmouseout="ChangeImg('booster','/images/icons/button_plus01.gif');">
                        <img src="/images/icons/button_plus01.gif" name="booster" border="0" title="Приобретите бустеры любым удобным способом"></a>
                     </td>
                  </tr>
                  <tr bgcolor="#e8dcc4">
                     <td width="35" align="right" valign="middle" style="padding-left:0px"><img src="/images/index-icons/money_dark.jpg" width="31" height="23"></td>
                     <td align="left" valign="bottom"><span class="menu2"><a href="/finances">Деньги:</a></span> <span class="stats"><a href="/finances">
                        <span id="moneyLbl"><?=intval($User['MoneyOut']); ?></span>						  </a></span>
                     </td>
                     <td valign="middle">
                        <a href="/finances/" onmousedown="ChangeImg('money','/images/icons/button_plus03.gif');" onmouseover="ChangeImg('money','/images/icons/button_plus02.gif');" onmouseout="ChangeImg('money','/images/icons/button_plus01.gif');">
                        <img src="/images/icons/button_plus01.gif" name="money" border="0" title="Вывод средств"></a>
                     </td>
                  </tr>
                  <!-- -->
                  <!-- -->
                  
                        
                     </td>
                  </tr>
                  <tr bgcolor="#e8dcc4">
                     <td align="right" valign="middle"><img src="/images/index-icons/mail.jpg" width="31" height="23"></td>
                     <td align="left" valign="bottom"><span class="menu2"><a href="/support/" style="color:#000000">Почта:</a></span> <span class="stats"><a href="/support/">0</a></span></td>
                     <td valign="middle">
                        <a href="/support/" onmousedown="ChangeImg('mail','/images/icons/button_plus03.gif');" onmouseover="ChangeImg('mail','/images/icons/button_plus02.gif');" onmouseout="ChangeImg('mail','/images/icons/button_plus01.gif');">
                        <img src="/images/icons/button_plus01.gif" name="mail" border="0" title="Связь со штабом">
                        </a>
                     </td>
                  </tr>
               </tbody>
            </table>
            <div style="padding-left: 40px; padding-top: 20px;"></div>
            <div style="padding-left: 40px; padding-top: 20px;">
               <h3>Статистика</h3>
               
               <li>За неделю: <b><span class="stats"><?=FullUserEvery(); ?></span></b></li>
               <li>Нас уже: <b><span class="stats"><?=FullUser(); ?></span></b></li>
			<li>Пополнено: <b><span class="stats"><?=FullEnter(); ?></span></b></li>
			<li>Выплачено: <b><span class="stats"><?=FullVivod(); ?></span></b></li>
			<li>Остаток резерва: <b><span class="stats"><?=(FullEnter()*0.90)-FullVivod(); ?></span></b></li>
			<li>Проект работает: <b><span class="stats"><?=intval(((time() - $DateStart) / 86400 ) -3); ?>-дня</span></b></li>
						</div>
			<div style="padding-left: 40px; padding-top: 20px;"></div>
            <div style="padding-left: 40px; padding-top: 20px;">			
			<div id="server_timer">
			<h3>Время сервера</h3>
			
				<span id="server_timer">--:--:--</span>
								<script type="text/javascript">
				var server_hour = <?=date("H", time()); ?>;
				var server_minute = <?=date("i", time()); ?>;
				var server_second = <?=date("s", time()); ?>;
					
				function server_timer() {	
					$("#server_timer").html((server_hour < 10 ? "0"+server_hour : server_hour)+":"+(server_minute < 10 ? "0"+server_minute : server_minute)+":"+(server_second < 10 ? "0"+server_second : server_second));
					++server_second;
					if(server_second > 59) {
						++server_minute;
						if(server_minute > 59) {
							++server_hour;
							if(server_hour > 23) {
								server_hour = 00;
							}
							server_minute = 00;
						}
						server_second = 00;
					}
				}
				server_timer();
				server_timer_id = setInterval('server_timer()',1000);
				</script>
			</div>
				</div>
            </div>
            <div style="padding-left: 40px; padding-top: 20px;">
               
            </div>
            <div style="padding-left: 40px; padding-top: 20px;">
               
            </div>
         </td>
      </tr>
   </tbody>
</table>