Rabu, 23 Maret 2011

tugas modul 7


Source Code (HTML,Java Scrip, PHP)
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[ Demo Login Form ]</title>
    <link rel="stylesheet" type="text/css" href="TugasPrak7.css">
</head>

<body>
<script language="javascript">
<!--
var inittext = "";

function getValue(){
    var myForm = document.myForm;
    var uName = myForm.uName.value;
    var pass = myForm.uPass.value;

    if (uName == '') {alert ('Username Harus diisi!'); myForm.uName.focus(); }
    else if (pass == '') {alert ('Password Harus diisi!');  myForm.uPass.focus(); }
    else myForm.submit();
}

function storeinittext(){
    inittext = document.myForm.uName.value;
}

function inputtex_onchange(){
    var inputtex_vlaue = document.myForm.uName.value;
    var filter = /^[a-zA-Z]+$/ ;
    if(!filter.test(inputtex_vlaue))        {
        document.myForm.uName.value = inittext;
    }
}

//-->
</script>
<div class="spFormContainer" style="margin-top:150px; margin-right:auto; margin-left:auto;">
<div class="spFormHeader" style="height:50px; font-size:36px; font-weight:normal; padding-top:25px; color: #45658F;"><center>Login Form</center></div>
<div id="spForm" style="margin:35px 5px 5px 40px; ">
<?php
$validuName="MNA";
$validUpass="MNA";
$isTryLogin=0;
if(isset($uName)){
    if(($uName==$validuName) and ($uPass==$validUpass)){
        echo "Berhasil Login! (^_^)<br>
              <br>
              Selamat Datang<br>
              Username: MNA<br>
              Password: MNA";
        $_SESSION['uState']=1;
        $isTryLogin=1;
        echo '<form id="logoutForm" name="logoutForm" action="'.$_SERVER['PHP_SELF'].'" method="post"><input type="submit" name="btLogout" id="btLogout" onclick="logout();" value="Logout" style="float:right;margin-right:40px;font-weight:bold;color:#283C55;width:55px;height:30px;" /></form>';
    }else{
        echo '<span style="color:red;">Username atau Password yang Anda masukkan salah! (T,T)</span><br>';
        $_SESSION['uState']=0;
    }
}
if(isset($btLogout)){
    $_SESSION['uState']=0;
}
if($_SESSION['uState']==0){?>
    <form id="myForm" name="myForm" action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
    <div class="spFormChild">
        <label for="uName">Username</label>
        <input type="text" name="uName" id="uName" onfocus="storeinittext();" onchange="inputtex_onchange();" />
    </div>
    <div class="spFormChild" style="margin-top:15px;">
        <label for="uPass">Password</label>
        <input type="password" name="uPass" id="uPass" />
    </div>
    <div class="spFormChild" style="margin-top:7px;">
        <input type="button" name="btOk" id="btOk" onclick="getValue();" value="Login" style="float:right;margin-right:40px;font-weight:bold;color:#283C55;width:55px;height:30px;" />
    </div>
    </form>
    <script type="text/javascript">
        document.myForm.uName.focus();
    </script>
    <?php
}elseif($isTryLogin==0){
    echo "Berhasil Login! (^_^)<br>
          <br>
          Selamat Datang<br>
          Username: mna<br>
          Password: mna";
    echo '<form id="logoutForm" name="logoutForm" action="'.$_SERVER['PHP_SELF'].'" method="post"><input type="submit" name="btLogout" id="btLogout" onclick="logout();" value="Logout" style="float:right;margin-right:40px;font-weight:bold;color:#283C55;width:55px;height:30px;" /></form>';
}
?>
</div>
</div>
<div style="padding:2px 0 2px 7px;border:2px solid #84A0C4;border-top:0px;width:293px;background-color:#ECF2FB;margin-right:auto;margin-left:auto;">
<center>Username yang benar : mna<br />
Password yang benar : mna<br /><br />
<u>Mohamad Nur Afandi - 100533406932<br />
S1 PTI Input 2010 Gasal Off F</u></center>

</div>
</body>
</html>



