17 include_once (
'Class.Log.php');
34 "lib" =>
"Commence par",
36 "param" =>
"SEMIPERCENT"
44 "lib" =>
"Ne Contient Pas",
49 "lib" =>
"Est égal à",
54 "lib" =>
"Est différent de",
59 "lib" =>
"Est Supérieur à",
64 "lib" =>
"Est Inférieur à",
69 "lib" =>
"N'est pas Vide",
70 "oper" =>
"is not null",
99 $this->log =
new Log(
"",
"Query",
"$class");
101 $this->dbaccess = $this->basic_elem->dbaccess;
105 private function initQuery(
$start = 0,
$slice = 0, $p_query =
"", $onlycont =
false)
108 if ($p_query ==
'') {
112 foreach ($this->basic_elem->fields as $k => $v) {
113 $select = $select .
" " . $this->basic_elem->dbtable .
"." . $v .
",";
116 foreach ($this->basic_elem->sup_fields as $k => $v) {
117 $select = $select .
" " . $v .
",";
119 $select = substr($select, 0, strlen($select) - 1);
121 $select =
'count(*)';
124 $from = $this->basic_elem->dbtable;
125 foreach ($this->basic_elem->sup_tables as $k => $v) {
129 $query =
"select {$select}
134 if ($where[$nb_where] !=
"") {
138 if ($where[$nb_where] !=
"") {
142 if ($where[$nb_where] !=
"") {
150 foreach ($where as $k => $v) {
162 if (($this->
order_by !=
"") && (!$onlycont)) {
164 if (isset($this->desc) && ($this->desc ==
"up")) {
178 $this->LastQuery =
$query;
196 $err = $this->basic_elem->exec_query(
$query, 0,
true);
202 include_once (
"Class.DbObjectList.php");
203 return new DbObjectList($this->dbaccess, $this->basic_elem->res, $this->class);
208 $this->nb = $this->basic_elem->numrows();
210 if ($this->nb == 0) {
215 return $this->basic_elem->res;
217 if (
$start >= $this->nb) {
230 $this->list = pg_fetch_all($this->basic_elem->res);
233 $result = $this->basic_elem->fetch_array(
$c);
235 $this->list[
$c] =
new $this->
class(
$this->dbaccess,
"", $result, $this->basic_elem->dbid);
237 foreach ($result as $k => $v) {
238 $this->list[
$c][$k] = $v;
243 return ($this->list);
252 $this->res_type =
"TABLE";
257 $result = $this->basic_elem->fetch_array(0);
258 return ($result[
"count"]);
264 if (isset($this->criteria) && ($this->criteria !=
"") && ($this->
operator !=
"none")) {
265 if ($this->casse ==
"NON") {
271 switch ($this->operators[$this->
operator][
"param"]) {
277 $string =
" '%{$this->string}%'";
281 $string =
" '{$this->string}%'";
283 if (($this->
operator !=
'null') && ($this->
operator !=
'notn')) {
284 if ($this->casse ==
"NON") {
285 $out.=
" upper({$string})";
302 if (
sizeof($this->basic_elem->sup_where) > 0) {
303 reset($this->basic_elem->sup_where);
305 foreach ($this->basic_elem->sup_where as $k => $v) {
319 $this->basic_elem->sup_where[] = $contraint;
323 $this->basic_elem->sup_where = array();
328 if ($resultname ==
"") $this->basic_elem->sup_fields[] = $sqlattr;
329 else $this->basic_elem->sup_fields[] =
"$sqlattr as $resultname";
Query($start=0, $slice=0, $res_type="LIST", $p_query="")
Count($start=0, $slice=0)
__construct($dbaccess, $class)
AddField($sqlattr, $resultname="")
if(($docid!==0)&&(!is_numeric($docid))) $query
if($file) if($subject==""&&$file) if($subject=="") $err