#everest pemotong barcode
UPDATE produk SET outdoor_barcode = SUBSTR(outdoor_barcode, 1, 6) WHERE supplier_id = 1 AND CHAR_LENGTH(outdoor_barcode) >= 12 AND CHAR_LENGTH(outdoor_barcode) < 18;
UPDATE produk SET indoor_barcode_1 = SUBSTR(indoor_barcode_1, 1, 6) WHERE supplier_id = 1 AND CHAR_LENGTH(indoor_barcode_1) >= 12 AND CHAR_LENGTH(indoor_barcode_1) < 18;
UPDATE produk SET barcode = SUBSTR(barcode, 1, 6) WHERE supplier_id = 1 AND CHAR_LENGTH(barcode) >= 12 AND CHAR_LENGTH(barcode) < 18;
UPDATE produk SET kode = SUBSTR(kode, 1, 6) WHERE supplier_id = 1 AND CHAR_LENGTH(kode) >= 12 AND CHAR_LENGTH(kode) < 18;

if( ! function_exists('kekata'))
{
	 function 
}
else{

}
mongodb
// $mg->where("dtime_bulan", $bln_yg_dicari);
// $mg->set($tmp_statik);
// $mg->update($coll_nama);

Netplwiz autologin windows
systemctl restart httpd
df -h
systemctl reboot -i

// unzip gz file
gzip -dv  2022.12.08_06.04_192.168.11.101_run_san_modul_backupHost.sql.gz

mysql -u admin -p majumapan_cek  < /var/www/html/2023.11.14_23.15_192.168.11.100_run_majumapan_web_192.168.5.7.sql

exec("mysqldump --user={$user} --password={$pass} --host={$host} {$database} | gzip > $dir/$file.sql.gz", $output, $res);

mysqldump --user=admin --password=mayanet619955 --lock-tables --databases undian > /var/www/html/teguh/undian.sql;
mysqldump -u admin_backup -p -x -A > /data/backup/dbs.sql

mysqldump --user=admin --password=mayanet619955 --lock-tables --databases run_san > /var/www/html/san/run_san_2021-12-28.sql;

// clear memcache https://tecadmin.net/flush-memory-cache-on-linux-server/
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches 

/*multy log*/
$str_log = date('Y-m-d H:i') . " modular $persen_modular% $jml_modular/$jml $ipadd";
// $dir = dirname(__FILE__) . '/db';;
$dir = "/var/www/html/log";
$myfile = file_put_contents($dir . '/log_modul.txt', $str_log . PHP_EOL, FILE_APPEND | LOCK_EX);

DATATABLE
$('table#id_tbl').DataTable().columns(0).visible(true); // TAMPIL
$('table').DataTable().columns(0).visible(false); // hidden

//-------------------------------------------------------------------------
contoh:
https://san.mayagrahakencana.com/Ledger/viewMoveDetails_1/Rekening/persediaan%20produk
excel_name = "$file_excel-" . dtimeNow('Ymd-His');
$strItems = blobEncode($items);
$strItems2 = blobEncode($items2);

$excel_data = "data=$strItems&item2=$strItems2";

$btn_tambahan = "<button type='button' class='btn btn-warning' onclick=\"download_excel()\"><i class='fa fa-download'></i> excel</button>";
$btn_tambahan .= downloadXlsx($link_excel, $excel_data, $excel_name);
//-------------------------------------------------------------------------

// vi crontab -e
dd	Delete current line
u	Reverse last change
x	Delete character under the cursor
j	Merge lines
o	Insert a new line under the current one
p	Insert data from the memory buffer at the cursor position
:q	Quit the editor without saving the text.
:wq	Write the changes to the file and quit the editor
i	Switch to input mode, in order to add and edit text
pada mode edit ESC dulu baru :wq/:q

//--
$day_now = dtimeNow('d');
$date_now = dtimeNow('Y-m-d');
if (isset($_GET['date1'])) {
    $date_now = $_GET['date1'];
}
$datemin = $kemarin = date('Y-m-d', strtotime("-30 day", strtotime($date_now)));
$dateplus = $kemarin = date('Y-m-d', strtotime("1 day", strtotime($date_now)));

$date_start = dtimeNow('Y-m-01');
if($day_now < 14){
    $date_start = $datemin;
}
// cekBiru($datemin . " $date_start");

// cekHijau("$date_now || $datemin || $dateplus");
// $rdate_left = "onClick=\"location.href='$tr_jenis?date1=$datemin&date2=$datemin'\"";
// $rdate_right = "onClick=\"location.href='$tr_jenis?date1=$dateplus&date2=$dateplus'\"";
// $rdate_right = "onClick=\"location.hrf='anu'\"";

function prety_array($array)
{
    echo "<pre>";
    print_r($array);
    echo "</pre>";
}

// modifikasi kolom table
ALTER TABLE `produk` 
	ADD COLUMN `kendaraan_id` int(11)   NOT NULL DEFAULT 0 after `lokasi` , 
	ADD COLUMN `kendaraan_nama` varchar(255)  COLLATE latin1_swedish_ci NULL after `lokasi_nama` ;
ALTER TABLE `produk_supplies` ADD COLUMN `coa_code` varchar(32)  NULL DEFAULT NULL after `id`;

ALTER TABLE __raw_rek_pembantu__1040
CHANGE COLUMN dtime dtime_2 datetime DEFAULT NULL,
ADD COLUMN dtime datetime DEFAULT NULL AFTER fulldate;

// ngloning isi table ke tabel lain dalan 1 database
INSERT INTO transaksi_registry_2 
SELECT *
FROM transaksi_registry
WHERE transaksi_id>'32000' and transaksi_id<='48000';

// trigger___________other database______________
CREATE TRIGGER trigger_employee
AFTER INSERT ON dummy_sumber_boga_modul.per_employee
FOR EACH ROW
BEGIN
   INSERT INTO dummy_sumber_boga_modul_pos.per_employee
   (id, nama, nama_login, password, toko_id,email,status,trash,jenis,cabang_id,gudang_id,ipadd,account_status,cabang-nama)
   VALUES
   (NEW.id, NEW.nama, NEW.nama_login, NEW.password,  NEW.toko_id, NEW.email, NEW.status, NEW.trash, NEW.jenis, NEW.cabang_id, NEW.gudang_id, NEW.ipadd, NEW.account_status, NEW.cabang-nama);
END;
//---------------------------------------
CREATE TRIGGER copy_data_kolom after INSERT ON __rek_pembantu_produk__010304
 FOR EACH ROW 
BEGIN
   SET NEW.produk_id = NEW.extern_id;
   SET NEW.produk_nama = NEW.extern_nama;
 END;

//---------------------------------
CREATE TRIGGER tambah_barang after INSERT ON barang
 FOR EACH ROW BEGIN
 INSERT INTO stok SET
  kd_barang = NEW.id, jumlah= 0,nama_barang = NEW.nama;
 END;
 //------------------------------------------------------------
 CREATE TRIGGER update_barang after UPDATE ON barang
 FOR EACH ROW BEGIN
 UPDATE stok SET
  nama_barang = NEW.nama
WHERE kd_barang = OLD.id;
 END;
 //------------------------------------------------------------
 CREATE TRIGGER update_barang after UPDATE ON barang
 FOR EACH ROW BEGIN

 INSERT INTO stok SET
  kd_barang = NEW.id, jumlah= 0,nama_barang = NEW.nama;

 UPDATE stok SET
  nama_barang = NEW.nama
WHERE kd_barang = OLD.id;

 END;
 //------------------------------------------------------------
CREATE TRIGGER jual_barang after INSERT ON jual
 FOR EACH ROW 
BEGIN
 UPDATE stok
 SET jumlah = jumlah - NEW.jumlah
 WHERE
 kd_barang = NEW.kd_barang;
 END;
 //------------------------------------------------------------everest-------------------
CREATE TRIGGER upd_trash_supplier after UPDATE ON per_supplier
 FOR EACH ROW 
BEGIN
IF NEW.trash <> OLD.trash THEN
 UPDATE merek
 SET trash = NEW.trash
 WHERE
 supplier_id = NEW.id;

 UPDATE produk
 SET trash = NEW.trash
 WHERE
 supplier_id = NEW.id;

 UPDATE produk_outdoor
 SET trash = NEW.trash
 WHERE
 supplier_id = NEW.id;

 UPDATE produk_indoor_1
 SET trash = NEW.trash
 WHERE
 supplier_id = NEW.id;
 
 UPDATE diskon_pembelian
 SET trash = NEW.trash
 WHERE
 supplier_id = NEW.id; 

 UPDATE diskon_pembelian_supplier
 SET trash = NEW.trash
 WHERE
 supplier_id = NEW.id; 
 
 END IF;
 END;
 
 CREATE TRIGGER upd_trash_produk after UPDATE ON produk
 FOR EACH ROW 
BEGIN
IF NEW.trash <> OLD.trash THEN
 UPDATE produk_per_supplier
 SET trash = NEW.trash
 WHERE
 produk_id = NEW.id;
 
 END IF;
 END;
 //------------------------------------------------------------
 show triggers from test;
 
 DROP TRIGGER test.tambah_barang;
 //------------------------------------------------------------

 CREATE TRIGGER del_opname_data after DELETE ON dashboard_opname
 FOR EACH ROW 
BEGIN
 DELETE FROM dashboard_opname_data
 WHERE
 dashboard_opname_data.dashboard_opname_id = OLD.id;
