<?PHP
$_OPTIMIZATION["title"] = "Настройки аккаунта";
$usid = $_SESSION["user_id"];
$db->Query("SELECT * FROM db_users_a WHERE id = '$usid'");
$user_data = $db->FetchArray();
?>
<?PHP
	if(isset($_POST["new"])){
     if (preg_match("/[\>|\<|\"|\'|\\|\/]/", $com2)) {
    } else {

		$new = $func->IsPassword($_POST["new"]);


				if($new !== false){

					if( strtolower($new) == strtolower($_POST["re_new"])){


						$db->Query("UPDATE db_users_a SET pass = '$new', name='$name' WHERE id = '$usid'");

						echo "<div class='alert alert-success'>Данные успешно обновлены</div>";

					}else echo "<div class='alert alert-danger'>Пароль и повтор пароля не совпадают</div>";

				}else echo "<div class='alert alert-danger'>Новый пароль имеет неверный формат</div>";

		}

	}




	if(isset($_POST["yad"])){

       if ( !preg_match("#^41001[0-9]{7,10}$#", $_POST["yad"])) {

            ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "error",
			      title: "Неверный счет!",
			      text: "Проверьте правильность счета",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
            <?



          }else{

          $db->Query("UPDATE db_users_a SET yad = '".$_POST["yad"]."' WHERE id = '$usid'");


          ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "success",
			      title: "Поздравляем!",
			      text: "Данные успешно обновлены",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
          <?

       };

	}





	if(isset($_POST["paykosh"])){


       if ( !preg_match("#^P[0-9]{7,15}|.+@.+\..+$#", $_POST["paykosh"])) {

            ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "error",
			      title: "Неверный счет!",
			      text: "Проверьте правильность счета",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
            <?



          }else{

          $db->Query("UPDATE db_users_a SET paykosh = '".$_POST["paykosh"]."' WHERE id = '$usid'");


          ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "success",
			      title: "Поздравляем!",
			      text: "Данные успешно обновлены",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
          <?

       };


	}




		if(isset($_POST["adv"])){


       if ( !preg_match("#^[RUE]{1}[0-9]{7,15}|.+@.+\..+$#", $_POST["adv"])) {

            ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "error",
			      title: "Неверный счет!",
			      text: "Проверьте правильность счета",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
            <?



          }else{

          $db->Query("UPDATE db_users_a SET adv = '".$_POST["adv"]."' WHERE id = '$usid'");


          ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "success",
			      title: "Поздравляем!",
			      text: "Данные успешно обновлены",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
          <?

       };


	}





    if(isset($_POST["r_name"])){

       if ( preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/", $_POST["r_name"])) {

            ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "error",
			      title: "Запрещенные символы!",
			      text: "Проверьте правильность имени",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
            <?



          }else{

          $db->Query("UPDATE db_users_a SET real_name = '".$_POST["r_name"]."' WHERE id = '$usid'");


          ?>
				  <link href="../style/sweet-alert.css" rel="stylesheet" type="text/css"><script src="../js/sweet-alert.min.js"></script><script type="text/javascript">
		          setTimeout(function() {
		          swal({
			      type: "success",
			      title: "Поздравляем!",
			      text: "Данные успешно обновлены",
			      showConfirmButton: true
		          });
		          }, 500);
		          </script>
          <?

       };

	}






?>


