[Dự án] Shop Auto chọn nhiều pet

  Bài viết hay nhất1
First topic message reminder :

Shop auto chọn nhiều pet © FCAmusement - VnIcefox 2014
Thiết kế: Méo Hắc Hắc (NCat) - K.
Cùng với sự giúp đỡ đắc lực của Zzbaivong - Devs.cf
Hàng mẫu, có thể lỗi nhiều
Tuyệt đối không xóa phần copyright bên dưới shop

Thông tin cập nhật code:
Chuyển từ nhiều gian hàng sang gian hàng dạng tab
Khi chọn xong có thể click thêm một lần nữa để bỏ hàng đang chọn
Hiện số hàng đang chọn ở Giỏ Hàng
Khi chưa chọn hàng sẽ không thể click vào nút gửi hóa đơn
Khung thông tin vẫn bao gồm tên, tiền và bài gửi
Sau khi chọn xong thì click vào nút gửi hóa đơn màu tím
Nói chung là như thế :v
Demo: http://fcatest6.forumvi.com/h2-page

[Dự án] Shop Auto chọn nhiều pet - Page 2 NEmlkkT

Code:
Tạo HTML : Do you wish to use your forum header and footer ? >> Có
Code:
<br/><div class="caigiday"><center><span style="font-size: 25px;font-weight: bold;color: #fff;">SHOP NÈ HÁ HÁ HÁ</span></center></div><br/>
<table border="0" style="width:100%">
  <tr>
    <td style="width:570px" valign="top">
      <div class="chonpet">
        <div class="tabbed_area">
       <ul class="tabs">
            <li><a href="#1" title="content_1" class="tab active">EMO MÉO 1</a></li>
            <li><a href="#2" title="content_2" class="tab">EMO MÉO 2</a></li>
        </ul>
       
        <div id="content_1" class="content">
            <div class="gianhang">
          <label>
            <input type="checkbox" name="item" class="item" />
            <img alt="item" src="http://i.imgur.com/peNYpHh.jpg" />
        </label>
        <label>
            <input type="checkbox" name="item" class="item" />
            <img alt="item" src="http://i.imgur.com/aUAn9JZ.jpg" />
        </label>
        <label>
            <input type="checkbox" name="item" class="item" />
            <img alt="item" src="http://i.imgur.com/TDIdQFQ.jpg" />
        </label>
        <label>
            <input type="checkbox" name="item" class="item" />
            <img alt="item" src="http://i.imgur.com/pjwIkFz.jpg" />
        </label>
     </div>
        </div>
        <div id="content_2" class="content">
            <div class="gianhang">
          <label>
            <input type="checkbox" name="item" class="item" />
      <img src="http://i.imgur.com/KSEvDV3.jpg"/>
          </label>
          <label>
            <input type="checkbox" name="item" class="item" />
      <img src="http://i.imgur.com/dI9F4RA.jpg"/>
          </label>
          <label>
            <input type="checkbox" name="item" class="item" />
      <img src="http://i.imgur.com/qKhd9RU.jpg"/>
          </label>
          <label>
            <input type="checkbox" name="item" class="item" />
      <img src="http://i.imgur.com/VGX73kB.jpg"/>
          </label>
          <label>
            <input type="checkbox" name="item" class="item" />
      <img src="http://i.imgur.com/vbJMG79.jpg"/>
          </label>
     </div>
        </div>
   
    </div>
     
  </div>
      <div class="headne">COPYRIGHT</div>
    <div class="cprshop">
      Shop auto chọn nhiều pet © FCAmusement - VnIcefox 2014<br/>
Thiết kế: Méo Hắc Hắc (NCat) - K.<br/>
Cùng với sự giúp đỡ đắc lực của Zzbaivong - Devs.cf<br/>
Vui lòng không rip code dưới mọi hình thức</div></td><td valign="top">
  <div id="cart">
<div class="headxem">GIỎ HÀNG (<span class="num">0</span>)</div>
<div class="xempetne"></div>
    <div class="tongtien">Tổng tiền: 0 Points</div>
  </div>
<div class="headxem">THÔNG TIN</div>
<div class="thongtinkhach">
Tên khách hàng: <span class="USERLINK" id="namene"></span><br />
Tài khoản: <span class="mypoint"></span> Points<br/>
Bài gửi: <span class="USERCOUNTPOST"></span> Bài
</div>
<!-- BEGIN switch_user_logged_out --><div class="muapet">
   <form id="abc" action="/post" class="frm-form" method="post" name="post" enctype="multipart/form-data">
        <div class="main-content frm">
                <input id="tieudepet" style="display:none" type="text" name="subject" value="" maxlength="255" title="The length of the title for this topic must be ranging between 10 and 255 characters" onkeypress="if (event.keyCode==13){return false}" />
                <script type="text/javascript">
                  //<![CDATA[
                  input = document.getElementsByName('subject');//]]>
                </script>
             <!-- Edit Textarea -->
              <textarea id="text_editor_textarea" name="message" style="display:none"></textarea>
             <!-- Edit Textarea -->
              <input type="hidden" name="mode" value="newtopic" />
              <input type="hidden" name="f" value="7" />
              <input type="hidden" name="lt" value="0" />
              <input id="submit" type="submit" name="post" value="Gửi hóa đơn" tabindex="6" accesskey="s" />
        </div>   
   </form>
