Example #1
0
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('cli only');
error_reporting(E_ALL);
require __DIR__ . '/vendor/autoload.php';
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
define('BASEPATH', __DIR__ . '/vendor/codeigniter/framework/system/');
define('APPPATH', __DIR__ . '/application/');
require APPPATH . 'libraries/Doctrine.php';
$doctrine = new Doctrine();
$em = $doctrine->em;
// Registrant Seeder
$reg = new RegistrantEntity();
$reg->setUsername('hanan');
$reg->setName('Ardiyan Hananto');
$reg->setGender('L');
$reg->setNisn('2010249129310');
$reg->setCp('085738271625');
$reg->setPassword(password_hash('qwerty', PASSWORD_BCRYPT));
$reg->setPreviousSchool('SMP IT Ihsanul FIkri Mungkid');
$reg->setProgram('Reguler');
$reg->setRegistrationTime(new DateTime('1-12-2014'));
$em->persist($reg);
$em->flush();
// Payment
$payment = new PaymentEntity();
$payment->setRegistrant($reg);
$payment->setPaymentDate(new DateTime('now'));
Example #2
0
 public function cek_status(RegistrantEntity $registrant)
 {
     $id = $registrant->getId();
     $arr_result = [];
     $all_stats = 0;
     if (is_null($registrant->getRegistrantData())) {
         $arr_result['data'] = 0;
     } else {
         $arr_result['data'] = 1;
         $all_stats++;
     }
     if (is_null($registrant->getFather())) {
         $arr_result['father'] = 0;
     } else {
         $arr_result['father'] = 1;
         $all_stats++;
     }
     if (is_null($registrant->getMother())) {
         $arr_result['mother'] = 0;
     } else {
         $arr_result['mother'] = 1;
         $all_stats++;
     }
     if (is_null($registrant->getGuardian())) {
         $arr_result['guardian'] = 0;
     } else {
         $arr_result['guardian'] = 1;
     }
     $this->load->helper('file');
     //        $file = read_file('./data/foto/'.$id.'.png');
     //        if(!$file){
     //            $arr_result ['foto'] = 0;
     //        } else {
     //            $arr_result ['foto'] = 1;
     //            $all_stats++;
     //        }
     if (is_null($registrant->getMainParent())) {
         $arr_result['letter'] = 0;
     } else {
         $arr_result['letter'] = 1;
         $all_stats++;
     }
     $file2 = read_file('./data/receipt/' . $id . '.png');
     if ($file2) {
         $arr_result['payment'] = $this->cek_receipt($registrant);
     } else {
         $arr_result['payment'] = 0;
     }
     $arr_result['completed'] = $all_stats >= 4 ? true : false;
     return $arr_result;
 }