<style>
/*body{background:#f3f2f0 !important;}*/
.insert_box{padding: 10px;border-radius: 10px;-moz-box-shadow: 0 1px 2px 0 rgba(0,0,0,.14);-webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,.14);box-shadow: 0 1px 2px 0 rgba(0,0,0,.14);}
.insert_new_btn {
    color: #fff;
    font-weight: 700;
    border: none;
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    border-bottom-left-radius: 50px;
    border-top-left-radius: 50px;
    outline: none;
    -webkit-transition: 333ms ease-in-out;
    transition: 333ms ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 38px 10px;
	margin-top:10px;
    font-size: 15px;
	letter-spacing:1px;
    background-color: #5cb45b;
   /* -webkit-box-shadow: 0 10px 15px 0 rgba(255,140,0,.2);*/
    /*box-shadow: 0 7px 15px 0 rgba(255,140,0,.2);*/
}
.insert_new_btn:hover{color:#fff;-webkit-transition:133ms ease-in-out;transition:133ms ease-in-out-webkit-box-shadow:0 7px 30px 0 rgba(255,140,0,.4));box-shadow:0 7px 30px 0 rgba(255,140,0,.4);}
.insert_new_input{border-radius: 50px;letter-spacing: 1px;text-align: center;background-color: #fdfdfd;height: 41px;font-size: 13px;}
.insert_new_input:focus::-webkit-input-placeholder {color: transparent}
.insert_new_input:focus::-moz-placeholder          {color: transparent}
.insert_new_input:focus:-moz-placeholder           {color: transparent}
.insert_new_input:focus:-ms-input-placeholder      {color: transparent}
.balancei_pscount{height:25px;color:#7f7f7f;}
.insert_new_btn:active{color:#fff !important;}
.insert_new_btn:focus{color:#fff !important;}
@media (min-width: 1200px) and (max-width: 1470px) {
	.insert_new_input{font-size: 10px;}
	.insert_new_btn{font-size: 13px;padding: 10px 0px 10px;}
	.balancei_pscount{display:none;}
	}
</style>
<style>
  .insert_new_btn {
    color: #fff;
    font-weight: 700;
    border: none;
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    border-bottom-left-radius: 50px;
    border-top-left-radius: 50px;
    outline: none;
    -webkit-transition: 333ms ease-in-out;
    transition: 333ms ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 38px 10px;
    margin-top:10px;
    font-size: 15px;
    letter-spacing:1px;
    background-color: #5cb45b;
   /* -webkit-box-shadow: 0 10px 15px 0 rgba(255,140,0,.2);*/
    /*box-shadow: 0 7px 15px 0 rgba(255,140,0,.2);*/
  }
  .insert_new_btn:hover{color:#fff;-webkit-transition:133ms ease-in-out;transition:133ms ease-in-out-webkit-box-shadow:0 7px 30px 0 rgba(255,140,0,.4));box-shadow:0 7px 30px 0 rgba(255,140,0,.4);}
.insert_new_input{border-radius: 50px;margin-bottom:15px;letter-spacing: 1px;text-align: center;background-color: #fdfdfd;height: 41px;font-size: 12px;}
.insert_new_input:focus::-webkit-input-placeholder {color: transparent}
.insert_new_input:focus::-moz-placeholder          {color: transparent}
.insert_new_input:focus:-moz-placeholder           {color: transparent}
.insert_new_input:focus:-ms-input-placeholder      {color: transparent}
.settings_new_label{padding:0 15px;font-weight:300;letter-spacing:1px;font-size: 11px;color: #484848;width:100%;}
.settings_new_label a{text-align:right;float: right;color: #9c2e0b;cursor: help;}
.settings_new_label a:hover{color:#d22;}
.insert_new_btn:active{color:#fff !important;}
.insert_new_btn:focus{color:#fff !important;}
.settings_pmodal{font-size: 13px;letter-spacing: 1px;text-align:justify;}
.settings_modal_btn{letter-spacing: 1px;font-size: 13px;}
</style>

<div class="page-content-wrapper ">
  <div class="container">
    <div class="row">
      <div class="col-lg-8">
        <div class="row">
          <div class="col-lg-12">
            <div class="panel panel-primary">
              <div class="panel-body">
                <hr><div class="ideas_coment text-center">Изменение пароля:</div><hr class="m-b-10">
                <div class="text-center m-t-10">
                  <form action="" method="post" class="settings_formbox">
                   
                   
                    <div class="form-group">
                      <input name="new" class="form-control" maxlength="20" minlength="6" type="password" required="" placeholder="Введите новый пароль">
                    </div>
                    <div class="form-group">
                      <input name="re_new" class="form-control" maxlength="20" minlength="6" type="password" required="" placeholder="Повторите новый пароль">
                    </div>
                    <button type="submit" class="btn waves-effect btn-primary btn-block calc_btn"><i class="fa fa-cog"></i> Изменить пароль</button>
                  </form>
                </div>
              </div>
            </div>
          </div>
          <div class="col-lg-12">
            <div class="panel panel-primary">
              <div class="panel-body">
                <hr>
                <div class="ideas_coment text-center">Ваше имя:</div>
                <hr class="m-b-10">
                <div class="text-center m-t-10">
                  <form action="" method="post" class="settings_formbox">
                    <input type="hidden" name="_tocken" value="4d61bc736bffe7b14aa29d632">
                    <div class="form-group">
                      <input name="r_name" class="form-control" maxlength="8" minlength="8" type="text" required="" value="<?=$user_data["real_name"]?>" placeholder="Ваше реальное имя">
                    </div>
                    <button type="submit" class="btn waves-effect btn-primary btn-block calc_btn"><i class="fa fa-cogs"></i> Сохранить</button>
                  </form>
                </div>        
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-lg-4">
        <div class="row">

          <div class="col-lg-12">
            <div class="panel panel-primary">
              <div class="panel-body">
                <hr>
                <div class="ideas_coment text-center">Кошельки для выплат:</div>
                <hr class="m-b-10">

              
                
                <form  action="" method="post">
                
                  <div class="form-group">
                    <label class="settings_new_label">Payeer</label>
                    <input name="paykosh" type="text" class="form-control balancei_input insert_new_input" value="<?=$user_data["paykosh"]?>" placeholder="Формат кошелька: P1*****" ">
                  </div>         
                  <button type="submit" class="btn waves-light btn-block balancei_btngo insert_new_btn"> Сохранить изменения</button>
                </form>
                <br>
                <br>
              <form  action="" method="post">
                
                  <div class="form-group">
                    <label class="settings_new_label">YandexMoney</label>
                    <input name="paykosh" type="text" class="form-control balancei_input insert_new_input" value="<?=$user_data["yad"]?>" placeholder="Формат кошелька: 41***************" ">
                  </div>         
                  <button type="submit" class="btn waves-light btn-block balancei_btngo insert_new_btn"> Сохранить изменения</button>
                </form>
                <br>
                <br>
              <form  action="" method="post">
                
                  <div class="form-group">
                    <label class="settings_new_label">AdvCash</label>
                    <input name="paykosh" type="text" class="form-control balancei_input insert_new_input" value="<?=$user_data["adv"]?>" placeholder="Формат кошелька: *****@mail.ru" ">
                  </div>         
                  <button type="submit" class="btn waves-light btn-block balancei_btngo insert_new_btn"> Сохранить изменения</button>
                </form>
                <br>
                <br>
                
              </div>
            </div>
          </div>
        </div>
      </div>