END
  //------------------------------------------------------------

  DELETE FROM produk
 WHERE
 coa_code = OLD.head_code;
 
 DELETE FROM per_customer
 WHERE
 coa_code = OLD.head_code;
 END;

 DELETE FROM bank
 WHERE
 coa_code = OLD.head_code;
 END;
//-----------------------------------------------------------
CREATE TRIGGER add_produk_per_serial_jasa
AFTER INSERT ON produk
FOR EACH ROW
BEGIN
    IF NEW.kategori_nama = 'jasa' THEN

        INSERT INTO produk_per_serialnumber (produk_sku,produk_nama, produk_id,produk_sku_part_nama
)
        VALUES (NEW.kode, NEW.nama,NEW.id,NEW.kode);
    END IF;
END;
 
CREATE TRIGGER upd_produk_per_serial AFTER UPDATE ON produk
FOR EACH ROW 
BEGIN
IF NEW.kode <> OLD.kode OR OLD.nama <> NEW.nama OR NEW.trash <> OLD.trash THEN
 UPDATE produk_per_serialnumber
 SET produk_sku = NEW.kode, produk_sku_part_nama = NEW.kode,produk_nama = NEW.nama, trash = NEW.trash
 WHERE
 produk_id = NEW.id;
 
 END IF;
 END;

 //------------------------------------------------------------
https://192.168.5.14/majumapan/Cli/genPenjualan?debuger=1&r=0

$hasil .= "<a href='https://api.whatsapp.com/send?phone=6285109028289&text=Hi%20Markonah%20Mitra%20Abdi%20Solusi'>wa</a>";
https://t.me/mas_sales1

$polaemail = "/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,3}$/i";
if(!preg_match($polaemail, $email)) {

}

$ip = $_SERVER['REMOTE_ADDR'];
// folder root
dirname(__FILE__) . DIRECTORY_SEPARATOR;
getcwd();
$_SERVER['DOCUMENT_ROOT'];

// form jebakan
	if (!isset($_SESSION['submit_selesai'])) {
                    $_SESSION['submit_selesai'] = true;
                }
// form_process
	if ($_SESSION['submit_selesai'] == false) {
                      die(toAlert("proses sedang berlangsung, harap bersabar..... :> "));
                }
                elseif ($_SESSION['submit_selesai'] == true) {

                    $_SESSION['submit_selesai'] = false;
                }
// --------------------------------------------proses
	unset($_SESSION['submit_selesai']);

watch -n 1 php /var/www/html/majumapan/index.php Cli genPenjualan
watch -d 5 php /var/www/majumapan/index.php Cli genPenjualan

$hari = date(‘l’,strtotime($tgl));
$dtgl = date('j',strtotime($ddate));
$dbln = date('n',strtotime($ddate));
$dthn = date('Y',strtotime($ddate));

$prev_date = date('Y-m-d', strtotime($date .' -1 day'));
$next_date = date('Y-m-d', strtotime($date .' +1 day'));

SET COOKIE
if (isset($ingat)) {
    setcookie("namaLogin", $nama, time() + 259200);
    setcookie("passwordLogin", $password, time() + 259200);
} else {
    setcookie("namaLogin", "", time() - 3600);
    setcookie("passwordLogin", "", time() - 3600);
}

md5 kosong 
d41d8cd98f00b204e9800998ecf8427e
123456
e10adc3949ba59abbe56e057f20f883e
sudo cp /var/www/debug/ci2/* /var/www/debug/cishare/ -R
 sudo cp /var/www/san /var/www/san_00/ -R

autocomplete='off'

0004
printf("%04d", $num);

API-Key: 02f00d69368f09aeb5011cec5679062f

// remove space on array
$arrSupp_email = array_filter(array_map('trim',$supp_email_exp));
// redirect pages:
	
$strOnload = "document.forms.login.nama.focus();";
header("refresh:1200"); 	
// refresh per 20 menit

$ci = &get_instance();

$path_web = "http://192.168.1.47/debug/presensi/new/Pages/Views/login.php";
header("location:$path_web");

$gotohell = "https://google.com";
echo "<meta http-equiv='refresh' content='0; url=$gotohell' />";
echo "<meta http-equiv='refresh' content='3'>";
header("Location: $gotohell");

isset($_GET['r']) && $_GET['r'] > 0 ? header("Refresh:" . $_GET['r']) : "";

agen browser 
$user_agent2 = $_SERVER['HTTP_USER_AGENT'];

$strTopMenu .= "<td><input type=text name=nama style='width:216px;color:#bbb;' value='$defID' onblur=\"if(this.value == '') { this.style.color='#bbb'; this.value='$defID'}\" onfocus=\"if (this.value == '$defID') {this.style.color='#000'; this.value=''}\" ></td>";

$actual_host = trim($_SERVER['HTTP_HOST']);
$basik_nama = basename($_SERVER['REQUEST_URI']); 	// n-data_produk.php?Mode=Harga&mn=data&cm=2
$curent = $_SERVER[REQUEST_URI]; 			// /Pages/Data/n-data_produk.php?Mode=Harga&mn=data&cm=2
$referer = $_SERVER['HTTP_REFERER'];		// http://192.168.1.59/Pages/Data/n-data_produk.php?Mode=View&mn=data&cm=1 
echo $_SERVER['SERVER_NAME'];			// www.anu.comipa

$script_bottom .= "$(\"#graph_produksi2\").append($(\"<div/>\").load(\"$link_graph_efisiensi_thn\"));";

load onclick
$("#privacy").click(function(){
        $("#pages").load("https://vitocafe.com/Welcome/privacyPolicy");
    });

    $("#welcome").click(function(){
                        window.location.reload();
                    });$("#about").click(function(){
                        $("#pages").load("https://vitocafe.com/about");
                    });$("#produks").click(function(){
                        $("#pages").load("https://vitocafe.com/produks");
                    });$("#artikel").click(function(){
                        $("#pages").load("https://vitocafe.com/artikel");
                    });

echo "<script>top.location.href='$referer'</script>";
echo $_SERVER['HTTP_REFERER'];

load('https://teguh.mayagrahakencana.com/pembelian/_selectorItem/selectItem/466/MdlProdukPerSupplier?search='+encodeURI(this.value));

$host= gethostname();				// sub_domain demo.mayagraha.....
$ip_2 = gethostbyname($host);			// ngeluarin ip server 192.168.11.150

unset($_SESSION["start_bl"]);

htmlspecialchars($l['lokasi_nama'],ENT_QUOTES); // encoder untuk single quot
htmlspecialchars();            // encode entitas
html_entity_decode($s['isi']); // decode entitas

// css tambahan
        $strMain .= "<style type='text/css'>
        .modal-dialog {width: 700px;}
        .modal {position: absolute;}
        td.borderless-bottom{border-bottom: 1px solid #fff !important;}
        .masthead {
          background-color: @brand-primary;
        }
        </style>";

die ("<script>alert('$msg');top.location.href='administrator.php?Mode=Insert'</script>");
echo "<script>alert('$msg');top.location.href='$_SERVER[PHP_SELF]?Mode=UserTraffic'</script>"; po

// tangal input
$strInfo .= "<script>DateInput('name_input', true, 'YYYY-MM-DD','$default_dtime')</script>";

$curent_url = $_SERVER[REQUEST_URI];

                    echo "<script>";
                    echo "var ok = confirm('YAKIN melewati verivikas ?');
                      if(ok == true){
//                        ok = window.location='$curent_url&skip=1';
                      }else{
                        history.go(-1);
                      }";
                    echo "</script>";
                }

$strMain .= "<img src='../../Assets/Images/loading.gif'><META HTTP-EQUIV = 'Refresh' Content = '0; URL =../../Pages/Mast/setcookie.php?n=$n'> ";
open new tab
onclick=\"window.open('../../public/akunting/cek_generator.php?Mode=Rekening&r=30');\">view progres generator</button>";
open popup
$cetak = "<a href='JavaScript:Void(0);' onclick=\"popup('$popup_setoran_print&id=$setoran_id&oid=$setoran_outlet&onama=$setoran_outlet_nama')\" title='Print laporan'><img src='../../Assets/Images/printer.gif' style='vertical-align: middle;'></a>";

in_array("admin", $arrayAdmin)

// mengambil id terakir:
$q2="SELECT LAST_INSERT_ID() AS lastId";

$q2="SELECT LAST_INSERT_ID() AS lastId";
$x2=mysql_query($q2,$conn) or die(mysql_error());
while ($l=mysql_fetch_assoc($x2))
{
	$id2=$l['lastId'];
}

<?php

$fh = fopen('filename.txt','r');
while ($line = fgets($fh)) {
  // <... Do your work with the line ...>
  // echo($line);
}
fclose($fh);
?>

$q2 = "SELECT LAST_INSERT_ID() AS lastId";
$x2 = mysql_query($q2, $conn) or die(mysql_error());
$l2 = mysql_fetch_array($x2);
$lastId = $l2['lastId'];

// comit inoDB:
mysql_query("SET AUTOCOMMIT=0",$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));
mysql_query("BEGIN",$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));
//{disini actionnya}
mysql_query("COMMIT",$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));
echo "<script>top.location.href='$_SERVER[PHP_SELF]'</script>";

----------
mysql_query("SET AUTOCOMMIT=0",$conn) or die(mysql_error());
mysql_query("BEGIN",$conn) or die("<script>alert(\"".mysql_error()."\");</script>");
//{disini actionnya}
mysql_query("COMMIT",$conn) or die("<script>alert(\"".mysql_error()."\");</script>");

//select II
$sql = "select * from anggota where nama='$sesNama' and level='2' and kerbak='1'";
mysql_select_db($db);
$qry = mysql_query($sql) or die("Query salah : " . mysql_error());

// delete:
$q="delete from images where idprod='$_GET[id]'";
$x=mysql_query($q,$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));	

$q="delete from images  ";
$q.="where idprod='$_GET[id]'";
$x=mysql_query($q,$conn) or die(mysql_error());

if (unlink("../../Assets/Images/Upload/$file"))
{
	$q="delete from images  ";
$q.="where idimage='$_GET[id]'";
	$x=mysql_query($q,$conn) or die(mysql_error());
	header("location:$_SERVER[PHP_SELF]?Mode=Detail&id=$idp");
}

// menambah kolom quarter virtual
SELECT YEAR(tanggal) as 'tahun',
 QUARTER(tanggal) as 'Quarter', avg(nilai_af) as 'nilai_af Count'
FROM penjualan
where periode='bulanan' and cabang_id='0'
GROUP BY YEAR(tanggal), QUARTER(tanggal)
ORDER BY 1,2

// ngopi data ke tabel lain
INSERT INTO transaksi_registry_0 
SELECT *
FROM transaksi_registry
WHERE transaksi_id>='1' and transaksi_id<='16000'

spanduk balinet
https://rapidshare.com/files/174481626/tiga2.cdr

// MENAMPILKAN KOLOM DALAM 1 TABLE
show columns from transaksi;

/*---------------data base------------*/

