PHP Labware source code viewer / Internal utilities | 04 Jul, 2025
Root | Help
./LabStoRe/labstore/modules/proteins.php
<?php

/*
LabStoRe
Version: 1.6.3
Date: 6 September 2014
Copyright: Santosh Patnaik, MD, PhD
License: GPL 3+
URL: www.bioinformatics.org/phplabware
*/

// Module-specific
$table = 'proteins'; // Mysql table name
$head_extra = ''; // extra to include in HTML before </head>; style, javascript
$heading_color = '#82CAFA'; // table column heading and page number list row
$row_color_1 = '#bdedff'; // alternating row colors
$row_color_2 = '#ffffff'; // alternating row colors
$extra_bottom = ''; // extra, will appear at bottom; message
$column_nos = '6'; // number of columns - for colspan table rows (page number row, etc.)

include(realpath(dirname(__FILE__) . '/../header.php'));
echo '<p><span style="color:#dcdcdc;">', $header_to_show, ' || <a href="../help/help.htm" onclick="return popitup(\'../help/help.htm\')">Help</a> || <a>', $date, '</a></span></p></div><div style="padding-left: 5px;">';

// Array of options and values for use with search and sort forms below; format is 'MySQL table field name' => 'Text that appears on webpage'
$option_value = array('name'=>'Name/description', 'nature'=>'Nature', 'source'=>'Source', 'made_in'=>'Species made in', 'reactivity'=>'Reactivity', 'conjugate'=>'Conjugate', 'fridge'=>'Location', 'modified_on'=>'Update date', 'added_on'=>'Add date', 'modified_by'=>'Updater', 'added_by'=>'Adder');

// Build upper table
echo '<table width="750" summary="top" cellpadding="5" cellspacing="1" style="background-color:#dcdcdc; border:0;  background-image:url(\'../images/proteins_small.gif\'); background-position: top right;background-repeat: no-repeat;"><tr><td>';

include(realpath(dirname(__FILE__) . '/../top_part.php'));

if($num_sat !== 0) {
  // Column headings
  echo '<colgroup><col width="40" valign="top" align="left" /><col valign="top" align="left" /><col valign="top" align="left" /><col valign="top" align="left" /><col valign="top" align="left" /><col valign="top" width="170" align="left" /></colgroup><tr style="background-color:', $heading_color, ';" valign="top"><td></td><td >Name/description</td><td>Nature</td><td>Source</td><td >Location</td><td></td></tr>';

  for($i = 0; $i < $numofrows; $i++) {
    $row = database_fetch_array($result);
    if($i % 2) {
      echo "<tr style=\"background-color:", $row_color_1, ";\" valign=\"top\">";
    }
    else {
      echo "<tr style=\"background-color:", $row_color_2, ";\" valign=\"top\">";
    }

    // Serial number of item (not record ID)
    $sn = (($page - 1) * $max_results) + $i + 1;
    
    echo '<td>', $sn, '</td><td>', htmlspecialchars($row["name"]);
    if($row["made_in"] != '') {
      echo '<br />Made in&nbsp;', htmlspecialchars($row["made_in"]);
    }
    echo '</td><td valign=top>', htmlspecialchars($row["nature"]);
    if($row["reactivity"] != '') {
      echo '<br />Against&nbsp;', str_replace('~', ' ', htmlspecialchars($row["reactivity"]));
    }
    if($row["isotype"] != '') {
      echo '<br />', htmlspecialchars($row["isotype"]), '&nbsp;isotype';
    }
    if($row["conjugate"] != '') {
      echo '<br />', htmlspecialchars($row["conjugate"]), '&nbsp;conjugate';
    }
    echo '</td><td>', htmlspecialchars($row["source"]), '</td><td>', htmlspecialchars($row["box"]), '<br />', htmlspecialchars($row["fridge"]);
    echo '</td><td><span style="color:#736F6E;">';
    if($row["added_on"] != '' and $row["added_on"] != '0000-00-00') {
      echo 'Added ', htmlspecialchars($row["added_on"]), '<br />';
    }
    if($row["modified_on"] != '' and $row["modified_on"] != '0000-00-00') {
      echo 'Updated ', htmlspecialchars($row["modified_on"]), '<br />';
    }
    
    // Detail link
    echo '<a href="../interface_creator/index_short.php?table_name=proteins&amp;function=details&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]), '" onclick="return popitup(\'../interface_creator/index_short.php?table_name=proteins&amp;function=details&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]) , '\')">Details</a>';
    
    // Edit, copy and delete links
    if(!($all_affect_items == "no" and $client == "not_allowed")) {
      echo ' | <a href="../interface_creator/index_short.php?table_name=proteins&amp;function=edit&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]), '" onclick="return popitup(\'../interface_creator/index_short.php?table_name=proteins&amp;function=edit&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]), '\')"> Edit</a> | <a href="../interface_creator/index_short.php?table_name=proteins&amp;function=delete&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]), '" onclick="return confipop(\'../interface_creator/index_short.php?table_name=proteins&amp;function=delete&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]) . '\')"> Delete</a> | <a href="../interface_creator/index_short.php?table_name=proteins&amp;function=copy&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]), '" onclick="return popitup(\'../interface_creator/index_short.php?table_name=proteins&amp;function=copy&amp;where_field=id&amp;where_value=', rawurlencode($row["id"]), '\')"> Copy</a>';
    }
    echo('</span></td></tr>');
  }
  include(realpath(dirname(__FILE__) . '/../bottom_part.php'));
}

include(realpath(dirname(__FILE__) . '/../footer.php'));
Presented with Sourceer
PHP Labware home | visitors since Sept 2017