Add SPOTA core PHP application

Add the main admin, dosen, mahasiswa, API, and service code needed to run the core legacy application with configurable upload storage.
This commit is contained in:
Power BI Dev
2026-05-02 10:08:52 +07:00
parent 874dbbe8e8
commit efdb11db3f
221 changed files with 43273 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
session_start();
if($_POST){
include ("../../../inc/helper.php");
include ("../../../inc/konfigurasi.php");
include ("../../../inc/db.pdo.class.php");
$db=new dB($dbsetting);
switch($_POST['act']){
default:
echo json_encode(array("result"=>false,"msg"=>"Request Not Found"));
break;
case 'simpan':
$idprodi=$_SESSION['login-admin']['prodi'];
$semester=$_POST['smt'];
$thnajaran=$_POST['thn_ajaran'];
$minsetuju=$_POST['min_setuju'];
$c="SELECT * FROM web_setting WHERE idProdi='$idprodi'";
$db->runQuery($c);
if($db->dbRows()>0){
$p="UPDATE web_setting SET `values`='$semester' WHERE name='smt' AND idProdi='$idprodi';";
$q="UPDATE web_setting SET `values`='$thnajaran' WHERE name='thn_ajaran' AND idProdi='$idprodi';";
$r="UPDATE web_setting SET `values`='$minsetuju' WHERE name='min_close' AND idProdi='$idprodi';";
}else{
$p="INSERT INTO web_setting SET `values`='$semester', name='smt', idProdi='$idprodi';";
$q="INSERT INTO web_setting SET `values`='$thnajaran', name='thn_ajaran', idProdi='$idprodi';";
$r="INSERT INTO web_setting SET `values`='$minsetuju', name='min_close', idProdi='$idprodi';";
}
/*echo $p;
echo $q;
echo $r;*/
if($db->runQuery($p) AND $db->runQuery($q) AND $db->runQuery($r)){
echo json_encode(array("result"=>true,"msg"=>"Pengaturan Disimpan"));
}else{
echo json_encode(array("result"=>false,"msg"=>"Aksi Gagal, DBError"));
}
break;
}
}
?>

View File

@@ -0,0 +1,86 @@
<?php $db=new dB($dbsetting);
$lvl=$_SESSION['login-admin']['lvl'];
if($lvl=='P'){
?>
<div class="row">
<div class="col-sm-12">
<ol class="breadcrumb">
<li>
<i class="clip-home-3"></i>
<a href="<?php ECHO ADMIN_PAGE;?>">
Home
</a>
</li>
<li class="active">
Pengaturan Website
</li>
<li class="search-box">
<label><?php echo tanggalIndo(date('Y-m-d H:i:s'),'j F Y, H:i');?></label>
</li>
</ol>
<div class="page-header">
<h1>Pengaturan Website<!-- <small>overview &amp; stats </small> --></h1>
</div>
</div>
</div>
<?php
$conf="SELECT * FROM web_setting WHERE idProdi='".$_SESSION['login-admin']['prodi']."'";
$db->runQuery($conf);
$smt="";
$thnajaran="";
$min_setuju="";
if($db->dbRows()>0){
while($p=$db->dbFetch()){
switch($p['name']){
case 'smt':
$smt=$p['values'];
break;
case 'thn_ajaran';
$thnajaran=$p['values'];
break;
case 'min_close':
$min_setuju=$p['values'];
break;
}
}
}
?>
<div class="row">
<div class="col-sm-4">
<form id="pengaturan" method="post" name="pengaturan">
<input name="act" value="simpan" type="hidden" />
<div class="form-group">
<label for="Semester Aktif">Semester Aktif</label>
<input type="text" value="<?php echo $smt;?>" name="smt" id="smt" class="form-control" placeholder="cth:GAS-2014"/>
</div>
<div class="form-group">
<label for="Tahun Ajaran">Tahun Ajaran</label>
<input type="text" id="thn_ajaran" name="thn_ajaran" value="<?php echo $thnajaran;?>" placeholder="cth: 2014/2015" class="form-control"/>
</div>
<div class="form-group">
<label for="Tahun Ajaran">Syarat Minimal Close Draft Praoutline</label>
<select name="min_setuju" id="min_setuju" class="form-control">
<option value="">- Pilih -</option>
<?php
for($x=1;$x<=10;$x++){
if($x==$min_setuju){
echo '<option selected value="'.$x.'">'.$x.'</option>';
}else{
echo '<option value="'.$x.'">'.$x.'</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<button class="btn btn-primary btn-sm"><i class="icon-save"></i> Simpan Pengaturan</button>
</div>
</form>
</div>
</div>
<?php
}
?>