Jump to content

Search the Community

Showing results for tags 'jquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. I'm trying to use ajax to show upload progress bar. I downloaded a plugin and created a single php file and it works fine. However it doesn't work if the code is being included by another php file. Does anybody have an idea what the problem might be? Thanks.
  2. It may be my lack of ability to think straight because I have a cold and couldn't sleep but this makes no sense to me. I got an up/down voting script from here: http://www.9lessons.info/2009/08/vote-with-jquery-ajax-and-php.html I wanted to integrate it into a project that allows logged in users to vote. Each user gets one vote (up or down) per item being voted on but can change their vote. To do so I keep a table with user_id, item_id, up_vote (bool), and down_vote( bool). If a voter votes the yes or no that they voted for is incremented. If they later change their vote, the prior vote counter (up or down) is decremented and the new vote is incremented. A new vote that duplicates the users existing vote is ignored. Here's the client side code: $(function() { $(".vote").click(function() { var id = $(this).attr("id"); var name = $(this).attr("name"); var dataString = 'id='+ id ; var parent = $(this); if(name=='up') { $(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">'); $.ajax({ type: "POST", url: "updown/up_vote.php", data: dataString, cache: false, success: function(html) { parent.html(html); } }); } else { $(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">'); $.ajax({ type: "POST", url: "updown/down_vote.php", data: dataString, cache: false, success: function(html) { parent.html(html); } }); } return false; }); }); </script> I got that all to work, but the code that returns the up or down vote counter only returns the counter for the current vote (up or down) so I needed change the code server side to return two values in case the opposite vote was decremented and the client side code to display both. I changed the server side so that I get back data as json - for example now in my working Up_vote script I get: {"upvalue":"13","downvalue":"38"} instead of just a 13. So, now comes the hard part. I want to display 13 in the up box and 38 in the down box. I go to look at how to get the equivalent down box my up box and find that both boxes have the same id="1" (which is not legal) so I can't use getElementbyID one has name="up", the other name="down", but I can't use that because I have ids 2, 3, 4,... each with its own up and down. Both have the same class "vote". So, I decide to fix the non-unique IDs so I make the IDs 1 into 1-up and 1-down. Now, I need to trim the -up off before my AJAX call to up_vote and have my script know that 1-down is where it needs to put the down value. So I try this: $(function() { $(".vote").click(function() { var id = $(this).attr("id"); var name = $(this).attr("name"); var parent = $(this); if(name=='up') { var idtrim = id.replace('-up',''); var dataString = 'id='+ idtrim ; var oppid = idtrim + '-down'; var opposite = getElementbyid(oppid); $(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">'); $.ajax({ type: "POST", url: "updown/up_vote.php", data: dataString, cache: false, success: function(html) { parent.html(html); // opposite.html(html.down_votes) } }); alert (html); } else { var idtrim = id.replace('-down',''); var dataString = 'id='+ idtrim ; $(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">'); $.ajax({ type: "POST", url: "updown/down_vote.php", data: dataString, cache: false, success: function(html) { parent.html(html); } }); } return false; }); }); and I get nothing back. The alert (html) never shows. using alerts to debug dataString is: "id=1" oppid is: "1-down" I updated from jquery 1.2.6 to 1.8.1. I can run the server side script directly and it works. If I change the last lines of the server side code to just echo WOW it works in the first javascript but not the second. What obvious stupidity am I missing?
  3. Hello, I am will create now a button that will merge and split table cells. This is my code on generating tables <?php $out = "<table id='sheet' class='excel' cellspacing='0'><thead><tr>"; $out .= "<th></th>"; for ($i='a',$x=0; $x<26; $x++,$i++){ $out .= "<th>".strtoupper($i)."</th>"; } $out .= "</thead><tbody class='row-data'>"; for($a=1;$a<=50;$a++){ $out .= "<tr>"; $out .= "<th>$a</th>"; for ($i='a',$x=0; $x<26; $x++,$i++){ $out .= "<td id=".strtoupper($i).$a."></td>"; } $out .= "</tr>"; } $out .= "</tbody>"; $out .= "</table>"; echo $out; ?> Can anyone give me an Idea how will I going to start on that or some functions that I needed. I'm just a starter on jquery.
  4. I've got this use this ajax and json to pass the value of a table to server side PHP: $.ajax({ type: "POST", url: "json1.php", dataType: 'html', data: { json_1 : JSON.stringify(newArray), json_2 : JSON.stringify(newArray1) ,'key' : fileKey}, success: function(response){ $('#output').html(response); } }); on the server side I have no problem, but returning the value I've got this error Catchable fatal error: Object of class PHPExcel_Writer_Excel2007 could not be converted to string from blah blah blah I can't figure out what is the problem. Maybe its the JSON cause its converting the html element to JSON, but I already decode it on the server side $jsonData1 = json_decode($jsonData_1); $jsonData2 = json_decode($jsonData_2);
  5. <input type='submit' class='set' id='set' value='Set'/> <input type='text' class='mytext' id='mytext' style='font-style:italic'/> $('#set').click(function(){ $(cellId).css('font-weight','bold'); }); What I want to happen is when I click a button it make the text bold and if the text is already bold when I clicked it again it will remove the font-weight style attribute only. Using jquery. .
  6. Can anyone give me an idea on how I will count the table column and table row and get the id, attribute and the content of a each cell (the cell is contenteditable). What tools i have to use. e.g. <table id='sheet'> <tbody> <tr> <td id='1A' rowspan=2>Rowspan 2</td> <td id='1B'>22222</td> <td id='1C'>33333</td> </tr> <tr> <td id='2B' colspan='2'> Colspan2</td> </tr> <tr> <td id='3A' style='color:red'>Whaterver</td> <td id='3B' style='font-weight:bold'>Askyourmother</td> <td id='3C'>sigh</td> </tr> </tbody> </table> I'm using PHP and Jquery(Javascript). Thanks. .
  7. mainpage.php, loginModal.php, signInvalidate.php I have a page has a button that when click a modal dialog box pop up, the content of the modal is from other page(loginModal.php) using jquery .load, so the content now of the modal is a login form which validates using jquery ajax that send information to signInvalidate.php. I have no problem on validation it still return error if it is error, but if it is correct information I want to reload the main page. How will I do that? or does Jquery .load accepting return TRUE value. e.g. signInvalidate.php $result = $userFunction->checkLogin($useremail, @$password, @$remember, $gotUrl); if($result == TRUE){ return TRUE; } loginModal.php success: function(msg){ if(msg == TRUE){ return true; }else{ $("#signInOutput").html(msg); } } mainpage.php $('#previewOutput').load('modalLogin.php', function(){ });
  8. I've got a modal dialog that pop up then load and show the loader image then after a seconds it will hide and preview the "modalLogin" page. $(href).fadeIn(100, function(){ $('#loadingImage').show(1,function(){ setTimeout( function(){ $('#loadingImage').hide(1, function(){ if(thisId == 'loginModal' ){ $('#previewOutput').load('modalLogin.php'); //alert("Login"); } } ); },500); }); }); At first loading the main page and clicking the button for modal dialog to pop up it is fine, but when I close the modal dialog and click the button for modal again, the loading is mess up! So can anyone explain to me what is wrong? Here's link : [LINK]
  9. im designing a online coupon site,,, there are several products displaying in my home page, when you click on each product, there is a coupon image displaying, but All that i want is, i want the users select the products they like. and there is a seperate print button. so i wanted the users to print the coupon of multiple selected products at once when click on the print button... for exaample, simillar as this website: visit http://www.coupons.com/
  10. I'm not sure if this is the right place for this, but since php is sort of the hub I figure this might work. I'm struggling with finding the right way to snag a variable from a javascript prompt and pass that through to the server for a mysql query. I'm relatively new to all of this, so any help (even the obvious stuff) would be greatly appreciated. Here's my situation... I'm using a scheduling plugin on Wordpress that allows users to schedule an appointment with a service provider. Unfortunately, these appointments are for a set duration (e.g. 30 minutes). I'd like to allow the user to select their start time and then set their own duration. The plugin uses jQuery to display a calendar in table format and the user can click on a date/time that works for them. Then a new <div> appears on the page to confirm the appointment. I would basically like to insert a javascript prompt when the user clicks on their starting time that asks for the duration in hours. I need to pass this value back to the server (using jQuery or Ajax I'm guessing?) so I can send a query to the database and check if this time conflicts with other appointments, then continue with the confirmation <div>. I've spent probably 2 or 3 hours searching Google and I'm simply not finding a way to do this. Seems like it should be straightforward, but the answer is eluding me.
  11. Hey guys why do i keep getting a problem with a redirect loop... i dont know why and i just get: http://www.powerwashers.co.uk/temp/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/index.php Its mainly when i click that google link although its just been happening on most things i do... also it doesnt display in firefox :/... Can anyone help me please?. http://www.powerwashers.co.uk/temp/main/expo.php <!DOCTYPE html> <head> <title>Brendon Powerwashers - News & Exhibitions</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="language" content="en"/> <meta name="robots" content="index, follow"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="stylesheet/style1.css" type="text/css"/> <link rel="stylesheet" href="stylesheet/style6.css" type="text/css"/> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/navigation_hide_show.js"></script> <script type="text/javascript" src="js/hover_script.js"></script> <script type="text/javascript" src="js/fader.js"></script> <script type="text/javascript" src="js/bg_fade.js"></script> <script type="text/javascript" src="js/jquery_script01.js"></script> <script type="text/javascript" src="js/app_fader.js"></script> <script type="text/javascript" src="js/navigation_dropdown.js"></script> </head> <body style='display:none;' class='body'> <div id="header"> <?php include('content/navigation2.php'); ?> </div> <div id="page_wrapper"> <div id="page"> <?php include('content/acc_navigation.php'); ?> <div id="fp_top2" style='margin-bottom:-3px;'> <div id="fp_nav"> <ul> <a href="#" id="fade1_link"><li>Exhibitions</li></a> <a href="#" id="fade2_link"><li>Latest News</li></a> <a><li> </li></a><!--id="fade3_link"--> <a><li> </li></a><!--id="fade4_link"--> <a><li> </li></a><!--id="fade5_link"--> <a><li> </li></a><!--id="fade6_link"--> <a><li> </li></a><!--id="fade7_link"--> </ul> </div> <div id="fader_img2"> <img id='fade1' class="fader_images" src="images/exhibition_banner.jpg" alt="Fader"/> <img id='fade2' class="fader_images" src="images/about_fader.jpg" alt="Fader"/> <img id='fade3' class="fader_images" src="images/fader/1_3.jpg" alt="Fader"/> <img id='fade4' class="fader_images" src="images/fader/1_4.jpg" alt="Fader"/> <img id='fade5' class="fader_images" src="images/fader/1_5.jpg" alt="Fader"/> <img id='fade6' class="fader_images" src="images/fader/1_6.jpg" alt="Fader"/> <img id='fade7' class="fader_images" src="images/fader/1_7.jpg" alt="Fader"/> </div> </div> <div> <div id="sheet2_1" class="fader_sheets"> <div class="white_bg"> <h1 style=" text-align:center; font-size:26px">Exhibitions</h1><br/> <?php $expire = date('Ymd'); $select_query8 = mysql_query("SELECT * FROM expos ORDER BY expire"); while($select_query_row8 = mysql_fetch_array($select_query8)){ if($select_query_row8['expire'] > $expire) { echo ' <div style="width:200px; height:300px; border:1px solid #000; float:left; margin-top:10px; margin-left:5px; margin-right:5px; margin-bottom:10px; padding:5px;"> <div style="width:300px; margin:0px auto;"><img src="images/logos/'.$select_query_row8['image_url'].'" alt="Show Logo"/></div> <h1 style="text-align:center;">'.$select_query_row8['header'].'</h1><h1 style="text-align:center; font-size:14px; margin-top:4px">('.$select_query_row8['start_day'].'/'. $select_query_row8['start_month'].'/'.$select_query_row8['start_year']. ' - '.$select_query_row8['end_day'].'/'. $select_query_row8['end_month'].'/'.$select_query_row8['end_year'].')</h1><br/>'; echo '<p style="text-align:center">'.$select_query_row8['content'].'<br/><a href="www.google.com" class="expo1" >www.google.com</a></p> </div> '; } } ?> </div> </div> <div id="sheet2_2" class="fader_sheets"> <div class="white_bg"> <h1 style=" text-align:center; font-size:26px">Latest News</h1> <p>Coming Soon...</p> </div> </div> <div id="sheet2_3" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_4" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_5" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_6" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_7" class="fader_sheets"> <div class="white_bg"> </div> </div> </div> </div> </div> <div id="background"></div> </body> </html>
  12. I have been stuck on this for 3 days... I would love the experts to shoot me some words of advice, appreciate it. I have a form I create from a while loop in php. I can submit it if I name the form and place that in the AJAX but it just uploads the last record in the table not the one I actually click. I know I need a unique ID from the form, which I have but I can get it in the AJAX ;( I have used $(this).attr("id") , $(this).form("id") etc and nothing gets it in.. Any advice would be great MY PHP Loop while($row = mysql_fetch_array($pendingresult)) { $id = "myForm".$row['reg_id']; echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" >'; print "<form id=\"$id\" name=\"CDs\" method=\"post\" >"; echo '<tr class="commentContainer" style="color:#FFF">'; echo"<td><input type=\"text\" name=\"team_name\" value=\"$row[team_name]\"</td>"; echo"<td><input type=\"text\" name=\"reg_id\" value=\"$id\"</td>"; echo"<td><input type=\"text\" name=\"team_level\" value=\"$row[team_level]\"</td>"; echo"<td><input type=\"text\" name=\"notes\" value=\"$row[comments]\"</td>"; echo"<td>"; echo "<td class=\"delete\" align=\"center\" id=".$row['reg_id']." width=\"10\"><a href=\"#\" id=\"$row[reg_id]\"><img src=\"admin/images/delete.png\" border=\"0\" ></a></td>"; echo "<td class=\"approve\" align=\"center\" id=".$id." width=\"10\"><a href=\"#\" ><img src=\"admin/images/approve.png\" border=\"0\" ></a></td>"; echo "</td>"; echo"</tr>"; echo "</form>"; echo ' </table>'; } My AJAX <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { <!--$('#load').hide();--> }); $(function() { $(".approve").click(function() { var commentContainer = $(this).parent('tr:first'); var id = $(this).attr("id"); var string = 'id='+ id; var formData = $(this).attr("id") $.ajax({ type: "POST", url: "approve.php", data: $(formData).serialize(), cache: false, success: function(){ commentContainer.slideUp('slow', function() {$(this).remove();}); } }); return false; }); }); </script>
  13. I'm using a spry dataset to view data off an .xml file for an online store. There's your basic stuff, picture link, headline, price, description, item number etc. The description set can vary as descriptions do with different items I'd like to only show the first few lines (140 characters or something) of the description upon load and then allow the visitor to toggle open the rest of the description. Is there a way to do that? Here is the code I'm currently using, just your basic dreamweaver insert. <div spry:region="catalog" class="SpotlightAndStacked"> <div spry:repeat="catalog" class="SpotlightAndStackedRow"> <div class="SpotlightContainer"> <div class="SpotlightColumn"><a href="_images/catalog/Art/{Picture_File}" title=" {Headline}"><img src="_images/catalog/thumbs/Art/{Thumbnail}"></a></div> </div> <div class="StackedContainer"> <div class="StackedColumn"> {Item_Last_Name}, {Item_First_Name}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> {Headline}</div> <div class="StackedColumn"> {Complete_Description}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> <strong>Retail price: {Retail_Price}</strong></div> </div> <br style="clear:both; line-height: 0px" /> </div> </div> my friend gave me this code but doesn't seem to work: <div spry:region="catalog" class="SpotlightAndStacked"> <div spry:repeat="catalog" class="SpotlightAndStackedRow"> <div class="SpotlightContainer"> <div class="SpotlightColumn"><a href="_images/catalog/Art/{Picture_File}" title=" {Headline}"><img src="_images/catalog/thumbs/Art/{Thumbnail}"></a></div> </div> <div class="StackedContainer"> <a href="#">Show Description</a> <div class="StackedInner" style="display:none"> <div class="StackedColumn"> {Item_Last_Name}, {Item_First_Name}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> {Headline}</div> <div class="StackedColumn"> {Complete_Description}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> <strong>Retail price: {Retail_Price}</strong> </div> </div> </div> <br style="clear:both; line-height: 0px" /> </div> </div> Jquery $(document).ready(function(){ $('.StackedContainer a').on('click',function(event){ event.preventDefault(); // prevent the link from any action var thisBtn = $(this); // cache thisBtn.parent().find('.StackedInner').toggle(); // toggle the description }); // close on click })
  14. Hi All, I want to ask you about my calendar appointment. The problem in my calendar is when user A insert new agenda, user B must refresh it manually for can see the changes. I've used an auto div refresh which is refresh page automatically but it still didn't work. The problem is in my calendar have a nex and previous button to see the other months. When I'm access my calendar for first time, it works fine (user B don't need refresh it manually). But when I click the previous next button, user B must refresh it manually again. Can you show me where can I fix my code ? Here's the calendar file before spiltted into two parts. <?php include "connection.php"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Agenda</title> </head> <body> <?php $monthNames = Array("January","February","March","April","May","June","July","August","September","October","November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0 ) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13 ) { $next_month = 1; $next_year = $cYear + 1; } ?> <table width="200"> <tr align="center"> <td bgcolor="#999999" style="color:#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="left"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prev_month . "&year=" . $prev_year; ?>" style="color:#FFFFFF">Previous</a></td> <td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $next_month . "&year=" . $next_year; ?>" style="color:#FFFFFF">Next</a></td> </tr> </table> </td> </tr> </table> <tr> <td align="center"> <table width="100%" border="1" cellpadding="2" cellspacing="2"> <tr align="center"> <td colspan="7" bgcolor="#999999" style="color:#FFFFFF"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td> </tr> <tr> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>W</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>F</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> </tr> <?php $timestamp = mktime(0,0,0,$cMonth,1,$cYear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; for ($i=0; $i<($maxday+$startday); $i++) { //echo "<a href=2.php>".$i."</a><br>"; if(($i % 7) == 0 ) { echo ""; } if($i < $startday) { echo "<td></td>\n"; }else { $sql = "select * from agenda where date='".($i - $startday + 1).'-'.$cMonth.'-'.$cYear."'"; $hs = mysql_query($sql); $jmlAcara = mysql_num_rows($hs); echo "<td align='center' valign='middle' height='20px'".($jmlAcara > 0 ? " bgcolor='yellow'" : '').">"; echo "<a href=2.php?tgl=".urlencode($i - $startday + 1)."&month=".urlencode($monthNames[$cMonth-1])." onclick=\"window.open(this.href,'window','width=640,height=480,resizable,scrollbars,toolbar,menubar') ;return false;\">".($i - $startday + 1)."</a><br>"; echo "</td>\n"; } if(($i % 7) == 6 ) { echo "</tr>\n"; } } ?> The I split up the file into two parts.The first is index.php who will refresh the user.php file every 1000ms. <?php include "connection.php"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Agenda</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $.ajaxSetup( { cache: false }); // This part addresses an IE bug. without it, IE will only load the first number and will never setInterval(function() { $('#result').load('user.php'); }, 1000); // the "3000" here refers to the time to refresh the div. it is in milliseconds. }); </script> </head> <body> <?php $monthNames = Array("January","February","March","April","May","June","July","August","September","October","November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13) { $next_month = 1; $next_year = $cYear + 1; } ?> <table width="200"> <tr align="center"> <td bgcolor="#999999" style="color:#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="left"><a href="<?php echo "cal.php?month=". $prev_month . "&year=" . $prev_year; ?>" style="color:#FFFFFF">Previous</a></td> <td width="50%" align="right"><a href="<?php echo "cal.php?month=". $next_month . "&year=" . $next_year; ?>" style="color:#FFFFFF">Next</a></td> </tr> </table> </td> </tr> </table> <tr> <div id="result"> The second file is user.php which contains the calendar. <?php include "connection.php"; $monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $month=$_GET["month"]; $year=$_GET["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13) { $next_month = 1; $next_year = $cYear + 1; } //$m=$_GET["month"]; //$y=$_GET["year"]; ?> <table width="100%" border="1" cellpadding="2" cellspacing="2"> <tr align="center"> <td colspan="7" bgcolor="#999999" style="color:#FFFFFF"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td> </tr> <tr> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>W</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>F</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> </tr> <?php $timestamp = mktime(0,0,0,$cMonth,1,$cYear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; for ($i=0; $i<($maxday+$startday); $i++) { //echo "($maxday+$startday)"; //echo "<a href=2.php>".$i."</a><br>"; if(($i % 7) == 0 ) { echo ""; } if($i < $startday) { echo "<td></td>\n"; }else { $sql = "select * from agenda where date='".($i - $startday + 1).'-'.$cMonth.'-'.$cYear."'"; $hs = mysql_query($sql); $jmlAcara = mysql_num_rows($hs); echo "<td align='center' valign='middle' height='20px'".($jmlAcara > 0 ? " bgcolor='yellow'" : '').">"; echo "<a href=2.php?tgl=".urlencode($i - $startday + 1)."&month=".urlencode($monthNames[$cMonth-1])." onclick=\"window.open(this.href,'window','width=640,height=480,resizable,scrollbars,toolbar,menubar') ;return false;\">".($i - $startday + 1)."</a><br>"; echo "</td>\n"; //echo "$cMonth"; } if(($i % 7) == 6 ) { echo "</tr>\n"; } } ?> Thank you.. Regards, Ikram
  15. Hello, I have founde this tutorial: http://www.hdeya.com/blog/2009/05/sorting-items-on-the-fly-ajax-using-jquery-ui-sortable-php-mysql/comment-page-1/#comment-865 I tried to do it, but I can't get the setup of my database to work as you can see here: http://www.danieldoktor.dk/jQuery%20UI%20Sortable%2C%20PHP%20%26%20MySQL/menu_list.php My domain is hosted by www.one.com, so I know it is possible, and I have installed wordpress on my server too. Can someone help Daniel
  16. I have inserted a jquery in my html page but it is not fading out <!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"> <link href="programmers.css" rel="stylesheet" type="text/css" /> <?php include('conn.php'); include('header.php'); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>User Allotment</title> <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $("#detail").hide(); $("#view").click(function() { $("#form").fadeout(); $("#detail").fadeIn(); }); }); </script> </head> <body> <form id="form1" name="form1" method="post" action="" id="form"> <table align="center" width="100%" id="form"> <tr> <td height="25" width="100%" bgcolor="#CCCCCC" align="center"><a href="user_allotment.php">User Allotment</a> <a href="view_users.php">View Users</a> <a href="">Pending Aprovals</a> <a href="freelancers_pending.php">Freelancer Pending</a> <a href="search.php">Search</a> <a href="admin_login.htm">Logout</a></td> </tr> <tr> <td><br/> <table width="1019" border="1" align="center" bgcolor="#FFFFFF"> <tr> <td colspan="13" align="center"><strong>PENDING APPROVALS</strong></td> </tr> <tr align="center"> <td width="60" align="center" >Id</td> <td width="60" align="center">First Name</td> <td width="60" align="center">Last Name</td> <td width="65" align="center">Company</td> <td width="50" align="center">Phone</td> <td width="40" align="center">Ext</td> <td width="50" align="center">E-mail</td> <td width="70" align="center">Skill required</td> <td width="75" align="center">Experience</td> <td width="70" align="center">Duration of hire</td> <td width="70" align="center">Location of hire</td> <td width="110" align="center">Brief project description</td> <td width="60" align="center">view</td> </tr> <?php mysql_select_db("programmers") or die(mysql_error()); $data = mysql_query("SELECT * FROM hire") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { ?> <tr> <td><?php echo $info['id'];?></td> <td><?php echo $info['fname'];?></td> <td><?php echo $info['lname'];?></td> <td><?php echo $info['cname'];?></td> <td><?php echo $info['cnum'];?></td> <td><?php echo $info['enum'];?></td> <td><?php echo $info['email'];?></td> <?php $id=$info['id']; $fetch=mysql_query("SELECT sname FROM skill WHERE id=$id"); while($row=mysql_fetch_array($fetch)) { $sname=$row['sname']; $sk[]=$sname; } $arr=implode(',',$sk); ?> <td><?php echo $arr;?></td> <td><?php echo $info['exnum'];?></td> <td><?php echo $info['dnum'];?></td> <td><?php echo $info['lhname'];?></td> <td><?php echo $info['task'];?></td> <td><label><input type="button" class="view" id="view" value="view"/></label></td> </tr> <?php } ?> </table> </td> </tr> </table> </form> </body> </html> <?php include('footer.php'); ?>
  17. I have a sidebar on a page, this will contain facebook and twitter feeds, however if I put jquery tabs on the page outside of the sidebar, the tab content only shows after the height of the sidebar HTML <div id="sidebar1"> <h3>Sidebar1 Content</h3> <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p> <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p> <!-- end #sidebar1 --><!--</div> --> <div id="mainContent"><!-- InstanceBeginEditable name="main-content" --> <h1>Charges</h1> <div id="tabs"> <ul> <li><a href="#tabs-1">Details</a></li> <li><a href="#tabs-2">Feedback</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> </div> sidebar css .twoColFixRtHdr #sidebar1 { float: right; /* since this element is floated, a width must be given */ width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */ padding: 15px 10px; } any ideas why?
  18. I have a search results page, and when someone clicks on the next link, or a higher page number, I want the current results to slide out to the left, whilst the new ones slide in from the right. Then if someone clicks on previous or a lower page number I want the current results to slide out to the right, and the new ones to slide in from the left. Also if possible can it change the url when the new results come in? I want to use jquery, and was wondering what is the best way to do this, would it be using animate? I have tried but cant seem to work it out.
  19. Okay here is what I have in the works. What I want to achieve is the ability to update the order of items in a database upon change and if an item is moved from one tab to another it will update as well. <?php include ('global.php') ; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>IT WHITEBOARD</title> <link rel="stylesheet" href="css/jquery-ui.css" /> <script src="jquery-1.8.3.js"></script> <script src="jquery-ui.js"></script> <style> #sortable1 li, #sortable2 li, #sortable3 li, #sortable4 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 100%; } </style> <script> $(function() { $( "#sortable1, #sortable2, #sortable3, #sortable4" ).sortable().disableSelection(); var $tabs = $( "#tabs" ).tabs(); var $tab_items = $( "ul:first li", $tabs ).droppable({ accept: ".connectedSortable li", hoverClass: "ui-state-hover", drop: function( event, ui ) { var $item = $( this ); var $list = $( $item.find( "a" ).attr( "href" ) ) .find( ".connectedSortable" ); ui.draggable.hide( "slow", function() { $tabs.tabs( "select", $tab_items.index( $item ) ); $( this ).appendTo( $list ).show( "slow" ); }); } }); }); </script> </head> <body> <div id="tabs"> <ul> <li><a href="#tabs-1">Emergency Tasks</a></li> <li><a href="#tabs-2">Priority Tasks</a></li> <li><a href="#tabs-3">Issues List</a></li> <li><a href="#tabs-4">Completed Tasks</a></li> </ul> <div id="tabs-1"> <ul id="sortable1" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result1 = mysql_query("SELECT * FROM tasks WHERE priority = 'Emergency' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result1)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result1) ; ?> </ul> </div> <div id="tabs-2"> <ul id="sortable2" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result2 = mysql_query("SELECT * FROM tasks WHERE priority = 'Priority' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result2)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result2) ; ?> </ul> </div> <div id="tabs-3"> <ul id="sortable3" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result3 = mysql_query("SELECT * FROM tasks WHERE priority = 'Issues' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result3)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result3) ; ?> </ul> </div> <div id="tabs-4"> <ul id="sortable4" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result4 = mysql_query("SELECT * FROM tasks WHERE priority = 'Completed' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result4)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result4) ; ?> </ul> </div> </div> </body> </html> I have also attached the CSS file if needed. All other .js files are standard jQuery Libary.
  20. Hi I am having a conflict with these two jquery libraries I have tried noConflict but that has not worked. Jquery 1.4.2 and Jquery 1.8.3 conflict On suggestions on what I can do or where I can look to fix this issue?
  21. Hello guys, I'm building a website for tablets and i want o add the ability for the user to swipe down to another div. I've found some jquery plugins for this but only for left/right, and from some blogs that jquery doesn't support this ? Is that true and how can i overcome this ? I don't know javascript/jquery and i'd like some help.
  22. Hi, In my project I am calling ul and li data in Iframe and when I click on link then it move fucus on top instead of selected item. Following is the example of the problem. testFrame.htm <!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=iso-8859-1" /> <title>Tree Frame</title> </head> <body> <table width="50%" border="0"> <tr id="frameRow"> <td> <iframe id="treeFrame" src="treeFrame2.htm" width="50%" height="100%" scrolling="yes" frameborder="0"> </iframe> <td> </tr> </table> </body> </html> testFrame2.htm <!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=iso-8859-1" /> <title>Test Frame2</title> <script language="javascript" type="text/javascript"> function focusMe(id) { documentBygetelementsbyid(id).focus(); } </script> </head> <body> <ul> <li><a href="#" id="1" onclick="javascript:focusMe('1');">menu1</a></li> <li><a href="#" id="2" onclick="javascript:focusMe('2');">menu2</a></li> <li><a href="#" id="3" onclick="javascript:focusMe('3');">memnu3</a></li> <li><a href="#" id="4" onclick="javascript:focusMe('4');">menu4</a></li> <li><a href="#" id="5" onclick="javascript:focusMe('5');">menu5</a></li> <li><a href="#" id="6" onclick="javascript:focusMe('6');">menu6</a></li> <li><a href="#" id="7" onclick="javascript:focusMe('7');">menu7</a></li> <li><a href="#" id="8" onclick="javascript:focusMe('8');">menu8</a></li> <li><a href="#" id="9" onclick="javascript:focusMe('9');">menu9</a></li> <li><a href="#" id="10" onclick="javascript:focusMe('10');">menu10</a></li> <li><a href="#" id="11" onclick="javascript:focusMe('11');">menu11</a></li> <li><a href="#" id="12" onclick="javascript:focusMe('12');">menu12</a></li> <li><a href="#" id="13" onclick="javascript:focusMe('13');">menu13</a></li> <li><a href="#" id="14" onclick="javascript:focusMe('14');">menu14</a></li> <li><a href="#" id="15" onclick="javascript:focusMe('15');">menu15</a></li> </ul> </body> </html> Any solution? - Thanks Zohaib.
  23. Hello, i have small problem with replacing croatian letters. I am using jQuery, and am trying to replace croatian letters č,ć,š,đ,ž but dunno how to put this in regex. For now i have regex for all chars: $('#text').replace(/\b[a-z]/g, 'somechars' ); Unfortunately it wont reconize croatian special letters. Thanks. Regards
  24. I have created a slider using CSS3 to display my testimonials.. Now I need to add some animation to this slider using Jquery. But I dont have any idea how to use Jquery with this slider.. and what are the suitable plugin for this. So anybody can tell me How can I add an animation to this slider? This is my slider with HTML and CSS ...http://jsfiddle.net/XJVYj/82/ any ideas are greatly appreciated. Thank you.
  25. Hey all so Im trying to put data through an AJAX call into this div <div class="scroll-pane2 blue small" style=""> <p id="bulletinBodyArea" style="margin-right:20px;"></p> </div> The AJAX is being triggered when one clicks on one of the links being fed from the database <div class="bulletinSectionAccordion rounded"> <p class="blue" style="font-size:19px;margin-left:23px;margin-top:15px;margin-bottom:10px;">Archives</p> <?php $query = "SELECT * FROM `bulletin` LEFT JOIN `bulletininschool` ON `bulletin`.`id`=`bulletininschool`.`bulletin` WHERE `school` = 2 "; $result=$connection->query($query); while($row = $result->fetch_array()) { echo '<p class="medium titi" style="margin-left:23px;">'.$row['title'].'</p>'; } ?> </div> It gets called and then passes the data $(".titi").click( getBody ); function getBody(){ $("#bulletinBodyArea").load('update/getBody.php'); }; And this is the AJAX function <?php $section='bulletin'; $table="bulletin"; $schoolSelectorTable="bulletininschool"; $schoolSelector="bulletin"; $db_host = "localhost"; $db_user = "root"; $db_pass = ""; $db_name = "isl"; mysql_connect($db_host, $db_user, $db_pass, $db_name); mysql_select_db("isl") or die(mysql_error()); $states = mysql_query("SELECT * FROM `bulletin` LEFT JOIN `bulletininschool` ON `bulletin`.`id`=`bulletininschool`.`bulletin` WHERE `school` = 2" ); while($state = mysql_fetch_array($states)){ echo "<p>".$state['body']."</p>"; } ?> Now the links that one clicks that are fed from the database are actually article titles, and when one clicks on a specific title the AJAX call should go and fetch the body text associated with that article. But I'm having trouble understanding how I should go through that. I'm doing the correct queries and getting the titles and the bodies but I just cant figure out how to associate them. Do I pass a variable to the AJAX call? Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.