<?php
class x_cn { 
var $x_fu = false; 
var $x_as = false; 
var $x_bk = 0; 
var $x_fv = Array(); 
var $x_fw = 0; 
var $x_fx = 0; 
var $x_fy = 0; 
function x_cn() { 
$x_1 = kerio("webiface::PhpSession"); 
$x_1->getStarInfo(&$x_4); 
$this->right = $x_4['right']; 
$this->dbStatus = $x_4['dbStatus']; 
if (0 == $this->right) { 
$this->x_fy = 0; 
} elseif ($this->dbStatus != 1) { 
$this->x_fy = 0; 
} else { 
$x_fz['host'] = $x_4['server'] . ($x_4['server'] != '' ? ':' : '') . $x_4['database']; 
$x_fz['user'] = $x_4['user']; 
$x_fz['password'] = $x_4['password']; 
} 
$this->x_fu = @ibase_pconnect($x_fz['host'], $x_fz['user'], $x_fz['password'],"UNICODE_FSS"); 
if (!$this->x_fu) { 
$this->x_fy = 0; 
} 
} 
function x_cc($x_cq = '') { 
$this->x_g0(); 
$this->x_as = Array(); 
if (1 == $this->dbStatus) { 
$this->x_bk = 0; 
$this->x_as = @ibase_query($this->x_fu, $x_cq); 
if (!$this->x_as) { 
return Array(); 
} else { 
return $this->x_as; 
} 
} 
} 
function x_g0() { 
$x_1 = kerio("webiface::PhpSession"); 
$x_1->getStarInfo(&$x_4); 
$this->dbStatus = $x_4['dbStatus']; 
} 
function x_9d() { 
return $this->x_bk; 
} 
function x_g1($x_g2 = 'index') { 
if ($this->x_as) { 
if ('assoc' == $x_g2) { 
$x_3u = @ibase_fetch_assoc($this->x_as); 
} else { 
$x_3u = @ibase_fetch_row($this->x_as); 
} 
if (is_array($x_3u)) { 
reset($x_3u); 
foreach ($x_3u as $x_fv) { 
if (isset($x_fv)) { 
$this->x_bk++; 
$this->x_fv = $x_3u; 
return true; 
} else { 
@ibase_free_result($this->x_as); 
return false; 
} 
} 
} else { 
@ibase_free_result($this->x_as); 
return false; 
} 
} 
} 
function x_cs($x_g2 = 'index', $x_dp = false) { 
$x_5c = Array(); 
while ($this->x_g1($x_g2)) { 
if (!$x_dp) { 
$x_5c[] = $this->x_fv; 
} elseif(isset($this->x_fv[$x_dp])) { 
$x_5c[trim($this->x_fv[$x_dp])] = $this->x_fv; 
} else { 
$x_5c[] = $this->x_fv; 
} 
} 
return $x_5c; 
} 
} 
?>