text:
<repo_name>omiologic/react-uiux-bones<file_sep>/app/routes/Home/Home.jsx
import React from 'react';
import { connect } from 'react-redux';
// import * as Component from 'APP/app/components';

export default class Home extends React.Component {
  render(){

    return(

Home

    )
  }
}<file_sep>/app/reducers/index.jsx
import DefaultReducer from './default';
export const root = DefaultReducer;

branch_name: refs/heads/master

repo_language: JavaScript

repo_name: omiologic/react-uiux-bones


text:
<repo_name>ruchi222/spinner_<file_sep>/spinner2.js
process.stdout.write('hello from spinner2.js... \rheyyy\n');
const chars = ['|', '/', '-', '\\', '|', '/', '-', '\\'];
let when = 0;
for (const symbol of chars) {
    when  += 200;
    setTimeout(() => {
        process.stdout.write(`\r ${symbol} `)
    }, when
    );
}


text:
<file_sep>

Get help from the community!

Make a post to create a chat room!

  <form method="POST" action="/auth/signin">
  	<input type="text" name="username" placeholder="username">
  	<input type="<PASSWORD>" name="password" placeholder="<PASSWORD>">
  	<input type="submit" class="btn btn-primary" value="Log In">
  </form><file_sep>
All Posts

<% posts.forEach(function(post) { %>

<a href="/video/<%=post.id%>"> <img class="img-thumbnail" src="<%=post.url%>"> <%= post.personId %>:
<%= post.title %> - <%= post.content %>

<% }); %>

<file_sep>var express = require('express');
var router = express.Router();
var db = require('../models');
var flash = require('express-flash');
var app = express();

 app.use(flash());

router.get('/signout', function(req, res) {
  req.currentUser = false;
  res.locals.currentUser = false;
  res.redirect('/');
});

router.post('/signin', function(req, res) {
  // proving we get the username and password
  var person = req.body.username;
  var pass = <PASSWORD>;
  db.person.authenticate(person, pass, function(err, person) {
    if (person) {
      req.session.personId = person.id;
      console.log('success', 'Successfully logged in.');
      currentUser = person;
      console.log(currentUser);
      res.redirect('/posts');
    }
  });
});

router.get('/signup', function(req, res) {
  res.render('signup');
});

router.post('/signup', function(req, res) {
  db.person.findOrCreate({
  	where: {
  		username: req.body.username,
  	},
  	defaults: {
  		password: <PASSWORD>
  	}
  }).spread(function(user, isNew) {
  	if (isNew) {
    	res.redirect('/posts');
  	} else if (db.person.find({where: {username:req.body.username}}) != null) {
  		console.log("danger");
  		req.flash('danger', 'Username already taken. Please choose another.')
    	res.redirect('/auth/signup');
  	}
  }).catch(function(err) {
    req.flash('danger', err.message);
    res.redirect('/auth/signup')
  });
});

module.exports = router;<file_sep>

      <% if (typeof alerts !== 'undefined') { %>
        <% for (key in alerts) { %>
          <% alerts[key].forEach(function(thisMsg) { %>
            <div class="alert alert-<%= key %>"><%= thisMsg %>

          <% }); %>
        <% } %>
      <% } %>

	<form method="POST">
		Username: <input type="text"name="username" placeholder="Username">

		Password: <input type="<PASSWORD>" name="password" placeholder="<PASSWORD>">

		Email: <input type="text" name="email" placeholder="Email">

		Language: <select name="language" value ="Language">
								  <option value="English">English</option>
								  <option value="Korean">Korean</option>
								  <option value="Japanese">Japanese</option>
								</select>

		Location: <select name="location" value ="Location">
								  <option value="US">US</option>
								  <option value="Korea">Korea</option>
								  <option value="Japan">Japan</option>
								</select>

		<input class="btn btn-info" type="submit" value="Sign Up">
	</form>
<file_sep><!DOCTYPE html>

<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
	<link rel="stylesheet" href="/style.css">
	<meta charset="UTF-8">

<title>Help!</title>

Home

Video Chat

Sign up

Posts

Create Post

Currently logged in as <%=currentUser.username%>

         <form action="/logout">
            <button type="submit" class="btn btn-danger">Logout</button>
          </form>

  <%- body %>

<file_sep>

(click name for more info)

<img src="<%=random.sprites.front_default%>"> <a href="https://bulbapedia.bulbagarden.net/wiki/<%=random.name%>_(Pok%C3%A9mon)"><%=random.name%>

<file_sep>
New Post

<form method="POST">

  	<%= currentUser.username %>

  <input type="text" name="title" placeholder="title">
  <input type="text" name="content" placeholder="post">
  <input type="text" name="url" placeholder="picture url">
  <input type="submit" class="btn btn-primary" value="Post">
</form><file_sep>var static = require('node-static');
var http = require('http');
var https = require('https');
var fs = require('fs');
var file = new(static.Server)();
var ejs = require('ejs');
var ejsLayouts = require('express-ejs-layouts');
var bodyParser = require('body-parser');
var request = require("request");
var express = require("express");
var db = require('./models');
var authCtrl = require('./controllers/auth');
var flash = require('express-flash');
var ExpressPeerServer = require('peer').ExpressPeerServer;

var app = express();
var session = require('express-session');

app.use(bodyParser.urlencoded({ extended: false}))
app.use(express.static(__dirname + '/static'));
app.use(ejsLayouts);
app.use(flash());

app.set('view engine', 'ejs');

app.use(session({
  secret: 'a bunch of random LETTERS',
  resave: false,
  saveUninitialized: true
}));

app.use('/auth', authCtrl);

app.use(function(req, res, next) {
  if (req.session.personId) {
    db.person.findById(req.session.personId).then(function(person) {
      req.currentUser = person;
      res.locals.currentUser = person;
      next();
    })
  } else {
    req.currentUser = false;
    res.locals.currentUser = false;
    next();
  }
});

app.get('/', function (req, res) {
  res.render('home');
});

app.get('/video/:postid', function (req, res) {
    var postid = req.params.postid;
  res.render('index');
  //file.serve(req, res);
});

app.get('/signup', function (req, res) {
  res.render('signup');
});

app.get('/posts', function(req, res) {
  db.post.findAll().then(function(posts) {
    // console.log(persons);
    res.render('posts', {posts: posts});
  });
});

app.post('/signup', function(req, res) {
  var newPerson = req.body;
  // console.log(newPerson);

  db.person.create(newPerson).then(function() {
    res.redirect('/posts');
  });
});

app.get('/newpost', function(req, res){
  res.render('newpost');
});

app.post('/newpost', function(req, res) {
  var newPost = req.body;
  // console.log(newPost);
  db.post.create(newPost).then(function() {
  db.post.findAll().then(function(posts) {
    res.render('posts', {posts: posts});
  });
});
});

//api functionality
app.get('/random', function(req, res) {
  var query = req.query.q;

  request('http://pokeapi.co/api/v2/pokemon/' + query, function(err, response, body) {
    var data = JSON.parse(body);
    if (!err && response.statusCode === 200 && data) {
      res.render('random', {random: data, q: query});
    } else {
      res.render('error');
    }
  });
});

//this code was in order to get the video chat to work, currently getUserMedia only works in https,
//but the caller id is sent over http, which creates a mixed content error

var httpsPort = 3443;

var serverOptions = {
  key: fs.readFileSync('./private.key'),
  cert: fs.readFileSync('./certificate.pem')
};

var peerOptions = {
  debug: true,
  secure: true
}
var server = https.createServer(serverOptions, app);

app.use('/peerjs', ExpressPeerServer(server, peerOptions));

server.listen(httpsPort);

app.listen(process.env.PORT || 3000)<file_sep>var express = require('express');
var db = require('../models');

var router = express.Router();

//function to show all posts
router.get('/posts', function(req, res) {
	db.post.findAll({
		include: [db.person]
	}).then(function(posts) {
		console.log(posts);
		res.render('posts', {posts: posts, alerts: req.flash()});
	});
});

//functiont to post new posts
router.post('/newposts', function(req, res){
	console.log(req.body);

	db.person.find({
		where: { username: currentUser.username}
	}).then(function(user) {
		person.createPost({
			content: req.body.content
		}).then(function(post) {
			res.redirect('/posts');
		});
	}).catch(function(err) {
		res.send(err);
	});
});

module.exports = router;

languages: JavaScript EJS


text:
<repo_name>tomnoble20/Just-Another-Reddit-Clone<file_sep>/src/components/post/createpost/CreatePost.js
import React from 'react';
import { firestore, auth, storage } from '../../../base'
import './creatpost.css'
import {expandTextArea,breakDateDown} from '../../../helpers'

class CreatePost extends React.Component {
    constructor() {
        super()
        this.handleSubmit = this.handleSubmit.bind(this)
        this.handleChange = this.handleChange.bind(this)
        this.onCreate= this.onCreate.bind(this)
        this.state = {
            category: 'sport',
            title: null,
            content: null,
            imageUrl: null,
        }
    }

    fileChangedHandler(e) {
        this.setState({selectedFile: e.target.files[0]})
    }

    handleSubmit(e) {
        e.preventDefault()
        if(this.state.selectedFile) {
            const location = storage.ref().child('post-images').child(this.props.user.uid).child(this.state.selectedFile.name)
            location.put(this.state.selectedFile).then(() => {
                location.getDownloadURL()
                .then((response) => {
                    this.setState({imageUrl: response})
                    this.onCreate()
                }).catch(error => (console.error(error.message) ))
            })
        } else {
            this.onCreate()
        }
    }

    onCreate(){
        const {uid, email, photoURL} = auth.currentUser || {}
        const post = {
            category: this.state.category,
            title: this.state.title,
            content: this.state.content,
            user: {
                uid,
                displayName: this.props.user.displayName,
                email,
                photoURL
            },
            comments: 0,
            created: breakDateDown(),
            image: this.state.imageUrl,
            vote: {
                count: 0,
                users: []
            },
            url: `r/${this.state.category}/`
        }
            firestore.collection('posts').add(post)
            this.props.history.push('/')
      }

    handleChange(e) {
        this.setState({
            [e.target.dataset.id]: e.target.value,
        })
    }

    render() {
        return (

Create Post

                <form onSubmit={this.handleSubmit} action='/'>
                Category
                <select data-id='category' defaultValue='sport' name='categories' onChange={(e) => {this.handleChange(e)}}>
                    <option value='sport'>Sport</option>
                    <option value='funny'>Funny</option>
                    <option value='random'>Random</option>
                </select>
                Title
                <input
                    onChange={(e) => {this.handleChange(e)}}
                    placeholder='Title'
                    data-id='title'
                />
                Text
                <textarea
                    onChange={(e) => {this.handleChange(e);expandTextArea(e)}}
                    placeholder='Text'
                    data-id='content'
                />
                Image
                <input type='file' accept="image/png, image/jpeg" onChange={(e) => this.fileChangedHandler(e)}></input>
                <button className='btn' disabled={!this.state.title || !this.state.content}>Post</button>
            </form>

        )
    }
}

export default CreatePost<file_sep>/src/components/layouts/nav/userdropdown/UserDropDown.js
import React from 'react'
import {signOut} from '../../../../base'
import './userdropdown.css'
import { UserContext } from '../../../../providers/UserProvider'
const body = document.querySelector('body')

class UserDropDown extends React.Component {
    constructor() {
        super()
        this.handleClick = this.handleClick.bind(this)
        this.outsideClick = this.outsideClick.bind(this)

        this.state = {
            show: false
        }
    }

    outsideClick() {
        this.setState({
            show: false
        })
    }

    handleClick(e) {
        this.setState(prevState => ({
            show: !prevState.show
        }))

    }

    componentWillMount() {
        body.addEventListener('click', this.outsideClick, false)
    }

    componentWillUnmount() {
        body.removeEventListener('click', this.outsideClick, false)
    }

    render() {
        return(
            <UserContext.Consumer>
            {user => (

                    <button onClick={(e) => this.handleClick(e)} className='user'>

{user.displayName}

{user.email}

                    </button>
                    <button
                        onClick={() => {signOut()}}
                        className={this.state.show ? 'user__logout js-active' : 'user__logout'}
                    >
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                            <path d="M0 0h24v24H0z" fill="none"/>
                            <path d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>
                        </svg>Log Out
                    </button>

            )}
            </UserContext.Consumer>
        )
    }
}

export default UserDropDown<file_sep>/src/providers/PostsProvider.js
import React, { createContext } from 'react';
import { firestore } from '../base'
import { collectIdsAndDocs } from '../helpers'

export const PostsContext = createContext()

class PostsProvider extends React.Component {
    constructor() {
        super()
        this.state = {
            posts: []
        }
    }

    componentDidMount() {
        this.unsubscribe = firestore.collection('posts').onSnapshot(snapshot => {
          const posts = snapshot.docs.map(collectIdsAndDocs)
          this.setState({
            posts: posts
          })
    })
    }

    componentWillUnmount() {
        this.unsubscribe()
    }

    render() {
        const {posts} = this.state
        const {children} = this.props
        return (
            <PostsContext.Provider value={posts}>{children}</PostsContext.Provider>
        )
    }
}

export default PostsProvider<file_sep>/src/components/layouts/nav/Nav.js
import React from 'react'
import SortAction from './sortAction/SortAction'
import UserDropDown from './userdropdown/UserDropDown'
import LoginAction from './LoginAction/LoginAction'
import { UserContext } from '../../../providers/UserProvider'
import './nav.css'
class Nav extends React.Component {
    constructor() {
        super()
        this.handleClick = this.handleClick.bind(this)
        this.state = {
            show: null,
        }
    }

    handleClick(e) {
        if(e.target.id === 'login' && this.state.show !== 'login') {
            this.setState({
                show: 'login'
            })
        } else if(e.target.id === 'sort' && this.state.show !== 'sort' ) {
            this.setState({
                show: 'sort'
            })
        } else {
            this.setState({
                show: null
            })
        }
    }
    render() {
        return (

                <SortAction sort={this.props.sort} show={this.handleClick} showState={this.state.show}/>
                <UserContext.Consumer>
                {user => (!user ?<LoginAction show={this.handleClick} toggle={this.props.toggle} switch={this.props.switch} showState={this.state.show}/> : <UserDropDown/>)}
                </UserContext.Consumer>

        )
    }
}

