-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.php
140 lines (119 loc) · 3.86 KB
/
action.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
* {
box-sizing: border-box;
}
body {
background-color: #f1f1f1;
}
#regForm {
background-color: #ffffff;
margin: 100px auto;
font-family: Arial;
padding: 40px;
width: 70%;
min-width: 300px;
}
h1 {
text-align: center;
}
button {
background-color: darkslategray;
color: #ffffff;
border: none;
padding: 10px 20px;
font-size: 17px;
font-family: Raleway;
cursor: pointer;
}
button:hover {
opacity: 0.8;
}
#prevBtn {
background-color: #bbbbbb;
}
/* Make circles that indicate the steps of the form: */
.step {
height: 15px;
width: 15px;
margin: 0 2px;
background-color: #bbbbbb;
border: none;
border-radius: 50%;
display: inline-block;
opacity: 0.5;
}
.step.active {
opacity: 1;
}
/* Mark the steps that are finished and valid: */
.step.finish {
background-color: #4CAF50;
}
</style>
<body>
<div id="regForm">
<h1>online Quine–McCluskey</h1>
<!-- One "tab" for each step in the form: -->
<div class="tab">
<hr>
<p style="font-family: Arial">
Number Of Variable is :
<?php
$number_of_variables = $_POST["variable"];
echo $number_of_variables;
?>
<br>
Your Minterms is:
<?php
$minterms = $_POST["minterms"];
echo $minterms
?>
</p>
<hr>
<?php
$array_of_minterms = [];
$invalid_minterm = false;
$array_of_minterms = explode(",", $minterms);
$all_numeric = true;
foreach ($array_of_minterms as $key) {
if (!(is_numeric($key))) { // check the type of minterms
$all_numeric = false;
break;
}
}
foreach ($array_of_minterms as $key) { //check the range of minterms
if ($key >= pow(2, $number_of_variables)) {
$invalid_minterm = true;
break;
}
}
if (ctype_digit($number_of_variables) && $number_of_variables <= 8 && $number_of_variables >= 0
&& $all_numeric && !$invalid_minterm) { //check the validate of inputs
?>
<p>
<?php
@include 'main.php';
?>
</p>
<?php } else { ?>
<p> your inputs are invalid !</p>
<?php } ?>
</div>
<hr>
<div style="overflow:auto;">
<div style="float:right;">
<a href="index.php" type="button" id="nextBtn" class="btn btn-success">home</a>
</div>
</div>
<div style="text-align:center;margin-top:40px;">
<span class="step"></span>
</div>
</div>
</body>
</html>