Commit 4c0625dd authored by ANDRIATAHINA Dady Christon's avatar ANDRIATAHINA Dady Christon
Browse files

CoObservatory for Open Atlas

parent d5470e76
......@@ -7,21 +7,30 @@
<?php if($answer){ ?>
<div class="col-md-6">
<?php
$myAnswers = PHDB::findOne("answers", array("user"=>Yii::app()->session["userId"], "form"=>$parentForm["_id"]->{'$id'}, "draft" => ['$exists' => false ]));
?>
<h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>">
<?php echo $label.$editQuestionBtn; ?>
</h4>
<?php echo $info ?>
<?php
$email = "";
if(isset($answer["answers"][$form["id"]]["email"])){
$email = $answer["answers"][$form["id"]]["email"];
}else if($answer["user"]==$_SESSION["userId"]){
$email = $_SESSION["userEmail"];
}else{
$email = "";
}
?>
<br>
<div class="form-group">
<input type="text" name="name" value="<?php echo $_SESSION['userEmail'] ?>" class="form-control">
<input type="text" id="<?= $key ?>" data-form="<?= $form["id"]?>" value="<?php echo $email ?>" class="form-control saveOneByOne">
</div>
</div>
......
......@@ -7,21 +7,30 @@
<?php if($answer){ ?>
<div class="col-md-6">
<?php
$myAnswers = PHDB::findOne("answers", array("user"=>Yii::app()->session["userId"], "form"=>$parentForm["_id"]->{'$id'}, "draft" => ['$exists' => false ]));
?>
<h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>">
<?php echo $label.$editQuestionBtn; ?>
</h4>
<?php echo $info ?>
<?php
$name = "";
if(!empty($answer["answers"][$form["id"]]["name"])){
$name = $answer["answers"][$form["id"]]["name"];
}else if($answer["user"]==$_SESSION["userId"]){
$name = $_SESSION["user"]["name"];
}else{
$name = "";
}
?>
<br>
<div class="form-group">
<input type="text" name="name" value="<?php echo $_SESSION['user']['name'] ?>" class="form-control">
<input type="text" id="<?= $key ?>" data-form="<?= $form["id"]?>" value="<?php echo $name ?>" class="form-control saveOneByOne">
</div>
</div>
......
......@@ -75,9 +75,11 @@
<?php echo $info ?>
<?php //$selected_type = $answer["answers"][$form["id"]]["type"]; ?>
<br>
<div class="form-group">
<select id="type-associe" class="form-control" name="types" onchange="getTypeAssocie()">
<select id="<?= $key ?>" data-form="<?= $form["id"]?>" class="form-control saveOneByOne">
<option></option>
<?php foreach ($types as $gkey => $gvalue) { ?>
<optgroup label="<?php echo $gvalue ?>">
......@@ -90,12 +92,15 @@
<?php } ?>
</select>
<?php // echo ($canEditForm)?"<div class='input-group-btn'>".$editParamsCheckbox."</div>":""; ?>
</div>
<div class="form-group">
<!--div class="col-sm-10 col-md-6">
TOTAL :
</div-->
<label>Nombre de part</label>
<input type="number" id="nbPart" name="nbPart" min="1" value="1" class="col-sm-10 col-md-6 form-control">
</div>
<br><br>
<div class="form-group">
<b>Total : </b> <span id="total"></span>
</div>
<div class="form-group">
<a id="btn-payement" class="btn btn-success btn-lg lbh" href="#" style="text-decoration : none;">
......@@ -106,8 +111,7 @@
<script type="text/javascript">
sectionDyf.<?php echo $kunik ?>ParamsData = <?php echo json_encode( $paramsData ); ?>;
var selectedType = "";
var typeAssocie = <?php echo json_encode( $types ); ?>;
$(document).ready(function(){
......@@ -180,9 +184,12 @@
alert( "Handler for .focus() called." );
});
$("#type-associe").off().on("change", function(){
$("#<?= $key ?>").off().on("change", function(){
$(this).blur();
const st = JSON.parse($(this).val());
$("#btn-payement").text("Proceder au payement de "+st.droit+" €");
$("#total").text(st.droit*$("#nbPart").val()+" €");
$("#btn-payement").text("Proceder au payement");
});
//adds a line into answer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment