function Grid1_Load($va) { global $scDb; $cUserName = GetSession("cSession_UserName"); $cLv_Admin = scSys::GetConfig("sc_admin"); $cLv = GetSession("cSession_SCLevel"); $cLimit = $va['offset'] . "," . $va['limit']; //limit $vaOrder = array(); if (isset($va['sort'])) { unset($va['sort'][13]); unset($va['sort'][14]); foreach ($va['sort'] as $key => $vaValue) { $vaOrder[] = $vaValue['field'] . " " . $vaValue['direction']; } } $cOrder = implode(",", $vaOrder); if ($cOrder == "") { $cOrder = "status ASC"; } //init order grid $dTglAwal = scDate::Date2String($va['dTglAwal']); $dTglAkhir = scDate::Date2String($va['dTglAkhir']); $cWhere_opt = ""; if ($va['optStatusF'] !== "-") { $cWhere_opt = " AND status = '{$va['optStatusF']}' "; } $vaWhere = array(); if (isset($va['search'])) { unset($va['search'][13]); unset($va['search'][14]); foreach ($va['search'] as $key => $vaValue) { $vaWhere[] = $vaValue['field'] . " like '%" . $vaValue['value'] . "%'"; } } //init where grid $cWhere = "date >= '{$dTglAwal}' AND date <= '{$dTglAkhir}' " . $cWhere_opt . (!empty($vaWhere) ? " AND (" . implode(" OR ", $vaWhere) . ")" : ""); $vaReturn = array(); $dbData = $scDb->Browse("sppd", "*", $cWhere, "", "", $cOrder, $cLimit); $dbDataNL = $scDb->Browse("sppd", "*", $cWhere); while ($dbRow = $scDb->GetRow($dbData)) { $dbRow['recid'] = $dbRow['code']; $cStatus = $dbRow['status']; $dbRow['code'] = '<a class="a-click" onClick="OBJFORM_NEW.trsppd.Print(\'' . $dbRow['recid'] . '\')">' . $dbRow['recid'] . '</a>'; $dbRow['code'] = html_entity_decode($dbRow['code']); $dbRow['status'] = html_entity_decode(sppd::GetStatus($dbRow['status'], true)); $dbRow['date'] = scDate::String2Date($dbRow['date']); $dbRow['date_go'] = scDate::String2Date($dbRow['date_go']); $dbRow['date_back'] = scDate::String2Date($dbRow['date_back']); $dbRow['letter_date'] = scDate::String2Date($dbRow['letter_date']); $dbRow['nip_pejabat'] = scSys::GetKeteranganOne("nama", "nip = '{$dbRow['nip_pejabat']}'", "pegawai"); $dbRow['nip_leader'] = scSys::GetKeteranganOne("nama", "nip = '{$dbRow['nip_leader']}'", "pegawai"); $dbRow['username'] = scSys::GetKeteranganOne("FullName", "UserName = '******'username']}'", "username"); $vaReturn[] = $dbRow; } $vaReturn = array("total" => $scDb->Rows($dbDataNL), "records" => $vaReturn); echo json_encode($vaReturn); }
function SetDefine() { //set define harus dipanggil setiap saat karena define jika direload akan hilang //ex define("sapeltu","isi",true) ; //location if (!defined("SYS_Url")) { define("SYS_Url", scSys::GetConfig("sc_front_url")); } if (!defined("SYS_UrlCore")) { define("SYS_UrlCore", SYS_Url . "sapeltucore/"); } if (!defined("SYS_UrlImages")) { define("SYS_UrlImages", SYS_Url . "/uploaded/"); } if (!defined("SYS_Title")) { define("SYS_Title", scSys::GetConfig("sc_front_title")); } if (!defined("SYS_ImgHeader")) { define("SYS_ImgHeader", scSys::GetConfig("sc_header")); } if (!defined("SYSCORE_VER")) { define("SYSCORE_VER", "0.0.1"); } if (!defined("SYCORE_MAIL")) { define("SYCORE_MAIL", "SMTP"); } //pdf setup if (!defined('PDF_MARGIN_FOOTER')) { define('PDF_MARGIN_FOOTER', 10); } if (!defined('PDF_MARGIN_TOP')) { define('PDF_MARGIN_TOP', 10); } if (!defined('PDF_MARGIN_BOTTOM')) { define('PDF_MARGIN_BOTTOM', 10); } if (!defined('PDF_MARGIN_LEFT')) { define('PDF_MARGIN_LEFT', 13); } if (!defined('PDF_MARGIN_RIGHT')) { define('PDF_MARGIN_RIGHT', 7); } if (!defined('SYSCORE_VER')) { define('SYSCORE_VER', '0.0.2'); } if (GetSession("scDatabase") == "") { SCDatabase(); SaveSession("scDatabase", "oke"); } }
function LoadSPPD_Pelaporan($va) { global $scDb; $cUserName = GetSession("cSession_UserName"); $cLv_Admin = scSys::GetConfig("sc_admin"); $cLv = GetSession("cSession_SCLevel"); $cNip = GetSession("cSession_UserName_Target"); $cSearch = $va['cSearch']; $vaArray = array(); $cWhere = strpos($cLv_Admin, $cLv) === false ? "code LIKE '%{$cSearch}%' AND (nip_leader = '{$cNip}')" : "code LIKE '%{$cSearch}%'"; $dbData = $scDb->Browse("sppd", "code,date", $cWhere); while ($dbRow = $scDb->GetRow($dbData)) { $vaArray[] = array("id" => $dbRow['code'], "text" => $dbRow['code'] . " pada tanggal " . scDate::String2Date($dbRow['date'])); } if (empty($vaArray)) { $vaArray[] = array("id" => "scnull", "text" => "Tidak ditemukan"); } echo json_encode($vaArray); }
public static function SendMail($cMailTo, $cSubject, $vaData) { //set table $cBodyTable = ""; foreach ($vaData as $key => $value) { $cBodyTable .= ' <tr> <td class="head" style="border-bottom: 1px solid #eaeaea;font-size: 16px ; font-weight: 600; padding: 10px 5px 5px 5px;">' . $key . '</td> </tr> <tr> <td class="child" style="padding: 5px 10px ;">' . $value . '</td> </tr>'; } $cUrl = scSys::GetConfig("sc_front_url"); $cImage = $cUrl . str_replace("./", "", scSys::GetConfig("sc_logo_mail")); $vaReplace = array("cTitle_Prg" => scSys::GetConfig("sc_front_title"), "cImage" => $cImage, "cUrl" => $cUrl, "cTitle" => $cSubject, "vaData" => $cBodyTable, "nYear" => date("Y")); $cData = @file_get_contents("./pages/ajaxload/theme_mail.php"); $cData = scSys::ReplaceString($vaReplace, $cData); $cData = trim(str_replace(array('\\r', '\\n'), '', $cData)); scSys::SendMail($cMailTo, $cSubject, $cData); }
<div class="checkbox"> <!-- <label>Ingat Saya <input type="checkbox" name="ckRemember"> </label> --> </div> <button id="btnSubmit" class="btn btn-default btn-block">Login</button> </form> </div> </div> <div class="footer"> <?php echo scSys::GetConfig("sc_front_title"); ?> | <a href="./pages/log.php" target="_blank">Ver : <?php echo GetSession("SYS.ver"); ?> </a> </div> </div> </div> </div> <script type="text/javascript" src="./sapeltucore/sc_credits/jquery/jquery.js"></script> <script type="text/javascript" src="./sapeltucore/sc_credits/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="./sapeltucore/sc_include/sc.core.js"></script> <script type="text/javascript"> $('document').ready(function(){
public static function NomHoliday($dTglAwal, $dTglAkhir) { $vaStart = explode("-", $dTglAwal); $vaEnd = explode("-", $dTglAkhir); $cLibur = scSys::GetConfig("sc_harilibur_" . $vaStart[0]); if ($vaEnd[0] != $vaStart[0]) { $cLibur .= scSys::GetConfig("sc_harilibur_" . $vaEnd[0]); } $nLiburan = 0; for ($i = strtotime($dTglAwal); $i <= strtotime($dTglAkhir); $i += 86400) { $dDate = date("Y-m-d", $i); $vaGetDate = getdate($i); $lValid = strpos($cLibur, $dDate) > -1 ? true : false; $lValid = $vaGetDate['wday'] == 0 ? true : $lValid; if ($lValid) { $nLiburan++; } } return $nLiburan; }
$nFont = 11; $pdf = new Cezpdf("A4", "P", $vaOpt, '0'); $pdf->ezImage(scSys::GetConfig("sc_header"), false, 100, 600); $pdf->ezTable($vaTable1, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 60, "wrap" => 1), "1" => array("width" => 20, "wrap" => 1), "2" => array("width" => 2), "3" => array("width" => 18, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezText("<u><b>PERINTAH PERJALANAN DINAS</b></u>", $nFont + 2, array("justification" => "center")); $pdf->ezText("(SPPD)", $nFont + 2, array("justification" => "center")); $pdf->ezText(""); $pdf->ezTable($vaTable2, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("1" => array("width" => 4, "wrap" => 1), "2" => array("width" => 40, "wrap" => 1), "3" => array("width" => 56, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezText(""); $pdf->ezTable($vaTanggal, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 50, "wrap" => 1), "1" => array("width" => 25, "wrap" => 1), "2" => array("width" => 2), "3" => array("width" => 23, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezTable($vaTtd, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 50, "wrap" => 1, "justification" => "center"), "1" => array("width" => 40, "wrap" => 1, "justification" => "center")))); $pdf->ezNewPage(); $pdf->ezImage(scSys::GetConfig("sc_header"), false, 100, 600); $pdf->ezText("<u><b>SURAT PERINTAH TUGAS</b></u>", $nFont + 2, array("justification" => "center")); $pdf->ezText("NOMOR : ", $nFont + 2, array("justification" => "center")); $pdf->ezText(""); $pdf->ezTable($vaDasar, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("1" => array("width" => 20, "wrap" => 1), "2" => array("width" => 2), "3" => array("wrap" => 1)))); $pdf->ezText(""); $pdf->ezText("MEMERINTAHKAN :", $nFont + 2, array("justification" => "center")); $pdf->ezText(""); $pdf->ezTable($vaKepada, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("1" => array("width" => 20, "wrap" => 1), "2" => array("width" => 2), "3" => array("width" => 4), "4" => array("width" => 20, "wrap" => 1), "5" => array("width" => 2), "6" => array("wrap" => 1)))); $pdf->ezText(""); $pdf->ezTable($vaUntuk, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("1" => array("width" => 20, "wrap" => 1), "2" => array("width" => 2), "3" => array("wrap" => 1)))); $pdf->ezText(""); $pdf->ezText(""); $pdf->ezTable($vaTanggal, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 50, "wrap" => 1), "1" => array("width" => 25, "wrap" => 1), "2" => array("width" => 2), "3" => array("width" => 23, "wrap" => 1)))); $pdf->ezText(""); $pdf->ezTable($vaTtd, "", "", array("showLines" => 0, "showHeadings" => 0, "fontSize" => $nFont, "cols" => array("x" => array("width" => 50, "wrap" => 1, "justification" => "center"), "1" => array("width" => 40, "wrap" => 1, "justification" => "center"))));
</div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <label>Kantor</label> <input type="text" placeholder="Kantor" value="<?php echo scSys::GetConfig("sc_company"); ?> " name="sc_company" id="sc_company" class="form-control sc-input-required"> </div> <div class="col-sm-3"> <label>Nip Kepala Kantor</label> <input type="text" placeholder="Kantor" value="<?php echo scSys::GetConfig("sc_kepala_dinas"); ?> " name="sc_kepala_dinas" id="sc_kepala_dinas" class="form-control sc-input-required"> </div> </div> </div> </div><!-- /.tab-pane --> <div class="tab-pane" id="tab_2"> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <input type="file" placeholder="Logo" name="cFileLogo" id="cFileLogo" class="form-control" accept="image/*"> <div class="text-center">Logo</div> </div>
public static function GetCabangInduk() { $cCabang = GetSession("cSession_CabangInduk"); if ($cCabang == "") { $cCabang = scSys::GetConfig("Sys_CabangInduk"); SaveSession("cSession_CabangInduk", $cCabang); } return $cCabang; }