Current File : /home/karenpetzb/application/modules/backoffice/views/scripts/faq/list.phtml |
<script type="text/javascript">
$(function(){
initRichTextBox('#faq_question', 2, 500, 150);
initRichTextBox('#faq_reponse', 2, 500, 150);
generateTabs($("#tabs"), 1);
});
</script>
<div id="tabs">
<ul>
<li><a href="#tabs-category">Cat�gorie</a></li>
<li><a href="#tabs-qr">Questions/Reponses</a></li>
</ul>
<div id="tabs-category">
<form action="<?php echo $this->baseUrl; ?>/backoffice/faq/addfaqtype#tabs-category" method="post">
<table cellpadding="0" cellspacing="10" border="0" width="800px">
<tr>
<td >
<span class="errorText"><?php echo $this -> messageError; ?></span>
<span class="successText"><?php echo $this -> messageSuccess; ?></span>
</td>
</tr>
<tr > <td colspan="3" style="background:#666666; height: 1px"></td></tr>
<tr>
<td colspan="3">
<div class="text2">CATEGORIE</div>
</td>
</tr>
<tr > <td colspan="3" style="background:#666666; height: 1px"></td></tr>
<tr>
<td>
Nom : <br/>
<input type="text" size="40" name="faq_nom" >
</td>
<td>
<input type="submit" value="Ajouter" >
</td>
</tr>
</table>
</form>
<?php foreach($this->faqtypes as $row) { ?>
<form action="<?php echo $this->baseUrl; ?>/backoffice/faq/editfaqtype" method="post">
<table cellpadding="0" cellspacing="6" border="0" >
<tr>
<td>
<input type="text" size="40" name="faq_nom" value="<?php echo $row['NOM'];?>">
</td>
<td >
<input type="hidden" value="<?php echo $row['ID']; ?>" name="faq_id">
<input type="submit" value="Modifier">
<?php if ($row['isACTIVE'] == 0) { ?>
<a class="button" href="<?php echo $this->baseUrl; ?>/backoffice/faq/activefaqtype/id/<?php echo $row['ID']; ?>#tabs-category" onClick="return msgOkCancelDelete();">Activer</a>
<?php } else { ?>
<a class="button" href="<?php echo $this->baseUrl; ?>/backoffice/faq/unactivefaqtype/id/<?php echo $row['ID']; ?>#tabs-category" onClick="return msgOkCancelDelete();">D�sactiver</a>
<?php } ?>
<a class="button" href="<?php echo $this->baseUrl; ?>/backoffice/faq/delfaqtype/id/<?php echo $row['ID']; ?>#tabs-category" onClick="return msgOkCancelDelete();">Supprimer</a>
</td>
</tr>
</table>
</form>
<?php } ?>
</div>
<div id="tabs-qr">
<form action="<?php echo $this->baseUrl; ?>/backoffice/faq/addfaq#tabs-qr" method="post">
<table cellpadding="0" cellspacing="10" border="0" >
<tr>
<td colspan="5">
<span class="errorText"><?php echo $this -> messageError; ?></span>
<span class="successText"><?php echo $this -> messageSuccess; ?></span>
</td>
</tr>
<tr > <td colspan="5" style="background:#666666; height: 1px"></td></tr>
<tr>
<td colspan="5">
<div class="text2">AJOUTER</div>
</td>
</tr>
<tr > <td colspan="5" style="background:#666666; height: 1px"></td></tr>
<tr>
<td>QUESTION </td>
<td>REPONSE </td>
<td>POSITION </td>
<td>CATEGORIE </td>
<td> </td>
</tr>
<tr>
<td><textarea rows="5" cols="30" name="faq_question" id="faq_question" class="faq_question"></textarea></td>
<td><textarea rows="5" cols="30" name="faq_reponse" id="faq_reponse" class="faq_reponse"></textarea></td>
<td><input type="text" size="5" name="faq_position" ></td>
<td>
<select name="faq_type">
<?php foreach($this->faqtypes as $row) { ?>
<option value="<?php echo $row['ID']; ?>"><?php echo $row['NOM']; ?></option>
<?php }?>
</select>
</td>
<td>
<input type="submit" value="Ajouter" >
</td>
</tr>
</table>
</form>
<table cellpadding="0" cellspacing="10" border="0" width="1200px">
<?php $lastType = "";
foreach($this->faq as $row) {
if ($lastType != $row['IDTYPE']) {
$lastType = $row['IDTYPE']; ?>
<tr > <td colspan="5" style="background:#666666; height: 1px"></td></tr>
<tr>
<td colspan="5">
<div class="text2"><?php echo $row['NOMTYPE']; ?></div>
</td>
</tr>
<tr > <td colspan="5" style="background:#666666; height: 1px"></td></tr>
<?php } ?>
<tr >
<td colspan="5" >
<form action="<?php echo $this->baseUrl; ?>/backoffice/faq/editfaq#tabs-qr" method="post">
<table cellpadding="0" cellspacing="10" border="0" >
<tr>
<td><textarea rows="5" cols="30" name="faq_question" class="faq_question"><?php echo $row['QUESTION'];?></textarea></td>
<td><textarea rows="5" cols="30" name="faq_reponse" class="faq_reponse"><?php echo $row['REPONSE'];?></textarea></td>
<td colspan="3">
<table cellpadding="0" cellspacing="10" border="0" >
<tr>
<td><input type="text" size="5" name="faq_position" value="<?php echo $this->escape($row['POSITION']);?>"></td>
<td>
<select name="faq_type">
<?php foreach($this->faqtypes as $rowType) { ?>
<option value="<?php echo $rowType['ID']; ?>" <?php if ($rowType['ID'] == $row['IDTYPE']) { echo "selected"; } ?>><?php echo $rowType['NOM']; ?></option>
<?php }?>
</select>
</td>
</tr>
<tr>
<td colspan="2" width="300px">
<input type="hidden" value="<?php echo $row['ID']; ?>" name="faq_id">
<span><input type="submit" value="Modifier"></span>
<span>
<?php if ($row['isACTIVEFAQ'] == 0) { ?>
<a class="button" href="<?php echo $this->baseUrl; ?>/backoffice/faq/activefaq/id/<?php echo $row['ID']; ?>#tabs-qr" onClick="return msgOkCancelDelete();">Activer</a>
<?php } else { ?>
<a class="button" href="<?php echo $this->baseUrl; ?>/backoffice/faq/unactivefaq/id/<?php echo $row['ID']; ?>#tabs-qr" onClick="return msgOkCancelDelete();">D�sactiver</a>
<?php } ?>
</span>
<span> <a class="button" href="<?php echo $this->baseUrl; ?>/backoffice/faq/delfaq/id/<?php echo $row['ID']; ?>#tabs-qr" onClick="return msgOkCancelDelete();">Supprimer</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>