ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/shardiwal/search.php
Revision: 13
Committed: Wed Feb 2 04:17:00 2011 UTC (5 years, 10 months ago) by rakeshshardiwal
File size: 3563 byte(s)
Log Message:
project almost done
Line File contents
1 <?php
2 $gene_id = $_GET['id'];
3 include "site_header.php";
4 include "config.php";
5 /*
6 * MySQL connection
7 */
8 $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
9 die( 'Could not open connection to server' );
10
11 mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
12 die( 'Could not select database '. $gaSql['db'] );
13
14 /*
15 * SQL queries
16 * Get data to display
17 */
18 $sQuery = "
19 SELECT * FROM proteins where symbol like '$gene_id'
20 ";
21 $rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
22 while($row = mysql_fetch_array($rResult))
23 {
24 $symbol = $row['symbol'];
25 $full_name = $row['full_name'];
26 $description = $row['description'];
27 $function = $row['function'];
28 $cellular_location = $row['cellular_location'];
29 $structure = $row['structure'];
30 $synonyms = $row['synonyms'];
31 $references = $row['references'];
32 $type = $row['type'];
33 }
34 $typeclass = "nonstructured";
35 if($type == 'Structural Protein'){
36 $typeclass="structured";
37 }
38
39 ?>
40 <div id="site_body">
41 <div class="title">Genome</div>
42 <div id="gene_desc" class="title_content">
43 Single-stranded, (+)sense RNA, ~10.5kb. The genome has a 5' cap but is not polyadenylated at the 3' end.<br>
44 <img id="gnm_image" src="images/genome.gif"><br>
45 <div id="genome">
46 <div class="structured_protein">
47 <?php
48 $arr = array('C','prM','E');
49 foreach ($arr as &$value) {
50 if($gene_id == $value){
51 $class="_selected";
52 }else{
53 $class="";
54 }
55 echo "
56 <div class=\"each_protein $class\" title=\"Structural protein <strong>$value</strong>\">
57 <a class=\"show_tip\" href=\"search.php?id=$value\">$value</a>
58 </div>
59 ";
60 }
61 ?>
62 </div>
63 <div class="unstructured_protein">
64 <?php
65 $arr = array('NS1','NS2a','NS2b','NS3','NS4a','NS4b','NS5');
66 foreach ($arr as &$value) {
67 if($gene_id == $value){
68 $class="_selected";
69 }else{
70 $class="";
71 }
72 echo "
73 <div class=\"each_protein $class\" title=\"Nonstructural <strong>$value</strong> protein\">
74 <a class=\"show_tip\" href=\"search.php?id=$value\">$value</a>
75 </div>
76 ";
77 }
78 ?>
79 </div>
80 <div class="clear"></div>
81 </div>
82 </div>
83
84 <div>
85 <table id="protein_information" cellpadding="0" cellspacing="10" border="0" >
86 <tr>
87 <td colspan="2" class="center <?php echo $typeclass ?>"><?php echo $type ?></td>
88 </tr>
89 <tr>
90 <td colspan="2" class="center <?php echo $typeclass ?>"><?php echo "$full_name" ?></td>
91 </tr>
92 <tr>
93 <td width="125px;">Description:</td>
94 <td><?php echo $description ?></td>
95 </tr>
96 <tr>
97 <td width="125px;">Function:</td>
98 <td><?php echo $function ?></td>
99 </tr>
100 <tr>
101 <td width="125px;">Cellular Location:</td>
102 <td><?php echo $cellular_location ?></td>
103 </tr>
104 <tr>
105 <td width="125px;">Structure:</td>
106 <td><?php echo $structure ?></td>
107 </tr>
108 <tr>
109 <td width="125px;">Synonyms:</td>
110 <td><?php echo $synonyms ?></td>
111 </tr>
112 <tr>
113 <td width="125px;">References:</td>
114 <td><?php
115 $reference = split(',', $references);
116 foreach ($reference as &$value) {
117 $value = trim($value);
118 echo "<a target=\"_blank\" href=\"http://www.ncbi.nlm.nih.gov/pubmed?term=$value\">$value</a><br>";
119 }
120 ?></td>
121 </tr>
122 </table>
123 </div>
124 </div>
125 <?php include "site_footer.php" ?>
126 <script>
127 $(".each_protein").tooltip();
128 </script>

Properties

Name Value
svn:eol-style native