export default Nav<file_sep>/README.md

## Just Another Reddit Clone

Built with React and Firebase

![Image of Reddit Clone](https://github.com/tomnoble92/Just-Another-Reddit-Clone/blob/master/src/Screenshot%202019-07-17%20at%2023.51.44.png)

## Features

* Frontpage
* Voting on posts
* Login / Register
* Relative time
* Submitting Posts / Images
* Sorting Posts by Popular / Recent

## Upcoming Features
* Sorting Posts by Category
* Deleting posts
* Submitting comments

### `npm start`

Runs the app in the development mode.

Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

### `Screen Shots`
![Image of Reddit Clone SideMenu](https://github.com/tomnoble92/Just-Another-Reddit-Clone/blob/master/src/sidemenu.png)

<file_sep>/src/components/post/vote/Vote.js
import React from 'react'
import { firestore } from '../../../base'
import firebase from 'firebase/app'
import '../postpreview/postpreview.css'
import { UserContext } from '../../../providers/UserProvider'

function Vote (props) {

   const handleUpdate =  async (e,userId) => {
        const id = props.id
        let vote = props.vote
        const postRef = firestore.doc(`posts/${id}`)
        if(e.target.dataset.id === 'Up') {
            postRef.update({
                vote: {
                    count: vote+1,
                    usersId: userId
                }
            })
        } else if(e.target.dataset.id === 'Down') {
            postRef.update({
                vote: {
                    count: vote-1,
                    usersId: userId
                }
            })
        }
    }
        return (
            <UserContext.Consumer>
                {user => (

                    <button onClick={(e) => handleUpdate(e,user.uid)} data-id='Up' aria-label='Up vote icon' disabled={!user}>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                            <path fill="none" d="M0 0h24v24H0V0z"/>
                            <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
                        </svg>
                    </button>
                    {props.vote}
                    <button onClick={(e) => handleUpdate(e,user.uid)} data-id='Down' aria-label='Down vote icon' disabled={props.vote === 0 || !user}>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                            <path fill="none" d="M0 0h24v24H0V0z"/><path fill="#010101" d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"/>
                        </svg>
                    </button>

                )}
            </UserContext.Consumer>
        )
}

export default Vote<file_sep>/src/components/auth/AuthForms/CreateAccountForm.js
import React from 'react'
import { auth, createUserProfileDocument } from '../../../base'
import ErrorMessage from './ErrorMessage'

class CreateAccountForm extends React.Component {
    constructor() {
        super()
        this.handleChange = this.handleChange.bind(this);
        this.handleSubmit = this.handleSubmit.bind(this);
        this.state = {
            email: '',
            displayName: '',
            HasError: true,
            PasswordHasError: true,
        }
    }

    handleEmailValidation = (e) => {
        const reg = /^\S+@\S+$/
        const email = e.target.value
        if(reg.test(email)) {
            this.setState({
                HasError: false,
                ErrorMessage: ''
            })
        } else {
            this.setState({
                HasError: true,
                ErrorMessage: 'Email Format Incorrect'
            })
        }
    }

    handlePasswordValidation = (e) => {
        const length = e.target.value.length
        if(length >= 6) {
            this.setState({
                PasswordHasError: false,
                ErrorMessage: ''
            })
        } else {
            this.setState({
                PasswordHasError: true,
                ErrorMessage: 'Password Must Be 6 Characters Or More'
            })
        }
    }

    handleChange(e) {
        this.setState({[e.target.id]: e.target.value})
    }

    handleSubmit = async e => {
        e.preventDefault()
        const {email,password,displayName} = this.state
        try {
            const { user } = await auth.createUserWithEmailAndPassword(email,password)
            await createUserProfileDocument(user,displayName)
            this.props.toggleSideMenu()
        } catch (error) {
            this.setState({
                HasError: true,
                ErrorMessage: error.message
            })
    }

}

    render() {
        return(

                <button onClick={this.props.toggleSideMenu}>
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                    <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
                    <path d="M0 0h24v24H0z" fill="none"/>
                </svg>
                </button>

Create Account

                <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 24 24" fill="#ccc" className='auth-form__face'>
                    <path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z"/>
                    <path fill="none" d="M0 0h24v24H0z"/>
                </svg>
                <form onSubmit={this.handleSubmit}>
                    Username
                    <input
                        onChange={(e) => {this.handleChange(e)}}
                        type='text'
                        placeholder='Username'
                        id='displayName'
                    />
                    Email
                    <input
                        onChange={(e) => {this.handleChange(e);this.handleEmailValidation(e)}}
                        type='text'
                        placeholder='Email'
                        id='email'
                    />
                    Password
                    <input
                        onChange={(e) => {this.handleChange(e);this.handlePasswordValidation(e,6)}}
                        type='password'
                        placeholder='<PASSWORD>'
                        id='password'
                    />
                    <ErrorMessage message={this.state.ErrorMessage} />
                    <button className='btn' disabled={this.state.HasError === true || this.state.PasswordHasError === true} type='submit'>Create Account</button>
                </form>

        )
}
}

export default CreateAccountForm<file_sep>/src/App.js
import React from 'react'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import Header from './components/layouts/header/Header'
import LoginForm from './components/auth/AuthForms/LoginForm'
import CreateAccountForm from './components/auth/AuthForms/CreateAccountForm'
import CreatePost from './components/post/createpost/CreatePost'
import PostsCollection from './components/post/postscollection/PostsCollection'
import './App.css'
import { UserContext } from './providers/UserProvider'

class App extends React.Component {
  constructor() {
    super()
    this.openSideMenu = this.openSideMenu.bind(this)
    this.switchForm = this.switchForm.bind(this)
    this.handleSort = this.handleSort.bind(this)
    this.state = {
      isSideMenuOpen: false,
      isLogInFormOpen: false,
      isCreatAccountFormOpen: false,
    }
  }

  switchForm(e) {
    const el = e.target.dataset.el
    if(el === 'isLogInFormOpen') {
      this.setState({
        isLogInFormOpen: true,
        isCreatAccountFormOpen: false
      })
    } else {
      this.setState({
        isLogInFormOpen: false,
        isCreatAccountFormOpen: true
      })
    }
  }

  handleSort(e) {
    this.setState({
      sortBy: e.target.id
    })
  }

  openSideMenu(e) {
    this.setState(prevState => ({
      isSideMenuOpen: !prevState.isSideMenuOpen
    }))
  }

  render() {
    return(

            <Router>
            <UserContext.Consumer>
            {user => (

                {user ? <Route exact path='/' render={() => <Link className='btn' to='/submit'>Create Post</Link>}/> : <button className='btn' data-el='isCreatAccountFormOpen' onClick={(e) => {this.openSideMenu(e); this.switchForm(e)}}>Create Account</button>}
                {user ? <Route exact path='/submit'  render={(props) => <CreatePost user={user} {...props}/>}/> : null}

            )}
            </UserContext.Consumer>
            <Route path='/' render={() => <PostsCollection sort={this.state.sortBy} />}/>
            </Router>

            {this.state.isLogInFormOpen ? <LoginForm toggleSideMenu={this.openSideMenu}/> : null}
            {this.state.isCreatAccountFormOpen ? <CreateAccountForm toggleSideMenu={this.openSideMenu}/> : null}

    )
  }
}

export default App;
<file_sep>/src/components/layouts/header/Header.js
import React from 'react'
import Nav from '../nav/Nav'
import './header.css'

function Header(props) {
    return (

            Just Another Reddit Clone

    )
}

export default Header<file_sep>/src/components/post/postscollection/PostsCollection.js
//
//

import React from 'react'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import { PostsContext } from '../../../providers/PostsProvider'
import PostPreview from '../postpreview/PostPreview'
import Post from '../post/Post'

function PostsCollection(props) {
    function handleClick(e) {
        sessionStorage.setItem('url',e.target.dataset.url)
        sessionStorage.setItem('id',e.target.dataset.id)
    }
    const id = sessionStorage.getItem('id')
    const data = React.useContext(PostsContext)

    function mapData(data) {
        if(!data) {return}
        if(props.sort) {
            data = sortData(data)
        }
        const postsData = data.map(posts => (<PostPreview {...posts} key={posts.id} click={handleClick} />))
        return postsData
    }

    function sortData(data) {
        const sorted = data.sort((a,b) => {
            if(props.sort === 'popular') {
                return b.vote.count - a.vote.count
            } else {
                return -1
            }
        })
        return sorted
    }
    const posts = mapData(data)

    return (

            <Route exact path='/' render={() =>
{data ? posts : null}
} />
            {id ? <Route exact path={sessionStorage.getItem('url')} render={() => <Post id={id}/>} /> : null}

    )
    }

export default PostsCollection<file_sep>/src/components/layouts/nav/LoginAction/LoginAction.js
import React from 'react';

class LoginAction extends React.Component {
    constructor() {
        super()

        this.state = {
            show: false
        }

    }

    handleClick() {
        this.setState(prevState => ({
            show: !prevState.show
        }))
    }
    render() {
        return(

                <button onClick={(e) => {this.props.show(e)}} id='login'>
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                    <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
                    <path d="M0 0h24v24H0z" fill="none"/>
                </svg>
                </button>

                    <button onClick={(e) => {this.props.toggle(e); this.props.switch(e)}} data-el='isLogInFormOpen'>Log In</button>
                    <button onClick={(e) => {this.props.toggle(e); this.props.switch(e)}} data-el='isCreatAccountFormOpen'>Create Account</button>

        )
    }

}

export default LoginAction<file_sep>/src/App.css
.sidemenu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  transform: translate3d(100%, 0, 0);
  background-color: #fff;
  max-width: 320px;
  width: 100%;
  transition: ease-in-out .2s;
  z-index: 10;
}

.js-open {
  transform: translate3d(0, 0, 0);
}

.js-mask {
   position: fixed;
   top:0;
   left:0;
   right:0;
   bottom:0;
   background-color: rgba(0,0,0,.4);
   z-index: 9;
}

.container {
  max-width: 800px;
  width: 100%;
  margin: auto;
  padding: 16px;
}

aside {
  max-width: 320px;
  padding: 16px;
}

.btn {
  display: block;
  max-width: 150px;
  margin-bottom: 16px;
  padding: 8px 16px;
  text-align: center;
  background-color: var(--blue);
  color: #fff;
  text-decoration: none;
}

.title {
  margin: 16px 0;
}
<file_sep>/src/providers/UserProvider.js
import React, {createContext} from 'react';
import {auth, createUserProfileDocument } from '../base'

export const UserContext = createContext()

class UserProvider extends React.Component {
    constructor() {
        super()
        this.state = {
            user: []
        }
    }

    unsubscribeFromAuth = null

    componentDidMount = async () => {
      this.unsubscribeFromAuth = auth.onAuthStateChanged(async userAuth => {
        const user = await createUserProfileDocument(userAuth)
        this.setState({user})
      })
    }

    render() {
        const {user} = this.state
        const {children} = this.props
        return (
            <UserContext.Provider value={user}>{children}</UserContext.Provider>
        )
    }
}

export default UserProvider

languages: Markdown JavaScript CSS

repo_language: Markdown


text:
<file_sep>package com.tj.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.LibraryBorrowDao;
import com.tj.dto.LibraryBorrowDto;

public class LRedateViewService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		String lCallnum = request.getParameter("lCallnum");
		LibraryBorrowDao lbDao = new LibraryBorrowDao();
		LibraryBorrowDto dto = lbDao.getBookNoReturn(lCallnum);
		request.setAttribute("returnDate", dto);
	}

}
<file_sep>DROP TABLE LIBRARYBORROW;
DROP SEQUENCE LIBRARYBORROW_SEQ;
CREATE SEQUENCE LIBRARYBORROW_SEQ MAXVALUE 999999 NOCACHE NOCYCLE;

CREATE TABLE LIBRARYBORROW (
    lbNum NUMBER(6) PRIMARY KEY,
    lCallnum VARCHAR2(100) REFERENCES LIBRARY(LCallnum),
    mId VARCHAR2(100) REFERENCES Member(mId),
    lbDate DATE DEFAULT SYSDATE,
    lbREdate DATE DEFAULT SYSDATE+14,
    lbREALre DATE);

SELECT BOOK.*, (SELECT COUNT(*) FROM LIBRARYBORROW WHERE BOOK.LCALLNUM=LIBRARYBORROW.LCALLNUM AND lbREALre IS NULL) FROM LIBRARY BOOK ORDER BY LCALLNUM;
-- 대출 처리
UPDATE LIBRARY SET LBORROW = 'N' WHERE LCALLNUM=5;
INSERT INTO LIBRARYBORROW (LBNUM, LCALLNUM, MID)
    VALUES (LIBRARYBORROW_SEQ.NEXTVAL, '5', 'aaa');
SELECT * FROM LIBRARYBORROW;
select * from library where ldel='N';

SELECT * FROM LIBRARYBORROW WHERE lCallnum=7 AND LBREALRE IS NULL;
UPDATE LIBRARY SET LBORROW = 'Y' WHERE lCallnum=5;
-- 빌려져있는책 불러오기
SELECT * FROM LIBRARYBORROW WHERE LCALLNUM='5' AND LBREALRE IS NULL;
-- 내가 빌린책
SELECT L.*,mId FROM LIBRARY L, LIBRARYBORROW B WHERE L.LCALLNUM = B.LCALLNUM AND B.mId='aaa' AND LBREALRE IS NULL;
SELECT COUNT(*) FROM LIBRARY L, LIBRARYBORROW B WHERE L.LCALLNUM = B.LCALLNUM AND B.mId='aaa' AND LBREALRE IS NULL;
-- 대출되어있는 책 보기ADMIN
SELECT * FROM LIBRARYBORROW WHERE LBREALRE IS NULL;
-- 반납 예정일이 지난 책 보기ADMIN
SELECT * FROM LIBRARYBORROW WHERE LBREALRE IS NULL AND lbREdate<SYSDATE;
-- 반납처리할때 반납일 갱신ADMIN
UPDATE LIBRARYBORROW SET lbREALre = SYSDATE WHERE lCallnum = 1;
-- 현황보기
SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT  LBNUM, B.LCALLNUM, LTITLE, MID, LBDATE, LBREDATE, LBREALRE FROM LIBRARYBORROW B, LIBRARY L WHERE B.lCallNum=L.lCallNum ORDER BY lbNum DESC) A)
            WHERE RN BETWEEN 1 AND 5;

