Beispiel #1
0
function addUser($conn, $user)
{
    $array = ['queue_id' => $user->getQueueId(), "queue" => getQueue($conn, $user->getQueueId())->getName(), "position" => addUserDB($conn, $user), "serving" => getfirstInLine($conn, $user->getQueueId())];
    return $array;
}
Beispiel #2
0
</td>
				      <td><?php 
        echo $queue_user->position;
        ?>
</td>
				    </tr>
				    <?php 
    }
    ?>
				  </tbody>
				</table>
          </div>
          <?php 
    // }
    try {
        $current_position = getfirstInLine($conn, $_SESSION['id']);
        echo 'Now serving: ' . $current_position;
        echo '<form method="POST" action="">';
        echo '<button name="next_customer" value="submit">Next customer</button>';
        echo '</form>';
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
?>
<div class="mdl-layout__container has-scrolling-header"><div class="demo-layout mdl-layout mdl-layout--fixed-header mdl-js-layout mdl-color--grey-100 is-upgraded" data-upgraded=",MaterialLayout">
      <header class="demo-header mdl-layout__header mdl-layout__header--scroll mdl-color--grey-100 mdl-color-text--grey-800">
        <div class="mdl-layout__header-row">
          <span class="mdl-layout-title">Material Design Lite</span>
          <div class="mdl-layout-spacer"></div>
          <div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable is-upgraded" data-upgraded=",MaterialTextfield">
Beispiel #3
0
        echo '<div id="position">';
        echo '<h3>Your current position is:</h3>';
        echo '<h1 class="cover-heading"> ' . $_SESSION['position'] . '</h1>';
        echo '<h3 > In Queue "' . $_SESSION['curr_queue'] . '"</h3>';
        echo '</div>';
    }
}
if (isset($_GET['id']) || isset($_SESSION['queue_id'])) {
    if (isset($_GET['id'])) {
        $pgqid = $_GET['id'];
    } else {
        $pgqid = $_SESSION['queue_id'];
    }
    $queue_sel = getQueue($conn, intval($pgqid));
    echo '<h1 class="que-heading">"' . $queue_sel->getName() . '"</h1>';
    $firstInLine = getfirstInLine($conn, $pgqid);
    if (!empty($firstInLine)) {
        $lastInLine = getLastInLine($conn, $pgqid);
        $length = intval($lastInLine) - intval($firstInLine);
        for ($i = 0; $i < $length; $i++) {
            echo '<i class="que-circle"></i>';
        }
        if ($length > 1) {
            echo '<h2>There are ' . $length . ' people ahead of you</h2>';
        } elseif ($length == 1) {
            echo '<h2>There is ' . $length . ' person ahead of you</h2>';
        }
    } else {
        echo '<h1 class="cover-heading">Queue is Empty!!</h1>';
    }
}