2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
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
11 * See the file "copy_notice.txt" for the licence notice
13 define('LANG_FILE','place.php');
14 $local_user='aufnahme_user';
15 require_once($root_path.'include/inc_front_chain_lang.php');
16 # Load the insurance object
17 require_once($root_path.'include/care_api_classes/class_address.php');
18 $address_obj=new Address
;
24 case 'list': $breakfile='citytown_list.php'.URL_APPEND
; break;
25 case 'search': $breakfile='citytown_search.php'.URL_APPEND
; break;
26 default: $breakfile='address_manage.php'.URL_APPEND
;
38 # Validate important data
40 $HTTP_POST_VARS['name']=trim($HTTP_POST_VARS['name']);
41 if(!empty($HTTP_POST_VARS['name'])){
43 # Check if address exists
45 if($address_obj->CityTownExists($HTTP_POST_VARS['name'],$HTTP_POST_VARS['iso_country_id'])){
49 $mode='citytown_exists';
51 if($address_obj->saveCityTownInfoFromArray($HTTP_POST_VARS)){
53 # Get the last insert ID
55 $insid=$db->Insert_ID();
57 # Resolve the ID to the primary key
59 $nr=$address_obj->LastInsertPK('nr',$insid);
61 header("location:citytown_info.php?sid=$sid&lang=$lang&nr=$nr&mode=show&save_ok=1&retpath=$retpath");
63 }else{echo "$sql<br>$LDDbNoSave";}
70 } // end of switch($mode)
73 # Start Smarty templating here
77 # Note: it is advisable to load this after the inc_front_chain_lang.php so
78 # that the smarty script can use the user configured template theme
80 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
81 $smarty = new smarty_care('system_admin');
84 $smarty->assign('sToolbarTitle',"$LDAddress :: $LDNewCityTown");
86 # href for help button
87 $smarty->assign('pbHelp',"javascript:gethelp('address_new.php')");
89 # href for close button
90 $smarty->assign('breakfile',$breakfile);
93 $smarty->assign('sWindowTitle',"$LDAddress :: $LDNewCityTown");
95 # Coller Javascript code
100 <script language
="javascript">
104 if((d
.name
.value
=="")){
105 alert("<?php echo "$LDAlertNoCityTownName \\n
$LDPlsEnterInfo"; ?>");
108 }else if(d
.iso_country_id
.value
==""){
109 alert("<?php echo $LDEnterISOCountryCode.'\n'.$LDEnterQMark; ?>");
110 d
.iso_country_id
.focus();
112 }else if(isNaN(d
.unece_locode_type
.value
)){
113 alert("<?php echo $LDWrongUneceLocCode.'\n'.$LDEnterZero; ?>");
114 d
.unece_locode_type
.focus();
125 $sTemp = ob_get_contents();
128 $smarty->append('JavaScript',$sTemp);
142 <td
><img
<?php
echo createMascot($root_path,'mascot1_r.gif','0','bottom') ?
>></td
>
143 <td valign
="bottom"><br
><font
class="warnprompt"><b
>
149 echo $LDAlertNoCityTownName;
152 case 'citytown_exists':
154 echo "$LDCityTownExists<br>$LDDataNoSave";
167 <form action
="<?php echo $thisfile; ?>" method
="post" name
="citytown" onSubmit
="return check(this)">
168 <font face
="Verdana, Arial" size
=-1><?php
echo $LDEnterAllFields ?
>
171 <td align
=right
class="adm_item"><font color
=#ff0000><b>*</b></font> <?php echo $LDCityTownName ?>: </td>
172 <td
class="adm_input"><input type
="text" name
="name" size
=50 maxlength
=60 value
="<?php echo $name ?>"><br
>
176 <td align
=right
class="adm_item"><?php
echo $LDISOCountryCode ?
>: </td
>
177 <td
class="adm_input"><input type
="text" name
="iso_country_id" size
=50 maxlength
=3 value
="<?php echo $iso_country_id ?>"><br
></td
>
180 <td align
=right
class="adm_item"><?php
echo $LDUNECELocalCode ?
>: </td
>
181 <td
class="adm_input"><input type
="text" name
="unece_locode" size
=50 maxlength
=60 value
="<?php echo $unece_locode ?>"><br
></td
>
184 <td align
=right
class="adm_item"><?php
echo $LDUNECEModifier ?
>: </td
>
185 <td
class="adm_input"><input type
="text" name
="unece_modifier" size
=50 maxlength
=60 value
="<?php echo $unece_modifier ?>"><br
></td
>
188 <td align
=right
class="adm_item"><?php
echo $LDUNECELocalCodeType ?
>: </td
>
189 <td
class="adm_input"><input type
="text" name
="unece_locode_type" size
=50 maxlength
=60 value
="<?php echo $unece_locode_type ?>"><br
></td
>
192 <td align
=right
class="adm_item"><?php
echo $LDUNECECoordinates ?
>: </td
>
193 <td
class="adm_input"><input type
="text" name
="unece_coordinates" size
=50 maxlength
=60 value
="<?php echo $unece_coordinates ?>"><br
></td
>
196 <td align
=right
class="adm_item"><?php
echo $LDWebsiteURL ?
>: </td
>
197 <td
class="adm_input"><input type
="text" name
="info_url" size
=50 maxlength
=60 value
="<?php echo $info_url ?>"><br
></td
>
200 <td
class=pblock
><input type
="image" <?php
echo createLDImgSrc($root_path,'savedisc.gif','0'); ?
>></td
>
201 <td align
=right
><a href
="<?php echo $breakfile ?>"><img
<?php
echo createLDImgSrc($root_path,'cancel.gif','0') ?
> border
="0"></a
></td
>
204 <input type
="hidden" name
="sid" value
="<?php echo $sid ?>">
205 <input type
="hidden" name
="mode" value
="save">
206 <input type
="hidden" name
="lang" value
="<?php echo $lang ?>">
207 <input type
="hidden" name
="retpath" value
="<?php echo $retpath ?>">
214 $sTemp = ob_get_contents();
217 # Assign page output to the mainframe template
219 $smarty->assign('sMainFrameBlockData',$sTemp);
223 $smarty->display('common/mainframe.tpl');