|
|
|
ไม่สามารถเพิ่มหรือแก้ไขข้อมูลได้ไม่รู้ผิดตรงไหน รบกวนผู้รู้ด้วยนะครับ ขอบคุณครับ |
|
|
|
|
|
|
|
<?
session_start();
include("invalid.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>..:ข้อมูลสมาชิก:..ระบบสารสนเทศ ตำรวจภุธรจังหวัดนครปฐม</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="management/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style12 {color: #FF0066; font-size: 12px; }
.style14 {font-size: 12px}
.style15 {font-size: 12}
.style18 {color: #0033FF; font-size: 12px; }
.style23 {color: #FF0000}
.style24 {font-size: 12; color: #FF0000; }
.style25 { font-size: 18px;
color: #666600;
}
-->
</style>
<?
<SCRIPT language=JavaScript>
<!--
function checkSubmit() {
e_k=event.keyCode
if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
//if (e_k != 13 && (e_k < 48) || (e_k > 57)) {
event.returnValue = false;
alert("ต้องเป็นตัวเลขเท่านั้น... \nกรุณากรอกรหัสประจำตัวของท่านอีกครั้ง...");
}
}
function check_char() {
e_k=event.keyCode
if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
//if (e_k == 13 && (e_k > 48) || (e_k < 57) && (e_k == 32) {
event.returnValue = false;
alert("ต้องเป็นตัวหนังสือเท่านั้น... \nกรุณาตรวจสอบข้อมูลของท่านอีกครั้ง...");
}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
*/?>
<script language="Javascript">
function checkSubmit()
{
var name_mem;
var cid_mem;
var eid_place;
var use_mem;
var pass_mem;
name_mem=document.form1.name_mem.value;
cid_mem=document.form1.cid_mem.value;
eid_place=document.form1.id_place.value;
use_mem=document.form1.use_mem.value;
pass_mem=document.form1.pass_mem.value;
if(name_mem == "")
{ alert("กรุณาใส่ชื่อ-นามสกุล ด้วยดิ !!!"); return false; }
if(cid_mem == "")
{ alert("กรุณาใส่เลขประจำตัวด้วยซิ !!!"); return false; }
if(eid_place == "")
{ alert("กรุณาเลือกหน่วยงานด้วยซิ !!!"); return false; }
if(use_mem == "")
{ alert("กรุณาใส่ชื่อ Login ด้วยเด้อ !!!"); return false; }
if(pass_mem == "")
{ alert("กรุณาใส่รหัสด้วยค้า !!!"); return false; }
}
</script>
</head>
<body background="../image/bg-tile.gif" onLoad="MM_preloadImages('image/back.png')">
<?
include "../config.php";
$sql="select * from tb_member";
$result=mysql_query($sql);
$number=mysql_num_rows($result);
$no=1;
?>
<table width="60%" border="1" align="center" cellspacing="0" bgcolor="#FFFFFF" >
<tr>
<td align="center"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="../personal/genper/admin/images/002_Box_Content_bg.jpg">
<tr>
<td height="347" valign="top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="8" rowspan="2" valign="top"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td height="244" colspan="2" align="center" valign="top">
<form method="post" action="member_man.php" name="form1" onSubmit="return checkSubmit()">
<div align="center"><span class="style25">ข้อมูลสมาชิกสำหรับ Administrator</span></div>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="6" align="center" valign="bottom" ><table align="right" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="../images/addedit.png" width="48" height="48"></div></td>
</tr>
</table></td>
<td align="left"><span class="style18">ชื่อสมาชิก </span></td>
<td align="left"><div align="center" class="style18">:</div></td>
<td align="left"><span class="style23">
<input name="name_mem" type="text" onKeyPress="check_char()">
<span class="style15">
<label> <span class="style14">* </span></label>
</span></span> <span class="style24">
<label><span class="style14">(กรุณาระบุ ชื่อ-นามสกุล) </span></label>
</span></td>
</tr>
<tr>
<td align="left"><span class="style18">รหัสประจำตัว</span></td>
<td align="left"><div align="center" class="style18">:</div></td>
<td align="left"><span class="style24">
<label>
<input maxlength="13" type="text" name="cid_mem" onKeyPress="check_number()" >
<span class="style14">* </span></label>
<span class="style14">(กรุณาระบุ เลขบัตร ปชช.)</span></span></td>
</tr>
<tr>
<td align="left"><span class="style18">แผนกงาน</span></td>
<td align="left"><div align="center" class="style18">:</div></td>
<td align="left"><span class="style24">
<label>
<select name="eid_place" id="id_place">
<option >- กรุณาเลือกแผนก -</option>
<?
include "config.php";
$sql="select * from $place";
$result=mysql_query($sql);
while($rs=mysql_fetch_array($result)) {
$id_place=$rs[id_place];
$name_place=$rs[name_place];
echo"<option value='$id_place' >$name_place</option>";
}
?>
</select>
</label>
</span></td>
</tr>
<tr>
<td align="left" class="style18">ชื่อล๊อกอิน</td>
<td align="left" class="style12"><div align="center" class="style18">:</div></td>
<td align="left"><span class="style24">
<input name="use_mem" type="text">
</label>
</span></td>
</tr>
<tr>
<td align="left"><span class="style18">รหัสผ่าน</span></td>
<td align="left" class="style12"><div align="center" class="style18">:</div></td>
<td align="left"><span class="style24">
<label>
<input type="text" maxlength="8"name="pass_mem">
<span class="style14">ระบุอักขระ หรือ ตัวเลขไม่เกิน 8 ตัว </span></label>
</span></td>
</tr>
<tr>
<td align="left" class="style18">สถานะสมาชิก</td>
<td align="left" class="style12"><div align="center" class="style18">:</div></td>
<td align="left"><label><font size="2" color="#FF0000"></label>
<span class="style14">
<INPUT NAME="status_mem" TYPE="radio" value="admin">
เจ้าหน้าที่
<INPUT NAME="status_mem" TYPE="radio" value="member"checked>
สมาชิก
</label>
</span></td>
</tr><? $d_y=date(Y);
$d_m=date(m);
?>
<tr>
<td colspan="3" align="left"><INPUT NAME="d_m" TYPE="hidden" VALUE="<?= "$d_m";?>">
<INPUT NAME="d_y" TYPE="hidden" VALUE="<?= "$d_y";?>"></td>
<td align="left"><input type="submit" name="Submit" value="เพิ่มสมาชิก" onclick="Validate(form)" >
</td>
</tr>
</table>
</form>
<?
if(isset($Submit)){
include "../config.php";
$sql="INSERT INTO tb_member VALUES('','$name_mem','$cid_mem','$eid_place','$use_mem','$pass_mem','$status_mem','$d_m','$d_y')";
$result=mysql_query($sql);
if ($result) {
echo "<script language='javascript'>alert('successfully');location.href='member_man.php';</script>";
} else {
echo "<script language='javascript'>alert('NO myddarling');location.href='member_man.php';</script>";
}
}
mysql_close();
?>
<form action="member_man.php" method="post">
<table width="30%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><div align="left">
<input type="submit" name="look" value="ดูผู้ใช้ระบบ">
</div></td>
</tr>
</table>
</form>
<font size="2">
<?
if(isset($look) || ($submit)){
include "../config.php";
$sql1="select * from tb_member";
$result1=mysql_query($sql1);
$number=mysql_num_rows($result1);
if ($number<>0) {
echo "
<B>แสดงข้อมูลสมาชิก</B><br>
<TABLE BORDER='1' bordercolor='#6699FF' cellpadding='0' cellspacing='0' align='center' width='100%'>
<TR BGCOLOR='#6699FF' >
<TD><CENTER><font color=#FFFFFF><B> ลำดับ </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> ชื่อสมาชิก </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> หน่วยงาน </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> เลขรหัส </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> ชื่อล็อกอิน </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> สถานะผู้ใช้ </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> แก้ไข </B></font></CENTER></TD>
<TD><CENTER><font color=#FFFFFF><B> ลบ </B></font></CENTER></TD>
</TR>";
while($rs=mysql_fetch_array($result1)) {
$id_mem=$rs[id_mem];
$name_mem=$rs[name_mem];
$id_place=$rs[id_place];
$cid_mem=$rs[cid_mem];
$use_mem=$rs[use_mem];
$pass_mem=$rs[pass_mem];
$status_mem=$rs[status_mem];
$sql2="SELECT * FROM tb_place WHERE id_place='$id_place' ";
$result2=mysql_query($sql2);
$number2=mysql_num_rows($result2);
$record=mysql_fetch_array($result2);
$id_place=$record[id_place];
$name_place=$record[name_place];
echo "
<TR>
<TD><CENTER>$no</CENTER></TD>
<TD align=left> $name_mem </TD>
<TD align=left> $name_place </TD>
<TD align=left> $cid_mem </TD>
<TD align=left> $use_mem </TD>
<TD align=left> $status_mem </TD>
<TD><A HREF=\"member_edit_man.php?id_edit=$id_mem\"><img src=../images/button_edit.png border=0 title=รายละเอียด></A></TD>
<TD><A HREF=\"member_delete_man.php?id_del=$id_mem\"
onclick=\" return confirm('ยืนยันลบสมาชิก $name_mem ออกจากระบบ')\"><img src=../images/button_drop.png border=0 title=ยางลบ></A></TD>
</TR>";
$no++;
}
echo "</TABLE>";
mysql_close();
}
}
?>
</font></td>
</tr>
<tr>
<td valign="top"> </td>
<td width="269" height="35" align="center" valign="top"><div align="left"><a href="../mamage1/data_manage.php"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','image/back.png',1)"><img src="image/back_f2.png" name="Image1" width="32" height="32" border="0"><span class="style14"> กลับ</span></a></div></td>
<td width="321" align="center" valign="top"><div align="right"><a href="../logout.php"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','image/back.png',1)"> <img src="../images/upload_f2.png" width="32" height="32" border="">log out </a></div></td>
</tr>
</table> </td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2010-08-10 19:19:06 |
By :
geedoo |
View :
744 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองดูว่า config.php ติดต่อ server ได้หรือเปล่า
แล้วก็มีการแจ้ง error ว่ายังไงบ้างครับ
|
|
|
|
|
Date :
2010-08-10 20:23:37 |
By :
iieszz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นี่คือconfig.php ครับไม่รู้ติดตรงไหน
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<?php
error_reporting(0);
//------------???????????????????----------------
$dbhost = 'localhost'; //?????????
$dbuser = 'root'; // ???????????
$dbpass = ''; //???????
$db_name = 'loc_per'; //????????????
//-------------------------------------------------------
//---------???????????????????????????????-----
$tb_user = "user";
$tb_gen_pers ="tb_gen_pers";
$tb_family ="tb_family";
$tb_type_gen_pers ="tb_type_gen_pers";
$tb_recorder ="tb_recorder";
$tb_type_crime_pers ="tb_type_crime_pers";
$tb_crime_pers ="tb_crime_pers";
$tb_caractor ="tb_caractor";
$tb_place ="place";
$tb_place_cri ="place_cri";
$tb_type_loca_cri ="type_loca_cri";
$tb_type_loca_gen="type_loca_gen";
$tb_family_crim ="tb_family_crim";
$tb_family_cri_cro ="tb_family_cri_cro";
$tb_tumbon ="tb_tumbon";
$tb_news ="news";
$tb_offi_pers ="offi_pers";
$tb_dep="department";
$questions="questions";
$answers="answers";
$base_pol="base_pol";
$station="station";
//----------------ฐานข้อมูลคดีอาญา 5 กลุ่ม
$g1="g1_name_crim";
$g2="g2_name_crim";
$g3="g3_name_crim";
$g4="g4_name_crim";
$g5="g5_name_crim";
$g5_criminal="g5_criminal";
//-----------------------------------------------------------
$titleonweb = "::ระบบข้อมูลบุคคลและสถานที่ ตำรวจภูธรจังหวัดนครปฐม::";
$titlew = "::Web_Board::";
$date=date("Y-m-d");
$datey = date("Y");
$timeon=date("h:i:A");
$title_offi_pers="เพิ่มบุคลากรประจำงาน";
$GTH1=date("dS");
$GTH2=date("l");
$GTH3=date("F");
$GTH4=date("Y")+543;
$GETG=("$GTH1 $GYH2 $GTH3 $GTH4");
//--------???????????????????????????------------------------
$conn = mysql_connect ($dbhost, $dbuser, $dbpass);
/*if(!$conn)
echo "Connect Error<br>";
else
echo "Connect OK<br>";*/
//------------------------------------------------------------------
//-------???????????????????????---------------------
$select_db=mysql_select_db($db_name);
/*if(!$select_db)
echo "Select Error<br>";
else
echo "Select OK<br>";*/
mysql_query( "SET NAMES tis620", $conn );
//---------------------------------------------------------
$timeformat="j/m/y-h:i";
$THdt=mktime(gmdate("H")+7,gmdate("i")+4,gmdate("s"),gmdate("m"),gmdate("d"),gmdate("y")); //ค่าวันเวลาสำหรับไทย
$bkk= mktime(gmdate("H")+7,gmdate("i")+0,gmdate("s"),
gmdate("m") ,gmdate("d"),gmdate("Y"));
$datetimeformat="j/m/y - H:i";
$now = date($datetimeformat,$bkk) ;
error_reporting(E_ALL ^ E_NOTICE); //ตั้งค่ารายงานความผิดพลาด
// ????????????????????????????????????? (????????????? ??? 1024 x 50 == 51200 ???? 50 Kb)
$config[imgSize_limit] = 51200;
$config[imgWidth] = 600; //????????????????? ????????????????????...
// ??????????????????????????
$config[fileSize_limit] = 102400;
$IP = getenv("REMOTE_ADDR");
$IP = "(".substr($IP,0,strrpos($IP,".")).".*)";
//????? IP Address ??????????????????????
if ($_SERVER["HTTP_X_FORWARDED_FOR"]) {
$IP = $_SERVER["HTTP_X_FORWARDED_FOR"];
} else {
$IP = $_SERVER["REMOTE_ADDR"];
}
$pagelen = 20;
$page = $_REQUEST['page'];
if (empty($page)) { $page=1; }
//????????????????????
//??????????????????????????????????????????????????????????
$parth = "c:/appserv/www/nnpt/images_gen";
$parths = "c:/appserv/www/nnpt/images_crime";
$parthss = "c:/appserv/www/nnpt/local/images_loca_gen";
$parthes = "c:/appserv/www/nnpt/local/images_loca_cri";
$p_parthes = "c:/appserv/www/nnpt/picpost";
$op_parthes = "c:/appserv/www/nnpt/pic_offic_pers";
if($birth_month == "01" || $birth_month == "1")
{
$month = "January";
}
if($birth_month == "02" || $birth_month == "2")
{
$month = "February";
}
if($birth_month == "03" || $birth_month == "3")
{
$month = "March";
}
if($birth_month == "04" || $birth_month == "4")
{
$month = "April";
}
if($birth_month == "05" || $birth_month == "5")
{
$month = "May";
}
if($birth_month == "06" || $birth_month == "6")
{
$month = "June";
}
if($birth_month == "07" || $birth_month == "7")
{
$month = "July";
}
if($birth_month == "08" || $birth_month == "8")
{
$month = "August";
}
if($birth_month == "09" || $birth_month == "9")
{
$month = "September";
}
if($birth_month == "10" || $birth_month == "10")
{
$month = "October";
}
if($birth_month == "11" || $birth_month == "11")
{
$month = "November";
}
if($birth_month == "12" || $birth_month == "12")
{
$month = "December";
}
?>
|
|
|
|
|
Date :
2010-08-11 07:24:45 |
By :
geedoo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|