예제 #1
0
 /**
  * Retrives active categories count
  * @param Varien_Object| $object
  * @return integer
  */
 public function __getChildrenCount($object)
 {
     if (Mage::getStoreConfig('catalog/frontend/flat_catalog_category')) {
         if (!$object->getChildrenCount()) {
             $count = 0;
             if ($object->getChildrenNodes()) {
                 foreach ($object->getChildrenNodes() as $child) {
                     if ($child->getIsActive()) {
                         $count++;
                     }
                 }
                 return $count;
             }
             if ($object->getChildren()) {
                 foreach ($object->getChildren() as $child) {
                     if ($child->getIsActive()) {
                         $count++;
                     }
                 }
                 return $count;
             }
         }
         return $object->getChildrenCount();
     } else {
         if ($object->getChildrenCount()) {
             $count = 0;
             foreach ($object->getChildren() as $child) {
                 if ($child->getIsActive()) {
                     $count++;
                 }
             }
             return $count;
         }
     }
     return 0;
 }
    ?>
                                                    <tr>
                                                        <td><?php 
    echo $result['school_id'];
    ?>
</td>
                                                        <td><?php 
    echo $result['name'];
    ?>
</td>
                                                        <td><?php 
    echo $result['district'];
    ?>
</td>
                                                        <?php 
    $child_count = getChildrenCount($result['school_id']);
    foreach ($child_count as $row) {
        ?>
                                                            <td><?php 
        echo $row['count_child'];
        ?>
</td>
                                                            <?php 
    }
    ?>
                                                        <form method="POST" action="ministry_school_view.php">
                                                            <td>
                                                                <button value="School"
                                                                        class="btn btn-block btn-primary btn-sm"
                                                                        name="view_school">View
                                                                </button>