public function executeDeletechapter()
 {
     $chapter = ChapterPeer::retrieveByPK($this->getRequestParameter('id'));
     $cr = $chapter->getChapterregion();
     $c = new Criteria();
     $c->add(UserchapterregionPeer::CHAPTERREGION_ID, $cr->getId());
     $ucount = UserchapterregionPeer::doCount($c);
     $ucr = UserchapterregionPeer::doSelectOne($c);
     if ($ucr) {
         $this->setFlash('notice', 'Cannot delete chapter. <b>' . $ucount . '</b> user(s) are subscribed to this chapter.');
     } else {
         $chapter->delete();
         $cr->delete();
         $this->setFlash('notice', 'Chapter Deleted Successfully');
     }
     $this->redirect('admin/chapters');
 }
 public function getChapter($con = null)
 {
     include_once 'lib/model/om/BaseChapterPeer.php';
     if ($this->aChapter === null && $this->chapter_id !== null) {
         $this->aChapter = ChapterPeer::retrieveByPK($this->chapter_id, $con);
     }
     return $this->aChapter;
 }
    if ($br) {
        echo "<b>" . BranchPeer::retrieveByPK($br)->getName() . "</b>";
    } else {
        echo '<i>any</i>';
    }
    ?>
				<br>Year: <?php 
    if ($yr) {
        echo "<b>" . $yr . "</b>";
    } else {
        echo '<i>any</i>';
    }
    ?>
				<br>Chapter: <?php 
    if ($chap) {
        echo "<b>" . ChapterPeer::retrieveByPK($chap)->getname() . "</b>";
    } else {
        echo '<i>any</i>';
    }
    ?>
				<br>Location: <?php 
    if ($loc) {
        echo "<b>" . $loc . "</b>";
    } else {
        echo '<i>any</i>';
    }
    ?>
				<br>Country: <?php 
    if ($cn) {
        echo "<b>" . CountryPeer::retrieveByPK($cn)->getname() . "</b>";
    } else {