Jump to content

Jquery


Xtremer360

Recommended Posts

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;  

Link to comment
Share on other sites

Javascript/JQuery run in the browser, PHP runs on the server. So you can't swap PHP code with JQuery code, as they don't do the same thing.

 

What you can do is use JQuery to hit a URL on the server with some data, and then use the returned values to do something on the browser. JQuery comes with a set of AJAX functions that work well for this. I'd recommend doing some JQuery tutorials and then looking at the JQuery AJAX functionality.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.