[phpwebapp-commits] CVS: web_app/database class.Recordset.php,1.9,1.10 class.PagedRS.php,1.9,1.10 cl
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-07-13 13:18:18
|
Update of /cvsroot/phpwebapp/web_app/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4377/database Modified Files: class.Recordset.php class.PagedRS.php class.EditableRS.php Log Message: xml parser Index: class.Recordset.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.Recordset.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** class.Recordset.php 29 Jan 2004 08:28:37 -0000 1.9 --- class.Recordset.php 13 Jul 2004 13:18:08 -0000 1.10 *************** *** 87,92 **** function Field($fld_name) { ! if ( isset($this->content[$this->pos][$fld_name]) ) ! return $this->content[$this->pos][$fld_name]; else return UNDEFINED; --- 87,92 ---- function Field($fld_name) { ! if ( isset($this->contents[$this->pos][$fld_name]) ) ! return $this->contents[$this->pos][$fld_name]; else return UNDEFINED; *************** *** 96,100 **** function Fields() { ! return $this->content[$this->pos]; } --- 96,100 ---- function Fields() { ! return $this->contents[$this->pos]; } *************** *** 114,118 **** $this->cnn = $conn; } ! $this->content = array(); $this->count = 0; $this->pos = 0; --- 114,118 ---- $this->cnn = $conn; } ! $this->contents = array(); $this->count = 0; $this->pos = 0; *************** *** 121,125 **** /** ! * Executes the query and puts the result into $this->content. * If $conn is given, it is used instead of its own connection. */ --- 121,125 ---- /** ! * Executes the query and puts the result into $this->contents. * If $conn is given, it is used instead of its own connection. */ *************** *** 143,147 **** if (is_array($result)) { ! $this->content = $result; $this->count = count($result); $this->pos = 0; --- 143,147 ---- if (is_array($result)) { ! $this->contents = $result; $this->count = count($result); $this->pos = 0; *************** *** 156,160 **** function Close() { ! if (isset($this->content)) unset($this->content); $this->count = 0; $this->pos = 0; --- 156,160 ---- function Close() { ! if (isset($this->contents)) unset($this->contents); $this->count = 0; $this->pos = 0; *************** *** 170,178 **** if ($length===UNDEFINED) { ! $slice = array_slice($this->content, $offset); } else { ! $slice = array_slice($this->content, $offset, $length); } --- 170,178 ---- if ($length===UNDEFINED) { ! $slice = array_slice($this->contents, $offset); } else { ! $slice = array_slice($this->contents, $offset, $length); } *************** *** 180,184 **** $rs = new $this->type; ! $rs->content = $slice; $rs->count = sizeof($slice); $rs->pos = 0; --- 180,184 ---- $rs = new $this->type; ! $rs->contents = $slice; $rs->count = sizeof($slice); $rs->pos = 0; *************** *** 207,211 **** //get the field value if ($pos===UNDEFINED) $pos = $this->pos; ! $fld_value = $this->content[$pos][$fld_name]; //match with pattern --- 207,211 ---- //get the field value if ($pos===UNDEFINED) $pos = $this->pos; ! $fld_value = $this->contents[$pos][$fld_name]; //match with pattern *************** *** 238,242 **** if ($this->match($condition, $i)) { ! $rec = $this->content[$i]; $rs->addRec($rec); } --- 238,242 ---- if ($this->match($condition, $i)) { ! $rec = $this->contents[$i]; $rs->addRec($rec); } *************** *** 308,314 **** for ($i=0; $i < $this->count; $i++) { ! if ( isset($this->content[$i][$fld_name]) ) { ! $column[] = $this->content[$i][$fld_name]; } } --- 308,314 ---- for ($i=0; $i < $this->count; $i++) { ! if ( isset($this->contents[$i][$fld_name]) ) { ! $column[] = $this->contents[$i][$fld_name]; } } *************** *** 331,335 **** { $fld = $arr_flds[$j]; ! $rec[$fld] = $this->content[$i][$fld]; } $rs->addRec($rec); --- 331,335 ---- { $fld = $arr_flds[$j]; ! $rec[$fld] = $this->contents[$i][$fld]; } $rs->addRec($rec); Index: class.PagedRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.PagedRS.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** class.PagedRS.php 24 Sep 2003 14:22:50 -0000 1.9 --- class.PagedRS.php 13 Jul 2004 13:18:08 -0000 1.10 *************** *** 69,73 **** } ! /** Executes the query and puts the result into $this->content. */ function Open($cp =UNDEFINED, $conn =UNDEFINED) { --- 69,73 ---- } ! /** Executes the query and puts the result into $this->contents. */ function Open($cp =UNDEFINED, $conn =UNDEFINED) { *************** *** 104,108 **** } ! $this->content = $result; $this->count = count($result); $this->pos = 0; --- 104,108 ---- } ! $this->contents = $result; $this->count = count($result); $this->pos = 0; Index: class.EditableRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.EditableRS.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** class.EditableRS.php 19 May 2004 09:19:09 -0000 1.8 --- class.EditableRS.php 13 Jul 2004 13:18:08 -0000 1.9 *************** *** 46,50 **** for ($i=0; $i < $this->count; $i++) { ! $fun_name($this->content[$i]); } } --- 46,50 ---- for ($i=0; $i < $this->count; $i++) { ! $fun_name($this->contents[$i]); } } *************** *** 66,70 **** } ! $rec = &$this->content[$this->pos]; if (!isset($rec[$fld_name])) { --- 66,70 ---- } ! $rec = &$this->contents[$this->pos]; if (!isset($rec[$fld_name])) { *************** *** 94,98 **** { $this->count++; ! $this->content[0] = $rec; $this->pos = 0; return; --- 94,98 ---- { $this->count++; ! $this->contents[0] = $rec; $this->pos = 0; return; *************** *** 102,110 **** for ($i=$this->count; $i > ($this->pos+1); $i--) { ! $this->content[$i] = $this->content[$i-1]; } if (!$this->BOF()) { ! $this->content[$i] = $this->content[$i-1]; } $this->count++; --- 102,110 ---- for ($i=$this->count; $i > ($this->pos+1); $i--) { ! $this->contents[$i] = $this->contents[$i-1]; } if (!$this->BOF()) { ! $this->contents[$i] = $this->contents[$i-1]; } $this->count++; *************** *** 132,136 **** { $this->count++; ! $this->content[0] = $rec; $this->pos = 0; return; --- 132,136 ---- { $this->count++; ! $this->contents[0] = $rec; $this->pos = 0; return; *************** *** 140,148 **** for ($i=$this->count; $i > ($this->pos + 1); $i--) { ! $this->content[$i] = $this->content[$i-1]; } if (!$this->BOF()) { ! $this->content[$i] = $this->content[$i-1]; } $this->count++; --- 140,148 ---- for ($i=$this->count; $i > ($this->pos + 1); $i--) { ! $this->contents[$i] = $this->contents[$i-1]; } if (!$this->BOF()) { ! $this->contents[$i] = $this->contents[$i-1]; } $this->count++; *************** *** 207,211 **** if ($i1 >= 0) //at BOF, $this->pos is -1 { ! $this->content[$i1] = $this->content[$i2]; } } --- 207,211 ---- if ($i1 >= 0) //at BOF, $this->pos is -1 { ! $this->contents[$i1] = $this->contents[$i2]; } } *************** *** 214,218 **** for ($i=$this->pos+$rem; $i < $this->count; $i++) { ! unset($this->content[$i]); } //update the count of the recs --- 214,218 ---- for ($i=$this->pos+$rem; $i < $this->count; $i++) { ! unset($this->contents[$i]); } //update the count of the recs *************** *** 226,234 **** function addCol($fld_name, $default_value =UNDEFINED) { ! if (isset($this->content[0][$fld_name])) return; for ($i=0; $i < $this->count; $i++) { ! $this->content[$i][$fld_name] = $default_value; } } --- 226,234 ---- function addCol($fld_name, $default_value =UNDEFINED) { ! if (isset($this->contents[0][$fld_name])) return; for ($i=0; $i < $this->count; $i++) { ! $this->contents[$i][$fld_name] = $default_value; } } *************** *** 239,243 **** function renameCol($fld_name, $new_fld_name) { ! if (isset($this->content[0][$new_fld_name])) { $msg = "EditableRS::renameCol(): there is already" --- 239,243 ---- function renameCol($fld_name, $new_fld_name) { ! if (isset($this->contents[0][$new_fld_name])) { $msg = "EditableRS::renameCol(): there is already" *************** *** 249,254 **** for ($i=0; $i < $this->count; $i++) { ! $this->content[$i][$new_fld_name] = $this->content[$i][$fld_name]; ! unset($this->content[$i][$fld_name]); } } --- 249,254 ---- for ($i=0; $i < $this->count; $i++) { ! $this->contents[$i][$new_fld_name] = $this->contents[$i][$fld_name]; ! unset($this->contents[$i][$fld_name]); } } |