changeset 2554:76439f2bb691

open
author ARAKI Tsuyohito <c113007@e.koeki-u.ac.jp>
date Fri, 24 Jul 2015 20:39:48 +0900
parents 19a10d778bc1
children fed28a15db67
files oasis2015/img/qr/q1.pdf oasis2015/img/qr/q1o.png oasis2015/img/qr/q2o.png oasis2015/img/qr/q3o.png oasis2015/img/qr/q4o.png oasis2015/img/qr/q5o.png oasis2015/img/qr/qro.pdf opencampus2015/#.htaccess# opencampus2015/.htaccess opencampus2015/accountcheck.rb opencampus2015/admin/.htaccess opencampus2015/admin/.htpasswd opencampus2015/admin/check.rb opencampus2015/cookie.rb opencampus2015/gets.rb opencampus2015/gohan.rb opencampus2015/img/boy1.png opencampus2015/img/boy1o.png opencampus2015/img/boy2.png opencampus2015/img/boy2o.png opencampus2015/img/boy3.png opencampus2015/img/boy3o.png opencampus2015/img/boy4.png opencampus2015/img/boy4o.png opencampus2015/img/boy5.png opencampus2015/img/boy5o.png opencampus2015/img/cabage.png opencampus2015/img/exp.png opencampus2015/img/expfront.png opencampus2015/img/fish.png opencampus2015/img/food.png opencampus2015/img/foot.png opencampus2015/img/foot2.png opencampus2015/img/gial1.png opencampus2015/img/gial1s.png opencampus2015/img/girl1.png opencampus2015/img/girl1o.png opencampus2015/img/girl2.png opencampus2015/img/girl2o.png opencampus2015/img/girl3.png opencampus2015/img/girl3o.png opencampus2015/img/girl4.png opencampus2015/img/girl4o.png opencampus2015/img/girl5.png opencampus2015/img/girl5o.png opencampus2015/img/head.png opencampus2015/img/head2.png opencampus2015/img/inu1.png opencampus2015/img/inu1o.png opencampus2015/img/inu2.png opencampus2015/img/inu2o.png opencampus2015/img/inu3.png opencampus2015/img/inu3o.png opencampus2015/img/inu4.png opencampus2015/img/inu4o.png opencampus2015/img/inu5.png opencampus2015/img/inu5o.png opencampus2015/img/kai.png opencampus2015/img/kamon1.png opencampus2015/img/kamon1o.png opencampus2015/img/kamon2.png opencampus2015/img/kamon2o.png opencampus2015/img/kamon3.png opencampus2015/img/kamon3o.png opencampus2015/img/kamon4.png opencampus2015/img/kamon4o.png opencampus2015/img/kamon5.png opencampus2015/img/kamon5o.png opencampus2015/img/kyabetsu.png opencampus2015/img/lvb.png opencampus2015/img/niku.png opencampus2015/img/ninnjinn.png opencampus2015/img/pan.png opencampus2015/img/room.png opencampus2015/img/ship.png opencampus2015/img/sisip1.png opencampus2015/img/sisip1o.png opencampus2015/img/sisip2.png opencampus2015/img/sisip2o.png opencampus2015/img/sisip3.png opencampus2015/img/sisip3o.png opencampus2015/img/sisip4.png opencampus2015/img/sisip4o.png opencampus2015/img/sisip5.png opencampus2015/img/sisip5o.png opencampus2015/img/snail.png opencampus2015/img/snake1.png opencampus2015/img/snake2.png opencampus2015/img/snake3.png opencampus2015/img/snake4.png opencampus2015/img/snake5.png opencampus2015/img/tamago.png opencampus2015/img/tsuya.png opencampus2015/index.html opencampus2015/prof.rb opencampus2015/profeel.css opencampus2015/smart.css
diffstat 97 files changed, 1404 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file oasis2015/img/qr/q1.pdf has changed
Binary file oasis2015/img/qr/q1o.png has changed
Binary file oasis2015/img/qr/q2o.png has changed
Binary file oasis2015/img/qr/q3o.png has changed
Binary file oasis2015/img/qr/q4o.png has changed
Binary file oasis2015/img/qr/q5o.png has changed
Binary file oasis2015/img/qr/qro.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/#.htaccess#	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,3 @@
+AddHandler cgi-script   .rb
+Options  +ExecCGI
+AddType "text/html; charset=utf-8" .html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/.htaccess	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,4 @@
+AddHandler cgi-script   .rb
+AddType	"text/html; charset=UTF-8" .rb
+AddType	"text/html; charset=UTF-8" .html
+Options +ExecCGI
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/accountcheck.rb	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,123 @@
+#!/usr/bin/env ruby22
+# -*- coding: utf-8 -*-
+
+require 'sqlite3'
+require 'kconv'
+require 'cgi'
+
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("sql/main.sq3")
+
+
+sql = "insert into test values(?, ?, ?, ?, ?, ?, ?, ?, ?)"
+
+toi = "insert into toi values (?, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"
+item = "insert into goods values (?, 0, 0, 0, 0, 0, 0)"
+
+name = c["name"]
+
+cle1 = "CREATE TABLE IF NOT EXISTS test(id, name, cal, age, sex, aria, exp, pt, lv)"
+cle2 = "CREATE TABLE IF NOT EXISTS toi(id, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10)"
+cle3 = "CREATE TABLE IF NOT EXISTS goods(id, g1, g2, g3, g4, g5, g6)"
+cle4 = "CREATE TABLE IF NOT EXISTS time(cd, now, id)"
+cle5 = "CREATE TABLE IF NOT EXISTS num(cd, id)"
+cle6 = "CREATE TABLE IF NOT EXISTS pass(id, pass, name)"
+
+ins4 = 'insert into time values(?, 61, "n")'
+ins5 = 'insert into num values("aa",0)'
+ins6 = 'insert into pass values(?, ?, ?)'
+num = "select id from num where cd = ?"
+numup = "update num set id = ? where cd = ?"
+
+db.execute(cle1)
+db.execute(cle2)
+db.execute(cle3)
+db.execute(cle4)
+db.execute(cle5)
+db.execute(cle6)
+if name == "createman789789789"
+db.execute(ins4, "a")
+db.execute(ins4, "b")
+db.execute(ins4, "c")
+db.execute(ins4, "d")
+db.execute(ins4, "e")
+db.execute(ins4, "f")
+db.execute(ins4, "g")
+db.execute(ins4, "h")
+db.execute(ins4, "i")
+db.execute(ins4, "j")
+db.execute(ins5)
+end
+
+name = c["name"]
+namae = "#{name}"
+cal = c["cal"]
+age = c["age"]
+sex = c["sex"]
+aria = c["aria"]
+
+id = c.cookies["id"][0]
+pass = c.cookies["pass"][0]
+
+if id == nil
+  number = db.execute(num, "aa")
+  id = number[0][0].to_i + 1
+  exp = 0
+  pt = 0
+  lv = 1
+  cd = "aa"
+  if pass == nil
+    pass = id
+  end
+  db.execute(ins6, id, pass, name)
+  db.execute(sql, id, name, cal, age, sex, aria, exp, pt, lv)
+  db.execute(toi, id)
+  db.execute(item, id)
+  db.execute(numup, id, cd)
+end
+#  srand(id.to_i)  
+#  id2 = rand(1000000)
+id2 = pass
+
+
+
+expires = "SAT, 24 Oct 2015 00:00:00 GMT"
+
+printf("Content-type: text/html; charset=UTF-8
+Set-Cookie:id=%s ;expires=%s
+Set-Cookie:pass=%s ;expires=%s\n\n", id, expires, id2, expires)
+
+printf(<<_EOS_, name, id.to_i)
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+
+<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)" href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css" type="text/css" rel="stylesheet" />
+
+
+
+
+<link rel="shortcut icon" href="./img/cabage.png"/>
+<title>Registering Account</title>
+
+</head>
+<body>
+<h1>ほげほげ</h1>
+<h2>登録が完了しました!</h2>
+<p>ようこそ_ %s _さん!</p>
+<p>あなたのIDは%04dです!</p>
+<div class="f1"><a href="prof.rb"><div class="lets"><span>始めよう!</span></div></a></div>
+<form method="POST" type="text">
+</form>
+</body></html>
+_EOS_
+
+
+if name == "createman987987987"
+  `rm sql/main.sq3`
+#  `touch sql/main.sq3`
+#  `chmod a+w sql/main.sq3`
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/admin/.htaccess	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,10 @@
+AddHandler cgi-script   .rb
+AddType "text/html; charset=utf-8" .rb
+AddType "text/html; charset=utf-8" .html
+Options +ExecCGI
+#AuthUserFile /home/www/skip/opencampus2015/admin/.htpasswd #for_skip
+AuthUserFile /home/irhome/c113/c113007/public_html/web/opencampus2015/admin/.htpasswd
+AuthGroupFile /dev/null
+AuthName "splatoon! piyopiyogirl"
+AuthType Basic
+require valid-user
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/admin/.htpasswd	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,1 @@
+c113007:QRf28ARYqd/FY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/admin/check.rb	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,151 @@
+#!/usr/bin/env ruby22
+# -*- coding: utf-8 -*-
+require 'cgi'
+require 'sqlite3'
+require 'kconv'
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("../sql/main.sq3")
+
+getAC1 = ARGV[0]
+pass = "hogehogeboy"
+
+hsh = c["SQ1"]
+hsh += c["SQ2"]
+
+pts = "<table><tr><th>id</th><td>name</td><td>cal</td><td>age</td><td>sex</td><td>aria</td><td>exp</td><td>pt</td><td>lv</td></tr>"
+
+
+if c["SQ2"] == "toi"
+pts = "<table><tr><th>id</th><td>q1</td><td>q2</td><td>q3</td><td>q4</td><td>q5</td><td>q6</td><td>q7</td><td>q8</td><td>q9</td><td>secret</td></tr>"
+elsif c["SQ2"] == "time"
+pts = "<table><tr><th>cd</th><td>now</td><td>id</td></tr>"
+elsif c["SQ2"] == "goods"
+pts = "<table><tr><th>id</th><td>おちゃ</td><td>しょうひん2</td><td>しょうひん3</td><td>しょうひん4</td><td>しょうひん5</td><td>しょうひん6</td></tr>"
+elsif c["SQ2"] == "pass"
+pts = "<table><tr><th>id</th><td>pass</td><td>name</td></tr>"
+
+end
+
+
+######################################
+################SQ3###################
+if c["SQ3"] == ""
+else
+upd = c["SQ3"]
+db.execute(upd)
+end
+
+################SQ3###################
+######################################
+
+
+
+
+################################
+################################
+if hsh == ""
+#  pts = "hoge"
+  hsh = "select * from test"
+else
+end
+
+hsh2 = db.execute(hsh)
+i = 0
+while i < hsh2.length
+  data = hsh2[i]
+  if c["SQ2"] == "toi"
+    pts += "<tr><th>#{data[0]}</th><td>#{data[1]}</td><td>#{data[2]}</td><td>#{data[3]}</td><td>#{data[4]}</td><td>#{data[5]}</td><td>#{data[6]}</td><td>#{data[7]}</td><td>#{data[8]}</td><td>#{data[9]}</td><td>#{data[10]}</td></tr>" 
+  elsif c["SQ2"] == "time"
+    pts += "<tr><th>#{data[0]}</th><td>#{data[1]}</td><td>#{data[2]}</td></tr>"
+  elsif c["SQ2"] == "goods"
+    pts += "<tr><th>#{data[0]}</th><td>#{data[1]}</td><td>#{data[2]}</td><td>#{data[3]}</td><td>#{data[4]}</td><td>#{data[5]}</td><td>#{data[6]}</td></tr>"
+  else
+    pts += "<tr><th>#{data[0]}</th><td>#{data[1]}</td><td>#{data[2]}</td><td>#{data[3]}</td><td>#{data[4]}</td><td>#{data[5]}</td><td>#{data[6]}</td><td>#{data[7]}</td><td>#{data[8]}</td><td>#{data[9]}</td></tr>" 
+  end
+  i += 1
+end
+#end
+pts += "</table>"
+
+
+print"Content-type: text/html; charset=UTF-8\n\n"
+
+
+######################################
+################if ~html##############
+
+#if getAC1 == pass
+
+printf(<<_EOS_, pts)
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+
+<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="../smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="../profeel.css"
+type="text/css" rel="stylesheet" />
+
+<link rel="shortcut icon" href="../img/tamago.png"/>
+
+<title>control</title>
+<style type="text/css">
+<!--
+-->
+</style>
+</head>
+
+<body>
+<header><p>test,toi,goods,time,num,pass<p></header>
+
+
+
+<h1>control</h1>
+<form method="POST" action="check.rb?">
+<input type="text" name="SQ1" value="select * from ">
+<input type="text" name="SQ2" placeholder='test JOIN pass ON test.id==pass.id;' value="test">
+<input type="submit">
+</form>
+
+<form method="POST" action="check.rb?#{pass}">
+<input type="text" name="SQ3" size="42" placeholder='insert into test values(501, "foo", "inu", 40, "G", "sakata", 0,0,1)' value="update test set pt = 0 where id = 0">
+<input type="submit">
+</form>
+<p>%s<br></p>
+
+
+<address>skip&#x40;xxxx.co.jp</address>
+<footer></footer>
+</body>
+</html>
+
+_EOS_
+#############################################
+#############################################
+#else
+if getAC1 == "hoge"    ###いらない行。accをつける前は"else"のみだった。
+printf(<<_EOS_)
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="../smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="../profeel.css"
+type="text/css" rel="stylesheet" />
+<link rel="shortcut icon" href="./img/tamago.png"/>
+<title>さかたっち(go top!)</title>
+<style type="text/css">
+</style></head>
+<body><header></header>
+<h1>さかたっち</h1>
+<a href="../index.html">トップへ!</a>
+<address>skip&#x40;xxxx.co.jp</address>
+<footer></footer></body>
+</html>
+_EOS_
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/cookie.rb	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,35 @@
+#!/usr/bin/env ruby22
+# -*- coding: utf-8 -*-
+
+require 'sqlite3'
+require 'kconv'
+require 'cgi'
+
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("sql/main.sq3")
+
+id = c.cookies["id"][0]
+id = nil
+expires = Time.now + 1
+if id == nil
+end 
+
+
+printf("Content-type: text/html; charset=UTF-8
+Set-Cookie:id=%s ;expires=%s\n\n", id, expires)
+
+printf(<<_EOS_)
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>
+<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)" href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css" type="text/css" rel="stylesheet" />
+<link rel="shortcut icon" href="./img/cabage.png"/>
+<title>Registering Account</title>
+</head>
+<body>
+<h1>さかたっち</h1>
+<h2>cookieを削除しました!</h2>
+<a href="index.html">とうろくがめんへ!</a>
+</body></html>
+_EOS_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/gets.rb	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,170 @@
+#!/usr/bin/env ruby22
+# -*- coding:utf-8 -*-
+
+require 'sqlite3'
+require 'cgi'
+
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("sql/main.sq3")
+
+id = c.cookies["id"][0]
+person = id.to_i
+
+data = "select * from test where id = ?"
+cook = db.execute(data, person)
+upd = "update test set pt = ? where id = ?"
+goods = "update goods set g1 = ?, g2 = ?, g3 = ?, g4 = ?, g5 = ?, g6 = ? where id = ?"
+
+
+name = cook[0][1]
+pt = cook[0][7]
+lv = cook[0][8]
+
+ticket = "select * from goods where id = ?"
+have = db.execute(ticket, person)
+g1 = have[0][1]
+g2 = have[0][2]
+g3 = have[0][3]
+g4 = have[0][4]
+g5 = have[0][5]
+g6 = have[0][6]
+
+gets = c["sho"]
+n1 = "おかし"      #商品それぞれの名前
+c1 = 3         #商品それぞれに対して消費するポイント
+n2 = "ジュース"
+c2 = 10
+n3 = "入学権"
+c3 = 30000000
+n4 = ""
+c4 = 2
+c5 = ""
+c5 = 5
+c6 = ""
+c6 = 100
+
+
+h1 = "チケットを発行したよ!<br>さかたっちスタッフの人と商品をこうかんしてね!"
+if lv < 3
+  h1 = "チケット発行できません!"
+  kekka = "レベル が たりないよ!"
+elsif gets == "s1" && pt >= c1
+  g1 += 1
+  pt -= c1
+  kekka = "#{n1}交換券をゲット!"
+elsif gets == "s2" && pt >= c2
+  g2 += 1
+  pt -= c2
+  kekka = "#{n2}交換券をゲット!"
+elsif gets == "s3" && pt >= c3
+  g3 += 1
+  pt -= c3
+  kekka = "#{n3}交換券をゲット!"
+elsif gets == "s4" && pt >= c4
+  g4 += 1
+  pt -= c4
+  kekka = "あめ交換券をゲット!"
+elsif gets == "s5" && pt >= c5
+  g5 += 1
+  pt -= c5
+  kekka = "10円金券をゲット!"
+elsif gets == "s6" && pt >= c6
+  g6 += 1
+  pt -= c6
+  kekka = "まぐろ交換券をゲット!"
+else
+  h1 = "チケット発行できません!!"
+  kekka = "ポイントとかたりません!"
+end
+
+trade = c["trade"]
+if trade == n1 && g1 > 0
+  g1 -= 1
+  kekka = "#{n1} と交換します!<br>スタッフの人は、スタッフがボタンを押した場合のみ、交換してください!"
+  h1 = "#{n1}と交換します!<br>こぼさないで たべてね!"
+elsif trade == n2 && g2 > 0
+  g2 -= 1
+  kekka = "#{n2} と交換します!<br>スタッフの人は、スタッフがボタンを押した場合のみ、年齢を確認してから交換してください!"
+  h1 = "#{n2} と交換します!<br>ひやしてから おうち で のんでね!"
+elsif trade == n3 && g3 > 0
+g3 -= 1
+kekka = "#{n3} と交換します!<br>スタッフの人は、スタッフがボタンを押した場合のみ、交換してください!"
+  h1 = "#{n3}と交換します!"
+elsif trade == n4 && g4 > 0
+g4 -= 1
+kekka = "あめ と交換します!<br>スタッフの人は、スタッフがボタンを押した場合のみ、交換してください!"
+h1 = "あめと交換します!"
+elsif trade == "10えん金券" && g5 > 0
+g5 -= 1
+kekka = " 10えん と交換します!<br>スタッフの人は、スタッフがボタンを押した場合のみ、交換してください!"
+h1 = "10えんと交換します!"
+elsif trade == "まぐろ" && g6 > 0
+g6 -= 1
+kekka = "まぐろ と交換します!<br>スタッフの人は、スタッフがボタンを押した場合のみ、交換してください!"
+h1 = "まぐろと交換します!"
+end
+
+
+
+
+
+db.execute(goods, g1, g2, g3, g4, g5, g6, person)
+db.execute(upd, pt, person)
+
+
+pre = "%"
+printf(<<_EOS_, h1, name, pt, kekka, g1, g2, g3, g4)
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+
+<meta name="viewport"
+content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css"
+type="text/css" rel="stylesheet" />
+
+<link rel="shortcut icon" href="./img/tsuya.png"/>
+<title>こうかん!</title>
+<style type="text/css">
+<!--
+-->
+</style>
+
+</head>
+
+<body>
+<header></header>
+<h1>さかたっち</h1>
+<h2>%s</h2>
+<p>
+%sさん<br>
+さかたポイント:%dp<br>
+%s
+</p>
+<table>
+<title>もっているチケット</title>
+<tr><td>おかし</td><td>:%d</td></tr>
+<tr><td>ジュース</td><td>:%d</td></tr>
+<tr><td>入学権</td><td>:%d</td></tr>
+<tr><td>secret</td><td></td></tr>
+<tr><td></td><td></td></tr>
+</table>
+<br><br>
+<div class="f1"><a href="prof.rb"><div class="lets"><span>もどる!</span></div></a></div>
+<br><br>
+<form method="POST" action="gets.rb">
+<input type="text" name="trade" placeholder="ここは スタッフ の 人 が つかうよ!">
+<input type="submit" value="スタッフ ぼたん"><br>スタッフじゃない人はおさないでね!
+</form>
+
+<footer></footer>
+</body>
+</html>
+
+
+_EOS_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/gohan.rb	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,225 @@
+#!/usr/bin/env ruby22
+# -*- coding: utf-8 -*-
+require 'cgi'
+require 'sqlite3'
+require 'kconv'
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("sql/main.sq3")
+
+id = c.cookies["id"][0]
+person = id.to_i
+
+data = "select * from test where id = ?"
+   #idが?(後で代入)のデータをtest票から探す。という命令をdataにしくむ。全てがほしい場合は「*」。「*」を「name」に変えると該当データのnameだけとりだす。
+
+cook = db.execute(data, person)
+   #dataに仕組んでいた命令を、personを代入しつつ実行。
+
+upd = "update test set exp = ?, pt = ? where id = ?"
+   #「idが?3のとき、expを?1にする。ptを?2にする。」という命令文。
+lvupd = "update test set lv = ? where id = ?"
+
+que = "select q10 from toi where id = ?"
+queupd = "update toi set q10 = 1 where id = ?"
+q10 = db.execute(que, person)
+
+  name = cook[0][1]
+  cal = cook[0][2]
+  exp = cook[0][6]
+  pt = cook[0][7]
+  lv = cook[0][8]
+  per = "%"
+#####################################
+##########秘密のこたえを設定##############
+if cal == "inu"
+m3 = "あゆ"
+elsif cal == "sisip"
+m3 = "ゆめ"
+elsif cal == "kamon"
+m3 = "ねぎ"
+elsif cal == "boy"
+m3 = "ふね"
+elsif cal == "girl"
+m3 = "かんざし"
+else
+m3 = "skipskip"
+end
+#####################################
+#####################################
+
+
+gohan = c["gohan"]
+#himitu = ""
+if gohan == "g1" && pt >= 2
+  exp += 2
+  pt -= 2
+  db.execute(upd, exp, pt, person)  
+  kekka = "#{cal}が成長した!"
+elsif gohan == "g2" && pt >= 5
+  exp += 6
+  pt -= 5
+  db.execute(upd, exp, pt, person)
+  kekka = "#{cal}がすごく成長した!"
+elsif gohan == m3
+  if q10[0][0] == 0
+    exp += 10
+    db.execute(upd, exp, pt, person)  
+    kekka = ""
+    db.execute(queupd, person)
+  else
+    kekka ="しつもん に こたえられるのは いっかい だけだよ!"
+  end
+else
+  kekka = "ポイント が たりない!"
+end
+
+if gohan == m3
+elsif gohan == "g1"
+elsif gohan == "g2"
+else
+kekka = "こたえ が ちがうよ!"
+end
+
+
+if exp >= lv*10 && lv < 5
+  lv += 1
+  db.execute(lvupd, lv, person)
+  kekka += "<br>レベルが上がった!<br>レベルが#{lv}になった!"
+end
+
+
+if cal == "inu"
+  image = "./img/inu#{lv}.png"
+  alt = "inu#{lv}"
+elsif cal == "sisip"
+  image = "./img/sisip#{lv}.png"
+  alt = "sisip#{lv}"
+elsif cal == "kamon"
+  image = "./img/kamon#{lv}.png"
+  alt = "kamon#{lv}"
+elsif cal == "boy"
+  image = "./img/boy#{lv}.png"
+  alt = "boy#{lv}"
+elsif cal == "girl"
+  image = "./img/girl#{lv}.png"
+  alt = "girl#{lv}"
+elsif cal == "snake"
+  image = "./img/snake#{lv}.png"
+  alt = "snake#{lv}"
+else
+  image = "./img/snail.png"
+end
+
+if lv == 1
+  color = "black"
+elsif lv == 2
+  color = "navy"
+elsif lv == 3
+  color = "green"
+elsif lv == 4
+  color = "red"
+elsif lv == 5
+  color = "yellow"
+else
+  color = "pink"
+  image = "./img/snail.png"
+  alt = "snails_bug"
+end
+
+gage = 0
+exp2 = exp
+if lv < 5
+  while exp2 >= 10
+    exp2 -= 10
+  end
+  gage = 100-exp2*10
+end
+
+
+
+modoru = '<br><div class="f1"><a href="prof.rb"><div class="lets"><span>ホーム'
+back = modoru
+if lv < 5 && gohan == "g1" || lv < 5 && gohan == "g2"
+  mo = '<input type="button" value="おかわり!" onclick="location.reload();" />'
+  back = mo + modoru
+elsif lv >= 5
+  back += "<br>(レベルマックスだよ!)"
+end
+back += '</span></div></a></div>'
+
+cook = db.execute(data, person)
+exp = cook[0][6]
+pt = cook[0][7]
+lv = cook[0][8]
+  
+
+printf(<<_EOS_, per, gage, per, per, per, color, image, alt, name, person, cal, lv, pt, kekka, back)
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+
+<meta name="viewport"
+content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css"
+type="text/css" rel="stylesheet" />
+
+<link rel="shortcut icon" href="./img/exp.png"/>
+<title>ごはぁん!</title>
+<style type="text/css">
+<!--
+p.gage{
+background:#adf;
+margin-left:0%s;
+margin-right:%d%s;
+text-align:left;
+border-radius: 10ex;
+}
+div.gage{
+background:#ddf;
+margin-left:20%s;
+margin-right:20%s;
+border-radius: 10ex;
+}
+
+div.cal div{float:left; border:solid %s;}
+
+-->
+</style>
+</head>
+
+<body>
+<header></header>
+<h1>ほげほげ!</h1>
+
+<div class="cal">
+<div>
+<img src=%s alt=%s width="172" height="172">
+</div>
+<table class="state"><tr><td>name</td><td>:%s</td></tr>
+<tr><td>id</td><td>:%04d</td></tr>
+<tr><td>cara</td><td>:%s</td></tr>
+<tr><td>lv.</td><td>%d</td></tr>
+</table>
+</div>
+
+<div class="gage">
+<p class="gage">exp</p>
+</div>
+
+<p>
+
+こうえきポイント:%dp<br>
+%s
+</p>
+
+%s
+<footer></footer>
+</body>
+</html>
+
+_EOS_
Binary file opencampus2015/img/boy1.png has changed
Binary file opencampus2015/img/boy1o.png has changed
Binary file opencampus2015/img/boy2.png has changed
Binary file opencampus2015/img/boy2o.png has changed
Binary file opencampus2015/img/boy3.png has changed
Binary file opencampus2015/img/boy3o.png has changed
Binary file opencampus2015/img/boy4.png has changed
Binary file opencampus2015/img/boy4o.png has changed
Binary file opencampus2015/img/boy5.png has changed
Binary file opencampus2015/img/boy5o.png has changed
Binary file opencampus2015/img/cabage.png has changed
Binary file opencampus2015/img/exp.png has changed
Binary file opencampus2015/img/expfront.png has changed
Binary file opencampus2015/img/fish.png has changed
Binary file opencampus2015/img/food.png has changed
Binary file opencampus2015/img/foot.png has changed
Binary file opencampus2015/img/foot2.png has changed
Binary file opencampus2015/img/gial1.png has changed
Binary file opencampus2015/img/gial1s.png has changed
Binary file opencampus2015/img/girl1.png has changed
Binary file opencampus2015/img/girl1o.png has changed
Binary file opencampus2015/img/girl2.png has changed
Binary file opencampus2015/img/girl2o.png has changed
Binary file opencampus2015/img/girl3.png has changed
Binary file opencampus2015/img/girl3o.png has changed
Binary file opencampus2015/img/girl4.png has changed
Binary file opencampus2015/img/girl4o.png has changed
Binary file opencampus2015/img/girl5.png has changed
Binary file opencampus2015/img/girl5o.png has changed
Binary file opencampus2015/img/head.png has changed
Binary file opencampus2015/img/head2.png has changed
Binary file opencampus2015/img/inu1.png has changed
Binary file opencampus2015/img/inu1o.png has changed
Binary file opencampus2015/img/inu2.png has changed
Binary file opencampus2015/img/inu2o.png has changed
Binary file opencampus2015/img/inu3.png has changed
Binary file opencampus2015/img/inu3o.png has changed
Binary file opencampus2015/img/inu4.png has changed
Binary file opencampus2015/img/inu4o.png has changed
Binary file opencampus2015/img/inu5.png has changed
Binary file opencampus2015/img/inu5o.png has changed
Binary file opencampus2015/img/kai.png has changed
Binary file opencampus2015/img/kamon1.png has changed
Binary file opencampus2015/img/kamon1o.png has changed
Binary file opencampus2015/img/kamon2.png has changed
Binary file opencampus2015/img/kamon2o.png has changed
Binary file opencampus2015/img/kamon3.png has changed
Binary file opencampus2015/img/kamon3o.png has changed
Binary file opencampus2015/img/kamon4.png has changed
Binary file opencampus2015/img/kamon4o.png has changed
Binary file opencampus2015/img/kamon5.png has changed
Binary file opencampus2015/img/kamon5o.png has changed
Binary file opencampus2015/img/kyabetsu.png has changed
Binary file opencampus2015/img/lvb.png has changed
Binary file opencampus2015/img/niku.png has changed
Binary file opencampus2015/img/ninnjinn.png has changed
Binary file opencampus2015/img/pan.png has changed
Binary file opencampus2015/img/room.png has changed
Binary file opencampus2015/img/ship.png has changed
Binary file opencampus2015/img/sisip1.png has changed
Binary file opencampus2015/img/sisip1o.png has changed
Binary file opencampus2015/img/sisip2.png has changed
Binary file opencampus2015/img/sisip2o.png has changed
Binary file opencampus2015/img/sisip3.png has changed
Binary file opencampus2015/img/sisip3o.png has changed
Binary file opencampus2015/img/sisip4.png has changed
Binary file opencampus2015/img/sisip4o.png has changed
Binary file opencampus2015/img/sisip5.png has changed
Binary file opencampus2015/img/sisip5o.png has changed
Binary file opencampus2015/img/snail.png has changed
Binary file opencampus2015/img/snake1.png has changed
Binary file opencampus2015/img/snake2.png has changed
Binary file opencampus2015/img/snake3.png has changed
Binary file opencampus2015/img/snake4.png has changed
Binary file opencampus2015/img/snake5.png has changed
Binary file opencampus2015/img/tamago.png has changed
Binary file opencampus2015/img/tsuya.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/index.html	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+
+<meta name="viewport"
+content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css"
+type="text/css" rel="stylesheet" />
+
+
+<link rel="shortcut icon" href="./img/cabage.png"/>
+<title>opencampus2015-7</title>
+
+</head>
+
+<body>
+<h1>ほげほげ!</h1><h2>~公益大に入学しよう~</h2>
+<p>キャラクターを登録しよう!</p>
+
+<form method="POST" action="./accountcheck.rb">
+<table>
+<tr><td>名前</td><td><input name="name" type="text" size="15"  placeholder="名前"></td></tr>
+<tr><td>性別</td><td><select name="sex">
+         <option value="B">男
+         <option value="G">女
+         </select></td></tr>
+<tr><td>年代</td><td><select name="age">
+         <option>10代以下
+         <option>10代
+         <option>20代
+         <option>30代
+         <option>40代
+         <option>50代
+         <option>60代以上
+        </select></td></tr>
+<tr><td>出身地</td><td><select name="aria">
+         <option>酒田市内
+         <option>山形県内 
+         <option>県外 
+         </select></td></tr>
+<tr><td>キャラ</td><td><select name="cal">
+           <option value="snake">へび
+	   <option value="inu">いぬ
+           <option value="sisip">シシップ
+           <option value="kamon">カモン
+           <option value="boy">男の子
+           <option value="girl">女の子
+        </select></td></tr>
+<tr><td></td><td><input type="submit" value="登録する!"></td></tr>
+</table>
+</form>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/prof.rb	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,479 @@
+#!/usr/bin/env ruby22
+# -*- coding: utf-8 -*-
+require 'cgi'
+require 'sqlite3'
+require 'kconv'
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+db = SQLite3::Database.new("./sql/main.sq3")
+
+id = c.cookies["id"][0]
+person = id.to_i
+
+data = "select * from test where id = ?"
+data2 = "select * from test where id = ?"
+#idが?(後で代入)のデータをtest票から探す。という命令をdataにしくむ。全てがほしい場合は「*」。「*」を「name」に変えると該当データのnameだけとりだす。
+cook = db.execute(data, person)               #dataに仕組んでいた命令を、personを代入しつつ実行。
+cook2 = db.execute(data2, person)
+jikan1 = "select * from time where cd = ?"
+timeupd = "update time set now = ?, id = ? where cd = ?"
+
+que = "select * from toi where id = ?"
+queupd = "update toi set q1 = ?, q2 = ?, q3 = ?, q4 = ?, q5 = ? where id = ?"
+toi = db.execute(que, person)
+
+bomd = "update test set pt = ? where id = ?"
+ins4 = 'insert into time values(?, 61, "n")'
+printf("Content-type: text/html; charset=UTF-8\n\n")
+
+begin
+name = cook[0][1]
+cal = cook[0][2]
+age = cook[0][3]
+sex = cook[0][4]
+aria = cook[0][5]
+exp = cook[0][6]
+pt = cook[0][7]
+lv = cook[0][8]
+rescue
+printf(<<_EOS_)
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<meta name="viewport"
+content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css"
+type="text/css" rel="stylesheet" />
+<link rel="shortcut icon" href="./img/cabage.png"/>
+<title>ほげほげ</title>
+<style type="text/css">
+<!--
+-->
+</style>
+</head>
+
+<body>
+<header></header>
+<h1>データがみつかりません!</h1><h2>クッキーを消してやりなおしてください!</h2>
+<div class="f1"><a href="index.html"><div class="lets"><span>とうろく画面へ!</span></div></a></div>
+<div class="f1"><a href="cookie.rb"><div class="lets"><span>くっきーをけす!</span></div></a></div>
+<address>skip&#x40;xxxx.co.jp</address>
+<footer></footer>
+</body>
+</html>
+
+_EOS_
+exit(0)            ##プログラム終了! これがないと以降のプログラムが動いてしまう。
+end
+
+
+
+q1 = toi[0][1]
+q2 = toi[0][2]
+q3 = toi[0][3]
+q4 = toi[0][4]
+q5 = toi[0][5]
+
+per ="%"
+
+##################--ptを獲得するための乱数生成--#############
+##################----#############################
+
+def qrc()
+  srand(4567845678)
+  x = rand(10000000)
+  srand(x)
+  qrnumber = Hash.new("n")
+  qrarr = ["a", "b", "c", "d", "e"]
+  qrarr.length.times do |i|
+    qrnumber[rand(100000000)] = qrarr[i]
+  end
+  return qrnumber
+end
+
+##################ptを獲得した際の反応。####################
+#########前の人が書き込んだ時間と比べて60秒以内なら追加ポイント####
+kpt = 0
+bom = c["bom"]                        ####<form ~~ name="bom">より
+
+begin
+  jikan2 = db.execute(jikan1, "j")
+  now1 = jikan2[0][1]
+rescue
+  db.execute(ins4, "a")
+  db.execute(ins4, "b")
+  db.execute(ins4, "c")
+  db.execute(ins4, "d")
+  db.execute(ins4, "e")
+  db.execute(ins4, "f")
+  db.execute(ins4, "g")
+  db.execute(ins4, "h")
+  db.execute(ins4, "i")
+  db.execute(ins4, "j")
+end
+
+if bom == "please skip here"
+  jikan2 = db.execute(jikan1, "j")
+  now1 = jikan2[0][1]
+  nowper = jikan2[0][2]
+  now2 = Time.now.to_i
+  db.execute(timeupd, now2, person, "j")
+  if person == nowper
+  elsif now1 == nil
+  elsif now2-now1 < 2                 ####2秒以内なら~
+    pt += 50
+    kpt += 50
+  end
+  pt += 1
+  kpt += 1
+  #  db.execute(bomd, pt, person)
+end
+
+qrAC = qrc            ###生成したハッシュには、"乱数"=>"記号"が入っている
+getAC = ARGV[0].to_i  ###URL?以降の文字(特定の乱数)を取得してgetACに代入
+qr = qrAC[getAC]      ###特定の"乱数"が一致すると、"乱数"=>"記号"がqrに正しく入力される。
+if qr =="a" && q1 == 0
+  q1 += 1
+  jikan2 = db.execute(jikan1, "a")
+  now1 = jikan2[0][1]
+  nowper = jikan2[0][2]
+  now2 = Time.now.to_i
+  db.execute(timeupd, now2, person, "a")
+  if person == nowper
+  elsif now1 == nil
+  elsif now2-now1 < 40
+    pt += 5
+    kpt += 5
+  end
+  pt += 7
+  kpt += 7
+elsif qr == "b" && q2 == 0
+  q2 += 1
+  jikan2 = db.execute(jikan1, "b")
+  now1 = jikan2[0][1]
+  nowper = jikan2[0][2]
+  now2 = Time.now.to_i
+  db.execute(timeupd, now2, person, "b")
+  if person == nowper
+  elsif now1 == nil
+  elsif now2-now1 < 20
+    pt += 2
+    kpt += 2
+  end
+  pt += 12
+  kpt += 12
+elsif qr == "c" && q3 == 0
+  q3 += 1
+  jikan2 = db.execute(jikan1, "c")
+  now1 = jikan2[0][1]
+  nowper = jikan2[0][2]
+  now2 = Time.now.to_i
+  db.execute(timeupd, now2, person, "c")
+  if person == nowper
+  elsif now1 == nil
+  elsif now2-now1 < 25
+    pt += 10
+    kpt += 10
+  end
+  pt += 3
+  kpt += 3
+elsif qr == "d" && q4 == 0
+  q4 += 1
+  jikan2 = db.execute(jikan1, "d")
+  now1 = jikan2[0][1]
+  nowper = jikan2[0][2]
+  now2 = Time.now.to_i
+  db.execute(timeupd, now2, person, "d")
+  if person == nowper
+  elsif now1 == nil
+  elsif now2-now1 < 60
+    pt += 2
+    kpt += 2
+  end
+  pt += 15
+  kpt += 15
+elsif qr == "e" && q5 == 0
+  q5 += 1
+  jikan2 = db.execute(jikan1, "e")
+  now1 = jikan2[0][1]
+  nowper = jikan2[0][2]
+  now2 = Time.now.to_i
+  db.execute(timeupd, now2, person, "e")
+  if person == nowper
+  elsif now1 == nil
+  elsif now2-now1 < 50
+    pt += 4
+    kpt += 4
+  end
+  pt += 10
+  kpt += 10
+end
+
+
+db.execute(bomd, pt, person)
+db.execute(queupd, q1, q2, q3, q4, q5, person)
+
+kkget = ""
+if kpt > 0
+  kkget = "#{kpt}ポイントゲット!!"
+end
+
+
+
+########################~ここまでpt処理~###################
+#######################################################
+
+if cal == "inu"
+  image = "./img/inu#{lv}.png"
+  alt = "inu#{lv}"
+  m1 = "ドッグフード"
+  mimg1 = "./img/food.png"
+  m2 = "にく"
+  mimg2 = "./img/niku.png"
+elsif cal == "sisip"
+  image = "./img/sisip#{lv}.png"
+  alt = "sisip#{lv}"
+  m1 = "ぱん"
+  mimg1 = "./img/pan.png"
+  m2 = "きゃべつ"
+  mimg2 = "./img/kyabetsu.png"
+elsif cal == "kamon"
+  image = "./img/kamon#{lv}.png"
+  alt = "kamon#{lv}"
+  m1 = "かい"
+  mimg1 = "./img/kai.png"
+  m2 = "とびうお"
+  mimg2 = "./img/fish.png"
+elsif cal == "boy"
+  image = "./img/boy#{lv}.png"
+  alt = "boy#{lv}"
+  m1 = "いか"
+  mimg1 = "./img/ship.png"
+  m2 = "つやひめ"
+  mimg2 = "./img/tsuya.png"
+elsif cal == "girl"
+  image = "./img/girl#{lv}.png"
+  alt = "girl#{lv}"
+  m1 = "さくらんぼ"
+  mimg1 = "./img/room.png"
+  m2 = "つやひめ"
+  mimg2 = "./img/tsuya.png"
+elsif cal == "snake"
+  image = "./img/snake#{lv}.png"
+  alt = "snake#{lv}"
+  m1 = "かえる"
+  mimg1 = "./img/exp.png"
+  m2 = "ねずみ"
+  mimg2 = "./img/exp.png"
+else
+  image = "./img/snail.png"
+  m1 = "たまごのから"
+  mimg1 = "./img/tamago.png"
+  m2 = "きゃべつ"
+  mimg2 = "./img/cabage.png"
+end
+
+
+
+if lv == 1
+  color = "black"
+elsif lv == 2
+  color = "navy"
+elsif lv == 3
+  color = "green"
+elsif lv == 4
+  color = "red"
+elsif lv == 5
+  color = "yellow"
+else
+  color = "pink"
+  image = "./img/snail.png"
+  alt = "snails_bug"
+end
+#expが10あがる毎にlvが1あがる。
+#expの1の位*10で、次のレベルアップに必要な経験値の割合が出る。
+#(exp=12の場合、2*10=『20%』、次のレベルアップまであと80%が必要、と分かる。)
+#(exp=35の場合、5*10=『50%』、次のレベルアップまであと50%が必要、と分かる。)
+gage = 0
+exp2 = exp
+esa = "<br><br><br>"
+if lv < 5
+  while exp2 >= 10
+    exp2 -= 10
+  end
+  gage = 100-exp2*10
+  esa ='<input type="reset" value="とりけし">
+<input type="submit" value="こうかんする!"><br>
+<input type="text" name="gohan" placeholder="ひみつ の こたえ を いれてね!">:0pt'
+end
+
+
+
+
+########################
+###lv==5のとき画像を変える###
+comm = ""
+if ARGV[0] == "commandbomd"
+comm += '<form method="POST" action="prof.rb?commandbomd">
+<input type="text" name="bom" size="8">
+<input type="submit">
+</form>'
+elsif lv == 5
+comm += '<form method="POST" action="prof.rb">
+<input type="text" name="bom" size="8">
+<input type="submit">
+</form>'
+end
+
+if bom == "inu1"
+image = "./img/inu1.png"
+elsif bom == "inu2"
+image = "./img/inu2.png"
+elsif bom == "inu3"
+image = "./img/inu3.png"
+elsif bom == "inu4"
+image = "./img/inu4.png"
+elsif bom == "inu5"
+image = "./img/inu5.png"
+
+elsif bom == "sisip1"
+image = "./img/sisip1.png"
+elsif bom == "sisip2"
+image = "./img/sisip2.png"
+elsif bom == "sisip3"
+image = "./img/sisip3.png"
+elsif bom == "sisip4"
+image = "./img/sisip4.png"
+elsif bom == "sisip5"
+image = "./img/sisip5.png"
+
+elsif bom == "kamon1"
+image = "./img/kamon1.png"
+elsif bom == "kamon2"
+image = "./img/kamon2.png"
+elsif bom == "kamon3"
+image = "./img/kamon3.png"
+elsif bom == "kamon4"
+image = "./img/kamon4.png"
+elsif bom == "kamon5"
+image = "./img/kamon5.png"
+
+elsif bom == "boy1"
+image = "./img/boy1.png"
+elsif bom == "boy2"
+image = "./img/boy2.png"
+elsif bom == "boy3"
+image = "./img/boy3.png"
+elsif bom == "boy4"
+image = "./img/boy4.png"
+elsif bom == "boy5"
+image = "./img/boy5.png"
+
+elsif bom == "girl1"
+image = "./img/girl1.png"
+elsif bom == "girl2"
+image = "./img/girl2.png"
+elsif bom == "girl3"
+image = "./img/girl3.png"
+elsif bom == "girl4"
+image = "./img/girl4.png"
+elsif bom == "girl5"
+image = "./img/girl5.png"
+end
+#########################
+#########################
+###################################--HTML--##################
+###################################--------##################
+
+printf(<<_EOS_, per, gage, per, per, per, color, qrAC, kkget, image, alt, name, person, cal, lv, comm, pt, m1, mimg1, m2, mimg2, esa)
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+
+<meta name="viewport"
+content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="format-detection" content="telephone=no">
+<link media="only screen and (max-device-width:480px)"
+href="smart.css" type="text/css" rel="stylesheet" />
+<link media="screen and (min-device-width:481px)" href="profeel.css"
+type="text/css" rel="stylesheet" />
+
+
+
+
+<link rel="shortcut icon" href="./img/cabage.png"/>
+<title>ほげほげ</title>
+<style type="text/css">
+<!--
+p.gage{
+background:#adf;
+margin-left:0%s;
+margin-right:%d%s;
+text-align:left;
+border-radius: 10ex;
+}
+div.gage{
+background:#ddf;
+margin-left:20%s;
+margin-right:20%s;
+border-radius: 10ex;
+}
+div.cal div{float:left; border:solid %s;}
+
+-->
+</style>
+</head>
+
+<body>
+<header><p>%s</p></header>
+<h1>ほげほげ</h1>
+<h2>%s</h2>
+
+<div class="cal">
+<div>
+<img src=%s alt=%s width="172" height="172">
+</div>
+<table class="state"><tr><td>name</td><td>:%s</td></tr>
+<tr><td>id</td><td>:%04d</td></tr>
+<tr><td>cara</td><td>:%s</td></tr>
+<tr><td>lv.</td><td>%d</td></tr>
+</table>
+</div>
+
+<div class="gage">
+<p class="gage">exp</p>
+</div>
+
+%s
+
+<p>こうえきポイント:%dp</p>
+<table><tr><td>
+<form method="POST" action="gohan.rb">
+<label><input type="checkbox" name="hdn">ごはん!<div><br>
+<label><input type="radio" name="gohan" value="g1">%s:2pt<img src=%s width="16" height="16"></label><br>
+<label><input type="radio" name="gohan" value="g2">%s:5pt<img src=%s width="16" height="16"></label><br>
+%s
+</div></label></form>
+</td><td>
+<form method="POST" action="gets.rb">
+<label><input type="checkbox" name="hdn">しょうひん!<div><br>
+<label><input type="radio" name="sho" value="s1">おかし:3pt</label><br>
+<input type="reset" value="とりけし">
+<input type="submit" value="こうかんする!"></div></label><br>
+
+</form>
+</td></tr></table>
+
+
+
+<address>skip&#x40;xxxx.co.jp</address>
+<footer></footer>
+</body>
+</html>
+
+_EOS_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/profeel.css	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,70 @@
+body{text-align:center;
+background:#bff;
+border:dashed 5px navy;
+}
+header{
+#padding:100px;
+    position: relative;
+    top: 0px;
+    left: 0px;
+    width: 80%;
+    height: 200px;
+background-image:url(./img/head.png);
+text-align:center;
+margin-left:auto;margin-right:auto;
+}
+footer{
+#padding:100px;
+    position: relative;
+    top: 0px;
+    left: 0px;
+    width: 80%;
+    height: 200px;
+background-image:url(./img/foot.png);
+text-align:center;
+margin-left:auto;margin-right:auto;
+}
+
+
+
+header p {color:red;}
+
+h1{
+color:#e90;
+border:solid 5px #fa0;
+border-style:double;
+background:url("./img/lvb.png");
+background-color:red;
+}
+
+
+
+
+input[type="checkbox"][name="hdn"] + span {display: none;}
+input[type="checkbox"][name="hdn"]:checked + span {display: inline;}
+
+input[type="checkbox"][name="hdn"] + div{opacity: 0;}
+input[type="checkbox"][name="hdn"]:checked + div {
+  opacity: 1.0; transition: 3s ease-in-out;
+  transition:  1s linear;}
+
+table{margin-left:auto; margin-right: auto;}
+table.state{text-align:left;}
+table.state tr+tr+tr+tr{font-size:xx-large;}
+
+
+div.f1{padding:0% 0%;
+margin:1em 17em;}
+div.lets{
+border:solid 2px #fa0;
+background:#faf;
+padding:1% 0%;
+#margin:1em 17em;
+}
+div.lets span{color:navy;  text-decoration: underline #faf;}
+
+div.cal {margin-left:auto; margin-right:auto;
+width: 320px; height: 180px;
+background: #eef;
+border: solid 2px navy;}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opencampus2015/smart.css	Fri Jul 24 20:39:48 2015 +0900
@@ -0,0 +1,76 @@
+body{text-align:center;
+background:#bff;
+border:dashed 5px navy;
+margin-left:auto;margin-right:auto;
+width:340px;
+}
+header{
+#padding:100px;
+    position: relative;
+    top: 0px;
+    left: 0px;
+    width: 100%;
+    height: 140px;
+background-image:url(./img/head2.png);
+background-repeat:no-repeat;
+text-align:center;
+margin-left:auto;margin-right:auto;
+}
+footer{
+#padding:100px;
+    position: relative;
+    top: 0px;
+    left: 0px;
+    width: 100%;
+    height: 140px;
+background-image:url(./img/foot2.png);
+background-repeat:no-repeat;
+text-align:center;
+margin-left:auto;margin-right:auto;
+}
+
+
+
+header p {color:red;}
+
+h1{
+color:#e90;
+border:solid 5px #fa0;
+border-style:double;
+background:url("./img/lvb.png");
+background-color:red;
+}
+
+input[type="checkbox"][name="hdn"] + span {display: none;}
+input[type="checkbox"][name="hdn"]:checked + span {display: inline;}
+
+input[type="checkbox"][name="hdn"] + div{opacity: 0;}
+input[type="checkbox"][name="hdn"]:checked + div {
+  opacity: 1.0; transition: 3s ease-in-out;
+  transition:  1s linear;}
+
+table{margin-left:auto; margin-right: auto;}
+table.state{text-align:left;}
+table.state tr+tr+tr+tr{font-size:xx-large;}
+
+
+div.f1{padding:0% 0%;}
+div.lets{
+border:solid 2px #fa0;
+background:#faf;
+padding:1% 0%;
+#margin:1em 17em;
+}
+div.lets span{color:navy;  text-decoration: underline #faf;}
+
+
+
+
+div.cal {margin-left:auto; margin-right:auto;
+width: 320px; height: 180px;
+background: #eef
+border: solid 2px navy;}
+
+
+
+#form{margin-left:auto; margin-right:auto;}

yatex.org