Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- Setup vi syntax for PHP
- increase mysql query speed
- EXCEL return to the next line in the same cell
- git svn conversion
Tuesday, February 11, 2014
Department database design (12) - improve search interface
First space between column is too c rowdy.
http://localhost/ubc_surgery_pub/scripts/manage/?action=listpeople&deptid=1
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\index.php, line 29 change
echo "<table border=\"0\"><tr><td valign=\"top\">";
to
echo "<table border=\"0\"><tr><td width=20% valign=\"top\">";
line 30 change
echo "\n </td><td valign=\"top\">";
to
echo "\n </td><td width=20% valign=\"top\">";
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\query\searchform.inc.php, line 161 remove
<label><input type="checkbox" name="eprintsonly" value="y" />
Eprints only</label></p>
line 170 change
<label>Author search:<br /><input name="namesearch" type="text" id="namesearch" /></label>
to
<label>Author search:<br /></label>
<select name="namesearch">
<option value=""> --- Choose a person --- </option>
<?php
foreach(getallpeople1() as $k=>$v){
$numpublished = countPubsPerUser2($k);
echo "\n<option value=\"$k\">$v[LASTNAME],$v[FIRSTNAME] ($numpublished)</option>";
}
?>
</select>
line 227 add
function getallpeople1()
{
global $dbcon;
$res = mysql_query("SELECT USERID, FIRSTNAME, LASTNAME FROM USERS ORDER BY LASTNAME, FIRSTNAME", $dbcon);
$ret = array();
while($row = mysql_fetch_assoc($res))
$ret[$row['USERID']] = $row;
return $ret;
}
function countPubsPerUser2($userids){
global $dbcon;
$userids = mysql_real_escape_string($userids);
$q = "SELECT COUNT(*) AS cnt, userlist FROM PUBLICATIONS WHERE FIND_IN_SET('$userids',userlist)";
if(!($res = mysql_query($q, $dbcon)))
return 0;
while($row = mysql_fetch_assoc($res)){
$counts= $row['cnt'];
}
return $counts;
}
?>
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\query\displayqueryterms.inc.php, line 67 change
if(strlen($namesearch)>0){
$querystrings[] = "<em>" . htmlspecialchars(stripslashes($namesearch)) . "</em> in authors";
to
if(strlen($namesearch)>0){
$tempdbcon = mysql_connect($config['db_addr'],$config['db_user'],$config['db_pass']);
@mysql_select_db($config['db_db']);
$q = "SELECT firstname, lastname FROM USERS WHERE userid=$namesearch";
$res = mysql_query($q, $tempdbcon);
$deptsnames = array();
while($row = mysql_fetch_assoc($res))
// $querystrings[] = "<em>" . htmlspecialchars(stripslashes($namesearch)) . "</em> in authors";
$querystrings[] = "<em>" . $row['lastname'].','.$row['firstname']. "</em> in authors";
@mysql_close($tempdbcon);
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\query\index.php, line 288 change
$wh .= "CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) LIKE '%$vv%' AND CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) REGEXP '$rvv' AND ";
to
$wh .= " CONCAT_WS(' ', userlist) REGEXP '$rvv' AND ";
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment