</p> </td> </tr> <tr> <td style="vertical-align:middle;"><label><?php echo __('Waktu'); ?> </label></td> <td style="text-align:center; vertical-align:middle;">:</td> <td style="vertical-align:middle;"> <p class="detail" style="font-weight: bold;"> <?php $c = new Criteria(); $c->add(ScheduleDetailPeer::SCHEDULE_ID, $schedule->getId()); $c->addDescendingOrderByColumn(ScheduleDetailPeer::ID); $cs_details = ScheduleDetailPeer::doSelect($c); $course_details = ScheduleDetailPeer::doCount($c); if ($course_details < 1) { echo '-'; } else { foreach ($cs_details as $detail) { echo $detail->getClassSession()->getBegin() . ' - ' . $detail->getClassSession()->getEnd() . '<br>'; } } ?> </p> </td> </tr> </tbody> </table> </td></tr></table></td>
public function getScheduleDetails($criteria = null, $con = null) { include_once 'lib/model/om/BaseScheduleDetailPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collScheduleDetails === null) { if ($this->isNew()) { $this->collScheduleDetails = array(); } else { $criteria->add(ScheduleDetailPeer::SCHEDULE_ID, $this->getId()); ScheduleDetailPeer::addSelectColumns($criteria); $this->collScheduleDetails = ScheduleDetailPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(ScheduleDetailPeer::SCHEDULE_ID, $this->getId()); ScheduleDetailPeer::addSelectColumns($criteria); if (!isset($this->lastScheduleDetailCriteria) || !$this->lastScheduleDetailCriteria->equals($criteria)) { $this->collScheduleDetails = ScheduleDetailPeer::doSelect($criteria, $con); } } } $this->lastScheduleDetailCriteria = $criteria; return $this->collScheduleDetails; }
public function executeDelete() { $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($schedule); #$ref_error = 0; #foreach ($schedule->getRefCountMethods() as $ref) { # $method = "count".$ref['affix']; # $count = $schedule->$method(); # if ($count > 0) { # ++$ref_error; # $this->getRequest()->setError('extracurricular/delete/'.sfInflector::camelize($ref['table']), $count); # } #} #if ($ref_error > 0) { # $this->getRequest()->setError('extracurricular/delete', '_ERR_DELETE_ ('.$schedule->toString().' - id:'.$schedule->getId().')'); #} else { $c = new Criteria(); $c->add(ScheduleDetailPeer::SCHEDULE_ID, $this->getRequestParameter('id')); $sc_details = ScheduleDetailPeer::doSelect($c); foreach ($sc_details as $sc_detail) { $sc_detail->delete(); } $cb = new Criteria(); $cb->add(ScheduleTutorPeer::SCHEDULE_ID, $this->getRequestParameter('id')); $sc_tutors = ScheduleTutorPeer::doSelect($cb); foreach ($sc_tutors as $sc_tutor) { $sc_tutor->delete(); } $cw = new Criteria(); $cw->add(StudentRaportPeer::SCHEDULE_ID, $this->getRequestParameter('id')); $sc_raports = StudentRaportPeer::doSelect($cw); foreach ($sc_raports as $sc_raport) { $sc_raport->delete(); } $schedule->delete(); #} return $this->forward('extracurricular', 'list'); }
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(ScheduleDetailPeer::ID, $pks, Criteria::IN); $objs = ScheduleDetailPeer::doSelect($criteria, $con); } return $objs; }