- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / insurance_co / insurance_co_list.php
blob808171fde488622af000cca254e31d93e1006d84
1 <?php
2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
5 /**
6 * CARE2X Integrated Hospital Information System Deployment 2.2 - 2006-07-10
7 * GNU General Public License
8 * Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
9 * elpidio@care2x.org,
11 * See the file "copy_notice.txt" for the licence notice
14 # Default value for the maximum nr of rows per block displayed, define this to the value you wish
15 # In normal cases this value is derived from the db table "care_config_global" using the "pagin_insurance_list_max_block_rows" element.
16 define('MAX_BLOCK_ROWS',30);
18 $lang_tables[]='search.php';
19 define('LANG_FILE','finance.php');
20 $local_user='aufnahme_user';
21 require_once($root_path.'include/inc_front_chain_lang.php');
22 # Load the insurance object
23 require_once($root_path.'include/care_api_classes/class_insurance.php');
24 $ins_obj=new Insurance;
26 $breakfile='insurance_co_manage.php'.URL_APPEND;
27 $thisfile=basename(__FILE__);
29 # Initialize page�s control variables
30 if($mode!='paginate'){
31 # Reset paginator variables
32 $pgx=0;
33 $totalcount=0;
34 # Set the sort parameters
35 if(empty($oitem)) $oitem='name';
36 if(empty($odir)) $odir='ASC';
39 $GLOBAL_CONFIG=array();
40 include_once($root_path.'include/care_api_classes/class_globalconfig.php');
41 $glob_obj=new GlobalConfig($GLOBAL_CONFIG);
42 $glob_obj->getConfig('pagin_insurance_list_max_block_rows');
43 if(empty($GLOBAL_CONFIG['pagin_insurance_list_max_block_rows'])) $GLOBAL_CONFIG['pagin_insurance_list_max_block_rows']=MAX_BLOCK_ROWS; # Last resort, use the default defined at the start of this page
45 #Load and create paginator object
46 require_once($root_path.'include/care_api_classes/class_paginator.php');
47 $pagen=new Paginator($pgx,$thisfile,$HTTP_SESSION_VARS['sess_searchkey'],$root_path);
48 # Adjust the max nr of rows in a block
49 $pagen->setMaxCount($GLOBAL_CONFIG['pagin_insurance_list_max_block_rows']);
51 # Get all the active firms info
52 $firms=$ins_obj->getLimitActiveFirmsInfo($GLOBAL_CONFIG['pagin_insurance_list_max_block_rows'],$pgx,$oitem,$odir);
54 $linecount=$ins_obj->LastRecordCount();
55 $pagen->setTotalBlockCount($linecount);
56 # Count total available data
57 if(isset($totalcount)&&$totalcount){
58 $pagen->setTotalDataCount($totalcount);
59 }else{
60 $totalcount=$ins_obj->countAllActiveFirms();
61 $pagen->setTotalDataCount($totalcount);
64 $pagen->setSortItem($oitem);
65 $pagen->setSortDirection($odir);
68 # Start Smarty templating here
69 /**
70 * LOAD Smarty
72 # Note: it is advisable to load this after the inc_front_chain_lang.php so
73 # that the smarty script can use the user configured template theme
75 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
76 $smarty = new smarty_care('system_admin');
78 # Title in toolbar
79 $smarty->assign('sToolbarTitle',"$LDInsuranceCo :: $LDListAll");
81 # href for help button
82 $smarty->assign('pbHelp',"javascript:gethelp('insurance_list.php')");
84 # href for close button
85 $smarty->assign('breakfile',$breakfile);
87 # Window bar title
88 $smarty->assign('sWindowTitle',"$LDInsuranceCo :: $LDListAll");
90 # Buffer page output
92 ob_start();
96 <ul>
98 <?php
99 if(is_object($firms)){
101 if ($linecount) echo str_replace("~nr~",$totalcount,$LDSearchFound).' '.$LDShowing.' '.$pagen->BlockStartNr().' '.$LDTo.' '.$pagen->BlockEndNr().'.';
102 else echo str_replace('~nr~','0',$LDSearchFound);
105 <table border=0 cellpadding=2 cellspacing=1>
106 <tr class="wardlisttitlerow">
107 <td><b>
108 <?php echo $pagen->makeSortLink($LDFirmID,'firm_id',$oitem,$odir); ?></b>
109 </td>
110 <td><b>
111 <?php echo $pagen->makeSortLink($LDInsuranceCoName,'name',$oitem,$odir); ?></b>
112 </td>
113 <td><b>
114 <?php echo $pagen->makeSortLink($LDMainPhoneNr,'phone_main',$oitem,$odir); ?></b>
115 </td>
116 <td><b>
117 <?php echo $pagen->makeSortLink($LDMainFaxNr,'fax_main',$oitem,$odir); ?></b>
118 </td>
119 <td><b>
120 <?php echo $pagen->makeSortLink($LDEmailAddress,'addr_email',$oitem,$odir); ?></b>
121 </td>
122 </tr>
123 <?php
124 $toggle=0;
125 while($firm=$firms->FetchRow()){
126 if($toggle) $bgc='#dddddd';
127 else $bgc='#efefef';
128 $toggle=!$toggle;
130 <tr bgcolor="<?php echo $bgc ?>">
131 <td><a href="insurance_co_info.php<?php echo URL_APPEND.'&retpath=list&firm_id='.$firm['firm_id']; ?>"><?php echo $firm['firm_id']; ?></a></td>
132 <td><a href="insurance_co_info.php<?php echo URL_APPEND.'&retpath=list&firm_id='.$firm['firm_id']; ?>"><?php echo $firm['name']; ?></a></td>
133 <td><?php echo $firm['phone_main']; ?></td>
134 <td><?php echo $firm['fax_main']; ?></td>
135 <td><?php if($firm['addr_email']){ echo '<img '.createComIcon($root_path,'email.gif','0').'>'; ?> <a href="mailto:<?php echo $firm['addr_email']; ?>"><?php echo $firm['addr_email']; ?></a><?php } ?></td>
136 </td>
137 </tr>
138 <?php
140 echo '
141 <tr><td colspan=4>'.$pagen->makePrevLink($LDPrevious).'</td>
142 <td align=right>'.$pagen->makeNextLink($LDNext).'</td>
143 </tr>';
145 </table>
146 <?php
147 }else{
148 echo str_replace('~nr~','0',$LDSearchFound);
152 <form action="insurance_co_new.php" method="post">
153 <input type="hidden" name="lang" value="<?php echo $lang ?>">
154 <input type="hidden" name="sid" value="<?php echo $sid ?>">
155 <input type="submit" value="<?php echo $LDNeedEmptyFormPls ?>">
156 </form>
157 </ul>
159 <?php
161 $sTemp = ob_get_contents();
162 ob_end_clean();
164 # Assign page output to the mainframe template
166 $smarty->assign('sMainFrameBlockData',$sTemp);
168 * show Template
170 $smarty->display('common/mainframe.tpl');