Файл: databasr/templates/table/edit.tpl
Строк: 132
{extends file="templates/index/index.tpl"}
{block
name="content"}
    <div class="container">
    
   <div class="row">
            <div
class="col-sm-12">
                <div
class="panel">
                    <div
class="panel-heading border">
                        Edit
table
                    </div>
                    <div
class="panel-body">
                        <form
action="{url controller=table action=updateStructure}"
method="post">
                        <table
class="table-form">
                            <tr>
   
                            <th>Column</th>
                   
            <th>Type</th>
                               
<th>Max Length</th>
                               
<th>Default</th>
                               
<th>Primary Key</th>
                               
<th></th>
                            </tr>
             
              {foreach $fields as $field}
                               
<tr>
                                    <td><input
type="text" name="fields[{$field->name}][name]"
value="{$field->name}" /></td>
                      
             <td>
                                        <select
name="fields[{$field->name}][type]">
                      
                     <option{if $field->type == "tinyint"}
selected="selected"{/if}>TINYINT</option>
              
                             <option{if $field->type ==
"smallint"}
selected="selected"{/if}>SMALLINT</option>
             
                              <option{if $field->type ==
"mediumint"}
selected="selected"{/if}>MEDIUMINT</option>
            
                               <option{if $field->type ==
"int"} selected="selected"{/if}>INT</option>
 
                                          <option{if $field->type ==
"bigint"}
selected="selected"{/if}>BIGINT</option>
               
                            <option{if $field->type ==
"float"}
selected="selected"{/if}>FLOAT</option>
                
                           <option{if $field->type ==
"double"}
selected="selected"{/if}>DOUBLE</option>
               
                            <option{if $field->type ==
"real"}
selected="selected"{/if}>REAL</option>
                 
                          <option{if $field->type ==
"decimal"}
selected="selected"{/if}>DECIMAL</option>
              
                             <option{if $field->type ==
"bit"} selected="selected"{/if}>BIT</option>
 
                                          <option{if $field->type ==
"serial"}
selected="selected"{/if}>SERIAL</option>
               
                            <option{if $field->type ==
"bool"}
selected="selected"{/if}>BOOL</option>
                 
                          <option{if $field->type ==
"boolean"}
selected="selected"{/if}>BOOLEAN</option>
              
                             <option{if $field->type ==
"dec"} selected="selected"{/if}>DEC</option>
 
                                          <option{if $field->type ==
"fixed"}
selected="selected"{/if}>FIXED</option>
                
                           <option{if $field->type ==
"numeric"}
selected="selected"{/if}>NUMERIC</option>
              
                             <option{if $field->type ==
"char"}
selected="selected"{/if}>CHAR</option>
                 
                          <option{if $field->type ==
"varchar"}
selected="selected"{/if}>VARCHAR</option>
              
                             <option{if $field->type ==
"tinytext"}
selected="selected"{/if}>TINYTEXT</option>
             
                              <option{if $field->type ==
"text"}
selected="selected"{/if}>TEXT</option>
                 
                          <option{if $field->type ==
"mediumtext"}
selected="selected"{/if}>MEDIUMTEXT</option>
           
                                <option{if $field->type ==
"longtext"}
selected="selected"{/if}>LONGTEXT</option>
             
                              <option{if $field->type ==
"tinyblob"}
selected="selected"{/if}>TINYBLOB</option>
             
                              <option{if $field->type ==
"mediumblob"}
selected="selected"{/if}>MEDIUMBLOB</option>
           
                                <option{if $field->type ==
"blob"}
selected="selected"{/if}>BLOB</option>
                 
                          <option{if $field->type ==
"longblob"}
selected="selected"{/if}>LONGBLOB</option>
             
                              <option{if $field->type ==
"enum"}
selected="selected"{/if}>ENUM</option>
                 
                          <option{if $field->type ==
"date"}
selected="selected"{/if}>DATE</option>
                 
                          <option{if $field->type ==
"datetime"}
selected="selected"{/if}>DATETIME</option>
             
                              <option{if $field->type ==
"timestamp"}
selected="selected"{/if}>TIMESTAMP</option>
            
                               <option{if $field->type ==
"time"}
selected="selected"{/if}>TIME</option>
                 
                          <option{if $field->type ==
"year"}
selected="selected"{/if}>YEAR</option>
                 
                      </select>
                                   
</td>
                                    <td><input
type="text"
name="fields[{$field->name}][max_length]"
value="{$field->max_length}" /></td>
                
                   <td><input type="text"
name="fields[{$field->name}][default]"
value="{$field->default}" /></td>
                   
                <td><input type="checkbox"
name="fields[{$field->name}][primary_key]"{if
$field->primary_key} checked="checked" {/if}/></td>
 
                                  <td>
                             
          <ul class="table-options">
                      
                     <li><a data-href="{url controller=table
action=dropcolumn name=$tableName column=$field->name}"
data-toggle="confirmation"><i class="fa
fa-trash"></i></a></li>
                         
              </ul>
                                    </td>
                               </tr>
                           
{/foreach}
                        </table>
                       
<div class="margin-top-small text-right">
                 
          <input type="hidden" name="table_name"
value="{$tableName}" />
                            <button
type="submit" class="btn btn-info">Update table
structure</button>
                        </div>
            
           </form>
                    </div>
               
</div>
            </div>
        </div>
   
</div>
{/block}