phpvortex-commit Mailing List for PHP Vortex Framework (Page 7)
Brought to you by:
nop144666
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(30) |
Oct
(93) |
Nov
(12) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(12) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Thiago R. <nop...@us...> - 2004-09-30 13:34:13
|
Update of /cvsroot/phpvortex/phpvortex/doc/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30208/html Log Message: Directory /cvsroot/phpvortex/phpvortex/doc/html added to the repository |
From: Thiago R. <nop...@us...> - 2004-09-30 13:34:08
|
Update of /cvsroot/phpvortex/phpvortex/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30143/doc Log Message: Directory /cvsroot/phpvortex/phpvortex/doc added to the repository |
From: Thiago R. <nop...@us...> - 2004-09-29 21:01:48
|
Update of /cvsroot/phpvortex/phpvortex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30117 Modified Files: TB_Base.class.php Log Message: Started working on TB_Base, but the day came to an end... Index: TB_Base.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/TB_Base.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TB_Base.class.php 28 Sep 2004 18:43:24 -0000 1.2 --- TB_Base.class.php 29 Sep 2004 21:01:39 -0000 1.3 *************** *** 25,34 **** /** * Constructor: Init the object, and define the table's fields and relationships. * * @param DB_Base $db Database where the table is. */ ! function TB_Base($db) { } } --- 25,47 ---- /** + * Array containing all the fields of the table (FT_* classes). + * @var array + */ + var $fields = array(); + + /** + * Array the current row of the table, for output, edit or search. + * @var array + */ + var $data = array(); + + /** * Constructor: Init the object, and define the table's fields and relationships. * * @param DB_Base $db Database where the table is. */ ! function TB_Base(&$db) { + $this->db =& $db; } } |
From: Thiago R. <nop...@us...> - 2004-09-29 20:05:08
|
Update of /cvsroot/phpvortex/phpvortex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18305 Modified Files: DB_Base.class.php Log Message: Added the member functions Insert(), Update() and Delete() to DB_Base Index: DB_Base.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/DB_Base.class.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DB_Base.class.php 29 Sep 2004 15:50:49 -0000 1.4 --- DB_Base.class.php 29 Sep 2004 20:04:59 -0000 1.5 *************** *** 86,89 **** --- 86,139 ---- /** + * Execute a INSERT INTO query at the database. + * + * @param string $table Table to insert into. + * @param array $values Fields and values to insert, as 'field' => 'value'. + * @return RS_Base Returns a RecordSet object if there is a result to the query or FALSE if a error occurred. + */ + function &Insert($table, $values) + { + $fl = ''; + $vl = ''; + foreach($values as $f => $v) { + $fl = (strlen($fl)?', ':'') . $f; + $vl = (strlen($vl)?', ':'') . $v; + } + $sql = "INSERT INTO $table ($fl) VALUES ($vl)"; + return $this->Query($sql); + } + + /** + * Execute a UPDATE query at the database. + * + * @param string $table Table to update. + * @param array $values Fields and values to update, as 'field' => 'value'. + * @param string $where Where clause to the query. + * @return RS_Base Returns a RecordSet object if there is a result to the query or FALSE if a error occurred. + */ + function &Update($table, $values, $where) + { + $sl = ''; + foreach($values as $f => $v) { + $sl = (strlen($sl)?', ':'') . "$f = $v"; + } + $sql = "UPDATE $table SET $sl WHERE $where"; + return $this->Query($sql); + } + + /** + * Execute a DELETE query at the database. + * + * @param string $table Table to update. + * @param string $where Where clause to the query. + * @return RS_Base Returns a RecordSet object if there is a result to the query or FALSE if a error occurred. + */ + function &Delete($table, $where) + { + $sql = "DELETE FROM $table WHERE $where"; + return $this->Query($sql); + } + + /** * Close the connection to the database if still connected. * |
From: Thiago R. <nop...@us...> - 2004-09-29 19:37:28
|
Update of /cvsroot/phpvortex/phpvortex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10063 Added Files: FT_Text.class.php Log Message: Added the class FT_Text --- NEW FILE: FT_Text.class.php --- <?php /** * File for class FT_Text. * * @package Vortex * @subpackage DB * @author Thiago Ramon Gonçalves Montoya * @copyright Copyright 2004, Thiago Ramon Gonçalves Montoya * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ /** Require the base class */ require_once('FT_Base.class.php'); /** * Database field, Text type. * * @package Vortex * @subpackage DB */ class FT_Text extends FT_Base { /** * Maximum size of the field. Use -1 for unlimited. * * @var int */ var $size = -1; /** * Number of rows in the text field. * * @var int */ var $rows = 1; /** * Number of columns in the field. Use -1 to ignore. * * @var int */ var $cols = -1; /** * Output the field as a HTML Form. * * @param string $value Value to load the control with. */ function ShowForm($value) { if ($this->rows > 1) { echo "<textarea name='{$this->name_form}' rows='{$this->rows}'".(($this->cols > 0)?" cols='{$this->cols}'":'').">$value</textarea>"; } else { echo "<input type='text' name='{$this->name_form}' value='$value'".(($this->size > 0)?" maxlength='{$this->size}'":'').'>'; } } /** * Output the field as plain text. * * @param string $value Value to load the control with. */ function ShowPlain($value) { echo nl2br($value); } /** * Output the field consistency testing in JavaScript. */ function JSConsist() { if ($this->required) { echo <<<END if (frm.{$this->name_form}.value == "") errors += " * {$this->label}"; END; } } /** * Test the field consistency. * * @param string $field The data from the field to be tested. * @return bool Returns TRUE if the field is consistent, FALSE otherwise. */ function ConsistTest(&$field) { if ($this->required && empty($field)) return FALSE; return TRUE; } } ?> |
From: Thiago R. <nop...@us...> - 2004-09-29 19:11:43
|
Update of /cvsroot/phpvortex/phpvortex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4989 Modified Files: FT_Base.class.php Log Message: Added the member variable $label and some functionality to Show() in FT_Base Index: FT_Base.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/FT_Base.class.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FT_Base.class.php 29 Sep 2004 15:52:14 -0000 1.3 --- FT_Base.class.php 29 Sep 2004 19:11:33 -0000 1.4 *************** *** 49,52 **** --- 49,60 ---- /** + * Label to the field. + * Default = {@link $name} + * + * @var string + */ + var $label; + + /** * Is the field a Primary Key? * *************** *** 67,71 **** * @var string */ ! var $default = "''"; /** --- 75,79 ---- * @var string */ ! var $default = ''; /** *************** *** 83,86 **** --- 91,95 ---- is_null($name_db) and $name_db = $name; is_null($name_form) and $name_form = $name; + is_null($label) and $label = $name; } *************** *** 92,99 **** --- 101,143 ---- function Show($form = TRUE) { + if (empty($this->table->data) || !isset($this->table->data[$this->name_form])) { + $value = $this->default; + } else { + $value = $this->table->data[$this->name_form]; + } + if ($form) { + echo '<tr><td>'.$this->label.'</td><td>'; + $this->ShowForm($value); + echo '</td></tr>'; + } else { + echo $this->label.': '; + $this->ShowPlain($value); + } + } + + /** + * Output the field as a HTML Form. + * + * @abstract + * @param string $value Value to load the control with. + */ + function ShowForm($value) + { + } + + /** + * Output the field as plain text. + * + * @param string $value Value to load the control with. + */ + function ShowPlain($value) + { + echo $value; } /** * Output the field consistency testing in JavaScript. + * + * @abstract */ function JSConsist() *************** *** 113,117 **** return FALSE; } else { ! return $this->default; } } --- 157,161 ---- return FALSE; } else { ! return "'".$this->default."'"; } } *************** *** 124,128 **** * Test the field consistency. * - * @internal * @param string $field The data from the field to be tested. * @return bool Returns TRUE if the field is consistent, FALSE otherwise. --- 168,171 ---- *************** *** 136,140 **** * Format the field for database insertion. * - * @internal * @param string $field The data from the field to be formated. * @return string Returns the formated field. --- 179,182 ---- |