Links to rx_print changed to make use of GET variable as now required by rx_print...
[openemr.git] / library / DBC_cron.php
blobc3e4f52a99a24583c71b555d6c7f9aadc736ee2c
1 <?php
2 /** DBC DUTCH SYSTEM
3 * Cron only functions
4 *
5 * @author Cristian NAVALICI (lemonsoftware [..] gmail [.] com)
6 * @version 1.0
7 */
9 require_once('DBC_cfunctions.php');
11 dc_yearly_closing();
13 // ----------------------------------------------------------------------------
14 /**
17 @param
18 @return
20 function dc_yearly_closing() {
21 dc_connect();
23 // take all opened DBC
24 $r = mysql_query("SELECT * FROM cl_axes WHERE ax_open = 1");
25 while ( $row = mysql_fetch_array($r) ) {
26 // and calculate the age
27 $age = df_dbc_age($row['ax_id']);
28 if ( $age >= 365 ) {
29 $newid = duplicate_dbc($row['ax_id']);
30 df_cronlog("DBC id: {$row['ax_id']} was duplicated with DBC id: $newid ");
35 //-----------------------------------------------------------------------------
36 /**
37 CONNECT TO DATABASE
39 make the connections to openemr database
40 the variables are taken from sqlconf.php
42 @param none
43 @return void
45 function dc_connect() {
46 require_once(dirname(__FILE__) . '/sqlconf.php');
47 global $host, $login, $pass, $dbase;
49 $link = mysql_connect($host, $login, $pass);
50 if (!$link) {
51 die('Could not connect: ' . mysql_error());
54 mysql_query("USE " . $dbase);