Beispiel #1
0
 public function forget($userId, $wordId, $type)
 {
     if (FlashCard::where('userId', $userId)->where('wordId', $wordId)->where('type', $type)->delete()) {
         return array('status' => 200);
     } else {
         return array('status' => 304);
     }
 }
Beispiel #2
0
<?php

require_once 'class.user.php';
require_once 'dbconfig.php';
require_once 'class.crud.php';
extract($_POST);
$decks = new FlashCard();
// get total
$c = $category;
$total = $total;
$count = $counter;
$percentage = $count / $total * 100;
// Display the Flashcards
if ($count <= $total) {
    ?>

<div class='stage'>
  <div class='flashcard'>
    <div class='front'>
      <p> 
      <?php 
    echo $decks->viewFront($count, $total, $c);
    ?>
     </p>
    </div>
    <div class='back'>
      <p>
      <?php 
    echo $decks->viewBack($count, $total, $c);
    ?>
      </p>
Beispiel #3
0
<?php

header('Content-Type: text/html; charset=ISO-8859-1');
session_start();
require_once 'class.user.php';
require_once 'dbconfig.php';
require_once 'class.crud.php';
$decks = new FlashCard();
$user_login = new USER();
/*if($user_login->is_logged_in()!="" && $_SERVER['HTTP_REFERER'] != 'http://'.$_SERVER['HTTP_HOST'].'/account.php')
{
	$user_login->redirect('account.php');
	exit();
}*/
/*if($user_login->is_logged_in()!="")
{
	$user_login->redirect('account.php');
}*/
if (isset($_POST['btn-login'])) {
    $email = trim($_POST['txtemail']);
    $upass = trim($_POST['txtupass']);
    if ($user_login->login($email, $upass) && $_SERVER['HTTP_REFERER'] != 'http://' . $_SERVER['HTTP_HOST'] . '/account.php') {
        $user_login->redirect('account.php');
    }
}
// show username, email and password if user is logged in
if ($user_login->is_logged_in() == 1) {
    list($username, $email, $password) = $user_login->getMember($_SESSION['userSession']);
}
// add +1 to php variable counter
if (isset($_POST['counter'])) {