Ejemplo n.º 1
0
function dbFetch($s,$t,$f=""){
	$t=dbSel($s,$t,$f." LIMIT 0,1");
	if(dbNRow($t)==1){
		$r=dbFA($t);
		return $r[$s];
	}else{
		return '';
	}
}
Ejemplo n.º 2
0
function MstrLastUrut($t)
{
    $ts = dbSel("urut", $t, "O/ urut DESC LIMIT 0,1");
    if (dbNRow($ts) > 0) {
        $rs = dbFA($ts);
        return $rs['urut'];
    }
    return 0;
}
Ejemplo n.º 3
0
function rapor_peringkatkelas_siswa($kls,$siswa){
	$db=siswa_db_bykelas($kls);
	
	$db->field("aka_komenrapor:komen");
	$db->join_cust("aka_komenrapor ON aka_komenrapor.siswa=aka_siswa.replid AND aka_komenrapor.tahunajaran=aka_tahunajaran.replid");
	
	$sna=""; $phn=array(); $SSKM=array(); $npeni=0;
	$t0=dbQSql("SELECT * FROM aka_sks WHERE kelas='$kls' GROUP BY pelajaran");
	while($r0=dbFA($t0)){
		$pelid=$r0['pelajaran'];
		$pel=$r0['pelajaran']; $gid=$r0['guru'];
		$SKM=pelajaran_skm($pel);
		$SSKM[$pelid]=$SKM;
		
		$db->field($SKM." as SKM_".$pelid);
		
		$t1=dbQSql("SELECT * FROM aka_penilaian WHERE guru='$gid' AND pelajaran='$pel' AND kelas='$kls'");
		//echo '<span style="color:red">'."SELECT * FROM aka_penilaian WHERE guru='$gid' AND pelajaran='$pel' AND kelas='$kls'".'</span>';
		if(dbNRow($t1)>0){
			$phn[$pelid]='@';
			$sk=""; $tbobot=0; $sb="";
			while($r1=dbFA($t1)){
				$db->field("@".$r1['kode']."_".$pelid." := IFNULL((SELECT aka_daftarnilai.nilai FROM aka_daftarnilai WHERE aka_daftarnilai.siswa=aka_siswa.replid AND aka_daftarnilai.penilaian='".$r1['replid']."'),0) as T".$r1['kode']."_".$pelid);
				
				$db->field($r1['bobot']." as B".$r1['kode']."_".$pelid);
				
				$tbobot+=$r1['bobot'];
				
				if($r1['bobot']>0){
					if($sk!="")$sk.=" + ";
					$sk.="@".$r1['kode']."_".$pelid;
					
					if($sb!="")$sb.=" + ";
					$sb.="@".$r1['kode']."_".$pelid." * ".$r1['bobot'];
				}
				
			}
			
			if($sk!="") $db->field("(".$sk.") as JMLNILAI_".$pelid);
			else $db->field("0 as JMLNILAI_".$pelid);
			if($tbobot>0){
				if($sb!="") $db->field("@TN_".$pelid." := ((".$sb.")/ ".$tbobot.") as TNILAI_".$pelid);
				else $db->field("@TN_".$pelid." := 0 as TNILAI_".$pelid);
			} else {
				$db->field("@TN_".$pelid." := 0 as TNILAI_".$pelid);
			}
			$db->field("IF( @TN_".$pelid." < ".$SKM.",0,1) as TLULUS_".$pelid);
			
			if($sna!="")$sna.=" + ";
			$sna.="@TN_".$pelid;
			
			$npeni++;
		} else {
			$phn[$pelid]='';
		}
	}
	
	if($sna!="") $db->field("(".$sna.") as TNRAPOR");
	else $db->field("0 as TNRAPOR");
	if($npeni>0) $db->field("((".$sna.")/".$npeni.") as AVGRAPOR");
	else $db->field("0 as AVGRAPOR");
	
	$db->order("TNRAPOR DESC");
	$s=$db->query();
	$rank=array(); $rk=1;
	while($v=dbFA($s)){
		$rank[$v['replid']]=$rk++;
	}
	
	return $rank[$siswa];
}
Ejemplo n.º 4
0
<?php

