function pick_id($seq) { // FIXME: check $seq $result = sql_do('SELECT nextval(\'' . $seq . '\')'); if ($result->numRows() != 1) { append_error('Unable to fetch a fresh ID.'); return 0; } return $result->fetchOne(); }
function write() { sql_do('UPDATE users SET name_user=\'' . str($this->get_name_user()) . '\',mail=\'' . str($this->get_mail()) . '\',url_user=\'' . str($this->get_url_user()) . '\',passwd=\'' . str($this->get_passwd()) . '\',desc_user=\'' . str($this->get_desc_user()) . '\' WHERE id_user=\'' . int($this->get_id_user()) . '\''); $this->validate(); }
function add_author($id_user) { sql_do('INSERT INTO ' . DB_PREF . '_authors (id_user,id_rel) VALUES (\'' . int($id_user) . '\',\'' . int($this->get_id_rel()) . '\')'); }
function get_last_release() { $result = sql_do('select id_rel from releases join branches using (id_branch) join projects using (id_prj) where id_branch=default_branch and id_prj=\'' . int($this->get_id_prj()) . '\' order by date_rel desc limit 1'); if ($result->numRows() == 0) { return 0; } else { $row = $result->fetchRow(); return $row[0]; } }
function delete() { sql_do('DELETE FROM platforms WHERE id_pf=\'' . int($this->get_id_pf()) . '\''); }
$id_branch = branch_new('main', $prj->get_id_prj()); if (!$id_branch) { sql_do('ROLLBACK'); append_error('Unable to create the default branch, please contact the administrator.'); } } // ... par défaut if (!errors()) { $prj->set_default_branch($id_branch); $prj->write(); } if (!errors()) { sql_do('COMMIT'); http_redir('/project/view.php?id_prj=' . $id_prj); } else { sql_do('ROLLBACK'); } } header_box("Igoan :: Adding a new project"); flush_errors(); ?> <div id="main"> <form class="admin" action="new_project.php"> <h2>Adding a project</h2> <div class="abstract"> <p> Adding a project to our database is as easy as 1, 2, 3: </p> <ol>
function delete() { sql_do('DELETE FROM licenses WHERE id_lic=\'' . int($this->get_id_lic()) . '\''); }
function get_last_release() { $result = sql_do('SELECT id_rel FROM ' . DB_PREF . '_releases JOIN ' . DB_PREF . '_branches USING (id_branch) JOIN ' . DB_PREF . '_projects USING (id_prj) WHERE ' . DB_PREF . '_branches.id_branch=' . DB_PREF . '_projects.default_branch AND ' . DB_PREF . '_projects.id_prj=\'' . int($this->get_id_prj()) . '\' ORDER BY date_rel DESC LIMIT 1'); if ($result->numRows() == 0) { return 0; } else { $row = $result->fetchRow(); return $row[0]; } }
function get_last_release() { $result = sql_do('SELECT id_rel FROM releases WHERE date_rel like (SELECT max(date_rel) FROM releases) AND id_branch=\'' . int($this->get_id_branch()) . '\''); if ($result->numRows() == 0) { return 0; } else { $row = $result->fetchRow(); return $row[0]; } }
function delete() { sql_do('DELETE FROM ' . DB_PREF . '_languages WHERE id_lang=\'' . int($this->get_id_lang()) . '\''); }
# it under the terms of the GNU General Public License as published by # the Free Software Foundation in the version 2 of the License. # # Igoan is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Igoan; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # require_once 'igoan/Project.class.php'; require_once 'igoan/User.class.php'; $me = user_get_by_id($_SESSION['id']); $result = sql_do('SELECT id_prj FROM projects ORDER BY id_prj DESC'); // show the data (NO PROCESSING HERE PLEASE, ONLY ECHOs) header_box('Igoan :: The Free Directory Project'); flush_errors(); ?> <div id="main"><?php // these are the "stuff" section login_box($me); //categories_box(); ?> </div> <div class="item soft"> <h2>Last project:</h2>
function delete() { sql_do('DELETE FROM categories WHERE id_cat=\'' . int($this->get_id_cat()) . '\''); }
# it under the terms of the GNU General Public License as published by # the Free Software Foundation in the version 2 of the License. # # Igoan is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Igoan; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # require_once 'igoan/Project.class.php'; require_once 'igoan/User.class.php'; $me = user_get_by_id($_SESSION['id']); $result = sql_do('SELECT id_prj FROM projects'); // show the data (NO PROCESSING HERE PLEASE, ONLY ECHOs) header_box('Igoan :: The Free Directory Project'); flush_errors(); ?> <div id="main"><?php // these are the "stuff" section login_box($me); //categories_box(); ?> </div> <div class="item soft"> <h2>Projects of the month:</h2>
function get_last_release() { $result = sql_do('SELECT id_rel FROM ' . DB_PREF . '_releases WHERE id_branch=\'' . int($this->get_id_branch()) . '\' ORDER BY date_rel DESC LIMIT 1'); if ($result->numRows() == 0) { return 0; } else { $row = $result->fetchRow(); return $row[0]; } }
# it under the terms of the GNU General Public License as published by # the Free Software Foundation in the version 2 of the License. # # Igoan is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Igoan; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # require_once 'igoan/Project.class.php'; require_once 'igoan/User.class.php'; $me = user_get_by_id($_SESSION['id']); $result = sql_do('SELECT id_prj FROM ' . DB_PREF . '_projects ORDER BY id_prj DESC'); // show the data (NO PROCESSING HERE PLEASE, ONLY ECHOs) header_box('Igoan :: The Free Directory Project'); flush_errors(); ?> <div id="main"><?php // these are the "stuff" section login_box($me); //categories_box(); ?> </div> <div class="item soft"> <h2>Last project:</h2>