<?php /* Template Name: Ricerca3 */ ?>
<?php materialis_get_header();?>
<div <?php echo materialis_page_content_atts("page-content"); ?>>
<div class="<?php materialis_page_content_wrapper_class(); ?>">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'page' );
endwhile;
?>
</div>
</div>
<?php
//index2.php
?>
<!DOCTYPE html>
<html>
<head>
<title>Archivio Singoli ricerca per Artista o Titolo brano</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<style>
.form_style
{
width: 600px;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="container" ng-app="live_search_app" ng-controller="live_search_controller" ng-init="fetchData()">
<br />
<h3 align="center">Archivio Singoli ricerca per Artista o Titolo brano</h3>
<br />
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">Cerca</span>
<input type="text" name="search_query" ng-model="search_query" ng-keyup="fetchData()" placeholder=" Scrivi il nome dell'artista o il titolo del brano" class="form-control" />
</div>
</div>
<br />
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Autore</th>
<th>Titolo e note</th>
<th>Tipo</th>
<th>Sincro</th>
<th>Data</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in searchData">
<td>{{ data.Autore }}</td>
<td>{{ data.Titolo_e_note }}</td>
<td>{{ data.Tipo }}</td>
<td>{{ data.Sincro }}</td>
<td>{{ data.Data }}</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
<script>
var app = angular.module('live_search_app', []);
app.controller('live_search_controller', function($scope, $http){
$scope.fetchData = function(){
$http({
method:"POST",
url:"https://love4music.altervista.org/wp-content/themes/materialis-child/fetch.php",
data:{search_query:$scope.search_query}
}).success(function(data){
$scope.searchData = data;
});
};
});
</script>
<?php get_footer();