Example #1
0
function main()
{
    init();
    connect();
    switch ($GLOBALS['req']['a']) {
        case 'getSongs':
            display('songs', getSongs());
            break;
        case 'getSongsMin':
            display('songsMin', getSongsMin());
            break;
        case 'add100':
            add100();
            display('done', 0);
            break;
    }
    echo json_encode($GLOBALS['final_print']);
    disconnect();
}
Example #2
0
function main()
{
    init();
    switch ($GLOBALS['req']['a']) {
        case 'getSongs':
            connect();
            display('songs', getSongs());
            break;
        case 'getSongsMin':
            connect();
            display('songsMin', getSongsMin());
            break;
        case 'add100':
            add100();
            display('done', 0);
            break;
        case 'getMembers':
            connect();
            display('members', getMembers());
            break;
        case 'validate':
            display('valid', validate($GLOBALS['req']['text']));
            break;
        case 'addMember':
            connect();
            addMember();
            break;
        case 'getNewImageName':
            connect();
            display('done', getNewImageName());
            break;
        case 'uploadPicture':
            connect();
            uploadPicture();
            break;
    }
    echo json_encode($GLOBALS['final_print']);
    disconnect();
}
Example #3
0
                    <ul>
                        <?php 
echo getChartCategories();
?>
                    </ul>
                </li> <!-- Submenu -->
                <li class="current-page"><a href="songs.php">SONGS</a></li>
                <li><a href="playlists.php">PLAYLISTS</a></li>
                <li><a href="contacts.php">CONTACTS</a></li>
            </ul>
        </nav>
        <section class="content-wrapper">
            <section class="album-section">
                <!-- Albums Section -->

                <?php 
getSongs();
?>
            </section>
        </section>
    </section>
    <footer>
        <p>&copy; All Rights Reserved</p>
    </footer>
</div>

<script>
    document.getElementById('background').style.height = window.innerHeight;
</script>
</body>
</html>
Example #4
0
require_once dirname(__FILE__) . '/../ExceptionHandling/ErrorToException.php';
require_once dirname(__FILE__) . '/../XML/XMLFactory.php';
require_once dirname(__FILE__) . '/../MySQL/SQLMediator.php';
function error_to_exception($code, $message, $file, $line, $context)
{
    if ($code != E_STRICT && $code != E_DEPRECATED) {
        throw new ErrorToException($code, $message, $file, $line, $context);
    }
}
set_error_handler("error_to_exception");
try {
    $mixTitle = $_POST['mixTitle'];
    $sql = new SQLMediator();
    $sql->connect();
    addToMixesLoadedTable($mixTitle, $sql);
    $xmlSongs = getSongs($mixTitle, $sql);
    echo $xmlSongs;
    $sql->disconnect();
} catch (Exception $ex) {
    echo GlobalExceptionHandler::writeException($ex);
}
function addToMixesLoadedTable($loadedMixesTitle, $sqlconn)
{
    $ip = $_SERVER['REMOTE_ADDR'];
    $loadedMixesTitle = str_replace("'", "\\'", $loadedMixesTitle);
    $res = $sqlconn->complexQuery("Select", "SELECT * FROM Mixes WHERE MixName = '{$loadedMixesTitle}'", 'Mixes');
    $mixid = getMixId($res);
    $now = getdate(date("U"));
    $datetime = new DateTime();
    $datetime->setDate($now['year'], $now['mon'], $now['mday']);
    $datetime->setTime($now['hours'], $now['minutes'] - 5, $now['seconds']);
Example #5
0
//Connect to database
require_once "connect_db.php";
require_once "algorithm.php";
//Pull trait information from database
$songname = $_POST["name"];
$sql = "SELECT * FROM \"USER04893\" . \"Songs\" WHERE \"title\" = LCASE('" . $songname . "')";
$stmt = db2_exec($conn4, $sql);
$losongs;
$row;
//Fetches the list of similar songs
if (!$stmt) {
    echo "SQL Statement Failed" . db2_stmt_errormsg() . "";
    return;
} else {
    $row = db2_fetch_array($stmt);
    $top = getSongs($row);
    $losongs = $top;
}
?>
	<br>
	<center><img src="images/logo.png" height="300px" width="300px" /></center>
	<table>

		<tr>
			<td colspan="3">The song you searched for is: <?php 
echo ucwords($row[0]);
?>
 by <?php 
echo ucwords($row[1]);
?>
</td>
Example #6
0
function get($arr)
{
    $music = new Music();
    if (isset($arr['songs'])) {
        return getSongs();
    } else {
        $result = array('on' => $music->isOn() ? 1 : 0, 'play' => $music->isPlay() ? 1 : 0, 'welcome' => isWelcomeMusic($arr['api']), 'vol' => $music->getVol(), 'songs' => getSongs());
        http_response_code(202);
        return $result;
    }
}