#!/usr/local/bin/ruby
#  encoding: utf-8
#  daybook_search.rb

#  Created by midori on 2006-09-03.
#  Copyright (c) 2006. All rights reserved.
#  You can distribute/modify this program under the terms of the Ruby License.
#  Last change: 2006-10-23.
#________________________________________ 
require "daybook"
base = MainBase.load('base/daybook_base')
h_base =  base.make_base_hash
#________________________________________
require "newpost/d_check"
env = CheckURI.new(h_base)
res = env.daybook_search_check
raise DaybookPrint.new.custom_print("_error... #{res['error']}")  if res.has_key?('error')

require "newpost/d_params"
cgipara = GetParams.new
para_data = cgipara.get_all_params
raise DaybookPrint.new.custom_print("inputdata_error... #{para_data['error']}")  if para_data.has_key?('error')

require "search/d_search"
begin
  SAFE = 3
    search = MySearch.new(h_base)
    ans = search.mysearch_board_search(para_data)
    print "Content-Type: text/html\n\n"
    print ans

rescue
  DaybookPrint.new.error_out
end

#________________________________________
