-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit.php
26 lines (24 loc) · 935 Bytes
/
edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once("resources/core.php");
if(isset($_GET['songID']) && $_GET['songID']) {
$songID = $_GET['songID'];
if(isset($_POST) && !empty($_POST)) {
$response = edit_song_info($songID);
if($response['success']) {
$message = array('type'=>'success', 'text'=>$response['message'], 'destructs'=>true);
} else {
$message = array('type'=>'error', 'text'=>$response['message'], 'destructs'=>true);
}
}
$query = "SELECT * FROM music WHERE songID='".$db->escape($songID)."' LIMIT 1";
$row = $db->get_row($query);
if(!$row) {
$message = array('type'=>'error', 'text'=>"songID was not found", 'destructs'=>false);
}
} else {
$message = array('type'=>'error', 'text'=>"no songID specified", 'destructs'=>false);
}
include('resources/templates/head.php');
include('resources/templates/edit.php');
include('resources/templates/foot.php');
?>