Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > เวลา กด search ค้าหาข้อมูล แล้วใช้งาน jquery.fancybox-1.3.4.pack.js ไม่ได้ครับ



 

เวลา กด search ค้าหาข้อมูล แล้วใช้งาน jquery.fancybox-1.3.4.pack.js ไม่ได้ครับ

 



Topic : 117993



โพสกระทู้ ( 39 )
บทความ ( 0 )



สถานะออฟไลน์




หน้าปกติครับ ตอนยังไม่ได้กด ปุ่ม search

1

เมื่อ กดลบข้อมูล ที่รูปถังขยะ จะมี popup ให้ลบข้อมูล ยังเป็นปกตินะครับ

11

หน้าโชวข้อมูลครับ

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>

<style type="text/css">

      <!--
         @import url("news_all_css.css");
      -->

}
</style>
	
	<script type="text/javascript" src="jquery/lib/jquery-1.8.3.js"></script>
	<script type="text/javascript" src="jquery/lib/jquery.mousewheel.js"></script>
	<script type="text/javascript" src="jquery/lib/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

     
	<link rel="stylesheet" type="text/css" href="jquery/lib/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
 	

	<script type="text/javascript">
	
		// delete functions
		jQuery(document).ready(function() {
			jQuery('a[id^="delete_data"]').fancybox({
				'width'				: '30%',
				'height'			: '30%',
				'autoScale'     	: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				onClosed	:	function() {
					parent.location.reload(true); 
				}
			});

		});
		
		// seacrh function
		 jQuery(function () {
		 	jQuery("#btnSearch").click(function () {
				if($.trim($("#itemname").val())!=""){    
						jQuery.ajax({
							 url: "search.php",
							 type: "post",
							 data: {itemname: jQuery("#itemname").val()
						},
					 beforeSend: function () {
						jQuery(".loading").show();
					 },
					 complete: function () {
					 jQuery("#setserch").hide();
					 },
					 success: function (data) {
					 jQuery("#list_data").html(data);
					 }
				 });
				}
		 });
		 $("#searchform").on("keyup keypress",function(e){
		 var code = e.keycode || e.which;
		 	if(code==13){
				$("#btnSearch").click();
				return false;
		 	}
		 });
		 });
	</script>
    
    
<?php
	session_start();
	require_once("connect.php");

			//*** Update Last Stay in Login System
			$sql = "UPDATE member SET last_update = NOW() WHERE mem_id = '".$_SESSION["mem_id"]."' ";
			$query = mysqli_query($con,$sql);
			

			$strSQL = "SELECT * FROM post_home LEFT JOIN member ON member.mem_id= post_home.mem_id order by post_home.posth_id DESC ";
			$objQuery = mysqli_query($con,$strSQL);
			
			
			
		if(!isset($_SESSION['mem_id'])){
			echo "Please Login!";
			header("location:login.php");
			//exit();
		}
		
	
			
?>



</head>

<body id="set_background">
<form class="form-inline" name="searchform" id="searchform">
<div id="all">
    <div id="header"></div>
    <div style="text-align:right;"> <a href="logout.php">Log-out</a> </div>
    <div id="navigation">
        <div id="bar1"><a href='homepage.php' id="inline_bar">Home Page</a></div>
        <div id="bar1"><a href='homepage.php' id="inline_bar">Meeting</a></div>
        <div id="bar1"><a href='homepage.php' id="inline_bar">Balanced scorecard</a></div>
        <div id="bar1"><a href='homepage.php' id="inline_bar">Webboard</a></div>
    </div>
    <div style="text-align:right;">
    	<input type="text" name="itemname" id="itemname" class="form-control" placeholder="Search a title" autocomplete="off">
        <button type="button" class="btn btn-primary" id="btnSearch">Search</button>
    </div>
    
    <div id="content"> 
        <div id="right">
        <div id="inform_news">
        <div id="setserch">

		<?php
        $i=0;
        while($objResult = mysqli_fetch_assoc($objQuery)){ 
        $i++;
        ?>
	
            <div id="blog_news">
            
            <div id="icon_image">
                   <img src="icons/news2.ico" style="width:100px;height:100px"></div>
            <div id="icon_bin_edit" >   
                  
             <?php 
             
                if($_SESSION["mem_id"] == $objResult["mem_id"]){   
                
             ?>                
                    
                    <p id="icon" class="display_icon" >
                    <a  href="edit_news_form.php?post_id=<?php echo $objResult["posth_id"];?>">
                        <img src="icons/edit2.ico" title="Edit" style="width:25px;height:25px"></a>
                          
                    <a id="delete_data<?php echo $i;?>" href="delete_form.php?post_id=<?php echo $objResult["posth_id"];?>">
                    <img src="icons/delete2.ico" title="Delete" style="width:25px;height:25px"></a>
                    </p>    
                   
              <?php 
                 }
               ?>
            </div>  
                    <div id="show_sql" class="show_sql">
                        <a href="news.php?new_id=<?php echo $objResult["posth_id"];?>" 
                        id="set_text_sql"><?php echo $objResult["posth_title"];?></a> [ <?php  echo $objResult["posth_created"];?> ]                
                        POST BY :<?php  echo $objResult['mem_name'];?> <?php  echo $objResult['mem_lastname'];?>
                    </div>
            
            </div>
        <?php
        
        }
        ?>  
        </div>
            <div id="loading"></div>	
            <div id="list_data"></div>
    </div>
     
    <div id="footer"> this is a footer
	</div>   

</form>
</body>
</html>




ส่งมายังหน้า search.php
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>

