Kamis, 09 Juni 2022

HTML SCROLL HORIZONTAL

 <html>

<title>HTMLExplorer Demo: Horizontal Scrolling Content</title>
<head>
<style type="text/css">
#outer_wrapper {  
    overflow: scroll;  
    width:100%;
}
#outer_wrapper #inner_wrapper {
    width:6000px; /* If you have more elements, increase the width accordingly */
}
#outer_wrapper #inner_wrapper div.box { /* Define the properties of inner block */
    width: 250px;
    height:300px;
    float: left;
    margin: 0 4px 0 0;
    border:1px grey solid;
}
</style>
</head>
<body>

<div id="outer_wrapper">
    <div id="inner_wrapper">
        <div class="box">
            <!-- Add desired content here -->
            HTMLExplorer.com - Explores HTML, CSS, Jquery, XML, PHP, JSON, Javascript 
        </div>
        <div class="box">
             <!-- Add desired content here -->
            HTMLExplorer.com - Explores HTML, CSS, Jquery, XML, PHP, JSON, Javascript 
        </div>
        <div class="box">
            <!-- Add desired content here -->
            HTMLExplorer.com - Explores HTML, CSS, Jquery, XML, PHP, JSON, Javascript 
        </div>
        <div class="box">
            <!-- Add desired content here -->
            HTMLExplorer.com - Explores HTML, CSS, Jquery, XML, PHP, JSON, Javascript 
        </div>
        <div class="box">
             <!-- Add desired content here -->
            HTMLExplorer.com - Explores HTML, CSS, Jquery, XML, PHP, JSON, Javascript 
        </div>
        <div class="box">
            <!-- Add desired content here -->
            HTMLExplorer.com - Explores HTML, CSS, Jquery, XML, PHP, JSON, Javascript 
        </div>
        <!-- more boxes here -->
    </div>
</div>
</body>
</html>

https://stackoverflow.com/questions/9925754/css-horizontal-scroll









Selasa, 07 Juni 2022

PHP SCRIPT UMUM

 function getCat($str,$N){
$str=wordwrap($str,$N,"<br>\n");
return $str;
}

 function getCat($str,$N){
$P=1000;
if(strlen($str)>$P){
$str=substr($str,0,$P);
}
$str=wordwrap($str,$N,"<br>\n");
return $str;
}

###############################
<?php
date_default_timezone_set("Asia/Jakarta");
require_once "koneksivar.php";

$conn = new mysqli($DBServer, $DBUser, $DBPass, $DBName);
if ($conn->connect_error) {
trigger_error('Database connection failed: '  . $conn->connect_error, E_USER_ERROR);
}
?>

<?php function RP($rupiah)
{
return number_format($rupiah, "2", ",", ".");
} ?>
<?php
function getCat($str,$N){
$str=wordwrap($str,$N,"<br>\n");
return $str;
}


function WKT($sekarang){
if ($sekarang == "0000-00-00") {
$sekarang = date("Y-m-d");
}

$tanggal = substr($sekarang, 8, 2) + 0;
$bulan = substr($sekarang, 5, 2);
$tahun = substr($sekarang, 0, 4);

$judul_bln = array(1 => "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
$wk = $tanggal . " " . $judul_bln[(int)$bulan] . " " . $tahun;
return $wk;
}
?>
<?php
function WKTP($sekarang)
{
$tanggal = substr($sekarang, 8, 2) + 0;
$bulan = substr($sekarang, 5, 2);
$tahun = substr($sekarang, 2, 2);

$judul_bln = array(1 => "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des");
$wk = $tanggal . " " . $judul_bln[(int)$bulan] . "'" . $tahun;
return $wk;
}
?>

<?php
function process($conn, $sql)
{
$s = false;
$conn->autocommit(FALSE);
try {
$rs = $conn->query($sql);
if ($rs) {
$conn->commit();
$last_inserted_id = $conn->insert_id;
$affected_rows = $conn->affected_rows;
$s = true;
}
} catch (Exception $e) {
echo 'fail: ' . $e->getMessage();
$conn->rollback();
}
$conn->autocommit(TRUE);
return $s;
}

function getJum($conn, $sql)
{
//echo $sql;
$rs = $conn->query($sql);
$jum = $rs->num_rows;
$rs->free();
return $jum;
}

function getField($conn, $sql)
{
$rs = $conn->query($sql);
$rs->data_seek(0);
$d = $rs->fetch_assoc();
$rs->free();
return $d;
}

function getData($conn, $sql)
{
$rs = $conn->query($sql);
$rs->data_seek(0);
$arr = $rs->fetch_all(MYSQLI_ASSOC);
//foreach($arr as $row) {
//  echo $row['nama_kelas'] . '*<br>';
//}

$rs->free();
return $arr;
}












Mencari Tanggal Terakhir Suatu Bulan

  $a_date = "$tahun-$bulan-01"; $lastdate= date('t',strtotime($a_date));//Y-m-t <?php require_once"koneksivar.php&...