forked from channaveer/EntityGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
94 lines (88 loc) · 2.73 KB
/
index.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
require_once 'init.php';
use EntityGenerator\Database\DatabaseRepository;
$databaseRepository = new DatabaseRepository($connection);
$databases = $databaseRepository->getDatabases($connection);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Entity Generator</title>
<link rel="stylesheet" href="EntityGenerator/assets/css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="EntityGenerator/assets/css/sumoselect/sumoselect.css" />
<script src="EntityGenerator/assets/js/jquery2_1_1.js"></script>
<script src="EntityGenerator/assets/js/bootstrap/bootstrap.min.js"></script>
<script src="EntityGenerator/assets/js/sumoselect/jquery.sumoselect.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="text-success">Entity Generator</h1>
</div>
</div>
<div class="row">
<div class="col-md-9">
<?php
if(isset($_GET['error'])){
echo '<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
'.$_GET['error'].'
</div>';
}
if(isset($_GET['success'])){
echo '<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Success!</strong> '.$_GET['success'].'
</div>';
}
?>
</div>
</div>
<form action="generateEntities.php" method="POST">
<div class="row">
<div class="col-md-4">
<label for="database">Select Dabases <span class="text-danger">*</span></label>
<select name="database" id="database" class="form-control" required="required">
<?php
foreach($databases as $database){
?>
<option value="<?php echo $database->Database; ?>"> <?php echo $database->Database; ?></option>
<?php
}
?>
</select>
</div>
<div class="col-md-4 col-md-offset-1">
<label for="tables">Select Tables <span class="text-danger">*</span> <small class="tableLoading text-info"></small></label>
<select name="tables" id="tables" class="form-control" multiple="multiple" required="required">
</select>
</div>
</div>
<br /><br />
<div class="row">
<div class="col-md-12">
<input type="submit" value="Generate Entities" class="btn btn-success">
</div>
</div>
</form>
</div>
<script>
$(document).ready(function(){
$('#database').SumoSelect({
search: true,
searchText: 'Search Database Name'
});
$('#tables').SumoSelect({
search: true,
searchText: 'Search Tables Name',
selectAll: true,
outputAsCSV : true,
csvSepChar: ','
});
});
</script>
<script src="EntityGenerator/assets/js/getTablesByDatabase.js"></script>
</body>
</html>