first commit
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
require_once _DOCROOT_.'vendor/autoload.php';
|
||||
|
||||
$dotenv = new Dotenv\Dotenv(_DOCROOT_);
|
||||
$dotenv->load();
|
||||
|
||||
$connect = mysqli_connect('p:'.$_ENV['DATABASE_HOST'], $_ENV['DATABASE_USER'], $_ENV['DATABASE_PASS'], $_ENV['DATABASE_NAME']);
|
||||
|
||||
try{
|
||||
$tmp_profil = mysqli_query($connect,"SELECT * FROM profil");
|
||||
if(!$tmp_profil)
|
||||
{
|
||||
$connect = mysqli_connect($_ENV['DATABASE_HOST'], $_ENV['DATABASE_USER'], $_ENV['DATABASE_PASS'], $_ENV['DATABASE_NAME']);
|
||||
$rstitle = $_SESSION['rstitle'];
|
||||
$singrstitl = $_SESSION['singrstitl'];
|
||||
$singhead1 = $_SESSION['singhead1'];
|
||||
$singsurat = $_SESSION['singsurat'];
|
||||
$header1 = $_SESSION['header1'];
|
||||
$header2 = $_SESSION['header2'];
|
||||
$header3 = $_SESSION['header3'];
|
||||
$header4 = $_SESSION['header4'];
|
||||
$KDRS = $_SESSION['kdrs'];
|
||||
$KelasRS = $_SESSION['kelasrs'];
|
||||
$NamaRS = $_SESSION['namars'];
|
||||
$KDTarifINACBG = $_SESSION['kdtarifnacbg'];
|
||||
// throw new Exception("Error Processing Request", 1);
|
||||
}
|
||||
else {
|
||||
$data = mysqli_fetch_array($tmp_profil);
|
||||
|
||||
$rstitle = $data['rstitle'];
|
||||
$singrstitl = $data['singrstitl'];
|
||||
$singhead1 = $data['singhead1'];
|
||||
$singsurat = $data['singsurat'];
|
||||
$header1 = $data['header1'];
|
||||
$header2 = $data['header2'];
|
||||
$header3 = $data['header3'];
|
||||
$header4 = $data['header4'];
|
||||
$KDRS = $data['kdrs'];
|
||||
$KelasRS = $data['kelasrs'];
|
||||
$NamaRS = $data['namars'];
|
||||
$KDTarifINACBG = $data['kdtarifnacbg'];
|
||||
|
||||
$_SESSION['rstitle'] = $data['rstitle'];
|
||||
$_SESSION['singrstitl'] = $data['singrstitl'];
|
||||
$_SESSION['singhead1'] = $data['singhead1'];
|
||||
$_SESSION['singsurat'] = $data['singsurat'];
|
||||
$_SESSION['header1'] = $data['header1'];
|
||||
$_SESSION['header2'] = $data['header2'];
|
||||
$_SESSION['header3'] = $data['header3'];
|
||||
$_SESSION['header4'] = $data['header4'];
|
||||
$_SESSION['kdrs'] = $data['kdrs'];
|
||||
$_SESSION['kelasrs'] = $data['kelasrs'];
|
||||
$_SESSION['namars'] = $data['namars'];
|
||||
$_SESSION['kdtarifnacbg'] = $data['kdtarifnacbg'];
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
}
|
||||
Reference in New Issue
Block a user