Files
CRM/QCMExamenEdit.php
BACHIR SOULDI 2794e62571 first commit
2025-09-28 08:49:37 +01:00

581 lines
34 KiB
PHP

<?php
require_once 'include/utils/utils.php';
require_once 'includes/Loader.php';
vimport ('includes.runtime.EntryPoint');
require_once 'SUtiles.php';
@session_start();
global $adb;
$current_user = Users_Record_Model::getCurrentUserModel();
$roleid = $current_user->get('roleid');
$viewer = new Vtiger_Viewer();
$viewer->assign('MODULE', 'Home');
$viewer->assign('SELECTED_MENU_CATEGORY', 'MARKETING');
$viewer->assign('COMPANY_LOGO', Vtiger_CompanyDetails_Model::getInstanceById()->getLogo());
$viewer->assign('COMPANY_DETAILS_SETTINGS',new Settings_Vtiger_CompanyDetails_Model());
$viewer->assign('USER_MODEL', $current_user);
$viewer->assign('CURRENT_USER_MODEL', $current_user);
$viewer->assign('PAGETITLE','Creation');
$viewer->view('CustomDashboard.tpl');
if(isset($_POST['update'])) {
$reseau = implode("::", $_POST['reseau'] );
$adb->pquery("UPDATE ent_qcm SET libelle_qcm = '".htmlentities($_POST['libelle'], ENT_QUOTES, "UTF-8")."' , date_debut = '". $_POST['dateD'] ."', date_fin = '". $_POST['dateF'] ."', heure_debut = '". $_POST['heureD'] ."', heure_fin = '". $_POST['heureF'] ."' ,type = '".htmlentities($_POST['type'], ENT_QUOTES, "UTF-8")."' , duree ='". $_POST['duree'] ."' ,reseau='".$reseau."' ,forme='".addslashes($_POST['forme'])."' ,memo='".addslashes($_POST['memo'])."' WHERE code_qcm='".$_SESSION['idExamen']."'");
$a=1;
for ($x = 0; $x < sizeof($_POST['question']); $x++) {
if($_POST['ids'][$x] <> 0){
$tableau="checkboxcChoix".$_POST['ids'][$x];
$comma_separated = implode("::", $_POST[$tableau]);
$checkboxcChoix=$comma_separated;
$adb->pquery("UPDATE lignes_qcm SET ordre ='".$_POST['ordre'][$x]."', question ='".htmlentities($_POST['question'][$x], ENT_QUOTES, "UTF-8")."', choix1 ='".htmlentities($_POST['choix1'][$x], ENT_QUOTES, "UTF-8")."' , choix2 ='".htmlentities($_POST['choix2'][$x], ENT_QUOTES, "UTF-8")."' , choix3 ='".htmlentities($_POST['choix3'][$x], ENT_QUOTES, "UTF-8")."', choix4 ='".htmlentities($_POST['choix4'][$x], ENT_QUOTES, "UTF-8")."', choix5 ='".htmlentities($_POST['choix5'][$x], ENT_QUOTES, "UTF-8")."', correction ='".$checkboxcChoix."', note ='".$_POST['note'][$x]."' where code_ligne='".$_POST['ids'][$x]."' and code_ent_qcm='".$_SESSION['idExamen']."'");
}else{
$tableau="checkboxcChoix".$a;
$comma_separated = implode("::", $_POST[$tableau]);
$checkboxcChoix=$comma_separated;
$query2 = "INSERT INTO `lignes_qcm` (`ordre` , `code_ent_qcm`, `question`, `choix1`, `choix2`,`choix3`, `choix4`, `choix5`,`correction`,`note`)
VALUES ('".$_POST['ordre'][$x]."','".$_SESSION['idExamen']."','".htmlentities($_POST['question'][$x], ENT_QUOTES, "UTF-8")."','".htmlentities($_POST['choix1'][$x], ENT_QUOTES, "UTF-8")."','".htmlentities($_POST['choix2'][$x], ENT_QUOTES, "UTF-8")."' ,'".htmlentities($_POST['choix3'][$x], ENT_QUOTES, "UTF-8")."','".htmlentities($_POST['choix4'][$x], ENT_QUOTES, "UTF-8")."' ,'".htmlentities($_POST['choix5'][$x],ENT_QUOTES, "UTF-8")."','".$checkboxcChoix."','".$_POST['note'][$x]."');";
$adb->query($query2);
$a=$a+1;
}
}
header("Location: index.php?module=QCMExamen&view=QCMExamen");
}
if(isset($_POST['submit'])) {
$_SESSION["idExamen"]=$_POST['idExamen'];
$idExamen=$_SESSION["idExamen"];
$query3= "SELECT * FROM `ent_qcm` where code_qcm='".$idExamen."'";
$sql_get_result3 = $adb->query($query3);
$recordinfo = $adb->fetch_array($sql_get_result3);
$Examen[] = $recordinfo;
$query4= "SELECT * FROM `lignes_qcm` where code_ent_qcm='".$idExamen."'";
$sql_get_result4 = $adb->query($query4);
$lignesQuestion = array();
while ($recordinfo = $adb->fetch_array($sql_get_result4)) {
$lignesQuestion[] = $recordinfo;
}
}
function result($lignesQuestion){
echo '<tr style="height:100px;"><td></td>
<td><input type="number" class="qty smallInputBox inputElement" name="ordre[]" value='.$lignesQuestion['ordre'].'></td>
<td><textarea style="height:100px;" name="question[]" class="qty smallInputBox inputElement">'.html_entity_decode($lignesQuestion['question']).'</textarea></td>
<td><textarea style="height:100px;" name="choix1[]" class="qty smallInputBox inputElement">'.html_entity_decode($lignesQuestion['choix1']).'</textarea></td>
<td><textarea style="height:100px;" name="choix2[]" class="qty smallInputBox inputElement">'.html_entity_decode($lignesQuestion['choix2']).'</textarea></td>
<td><textarea style="height:100px;" name="choix3[]" class="qty smallInputBox inputElement">'.html_entity_decode($lignesQuestion['choix3']).'</textarea></td>
<td><textarea style="height:100px;" name="choix4[]" class="qty smallInputBox inputElement">'.html_entity_decode($lignesQuestion['choix4']).'</textarea></td>
<td><textarea style="height:100px;" name="choix5[]" class="qty smallInputBox inputElement">'.html_entity_decode($lignesQuestion['choix5']).'</textarea></td>
<td>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="checkboxcChoix'.$lignesQuestion['code_ligne'].'[]" id="Choix1'.$lignesQuestion['code_ligne'].'" value="Choix1" >
<label class="form-check-label" for="ridRadios1">Choix1</label></div>
<div class="form-check"><input class="form-check-input" type="checkbox" name="checkboxcChoix'.$lignesQuestion['code_ligne'].'[]" id="Choix2'.$lignesQuestion['code_ligne'].'" value="Choix2">
<label class="form-check-label" for="ridRadios1">Choix2</label></div>
<div class="form-check"><input class="form-check-input" type="checkbox" name="checkboxcChoix'.$lignesQuestion['code_ligne'].'[]" id="Choix3'.$lignesQuestion['code_ligne'].'" value="Choix3">
<label class="form-check-label" for="ridRadios1">Choix3</label></div>
<div class="form-check"><input class="form-check-input" type="checkbox" name="checkboxcChoix'.$lignesQuestion['code_ligne'].'[]" id="Choix4'.$lignesQuestion['code_ligne'].'" value="Choix4">
<label class="form-check-label" for="ridRadios1">Choix4</label></div>
<div class="form-check"><input class="form-check-input" type="checkbox" name="checkboxcChoix'.$lignesQuestion['code_ligne'].'[]" id="Choix5'.$lignesQuestion['code_ligne'].'" value="Choix5">
<label class="form-check-label" for="ridRadios1">Choix5</label>
</div>
</td>
<td><input type="number" class="qty smallInputBox inputElement" name="note[]" value='.$lignesQuestion['note'].'></td>
<td style="display: none;"><input type="number" name="ids[]" value='.$lignesQuestion['code_ligne'].'></td>
</tr>';
//traitement pour checkbox/correction
if(strlen($lignesQuestion['correction']) == 6){
$tableReseau=$lignesQuestion['correction'];
echo'<script>document.getElementById("'.$tableReseau.$lignesQuestion['code_ligne'].'").checked = true;</script>';
}else{
$tableReseau=explode("::",$lignesQuestion['correction']);
echo'<script>';
for ($zz = 0; $zz< sizeof($tableReseau); $zz++) {
echo'document.getElementById("'.$tableReseau[$zz].$lignesQuestion['code_ligne'].'").checked = true;';
}
echo'</script>';
}
}
echo'<div class="main-container main-container-Accounts">
<form action="?module=QCMExamenEdit&view=QCMExamenEdit" method="post" enctype="multipart/form-data">
<div class="container-fluid" style="margin:15px 15px 15px 15px;">
<div class=" detailview-header-block">
<div class="fieldBlockContainer" data-block="LBL_ADDRESS_INFORMATION">
<h4 class="fieldBlockHeader">Details Examen</h4>
<hr>
<table class="table table-borderless addressBlock">
<tbody>
<tr>
<td class="fieldLabel alignMiddle">Libellé&nbsp;&nbsp;</td>
<td class="fieldValue"><input type="text" class="inputElement " name="libelle" value="'.html_entity_decode($Examen[0]['libelle_qcm']).'"></td>
<td class="fieldLabel alignMiddle">Type&nbsp;&nbsp;</td>
<td class="fieldValue"><input type="text" class="inputElement " name="type" value="'.html_entity_decode($Examen[0]['type']).'"></td>
</tr>
<tr>
<td class="fieldLabel alignMiddle">Date Début&nbsp;</td>
<td class="fieldValue"><input type="date" class="inputElement " name="dateD" value="'.$Examen[0]['date_debut'].'"></td>
<td class="fieldLabel alignMiddle">Date fin&nbsp;&nbsp;</td>
<td class="fieldValue"><input type="date" class="inputElement " name="dateF" value="'.$Examen[0]['date_fin'].'"></td>
</tr>
<tr>
<td class="fieldLabel alignMiddle">Heure début&nbsp;&nbsp;</td>
<td class="fieldValue"><input type="time" class="inputElement " name="heureD" value="'.$Examen[0]['heure_debut'].'"></td>
<td class="fieldLabel alignMiddle">Heure fin&nbsp;&nbsp;</td>
<td class="fieldValue"><input type="time" class="inputElement " name="heureF" value="'.$Examen[0]['heure_fin'].'"></td>
</tr>
<tr>
<td class="fieldLabel alignMiddle">Durée&nbsp;&nbsp;</td>
<td class="fieldValue"><input type="time" class="inputElement " name="duree" value="'.$Examen[0]['duree'].'" readonly></td>
<td class="fieldLabel alignMiddle">Réseau&nbsp;&nbsp;</td>
<td class="fieldValue">
<label class="checkbox-inline" >
<input name="reseau[]" style="margin-right: 5px;" id="A" type="checkbox" value="A">A
</label>
<label class="checkbox-inline" >
<input name="reseau[]" style="margin-right: 5px;" id="B" type="checkbox" value="B">B
</label>
<label class="checkbox-inline">
<input name="reseau[]" style="margin-right: 5px;" id="C" type="checkbox" value="C">C
</label>
</td>
</tr>
<tr>
<td class="fieldLabel alignMiddle">Forme&nbsp;&nbsp;</td>
<td class="fieldValue">
<select class="js-example-basic-single form-control" style="width:200px;" name="forme" id="forme" required >
<option value="NORMALE" '; if($Examen[0]['forme'] == 'NORMALE') echo 'selected'; echo' >NORMALE</option>
<option value="ENONCE"'; if($Examen[0]['forme'] == 'ENONCE' ) echo 'selected'; echo' >ENONCE</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
</div><div class=" detailview-header-block" style="margin-top:15px; margin-bottom:50px; display : none;" id="memo">
<h4 class="fieldBlockHeader">MÉMO</h4>
<hr>
<div class="row" style="margin: 5px 0px 0px 0px;">
<div class="row">
<div class="col-md-12">
<textarea class="form-control" name="memo" rows="10" autocomplete="off" >'.$Examen[0]['memo'].'</textarea>
</div>
</div>
</div>
</div>
<div class=" detailview-header-block" style="margin-top:15px; margin-bottom:50px;">
<h4 class="fieldBlockHeader">Lignes Question</h4>
<hr>
<div class="row" style="margin: 5px 0px 0px 0px;">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
<div class="fa fa-plus" aria-hidden="true"></div>
&nbsp;&nbsp;Ajouter
</button>
</div>
<div class="row" style="margin: 5px 0px 0px 0px;">
<table id="dynamique" class="table table-bordered table-editable">
<thead>
<tr>
<th style="width: 20px;">Select</th>
<th style="width: 20px;">Ordre</th>
<th>Question</th>
<th>Choix 1</th>
<th>Choix 2</th>
<th>Choix 3</th>
<th>Choix 4</th>
<th>Choix 5</th>
<th>Correction</th>
<th>Note</th>
<th style="display: none;"></th>
</tr>
</thead>
<tbody>';
foreach ($lignesQuestion as $lignesQuestion) {
result($lignesQuestion);
}
echo'</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="modal-overlay-footer" style="border-left: 42px solid #efefef;">
<div class="row clearfix">
<div class="textAlignCenter col-lg-12 col-md-12 col-sm-12 ">
<button class="btn btn-success saveButton" type="submit" name="update" value="update">Save</button>
<a class="cancelLink" href="javascript:history.back()" type="reset">Annuler</a>
</div>
</div>
</div></form>';
echo '<!-- Modal --><form id="formulaire" class="needs-validation" novalidate>
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Details Question</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row" style="margin: 5px 0px 0px 0px;">
<div class="row">
<div class="col-md-12">
<label for="Date">Question</label>
<textarea class="form-control" id="question" name="question" rows="2" autocomplete="off" required></textarea>
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12">
<label for="Date">Choix 1</label>
<input class="form-control" type="text" id="choix1" name="choix1" autocomplete="off">
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12">
<label for="Date">Choix 2</label>
<input class="form-control" type="text" id="choix2" name="choix2" autocomplete="off">
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12">
<label for="Date">Choix 3</label>
<input class="form-control" type="text" id="choix3" name="choix3" autocomplete="off">
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12">
<label for="Date">Choix 4</label>
<input class="form-control" type="text" id="choix4" name="choix4" autocomplete="off">
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12">
<label for="Date">Choix 5</label>
<input class="form-control" type="text" id="choix5" name="choix5" autocomplete="off">
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12">
<label for="Date">Correction :&nbsp;&nbsp;</label>
<label class="checkbox-inline" >
<input name="checkboxcChoix1" style="margin-right: 5px;" id="checkboxcChoix1" type="checkbox" value="choix1">choix1
</label>
<label class="checkbox-inline" >
<input name="checkboxcChoix[]" style="margin-right: 5px;" id="checkboxcChoix2" type="checkbox" value="choix2">choix2
</label>
<label class="checkbox-inline">
<input name="checkboxcChoix[]" style="margin-right: 5px;" id="checkboxcChoix3" type="checkbox" value="choix3">choix3
</label>
<label class="checkbox-inline">
<input name="checkboxcChoix[]" style="margin-right: 5px;" id="checkboxcChoix4" type="checkbox" value="choix4">choix4
</label>
<label class="checkbox-inline">
<input name="checkboxcChoix[]" style="margin-right: 5px;" id="checkboxcChoix5" type="checkbox" value="choix5">choix5
</label>
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-4">
<label for="Date">Ordre</label>
<input class="form-control" type="numbre" id="ordre" name="ordre" autocomplete="off">
</div>
<div class="col-md-4">
<label for="note">Note</label>
<input class="form-control" type="numbre" id="note" name="note" autocomplete="off">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<input class="add-row btn btn-primary" data-dismiss="modal" type="submit" value="Ajouter">
</div>
</div>
</div>
</div><form>';
//afficher la result aprer ajouter l'attribut checked
$tableReseau=explode("::",$Examen[0]['reseau']);
echo'<script>';
for ($z = 0; $z< sizeof($tableReseau); $z++) {
echo'document.getElementById("'.$tableReseau[$z].'").checked = true;';
}
echo'</script>';
$viewer->view('CustomDashboardFooter.tpl');
?>
<!-- script pour liste déroulante -->
<script>
$(document).ready(function() {
$('.js-example-basic-single').select2();
});
$(document).ready(function() {
var res=$('#forme').val();
if(res == "ENONCE")
document.getElementById("memo").style.display = "block";
});
$('#forme').change(function() {
var res=$(this).val();
if(res == "ENONCE"){
document.getElementById("memo").style.display = "block";
}else if(res == "NORMALE"){
document.getElementById("memo").style.display = "none";
}
});
</script>
<script type="text/javascript" src="layouts/v7/lib/jquery/purl.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/select2/select2.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery.class.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery-ui-1.11.3.custom/jquery-ui.js"></script>
<script type="text/javascript" src="layouts/v7/lib/todc/js/bootstrap.min.js"></script>
<script type="text/javascript" src="libraries/jquery/jstorage.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery-validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="libraries/jquery/jquery.ba-outside-events.min.js"></script>
<script type="text/javascript" src="libraries/jquery/defunkt-jquery-pjax/jquery.pjax.js"></script>
<script type="text/javascript" src="libraries/jquery/multiplefileupload/jquery_MultiFile.js"></script>
<script type="text/javascript" src="resources/jquery.additions.js"></script>
<script type="text/javascript" src="layouts/v7/lib/bootstrap-notify/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/websockets/reconnecting-websocket.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery-play-sound/jquery.playSound.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/malihu-custom-scrollbar/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/malihu-custom-scrollbar/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/autoComplete/jquery.textcomplete.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery.qtip.custom/jquery.qtip.js"></script>
<script type="text/javascript" src="libraries/jquery/jquery-visibility.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/momentjs/moment.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/daterangepicker/moment.min.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/daterangepicker/jquery.daterangepicker.js"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/jquery.timeago.js"></script>
<script type="text/javascript" src="libraries/jquery/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="libraries/jquery/ckeditor/adapters/jquery.js"></script>
<script type='text/javascript' src='layouts/v7/lib/anchorme_js/anchorme.min.js'></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Class.js?v=7.1.0"></script>
<script type='text/javascript' src="layouts/v7/resources/helper.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/resources/application.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Utils.js?v=7.1.0"></script>
<script type='text/javascript' src="layouts/v7/modules/Vtiger/resources/validation.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/lib/bootbox/bootbox.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Base.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Vtiger.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Calendar/resources/TaskManagement.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Import/resources/Import.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Emails/resources/EmailPreview.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Base.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Google/resources/Settings.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/CkEditor.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Documents/resources/Documents.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/bootstrap/js/eternicode-bootstrap-datepicker/js/bootstrap-datepicker.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/bootstrap/js/eternicode-bootstrap-datepicker/js/locales/bootstrap-datepicker.fr.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/timepicker/jquery.timepicker.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/lazyYT/lazyYT.min.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Header.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Edit.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Popup.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Field.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jquery_windowmsg.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/BasicSearch.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceFilter.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/SearchAdvanceFilter.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceSearch.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/BaseList.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/List.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceSearchList.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/RecordSelectTracker.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Pagination.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Import/resources/Popup.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Emails/resources/MassEdit.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/EmailsRelatedPopup.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/sadropdown.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/languages/jquery.validationEngine-fr.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Vtiger.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jquery.stickytableheaders.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/gridster/jquery.gridster.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/jquery.jqplot.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.pieRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.pointLabels.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.funnelRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.logAxisRenderer.min.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/VtJqplotInterface.js?v=7.1.0"></script>
<script type="text/javascript" src="libraries/jquery/vtchart.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/lib/jquery/gridster/jquery.gridster.min.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/DashBoard.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/dashboards/Widget.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Detail.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Reports/resources/Detail.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Reports/resources/ChartDetail.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/CkEditor.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/lib/bootstrap-daterangepicker/moment.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/lib/bootstrap-daterangepicker/daterangepicker.js?v=7.1.0"></script>
<script type="text/javascript" src="layouts/v7/resources/v7_client_compat.js?v=7.1.0"></script>
<!-- Added in the end since it should be after less file loaded -->
<script type="text/javascript" src="libraries/bootstrap/js/less.min.js"></script>
<!-- Enable tracking pageload time -->
<script type="text/javascript">var _REQSTARTTIME = "1589749969";
jQuery(document).ready(function() {
window._PAGEREADYAT = new Date();
}
);
jQuery(window).load(function() {
window._PAGELOADAT = new Date();
window._PAGELOADREQSENT = false;
// Transmit the information to server about page render time now.
if (typeof _REQSTARTTIME != 'undefined') {
// Work with time converting it to GMT (assuming _REQSTARTTIME set by server is also in GMT)
var _PAGEREADYTIME = _PAGEREADYAT.getTime() / 1000.0;
// seconds
var _PAGELOADTIME = _PAGELOADAT.getTime() / 1000.0;
// seconds
var data = {
page_request: _REQSTARTTIME, page_ready: _PAGEREADYTIME, page_load: _PAGELOADTIME };
data['page_xfer'] = (_PAGELOADTIME - _REQSTARTTIME).toFixed(3);
data['client_tzoffset']= -1*_PAGELOADAT.getTimezoneOffset()*60;
data['client_now'] = JSON.parse(JSON.stringify(new Date()));
if (!window._PAGELOADREQSENT) {
// To overcome duplicate firing on Chrome
window._PAGELOADREQSENT = true;
}
}
}
);
</script>
<script>
var checked;
$(document).ready(function(){
var inc=1;
$(".add-row").click(function(){
var question = $("#question").val();
var choix1 = $("#choix1").val();
var choix2 = $("#choix2").val();
var choix3 = $("#choix3").val();
var choix4 = $("#choix4").val();
var choix5 = $("#choix5").val();
var checkboxcChoix1 =$("#checkboxcChoix1 ").is(":checked");
if(checkboxcChoix1 == true){checked1="checked"}else{checked1="";}
var checkboxcChoix2 =$("#checkboxcChoix2 ").is(":checked");
if(checkboxcChoix2 == true){checked2="checked"}else{checked2="";}
var checkboxcChoix3 =$("#checkboxcChoix3 ").is(":checked");
if(checkboxcChoix3 == true){checked3="checked"}else{checked3="";}
var checkboxcChoix4 =$("#checkboxcChoix4 ").is(":checked");
if(checkboxcChoix4 == true){checked4="checked"}else{checked4="";}
var checkboxcChoix5 =$("#checkboxcChoix5 ").is(":checked");
if(checkboxcChoix5 == true){checked5="checked"}else{checked5="";}
var ordre = $("#ordre").val();
var note = $("#note").val();
var markup = "<tr style='height:100px;'><td><input type='checkbox' name='record'></td>"
+"<td><input type='number' class='qty smallInputBox inputElement' name='ordre[]' value="+ ordre + "></td>"
+"<td><textarea style='height:100px;' name='question[]' class='qty smallInputBox inputElement'>"+ question +"</textarea></td>"
+"<td><textarea style='height:100px;' name='choix1[]' class='qty smallInputBox inputElement'>"+ choix1 +"</textarea></td>"
+"<td><textarea style='height:100px;' name='choix2[]' class='qty smallInputBox inputElement'>"+ choix2 +"</textarea></td>"
+"<td><textarea style='height:100px;' name='choix3[]' class='qty smallInputBox inputElement'>"+ choix3 +"</textarea></td>"
+"<td><textarea style='height:100px;' name='choix4[]' class='qty smallInputBox inputElement'>"+ choix4 +"</textarea></td>"
+"<td><textarea style='height:100px;' name='choix5[]' class='qty smallInputBox inputElement'>"+ choix5 +"</textarea></td>"
+"<td>"
+" <div class='form-check'><input class='form-check-input' type='checkbox' name='checkboxcChoix"+inc+"[]' value='Choix1' "+ checked1 +">"
+" <label class='form-check-label' for='ridRadios1'>Choix1</label></div>"
+" <div class='form-check'><input class='form-check-input' type='checkbox' name='checkboxcChoix"+inc+"[]' value='Choix2' "+ checked2 +">"
+" <label class='form-check-label' for='ridRadios1'>Choix2</label></div>"
+" <div class='form-check'><input class='form-check-input' type='checkbox' name='checkboxcChoix"+inc+"[]' value='Choix3' "+ checked3 +">"
+" <label class='form-check-label' for='ridRadios1'>Choix3</label></div>"
+" <div class='form-check'><input class='form-check-input' type='checkbox' name='checkboxcChoix"+inc+"[]' value='Choix4' "+ checked4 +">"
+" <label class='form-check-label' for='ridRadios1'>Choix4</label></div>"
+" <div class='form-check'><input class='form-check-input' type='checkbox' name='checkboxcChoix"+inc+"[]' value='Choix5' "+ checked5 +">"
+" <label class='form-check-label' for='ridRadios1'>Choix5</label></div>"
+"</td>"
+"<td><input type='number' class='qty smallInputBox inputElement' name='note[]' value="+ note + "></td>"
+"<td style='display: none;'><input type='number' name='ids[]' value='0'></td>"
+"</tr>";
inc=inc+1;
$("#dynamique").append(markup);
viderChamps();
}
);
// Find and remove selected table rows
$(".delete-row").click(function(){
console.log("mm");
$("#dynamique").find('input[name="record"]').each(function(){
if($(this).is(":checked")){
$(this).parents("tr").remove();
}
}
);
}
);
}
);
</script>
<script>
function viderChamps() {
//réinitialiser le formulaire
$("#formulaire")[0].reset();
}
</script>
</html>