$q = "SHOW TABLES from $DB_0";
$x = mysql_query($q) or die("Query salah : " . mysql_error());
while ($l = mysql_fetch_row($x)) {
            $table_nama = $l[0];        
}

$q = "TRUNCATE TABLE $tbls";
$x = mysql_query($q, $conn) or die(mysql_error());

// update:
$q = "update $tbl set urut='$_GET[set]' where id='$_GET[id]'";
$x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));

// insert:
$q = "insert into transaksi (jenis,tgTransaksi)";
$q .= "values('input',CURRENT_TIMESTAMP() )";
$x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));

$q = "insert into transaksi (jenis,tgTransaksi)";
$q .= "values('input',CURRENT_TIMESTAMP() )";						
$x = mysql_query($q,$conn) or die(mysql_error());

if (mysql_affected_rows($conn) > 0) {

}

// insert CLI
$q = "insert into transaksi (jenis,tgTransaksi)";
$q .= "values('input',CURRENT_TIMESTAMP() )";
$x = mysql_query($q, $conn) or die(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__);
					
// select 
$q = "select * from $tbl where idProduk='$id'";
$x = mysql_query($q,$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));	
while($l = mysql_fetch_assoc($x)){
}

$q = "select * from $tbl where idProduk='$id'";
$x = mysql_query($q,$conn) or die(mysql_error());

$q = "select * from $tbl where idProduk='$id'";
$x = mysql_query($q,$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));	
$jml = mysql_num_rows($x);										

$q = "select * from $tbl where idProduk='$id'";
$x = mysql_query($q,$conn) or die(toAlert(mysql_error()." on ".__FUNCTION__." line ".__LINE__." file ".__FILE__));	
$l = mysql_fetch_array($x);

class
// connect
$db0 = New db_class();

// jika opsi error di configurasi di munculkan maka error akan tampak

$db0 = New _00_DBclass();
!$db0->connect() ? $db0->display_errors(__FILE__ . " no " . __LINE__) : ""; 

// select class
$q = "select * from $tbl";
$x = $db0->select($q);
!$x ? die($db0->display_errors(__FILE__ . " on line " . __LINE__)) : "";

while ($l = $db0->get_row($x)) {
    echo $l->id;
    echo $l->dtime;
    echo "<br>";
}

// class
    // region array kolom yg ingin dipanggil
            $arrKolom = array(
                "id" => "id",
                "nama" => "nama konsumen",
                "tlp" => "telpon",
                "nik" => "nik",
                "alamat" => "alamat",
                "npwp" => "npwp",
                "email" => "email",
            );
            // endregion array kolom yg ingin dipanggil

            // region queri data yg dibutuhkan
            $list = implode(",",array_flip($arrKolom));

            $conditional = "where id='$relasi_id'";
            $q = "select $list from $tbl $conditional";
            $x = $db0->select($q);
            !$x ? die($db0->display_errors(__FILE__ . " on line " . __LINE__)) : "";
            $l = $db0->get_row($x);

            foreach ($arrKolom as $kolom => $kolom_alias){
                $$kolom = $l->$kolom;
            }
            // endregion queri data yg dibutuhkan

// insert
$q = "insert into orders_comments (orders_id,orders_status,authors_id,comments,dtime)";
$q .= "values('$orders_id','$orders_status','$authors_is','$comments',CURRENT_TIMESTAMP() )";
$x = $db1->run_sql($q, false);
!$x ? die($db1->display_errors(__FILE__ . " on line " . __LINE__)) : "";

// update
$q = "update orders_comments  set comments=’$comments’";
$x = $db1->run_sql($q, true);
!$x ? die($db1->display_errors(__FILE__ . " on line " . __LINE__)) : "";

drop database ds_mitsubishi_00;

// lock unlock table supaya tidak digunakan script lain
/*---lock data table---*/
        $query = "lock tables $tbl write";
        mysql_query($query) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file "  . __FILE__));
//' query lainnya

/*---unlock data table---*/
        $query_ = "unlock tables";
        mysql_query($query_) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));

// baca file dalam folder
$path = "assets/images/slider/";
if ($handle = opendir($path)) {
    $files = "";
    while (false !== ($entry = readdir($handle))) {
        if ($entry != "." && $entry != "..") {
            $files = $path . $entry;
            $strSlider .= "<a href='#' target='_blank'><img src='$files' border='0' alt='barcode' style='margin:auto; width:200px;display:block'></a>";
        }
    }
    closedir($handle);
}

// region mencatat orderan bulanan
                    $q = "select id from orders_bl where bulan='$today_m' and tahun='$today_Y'  and anggota_id='$id_anggota' and produk_id='$prod_id'";
                    $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));
                    $l = mysql_fetch_array($x);
                    $orders_bl_id = $l['id'];

                    if (mysql_num_rows($x) > 0) {

                        $q = "update orders_bl set orders_in=orders_in+$prod_jml where id='$order_bl_id'";
                        $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));

                    } else {

                        $q = "insert into orders_bl (tanggal,bulan,tahun,anggota_id,produk_id,orders_in)";
                        $q .= "values(CURRENT_TIMESTAMP,'$today_m','$today_Y','$id_anggota','$prod_id','$prod_jml')";
                        $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));

                    }
                    // endregion order_bl

//pop up hislide file
<a href=\"satuan.php\" onclick=\"return hs.htmlExpand(this, { objectType: 'ajax'} )\">add satuan</a>
onclick=\"return hs.close(this)\"

$strMain .= "<a id=thumb11 class=highslide onclick='return hs.expand(this)' href=\"../../Assets/Images/Upload/$namafile\" ><img src='../../Assets/Images/Upload/$namafile' alt=\"peta hommy\" class=\"left\"/ height='50px' style='border:1px solid #ddd;padding: 2px;background:#fff;'></a>";

"<input type=text size=2 maxlength=4 name=urut value='$urut' onBlur=\"location.href='$_SERVER[PHP_SELF]?Mode=SetUrut&id=$id&set='+this.value\">"

konfirmasi
onClick=\"doConfirm('$dmsg', function yes(){location.href='$_SERVER[PHP_SELF]?Mode=ExecutorDelete&id=$sesuatu_id$cm$mn';});\"
onClick=\"if(confirm('$dmsg $id')==1){location.href='$_SERVER[PHP_SELF]?$modeD&id=$id';}\"
<a href='JavaScript:void(0);' onClick=\"if(confirm('$dmsg $id')==1){location.href='$_SERVER[PHP_SELF]?$modeD&id=$id';}\" title='Delete'><img src='../../Assets/Images/delete.gif'></a>";
echo "<script>if(confirm('$dmsg $id')==1){location.href='$_SERVER[PHP_SELF]?$modeD&id=$id';}</script>";

konfirm dalam form submit
<form method="post" id="myForm" action="/san/public/finance/749.php?Mode=Executor&amp;mn=finance&amp;cm=3" onsubmit="confirm_submit('Peringatan', 'Kas diterima 95.703.760,05?','myForm','OK'); return false" target="result">

$strMain = "<form method='post' action='$_SERVER[PHP_SELF]?Mode=ExecutorClaim&idd=$id_cabang$mn$cm' onsubmit=\"return confirm('$dmsg_ok')\">";

select * from nilai where month(tanggal)='2'

timediff(now(),in_dtime)

