예제 #1
0
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.

******************************************************************************************/
$locs = array();
$list = '<script type="text/javascript">!window.jQuery && document.write(\'<script src="jquery/jquery-1.4.3.min.js"><\\/script>\');';
$dbconn = new DBConn();
$res = $dbconn->query("SELECT pid, name FROM place", array());
if ($res) {
    while (($row = $resultset->fetch()) != false) {
        $locs[] = "{$row[1]} ({$row[0]})";
    }
    $list .= '<!-- $(function () { $(\'#f, #t\').tagSuggest({ tags: ["' . implode('","', $locs) . '"] }); }); //-->';
}
$list .= '</script>';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Bus Route Finder</title>
<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
<link href="img/bus.ico" rel="icon" type="image/vnd.microsoft.icon"/>
<link href='http://fonts.googleapis.com/css?family=Cabin&v1' rel='stylesheet' type='text/css' />
        $checks[$row['check']]['amount'] += $ta->cost;
    }
    $task_activity_result->free();
    debug('Added task activities to sureinvoice!');
}
$si_db = new DBConn(DB_SERVER, DB_DATABASE, DB_USER, DB_PASSWORD);
assert_die($si_db->connect(TRUE), "Could not connect to sureinvoice database!\n" . $si_db->getLastError());
debug('Connected to sureinvoice database ' . DB_DATABASE);
$dt_db = new DBConn($phpdt_server, $phpdt_database, $phpdt_username, $phpdt_password);
assert_die($dt_db->connect(TRUE), "Could not connect to phpdt database!\n" . $dt_db->getLastError());
debug('Connected to phpdt database ' . $phpdt_database);
// Migrate companies
$companies = array();
$company_rates = array();
$company_sql = "\nSELECT `id`, `name`, `address1`, `address2`, `city`, `state`,\n`zip`, `phone`, `fax`, `hourly_rate`, `created_ts`, `updated_ts`\nFROM `companies`\n";
$company_result = $dt_db->query($company_sql, TRUE);
assert_die($company_result, "Could not get company list!\n" . $dt_db->getLastError());
debug('Got ' . $company_result->numRows() . ' company rows from phpdt.');
while ($row = $company_result->fetchArray(MYSQL_ASSOC)) {
    $company_insert_sql = "\nINSERT INTO companies (id, name, address1, address2, city,\nstate, zip, phone, fax, hourly_rate,created_ts, updated_ts)\nVALUES(" . $row['id'] . ", '" . $si_db->escapeString($row['name']) . "', '" . $row['address1'] . "', \n'" . $row['address2'] . "', '" . $row['city'] . "', '" . $row['state'] . "', \n'" . $row['zip'] . "', '" . $row['phone'] . "', '" . $row['fax'] . "', \n" . $row['hourly_rate'] . ", " . $row['created_ts'] . ", " . $row['updated_ts'] . ")\n\t";
    assert_die($si_db->query($company_insert_sql, TRUE), "Error adding company!\n" . $si_db->getLastError(), FALSE);
    debug('Added ' . $row['name'] . ' to sureinvoice');
    $company_rates[$row['id']] = $row['hourly_rate'];
    $companies[$row['id']] = $row;
}
$company_result->free();
// Migrate users
$users = array();
$user_sql = "\nSELECT `id`, `user_type_id`, `first_name`, `last_name`, `company_id`, \n`address1`, `address2`, `city`, `state`, `zip`, `email`, `password`, \n`hourly_rate`, `rate_type`, `active`, `created_ts`, `updated_ts`, \n`last_login_ts` \nFROM `users`";
$user_result = $dt_db->query($user_sql, TRUE);
assert_die($user_result, "Could not get user list!\n" . $dt_db->getLastError());
예제 #3
0
******************************************************************************************/
echo <<<OUT
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Bus Route Finder</title>
</head>
<body>
<div><strong>I want to go on a bus from</strong>
<br/>
<form action="query.php" method="get" enctype="text/plain" autocomplete="off">
OUT;
$dbconn = new DBConn();
$res = $dbconn->query("SELECT pid, name FROM place ORDER BY p.name ASC", array());
$options = '';
if ($res) {
    while (($row = $resultset->fetch()) != false) {
        $options .= '<option value="' . $row[0] . '">' . $row[1] . '</option>' . "\n";
    }
}
echo <<<OUT
<label for="f">from</label><select id="f" name="f">
{$options}
</select><br/>
<label for="t">to</label><select id="t" name="t">
{$options}
</select>
<input type="hidden" name="v" value="mobile">
<button type="submit">find a bus</button>