</div><!-- END switch_user_logged_out -->
  </td></tr></table>

<script>
  $(".mypoint").load($(".name a").attr("href") + " #field_id-13 .field_uneditable");
  $("#submit").click(function(){
  $("#tieudepet").val("Hóa đơn của " + $('span.USERLINK a').html());});
 
</script>
<style>
.cprshop {border: 2px solid #3C6432;padding: 17px 20px;color: #3C6432;font-weight: bold;background: #CFE2CA;}
.caigiday {background: #6CA05F;padding: 20px;text-align: center;}
button, input[type="submit"] {cursor:pointer;outline:none!important}
div.chonpet img {cursor:pointer;}
#submit {display:none;background: #A05F96;padding: 5px;border: 0;color: #fff;font-size: 16px;font-weight: bold;font-family: 'Roboto' , sans-serif;box-sizing: inherit;width: 100%;margin-left: -1px;margin-top: -1px;}
.muapet {margin-left: 10px;width: calc(90% + 6px);margin-top:10px}
div.xempetne img {width: 75px;padding: 7px;}
.gianhang {overflow-y: scroll;overflow-x: hidden!important;border: 2px solid #816E52;background: #C5B091;padding: 5px;height: 220px;}
.gianhang img {padding: 4px;}
.gianhang .item {display: none;}
.gianhang .item + img {box-shadow: 0 0 0px transparent;}
.gianhang .item:checked + img {box-shadow: 0 0 5px #000;}
.headxem {padding: 7px;background: cadetblue;color: #fff;font-weight: bold;margin-top:10px;width: 90%;background: cadetblue;color: #fff;font-weight: bold;margin-left: 10px;}
.headxem:first-child {margin-top:0}
div.xempetne {border: 2px solid cadetblue;border-top:0;padding: 5px;overflow-y: scroll;overflow-x: hidden!important;background: #C4DEDF;height: 221px;width: 90%;margin-left: 10px;}
.lamlaine {background: rgb(76, 125, 126);padding: 5px;border: 0;color: #fff;font-weight: bold;float: right;margin-top: -4px;font-size: 14px;}
.headne {padding: 7px 10px;color: #fff;background: #3C6432;font-weight: bold;margin-top: 10px;}
.mypoint .field_uneditable {display: inline-block;}
.thongtinkhach {padding: 5px;border: 2px solid cadetblue;margin-left: 10px;width: 90%;}

  /**/ 
#tabbed_box_1{margin:0 auto 0 auto;width:300px}
.tabbed_box h4{font-family:Arial,Helvetica,sans-serif;font-size:23px;color:#fff;letter-spacing:-1px;margin-bottom:10px}
.tabbed_box h4 small{color:#e3e9ec;font-weight:normal;font-size:9px;font-family:Verdana,Arial,Helvetica,sans-serif;text-transform:uppercase;position:relative;top:-4px;left:6px;letter-spacing:0}
ul.tabs {height: 31px;background: #A0865F;margin: 0;padding: 0;}
ul.tabs li:first-child a {margin-left: 10px;}
ul.tabs li {margin-top: 7px;list-style: none;display: inline-block;}
ul.tabs li a {background: #64543C;padding: 10px;font-size: 9px;font-weight: bold;color: #fff!important;font-family: 'Roboto', sans-serif;}
ul.tabs li a.active {background: #7C6B52;}
#content_2,#content_3,#content_4,#content_5,#content_6,#content_7,#content_8,#content_9,#content_10{display:none}
.content ul{margin:0;padding:0 20px}
.content ul li{list-style:none;border-bottom:1px solid #d6dde0;padding-top:15px;padding-bottom:15px;font-size:13px}
.content ul li:last-child{border-bottom:none}
.content ul li a{text-decoration:none;color:#3e4346}
.content ul li a small{color:#8b959c;font-size:9px;text-transform:uppercase;font-family:Verdana,Arial,Helvetica,sans-serif;position:relative;left:4px;top:0}
.content ul li a:hover{color:#a59c83}
.content ul li a:hover small{color:#baae8e}
.tongtien {padding: 5px 10px;margin-top: 10px;margin-left: 10px;border: 2px solid #A05F5F;color:#A05F5F}
</style>

<script>
$(".gianhang .item").change(function () {
$("div.xempetne").html($(".item:checked + img").clone());
$("#cart .num").text($(".item:checked + img").length);
var bill = "";
$("div.xempetne img").each(function(){
bill += "[img]" + this.src + "[/img]";
});
$("#text_editor_textarea").val(bill + '\n\n Tổng tiền: ' + $(".item:checked + img").length*100 + ' Points');
$(".item:checked").length ? $("#submit").fadeIn(250) : $("#submit").fadeOut(250);
});
</script>
<script>
$(document).ready(function(){
// Sự kiện khi nhấn vào các tab của menu
$("a.tab").click(function () {
// tắt tất cả các tab
$(".active").removeClass("active");
// bật tab đang click lên
$(this).addClass("active");
// tạo hiệu ứng trượt lên trên cho nội dung của tab đang click
$(".content").hide();
// Nếu là tab đầu tiên thì set hiệu ứng là trượt xuống dưới
var content_show = $(this).attr("title");
$("#"+content_show).show();
});
});

$(window).load(function(){
if (Number($(".mypoint .field_uneditable").text()) >100) {
}
else {
alert("Xin lỗi bạn cần ít nhất 100 $ để thực hiện các chức năng trong Shop");
location.href="/forum";
}
});
$(".gianhang .item").change(function () {
$(".tongtien").text('Tổng tiền: ' + $("div.xempetne img").length*100 + ' Points');
if($("div.xempetne img").length*100 > Number($(".mypoint .field_uneditable").text())){alert('Bạn không đủ tiền để mua hết vật phẩm đã chọn\nHãy chọn lại cho phù hợp túi tiền của bạn')}
else{}
});
</script>

Thay 7 bằng id box muốn gửi hóa đơn trong đoạn
Code:

<input type="hidden" name="f" value="7" />

Lưu ý: ai chưa gán Variable cho forum thì thêm đoạn này vào cuối HTML:
Code:
<script type="text/javascript" src="http://yourjavascript.com/156126353119/fmvar.js"></script>
  Bài viết hay nhất26
Tại con méo chưa gán FMvar vào =)))))))))))
  Bài viết hay nhất27
Cập nhật thêm Tổng tiền khi mua hàng trong shop và bài gửi, cảnh báo khi tổng tiền cao hơn tiền đang có :v
  Bài viết hay nhất28
Nó bị lỗi thế này
[Dự án] Shop Auto chọn nhiều pet - Page 2 RWeMWhO
  Bài viết hay nhất29
@Nhocpronho49 : http://www.devs.cf/t395p15-dong-gop-shop-auto-chon-nhieu-pet-hang-mau#2568
The author of this message was banned from the forum - See the message
  Bài viết hay nhất31
Ồ vậy tức là đã cài Variable rồi, bỏ cái variable trong code shop ra đi :v
Chắc tại nó ghét mi nên nó không hiện đó
The author of this message was banned from the forum - See the message
  Bài viết hay nhất33
k hiện đc vậy :v
  Bài viết hay nhất34
xoá dòng này cho rồi Méo : "Vui lòng không rip code dưới mọi hình thức" - vì đã share rồi thì có ai lại đi rip nữa mà để
vs lại a cũng add vào k thấy hiện points - dù id=-13 trùng vs Méo @@ nhưng vẫn k hiện @@
  Bài viết hay nhất35
NCat wrote:Cập nhật thêm Tổng tiền khi mua hàng trong shop và bài gửi, cảnh báo khi tổng tiền cao hơn tiền đang có :v

tổng tiền cao hơn tiền đang có là sao ạ?
  Bài viết hay nhất36
nhokpronho49 wrote:
NCat wrote:Cập nhật thêm Tổng tiền khi mua hàng trong shop và bài gửi, cảnh báo khi tổng tiền cao hơn tiền đang có :v

tổng tiền cao hơn tiền đang có là sao ạ?
kiểu như bạn có 1000points thì k thể mua hàng nhiều hơn số tiền bạn có đc - lúc đó sẽ có 1 cảnh báo bạn đang thiếu tiền
  Bài viết hay nhất37
Vậy mỗi món hàng có giá trị bao nhiều tiền vậy ? mình có thể chình sửa lại được không?
  Bài viết hay nhất38
Mỗi mặt hàng trong shop méo để là cố định tiền như nhau luôn. tìm
Code:
*100
Sửa thành
Code:
*SÔ BẠN THÍCH
VD muốn mỗi hàng là 300 Points thì *300

Về lỗi get point thì để méo hỏi lại K
  Bài viết hay nhất39
Ò...tks Méo. Tại em thấy lạ tiền em 54633 mà nó để không đủ tiền nên mới hỏi
  Bài viết hay nhất40
Code còn nhiều lỗi nha. Không cần dùng fmvar đâu nhá. Số bài gửi cũng không cần lắm và lấy tên người dùng ra bằng link logout.
Code:

if (document.getElementById('logout')) {
   username = document.getElementById('logout').textContent.match(/\[ (.*?) \]/)[1]
}
muốn link tới profile thì dùng /profile.forum?mode=viewprofile&u=tênngườidùng

Điều kiện này
Code:
$(window).load(function () {
   if (Number($(".mypoint .field_uneditable").text()) > 100) {} else {
      alert("Xin lỗi bạn cần ít nhất 100 $ để thực hiện các chức năng trong Shop");
      location.href = "/forum";
   }
});
hoạt động cho với khách và đảm bảo phải hoạt động sau ajax tải .mypoint nếu không, sẽ không hoạt động. Tốt nhất chuyển .load qua .get rồi so sánh point trong function get đó luôn.
  Bài viết hay nhất41
Zero wrote:Tốt nhất chuyển .load qua .get rồi so sánh point trong function get đó luôn.
Đoạn này méo không hiểu lắm :(
  Bài viết hay nhất42
rút gọn js
Code:

$(function () {
   var point, username;
   // Lấy tên người dùng
   if (document.getElementById('logout')) {
      username = document.getElementById('logout').textContent.match(/\[ (.*?) \]/)[1];
      document.getElementById('namene').innerHTML = username;
   } else {
      alert('Đăng nhập để sử dụng chức năng này');
      location.href = "/forum";
   }
   // Lấy số point
   $.get('/profile.forum?mode=viewprofile&u=' + username, function (data) {
      point = $(data).find('field_id-13 .field_uneditable');
      // Nếu point nhỏ hơn 100
      if (point < 100 && point != undefined) {
         alert("Xin lỗi bạn cần ít nhất 100 $ để thực hiện các chức năng trong Shop");
         location.href = "/forum";
      }
      $(".mypoint").html(point);
   });
   $("#submit").click(function () {
      $("#tieudepet").val("Hóa đơn của " + username);
   });
   $("a.tab").click(function () {
      // tắt tất cả các tab
      $(".active").removeClass("active");
      // bật tab đang click lên
      $(this).addClass("active");
      // tạo hiệu ứng trượt lên trên cho nội dung của tab đang click
      $(".content").hide();
      // Nếu là tab đầu tiên thì set hiệu ứng là trượt xuống dưới
      var content_show = $(this).attr("title");
      $("#" + content_show).show();
   });
   $(".gianhang .item").change(function () {
      $("div.xempetne").html($(".item:checked + img").clone());
      $("#cart .num").text($(".item:checked + img").length);
      var bill = "";
      $("div.xempetne img").each(function () {
         bill += "[img]" + this.src + "[/img]";
      });
      $("#text_editor_textarea").val(bill + '\n\n Tổng tiền: ' + $(".item:checked + img").length * 100 + ' Points');
      $(".item:checked").length ? $("#submit").fadeIn(250) : $("#submit").fadeOut(250);
      $(".tongtien").text('Tổng tiền: ' + $("div.xempetne img").length * 100 + ' Points');
      if ($("div.xempetne img").length * 100 > point) {
         alert('Bạn không đủ tiền để mua hết vật phẩm đã chọn\nHãy chọn lại cho phù hợp túi tiền của bạn')
      }
   });
});
Edited 4/15/2014
  Bài viết hay nhất43
@^: Có vẻ hay! Giờ mới biết xài Get :)
  Bài viết hay nhất44
bác Zero: Cái đó không hiện Points :'(
  Bài viết hay nhất45
NCat wrote:bác Zero: Cái đó không hiện Points :'(
doi $(data).find('field_id-13 .field_uneditable'); thanh $(data).find('field_id-13 .field_uneditable').text(); thu xem :P
  Bài viết hay nhất46
Cũng vậy ạ -_-
  Bài viết hay nhất47
minh test van~ ok ma` dau co bi gi` dau @@
http://www.kenhgame8.com/h21-
id: testshop
pas: kenhgame8.com
  Bài viết hay nhất48
LilKhang1994 wrote:minh test van~ ok ma` dau co bi gi` dau @@
http://www.kenhgame8.com/h21-
id: testshop
pas: kenhgame8.com
bác cho thêm cái acc test 10k xu xem nào
The author of this message was banned from the forum - See the message
  Bài viết hay nhất50
Đưa demo đây để ta sửa -_-
  Bài viết hay nhất51
You cannot reply to topics in this forum