select * from library where lcallnum=5;
select * from library;
SELECT * FROM LIBRARYBORROW WHERE lCallnum=5 AND LBREALRE IS NULL;
commit;<file_sep>package com.tj.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.tj.dao.BoardDao;
import com.tj.dao.NoticeDao;

public class NModifyService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {

		HttpSession session = request.getSession();
		int nNum = Integer.parseInt(request.getParameter("nNum"));
		String aId = (String)session.getAttribute("aId");
		String nTitle = request.getParameter("nTitle");
		String nContent = request.getParameter("nContent");
		NoticeDao nDao = new NoticeDao();
		int result = nDao.modify(nNum, nTitle, nContent);
		if(result == BoardDao.SUCCESS) { // 글쓰기 진행
			request.setAttribute("resultMsg", "글쓰기 성공");
		}else {
			request.setAttribute("resultMsg", "글쓰기 실패");
		}
	}
}
<file_sep>DROP TABLE BOARD;
DROP SEQUENCE BOARD_SEQ;

SELECT B.*, MNAME FROM BOARD B, MEMBER M WHERE B.MID=M.MID AND bNum=2;

CREATE SEQUENCE BOARD_SEQ MAXVALUE 999999 NOCACHE NOCYCLE;
CREATE TABLE BOARD(
    bNum NUMBER(6) PRIMARY KEY,
    bTitle VARCHAR2(100) NOT NULL,
    bContent VARCHAR2(300),
    bDate DATE DEFAULT SYSDATE,
    bHIT NUMBER(6) DEFAULT 0,
    bGroup NUMBER(6) NOT NULL,
    bStep NUMBER(3) NOT NULL,
    bIndent NUMBER(3) NOT NULL,
    mId VARCHAR2(30) REFERENCES MEMBER(mId),
    bIp VARCHAR2(20) NOT NULL);

    SELECT * FROM
				(SELECT ROWNUM RN, A.* FROM
				(SELECT * FROM BOARD ORDER BY BGROUP DESC, BSTEP) A)
				WHERE RN BETWEEN 1 AND 10;

-- 希耕汽戚斗 (据越)
INSERT INTO BOARD (bNum, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent, mId, bIp)
    VALUES (BOARD_SEQ.NEXTVAL, 'けけけけけけけけけけけけけけけけけけけけけけけけけけけけけけけけけ', 'content', null, 0,
        BOARD_SEQ.CURRVAL, 0, 0, 'aaa', '192.168.10.151');
SELECT * FROM BOARD;

-- 希耕汽戚斗(是税 1腰越拭 企廃 湛腰属 岩痕越)
INSERT INTO BOARD (bNum, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent, mId, bIp)
    VALUES (BOARD_SEQ.NEXTVAL, 'reply', 'content', null, 0,
        1, 1, 1, 'bbb', '192.168.10.151');
SELECT * FROM BOARD ORDER BY bGROUP DESC, bSTEP;
SELECT COUNT(*) cnt FROM BOARD;

-- 希耕汽戚斗 是税 1腰越拭 企廃 砧腰属 岩痕越
-- 岩痕越 蓄亜 穿 STPE a 呪楳
UPDATE BOARD SET bSTEP = bSTEP+1
    WHERE bGROUP = 1 AND bSTEP>0;
INSERT INTO BOARD (bNum, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent, mId, bIp)
    VALUES (BOARD_SEQ.NEXTVAL, 'reply', 'content', null, 0,
        1, 1, 1, 'bbb', '192.168.10.151');
COMMIT;

--bHIT 馬蟹 臣軒奄
UPDATE BOARD SET bHIT = bHIT +1 WHERE bNum=1;
SELECT B.*, MNAME FROM BOARD B, MEMBER M WHERE B.MID=M.MID AND bNum=1;
--bNum生稽 越 DTO 左奄
SELECT * FROM BOARD WHERE bNum=1;

--越 呪舛馬奄 (BNUM, BTITLE, BCONTENT, BIP, BDATE)
UPDATE BOARD SET BTITLE = '薦鯉',
                           BCONTENT = '沙庚',
                           BIP = '192.168.151.0',
                           BDATE = SYSDATE
                           WHERE BNUM = 1;

-- 働舛越 肢薦(id壱形)
DELETE FROM BOARD WHERE BNUM=1 AND MID='11';

-- 越鯉系 startRow endRow
SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT B.*, MNAME FROM BOARD B, MEMBER M WHERE B.MID=M.MID
                ORDER BY BGROUP DESC, BSTEP) A) WHERE RN BETWEEN 1 AND 5;<file_sep>DROP TABLE NOTICE;
DROP SEQUENCE NOTICE_SEQ;

CREATE SEQUENCE NOTICE_SEQ MAXVALUE 999999 NOCACHE NOCYCLE;
CREATE TABLE NOTICE(
    nNum NUMBER(6) PRIMARY KEY,
    nTitle VARCHAR2(100) NOT NULL,
    nContent VARCHAR2(300),
    nDate DATE DEFAULT SYSDATE,
    nHIT NUMBER(6) DEFAULT 0,
    aId VARCHAR2(30) REFERENCES ADMINID(aId));

-- 더미데이터 (원글)
INSERT INTO NOTICE (nNum, nTitle, nContent, nDate, nHit, aId)
    VALUES (NOTICE_SEQ.NEXTVAL, '일부러 좀 길게 만든 제목 WWWWWWWWQWWQQWWWWW', 'content', SYSDATE, 0, 'ADMIN');
SELECT * FROM NOTICE;
commit;
--bHIT 하나 올리기
UPDATE NOTICE SET nHIT = nHIT +1 WHERE nNum=2;

--bNum으로 글 DTO 보기
SELECT * FROM NOTICE WHERE nNum=2;

--글 수정하기 (NNUM, NTITLE, NCONTENT, NDATE)
UPDATE NOTICE SET NTITLE = '제목',
                           NCONTENT = '본문',
                           NDATE = SYSDATE
                           WHERE nNUM = 2;

-- 특정글 삭제(id고려)
DELETE FROM NOTICE WHERE NNUM=3 AND AID='ADMIN';

--글 정보 가져오기
SELECT * FROM NOTICE WHERE NNUM=1;

-- 글갯수
SELECT COUNT(*) FROM NOTICE;

-- 글목록 startRow endRow
SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT * FROM NOTICE
                ORDER BY NNUM DESC) A) WHERE RN BETWEEN 1 AND 4;<file_sep> DROP TABLE BCode;
 CREATE TABLE BCode (
    bNumber NUMBER(3) PRIMARY KEY,
    bCodename VARCHAR(100));
