%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php $ans = array(); $ansOth = array(); foreach($answers as $row){ if($row['type'] == 'radio_opt'){ $ans[$row['question_id']][$row['answer']][] = 1; $ansOth[$row['question_id']]['answer_other'][] = $row['answer_other']; } if($row['type'] == 'check_opt'){ foreach(explode(",", str_replace(array("[","]"), '', $row['answer'])) as $v){ $ans[$row['question_id']][$v][] = 1; } } if($row['type'] == 'textfield_b'){ $ans[$row['question_id']][] = $row['answer']; } if($row['type'] == 'textfield_s'){ $ans[$row['question_id']][] = $row['answer']; } } ?> <style> .tfield-area{ max-height: 30vh; overflow: auto; } </style> <div id="content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-md-4"> <div class="card card-outline card-primary"> <div class="card mb-3 fomr-news"> <div class="card-header card-header-new"><h3> <i class="fa fa-university"></i> Survey Details of <?=ucwords($survey['full_name'])?></h3> </div> </div> <div class="card-body"> <div class="survay-detail"> Title: <strong><?php echo $sd['title']; ?> </strong> Description: <strong><?php echo $description; ?> </strong> Start: <strong><?php echo date("M d, Y",strtotime($sd['start_date'])) ?> </strong> End: <strong><?php echo date("M d, Y",strtotime($sd['end_date'])) ?> </strong> Have Taken: <strong><?php echo number_format($taken) ?> </strong> </div> </div> </div> </div> <div class="col-md-8"> <div class="card card-outline card-success"> <div class="card mb-3 fomr-news"> <div class="card-header card-header-new"><h3> <i class="fa fa-university"></i> Survey Report</h3> <button class="button2" type="button" id="print" style="float:right;"><i class="fa fa-print"></i> Print</button> </div> </div> <div class="card-body ui-sortable"> <?php $t=1; $finalResp = array(); $finalRespArray = array(); foreach($questionArray as $trow){ if($trow['type']=='textfield_b') { if(isset($ans[$trow['id']])){ foreach($ans[$trow['id']] as $val){ $respon = unserialize($val); foreach($respon as $key=>$val){ if(ctype_alnum($key) && !in_array($key,array('submit','Submit'))) { if($val>='4'){ $finalResp[$trow['id']][$key][] = $val; $finalRespArray[$trow['id']][] = $val; } } } } } } } // print_r($finalResp); //die; foreach($questionArray as $row){ $answerOthArray = $ansOth[$row['id']]; $answerArray = $ans[$row['id']]; ?> <div class="callout callout-info"> <div class="callouttop"> <div class="row"> <div class="col-md-11"> <h5><span style="color:blue;">Qus<?=$t++?></span>: <?php echo $row['question'] ?> </h5> </div> </div> </div> <div class="row"> <div class="col-md-12"> <input type="hidden" name="qid[]" value="<?php echo $row['id'] ?>"> <?php if($row['type'] == 'radio_opt'): foreach(json_decode($row['frm_option']) as $k => $v): foreach($answerArray as $nkey=>$nval){ $otherKeyArray = explode(' || ', $v); ?> <div class="icheck-primary"> <input type="radio" id="option_<?php echo $k ?>" name="answer[<?php echo $row['id'] ?>]" value="<?php echo $k ?>" <?php if($nkey==$k) { echo 'checked'; } ?>> <label for="option_<?php echo $k ?>"><?php echo $v ?></label> <?php if($otherKeyArray[0]=='Other') { ?><p><?php echo $answerOthArray['answer_other'][0]!='' ? $answerOthArray['answer_other'][0]: ''; ?></p> <?php } ?> </div> <?php } endforeach; ?> <?php elseif($row['type'] == 'check_opt'): foreach(json_decode($row['frm_option']) as $k => $v): ?> <div class="icheck-primary"> <input type="checkbox" id="option_<?php echo $k ?>" name="answer[<?php echo $row['id'] ?>][]" value="<?php echo $k ?>" > <label for="option_<?php echo $k ?>"><?php echo $v ?></label> </div> <?php endforeach; ?> <?php elseif($row['type'] == 'textfield_b'): ?> <?php echo base64_decode($row['frm_option']); foreach(unserialize($answerArray[0]) as $key=>$val){ ?> <script> $("#<?=$key?> option[value='" + <?=$val?> + "']").prop("selected", true); </script> <?php } ?> <?php else: ?> <input type='text' name="answer[<?php echo $row['id'] ?>]" id="" cols="30" rows="4" class="form-control" placeholder="Write Something Here..." value="<?=$answerArray[0]?>"> <?php endif; ?> </div> </div> </div> <?php } ?> </div> </div> </div> </div> </div> </div> <script> $('#manage-survey').submit(function(e){ e.preventDefault() start_load() $.ajax({ url:'ajax.php?action=save_answer', method:'POST', data:$(this).serialize(), success:function(resp){ if(resp == 1){ alert_toast("Thank You.",'success') setTimeout(function(){ location.href = 'index.php?page=survey_widget' },2000) } } }) }) $('#print').click(function(){ start_load() var nw = window.open("print_report.php?id=<?php echo $id ?>","_blank","width=800,height=600") nw.print() setTimeout(function(){ nw.close() end_load() },2500) }) </script>