Server IP : 119.59.102.212 / Your IP : 3.141.244.88 Web Server : Apache/2 System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64 User : yangkam ( 1022) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/question/ |
Upload File : |
<?php import_request_variables('pG', 'p_'); $sel_q = "select * from cms_question where id_question = '$p_question_id'"; $que_q = mysql_query($sel_q); $obj_q = mysql_fetch_assoc($que_q); $navig['question&id_sub='.$p_id_sub] = $p_sub_name; $navig['question_title'] = 'เพิ่มหัวข้อ'; navigator($navig); echo"<br>"; bar_header($p_title); // Bar_Header fieldset_top($obj_q['topic']); //debuga($_POST); foreach($_POST as $key => $value){ if(strpos($key, 'choice_no_') > -1){ $arr = explode('_', $key); $no = $arr[2]; $arr_choice[$no] = $value; } } ?> <table width="97%" border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td> <center> <FORM NAME='formupdate' METHOD=POST ACTION='index.php?mod=question_output&path=question' onSubmit='return check()'> <input type="hidden" name="id_sub" value="<?php echo $p_id_sub; ?>" /> <input type="hidden" name="sub_name" value="<?php echo $p_sub_name; ?>" /> <input type="hidden" name="question_id" value="<?php echo $p_question_id; ?>" /> <input type="hidden" name="title" value="<?php echo $p_title; ?>" /> <input type="hidden" name="question_type" value="<?php echo $p_question_type; ?>" /> <?php if($p_question_type == '6'){ ?> <table width='98%' border='0' cellpadding='0' cellspacing='0'> <?php text_editor('100%', '260', 'คำอธิบาย', 1, '', 'data_1'); ?> </table> <?php }else{ ?> <?php if(isset($arr_choice)){ ?> <input type="hidden" name="all_choice" value="<?php echo implode('#@+=', $arr_choice); ?>" /> <?php } ?> <table width='98%' border='0' cellpadding='0' cellspacing='1' bgcolor='#eff3f7' id="tb_title"> <tr id="tr_data_1"> <td width='20%' height='30' bgcolor='ffffff'> <img src='coremain/images/marker.gif'> หัวข้อที่ 1</td> <td width='80%' height='30' bgcolor='ffffff'><INPUT TYPE='text' NAME='data_1' size="50" value=''></td> </tr> </table> <?php } ?> <table width="100%" id="bt_question_title"> <?php if($p_question_type != '6'){ ?> <tr> <td align="left"> <button type="button" id="add_data" class="ui-button ui-corner-all ui-state-focus" style="padding: 2px;"> <img src='coremain/images/bullet2.gif'> เพิ่มหัวข้อ</button> <?php if($p_question_type == '3' || $p_question_type == '4'){ ?> <input type="checkbox" name="add_other" value="1" checked="checked" /> มีหัวข้ออื่นๆ <?php } ?> </td> </tr> <?php } ?> <tr> <td align="center"> <?php button_text('เพิ่มแบบสำรวจ', 'Submit', 2); ?> </td> </tr> </table> </FORM> </center> </td> </tr> </table> <script language="javascript"> $('input[name="data_1"]').focus(); $('#add_data').on('click', function(){ var row = $('#tb_title').find('tr').last().attr('id'); var id = row.split('_'); var n = Number(id[2]) + 1; var tr = '<tr id="tr_data_'+ n +'"><td height="30" bgcolor="ffffff"> <img src="coremain/images/marker.gif"> หัวข้อที่ '+ n +'</td><td height="30" bgcolor="ffffff"><INPUT TYPE="text" NAME="data_'+ n +'" size="50" /> <a href="javascript:void(0);" class="del_data" id="'+ n +'"><img SRC="coremain/images/del1.gif" border="0" title="ลบข้อมูล"></a></td></tr>'; $('#tb_title').append(tr); $('input[name="data_'+ n +'"]').focus(); $('.del_data').on('click', function(){ if(del_data()){ var val = $(this).attr('id'); $('tr#tr_data_'+ val).remove(); } }); }); function check() { if(document.formupdate.topic.value=="") { alert("กรุณากรอกหัวข้อ !") ; document.formupdate.topic.focus() ; return false ; }else if(document.formupdate.question_type.value=='2'){ var chk_text = true; $.each($('.choice_no'), function(){ chk_text &= $(this).val() == '' ? false : true; }); if(!chk_text){ alert('กรุณากรอกคำตอบให้ครบทุกช่อง !'); return false; } }else{ return true ; } } function del_data(){ if(confirm('คุณต้องการลบหัวข้อนี้ ?')){ return true; }else{ return false; } } </script>