SELECT * FROM BCode;
INSERT INTO BCode VALUES (000,'총류');
INSERT INTO BCode VALUES (001, '지식, 학문 일반');
INSERT INTO BCode VALUES (003, '이론체계 및 시스템');
INSERT INTO BCode VALUES (004, '컴퓨터과학');
INSERT INTO BCode VALUES (005, '프로그래밍, 프로그램, 데이터');
INSERT INTO BCode VALUES (007, '연구 일반 및 방법론');
INSERT INTO BCode VALUES (010, '도서학, 서지학');
INSERT INTO BCode VALUES (011, '저작');
INSERT INTO BCode VALUES (012, '사본, 판본, 제본');
INSERT INTO BCode VALUES (013, '출판 및 판매');
INSERT INTO BCode VALUES (014, '개인서지 및 목록');
INSERT INTO BCode VALUES (015, '국가별서지 및 목록');
INSERT INTO BCode VALUES (016, '주제별서지 및 목록');
INSERT INTO BCode VALUES (017, '특수서지 및 목록');
INSERT INTO BCode VALUES (018, '일반서지 및 목록');
INSERT INTO BCode VALUES (019, '장서목록');
INSERT INTO BCode VALUES (020, '문헌정보학');
INSERT INTO BCode VALUES (021, '도서관 행정 및 재정');
INSERT INTO BCode VALUES (022, '도서관 건물 및 설비');
INSERT INTO BCode VALUES (023, '도서관 경영, 관리');
INSERT INTO BCode VALUES (024, '수서, 정리 및 보존');
INSERT INTO BCode VALUES (025, '도서관 봉사 및 활동');
INSERT INTO BCode VALUES (026, '일반 도서관');
INSERT INTO BCode VALUES (027, '학교 및 대학도서관');
INSERT INTO BCode VALUES (028, '기록관리');
INSERT INTO BCode VALUES (029, '독서 및 정보매체의 이용');
INSERT INTO BCode VALUES (030, '백과사전');
INSERT INTO BCode VALUES (031, '한국어');
INSERT INTO BCode VALUES (032, '중국어');
INSERT INTO BCode VALUES (033, '일본어');
INSERT INTO BCode VALUES (034, '영어');
INSERT INTO BCode VALUES (035, '독일어');
INSERT INTO BCode VALUES (036, '프랑스어');
INSERT INTO BCode VALUES (037, '스페인어');
INSERT INTO BCode VALUES (038, '이탈리아어');
INSERT INTO BCode VALUES (039, '기타 제언어');
INSERT INTO BCode VALUES (040, '강연집, 수필집, 연설문집');
INSERT INTO BCode VALUES (041, '한국어');
INSERT INTO BCode VALUES (042, '중국어');
INSERT INTO BCode VALUES (043, '일본어');
INSERT INTO BCode VALUES (044, '영어');
INSERT INTO BCode VALUES (045, '독일어');
INSERT INTO BCode VALUES (046, '프랑스어');
INSERT INTO BCode VALUES (047, '스페인어');
INSERT INTO BCode VALUES (048, '이탈리아어');
INSERT INTO BCode VALUES (049, '기타 제언어');
INSERT INTO BCode VALUES (050, '일반 연속간행물');
INSERT INTO BCode VALUES (051, '한국어');
INSERT INTO BCode VALUES (052, '중국어');
INSERT INTO BCode VALUES (053, '일본어');
INSERT INTO BCode VALUES (054, '영어');
INSERT INTO BCode VALUES (055, '독일어');
INSERT INTO BCode VALUES (056, '프랑스어');
INSERT INTO BCode VALUES (057, '스페인어');
INSERT INTO BCode VALUES (058, '기타 제언어');
INSERT INTO BCode VALUES (059, '연감');
INSERT INTO BCode VALUES (060, '일반 학회, 단체, 협회, 기관');
INSERT INTO BCode VALUES (061, '아시아 일반 학회, 단체 등');
INSERT INTO BCode VALUES (062, '유럽 일반 학회, 단체 등');
INSERT INTO BCode VALUES (063, '아프리카 일반 학회, 단체 등');
INSERT INTO BCode VALUES (064, '북아메리카 일반 학회, 단체 등');
INSERT INTO BCode VALUES (065, '남아메리카 일반 학회, 단체 등');
INSERT INTO BCode VALUES (066, '오세아니아 일반 학회, 단체 등');
INSERT INTO BCode VALUES (067, '양극지방 일반 학회, 단체 등');
INSERT INTO BCode VALUES (068, '해양');
INSERT INTO BCode VALUES (069, '박물관학');
INSERT INTO BCode VALUES (070, '신문, 저널리즘');
INSERT INTO BCode VALUES (071, '아시아 신문, 저널리즘 등');
INSERT INTO BCode VALUES (072, '유럽 신문, 저널리즘 등');
INSERT INTO BCode VALUES (073, '아프리카 신문, 저널리즘 등');
INSERT INTO BCode VALUES (074, '북아메리카 신문, 저널리즘 등');
INSERT INTO BCode VALUES (075, '남아메리카 신문, 저널리즘 등');
INSERT INTO BCode VALUES (076, '오세아니아 신문, 저널리즘 등');
INSERT INTO BCode VALUES (077, '양극지방 신문, 저널리즘 등');
INSERT INTO BCode VALUES (078, '특정주제의 신문');
INSERT INTO BCode VALUES (080, '일반전집, 총서');
INSERT INTO BCode VALUES (081, '개인의 일반 전집');
INSERT INTO BCode VALUES (082, '2인 이상의 일반 전집, 총서');
INSERT INTO BCode VALUES (090, '향토자료');
INSERT INTO BCode VALUES (100, '철학');
INSERT INTO BCode VALUES (101, '이론 및 철학의 효용');
INSERT INTO BCode VALUES (102, '잡저');
INSERT INTO BCode VALUES (103, '사전, 사전, 어사전');
INSERT INTO BCode VALUES (104, '강연집, 수필집');
INSERT INTO BCode VALUES (105, '연속간행물');
INSERT INTO BCode VALUES (106, '학회, 단체, 협회, 기관, 회의');
INSERT INTO BCode VALUES (107, '지도법, 연구법 및 교육, 교육자료');
INSERT INTO BCode VALUES (108, '총서, 전집, 선집');
INSERT INTO BCode VALUES (109, '철학사');
INSERT INTO BCode VALUES (110, '형이상학');
INSERT INTO BCode VALUES (111, '방법론');
INSERT INTO BCode VALUES (112, '존재론');
INSERT INTO BCode VALUES (113, '우주론 및 자연철학');
INSERT INTO BCode VALUES (114, '공간');
INSERT INTO BCode VALUES (115, '시간');
INSERT INTO BCode VALUES (116, '운동과 변화');
INSERT INTO BCode VALUES (117, '구조');
INSERT INTO BCode VALUES (118, '힘과 에너지');
INSERT INTO BCode VALUES (119, '물량과 질량');
INSERT INTO BCode VALUES (120, '인식론, 인과론, 인간학');
INSERT INTO BCode VALUES (121, '인식론');
INSERT INTO BCode VALUES (122, '인과론');
INSERT INTO BCode VALUES (123, '자유 및 필연');
INSERT INTO BCode VALUES (124, '목적론');
INSERT INTO BCode VALUES (125, '가치론');
INSERT INTO BCode VALUES (126, '철학적 인간학');
INSERT INTO BCode VALUES (130, '철학의 체계');
INSERT INTO BCode VALUES (131, '관념론 및 연관철학');
INSERT INTO BCode VALUES (132, '비판철학');
INSERT INTO BCode VALUES (133, '합리론');
INSERT INTO BCode VALUES (134, '인문주의');
INSERT INTO BCode VALUES (135, '경험론');
INSERT INTO BCode VALUES (136, '자연주의');
INSERT INTO BCode VALUES (137, '유물론');
INSERT INTO BCode VALUES (138, '과학주의');
INSERT INTO BCode VALUES (139, '기타');
INSERT INTO BCode VALUES (140, '경학');
INSERT INTO BCode VALUES (141, '역류');
INSERT INTO BCode VALUES (142, '서류');
INSERT INTO BCode VALUES (143, '시류');
INSERT INTO BCode VALUES (144, '예류');
INSERT INTO BCode VALUES (145, '악류');
INSERT INTO BCode VALUES (146, '춘추류');
INSERT INTO BCode VALUES (147, '효경');
INSERT INTO BCode VALUES (148, '사서');
INSERT INTO BCode VALUES (150, '동양철학, 사상');
INSERT INTO BCode VALUES (151, '한국철학, 사상');
INSERT INTO BCode VALUES (152, '중국철학, 사상');
INSERT INTO BCode VALUES (153, '일본철학, 사상');
INSERT INTO BCode VALUES (154, '동남아시아 제국 철학, 사상');
INSERT INTO BCode VALUES (155, '인도철학, 사상');
INSERT INTO BCode VALUES (156, '중앙아시아 제국 철학, 사상');
INSERT INTO BCode VALUES (157, '시베리아 철학, 사상');
INSERT INTO BCode VALUES (158, '서남아시아 제국 철학, 사상');
INSERT INTO BCode VALUES (159, '아라비아반도 철학, 사상');
INSERT INTO BCode VALUES (160, '서양철학');
INSERT INTO BCode VALUES (162, '미국철학');
INSERT INTO BCode VALUES (163, '북구철학');
INSERT INTO BCode VALUES (164, '영국철학');
INSERT INTO BCode VALUES (165, '독일, 오스트리아철학');
INSERT INTO BCode VALUES (166, '프랑스, 네덜란드철학');
INSERT INTO BCode VALUES (167, '스페인철학');
INSERT INTO BCode VALUES (168, '이탈리아철학');
INSERT INTO BCode VALUES (169, '러시아철학');
INSERT INTO BCode VALUES (170, '논리학');
INSERT INTO BCode VALUES (171, '연역법');
INSERT INTO BCode VALUES (172, '귀납법');
INSERT INTO BCode VALUES (173, '번증법적 논리학');
INSERT INTO BCode VALUES (174, '기소, 수리논리학');
INSERT INTO BCode VALUES (175, '오류');
INSERT INTO BCode VALUES (176, '삼단논법');
INSERT INTO BCode VALUES (177, '가설, 가정');
INSERT INTO BCode VALUES (178, '유추');
INSERT INTO BCode VALUES (179, '논증, 설득');
INSERT INTO BCode VALUES (180, '심리학');
INSERT INTO BCode VALUES (181, '심리학각론');
INSERT INTO BCode VALUES (182, '차이심리학');
INSERT INTO BCode VALUES (183, '발달심리학');
INSERT INTO BCode VALUES (184, '이상심리학');
INSERT INTO BCode VALUES (185, '생리심리학');
INSERT INTO BCode VALUES (186, '임상심리학');
INSERT INTO BCode VALUES (187, '심령연구 및 비학, 초심리학');
INSERT INTO BCode VALUES (188, '상법, 운명판단');
INSERT INTO BCode VALUES (189, '응용심리학 일반');
INSERT INTO BCode VALUES (190, '윤리학, 도덕철학');
INSERT INTO BCode VALUES (191, '일반윤리학 각론');
INSERT INTO BCode VALUES (192, '가정윤리');
INSERT INTO BCode VALUES (193, '국가 및 정치윤리');
INSERT INTO BCode VALUES (194, '사회윤리');
INSERT INTO BCode VALUES (195, '직업윤리 일반');
INSERT INTO BCode VALUES (196, '오락 및 경기윤리');
INSERT INTO BCode VALUES (197, '성윤리 및 생식윤리');
INSERT INTO BCode VALUES (198, '소비윤리');
INSERT INTO BCode VALUES (199, '도덕훈, 교훈');
INSERT INTO BCode VALUES (200, '종교');
INSERT INTO BCode VALUES (201, '종교철학 및 종교사상');
INSERT INTO BCode VALUES (202, '잡저');
INSERT INTO BCode VALUES (203, '사전(辭典), 사전(事典)');
INSERT INTO BCode VALUES (204, '자연종교, 자연신학');
INSERT INTO BCode VALUES (205, '연속간행물');
INSERT INTO BCode VALUES (206, '학회, 단체, 협회, 기관, 회의');
INSERT INTO BCode VALUES (207, '지도법, 연구법 및 교육, 교육자료');
INSERT INTO BCode VALUES (208, '총서, 전집, 선집');
INSERT INTO BCode VALUES (209, '종교사');
INSERT INTO BCode VALUES (210, '비교종교');
INSERT INTO BCode VALUES (211, '교리');
INSERT INTO BCode VALUES (212, '종교창시자(교주) 및 제자');
INSERT INTO BCode VALUES (213, '경전, 성전');
INSERT INTO BCode VALUES (214, '종교신앙, 신앙록, 신앙활동, 수도생활');
INSERT INTO BCode VALUES (215, '선교, 포교, 전도, 교육활동');
INSERT INTO BCode VALUES (216, '종단, 교단(교단론)');
INSERT INTO BCode VALUES (217, '예배형식, 의식, 의례');
INSERT INTO BCode VALUES (218, '종파, 교파');
INSERT INTO BCode VALUES (219, '신화, 신화학');
INSERT INTO BCode VALUES (220, '불교');
INSERT INTO BCode VALUES (221, '불교교리');
INSERT INTO BCode VALUES (222, '부처, 보살, 불제자');
INSERT INTO BCode VALUES (223, '경전(불전, 불경, 대장경)');
INSERT INTO BCode VALUES (224, '종교신앙, 신앙록, 신앙생활');
INSERT INTO BCode VALUES (225, '포교, 교육, 교화활동');
INSERT INTO BCode VALUES (226, '사원론');
INSERT INTO BCode VALUES (227, '법회, 의식, 행사(의궤)');
INSERT INTO BCode VALUES (228, '종파');
INSERT INTO BCode VALUES (229, '라마교');
INSERT INTO BCode VALUES (230, '기독교');
INSERT INTO BCode VALUES (231, '기독교신학, 교의학(조직신학)');
INSERT INTO BCode VALUES (232, '예수 그리스도, 사도');
INSERT INTO BCode VALUES (233, '성서(성경)');
INSERT INTO BCode VALUES (234, '종교신앙, 신앙록, 신앙생활');
INSERT INTO BCode VALUES (235, '전도, 교육, 교화 활동, 목회학');
INSERT INTO BCode VALUES (236, '교회론');
INSERT INTO BCode VALUES (237, '예배, 의식, 성례');
INSERT INTO BCode VALUES (238, '교파');
INSERT INTO BCode VALUES (239, '유대교(유태교)');
INSERT INTO BCode VALUES (240, '도교');
INSERT INTO BCode VALUES (241, '교의, 신선사상');
INSERT INTO BCode VALUES (242, '교주, 개조(장도릉)');
INSERT INTO BCode VALUES (243, '도장');
INSERT INTO BCode VALUES (244, '신앙록, 신앙생활');
INSERT INTO BCode VALUES (245, '포교, 전도, 교육, 교육 활동');
INSERT INTO BCode VALUES (246, '사원론(도관)');
INSERT INTO BCode VALUES (247, '행사, 법술');
INSERT INTO BCode VALUES (248, '교파');
INSERT INTO BCode VALUES (250, '천도교');
INSERT INTO BCode VALUES (251, '교리');
INSERT INTO BCode VALUES (252, '종교창시자(교주) 및 제자');
INSERT INTO BCode VALUES (253, '경전, 성전');
INSERT INTO BCode VALUES (254, '종교신앙, 신앙록, 신앙활동, 수도생활');
INSERT INTO BCode VALUES (255, '선교, 포교, 전도, 교육활동');
INSERT INTO BCode VALUES (256, '종단, 교단(교단론)');
INSERT INTO BCode VALUES (257, '예배형식, 의식, 의례');
INSERT INTO BCode VALUES (258, '동학교분파');
INSERT INTO BCode VALUES (259, '단군교, 대종교');
INSERT INTO BCode VALUES (270, '힌두교, 브라만교');
INSERT INTO BCode VALUES (271, '교리');
INSERT INTO BCode VALUES (272, '종교창시자(교주) 및 제자');
INSERT INTO BCode VALUES (273, '경전, 성전');
INSERT INTO BCode VALUES (274, '종교신앙, 신앙록, 신앙활동, 수도생활');
INSERT INTO BCode VALUES (275, '선교, 포교, 전도, 교육활동');
INSERT INTO BCode VALUES (276, '종단, 교단(교단론)');
INSERT INTO BCode VALUES (277, '예배형식, 의식, 의례');
INSERT INTO BCode VALUES (278, '종파, 교파');
INSERT INTO BCode VALUES (279, '자이나교');
INSERT INTO BCode VALUES (280, '이슬람교(회교)');
INSERT INTO BCode VALUES (281, '교리');
INSERT INTO BCode VALUES (282, '종교창시자(교주) 및 제자');
INSERT INTO BCode VALUES (283, '경전, 성전');
INSERT INTO BCode VALUES (284, '종교신앙, 신앙록, 신앙활동, 수도생활');
INSERT INTO BCode VALUES (285, '선교, 포교, 전도, 교육활동');
INSERT INTO BCode VALUES (286, '종단, 교단(교단론)');
INSERT INTO BCode VALUES (287, '예배형식, 의식, 의례');
INSERT INTO BCode VALUES (288, '종파, 교파');
INSERT INTO BCode VALUES (289, '조로아스터교(요교, 배화교)');
INSERT INTO BCode VALUES (290, '기타 제종교');
INSERT INTO BCode VALUES (291, '아시아');
INSERT INTO BCode VALUES (292, '유럽');
INSERT INTO BCode VALUES (293, '아프리카');
INSERT INTO BCode VALUES (294, '북아메리카');
INSERT INTO BCode VALUES (295, '남아메리카');
INSERT INTO BCode VALUES (296, '오세아니아, 양극지방');
INSERT INTO BCode VALUES (299, '기타 다른 기원의 종교');
INSERT INTO BCode VALUES (300, '사회과학');
INSERT INTO BCode VALUES (301, '사회사상');
INSERT INTO BCode VALUES (302, '잡저');
INSERT INTO BCode VALUES (303, '사전(辭典), 사전(事典)');
INSERT INTO BCode VALUES (304, '강연집, 수필집, 연설문집');
INSERT INTO BCode VALUES (305, '연속간행물');
INSERT INTO BCode VALUES (306, '학회, 단체, 협회, 기관, 회의');
INSERT INTO BCode VALUES (307, '연구법, 연구방법 및 교육, 교육자료');
INSERT INTO BCode VALUES (308, '총서, 전집, 선집');
INSERT INTO BCode VALUES (309, '사회 문화 사정');
INSERT INTO BCode VALUES (310, '통계자료');
INSERT INTO BCode VALUES (311, '아시아');
INSERT INTO BCode VALUES (312, '유럽');
INSERT INTO BCode VALUES (313, '아프리카');
INSERT INTO BCode VALUES (314, '북아메리카');
INSERT INTO BCode VALUES (315, '남아메리카');
INSERT INTO BCode VALUES (316, '오세아니아, 양극지방');
INSERT INTO BCode VALUES (317, '일반지역');
INSERT INTO BCode VALUES (319, '인구통계');
INSERT INTO BCode VALUES (320, '경제학');
INSERT INTO BCode VALUES (321, '경제각론');
INSERT INTO BCode VALUES (322, '경제정책');
INSERT INTO BCode VALUES (323, '산업경제, 일반');
INSERT INTO BCode VALUES (324, '기업경제');
INSERT INTO BCode VALUES (325, '경영');
INSERT INTO BCode VALUES (326, '상업, 교통, 통신');
INSERT INTO BCode VALUES (327, '금융');
INSERT INTO BCode VALUES (328, '보험');
INSERT INTO BCode VALUES (329, '재정');
INSERT INTO BCode VALUES (330, '사회학, 사회문제');
INSERT INTO BCode VALUES (331, '사회학');
INSERT INTO BCode VALUES (332, '사회 조직 및 제도');
INSERT INTO BCode VALUES (334, '사회문제');
INSERT INTO BCode VALUES (335, '생활문제');
INSERT INTO BCode VALUES (337, '여성문제');
INSERT INTO BCode VALUES (338, '사회복지');
INSERT INTO BCode VALUES (339, '사회단체');
INSERT INTO BCode VALUES (340, '정치학');
INSERT INTO BCode VALUES (341, '국가형태');
INSERT INTO BCode VALUES (342, '국가와 개인 및 집단');
INSERT INTO BCode VALUES (344, '선거');
INSERT INTO BCode VALUES (345, '입법');
INSERT INTO BCode VALUES (346, '정당');
INSERT INTO BCode VALUES (349, '외교, 국제관계');
INSERT INTO BCode VALUES (350, '행정학');
INSERT INTO BCode VALUES (351, '아시아');
INSERT INTO BCode VALUES (352, '유럽');
INSERT INTO BCode VALUES (353, '아프리카');
INSERT INTO BCode VALUES (354, '북아메리카');
INSERT INTO BCode VALUES (355, '남아메리카');
INSERT INTO BCode VALUES (356, '오세아니아, 양극지방');
INSERT INTO BCode VALUES (357, '일반지역');
INSERT INTO BCode VALUES (359, '지방자치 및 지방행정');
INSERT INTO BCode VALUES (360, '법률, 법학');
INSERT INTO BCode VALUES (361, '국제법');
INSERT INTO BCode VALUES (362, '헌법');
INSERT INTO BCode VALUES (363, '행정법');
INSERT INTO BCode VALUES (364, '형법');
INSERT INTO BCode VALUES (365, '민법');
INSERT INTO BCode VALUES (366, '상법');
INSERT INTO BCode VALUES (367, '사법제도 및 소송법');
INSERT INTO BCode VALUES (368, '기타 제법');
INSERT INTO BCode VALUES (369, '각국 법 및 예규');
INSERT INTO BCode VALUES (370, '교육학');
INSERT INTO BCode VALUES (371, '교육정책 및 행정');
INSERT INTO BCode VALUES (372, '학교행정 및 경영, 보건 및 교육지도');
INSERT INTO BCode VALUES (373, '학습지도, 교육방법');
INSERT INTO BCode VALUES (374, '교육과정');
INSERT INTO BCode VALUES (375, '유아 및 초등교육');
INSERT INTO BCode VALUES (376, '중등교육');
INSERT INTO BCode VALUES (377, '대학, 전문, 고등교육');
INSERT INTO BCode VALUES (378, '평생교육');
INSERT INTO BCode VALUES (379, '특수교육');
INSERT INTO BCode VALUES (380, '풍속, 예절, 민속학');
INSERT INTO BCode VALUES (381, '의식주의 풍습');
INSERT INTO BCode VALUES (382, '연령별, 성별, 신분별, 사회계층의 풍습');
INSERT INTO BCode VALUES (383, '사회생활의 풍습');
INSERT INTO BCode VALUES (384, '관혼상제');
INSERT INTO BCode VALUES (385, '예절');
INSERT INTO BCode VALUES (386, '축제, 세시풍속');
INSERT INTO BCode VALUES (388, '민속학');
INSERT INTO BCode VALUES (389, '문화인류학');
INSERT INTO BCode VALUES (390, '국방, 군사학');
INSERT INTO BCode VALUES (391, '군사행정');
INSERT INTO BCode VALUES (392, '전략, 전술');
INSERT INTO BCode VALUES (393, '군사교육 및 훈련');
INSERT INTO BCode VALUES (394, '군사시설 및 장비');
INSERT INTO BCode VALUES (395, '군특수기술근무');
INSERT INTO BCode VALUES (396, '육군');
INSERT INTO BCode VALUES (397, '해군');
INSERT INTO BCode VALUES (398, '공군');
INSERT INTO BCode VALUES (399, '고대병법');
INSERT INTO BCode VALUES (400, '자연과학');
INSERT INTO BCode VALUES (410, '수학');
INSERT INTO BCode VALUES (420, '물리학');
INSERT INTO BCode VALUES (430, '화학');
INSERT INTO BCode VALUES (440, '천문학');
INSERT INTO BCode VALUES (450, '지구과학');
INSERT INTO BCode VALUES (460, '광물학');
INSERT INTO BCode VALUES (470, '생명과학');
INSERT INTO BCode VALUES (480, '식물학');
INSERT INTO BCode VALUES (490, '동물학');
INSERT INTO BCode VALUES (500, '기술과학');
INSERT INTO BCode VALUES (510, '의학');
INSERT INTO BCode VALUES (520, '농업, 농학');
INSERT INTO BCode VALUES (530, '공학, 공업 일반, 토목공학, 환경공학');
INSERT INTO BCode VALUES (540, '건축공학');
INSERT INTO BCode VALUES (550, '기계공학');
INSERT INTO BCode VALUES (560, '전기공학, 전자공학');
INSERT INTO BCode VALUES (570, '화학공학');
INSERT INTO BCode VALUES (580, '제조업');
INSERT INTO BCode VALUES (590, '생활과학');
INSERT INTO BCode VALUES (600, '예술');
INSERT INTO BCode VALUES (620, '조각 및 조형미술');
INSERT INTO BCode VALUES (630, '공예, 장식미술');
INSERT INTO BCode VALUES (640, '서예');
INSERT INTO BCode VALUES (650, '회화, 도화');
INSERT INTO BCode VALUES (660, '사진 예술');
INSERT INTO BCode VALUES (670, '음악');
INSERT INTO BCode VALUES (680, '공연예술 및 매체예술');
INSERT INTO BCode VALUES (690, '오락, 스포츠');
INSERT INTO BCode VALUES (700, '언어');
INSERT INTO BCode VALUES (701, '언어학');
INSERT INTO BCode VALUES (702, '잡저');
INSERT INTO BCode VALUES (703, '사전');
INSERT INTO BCode VALUES (704, '강연집, 수필집');
INSERT INTO BCode VALUES (705, '연속간행물');
INSERT INTO BCode VALUES (706, '학회, 단체, 기관, 회의');
INSERT INTO BCode VALUES (707, '지도법, 연구법 및 교육, 교육자료');
INSERT INTO BCode VALUES (708, '전집, 총서');
INSERT INTO BCode VALUES (709, '언어사 및 언어정책, 언어행정');
INSERT INTO BCode VALUES (710, '한국어');
INSERT INTO BCode VALUES (711, '음운, 음성, 문자');
INSERT INTO BCode VALUES (712, '어원, 어의');
INSERT INTO BCode VALUES (713, '사전');
INSERT INTO BCode VALUES (714, '어휘');
INSERT INTO BCode VALUES (715, '문법');
INSERT INTO BCode VALUES (716, '작문');
INSERT INTO BCode VALUES (717, '독본, 해석, 회화');
INSERT INTO BCode VALUES (718, '방언(사투리)');
INSERT INTO BCode VALUES (720, '중국어');
INSERT INTO BCode VALUES (721, '음운, 음성, 문자');
INSERT INTO BCode VALUES (722, '어원, 어의');
INSERT INTO BCode VALUES (723, '사전');
INSERT INTO BCode VALUES (724, '어휘');
INSERT INTO BCode VALUES (725, '문법, 어법');
INSERT INTO BCode VALUES (726, '작문');
INSERT INTO BCode VALUES (727, '독본, 해석, 회화');
INSERT INTO BCode VALUES (728, '방언(사투리)');
INSERT INTO BCode VALUES (730, '일본어 및 기타 아시아제어');
INSERT INTO BCode VALUES (731, '음운, 음성, 문자');
INSERT INTO BCode VALUES (732, '어원, 어의');
INSERT INTO BCode VALUES (733, '사전');
INSERT INTO BCode VALUES (734, '어휘');
INSERT INTO BCode VALUES (735, '문법');
INSERT INTO BCode VALUES (736, '작문');
INSERT INTO BCode VALUES (737, '독본, 해석, 회화');
INSERT INTO BCode VALUES (738, '방언(사투리)');
INSERT INTO BCode VALUES (739, '기타 아시아 제어');
INSERT INTO BCode VALUES (740, '영어');
INSERT INTO BCode VALUES (741, '음운, 음성, 문자');
INSERT INTO BCode VALUES (742, '어원, 어의');
INSERT INTO BCode VALUES (743, '사전');
INSERT INTO BCode VALUES (744, '어휘');
INSERT INTO BCode VALUES (745, '문법');
INSERT INTO BCode VALUES (746, '작문');
INSERT INTO BCode VALUES (747, '독본, 해석, 회화');
INSERT INTO BCode VALUES (748, '방언(사투리)');
INSERT INTO BCode VALUES (749, '앵글로색슨어');
INSERT INTO BCode VALUES (750, '독일어');
INSERT INTO BCode VALUES (751, '음운, 음성, 문자');
INSERT INTO BCode VALUES (752, '어원, 어의');
INSERT INTO BCode VALUES (753, '사전');
INSERT INTO BCode VALUES (754, '어휘');
INSERT INTO BCode VALUES (756, '문법');
INSERT INTO BCode VALUES (756, '작문');
INSERT INTO BCode VALUES (757, '독본, 해석, 회화');
INSERT INTO BCode VALUES (758, '방언(사투리)');
INSERT INTO BCode VALUES (759, '기타 게르만어');
INSERT INTO BCode VALUES (760, '프랑스어');
INSERT INTO BCode VALUES (761, '음운, 음성, 문자');
INSERT INTO BCode VALUES (762, '어원, 어의');
INSERT INTO BCode VALUES (763, '사전');
INSERT INTO BCode VALUES (764, '어휘');
INSERT INTO BCode VALUES (765, '문법');
INSERT INTO BCode VALUES (766, '작문');
INSERT INTO BCode VALUES (767, '독본, 해석, 회화');
INSERT INTO BCode VALUES (768, '방언(사투리)');
INSERT INTO BCode VALUES (769, '프로방스어');
INSERT INTO BCode VALUES (770, '스페인어');
INSERT INTO BCode VALUES (771, '음운, 음성, 문자');
INSERT INTO BCode VALUES (772, '어원, 어의');
INSERT INTO BCode VALUES (773, '사전');
INSERT INTO BCode VALUES (774, '어휘');
INSERT INTO BCode VALUES (775, '문법');
INSERT INTO BCode VALUES (776, '작문');
INSERT INTO BCode VALUES (777, '독본, 해석, 회화');
INSERT INTO BCode VALUES (778, '방언(사투리)');
INSERT INTO BCode VALUES (779, '포르투갈어');
INSERT INTO BCode VALUES (780, '이탈리아어');
INSERT INTO BCode VALUES (781, '음운, 음성, 문자');
INSERT INTO BCode VALUES (782, '어원, 어의');
INSERT INTO BCode VALUES (783, '사전');
INSERT INTO BCode VALUES (784, '어휘');
INSERT INTO BCode VALUES (785, '문법');
INSERT INTO BCode VALUES (786, '작문');
INSERT INTO BCode VALUES (787, '독본, 해석, 회화');
INSERT INTO BCode VALUES (788, '방언(사투리)');
INSERT INTO BCode VALUES (789, '루마니아어');
INSERT INTO BCode VALUES (790, '기타 제어');
INSERT INTO BCode VALUES (792, '인도유럽어');
INSERT INTO BCode VALUES (793, '아프리카 제어');
INSERT INTO BCode VALUES (794, '북아메리카 인디안어');
INSERT INTO BCode VALUES (795, '남아메리카 인디안어');
INSERT INTO BCode VALUES (796, '오스트로네시아어족');
INSERT INTO BCode VALUES (797, '셈어족');
INSERT INTO BCode VALUES (798, '함어족');
INSERT INTO BCode VALUES (799, '국제어(인공어) 및 기타 언어');
INSERT INTO BCode VALUES (800, '문학');
INSERT INTO BCode VALUES (801, '문학이론');
INSERT INTO BCode VALUES (802, '문장작법, 수사학');
INSERT INTO BCode VALUES (803, '사전(辭典), 사전(事典)');
INSERT INTO BCode VALUES (804, '강연집, 수필');
INSERT INTO BCode VALUES (805, '연속간행물');
INSERT INTO BCode VALUES (806, '학회, 단체, 기관, 회의');
INSERT INTO BCode VALUES (807, '지도법 및 연구법, 교육, 교육자료');
INSERT INTO BCode VALUES (808, '전집, 총서');
INSERT INTO BCode VALUES (809, '문학사, 평론');
INSERT INTO BCode VALUES (810, '한국문학');
INSERT INTO BCode VALUES (811, '시');
INSERT INTO BCode VALUES (812, '희곡');
INSERT INTO BCode VALUES (813, '소설');
INSERT INTO BCode VALUES (814, '수필');
INSERT INTO BCode VALUES (815, '연설, 웅변');
INSERT INTO BCode VALUES (816, '일기, 서간, 기행');
INSERT INTO BCode VALUES (817, '풍자');
INSERT INTO BCode VALUES (818, '르포르타주 및 기타');
INSERT INTO BCode VALUES (820, '중국문학');
INSERT INTO BCode VALUES (821, '시');
INSERT INTO BCode VALUES (822, '희곡');
INSERT INTO BCode VALUES (823, '소설');
INSERT INTO BCode VALUES (824, '수필');
INSERT INTO BCode VALUES (825, '연설, 웅변');
INSERT INTO BCode VALUES (826, '일기, 서간, 기행');
INSERT INTO BCode VALUES (827, '풍자');
INSERT INTO BCode VALUES (828, '르포르타주 및 기타');
INSERT INTO BCode VALUES (830, '일본문학 및 기타 아시아문학');
INSERT INTO BCode VALUES (831, '시');
INSERT INTO BCode VALUES (832, '희곡');
INSERT INTO BCode VALUES (833, '소설');
INSERT INTO BCode VALUES (834, '수필');
INSERT INTO BCode VALUES (835, '연설, 웅변');
INSERT INTO BCode VALUES (836, '일기, 서간, 기행');
INSERT INTO BCode VALUES (837, '풍자');
INSERT INTO BCode VALUES (838, '르포르타주 및 기타');
INSERT INTO BCode VALUES (839, '기타 아시아 제문학');
INSERT INTO BCode VALUES (840, '영미문학');
INSERT INTO BCode VALUES (841, '시');
INSERT INTO BCode VALUES (842, '희곡');
INSERT INTO BCode VALUES (843, '소설');
INSERT INTO BCode VALUES (844, '수필');
INSERT INTO BCode VALUES (845, '연설, 웅변');
INSERT INTO BCode VALUES (846, '일기, 서간, 기행');
INSERT INTO BCode VALUES (847, '풍자');
INSERT INTO BCode VALUES (848, '르포르타주 및 기타');
INSERT INTO BCode VALUES (849, '미국문학');
INSERT INTO BCode VALUES (850, '독일문학');
INSERT INTO BCode VALUES (851, '시');
INSERT INTO BCode VALUES (852, '희곡');
INSERT INTO BCode VALUES (853, '소설');
INSERT INTO BCode VALUES (854, '수필');
INSERT INTO BCode VALUES (855, '연설, 웅변');
INSERT INTO BCode VALUES (856, '일기, 서간, 기행');
INSERT INTO BCode VALUES (857, '풍자');
INSERT INTO BCode VALUES (858, '르포르타주 및 기타');
INSERT INTO BCode VALUES (859, '기타 게르만 문학');
INSERT INTO BCode VALUES (860, '프랑스문학');
INSERT INTO BCode VALUES (861, '시');
INSERT INTO BCode VALUES (862, '희곡');
INSERT INTO BCode VALUES (863, '소설');
INSERT INTO BCode VALUES (864, '수필');
INSERT INTO BCode VALUES (865, '연설, 웅변');
INSERT INTO BCode VALUES (866, '일기, 서간, 기행');
INSERT INTO BCode VALUES (867, '풍자');
INSERT INTO BCode VALUES (868, '르포르타주 및 기타');
INSERT INTO BCode VALUES (869, '프로방스문학');
INSERT INTO BCode VALUES (870, '스페인문학 및 포르투갈문학');
INSERT INTO BCode VALUES (871, '시');
INSERT INTO BCode VALUES (872, '희곡');
INSERT INTO BCode VALUES (873, '소설');
INSERT INTO BCode VALUES (874, '수필');
INSERT INTO BCode VALUES (875, '연설, 웅변');
INSERT INTO BCode VALUES (876, '일기, 서간, 기행');
INSERT INTO BCode VALUES (877, '풍자');
INSERT INTO BCode VALUES (878, '르포르타주 및 기타');
INSERT INTO BCode VALUES (879, '포르투갈문학');
INSERT INTO BCode VALUES (880, '이탈리아문학');
INSERT INTO BCode VALUES (881, '시');
INSERT INTO BCode VALUES (882, '희곡');
INSERT INTO BCode VALUES (883, '소설');
INSERT INTO BCode VALUES (884, '수필');
INSERT INTO BCode VALUES (885, '연설, 웅변');
INSERT INTO BCode VALUES (886, '일기, 서간, 기행');
INSERT INTO BCode VALUES (887, '풍자');
INSERT INTO BCode VALUES (888, '르포르타주 및 기타');
INSERT INTO BCode VALUES (889, '루마니아문학');
INSERT INTO BCode VALUES (890, '기타 제문학');
INSERT INTO BCode VALUES (892, '인도-유럽계문학');
INSERT INTO BCode VALUES (893, '아프리카제문학');
INSERT INTO BCode VALUES (894, '북아메리카 인디언문학');
INSERT INTO BCode VALUES (895, '남아메리카 인디언문학');
INSERT INTO BCode VALUES (896, '오스트로네시아문학');
INSERT INTO BCode VALUES (897, '셈족문학');
INSERT INTO BCode VALUES (898, '함족문학');
INSERT INTO BCode VALUES (899, '기타 문학');
INSERT INTO BCode VALUES (900, '역사');
INSERT INTO BCode VALUES (901, '역사 철학 및 이론');
INSERT INTO BCode VALUES (902, '역사보조학');
INSERT INTO BCode VALUES (903, '사전, 사전');
INSERT INTO BCode VALUES (904, '강연집, 사평');
INSERT INTO BCode VALUES (905, '연속간행물');
INSERT INTO BCode VALUES (906, '학회, 단체, 기관, 회의');
INSERT INTO BCode VALUES (907, '지도법, 연구법 및 교육, 교육자료');
INSERT INTO BCode VALUES (908, '전집, 총서');
INSERT INTO BCode VALUES (909, '세계사, 세계문화사');
INSERT INTO BCode VALUES (910, '아시아');
INSERT INTO BCode VALUES (911, '한국');
INSERT INTO BCode VALUES (912, '중국');
INSERT INTO BCode VALUES (913, '일본');
INSERT INTO BCode VALUES (914, '동남아시아');
INSERT INTO BCode VALUES (915, '인디아와 남부아시아');
INSERT INTO BCode VALUES (916, '중앙아시아');
INSERT INTO BCode VALUES (917, '시베리아');
INSERT INTO BCode VALUES (918, '서남아시아, 중동');
INSERT INTO BCode VALUES (919, '아라비아반도와 인접지역');
INSERT INTO BCode VALUES (920, '유럽');
INSERT INTO BCode VALUES (921, '고대 그리스(희랍고대사)');
INSERT INTO BCode VALUES (922, '고대 로마');
INSERT INTO BCode VALUES (923, '스칸디나비아');
INSERT INTO BCode VALUES (924, '영국, 아일랜드');
INSERT INTO BCode VALUES (925, '독일과 중앙유럽');
INSERT INTO BCode VALUES (926, '프랑스와 인접국가');
INSERT INTO BCode VALUES (927, '스페인과 인접국가');
INSERT INTO BCode VALUES (928, '이탈리아와 인접국가');
INSERT INTO BCode VALUES (929, '러시아와 동부유럽');
INSERT INTO BCode VALUES (930, '아프리카');
INSERT INTO BCode VALUES (931, '북아프리카');
INSERT INTO BCode VALUES (934, '서아프리카');
INSERT INTO BCode VALUES (936, '중앙아프리카');
INSERT INTO BCode VALUES (937, '동아프리카');
INSERT INTO BCode VALUES (938, '남아프리카');
INSERT INTO BCode VALUES (939, '남인도양제도');
INSERT INTO BCode VALUES (940, '북아메리카');
INSERT INTO BCode VALUES (941, '캐나다');
INSERT INTO BCode VALUES (942, '미국(미합중국)');
INSERT INTO BCode VALUES (943, '멕시코');
INSERT INTO BCode VALUES (944, '중앙아메리카(중미제국)');
INSERT INTO BCode VALUES (945, '과테말라, 벨리즈, 엘살바도르');
INSERT INTO BCode VALUES (946, '온두라스');
INSERT INTO BCode VALUES (947, '니카라과');
INSERT INTO BCode VALUES (948, '코스타리카, 파나마');
INSERT INTO BCode VALUES (949, '서인도제도');
INSERT INTO BCode VALUES (950, '남아메리카');
INSERT INTO BCode VALUES (951, '콜롬비아');
INSERT INTO BCode VALUES (952, '베네수엘라와 기아나 지역');
INSERT INTO BCode VALUES (953, '브라질');
INSERT INTO BCode VALUES (954, '에콰도르');
INSERT INTO BCode VALUES (955, '페루');
INSERT INTO BCode VALUES (956, '볼리비아');
INSERT INTO BCode VALUES (957, '파라과이, 우루과이');
INSERT INTO BCode VALUES (958, '아르헨티나');
INSERT INTO BCode VALUES (959, '칠레');
INSERT INTO BCode VALUES (960, '오세아니아, 양극지방');
INSERT INTO BCode VALUES (962, '오스트레일리아(호주)');
INSERT INTO BCode VALUES (963, '뉴질랜드');
INSERT INTO BCode VALUES (964, '파푸아뉴기니');
INSERT INTO BCode VALUES (965, '멜라네시아');
INSERT INTO BCode VALUES (966, '미크로네시아와 인접 국가');
INSERT INTO BCode VALUES (967, '폴리네시아와 하와이');
INSERT INTO BCode VALUES (968, '대서양제도');
INSERT INTO BCode VALUES (969, '양극지방');
INSERT INTO BCode VALUES (970, '미분류');
INSERT INTO BCode VALUES (980, '지리');
INSERT INTO BCode VALUES (981, '아시아지리');
INSERT INTO BCode VALUES (982, '유럽지리');
INSERT INTO BCode VALUES (983, '아프리카지리');
INSERT INTO BCode VALUES (984, '북아메리카지리');
INSERT INTO BCode VALUES (985, '남아메리카지리');
INSERT INTO BCode VALUES (986, '오세아니아지리와 양극 지리');
INSERT INTO BCode VALUES (987, '지역 구분 일반지리');
INSERT INTO BCode VALUES (988, '해양');
INSERT INTO BCode VALUES (989, '지도 및 지도책');
INSERT INTO BCode VALUES (990, '전기');
INSERT INTO BCode VALUES (991, '아시아전기');
INSERT INTO BCode VALUES (992, '유럽전기');
INSERT INTO BCode VALUES (993, '아프리카전기');
INSERT INTO BCode VALUES (994, '북아메리카전기');
INSERT INTO BCode VALUES (995, '남아메리카전기');
INSERT INTO BCode VALUES (996, '오세아니아와 양극 전기');
INSERT INTO BCode VALUES (998, '주제별 전기');
INSERT INTO BCode VALUES (999, '계보, 족보');<file_sep>package com.tj.service;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.tj.dao.LibraryDao;
import com.tj.dto.LibraryDto;

