|
|
|
ต้องการปิด popup เมื่อกดปุ่ม summit และ refresh หน้าต่างเพื่อนแสดงค่าล่าสุด |
|
|
|
|
|
|
|
ตามเนี่ยครับ onClick="javascript:closepopup()" ใช้แล้วมันก็ไม่ปิดให้เอง
Code (PHP)
<body>
<table align="center">
<tr><form action="insert.php" method="post" name="event-data" >
<td align="center" colspan="2">Event Data Date :: <?=$startDate?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Descriptions :</td>
<td><input name="title" size="40" id="title"/></td>
</tr>
<tr>
<td>Type :</td>
<td>
<select name="type" id="type"/>
<option id="1" value="M01">(M01) Outsource</option>
<option id="2" value="M02">(M02) Phone & Remote Support (CRM)</option>
<option id="3" value="M03">(M03) Onsite Support (CRM)</option>
<option id="4" value="M04">(M04) Preventive Maintenance</option>
<option id="5" value="M05">(M05) Planning Project</option>
<option id="6" value="M06">(M06) Tacking Job</option>
<option id="7" value="M07">(M07) Meeting</option>
<option id="8" value="I01">(I01) New Installation</option>
<option id="9" value="I02">(I02) Testing</option>
<option id="10" value="I03">(I03) Presale</option>
<option id="11" value="I04">(I04) Trainer (internal/external)</option>
<option id="12" value="I05">(I05) Training (internal/external)</option>
<option id="13" value="T01">(T01) Other</option></td>
</tr>
<tr>
<td><?php echo "Date, time :"?></td>
</tr>
<tr>
<td><h4>Start</h4></td>
<td><input type="datetime" id="datetimepicker1" name="start" value="<?=$startDate?>"/></td>
</tr>
<tr>
<td><h4>End</h4></td>
<td><input type="datetime" id="datetimepicker2" name="end" value="<?=$endDate?>"/></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit" onClick="javascript:closepopup()"/></td>
</tr>
</table>
</form>
แล้วต้องการให้หน้านี่refreshเองเมื่อกดปุ่มข้างบน
Code (PHP)
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel="stylesheet" href="fullcalendar-2.3.1/bootstrap/bootstrap.css" media="screen">
<script src="fullcalendar-2.3.1/bootstrap/bootstrap.min.js"></script>
<link href='fullcalendar-2.3.1/fullcalendar.css' rel='stylesheet' />
<link href='fullcalendar-2.3.1/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='fullcalendar-2.3.1/lib/moment.min.js'></script>
<script src='fullcalendar-2.3.1/lib/jquery.min.js'></script>
<script src='fullcalendar-2.3.1/fullcalendar.min.js'></script>
<? include "ConnectDB/DB_Connect.php";?>
<? $query = "SELECT * FROM event";
$result = mysql_query($query);
$today = date("Y/m/d");
?>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '<?=$today?>',
selectable: true,
selectHelper: true,
buttonIcons: true,
select: function(start, end) {
window.open("event-data.php?startDate="+start.format()+"&endDate="+end.format(), "", "width=500, height=600");
<!--starttime = $.fullCalendar.formatDate(start,'ddd, MMM d, h:mm tt');var title = prompt('Event Title:');1-->
var eventData;
if (title) {
eventData = {
title: title,
start: start,
end: end
};
$('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
}
$('#calendar').fullCalendar('unselect');
},
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
<? while($row = mysql_fetch_array($result)){ ?>
<?
$startDate = date("Y-m-d H:i:s",strtotime($row['start']));
$endDate = date("Y-m-d H:i:s",strtotime($row['end']));?>
{
title: '<?="(".$row['type'].") ".$row['title']?>',
start: '<?=$startDate?>',
end: '<?=$endDate?>' },
<? ;} ?>
]
});
});
</script>
<style>
body {
margin: 40px 10px;
padding: 0;
font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
font-size: 14px;
}
#calendar {
max-width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<? include "header-menu.php" ;?>
<div id='calendar'></div>
</body>
</html>
Tag : PHP, JavaScript, jQuery
|
|
|
|
|
|
Date :
2015-06-29 15:15:01 |
By :
kendocfc |
View :
2477 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (JavaScript)
self.opener.location.reload();
ลองดูตัวนี้ครับ
|
|
|
|
|
Date :
2015-06-29 16:19:03 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|