<span class = "msg_subject">

					<?php 
        echo $subject;
        ?>

				</span>

			</div>

			<div class = "msg_bar_right">

				<?php 
        //if this is a search, apply label (inbox, archive, sent, etc)
        if (isset($s)) {
            echo apply_labels($dbh, $id, $username);
        }
        ?>

				<?php 
        echo extract_date_time($time_sent);
        ?>

				<span

					<?php 
        if (in_string($username, $starred)) {
            echo "class = 'star_msg star_on'><img src='html/ico/starred.png' title = 'Remove star from message'>";
        } else {
            echo "class = 'star_msg star_off'><img src='html/ico/not_starred.png' title='Star this message'>";
        }
Beispiel #2
0
function apply_maps($myrxn, $mymap)
{
    $result = "";
    $rxndescr = analyze_rxnfile($myrxn);
    $nrmol = get_nrmol($rxndescr);
    $npmol = get_npmol($rxndescr);
    $allmol = array();
    $allmol = explode("\$MOL\r\n", $myrxn);
    $ca = count($allmol);
    $header = $allmol[0];
    $rlabel_list = array();
    $plabel_list = array();
    $map_list = array();
    $n_rlabels = 0;
    $n_plabels = 0;
    $n_maps = 0;
    if (strlen($mymap) > 0) {
        $map_list = explode(",", $mymap);
        $n_maps = count($map_list);
    }
    if ($nrmol > 0 && $npmol > 0) {
        if ($nrmol > 0) {
            for ($i = 0; $i < $nrmol; $i++) {
                $rmol[$i] = $allmol[$i + 1];
                $mnum = $i + 1;
                $mid = "r" . $mnum;
            }
        }
        if ($npmol > 0) {
            for ($i = 0; $i < $npmol; $i++) {
                $pmol[$i] = $allmol[$i + 1 + $nrmol];
                $mnum = $i + 1;
                $labels = get_atomlabels($pmol[$i]);
                $mid = "p" . $mnum;
            }
        }
        $l = 1;
        foreach ($map_list as $item) {
            $marr1 = explode("=", $item);
            $rpart = $marr1[0];
            $rarr1 = explode(":", $rpart);
            $rm = $rarr1[0];
            $rm = intval(str_replace("r", "", $rm));
            $ra = $rarr1[1];
            $rl = $l;
            $ppart = $marr1[1];
            $parr1 = explode(":", $ppart);
            $pm = $parr1[0];
            $pm = intval(str_replace("p", "", $pm));
            $pa = $parr1[1];
            $pl = $l;
            @($rlbl = $rlabel_list[$rm - 1]);
            if (strlen($rlbl) > 0) {
                $rlbl .= ",";
            }
            $rlbl .= $ra . "-" . $rl;
            $rlabel_list[$rm - 1] = $rlbl;
            @($plbl = $plabel_list[$pm - 1]);
            if (strlen($plbl) > 0) {
                $plbl .= ",";
            }
            $plbl .= $pa . "-" . $pl;
            $plabel_list[$pm - 1] = $plbl;
            $l++;
        }
        for ($i = 0; $i < $nrmol; $i++) {
            $lbl = $rlabel_list[$i];
        }
        for ($i = 0; $i < $npmol; $i++) {
            $lbl = $plabel_list[$i];
        }
        $newrxn = $header;
        for ($i = 0; $i < $nrmol; $i++) {
            $rmol[$i] = apply_labels($rmol[$i], $rlabel_list[$i]);
            $newrxn .= "\$MOL\r\n" . $rmol[$i];
        }
        for ($i = 0; $i < $npmol; $i++) {
            $pmol[$i] = apply_labels($pmol[$i], $plabel_list[$i]);
            $newrxn .= "\$MOL\r\n" . $pmol[$i];
        }
        $result = $newrxn;
    }
    // end if there are both reactants and products
    return $result;
}