function get_file_info($dbh, $id) { $sql = "SELECT choir_member,note FROM main"; $stmt = $dbh->prepare($sql); $stmt->execute(); $obj = $stmt->fetchObject(); $choir_member = $obj->choir_member; $note = $obj->note; //member name $sql = "SELECT name FROM member WHERE ID='{$choir_member}'"; $stmt = $dbh->prepare($sql); $stmt->execute(); $obj = $stmt->fetchObject(); $member = $obj->name; // $sql1 = "SELECT * FROM single_sound"; $stmt1 = $dbh->prepare($sql1); $stmt1->execute(); $obj1 = $stmt1->fetchObject(); $vocal = $obj1->vocal; $velocity = $obj1->velocity; $vibratio = $obj1->vibratio; $type = $obj1->type; $frequency = $obj1->frequency; $start_marker1 = $obj1->start_marker1; $start_marker2 = $obj1->start_marker2; $end_marker1 = $obj1->end_marker1; $end_marker2 = $obj1->end_marker2; $vocal = strtr($vocal, array('1' => 'C', '2' => 'Db', '3' => 'D', '4' => 'Eb', '5' => 'E', '6' => 'F', '7' => 'Gb', '8' => 'G', '9' => 'Ab', '10' => 'A', '11' => 'Bb', '12' => 'H')); echo "\n<tr>\n<td>ID/Name</td>\n<td>{$id}</td>\n<td></td>\n</tr>\n<tr>\n<td>Choir Member</td>\n<td>{$member}</td>\n<td> \n<select name='member' class='form-control'>\n"; get_members_option($dbh); echo "\n</select></td>\n</tr>\n<tr>\n<td>File Note</td>\n<td>{$note}</td>\n<td>\n<input type='text' name='note' class='form-control' placeholder='note for file (optional)'>\n</td>\n</tr>\n\n<tr>\n<td>Vowel</td>\n<td>{$vocal}</td>\n<td>\n <select name='tone' class='form-control'>\n <option value='1'>C</option>\n <option value='2'>Db</option>\n <option value='3'>D</option>\n <option value='4'>Eb</option>\n <option value='5'>E</option>\n <option value='6'>F</option>\n <option value='7'>Gb</option>\n <option value='8'>G</option>\n <option value='9'>Ab</option>\n <option value='10'>A</option>\n <option value='11'>Bb</option>\n <option value='12'>H</option>\n</select>\n</td>\n</tr>\n<tr>\n<td>Velocity</td>\n<td>{$velocity}</td>\n<td>\n<select name='velocity' class='form-control'>\n <option value='1'>1</option>\n <option value='2'>2</option>\n <option value='3'>3</option>\n <option value='4'>4</option>\n <option value='5'>5</option>\n <option value='6'>6</option>\n <option value='7'>7</option>\n <option value='8'>8</option>\n <option value='9'>9</option>\n <option value='10'>10</option>\n</select>\n</td>\n</tr>\n<tr>\n<td>Vibratio</td>\n<td>{$vibratio}</td>\n<td><input type='text' name='note' class='form-control' placeholder='INT'></td>\n</tr>\n<tr>\n<td>Function</td>\n<td>{$type}</td>\n<td>\n<select name='velocity' class='form-control'>\n <option value='1'>Belting</option>\n <option value='2'>Curbing</option>\n <option value='3'>Overdrive</option>\n <option value='4'>Air</option>\n</select>\n</td>\n</tr>\n<tr>\n<td>Octav</td>\n<td>{$octav}</td>\n<td>\n<select name='octav' class='form-control'>\n <option value='1'>1</option>\n <option value='2'>2</option>\n <option value='3'>3</option>\n <option value='4'>4</option>\n <option value='5'>5</option>\n <option value='6'>6</option>\n <option value='7'>7</option>\n <option value='8'>8</option>\n</select>\n</td>\n</tr>\n<tr>\n<td>Frequency</td>\n<td>{$frequency}</td>\n<td><input type='text' name='note' class='form-control' placeholder='FLOAT'></td>\n</tr>\n<tr>\n<td>Start Marker 1</td>\n<td>{$start_marker1}</td>\n<td><input type='text' name='note' class='form-control' placeholder='INT'></td>\n</tr>\n<tr>\n<td>Start Marker 2</td>\n<td>{$start_marker2}</td>\n<td><input type='text' name='note' class='form-control' placeholder='INT'></td>\n</tr>\n<tr>\n<td>End Marker 1</td>\n<td>{$end_marker1}</td>\n<td><input type='text' name='note' class='form-control' placeholder='INT'></td>\n</tr>\n<tr>\n<td>End Marker 2</td>\n<td>{$end_marker2}</td>\n<td><input type='text' name='note' class='form-control' placeholder='INT'></td>\n</tr>\n"; }
<!DOCTYPE html> <?php include 'controller.php'; session_start(); if (isset($_SESSION['login']) && $_SESSION['upload'] == '1') { echo "\n<html lang='en'>\n\n<head>\n\n <meta charset='utf-8'>\n <meta http-equiv='X-UA-Compatible' content='IE=edge'>\n <meta name='viewport' content='width=device-width, initial-scale=1'>\n <meta name='description' content=''>\n <meta name='author' content=''>\n <title>Vocal Line - Admin page</title>\n <link href='../bower_components/bootstrap/dist/css/bootstrap.min.css' rel='stylesheet'>\n <link href='../bower_components/metisMenu/dist/metisMenu.min.css' rel='stylesheet'>\n <link href='../dist/css/timeline.css' rel='stylesheet'>\n <link href='../dist/css/sb-admin-2.css' rel='stylesheet'>\n <link href='../bower_components/morrisjs/morris.css' rel='stylesheet'>\n <link href='../bower_components/font-awesome/css/font-awesome.min.css' rel='stylesheet' type='text/css'>\n <link href='../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css' rel='stylesheet'>\n <link href='../bower_components/datatables-responsive/css/dataTables.responsive.css' rel='stylesheet'>\n</head>\n\n<body>\n\n <div id='wrapper'>\n\n <!-- Navigation -->\n <nav class='navbar navbar-default navbar-static-top' role='navigation' style='margin-bottom: 0'>\n <div class='navbar-header'>\n <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>\n <span class='sr-only'>Toggle navigation</span>\n <span class='icon-bar'></span>\n <span class='icon-bar'></span>\n <span class='icon-bar'></span>\n </button>\n <a class='navbar-brand' href='index.php'>Vocal Line - Admin page</a>\n </div>\n <!-- /.navbar-header -->\n <ul class='nav navbar-top-links navbar-right'>\n <li class='dropdown'>\n <a class='dropdown-toggle' data-toggle='dropdown' href='#/'>\n <i class='fa fa-user fa-fw'></i> <i class='fa fa-caret-down'></i>\n </a>\n <ul class='dropdown-menu dropdown-user'>\n <li><a href='profile.php'><i class='fa fa-user fa-fw'></i> User Profile</a>\n </li>\n <li class='divider'></li>\n <li><a href='logout.php'><i class='fa fa-sign-out fa-fw'></i> Logout</a>\n </li>\n </ul>\n <!-- /.dropdown-user -->\n </li>\n <!-- /.dropdown -->\n </ul>\n <!-- /.navbar-top-links -->\n\n <div class='navbar-default sidebar' role='navigation'>\n <div class='sidebar-nav navbar-collapse'>\n <ul class='nav' id='side-menu'>\n <li>\n <a href='index.php'><i class='fa fa-bar-chart-o fa-fw'></i> Dashboard</a>\n </li>\n <li>\n <a href='createuser.php'><i class='fa fa-pencil fa-fw'></i> Manage</a>\n </li>\n <li>\n <a href='upload.php'><i class='fa fa-music fa-fw'></i> Upload</a>\n </li> \n </ul>\n </div>\n <!-- /.sidebar-collapse -->\n </div>\n <!-- /.navbar-static-side -->\n </nav>\n\n <div id='page-wrapper'>\n <div class='row'>\n <div class='col-lg-12'>\n <h1 class='page-header'>Upload File</h1>\n </div>\n <!-- /.col-lg-12 -->\n </div>\n <!-- /.row -->\n <div class='row'>\n <div class='col-lg-12'>\n <div class='panel panel-default'>\n <div class='panel-heading'>\n Upload\n </div>\n <div class='panel-body'>\n <div class='row'>\n <div class='col-lg-6'>\n <form action='uploading.php' method='post' enctype='multipart/form-data'>\n <div class='form-group'>\n <input type='text' name='note' class='form-control' placeholder='Comment for file (optional)'>\n <label>File input</label>\n <input type='file' name='file' id='file'>\n </div>\n <div class='form-group'>\n <label>Choir Member</label>\n <select name='member' class='form-control'>\n "; get_members_option($dbh); echo "\n </select>\n </div>\n <div class='form-group'>\n <label>Vowel</label>\n <select name='tone' class='form-control'>\n <option value='1'>C</option>\n <option value='2'>Db</option>\n <option value='3'>D</option>\n <option value='4'>Eb</option>\n <option value='5'>E</option>\n <option value='6'>F</option>\n <option value='7'>Gb</option>\n <option value='8'>G</option>\n <option value='9'>Ab</option>\n <option value='10'>A</option>\n <option value='11'>Bb</option>\n <option value='12'>H</option>\n </select>\n </div>\n <div class='form-group'>\n <label>Velocity</label>\n <select name='velocity' class='form-control'>\n <option value='1'>1</option>\n <option value='2'>2</option>\n <option value='3'>3</option>\n <option value='4'>4</option>\n <option value='5'>5</option>\n <option value='6'>6</option>\n <option value='7'>7</option>\n <option value='8'>8</option>\n <option value='9'>9</option>\n <option value='10'>10</option>\n </select>\n </div>\n <div class='form-group'>\n <label>Sound Connection</label>\n <select name='connection' class='form-control'>\n <option value='1'>Single</option>\n <option value='2'>Connected</option>\n </select>\n </div>\n <button type='submit' class='btn btn-default'>Upload</button>\n </form>\n </div>\n </div>\n <!-- /.row (nested) -->\n </div>\n <!-- /.panel-body -->\n </div>\n <!-- /.panel -->\n </div>\n <!-- /.col-lg-12 -->\n\n \n <div class='col-lg-12'>\n <h1 class='page-header'>Uploads</h1>\n </div>\n <!-- /.col-lg-12 -->\n </div>\n <!-- /.row -->\n <div class='row'>\n <div class='col-lg-12'>\n <div class='panel panel-default'>\n <div class='panel-heading'>\n Uploaded files\n </div>\n <!-- /.panel-heading -->\n <div class='panel-body'>\n <div class='dataTable_wrapper'>\n <table class='table table-striped table-bordered table-hover' id='dataTables-example'>\n <thead>\n <tr>\n <th>File ID</th>\n <th>Choir Member</th>\n <th>Vowel</th>\n <th>Function</th>\n <th>Velocity</th>\n <th>Connection</th>\n <th>Comment</th>\n <th style='width:35px;'>Edit</th>\n </tr>\n </thead>\n <tbody>\n "; fetch_uploads($dbh); echo "\n </tbody>\n </table>\n </div>\n </div>\n <!-- /.panel-body -->\n </div>\n <!-- /.panel -->\n </div>\n </div>\n <!-- /.row -->\n \n </div>\n <!-- /#wrapper -->\n\n <script src='../bower_components/jquery/dist/jquery.min.js'></script>\n <script src='../bower_components/bootstrap/dist/js/bootstrap.min.js'></script>\n <script src='../bower_components/metisMenu/dist/metisMenu.min.js'></script>\n <script src='../dist/js/sb-admin-2.js'></script>\n <script src='../bower_components/datatables/media/js/jquery.dataTables.min.js'></script>\n <script src='../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js'></script>\n <script>\n \$(document).ready(function() {\n \$('#dataTables-example').DataTable({\n responsive: true\n });\n });\n </script>\n\n</body>\n\n</html>\n"; } else { header('Location: index.php'); }