$t = dbSel("*", "so_history", "W/status='1' OR status='2' LIMIT 0,1");
$nso = dbNRow($t);
?>
<div class="hl2" style="font-size:16px;margin-bottom:10px;padding-top:20px;">Initialize stock take</div>
<?php 
if ($nso == 0) {
    ?>
<div class="sfont" style="line-height:200%;width:600px;margin-bottom:10px">This application wil guide you through stock take process. Once you initialize a stock take process you may not to initialize another process until current process are finished.</div>
<input type="button" class="btnx" value="Start new stock take" onclick="jumpTo('<?php 
    echo RLNK;
    ?>
stockopname.php?tab=init')"/>
<?php 
} else {
    $r = dbFA($t);
    $tt = array('1' => 'cek', '2' => 'note', '3' => 'finish');
    ?>
<div class="sfont" style="line-height:200%;width:600px;margin-bottom:10px">Current stock take process <b>"<?php 
    echo $r['name'];
    ?>
"</b> is not finish yet.</div>
<input type="button" class="btnz" value="Continue current stock take" onclick="jumpTo('<?php 
    echo RLNK;
    ?>
stockopname.php?tab=<?php 
    echo $tt[$r['status']];
    ?>
')"/>
<?php 
Ejemplo n.º 5
0
<?php

$t = dbSel("*", "mstr_level", "O/ urut");
$k = 1;
$n = dbNRow($t);
while ($r = dbFA($t)) {
    ?>
<tr><td width="380px"><?php 
    echo $r['name'];
    ?>
</td><td align="right">
	<div class="prefopt">
	<?php 
    if ($k != 1) {
        ?>
<input type="button" title="Move up" class="prefup" onclick="m_level('up',<?php 
        echo $r['dcid'];
        ?>
)"/> &nbsp;<?php 
    }
    ?>
	<?php 
    if ($k != $n) {
        ?>
<input type="button" title="Move down" class="prefdn" onclick="m_level('dn',<?php 
        echo $r['dcid'];
        ?>
)"/><?php 
    } else {
        ?>
<button style="width:15px;height:15px;border:none;background:none"></button><?php 
Ejemplo n.º 6
0
}
?>
				</table><input type="hidden" id="ceb_jobhis" value="0"/>
				<div id="aeb_jobhis" style="margin:9px 0 15px 0"><a class="linkl11" href="javascript:addEntry('jobhis',0)">Add employment history...</a></div>
			</td></tr>
			
			<tr><td>&nbsp;</td><td colspan="2"></td></tr> <!-- Separator -->
			<tr height="30px" valign="top"><td width="20px"><b>H.</b></td><td colspan="2"><strong>Character References: professionals (do not list relatives, families, and friends)</strong></td></tr>
			
			<tr valign="top"><td>&nbsp;</td><?php 
echo tdLabel("Reference", "padding-top:10px");
?>
<td>
			<?php 
$tf = dbSel("*", "emp_reference", "W/empid='{$dcid}'");
$nf = dbNRow($tf);
$df = array();
$i = 0;
while ($rf = dbFAx($tf)) {
    $df[$i++] = $rf;
}
?>
				<table id="teb_reference" class="preftbl" cellspacing="0px" cellpadding="8px" style="margin:0 0 5px 0">
				<?php 
