75 lines
2.1 KiB
PHP
75 lines
2.1 KiB
PHP
<?php
|
|
$page = "general";
|
|
include "header.php";
|
|
if( !$user->user_exists)
|
|
{
|
|
$page = "error";
|
|
$smarty->assign('error_header', 639);
|
|
$smarty->assign('error_message', 656);
|
|
$smarty->assign('error_submit', 641);
|
|
include "footer.php";
|
|
}
|
|
function general(){
|
|
global $user, $database;
|
|
if(isset($_GET["id"])&&isset($_GET["delete"]))
|
|
{
|
|
$database->database_query("DELETE FROM travelers WHERE id='".$database->database_real_escape_string($_GET["id"])."' AND userid='".$user->user_info["user_id"]."'");
|
|
}
|
|
?><a href="addtravel.php">Add a travel plan</a><table class="table"><?
|
|
$query=$database->database_query("SELECT * FROM travelers WHERE userid='".$user->user_info["user_id"]."' ");
|
|
while($row=$database->database_fetch_array($query))
|
|
{
|
|
?><tr><td style="border:0px;"><strong>Visiting: </strong><? if(trim($row["city"])!=""){echo $row["city"].", ";}if(trim($row["city"])!=""){echo $row["province"].", ";} if(trim($row["country"])!=""){echo $row["country"]." ";}?>
|
|
<br />
|
|
<strong>From:</strong> <?=date("F j, Y", $row["arrive"])?>
|
|
<br />
|
|
<strong>To:</strong> <?=date("F j, Y", $row["depart"])?><br />
|
|
<strong>Seeks: </strong><?
|
|
$seek=unserialize($row["seeking"]);
|
|
|
|
$seeking="";
|
|
$split=explode(",", $seek);
|
|
if(in_array("1", $split))
|
|
{
|
|
$seeking="J/O date";
|
|
}
|
|
if(in_array("2", $split))
|
|
{
|
|
if($seeking==""){
|
|
$seeking="Accommodation";}
|
|
else{
|
|
$seeking.=", Accommodation";}
|
|
}
|
|
if(in_array("3", $split))
|
|
{
|
|
if($seeking==""){
|
|
$seeking="J/O date(and more)";}
|
|
else{
|
|
$seeking.=", J/O date(and more)";}
|
|
}
|
|
if(in_array("4", $split))
|
|
{
|
|
if($seeking==""){
|
|
$seeking="Coffee/Dinner";}
|
|
else{
|
|
$seeking.=", Coffee/Dinner";}
|
|
}
|
|
echo $seeking;?><br>
|
|
|
|
<strong>More info:</strong><br>
|
|
<?php echo $row["moreinfo"];?>
|
|
</td><td valign="top" style="border:0px;"><a href="edittravel.php?id=<?=$row["id"]?>">Edit Travel Plan</a> | <a href="mytravel.php?id=<?=$row["id"]?>&delete" onclick="return confirm('Are you sure you want to delete this?');"><?=$row["cnt"]?>Delete Travel Plan</a></td></tr><?
|
|
}
|
|
?>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<?
|
|
}
|
|
// ASSIGN SMARTY VARS AND INCLUDE FOOTER
|
|
$smarty->assign('forumcats', $forumcat_array);
|
|
$smarty->assign('forum_is_moderator', $forum_is_moderator);
|
|
include "footer.php";
|
|
?>
|