$strMain .= "<script language=\"JavaScript\" type=\"text/javascript\"	xml:space=\"preserve\">
								//<![CDATA[
								var frmvalidator  = new Validator(\"form1\");
								frmvalidator.addValidation(\"kelamin\",\"dontselect\",\"pilih jenis kelamin\");

								frmvalidator.addValidation(\"nama\",\"req\",\"masukan nama Customer\");
								frmvalidator.addValidation(\"email\",\"req\",\"masukan eamail\");
								frmvalidator.addValidation(\"email\",\"email\",\"eamail tidak valid\");

								frmvalidator.addValidation(\"kelamin\",\"selone\",\"pilih jenis kelamin\");

								//]]></script>";

kalkun tes kirim
INSERT INTO `outbox` VALUES (CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),'23:59:59','00:00:00',NULL,'081804095852','Default_No_Compression',NULL,-1,'testing SMS Gateway','','false',-1,NULL,'0000-00-00 00:00:00','default','');

deteksi dimensi image
 list($width, $height, $type, $attr) = getimagesize("../../Assets/Images/Upload/$fotoprod");

// format tanggal indonesia
$masuk = indonesian_date($in_dtime,'d F Y','');

function indonesian_date ($timestamp = '', $date_format = 'l, j F Y | H:i', $suffix = 'WIB')

auto uppercase
//onblur=\"javascript:{this.value = this.value.toUpperCase(); }\"
//onblur=\"javascript:{this.value = this.value.toLowerCase(); }\"

<script>
String.prototype.capitalize = function () {
        return this.replace(/(^|\s)([a-z])/g, function (m, p1, p2) {
            return p1 + p2.toUpperCase();
        });
    };
</script>
//onkeyup=\"javascript:{this.value = this.value.capitalize(); }\"

onclick='javascript:this.form.txt.focus();this.form.txt.select();

// otomatis select text dalam form
onClick=\"this.select()\"

//input kalender
$strMain.="<script>DateInput('vtg', true, 'YYYY-MM-DD')</script>";	

CURDATE(),
CURTIME()
CURRENT_TIMESTAMP

//hypo
onchange=\"getData('../../Pages/hypo/hypoHarga.php?j='+this.value,'jenis')\"

//iframe
onkeyup=\"document.getElementById('result').src='../../public/data/update_data.php?Mode=Produk&id=$id&col=harga&val='+this.value\"

// resize iframe menyesuaikan kontenya
<iframe scrolling='no' frameborder='0' id='frmid' src=’getad.aspx'
         onload='javascript:resizeIframe(this);'>
</iframe>
Use this javascript to resize iframe based on the height & width of child page

<script language="javascript" type="text/javascript">
 function resizeIframe(obj)
 {
   obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
   obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';
 }
 </script>

maxlength=4

<a onClick=\"if(confirm('clear shoping cart?')==1){location.href='$_SERVER[PHP_SELF]?Mode=ClearCart';}\">reset cart</a>";

if (isset($_POST['submit']))
{
	
}

<input type='button' value='Continue' onClick=\"if(confirm('dalam SLOW MODE kecepatan akses akan terbatas')==1){location.href='$_SERVER[PHP_SELF]?submit=1';}\">

$strMain.="<script>getData('views.php?Mode=Reguler','cek');</script>";

//fungsi interterger 	
function isint ( $mixed ) 
{
	return ( preg_match ( '/^\d*$/' , $mixed ) == 1 );				
}

$awal = microtime(true);
$akhir = microtime(true);
$lama = $akhir - $awal “detik”;

robots
<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">

//jam 
<script src="http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj=new Object;obj.clockfile="5003-orange.swf";obj.TimeZone="USZ5";obj.width=192;obj.height=50;obj.Place="";obj.DateFormat="dd / MMM / yyyy";obj.TimeFormat="hh:mm:ss TT";obj.wmode="transparent";showClock(obj);</script>

085292665000 totok dingklik

sembunyikan tombol
<INPUT TYPE='submit' id='tombol' VALUE='Sign Up' class='submit-button' onclick=\"getElementById('tombol').style.display = 'block';this. style.display = 'none';\" >
//

// copy folder putty
cp -r /var/www/htdocs/Rae\ Sremmurd/ /konten/hd01/konten/Lagu/Western/Pqr/

// Dinamis
JS dinamik form
  <script language="JavaScript" type="text/JavaScript">
	  counter = 0;
	  function action()
	  {
		counterNext = counter + 1;
		document.getElementById("input"+counter).innerHTML = "<p>Masukkan Data <input type='text' name='data[]'></p><div id=\"input"+counterNext+"\"></div>";
		counter++;
	  }
  </script>
</head>

<body>
<h1>Form Dinamis</h1>

<form method="post" action="proses.php">
<p>Masukkan Data <input type='text' name='data[]'></p>

<div id="input0">
</div>

<p><a href="javascript:action();">Tambah</a></p>
<p><input type="submit" name="submit" value="Submit"><input type="reset" name="reset" value="Reset"></p>
</form>
//
CSS

<img align="middle" ...>
<img style="vertical-align:middle" ...>
<span style="display:inline-block; vertical-align:middle"> foo<br>bar </span>
atau
<td valign="middle"> <!-- but you shouldn't ever use valign --> </td>
<td style="vertical-align:middle"> ... </td>
<div style="display:table-cell; vertical-align:middle"> ... </div>
//a hover
#tumb a{
		display: block;
        	opacity:0.4;
	        filter:alpha(opacity=40); /* For IE8 and earlier */
        }
#tumb a:hover{
        	opacity:1.0;
		filter:alpha(opacity=100); /* For IE8 and earlier */
        }
#tumb img{
		border: none;
        }
carakter count 
java script code
<!-- Script by hscripts.com -->
<script type="text/javascript">
//Edit the counter/limiter value as your wish
var count = "125";   //Example: var count = "175";
function limiter(){
var tex = document.myform.comment.value;
var len = tex.length;
if(len > count){
        tex = tex.substring(0,count);
        document.myform.comment.value =tex;
        return false;
}
document.myform.limit.value = count-len;
}

</script>
<!-- Script by hscripts.com -->
html code
<!-- Script by hscripts.com -->
<form name="myform" METHOD=POST>
<textarea name=comment wrap=physical rows=3 cols=40 onkeyup=limiter()></textarea><br>
<script type="text/javascript">
document.write("<input type=text name=limit size=4 readonly value="+count+">");
</script>
</form>
<!-- Script by hscripts.com -->

tabel
echo "<table>";
echo "<tr>";
echo "<td></td>";
echo "</tr>";
echo "</table>";

$strMain .= "<table>";
$strMain .= "<tr>";
$strMain .= "<td></td>";
$strMain .= "</tr>";
$strMain .= "</table>";

$angka_2digid = str_pad($angka, 2, 0, STR_PAD_LEFT);

$popup_print = "<input type='button' value='*print alamat' id='tom' style='display: block;' onclick=\"getElementById('tom').style.display = 'block'; this.style.display = 'none'\" title='Print alamat' id='tombol-action'>";

// for perulangan hasil
for ($i = 1; $i <= 10; $i++) {
    echo $i;
}

permalink
	$arrMenu_tab = array(
        		"s1/$sesMid" => "Pages/Editors/e-orderan.php?Mode=NewOrder&t=1&n=$sesMid",
                        "s2/$sesMid" => "Pages/Editors/e-orderan.php?Mode=NewOrder&t=2&n=$sesMid",
                        "s3/$sesMid" => "Pages/Editors/e-orderan.php?Mode=NewOrder&t=3&n=$sesMid"
                    );

                    foreach ($arrMenu_tab as $m_i => $m_v) {

                        $menuTab = $permalink == 1 ? "$m_v" : "$m_v";
                        $arrMenuTab[] = $menuTab;
                    }

// region data dan setting
            $kirim_email = 1; // 1 = yes 0 = no
            $smtp = "local"; // option local / gmail

            $arrToAddr = array(
                "thomas@mayagrahakencana.com",
                "nakamoe@yahoo.co.id"
            );
            $fromAddr = "info@mcm.com";
            $fromLabel = "Request MCM";

            $toLabel = "$hasil";
            $subject = "Packingan $sesNama";
            $message = "Saya telah membuat $prod_qtt_total  packingan, untuk menambah deposit packingan MCM";

// hasil
	$allow_jenis = "";
            foreach ($arrToAddr as $i => $toAddr) {
		
$var = "'$nilai'";
if ($hasil == "") {
    $hasil .= "$var";
}
else {
    $hasil = "$hasil" . "$var";
}
            }

// menghilangkan spasi diawal kata
$mesage = ltrim($mesage);

            // endregion data dan setting email
            //region kirim email
            if ($kirim_email == 1) {
                foreach ($arrToAddr as $i => $toAddr) {
                    $toLabel = "$toAddr ";
                    $sendEmail = sendSMTPMail("$smtp", "$fromAddr", "$fromLabel", "$toAddr", "$toLabel", "$subject", "$message");
                }
            }
//endregion kirim email

$req_filter = "where bulan='$req_bl' and tahun='$req_th' and anggota_id in ($LIST_ID)";
SELECT s1 FROM t1 WHERE s1 IN    (SELECT s1 FROM t2);

tanggal mundur mysql
DATE_SUB(CURDATE(), INTERVAL 3 DAY )

$conditional = "where oleh_id='$ses_id' and date(dtime) >= DATE_SUB(CURDATE(), INTERVAL 3 DAY ) order by id desc";

// ganti mac mickrotik
interface ethernet set  ether4 mac-address=00:23:CD:B5:A4:F3

attrib -h -r -s /s /d g:\*.* 

grant

mysql -u root -p --socket=/var/run/mysqld/mysqld2.sock
mysql -u admin -p --socket=/var/run/mysqld/mysqld2.sock
/var/run/mysqld/mysqld.sock'  port: 3306 

SELECT 'db', User, Host FROM db WHERE Db='billing';
grant all on billing.* to 'admin'@'192.168.0.45' identified by 'mayanet619955';
grant select on ds_x_mgk.* to 'root'@'192.168.11.25' identified by 'mayanet619955';

flush privileges;
FLUSH HOSTS;
REPAIR TABLE table_name;

copy all file and folder
cp -r /var/www/shared/BOSSSS/* /home/thomas/temp/pwkerto/BOSSSS/

grant select on ds_mgk.* to 'admin'@'192.168.1.58' identified by 'mayanet619955';
grant all on bank_data.* to 'admin'@'192.168.1.58' identified by 'mayanet619955';
SHOW GRANTS FOR 'admin'@'192.168.11.150:3406';

grant all on *.* to 'admin'@'192.168.1.58' identified by 'mayanet619955';

source /var/www/ds/maya3/MYSQL_default/per_employee.sql;

CREATE DATABASE IF NOT EXISTS tutorial_database;;
DROP DATABASE IF EXISTS tutorial_database;;
DROP TABLE IF EXISTS ds_mgk_3.orders_bayar;;

apt-get install  mysql-client
apt-get --purge remove mysql-client mysql-server mysql-common

 /etc/init.d/freeradius restart
root@webserver:~# ps -ax | grep radius

warna body email MCM
if ($pembayaran == 0) 
{
    $line_warna = "#B4B4B4";
    $bg_warna = "#f7f7f7";
} elseif ($pembayaran == 1) {
    $line_warna = "#66CC66";
    $bg_warna = "#CCFFCC";
} elseif ($pembayaran == 2) {
    $line_warna = "#6666FF";
    $bg_warna = "#CCCCFF"
}

// explode nomer nota
$no_order_expl = explode("-", "$no_order");
                        $j_expl = count($no_order_expl);
                        $xx = $j_expl - 1;
                        $no_order_f = "..." . $no_order_expl[$xx];

// region halaman akhir
                $q8 = "select st_id from stock $listProduk $filterNamaProd order by st_id asc";
                $x8 = mysql_query($q8, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));
                $n8 = mysql_num_rows($x8);
                $full_pages = floor($n8 / $batas);
                $sisa_baris = $n8 % $batas;
                $last_pages = $sisa_baris == 0 ? "$full_pages" : $full_pages + 1;
                if (!isset($_GET['page'])){
                    echo "<script>top.location.href='$_SERVER[PHP_SELF]?Mode=Stocks&mn=mut&cm=1&page=$last_pages$get_prod_id'</script>";
                }
                // endregion halaman akhir

// meliat file dlam folder
  $dir = '../';
  $files1 = scandir($dir);
  $files1 = scandir($dir,1); //descending
// output berupa arai

// kolom
    $strMain .= "<table border='1' rules='all' width='100%'>";
    $kolom = 5;
    $no = 0;
    foreach ($arrProdukBelum as $p_id => $p_nama) {
            $no++;

            if ($i >= $kolom) {
                $strMain .= "<tr></tr>";
                $i = 0;
    }
            $i++;

            $strMain .= "<td align='center'>";
             // isi kolom
            $strMain .= "$p_nama";
            
            $strMain .= "</td>";

        }
        $strMain .= "</tr>";
        $strMain .= "</table>";
// end of kolom

// icon untuk title di browser
<link rel="icon" type="image/png" href="../../Assets/Images/Orders.png">

// key stoke
<script>
    function cekInput() {
        /*alert(detectKeyStroke());*/
        switch (detectKeyStroke()) {
            case "ESC":
                window.close();
                break;
            case "space":
                var newURL = document.location.href + '&Mode=ShowHistory';
                location.href = newURL;
                break;
        }
    }
</script>

// clear input
<script type=\"text/javascript\">
        function onkeypressed(evt, input) {
            var code = evt.charCode || evt.keyCode;
            if (code == 27) {
                input.value = '';
            }
        }
    </script>
onkeydown="onkeypressed(event, this)";

// esc fo browser back
<script type=\"text/javascript\">
window.onkeyup = function(e) {
  if (e.keyCode == 27) window.history.back();
}
</script>

// buka tutup layer
window.onkeyup = function(e) {
            var obj = document.getElementById('layer').style.display = 'none';
            if (e.keyCode == 27) {obj.style.display='block'};
 }

// onclik mouse
        document.onclick=check;
        function check(e){
            var target = (e && e.target) || (event && event.srcElement);
            var obj = document.getElementById('tutup').style.display = 'none';
            if(target!=obj){obj.style.display='block'}
        }

// region searching bolak balik 2 kata
        if (isset($_GET['cari'])) {

            $c = htmlspecialchars($_GET['cari'], ENT_QUOTES);
            $ca = explode(" ", "$c");
            $jca = count($ca);

            if ($jca == 1) {
                $filterNamaProd = "and nama like '%$ca[0]%' ";
            } else {

                $filterNamaProd = "and nama like '%$ca[0]% %$ca[1]%'";

                $q = "select * from produk where trash='0' $filterNamaProd order by idproduk";
                $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__));
                if ($num = mysql_num_rows($x) == 0) {

                    $filterNamaProd = "and nama like '%$ca[1]% %$ca[0]%'";
                }
            }
        }
        // endregion searching

