Example #1
0
 private function change()
 {
     $db = Lua::get_one("select status from lua_model where id='" . Lua::post('id') . "'");
     $rt = $db['status'] == 1 ? 0 : 1;
     Doo::db()->query("update lua_model set status='{$rt}' where id='" . Lua::post('id') . "'");
     Lua::println();
 }
Example #2
0
 private function so_value()
 {
     $mode = Lua::post('mode');
     $value = Lua::post('value');
     if ($value) {
         $model_id = Lua::post('model_id');
         $db = $this->_table_db($model_id);
         if ($db) {
             if ($mode == 0) {
                 $row = Lua::get_one("select subject from " . $db['tablename'] . " where id='" . intval($value) . "'");
                 Lua::println($row['subject']);
             } else {
                 $exv = explode(',', $value);
                 $out = array();
                 if ($exv) {
                     foreach ($exv as $id) {
                         if ($id) {
                             $out[] = intval($id);
                         }
                     }
                 }
                 if ($out) {
                     $out = array_unique($out);
                     $ime = implode(',', $out);
                     $list = Lua::get_more("select id,subject from " . $db['tablename'] . " where id in (" . $ime . ")");
                     if ($list) {
                         foreach ($list as $row) {
                             echo $row['subject'] . " <a href='javascript:;' onclick=\"so_delete('{$ime}', " . $row['id'] . ", '" . Lua::post('id') . "','" . $model_id . "');\" title='移除'>×</a>&nbsp;";
                         }
                         echo "<script>\$(\"input[name='" . Lua::post('id') . "']\").val('" . $ime . "');</script>";
                     }
                 }
             }
         }
     }
 }
Example #3
0
 private function change()
 {
     $id = Lua::post('uid');
     $db = Lua::get_one("select status from lua_member where uid='{$id}'");
     $rt = $db['status'] == 1 ? 0 : 1;
     Doo::db()->query("update lua_member set status='{$rt}' where uid='{$id}'");
     Lua::println();
 }
Example #4
0
    private function isdefault()
    {
        $id = Lua::post('id');
        $db = Lua::get_one("select isdefault from lua_channel where id='{$id}'");
        $rt = $db['isdefault'] == 1 ? 0 : 1;
        Doo::db()->query("update lua_channel set isdefault='0'");
        Doo::db()->query("update lua_channel set isdefault='{$rt}' where id='{$id}'");
        $_index_db = Doo::db()->fetchRow("select * from lua_channel where isdefault='1' order by id desc limit 1");
        $__install = '
if (file_exists("no.install")){
    header("Location:/@install/");
    exit;
}
';
        if ($_index_db) {
            $__php = '<?php
' . $__install . '
header("Location:/' . $_index_db['path'] . '/");
exit;
';
        } else {
            $__php = '<?php
' . $__install . '
header("Location:/' . ADMIN_ROOT . '/");
exit;';
        }
        file_put_contents(LUA_ROOT . 'index.php', $__php);
        Lua::println();
    }
Example #5
0
 private function ajax_change()
 {
     $uid = Lua::post('uid');
     if ($uid) {
         $db = Lua::get_one("select gid from lua_admin where uid='{$uid}'");
         $rt = $db['gid'] == 1 ? 0 : 1;
         Doo::db()->query("update lua_admin set gid='{$rt}' where uid='{$uid}'");
         Lua::println();
     }
 }