本文整理汇总了PHP中Activity::getIsPossibleToSubscribe方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::getIsPossibleToSubscribe方法的具体用法?PHP Activity::getIsPossibleToSubscribe怎么用?PHP Activity::getIsPossibleToSubscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity::getIsPossibleToSubscribe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Add activity in database
* @param : Activity object
* @return : false if the insert failed / else true
*/
public function add(Activity $activite)
{
$title = $activite->getTitle();
$descr = $activite->getDescription();
$pos = $activite->getGeoPos();
$type = $activite->getType();
$priority = $activite->getPriority();
$sd = $activite->getStartDate();
$ed = $activite->getEndDate();
$sh = $activite->getStartHour();
$eh = $activite->getEndHour();
$per = $activite->getPeriodic();
$nbOcc = $activite->getNbOccur();
$isInBreak = $activite->getIsInBreak();
$sub = $activite->getIsPossibleToSubscribe();
$public = $activite->getIsPublic();
$idAgenda = $activite->getIdAgenda();
$sql = "INSERT INTO activite (titre, description, positionGeographique, type, priorite, dateDebut, dateFin, heureDebut, heureFin, periodicite, nbOccurence, estEnPause, estPossibleDeSinscrire, estPublic, idAgenda)\n\t\t\tVALUES (:titre, :description, :positionGeographique, :type, :priorite, :dateDebut, :dateFin, :heureDebut, :heureFin, :periodicite, :nbOccurence, :estEnPause, :estPossibleDeSinscrire, :estPublic, :idAgenda)";
$req = $this->_db->prepare($sql);
$req->bindParam(':titre', $title, PDO::PARAM_STR);
$req->bindParam(':description', $descr, PDO::PARAM_STR);
$req->bindParam(':positionGeographique', $pos, PDO::PARAM_STR);
$req->bindParam(':type', $type, PDO::PARAM_STR);
$req->bindParam(':priorite', $priority, PDO::PARAM_INT);
$req->bindParam(':dateDebut', $sd, PDO::PARAM_STR);
$req->bindParam(':dateFin', $ed, PDO::PARAM_STR);
$req->bindParam(':heureDebut', $sh, PDO::PARAM_STR);
$req->bindParam(':heureFin', $eh, PDO::PARAM_STR);
$req->bindParam(':periodicite', $per, PDO::PARAM_STR);
$req->bindParam(':nbOccurence', $nbOcc, PDO::PARAM_INT);
$req->bindParam(':estEnPause', $isInBreak, PDO::PARAM_INT);
$req->bindParam(':estPossibleDeSinscrire', $sub, PDO::PARAM_INT);
$req->bindParam(':estPublic', $public, PDO::PARAM_INT);
$req->bindParam(':idAgenda', $idAgenda, PDO::PARAM_INT);
$req->execute();
$nbTupleInsere = $req->rowCount();
$req->closeCursor();
//check if insert has failed
if ($nbTupleInsere < 1) {
return false;
}
return true;
}
示例2: showActivity
public function showActivity(Activity $act, $idUser)
{
$html = "";
$html .= '
<div class="row">
<div class="col-md-12">
<div class="center" id="successSub">
</div>
<div class="alert alert-info center" role="alert">
<div class="row">
<div class="col-md-6">
Priorité : ' . $act->getPriority() . '
</div>
<div class="col-md-6">
';
if ($act->getIsPublic()) {
$html .= 'Activité publique';
} else {
$html .= 'Activité privée';
}
$html .= '
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<h1>' . $act->getIdActivity() . ' - ' . $act->getTitle() . ' à ' . $act->getGeoPos() . '</h1>
</div>
<div class="col-md-4">
<div class="row">
<div class="col-md-12">
<div class="notationDiv">
<p>Notation : </p>
<script src="js/ListeEtoile.js"></script>
<div id="notation">
<script type="text/javascript">
CreateListeEtoile(\'notation\',5);
</script>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 center">
';
//if the event is private the button is disabled
if ($act->getIsPossibleToSubscribe()) {
$html .= '<button type="button" id="buttonInscriptionAct" data-idAct=' . $act->getIdActivity() . ' data-idUser=' . $idUser . ' class="btn btn-default">S\'inscrire</button>';
} else {
$html .= '<button type="button" class="btn btn-default" disabled="disabled">S\'inscrire</button>';
}
$html .= '
</div>
</div>
</div>
</div>
<div class="row marginBot">
<div class="col-md-12">
Du : ' . $act->getStartDate() . ' au ' . $act->getEndDate() . ' <br/>
De : ' . $act->getStartHour() . ' à ' . $act->getEndHour() . ' <br/>
<br/>
<h3>Description : </h3>
' . $act->getDescription() . '
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="showComment2">
</div>
</div>
</div>
';
echo $html;
}