<?
// ---------------------------------------------
// | Comic COMPONENT |
// | |
// | Copyright (C) 2005 Rdemont |
// | |
// | All rights reserved |
// ---------------------------------------------
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// Please note that the GPL states that any headers in files and
// Copyright notices as well as credits in headers, source files
// and output (screens, prints, etc.) can not be removed.
// You can extend them with your own credits, though...
//
// 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.
//
// The "GNU General Public License" (GPL) is available at
// http://www.gnu.org/copyleft/gpl.html.
//-----------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// Autorisation d'accès
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
//--------------------------------------------------------------------------------------------------
global $mosConfig_live_site;
?>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $mosConfig_live_site;?>/components/com_comic/templates/<?php echo $templateName;?>/calendar.css" title="calendar" />
<script language="javascript">
function submitbutton(pressbutton)
{
var form = document.adminForm;
if (pressbutton == 'cancel')
{
form.task.value = "comic_list";
form.submit();
return;
}
// do field validation
if (form.name.value == "")
{
alert( "<?php echo _WARN_SERIE_NAME; ?>" );
} else {
form.task.value = "save_comic";
form.submit();
}
}
</script>
<form method="POST" name="adminForm" action="index.php">
<!-- BOUTONS-->
<table width="100%">
<tr>
<td width="90%" align="right"></td>
<td width="10%">
<?php
mosToolBar::startTable();
mosToolBar::save();
mosToolBar::spacer(25);
mosToolBar::cancel();
mosToolBar::endtable();
?>
</td>
</tr>
</table>
<!--FORMULAIRE-->
<table width="100%">
<tr>
<td width="30%" align="right"><?php echo _COMIC_TITRE ;?></td>
<td width="70%" align="left"><input type="text" name="title" size="40" maxlength="100" value="<?php echo $title ;?>" class="inputbox"/></td>
</tr>
<?php
if ((!isset($serieid)) || ($serieid=="") || ($serieid==0))
{
?>
<tr>
<td width="30%" align="right"><?php echo _COMIC_SERIE ;?></td>
<td width="70%" align="left">
<select name="serie_FK" class="inputbox">
<?php
for ($i=0;$i<count($serieRows);$i++)
{
$selected = "";
echo "<option value=\"".$serieRows[$i]->id."\" ".$selected." >".$serieRows[$i]->Name."</option>";
}
?>
</select>
</td>
</tr>
<?php
} else {
?>
<input type="hidden" name="serie_FK" value="<?php echo $serie_FK ;?>" />
<?php
}
?>
<tr>
<td width="30%" align="right"><?php echo _COMIC_PUBLISHER ;?></td>
<td width="70%" align="left">
<select name="publisher_PK" class="inputbox">
<?php
for ($i=0;$i<count($publisherRows);$i++)
{
$selected = "";
if ($publisherRows[$i]->id == $publisher_FK)
$selected = "SELECTED";
echo "<option value=\"".$publisherRows[$i]->id."\" ".$selected." >".$publisherRows[$i]->Name."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td width="30%" align="right"><?php echo _COMIC_VOLUMENUMBER ;?></td>
<td width="70%" align="left"><input type="text" name="volumeNumber" size="10" maxlength="10" value="<?php echo $volumeNumber ;?>" class="inputbox"/></td>
</tr>
<tr>
<td width="30%" align="right"><?php echo _COMIC_PRICE ;?></td>
<td width="70%" align="left"><input type="text" name="price" size="10" maxlength="10" value="<?php echo $price ;?>" class="inputbox"/></td>
</tr>
<tr>
<td width="30%" align="right"><?php echo _COMIC_DESCRIPTION ;?></td>
<td width="70%" align="left"><textarea name="description" rows="5" cols="40" class="inputbox" ><?php echo $description;?></textarea></td>
</tr>
<tr>
<td width="30%" align="right"><?php echo _COMIC_PARUTIONDATE ;?></td>
<td width="70%" align="left">
<input type="hidden" id="parutionDate" name="parutionDate" size="40" maxlength="255" value="<?php echo $parutionDate;?>" class="inputbox"/>
<span
style="background-color: #ff8; cursor: default;"
onmouseover="this.style.backgroundColor='#ff0';"
onmouseout="this.style.backgroundColor='#ff8';"
id="spanParutionDate">press</span>
<script>
Calendar.setup({
inputField : "parutionDate", // id of the input field
ifFormat : "%Y-%m-%d 00:00:00", // format of the input field (even if hidden, this format will be honored)
displayArea : "spanParutionDate", // ID of the span where the date is to be shown
daFormat : "%A, %d %B %Y",// format of the displayed date
align : "Tl", // alignment (defaults to "Bl")
singleClick : true,
firstDay : 1
});
<?php
if (($parutionDate == "")|| ($parutionDate == "0000-00-00 00:00:00"))
{
?>
document.getElementById("spanParutionDate").innerHTML = "<?php echo _CLICK_TO_OPEN_DATE_SELECTOR;?>";
<?php
} else {
?>
var date = new Date(<?php echo str_replace(" ",",",str_replace(":",",",str_replace("-",",",$parutionDate)));?>);
document.getElementById("spanParutionDate").innerHTML = date.print("%A, %d %B %Y");
<?php
}
?>
</script>
</td>
</tr>
</table>
<!--PARAM-->
<input type="hidden" name="task" value="save_serie" />
<input type="hidden" name="option" value="<?php echo $option ;?>" />
<input type="hidden" name="id" value="<?php echo $id ;?>" />
<input type="hidden" name="owner_FK" value="<?php echo $owner_FK ;?>" />
</form>