Skip to content
Permalink
63e212f5ed
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
97 lines (83 sloc) 2.64 KB
// This controller will hold logic for the employee Portal homepage (Order List, Logout), Customer Info, Media Center, and Reports
angular.module('routerApp').controller('adminController', function ($scope, $http, $log, $timeout, $cookies, urlService, $anchorScroll, $location, $q, $state, $rootScope) {
/* Retrieve Url */
var url = urlService.web;
$cookies.put('PAGE', 'Admin');
/* Functions Defined */
// Logging out
$scope.logout = function () {
$cookies.remove('userid');
$state.go('home');
}
/* BEGIN LOGIC */
$scope.showMediaOptions = true;
$scope.showTrackFields = false;
$scope.showAlbumFields = false;
$scope.showArtistFields = false;
$scope.showGenreFields = false;
$scope.showMediaTypeFields = false;
$scope.back = function () {
$scope.showMediaOptions = true;
$scope.showTrackFields = false;
$scope.showAlbumFields = false;
$scope.showArtistFields = false;
$scope.showGenreFields = false;
$scope.showMediaTypeFields = false;
}
$scope.toCreateTrack = function () {
$scope.showMediaOptions = false;
$scope.showTrackFields = true;
};
$scope.toCreateAlbum = function () {
$scope.showMediaOptions = false;
};
$scope.toCreateArtist = function () {
$scope.showMediaOptions = false;
};
$scope.toCreateGenre = function () {
$scope.showMediaOptions = false;
};
$scope.toCreateMediaType = function () {
$scope.showMediaOptions = false;
};
$scope.gridOptions = {
enableFiltering: true,
columnDefs: [
{field: 'Fname', displayName: 'First Name'},
{field: 'Lname', displayName: 'Last Name'},
{field: 'Address'},
{field: 'City'},
{field: 'State'},
{field: 'Post'},
{field: 'Country'},
{field: 'Phone'},
{field: 'Fax'},
{field: 'Email'},
{field: 'Company'}
]
}
$scope.gridOptions.data = [
{
"Fname": "Test",
"Lname": "Test",
"Address": "Test",
"City": "Test",
"State": "Test",
"Post": "Test",
"Country": "Test",
"Phone": "Test",
"Fax": "Test",
"Email": "Test",
"Company": "Test"
}
]
$scope.getPlaylists = function () {
console.log($scope.playlists);
$scope.playlists = [];
$http.get("http://localhost:50031/api/GetPlaylistList")
.success(function (response) {
$scope.playlists = angular.copy(response);
console.log(response);
})
}
});