Initial commit
[2ch-be.git] / dev-test / convertMarch142015.php
blob80c7ee39ae60c0fc2ba33204a18b06fd16fe2747
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 $_SESSION['error'] = "ƒ�ƒ�ƒ“ƒ|ƒCƒ“ƒg‚ª‘«‚è‚Ü‚¹‚ñ�B";
16 header('Location: convert.php');
17 exit;
18 } else {
19 $points = file_get_contents("http://tpol27.nttec.com/melon.php?conv=".$pointsToConvert."&usr=".$email."&ip=".$_SERVER['REMOTE_ADDR']);
20 if($points != "0" && $points == "1") {
21 if ($be->AddBEpoints($email, $pointsToConvert)){
23 $_SESSION['error'] = "�¬Œ÷";
24 header('Location: convert.php');
25 exit;
26 } else{
27 $_SESSION['error'] = "Ž¸”s‚·‚é";
28 header('Location: convert.php');
29 exit;
31 } else {
32 $_SESSION['error'] = "NG•ÏŠ·";
33 header('Location: convert.php');
34 exit;
38 // if($points != "0" && $points == "1") {
39 // $_SESSION['error'] = "�¬Œ÷";
40 // header("Location: convert.php");
41 // exit;
42 // else{
44 // }
45 // $_SESSION['error'] = "Ž¸”s‚·‚é";
46 // header("Location: convert.php");
47 // exit;
48 // } else {
49 // $_SESSION['error'] = "NG•ÏŠ·";
50 // header("Location: convert.php");
51 // exit;
52 // }
53 $varMessage = $_SESSION['error'];
54 ?><!DOCTYPE html>
55 <html lang="en">
56 <head>
57 <meta charset="Shift_JIS">
58 <title>•ÏŠ·</title>
59 <meta name="viewport" content="width=device-width, initial-scale=1.0">
60 <meta name="description" content="">
61 <meta name="author" content="">
62 <link rel="stylesheet" type="text/css" href="<?php echo $livesitePath ?>css/style.css"/>
63 </head>
64 <body>
65 <div class="containerz">
66 <div class="navbar-collapse">
67 <ul class="nav navbar-nav">
68 </ul>
69 </div>
70 </div>
72 <div class="container">
73 <center>
74 <div class="form-signin" style = "font-size: 1.2em;text-align:right;">
75 <?php
76 if($_SERVER['SERVER_NAME'] == "be.2ch.net") {
78 <a href="http://www.2ch.net/" target="_BLANK">
79 <img src="<?php echo $livesitePath ?>css/img/2ch_logo.gif">
80 </a>
81 <?php
82 } elseif ($_SERVER['SERVER_NAME'] == "be.bbspink.com") {
84 <a href="http://www.bbspink.com/" target="_BLANK">
85 <img src="<?php echo $livesitePath ?>css/img/pink.png">
86 </a>
87 <?php
90 <br>
91 BE 2.0
92 </div>
93 </center>
94 </div>
95 <div class="container">
96 <center>
97 <form class="form-signin" method="post">
98 <?php
100 $points = file_get_contents("http://tpol27.nttec.com/melon.php?email=".$email);
101 echo "ƒ�ƒ�ƒ“ƒ|ƒCƒ“ƒg: <b><font color=\"green\">".$points."</font></b><br><br>";
102 echo "Beƒ|ƒCƒ“ƒg: <b><font color=\"green\">".$be->GetBEpoints($email)."</font></b><br><br>";
103 echo "1 ƒ�ƒ�ƒ“‚̃|ƒCƒ“ƒg --> 1 Beƒ|ƒCƒ“ƒg<br><br>";
105 <input type="text" name="convert" placeholder="“_�”"><br>
106 <?php
107 if(!empty($varMessage)){
108 echo "<div style=\"padding:5px; margin-top:8px; background-color:#D6D6D6; \">". $varMessage . "</div><br>";
109 $_SESSION['error'] = "";
110 }?>
111 <input type="submit" name="submit" value="•ÏŠ·">
113 </form>
114 </center>
115 </div>
116 </body>
117 </html>