Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
your hearts been aching but you're to shy to say it
  • Loading branch information
adl13006 committed Dec 9, 2015
1 parent 1a4351b commit 5c762bb
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 20 deletions.
12 changes: 9 additions & 3 deletions Chinook_Rev1.sql
Expand Up @@ -83,7 +83,7 @@ CREATE TABLE `Person`
CREATE TABLE `TrackURL`
(
`TrackID` INT NOT NULL,
`URL` VARCHAR(45) NOT NULL,
`URL` VARCHAR(150),
CONSTRAINT `PK_TrackURL` PRIMARY KEY (`TrackID`)
);

Expand Down Expand Up @@ -244,9 +244,15 @@ Add IsDefault to Payment
**************************/
ALTER TABLE payment ADD COLUMN IsDefault bool;

/**************************
*add things
**************************/
INSERT INTO TrackURL(TrackID)
SELECT TrackID
FROM Track;



UPDATE TrackURL
SET url = "http://a1310.phobos.apple.com/us/r1000/167/Music3/v4/00/23/38/0023383d-1616-fbe2-b3a3-7f2de268911b/mzaf_7209253486009554987.plus.aac.p.m4a";



3 changes: 2 additions & 1 deletion TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs
Expand Up @@ -516,7 +516,8 @@ namespace TeamDBAwesome.SqlService
}
else
{
IsDef = int.Parse(EmptyDefault);
//IsDef = int.Parse(EmptyDefault);
IsDef = 0;
}

Payment LoadPayment = new Payment
Expand Down
19 changes: 14 additions & 5 deletions TeamDBAwesome/TeamDBAwesome/js/userController.js
Expand Up @@ -80,7 +80,7 @@ angular.module('routerApp').controller('userController', function ($q, $window,
{ field: 'AlbumTitle', displayName: ' Album ', width: "15%" },
{ field: 'MediaType', displayName: ' Media ', width: "10%" },
{ field: 'Genre', displayName: ' Genre ', width: "10%" },
{ field: 'Clip', displayName: ' Clip ', width: "10%" },
{ field: 'Clip', displayName: ' Clip ', width: "10%", cellTemplate: '<audio id="audio1"><source src="http://a1310.phobos.apple.com/us/r1000/167/Music3/v4/00/23/38/0023383d-1616-fbe2-b3a3-7f2de268911b/mzaf_7209253486009554987.plus.aac.p.m4a"></source>Your browser isn\'t invited for super fun audio time.</audio><center> <button data-ng-click="grid.appScope.play()" class="btn btn-normal btn-xs"> <i class="glyphicon glyphicon-play"></i> </button></center>' },
{ field: 'UnitPrice', displayName: ' Price ', width: "10%" }
];

Expand Down Expand Up @@ -254,6 +254,12 @@ angular.module('routerApp').controller('userController', function ($q, $window,
})
};

//Play Audio Clip
$scope.play = function () {
var audio = document.getElementById("audio1");
audio.play();
};

