PHP - Php Data Table - Jquery Sliding Effect
Similar TutorialsHello, i want when click next button to show the 4 content ... ive try everything Code: [Select] <div id="MoreBoxBorder"><div id="MoreBoxBorderLine"></div></div> <div id="ArrowMoreBox"><a class="next browse right"><div id="ArrowMoreImage"></div></a></div> <?php $query = "SELECT *, date_FORMAT(Date, '%H:%i') as Date_Time FROM tblnews WHERE LatestNews = 1 AND Category != 10 ORDER BY `Date` DESC LIMIT 4"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { ?> <div id="MoreBox" id="comments"> <div class="box"> <a href="<?php echo BASE_URL;?>index.php?pid=article&artidread=<?php echo $row['Id'];?>"><img src="<?php echo html_entity_decode($row['Thumb']);?>" border="0" width="110" height="64" /></a> <strong><a href="<?php echo BASE_URL;?>index.php?pid=article&artidread=<?php echo $row['Id'];?>"><strong><?php echo html_entity_decode(substr($row['Title'],0,437));?></strong></a></strong> <p><?php echo html_entity_decode($row['SubTitle']);?></strong> <div id="MoreIcoBox"> <a href="<?php echo BASE_URL;?>index.php?pid=article&artidread=<?php echo $row['Id'];?>"><img id="MoreIco" src="<?php echo BASE_URL;?>images/news/more.png" border="0" /></a> </div> </div> </div> <?php } ?> Like the image.. when i click next image will display another 4 (& auto scroll every 10seconds) Any help please Thank you Hi Everyone,
I am struggling with a pdf.
On our server I get the pdf as a byte array from the database, which I then build up in a StreamingOutput object and return as a pdf file. This is done using java using JAX-RS service.
Now when I open the path/link in my browser(chrome/firefox) the pdf opens in the browser. So this means my backend is working.
On my webapp I want to use $.ajax to download the pdf and view it in an Iframe or embed it in an <embed> or <object> tag. I need to do this as the service call is actually under username and password, and we do not create a session between the browser and the server - there is a long explanation for this.
I saw the option to use http://[username]:[password]@www.myserver.com/... but this was dropped by most browsers. This is why I am trying ajax.
Now in my ajax call I do receive the pdf in the success function as:
%PDF-1.4....This open the browser's pdfviewer correctly and every thing, but the pdf only returns blank pages. The Base64 is a java object that I found on the internet. But I have tried it without the base64 but still now luck. Here is my success function from my ajax call. success: function(data, status, xhr) { var pdfText = Base64.encode(xhr.responseText); var url = "data:application/pdf;base64," + escape(pdfText); var html = '<embed width=100% height=600' + ' type="application/pdf"' + ' src="' + url + '">' + '</embed>'; $("div.inner").html(""); $("div.inner").append(html); }, Hello to all, I have problem figuring out how to properly display data fetched from MySQL database in a HTML table. In the below example I am using two while loops, where the second one is nested inside first one, that check two different expressions fetching data from tables found in a MySQL database. The second expression compares the two tables IDs and after their match it displays the email of the account holder in each column in the HTML table. The main problem is that the 'email' row is displayed properly while its while expression is not nested and alone(meaning the other data is omitted or commented out), but either nested or neighbored to the first while loop, it is displayed horizontally and the other data ('validity', 'valid_from', 'valid_to') is not displayed.'
Can someone help me on this, I guess the problem lies in the while loop? <thead> <tr> <th data-column-id="id" data-type="numeric">ID</th> <th data-column-id="email">Subscriber's Email</th> <th data-column-id="validity">Validity</th> <th data-column-id="valid_from">Valid From</th> <th data-column-id="valid_to">Valid To</th> </tr> </thead> Here is part of the PHP code:
<?php while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { echo ' <tr> <td>'.$row["id"].'</td> '; while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)) { echo ' <td>'.$row1["email"].'</td> '; } if($row["validity"] == 1) { echo '<td>'.$row["validity"].' month</td>'; }else{ echo '<td>'.$row["validity"].' months</td>'; } echo ' <td>'.$row["valid_from"].'</td> <td>'.$row["valid_to"].'</td> </tr>'; } ?>
Thank you. I can add and delete data from my table. Now I need to be able to change one or more fields in an entry. So I want to retrieve a row from the db, display that data on a form where the user can change any field and then pass the changed data to an update.php program. I know how to go from form to php. But how do I pass the data from retrieve.php to a form so it will display? Do I use a URL and Get? Can I put the retrieve and form in the same program? Hey everyone. I am creating a website so my family can select from the list of present my daugther has asked for. I have them logging in, and that works. I have the table data set and the search and table display works. But I would like to display the list (as in the code below) but with a checkbox in the first column (add a column). From that the authenticated user can click on the item they have purchased and that selection will be moved to another table (called purchased). I have that code. The only thing I cannot figure out is to present the data in list form with a checkbox (like you would see on an order form). Here is the display code (there is no error checking at this point): <head><LINK REL="SHORTCUT ICON" HREF="cmwschl.ico"></head> <body bgcolor="#C0C0C0"> <font face="Arial" color="#000080">Books from the Selected Series</font> </h1> <hr font color="Navy" font size="3"> <center> <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td width="170" bgcolor="#FFCC66"><center><b><font color="navy" size="2" face="Trebuchet MS"><b><center>Book Number</center></font></b></center></td> <td width="140" bgcolor="#FFCC66"><center><b><font color="navy" size="2" face="Trebuchet MS"><b><center>Book Group</center></font></b></center></td> <td width="100" bgcolor="#FFCC66"><center><b><font color="navy" size="2" face="Trebuchet MS"><b><center>Book Title</center></font></b></center></td> </tr> <?php $con = mysql_connect("localhost","twilson","R00tb33r!") or die('Connection: ' . mysql_error());; mysql_select_db("CMWWeb", $con) or die('Database: ' . mysql_error()); ?> <? $group = $_POST['bookgrp']; //if ($Prod <> 0) { $sql = "SELECT * FROM `OpenBooks` WHERE `bookgrp`= '$group'"; $results = mysql_query($sql); if ($results) { //this will check if the query failed or not if (mysql_num_rows($results) > 0) { //this will check if results were returned while($copy = mysql_fetch_array($results)) { $variable1=$copy['booknum']; $variable2=$copy['bookgrp']; $variable3=$copy['booktitle']; //table layout for results print ("<tr>"); print ("<td><center>$variable1</center></td>"); print ("<td><center>$variable2</center></td>"); print ("<td><left>$variable3</left></td>"); print ("</tr>"); } } else { echo "No results returned"; } } else { echo "Query error: ".mysql_error(); } mysql_close($con); ?> </table> </center> This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346771.0 Hi, I am trying to build a jQuery and PHP love it button where the user clicks it and the number increments and saves to a DB. I have it all working apart from the Saving to the DB part : ) I have this currently to save but it doesnt seem to work. Code: [Select] <?php mysql_connect("localhost", "web183-loveit", "password") or die ("Error."); mysql_select_db("web183-loveit") or die ("error"); $increase = "UPDATE results SET value=value+1 WHERE id=1;"; $active_rate = mysql_query("SELECT * FROM results WHERE id=1;"); $val = 0; if($rt = mysql_fetch_assoc($active_rate)) { $val = $rt['value']; } if($_POST['action'] == 'add') { mysql_query($increase); print $val++; } ?> Please see it here http://bit.ly/dKx15z Any ideas?? cheers Craig Hi,
what I'm tryng is to append a table row with associated jquery code...
I have a jquery code just like this
<script type="text/javascript"> jQuery(function($) { var rowCtr = 0; $('.addRow').click(function(){ $('#tableID > tbody:last').append('<tr name="rowEq['+rowCtr+']" id="rowEq['+rowCtr+']"><td>'+ '<select id="stype'+rowCtr+'" name="rowData['+rowCtr+'][equipment_type]">'+ '<option value="0"> -- </option>'+ '<option value="1"> Type 1 </option>'+ '<option value="2"> Type 2 </option>'+ '<option value="3"> Other </option>'+ '</select>'+ '<input id="other_type'+rowCtr+'" type="text" name="rowData['+rowCtr+'][other_type]">'+ ); $('#stype'+rowCtr).change(function() { if(jQuery('#stype'+rowCtr).val() == '3') { jQuery('#other_type'+rowCtr).show(); }else{ jQuery('#other_type'+rowCtr).hide(); } }); if(jQuery( '#stype'+rowCtr ).val() != '3') { jQuery('#other_type'+rowCtr).hide(); } rowCtr++; }); }); </script>And html like this.. <input type='button' class='addRow' value="Add Row"> <form> <table id="tableId"> <thead> <tr> <th> Type </th> </tr> </thead> <tbody> <tr> <td> dummy text.. </td> </tr> </tbody> </table> </form>The appending is ok but the hidding/showing of "other_type" field is not working. It always hide "other_type" field even if I already selected the 'other' option. tbl1.png 3.38KB 0 downloads hello friends I'm dealing with this problem for two days. I put here the screenshot for easier understanding.Sorry about my bad english. Here is the ss http://i61.tinypic.com/2rz5q55.jpg I don't want to inner join or table join. All image links which same sku should displayed in single row where products.resimler colon I can join the tables but i want to one table.Because i can import single csv file for e-commerce script.How can I use a update query for list multiple images in table products. Edited by nogai, 10 October 2014 - 07:01 AM. the second database found on the cloud
i try to get JSON data but how to insert and update them to another online database with the same table my php script to return json data <?php include_once('db.php'); $users = array(); $users_data = $db -> prepare('SELECT id, username FROM users'); $users_data -> execute(); while($fetched = $users_data->fetch()) { $users[$fetchedt['id']] = array ( 'id' => $fetched['id'], 'username' => $fetched['name'] ); } echo json_encode($leaders);
i get
{"1":{"id":1,"username":"jeremia"},"2":{"id":2,"username":"Ernest"}} Edited March 24 by mahenda Hi all I am describing my problem below can any body please look into this I have two databases DB1:datain1 DB2:datain2 having the below structure database, table, fields datain1 , student , id,name datain2 , student , id,name the two databases having same structure My query is i want copy all data from datain1 to datain2 on daily process through php script(script will be executed manually on daily) i don't want any duplicate or repeated data in datain2 give me some script to do this kindly help me to solve this its so urgent Hereby, i need assistance from your side. That here the images are not getting sliding.Moreover the uploaded images are getting stored in database and unable to fetch from the "images folder"
We have created 2 folders image folder for cover page image and second one is images folder for inside images i.e slider images. Moreover,cover page is fetching from image folder and getting displayed but slider images are not fetching from the images folder. meanwhile uploaded images are getting stored in database as well..
Can you guys please me. Hi This may seem pretty standard to some of you but I am having a problem with tables. What I am trying to do is give the user 4 fields to choose from and depending upon which field they enter data into the php will query the mysql database and return all of the data related to that value and place it into a table. Seems fair enough however there could be multiple entries of that value and I want there to maybe be a loop that will check for the information and then when it is done complete the table. My code looks something like this: <html> <?php # Script 14.2 - course_form.php // This page allows the administrator to add a course (product). $con = mysql_connect("localhost","root","millennium"); if (!$con) { die('Could not connect: ' . mysql_error()); } if (isset($_POST['submitted'])) { // Check if the form has been submitted. // Validate the print_name, image, artist (existing or first_name, last_name, middle_name), size, price, and description. // Check for a course id. if (!empty($_POST['IpAddress'])) { $ip = ($_POST['IpAddress']); } else { $ip = FALSE; } // Check for a course id. if (!empty($_POST['Identifier'])) { $id = ($_POST['Identifier']); } else { $id = FALSE; } // Check for a course id. if (!empty($_POST['Destination'])) { $de = ($_POST['Destination']); } else { $de = FALSE; } // Check for a course id. if (!empty($_POST['Reply'])) { $re = ($_POST['Reply']); } else { $re = FALSE; } // Add the course to the database. mysql_select_db("accs", $con); $result = mysql_query("SELECT * FROM smsaudit WHERE smsreply='$re' || smsorigip='$ip' || smsidentifier='$id' || smsdest='$de'"); $tdcount = 1; $numtd = 4; // number of cells per row echo "<table border='1'>"; while($row = mysql_fetch_array($result)) { if ($tdcount == 1) echo "<tr>"; echo "<td>IP Address: $ip </td>"; // display as you like echo "<td>Identifier: $id </td>"; echo "<td>Destination: $de </td>"; echo "<td>Reply: $re </td>"; if ($tdcount == $numtd) { echo "</tr>"; $tdcount = 1; } else { $tdcount++; } // time to close up our table if ($tdcount!= 1) { while ($tdcount <= $numtd) { echo "<td> </td>"; $tdcount++; } echo "</tr>"; } echo "</table>"; } echo "<br />"; $result2 = mysql_query("SELECT totalsms FROM smsaudit ORDER BY totalsms DESC LIMIT 1"); while($row = mysql_fetch_array($result2)) { echo 'You have used ' . $row['totalsms'] .' sms messages'; } } else { // Display the form. ?> <form action="form1.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="524288"> <p> </p> <table width="449" border="0"> <td><h1>SMS Information</h1></td> <td> </td> <td> </td> <td> </td> </tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td width="160"><strong>IP Address</strong></td> <td width="95"> </td> <td width="167"><strong>Identifier</strong></td> </tr> <tr> <td><input name="IpAddress" type="text" id="IpAddress" /></td> <td> </td> <td><input name="Identifier" type="text" id="Identifier" /></td> <td width="9"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><strong>Destination</strong></td> <td> </td> <td><strong>Reply</strong></td> <td> </td> </tr> <tr> <td><input name="Destination" type="text" id="Destination" /></td> <td> </td> <td><input name="Reply" type="text" id="Reply" /></td> <td> </td> </tr> <tr> <td><input type="submit" name="Submit" id="Submit" value="Submit" /></td> <td> </td> <td> </td> <td> </td> </tr> </table> <input type="hidden" name="submitted" value="TRUE" /> </form> <?php } // End of main conditional. ?> </html> Can anyone please let me know of a way to achieve this? Thanks First I need to create a table or add to an existing table - the table needs to contain a date -msg last sent date Then run the following email script for each record if the value of the msg last sent date is greater than >30 days??? after the script is run, it updates the records it emailed to todays date... <?php include "vsadmin/db_conn_open.php"; $allprods=mysql_query("select pID, pName, pPrice, pDropship, dsID, dsName, dsEmail from products, dropshipper where pDropship = dsID"); while ($yarr=mysql_fetch_assoc($allprods)){ $aname=$yarr["pID"]; $bname=$yarr["pName"]; $cname=$yarr["dsName"]; $dname=$yarr["dsEmail"]; $ename=$yarr["pPrice"]; $to = $dname; $subject = ("Your Ebook: " . $bname); $body = ("Hello " . $cname .",\n\nYou have the following ebook listed for sale on www.insertwebsite.com (". $bname ."). \nYour Ebook (product) is currently listed at the retail price of $" . $ename . "\n\nThe following link is provided to you as a marketing tool for your current or future email campaigns. This link is a direct link to your ebook on the Enlightened Ebooks site. \n www.www.insertwebsite.com/proddetail.php?prod=". $aname . "\n\nOnline sales is a safe secure way to increase your ebook sales. Simply provide the link in all your correspondences and you sales will increase. You are your own best promoter."); $headers = "From: neil@me.com\r\n" . "X-Mailer: php"; if (mail($to, $subject, $body, $headers)) { echo("<p><b>Message sent to.</b></P>". $cname . " for the following ebook " . $bname ); } else { echo("<p>Message delivery failed...</p>"); }} ?> Hi,
A little new to php programming... I have a question:
I have written this code:
<html> <head> <title>Test</title> </head> <FONT FACE="Verdana, sans-serif"> <H3>Movies</h3> <?php include 'config.php'; include 'opendb.php'; $result = mysql_query("SELECT * FROM DayMovie ORDER BY FileDate") or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>Filename</th><th>Path</th><th>Date</th><th>Filetype</th> <th>Size</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['FileName']; echo "</td><td>"; echo $row['FilePath']; echo "</td><td>"; echo $row['FileDate']; echo "</td><td>"; echo $row['FileType']; echo "</td><td>"; echo $row['FileSize']; echo "</td></tr>"; } echo "</table>"; include 'closedb.php'; ?>I would like to have a link to these files on all the rows to open the files. How can I do that? I would also like that the link from the mysql row is not shown in the table. Only a text with the text "link" or "view". What I'm wanting to do is instead of March-July have it always display the last 5 months and for the Visits th have it display the number of hits to my main page for each month and display the number of logins for each month to my CMS script. Can someone point me in the right direction? Code: [Select] <?php function get_visit_data_table() { echo "<table class=\"visualize_dashboard\">"; echo "<caption>Dashboard Chart Example</caption>"; echo "<thead>"; echo "<tr>"; echo "<td></td>"; echo "<th scope=\"col\">March</th>"; echo "<th scope=\"col\">April</th>"; echo "<th scope=\"col\">May</th>"; echo "<th scope=\"col\">June</th>"; echo "<th scope=\"col\">July</th>"; echo "</tr>"; echo "</thead>"; echo "<tbody>"; echo "<tr>"; echo "<th scope=\"row\">Visits</th>"; echo "<td>175</td>"; echo "<td>145</td>"; echo "<td>212</td>"; echo "<td>175</td>"; echo "<td>182</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\">Logins</th>"; echo "<td>94</td>"; echo "<td>53</td>"; echo "<td>124</td>"; echo "<td>92</td>"; echo "<td>105</td>"; echo "</tr>"; echo "</tbody>"; echo "</table>"; } ?> I have a script that is supposed to allow a user to add their details to a members table in the database. It acts as if the user has been added to the database by stating the thank you message, but there is no entry into the database. I can connect to the database and have another script running OK that allows me to view all of the information in the members table with a loop (this data was entered using php my admin's GUI). Here is the script that is supposed to add the member. Any help would be greatly appreciated. <?php error_reporting(-1); $user_name = "root"; $password = ""; $database = "test"; $server = "localhost"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "INSERT INTO members (fname, sname, email, password, gender) VALUES ('$_POST[fname]','$_POST[sname]','$_POST[email]','$_POST[password]','$_POST[gender]')"; $result = mysql_query($SQL); mysql_close($db_handle); print "Thanks for joining us ".$_POST['fname']."."; } else { print "Database NOT Found"; mysql_close($db_handle); } ?> Code: [Select] $myusername = $_POST['myusername']; mysql_query("INSERT INTO logedin ( username ) VALUES ('$myusername')") OR die("Could not send the message: <br>".mysql_error()); wont insert anything no error's given even just trying to insert username into the the loged in table yes i know i spelt loged in wrong but i did that on the db lol So I'm trying to grab values from a specific table id in html in PHP possibly using `DOMElement` or something else? I want to add my index.php page to a variable, search for a certain table id ( in this case, "shades" ), then grab JUST the values from inside that table & print it out in an echo. Here's what i have. for some reason I'm getting Warning: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity <?php $HTML = [ ]; $stream = fopen ( "index.php", "r" ); $string = stream_get_contents ( $stream ); HTML [ 0 ] = $string; // Our HTML goes here $innerHTML = implode ( ',', $HTML ); // Create a new DOMDocument based on our HTML $document = new DOMDocument; $document -> loadHTML ( $innerHTML ); // Get a NodeList of any table "id", "shades" $cells = $document -> getElementsByTagName ( "id" ); // Cycle over each <td>, adding its HTML to $innerHTML foreach ( $cells as $cell ) { $innerHTML = $document -> saveHTML ( $cell ); } // Output our glorious HTML echo $innerHTML; fclose ( $stream ); ?>
|