<script>
        function setFocus2() {
            document.getElementsById("tombol-action-0").focus();
        }
    </script>

function onkeypressed(evt, input) {
    var code = evt.charCode || evt.keyCode;
    if (code == 27) {
        input.value = '';
    }
}
And the corresponding markup:

<input type="text" id="search" size="25" autocomplete="off" 
       onkeydown="onkeypressed(event, this);" />

// anti copy
<style>
.do-not-copy {
  -webkit-user-select:none;
  -khtml-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
}
</style>

// untuk menambahkan table lebih manusiawi di eSUS (e5)
$tmp = "<table align=center border=1 cellspacing=0 cellpadding=5 rules='all' class='tbl'>";
$tmp .= "<caption align='left' style='padding-bottom: 10px;text-align: left;'><input type=button class=btnAdd value='+ Data' onClick=\"showDialog('" . $this->URL . "?Mode=New');\"></caption>";
$tmp .= "<tr class='tblHead bg-color'>";

nl2br($string);
echo nl2br($_POST['a']);
CHR() Codes 

line feed CHR(10)
carriage return CHR(13)
new line CHR(21) 

End CHR(6) 

 CHR(7)
Home CHR(1)
Insert CHR(22)
Page Up CHR(18)
Page Down CHR(3) 

Backspace CHR(8)
Escape CHR(27)
Tab CHR(9) 

up arrow CHR(5) 
down arrow CHR(24) 
left arrow CHR(19) 
right arrow CHR(4) 

Ctrl-left arrow, Ctrl-Z CHR(26) 
Ctrl-right arrow, Ctrl-B CHR(2) 
Ctrl-Home, Ctrl-] CHR(29) 
Ctrl-End, Ctrl-W CHR(23) 
Ctrl-Page Up, Ctrl-Hyphen CHR(31) 
Ctrl-Page Down, Ctrl-^ CHR(30) 

F1 CHR(28) Alt-F1 CHR(-30) 
F2 CHR(-1) Alt-F2 CHR(-31) 
F3 CHR(-2) Alt-F3 CHR(-32) 
F4 CHR(-3) Alt-F4 CHR(-33) 
F5 CHR(-4) Alt-F5 CHR(-34) 
F6 CHR(-5) Alt-F6 CHR(-35) 
F7 CHR(-6) Alt-F7 CHR(-36) 
F8 CHR(-7) Alt-F8 CHR(-37) 
F9 CHR(-8) Alt-F9 CHR(-38) 
F10 CHR(-9) Alt-F10 CHR(-39) 
F11 CHR(133)
F12 CHR(134) 

Ctrl-F1 CHR(-20) Shift-F1 CHR(-10) 
Ctrl-F2 CHR(-21) Shift-F2 CHR(-11) 
Ctrl-F3 CHR(-22) Shift-F3 CHR(-12) 
Ctrl-F4 CHR(-23) Shift-F4 CHR(-13) 
Ctrl-F5 CHR(-24) Shift-F5 CHR(-14) 
Ctrl-F6 CHR(-25) Shift-F6 CHR(-15) 
Ctrl-F7 CHR(-26) Shift-F7 CHR(-16)
Ctrl-F8 CHR(-27) Shift-F8 CHR(-17)
Ctrl-F9 CHR(-28) Shift-F9 CHR(-18) 
Ctrl-F10 CHR(-29) Shift-F10 CHR(-19) 

css
ul.tree,
ul.tree ul {
  list-style:none;
  margin:0;
  padding:0;
}

ul.tree ul {
  margin-left:10px; /* indentation */
  position:relative;
}

ul.tree ul:before {
  content:"";
  display:block;
  width:0;
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  border-left:1px solid;
}

ul.tree li {
  margin:0;
  padding:0 12px; /* indentation + 2 */
  font-size:14px;
  line-height:20px; /* default list item `line-height` */
  color:#369;
  font-weight:bold;
  position:relative;
}

ul.tree ul li:before {
  content:"";
  display:block;
  width:10px; /* same with indentation */
  height:0;
  border-top:1px solid;
  position:absolute;
  top:10px;
  left:0;
}

ul.tree ul li:last-child:before {
  background:white; /* same with body background */
  height:auto;
  top:10px; /* (line-height/2) */
  bottom:0;
}

// 3 bulan terakhir //
if (($today_m == 01)) {
            $sesR_bl = 12;
            $sesR_th = $today_Y - 1;
        }
        else {
            $sesR_bl = $today_m;
            $sesR_th = $today_Y;
        }
 $countMonth = 3;
        for ($i = $sesR_bl - $countMonth; $i < $sesR_bl; $i++) {
            if ($i < 1) {
                $iBulan = $i + count($arrBulanX);
                $iTahun = $today_Y - 1;
            }
            else {
                $iBulan = $i;
                $iTahun = $today_Y;
            }
            $arrTigaBulan[$iBulan] = $iTahun;
        }

//bootstrap
echo "<div class='form-group'>";
echo "<div class='list-group-item'>";

$harga_per_cabang_0 = "<div class='input-group'>";
$harga_per_cabang_0 .= "<div class='input-group-addon'>Rp</div>";
$harga_per_cabang_0 .= "<input type='text' class='form-control text-right' name='harga[$produk_id][0]' placeholder='harga' value='$harga_pusat_f' onclick=\"this.select();\">";
$harga_per_cabang_0 .= "</div>";

$contensL = "<div class='panel panel-default'>";
$contensL .= "<div class='panel-heading'>Panel heading</div>";
$contensL .= "<div class='panel-footer text-right'>";

//        $strHead = "document.getElementById('myModal').style.display='block'";

            $batas_manual .= "<div class = 'input-group input-group-sm'>";
            $batas_manual .= "<span class='input-group-addon btn-sm'  title='tampilan baris per halaman'><span class='glyphicon glyphicon-eye-open' title='tampilan baris per halaman'></span></span> 			<input type='text' value='$jml_tampil' class='form-control' style='width:50px;text-align: center;' onblur=\"location.href='../../public/exe/session-create.php?					Mode=JmlTampil&jml_tampil='+this.value\" onclick=\"this.select();\">";
            $batas_manual .= "</div>";

// reload
document.location.reload();
$('#nilai_$cont').blur(function() {
   var harga = $hrg_jual;
   var minim = $('#jml_$cont').val();
   var nilai_diskon = $('#nilai_$cont').val();
   var persen_diskon = (nilai_diskon / harga) * 100;
   var harga_baru = harga - nilai_diskon;
   
   $('#persen_$cont').val(persen_diskon);
   $('#harga_$cont').val(harga_baru);
   
   var cont_af = $cont + 1; 
   $('#jml_'+cont_af).prop('disabled', false);
   $('#btn_simpan').prop('disabled', false);
});
$('p#44.test').css('background-color', 'yellow');
$('#spanText').attr('style',  'background-color:gray');

cloning isi form ke yg lain dengan dicari id
$arrHead = "<script type=\"text/javascript\">
    $(document).ready(function(){
        $(\"#name\").keyup(function(){
            var clone = $(this).val();
            $(\"#nama_login\").val(clone);
        });
    });
</script>";

$('#customer').keyup(function(){
    var nohp = $('#customer').val();
    // console.log(nohp);
    if(nohp.length > 5){        
          $('#minta').attr('disabled',false);
          $('#minta').attr('disabled','disabled');
    }
});

$('#result').load('$link_to_session_main?produk_type=' + this.value);

// taruh di bottom script membuag cachbootstrab
    <script>
        $('#myModal').on('hidden.bs.modal', function () {
            $(this).removeData('bs.modal');
        });
        </script>

// load on page load
  $modal_load = "<script type='text/javascript'>
                $(window).on('load',function(){
                    $('#myModal').modal('show');
                });
            </script>";

// menambahkan pencarian
$p->setCariDataAjax("onkeyup=\"getData('../../public/data/bahan_autocomplete.php?Mode=ItemAll&j='+this.value,'jenis')\"");
        $p->setCariData(true, "jenis");

// pop over via js
$script_bottom = "<script>$(document).ready(function() {
            $(\"body\").popover({ selector: '[data-toggle=popover]',placement : 'top',trigger   : 'hover' });

        });</script>";
        $p->setScriptBottom($script_bottom);

// tomol triger
$link_nota = "../../public/penjualan/modal_982r.php?Mode=Isi&id=$id&cus_id=$cus_id&a=$transaksi_jenis";
$link_transaksi = "<a data-toggle='modal' data-target='#myModal' href='$link_nota' data-toggle-tip='tooltip' title='klik untuk melihat detile transaksi' class='primary'>$transaksi_no</a>";

