Example #1
0
             $rs = $db->select(0, 1, 'tb_member', 'desk' . $desk, 'and tbid = ' . session('member_id'));
             $desk_arr = explode(',', $rs['desk' . $desk]);
             if ($desk_arr[0] == '') {
                 $desk_arr[0] = $id;
             } else {
                 array_splice($desk_arr, $to, 0, $id);
             }
             $db->update(0, 0, 'tb_member', 'desk' . $desk . ' = "' . implode(',', $desk_arr) . '"', 'and tbid = ' . session('member_id'));
             $db->update(0, 0, 'tb_member_app', 'folder_id = 0', 'and tbid=' . $id . ' and member_id = ' . session('member_id'));
             break;
     }
     break;
     //新建文件夹
 //新建文件夹
 case 'addFolder':
     addApp(array('type' => 'folder', 'icon' => $icon, 'name' => $name, 'desk' => $desk));
     break;
     //文件夹重命名
 //文件夹重命名
 case 'updateFolder':
     $db->update(0, 0, 'tb_member_app', 'icon = "' . $icon . '", name = "' . $name . '"', 'and tbid = ' . $id . ' and member_id = ' . session('member_id'));
     break;
     //获得应用评分
 //获得应用评分
 case 'getAppStar':
     $rs = $db->select(0, 1, 'tb_app', 'starnum', 'and tbid = ' . $id);
     echo $rs['starnum'];
     break;
     //更新应用评分
 //更新应用评分
 case 'updateAppStar':
Example #2
0
<?php

require '../../global.php';
switch ($ac) {
    case 'edit':
        if ($id == '') {
            addApp(array('type' => $val_type, 'icon' => $val_icon, 'name' => $val_name, 'url' => $val_url, 'width' => $val_width, 'height' => $val_height, 'isresize' => $val_isresize, 'isopenmax' => $val_isopenmax, 'isflash' => $val_isflash, 'desk' => $desk));
        } else {
            $set = array('type = "' . $val_type . '"', 'icon = "' . $val_icon . '"', 'name = "' . $val_name . '"', 'url = "' . $val_url . '"', 'width = ' . $val_width, 'height = ' . $val_height, 'isresize = ' . $val_isresize, 'isopenmax = ' . $val_isopenmax, 'isflash = ' . $val_isflash);
            $db->update(0, 0, 'tb_member_app', $set, 'and tbid = ' . $id . ' and member_id = ' . session('member_id'));
        }
        echo json_encode(array('info' => '', 'status' => 'y'));
        break;
    case 'uploadImg':
        include 'libs/Uploader.class.php';
        $config = array('savePath' => 'uploads/' . session('member_id') . '/shortcut/', 'allowFiles' => array('.jpg', '.jpeg', '.png', '.gif', '.bmp'), 'maxSize' => 1000);
        $up = new Uploader('xfile', $config);
        $info = $up->getFileInfo();
        echo '{"url":"' . $info['url'] . '","fileType":"' . $info['type'] . '","original":"' . $info['originalName'] . '","state":"' . $info['state'] . '"}';
        break;
}
Example #3
0
//----------------------------------------------------------------------
if ($action == 'updUserForm') {
    $name = $_POST['f_username'];
    $pswd = $_POST['f_password'];
    $uid = $_POST['f_uid'];
    updateUser($f_id, $name, $pswd, $uid);
    $do = 'list_user';
}
//----------------------------------------------------------------------
if ($action == 'addAppForm') {
    $appid = $_POST['f_appid'];
    $title = $_POST['f_title'];
    $ownerid = $_POST['f_ownerid'];
    $charttype = $_POST['f_charttype'];
    $shared = $_POST['f_shared'];
    addApp($appid, $title, $ownerid, $charttype, $shared);
    $do = 'list_app';
}
//----------------------------------------------------------------------
if ($action == 'updAppForm') {
    $appid = $_POST['f_appid'];
    $title = $_POST['f_title'];
    $ownerid = $_POST['f_ownerid'];
    $charttype = $_POST['f_charttype'];
    $shared = $_POST['f_shared'];
    updateApp($f_id, $title, $ownerid, $charttype, $shared);
    $do = 'list_app';
}
//----------------------------------------------------------------------
if ($action == 'addValueForm') {
    $sid = $_POST['f_sid'];