스파르타코딩클럽

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
      integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
        integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
        crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
        integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
        crossorigin="anonymous"></script>

<title>스파르타코딩클럽 | 부트스트랩 연습하기</title>

<link href="https://fonts.googleapis.com/css2?family=Jua&display=swap" rel="stylesheet">

<style>
    * {
        font-family: 'Jua', sans-serif;
    }

    .item-img {
        width: 500px;
        height: 300px;

        background-image: url("https://t1.daumcdn.net/liveboard/nts/5bcccfbd33da4865817b9c606b6b852e.JPG");
        background-position: center;
        background-size: cover;
    }

    .price {
        font-size: 20px;
    }

    .item-desc {
        width: 500px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .item-order {
        width: 500px;
        margin-bottom: 50px;
    }

    .btn-order {
        margin: auto;
        width: 100px;

        display: block;
    }

    .wrap {
        width: 500px;
        margin: auto;
    }

    .rate {
        color: blue;
    }
</style>

<script>
    $(document).ready(function () {
        get_rate();
        listing();
    });

    function listing() {
        $.ajax({
            type: "GET",
            url: "/order",
            data: {},
            success: function (response) {
                if (response["result"] == "success") {
                    let orders = response['orders'];
                    for (let i = 0; i < orders.length; i++) {
                        let name = orders[i]['name'];
                        let count = orders[i]['count'];
                        let address = orders[i]['address'];
                        let phone = orders[i]['phone'];

                        let temp_html = `<tr>
                                            <th scope="row">${name}</th>
                                            <td>${count}</td>
                                            <td>${address}</td>
                                            <td>${phone}</td>
                                        </tr>`
                        $('#orders-box').append(temp_html)
                    }
                }
            }
        })
    }

    function get_rate() {
        $.ajax({
            type: "GET",
            url: "https://api.manana.kr/exchange/rate.json",
            data: {},
            success: function (response) {
                let now_rate = response[1]['rate'];
                $('#now-rate').text(now_rate);
            }
        })
    }

    function order() {
        let name = $('#order-name').val();
        let count = $('#order-count').val();
        let address = $('#order-address').val();
        let phone = $('#order-phone').val();

        $.ajax({
            type: "POST",
            url: "/order",
            data: {name_give: name, count_give: count, address_give: address, phone_give: phone},
            success: function (response) {
                if (response["result"] == "success") {
                    alert(response["msg"]);
                    window.location.reload();
                }
            }
        })
    }
</script>

양초를 팝니다 가격:3,000원/개

이 양초는 사실 특별한 힘을 지니고 있어요!

달러-원 환율: 1219.15

주문자이름
수량
-- 수량을 선택하세요 -- 1 2 3
주소
전화번호
주문하기
이름 수량 주소 전화번호
```

좋은 웹페이지 즐겨찾기