Created
June 22, 2020 11:55
-
-
Save sinyo1015/713a6ecc84ee48782b861c78ffbf1b76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//import apalah disini | |
class X extends REST_Controller{ | |
public function index_get(){ | |
//Get lapangan | |
$lapangan = $this->m_futsal->lapangan()->result(); | |
$tersedia = $this->m_futsal->tersedia(); | |
//tempat sementara | |
$lapangannya = []; | |
//Loop Lapangan | |
foreach($lapangan as $lapanganF){ | |
foreach($tersedia as $tersediakan){ | |
if($tersediakan["id_lapangan"] != $lapanganF["id_lapangan"] && $tersediakan["id_futsal"] != $lapanganF["id_futsal"]){ | |
array_push($lapangannya, $lapanganF["id_lapangan"]; | |
} | |
} | |
} | |
echo "Lapangan yang tersedia : ". implode(", ", $lapangannya); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment