changeset 669:716b1bdf9fc3

remove
author MURAKAMI Masaki <c112124@h.koeki-u.ac.jp>
date Tue, 24 Feb 2015 16:46:14 +0900
parents 003cb0e1f3ab
children ddbe3a162d50
files 2014OC/admin/#drawLots.rb#
diffstat 1 files changed, 0 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/2014OC/admin/#drawLots.rb#	Tue Feb 24 16:37:24 2015 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-require 'sqlite3'
-require 'cgi'
-require 'date'
-
-c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
-db = SQLite3::Database.new("../sql/stamp.sq3")
-
-add = ENV["REMOTE_ADDR"]
-
-if /^(172\.19\.5\.|172\.17\.54\.|172\.21\.90\.)|118.21.142.107|202.214.125.107/ =~ add
-check = c['check']
-
-printf("Content-type: text/html; charset=UTF-8\n\n")
-
-sum = 'SELECT SUM(rank) FROM main WHERE NOT id=1;'
-rank_sum = db.execute(sum).flatten(2)[0].to_i
-
-t = Time.now
-expires = Time.local(2014, 8, 3, 8, 50)
-expires2 = Time.local(2014, 8, 3, 17, 00)
-if t > expires && t < expires2
-else
-  check = ""
-  puts check
-end
-
-if check == "OK"
-  begin
-    result = db.execute("select id,exp,rank from main;")
-  rescue
-    exit
-  end
-  all = Array.new
-  for id,lv,rank in result
-    if id == 1 || lv == 0 || rank.to_i != 0
-      next
-    end
-    lv.to_i.times do
-      all << id
-    end
-  end
-  
-  tousen = Array.new(0)
-  atari1 = rand(all.length)
-  tousen << all[atari1]
-  all.delete_if {|x| x == tousen[0]}
-  
-  sql = "update main set rank = 1 where id = ?;"
-  db.execute(sql,tousen[0])
-  
-  sql = "update main set rank = 2 where id = ?;"
-  while tousen.length < 4
-    srand
-    atari2 = rand(all.length)
-    hoge = all[atari2]
-    tousen << all[atari2]
-    all.delete_if {|x| x == hoge}
-    db.execute(sql,hoge)
-  end
-  
-  i=0
-  
-  printf("<p>1等はIDが%04dの方!おめでとー!</p>\n",tousen[i].to_i-1)
-  printf("<p>2等はIDが%04dと%04dと%04dの方!おめでとー!</p>\n",tousen[i+=1].to_i-1,tousen[i+=1].to_i-1,tousen[i+=1].to_i-1)
-print'<p><a href="drawLots.html">抽選ページ戻る</a></p>\n
-<p><a href="monitor.html">抽選ページ戻る</a></p>
-'
-else
-  print"<p>抽選はまだ行いませんよ</p>\n<p><a href=\"drawLots.html\">抽選ページ戻る</a></p>"
-end
-else
-  printf("Content-type: text/html; charset=UTF-8\n\n")
-  
-  printf'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h
-tml4/strict.dtd">
-<html>
-<head>
-<title>Delete table</title>
-<link rel="stylesheet" type="text/css" href="design.css">
-</head>
-</body>
-<p>管理者用ページのため閲覧できません。</p>'
-end
-print'</body></html>'

yatex.org