Commit c56310ea authored by Anatole Rakotoson's avatar Anatole Rakotoson
Browse files

sommom

parent 4b31c39f
...@@ -121,14 +121,13 @@ if($mode == "r"){ ?> ...@@ -121,14 +121,13 @@ if($mode == "r"){ ?>
<?php <?php
foreach (Yii::app()->session["costum"]["form"]["params"][$kunik]["list"] as $ix => $lbl) { foreach (Yii::app()->session["costum"]["form"]["params"][$kunik]["list"] as $ix => $lbl) {
$value = ""; $ckd = "";
if(!empty($answer) && isset($answer["answers"][$form["id"]][$kunik.$ix]) && $answer["answers"][$form["id"]][$kunik.$ix] )
$value = "checked"; if(isset($answer["answers"][$form["id"]][$kunik]["value"]) && $answer["answers"][$form["id"]][$kunik]["value"] == $lbl)
else if(!empty($answer) && isset($answer["answers"][$kunik]) && $answer["answers"][$kunik] ) $ckd = "checked";
$value = "checked";
?> ?>
<tr><th> <tr><th>
<input data-id="<?php echo $kunik ?>" class=" radioCo " id="<?php echo $kunik.$ix ?>" data-form='<?php echo $form["id"] ?>' <?php echo $value?> type="radio" name="<?php echo $kunik ?>" <input data-id="<?php echo $kunik ?>" class=" radioCo " id="<?php echo $kunik.$ix ?>" data-form='<?php echo $form["id"] ?>' <?php echo $ckd?> type="radio" name="<?php echo $kunik ?>"
data-type="<?php if(count($paramsData["tofill"]) != 0){ data-type="<?php if(count($paramsData["tofill"]) != 0){
$tr = true; $tr = true;
...@@ -147,7 +146,6 @@ if($mode == "r"){ ?> ...@@ -147,7 +146,6 @@ if($mode == "r"){ ?>
} }
?>" ?>"
value="<?php echo $lbl ?>" /> value="<?php echo $lbl ?>" />
<label for="<?php echo $kunik.$ix ?>"><span></span><span><?php echo $lbl ?> <label for="<?php echo $kunik.$ix ?>"><span></span><span><?php echo $lbl ?>
...@@ -155,7 +153,13 @@ if($mode == "r"){ ?> ...@@ -155,7 +153,13 @@ if($mode == "r"){ ?>
foreach ($paramsData["tofill"] as $key => $value) { foreach ($paramsData["tofill"] as $key => $value) {
if($lbl == $value){ if($lbl == $value){
?> ?>
<input class="effect-1" type="text" placeholder="<?php echo $paramsData['placeholdersradio'][$value]; ?>" style="display: inline-block !important;"> <input class="effect-1 inputRadioCo" data-id="<?php echo $kunik ?>" data-form='<?php echo $form["id"] ?>' type="text" data-imp="<?php echo $value; ?>" placeholder="<?php echo $paramsData['placeholdersradio'][$value]; ?>" style="display: inline-block !important;"
value="<?php
if(isset($answer["answers"][$form["id"]][$kunik]["textsup"]) && isset($answer["answers"][$form["id"]][$kunik]["value"]) && $answer["answers"][$form["id"]][$kunik]["value"] == $value ){
echo $answer["answers"][$form["id"]][$kunik]["textsup"] ;
} ?>"
>
<?php <?php
...@@ -171,7 +175,7 @@ if($mode == "r"){ ?> ...@@ -171,7 +175,7 @@ if($mode == "r"){ ?>
</th></tr> </th></tr>
<?php } ?> <?php } ?>
</table> </table>
<?php //var_dump($paramsData["tofill"]); ?>
</div> </div>
<?php }?> <?php }?>
...@@ -200,14 +204,34 @@ jQuery(document).ready(function() { ...@@ -200,14 +204,34 @@ jQuery(document).ready(function() {
answer.path = "answers."+$(this).data("form")+"."+$(this).data("id"); answer.path = "answers."+$(this).data("form")+"."+$(this).data("id");
answer.collection = "answers" ; answer.collection = "answers" ;
answer.id = "<?php echo $answer["_id"]; ?>"; answer.id = "<?php echo $answer["_id"]; ?>";
answer.value = $(this).val(); answer.value = {"value" : $(this).val(), "type" : "simple"};
dataHelper.path2Value(answer , function(params) { dataHelper.path2Value(answer , function(params) {
} ); } );
} else if ($(this).data("type") == "cplx"){ } else if ($(this).data("type") == "cplx"){
answer.path = "answers."+$(this).data("form")+"."+$(this).data("id");
answer.collection = "answers" ;
answer.id = "<?php echo $answer["_id"]; ?>";
answer.value = {"value" : $(this).val(), "type" : "cplx", "textsup" : $('input[data-imp="' + $(this).val() + '"]').val()};
dataHelper.path2Value(answer , function(params) {
} );
} }
}); });
$('.inputRadioCo').keyup(function(){
if($('input[value="' + $(this).data("imp") + '"]').is(':checked')) {
answer.path = "answers."+$(this).data("form")+"."+$(this).data("id");
answer.collection = "answers" ;
answer.id = "<?php echo $answer["_id"]; ?>";
answer.value = {"value" : $(this).data("imp"), "type" : "cplx", "textsup" : $(this).val()};
dataHelper.path2Value(answer , function(params) {
} );
}
})
sectionDyf.<?php echo $kunik ?>Params = { sectionDyf.<?php echo $kunik ?>Params = {
"jsonSchema" : { "jsonSchema" : {
......
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