public class LMyBorrowService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		System.out.println("들어옴?");
		HttpSession session = request.getSession();
		String mId = (String)session.getAttribute("mId");
		LibraryDao lDao = new LibraryDao();
		ArrayList<LibraryDto> dtos = lDao.myBookList(mId);
		request.setAttribute("mylist", dtos);
		int totCnt = lDao.getMyBookCnt(mId);
		request.setAttribute("mytotCnt", totCnt);
	}

}
<file_sep>package com.tj.service;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.NoticeDao;
import com.tj.dto.NoticeDto;

public class NListService5 implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {

		NoticeDao NoticeDao = new NoticeDao();
		ArrayList<NoticeDto> list = NoticeDao.list5();
		request.setAttribute("nlist", list);

		}
	}
<file_sep>package com.tj.service;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oreilly.servlet.MultipartRequest;
import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
import com.tj.dao.LibraryDao;

public class LInsertService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		// 파일첨부 로직 + 파라미터들 받아 DB에 join
		String path = request.getRealPath("libraryUp");
		int maxSize = 1024*1024*10; // 최대업로드 사이즈는 10M
		MultipartRequest mRequest = null;
		String lImage = "";
		try {
			mRequest = new MultipartRequest(request, path, maxSize,
									"utf-8", new DefaultFileRenamePolicy());
			Enumeration<String> params = mRequest.getFileNames();
			String param = params.nextElement();
			lImage = mRequest.getFilesystemName(param);
			// lTitle, lWriter, lYear, lPublicsher, lLocation, lImage, lKeyword, lBorrow, lMany, bNumber, lDel
			String lTitle = mRequest.getParameter("lTitle");
			String lWriter = mRequest.getParameter("lWriter");
			int lYear = Integer.parseInt(mRequest.getParameter("lYear"));
			String lPublicsher = mRequest.getParameter("lPublicsher");
			String lLocation = mRequest.getParameter("lLocation");
			String lKeyword = mRequest.getParameter("lKeyword");
			int bNumber = Integer.parseInt(mRequest.getParameter("bNumber"));
			LibraryDao lDao = new LibraryDao();
			int result = lDao.insertBook(lTitle, lWriter, lYear, lPublicsher, lLocation, lImage, lKeyword, bNumber);
			if(result == LibraryDao.SUCCESS) {
				request.setAttribute("resultMsg", "글쓰기 성공");
			}else {
				request.setAttribute("resultMsg", "글쓰기 실패");
			}
			// 결과에 따라 적절히 request.setAttribute
		} catch (IOException e) {
			System.out.println(e.getMessage());
			request.setAttribute("resultMsg", "글쓰기 실패");
		}
		// 서버에 올라간 fileboardUp 파일을 소스폴더에 filecopy
		File serverFile = new File(path+"/"+lImage);
		if(serverFile.exists()) {
			InputStream  is = null;
			OutputStream os = null;
			try {
				is = new FileInputStream(serverFile);
				os = new FileOutputStream("D:/mega_IT/source/6_JSP/1stProject/WebContent/libraryUp/"+lImage);
				byte[] bs = new byte[(int)serverFile.length()];
				while(true) {
					int nByteCnt = is.read(bs);
					if(nByteCnt==-1) break;
					os.write(bs, 0, nByteCnt);
				}
			} catch (Exception e) {
				System.out.println(e.getMessage());
			} finally {
				try {
					if(os!=null) os.close();
					if(is!=null) is.close();
				} catch (Exception e) {
					System.out.println(e.getMessage());
				}
			}
		}
	}

}
<file_sep>package com.tj.dto;

public class LibraryDto {
	private String lCallnum;
	private String lTitle;
	private String lWriter;
	private int lYear;
	private String lPublicsher;
	private String lLocation;
	private String lImage;
	private String lKeyword;
	private String lBorrow;
	private int lMany;
	private int bNumber;
	public LibraryDto() {}
	public LibraryDto(String lCallnum, String lTitle, String lWriter, int lYear, String lPublicsher, String lLocation,
			String lImage, String lKeyword, String lBorrow, int lMany, int bNumber) {
		this.lCallnum = lCallnum;
		this.lTitle = lTitle;
		this.lWriter = lWriter;
		this.lYear = lYear;
		this.lPublicsher = lPublicsher;
		this.lLocation = lLocation;
		this.lImage = lImage;
		this.lKeyword = lKeyword;
		this.lBorrow = lBorrow;
		this.lMany = lMany;
		this.bNumber = bNumber;
	}
	public String getlCallnum() {
		return lCallnum;
	}
	public void setlCallnum(String lCallnum) {
		this.lCallnum = lCallnum;
	}
	public String getlTitle() {
		return lTitle;
	}
	public void setlTitle(String lTitle) {
		this.lTitle = lTitle;
	}
	public String getlWriter() {
		return lWriter;
	}
	public void setlWriter(String lWriter) {
		this.lWriter = lWriter;
	}
	public int getlYear() {
		return lYear;
	}
	public void setlYear(int lYear) {
		this.lYear = lYear;
	}
	public String getlPublicsher() {
		return lPublicsher;
	}
	public void setlPublicsher(String lPublicsher) {
		this.lPublicsher = lPublicsher;
	}
	public String getlLocation() {
		return lLocation;
	}
	public void setlLocation(String lLocation) {
		this.lLocation = lLocation;
	}
	public String getlImage() {
		return lImage;
	}
	public void setlImage(String lImage) {
		this.lImage = lImage;
	}
	public String getlKeyword() {
		return lKeyword;
	}
	public void setlKeyword(String lKeyword) {
		this.lKeyword = lKeyword;
	}
	public String getlBorrow() {
		return lBorrow;
	}
	public void setlBorrow(String lBorrow) {
		this.lBorrow = lBorrow;
	}
	public int getlMany() {
		return lMany;
	}
	public void setlMany(int lMany) {
		this.lMany = lMany;
	}
	public int getbNumber() {
		return bNumber;
	}
	public void setbNumber(int bNumber) {
		this.bNumber = bNumber;
	}
	@Override
	public String toString() {
		return "LibraryDto [lCallnum=" + lCallnum + ", lTitle=" + lTitle + ", lWriter=" + lWriter + ", lYear=" + lYear
				+ ", lPublicsher=" + lPublicsher + ", lLocation=" + lLocation + ", lImage=" + lImage + ", lKeyword="
				+ lKeyword + ", lBorrow=" + lBorrow + ", lMany=" + lMany + ", bNumber=" + bNumber + "]";
	}
}
<file_sep>package com.tj.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.MemberDao;

