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
<?php | |
namespace Gymloop\ChallengeBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Gymloop\CoreBundle\Entity\Challenge; | |
use Gymloop\CoreBundle\Entity\ChallengeCoordinates; | |
class DefaultController extends Controller |
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
<?php | |
namespace Gymloop\CoreBundle\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use FOS\UserBundle\Entity\User as BaseUser; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity |
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
<script type="text/javascript" src="{{ asset('js/admin/util.js') }}"></script> | |
<script type="text/javascript"> | |
var GymloopAdmin = function() { | |
var today = new Date(), | |
userTargets = [], //contains total target sessions & target sessions to date per programme per user | |
count = parseInt({{ users | length }},10); | |
var totalTargetSessions = function(startDate, endDate, weeklyTarget) { |
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
$tdCollection = $('td[class*="fc-day"]'); | |
$.each($tdCollection,function(key,elem){ | |
if($(elem).hasClass('pending') || $(elem).hasClass('confirmed') ) { | |
$(elem).wijtooltip({ | |
content:'Click to delete session', | |
position: {my: "left bottom", at:"left bottom"} | |
}); | |
} else { | |
$(elem).wijtooltip({ |
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
$query = $this->getEntityManager()->createQuery(' | |
SELECT COUNT(s) FROM GymloopDiaryBundle:TrainingSession s | |
WHERE s.status = :completed | |
AND s.user = :user') | |
->setParameter('user',$user) | |
->setParameter('completed','confirmed'); | |
$result = $query->getResult(); | |
array(1) { [0]=> array(1) { [1]=> string(1) "0" } } |
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
public function findUserAdminDetails() | |
{ | |
$query = $this->getEntityManager()->createQuery(' | |
SELECT u, p, m | |
FROM GymloopCoreBundle:User u | |
JOIN u.programmes p | |
JOIN u.motivation m | |
'); | |
$result = $query->getArrayResult(); var_dump($result); exit; |
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
<?php | |
namespace Gymloop\CoreBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Gymloop\CoreBundle\Entity\Motivation | |
* | |
* @ORM\Table(name="gymloop_motivation") |
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
<?php | |
namespace Gymloop\CoreBundle\Entity; | |
use Doctrine\ORM\EntityRepository; | |
/** | |
* MotivationRepository | |
* | |
* This class was generated by the Doctrine ORM. Add your own custom |
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
<?php | |
namespace Gymloop\CoreBundle\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use FOS\UserBundle\Entity\User as BaseUser; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity |
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
$('.fc-day-number').each(function(){ | |
lDay = parseInt($(this).text()); | |
//check if it is another month date | |
if($(this).parents('td').hasClass('fc-other-month')) | |
{ | |
lYear = parseInt(cYear); | |
//if it is belong to the previous month | |
if(lDay>15) | |
{ | |
lMonth = parseInt(cMonth) - 1; |