// Get CustomPlaylist Tracks
$scope.getMyPlaylistTracks = function (id) {
$http.get("http://localhost:50031/api/GetPlaylist?PlaylistID=" + id)
Expand Down Expand Up @@ -298,8 +304,10 @@ angular.module('routerApp').controller('userController', function ($q, $window,
}

// Open window for orders
$scope.openOrder = function (size, orderid) {
$scope.getOrderTracks(orderid);
$scope.openOrder = function (orderid) {
console.log(orderid);
$scope.catcats = orderid;
$scope.getOrderTracks(orderid.invoiceId);
var modalInstance = $uibModal.open({
animation: $scope.animationsEnabled,
templateUrl: 'pages/user-ordermodal.html',
Expand All @@ -317,6 +325,7 @@ angular.module('routerApp').controller('userController', function ($q, $window,
$scope.getOrderTracks = function (orderid) {
$http.get("http://localhost:50031/api/GetOrderTracks?orderId=" + orderid)
.success(function (response) {
console.log(response);
$scope.currordertracks = angular.copy(response);
console.log($scope.currordertracks);
})
Expand Down Expand Up @@ -363,7 +372,7 @@ angular.module('routerApp').controller('userController', function ($q, $window,

// From shopping cart to invoice
$scope.buy = function (payid) {
console.log("YAY");
console.log(payid);
$http.get("http://localhost:50031/api/GenerateInvoice?custId=" + $cookies.get('userid') + "&payId=" + payid + "&orderId=" + $scope.currOrderID)
.success(function (response) {
$http.get("http://localhost:50031/api/CreateOrder?CustomerID=" + $cookies.get('userid'))
Expand All @@ -383,7 +392,7 @@ angular.module('routerApp').controller('userController', function ($q, $window,

// Initialize User Portal Informations
$scope.initPortal = function () {
// $scope.getMyOrders();
$scope.getMyOrders();
}

// Get Invoice for a specific user
Expand Down
10 changes: 4 additions & 6 deletions TeamDBAwesome/TeamDBAwesome/pages/user-home.html
Expand Up @@ -47,12 +47,10 @@

<br /><br />
<table>
<tr><th colspan="2"><center><h2>My Orders</h2><br />Click an order to see details</center></th></tr>
<td width="90%"><center>Track Name</center></td>
<td width="10%"><center>Price</center></td>
<tr ng-repeat="x in [1,2,3,4]">
<td width="90%">{{x}}</td>
<td width="10%"><text ng-click="openOrder(x)">{{x}}</text></td>
<tr><th ><center><h2>My Orders</h2><br />Click an order to see details</center></th></tr>
<td><center>Invoice Number</center></td>
<tr ng-repeat="x in currorders">
<td > <center><text ng-click="openOrder(x)"><b>{{x.invoiceId}}</b></text></center> </td>
</tr>
</table>

Expand Down
10 changes: 8 additions & 2 deletions TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html
@@ -1,8 +1,14 @@

<div ng-controller='userController'>
<h2><center>CATS CATS CATS CATS CATS</center></h2>
<h4>Invoice ID : {{catcats.invoiceId}}</h4>
<h4>Invoice Date : {{catcats.invoiceDate}}</h4>
<h4>Invoice Address : {{catcats.address}} {{catcats.city}} {{catcats.state}}</h4>
<h4 ng-show="catcats.payment.token">Apple token : {{catcats.paymment.token}}</h4>
<h4 ng-show="catcats.payment.email">Email Address : {{catcats.payment.email}}</h4>
<h4 ng-show="catcats.payment.cardnum">Card number : {{catcats.payment.cardnum}}</h4>
<h4 ng-show="catcats.payment.expr_date">Card number : {{catcats.payment.expr_date}}</h4>
<table>
<tr ng-repeat="x in currplaylist">
<tr ng-repeat="x in currordertracks">
<td>{{x.TrackName}}</td>
</tr>
</table>
Expand Down
12 changes: 9 additions & 3 deletions TeamDBAwesome/TeamDBAwesome/pages/user-orders.html
Expand Up @@ -56,15 +56,21 @@
<td width="25%"><center>Album Name</center></td>
<td width="16%"><center>Media Type</center></td>
<td width="8%"><center>Genre</center></td>
<td width="5%">CLIP</td>
<td width="5%"><i class="glyphicon glyphicon-music"></i></td>
<td width="10%"><center>Price</center></td>
<tr ng-repeat="x in orderOptions.data">
<td width="3%"> <center><button data-ng-click="addToCart({{x.TrackId}})" class="btn btn-success btn-xs"> + </button></center></td> </td>
<td width="3%"> <center> <button data-ng-click="addToCart({{x.TrackId}})" class="btn btn-success btn-xs"> + </button></center> </td> </td>
<td width="30%">{{x.TrackName}}</td>
<td width="30%">{{x.AlbumTitle}}</td>
<td width="16%">{{x.MediaType}}</td>
<td width="8%">{{x.Genre}}</td>
<td width="5%">CLIP</td>
<td width="5%">
<audio id="audio1">
<source src="http://a1310.phobos.apple.com/us/r1000/167/Music3/v4/00/23/38/0023383d-1616-fbe2-b3a3-7f2de268911b/mzaf_7209253486009554987.plus.aac.p.m4a"></source>
Your browser isn't invited for super fun audio time.
</audio>
<center> <button data-ng-click="play()" class="btn btn-normal btn-xs"> <i class="glyphicon glyphicon-play"></i> </button></center>
</td>
<td width="4%">{{x.UnitPrice}}</td>
</tr>
</table>
Expand Down

0 comments on commit 5c762bb

Please sign in to comment.