$anz_insaddr = ""; $anz_rueckruf = ""; $anz_msn = ""; $anz_ab = ""; $sfcallnr = ""; //link to AB if ($config['capisuite'] && $_SESSION['cs_user'] != "" && check_cs_username($_SESSION['cs_user']) == 0 && $_SESSION['show_linktoam']) { $ab_query = sprintf("SELECT id FROM capisuite WHERE from_nr=((%s==unknown)?-:%s) AND date_time='%s %s' AND MSN='%s' ", $dataB->sql_check($daten['rufnummer']), $dataB->sql_check($daten['rufnummer']), $dataB->sql_check($daten['datum']), $dataB->sql_check($daten['uhrzeit']), $daten['msn']); $ab_res = $dataB->sql_query($ab_query); if (is_array($ab_data = $dataB->sql_fetch_assoc($ab_res))) { $anz_ab = "<a href=\"./cs_hearmessage.php?file=" . $ab_data['id'] . "\"><img src=\"./images/play.png\" border=0></a>"; } } if ($daten['vorwahl'] == "cell phone") { $anz_vorwahl = $textdata['cell_pone']; $anz_rufnr = split_cellphone($daten['rufnummer']); } else { $anz_rufnr = split_number($daten['rufnummer'], $daten['vorwahlnr']); $anz_vorwahl = $daten['vorwahl']; } if ($daten['rufnummer'] == "unknown" && $daten['name'] == "unknown") { if (isset($_GET['datum'])) { $submit_date = "&datum=" . $_GET['datum']; } else { if (isset($_GET['sdatum'])) { $submit_date = "&datum=" . $_GET['sdatum']; } else { $submit_date = ""; } } $anz_name = "<a href=\"./showstatnew.php?unbekannt=yes&einid={$daten['id']}{$submit_date}\">{$textdata['unknown']}</a>";
$wochen = $ergbis / 60 / 60 / 24 / 7; $wochen_genau = ceil($wochen); if ($wochen_genau == 0) { $wochen_genau = 1; } $anrufe_woche = round($ges_anzahl / $wochen_genau, 2); //ende daten sammeln!!!! $template->assign_block_vars('tab1', array('L_DETAIL_VIEW' => 'Detailansicht', 'L_ADDR_FRIST_NAME' => $textdata['addadress_vorname'], 'L_ADDR_LAST_NAME' => $textdata['addadress_nachname'], 'DATA_FIRST_NAME' => $data_adressbuch['name_first'], 'DATA_LAST_NAME' => $data_adressbuch['name_last'])); $result = $dataB->sql_query("SELECT t1.number,t2.vorwahlnr FROM phonenumbers AS t1 LEFT JOIN vorwahl AS t2 ON t2.id=t1.areacode WHERE addr_id='{$id}' AND typ='1'"); while ($daten = $dataB->sql_fetch_assoc($result)) { $daten['number'] = split_number($daten['number'], $daten['vorwahlnr']); $template->assign_block_vars('show_tele', array('L_TELE' => $textdata['addadress_telefonnummer'], 'DATA_TELE' => $daten['number'])); } $result = $dataB->sql_query("SELECT number FROM phonenumbers WHERE addr_id='{$id}' AND typ='2'"); while ($daten = $dataB->sql_fetch_assoc($result)) { $daten['number'] = split_cellphone($daten['number']); $template->assign_block_vars('show_cell_phone', array('L_CELL_PHONE' => $textdata['addadress_handy'], 'DATA_CELL_PHONE' => $daten['number'])); } $result = $dataB->sql_query("SELECT t1.number,t2.vorwahlnr FROM phonenumbers AS t1 LEFT JOIN vorwahl AS t2 ON t2.id=t1.areacode WHERE addr_id='{$id}' AND typ='3'"); while ($daten = $dataB->sql_fetch_assoc($result)) { $daten['number'] = split_number($daten['number'], $daten['vorwahlnr']); $template->assign_block_vars('show_fax', array('L_FAX' => $textdata['addadress_fax'], 'DATA_FAX' => $daten['number'])); } $dataB->sql_close(); $template->assign_block_vars('tab2', array('L_STAT_CALLERS_COUNTS' => $textdata['stat_anrufer_zahlen_fakten'], 'L_ALL_CALLS' => $textdata['stat_anrufer_gesamte_anrufe'], 'DATA_ALL_CALLS' => $ges_anzahl, 'L_STAT_TIME' => $textdata['stat_anrufer_geht_ueber'], 'DATA_WEEKS' => $wochen_genau, 'L_WEKKS' => 'Wochen', 'L_LAST_CALL' => $textdata['stat_anrufer_letzter_anruf'], 'DATA_LAST_DATE' => $datum_letzter, 'DATA_LAST_TIME' => $uhrzeit_letzer, 'L_FRIST_CALL' => $textdata['stat_anrufer_erster_anruf'], 'DATA_FIRST_DATE' => $datum_erster, 'DATA_FIRST_TIME' => $uhrzeit_erster, 'L_CALLS_AVERAGE' => $textdata['stat_anrufer_durchschnitt_anrufe'], 'DATA_CALLS_AVERAGE' => $anrufe_woche)); $template->assign_vars(array('DATA_ID_CALLERS' => $id)); $template->assign_block_vars('tab3', array('L_LSIT_ALL_CALLS' => $textdata['stat_anrufer_alle_anrufe_von'] . " " . $data_adressbuch['name_first'] . " " . $data_adressbuch['name_last'], 'L_DATE' => $textdata['stat_anrufer_datum'], 'L_TIME' => $textdata['stat_anrufer_uhrzeit'], 'L_CALL_NUMBER' => $textdata['stat_anrufer_rufnummer'], 'L_CALL_TO_MSN' => $textdata['stat_anrufer_MSN'])); $dataB->sql_connect($sql["host"], $sql["dbuser"], $sql["dbpasswd"], $sql["db"]); $sql_query = "SELECT datum,uhrzeit,msn,rufnummer FROM\n\tangerufene AS t1,\n\tphonenumbers AS t2 WHERE t1.rufnummer=t2.number \n\tAND t2.addr_id={$id} ORDER BY t1.id DESC"; $result = $dataB->sql_query($sql_query); $dataB->sql_close();
$result = $dataB->sql_query($sqlabfrage); $i = 0; while ($data_addr = $dataB->sql_fetch_assoc($result)) { if ($i % 2 == 0) { $color = $row_color_1; $i = 1; } else { $color = $row_color_2; $i = 0; } $result_tele = $dataB->sql_query("SELECT t1.number,t2.vorwahlnr FROM phonenumbers as t1 LEFT JOIN vorwahl as t2 ON t1.areacode=t2.id WHERE t1.typ='1' AND t1.addr_id='{$data_addr['id']}' LIMIT 1 "); echo mysql_error(); $data_tele = $dataB->sql_fetch_assoc($result_tele); if ($data_tele) { $data_tele['number'] = split_number($data_tele['number'], $data_tele['vorwahlnr']); } $result_cellphone = $dataB->sql_query("SELECT number FROM phonenumbers WHERE typ='2' AND addr_id='{$data_addr['id']}' LIMIT 1"); $data_cellphone = $dataB->sql_fetch_assoc($result_cellphone); if ($data_cellphone) { $data_cellphone['number'] = split_cellphone($data_cellphone['number']); } if (isset($_GET['id']) && $_GET['id'] == $data_addr['id']) { $color = $hightlight_color; $data_tele['number'] = '<a name="find">' . $data_tele['number'] . '</a>'; } $template->assign_block_vars('tab', array('color' => $color, 'addr_id' => $data_addr['id'], 'addr_last_name' => $data_addr['name_last'], 'addr_first_name' => $data_addr['name_first'], 'addr_tele_1' => $data_tele['number'], 'addr_cell_phone' => $data_cellphone['number'], 'addr_edit_entry' => $textdata['adressbuch_eintrag_bearbeiten'], 'addr_delete_entry' => $textdata['adressbuch_eintrag_loeschen'], 'addr_search_entry' => $textdata['adressbuch_suche_eintraege'])); } // Auslesen ENde $dataB->sql_close(); $template->pparse('overall_body'); include "./footer.inc.php";
$template->assign_block_vars('entry_not_found', array('SHOW_ENTRY_NOT_FOUND' => $textdata['editadress_eintrag_mit_nicht_gefunden'])); $template->pparse('overall_body'); $dataB->sql_close(); include "footer.inc.php"; exit; } $template->assign_block_vars('tab1', array('L_FIRST_NAME' => $textdata['addadress_vorname'], 'DATA_FIRST_NAME' => $daten['name_first'], 'DATA_ID_USER' => $daten['id'], 'L_LAST_NAME' => $textdata['addadress_nachname'], 'DATA_LAST_NAME' => $daten['name_last'], 'L_STREET_NAME' => $textdata['addadress_strasse'], 'DATA_STREET_NAME' => $daten['street'], 'L_HOUSE_NUMBER' => $textdata['addadress_hausnummer'], 'DATA_HOUSE_NUMBER' => $daten['housenr'], 'L_ZIP_CODE' => $textdata['addadress_plz'], 'DATA_ZIP_CODE' => $daten['zipcode'], 'L_CITY' => $textdata['addadress_ort'], 'DATA_CITY' => $daten['city'], 'L_E_MAIL' => $textdata['addadress_email'], 'DATA_E_MAIL' => $daten['email'], 'CHANGE_ADDR' => $textdata['editadress_eintrag_aendern'], 'L_ADD_NUMBER' => $textdata['adddress_add_number'])); //telephon: $result_tele = $dataB->sql_query("SELECT t1.id,t1.number,t2.vorwahlnr FROM phonenumbers AS t1 LEFT JOIN vorwahl AS t2 ON t2.id=t1.areacode WHERE typ='1' AND addr_id='{$daten['id']}'"); while ($daten_tele = $dataB->sql_fetch_assoc($result_tele)) { $template->assign_block_vars('tab1.telephon', array('L_TELE' => $textdata['addadress_telefonnummer'], 'L_DB_TELE' => split_number($daten_tele['number'], $daten_tele['vorwahlnr']), 'L_DB_TELE_ID' => $daten_tele['id'], 'L_DB_ID' => $daten['id'], 'L_SAVE' => $textdata['save'], 'L_DELETE' => $textdata['delet'])); } //cell phone: $result_cellphone = $dataB->sql_query("SELECT id,number FROM phonenumbers WHERE typ='2' AND addr_id='{$daten['id']}'"); while ($daten_cellphone = $dataB->sql_fetch_assoc($result_cellphone)) { $template->assign_block_vars('tab1.cellphone', array('L_CELL_PHONE' => $textdata['addadress_handy'], 'L_DB_TELE' => split_cellphone($daten_cellphone['number']), 'L_DB_TELE_ID' => $daten_cellphone['id'], 'L_DB_ID' => $daten['id'], 'L_SAVE' => $textdata['save'], 'L_DELETE' => $textdata['delet'])); } //fax number: $result_fax = $dataB->sql_query("SELECT t1.id,t1.number,t2.vorwahlnr FROM phonenumbers AS t1 LEFT JOIN vorwahl AS t2 ON t2.id=t1.areacode WHERE typ='3' AND addr_id='{$daten['id']}'"); while ($daten_fax = $dataB->sql_fetch_assoc($result_fax)) { $template->assign_block_vars('tab1.fax', array('L_FAX' => $textdata['addadress_fax'], 'L_DB_TELE' => split_number($daten_fax['number'], $daten_fax['vorwahlnr']), 'L_DB_TELE_ID' => $daten_fax['id'], 'L_DB_ID' => $daten['id'], 'L_SAVE' => $textdata['save'], 'L_DELETE' => $textdata['delet'])); } //add number dialog: $template->assign_block_vars('tab1.add', array('ID' => $daten['id'], 'L_ADD' => $textdata['add'], 'L_CELL_PHONE' => $textdata['cell_phone'], 'L_TELE' => $textdata['telephon'], 'L_FAX' => $textdata['fax'])); $template->assign_block_vars('cancel_edit', array('CANCEL_EDIT_ADDR' => $textdata['editadress_abbrechen'])); if (isset($_POST['loeschen_OK']) or isset($_GET['del'])) { $template->assign_block_vars('now_delete_really_entry', array('ID_FROM_ADDR' => $daten['id'], 'REMOVE_ENTRY' => $textdata['adressbuch_eintrag_loeschen'])); } else { $template->assign_block_vars('ask_for_delete_entry', array('ID_FROM_ADDR' => $daten['id'], 'id' => $daten['id'], 'DELETE_ENTRY' => $textdata['adressbuch_eintrag_loeschen'])); } $dataB->sql_close();