${CLASSVAR}->get{FUNC_NAME}(); ${CLASSVAR}->set{FUNC_NAME}(); ${CLASSVAR}->save(); */ /** * * @author - {AUTHOR} * @desc - * @vers - 1.0 */ class {NAME} { {TYPE} ${VARIABLES}; /** * * @author - {AUTHOR} * @type - public * @desc - Constructor * @param $ - string ${IDCLASS} - the ID * @return - mixed rewrite array * @vers - 1.0 * @Mod - */ function {NAME}(${IDCLASS}) { if(${IDCLASS}<>0) { $this->{IDCLASS} = ${IDCLASS}; $SQL = " SELECT {LIST} FROM {DBNAME} WHERE `{IDCLASS}`='".$this->{IDCLASS}."'"; $retid = mysql_query($SQL) or die($MYSQL); if ($row = mysql_fetch_array($retid)) { $this->{FIELD_NAME} = $row["{FIELD_NAME}"]; } else { $this->{FIELD_NAME} = ""; } } }//end constructor {NAME} /** * * @author - {AUTHOR} * @type - {GETFUNCTIONTYPE} * @desc - get $this->{VAR_NAME} * @return - string * @vers - 1.0 * @Mod - */ {GETFUNCTIONTYPE} function get{FUNC_NAME}() { return $this->{VAR_NAME}; } // end get{FUNC_NAME}() /** * * @author - {AUTHOR} * @type - {SETFUNCTIONTYPE} * @desc - set $this->{VAR_NAME} to ${VAR_NAME} * @param $ - string ${VAR_NAME} * @return - void * @vers - 1.0 * @Mod - */ {SETFUNCTIONTYPE}function set{FUNC_NAME}(${VAR_NAME}) { $this->{VAR_NAME}=${VAR_NAME}; } // end set{FUNC_NAME}() /** * * @author - {AUTHOR} * @type - {SAVEFUNCTIONTYPE} * @desc - saves data into database * @return - void * @vers - 1.0 * @Mod - */ {SAVEFUNCTIONTYPE}function save() { if (($this->{IDCLASS})==0) { $SQL = "INSERT INTO {DBNAME} ({LIST})"; $SQL .= " VALUES({LIST_INSERT})"; $retid = mysql_query($SQL); if (!$retid) { echo( mysql_error()); } $this->{IDCLASS} = mysql_insert_id(); } else { $SQL = "UPDATE {DBNAME} SET {LIST_UPDATE}"; $SQL .= " WHERE `{IDCLASS}`='".$this->{IDCLASS}."'"; $retid = mysql_query($SQL); if (!$retid) { echo( mysql_error()); } } }//end save() /** * * @author - {AUTHOR} * @type - {FDTYPE} * @desc - delete ${IDCLASS} from database * @return - void * @vers - 1.0 * @Mod - */ {FDTYPE} function delete(${IDCLASS}) { $SQL = "DELETE FROM {DBNAME} WHERE `{IDCLASS}`='".${IDCLASS}."'"; $retid = mysql_query($SQL); if (!$retid) { echo( mysql_error()); } } // end delete() } // end class {NAME} ?>