mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-02 08:27:15 +00:00
improve farmlist (not 100%)
This commit is contained in:
+26
-228
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
if(isset($_GET['t'])==99 && isset($_GET['action'])==0) {
|
if(isset($_GET['t'])==99 && isset($_GET['action'])==0) {
|
||||||
|
|
||||||
if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList'){
|
if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList' && $_POST['did']!="" && $_POST['name']!=""){
|
||||||
$database->createFarmList($_POST['did'], $session->uid, $_POST['name']);
|
$database->createFarmList($_POST['did'], $session->uid, $_POST['name']);
|
||||||
|
}else if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList'){
|
||||||
|
header("Location: build.php?gid=16&t=99&action=addList");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
|
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
|
||||||
@@ -68,9 +70,12 @@ $vdata = $database->getVillage($towref);
|
|||||||
?>
|
?>
|
||||||
<tr class="slotRow">
|
<tr class="slotRow">
|
||||||
<td class="checkbox">
|
<td class="checkbox">
|
||||||
|
<?php if($checked[$lid] == 0){ ?>
|
||||||
<input id="slot<?php echo $id; ?>" name="slot[<?php echo $id; ?>]" type="checkbox" class="markSlot" onclick="Travian.Game.RaidList.markSlotForRaid(<?php echo $lid; ?>, <?php echo $id; ?>, this.checked);">
|
<input id="slot<?php echo $id; ?>" name="slot[<?php echo $id; ?>]" type="checkbox" class="markSlot" onclick="Travian.Game.RaidList.markSlotForRaid(<?php echo $lid; ?>, <?php echo $id; ?>, this.checked);">
|
||||||
</td>
|
<?php }else{ ?>
|
||||||
|
<input id="slot<?php echo $id; ?>" name="slot[<?php echo $id; ?>]" type="checkbox" class="markSlot" checked>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
<td class="village">
|
<td class="village">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
@@ -96,9 +101,9 @@ $vdata = $database->getVillage($towref);
|
|||||||
<span class="coordinates coordinatesWithText">
|
<span class="coordinates coordinatesWithText">
|
||||||
<span class="coordText">Oasis</span>
|
<span class="coordText">Oasis</span>
|
||||||
<span class="coordinatesWrapper">
|
<span class="coordinatesWrapper">
|
||||||
<span class="coordinateY"><?php echo $y; ?>)</span>
|
<span class="coordinateY">(<?php echo $x; ?></span>
|
||||||
<span class="coordinatePipe">|</span>
|
<span class="coordinatePipe">|</span>
|
||||||
<span class="coordinateX">(<?php echo $x; ?></span>
|
<span class="coordinateX"><?php echo $y; ?>)</span>
|
||||||
</span></span>
|
</span></span>
|
||||||
<?php }else{ ?>
|
<?php }else{ ?>
|
||||||
<span class="coordinates coordinatesWithText">
|
<span class="coordinates coordinatesWithText">
|
||||||
@@ -109,7 +114,7 @@ $vdata = $database->getVillage($towref);
|
|||||||
<span class="clear"></span>
|
<span class="clear"></span>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td class="ew"><?php echo $vdata['pop']; ?></td>
|
<td class="ew"><?php if($oasistype == 0){ echo $vdata['pop']; }else{ echo "<center>-</center>"; }; ?></td>
|
||||||
<td class="distance"><?php echo $distance; ?></td>
|
<td class="distance"><?php echo $distance; ?></td>
|
||||||
<td class="troops">
|
<td class="troops">
|
||||||
|
|
||||||
@@ -187,9 +192,9 @@ $vdata = $database->getVillage($towref);
|
|||||||
<td class="lastRaid">
|
<td class="lastRaid">
|
||||||
<?php
|
<?php
|
||||||
$noticeClass = array("Scout Report","Won as attacker without losses","Won as attacker with losses","Lost as attacker with losses","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Lost as defender without losses","Reinforcement arrived","","Wood Delivered","Clay Delivered","Iron Delivered","Crop Delivered","","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Won scouting as attacker","Lost scouting as attacker","Won scouting as defender","Lost scouting as defender");
|
$noticeClass = array("Scout Report","Won as attacker without losses","Won as attacker with losses","Lost as attacker with losses","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Lost as defender without losses","Reinforcement arrived","","Wood Delivered","Clay Delivered","Iron Delivered","Crop Delivered","","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Won scouting as attacker","Lost scouting as attacker","Won scouting as defender","Lost scouting as defender");
|
||||||
$limits = "ntype!=4 and ntype!=5 and ntype!=6 and ntype!=7";
|
$limits = "(ntype=1 or ntype=2 or ntype=3 or ntype=18 or ntype=19 or ntype=22)";
|
||||||
$getnotice = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".$towref." ORDER BY time DESC Limit 1");
|
$getnotice = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".$towref." ORDER BY time DESC Limit 1");
|
||||||
|
if(mysql_num_rows($getnotice) > 0){
|
||||||
while($row2 = mysql_fetch_array($getnotice)){
|
while($row2 = mysql_fetch_array($getnotice)){
|
||||||
$dataarray = explode(",",$row2['data']);
|
$dataarray = explode(",",$row2['data']);
|
||||||
$type2 = $row2['ntype'];
|
$type2 = $row2['ntype'];
|
||||||
@@ -211,11 +216,12 @@ while($row2 = mysql_fetch_array($getnotice)){
|
|||||||
$date = $generator->procMtime($row2['time']);
|
$date = $generator->procMtime($row2['time']);
|
||||||
echo "<a href=\"berichte.php?id=".$row2['id']."\">".$date[0]." ".date('H:i',$row2['time'])."</a> ";
|
echo "<a href=\"berichte.php?id=".$row2['id']."\">".$date[0]." ".date('H:i',$row2['time'])."</a> ";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</td>
|
</td>
|
||||||
<td class="action">
|
<td class="action">
|
||||||
<a class="arrow" href="#" onclick="Travian.Game.RaidList.editSlot(<?php echo $lid; ?>, <?php echo $id; ?>); return false;">edit</a>
|
<a class="arrow" href="build.php?id=39&t=99&action=showSlot&eid=<?php echo $id; ?>">edit</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
@@ -226,12 +232,16 @@ while($row2 = mysql_fetch_array($getnotice)){
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="markAll">
|
<div class="markAll">
|
||||||
<input type="checkbox" id="raidListMarkAll<?php echo $lid; ?>" class="markAll" onclick="Travian.Game.RaidList.markAllSlotsOfAListForRaid(<?php echo $lid; ?>, this.checked);">
|
<?php if($checked[$lid] == 0){ ?>
|
||||||
|
<input type="checkbox" id="raidListMarkAll<?php echo $lid; ?>" class="markAll" onclick="window.location.href = '?gid=16&t=99&slid=<?php echo $lid; ?>';">
|
||||||
|
<?php }else{ ?>
|
||||||
|
<input type="checkbox" id="raidListMarkAll<?php echo $lid; ?>" class="markAll" onclick="window.location.href = '?gid=16&t=99';" checked>
|
||||||
|
<?php } ?>
|
||||||
<label for="raidListMarkAll<?php echo $lid; ?>">Select All</label>
|
<label for="raidListMarkAll<?php echo $lid; ?>">Select All</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="addSlot">
|
<div class="addSlot">
|
||||||
<a href="build.php?id=39&t=99&action=showSlot&lid=">Add Raid</a>
|
<a href="build.php?id=39&t=99&action=addraid&lid=<?php echo $lid; ?>">Add Raid</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
@@ -253,7 +263,7 @@ for($i=$start;$i<=$end;$i++){
|
|||||||
<button type="submit" value="Start Raid"><div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Start Raid</div></div></button> </div>
|
<button type="submit" value="Start Raid"><div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Start Raid</div></div></button> </div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php }else{ ?>
|
<?php }else{ ?>
|
||||||
<div id="list<?php echo $lid; ?>" class="listEntry">
|
<div id="list<?php echo $lid; ?>" class="listEntry">
|
||||||
<div class="round spacer listTitle" onclick="Travian.Game.RaidList.toggleList(<?php echo $lid; ?>);">
|
<div class="round spacer listTitle" onclick="Travian.Game.RaidList.toggleList(<?php echo $lid; ?>);">
|
||||||
@@ -349,222 +359,10 @@ $NUM1++;
|
|||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
|
||||||
|
|
||||||
$troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10']."";
|
|
||||||
|
|
||||||
if($_POST['x'] && $_POST['y']){
|
|
||||||
$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
|
|
||||||
$type = $database->getVillageType2($Wref);
|
|
||||||
$oasistype = $type['oasistype'];
|
|
||||||
$vdata = $database->getVillage($Wref);
|
|
||||||
}
|
|
||||||
if(!$_POST['x'] && !$_POST['y']){
|
|
||||||
$errormsg .= "Enter coordinates.";
|
|
||||||
}elseif(!$_POST['x'] || !$_POST['y']){
|
|
||||||
$errormsg .= "Enter the correct coordinates.";
|
|
||||||
}elseif($oasistype == 0 && $vdata == 0){
|
|
||||||
$errormsg .= "In this village there are no coordinates.";
|
|
||||||
}elseif($troops == 0){
|
|
||||||
$errormsg .= "No troops has been selected.";
|
|
||||||
}else{
|
|
||||||
|
|
||||||
$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
|
|
||||||
$coor = $database->getCoor($village->wid);
|
|
||||||
|
|
||||||
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
|
||||||
$max = 2 * WORLD_MAX + 1;
|
|
||||||
$x1 = intval($coorx1);
|
|
||||||
$y1 = intval($coory1);
|
|
||||||
$x2 = intval($coorx2);
|
|
||||||
$y2 = intval($coory2);
|
|
||||||
$distanceX = min(abs($x2 - $x1), abs($max - abs($x2 - $x1)));
|
|
||||||
$distanceY = min(abs($y2 - $y1), abs($max - abs($y2 - $y1)));
|
|
||||||
$dist = sqrt(pow($distanceX, 2) + pow($distanceY, 2));
|
|
||||||
return round($dist, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$distance = getDistance($coor['x'], $coor['y'], $_POST['y'], $_POST['x']);
|
|
||||||
|
|
||||||
$database->addSlotFarm($_POST['lid'], $Wref, $_POST['x'], $_POST['y'], $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
|
|
||||||
|
|
||||||
header("Location: build.php?id=39&t=99");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var targets = {};
|
|
||||||
|
|
||||||
function fillTargets()
|
|
||||||
{
|
|
||||||
var targetId = $('target_id');
|
|
||||||
|
|
||||||
targetId.empty();
|
|
||||||
|
|
||||||
var option = new Element('option',
|
|
||||||
{
|
|
||||||
'html': 'Choose a village'
|
|
||||||
});
|
|
||||||
targetId.insert(option);
|
|
||||||
|
|
||||||
$each(targets[lid], function(data)
|
|
||||||
{
|
|
||||||
var option = new Element('option',
|
|
||||||
{
|
|
||||||
'value': data.did,
|
|
||||||
'html': data.name
|
|
||||||
});
|
|
||||||
targetId.insert(option);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTargetsByLid()
|
|
||||||
{
|
|
||||||
var lidSelect = $('lid');
|
|
||||||
lid = lidSelect.getSelected()[0].value;
|
|
||||||
|
|
||||||
if (targets[lid])
|
|
||||||
{
|
|
||||||
fillTargets();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Travian.ajax(
|
|
||||||
{
|
|
||||||
data:
|
|
||||||
{
|
|
||||||
cmd: 'raidListTargets',
|
|
||||||
'lid': lid
|
|
||||||
},
|
|
||||||
onSuccess: function(data)
|
|
||||||
{
|
|
||||||
targets[data.lid] = data.targets;
|
|
||||||
fillTargets();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectCoordinates()
|
|
||||||
{
|
|
||||||
var targetId = $('target_id');
|
|
||||||
var did = targetId.getSelected()[0].value;
|
|
||||||
|
|
||||||
if (did == '')
|
|
||||||
{
|
|
||||||
$('xCoordInput').value = '';
|
|
||||||
$('yCoordInput').value = '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var array;
|
|
||||||
$each(targets[lid], function(data)
|
|
||||||
{
|
|
||||||
if (data.did == did)
|
|
||||||
{
|
|
||||||
array = data;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('xCoordInput').value = array.x;
|
|
||||||
$('yCoordInput').value = array.y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var lid = <?php echo $_GET['lid']; ?>;targets[lid] = {};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<?php if($create == 1){
|
<?php if($create == 1){
|
||||||
include("Templates/goldClub/farmlist_add.tpl");
|
include("Templates/goldClub/farmlist_add.tpl");
|
||||||
}else if($query > 1){ ?>
|
}else if($create == 2){
|
||||||
<div id="raidListSlot">
|
include("Templates/goldClub/farmlist_addraid.tpl");
|
||||||
<h4>Add Raid</h4>
|
}else if($create == 3){
|
||||||
<font color="#FF0000"><b>
|
include("Templates/goldClub/farmlist_editraid.tpl");
|
||||||
<?php echo $errormsg; ?>
|
|
||||||
</b></font>
|
|
||||||
|
|
||||||
<form action="build.php?id=39&t=99&action=showSlot&lid=<?php echo $_GET['lid']; ?>" method="post">
|
|
||||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
|
||||||
|
|
||||||
<input type="hidden" name="action" value="addSlot">
|
|
||||||
<input type="hidden" name="lid" value="<?php echo $_GET['lid']; ?>">
|
|
||||||
|
|
||||||
|
|
||||||
<table cellpadding="1" cellspacing="1" class="transparent">
|
|
||||||
<tbody><tr>
|
|
||||||
<th>From List</th>
|
|
||||||
<td>
|
|
||||||
<select onchange="getTargetsByLid();" id="lid" name="lid">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
|
||||||
while($row = mysql_fetch_array($sql)){
|
|
||||||
$lid = $row["id"];
|
|
||||||
$lname = $row["name"];
|
|
||||||
$lowner = $row["owner"];
|
|
||||||
$lwref = $row["wref"];
|
|
||||||
$lvname = $database->getVillageField($row["wref"], 'name');
|
|
||||||
if($_GET['lid']==$lid){
|
|
||||||
$selected = 'selected=""';
|
|
||||||
}else{ $selected = ''; }
|
|
||||||
echo '<option value="'.$lid.'" '.$selected.'>'.$lvname.' - '.$lname.'</option>';
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Coordinates:</th>
|
|
||||||
<td class="target">
|
|
||||||
|
|
||||||
<div class="coordinatesInput">
|
|
||||||
<div class="xCoord">
|
|
||||||
<label for="xCoordInput">X:</label>
|
|
||||||
<input value="<?php echo $_POST['y']; ?>" name="y" id="xCoordInput" class="text coordinates y ">
|
|
||||||
</div>
|
|
||||||
<div class="yCoord">
|
|
||||||
<label for="yCoordInput">Y:</label>
|
|
||||||
<input value="<?php echo $_POST['x']; ?>" name="x" id="yCoordInput" class="text coordinates x ">
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
|
||||||
<div class="targetSelect">
|
|
||||||
<label class="lastTargets" for="last_targets">Villiages</label>
|
|
||||||
<select id="target_id" name="target_id" onchange="selectCoordinates()">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql1 = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
|
||||||
while($row1 = mysql_fetch_array($sql1)){
|
|
||||||
$lid1 = $row1["id"];
|
|
||||||
$lname1 = $row1["name"];
|
|
||||||
$lowner1 = $row1["owner"];
|
|
||||||
$lwref1 = $row1["wref"];
|
|
||||||
$lvname1 = $database->getVillageField($row1["wref"], 'name');
|
|
||||||
if($_GET['lid']==$lid){
|
|
||||||
$selected = 'selected=""';
|
|
||||||
}else{ $selected = ''; }
|
|
||||||
echo '<option value="'.$lwref1.'" '.$selected1.'>'.$lvname1.'</option>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody></table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php include "Templates/goldClub/trooplist.tpl"; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<button type="submit" value="Add" name="save" id="save"><div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Add</div></div></button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
@@ -1,18 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
$FLData = $database->getFLData($_GET['lid']);
|
||||||
|
if($FLData['owner'] == $session->uid){
|
||||||
if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
||||||
|
|
||||||
$troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10']."";
|
$troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10']."";
|
||||||
|
|
||||||
if($_POST['x'] && $_POST['y']){
|
if($_POST['target_id'] != ""){
|
||||||
$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
|
$Wref = $_POST['target_id'];
|
||||||
$type = $database->getVillageType2($Wref);
|
$WrefCoor = $database->getCoor($Wref);
|
||||||
$oasistype = $type['oasistype'];
|
$WrefX = $WrefCoor['x'];
|
||||||
$vdata = $database->getVillage($Wref);
|
$WrefY = $WrefCoor['y'];
|
||||||
}
|
$type = $database->getVillageType2($Wref);
|
||||||
if(!$_POST['x'] && !$_POST['y']){
|
$oasistype = $type['oasistype'];
|
||||||
|
$vdata = $database->getVillage($Wref);
|
||||||
|
}elseif($_POST['x'] && $_POST['y']){
|
||||||
|
$Wref = $database->getVilWref($_POST['x'], $_POST['y']);
|
||||||
|
$WrefX = $_POST['x'];
|
||||||
|
$WrefY = $_POST['y'];
|
||||||
|
$type = $database->getVillageType2($Wref);
|
||||||
|
$oasistype = $type['oasistype'];
|
||||||
|
$vdata = $database->getVillage($Wref);
|
||||||
|
}
|
||||||
|
if(!$_POST['x'] && !$_POST['y'] && $_POST['target_id'] == ""){
|
||||||
$errormsg .= "Enter coordinates.";
|
$errormsg .= "Enter coordinates.";
|
||||||
}elseif(!$_POST['x'] || !$_POST['y']){
|
}elseif((!$_POST['x'] || !$_POST['y']) && $_POST['target_id'] == ""){
|
||||||
$errormsg .= "Enter the correct coordinates.";
|
$errormsg .= "Enter the correct coordinates.";
|
||||||
}elseif($oasistype == 0 && $vdata == 0){
|
}elseif($oasistype == 0 && $vdata == 0){
|
||||||
$errormsg .= "There is no village on those coordinates.";
|
$errormsg .= "There is no village on those coordinates.";
|
||||||
@@ -20,7 +31,16 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+"
|
|||||||
$errormsg .= "No troops has been selected.";
|
$errormsg .= "No troops has been selected.";
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
|
if($_POST['target_id'] != ""){
|
||||||
|
$Wref = $_POST['target_id'];
|
||||||
|
$WrefCoor = $database->getCoor($Wref);
|
||||||
|
$WrefX = $WrefCoor['x'];
|
||||||
|
$WrefY = $WrefCoor['y'];
|
||||||
|
}else{
|
||||||
|
$Wref = $database->getVilWref($_POST['x'], $_POST['y']);
|
||||||
|
$WrefX = $_POST['x'];
|
||||||
|
$WrefY = $_POST['y'];
|
||||||
|
}
|
||||||
$coor = $database->getCoor($village->wid);
|
$coor = $database->getCoor($village->wid);
|
||||||
|
|
||||||
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
||||||
@@ -35,119 +55,32 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+"
|
|||||||
return round($dist, 1);
|
return round($dist, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$distance = getDistance($coor['x'], $coor['y'], $_POST['y'], $_POST['x']);
|
$distance = getDistance($coor['x'], $coor['y'], $WrefX, $WrefY);
|
||||||
|
|
||||||
$database->addSlotFarm($_POST['lid'], $Wref, $_POST['x'], $_POST['y'], $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
|
$database->addSlotFarm($_POST['lid'], $Wref, $WrefX, $WrefY, $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
|
||||||
|
|
||||||
header("Location: build.php?id=39&t=99");
|
header("Location: build.php?id=39&t=99");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var targets = {};
|
|
||||||
|
|
||||||
function fillTargets()
|
|
||||||
{
|
|
||||||
var targetId = $('target_id');
|
|
||||||
|
|
||||||
targetId.empty();
|
|
||||||
|
|
||||||
var option = new Element('option',
|
|
||||||
{
|
|
||||||
'html': 'Select village'
|
|
||||||
});
|
|
||||||
targetId.insert(option);
|
|
||||||
|
|
||||||
$each(targets[lid], function(data)
|
|
||||||
{
|
|
||||||
var option = new Element('option',
|
|
||||||
{
|
|
||||||
'value': data.did,
|
|
||||||
'html': data.name
|
|
||||||
});
|
|
||||||
targetId.insert(option);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTargetsByLid()
|
|
||||||
{
|
|
||||||
var lidSelect = $('lid');
|
|
||||||
lid = lidSelect.getSelected()[0].value;
|
|
||||||
|
|
||||||
if (targets[lid])
|
|
||||||
{
|
|
||||||
fillTargets();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Travian.ajax(
|
|
||||||
{
|
|
||||||
data:
|
|
||||||
{
|
|
||||||
cmd: 'raidListTargets',
|
|
||||||
'lid': lid
|
|
||||||
},
|
|
||||||
onSuccess: function(data)
|
|
||||||
{
|
|
||||||
targets[data.lid] = data.targets;
|
|
||||||
fillTargets();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectCoordinates()
|
|
||||||
{
|
|
||||||
var targetId = $('target_id');
|
|
||||||
var did = targetId.getSelected()[0].value;
|
|
||||||
|
|
||||||
if (did == '')
|
|
||||||
{
|
|
||||||
$('xCoordInput').value = '';
|
|
||||||
$('yCoordInput').value = '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var array;
|
|
||||||
$each(targets[lid], function(data)
|
|
||||||
{
|
|
||||||
if (data.did == did)
|
|
||||||
{
|
|
||||||
array = data;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('xCoordInput').value = array.x;
|
|
||||||
$('yCoordInput').value = array.y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var lid = <?php echo $_GET['lid']; ?>;targets[lid] = {};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="raidListSlot">
|
<div id="raidListSlot">
|
||||||
<h4>Add Slot</h4>
|
<h4>Add Slot</h4>
|
||||||
<font color="#FF0000"><b>
|
<font color="#FF0000"><b>
|
||||||
<?php echo $errormsg; ?>
|
<?php echo $errormsg; ?>
|
||||||
</b></font>
|
</b></font>
|
||||||
|
|
||||||
<form action="build.php?id=39&t=99&action=showSlot&lid=<?php echo $_GET['lid']; ?>" method="post">
|
<form action="build.php?id=39&t=99&action=addraid&lid=<?php echo $_GET['lid']; ?>" method="post">
|
||||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
||||||
|
|
||||||
<input type="hidden" name="action" value="addSlot">
|
<input type="hidden" name="action" value="addSlot">
|
||||||
<input type="hidden" name="lid" value="<?php echo $_GET['lid']; ?>">
|
|
||||||
|
|
||||||
|
|
||||||
<table cellpadding="1" cellspacing="1" class="transparent">
|
<table cellpadding="1" cellspacing="1" class="transparent">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Farm Name:</th>
|
<th>Farm Name:</th>
|
||||||
<td>
|
<td>
|
||||||
<select onchange="getTargetsByLid();" id="lid" name="lid">
|
<select name="lid">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||||
@@ -182,10 +115,31 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="targetSelect">
|
<div class="targetSelect">
|
||||||
<label class="lastTargets" for="last_targets">Last targets:</label>
|
<label class="lastTargets">Last targets:</label>
|
||||||
<select id="target_id" name="target_id" onchange="selectCoordinates()">
|
<select name="target_id">
|
||||||
<option value="">Select village</option>
|
<?php
|
||||||
</select>
|
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$_GET['lid']."";
|
||||||
|
$arraywref = $database->query_return($getwref);
|
||||||
|
echo '<option value="">Select village</option>';
|
||||||
|
if(mysql_num_rows(mysql_query($getwref)) != 0){
|
||||||
|
foreach($arraywref as $row){
|
||||||
|
$towref = $row["towref"];
|
||||||
|
$tocoor = $database->getCoor($towref);
|
||||||
|
$totype = $database->getVillageType2($towref);
|
||||||
|
$tooasistype = $totype['oasistype'];
|
||||||
|
if($tooasistype == 0){
|
||||||
|
$tovname = $database->getVillageField($towref, 'name');
|
||||||
|
}else{
|
||||||
|
$tovname = $database->getOasisField($towref, 'name');
|
||||||
|
}
|
||||||
|
if($vill[$towref] == 0){
|
||||||
|
echo '<option value="'.$towref.'">'.$tovname.'('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
|
||||||
|
}
|
||||||
|
$vill[$towref] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</td>
|
</td>
|
||||||
@@ -200,3 +154,8 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
|||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
}else{
|
||||||
|
header("Location: build.php?id=39&t=99");
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -4,20 +4,31 @@ $eiddata = $database->getRaidList($_GET['eid']);
|
|||||||
$x = $eiddata['x'];
|
$x = $eiddata['x'];
|
||||||
$y = $eiddata['y'];
|
$y = $eiddata['y'];
|
||||||
$t1 = $eiddata['t1'];$t2 = $eiddata['t2'];$t3 = $eiddata['t3'];$t4 = $eiddata['t4'];$t5 = $eiddata['t5'];$t6 = $eiddata['t6'];$t7 = $eiddata['t7'];$t8 = $eiddata['t8'];$t9 = $eiddata['t9'];$t10 = $eiddata['t10'];
|
$t1 = $eiddata['t1'];$t2 = $eiddata['t2'];$t3 = $eiddata['t3'];$t4 = $eiddata['t4'];$t5 = $eiddata['t5'];$t6 = $eiddata['t6'];$t7 = $eiddata['t7'];$t8 = $eiddata['t8'];$t9 = $eiddata['t9'];$t10 = $eiddata['t10'];
|
||||||
|
$FLData = $database->getFLData($eiddata['lid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['action']) == 'editSlot' && $_POST['eid']) {
|
if(isset($_POST['action']) == 'editSlot' && $_POST['eid']) {
|
||||||
|
if($_POST['target_id'] != ""){
|
||||||
$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
|
$Wref = $_POST['target_id'];
|
||||||
|
$WrefCoor = $database->getCoor($Wref);
|
||||||
|
$WrefX = $WrefCoor['x'];
|
||||||
|
$WrefY = $WrefCoor['y'];
|
||||||
$type = $database->getVillageType2($Wref);
|
$type = $database->getVillageType2($Wref);
|
||||||
$oasistype = $type['oasistype'];
|
$oasistype = $type['oasistype'];
|
||||||
$vdata = $database->getVillage($Wref);
|
$vdata = $database->getVillage($Wref);
|
||||||
|
}elseif($_POST['x'] && $_POST['y']){
|
||||||
|
$Wref = $database->getVilWref($_POST['x'], $_POST['y']);
|
||||||
|
$WrefX = $_POST['x'];
|
||||||
|
$WrefY = $_POST['y'];
|
||||||
|
$type = $database->getVillageType2($Wref);
|
||||||
|
$oasistype = $type['oasistype'];
|
||||||
|
$vdata = $database->getVillage($Wref);
|
||||||
|
}
|
||||||
$troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10']."";
|
$troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10']."";
|
||||||
|
|
||||||
if(!$_POST['x'] && !$_POST['y']){
|
if(!$_POST['x'] && !$_POST['y'] && $_POST['target_id'] == ""){
|
||||||
$errormsg .= "Enter coordinates.";
|
$errormsg .= "Enter coordinates.";
|
||||||
}elseif(!$_POST['x'] || !$_POST['y']){
|
}elseif((!$_POST['x'] || !$_POST['y']) && $_POST['target_id'] == ""){
|
||||||
$errormsg .= "Enter the correct coordinates.";
|
$errormsg .= "Enter the correct coordinates.";
|
||||||
}elseif($oasistype == 0 && $vdata == 0){
|
}elseif($oasistype == 0 && $vdata == 0){
|
||||||
$errormsg .= "There is no village on those coordinates.";
|
$errormsg .= "There is no village on those coordinates.";
|
||||||
@@ -25,7 +36,16 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+"
|
|||||||
$errormsg .= "No troops has been selected.";
|
$errormsg .= "No troops has been selected.";
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
|
if($_POST['target_id'] != ""){
|
||||||
|
$Wref = $_POST['target_id'];
|
||||||
|
$WrefCoor = $database->getCoor($Wref);
|
||||||
|
$WrefX = $WrefCoor['x'];
|
||||||
|
$WrefY = $WrefCoor['y'];
|
||||||
|
}else{
|
||||||
|
$Wref = $database->getVilWref($_POST['x'], $_POST['y']);
|
||||||
|
$WrefX = $_POST['x'];
|
||||||
|
$WrefY = $_POST['y'];
|
||||||
|
}
|
||||||
$coor = $database->getCoor($village->wid);
|
$coor = $database->getCoor($village->wid);
|
||||||
|
|
||||||
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
||||||
@@ -39,103 +59,17 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+"
|
|||||||
$dist = sqrt(pow($distanceX, 2) + pow($distanceY, 2));
|
$dist = sqrt(pow($distanceX, 2) + pow($distanceY, 2));
|
||||||
return round($dist, 1);
|
return round($dist, 1);
|
||||||
}
|
}
|
||||||
$distance = getDistance($coor['x'], $coor['y'], $_POST['y'], $_POST['x']);
|
$distance = getDistance($coor['x'], $coor['y'], $WrefX, $WrefY);
|
||||||
|
|
||||||
$database->editSlotFarm($_GET['eid'], $_POST['lid'], $Wref, $_POST['x'], $_POST['y'], $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
|
$database->editSlotFarm($_GET['eid'], $_POST['lid'], $Wref, $WrefX, $WrefY, $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
|
||||||
|
|
||||||
header("Location: build.php?id=39&t=99");
|
header("Location: build.php?id=39&t=99");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($FLData['owner'] == $session->uid){
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var targets = {};
|
|
||||||
|
|
||||||
function fillTargets()
|
|
||||||
{
|
|
||||||
var targetId = $('target_id');
|
|
||||||
|
|
||||||
targetId.empty();
|
|
||||||
|
|
||||||
var option = new Element('option',
|
|
||||||
{
|
|
||||||
'html': 'Select village'
|
|
||||||
});
|
|
||||||
targetId.insert(option);
|
|
||||||
|
|
||||||
$each(targets[lid], function(data)
|
|
||||||
{
|
|
||||||
var option = new Element('option',
|
|
||||||
{
|
|
||||||
'value': data.did,
|
|
||||||
'html': data.name
|
|
||||||
});
|
|
||||||
targetId.insert(option);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTargetsByLid()
|
|
||||||
{
|
|
||||||
var lidSelect = $('lid');
|
|
||||||
lid = lidSelect.getSelected()[0].value;
|
|
||||||
|
|
||||||
if (targets[lid])
|
|
||||||
{
|
|
||||||
fillTargets();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Travian.ajax(
|
|
||||||
{
|
|
||||||
data:
|
|
||||||
{
|
|
||||||
cmd: 'raidListTargets',
|
|
||||||
'lid': lid
|
|
||||||
},
|
|
||||||
onSuccess: function(data)
|
|
||||||
{
|
|
||||||
targets[data.lid] = data.targets;
|
|
||||||
fillTargets();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectCoordinates()
|
|
||||||
{
|
|
||||||
var targetId = $('target_id');
|
|
||||||
var did = targetId.getSelected()[0].value;
|
|
||||||
|
|
||||||
if (did == '')
|
|
||||||
{
|
|
||||||
$('xCoordInput').value = '';
|
|
||||||
$('yCoordInput').value = '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var array;
|
|
||||||
$each(targets[lid], function(data)
|
|
||||||
{
|
|
||||||
if (data.did == did)
|
|
||||||
{
|
|
||||||
array = data;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('xCoordInput').value = array.x;
|
|
||||||
$('yCoordInput').value = array.y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var lid = <?php echo $_GET['lid']; ?>;targets[lid] = {};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="raidListSlot">
|
<div id="raidListSlot">
|
||||||
<h4>Add Slot</h4>
|
<h4>Add Slot</h4>
|
||||||
<font color="#FF0000"><b>
|
<font color="#FF0000"><b>
|
||||||
@@ -190,9 +124,31 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="targetSelect">
|
<div class="targetSelect">
|
||||||
<label class="lastTargets" for="last_targets">Last targets:</label>
|
<label class="lastTargets">Last targets:</label>
|
||||||
<select id="target_id" name="target_id" onchange="selectCoordinates()">
|
<select name="target_id">
|
||||||
<option value="">Select village</option>
|
<?php
|
||||||
|
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid2";
|
||||||
|
$arraywref = $database->query_return($getwref);
|
||||||
|
echo '<option value="">Select village</option>';
|
||||||
|
if(mysql_num_rows(mysql_query($getwref)) != 0){
|
||||||
|
foreach($arraywref as $row){
|
||||||
|
$towref = $row["towref"];
|
||||||
|
$tocoor = $database->getCoor($towref);
|
||||||
|
$totype = $database->getVillageType2($towref);
|
||||||
|
$tooasistype = $totype['oasistype'];
|
||||||
|
if($tooasistype == 0){
|
||||||
|
$tovname = $database->getVillageField($towref, 'name');
|
||||||
|
}else{
|
||||||
|
$tovname = $database->getOasisField($towref, 'name');
|
||||||
|
}
|
||||||
|
if($row["id"] == $_GET['eid']){ $selected = 'selected=""'; }else{ $selected = ''; }
|
||||||
|
if($vill[$towref] == 0){
|
||||||
|
echo '<option value="'.$towref.'" '.$selected.'>'.$tovname.'('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
|
||||||
|
}
|
||||||
|
$vill[$towref] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
@@ -205,15 +161,11 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
|||||||
|
|
||||||
|
|
||||||
<button type="submit" value="save" name="save" id="save"><div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Save</div></div></button>
|
<button type="submit" value="save" name="save" id="save"><div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Save</div></div></button>
|
||||||
<button type="button" value="delete" name="delete" id="delete" onclick="return (function(){
|
<button type="button" value="delete" name="delete" id="delete" onclick="window.location.href = '?gid=16&t=99&action=deleteSlot&eid=<?php echo $_GET["eid"]; ?>';"><div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Delete</div></div></button>
|
||||||
('Are you sure that you want to delete this list?').dialog(
|
|
||||||
{
|
|
||||||
onOkay: function(dialog, contentElement)
|
|
||||||
{
|
|
||||||
window.location.href = 'build.php?id=39&t=99&action=deleteSlot&eid=<?php echo $_GET['eid']; ?>'}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
})()">
|
|
||||||
<div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">Delete</div></div></button>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
}else{
|
||||||
|
header("Location: build.php?id=39&t=99");
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -168,16 +168,21 @@ if($session->goldclub == 1 && $session->access != BANNED){
|
|||||||
|
|
||||||
if($_GET['action'] == 'addList') {
|
if($_GET['action'] == 'addList') {
|
||||||
$create = 1;
|
$create = 1;
|
||||||
}else{
|
}else if($_GET['action'] == 'addraid') {
|
||||||
$create = 0;
|
$create = 2;
|
||||||
|
}else if($_GET['action'] == 'showSlot' && $_GET['eid']) {
|
||||||
|
$create = 3;
|
||||||
|
}else{
|
||||||
|
$create = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['action'] == 'addraid') {
|
if($_GET['slid']) {
|
||||||
include("Templates/goldClub/farmlist_addraid.tpl");
|
$FLData = $database->getFLData($_GET['slid']);
|
||||||
}
|
if($FLData['owner'] == $session->uid){
|
||||||
}elseif($_GET['action'] == 'showSlot' && $_GET['eid']) {
|
$checked[$_GET['slid']] = 1;
|
||||||
include("Templates/goldClub/farmlist_editraid.tpl");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['action'] == 'deleteList') {
|
if($_GET['action'] == 'deleteList') {
|
||||||
$database->delFarmList($_GET['lid'], $session->uid);
|
$database->delFarmList($_GET['lid'], $session->uid);
|
||||||
header("Location: build.php?id=39&t=99");
|
header("Location: build.php?id=39&t=99");
|
||||||
@@ -185,6 +190,7 @@ if($session->goldclub == 1 && $session->access != BANNED){
|
|||||||
$database->delSlotFarm($_GET['eid']);
|
$database->delSlotFarm($_GET['eid']);
|
||||||
header("Location: build.php?id=39&t=99");
|
header("Location: build.php?id=39&t=99");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$create = 0;
|
$create = 0;
|
||||||
if($session->access == BANNED){
|
if($session->access == BANNED){
|
||||||
|
|||||||
+16
-15
@@ -43,16 +43,17 @@ if($session->access != BANNED){
|
|||||||
$getFLData = $database->getFLData($lid);
|
$getFLData = $database->getFLData($lid);
|
||||||
$unitslist = $database->getFLData($lid);
|
$unitslist = $database->getFLData($lid);
|
||||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid."");
|
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid."");
|
||||||
$sql1 = mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']);
|
$sql1 = mysql_fetch_array(mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']));
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysql_fetch_array($sql)){
|
||||||
$sid = $row['id'];
|
$sid = $row['id'];
|
||||||
$wref = $row['towref'];
|
$wref = $row['towref'];
|
||||||
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
|
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
|
||||||
$t6 = $row['t6'];$t7 = $row['t7'];$t8 = $row['t8'];$t9 = $row['t9'];$t10 = $row['t10'];
|
$t6 = $row['t6'];$t7 = $row['t7'];$t8 = $row['t8'];$t9 = $row['t9'];$t10 = $row['t10'];
|
||||||
$t11 = 0;
|
$t11 = 0;
|
||||||
if($tribe == 1){ $u = ""; } elseif($tribe == 2){ $u = "1"; } elseif($tribe == 3){ $u = "2"; }elseif($tribe == 4){ $u = "3"; }else {$u = "4"; }
|
if($tribe == 1){ $u = "u"; } elseif($tribe == 2){ $u = "u1"; } elseif($tribe == 3){ $u = "u2"; }elseif($tribe == 4){ $u = "u3"; }else {$u = "u4"; }
|
||||||
if($sql[$u.'1']>=$t1 && $sql[$u.'2']>=$t2 && $sql[$u.'3']>=$t3 && $sql[$u.'4']>=$t4 && $sql[$u.'5']>=$t5 && $sql[$u.'6']>=$t6 && $sql[$u.'7']>=$t7 && $sql[$u.'8']>=$t8 && $sql[$u.'9']>=$t9 && $sql[$u.'10']>=$t10 && $sql['hero']>=$t11){
|
if($tribe == 1){ $u1 = "u1"; } elseif($tribe == 2){ $u1 = "u2"; } elseif($tribe == 3){ $u1 = "u3"; }elseif($tribe == 4){ $u1 = "u4"; }else {$u1 = "u5"; }
|
||||||
if($slots[$sid]=='on'){
|
if($tribe == 1){ $u2 = ""; } elseif($tribe == 2){ $u2 = "1"; } elseif($tribe == 3){ $u2 = "2"; }elseif($tribe == 4){ $u2 = "3"; }else {$u2 = "4"; }
|
||||||
|
if($sql1[$u.'1']>=$t1 && $sql1[$u.'2']>=$t2 && $sql1[$u.'3']>=$t3 && $sql1[$u.'4']>=$t4 && $sql1[$u.'5']>=$t5 && $sql1[$u.'6']>=$t6 && $sql1[$u.'7']>=$t7 && $sql1[$u.'8']>=$t8 && $sql1[$u.'9']>=$t9 && $sql1[$u1.'0']>=$t10 && $sql1['hero']>=$t11){ if($slots[$sid]=='on'){
|
||||||
$ckey = $generator->generateRandStr(6);
|
$ckey = $generator->generateRandStr(6);
|
||||||
$id = $database->addA2b($ckey,time(),$wref,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11,4);
|
$id = $database->addA2b($ckey,time(),$wref,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11,4);
|
||||||
|
|
||||||
@@ -99,19 +100,19 @@ if($session->access != BANNED){
|
|||||||
$abdata = $database->getABTech($getFLData['wref']);
|
$abdata = $database->getABTech($getFLData['wref']);
|
||||||
$reference = $database->addAttack(($getFLData['wref']),$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],$data['type'],$ctar1,$ctar2,0,$abdata['b1'],$abdata['b2'],$abdata['b3'],$abdata['b4'],$abdata['b5'],$abdata['b6'],$abdata['b7'],$abdata['b8']);
|
$reference = $database->addAttack(($getFLData['wref']),$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],$data['type'],$ctar1,$ctar2,0,$abdata['b1'],$abdata['b2'],$abdata['b3'],$abdata['b4'],$abdata['b5'],$abdata['b6'],$abdata['b7'],$abdata['b8']);
|
||||||
$totalunits = $data['u1']+$data['u2']+$data['u3']+$data['u4']+$data['u5']+$data['u6']+$data['u7']+$data['u8']+$data['u9']+$data['u10']+$data['u11'];
|
$totalunits = $data['u1']+$data['u2']+$data['u3']+$data['u4']+$data['u5']+$data['u6']+$data['u7']+$data['u8']+$data['u9']+$data['u10']+$data['u11'];
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'1'), array($data['u1']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'1'), array($data['u1']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'2'), array($data['u2']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'2'), array($data['u2']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'3'), array($data['u3']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'3'), array($data['u3']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'4'), array($data['u4']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'4'), array($data['u4']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'5'), array($data['u5']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'5'), array($data['u5']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'6'), array($data['u6']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'6'), array($data['u6']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'7'), array($data['u7']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'7'), array($data['u7']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'8'), array($data['u8']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'8'), array($data['u8']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'9'), array($data['u9']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'9'), array($data['u9']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array($u.'10'), array($data['u10']), array(0));
|
$database->modifyUnit($getFLData['wref'], array($u2.'10'), array($data['u10']), array(0));
|
||||||
$database->modifyUnit($getFLData['wref'], array('hero'), array($data['u11']), array(0));
|
$database->modifyUnit($getFLData['wref'], array('hero'), array($data['u11']), array(0));
|
||||||
|
|
||||||
$database->addMovement(3,$getFLData['wref'],$data['to_vid'],$reference,0,($time+time()));
|
$database->addMovement(3,$getFLData['wref'],$data['to_vid'],$reference,time(),($time+time()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user