コード例 #1
0
        <ul class="detailLink">
          <li><a href="/detail/<?php 
        echo $fleamarket_id;
        ?>
">詳細情報を見る<i></i></a></li>
        </ul>
        <ul class="rightbutton">
    <?php 
        if ($user && $user->hasReserved($fleamarket_id)) {
            ?>
          <li class="button reserved">出店予約中</li>
    <?php 
        } elseif ($user && $user->hasWaiting($fleamarket_id, true)) {
            ?>
        <?php 
            if (\Model_Fleamarket::hasEmptyBooth($fleamarket_id)) {
                ?>
          <li class="button makeReservation"><a href="/reservation?fleamarket_id=<?php 
                echo $fleamarket_id;
                ?>
">出店予約をする</a></li>
        <?php 
            } else {
                ?>
          <li class="button reserved">キャンセル待ち中</li>
        <?php 
            }
            ?>
    <?php 
        } elseif ($is_official) {
            ?>
 /**
  * 完了
  *
  * @access public
  * @param
  * @return void
  * @author kobayashi
  * @author ida
  */
 public function post_thanks()
 {
     if (!\Security::check_token()) {
         \Response::redirect('errors/doubletransmission');
     }
     $fleamarket_id = $this->fleamarket->fleamarket_id;
     $has_empty_booth = \Model_Fleamarket::hasEmptyBooth($fleamarket_id);
     $can_reserve = $this->canReserve($fleamarket_id, $has_empty_booth);
     if (!$can_reserve) {
         \Response::redirect('reservation');
     }
     $data = $this->getEntryData();
     if (!$data) {
         throw new \SystemException(\Model_Error::ER00502);
     }
     try {
         $db = \Database_Connection::instance('master');
         $db->start_transaction();
         $entry = $this->registerEntry($data);
         if (!$entry) {
             throw new \SystemException(\Model_Error::ER00503);
         }
         $db->commit_transaction();
     } catch (\Exception $e) {
         $db->rollback_transaction();
         throw new \SystemException(\Model_Error::ER00504);
     }
     if ($entry) {
         try {
             $entry->sendmail($this->login_user);
         } catch (\Exception $e) {
             throw new \SystemException(\Model_Error::ER00507);
         }
     }
     $view = \View::forge('reservation/thanks');
     $view->set('entry', $entry, false);
     $this->template->content = $view;
 }