changeset 152:f58a523ab531

Confiction resolved
author HIROSE Yuuji <yuuji@koeki-u.ac.jp>
date Wed, 06 Feb 2013 12:28:25 +0900
parents 79793162112a (current diff) 5753c5edba41 (diff)
children 2871a3b9273d
files .htaccess
diffstat 4 files changed, 71 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/.htaccess	Wed Feb 06 12:05:56 2013 +0900
+++ b/.htaccess	Wed Feb 06 12:28:25 2013 +0900
@@ -1,1 +1,1 @@
-AddType "text/html; charset=euc-jp" .html
\ No newline at end of file
+AddType "text/html; charset=euc-jp" .html
--- a/bus_cgi/bus1.rb	Wed Feb 06 12:05:56 2013 +0900
+++ b/bus_cgi/bus1.rb	Wed Feb 06 12:28:25 2013 +0900
@@ -19,8 +19,8 @@
   open("zikoku1.txt","r:euc-jp") do |zikoku|
     while line = zikoku.gets 
       if /(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*)/ =~ line
-        bus[$10.to_s] = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,$5.to_i,
-                         $6.to_i,$7.to_i,$8.to_i,$9.to_i]
+        bus[$10.to_s] = [$1.to_s,$2.to_s,$3.to_s,$4.to_s,$5.to_s,
+                         $6.to_s,$7.to_s,$8.to_s,$9.to_s]
       end      
     end
   end
@@ -29,8 +29,8 @@
   open("zikoku2.txt","r:euc-jp") do |zikoku|
     while line = zikoku.gets
       if /(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*),(\S*)/ =~ line
-        bus[$10.to_s] = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,$5.to_i,
-                         $6.to_i,$7.to_i,$8.to_i,$9.to_i]
+        bus[$10.to_s] = [$1.to_s,$2.to_s,$3.to_s,$4.to_s,$5.to_s,
+                         $6.to_s,$7.to_s,$8.to_s,$9.to_s]
       end      
     end
   end
@@ -47,47 +47,72 @@
 print("</head>\n")
 print("<body>\n")
 print("<link rel=\"stylesheet\" href=\"ruru.css\" type=\"text/css\">\n")
-print("<h1>検索結果</h1>\n")
+print("<h1>酒田駅大学線バス時刻検索</h1>\n")
 print("<img src=\"bus.png\" align=\"right\">")
+print("<br><h2>検索結果</h2>")
 
 a = 0
 if which == "t"
-    while true
-      if time.to_i < bus[arr][0]
-        print("<h2>乗車</h2>")
-        printf("<p> %s %d\n</p>\n",dep,bus[dep][8])
-        print("<h2>降車</h2>")
-        printf("<p> %s %d\n</p>\n",arr,bus[arr][8])
-        break
-      elsif a >= 8 || time.to_i > bus[arr][a] && time.to_i < bus[arr][a+1]
-        print("<h2>乗車</h2>")
-        printf("<p>%s %d\n</p>\n",dep,bus[dep][a])
-        print("<h2>降車</h2>")
-        printf("<p>%s %d\n</p>\n",arr,bus[arr][a])
-        break
-      else 
-        a += 1 
+  while true
+    if time.to_i < bus[arr][0].to_i
+      if /(\S\S)(\S\S)/ =~ bus[dep][8]
+        dhour = $1
+        dmin = $2
+      end
+      if /(\S\S)(\S\S)/ =~ bus[arr][8]
+        ahour = $1
+        amin = $2
       end
+      printf("<p>出発* %s %s:%s\n</p>\n",dep ,dhour, dmin)
+      printf("<p>到着* %s %s:%s\n</p>\n",arr ,ahour, amin)
+      break
+    elsif a >= 8 || time.to_i > bus[arr][a].to_i && time.to_i < bus[arr][a+1].to_i
+      if /(\S\S)(\S\S)/ =~ bus[dep][a]
+        dhour = $1
+        dmin = $2
+      end
+      if /(\S\S)(\S\S)/ =~ bus[arr][a]
+        ahour = $1
+        amin = $2
+      end
+      printf("<p>出発* %s %s:%s\n</p>\n",dep ,dhour, dmin)
+      printf("<p>到着* %s %s:%s\n</p>\n",arr ,ahour, amin)
+      break
+    else 
+      a += 1 
     end
+  end
 elsif which == "s"
   while true
