<?php require_once '../etc/utils.php'; require_once '../etc/constants.php'; // We won't tell the error detail to the world. Ssssh! $global_hush_hush = true; //init PHP for header start_working(); //connect to DB init_mysql(); //mode didapat dari post dengan key 'mode' $mode = retrieve_from_post($proto_mode); //version dari post dengan key 'version' $version = retrieve_from_post($proto_version, false); //jika tidak ada data dari post, isi dengan 1 $version = is_null($version) ? 1 : $version; //apikey dari post dengan key 'apikey' $apikey = retrieve_from_post($proto_apikey); //cek database apikey yang digunakan ada atau tidak. jika ada, cek lg IP komputer tersebut diblok atau tidak. check_apikey($apikey); //mode = 'findroute' if ($mode == $proto_mode_findroute) { //addslashes method untuk special char tidak dianggap string lain, misal ',",\ //masukkan ke variabel $start = addslashes(retrieve_from_post($proto_routestart)); $finish = addslashes(retrieve_from_post($proto_routefinish)); $locale = addslashes(retrieve_from_post($proto_locale)); //cek untuk lokalisasi,jika ada, load file tersebut inggris / indo. kalo if (file_exists("../etc/locale/tirtayasa_{$locale}.php")) { require_once "../etc/locale/tirtayasa_{$locale}.php"; } else {
fseek($f, 0, SEEK_END); } $command = $argv[1] ? $argv[1] : 'summary'; switch ($command) { case 'summary': if ($active) { print_working(); } else { print_summary(); } break; case 'start': if ($active) { error("[!] cannot start a new project while one is in progress\n"); } else { start_working($argv[2]); } break; case 'stop': if ($active) { print_working(true); } else { error("[!] there are no active projects running\n"); } break; case 'projects': print_projects(); break; case 'print': print_tracker($active); break;