Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/sys_uninew.txt
<?php
/*
OpenDataBag - Data Web Interface
Copyright (C) 2004 Nawara

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

$group=get('group');

$change_array=array();
$res=opendir(cfg_data_path.'/script/structure/');
while($fl = readdir($res))
  if(substr($fl,0,4)=='grp_' and substr($fl,-4)=='.php')
  {
    $change_array[substr($fl,4,-4)]=1;
  }
closedir($res);

addpath(cfg_data_path.'/config/structure/');
$res=opendir(cfg_data_path.'/config/structure/');
while($fl = readdir($res))
  if(substr($fl,0,4)=='grp_' and substr($fl,-4)=='.php')
  {
    $change_array[substr($fl,4,-4)]=2;
  }
closedir($res);

ksort($change_array);

echo '<div class="supergroup">';

echo '<h1>';
myecho('Add New...');
echo '</h1>';

echo '<h2>';
myecho('Add New Record');
echo '</h2>';

echo '<ol>';

  //echo '<li><a href="index.php?odb_sys=structure&amp;odb_new=1" title="Add new object">';
  //  myecho('Add New Object');
  //echo '</a></li>';

reset($change_array);
while(list($change,$level)=each($change_array))
{
  if($level!=1)
  {
    $variable_array=load_config($change);
  
    $font_size='';
	if( count($variable_array)>99)  $font_size='font-size:17px;';
    elseif( count($variable_array)>40)  $font_size='font-size:16px;';
    elseif( count($variable_array)>20)  $font_size='font-size:15px;';
    elseif( count($variable_array)<21)  $font_size='font-size:12px;';

    echo '<li><a style="'.$font_size.'" href="index.php?odb_script=new&amp;odb_group='.$variable_array['sysGroupBy']['value'].'">'.$variable_array['sysGroupBy']['value'].'</a></li>';
  }
}
echo '</ol>';

echo '<h2>';
myecho('Examples');
echo '</h2>';

echo '<ol>';
  echo '<li><a href="index.php?odb_script=chart&odb_search=test&odb_title=Region&odb_type=3d+column&a0=Name&a1=&a2=&a3=&a4=&a5=&b0=&b1=&b2=&b3=&b4=&b5=&c0=Income&d0=sum">'.myecho('Column Chart','RETURN').'</a></li>';
  echo '<li><a href="index.php?odb_script=chart&odb_search=test&odb_title=Region&odb_type=3d+pie&a0=-&b0=Name&c0=Income&d0=sum">'.myecho('Pie Chart','RETURN').'</a></li>';
  echo '<li><a href="index.php?odb_script=report&odb_search=&k2=sysGroupBy&n1=TOTAL&k3=sysModBy">'.myecho('Report','RETURN').'</a></li>';
  echo '<li><a href="index.php?odb_search=articles&odb_script=cube&odb_title=&odb_type=&a0=Language&b0=&c0=Articles&d0=&a1=Menu+item">'.myecho('Cube','RETURN').'</a></li>';
  echo '<li><a href="index.php?odb_script=xcal">'.myecho('Universal Calendar','RETURN').'</a></li>';
  echo '<li><a href="index.php?odb_script=xrcal">'.myecho('Resource Calendar','RETURN').'</a></li>';
  //echo '<li><a href="index.php?odb_script=cal">New Calendar</a></li>';
  //echo '<li><a href="index.php?odb_script=rcal">New Resource Calendar</a></li>';
  echo '<li><a href="index.php?odb_script=report&odb_search=&k2=sysGroupBy&n1=TOTAL&k3=sysModBy&e1=DUBLETS">'.myecho('Deduplication Report','RETURN').'</a></li>';
  echo '<li><a href="index.php?odb_search=&odb_tree0=MyBag&odb_tree1=sysGroupBy">'.myecho('Tree View','RETURN').'</a></li>';

  echo '<li><a href="map.php?odb_map=pl-woj&odb_search=sysgroupby%3dtest&odb_title=Map Example A&odb_value_field_name=Income&odb_region_field_name=Region&odb_colorset=redgreen">'.myecho('Map A','RETURN').'</a></li>';
  echo '<li><a href="map.php?odb_map=ch-postal&odb_search=sysgroupby%3dtest&odb_title=Map Example B&odb_value_field_name=Income&odb_region_field_name=Region&odb_colorset=redgreen">'.myecho('Map B','RETURN').'</a></li>';
  //odb_search=%3D&odb_script=chart&odb_title=Quality&odb_type=3d+pie&a0=-&b0=Quality&c0=Quality&d0=&a1=&b1=&c1=&d1=&a2=&b2=&c2=&d2=&a3=&b3=&c3=&d3=&a4=&b4=&c4=&d4=&a5=&b5=&c5=&d5=&a6=&b6=&c6=&d6=&a7=&b7=&c7=&d7=&a8=&b8=&c8=&d8=&a9=&b9=&c9=&d9=

  $res=opendir(cfg_data_path.'/../maps/');
  while($fl = readdir($res))
  if(substr($fl,-4)=='.png')
  {
    echo '<li>'.substr($fl,0,-4).' - ';
    echo '<a href="odb_map.php?odb_map='.substr($fl,0,-4).'&odb_search=---&odb_title='.substr($fl,0,-4).'">';
    myecho('Internal map');
    echo '</a> | ';
    echo '<a href="map.php?odb_map='.substr($fl,0,-4).'&odb_search=---&odb_title='.substr($fl,0,-4).'">';
    myecho('External map');
    echo '</a>';
    echo '</li>';
  }
closedir($res);
echo '</ol>';


echo '<h2>';
myecho('Add New System Record');
echo '</h2>';

echo '<ol>';
reset($change_array);
while(list($change,$level)=each($change_array))
{
  $variable_array=load_config($change);

  $font_size='';
      if( count($variable_array)>99)  $font_size='font-size:17px;';
  elseif( count($variable_array)>40)  $font_size='font-size:16px;';
  elseif( count($variable_array)>20)  $font_size='font-size:15px;';
  elseif( count($variable_array)<21)  $font_size='font-size:12px;';

  if($level==1) //system default objects
    echo '<li><a style="font-size:12px; color:#888;" href="index.php?odb_script=new&amp;odb_group='.$variable_array['sysGroupBy']['value'].'#object">'.$variable_array['sysGroupBy']['value'].' ('.myecho('standard object','RETURN').')</a></li>';
  else
  {
    //echo '<li><a style="'.$font_size.'" href="index.php?odb_script=new&amp;odb_group='.$variable_array['sysGroupBy']['value'].'">'.$variable_array['sysGroupBy']['value'].'</a></li>';
  }
}
echo '</ol>';


echo '</div>';

?>
Return current item: OpenBizMap