This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) { | |
$scope.$on('authLoaded', function() { | |
$scope.isExpert($scope.main.serieId); | |
$scope.isMember($scope.main.serieId); | |
}); | |
$scope.loadAuth = function() { | |
Auth.load().success(function(data) { | |
$scope.main.user = data.user; | |
$scope.$broadcast("authLoaded"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SPLIT_STR MySQL Function | |
-- from http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/ | |
CREATE FUNCTION SPLIT_STR( | |
x VARCHAR(255), | |
delim VARCHAR(12), | |
pos INT | |
) | |
RETURNS VARCHAR(255) | |
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos), |