#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require 'cgi'


cgi = CGI.new(:tag_maker =>"html5", :accept_charset => "UTF-8")
tango= cgi["tango"]  #
cost= cgi["cost"]                   
hinsi= cgi["hinsi"]
yomi=cgi["yomi"]
hatuon=cgi["hatu"]

print("Content-type: text/html; charset=UTF-8\n\n")

print("<html>\n")
print("<head>\n")
print("<title>作成する単語</title>\n")
print("<link rel=\"stylesheet\" type=\"text/css\" href=\"tenji.css\" media=\"screen\">\n") 

print("</head>\n")
print("<body>\n")
open("./add_dic/newuser.csv","a+") do |write|
  write.printf("%s,*,*,%s,%s,*,*,*,*,*,%s,%s,%s\n",tango,cost,hinsi,tango,yomi,hatuon)
end
printf("<h2>追加する単語:%s</h2><h3>優先度:%s</h3><h3>品詞:%s</h3><h3>読み:%s</h3><h3>発音:%s</h3>",tango,cost,hinsi,yomi,hatuon)
print("<p>以上を辞書に追加します。よろしいですか?</p>")
print("<a href=\"tuika_dic.rb\"><button>ok</button>")
print("</body>\n")
print("</html>\n")
