コード例 #1
0
ファイル: batch.php プロジェクト: NemOry/Skoolyf
<?php

require_once "header.php";
if ($session->is_logged_in()) {
    $loggeduser = User::get_by_id($session->user_id);
}
$pathinfo = pathinfo($_SERVER["PHP_SELF"]);
$basename = $pathinfo["basename"];
$currentFile = str_replace(".php", "", $basename);
$pageURL = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
echo "<input id='batchid' type='hidden'  value='" . $_GET['id'] . "'>";
if (isset($_GET['id'])) {
    $batch = Batch::get_by_id($_GET['id']);
    $school = School::get_by_id($batch->schoolid);
    $batchUsers = BatchUser::getUsersInBatch($batch->id);
    if ($session->is_logged_in()) {
        if (!User::get_by_id($session->user_id)->is_super_admin()) {
            if ($batch->pending == 1 || $batch->enabled == 0) {
                header("location: index.php?negative");
            }
        }
    } else {
        if ($batch->pending == 1 || $batch->enabled == 0) {
            header("location: index.php?negative");
        }
    }
} else {
    header("location: index.php?negative");
}
?>
コード例 #2
0
ファイル: 0.students.php プロジェクト: NemOry/Skoolyf
<?php

require_once "header.php";
$currentFile = str_replace(".php", "", pathinfo($_SERVER['PHP_SELF'])['basename']);
$batchUsers = BatchUser::getUsersInBatch($_GET['batchid']);
?>

<div class="container-fixed" >
  <div class="row-fixed" >
    <div class="span12 offset1">
      <?php 
foreach ($batchUsers as $batchuser) {
    $user = User::get_by_id($batchuser->userid);
    echo '
          <div class="span2 mygridbox">
            <img class="mygridimage" src="' . $user->picture() . '" />
            <p class="mygridname span2">' . $user->get_full_name() . '</p>
            <p class="mygridmotto">"' . $user->moto . '"</p>
            <p><a class="btn pull-bottom" href="profile.php?id=' . $user->id . '">View Profile &raquo;</a></p>
          </div>
        ';
}
?>
    </div><!--/span-->
  </div><!--/row-->
  
<?php 
require_once "footer.php";