<a href="#" onClick="getDeckDetails('7','null')"><img src="../img/sampleThumb.jpg"><span class="gItemTitle"><?php echo getDeckInfoFromId('7', 'display_name'); ?> </span></a> <span class="itemType"><?php echo getDeckInfoFromId('7', 'type'); ?> </span> <div class="gameItemPrice"> <span class="diamondP">DMD$ <?php echo getDeckInfoFromId('7', 'diamond_price'); ?> </span>; <span class="goldP">GLD$ <?php echo getDeckInfoFromId('7', 'gold_price'); ?> </span> </div> </li> </ul> </div> </div><!--end #middle-wrap.buyCol--> <!--</section>--> <!--********************************************************************* ITEM DESCRIPTION *************************************************************************--> <section> <div class="middle-wrap buyCol"> <h3>Item Description</h3> <div id="itemDescr">
<?php session_start(); header('Content-Type: text/html; charset=utf-8'); include_once "../include/check_login.php"; //if($user_ok == false){header("location: ../logout.php");} include_once '../stats.php'; $userId = getUserID(preg_replace('#[^a-z0-9]#i', '', $_SESSION['username'])); setSkill('cvset', $userId, getDeckShortName($_POST['deckId'], '')); setSkill('vStyle', $userId, $_POST['vStyle']); if (getSkill('cvset', $userId) != getDeckInfoFromId($_POST['deckId'], 'short_name') || getSkill('vStyle', $userId) != $_POST['vStyle']) { echo "sent id " . $_POST['deckId'] . "</br>" . getDeckShortName($_POST['deckId'], ''); echo getSkill('cvset', $userId) . "</br>"; echo getSkill('vStyle', $userId) . "</br>"; } else { echo "change_success"; }
?> Japanese Vocabulary Deck Details Page"><?php echo getDeckInfoFromId(getDeckInfo($cvset, 'series_prev'), 'display_name'); ?> </a></i> <br /><i>Recommended next: <a href="http://www.jpvocab.com/Japanese-Vocabulary/deck.php?t=<?php echo getDeckInfoFromId(getDeckInfo($cvset, 'series_next'), 'type'); ?> &d=<?php echo getDeckInfoFromId(getDeckInfo($cvset, 'series_next'), 'display_url'); ?> " title="<?php echo getDeckInfoFromId(getDeckInfo($cvset, 'series_next'), 'display_name'); ?> Japanese Vocabulary Deck Details Page"><?php echo getDeckInfoFromId(getDeckInfo($cvset, 'series_next'), 'display_name'); ?> </a></i> </div>--> </div> </div> </div> <!-- Quiz Word--> <div class="col-sm-4"> <div class="row" ><?php include_once $_SERVER['DOCUMENT_ROOT'] . "/mc_get.php"; //include('include/kanjiRE.php'); ?> <div class="col-xs-4 small text-left">Streak: <?php echo $_SESSION['streak']; ?>
function isHKid($id) { if (getDeckInfoFromId($id, 'short_name') == 'hirkat' or getDeckInfoFromId($id, 'short_name') == 'katakana') { return TRUE; } else { return FALSE; } }
$pkanjiRE = getPrice('kanjiRE', 'gc'); $pkanjiH = getPrice('kanjiH', 'gc'); $pkanjiE = getPrice('kanjiE', 'gc'); $pengKR = getPrice('engKR', 'gc'); $pengH = getPrice('engH', 'gc'); $pengK = getPrice('engK', 'gc'); $paudioR = getPrice('audioR', 'gc'); $paudioE = getPrice('audioE', 'gc'); $paudioK = getPrice('audioK', 'gc'); //Set Cell Contents $ownsRE = getDeckInfoFromId($value, 'kanjiRE') ? getOwnershipDeckVstyle($key, 'kanjiRE', $pid) : ''; $ownsE = getDeckInfoFromId($value, 'kanjiE') ? getOwnershipDeckVstyle($key, 'kanjiE', $pid) : ''; $ownsH = getDeckInfoFromId($value, 'kanjiH') ? getOwnershipDeckVstyle($key, 'kanjiH', $pid) : ''; $ownsAudR = getDeckInfoFromId($value, 'audioR') ? getOwnershipDeckVstyle($key, 'audioR', $pid) : ''; $ownsAudE = getDeckInfoFromId($value, 'audioE') ? getOwnershipDeckVstyle($key, 'audioE', $pid) : ''; $ownsAudK = getDeckInfoFromId($value, 'audioK') ? getOwnershipDeckVstyle($key, 'audioK', $pid) : ''; //$ownsE = (isHKid($value) == FALSE ? getOwnershipDeckVstyle($key,'kanjiE',$pid) : ''); //$ownsH = (isHKid($value) == FALSE ? getOwnershipDeckVstyle($key,'kanjiH',$pid) : ''); if ($ownsRE == TRUE) { // If own this decks KanjiRE $clvRE = getSkill($sDeck . '_kanjiRE_lv', $pid); $percRE = $clvRE == 1 ? 0 : round($clvRE / $deckMxLv * 100, 0); $finRE = $percRE == 100 ? "success sparkley" : ($percRE <= 25 && $percRE != 0 ? "warning" : ($percRE == 0 ? "danger" : "")); //Style it based off their progress } if ($ownsE == TRUE) { // If own this decks KanjiRE $clvE = getSkill($sDeck . '_kanjiE_lv', $pid); $percE = $clvE == 1 ? 0 : round($clvE / $deckMxLv * 100, 0); $finE = $percE == 100 ? "success sparkley" : ($percE <= 25 && $percE != 0 ? "warning" : ($percE == 0 ? "danger" : "")); //Style it based off their progress
$userCurrencyFunds = getStat('Diamonds', getUserID($_SESSION['username'])); } $balance = $userCurrencyFunds - $price; if ($owned == true) { $hTitle = "Oops..."; $failBuy = "You already own this deck."; $bought = false; } elseif ($balance < 0) { $lhsIcon = "<img src='../img/fail.jpg'>"; $hTitle = "Uh oh"; $failBuy = "<b>Insufficient funds. It seems you need more funds.</b><p>{$title} could be yours instantly if you get Diamonds from <a href='../diamond.php'>here</a>.</p>"; $bought = false; } elseif ($balance >= 0 and $owned == false) { buyDeck(getDeckInfoFromId($_POST['deckId'], 'short_name'), $userId, $currency); setOwnershipvStyle(getDeckInfoFromId($_POST['deckId'], 'short_name'), 'kanjiE', $userId); setOwnershipvStyle(getDeckInfoFromId($_POST['deckId'], 'short_name'), 'kanjiH', $userId); $bought = true; } else { $lhsIcon = ""; } //Assign Values for Results Template $msg = $failBuy; $linkLHS = ""; $linkRHS = ""; if ($bought == true) { $hTitle = "Congratulations!"; $lhsIcon = "<i class='fa check-circle-o fa-x5 text-success text-center' ></i>"; $msg = "You've purchased <b>{$title}</b> Japanese flashcard vocabulary deck. Thank you and Enjoy!"; $linkRHS = '<a href="#2" class="btn btn-link btn-block" onClick="sendToQuiz(' . $_POST['deckId'] . ',"kanjiRE","null")" role="button">Click to use it now <i class="fa fa-hand-point-o"></i></a>'; } ?>
?> <tr class="text-center"> <td class="text-left"><?php echo $key; ?> </td> <td <?php if ($reCnt < 10) { echo "class='danger'"; } ?> > <?php echo $reCnt; ?> </td><?php if (getDeckInfoFromId($value, 'short_name') != 'hirkat' && getDeckInfoFromId($value, 'short_name') != 'katakana') { ?> <td <?php if ($eCnt < 10) { echo "class='danger'"; } ?> > <?php echo $eCnt; ?> </td> <td <?php if ($hCnt < 10) { echo "class='danger'"; } ?>
<?php session_start(); include '../stats.php'; echo "<strong>Summary</strong>"; $title = getDeckInfoFromId($_POST['deckId'], 'display_name'); $cost = getDeckInfoFromId($_POST['deckId'], 'cost'); $userGold = getStat('Gold', getUserID($_SESSION['username'])); $balance = $userGold - $cost; $owned = getOwnershipStatus($_POST['deckId'], getUserID($_SESSION['username'])); ?> <button type="button" id="confirmCancel" onClick="disablePopup()">Cancel</button> <?php if ($balance < 0) { echo "<i>insufficient gold</i>"; } elseif ($owned == false) { ?> <button type="button" id="confirmBuy" onClick="buyDeck(getDeckInfoFromId('$_POST['deckId']','short_name'))">Buy!</button><?php } else { ?> <button type="button" id="confirmBuy" onClick="disablePopup()">Congrats! Deck already owned~</button><?php } ?> <div id="buyStatus"></div>