0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
poll
/
[
Home
]
File: add_choice.php
<?php session_start(); if($_SESSION["user"]==""){ session_destroy(); $message = "กรุณา Login ก่อน."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } require_once('../admin/Connections/conndb.php'); if(isset($_GET[ck])!=""){ $upd="update vote set vtitle='".mysql_real_escape_string($_POST[title2])."' WHERE id_v=".$_POST[ck]; mysql_query($upd); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin template="/Templates/template_a.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <script> function confirmDelete(delUrl) { if (confirm("ยืนยันการลบข้อมูล")) { document.location = delUrl; } } </script> <!-- InstanceEndEditable --> <?php require_once('../admin/Connections/conndb.php'); mysql_select_db($database_conndb, $conndb); ?> <title>องค์การบริหารส่วนตำบลบางเตย ที่อยู่ 8/8 หมู่2 ตำบลบางเตย อำเภอเมืองฉะเชิงเทรา จังหวัดฉะเชิงเทรา 24000 ::www.bangtoey.go.th</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../styles.css" rel="stylesheet" type="text/css"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #3CFFFF; } --> </style> <!--styles --> <link href="../styles.css" rel="stylesheet" type="text/css" /> <link href="../css/Hover%20Buttons.css" rel="stylesheet" type="text/css"/> <link href="../css/Hoverable-Sidenav.css" rel="stylesheet" type="text/css"/> <!--<script src="https://platform-api.sharethis.com/js/sharethis.js#property=5d255a83d97c100012d80679&product='inline-share-buttons' async='async" type='text/javascript'> --> </script> <!--styles --> <!--menutop hover --> <link href="../imagehover.css-master/css/demo-page.css" rel="stylesheet" media="all"> <link href="../imagehover.css-master/css/imagehover.min.css" rel="stylesheet" media="all"> <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' /> <!--end --> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } .style6 {color: #FFFFFF} --> </style></head> <body background="../images/0bg1.png" style="background-repeat:no-repeat; background-position:top"> <!--<div id="mySidenav" class="sidenav"> <a href="http://new.huayyai.go.th/index.php" id="about"> </a> <a href="http://new.huayyai.go.th/news.php?cat_id=1" id="blog"> </a> <a href="http://new.huayyai.go.th/news.php?cat_id=4" id="projects"> </a> <a href="http://new.huayyai.go.th/albums/index.php" id="contact"> </a> </div> --> <!-- content --> <div align="center"> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"><tr> <td height="650" align="center" valign="top" background="../images/head-1.png" style="background-repeat:no-repeat"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="515" align="center" valign="top"> </td> </tr> <tr> <td height="364" align="center" valign="top"><iframe src="/title_head.html" width="980" height="335" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></td> </tr> <tr> <td align="center" valign="top"><iframe src="/menu-top.html" width="980" height="53" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></td> </tr> <tr> <td height="150" align="center" valign="top"> </td> </tr> </table></td> </tr> </td> </tr> <tr> <td align="center" valign="top"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" --> <table width="98%" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="21" class="under"><div align="center" class="title2"><img src="../images/botton/poll.png" width="640" height="78"></div></td> </tr> <tr> <td> </td> </tr> <tr> <td class="styles1"><div align="right"> <div align="right"> <div align="right"><a href="../admin/main.php" class="styles2">หน้า Admin </a> | <a href="admin.php">แบบสอบถามทั้งหมด</a> | <a href="add_poll.php" class="styles2">เพิ่มแบบสอบถาม </a>| <a href="../admin/signout.php" class="styles2">ออกจากระบบ </a></div> </div> </div></td> </tr> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top"> <?php if(isset($_GET[idp])){ $idp=$_GET[idp]; } else{ $idp=$_POST[idp]; } $sql="select * from poll WHERE id_poll=".$idp; $res=mysql_query($sql); $dat=mysql_fetch_array($res); ?> <h4><?php echo stripslashes($dat[p_title]);?></h4> <?php if($_GET[idv]==""){ ?> <form method="POST" name="fnews" enctype="multipart/form-data" action="csave.php"> <input type="hidden" name="idp" value="<?php echo $dat[id_poll];?>"> <table width="650" border="0" cellpadding="2" cellspacing="1" class="box-center"> <tr align="center"> <td height="22" colspan="2" background="../images/bg4.gif" class="styles"><span class="title2">เพิ่มตัวเลือก</span></td> </tr> <tr> <td width="150" align="right" class="styles1"><div align="right">ตัวเลือก : </div></td> <td width="500" align="left" class="red"><div align="left"> <input name="title" type="text" class="styles4" id="cat_name" size="70"> **</div></td> </tr> <tr> <td height="25" colspan="2" ><div align="center"> <input name="okbutton" type="submit" class="btn" value="บันทึก" /> <input name="clear" type="button" class="btn" id="reset" value="ยกเลิก" onClick="location.href='add_poll.php';" /> <input name="c_date" type="hidden" id="c_date" value="<?php echo date('Y-m-d h:i:s');?>" /> </div></td> </tr> </table> <input type="hidden" name="MM_insert" value="fnews"> </form> <?php } else{ $sql2="select * from vote where id_v=".$_GET[idv]; $res2=mysql_query($sql2) or die(mysql_error()); $dat2=mysql_fetch_array($res2); ?> <form method="POST" name="fnews" enctype="multipart/form-data" action="cupdate.php"> <input type="hidden" name="idp" value="<?php echo $dat[id_poll];?>"> <table width="650" border="0" cellpadding="2" cellspacing="1" class="box-center"> <tr align="center"> <td height="22" colspan="2" background="../images/bg4.gif" class="styles"><span class="title2">เพิ่มตัวเลือก</span></td> </tr> <tr> <td width="150" align="right" class="styles1"><div align="right">ตัวเลือก : </div></td> <td width="500" align="left" class="red"><div align="left"> <input name="title2" type="text" class="styles4" id="cat_name" size="70" value="<?php echo $dat2[vtitle];?>"> <input type="hidden" name="ck" value="<?php echo $dat2[id_v];?>"> **</div></td> </tr> <tr> <td height="25" colspan="2" ><div align="center"> <input name="okbutton" type="submit" class="btn" value="บันทึก" /> <input name="clear" type="button" class="btn" id="reset" value="ยกเลิก" onClick="location.href='add_poll.php';" /> </div></td> </tr> </table> <input type="hidden" name="MM_insert" value="fnews"> </form> <?php } ?> </td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <table width="700" border="0" cellpadding="2" cellspacing="1" class="box-center"> <tr> <td width="48" height="22" background="../images/bg4.gif" class="styles"><div align="center">ลำดับ</div></td> <td width="456" height="22" background="../images/bg4.gif" class="styles"><div align="center">ตัวเลือก</div></td> <td width="69" height="22" align="center" background="../images/bg4.gif" class="styles"> </td> <td width="48" height="22" align="center" background="../images/bg4.gif" class="styles"><div align="center">แก้ไข</div></td> <td width="51" align="center" background="../images/bg4.gif" class="styles">ลบ</td> </tr> <?php $sql2="SELECT * FROM vote WHERE id_poll=".$idp; $res2=mysql_query($sql2); $i=1; while($c=mysql_fetch_object($res2)){ ?> <tr> <td width="48" valign="top" class="styles2"><div align="center"> <?php echo $i;?> </div></td> <td width="456" valign="top" class="styles1"><div align="left"><?php echo $c->vtitle; ?></div></td> <td width="69" align="center" valign="top"> </td> <td width="48" align="center" valign="top"><a href="add_choice.php?idv=<?php echo $c->id_v ; ?>&idp=<?php echo $c->id_poll;?>"><img src="../admin/images/edit.gif" alt="แก้ไข" width="13" height="13" border="0"></a></td> <td width="51" align="center" valign="top"><div align="center"><a href="javascript:confirmDelete('del_choice.php?idp=<?php echo $c->id_poll ; ?>&ck=<?php echo $c->id_v;?>')"><img src="../admin/images/delete.gif" alt="ลบหัวข้อ" width="18" height="18" border="0"></a></div></td> </tr> <?php $i++; } ?> </table> </div></td> </tr> <tr> <td class="styles1"><div align="left"></div></td> </tr> <tr> <td> </td> </tr> </table> <!-- InstanceEndEditable --></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top" style="background-repeat:no-repeat"><img src="../images/foot.png"></td> </tr> </table> </div> <!-- end_content --> <tr><td><a style="display:scroll;position:fixed;bottom:5px;right:5px;" class="backtotop" href="#top" rel="nofollow" title="Back to Top"><img src="../images/up.png" border="0" /></a></td> </tr> <map name="Map6" id="Map6"><area shape="rect" coords="210,1,302,41" href="http://www.tratlocal.go.th/index.php" target="_blank" /> </map> </body> <!-- InstanceEnd --></html> <?php if($conndb) { mysql_close($conndb); unset($conndb); } ?>
©
2018.