Source Code (CSS)
body{
    font-family:'lucida grande',tahoma,arial,sans-serif; /* jenis font default pada html */
    font-size:11px; /* ukuran default untuk font pada html */
    color:#333; /* warna default untuk font pada html */
    background-color:#FFFF99;
}
.spBody{
    text-align:left;
    width:900px;
    margin-top:0;
    margin-right:auto;
    margin-bottom:0;
    margin-left:auto;
    height:500px;
    border:1px solid #84A0C4;
}
.spBodyHeader{
    font-weight:bold;
    background-image:url(images/header.gif); /* background header form, kalo mau di ubah tinggal ganti alamat image-nya */
    padding:5px 5px 5px 5px;
    margin-bottom:9px;
    font-family:Arial;
    font-size:25px;
    color:#333;
    width:890px;
    border-bottom-width:1px;
    border-bottom-style:solid;
    border-bottom-color:#84A0C4;
}
/*spFormContainer adalah style class untuk tempat dimana form dibuat */
.spFormContainer{
    margin-right:9px;
    width:300px; /* lebar container */
    height:275px; /* tinggi kontainer */
    border:2px  solid #84A0C4; /* bordernya */
    background-color:#ECF2FB;
}
/*spFormHeader adalah style class untuk form header */
.spFormHeader{
    font-weight:bold;
    background-image:url(images/header.gif); /* background header form, kalo mau di ubah tinggal ganti alamat image-nya */
    padding:5px 0 5px 5px;
    border-bottom-width:1px;
    border-bottom-style:solid;
    border-bottom-color:#84A0C4;
    font-family:Arial;
    font-size:15px;
    color:#333;
    width:295px;
}
/*spForm adalah style class untuk form body */
.spForm{
    font:12px Arial;
    font-weight:bold;
    width:295px;
    padding:9px 0 5px 5px;
}
/*spFormChild adalah style class untuk form item */
.spFormChild{
    height:30px;
}
.spFormChild label{
    float:left;
    width:70px;
    height:30px
    display:block;
    margin-top:5px;
}
.spFormChild input{
    float:left;
    width:140px;
    display:block;
    height:22px
}

Rabu, 16 Maret 2011

tugas modul 6 B


PHP Source code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body><center>
<?php

tugas modul 6 A

Perbedaan PASSING BY VALUE dengan PASSING BY REFERENCE

PASSING BY VALUE
secara  default, semua nilai yang di-pass masuk atau keluar dari fungsi  adalah passing by value, bukan by reference. ini berarti PHP membuat  kopian dari nilai original dan nilai kopian itulah yang kita akses  dan kita manipulasi, bukan nilai originalnya.
dengan  begitu bagaimanapun kita ubah nilai itu, tidak akan mengubah nilai  originalnya, contoh:

Rabu, 09 Maret 2011

tugas modul 5