-    if time.to_i < bus[dep][0] || time.to_i > bus[dep][8]
-      print("<h2>乗車</h2>")
-      printf("<p> %s %d\n</p>\n",dep,bus[dep][0])
-      print("<h2>降車</h2>")
-      printf("<p> %s %d\n</p>\n",arr,bus[arr][0])
+    if time.to_i < bus[dep][0].to_i || time.to_i > bus[dep][8].to_i
+      if /(\S\S)(\S\S)/ =~ bus[dep][0]
+        dhour = $1
+        dmin = $2
+      end
+      if /(\S\S)(\S\S)/ =~ bus[arr][0]
+        ahour = $1
+        amin = $2
+      end
+      printf("<p>出発* %s %s:%s\n</p>\n",dep ,dhour, dmin)
+      printf("<p>到着* %s %s:%s\n</p>\n",arr ,ahour, amin)
       break
-    elsif time.to_i > bus[dep][a] && time.to_i < bus[dep][a+1]
-      print("<h2>乗車</h2>")
-      printf("<p> %s %d\n</p>\n",dep,bus[dep][a+1])
-      print("<h2>降車</h2>")
-      printf("<p> %s %d\n</p>\n",arr,bus[arr][a+1])
+    elsif time.to_i > bus[dep][a].to_i && time.to_i < bus[dep][a+1].to_i
+      if /(\S\S)(\S\S)/ =~ bus[dep][a+1]
+        dhour = $1
+        dmin = $2
+      end
+      if /(\S\S)(\S\S)/ =~ bus[arr][a+1]
+        ahour = $1
+        amin = $2
+      end
+      printf("<p>出発* %s %s:%s\n</p>\n",dep ,dhour, dmin)
+      printf("<p>到着* %s %s:%s\n</p>\n",arr ,ahour, amin) 
       break
     else 
       a += 1 
     end
   end
 end
-
+print("<a href=\"http://skip.koeki-prj.org/bus_cgi/top.html\">戻る</a>\n") 
 print("</body>\n")
 print("</html>\n")
--- a/bus_cgi/ruru.css	Wed Feb 06 12:05:56 2013 +0900
+++ b/bus_cgi/ruru.css	Wed Feb 06 12:28:25 2013 +0900
@@ -1,7 +1,7 @@
-body {color: maroon;
+body {color: dodgerblue;
       margin: 10%;}
 
-p { color: dodgerblue;
+p { color: maroon;
     text-align: left;}
 
 h1 { color: saddlebrown;
--- a/bus_cgi/top.html	Wed Feb 06 12:05:56 2013 +0900
+++ b/bus_cgi/top.html	Wed Feb 06 12:28:25 2013 +0900
@@ -1,4 +1,3 @@
-
 <html>
 <html lang="ja">
 <head>
@@ -11,12 +10,15 @@
 <body>
 <form method="POST" action="./bus1.rb">
 
-<h1>酒田市福祉乗合バス時刻検索<デモ版></h1>
+<h1>酒田駅大学線バス時刻検索</h1>
+<img src="bus.png" align="right">
 <br>
-<h2>るんるんバス時刻検索</h2>
-<img src="bus.png" align="right">
-<p><input type="radio" name="direc" value="e" checked>駅方面</p>
-<p><input type="radio" name="direc" value="k">かんぽの郷方面</p>
+<h2>路線図</h2>
+<p>作成中です・・・</p>
+<br>
+<h2>時刻検索</h2>
+<p><input type="radio" name="direc" value="e" checked>駅方面
+<input type="radio" name="direc" value="k">かんぽの郷方面</p>
 <p>出発*
 <select name="dep">
  <option> かんぽの郷
@@ -94,7 +96,9 @@
 </form>
 <br>
 <h2>プログラムに関して</h2>
-<p>このプログラムは、酒田市福祉乗合バス時刻表を基に、東北公益文科大学SKIPが作成したものです。このページにおいて提供されているコンテンツに関して、編集著作権を含む一切の権利は管理者SKIPが保有致します。また、このプログラムはデモ版であり、このページから得られた情報に関しての責任は一切負いません。</p>
-
+<p>このプログラムは、酒田市福祉乗合バス時刻表を基に、東北公益文科大学SKIPが作成したものです。<br>このページにおいて提供されているコンテンツに関して、編集著作権を含む一切の権利は管理者SKIPが保有致します。<br>また、このプログラムはデモ版であり、このページから得られた情報に関しての責任は一切負いません。</p>
+<br>
+<a href="http://skip.koeki-prj.org/bus_cgi/home.html">戻る</a>
+<a href="http://skip.koeki-prj.org/">SKIP</a>
 </body>
 </html>

yatex.org