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

sommom

parent 4b31c39f
......@@ -121,14 +121,13 @@ if($mode == "r"){ ?>
<?php
foreach (Yii::app()->session["costum"]["form"]["params"][$kunik]["list"] as $ix => $lbl) {
$value = "";
if(!empty($answer) && isset($answer["answers"][$form["id"]][$kunik.$ix]) && $answer["answers"][$form["id"]][$kunik.$ix] )
$value = "checked";
else if(!empty($answer) && isset($answer["answers"][$kunik]) && $answer["answers"][$kunik] )
$value = "checked";
$ckd = "";
if(isset($answer["answers"][$form["id"]][$kunik]["value"]) && $answer["answers"][$form["id"]][$kunik]["value"] == $lbl)
$ckd = "checked";
?>
<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){
$tr = true;
......@@ -147,7 +146,6 @@ if($mode == "r"){ ?>
}
?>"
value="<?php echo $lbl ?>" />
<label for="<?php echo $kunik.$ix ?>"><span></span><span><?php echo $lbl ?>
......@@ -155,7 +153,13 @@ if($mode == "r"){ ?>
foreach ($paramsData["tofill"] as $key => $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
......@@ -171,7 +175,7 @@ if($mode == "r"){ ?>
</th></tr>
<?php } ?>
</table>
<?php //var_dump($paramsData["tofill"]); ?>
</div>
<?php }?>
......@@ -200,15 +204,35 @@ jQuery(document).ready(function() {
answer.path = "answers."+$(this).data("form")+"."+$(this).data("id");
answer.collection = "answers" ;
answer.id = "<?php echo $answer["_id"]; ?>";
answer.value = $(this).val();
answer.value = {"value" : $(this).val(), "type" : "simple"};
dataHelper.path2Value(answer , function(params) {
} );
} 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 = {
"jsonSchema" : {
"title" : "<?php echo $kunik ?> config",
......
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