I am looking for the easiest way to set up a table on a page that needs a password to see. The table needs to be able to be sorted by clicking the header of the column you choose. Alternately, or inclusive I would like to search for data on that page only, not the website. I am relatively new to page construction and use Sharepoint 2007 to make pages. Does anyone have any suggestions.

Recommended Answers

All 3 Replies

http://www.daniweb.com/forums/thread99569.html

Thats a simple example on how to sort records based on a column.

And about the password, if you are storing the username/password in the database, ask the user to enter username and password. Check if that username & password are in the table. If true, then redirect the user to this table page. Else, redirect him to error page.

What do you mean by search for data on that page only ? are you having a textbox to accept search string or are you talking about control + F /find ?

I was able to get the search for text on a single page to work. Being pretty new to this I was just having a little trouble. I would like to create a database of users and passwords, but am unsure how to link it to a password script. I will try to but if anyone has a working one, viewing it would be helpful.

Thanks
Don

I have a doubt ...

My table contains some fields like ID,Name and date etc.When we just click on the ID it sorts the table in ASCending order on the next Click DESCending order,like other fields also.
I have found a some codes in the net that contains the pure html.
But my code is made by Ajax,The page is loaded based on functions.
So any one please help me..

My code goes here..

<?php
header("cache-control: must-revalidate");
?>
<div class="main_body">
	<div id="main_body">
	<div id="error">&nbsp;</div>
	
	<form  method="post" enctype="application/x-www-form-urlencoded" name="formupdate"  action="#">
	<table id="border" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<th width="8%"  align="center">ID</th>
			<th width="18%"  align="center"> Work Order</th>
			<th width="18%" align="center">Status</th>
			<th width="18%" align="center">Created/Updated</th>
			<th width="8%"  align="center">Select</th>
			
			   
		</tr>
		<?php
            require_once($_SERVER['DOCUMENT_ROOT'].'/_lib.php');
            dbConnect();

                $query   = "SELECT * FROM cp_work_order  ORDER BY date_created ASC";
                $result  = mysql_query($query) or die('<p style="color:red; font-weight:bold;">'.mysql_error().'</p>');
                
                if (mysql_num_rows($result) >= 1) {          
			$total_count=mysql_num_rows($result);

            	   while ($row = mysql_fetch_array($result)) {
        ?>
            	       <tr onMouseOver="this.style.backgroundColor ='#9CAAAD'" onMouseOut="this.style.backgroundColor ='#8B999E'">
                       <td align="center" valign="middle"><?php echo $row['order_id']; ?></td>
                       <td><?php echo $row['order_company']; ?></td>
		       <td align="center" valign="middle"><?php echo $row['order_status']; ?></td>
                       <td align="center" valign="middle"><?php echo $row['date_start_dummy']; ?></td>
			<td align="center" valign="middle"><input type="checkbox" name="chkboxarray" value="<?php echo $row['order_id']; ?>" > </td>
                     
			</tr>
        <?php
		

/
		}

            	   
            	   mysql_free_result($result);
            	} else {
            	   echo '<tr>';
                        echo '<td colspan="4" align="center" valign="middle">There is no  Work Order available in the database.</td>';
                   echo '</tr>';
            	}

        ?>
	</table>
	<table>
		<tr><td align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		<input name="hidSubmit" type="hidden" id="hidSubmit2" value="true">
					
				<select name="select_update" style="width:150px">
				<option value="">Please Select One</option>
				<option value="EDIT">Edit Selected</option>
				<option value="DELETE">Delete Selected</option>
                    	</select>&nbsp;&nbsp;<input type="button" value="Submit" name="submit" onclick="return updateAction()">
                </td>
            	</tr>
		<?php

		?>
	</table>
 <?php 
//echo $strExpert; ?> 

</form>	
 </body>
</div>
</div>

Thanks In advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.