protected function modify(AnnouncementReservation $announcementReservation)
 {
     $q = $this->dao->prepare('UPDATE ' . $this->table() . ' SET DATE = :date, DATE_END = :dateEnd, DATE_OPTION = :option, ANNOUNCEMENT_ID = :announcementId, USER_OWNER_ID = :userOwnerId, USER_SUBSCRIBER_ID = :userSubscriberId, CONTACT_GROUP_ID = :contactGroupId, PRICE = :price, STATE_ID = :stateId, KEY_CHECK = :keyCheck, TRANSACTION_REF = :transactionRef, UPDATED_TIME = FROM_UNIXTIME(:updatedTime), ADMIN_PROCEED = :adminProceed WHERE ID = :id');
     $q->bindValue(':date', $announcementReservation->getDate());
     $q->bindValue(':dateEnd', $announcementReservation->getDateEnd());
     $q->bindValue(':option', $announcementReservation->getDateOption());
     $q->bindValue(':announcementId', $announcementReservation->getAnnouncementId(), PDO::PARAM_INT);
     $q->bindValue(':userOwnerId', $announcementReservation->getUserOwnerId(), PDO::PARAM_INT);
     $q->bindValue(':userSubscriberId', $announcementReservation->getUserSubscriberId(), PDO::PARAM_INT);
     $q->bindValue(':contactGroupId', $announcementReservation->getContactGroupId(), PDO::PARAM_INT);
     $q->bindValue(':price', $announcementReservation->getPrice());
     $q->bindValue(':stateId', $announcementReservation->getStateId(), PDO::PARAM_INT);
     $q->bindValue(':keyCheck', $announcementReservation->getKeyCheck());
     $q->bindValue(':transactionRef', $announcementReservation->getTransactionRef());
     $q->bindValue(':updatedTime', $announcementReservation->getUpdatedTime());
     $q->bindValue(':adminProceed', $announcementReservation->getAdminProceed());
     $q->bindValue(':id', $announcementReservation->id(), PDO::PARAM_INT);
     $q->execute();
 }
Example #2
0
    public function sendReservationOwnerValidation(Users $userOwner, Users $userSubscriber, Announcement $announce, AnnouncementReservation $reservation)
    {
        $label = 'pour';
        if ($reservation->getDateOption() == 'period') {
            $label = 'au';
        }
        $date = new DateTime($reservation->getDate());
        $this->to = $userOwner->getMail();
        $this->subject = 'Demande de réservation ';
        $this->content = '
								Bonjour ' . ucfirst($userOwner->getUsername()) . ',
								<br /><br />
								Votre annonce de <b>' . $announce->getTitle() . '</b> intéresse <b>' . ucfirst($userSubscriber->getUsername()) . '</b> pour la période du
								<b>' . $date->format('d-m-Y') . '</b> ' . $label . ' <b>' . $reservation->getDateOptionLabel() . '</b>.
								<br /><br />
								<a href="' . $this->serverName . 'users/member/' . $userSubscriber->id() . '">Voir son profil</a>.
								<br /><br />
								Pour vous mettre en relation et valider ce Tip  <a href="' . $this->serverName . 'reservations/valid/' . $reservation->id() . '/' . $reservation->getKeyCheck() . '">cliquez ici</a>
								<br /><br />
								<b>' . ucfirst($userSubscriber->getUsername()) . '</b> pourra ainsi recevoir vos coordonnées et vous pourrez convenir
								de votre rencontre.
								<br /><br />
								Vous ne pouvez pas prêter votre <b>' . $announce->getTitle() . '</b> <a href="' . $this->serverName . 'reservations/cancel/' . $reservation->id() . '/' . $reservation->getKeyCheck() . '">cliquez ici</a>
								<br /><br />
								<b>' . ucfirst($userOwner->getUsername()) . '</b>, n’oubliez pas que sans réponse de votre part dans les 5 jours la demande sera annulée.
								<br /><br />
								A très bientôt sur TIPKIN !
								<br /><br />
								Je possède. Tu empruntes. Nous partageons !
								<br /><br />
								L’équipe TIPKIN.
        						';
        $this->send();
    }