<style type="text/css">

      <!--
         @import url("news_all_css.css");
      -->

}
</style>

	<script type="text/javascript" src="jquery/lib/jquery.mousewheel.js"></script>

    
	<script type="text/javascript">
	jQuery.noConflict();
		// delete functions
		jQuery(document).ready(function() {
			jQuery('a[id^="delete_data"]').fancybox({
				'width'				: '30%',
				'height'			: '30%',
				'autoScale'     	: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				onClosed	:	function() {
					parent.location.reload(true); 
				}
			});
		});

	</script>
    <script type="text/javascript" src="jquery/lib/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
    <script type="text/javascript" src="jquery/lib/jquery-1.8.3.js"></script>
<?php
	session_start();
	require_once("connect.php");

		$recieve_search =$_POST['itemname'];
		
		$sql = "SELECT * FROM post_home LEFT JOIN member ON member.mem_id= post_home.mem_id where post_home.posth_title like '%$recieve_search%' order by post_home.posth_id DESC ";
		//$sql = "select * from post_home where posth_title like '%$recieve_search%'";			

		$objQuery = mysqli_query($con,$sql);
		
        
			
			
		if(!isset($_SESSION['mem_id'])){
			echo "Please Login!";
			header("location:login.php");
			//exit();
		}
		
	
			
?>



</head>

<body >
	<?php if(mysqli_num_rows($objQuery)==0){ ?>
		
    <div style="text-align:center; margin-top:60px; margin-bottom:200px;">
    	
		<?php     
			echo "<center>Sorry, We couldn't find anything for (".$recieve_search."). Try entering a title again.</center>";
		?>	 
		
    </div>
   <?php } ?>

    <div > 

		<?php
        $i=0;
        while($objResult = mysqli_fetch_assoc($objQuery)){ 
				$member_name = $objResult["mem_name"];
		
        $i++;
        ?>
	
            <div id="blog_news">
            
            <div id="icon_image">
                   <img src="icons/news2.ico" style="width:100px;height:100px"></div>
            <div id="icon_bin_edit" >   
                  
             <?php 
             
                if($_SESSION["mem_id"] == $objResult["mem_id"]){   
                
             ?>                
                    
                    <p id="icon" class="display_icon" >
                    <a  href="edit_news_form.php?post_id=<?php echo $objResult["posth_id"];?>">
                        <img src="icons/edit2.ico" title="Edit" style="width:25px;height:25px"></a>
                          
                    <a id="delete_data<?php echo $i;?>" href="delete_form.php?post_id=<?php echo $objResult["posth_id"];?>">
                    <img src="icons/delete2.ico" title="Delete" style="width:25px;height:25px"></a>
                    </p>    
                   
              <?php 
                 }
               ?>
            </div>  
                    <div id="show_sql" class="show_sql">
                        <a href="news.php?new_id=<?php echo $objResult["posth_id"];?>" 
                        id="set_text_sql"><?php echo $objResult["posth_title"];?></a> [ <?php  echo $objResult["posth_created"];?> ]                
                        POST BY :<?php  echo $objResult['mem_name'];?> <?php  echo $objResult['mem_lastname'];?>
                    </div>
            
            </div>
        <?php
        
        }
        ?>  
	</div>


</body>
</html>




หน้าที่เป็น form pupup ว่าแน่ใจที่จะลบข้อมูลหรือไม่

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>

<style type="text/css">

      <!--
         @import url("news_all_css.css");
      -->

}
</style>

</head>
<script type="text/javascript">

 	function cancel_fancybox(){
		try{
        parent.jQuery.fancybox.close();
    }catch(err){
        parent.$('#fancybox-overlay').hide();
        parent.$('#fancybox-wrap').hide();
    }
	
}
	
	
	
	

</script>


<body>
<?php 

	$recieve_post_id = $_GET['post_id'];	

?>

<form  method="post" action="delete_new_post.php?post_id=<?php echo $recieve_post_id?>"  enctype="multipart/form-data">

        <div class="header">
        
            <h3>Are you sure to delete news post?</h3>
            
        </div>
       
          	<div > 
           			 <input type="button" OnClick="cancel_fancybox()"  value="Cancel" />
					<input class="Delete" id="Delete" type="submit" value="Delete News">
          	</div>
   
       </div>

    </form>


</body>
</html>


เวลาผมค้นหาข้อมูล เช่น the

ff

แล้วมันจะโชว์ ที่มีคำว่า the ถ้าผม กดลบข้อมูล ที่เป็นรูปถังขยะ มันกลับส่งค่าไปอีกหน้า โดยไม่มี popup โชว์หน้าเดิม

dsd

ผมไม่รู้จะแก้ตรงไหนครับ ไม่รู้ว่าผิดตรงไหนครับ ใครรู้ช่วยบอกหน่อยครับ



Tag : PHP









ประวัติการแก้ไข
2015-07-24 06:02:04
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-07-24 05:59:05 By : adiphong1 View : 1395 Reply : 1
 

 

No. 1



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

ใน search.php
Code (PHP)
<script type="text/javascript" src="jquery/lib/jquery-1.8.3.js"></script>  // ต้องมาก่อนเพื่อน
<script type="text/javascript" src="jquery/lib/jquery.mousewheel.js"></script>
<script type="text/javascript" src="jquery/lib/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="jquery/lib/fancybox/jquery.fancybox-1.3.4.css" media="screen" />







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-06-04 22:19:36 By : PhrayaDev
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : เวลา กด search ค้าหาข้อมูล แล้วใช้งาน jquery.fancybox-1.3.4.pack.js ไม่ได้ครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่