コード例 #1
0
ファイル: object.action.php プロジェクト: GeoPvN/winstone
            }
            $output['aaData'][] = $row;
        }
        break;
    case 'save_object':
        //
        $object_id = $_REQUEST['id'];
        $name = $_REQUEST['na'];
        $type = $_REQUEST['t'];
        $parent = $_REQUEST['p'];
        $address = $_REQUEST['a'];
        $warehouse = $_REQUEST['w'];
        if ($object_id == '') {
            AddObject($user_id, $name, $type, $parent, $address, $warehouse);
        } else {
            SaveObject($user_id, $object_id, $name, $type, $parent, $address, $warehouse);
        }
        break;
    case 'disable':
        $object_id = $_REQUEST['id'];
        Disable($object_id);
        break;
    default:
        $error = 'Action is Null';
}
$output['error'] = $error;
echo json_encode($output);
function GetObb($object_id)
{
    $res = mysql_fetch_assoc(mysql_query("\tSELECT\t`object`.`ID`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`object`.`name`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`object`.`address`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`object`.`warehouse`\n\t\t\t\t\t\t\t\t\t\t\t\tFROM\t`object`\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE   `object`.`actived` = 1 && `id`={$object_id}"));
    return $res;
コード例 #2
0
                $row[] = $aRow[$i];
                if ($i == $count - 1) {
                    $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />';
                }
            }
            $output['aaData'][] = $row;
        }
        break;
    case 'save_object':
        $object_id = $_REQUEST['id'];
        $name = $_REQUEST['name'];
        $object = $_REQUEST['object'];
        if ($object_id == '') {
            AddObject($user_id, $name, $object);
        } else {
            SaveObject($user_id, $object_id, $name, $object);
        }
        break;
    case 'disable':
        $object_id = $_REQUEST['id'];
        Disable($object_id);
        break;
    default:
        $error = 'Action is Null';
}
$output['error'] = $error;
echo json_encode($output);
function GetObb($object_id)
{
    $res = mysql_fetch_assoc(mysql_query("\tSELECT\t`tables`.`id`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`tables`.`name`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`tables`.`object_id`\n\t\t\t\t\t\t\t\t\t\t\t\tFROM\t`tables`\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE   `tables`.`actived` = 1 && `id`={$object_id}"));
    return $res;