/**********************************************
The MyReview system for web-based conference management
Copyright (C) 2003-2004 Philippe Rigaux
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation;
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
************************************************/
//Management of codes
require_once ("Util.php");
require_once ("Formulaire.class.php");
function MngtCodes ($_POST, $codeName, $context, $db, &$tpl)
{
if (isSet($_POST['label']))
{
$message = InsertCode ($codeName, $_POST, $_POST['mode'], $db);
if (!is_numeric($message))
{
// Error reporting
$tpl->set_var("TITLE", "Error: $message");
$codif = CleanArray ($_POST);
$mode = INSERTION;
}
else
{
$tpl->set_var("TITLE", "Transaction OK");
$mode = INSERTION;
}
// Display the form
$tpl->set_var("FORM_CODIF",
FormCodif ($codeName, array(), $mode, $context));
}
else if (isSet($_GET['id']))
{
if (!isSet ($_GET['do']) or $_GET['do']=="modify")
{
// Ask for code modification
$tpl->set_var("TITLE", "Modify");
$codif = ChercheCodif ($codeName, $_GET['id'], $db);
$tpl->set_var ("FORM_CODIF",
FormCodif($codeName, $codif, MAJ, $context));
}
else
{
// Delete the code
$query = "DELETE FROM $codeName WHERE id=" . $_GET['id'];
$db->execRequete ($query);
$tpl->set_var ("FORM_CODIF",
FormCodif($codeName, array(), INSERTION, $context));
}
}
else
{
// Insert
$tpl->set_var("TITLE", "Add a code in table $codeName");
$tpl->set_var ("FORM_CODIF",
FormCodif($codeName, $_POST, INSERTION, $context));
}
// Always print the list of existing codes
$tpl->set_block("TxtCodes", "DETAIL_CODIF", "CODIFS");
$tpl->set_var ("CODIFS", "");
$query = "SELECT * FROM $codeName";
$result = $db->execRequete ($query);
while ($code = $db->objetSuivant($result))
{
$modLink = Ancre ($context . "&id=$code->id&do=modify", "Modify");
$delLink = Ancre ($context . "&id=$code->id&do=delete", "Delete");
$tpl->set_var("CODIF_LABEL", $code->label);
$tpl->set_var("MODIFY", $modLink);
$tpl->set_var("DELETE", $delLink);
$tpl->parse("CODIFS", "DETAIL_CODIF", true);
}
$tpl->set_var("ADD_CODE", Ancre($context, "Add a new code"));
/* Instanciate CODIFS in BODY */
$tpl->parse("BODY", "TxtCodes");
}
function InsertCode ($nomCodif, $codif, $mode, $db)
{
// Controle
$message = ControleCodif ($codif);
if (!empty($message)) return $message;
// Insertion ou mise à jour
$code = SQLCodif ($nomCodif, $codif, $mode, $db);
return $code;
}
function FormCodif ($nomCodif, $codif, $mode, $target)
{
// Create the form
$form = new Formulaire ("POST", $target, false);
$form->champCache ("mode", $mode);
if ($mode != INSERTION)
{
$form->champCache ("id", $codif['id']);
}
else
$codif['label'] = "";
$form->champTexte ("Label",
"label", $codif['label'], 30, 30);
if ($mode == MAJ)
$form->champValider ("Modify", "submit");
else
$form->champValider ("Insert", "submit");
return $form->fin(false);
}
// Insérer une codification
function SQLCodif ($nomCodif, $codif, $mode, $db)
{
// Get the variables (easier)
$lib = $codif['label'];
if ($mode == INSERTION)
{
// Insert
$query = "INSERT INTO $nomCodif (label) "
. "VALUES ('$lib') ";
$db->execRequete ($query);
$code = $db->idDerniereLigne();
}
else
{
// Update
$code = $codif['id'];
$query = "UPDATE $nomCodif SET label='$lib' "
. " WHERE id='$code'";
$db->execRequete ($query);
}
return $code;
}
function ControleCodif($codif)
{
$message = "";
// Quelques tests...
if (empty ($codif['label'])) $message = "Please provide a label ";
return $message;
}
// Recherche d'une codif
function ChercheCodif ($nomCodif, $code, $db)
{
$query = "SELECT * FROM $nomCodif WHERE id = '$code'" ;
$result = $db->execRequete ($query);
return $db->ligneSuivante ($result);
}
// Recherche de l'intitulé d'une codif
function LibelleCodif ($nomCodif, $code, $db)
{
$query = "SELECT * FROM $nomCodif WHERE id = '$code'" ;
$result = $db->execRequete ($query);
$codif = $db->ligneSuivante ($result);
return $codif['label'];
}
?>
Interaction: Systems, Practice and Theory 2004
INTERACTION: Systems, Practice and Theory
A Creativity & Cognition Symposium hosted by The Dynamic Design Research Group.
Sydney, 16-19 November 2004
Interaction: Systems, Practice and Theory
A Creativity and Cognition Symposium
Hosted by: The Dynamic Design Research Group, UTS.
To be held at: University of Technology, Sydney, and;
Powerhouse Museum, Sydney
16 November - 19 November 2004
The symposium will focus on the emergence of art, communication, information and entertainment systems using interactive environments and media in museum, gallery and other public spaces. It will address recent research and future directions in art and design, spanning the areas of
Innovative interactive devices and systems
Creative practice employing interactive environments
Social and cultural theory about interaction
The discussions will draw on digital art practice, computer game developments, human-computer interaction as well as social and cultural theory. Attendance will primarily depend on the acceptance of refereed contributions, which will be published in a Workshop Proceedings. An exhibition will form an integral part of the meeting. This will show artworks, games and other systems germane to the meeting. It is planned to make the exhibition open to the public. Three Keynote speakers will make public presentations to set the tone and direction of the meeting. The symposium will be organised so that the contributions and discussions lead to a significant book on the subject that will both summarize the state of the art and point forward to future research and practice.
Keynote speakers
Sidney Fels, Associate Professor, Dept. of Electrical and Computer Engineering, The University of British Columbia, Canada