* @author Claire Figueras */ include("session.php"); if(file_exists($_SESSION['config']['lang'].'.php')) { include($_SESSION['config']['lang'].'.php'); } else { $_SESSION['error'] = "Language file missing...
"; } ?> <?php echo $_SESSION['config']['applicationname']; ?> connect(); $db2 = new dbquery(); $db2->connect(); $couleur=0; if(empty($_SESSION['tablechoice'])) { $_SESSION['tablechoice'] = 'res_x'; } if(isset($_GET['id'])) { $s_id = $_GET['id']; } else { $s_id = ""; } if(isset($_GET['start'])) { $db->the_start = strip_tags($_GET['start']); } else { $db->the_start = 0; } //Users list $db2->query("SELECT USER_ID,LASTNAME, FIRSTNAME FROM ".$_SESSION['tablename']['users']); while( $res = $db2->fetch_object() ) { $users_list[$res->USER_ID]['LASTNAME'] = $res->LASTNAME; $users_list[$res->USER_ID]['FIRSTNAME'] = $res->FIRSTNAME; } //Services list $db2->query("SELECT ID,SERVICE FROM ".$_SESSION['tablename']['services']); while( $res = $db2->fetch_object() ) { $services_list[$res->ID]['SERVICE'] = $res->SERVICE; } //Usergroups list $db2->query("SELECT GROUP_ID, GROUP_DESC FROM ".$_SESSION['tablename']['usergroups']); while( $res = $db2->fetch_object() ) { $usergroups_list[$res->GROUP_ID]['GROUP_DESC'] = $res->GROUP_DESC; } $nb_show = $_SESSION['config']['nblinetoshow']; $page_name = "hist_courrier"; $what = ""; $db->query("select count(*) as total from ".$_SESSION['tablename']['history']." WHERE TABLE_NAME= '".$_SESSION['tablechoice']."' AND RECORD_ID= ".$s_id); $nb_total_1 = $db->fetch_object(); $nb_total = $nb_total_1->total; // define the defaults values $nb_pages = ceil($nb_total/$nb_show); $link = "hist_courrier.php?title=on&id=".$s_id; if($nb_pages > 1) { $next_start = 0; $page_list1 = '

'; $lastpage = 0; for($i = 0;$i <> $nb_pages; $i++) { $page_name = $i + 1; $the_line = $i + 1; if($db->the_start == $next_start) { $page_list1 .= ""; $page_list2 .= ""; } else { $page_list1 .= ""; $page_list2 .= ""; } $next_start = $next_start + $nb_show; $lastpage = $next_start; } $lastpage = $lastpage - $nb_show; $previous = ""; $next = ""; if($db->the_start > 0) { $start_prev = $db->the_start - $nb_show; $previous = ''; } if($db->the_start <> $lastpage) { $start_next = $db->the_start + $nb_show; $next = ''; } $page_list1 = $page_list1.""; $page_list2 = $page_list2.""; if($previous <> '' || $next <> '') { if(empty($previous)) { $previous = " "; } if(empty($next)) { $next = " "; } $page_list1 .= $previous." ".$next.'

'; $page_list2 .= $previous." ".$next.'

'; } } $db->query("select INFO, EVENT_DATE, EVENT_TYPE, USER_ID from ".$_SESSION['tablename']['history']." WHERE TABLE_NAME= '".$_SESSION['tablechoice']."' AND RECORD_ID= ".$s_id." ORDER BY EVENT_DATE desc limit ".$db->the_start.",".$nb_show); if(isset($_GET['title'])) { echo '

'._DOC_HISTORY.'

'; } echo $page_list1; ?>
fetch_object()) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } $db2->query("select LASTNAME, FIRSTNAME from ".$_SESSION['tablename']['users']." where USER_ID = '".$res->USER_ID."'"); $res2 = $db2->fetch_object(); $nom = $res2->LASTNAME; $prenom = $res2->FIRSTNAME; ?> >
dateformat($res->EVENT_DATE); ?> INFO; $replace_new_line = array("\n","\r\n"); $info = str_replace($replace_new_line,"
",$info); if($res->EVENT_TYPE == "RED") { $regex = "/(.*".trim(_REDIRECTED_TO)."\s*)(\S*)(\s*\S*)/"; if( preg_match($regex,trim($info),$result) ) { if( isset($users_list[$result[2]]) ) $info = preg_replace($regex,"$1 ".$users_list[$result[2]]["LASTNAME"]." ".$users_list[$result[2]]["FIRSTNAME"]." $3",trim($info)); else if( isset($services_list[$result[2]]) ) $info = preg_replace($regex,"$1 ".$services_list[$result[2]]["SERVICE"]." $3",trim($info)); } } echo $info; ?>
"details") {?>