// modal kontainer
  $strMain = "<div id='myModal' class='modal fade' role='dialog'>
        <div class='modal-backdrop in' style='height: 200%;'></div>
        <div class='modal-dialog'>
            <div class='modal-content'>
                <!-- Content will be loaded here from 'remote.php' file -->
            </div>
        </div>
    </div>
  ";
        $strMain .= "<script>
            $(document).ready(function () {
            $(\"body\").tooltip({ selector:'[data-toggle-tip=tooltip]' });
        });

	$('#myModal').on('hidden.bs.modal', function () {
            $(this).removeData('bs.modal');
        });

        </script>";

// cek rekening persediaan 
$v->setCabangId(1);
$status_persediaan  = $v->getCekProduk();
if($status_persediaan == 0){

	die();
}

// region set fifo
            $jml_nilai = $produk_ord_jml * $produk_hpp;
            $arrFifo = array(
                "produk_id" => "$produk_id",
                "unit" => $produk_ord_jml,
                "hpp" => $produk_hpp,
                "jml_nilai" => $jml_nilai,
                "produk_nama" => $produk_nama
            );
            $ff->setFifoJenis("produk");
            $ff->setCabangId($cabang_id);
            $ff->setTransaksiId($transaksi_id);
            $ff->setTransaksiJenis(982);
            $ff->setFifo($arrFifo);
            // endregion set fifo

// get fifo
 $produk_need_total = 0;
        foreach ($sesProds_id_1 as $x => $produk_id) {

            $produk_need = $getSessionTemp = getSessionForm($session_parent_cart, $produk_id);
//            cekHere("prod_id : $produk_id butuh : $produk_need");
            $ff->setUnitNeed(1);
            $ff->setFifoJenis("produk");
            $produk_need_total += $produk_need;
            for ($i_produk = 1; $i_produk <= $produk_need; $i_produk++) {
                $arrFifoProduk = $ff->getFifo(0, $produk_id);
                if (count($arrFifoProduk) < 1) {
                    createLog("fifo tidak ditemukan untuk transaksi return distribusi produk_id: $produk_id", "dev");
                    die(toAlertGo("fifo tidak valid", referer()));
                }
                foreach ($arrFifoProduk[$produk_id] as $arrFifodata) {
                    $produk_hpp = $arrFifodata["hpp"];
//                    cekHere("HPP: $produk_hpp");
                    $arrProdukHpp[$produk_id][$produk_hpp][] = 1;
                    $transaksi_nilai += $produk_hpp;
                }
            }

        }

//tele telegram link telegram
$msg_tele .= PHP_EOL . "[show in browser](https://pos.vitocafe.com/dashboard)";

// inv 
 $transaksi_nomer = $t->getNumbering();
$transaksi_nomer_expl = explode("-", $transaksi_nomer);
$transaksi_nomer_j = count($transaksi_nomer_expl);
$inv = $transaksi_nomer_j - 1;
$transaksi_inv = $transaksi_nomer_expl[$inv];

// progres bar
$btn_action = "<div class='progress' style='border: 1px solid blue;margin-bottom: 0;'>";
                    $btn_action .= "<div class='progress-bar progress-bar-striped active' style='width: 100%;'>";
                    $btn_action .= "<span class='glyphicon glyphicon-hourglass'></span> Pending";
                    $btn_action .= "</div>";
                    $btn_action .= "</div>";

// validator
$contens .= "<form data-toggle='validator' role='form' method='post' id='form'>";

        $contens .= "<div class='form-group'>";
        $contens .= "<input class='form-control' type='email' data-error='salah bosss'>";
        $contens .= "<div class='help-block with-errors'></div>";
        $contens .= "</div>";
$contens .= "</form>";

// show hide
 $show_hide = "<script type=\"text/javascript\">
                                        function showIsi(id){
                                            var t = document.getElementById(id);
                                            if (t.style.display == 'none')
                                                t.style.display = 'block';
                                            else
                                                t.style.display = 'none';
                                        }

                                        </script>";
        $p->setHead($show_hide);
// check-uncheck checkbox
$strShow_hide .= "<script type=\"text/javascript\">
                                        function check_uncheck(id){
                                            var t = document.getElementById(id);
                                            if (t.checked == true)
                                                t.checked = false;
                                            else
                                                t.checked = true;
                                        }
                                        </script>";

// triger
$data_footer = "<button class='btn btn-info btn-block btn-sm' data-toggle='tooltip' title='klik untuk melihat detile' onclick=\"if(this.value == 's'){this.value = 'h'}else{this.value = 's'};showIsi('show_$id')\">berisi $data_row_f item, total $bahan_qtt_total_f unit</button>";
$data_footer .= "<div id='show_$id' style='display: none;'>$data</div>";

// datepickcer
// region date
        $contens .= "<input type='text' autocomplete='off' id='example1' class='form-control' onclick=\"this.select();\" value='$diskon_cabang_f' name='tanggal'> ";
        $strPilih_tanggal_2 = "<link rel=\"stylesheet\" href='../../assets/suport/bootstrap-datepicker-1.5.0-dist/css/bootstrap-datepicker.css'>";
        $strPilih_tanggal_2 .= "<script src='../../assets/suport/autocomplete/jquery-1.8.2.min.js'></script>";
        $strPilih_tanggal_2 .= "<script src='../../assets/suport/bootstrap-datepicker-1.5.0-dist/js/bootstrap-datepicker.js'></script>";

        $strPilih_tanggal_2 .= "<script type=\"text/javascript\">
                // When the document is ready
                $(document).ready(function () {

                $('#example1').datepicker({
                        format: \"yyyy/mm/dd\"
                });

            });
        </script>";

        $p->setScriptBottom($strPilih_tanggal_2);
        // endregion date

// tab bootstrab
        // region tab
        $contens = " <div class=''>
                        <ul class='nav nav-tabs'>
                            <li class='active'><a href='#tab1default' data-toggle='tab'>data konsumen</a></li>
        <li><a href='#tab2default' data-toggle='tab'>data produk</a></li>
                            <li><a href='#tab3default' data-toggle='tab'>Default 3</a></li>
                            <li class='dropdown'>
                                <a href='#' data-toggle='dropdown'>Dropdown <span class='caret'></span></a>
                                <ul class='dropdown-menu' role='menu'>
                                    <li><a href='#tab4default' data-toggle='tab'>Default 4</a></li>
                                    <li><a href='#tab5default' data-toggle='tab'>Default 5</a></li>
                                </ul>
                            </li>
                        </ul>
                </div>";
        // endregion tab

        // region bodi tab
        $contens .= "<div class=''>";
        $contens .= "<div class='tab-content'>";

        $contens .= "<div class='tab-pane fade in active' id='tab1default'>";

        $contens .= "</div>";

        $contens .= "<div class='tab-pane fade' id='tab2default'>";
        $contens .= "Default 2";

        $contens .= "</div>";

        $contens .= "</div>";
        $contens .= "</div>";
        // endregion bodi tab

// modal footer kanan kiri button
$strMain .= "<div class='modal-footer'>";
$strMain .= "<ul class='pager' style='border: 0px solid red;margin: 0;'>";
$strMain .= "<li class='previous' style='float:left;'>";
$strMain .= "<button type='button' class='btn btn-default' data-dismiss='modal'>Close</button>";
$strMain .= "</li>";
$strMain .= "<li class='next' style='float:right;'>";
$strMain .= "<button type='submit' class='btn btn-primary'>Simpan perubahan</button>";
$strMain .= "</li>";
$strMain .= "</ul>";
$strMain .= "</div>";

// pager versi ori
                $strPer_hari .= "<div>";
                $strPer_hari .= "<ul class='pager'>";
                $strPer_hari .= "<li class='previous'><a href='#'>Previous</a></li>";
//                $strPer_hari .= "<li><button class='btn btn-info'>hari ini</button></li>";
                $strPer_hari .= "<li><a href='#'>today</a></li>";
                $strPer_hari .= "<li class='next'><a href='#'>Next</a></li>";
                $strPer_hari .= "</ul>";
                $strPer_hari .= "</div>";

update mcm untuk pembayaran hutang suppliers
V:\mcm_01\templates\pure\css\custom_web.css
V:\mcm_01\public\akunting\mutasi.php
V:\mcm_01\public\exe\session-create.php
V:\mcm_01\public\data\bank_autocomplete.php

        // region set koneksi
        if (isset($this->koneksi)) {
            $this->pdo = $this->koneksi;
        }
        else {
            die(toAlert(__FUNCTION__ . " line " . __LINE__ . " koneksi belum di-sett"));
	$this->pdo = matiHere(__LINE__ . __FUNCTION__);
        }
        // endregion set koneksi

$pdo = $c->connC();
$t->setKoneksi($pdo);
$d->setKoneksi($pdo);

$q = "select * from set_access where 1 order by per_employee_id, acc_type";

$x = $this->pdo->prepare($q);
//$x = $pdo->prepare($q);
$x->execute();
$j = $x->rowCount();
//$l = $x->fetchObject();

$x_12 = $this->pdo->prepare($q_12);
$x_12->execute();
$j_12 = $x_12->rowCount();
//$l_12 = $x_12->fetchObject();

// insert
$this->pdo->exec($q_0);

//update
$x = $this->pdo->prepare($q);
$x->execute();

// cari barang ini ya
$db1->select($q_1)

echo("<script>top.swal({title: 'Proses verifikasi login', html: 'halaman akan diarahkan sessuai hak akses Anda, <br>Harap menunggu.....', type: 'warning', allowOutsideClick: false, showConfirmButton: false}).then(function(){top.location.reload(true);})</script>");

$swalAlerts = array(
    "type" => "warning",
    "html" => "untuk saat ini transaksi belum bisa dilakukan",
    "allowOutsideClick" => false,
    "allowEscapeKey" => false,
    "showConfirmButton" => false,
	"confirmButtonText" => "$label_btn",
"showCloseButton" => true,
"showCancelButton" => true,
	"cancelButtonText" => "$cancel_btn",
);

//        die("<script>window.setTimeout(function(){
////            top.location.reload();
//        } ,2000);</script>");

// array blacklist dan allowed
$arrBlock = array(
                 "id","transaksi_id","rekening_id_asal","rekening_id_tujuan",
                 "bulan","tahun","angsuran","parent_id","trash","administrasi",
                 "transaksi_jenis","bunga"
                  );
$arrChilddata = $arrDiff_key = array_diff_key($arrUpd, array_flip($arrBlock));

$arrOpen = array(
                "produk_jenis", "produk_id", "produk_nama", "produk_keterangan",
                "produk_folders", "produk_kode"
                );
$arrDiff_key = array_intersect_key($arrUpd,array_flip($arrOpen));

// excell
=CONCATENATE("'",A1,"',") // mengabungkan string dari kolom-kolom

// copi form ke form
 function copyTextValue(bf) {
                if(bf)
                      var text1 = document.getElementById(\"id_1\").value;
                else
                      text1='';

                var text1_f = text1.replace(/ /g,'_');
                document.getElementById(\"id_2\").value = text1_f;

                }

          function copyTextValue2(bf) {
                if(bf)
                      var text3 = document.getElementById(\"id_3\").value;
                else
                      text3='';

                      var text1 = document.getElementById(\"id_1\").value;
                      var text1_f = text1.replace(/ /g,'_');
                      var text3_f = text3.replace(/ /g,'_');
                document.getElementById(\"id_2\").value = text1_f + '_' + text3_f;
                }

                $(function() {
                    $('#id_2').on('keypress', function(e) {
                        if (e.which == 32)
                            return false;
                    });
                });

function turun(){
    var objDiv = document.getElementById("cartBoard");
      objDiv.scrollTop = objDiv.scrollHeight;
}

// post ajax
$("img.foo").onclick(function()
{
    // Get the src of the image
    var src = $(this).attr("src");

    // Send Ajax request to backend.php, with src set as "img" in the POST data
    $.post("/backend.php", {"img": src});
});

// back onclick=\"\";
window.history.back()

// jquery 
<div id="list" style="display: none"></div>
<input id="ip" value="">

<script>
    $(document).ready(function () {
        setTimeout(function () {
            var ip_local = $("#list").text();
            $("#ip").val(ip_local);
            // alert(ip_local);
        }, 1000);
    })

$("input[id2=\"anu\"]").blalalaal
[name="nameOfElement"]
// trigger auto clik triger
$('input#opt0.chRadio:fist').prop('checked',false).trigger('click');
$('input#opt0.chRadio:last').prop('checked',false).trigger('click');
$('#khusus_tic').prop('checked',false).trigger('click');

// auto scroll halaman
$('html, body').animate({ scrollTop: $(document).height() }, 1000);
$('div, .modal-content').animate({ scrollTop: $(document).height() }, 6000);

setTimeout(function () {
    $('#btnSave').trigger('click');
}, 5000);

function myKlik(s,t){
    // console.log(s);
    // console.log(t);
    var src = $('input[name=\'' + s + '\']');
    
    // $(src).click(function() {
        if(!$(src).is(':checked')){
            $('input[name=\'' + t + '\']').prop('checked',true).trigger('click');
        }
        else{                                    
            $('input[name=\'' + t + '\']').prop('checked',false).trigger('click');
        }
            
    // });
}

</script>

// region looping
$arrAll = array(5,6,9,8);
$str_loop = true;
$i = 0;
while ($str_loop == true){
    $i++;
    $var_code = rand(1,9);

    if(in_array($var_code, $arrAll)){
        $str_loop = true;
	// ulang lagi dari atas
    }
    else{
        $str_loop = false;
	// stop sudah didapat $var_code baru
    }

    echo "$i === $var_code<br>";
}

// endregion looping

pas indosan
dc1f64c157b0422911a1343c66aee41f

#ci #codeigniter
// menampilkan query yag lagi aktive
$cc = $this->db->last_query();
$cc = $this->db->queries[0];
// cekHere("$cc");
// $tbl = $this->tableName;        
$where = "and trash='0' and DATE(dtime_in)='$dateNow'";
$q = $this->db->query('SELECT * FROM ' . $tbl . ' where 1 '.$where);

$this->db->select($listKolom);
$this->db->where($arrWhere);
$q = $this->db->get($this->tableName);

____________________________________________________________________________________________
function bacaHTML($url){
    // inisialisasi CURL
    $data = curl_init();
    // setting CURL
    curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($data, CURLOPT_URL, $url);
    // menjalankan CURL untuk membaca isi file
    $hasil = curl_exec($data);
    curl_close($data);
    return $hasil;
}

$url_target = "https://www.calculator.net/conversion-calculator.html";
$bacaHTML = bacaHTML("$url_target");
print_r($bacaHTML);
_________________________________________________________________________________________

$this->load->library('curl');
$urlApi = $this->apiApk["order_request"] . my_toko_id();
$preOrderRequest = json_decode($this->curl->simple_get($urlApi));
______________________________________________________________

SELECT *, `transaksi`.`oleh_id` as `oleh_id`, `transaksi`.`oleh_nama` as `oleh_nama`, `transaksi`.`cabang_id` as `cabang_id` FROM `transaksi` JOIN `transaksi_data` ON `transaksi_data`.`transaksi_id` = `transaksi`.`id` WHERE 
`transaksi`.`status` = '1' 
AND `transaksi`.`trash` = '0' 
AND `transaksi`.`link_id` = '0' 
AND `div_id` = '18' 
AND `jenis_top` = '456ro' 
AND `next_substep_code` != '' 
AND `sub_step_number` > '0' 
AND ( 
`transaksi`.`cabang_id` = '-1' 
OR `transaksi`.`cabang2_id` = '-1' 
)
 AND ( 
`transaksi`.`gudang_id` = -999 
OR `transaksi`.`gudang2_id` = -999 
)
 GROUP BY `transaksi_id`, `next_substep_code` ORDER BY `transaksi`.`id` DESC

`transaksi_data`.`transaksi_id` = `transaksi`.`id` WHERE 
`transaksi`.`status` = '1' 
AND `transaksi`.`trash` = '0' 
AND `transaksi`.`link_id` = '0' 
AND `div_id` = '18' 
AND `jenis_top` = '456ro' 
AND `next_substep_code` != '' 
AND `sub_step_number` = '0' 
AND `valid_qty` > '0' 
AND ( 
`transaksi`.`cabang_id` = '-1' 
OR `transaksi`.`cabang2_id` = '-1' 
) 
AND ( 
`transaksi`.`gudang_id` = '-1' 
OR `transaksi`.`gudang2_id` = '-1'

// perbedaan terus vs tf dicancel
if ($currentState < 99) { // lanottt bosss
    $tr->addFilter("sub_step_number='$currentState'");
    $tr->addFilter("valid_qty>0");
}
else { // didelete/dibatalkan
    $tr->addFilter("sub_step_number>0");
}

// step_available
| step_avail  | step_current | step_number | next_step_number |
|	3  |	0         |     0               |        1                     |

// win7 log
sc config eventlog start= disabled
for /f %x in ('wevtutil el') do wevtutil cl "%x"

$dtime = $kemarin = date('Y-m-d', strtotime("-$jml_hari_penjualan day", strtotime(date("Y-m-d"))));

Load  database  ke dua
Cukup diload di controllernya
 parent::__construct();
$this->db2 = $this->load->database('report', TRUE);
Model cukup manggil koneksi $this->db2
Kalau model diload lagi commit bocor

$ss = 0;
while ($ss <= 100){
    echo "$ss ";
    $ss++;
}

$ss = true;
$xx = 0;
while ($ss == true){
    $xx++;
    echo "$xx ";

    if($xx == 100){
        break;
    }
}

$ss = "hitung";
$xx = 0;
while ($ss == "hitung"){
    $xx++;
    echo "$xx ";

    if($xx == 101){
        break;
    }
}

arrPrint(get_class($this));
arrPrint(get_class_methods($this));
arrPrint($this->router->class);
arrPrint($this->router->method);

// query grouping data
SELECT `oleh_id`, `oleh_nama`, `cabang_id`,session_id, max(DATE(dtime)) as tanggal, sum(beli) as sum_hpp, sum(laba) as sum_laba, sum(jual) as sum_jual, sum(komisi) as sum_komisi 
FROM `transaksi` 
WHERE `jenis` = '582' AND YEAR(dtime) = '2020' AND MONTH(dtime) = '10' and oleh_id='297'
GROUP BY `oleh_id`, `cabang_id`, session_id 
ORDER BY `cabang_id` ASC, `oleh_id` ASC, date(dtime) ASC

$ksr_head = "";
$ksr_head .= "<tr class='bg-info'>";

$kolom_params = reset($koloms);
$attr_head = isset($kolom_params['attr_head']) ? $kolom_params['attr_head'] : "";
$ksr_head .= "<th $attr_head width='20px;'>no</th>";

foreach ($koloms as $kolom => $attrs) {
    $label = $attrs['label'];
    $attr = isset($attrs['attr_head']) ? $attrs['attr_head'] : "";

    $ksr_head .= "<th $attr>";
    $ksr_head .= $label;
    $ksr_head .= "</th>";
}
$ksr_head .= "</tr>";
// $anu = "222";
// arrPrint($contens['222']);
// arrPrint(array_keys($contens));
// arrPrint($contens);
// arrPrintPink($contens['378']);
$ksr = "";
if (sizeof($contens) > 0) {
    // foreach ($totalKasir as $dmain) {
    // asort($kasirs);
    // arrPrint($srcDatas);
    $no = 0;
    $totals = array();
    if (isset($this->layout_table_shorting)) {
        // arrPrint($contens);
        foreach ($this->layout_table_shorting as $ksr_id => $lsr_nama) {
            // cekBiru($ksr_id);
            // $dmain = isset($contens->$ksr_id) ? $contens->$ksr_id : array();
            $dmain = isset($contens[$ksr_id]) ? $contens[$ksr_id] : array();
            // arrPrint($dmain);
            $no++;
            $ksr .= "<tr>";
            $ksr .= "<td class='text-right'>$no</td>";
            foreach ($koloms as $kolom => $attrs) {
                $nilai = isset($dmain->$kolom) ? $dmain->$kolom : 0;

                $attr = isset($attrs['attr']) ? $attrs['attr'] : "";
                $format_key = isset($attrs['format_key']) ? $attrs['format_key'] : $kolom;
                $nilai_f = isset($attrs['format']) ? $attrs['format']($format_key, $nilai) : $nilai;

                $linking = isset($attrs['link']) ? $attrs['link'] . "/$ksr_id" : "";
                $linkDetile = base_url() . $linking . "";
                if (isset($attrs['linkType']) && $attrs['linkType'] == 'modal') {
                    $modalHeader = isset($attrs['modalHeader']) ? $dmain->$attrs['modalHeader'] : "none";
                    $linkModal = modalDialogBtn("'$modalHeader'", $linkDetile);
                }
                else {
                    $linkModal = "location.href='$linkDetile'";
                }

                $nilai_link = isset($attrs['link']) ? "<a href='JavaScript:Void(0);' onclick=\"$linkModal\" title='lihat detail $ksr_id'>$nilai_f</a>" : $nilai_f;

                $ksr .= "<td $attr data-order='$nilai'>";
                // $ksr .= $dmain->$kolom;
                $ksr .= $nilai_link;
                $ksr .= "</td>";

                if (isset($attrs['summary'])) {
                    if (!isset($totals[$kolom])) {
                        $totals[$kolom] = 0;
                    }
                    $totals[$kolom] += $nilai;
                }
            }
            $ksr .= "</tr>";

            // $ksr .= "</tr>";
        }
    }
    else {
        foreach ($contens as $ksr_id => $lsr_nama) {
            $dmain = (object)$lsr_nama;

            $no++;
            $ksr .= "<tr>";
            $ksr .= "<td class='text-right'>$no</td>";

            foreach ($koloms as $kolom => $attrs) {
                $nilai = isset($dmain->$kolom) ? $dmain->$kolom : 0;

                $attr = isset($attrs['attr']) ? $attrs['attr'] : "";
                $format_key = isset($attrs['format_key']) ? $attrs['format_key'] : $kolom;
                $nilai_f = isset($attrs['format']) ? $attrs['format']($format_key, $nilai) : $nilai;

                $linking = isset($attrs['link']) ? $attrs['link'] . "/$ksr_id" : "";
                $linkDetile = base_url() . $linking . "";
                // $linkModal = modalDialogBtn("'$nama'", $linkDetile);
                $nilai_link = isset($attrs['link']) ? "<a href='JavaScript:Void(0);' onclick=\"$linkModal\" title='lihat komposisi'>$nilai_f</a>" : $nilai_f;

                $ksr .= "<td $attr data-order='$nilai'>";
                // $ksr .= $dmain->$kolom;
                $ksr .= $nilai_link;
                $ksr .= "</td>";

                if (isset($attrs['summary'])) {
                    if (!isset($totals[$kolom])) {
                        $totals[$kolom] = 0;
                    }
                    $totals[$kolom] += $nilai;
                }
            }
            $ksr .= "</tr>";

            // $ksr .= "</tr>";
        }
    }

}
else {
    $ksr .= tplTableNoData("2");
}

$ksr_foot = "";
$ksr_foot .= "<tr class='bg-danger'>";
$ksr_foot .= "<th></th>";
foreach ($koloms as $kolom => $attrs) {
    $fNilai = isset($totals[$kolom]) ? $totals[$kolom] : "-";
    $fNilai_f = isset($attrs['format']) ? $attrs['format']($kolom, $fNilai) : $fNilai;
    // $label = $attrs['label'];

    $ksr_foot .= "<th>";
    $ksr_foot .= $fNilai_f;
    $ksr_foot .= "</th>";
}
// $ksr_foot .= "</tr>";
// ---------------
$str_tbl_id = isset($this->layout_table_data_tbl) && ($this->layout_table_data_tbl != false) ? "id='" . $this->layout_table_data_tbl . "'" : "";

$var_tbl = "";
$var_tbl .= isset($this->layout_table_caption) ? $this->layout_table_caption : "";
$var_tbl .= "<div class='table-responsive'>";
$var_tbl .= "<table class='table table-condensed table-striped' $str_tbl_id>";
$var_tbl .= "<thead>";
$var_tbl .= $ksr_head;
$var_tbl .= "</thead>";

$var_tbl .= "<tbody>";
$var_tbl .= $ksr;
$var_tbl .= "</tbody>";

// cekBiru(sizeof($totals));
if (is_array($totals) && sizeof($totals) > 0) {

    $var_tbl .= "<tfoot>";
    $var_tbl .= $ksr_foot;
    $var_tbl .= "</tfoot>";
}

$var_tbl .= "</table>";
$var_tbl .= "</div>";