for ($b = 0; $b < 10; $b++) {
    if ($b < $i) {
        ?>
					<tr id="reb_reference<?php 
        echo $b;
        ?>
" style="display:">
Ejemplo n.º 7
0
<?php

$mid = gets('mid');
$sql = "SELECT * FROM joshr.employee WHERE `nip`='{$mid}' LIMIT 0,1";
//echo $sql;
$t = dbQsql($sql);
$ndata = dbNRow($t);
$mtype = '';
if ($ndata > 0) {
    $mtype = 's';
}
if ($mtype != '') {
    $r = dbFAx($t);
    if ($mtype == 's') {
        ?>
<style type="text/css">
#pf_photo {
	border:4px solid #ffffff;
	width:60px;
	box-shadow: 0px 2px 5px rgba(0, 0, 0, .25);
}
.mem_info tr td{
	font:12px 'Segoe UI',Verdana,Tahoma;
	color:#444;
}
.mem_info tr{
	height:20px;
}
</style>
<script type="text/javascript" language="javascript">
function getBookLookup(){
Ejemplo n.º 8
0
<?php

$t = dbSel("*", "mstr_document", "O/ urut");
if (dbNRow($t) > 0) {
    ?>
<div class="pfsub">Document reminder</div>
<table class="preftbl2" cellspacing="1px" cellpadding="8px">
<?php 
    while ($r = dbFA($t)) {
        ?>
<tr><td width="300px">
	<table class="prefsfont" cellspacing="0" width="300px"><tr>
	<td width="200px"><?php 
        echo $r['name'];
        ?>
</td>
	<td align="right"><?php 
        echo $r['reminder'];
        ?>
 day<?php 
        echo $r['reminder'] > 1 ? "s" : "";
        ?>
</td>
	</tr></table>
</td></tr>
<?php 
    }
    ?>
</table>
<button class="btn" onclick="m_remdoc('uf')" style="margin:10px 0 0 20px">Set document reminders...</button>
<?php 
Ejemplo n.º 9
0
function dbFetch($sel, $tbl, $filter = "")
{
    $t = dbSel($sel, $tbl, $filter . " LIMIT 0,1");
    if (dbNRow($t) == 1) {
        $res = dbFA($t);
        return $res[$sel];
    } else {
        return '';
    }
}
Ejemplo n.º 10
0
 $db->field("aka_komenrapor:komen");
 $db->join_cust("aka_komenrapor ON aka_komenrapor.siswa=aka_siswa.replid AND aka_komenrapor.tahunajaran=aka_tahunajaran.replid");
 $sna = "";
 $phn = array();
 $SSKM = array();
 $npeni = 0;
 while ($r0 = dbFA($t0)) {
     $pelid = $r0['pelajaran'];
     $pel = $r0['pelajaran'];
     $gid = $r0['guru'];
     $SKM = pelajaran_skm($pel);
     $SSKM[$pelid] = $SKM;
     $db->field($SKM . " as SKM_" . $pelid);
     $t1 = dbQSql("SELECT * FROM aka_penilaian WHERE guru='{$gid}' AND pelajaran='{$pel}' AND kelas='{$kls}'");
     //echo '<span style="color:red">'."SELECT * FROM aka_penilaian WHERE guru='$gid' AND pelajaran='$pel' AND kelas='$kls'".'</span>';
     if (dbNRow($t1) > 0) {
         $phn[$pelid] = '@';
         $sk = "";
         $tbobot = 0;
         $sb = "";
         while ($r1 = dbFA($t1)) {
             $db->field("@" . $r1['kode'] . "_" . $pelid . " := IFNULL((SELECT aka_daftarnilai.nilai FROM aka_daftarnilai WHERE aka_daftarnilai.siswa=aka_siswa.replid AND aka_daftarnilai.penilaian='" . $r1['replid'] . "'),0) as T" . $r1['kode'] . "_" . $pelid);
             $db->field($r1['bobot'] . " as B" . $r1['kode'] . "_" . $pelid);
             $tbobot += $r1['bobot'];
             if ($r1['bobot'] > 0) {
                 if ($sk != "") {
                     $sk .= " + ";
                 }
                 $sk .= "@" . $r1['kode'] . "_" . $pelid;
                 if ($sb != "") {
                     $sb .= " + ";
Ejemplo n.º 11
0
function dbSRow($tbl, $filter = "")
{
    return dbNRow(dbSel("*", $tbl, $filter));
}
Ejemplo n.º 12
0
     $pdf->MultiCell($dcPageW, 0, "Healt Circumtance", 0, 'L', 0, 1, '', '', true);
     $pdf->SetFont('dejavusans', '', 9, '', true);
     dc_LineBar('', '', 1);
     $pdf->setCellPaddings(0, 0, 0, 0.5);
     $f = dbSFAx("*", "emp_healt", "W/empid='{$dcid}'");
     $lbl = array('Jelaskan bagaimana kesehatan anda secara umum', 'Bagaimana pendengaran anda', 'Bagaimana penglihatan anda', 'Golongan darah anda', 'Adakah kecacatan, atau kondisi khusus lainnya', 'Tanggal pemeriksaan dokter terakhir', 'Apakah pernah menjalani perawatan di rumah sakit?, Untuk keperluan apa dan selama berapa lama');
     for ($i = 0; $i < count($lbl); $i++) {
         dc_EmployeeHealt($lbl[$i], $f['info' . ($i + 1)], 80);
     }
     $pdf->setCellPaddings(0, 0, 0, 0);
     $pdf->Ln();
 }
 if ($dps[dp_Reference] == '1') {
     // Reference** name	address	phone	job	know	relation
     $q = dbSel("*", "emp_reference", "W/empid='{$dcid}'");
     if (dbNRow($q) == 0) {
         $pdf->SetFont('dejavusans', 'B', 9, '', true);
         $pdf->MultiCell($dcPageW, 0, "References: N/A", 0, 'L', 0, 1, '', '', true);
         $pdf->Ln();
     } else {
         $pdf->SetFont('dejavusans', 'B', 9, '', true);
         $pdf->MultiCell($dcPageW, 0, "References", 0, 'L', 0, 1, '', '', true);
         $pdf->SetFont('dejavusans', '', 9, '', true);
         dc_YDown(1);
         $th = array('Name', 'Address', 'Phone', 'Job', 'Since', 'Relation');
         $tw = array(0, 60, 20, 30, 20, 20);
         $pdf->setCellPaddings(0.5, 0.5, 0.5, 0.5);
         dc_tableHead($th, $tw);
         while ($f = dbFA($q)) {
             $i = 0;
             $pdf->MultiCell($tw[$i++], 0, $f['name'], 0, 'L', 0, 0, '', '', true);