|
|
|
ต้องการเชื่อมต่อฐานข้อมูลใน phpmyadmin ทำยังไงครับ |
|
|
|
|
|
|
|
เขียนโปรแกรมในดรีมcs6ครับ แล้วสร้างฐานข้อมูลใน phpmyadmin ต้องการบันทึกข้อมูล เวลา ลงในฐานข้อมูล
นี่ตัวอย่างโค๊ดครับ
Code (PHP)
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<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>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2015-02-12',
selectable: true,
selectHelper: true,
select: function(start, end) {
window.open("event-data.php?startDate="+start.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: [
{
title: 'All Day Event',
start: '2015-02-01'
},
{
title: 'Long Event',
start: '2015-02-07',
end: '2015-02-10'
},
{
id: 999,
title: 'Repeating Event',
start: '2015-02-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2015-02-16T16:00:00'
},
{
title: 'Conference',
start: '2015-02-11',
end: '2015-02-13'
},
{
title: 'Meeting',
start: '2015-02-12T10:30:00',
end: '2015-02-12T12:30:00'
},
{
title: 'Lunch',
start: '2015-02-12T12:00:00'
},
{
title: 'Meeting',
start: '2015-02-12T14:30:00'
},
{
title: 'Happy Hour',
start: '2015-02-12T17:30:00'
},
{
title: 'Dinner',
start: '2015-02-12T20:00:00'
},
{
title: 'Birthday Party',
start: '2015-02-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2015-02-28'
}
]
});
});
</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>
<div id='calendar'></div>
</body>
</html>
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<link rel="stylesheet" href="datetimepicker/bootstrap.css" media="screen">
<script src="datetimepicker/jquery-1.10.2.min.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="datetimepicker/bootstrap.min.js"></script>
<script type="text/javascript" src="datetimepicker/moment.min.js"></script>
<script type="text/javascript" src="datetimepicker/bootstrap-datetimepicker.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="datetimepicker/bootstrap-datetimepicker.min.css">
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css" rel="stylesheet">
<?
$startDate = date("d-M-Y",strtotime($_GET['startDate']));
?>
<body>
<form name="event-data" >
<table align="center">
<tr>
<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" /></td>
</tr>
<tr>
<td>Type :</td>
<td><select name="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>Time Start :</td>
<td><input id="datetimepicker1" size="40" /></td>
</tr>
<tr>
<td>Time Stop :</td>
<td><input id="datetimepicker2" size="40" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Comfirm" /></td>
</tr>
<tr>
<td><input id="datetimepicker1" /></td>
<td><input id="datetimepicker2" /></td>
</tr>
</table>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
}
,format: 'DD-MM-YYYY HH:mm:00'
});
});
$(function () {
$('#datetimepicker2').datetimepicker({
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
}
,format: 'DD-MM-YYYY HH:mm:00'
});
});
</script>
</form>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2015-06-15 09:47:03 |
By :
kendocfc |
View :
1646 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
phpmyadmin ไม่ใช่ฐานข้อมูลครับ เป็นเพยงตัวจัดการฐานข้อมูล MySQL ครับ
PHP MySQL
PHP MySQL Database (mysqli)
|
|
|
|
|
Date :
2015-06-15 12:56:35 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณพี่ๆที่แนะนำนะครับผมกำลังฝึกงานเลยต้องเขียนโปรเจคให้ที่ทำงาน ความรู้ต่ำต้อยมากคงต้องค่อยๆถามเอาศึกษาเอา
|
|
|
|
|
Date :
2015-06-15 13:42:45 |
By :
kendocfc |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|