  def destroy
    Log.add_info(request, params.inspect)

    return unless request.post?

    @date = Date.parse(params[:date])

    begin
      schedule = Schedule.find(params[:id])
    rescue => evar
      Log.add_error(request, evar)
      @schedules = Schedule.get_user_day(@login_user, @date)
      render(:partial => 'timetable', :layout => false)
      return
    end

    unless schedule.check_user_auth(@login_user, 'w', true)

      Log.add_check(request, '[Schedule.check_user_auth]'+request.to_s)

      if @login_user.nil?
        check_login
      else
        flash[:notice] = 'ERROR:' + t('schedule.need_auth_to_edit_destroy')
        @schedules = Schedule.get_user_day(@login_user, @date)
        render(:partial => 'timetable', :layout => false)
      end
      return
    end

    schedule.destroy

    @schedules = Schedule.get_user_day(@login_user, @date)

    render(:partial => 'timetable', :layout => false)

  rescue => evar
    Log.add_error(request, evar)

    @schedules = Schedule.get_user_day(@login_user, @date)
    render(:partial => 'timetable', :layout => false)
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.