Newer
Older
skip-web / program / 6hour / hospitalkeka.rb
@MURAKAMI Masaki MURAKAMI Masaki on 21 Nov 2013 37 KB ディレクトリ整理しました
#!/usr/bin/env ruby
# coding: euc-jp

# $KCODE = 'e'            # 日本語コードの定義

require 'cgi'                   # CGI を使いますという宣言
c = CGI.new(:accept_charset => "EUC-JP")          # CGI変数は HTML に使用する
print "Content-type: text/html; charset=EUC-JP\n\n"   # 日本語コードの定義


# CGIスクリプトから受け取った変数の対を、rbで使う変数に代入

choose = c["koumokumei"]


#p choose

if /(\S+):(\S+)/=~choose
  # $1 = 病院名
  # $2 = 住所
  na = $1
  ad = $2
end

#p na
#p ad


print("<html>\n")      # HTMLの規定
print("<head>\n")      # HTMLの設定
print("<link rel=\"stylesheet\" type=\"text/css\" href=\"kensaku2.css\">\n")
                       # cssの設定
printf("<title>検索結果 %s</title>\n",na)   # <title>の表示
print("<link rel=\"shortcut icon\" href=\"smile.png\">")   # アイコン
print("</head>\n")     # HTMLの設定(閉)
print("<body>\n")      # HTMLの表示部分

print("<h1>検索結果<sub><img class=\"head\" src=\"chara2.png\" width=\"80\" height=\"100\" alt=\"FUCHO\"></img></sub></h1>\n")                     # <h1>の表示

printf("<h2>検索ワード[%s]</h2>\n",na)

print("<form method=\"POST\" action =\"kuchikomi.rb\">\n")

hospital = Hash.new

# データを読みこむ
print("<div class=\"ue\">")
if /鶴岡市/=~ad
  
open("turuoka.dat","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

     if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /酒田市/=~ad
open("sakata.dat","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /庄内町/=~ad
open("syounai.dat","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /三川町/=~ad
open("mikawa.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /遊佐町/=~ad
open("yuza.dat","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /山形市/=~ad
open("yamagatashi.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /寒河江市/=~ad
open("sagae.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /上山市/=~ad
open("kaminoyama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /村山市/=~ad
open("murayama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /天童市/=~ad
open("tendo.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /東根市/=~ad
open("higasine.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /尾花沢市/=~ad
open("obanazawa.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /東村山郡/=~ad
open("h_murayama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /西村山郡/=~ad
open("n_murayama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /北村山郡/=~ad
open("k_murayama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /新庄市/=~ad
open("sinjou.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /新庄市/=~ad
open("sinjou.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /最上郡/=~ad
open("mogami.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /米沢市/=~ad
open("yonezawa.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /長井市/=~ad
open("nagai.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /南陽市/=~ad
open("nanyo.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /東置賜郡/=~ad
open("h_okitama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

elsif /西置賜郡/=~ad
open("n_okitama.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = 電話番号
      # $4 = 曜日(午前)
      # $5 = 曜日(午後)
      # $6 = 休診日
      # $7 = 科
      hospital[$1] = $2,$3,$4,$5,$6,$7
      juusho = $2

      if juusho == ad
        print("<table border=1 align=center>\n")

        print("<tr><th><img alt=\"病院アイコン\" heght=\"38\" src=\"hospital.png\" width=\"33\">病院名</th>\n")
        printf("<th>%s</th></tr>\n",$1)

        print("<tr><th><img alt=\"住所アイコン\" heght=\"38\" src=\"yubin.png\" width=\"33\">住所</th>\n")
        printf("<th>%s</th></tr>\n",$2)

        print("<tr><th><img alt=\"電話アイコン\" heght=\"38\" src=\"telephone.png\" width=\"33\">電話番号</th>\n")
        printf("<th>%s</th></tr>\n",$3)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gozen2.png\" width=\"33\">診療日(午前)</th>\n")
        printf("<th>%s</th></tr>\n",$4)

        print("<tr><th><img alt=\"時計アイコン\" heght=\"38\" src=\"gogo2.png\" width=\"33\">診療日(午後)</th>\n")
        printf("<th>%s</th></tr>\n",$5)

        print("<tr><th><img alt=\"布団アイコン\" heght=\"38\" src=\"huton.png\" width=\"33\">休診日</th>\n")
        printf("<th>%s</th></tr>\n",$6)

        print("<tr><th><img alt=\"先生アイコン\" heght=\"38\" src=\"sensei.png\" width=\"33\">診療科</th>\n")
        printf("<th>%s</th></tr>\n",$7)
        print("</table>\n")
      end
    end
  end
end

end
print("</div>")

print("<br><br>")

print("<h2>くちこみ</h2>")
print("<div class=\"shita\">")
print("<h3>投稿!!</h3>")
print("\n")
printf("<input type=\"hidden\" name=\"byoin\" value=\"%s\" checked>%s\n",choose,na)
print("の情報をいれてください。<br>\n")
print("<textarea name=\"info\" rows=\"3\" cols=\"50\">")
print("ここに入力して下さい。</textarea></p>")

print("<input type=\"hidden\" name=\"name\" value=\"名前\" checked>名前を記入して下さい。<br>")
print("<input type=\"text\" name=\"toukousya\" maxlengh=\"20\"></p>")

print("<input type =\"submit\" value= \"投稿\">\n")
print("</form>\n")



print("<h3>閲覧!!</h3>\n")

#くちこみファイルを読みこむ
ku = Hash.new
i = 0    # kuの番号
open("kuchi.txt","r:euc-jp")do |yomu|
  while line = yomu.gets
    if /([^,]+),([^,]+),([^,]+),([^,]+)/=~line
      # $1 = 病院名
      # $2 = 住所
      # $3 = くちこみ
      # $4 = 投稿者
      ku[i] = $1,$2,$3,$4
    end
    i += 1
  end
end

#p ku
#p hospital[na][0]

#i = 0
#while ku.length

j = 0
for i in ku.keys.sort
  if ku[i][1] == hospital[na][0]
    printf("・%s  投稿者%sさん<br>\n",ku[i][2],ku[i][3])
  j += 1
  end
end

if j == 0
print("まだ投稿されていません。\n")
end
print("</div>\n")



print("<br><br>")

print("<a href=\"http://skip.koeki-prj.org/6hour/hospital.html\">戻る</a>
<a href=\"http://skip.koeki-prj.org/\">SKIP</a>\n") 
                                                 
print("<p>最長 6 時間</p>\n")                        # <p>の表示


print("</body>\n")     # HTMLの表示部分(閉) 
print("</html>\n")     # HTMLの規定(閉)