function updateproject($projectid, $projectname, $projectdetail, $projectlat, $projectlong) { // function Update ข้อมูลโครงการลงในฐานข้อมูล global $conn; // เรียกตัวแปล conn มาเพื่อรอการเชื่อมต่อฐานข้อมูล //ชุดคำสั่ง update ค่าลงในฐานข้อมูล ในตารางข้อมูลที่ชื่อว่า project $sqlpro = "UPDATE project SET project_name='{$projectname}',project_detail='{$projectdetail}',project_lat='{$projectlat}',project_long='{$projectlong}'\n WHERE project_ID = '{$projectid}';"; mysql_query($sqlpro) or die(mysql_error()); //นำชุดคำสั่งมาใช้ CloseDB(); // เมื่อทำเสร็จแล้วให้ปิดการเชื่อมต่อ และ ทำการกลับไปที่หน้า admin/projectmanager.php header("location: ../admin/projectmanager.php"); // =>>>> กลับไป }
function deleteproject($deleteID) { // function delete ข้อมูลโครงการลงในฐานข้อมูล global $conn; // เรียกตัวแปล conn มาเพื่อรอการเชื่อมต่อฐานข้อมูล //ชุดคำสั่ง delete ค่าลงในฐานข้อมูล ในตารางข้อมูลที่ชื่อว่า project $sqlpro = "DELETE FROM project WHERE project_ID = '{$deleteID}'"; mysql_query($sqlpro) or die(mysql_error()); //นำชุดคำสั่งมาใช้ CloseDB(); // เมื่อทำเสร็จแล้วให้ปิดการเชื่อมต่อ และ ทำการกลับไปที่หน้า admin/projectmanager.php header("location: ../admin/projectmanager.php"); // =>>>> กลับไป }
function insertproject($projectname, $projectdetail, $projectlat, $projectlong) { // function insert ข้อมูลโครงการลงในฐานข้อมูล global $conn; // เรียกตัวแปล conn มาเพื่อรอการเชื่อมต่อฐานข้อมูล //ชุดคำสั่ง insert ค่าลงในฐานข้อมูล ในตารางข้อมูลที่ชื่อว่า project $sqlpro = "INSERT INTO\n\t\t\t project (project_name,project_detail,project_lat,project_long)\n\t\t\t VALUES ('{$projectname}',\n\t\t\t \t\t '{$projectdetail}',\n\t\t\t\t\t '{$projectlat}',\n\t\t\t\t\t '{$projectlong}')"; mysql_query($sqlpro) or die(mysql_error()); //นำชุดคำสั่งมาใช้ CloseDB(); // เมื่อทำเสร็จแล้วให้ปิดการเชื่อมต่อ และ ทำการกลับไปที่หน้า admin/projectmanager.php header("location: ../admin/projectmanager.php"); // =>>>> กลับไป }
<div class="part-btn-back"> <div class="box-btn cf"> <a href="<? echo $back_link ?>" class="btn red"><?=$backToActivityCap ?></a> </div> </div> </div> </div> </div> <div class="box-freespace"></div> <?php include ('inc/inc-footer.php'); include ('inc/inc-social-network.php'); ?> <? if($audioPlayer){ ?> <link rel="stylesheet" href="assets/plugin/circle-player/skin/circle.player.css"> <script type="text/javascript" src="assets/plugin/jplayer/jplayer/jquery.jplayer.min.js"></script> <script type="text/javascript" src="assets/plugin/circle-player/js/jquery.transform2d.js"></script> <script type="text/javascript" src="assets/plugin/circle-player/js/jquery.grab.js"></script> <script type="text/javascript" src="assets/plugin/circle-player/js/mod.csstransforms.min.js"></script> <script type="text/javascript" src="assets/plugin/circle-player/js/circle.player.js"></script> <script type="text/javascript" src="audiolist.php?NAME=voice&CID=<?=$CID ?>&CONID=<?=$CONID ?>"></script> <? } ?> </body> </html> <? CloseDB(); ?>
<!-- form --> <!-- end form --></td> </tr> <tr> <td height="16" colspan="2" align="center" background="img_mian/bgcolor2.gif" bgcolor="#B1C3D9">| <?php echo "<a href=\"javascript:history.back(-1)\">Âé͹¡ÅѺ</a>"; ?> |</td> </tr> <tr> <td height="16" valign="top"><img src="img_mian/bn_03_2.gif" width="634" height="36"></td> <td height="16" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td height="23"> </td> </tr> </table> <?php } //ch online CloseDB(); //close connect db ?> </body> </html>
function profileLookup() { global $start_date, $end_date; // connect to the database if (!TryOpenDB()) { abortAndExit(); } // Get REPORT_ID for all reports between specified dates. //$start_date = '2006-01-01'; //$end_date = strftime("%Y-%m-%d %H:%m:%S"); print "<table>\n"; print "<tr><td>Start date:</td><td>{$start_date}</td>\n"; print "<tr><td>End date:</td><td>{$end_date}</td>\n"; print "</table>\n"; $queryString = "select REPORT_ID,REPORT_DATE from profileReport where REPORT_DATE >= '" . $start_date . "' and REPORT_DATE <= '" . $end_date . " ORDER BY REPORT_DATE'"; //print "query: $queryString<br />\n"; // report_ids will be an associative array: keys=report_ids, values=dates $report_ids_lookup = mysql_query($queryString); if (!$report_ids_lookup) { abortAndExit(); //print "Could not look up row IDs with query $queryString<br />\n"; } if (mysql_num_rows($report_ids_lookup) == 0) { print "<p>No reports found in this date range</p>\n"; return; } while ($row = mysql_fetch_assoc($report_ids_lookup)) { //print $row['REPORT_ID'] . ": " . $row['REPORT_DATE']; $report_ids[$row['REPORT_ID']] = $row['REPORT_DATE']; } mysql_free_result($report_ids_lookup); if ($debug) { print "Report IDs:<br />\n"; print_r($report_ids); print "<br \\>\n"; } // Now dsplay a table of reported data for these REPORT_IDs. // Could find keys in advance using "select REPORT_KEY from reportRecord group by REPORT_KEY" // knownReportKeys is a (non-associative) array where each entry is a key used in a profile report. $knownReportKeysLookup = mysql_query("select REPORT_KEY from reportRecord group by REPORT_KEY"); if (!$knownReportKeysLookup) { abortAndExit(); } while ($row = mysql_fetch_array($knownReportKeysLookup)) { $knownReportKeys[] = $row[0]; } mysql_free_result($knownReportKeysLookup); if ($debug) { print "known keys:<br />\n"; print_r($knownReportKeys); } print "<table><tr><td>Date</td>\n"; foreach ($knownReportKeys as $reportKey) { print "<td>{$reportKey}</td>\n"; } print "</td>\n"; while (list($report_id, $report_date) = each($report_ids)) { $queryString = "select REPORT_KEY,REPORT_VALUE from reportRecord where REPORT_ID='" . $report_id . "'"; // report_records will be an assoc array, keys from knownReportKeys, values with the corresponding value $reportRecordsLookup = mysql_query($queryString); if (!$reportRecordsLookup) { abortAndExit(); } while ($row = mysql_fetch_assoc($reportRecordsLookup)) { $reportRecords[$row['REPORT_KEY']] = $row['REPORT_VALUE']; } mysql_free_result($reportRecordsLookup); if ($debug) { print "<br />report records: <br />\n"; print_r($reportRecords); print "<br />\n"; } print "<tr><td>{$report_date}</td>\n"; foreach ($knownReportKeys as $reportKey) { print "<td>" . $reportRecords[$reportKey] . "</td>\n"; } print "</tr>\n"; } print "</table>\n"; CloseDB(); }