Skip to content

Commit

Permalink
Fix of spinner Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
Shou Ya committed Oct 10, 2012
1 parent 905aefe commit 23f1d34
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
6 changes: 3 additions & 3 deletions client/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ function detect_ie(){
</div>

<ul>
<!-- <li><a href="javascript:void(0)" class="btn_add_card">Add Card</a></li> -->
<?php if($forum_is_login){?>
<li><a href="javascript:void(0)" class="btn_save">Save</a></li>
<?php };?>
<li><a href="javascript:void(0)" class="btn_save">Save</a></li><?php }else{ ?>
<li><a href="/member.php?mod=register" class="btn_register">Register</a></li>
<?php }?>
<li><a href="javascript:void(0);" class="btn_book">Book Meal</a></li>
<?php if($forum_is_login){?>
<li><a href="/member.php?mod=logging&action=logout&formhash=<?php echo($forum_formhash);?>" class="btn_logout">Logout</a></li>
Expand Down
4 changes: 2 additions & 2 deletions client/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function book_meal_start() {
function card_e(card_no, target) {
var table = $(card_table);
target = (typeof target == 'undefined') ? '' : target;
e_card_no_input = table.find('input[value="' + card_no + '"]:first');
e_card_no_input = table.find('input[value=' + card_no + ']:first');
switch(target) {
case 'tr':
return e_card_no_input.closest('tr');
Expand All @@ -429,7 +429,7 @@ function card_e(card_no, target) {
break;
case 'btn':
return e_card_no_input.closest('tr')
.find('a[name="card_btn"]:first');
.find('a[name=card_btn]:first');
break;
}
return e_card_no_input;
Expand Down
15 changes: 13 additions & 2 deletions server/bookmeal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@
QUERY_LOGIN_URL = 'http://bgy.gd.cn/mis/info/list.asp'
QUERY_BOOKING_URL = 'http://bgy.gd.cn/mis/info/dc_info/dc3_new.asp'

def get_login_token
init_cookie = RestClient.get(QUERY_COOKIE_URL).cookies.to_a.first.join('=')

RestClient.post(QUERY_LOGIN_URL, {
:tbarno => card_no.to_s,
:passwd => password.to_s,
:hd => '001',
:B1 => "\xc8\xb7\xb6\xa8"
}, :cookie => init_cookie)

end

def bookmeal(card_no, password)
cookie = RestClient.get(QUERY_COOKIE_URL).cookies.to_a.first.join('=')

RestClient.post(QUERY_LOGIN_URL, {
:tbarno => card_no.to_s,
Expand Down Expand Up @@ -39,7 +50,7 @@ def bookmeal(card_no, password)
:B1 => "\xb1\xa3\xb4\xe6",
}.merge(fields.map {|a,b| {a=>b} }
.inject({}, &:merge)),
:cookie => cookie)
:cookie=> cookie)

result.include? "\xCD\xF8\xD2\xB3\xB9\xFD\xC6\xDA!!" and
raise WrongCardPassword
Expand Down

0 comments on commit 23f1d34

Please sign in to comment.