-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbiedi.php
More file actions
82 lines (76 loc) · 2.7 KB
/
biedi.php
File metadata and controls
82 lines (76 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
if(isset($_POST['submit_tags']))
{
$tagsList=$_POST['tags_list'];
$arrayElements = explode(";", $tagsList);
echo "Contains ".sizeof($arrayElements)." elements<br>-----------------<br><br>";
$counter = 0;
foreach($arrayElements as $vehicle)
{
$vehicleValues = explode(",", $vehicle);
echo"
_vehicle_".$counter."=objNull;<br>
_this = createVehicle ".$arrayElements[$counter].";<br>
_vehicle_".$counter." = _this;<br>
_this setDir ".rtrim($vehicleValues[4],']').";<br>
_this setPos ".$vehicleValues[1].",".$vehicleValues[2]."];<br><br><br>";
$counter++;
}
}
?>
<h1> Array to Biedi Converter</h1>
<form action="" method="post" enctype="multipart/form-data">
<Textarea name="tags_list" textarea rows="20" cols="80"></Textarea></br>
<input type="submit" name="submit_tags">
</form>
<?php
if(isset($_POST['sqf']))
{
$tagsList=$_POST['tags_list'];
$arrayElements = explode(";", $tagsList);
echo "Contains ".sizeof($arrayElements)." elements<br>-----------------<br><br>";
$counter = 0;
foreach($arrayElements as $vehicle)
{
$vehicleValues = explode(",", $vehicle);
echo"
_vehicle_".$counter."=objNull;<br>
_this = createVehicle ".$arrayElements[$counter].";<br>
_vehicle_".$counter." = _this;<br>
_this setDir ".rtrim($vehicleValues[4],']').";<br>
_this setPos ".$vehicleValues[1].",".$vehicleValues[2]."];<br><br><br>";
$counter++;
}
}
if(isset($_POST['biedi']))
{
$tagsList=$_POST['tags_list'];
$arrayElements = explode(";", $tagsList);
$counter = 0;
foreach($arrayElements as $vehicle)
{
$vehicleValues = explode(",", $vehicle);
$step1 = str_replace('[', '',$vehicleValues[0]);
$step2 = str_replace(']', '',$step1);
$type1=trim($vehicleValues[0],'"');
echo'<html><body>
class _vehicle_'.$counter.'<br>
{<br>
objectType="vehicle";<br>
class Arguments <br>
{<br>
POSITION="'.$vehicleValues[1].','.$vehicleValues[2].','.$vehicleValues[3].'";<br>
TYPE='.$step2.';<br>
AZIMUT="'.rtrim($vehicleValues[4],"]").'";<br>
PARENT="";<br>
};<br>};<br><br><br></html></body>';
$counter++;
}
}
?>
<h1> Array to Biedi Converter</h1>
<form action="" method="post" enctype="multipart/form-data">
<Textarea name="tags_list" textarea rows="20" cols="80"></Textarea></br>
<input type="submit" value="Convert to SQF" name="sqf">
<input type="submit" value="Convert to Biedi" name="biedi">
</form>