Source HTML
<html lang="en">
<head>
<title>Form Pemesanan</title>
<script language="javascript" type="text/javascript">
var Dom = {
get: function(el) {
  if (typeof el === 'string') {
    return document.getElementById(el);

Rabu, 02 Maret 2011

Tugas Modul 4



source HTML

<!DOCTYPE html>
<head>
    <title>Tugas Layout Web Elektro</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
    <header>
        <div class="box-header">
            <div class="rightfloat header-rtext">
                <div class="header-link">
                    <a href=#>Home</a>|<a href=#>Our Offer</a>|<a href=#>Rulles and Policies</a>|<a href=#>Contact us</a></div>
                  <div class="header-search">Search Engine <input class="input-search" type="text"></div>
          </div>
            <img width="70" height="70" src="Web_clip_image002.gif" alt="UM Color">
            <div class="logo-title">Teknik Informatika</div>
    </div>
        </header>
    <nav>
        <div class="box-nav">
            <a href=#><div class="menu-nav"><div class="menu-text">Company</div></div></a>
            <a href=#><div class="menu-nav"><div class="menu-text">Categories</div></div></a>
            <a href=#><div class="menu-nav"><div class="menu-text">Tutorial</div></div></a>
            <a href=#><div class="menu-nav"><div class="menu-text">Produces</div></div></a>
            <a href=#><div class="menu-nav"><div class="menu-text">Downloads</div></div></a>
        </div>
    </nav>
  
    <section>
         <div class="box-sect"><img src="Web_clip_image002.jpg" alt="" width="298" height="79"><img src="Web_clip_image002_0000.jpg" alt="" width="298" height="79">
           <div class="rightfloat box-rsect">
                <div class="subtitle">Woro-Woro !</div>
                <ul>
                    <a href=#>
                    <li class="rsect-list">Berita Terbaru</li>
                    </a>
                    <li class="rsect-list"><a href=#>Berita Terbaik</a></li>
                    <li class="rsect-list"><a href=#>Berita Terkocak</a></li>
                    <li class="rsect-list"><a href=#>Berita Terlalu</a></li>
                    <li class="rsect-list"><a href=#>Berita Terr...</a></li>
      </ul>
           </div>
            <div class="subtitle">Hikmah</div>
            <div class="datepost">02 maret 2011 - 10:30 PM</div>
            <div class="content">
                Jika kamu menghitung-hitung nikmat Allah, niscaya kamu tidak akan dapat menentukan jumlahnya. Sesungguhnya Allah benar-benar Maha Pengampun lagi Maha Penyayang". (QS. An-Nahl:18)
                <a class="more" href="#">[Read Mode]</a>            </div>
            <div class="subtitle"> Pesan Penting</div>
            <div class="datepost"> Untukmu Pewaris Peradaban Sejati</div>
            <div class="content">
                Padamu pewaris negeri , harapan selalu terpatri, azam tetap membahana hingga terwujudkan janji. padamu pewaris negeri teruslah melangkah beriringan untuk lantahkan kebatilan , bergerak keharmonian tegakkan keadilan. dalam hidup hanya Allah tujuan kita, Rosulullah tauladan kita, Alqur'an pedoman kita, Jihad adalah jalan juang kita dan mati dijalan Allah/syahid adalah cita-cita tertinggi kita.<a class="more" href="#">Read Mode]</a>            </div>
      </div>
</section>
  
    <footer>
        <div class="box-footer">
            <div class="footer-text">css design layout web elektro &copy; 2011 by <strong><a href="http://ulul-alabab-manesa.blogspot.com">Mohamad Nur Afandi</a></strong></div>
        </div>
    </footer>

</body>

</html>

source CMS

body {
    margin:10px auto;
    width:750px;
}

header,nav,section,footer {
    display:block;
    border:0px solid red;
    background-color:yellow;
}
    a{
        cursor:pointer;
        text-decoration:none;
    }
    a:hover{
        text-decoration:underline;
    }   

header {
    height:90px;
    margin-top:-10px;
    border:1px solid gray;
}
    .box-header {
        margin-top:10px;
        margin-bottom:10px;
        background-color:#00FF66;
        height:70px;
    }
    .logo-pic {
        margin-top:10px;
        margin-left:5px;
    }
    .logo-title {
        position: relative;
        left:70px;
        top: -55px;
        font-family: Arial;
        font-size:20px;
        font-weight:bolder;
        color:black;
        height: auto;
        width: 200px;
    }
    .header-rtext,.box-header a {
        color:#003399;
        font-family:Verdana, Arial, Helvetica, sans-serif;
    }
    .header-link {
        margin-right:5px;
        font-family: Arial, Helvetica, sans-serif;
        font-size:12px;
    }
    .header-search {
        margin-top:30px;
        padding-left:45px;
        font-family:"Courier New";
        font-size:12px;
    }
    .input-search {
        border:0px solid #000000;
        width:135px;
    }

nav {
    float:left;
    width:150px;
    height:400px;
}
    .box-nav {
        margin-left:3px;
        background-color:#0033FF;
        height:inherit;
    }
    .menu-nav {
        margin-left:-3px;
        background-color: #0033CC;
        height:30px;
        border-width:3px;
        border-style:solid;
        border-color:#000099;
        font-weight:lighter;
    }
    .menu-text {
        font-family:"Verdana";
        font-size:12px;
        color:#FFFF33;
        margin-top:5px;
        margin-left:10px;
    }
    .menu-nav:hover {
        cursor:pointer;
        margin-left:0px;
        background-color:#00CCFF;
        height:30px;
        border-width:3px;
        border-style:solid;
        border-color:#0033CC;
        font-weight:bold;
    }
   
section {
    margin-left:150px;
    width:auto;
    height:400px;
}
    .box-sect {
        background-color:#66FFFF;
        height:inherit;
        margin-right:3px;
    }
    .subtitle {
        margin-top:5px;
        margin-left:10px;
        font-family:"Verdana";
        font-size:16px;
        font-weight:bolder;
        color:black;
        height: auto;
        width: 200px;
    }
    .datepost {
        padding-left:10px;
        color:blue;
        font-family:"Courier New";
        font-size:12px;
        font-style:italic;
    }
    .content {       
        margin-top:5px;
        margin-left:15px;
        font-family: Verdana;
        font-size:12px;
        color:black;
    }
    .more {
        position:fixed;
        padding-left:10px;
        color:blue;
        font-family:"Courier New";
        font-size:12px;
    }
    .more:hover {
        font-weight:bold;
        text-decoration:none;
    }
    .box-rsect {
        width:200px;
        height:auto;
        margin-top:5px;
        margin-right:10px;
        padding-bottom:5px;
        background-color:#CCFF00;
        border-width:3px;
        border-style:solid;
        border-color:#000099;
    }
    .rsect-list ul, .rsect-list a{
        list-style-type:square;
        color:black;
        font-family:"Courier New";
        font-size:12px;
    }

footer {
    clear:both;
    height:65px;
    border:1px solid blue;
}
    .box-footer {
        margin-top:5px;
        margin-bottom:10px;
        background-color:#00CC33;
        height:50px;
    }
    .footer-text {
        padding-top:20px;
        padding-left:200px;
    }
    .footer-text,.box-footer  a {
        color:gray;
        font-family:"Courier New";
        font-size:12px;
    }
   
.rightfloat {
    float:right;
}