该类的名称为 class.Application
中间的内容如下:
<?php
class Application{
var $appId;
var $appCode;
var $appName;
var $appPath;
var $formId;
var $picFlow;
var $picFlowVoided;
var $listStep = array();
var $listUser = array();
function Application($appId="",$stepIndex="",$formId=""){
if($appId!=""){
$this->appId = $appId;
$this->stepIndex = $stepIndex;
$this->formId = $formId;
$this->getApplication();
// $this->getListApplicationStep();
if($this->stepIndex!=""){
$this->getListUser();
}
}
}
function getApplication(){
global $WORKFLOW;
$strSql = "SELECT * FROM ".$WORKFLOW->tblApplication." WHERE
ID='".$this->appId."'";
$query = $WORKFLOW->dbCon->getQuery($strSql);
$rs = $WORKFLOW->dbCon->getData($query);
$this->appCode = $rs['APP_CODE']; // 6 / 13
$this->appName = $rs['APP_NAME'];
// Vehicle Management System/Corrective and Preventive Action Requisition
$this->appPath = $rs['APP_PATH']; // formbrs/ / formcpar/
$this->picFlow = $rs['APP_FLOW']; //Null
$this->picFlowVoided = $rs['APP_VOIDED_FLOW']; //Null
}
function getListUser(){
global $WORKFLOW;
$strSql = "SELECT * FROM ";
if($this->formId!="")
$strSql .= $WORKFLOW->tblFormAuthorize." WHERE FORM_ID='".$this->formId."' AND ";
else
$strSql .= $WORKFLOW->tblAuthorize." WHERE APP_ID='".$this->appId."' AND ";
$strSql .= "STEP_INDEX='".$this->stepIndex."'"; ////我要在这把 $strSql打印出来〉 应该怎么来写啦 ????
//// echo $tmpStrSql; 这样不能打印出来???? ?? $query = $WORKFLOW->dbCon->getQuery($strSql);
while($rs = $WORKFLOW->dbCon->getData($query)){
if($this->formId!="")
$this->listUser[] = $rs['USER_ACTION'];
else
$this->listUser[] = $rs['USER_EN'];
}
}
}
}
?>在页 面中就用到
$APPLICATION = new Application($APP_ID);这里只有一个值传递进去 。。我想打印出来 class.Application 中 getListUser函数的 $strSql 语句 请问怎么来实现?
$APPLICATION->getListUser();
想要的是这个么?
$APPLICATION->getListUser();
echo $strSql;
请再 指教。。
//// echo $tmpStrSql; 这样不能打印出来???? ??
$this->lastSql = $strSql; //加上这句
$query = $WORKFLOW->dbCon->getQuery($strSql);
******************$APPLICATION->getListUser();
echo $APPLICATION->lastSql;