Someone asked about the date, how do we make a date with a simple click on the date column. So I want to explain a little knowledge I have about making a calendar with datepicker.

The first step:
Make advance index.php files to display the date that we will use and save on htdocs and create a new folder in htdocs, eg "date".
Here's the source code index.php

<html>
<head>
<title> datepicker </title>
</head>
<body>
Input Date : <input type= "text" name= "date" id= "date">
</body>
</html>
After creating the appearance index.php it must add <script> under <title> datepicker </title> to read the datepicker function, the following source code function.
<script>
$(function() {
            $( "#date" ).datepicker({
                        showOtherMonths: true,
                        selectOtherMonths: true
            });
});
</script>
Step two:
Make CSS files to show the date to be used on index.php files, files the first we make the following source code jquery.ui.all.css jquery.ui.all.css
-          jquery.ui.all.css
@import "jquery.ui.base.css";
@import "jquery.ui.theme.css";
After creating the @import then we had to make an additional CSS jquery.ui.base.css and jquery.ui.theme.css to read the CSS that we make.
-       jquery.ui.base.css
@import url("jquery.ui.core.css");
@import url("jquery.ui.datepicker.css");
To call the url of jquery.ui.core.css and jquery.ui.datepicker.css, the following source code @import url() to be used.
-       jquery.ui.core.css
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
        display: none;
}
.ui-helper-hidden-accessible {
        border: 0;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
}
.ui-helper-reset {
        margin: 0;
        padding: 0;
        border: 0;
        outline: 0;
        line-height: 1.3;
        text-decoration: none;
        font-size: 100%;
        list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
        content: "";
        display: table;
}
.ui-helper-clearfix:after {
        clear: both;
}
.ui-helper-clearfix {
        min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        position: absolute;
        opacity: 0;
        filter:Alpha(Opacity=0);
}

.ui-front {
        z-index: 100;
}


/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
        cursor: default !important;
}


/* Icons
----------------------------------*/

/* states and images */
.ui-icon {
        display: block;
        text-indent: -99999px;
        overflow: hidden;
        background-repeat: no-repeat;
}


/* Misc visuals
----------------------------------*/

/* Overlays */
.ui-widget-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
}

-       jquery.ui.datepicker.css
.ui-datepicker {
        width: 17em;
        padding: .2em .2em 0;
        display: none;
}
.ui-datepicker .ui-datepicker-header {
        position: relative;
        padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
        position: absolute;
        top: 2px;
        width: 1.8em;
        height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
        top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
        left: 2px;
}
.ui-datepicker .ui-datepicker-next {
        right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
        left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
        right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
        display: block;
        position: absolute;
        left: 50%;
        margin-left: -8px;
        top: 50%;
        margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
        margin: 0 2.3em;
        line-height: 1.8em;
        text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
        font-size: 1em;
        margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month-year {
        width: 100%;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
        width: 49%;
}
.ui-datepicker table {
        width: 100%;
        font-size: .9em;
        border-collapse: collapse;
        margin: 0 0 .4em;
}
.ui-datepicker th {
        padding: .7em .3em;
        text-align: center;
        font-weight: bold;
        border: 0;
}
.ui-datepicker td {
        border: 0;
        padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
        display: block;
        padding: .2em;
        text-align: right;
        text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
        background-image: none;
        margin: .7em 0 0 0;
        padding: 0 .2em;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
        float: right;
        margin: .5em .2em .4em;
        cursor: pointer;
        padding: .2em .6em .3em .6em;
        width: auto;
        overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
        float: left;
}

/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
        width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
        float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
        width: 95%;
        margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
        width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
        width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
        width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
        border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
        clear: left;
}
.ui-datepicker-row-break {
        clear: both;
        width: 100%;
        font-size: 0;
}

/* RTL support */
.ui-datepicker-rtl {
        direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
        right: 2px;
        left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
        left: 2px;
        right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
        right: 1px;
        left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
        left: 1px;
        right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
        clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
        float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
        float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
        border-right-width: 0;
        border-left-width: 1px;
}

-       jquery.ui.theme.css
/* Component containers
----------------------------------*/
.ui-widget {
            font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
            font-size: 1.1em/*{fsDefault}*/;
}
.ui-widget .ui-widget {
            font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
            font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
            font-size: 1em;
}
.ui-widget-content {
            border: 1px solid #aaaaaa/*{borderColorContent}*/;
            background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
            color: #222222/*{fcContent}*/;
}
.ui-widget-content a {
            color: #222222/*{fcContent}*/;
}
.ui-widget-header {
            border: 1px solid #aaaaaa/*{borderColorHeader}*/;
            background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
            color: #222222/*{fcHeader}*/;
            font-weight: bold;
}
.ui-widget-header a {
            color: #222222/*{fcHeader}*/;
}
Files are very long, if you want to see all download this script.
Download.
If you are tired of reading the contents of all of which I type, you can download all the source code of this program. The following list of source code can be downloaded.
- Download themes.rar
- Download ui.rar
- Download index.rar
- Download jquery-1.9.0.rar
- demos.rar
Extract themes.rar and ui.rar, put in the folder "date" and index.php files, jquery-1.9.0.js and demos.css.
thank you

0 komentar:

Post a Comment

if you have any questions about posting, feel free to comment.
thank you