public class IdConfirmService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		String mId = request.getParameter("mId");
		MemberDao mDao = new MemberDao();
		int result = mDao.mIdConfirm(mId);
		if(result == MemberDao.EXISTENT) {
			request.setAttribute("idConfirmMsg", "중복된 ID입니다");
		}else {
			request.setAttribute("idConfirmMsg", "사용가능한 ID입니다");
		}

	}

}
<file_sep>package com.tj.dao;

import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

import com.tj.dto.LibraryBorrowDto;

public class LibraryBorrowDao {
	public static final int FAIL = 0;
	public static final int SUCCESS = 1;
	private DataSource ds;
	public LibraryBorrowDao() {
		try {
			Context ctx = new InitialContext();
			ds =
			(DataSource) ctx.lookup("java:comp/env/jdbc/Oracle11g");
		} catch (NamingException e) {
			System.out.println(e.getMessage());
		}
	}
	//대출처리
	public int lbBorrowBook(String lCallnum, String mId) {
		int result = FAIL;
		Connection        conn  = null;
		PreparedStatement pstmt = null;
		String sql = "INSERT INTO LIBRARYBORROW (LBNUM, lCallnum, MID) " +
				"    VALUES (LIBRARYBORROW_SEQ.NEXTVAL, ?, ?)";
		try {
			conn = ds.getConnection();
			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, lCallnum);
			pstmt.setString(2, mId);
			result = pstmt.executeUpdate();
			if(result==SUCCESS) {
				borrowBook(lCallnum);
			}
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		}finally {
			try {
				if(pstmt!=null) pstmt.close();
				if(conn !=null) conn.close();
			} catch (SQLException e) {System.out.println(e.getMessage());}
		}
		return result;
	}
	//빌린상태로 만들기
	public void borrowBook(String lCallnum) {
		Connection        conn  = null;
		PreparedStatement pstmt = null;
		String sql = "UPDATE LIBRARY SET LBORROW = 'N' WHERE lCallnum=?";
		try {
			conn = ds.getConnection();pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, lCallnum);
			pstmt.executeUpdate();
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		}finally {
			try {
				if(pstmt!=null) pstmt.close();
				if(conn !=null) conn.close();
			} catch (SQLException e) {System.out.println(e.getMessage());}
		}
	}
	//반납처리
	public int lbReturnBook(String lCallnum) {
		int result = FAIL;
		Connection        conn  = null;
		PreparedStatement pstmt = null;
		ResultSet		  rs	= null;
		String sql = "SELECT * FROM LIBRARYBORROW WHERE lCallnum=? AND LBREALRE IS NULL";
		try {
			conn = ds.getConnection();
			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, lCallnum);
			rs = pstmt.executeQuery();
			rs.next();
			int lbNum = rs.getInt("lbNum");
			rs.next();
			returnBook(lCallnum);
			returnDate(lbNum);
			result=SUCCESS;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
	}
	// 빌리지 않은 상태로 만들기
		public void returnBook(String lCallnum) {
			Connection        conn  = null;
			PreparedStatement pstmt = null;
			String sql = "UPDATE LIBRARY SET LBORROW = 'Y' WHERE lCallnum=?";
			try {
				conn = ds.getConnection();pstmt = conn.prepareStatement(sql);
				pstmt.setString(1, lCallnum);
				pstmt.executeUpdate();
			} catch (SQLException e) {
				System.out.println(e.getMessage());
			}finally {
				try {
					if(pstmt!=null) pstmt.close();
					if(conn !=null) conn.close();
				} catch (SQLException e) {System.out.println(e.getMessage());}
			}
		}
	//반납일 생성하기
		public void returnDate(int lbNum) {
			Connection        conn  = null;
			PreparedStatement pstmt = null;
			String sql = "UPDATE LIBRARYBORROW SET lbREALre = SYSDATE WHERE lbNum=?";
			try {
				conn = ds.getConnection();pstmt = conn.prepareStatement(sql);
				pstmt.setInt(1, lbNum);
				pstmt.executeUpdate();
			} catch (SQLException e) {
				System.out.println(e.getMessage());
			}finally {
				try {
					if(pstmt!=null) pstmt.close();
					if(conn !=null) conn.close();
				} catch (SQLException e) {System.out.println(e.getMessage());}
			}
		}

	//내가 빌린책
	public ArrayList<LibraryBorrowDto> borrowList(String mId){
		ArrayList<LibraryBorrowDto> dtos = new ArrayList<LibraryBorrowDto>();
		Connection        conn  = null;
		PreparedStatement pstmt = null;
		ResultSet         rs    = null;
		String sql = "SELECT L.lCallnum, LTITLE, LWRITER, LIMAGE, lbDate, lbREdate FROM LIBRARY L, "
				+ 		"LIBRARYBORROW B WHERE L.lCallnum = B.lCallnum AND B.mId=?";
		try {
			conn = ds.getConnection();
			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, mId);
			rs = pstmt.executeQuery();
			while(rs.next()) {
				String lCallnum	= rs.getString("lCallnum");
				String lTitle	= rs.getString("lTitle");
				String lWriter	= rs.getString("lWriter");
				String lImage	= rs.getString("lImage");
				Date   lbDate	= rs.getDate("lbDate");
				Date   lbREdate	= rs.getDate("lbREdate");
				dtos.add(new LibraryBorrowDto(0, lCallnum, mId, lbDate, lbREdate, null, lTitle, lWriter, lImage));
			}
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		}finally {
			try {
				if(rs   !=null) rs.close();
				if(pstmt!=null) pstmt.close();
				if(conn !=null) conn.close();
			} catch (SQLException e) {System.out.println(e.getMessage());}
		}
		return dtos;
	}
	//대출되어있는책 보기 ADMIN
	public ArrayList<LibraryBorrowDto> noReturnBorrowList(int startRow, int endRow){
		ArrayList<LibraryBorrowDto> dtos = new ArrayList<LibraryBorrowDto>();
		Connection        conn  = null;
		PreparedStatement pstmt = null;
		ResultSet         rs    = null;
		String sql = "SELECT * FROM " +
				"        (SELECT ROWNUM RN, A.* FROM " +
				"            (SELECT B.*, LTITLE FROM LIBRARYBORROW B, LIBRARY L "
				+ "				WHERE B.lCallnum=L.lCallnum AND LBREALRE IS NULL ORDER BY lbNum DESC) A) " +
				"            WHERE RN BETWEEN ? AND ?";
		try {
			conn = ds.getConnection();
			pstmt = conn.prepareStatement(sql);
			pstmt.setInt(1, startRow);
			pstmt.setInt(2, endRow);
			rs = pstmt.executeQuery();
			while(rs.next()) {
				int lbNum		= rs.getInt("lbNum");
				String lTitle	= rs.getString("lTitle");
				String lCallnum	= rs.getString("lCallnum");
				String mId		= rs.getString("mId");
				Date   lbDate	= rs.getDate("lbDate");
				Date   lbREdate	= rs.getDate("lbREdate");
				dtos.add(new LibraryBorrowDto(lbNum, lCallnum, mId, lbDate, lbREdate, null, lTitle, null, null));
			}
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		}finally {
			try {
				if(rs   !=null) rs.close();
				if(pstmt!=null) pstmt.close();
				if(conn !=null) conn.close();
			} catch (SQLException e) {System.out.println(e.getMessage());}
		}
		return dtos;
	}
	//현황보기
		public ArrayList<LibraryBorrowDto> returnBorrowList(int startRow, int endRow){
			ArrayList<LibraryBorrowDto> dtos = new ArrayList<LibraryBorrowDto>();
			Connection        conn  = null;
			PreparedStatement pstmt = null;
			ResultSet         rs    = null;
			String sql = "SELECT * FROM " +
					"        (SELECT ROWNUM RN, A.* FROM " +
					"            (SELECT B.*, LTITLE FROM LIBRARYBORROW B, LIBRARY L "
					+ "				WHERE B.lCallnum=L.lCallnum ORDER BY lbNum DESC) A) " +
					"            WHERE RN BETWEEN ? AND ?";
			try {
				conn = ds.getConnection();
				pstmt = conn.prepareStatement(sql);
				pstmt.setInt(1, startRow);
				pstmt.setInt(2, endRow);
				rs = pstmt.executeQuery();
				while(rs.next()) {
					int lbNum		= rs.getInt("lbNum");
					String lTitle	= rs.getString("lTitle");
					String lCallnum	= rs.getString("lCallnum");
					String mId		= rs.getString("mId");
					Date   lbDate	= rs.getDate("lbDate");
					Date   lbREdate	= rs.getDate("lbREdate");
					Date   lbREALre	= rs.getDate("lbREALre");
					dtos.add(new LibraryBorrowDto(lbNum, lCallnum, mId, lbDate, lbREdate, lbREALre, lTitle, null, null));
				}
			} catch (SQLException e) {
				System.out.println(e.getMessage());
			}finally {
				try {
					if(rs   !=null) rs.close();
					if(pstmt!=null) pstmt.close();
					if(conn !=null) conn.close();
				} catch (SQLException e) {System.out.println(e.getMessage());}
			}
			return dtos;
		}
		//빌려져있는책 불러오기
		public LibraryBorrowDto getBookNoReturn(String lCallnum){
			LibraryBorrowDto dto = null;
			Connection        conn  = null;
			PreparedStatement pstmt = null;
			ResultSet         rs    = null;
			String sql = "SELECT * FROM LIBRARYBORROW WHERE lCallnum=? AND LBREALRE IS NULL";
			try {
				conn = ds.getConnection();
				pstmt = conn.prepareStatement(sql);
				pstmt.setString(1, lCallnum);
				rs = pstmt.executeQuery();
				while(rs.next()) {
					int lbNum		= rs.getInt("lbNum");
					String mId		= rs.getString("mId");
					Date   lbDate	= rs.getDate("lbDate");
					Date   lbREdate	= rs.getDate("lbREdate");
					dto = new LibraryBorrowDto(lbNum, lCallnum, mId, lbDate, lbREdate, null);
				}
			} catch (SQLException e) {
				System.out.println(e.getMessage());
			}finally {
				try {
					if(rs   !=null) rs.close();
					if(pstmt!=null) pstmt.close();
					if(conn !=null) conn.close();
				} catch (SQLException e) {System.out.println(e.getMessage());}
			}
			return dto;
		}
		//리스트갯수
		public int getListCnt(){
			int cnt = 0;
			Connection        conn  = null;
			PreparedStatement pstmt = null;
			ResultSet         rs    = null;
			String sql = "SELECT COUNT(*) FROM LIBRARYBORROW";
			try {
				conn = ds.getConnection();
				pstmt = conn.prepareStatement(sql);
				rs = pstmt.executeQuery();
				rs.next();
				cnt = rs.getInt(1);
			} catch (SQLException e) {
				System.out.println(e.getMessage());
			}finally {
				try {
					if(rs   !=null) rs.close();
					if(pstmt!=null) pstmt.close();
					if(conn !=null) conn.close();
				} catch (SQLException e) {System.out.println(e.getMessage());}
			}
			return cnt;
		}
}
<file_sep>DROP TABLE Library;
DROP SEQUENCE LIBRARY_SEQ;
CREATE SEQUENCE LIBRARY_SEQ MAXVALUE 999999 NOCACHE NOCYCLE;
CREATE TABLE Library (
    lCallnum VARCHAR2(100) PRIMARY KEY,
    lTitle VARCHAR2(100) NOT NULL,
    lWriter VARCHAR2(100),
    lYear NUMBER(4),
    lPublicsher VARCHAR(100),
    lLocation VARCHAR(100) NOT NULL,
    lImage VARCHAR(100) DEFAULT 'nothing.jpg',
    lKeyword VARCHAR(100),
    lBorrow VARCHAR(100) DEFAULT 'Y',
    lMany NUMBER(6) DEFAULT 0,
    bNumber NUMBER(3) REFERENCES BCode(bNumber),
    lDel VARCHAR(3) DEFAULT 'N');
INSERT INTO LIBRARY VALUES (LIBRARY_SEQ.NEXTVAL, '노빈손 에버랜드에 가다',
    '박경수', '2002', '뜨인돌', '보존서고1', 'nobinson_ever.jpg', '가다!', 'N', 0, 817,'N');

SELECT * FROM LIBRARY;
-- 도서목록
SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT * FROM LIBRARY ORDER BY LMANY, LTITLE DESC) A)
            WHERE RN BETWEEN 1 AND 2;
SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT L.*, lbDate, lbREdate FROM LIBRARY L, LIBRARYBORROW B WHERE L.lCallnum=B.lCallnum
                ORDER BY LMANY, LTITLE DESC) A) WHERE RN BETWEEN 1 AND 2;
-- 새로 들어온 책 4권
SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT * FROM LIBRARY ORDER BY LCALLNUM+0 DESC) A) WHERE RN BETWEEN 1 AND 4;

            commit;
-- 책검색
SELECT * FROM LIBRARY WHERE LTITLE LIKE '%'||?||'%' OR lKeyword LIKE '%'||?||'%';

-- 도서등록ADMIN
INSERT INTO LIBRARY (lCallnum, lTitle, lWriter, lYear, lPublicsher, lLocation, lImage, lKeyword, bNumber)
    VALUES (LIBRARY_SEQ.NEXTVAL, '노빈손, 피라미드의 비밀을 풀어라', '강영숙', '2000', '뜨인돌', '보존서고1', 'nothing.jpg', '노빈손', 980);
INSERT INTO LIBRARY (lCallnum, lTitle, lWriter, lYear, lPublicsher, lLocation, lImage, lKeyword, bNumber)
    VALUES (LIBRARY_SEQ.NEXTVAL, '노빈손, 티라노의 알을 찾아라', '강산들', '2009', '뜨인돌', '일반자료실1', 'nobinson_tirano.jpg', '노빈손,티라노,아동,백악기', 400);
