...

View Full Version : Possible JQuery



CoolAsCarlito
06-23-2010, 01:51 AM
I'm not sure if this is something jquery can do or what but here's what I want to do but I have this following code and when it shows either Public or Archived for the Event Status I want it to be a link so that if I click on Public then it turn it into Archived because it'll change its status_id in the DB from 4 to 5.



case 1:
echo $e;
?>
<h1 class=backstage>Archiving Management</h1><br />
<h2 class=backstage>Weekly Events</h2><br />

<?php
$query = "SELECT ecb.bookingdate, els.name, ele.statusname, ecb.label FROM `efed_content_booking` AS ecb LEFT JOIN `efed_list_shownames` AS els ON ( ecb.event_id = els.id ) LEFT JOIN `efed_list_eventstatus` AS ele ON ( ecb.status_id = ele.id ) WHERE els.type = 'singular' OR els.type = 'recurring'";

$result = mysql_query ( $query );
$rows = mysql_num_rows($result);
if ($rows > 0) {
print'<table width="100%" class="table1">
<tr class="rowheading">
<td>Event</td>
<td align="center">Booking Date</td>
<td align="center">Event Status</td>
</tr>';
$i = 0;
while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) {
$sClass = 'row2';
if ($i++ % 2) $sClass = 'row1';
printf ( "<tr class=\"%s\">", $sClass );
printf ( "<td valign=\"top\">%s%s</td>", $row['name'],$row['label'] );
printf ( "<td valign=\"top\" align=\"center\">%s</td>", convertdate($row['bookingdate'] ));
printf ( "<td valign=\"top\" align=\"center\">%s</td>", $row['statusname'] );
echo '</tr>';
}
echo '</table><br>';
} else {
echo '<span>There are no weekly events to archive.</span><br /><br />';
}
?>
<h2 class=backstage>Pay-Per-View Events</h2><br />

<?php
$query = "SELECT ecb.bookingdate, els.name, ele.statusname, ecb.label FROM `efed_content_booking` AS ecb LEFT JOIN `efed_list_shownames` AS els ON ( ecb.event_id = els.id ) LEFT JOIN `efed_list_eventstatus` AS ele ON ( ecb.status_id = ele.id ) WHERE els.type = 'ppv'";

$result = mysql_query ( $query );
$rows = mysql_num_rows($result);
if ($rows > 0) {
print'<table width="100%" class="table1">
<tr class="rowheading">
<td>Event</td>
<td align="center">Booking Date</td>
<td align="center">Event Status</td>
</tr>';
$i = 0;
while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) {
$sClass = 'row2';
if ($i++ % 2) $sClass = 'row1';
printf ( "<tr class=\"%s\">", $sClass );
printf ( "<td valign=\"top\">%s%s</td>", $row['name'],$row['label'] );
printf ( "<td valign=\"top\" align=\"center\">%s</td>", convertdate($row['bookingdate']) );
printf ( "<td valign=\"top\" align=\"center\">%s</td>", $row['statusname'] );
echo '</tr>';
}
echo '</table><br>';
} else {
echo '<span>There are no ppv events to archive.</span><br /><br />';
}
returnmain();
footercode();
break;

Keleth
06-23-2010, 01:55 AM
Well, if javascript can do it, jquery can do it... as jquery is just a javascript framework (before someone yells, I know that's not absolutely true :p).

That being said, you wanna look into AJAX, such as the jquery post method
http://api.jquery.com/jQuery.post/

AJAX is how you do a live db change... essentially you call a php (or w/e coding language) page that takes an argument via POST (or GET if you prefer) and works at it. The javascript takes elements of the current page and does a server side request in the background.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum