コード例 #1
0
function Def()
{
    global $mnux, $pref, $token;
    include_once "{$mnux}.{$_SESSION[$pref]}.php";
    $sub = !empty($_REQUEST['sub']) ? $_REQUEST['sub'] : "Def{$_SESSION[$pref]}";
    $sub();
}
// *** Parameters ***
$pref = 'mk';
$mnux = 'matakuliah';
$arrMK = array('Mata Kuliah->MK', 'MK Setara->MKSet', 'Kurikulum->Kur', 'Konsentrasi->Kons', 'Jenis Mata Kuliah->Jen', 'Pilihan Wajib->Pil', 'Jenis Kurikulum->JenKur', 'Nilai->Nil', 'MaxSKS->MaxSKS', 'Paket Matakuliah->Pkt', "Predikat->pred");
$tokendef = 'MK';
$token = GetSetVar($pref, $tokendef);
$prodi = GetSetVar('prodi');
$kurid = GetSetVar("kurid_{$prodi}");
$mkkode = GetSetVar("mkkode_{$prodi}");
if (empty($kurid) && !empty($prodi)) {
    $_kurid = GetaField("kurikulum", "NA='N' and ProdiID", $prodi, "KurikulumID");
    $_SESSION["kurid_{$prodi}"] = $_kurid;
    $kurid = $_kurid;
}
// *** Main ***
TampilkanJudul("Administrasi Mata Kuliah");
if (empty($_SESSION['_ProdiID'])) {
    echo ErrorMsg('Tidak Ada Hak Akses', "Anda tidak memiliki hak akses terhadap modul ini.<br>\r\n  Hubungi Superuser/Administrator untuk memberikan hak akses terhadap program studi.");
} else {
    TampilkanSubMenu($mnux, $arrMK, $pref, $token);
    if (!empty($token)) {
        Def();
    }
}
コード例 #2
0
ファイル: code.playlist.php プロジェクト: KiloooNL/radio
// The class handling song info
include_once 'classes/class.song.php';
if (ALLOW_REQUESTS) {
    // An array of song objects with the top requested songs
    $topRequestedSongs = Song::getTopRequestedSongs();
    $topPlayedSongs = Song::getTopPlayedSongs();
}
$start = Def('start', 0);
// Where the playlist must start
$limit = Def('limit', 25);
// How many items will be displayed
$search = Def('search');
// The search string
$character = Def('character');
// The letter to sort the playlist by
$search_fields = Def('fields');
// The fields to search in
if ("All" == $character) {
    unset($character);
}
//########## BUILD SEARCH STRING ################
$search_words = '';
if ($search != '') {
    $search_words = array();
    $search = stripslashes($search);
    $quote = explode('"', $search);
    reset($quote);
    while (list($qkey, $qval) = each($quote)) {
        if ($qkey & 1) {
            // Exact match
            $val = trim($qval);
コード例 #3
0
ファイル: code.songinfo.php プロジェクト: KiloooNL/radio
<?php

// The class handling song info
include_once 'classes/class.song.php';
$songID = Def('songID');
// The song object specified by the songID
$song = Song::getSong($songID);
コード例 #4
0
ファイル: code.request.php プロジェクト: KiloooNL/radio
    }
    if (empty($xmldata)) {
        throw new Exception('Invalid data returned!');
    }
    //#################################
    //	Initialize data
    //#################################
    $tree = XML2Array($xmldata);
    $request = Keys2Lower($tree["REQUEST"]);
    $code = $request["status"]["code"];
    $message = $request["status"]["message"];
    $requestID = $request["status"]["requestid"];
    if (empty($code)) {
        throw new Exception('Invalid data returned!');
    }
    if ($code != 200) {
        throw new Exception($message);
    }
} else {
    //If a request was already made, allow dedication to the request
    $data = array();
    $data['msg'] = strip_tags(Def('rmessage'));
    $data['name'] = strip_tags(Def('rname'));
    $db = Database::getInstance();
    $db->update('requestlist', $data, array('ID = ?' => $requestID, 'songID = ?' => $songID));
}
// Retrieve details of the requested song from the database.
if ($requestID > 0) {
    require_once 'classes/class.song.php';
    $song = Song::getRequestedSong($requestID);
}