예제 #1
0
 function str_replace_action() {
 	chkpw('func_data_replace');
     if(front::post('submit') &&front::post('sfield') &&front::post('replace1')) {
         $field=front::post('sfield');
         $table=front::post('stable');
         $table=new $table();
         $replace1=front::post('replace1');
         $replace2=front::post('replace2');
         $where=front::post('where');
         if(!$where) {
             $table->getFields();
             $where=$table->primary_key.'>0';
         }
         $table->rec_update( " `$field` = REPLACE($field,'$replace1','$replace2')",$where);
         front::flash("成功替换!");
     }
     $_tables=tdatabase::getInstance()->getTables();
     $this->view->tables=array(0=>'请选则项目...');
     if(config::get('test_data')) $prefix='test_';
     else $prefix=config::get('database','prefix');
     foreach($_tables as $table) {
         if(!eregi($prefix,$table['name'])) continue;
         $name=str_replace($prefix,'',$table['name']);
         $name=str_replace('a_','',$name);
         $_name=lang($name);
         if($_name<>$name)
             $this->view->tables[$name]=$_name;
     }
 }
예제 #2
0
 private function get_my_tables() {
     $tables=array();
     $forms=tdatabase::getInstance()->getTables();
     foreach($forms as $form) {
         if(preg_match('/^'.config::get('database','prefix').'(my_\w+)/xi',$form['name'],$res))
             $tables[]=$res[1];
     }
     return $tables;
 }
예제 #3
0
function get_my_tables_list() {
    $tables = array('继承', '不绑定');
    $forms = tdatabase::getInstance()->getTables();
    foreach ($forms as $form) {
        if (preg_match('/^' . config::get('database', 'prefix') . '(my_\w+)/xi', $form['name'], $res))
            $tables[$res[1]] = setting::$var[$res[1]]['myform']['cname'];
    }
    return $tables;
}
예제 #4
0
echo uri();
?>
" method="post">
<div id="tagscontent" class="right_box">
<table border="0" cellspacing="0" cellpadding="0" name="table1" id="table1" width="100%">
        <thead>
            <tr class="th">
           <th style="width:60px;"><input title="点击可全选本页的所有项目"  onclick="CheckAll(this.form)" type="checkbox" name="chkall" class="checkbox" /></th>
          <th>表名</th>
           <th>记录数</th>
           <th>大小</th>
        </tr>
</thead>
<tbody>
        <?php 
foreach (tdatabase::getInstance()->getTables() as $table) {
    ?>
      <tr class="s_out">
           <td style="width:60px;" align="center"><input onclick="c_chang(this)" type="checkbox" value="<?php 
    echo $table['name'];
    ?>
" name="select[]" class="checkbox" /></td>
          <td align="left" style="padding-left:10px;"><?php 
    echo $table['name'];
    ?>
</td>
          <td align="left" style="padding-left:10px;"><?php 
    echo $table['count'];
    ?>
</td>
          <td align="left" style="padding-left:10px;"><?php