| 1 |
<?php |
<?php |
| 2 |
// $Id: stormperson.admin.inc,v 1.3 2008/05/18 08:25:06 robertogerola Exp $ |
// $Id: stormperson.admin.inc,v 1.4 2008/05/19 08:18:25 robertogerola Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 41 |
); |
); |
| 42 |
|
|
| 43 |
$where = array(); |
$where = array(); |
| 44 |
$s = "SELECT n.*, spe.* FROM {stormperson} spe INNER JOIN {node} n ON n.nid=spe.nid WHERE n.status=1 AND n.type='stormperson' "; |
$s = "SELECT n.*, spe.* FROM {node} AS n INNER JOIN {stormperson} AS spe ON n.nid=spe.nid WHERE n.status=1 AND n.type='stormperson' "; |
| 45 |
if ($_SESSION['stormperson_list_filter']['organization_nid']) { |
if ($_SESSION['stormperson_list_filter']['organization_nid']) { |
| 46 |
$where[] = 'spe.organization_nid='. $_SESSION['stormperson_list_filter']['organization_nid']; |
$where[] = 'spe.organization_nid='. $_SESSION['stormperson_list_filter']['organization_nid']; |
| 47 |
} |
} |
| 51 |
$itemsperpage = $_SESSION['stormperson_list_filter']['itemsperpage']; |
$itemsperpage = $_SESSION['stormperson_list_filter']['itemsperpage']; |
| 52 |
|
|
| 53 |
$s = stormperson_access_sql($s, $where); |
$s = stormperson_access_sql($s, $where); |
| 54 |
$s = db_rewrite_sql($s, 'stormperson', 'nid'); |
$s = db_rewrite_sql($s); |
| 55 |
|
|
| 56 |
$tablesort = tablesort_sql($header); |
$tablesort = tablesort_sql($header); |
| 57 |
$r = pager_query($s . $tablesort, $itemsperpage, 0, NULL); |
$r = pager_query($s . $tablesort, $itemsperpage, 0, NULL); |
| 91 |
'#weight' => -20, |
'#weight' => -20, |
| 92 |
); |
); |
| 93 |
|
|
| 94 |
$s = "SELECT n.nid, n.title FROM {stormorganization} sor INNER JOIN {node} n ON sor.nid=n.nid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title"; |
$s = db_rewrite_sql("SELECT n.nid, n.title FROM {stormorganization} sor INNER JOIN {node} n ON sor.nid=n.nid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title"); |
| 95 |
$r = db_query(stormorganization_access_sql($s)); |
$r = db_query(stormorganization_access_sql($s)); |
| 96 |
$organizations = array(); |
$organizations = array(); |
| 97 |
while ($organization = db_fetch_object($r)) { |
while ($organization = db_fetch_object($r)) { |