<?php
/**
* Entier Studio
*
* LICENSE
*
* Copyright 2006 Entier Studio team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package entier.studio
* @copyright Copyright (c) 2006 Entier Studio team. All rights reserved.
* @version $Id: data.OnlineResource.php 81 2008-01-17 23:08:21Z yannromefort $
*/
//-----------------------------------------------------------------------------
// namespace
if (!defined("DefOnlineResource")) {
//-------------------------------------------------------------------------
// Define
define("DefOnlineResource", "1");
//-------------------------------------------------------------------------
// Include
@require_once (FRAMEWORK_DIR . DATAROWOBJECT);
//-------------------------------------------------------------------------
// Class
class OnlineResource extends DataRow {
//---------------------------------------------------------------------
// Constructor
/**
*
* @param integer pkid OnlineResource OBJRESOPKID // primary key
*
*/
function OnlineResource($OBJRESOPKID = 0, $DIRRESOPKID = 0) {
//
$this->m_tableSet[PRIMARYKEY] = "tbl_objectory_resource";
//
$this->m_indexSet[PRIMARYKEY] = "OBJRESOPKID";
$this->m_indexSet[FOREIGNKEY] = "DIRRESOPKID";
$this->m_indexSet[NATURALKEY] = "OBJRESONAME";
//
$this->m_fieldSet["OBJRESOPKID"] = $OBJRESOPKID;
$this->m_fieldSet["DIRRESOPKID"] = $DIRRESOPKID;
}
//-------------------------------------------------------------------------
// Methods
/**
*
* @param integer index type
* @return string
*/
function getSelectQuery($indexType = PRIMARYKEY) {
//
$string = EN_SERVER_CODE;
//
switch ($indexType) {
case PRIMARYKEY:
/*
*
* SELECT
* tbl_objectory_resource as t1
* <-> tbl_directory_resource as t2
* <-> tbl_directory_resource_access as t3
*
* ON OBJELEMPKID
*
*/
//
$field = $this->m_indexSet["$indexType"];
$index = $this->m_fieldSet["$field"];
//
if ($index != 0) return ("SELECT
t1.OBJRESOPKID,
t1.DIRPROJPKID,
t1.DIRRESOPKID,
t1.OBJRESONAME,
t1.OBJRURLNAME,
t1.OBJRURLHOST,
t1.OBJRURLPORT,
t1.OBJRURLUSER,
AES_DECRYPT( t1.OBJRURLPASS,'$string') as OBJRDECPASS,
t1.OBJRESOSTAT,
t2.DIRRESONAME,
t3.DIRRACCCODE
FROM
tbl_objectory_resource as t1,
tbl_directory_resource as t2,
tbl_directory_resource_access as t3
WHERE
t1.OBJRESOPKID=$index
AND
t1.OBJRESOSTAT > 0
AND
t1.DIRRESOPKID=t2.DIRRESOPKID
AND
t2.DIRRACCPKID=t3.DIRRACCPKID");
break;
}
//
return ("");
}
};
// Class
//-------------------------------------------------------------------------
}
// namespace
//-----------------------------------------------------------------------------
?>