diff --git a/2014OC/.htaccess b/2014OC/.htaccess
new file mode 100644
index 0000000..3a8c330
--- /dev/null
+++ b/2014OC/.htaccess
@@ -0,0 +1,4 @@
+AddHandler cgi-script .rb
+AddType "text/html; charset=UTF-8" .rb
+AddType "text/html; charset=UTF-8" .html
+Options +ExecCGI
diff --git a/2014OC/Bingo.css b/2014OC/Bingo.css
new file mode 100644
index 0000000..dee3604
--- /dev/null
+++ b/2014OC/Bingo.css
@@ -0,0 +1,76 @@
+html,body {
+ width: 100%;
+ height: 100%;
+}
+div.outflam{
+ width: 800px;
+ height: 1240px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 0 auto;
+ }
+
+div.top{
+ background: #136cf9;
+ background-image: url("png/top.png");
+ background-repeat: no-repeat;
+ border: thin solid #136cf9;
+ width: 100%;
+ height: 180px;
+ margin-top:0 auto;
+ margin-bottom:0 auto;
+ margin-left: auto;
+ margin-right: auto;
+
+}
+
+p,h3 {
+ margin:0;
+ padding-left: 5%;
+ font-weight: 900;
+ height: 5%;
+ width: 95%;
+ border: thin solid #136cf9;
+}
+
+div.center{
+ border: thin solid #1d38ff;
+ background: #1d38ff;
+ width: 100%;
+ height: 45%;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table {
+ background: white;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 1%;
+ margin-bottom: auto;
+}
+
+div.bottom{
+ background: #45e2fe;
+ background-image: url("png/bottom.png");
+ background-repeat: no-repeat;
+ background-position: center bottom;
+ border:thin solid #45e2fe;
+ width: 100%;
+ height: 150px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+div.bottom img {
+ float: left;
+ margin-left: 15%;
+}
+
+div.charSTATUS {
+ clear: right;
+ margin-top: 7%;
+ background: rgba(255,255,255,0.75);
+ width: 70%;
+}
+
diff --git a/2014OC/Bingo.rb b/2014OC/Bingo.rb
new file mode 100755
index 0000000..dfa4e37
--- /dev/null
+++ b/2014OC/Bingo.rb
@@ -0,0 +1,436 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+require 'sqlite3'
+require 'cgi'
+require 'date'
+require './sub.rb'
+require 'net/http'
+
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("sql/test.sq3")
+
+id = c.cookies["id"][0].to_i
+magic = c.cookies["magic"][0].to_i
+err = 0 # 不正な動きであれば負の値になる
+sidesize = 3
+message = "はりきって行きましょう!
" # ビンゴ用テキスト
+
+print("Content-type: text/html; charset=UTF-8 \n\n")
+
+getcom = ARGV[0]
+
+### DELETE TABLE ###
+
+del = 'DELETE FROM main WHERE id=?'
+if getcom == 'ududlrlrba'
+ db.execute(del, id)
+end
+
+######
+
+##### CHECKING UID #####
+
+sql = "SELECT stamp_status, stamp_img, name, job, sex, exp FROM main WHERE id=? AND magic=?"
+begin
+ user_data = db.execute(sql, id, magic)
+rescue
+ user_data = []
+end
+
+if user_data == [] # ログインエラー(-1)
+ err -= 1
+end
+
+### LOGIN ERROR HTML ###
+
+if err == -1
+ print'
+
+
+
ログインに失敗しました。
+
+アカウント登録ページへ接続中…
+* 3秒経っても移動しない場合はこちらから移動して下さい。
+
抽選は終了しましたが、引続きゆる☆スタをお楽しみ下さい!!
' +end + +# End of top +print' +%sおめでとうございます!☆ %d等 ☆が当選しました!!
", message, rank) +else + printf("%s
", message) +end + +## + +###### + +### CENTER ### +print' +![]() | \n", stamp_img[3*i+n], stamp_st[3*i+n])
+ else
+ print"\n" + end + end + print' |
入力してね
+ + + diff --git a/2014OC/accountcheck.rb b/2014OC/accountcheck.rb new file mode 100755 index 0000000..06b0e7e --- /dev/null +++ b/2014OC/accountcheck.rb @@ -0,0 +1,68 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +require 'sqlite3' +require 'cgi' +require './magic.rb' + +c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8") +db = SQLite3::Database.new("sql/test.sq3") + +begin + result = db.execute("select * from main;") + max = "select max(id) from main;" +rescue + db.execute("create table main(id INTEGER PRIMARY KEY AUTOINCREMENT,name,sex,age,aria,job,stamp_status,stamp_img,exp INTEGER,rank INTEGER,magic)"); + db.execute("insert into main(name,sex,age,aria,job,stamp_status,stamp_img,exp,rank,magic) values('名前','性別','年代','住所','職業','スタンプ状況','スタンプ画像','レベル','当選順位','本人確認用')"); + result = db.execute("select * from main;") + max = "select max(id) from main;" +end + +id = c.cookies["id"][0] +c_magic = c.cookies["magic"][0] +name = c["name"] +job = c["job"] +age = c["age"] +sex = c["sex"] +aria = c["aria"] + +begin +sel = 'select * from main where id=? AND magic=?' +h = db.execute(sel, id.to_i, c_magic.to_i) +rescue +h == [] +end + +if id != nil && h != [] +update = 'update main set name=?, job=?, age=?, sex=?, aria=? where id=? and magic=?' +mg = c_magic +db.execute(update, name, job, age, sex, aria, id.to_i, mg.to_i) +else +code = magic() +id = db.execute(max).flatten(2)[0].to_i + 1 +mg = code[id] +sql = "insert into main(name,sex,age,aria,job,stamp_status,stamp_img,exp,rank,magic) values (?,?,?,?,?,?,?,?,?,?);" +db.execute(sql,name,sex,age,aria,job,'000010000','n,n,n,n,kamo,n,n,n,n',0,0,mg); #初期値 +end + +expires = "Mon, 28 Jul 2014 23:00:00 GMT" + +printf("Content-type: text/html; charset=UTF-8 +Set-Cookie:id=%s ;expires=%s +Set-Cookie:magic=%s;expires=%s\n\n",id,expires,mg.to_s,expires) + +print' + + +登録が完了しました。
+あなたのIDは%04dです。抽選はこのIDを元に行われます
+下記リンクからスタンプラリーを開始して下さい!
+ + + +