//以面向对象的思想连接数据库
class Oracle {
var $db="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.136.13)(PORT=1521))(CONNECT_DATA= (SID=orcl)))";
var $dbname="crm";//连接数据库的用户名
var $dbpwd="crm";//连接数据库的用户名密码
var $dblink="";//连接数据库
function Oracle() {
$this->dblink=oci_connect($this->dbname,$this->dbpwd,$this->db);
}
}
?>
session_start();
$username = $_SESSION['USERNAME'];
/*if(!isset($username)){
header("Location:http://".$_SERVER["SERVER_NAME"]."/ibm2crm/index.php");
exit;
}*/
?>
require_once("../../../web/include/page.php");
?>
require_once("../../../lib/db/Oracle.class.php");
$db = new Oracle();
$sql ="begin userPKG.pageUser(:pageno,:pagesize,:depcur,:totalrecore);end;";
$stmt = oci_parse($db->dblink,$sql);
$cur=oci_new_cursor($db->dblink);
oci_bind_by_name($stmt,"pageno",$pageno,3);
oci_bind_by_name($stmt,"pagesize",$pagesize,3);
oci_bind_by_name($stmt,"depcur",$cur,-1,OCI_B_CURSOR);
oci_bind_by_name($stmt,"totalrecore",$totalrecord,2);
oci_execute($stmt);
oci_execute($cur);
$a=1;
//$color="this.bgColor = '#C2E9FC'";
//$color2="this.bgColor = 'FFFFFF'";
if($cur!=null)
{ if($_SESSION['USER_ISMANAGER'])
{
while($row=oci_fetch_array($cur))
{
$stmt = ociparse($db->dblink, "select dname from crm_department where deptno='$row[2]'");
OCIDefineByName($stmt,"DNAME",&$dname);
ociexecute($stmt);
while(ocifetch($stmt))
echo "
echo "
echo "
echo "
echo "
echo "
}
$totalPage = floor(($totalrecord-1)/$pagesize+1);
?>