Initial commit
[2ch-be.git] / dev-test / old_dev / bak / convert2.php
blobd105d44d35639edf3d47afff11dd16dfd6c6b663
1 <?php
2 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
3 die("NG");
5 include("encrypt.php");
7 $be = new Message;
8 $email = Decrypt($_COOKIE['DMDM'],KEY);
9 $points = file_get_contents("http://tpol27.nttec.com/melon.php?email=".$email);
11 if(isset($_POST['submit'])) {
12 $pointsToConvert = abs(trim($_POST['convert']));
13 $email = Decrypt($_COOKIE['DMDM'],KEY);
14 if ($pointsToConvert > $points || !filter_var($pointsToConvert, FILTER_VALIDATE_INT)) {
15 echo "エラー!許可されていない";
16 } else {
17 $points = file_get_contents("http://tpol27.nttec.com/melon.php?conv=".$pointsToConvert."&usr=".$email."&ip=".$_SERVER['REMOTE_ADDR']);
18 if($points != "0" && $points == "1") {
19 if ($be->AddBEpoints($email, $pointsToConvert))
20 echo "成功";
21 else
22 echo "失敗する";
23 } else {
24 echo "NG変換";
29 ?><!DOCTYPE html>
30 <html lang="en">
31 <head>
32 <meta charset="Shift_JIS">
33 <title>変換</title>
34 <meta name="viewport" content="width=device-width, initial-scale=1.0">
35 <meta name="description" content="">
36 <meta name="author" content="">
37 <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
38 </head>
39 <body>
40 <div class="containerz">
41 <div class="navbar-collapse">
42 <ul class="nav navbar-nav">
43 </ul>
44 </div>
45 </div>
47 <div class="container">
48 <center>
49 <div class="form-signin" style = "font-size: 1.2em;text-align:right;">
50 <?php
51 if($_SERVER['SERVER_NAME'] == "be.2ch.net") {
53 <a href="http://www.2ch.net/" target="_BLANK">
54 <img src="<?php echo $livesitePath ?>css/img/2ch_logo.gif">
55 </a>
56 <?php
57 } elseif ($_SERVER['SERVER_NAME'] == "be.bbspink.com") {
59 <a href="http://www.bbspink.com/" target="_BLANK">
60 <img src="<?php echo $livesitePath ?>css/img/pink.png">
61 </a>
62 <?php
65 <br>
66 BE 2.0<?php echo (detect_device($_SERVER['HTTP_USER_AGENT'])) ? "β" : "" ?>
67 </div>
68 </center>
69 </div>
70 <div class="container">
71 <center>
72 <form class="form-signin" method="post">
73 <?php
75 $points = file_get_contents("http://tpol27.nttec.com/melon.php?email=".$email);
76 echo "メロンのポイント: <b><font color=¥"green¥">".$points."</font></b><br><br>";
77 echo "Beポイント: <b><font color=¥"green¥">".$be->GetBEpoints($email)."</font></b><br><br>";
78 echo "1 メロンのポイント --> 1 Beポイント<br><br>";
80 <input type="text" name="convert" placeholder="点数"><br>
81 <input type="submit" name="submit" value="変換">
83 </form>
84 </center>
85 </div>
86 </body>
87 </html>