示例#1
0
                ?>
" class="<?php 
                echo $field->column_name;
                ?>
" type="hidden"/>
									<?php 
            } else {
                ?>
                                    	<?php 
                if (stristr($field->column_comment, 'multiselect')) {
                    $comment = $field->column_comment;
                    $field->column_comment = ' ';
                }
                ?>
										<?php 
                echo @call_user_func('form_' . convertDataType($field->data_type), $field_structure);
                ?>
<br/><span class="help_text"><?php 
                echo clean_comment($field->column_comment);
                echo $field->is_nullable == 'YES' ? '' : '<span class="red">&nbsp;(required)</span>';
                ?>
</span>
                                      <?php 
                /** check to see if there should be a multiselect between 2 tables **/
                ?>
                                        <?php 
                if (isset($comment)) {
                    /* setting up multi-select:
                     * add to the comment of a field: 
                     * multiselect|table to select from|table to save to|column to save(id)|column to display|main column from relational table| second column from relation table
                     */
示例#2
0
 /**
  * Get DataObject Fields
  * @return void
  */
 protected function getDOFields()
 {
     $db = BizSystem::dbConnection($this->db_name);
     $tblCols = $db->describeTable($this->table_name);
     $db_config = $this->db_config;
     $i = 0;
     if (is_array($tblCols["sort_order"])) {
         $this->sort_column = "sort_order";
     }
     foreach ($tblCols as $colName => $colAttrs) {
         // special handling on the primary key column(s)
         // for simple, just consider simple primary key case
         if ($colAttrs['PRIMARY'] == true) {
             $fields[$i]['name'] = 'Id';
             $this->do['id_identity'] = $colAttrs['IDENTITY'];
             $this->id_identity = true;
         } else {
             $fields[$i]['name'] = $colName;
         }
         $fields[$i]['col'] = $colName;
         $fields[$i]['nullable'] = $colAttrs['NULLABLE'];
         $fields[$i]['length'] = $colAttrs['LENGTH'];
         // different db engine has different type name, but need to convert them to DO types.
         $fields[$i]['type'] = convertDataType($colAttrs['DATA_TYPE'], $db_config['Driver']);
         $fields[$i]['element'] = getDataElement($colAttrs['DATA_TYPE'], $db_config['Driver']);
         $fields[$i]['options'] = getDataOptions($colAttrs['DATA_TYPE'], $db_config['Driver']);
         $fields[$i]['raw_type'] = $colAttrs['DATA_TYPE'];
         if ($colAttrs['DEFAULT'] != "CURRENT_TIMESTAMP") {
             $fields[$i]['default'] = $colAttrs['DEFAULT'];
         }
         $i++;
     }
     $this->fields = $fields;
 }