INSERT INTO LIBRARY (lCallnum, lTitle, lWriter, lYear, lPublicsher, lLocation, lImage, lKeyword, bNumber)
    VALUES (LIBRARY_SEQ.NEXTVAL, '노빈손의 남극 어드벤처', '박경수', '2008', '뜨인돌', '일반자료실1', 'nobinson_polar.jpg', '노빈손,남극,소설,자연과학', 400);
-- 책 상세보기
SELECT * FROM LIBRARY WHERE LCALLNUM=4;
-- 도서수정ADMIN
UPDATE LIBRARY SET LTITLE = '노빈손, 피라미드의 비밀을 풀어라',
                             LWRITER = '강영숙',
                             LYEAR = 2000,
                             LPUBLICSHER = '뜨인돌',
                             LLOCATION = '보존서고1',
                             LIMAGE = 'nothing.jpg',
                             LKEYWORD = '노빈손, 이집트',
                             BNUMBER = 980
                WHERE LCALLNUM = 1;
    commit;
-- 도서삭제ADMIN
DELETE FROM LIBRARY WHERE LCALLNUM=3;
UPDATE LIBRARY SET lDel = 'Y' WHERE lCallnum=10;

-- 책 대출 처리(대출횟수 1 증가)
UPDATE LIBRARY SET LMANY = LMANY+1, LBORROW = 'N' WHERE LCALLNUM=1;
INSERT INTO LIBRARYBORROW (LBNUM, LCALLNUM, MID)
    VALUES (LIBRARYBORROW_SEQ.NEXTVAL, '1', 'aaa');
-- 책 반납 처리
UPDATE LIBRARY SET LBORROW = 'Y' WHERE LCALLNUM=5;
SELECT * FROM LIBRARYBORROW WHERE lCallnum=5 AND LBREALRE IS NULL;
UPDATE LIBRARYBORROW SET lbREALre = SYSDATE WHERE lbnum=6;

UPDATE LIBRARY SET LTITLE = ?,
				                     LWRITER = ?,
				                      LYEAR = ?,
                                     LPUBLICSHER = ?,
				                      LLOCATION = ?,
				                       LIMAGE = ?,
				                       LKEYWORD = ?,
				                       BNUMBER = ?
				               WHERE lCallnum = ?<file_sep>package com.tj.service;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.LibraryDao;
import com.tj.dto.LibraryDto;

public class LListService4 implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		LibraryDao lDao = new LibraryDao();
		ArrayList<LibraryDto> llist = lDao.newBookList();
		request.setAttribute("llist", llist);
	}

}
<file_sep>package com.tj.service;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.LibraryDao;
import com.tj.dto.LibraryDto;

public class LListService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		// pageNum받고, startRow, endRow 계산해서
		String pageNum = request.getParameter("pageNum");
		if(pageNum==null)pageNum = "1";
		int currentPage = Integer.parseInt(pageNum);
		final int PAGESIZE = 5, BLOCKSIZE=5;
		int startRow = (currentPage-1)*PAGESIZE +1;
		int endRow = startRow + PAGESIZE -1;
		// dao의 list(startRow, endRow)실행결과를 request.setAttribute
		LibraryDao lDao = new LibraryDao();
		ArrayList<LibraryDto> dtos = lDao.bookList(startRow, endRow);
		request.setAttribute("list", dtos);
		// totCnt, pageCnt, startPage, endPage, BLOCKSIZE
		//   => request.setAttribute
		int totCnt = lDao.getBookCnt();
		int pageCnt = (int)Math.ceil((double)totCnt/PAGESIZE);
		int startPage = ((currentPage-1)/BLOCKSIZE)*BLOCKSIZE+1;
		int endPage = startPage + BLOCKSIZE-1;
		if(endPage > pageCnt) {
			endPage = pageCnt;
		}
		request.setAttribute("totCnt", totCnt);
		request.setAttribute("pageCnt", pageCnt);
		request.setAttribute("startPage", startPage);
		request.setAttribute("endPage", endPage);
		request.setAttribute("BLOCKSIZE", BLOCKSIZE);
		request.setAttribute("pageNum", currentPage);
	}
}

<file_sep>package com.tj.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.BoardDao;

public class BDeleteService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		int bNum = Integer.parseInt(request.getParameter("bNum"));
		BoardDao boardDao = new BoardDao();
		int result = boardDao.delete(bNum);
		request.setAttribute("resultMsg", "글삭제성공");
	}

}
<file_sep>package com.tj.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tj.dao.BoardDao;
import com.tj.dao.NoticeDao;
import com.tj.dto.BoardDto;
import com.tj.dto.NoticeDto;

public class NModifyViewService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		int nNum = Integer.parseInt(request.getParameter("nNum"));
		NoticeDao nDao = new NoticeDao();
		NoticeDto dto = nDao.modifyView(nNum);
		request.setAttribute("modify_view", dto);
	}

}
<file_sep>김찬양 개인 프로젝트 소스 파일들입니다.

프로젝트명:

참여인원: 1명

기간	: 2019.03.06 ~ 2019.03.15

개발환경:

OS	 Windows 7 Professional K

WAS	 Apache Tomcat 8.5

DBMS	 Oracle 11g Express Edition

Language Java Platform 8 , JSP & Servlet

Model	 MVC (Model 2)

Web	 HTML5, CSS/CSS3, JavaScript

Tool	 Eclipse IDE for Java EE Developers, Sqldeveloper, eXERD (E-R Modeling Tool), Start UML

Open Source	jQuery v3.2.1, jQuery UI v.1.12.1, cos-26Dec2008
<file_sep><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="conPath" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
	<style>
		#content{width:1000px; margin:0 auto;
						background-size:cover;
            z-index:-99;
            background-image: url(css/배경2.jpg);}
		form{ width:325px; height:500px; margin:0 auto; }
		h1{margin:0 auto;}
		caption{font-size: 2em; padding: 12px;}
		tr,td{height: 30px; text-align: center;}
		.button{width:70px; height: 30px; margin: 0 auto;}
		input{height: 20px;}
		#space{height: 80px;}
	</style>
</head>
<body>
	<jsp:include page="../main/header.jsp"/>
	<div id="content">
	<form action="${conPath }/lInsert.do" method="post" enctype="multipart/form-data">
		<table>
			<caption>책등록 폼</caption>
			<tr><td>제목</td><td><input type="text" name="lTitle"
							required="required" size="30"></td></tr>
			<tr><td>저자</td><td><input type="text" name="lWriter" size="30"></td></tr>
			<tr><td>출판년도</td><td><input type="text" name="lYear" size="30"></td></tr>
			<tr><td>출판사</td><td><input type="text" name="lPublicsher" size="30"></td></tr>
			<tr><td>비치된곳</td><td><input type="text" name="lLocation"
							required="required" size="30"></td></tr>
			<tr><td>책 사진</td><td><input type="file" name="lImage"></td></tr>
			<tr><td>키워드</td><td><input type="text" name="lKeyword" size="30"></td></tr>
			<tr><td>분류번호</td><td><input type="text" name="bNumber"
							required="required" size="30" placeholder="제대로된 숫자를 입력해야합니다"></td></tr>
			<tr><td colspan="2"></td></tr>
			<tr><td colspan="2">
						<input type="submit" class="button" value="글쓰기">
						<input type="reset"class="button" value="취소">
						<input type="button"class="button" value="목록"
							onclick="location.href='${conPath}/lList.do'">
		</table>
	</form>
</div>
	<jsp:include page="../main/footer.jsp"/>
</body>
</html><file_sep>DROP TABLE MEMBER;
CREATE TABLE MEMBER (
    mId VARCHAR2(100) PRIMARY KEY,
    mPw VARCHAR2(100) NOT NULL,
    mName VARCHAR2(100) NOT NULL,
    mTel VARCHAR2(100),
    mBirth DATE,
    mEmail VARCHAR2(30),
    mGender VARCHAR2(5),
    mAddress VARCHAR(100),
    mDel VARCHAR(3) DEFAULT 'N');

    SELECT * FROM MEMBER;
-- mId confirm
    SELECT * FROM MEMBER WHERE MID='aaa';

-- join
    INSERT INTO MEMBER (MID, MPW, MNAME, MTEL, MBIRTH, MEMAIL, MGENDER, MADDRESS)
        VALUES ('aaa', '111', 'hong', NULL, TO_DATE('19900101','YYYYMMDD'), NULL, 'M', 'SEOUL');
    INSERT INTO MEMBER (MID, MPW, MNAME, MTEL, MBIRTH, MEMAIL, MGENDER, MADDRESS)
        VALUES ('bbb', '111', 'park', NULL, '1990-01-01', NULL, 'F', 'SEOUL');
    commit;
-- login
    SELECT * FROM MEMBER WHERE MID='aaa'; -- id wrong /pw wrong
    SELECT * FROM MEMBER WHERE MID='aaa' AND MPW='111';

-- mId로 dto 가져오기
    SELECT * FROM MEMBER WHERE MID='aaa';

-- modify info
    UPDATE MEMBER SET MPW='111',
                                        MNAME = '<NAME>',
                                        MTEL = '010-0000-0000',
                                        MBIRTH = NULL,
                                        MEMAIL = '<EMAIL>',
                                        MGENDER = 'F',
                                        MADDRESS = 'INCHON'
                            WHERE MID='aaa';
-- 회원 탈퇴
    UPDATE MEMBER SET mDel = 'Y' WHERE MID='bbb';

COMMIT;<file_sep>DROP TABLE ADMINID;

CREATE TABLE ADMINID (
    aId VARCHAR(30) PRIMARY KEY,
    aPw VARCHAR(30) NOT NULL,
    aName VARCHAR(30) NOT NULL);

-- 관리자 아이디
    INSERT INTO ADMINID VALUES ('ADMIN', '111', '관리자');

-- 가입한 회원 명수 가져오기
    SELECT COUNT(*) CNT FROM MEMBER;

-- startRow부터 endRow까지 회원가져오기
    SELECT * FROM MEMBER ORDER BY MID;
    SELECT ROWNUM RN, A.* FROM (SELECT * FROM MEMBER ORDER BY MID) A;
    SELECT * FROM
        (SELECT ROWNUM RN, A.* FROM
            (SELECT * FROM MEMBER ORDER BY MID) A) WHERE RN BETWEEN 1 AND 2;

-- 회원 탈퇴
    DELETE FROM MEMBER WHERE MID='bbb';<file_sep>package com.tj.service;

import java.sql.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.tj.dao.BoardDao;
import com.tj.dao.MemberDao;
import com.tj.dto.MemberDto;

public class MModifyService implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		HttpSession session = request.getSession();
		String mId = (String)session.getAttribute("mId");
		String mPw = request.getParameter("mPw");
		String mName = request.getParameter("mName");
		String mTel = request.getParameter("mTel");
		Date mBirth = null;
		String mBirthStr = request.getParameter("mBirth");
		if(!mBirthStr.equals("")) {
			mBirth = Date.valueOf(mBirthStr);
		}
		String mEmail = request.getParameter("mEmail");
		String mGender = request.getParameter("mGender");
		String mAddress = request.getParameter("mAddress");
		MemberDto dto = new MemberDto(mId, mPw, mName, mTel, mBirth, mEmail, mGender, mAddress, "n");
		MemberDao mDao = new MemberDao();
		int result = mDao.modifyMember(dto);
		if(result == MemberDao.SUCCESS) { // 수정 진행
			request.setAttribute("resultMsg", "수정 성공");
		}else {
			request.setAttribute("resultMsg", "수정 실패");
		}
	}

}
<file_sep>package com.tj.dto;

import java.sql.Date;

public class BoardDto {
	private int bNum;
	private String bTitle;
	private String bContent;
	private Date bDate;
	private int bHIT;
	private int bGroup;
	private int bStep;
	private int bIndent;
	private String mId;
	private String bIp;
	public BoardDto() {}
	public BoardDto(int bNum, String bTitle, String bContent, Date bDate, int bHIT, int bGroup, int bStep, int bIndent,
			String mId, String bIp) {
		this.bNum = bNum;
		this.bTitle = bTitle;
		this.bContent = bContent;
		this.bDate = bDate;
		this.bHIT = bHIT;
		this.bGroup = bGroup;
		this.bStep = bStep;
		this.bIndent = bIndent;
		this.mId = mId;
		this.bIp = bIp;
	}
	public int getbNum() {
		return bNum;
	}
	public void setbNum(int bNum) {
		this.bNum = bNum;
	}
	public String getbTitle() {
		return bTitle;
	}
	public void setbTitle(String bTitle) {
		this.bTitle = bTitle;
	}
	public String getbContent() {
		return bContent;
	}
	public void setbContent(String bContent) {
		this.bContent = bContent;
	}
	public Date getbDate() {
		return bDate;
	}
	public void setbDate(Date bDate) {
		this.bDate = bDate;
	}
	public int getbHIT() {
		return bHIT;
	}
	public void setbHIT(int bHIT) {
		this.bHIT = bHIT;
	}
	public int getbGroup() {
		return bGroup;
	}
	public void setbGroup(int bGroup) {
		this.bGroup = bGroup;
	}
	public int getbStep() {
		return bStep;
	}
	public void setbStep(int bStep) {
		this.bStep = bStep;
	}
	public int getbIndent() {
		return bIndent;
	}
	public void setbIndent(int bIndent) {
		this.bIndent = bIndent;
	}
	public String getmId() {
		return mId;
	}
	public void setmId(String mId) {
		this.mId = mId;
	}
	public String getbIp() {
		return bIp;
	}
	public void setbIp(String bIp) {
		this.bIp = bIp;
	}
	@Override
	public String toString() {
		return "BoardDto [bNum=" + bNum + ", bTitle=" + bTitle + ", bContent=" + bContent + ", bDate=" + bDate
				+ ", bHIT=" + bHIT + ", bGroup=" + bGroup + ", bStep=" + bStep + ", bIndent=" + bIndent + ", mId=" + mId
				+ ", bIp=" + bIp + "]";
	}
}

languages:
Java Server Pages
Java
Markdown
SQL
PLSQL

repo_language: Java Server Pages