Exemple #1
0
if ($pager->getNbResults() < 1) {
    ?>
                                                                 <tr class="list"><td colspan="100"><div class="no_record"><?php 
    echo __('No record found');
    ?>
</div></td></tr>
                                                             <?php 
} else {
    ?>
                                                                 <?php 
    $i = 0;
    foreach ($pager->getResults() as $subject_grading) {
        $ct = new Criteria();
        $ct->add(SubjectCompetencyPeer::SUBJECT_GRADING_ID, $subject_grading->getId());
        $sub_comps = SubjectCompetencyPeer::doSelect($ct);
        $sub_count = SubjectCompetencyPeer::doCount($ct);
        ?>
                                                                     <tr class="list<?php 
        ++$i;
        if ($i % 2 == 0) {
            echo ' even';
        }
        ?>
">
                                                                         <td style="vertical-align: middle;"><?php 
        echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
        ?>
</td>                        
                                                                         <td style="vertical-align: middle;" colspan="2">
                                                                             <?php 
        echo link_to_function(strlen($subject_grading->getDetail()) > 0 ? $subject_grading->getDetail() : 'n/a', visual_effect('toggle_appear', 'row_' . $subject_grading->getId(), array('duration' => 0.5, 'onclick' => 'this.blur()')));
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = SubjectCompetencyPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setSubjectGradingId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setKkm($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setDetail($arr[$keys[3]]);
     }
 }
 public function countSubjectCompetencys($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseSubjectCompetencyPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(SubjectCompetencyPeer::SUBJECT_GRADING_ID, $this->getId());
     return SubjectCompetencyPeer::doCount($criteria, $distinct, $con);
 }
Exemple #4
0
 public function executeDeleteCompetency()
 {
     $subject_grading_id = $this->getRequestParameter('subject_grading_id');
     $subject_grading = SubjectGradingPeer::retrieveByPK($subject_grading_id);
     $this->forward404Unless($subject_grading);
     $this->subject_grading = $subject_grading;
     $subject_competency = SubjectCompetencyPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($subject_competency);
     $ref_error = 0;
     foreach ($subject_competency->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $subject_competency->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('subject_grading/deleteCompetency/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('subject_grading/deleteCompetency', '_ERR_DELETE_ (' . $subject_competency->toString() . ' - id:' . $subject_competency->getId() . ')');
     } else {
         $subject_competency->delete();
     }
     $this->getRequest()->setParameter('subject_grading_id', $subject_grading_id);
     return $this->forward('subject_grading', 'listCompetency');
 }
 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(SubjectCompetencyPeer::ID, $pks, Criteria::IN);
         $objs = SubjectCompetencyPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemple #6
0
                                 <br>
								 . <?php 
        echo link_to_remote(__('kompetensi dasar'), array('url' => 'subject_grading/listCompetency?subject_grading_id=' . $subject_grading->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white', 'style' => 'font-size:10px;'));
        ?>
							</p>
						</td>
						<!--td><?php 
        #echo $subject_grading->getKkm()? $subject_grading->getKkm() : '-'
        ?>
</td-->
                        <td align="center" style="text-align:left;">
                    	<?php 
        $c = new Criteria();
        $c->add(SubjectCompetencyPeer::SUBJECT_GRADING_ID, $subject_grading->getId());
        $sub_count = SubjectCompetencyPeer::doCount($c);
        $subject_competency = SubjectCompetencyPeer::doSelect($c);
        ?>
                        <?php 
        #echo link_to_remote($sub_count,
        #		array(
        #			'url'=>'subject_grading/listCompetency?subject_grading_id='.$subject_grading->getId(),
        #			'update'=>'content',
        #			'script'=>'true',
        #			'loading' => "showIndicator('content', 'snakebig_black');",
        #			'complete' => "hideIndicator()",
        #		),
        #		array('class'=>'white', 'title'=>__('Detail Kompetensi Dasar'))
        #	);
        if ($sub_count < 1) {
            echo link_to_remote($sub_count, array('url' => 'subject_grading/listCompetency?subject_grading_id=' . $subject_grading->getId(), 'update' => 'content', 'script' => 'true', 'loading' => "showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white', 'title' => __('Detail Kompetensi Dasar')));
        } else {