 <?php 

session_start();

//error_reporting(E_ALL);
//ini_set('display_errors', 'On');

require_once 'validator.php';

$validator = new Validator();

$validator->set_error_delimiters('<div id="contact-error" class="alert alert-danger">
									<span class="message">', '</span>
								</div> ');

//Задаем правила валидации
$rules = array(
	array(
		'field' => 'user_name',
		'label' => 'Ваше имя',
		'rules' => array(
                        'trim' => '', //Обрезаем пробелы по бокам
                        'strip_tags' => '', // Удаляем HTML и PHP теги
                        'required' => 'Поле %s обязательно для заполнения'
					)
	),
	array(
		'field' => 'user_email',
		'label' => 'Ваш e-mail адрес',
		'rules' => array(
                        'trim' => '',
                        'required' => 'Поле %s обязательно для заполнения',
                        'valid_email' => 'Поле %s должно содержать правильный email-адрес'
					)
	),

    array(
		'field' => 'subject',
		'label' => 'Тема письма',
		'rules' => array(
                        'trim' => '', //Обрезаем пробелы по бокам
                        'strip_tags' => '', // Удаляем HTML и PHP теги
                        'required' => 'Поле %s обязательно для заполнения'
					)
	),
    array(
		'field' => 'text',
		'label' => 'Текст сообщения',
		'rules' => array(
                        'trim' => '', //Обрезаем пробелы по бокам
                        'strip_tags' => '', // Удаляем HTML и PHP теги
                        'required' => 'Поле %s обязательно для заполнения'
					)
	),
    array(
		'field' => 'keystring',
		'label' => 'Капча',
		'rules' => array(
                        'trim' => '', //Обрезаем пробелы по бокам
                        'required' => 'Вы не ввели цифры изображенные на картинке',
    					'valid_captcha[keystring]' => 'Вы ввели не правильные цифры с картинки'
					)
	)
);

//Устанавливаем правила валидации
$validator->set_rules($rules);
$message = '';

//Запускаем валидацию POST данных
if($validator->run()){
	
	//Здесь впишите свой e-mail адрес
	//на негу будут приходить уведомления с формы
	$to = 'support@axpreo.com';
 
	$from = "=?cp1251?b?" . base64_encode($validator->postdata('user_name')) . "?=";
	$subject = "=?cp1251?b?" . base64_encode( $validator->postdata('subject') ) . "?=";
	
	$mail_body = "Поступил новый ответ от формы обратной связи.\r\nАвтор оставил такие данные:\r\n";
	
	//Формируем текст сообщения
	foreach($rules as $rule){
		if($rule['field'] == 'keystring') continue;
		$mail_body .= $rule['label'].': '.$validator->postdata($rule['field'])."\r\n";
	}
	
	$header = "MIME-Version: 1.0\n";
	$header .= "Content-Type: text/plain; charset=cp1251\n";
	$header .= "From: ". $from . " <" . $validator->postdata('user_email'). ">";

	//Отправка сообщения
	if(mail($to, $subject, $mail_body, $header)){
		
		$message = '				<div class="alert bg-success alert-dismissible mb-2" role="alert">                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">                                        <span aria-hidden="true">?</span>                                    </button>                                    <strong>Сообщение в службу поддержки</strong> Ваше письмо успешно отправлено!                                </div> ';
		
		//Очищаем форму обратной связи
		$validator->reset_postdata();
	}
	else{
		
		$message = '<div id="contact-error" class="alert alert-danger">
									<span class="message">Ваше сообщение не отправлено!</span>
								</div>';
	}
}
else{
	
    //Получаем сообщения об ошибках в виде строки
	$message = $validator->get_string_errors();
	
    //Получаем сообщения об ошибках в виде массива
	$errors = $validator->get_array_errors();

}

?> 


<!DOCTYPE html>

<html lang="en" class="loading">

  

<head>

 <meta http-equiv="content-type" content="text/html; charset=windows-1251" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">

    <meta name="description" content="Пассивный и активный доход с AXPREO без каких-либо действий с Вашей стороны! Зарабатывай вместе со всеми прямо сейчас!">

    <meta name="keywords" content="Доход, инвестиции, заработок, вклады, работа в интернете, вклады под процент, биржа валют, заработок 2018">

    <meta name="author" content="PIXINVENT">

    <title>AXPREO - Статистика вашего профиля</title>

    <link rel="apple-touch-icon" sizes="60x60" href="app-assets/img/ico/apple-icon-60.html">

    <link rel="apple-touch-icon" sizes="76x76" href="app-assets/img/ico/apple-icon-76.html">

    <link rel="apple-touch-icon" sizes="120x120" href="app-assets/img/ico/apple-icon-120.html">

    <link rel="apple-touch-icon" sizes="152x152" href="app-assets/img/ico/apple-icon-152.html">

    <link rel="shortcut icon" type="image/x-icon" href="app-assets/img/ico/favicon.ico">

    <link rel="shortcut icon" type="image/png" href="app-assets/img/ico/favicon-32.png">

    <meta name="apple-mobile-web-app-capable" content="yes">

    <meta name="apple-touch-fullscreen" content="yes">

    <meta name="apple-mobile-web-app-status-bar-style" content="default">

    <link href="https://fonts.googleapis.com/css?family=Rubik:300,400,500,700,900|Montserrat:300,400,500,600,700,800,900" rel="stylesheet">

    <!-- BEGIN VENDOR CSS-->

    <!-- font icons-->

    <link rel="stylesheet" type="text/css" href="app-assets/fonts/feather/style.min.css">

    <link rel="stylesheet" type="text/css" href="app-assets/fonts/simple-line-icons/style.css">

    <link rel="stylesheet" type="text/css" href="app-assets/fonts/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/perfect-scrollbar.min.css">

    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/prism.min.css">

    <link rel="stylesheet" type="text/css" href="app-assets/vendors/css/chartist.min.css">

    <!-- END VENDOR CSS-->

    <!-- BEGIN APEX CSS-->

    <link rel="stylesheet" type="text/css" href="app-assets/css/app.css">

  <script src="/js/progressbar.js" type="text/javascript" ></script>

  <script src="/js.js" type="text/javascript" ></script>

    <!-- END APEX CSS-->

    <!-- BEGIN Page Level CSS-->

    <!-- END Page Level CSS-->

    <!-- BEGIN Custom CSS-->

    <!-- END Custom CSS-->

  </head>

  <body data-col="2-columns" class=" 2-columns ">

    <!-- ////////////////////////////////////////////////////////////////////////////-->

    <div class="wrapper">





      <!-- main menu-->

      <!--.main-menu(class="#{menuColor} #{menuOpenType}", class=(menuShadow == true ? 'menu-shadow' : ''))-->

      <div data-active-color="white" data-background-color="man-of-steel" data-image="app-assets/img/sidebar-bg/01.jpg" class="app-sidebar">

        <!-- main menu header-->

        <!-- Sidebar Header starts-->

        <div class="sidebar-header">

          <div class="logo clearfix"><a href="/" class="logo-text float-left">

              <div class="logo-img"><img src="app-assets/img/logo.png"/></div><span class="text align-middle">AXPREO</span></a><a id="sidebarToggle" href="javascript:;" class="nav-toggle d-none d-sm-none d-md-none d-lg-block"><i data-toggle="expanded" class="ft-toggle-right toggle-icon"></i></a><a id="sidebarClose" href="javascript:;" class="nav-close d-block d-md-block d-lg-none d-xl-none"><i class="ft-x"></i></a></div>

        </div>

        <!-- Sidebar Header Ends-->

        <!-- / main menu header-->

        <!-- main menu content-->

        <div class="sidebar-content">

          <div class="nav-container">

            <ul id="main-menu-navigation" data-menu="menu-navigation" class="navigation navigation-main">

              

        

        <li><a href="/?page=deposits"><i class="icon-briefcase"></i><span data-i18n="" class="menu-title">Мои депозиты</span></a>

              </li>

        

              <li class=" nav-item"><a href="/?page=invest"><i class="icon-wallet"></i><span data-i18n="" class="menu-title">Пополнить баланс</span></a>

              </li>

              <li class=" nav-item"><a href="/?page=withdrawal"><i class="icon-credit-card"></i><span data-i18n="" class="menu-title">Вывести средства</span></a>

              </li>

              <li class=" nav-item"><a href="/?page=refs"><i class="icon-users"></i><span data-i18n="" class="menu-title">Партнерская</span></a>

              </li>
				<li class=" nav-item"><a href="/?page=settings"><i class="icon-settings"></i><span data-i18n="" class="menu-title">Настройки</span></a>

              </li>
              <li class=" nav-item"><a href="/logout.php"><i class="icon-logout"></i><span data-i18n="" class="menu-title">Выход</span></a>

              </li>

      <br>





              <li class="nav-item"><a href="/?page=reviews_cab"><i class="icon-bubbles"></i><span data-i18n="" class="menu-title">Отзывы</span></a>

              </li>

              <li class="active"><a href="/?page=contact_cab"><i class="ft-life-buoy"></i><span data-i18n="" class="menu-title">Поддержка</span></a>

              </li>

            </ul>

          </div>

        </div>

        <!-- main menu content-->

        <div class="sidebar-background"></div>

        <!-- main menu footer-->

        <!-- include includes/menu-footer-->

        <!-- main menu footer-->

      </div>

      <!-- / main menu-->



      <div class="main-panel">



        <!-- Navbar (Header) Starts-->

        <nav class="navbar navbar-expand-lg navbar-light bg-faded">

          <div class="container-fluid">

            <div class="navbar-header">

                    <button type="button" data-toggle="collapse" class="navbar-toggle d-lg-none float-left"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>

            <h4 class="card-title" style="margin-top: 20px;font-size: 22px;">Статистика профиля</h4>

            </div>

            <div class="navbar-container">

              <div id="navbarSupportedContent" class="collapse navbar-collapse">

        

       <div class="media mb-3" style="">

        <? if($_SESSION['avatar'] != ""): ?>     

          <img alt="96x96" class="media-object d-flex mr-3 align-self-center bg-success height-50 rounded-circle" src="images/avatars/<?=$_SESSION['avatar'];?>" alt="avatar" style="margin-top: 2px;">

        <?php elseif( $_SESSION['avatar'] == '' && USER_LOGGED ): ?>

          <img alt="96x96" class="media-object d-flex mr-3 align-self-center bg-success height-50 rounded-circle" src="/app-assets/img/portrait/avatars/avatar-08.png" alt="avatar" style="margin-top: 2px;">

        <?php endif; ?>

        



                        

                        <div class="media-body">

                            <h4 class="font-medium-1 mt-2 mb-0" style="padding-top: 10px;margin-right: 23px;"><?php echo $u_login; ?></h4>

                        </div>

                   

                    </div>

                <ul class="navbar-nav">

                  <li class="nav-item mr-2"><a id="navbar-fullscreen" href="javascript:;" class="nav-link apptogglefullscreen"><i class="ft-maximize font-medium-3 blue-grey darken-4"></i>

                      <p class="d-none">Полный экран</p></a></li>

               

               

                  <li class="dropdown nav-item">

          <a id="dropdownBasic3" href="#" data-toggle="dropdown" class="nav-link position-relative dropdown-toggle">

          <i class="ft-user font-medium-3 blue-grey darken-4"></i>

                      <p class="d-none">Профиль пользователя</p></a>

                    <div ngbdropdownmenu="" aria-labelledby="dropdownBasic3" class="dropdown-menu dropdown-menu-right">

          <a href="/?page=settings" class="dropdown-item py-1"><i class="ft-settings mr-2"></i><span>Настройки</span></a>

        

      

                      <div class="dropdown-divider"></div><a href="/logout.php" class="dropdown-item"><i class="ft-power mr-2"></i><span>Выход</span></a>

                    </div>

                  </li>

                  

                </ul>

              </div>

            </div>

          </div>

        </nav>

        <!-- Navbar (Header) Ends-->



        <div class="main-content">

          <div class="content-wrapper"><!--Statistics cards Starts-->

<div class="row" id="auto_statistic_cab" ids="<?php $databasecode = base64_encode($u_login); echo $databasecode; ?>">

  <div class="col-xl-3 col-lg-6 col-md-6 col-12">

    <div class="card gradient-blackberry">

      <div class="card-body">

        <div class="card-block pt-2 pb-0">

          <div class="media">

            <div class="media-body white text-left">

            <span>Ваш лицевой счет</span>

              <h3 class="font-large-1 mb-0"><?php echo number_format($b_tot,2,'.',','); ?> &#8381;</h3>

              

            </div>

            <div class="media-right white text-right">

              <i class="icon-wallet font-large-1"></i>

            </div>

          </div>

        </div>

        <div id="Widget-line-chart" class="height-75 WidgetlineChart WidgetlineChartshadow mb-2">         

        </div>

      </div>

    </div>

  </div>

  <div class="col-xl-3 col-lg-6 col-md-6 col-12">

    <div class="card gradient-ibiza-sunset">

      <div class="card-body">

        <div class="card-block pt-2 pb-0">

          <div class="media">

            <div class="media-body white text-left">

            <span>Средства на депозите</span>

              <h3 class="font-large-1 mb-0"><?php echo str_replace('.00','',number_format($b_activ,2,'.',',')); ?> &#8381;</h3>

              

            </div>

            <div class="media-right white text-right">

              <i class="icon-speedometer font-large-1"></i>

            </div>

          </div>

        </div>

        <div id="Widget-line-chart1" class="height-75 WidgetlineChart WidgetlineChartshadow mb-2">          

        </div>



      </div>

    </div>

  </div>

  

  <div class="col-xl-3 col-lg-6 col-md-6 col-12">

    <div class="card gradient-green-tea">

      <div class="card-body">

        <div class="card-block pt-2 pb-0">

          <div class="media">

            <div class="media-body white text-left">

            <span>Выведено с системы</span>

              <h3 class="font-large-1 mb-0"><?php echo str_replace('.00','',number_format($b_withed,2,'.',',')); ?> &#8381;</h3>

              

            </div>

            <div class="media-right white text-right">

              <i class="icon-credit-card font-large-1"></i>

            </div>

          </div>

        </div>

        <div id="Widget-line-chart2" class="height-75 WidgetlineChart WidgetlineChartshadow mb-2">        

        </div>

      </div>

    </div>

  </div>

  <div class="col-xl-3 col-lg-6 col-md-6 col-12">

    <div class="card gradient-pomegranate">

      <div class="card-body">

        <div class="card-block pt-2 pb-0">

          <div class="media">

            <div class="media-body white text-left">

            <span>Начислено средств</span>

              <h3 class="font-large-1 mb-0"><?php echo str_replace('.00','',number_format($b_earned,2,'.',',')); ?> &#8381;</h3>

              

            </div>

            <div class="media-right white text-right">

            <i class="icon-pie-chart font-large-1"></i>

              

            </div>

          </div>

        </div>

        <div id="Widget-line-chart3" class="height-75 WidgetlineChart WidgetlineChartshadow mb-2">          

        </div>

      </div>

    </div>

  </div>

</div>

<!--Statistics cards Ends-->


<div class="row">
	<div class="col-sm-12">
		<div class="card">
			<div class="card-header">
				<h4 class="card-title">Служба поддержки</h4>
				
			</div>
<section id="minimal-statistics">
<div class="px-3">						
							<form action="" method="post" class="form">		
							
							<div class="form-body">


								<h4 class="form-section"><i class="icon-speech"></i> Опишите вашу проблему</h4>
<?=(!empty($message))? '<div class="errors">'.$message.'</div>': ''?>
								<div class="form-group" <?=(!empty($errors['user_name']))? 'class="error_field"': '';?>>
									<label for="userinput5">Ваше имя</label>
									<input class="form-control border-primary" type="text" name="user_name" value="<?=$validator->postdata('user_name');?>">
								</div>

								<div class="form-group" <?=(!empty($errors['user_email']))? 'class="error_field"': '';?>>
									<label for="userinput6">Ваша почта</label>
									<input class="form-control border-primary" type="email" name="user_email" value="<?=$validator->postdata('user_email');?>">
								</div>

								<div class="form-group" <?=(!empty($errors['subject']))? 'class="error_field"': '';?>>
									<label>Тема обращения</label>
									<input class="form-control border-primary" name="subject" type="text" value="<?=$validator->postdata('subject');?>">
								</div>

								<div class="form-group" <?=(!empty($errors['text']))? ' error_field': '';?>>
									<label for="userinput8">Подробная информация</label>
									<textarea name="text" rows="5" class="form-control border-primary"><?=$validator->postdata('text');?></textarea>
								</div>

							</div>
							
							<div class="form-group col-sm-2" >
							<label for="userinput8">Капча</label>
 <div class="captchamvc capth_images" <?=(!empty($errors['keystring']))? 'class="error_field"': '';?>>
<?php require 'captcha.php';?>   
    <br>
<br>
        <div class="input-group">
          
                <input autocomplete="off"  name="keystring" class="form-control" type="text" value="" >
                <span class="field-validation-valid" data-valmsg-for="CaptchaInputText" data-valmsg-replace="true"></span>
           
        </div>
</div>	</div>			<div class="form-actions right">
								<button type="submit" id="buttonSendLetter" class="btn btn-raised btn-primary">
									<i class="fa fa-check-square-o"></i> Отправить запрос в службу поддержки
								</button>
							</div>
						</form>

					</div>

</section>
</div>

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

        <footer class="footer footer-static footer-light">

          <p class="clearfix text-muted text-sm-center px-2"><span>Copyright  &copy; 2018 AXPREO.COM, All rights reserved. </span></p>

        </footer>

</div>

</div>

    <script src="app-assets/vendors/js/core/jquery-3.2.1.min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/core/popper.min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/core/bootstrap.min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/perfect-scrollbar.jquery.min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/prism.min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/jquery.matchHeight-min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/screenfull.min.js" type="text/javascript"></script>

    <script src="app-assets/vendors/js/pace/pace.min.js" type="text/javascript"></script>

    <!-- BEGIN VENDOR JS-->

    <!-- BEGIN PAGE VENDOR JS-->

    <script src="app-assets/vendors/js/chartist.min.js" type="text/javascript"></script>

    <!-- END PAGE VENDOR JS-->

    <!-- BEGIN APEX JS-->

    <script src="app-assets/js/app-sidebar.js" type="text/javascript"></script>

    <script src="app-assets/js/notification-sidebar.js" type="text/javascript"></script>

    <script src="app-assets/js/customizer.js" type="text/javascript"></script>

    <!-- END APEX JS-->

    <!-- BEGIN PAGE LEVEL JS-->

    <script src="app-assets/js/dashboard1.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/ajax.js"></script>    
<!-- BEGIN JIVOSITE CODE {literal} -->
<script type='text/javascript'>
(function(){ var widget_id = 'n790DI644T';var d=document;var w=window;function l(){
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//code.jivosite.com/script/widget/'+widget_id; var ss = document.getElementsByTagName('script')[0]; ss.parentNode.insertBefore(s, ss);}if(d.readyState=='complete'){l();}else{if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();</script>
<!-- {/literal} END JIVOSITE CODE -->
</body>

</html>