function render()
    {
        $this->view->headLink()->appendStylesheet('/css/express-table/style.css');
        $sections = $this->_modelInfoConfig->getSections();
        // print_r($formGroups);
        ?>
		
       <div style="text-align: center; width: 100%; padding-left: 20px" align="center" > <table class="statistics " style="width: 90%">
        <?php 
        $index = 0;
        foreach ($sections as $section) {
            ?>
        <tr id="<?php 
            echo $section['id'];
            ?>
"><th style="height: 5px"><?php 
            echo $section['label'];
            ?>
</th></tr>
        <tr><td>
        <table  class="hor-minimalist-b" style="width: 95%">
        <tr>
          <?php 
            $line = 0;
            $col = 0;
            foreach ($section['items'] as $item) {
                $line++;
                $col += 1;
                if ($item->type == 'field') {
                    $elementid = $item->id;
                    $prop = $this->_config->getPropByName($elementid);
                    ?>
              
               <td style="text-align: left; width: 20%; max-width: 200px;text-transform: capitalize;font-weight: bold;;" ><?php 
                    echo $this->view->translate($prop->label);
                    ?>
  </td>
               <td style="width: 10px"> : </td>
               <td style="text-align: left;" ><?php 
                    echo $this->_model->{$elementid};
                    ?>
  </td>
               
               
                <?php 
                    if ($line % 2 == 0) {
                        echo "</tr><tr>";
                        $col = 0;
                    }
                    ?>
  
          
         <?php 
                } elseif ($item->type == 'viewHelper') {
                    ?>
          
          <tr>
               <td colspan="6"> <?php 
                    echo $this->view->{$item->id}($this->_model);
                    ?>
 </td>
          </tr>
         
       <?php 
                    $col = 0;
                }
                ?>
       
       
       <?php 
            }
            ?>
       <?php 
            if ($col == 1) {
                echo "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
                $endline = true;
            }
            ?>
        </table>
        </td></tr>
        <?php 
            $index += 1;
        }
        ?>
        
        </table></div>
<?php 
    }
Example #2
0
 /**
  * @return App_Model_Info
  * config ของ หน้า info ใช้ ร่วมกับ App_View_Helper_DisplayModelInfoAdvance
  * @param unknown_type $uiName
  */
 public function getModelInfoConfig($uiName = 'default')
 {
     $uiconfig = $this->getConfig();
     $tmpconfig = @$uiconfig->config->ui->{$uiName};
     if ($tmpconfig instanceof Zend_Config) {
         //	echo "C1";
         $config = $tmpconfig;
     } else {
         //	echo "C2";
         $config = $config->config;
     }
     if (isset($config->info->sections)) {
         $modelInfo = new App_Model_Info();
         $modelInfo->setUiname($uiName);
         foreach ($config->info->sections->section as $section) {
             $modelInfo->addSection($section);
             if (isset($section->item->id)) {
                 //die($section->item->id);
                 $modelInfo->addItem($section->id, $section->item);
             } else {
                 foreach ($section->item as $item) {
                     //die($item->id);
                     $modelInfo->addItem($section->id, $item);
                 }
             }
         }
     }
     return $modelInfo;
 }