-
Notifications
You must be signed in to change notification settings - Fork 0
/
edititems.php
67 lines (64 loc) · 1.71 KB
/
edititems.php
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
<?php
require_once 'lib/parsecsv.lib.php';
if(isset($_POST['sub'])){
$item_name=$_POST['item_name'];
$quality=$_POST['quality'];
$ks=$_POST['killstreak'];
$key=$_POST['key'];
$ref=$_POST['ref'];
$rec=$_POST['rec'];
$scr=$_POST['scrap'];
$buysell=$_POST['buysell'];
$entry=$quality.$ks.$item_name.', '.$scr.'.'.$rec.'.'.$ref.'.'.$key.'.0, '.$buysell.PHP_EOL;
$fp=fopen("bot/trade.csv","a+");
if($fp==FALSE){
echo "Error in opening File";
exit();
}
fwrite( $fp, $entry);
fclose($fp);
}
?>
<html>
<head>
<title>
Edit csv file
</title>
</head>
<body>
<center>
<form method="post">
<input type="text" name="item_name" placeholder="Item name" size="40px"> Quality:
<select name="quality">
<option></option>
<option>Strange </option>
<option>Unusual </option>
<option>Genuine </option>
</select>Killstreak:<select name="killstreak">
<option></option>
<option>Killstreak </option>
<option>Specialized Killstreak </option>
<option>Professional Killstreak </option></select><br><br>
<input type="text" name="key" placeholder="value in key">
<input type="text" name="ref" placeholder="value in refine">
<input type="text" name="rec" placeholder="value in reclaimed">
<input type="text" name="scrap" placeholder="value in scrap">
<input type="text" name="bud" value="0" disabled>
<select name="buysell">
<option> buy<br></option>
<option> sell<br></option></select><br><br>
<input type="submit" name="sub">
</form>
</center>
<div id="block">
<?php
$file=fopen("bot/trade.csv","r");
while(! feof($file)){
print_r(fgetcsv($file));
echo "<br>";
}
fclose($file);
?>
</div>
</body>
</html>