PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/Prohits/analyst/pop_plate_show.php

http://prohits.googlecode.com/
PHP | 363 lines | 311 code | 15 blank | 37 comment | 28 complexity | 6f0352a9a7eb3999d721c6ac226d781a MD5 | raw file
  1. <?
  2. /***********************************************************************
  3. Prohits version 1.00
  4. Copyright (C) 2001, Mike Tyers, All Rights Reserved.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. *************************************************************************/
  14. $argv[1] = '';
  15. $Plate_ID = 0;
  16. $Band_ID = 0;
  17. $theaction = '';
  18. $order_by = '';
  19. $start_point = '';
  20. $OwnerID = '';
  21. //-plate_info.inc--------
  22. $PlateName_str = '';
  23. $msg_plate = '';
  24. $in_Plate_ID = '';
  25. $whichPlate = '';
  26. //-plate_layout.inc------
  27. $newplate = '';
  28. $tab = '';
  29. $selectedWellCode_arr = '';
  30. //-plate_band_hits-----
  31. $sub = '';
  32. $noplate = '';
  33. $gelFree = 0;
  34. $hitType = 'normal';
  35. $item_hits_order_by = '';
  36. $hitType = 'normal';
  37. $searchEngineField = '';
  38. $Type = 'Sample';
  39. define ("RESULTS_PER_PAGE", 25);
  40. define ("MAX_PAGES", 15);
  41. require("../common/site_permission.inc.php");
  42. require("classes/bait_class.php");
  43. require("classes/experiment_class.php");
  44. require("classes/gel_class.php");
  45. require("classes/lane_class.php");
  46. require("classes/band_class.php");
  47. require("classes/plate_class.php");
  48. require("classes/plateWell_class.php");
  49. require("classes/hits_class.php");
  50. require("../common/page_counter_class.php");
  51. include("common_functions.inc.php");
  52. include("../common/common_fun.inc.php");
  53. //require("export_lable_arrs.inc.php");
  54. /*echo "<pre>";
  55. print_r($request_arr);
  56. echo "</pre>";*/
  57. $Log = new Log();
  58. if($Plate_ID){
  59. $Plate = new Plate($Plate_ID);
  60. }else if($Band_ID){
  61. $thisPlateWell = new PlateWell();
  62. $band_in_plates_arr = $thisPlateWell->band_in_plate($Band_ID);
  63. if(count($band_in_plates_arr)){
  64. $Plate_ID = $band_in_plates_arr[0];
  65. $Plate = new Plate($band_in_plates_arr[0]);
  66. }else{
  67. $Plate = new Plate();
  68. }
  69. }else{
  70. $Plate = new Plate();
  71. }
  72. if($theaction == 'updateplate' and $AUTH->Modify and $Plate_ID){
  73. //$thePlate = new Plate($Plate_ID);
  74. if($Plate->MSDate != $frm_MSDate){
  75. //if ms complited has been chagned, it should check bait Carry Over.
  76. //this include script will check if a hit is a bait in 'up-stream' on the same plate
  77. //the included file also will check other filters.
  78. include("checkCarryOver.inc.php");
  79. }
  80. $Plate->update($Plate_ID,$frm_Name,$frm_PlateNotes,$frm_DigestedBy, $frm_DigestStarted,$frm_DigestCompleted,$frm_Buffer,$frm_MSDate);
  81. $Desc = "DigestStarted=$frm_DigestStarted,DigestCompleted=$frm_DigestCompleted,Buffer=$frm_Buffer,MSDate=$frm_MSDate";
  82. $Log->insert($AccessUserID,'Plate',$Plate_ID,'modify',$Desc,$AccessProjectID);
  83. //$Plate = new Plate($Plate_ID);
  84. $theaction = 'showone';
  85. }
  86. //require("site_header.php");
  87. //$TB_CELL_COLOR = "#dadada";
  88. ?>
  89. <html>
  90. <head>
  91. <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
  92. <LINK REL="SHORTCUT ICON" HREF="../images/porhits.ico">
  93. <link rel="stylesheet" type="text/css" href="./site_style.css">
  94. <title>Prohits</title>
  95. <script language="Javascript" src="../common/javascript/site_javascript.js"></script>
  96. </head><basefont face="arial">
  97. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff leftMargin=5
  98. topMargin=5 rightMargin=5 marginheight="5" marginwidth="5">
  99. <script language='javascript'>
  100. function view_master_results(ResultFile,searchEngineField){
  101. if(ResultFile == ''){
  102. alert("No results file exists.");
  103. return false;
  104. }
  105. if(searchEngineField == "Mascot"){
  106. <?if(MASCOT_USER){?>
  107. var tmp_url = "http://<?=MASCOT_IP. MASCOT_CGI_DIR;?>/login.pl";
  108. tmp_url += "?action=login&username=<?=MASCOT_USER;?>&password=<?=MASCOT_PASSWD;?>";
  109. tmp_url += "&display=nothing&savecookie=1&referer=master_results.pl?file=" + ResultFile;
  110. <?}else{?>
  111. var tmp_url = "http://<?=MASCOT_IP. MASCOT_CGI_DIR;?>/master_results.pl?file=" + ResultFile;
  112. <?}?>
  113. window.open(tmp_url,"mascot_win", "toolbar=1,menubar=1,scrollbars=1,resizable=1,width=800,height=800");
  114. //file = "http://<?=MASCOT_IP;?>/mascot/cgi/master_results.pl?file=" + ResultFile;
  115. }else if(searchEngineField == "GPM"){
  116. var file = "http://<?=GPM_IP;?>/thegpm-cgi/plist.pl?path=" + ResultFile;
  117. window.open(file,"gpm_win", "toolbar=1,menubar=1,scrollbars=1,resizable=1,width=800,height=800");
  118. }else{
  119. return;
  120. }
  121. }
  122. function display_plate(Plate_ID){
  123. var theForm = document.action_form;
  124. theForm.theaction.value = 'showone';
  125. theForm.Plate_ID.value = Plate_ID;
  126. theForm.submit();
  127. }
  128. function view_image(Gel_ID){
  129. file = 'gel_view.php?Gel_ID=' + Gel_ID;
  130. newwin = window.open(file,"gel_image",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=750,height=600');
  131. newwin.moveTo(10,10);
  132. }
  133. function print_view(Plate_ID){
  134. file = 'plate_view.php?Plate_ID=' + Plate_ID;
  135. newwin = window.open(file,"plate",'toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=850,height=600');
  136. newwin.moveTo(10,10);
  137. }
  138. function show_all_peptides(Band_ID){
  139. file = 'show_all_peptides.php?Band_ID=' + Band_ID;
  140. newwin = window.open(file,"show_all_peptides",'toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=850,height=600');
  141. newwin.moveTo(10,10);
  142. }
  143. </script>
  144. <?
  145. //---------------------------------------------------------------------------------------------
  146. if($sub){?>
  147. <table cellspacing="0" cellpadding="0" border="0" align=center>
  148. <tr>
  149. <td><img src="./images/arrow_green_gel.gif" border=0></td>
  150. <td><img src="./images/arrow_green_bait.gif" border=0></td>
  151. <td><img src="./images/arrow_green_exp.gif" border=0></td>
  152. <td><img src="./images/arrow_green_band.gif" border=0></td>
  153. <td><img src="./images/arrow_red_well.gif" border=0></td>
  154. </tr>
  155. </table>
  156. <?}?>
  157. <form name=action_form action=<?echo $PHP_SELF;?> method=post>
  158. <input type=hidden name=Band_ID value=<?echo $Band_ID;?>>
  159. <input type=hidden name=Plate_ID value='<?echo $Plate_ID;?>'>
  160. <input type=hidden name=theaction value=''>
  161. <input type=hidden name=whichPlate value=''>
  162. <input type=hidden name=frm_WellCode value=''>
  163. <input type=hidden name=sub value=<?echo $sub;?>>
  164. <input type=hidden name=noplate value=<?echo $noplate;?>>
  165. <input type=hidden name=hitType value=<?echo $hitType;?>>
  166. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  167. <?if(!$noplate){?>
  168. <tr>
  169. <td colspan=2><div class=maintext>
  170. <img src="images/icon_but.gif" height=15> Available Well
  171. <img src="images/icon_curr_band.gif" height=15> Current Band
  172. <img src="images/icon_plate.gif" height=17> Plate
  173. <img src="images/icon_plate_check.gif" height=17> MS Completed Plate
  174. <img src="images/icon_report.gif" height=17> Plate Report
  175. </div><br>
  176. </td>
  177. </tr>
  178. <tr>
  179. <td align="left">
  180. &nbsp; <font color="navy" face="helvetica,arial,futura" size="3"><b>Plates & Wells
  181. <?
  182. if($AccessProjectName){
  183. echo " <font color='red' face='helvetica,arial,futura' size='3'>(Project $AccessProjectID: $AccessProjectName)</font>";
  184. }
  185. ?>
  186. </b>
  187. </font>
  188. </td>
  189. <td align="right">
  190. &nbsp;
  191. </td>
  192. </tr>
  193. <?}else{?>
  194. <tr>
  195. <td align="left">
  196. &nbsp; <font color="navy" face="helvetica,arial,futura" size="3"><b>Band
  197. <?
  198. if($AccessProjectName){
  199. echo " <font color='red' face='helvetica,arial,futura' size='3'>(Project: $AccessProjectName)</font>";
  200. }
  201. ?>
  202. </b>
  203. </font>
  204. </td>
  205. <td align="right">
  206. <a href="javascript: window.close();" class=button>[Close Window]</a>
  207. </td>
  208. </tr>
  209. <?}?>
  210. <tr>
  211. <td colspan=2 height=1 bgcolor="black"><img src="./images/pixel.gif"></td>
  212. </tr>
  213. <tr>
  214. <td align="center" colspan=2>
  215. <?
  216. if(!$gelFree){
  217. if(!$theaction){//list plate ---------------------
  218. $Plates = new Plate();
  219. $total = $Plates->get_total();
  220. if(!$order_by) $order_by = "P.ID desc";
  221. if(!$start_point) $start_point = 0;
  222. $Plates->fetchall_list($order_by,$start_point, RESULTS_PER_PAGE);
  223. //page counter start here
  224. $PAGE_COUNTER = new PageCounter();
  225. $query_string = "";
  226. $caption = "Plates";
  227. if($order_by){
  228. $query_string .= "&order_by=".$order_by;
  229. }
  230. $page_output = $PAGE_COUNTER->page_links($start_point, $total, RESULTS_PER_PAGE, MAX_PAGES,$query_string);
  231. ?>
  232. <table border="1" cellpadding="0" cellspacing="1" width="100%">
  233. <tr><td colspan=6 align=right><?echo $page_output;?></td></tr>
  234. <tr bgcolor="">
  235. <td width="60" height="25" bgcolor="<?echo $bg_tb_header;?>" align=center>
  236. <a href="<?echo $PHP_SELF;?>?theaction=<?echo $theaction;?><?echo ($sub)?"&sub=$sub":"";?>">
  237. <div class=tableheader>
  238. ID</div></a>
  239. </td>
  240. <td width="140" height="25" bgcolor="<?echo $bg_tb_header;?>" align=center>
  241. <a href="<?echo $PHP_SELF;?>?theaction=<?echo $theaction;?>&order_by=P.Name<?echo ($sub)?"&sub=$sub":"";?>">
  242. <div class=tableheader>
  243. Plate Name</div></a>
  244. </td>
  245. <td width="150" bgcolor="<?echo $bg_tb_header;?>" align=center><div class=tableheader>
  246. Created By</div>
  247. </td>
  248. <td width="150" bgcolor="<?echo $bg_tb_header;?>" align="center" align=center>
  249. <a href="<?echo $PHP_SELF;?>?theaction=<?echo $theaction;?>&order_by=P.DateTime<?echo ($sub)?"&sub=$sub":"";?>">
  250. <div class=tableheader>
  251. Created On</div></a>
  252. </td>
  253. <td width="100" bgcolor="<?echo $bg_tb_header;?>" align="center" align=center>
  254. <a href="<?echo $PHP_SELF;?>?theaction=<?echo $theaction;?>&order_by=P.MSDate<?echo ($sub)?"&sub=$sub":"";?>">
  255. <div class=tableheader>
  256. MS Completed</div></a>
  257. </td>
  258. </td>
  259. <td width="70" bgcolor="<?echo $bg_tb_header;?>" align="center">
  260. <div class=tableheader>Options</div>
  261. </td>
  262. </tr>
  263. <?
  264. //print_r($_SESSION['USER']->UsersArr);exit;
  265. //echo $Plates->count;exit;
  266. for($i=0; $i < $Plates->count; $i++) {
  267. $theOwner = '';
  268. if($Plates->OwnerID[$i]){
  269. $OwnerID = $Plates->OwnerID[$i];
  270. if(isset($_SESSION['USER']->UsersArr[$OwnerID])){
  271. $theOwner = $_SESSION['USER']->UsersArr[$OwnerID];
  272. }
  273. }
  274. ?>
  275. <tr bgcolor="<?echo $TB_CELL_COLOR;?>">
  276. <td width="" align="left"><div class=maintext>&nbsp; &nbsp;
  277. <?echo $Plates->ID[$i];?>&nbsp;
  278. </div>
  279. </td>
  280. <td width="" align="center"><div class=maintext>
  281. <?echo $Plates->Name[$i];?>&nbsp;
  282. </div>
  283. </td>
  284. <td width="" align="center"><div class=maintext>
  285. <?echo $theOwner;?>&nbsp;
  286. </div>
  287. </td>
  288. <td width="" align="center"><div class=maintext>
  289. <?echo $Plates->DateTime[$i] ;?>&nbsp;
  290. </div>
  291. </td>
  292. <td width="" align="center"><div class=maintext>
  293. <?echo $Plates->MSDate[$i] ;?>&nbsp;
  294. </div>
  295. </td>
  296. <td width="" align="left"><div class=maintext>&nbsp; &nbsp; &nbsp;
  297. <a href="javascript:display_plate('<?echo $Plates->ID[$i];?>');">
  298. <?if($Plates->MSDate[$i]){?>
  299. <img border="0" src="./images/icon_plate_check.gif" alt="MS completed"></a>
  300. <a href="./plate_report.php?Plate_ID=<?echo $Plates->ID[$i];?>" class=button><img src="./images/icon_report.gif" border=0 alt="Plate Report"></a>
  301. <?}else{?>
  302. <img border="0" src="./images/icon_plate.gif" alt="bands in plate"></a>
  303. <?}?>
  304. </div>
  305. </td>
  306. </tr>
  307. <?
  308. } //end for
  309. ?>
  310. </table>
  311. <?
  312. } //end of list plate -------------
  313. }
  314. if(($theaction == 'showone' or $theaction=='modifyplate')){
  315. //get all info about this band
  316. //display one plate only
  317. echo "<br>";
  318. if(!$gelFree){
  319. include("plate_info.inc.php");
  320. }
  321. $Band = new Band($Band_ID);
  322. if($Band->ID){
  323. $Location = $Band->Location;
  324. $Bait = new Bait($Band->BaitID); $Bait_ID = $Bait->ID;
  325. $Exp = new Experiment('',$Band->ExpID); $Exp_ID = $Exp->ID;
  326. $Lane = new Lane($Band->LaneID); $Lane_ID = $Lane->ID;
  327. //$Project = new Projects($Band->ProjectID);
  328. $Gel = new Gel($Lane->GelID); $Gel_ID = $Gel->ID;
  329. $BandOwner = get_userName($mainDB, $Band->OwnerID);
  330. include("plate_band_info.inc.php");
  331. ?>
  332. <!--table border="0" cellpadding="0" cellspacing="1" width=740"><tr><td align="right">&nbsp;<br>
  333. <a href="javascript:show_all_peptides('<?=$Band->ID;?>');">Sample Report (peptide detail)</a>
  334. </td></tr></table-->
  335. <?
  336. include("plate_band_hits.inc.php");
  337. }
  338. }//end of show one plate ------------
  339. ?>
  340. </td>
  341. </tr>
  342. </table>
  343. </form>
  344. </body>
  345. </html>