diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..2a03212 --- /dev/null +++ b/src/index.html @@ -0,0 +1,76 @@ + + + + + + +

Osvobozená základní škola - Docházka

+

Ukaž svoji školní průkazku

+
+ + + + +

Kdo jsi?

+

Načítám ...

+

+

Kdo je ve škole

+

Načítám ...

+ + + diff --git a/src/osvobdoch_local_vars.php b/src/osvobdoch_local_vars.php new file mode 100644 index 0000000..5d70ec6 --- /dev/null +++ b/src/osvobdoch_local_vars.php @@ -0,0 +1,6 @@ + + diff --git a/src/osvobdoch_vars.php b/src/osvobdoch_vars.php new file mode 100644 index 0000000..45fd530 --- /dev/null +++ b/src/osvobdoch_vars.php @@ -0,0 +1,5 @@ + + diff --git a/src/pruchod.php b/src/pruchod.php new file mode 100644 index 0000000..193dbb3 --- /dev/null +++ b/src/pruchod.php @@ -0,0 +1,77 @@ +direction == "P") { + if( !in_array($pozadavek->name, $at_school)) { + $at_school[] = $pozadavek->name; + } else { + echo $pozadavek->name." už je ve škole"; + return; + } +} else { + //if student is already at school, remove him from the list + if( in_array($pozadavek->name, $at_school)) { + $key = array_search($pozadavek->name, $at_school); + unset($at_school[$key]); + } else { + echo $pozadavek->name." není ve škole"; + return; + } +} + + +$pruchod = array( + "PkUzivatel" => $pozadavek->id, + "TypUzivatele" => "P", + "Datum" => date("Y-m-d"), + "Cas" => date("H:i:s"), + "Smer" => $pozadavek->direction, + "Hlavni" => $pozadavek->main, + "BranaId" => "ENTRANCE", + "CteckaId" => "CAM1", + "Poznamka" => "" +); +$payload = json_encode($pruchod)."
"; +echo $payload; +$ch = curl_init(); +curl_setopt($ch, CURLOPT_URL, $url.$cesta); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); +curl_setopt($ch, CURLOPT_POST, true); +curl_setopt($ch, CURLOPT_HTTPHEADER, array( + "com.edookit.Time: ".$cas, + "com.edookit.Auth: ".$auth, + "com.edookit.Client: ".$id, + "Content-Type: application/json" +)); +/*curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); +$result = curl_exec($ch); +echo $result;*/ +file_put_contents('at_school.txt', ' diff --git a/src/veskole.php b/src/veskole.php new file mode 100644 index 0000000..c598c76 --- /dev/null +++ b/src/veskole.php @@ -0,0 +1,17 @@ +