public function executeDelete() { $userchapterregion = UserchapterregionPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($userchapterregion); $userchapterregion->delete(); return $this->redirect('userchapterregion/list'); }
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 static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(UserchapterregionPeer::ID, $pks, Criteria::IN); $objs = UserchapterregionPeer::doSelect($criteria, $con); } return $objs; }
?> <div class="<?php if ($i % 2 == 0) { echo 'evenRow'; } else { echo 'oddRow'; } ?> "> <?php $c = new Criteria(); $c->add(ChapterregionPeer::CHAPTER_ID, $chapter->getId()); $cr = ChapterregionPeer::doSelectOne($c); $c->clear(); $c->add(UserchapterregionPeer::CHAPTERREGION_ID, $cr->getId()); $ucount = UserchapterregionPeer::doCount($c); ?> <div class="statColC1"><?php echo $chapter->getName(); ?> </div> <div class="statColC2"><?php echo $cr->getRegion()->getName(); ?> </div> <div class="statColC3"><?php echo link_to($ucount, 'search/result?usertype=1&chapter=' . $chapter->getId(), array('title' => 'Click here to see a list of users from ' . $chapter->getName())); ?> </div> </div> <?php
public function getUserchapterregionsJoinUser($criteria = null, $con = null) { include_once 'lib/model/om/BaseUserchapterregionPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collUserchapterregions === null) { if ($this->isNew()) { $this->collUserchapterregions = array(); } else { $criteria->add(UserchapterregionPeer::CHAPTERREGION_ID, $this->getId()); $this->collUserchapterregions = UserchapterregionPeer::doSelectJoinUser($criteria, $con); } } else { $criteria->add(UserchapterregionPeer::CHAPTERREGION_ID, $this->getId()); if (!isset($this->lastUserchapterregionCriteria) || !$this->lastUserchapterregionCriteria->equals($criteria)) { $this->collUserchapterregions = UserchapterregionPeer::doSelectJoinUser($criteria, $con); } } $this->lastUserchapterregionCriteria = $criteria; return $this->collUserchapterregions; }
<div class="srcol4"><?php echo $rs->getGraduationyear(); ?> </div> <div class="srcol5"><?php echo $rs->getBranchcode(); ?> </div> <div class="srcol6"><?php echo $rs->getDegree()->getName(); ?> </div> <div class="srcol7"><?php $c = new Criteria(); $c->add(UserchapterregionPeer::USER_ID, $rs->getId()); $ucrs = UserchapterregionPeer::doSelect($c); $chapterlist = ''; foreach ($ucrs as $ucr) { if (!$chapterlist) { $chapterlist = $ucr->getChapterregion()->getChapter()->getName(); } else { $chapterlist .= ', ' . $ucr->getChapterregion()->getChapter()->getName(); } } echo $chapterlist; ?> </div> <div class="srcol10"> <?php if ($rs->getEmail()) {
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = UserchapterregionPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setUserId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setChapterregionId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setOther($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setUcrflag($arr[$keys[4]]); } }
public function executeUnjoinchapter() { $userid = $this->getUser()->getAttribute('userid'); $crid = $this->getRequestParameter('crid'); $c = new Criteria(); $c->add(UserchapterregionPeer::USER_ID, $userid); $c->add(UserchapterregionPeer::CHAPTERREGION_ID, $crid); $ucr = UserchapterregionPeer::doSelectOne($c); if ($ucr) { $ucr->delete(); } $this->redirect('/address/show'); }