first commit
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SplClassLoader implementation that implements the technical interoperability
|
||||
* standards for PHP 5.3 namespaces and class names.
|
||||
*
|
||||
* http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1
|
||||
*
|
||||
* // Example which loads classes for the Doctrine Common package in the
|
||||
* // Doctrine\Common namespace.
|
||||
* $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine');
|
||||
* $classLoader->register();
|
||||
*
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||
* @author Roman S. Borschel <roman@code-factory.org>
|
||||
* @author Matthew Weier O'Phinney <matthew@zend.com>
|
||||
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
|
||||
*/
|
||||
class SplClassLoader
|
||||
{
|
||||
private $_fileExtension = '.php';
|
||||
private $_namespace;
|
||||
private $_includePath;
|
||||
private $_namespaceSeparator = '\\';
|
||||
/**
|
||||
* Creates a new <tt>SplClassLoader</tt> that loads classes of the
|
||||
* specified namespace.
|
||||
*
|
||||
* @param string $ns The namespace to use.
|
||||
*/
|
||||
public function __construct($ns = null, $includePath = null)
|
||||
{
|
||||
$this->_namespace = $ns;
|
||||
$this->_includePath = $includePath;
|
||||
}
|
||||
/**
|
||||
* Sets the namespace separator used by classes in the namespace of this class loader.
|
||||
*
|
||||
* @param string $sep The separator to use.
|
||||
*/
|
||||
public function setNamespaceSeparator($sep)
|
||||
{
|
||||
$this->_namespaceSeparator = $sep;
|
||||
}
|
||||
/**
|
||||
* Gets the namespace seperator used by classes in the namespace of this class loader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getNamespaceSeparator()
|
||||
{
|
||||
return $this->_namespaceSeparator;
|
||||
}
|
||||
/**
|
||||
* Sets the base include path for all class files in the namespace of this class loader.
|
||||
*
|
||||
* @param string $includePath
|
||||
*/
|
||||
public function setIncludePath($includePath)
|
||||
{
|
||||
$this->_includePath = $includePath;
|
||||
}
|
||||
/**
|
||||
* Gets the base include path for all class files in the namespace of this class loader.
|
||||
*
|
||||
* @return string $includePath
|
||||
*/
|
||||
public function getIncludePath()
|
||||
{
|
||||
return $this->_includePath;
|
||||
}
|
||||
/**
|
||||
* Sets the file extension of class files in the namespace of this class loader.
|
||||
*
|
||||
* @param string $fileExtension
|
||||
*/
|
||||
public function setFileExtension($fileExtension)
|
||||
{
|
||||
$this->_fileExtension = $fileExtension;
|
||||
}
|
||||
/**
|
||||
* Gets the file extension of class files in the namespace of this class loader.
|
||||
*
|
||||
* @return string $fileExtension
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
return $this->_fileExtension;
|
||||
}
|
||||
/**
|
||||
* Installs this class loader on the SPL autoload stack.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'));
|
||||
}
|
||||
/**
|
||||
* Uninstalls this class loader from the SPL autoloader stack.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $className The name of the class to load.
|
||||
* @return void
|
||||
*/
|
||||
public function loadClass($className)
|
||||
{
|
||||
if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
|
||||
$fileName = '';
|
||||
$namespace = '';
|
||||
if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
|
||||
$namespace = substr($className, 0, $lastNsPos);
|
||||
$className = substr($className, $lastNsPos + 1);
|
||||
$fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
|
||||
require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
+1268
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,472 @@
|
||||
<?php
|
||||
include '../core/main.php';
|
||||
?>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
$(document).ready(function(){
|
||||
$("#KOTA").change(function(){
|
||||
var selectValues = $("#KOTA").val();
|
||||
var kecHidden = $("#KECAMATANHIDDEN").val();
|
||||
$.post('./include/ajaxload.php',{kdkota:selectValues,load_kecamatan:'true'},function(data){
|
||||
$('#kecamatanpilih').html(data);
|
||||
$('#kecamatanpilih select').select2();
|
||||
$('#KDKECAMATAN').val(kecHidden).change();
|
||||
$('#kelurahanpilih').html("<select name=\"KELURAHAN\" class=\"form-control text required\" style=\"width:100%\" id=\"KELURAHAN\" required> <option value=\"\"> --pilih-- </option>");
|
||||
});
|
||||
});
|
||||
|
||||
$("#KDKECAMATAN").change(function(){
|
||||
var selectValues = $("#KDKECAMATAN").val();
|
||||
var kelHidden = $("#KELURAHANHIDDEN").val();
|
||||
$.post('./include/ajaxload.php',{kdkecamatan:selectValues,load_kelurahan:'true'},function(data){
|
||||
$('#kelurahanpilih').html(data);
|
||||
$('#kelurahanpilih select').select2();
|
||||
$('#KELURAHAN').val(kelHidden);
|
||||
});
|
||||
});
|
||||
|
||||
$("#ID_DIAGNOSIS").change(function(){
|
||||
var selectValues = $("#ID_DIAGNOSIS").val();
|
||||
//var kecHidden = $("#KECAMATANHIDDEN").val();
|
||||
$.post('./include/ajaxload.php',{id_diagnosis:selectValues,load_sub_var1:'true'},function(data){
|
||||
$('#dafgejalapilih').html(data);
|
||||
});
|
||||
$.post('./include/ajaxload.php',{id_diagnosis:selectValues,load_sub_var2:'true'},function(data){
|
||||
$('#dafetiologipilih').html(data);
|
||||
});
|
||||
$.post('./include/ajaxload.php',{id_diagnosis:selectValues,load_sub_var3:'true'},function(data){
|
||||
$('#dafoutcomepilih').html(data);
|
||||
});
|
||||
$.post('./include/ajaxload.php',{id_diagnosis:selectValues,load_sub_var4:'true'},function(data){
|
||||
$('#dafintervensipilih').html(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
</SCRIPT>
|
||||
<?php
|
||||
if(array_key_exists('dokterjaga', $_REQUEST) && $_REQUEST['dokterjaga'] != ''){
|
||||
$kdpoly = $_REQUEST['kdpoly'];
|
||||
$kddokter = $_REQUEST['kddokter'];
|
||||
$kddokter2 = $_REQUEST['kddokter2'];
|
||||
$sql = $db->query('select * from m_dokter_jaga where kdpoly = '.$kdpoly);
|
||||
if($sql->numRows() > 0){
|
||||
$update = $db->query('update m_dokter_jaga set kddokter = '.$kddokter.' where kdpoly ='.$kdpoly);
|
||||
}else{
|
||||
$insert = $db->query('insert into m_dokter_jaga '.bind_sql(['kdpoly'=>$kdpoly,'kddokter'=>$kddokter]));
|
||||
}
|
||||
}
|
||||
if(array_key_exists('load_dokterjaga', $_REQUEST) && $_REQUEST['load_dokterjaga'] != ''){
|
||||
$kdpoly = $_REQUEST['kdpoly'];
|
||||
$sql = $db->query('SELECT a.kddokter as kddokter, b.namadokter, b.tgl_akhir_sip from m_dokter_jaga a join m_dokter b on a.KDDOKTER = b.kddokter where a.kdpoly = \''.$kdpoly.'\' and b.aktif = 1');
|
||||
if(!$sql) {
|
||||
echo 'Terjadi kesalahan pada sistem';
|
||||
}
|
||||
else {
|
||||
if($sql->numRows() > 0){
|
||||
$arr_dokter = [''=>'Pilih Dokter'];
|
||||
foreach($sql->fetchAll() as $data)
|
||||
{
|
||||
$tgl_SIP = new Datetime($data['tgl_akhir_sip']);
|
||||
$tgl_sekarang = new Datetime(date('Y-m-d'));
|
||||
|
||||
if($d['tgl_akhir_sip'] > '0000-00-00'){
|
||||
if($tgl_sekarang <= $tgl_SIP) {
|
||||
$arr_dokter[$data['kddokter']] = $data['namadokter'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$arr_dokter[$data['kddokter']] = $data['namadokter'];
|
||||
}
|
||||
}
|
||||
echo form_dropdown('DOKTERJAGA',$arr_dokter,'','class="form-control"');
|
||||
|
||||
}else{
|
||||
echo 'Tidak ada dokter jaga di poli tersebut';
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('load_dokterjaga_v2', $_REQUEST) && $_REQUEST['load_dokterjaga_v2'] != ''){
|
||||
$kdpoly = $_REQUEST['kdpoly'];
|
||||
$sql = $db->query('SELECT a.kddokter as kddokter, b.namadokter, b.tgl_akhir_sip from m_dokter_jaga a join m_dokter b on a.KDDOKTER = b.kddokter where a.kdpoly = \''.$kdpoly.'\' and b.aktif = 1');
|
||||
if(!$sql) {
|
||||
echo 'Terjadi kesalahan pada sistem';
|
||||
}
|
||||
else {
|
||||
if($sql->numRows() > 0){
|
||||
foreach($sql->fetchAll() as $data)
|
||||
{
|
||||
$tgl_SIP = new Datetime($data['tgl_akhir_sip']);
|
||||
$tgl_sekarang = new Datetime(date('Y-m-d'));
|
||||
|
||||
if($d['tgl_akhir_sip'] > '0000-00-00'){
|
||||
if($tgl_sekarang <= $tgl_SIP) {
|
||||
$arr_dokter[$data['kddokter']] = $data['namadokter'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$arr_dokter[$data['kddokter']] = $data['namadokter'];
|
||||
}
|
||||
}
|
||||
echo form_dropdown('input[kddokter]',$arr_dokter,'','class="form-control" id="kddokter"');
|
||||
|
||||
}else{
|
||||
echo 'Tidak ada dokter jaga di poli tersebut';
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('load_payplan', $_REQUEST) && $_REQUEST['load_payplan'] != ''){
|
||||
$payplan = $_REQUEST['payplan'];
|
||||
$sql = $db->query('select KODE, NAMA from m_carabayar where KODE > 1');
|
||||
if($sql->numRows() > 0){
|
||||
#$data = $sql->fetchAll()[0];
|
||||
echo '<select name="CARABAYAR" id="CARABAYAR" class="text"><option value="0"> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo '<option value="'.$data['KODE'].'">'.$data['NAMA'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo '-';
|
||||
}
|
||||
}
|
||||
|
||||
# INSERT DOKTER JAGA BARU
|
||||
if(array_key_exists('adddokterjaga', $_REQUEST) && $_REQUEST['adddokterjaga'] != ''){
|
||||
$poly = $_REQUEST['poly'];
|
||||
$dokter = $_REQUEST['dokter'];
|
||||
$q = $db->query('select * from m_dokter_jaga where kdpoly = "'.$poly.'" AND kddokter ="'.$dokter.'"');
|
||||
if($q->numRows() > 0):
|
||||
echo 'error';
|
||||
else:
|
||||
$sql = execute('insert into m_dokter_jaga '.bind_sql(['kdpoly'=>$poly,'kddokter'=>$dokter]));
|
||||
endif;
|
||||
}
|
||||
# LOAD LIST DOKTER JAGA
|
||||
if(array_key_exists('loaddokterjaga', $_REQUEST) && $_REQUEST['loaddokterjaga'] != ''){
|
||||
$kdpoly = $_GET['loaddokterjaga'];
|
||||
$sql = $db->query("SELECT a.kdpoly,a.kddokter,a.id,b.NAMADOKTER from m_dokter_jaga a join m_dokter b on b.KDDOKTER = a.kddokter where a.kdpoly = '$kdpoly'");
|
||||
#$sql = $db->query('select kdpoly,kddokter,NAMADOKTER from m_dokter where kdpoly = '.$kdpoly);
|
||||
if($sql->numRows() > 0){
|
||||
echo '<script>';
|
||||
echo '$(document).ready(function(){
|
||||
$(".hapus").click(function(){
|
||||
var id = $(this).attr("id");
|
||||
var poly= $(this).attr("poly");
|
||||
$.post("'._BASE_.'include/ajaxload.php",{id:id,removedokterjaga:true},function(data){
|
||||
$("#listdokter_"+poly).load("'._BASE_.'include/ajaxload.php?loaddokterjaga="+poly);
|
||||
});
|
||||
});});';
|
||||
echo '</script>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo '<div class="namadokter">'.$data['NAMADOKTER'].'</div> <span id="'.$data['id'].'" poly="'.$dpoly['kode'].'" class="hapus text">Hapus</span> <br clear="all">';
|
||||
}
|
||||
}
|
||||
}
|
||||
# HAPUS DOKTER JGA
|
||||
if(array_key_exists('removedokterjaga', $_REQUEST) && $_REQUEST['removedokterjaga'] == true){
|
||||
execute('delete from m_dokter_jaga where id = "'.$_REQUEST['id'].'"');
|
||||
}
|
||||
|
||||
if(array_key_exists('rem_tindakanlab', $_REQUEST) && $_REQUEST['rem_tindakanlab'] == 'true'){
|
||||
$jenis = $_REQUEST['cito_status'];
|
||||
if($jenis == "c"){
|
||||
$faktor = 1.25;
|
||||
}else{
|
||||
$faktor = 1;
|
||||
}
|
||||
$db->query('DELETE FROM tmp_orderpenunjang where kode_tindakan = "'.$_REQUEST['kd_tindakan'].'" AND ip = "'.getRealIpAddr().'"');
|
||||
$sql = $db->query('select a.nama_tindakan, a.qty, a.tarif from tmp_orderpenunjang a where a.ip = "'.getRealIpAddr().'"');
|
||||
if($sql->numRows() > 0){
|
||||
$t = 0;
|
||||
echo '<table style="width:100%;">';
|
||||
echo '<tr><th>Nama Pemeriksaan</th><th>Qty</th><th>Tarif</th></tr>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
$t = $t + $data['tarif'] * $faktor;
|
||||
echo '<tr><td>'.$data['nama_tindakan'].'</td><td>'.$data['qty'].'</td><td align="right">'.format_uang($data['tarif'] * $faktor).'</td></tr>';
|
||||
}
|
||||
echo '<tr><td colspan="2" style="border-top:1px solid #000; text-align:center;">Total</td><td style="border-top:1px solid #000; text-align:right;">'.format_uang($t).'</td></tr>';
|
||||
echo '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('view_detail_bill', $_REQUEST) && $_REQUEST['view_detail_bill'] == 'true'){
|
||||
$is_batal = (array_key_exists('page_akses', $_REQUEST)) ? $_REQUEST['page_akses']['d'] : null;
|
||||
if($_REQUEST['kode_tarif'] == 'DFAR'){
|
||||
$sql = $db->query('SELECT a.*,
|
||||
CASE WHEN SUBSTR(a.kode_obat,1,1) = "R" AND LENGTH(a.kode_obat) = 3 THEN "RACIKAN "+SUBSTR(a.kode_obat,2,2)
|
||||
ELSE ( SELECT c.Nama FROM tmlogbarang c WHERE a.kode_obat = c.Kode ) END AS nama_obat
|
||||
FROM t_billobat_rajal a
|
||||
where a.nobill = "'.$_REQUEST['nobill'].'"');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<table style="width:100%;" class="table table-bordered table-sm table-striped">';
|
||||
echo '<tr><th>Nama Pemeriksaan</th><th style="width:50px;">Qty</th><th style="width:100px;">Tarif</th></tr>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo '<tr><td>'.$data['nama_obat'].'</td><td>'.$data['qty'].'</td><td align="right">'.format_uang($data['harga']).'</td></tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
}else{
|
||||
$sql = $db->query('select a.*,b.* from t_billrajal a inner join m_tarif_rs b on b.kode_tarif = a.KODETARIF where a.nobill = "'.$_REQUEST['nobill'].'" and a.KODETARIF not like "DFAR"');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<table style="width:100%;" class="table table-bordered table-sm table-striped">';
|
||||
echo '<tr><th>Nama Pemeriksaan</th><th style="width:50px;">Qty</th><th style="width:100px;">Tarif</th></tr>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
?>
|
||||
<tr><td><?php echo $data['nama_tindakan']; ?></td><td><?php echo $data['QTY']; ?></td><td align="right"><?php echo format_uang($data['TARIFRS']); ?></td>
|
||||
<?php if($is_batal == true) { ?>
|
||||
<td> <input type="button" name="Cancel" value="Batal" idxdaftar="<?php echo $data['IDXDAFTAR'];?>" kode="<?php echo $data['kode_tindakan']; ?>" id="cancel_<?php echo $data['IDXBILL']; ?>" rel=<?php echo $data['IDXBILL']; ?> svn=<?php echo $data['IDXBILL']; ?> class="btn btn-outline-danger btn-sm cancel_btn" />
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
$('.cancel_btn').click(function(){
|
||||
var nobill = $(this).attr('svn');
|
||||
var nomr = $('#nomr').val();
|
||||
var kode = $(this).attr('kode');
|
||||
var idxdaftar = $(this).attr('idxdaftar');
|
||||
//cancel
|
||||
alert ('Anda yakin akan membatalkan?');
|
||||
$.post('<?php echo _BASE_;?>cartbill_batal_tindakan.php',{nobill:nobill,nomr:nomr,kode:kode,idxdaftar:idxdaftar},function(data){
|
||||
$('#tmp_print').empty().html(data);
|
||||
w=window.open();
|
||||
w.document.write($('#tmp_print').html());
|
||||
w.print();
|
||||
w.close();
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
if(array_key_exists('loadDetailPasien', $_REQUEST) && $_REQUEST['loadDetailPasien'] == 'true'){
|
||||
$sql = $db->query('SELECT * from m_pasien where nomr = \''.$_REQUEST['nomr'].'\'');
|
||||
$data = $sql->fetchFirst();
|
||||
$data = implode('|',$data);
|
||||
echo $data;
|
||||
}
|
||||
|
||||
if(array_key_exists('form_edit_pembayaran', $_REQUEST) && $_REQUEST['form_edit_pembayaran'] == 'true'){
|
||||
$sql = $db->query('select * from m_carabayar order by ORDERS');
|
||||
echo '<select name="carabayar_update[]">';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
if($data['KODE'] == $_REQUEST['old']): $sel = 'selected="selected"'; else: $sel = ''; endif;
|
||||
echo '<option value="'.$data['KODE'].'" '.$sel.'>'.$data['NAMA'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
|
||||
if(array_key_exists('load_kota', $_REQUEST) && $_REQUEST['load_kota'] != ''){
|
||||
$kdprov = $_REQUEST['kdprov'];
|
||||
if($kdprov != null){
|
||||
$sql = $db->query('SELECT * from m_kota where idprovinsi = \''.$kdprov.'\' order by idkota ASC');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="KOTA" class="form-control text required" style="width:100%" id="KOTA" required> <option value=""> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
if($_REQUEST['kdkota'] == $data['idkota']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
echo '<option value="'.$data['idkota'].'" '.$sel.' > '.$data['namakota'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada kota di provinsi tersebut';
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('load_kecamatan', $_REQUEST) && $_REQUEST['load_kecamatan'] != ''){
|
||||
$kdkota = $_REQUEST['kdkota'];
|
||||
if($kdkota != null){
|
||||
$sql = $db->query('SELECT * from m_kecamatan where idkota = '.$kdkota.' order by idkecamatan ASC');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="KDKECAMATAN" class="form-control text required" style="width:100%" id="KDKECAMATAN" required> <option value=""> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo'<option value="'.$data['idkecamatan'].'">'.$data['namakecamatan'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada kecamatan di kota tersebut';
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('load_kelurahan', $_REQUEST) && $_REQUEST['load_kelurahan'] != ''){
|
||||
$kdkecamatan = $_REQUEST['kdkecamatan'];
|
||||
if($kdkecamatan != null){
|
||||
$sql = $db->query('SELECT * from m_kelurahan where idkecamatan = \''.$kdkecamatan.'\' order by idkelurahan ASC');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="KELURAHAN" class="form-control text required" style="width:100%" id="KELURAHAN" required> <option value=""> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo'<option value="'.$data['idkelurahan'].'">'.$data['namakelurahan'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada kelurahan di kecamatan tersebut';
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('dokterpraktek', $_REQUEST) && $_REQUEST['dokterpraktek'] != ''){
|
||||
$kdpoly = $_REQUEST['kdpoly'];
|
||||
$kddokter = $_REQUEST['kddokter'];
|
||||
$kddokter2 = $_REQUEST['kddokter2'];
|
||||
$sql = $db->query('select * from m_dokter_praktek where kdpoly = '.$kdpoly);
|
||||
if($sql->numRows() > 0){
|
||||
$update = $db->query('update m_dokter_praktek set kddokter = '.$kddokter.' where kdpoly ='.$kdpoly);
|
||||
}else{
|
||||
$insert = $db->query('insert into m_dokter_praktek '.bind_sql(['kdpoly'=>$kdpoly,'kddokter'=>$kddokter]));
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('dokterjaga', $_REQUEST) && $_REQUEST['add_dokterprak'] != ''){
|
||||
$poly = $_REQUEST['poly'];
|
||||
$dokter = $_REQUEST['dokter'];
|
||||
$jadwal = $_REQUEST['jadwal'];
|
||||
$start = $_REQUEST['start'];
|
||||
$end = $_REQUEST['end'];
|
||||
$q = $db->query('select * from m_dokter_praktek where KDPOLY = "'.$poly.'" AND KDDOKTER ="'.$dokter.'" AND JADWAL ="'.$jadwal.'"');
|
||||
if($q->numRows() > 0):
|
||||
echo 'error';
|
||||
else:
|
||||
$sql = $db->query('insert into m_dokter_praktek '.bind_sql(['kdpoly'=>$poly,'kddokter'=>$dokter,'jadwal'=>$jadwal,'dari_jam'=>$start,'sampai_jam'=>$end]));
|
||||
endif;
|
||||
}
|
||||
|
||||
if(array_key_exists('loaddokter', $_REQUEST) && $_REQUEST['loaddokter'] != ''){
|
||||
global $db;
|
||||
$kdpoly = $_GET['loaddokter'];
|
||||
$sql = $db->query('SELECT a.kdpoly,a.kddokter,a.id, b.NAMADOKTER from m_dokter_prakter a join m_dokter b on b.KDDOKTER = a.kddokter where a.kdpoly = '.$kdpoly);
|
||||
if($sql->numRows() > 0){
|
||||
echo '<script>';
|
||||
echo '$(document).ready(function(){
|
||||
$(".hapus").click(function(){
|
||||
var id = $(this).attr("id");
|
||||
var poly= $(this).attr("poly");
|
||||
$.post("'._BASE_.'include/ajaxload.php",{id:id,removedokter:true},function(data){
|
||||
$("#listdokter_prak"+poly).load("'._BASE_.'include/ajaxload.php?loaddokter="+poly);
|
||||
});
|
||||
});
|
||||
$(".edit").click(function(){
|
||||
var id = $(this).attr("id");
|
||||
var poly= $(this).attr("poly");
|
||||
var dokter= $(this).attr("dokter");
|
||||
$.post("'._BASE_.'include/ajaxload.php",{id:id,editdokter:true},function(data){
|
||||
$("#listdokter_prak"+poly).load("'._BASE_.'include/ajaxload.php?loaddokter="+poly);
|
||||
});
|
||||
});
|
||||
});';
|
||||
echo '</script>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo '<div class="namadokter">'.$data['NAMADOKTER'].'</div> <span id="'.$data['id'].'" poly="'.$dpoly['kode'].'" </span><br clear="all">';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('removedokter', $_REQUEST) && $_REQUEST['removedokter'] == true){
|
||||
$db->query('delete from m_dokter_praktek where id = "'.$_REQUEST[id].'"');
|
||||
}
|
||||
|
||||
if(array_key_exists('editdokter', $_REQUEST) && $_REQUEST['editdokter'] == true){
|
||||
// $db->query('update m_dokter_praktek set kddokter = '.$kddokter.' where kdpoly ='.$kdpoly);
|
||||
//$db->query('update m_dokter_praktek set id = "'.$_REQUEST[id].'"');
|
||||
$kode = $_REQUEST['kode'];
|
||||
$poly = $_REQUEST['poly'];
|
||||
$dokter = $_REQUEST['dokter'];
|
||||
$jadwal = $_REQUEST['jadwal'];
|
||||
$start = $_REQUEST['start'];
|
||||
$end = $_REQUEST['end'];
|
||||
$q = $db->query('select * from m_dokter_praktek where KDPOLY = "'.$poly.'" AND KDDOKTER ="'.$dokter.'" AND JADWAL ="'.$jadwal.'" and id not in '.$kode);
|
||||
if($q->numRows() > 0):
|
||||
echo 'error';
|
||||
else:
|
||||
$sql = $db->query('update m_dokter_praktek set kdpoly = "'.$poly.'", kddokter = "'.$dokter.'", jadwal = "'.$jadwal.'", dari_jam = "'.$start.'", sampai_jam = "'.$end.'" where id = "'.$kode.'"');
|
||||
endif;
|
||||
}
|
||||
|
||||
if(array_key_exists('load_diagnosis', $_REQUEST) && $_REQUEST['load_diagnosis'] != ''){
|
||||
$iddomain = $_REQUEST['iddomain'];
|
||||
$sql = $db->query('select * from m_diagnosis_kep where id_domain = "'.$iddomain.'" order by id_diagnosis ASC');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="ID_DIAGNOSIS" class="text required" title="*" id="ID_DIAGNOSIS"><option value="0"> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
if($_REQUEST['id_diagnosis'] == $data['id_diagnosis']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
echo '<option value="'.$data['id_diagnosis'].'" '.$sel.' > '.$data['kode_diagnosis'].' - '.$data['nama_diagnosis'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada diagnosis di domain tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('load_sub_var1', $_REQUEST) && $_REQUEST['load_sub_var1'] != ''){
|
||||
$id_diagnosis = $_REQUEST['id_diagnosis'];
|
||||
$sql = $db->query('select * from m_sub_var1_diagnosa_kep where id_diagnosis = "'.$id_diagnosis.'" order by id_sub_var1 ASC');
|
||||
if($sql->numRows() > 0){
|
||||
//$val_1 = split(",",$data['sub_var1']); $i = 0;
|
||||
foreach($sql->fetchAll() as $ds){
|
||||
echo '<input type="checkbox" name="SUB_VAR1[]" value="'.$ds['id_sub_var1'].'" ';
|
||||
//if($val_1[$i]==$ds['id_sub_var1']){echo "Checked"; $i++;}
|
||||
echo '> '.$ds['nama_sub_var1'].' <br>';
|
||||
}
|
||||
}else{
|
||||
echo 'Tidak ada daftar gejala - batasan karakteristik di diagnosis tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('load_sub_var2', $_REQUEST) && $_REQUEST['load_sub_var2'] != ''){
|
||||
$id_diagnosis = $_REQUEST['id_diagnosis'];
|
||||
$sql = $db->query('select * from m_sub_var2_diagnosa_kep where id_diagnosis = "'.$id_diagnosis.'" order by id_sub_var2 ASC');
|
||||
if($sql->numRows() > 0){
|
||||
//$val_2 = split(",",$data['sub_var2']); $i = 0;
|
||||
foreach($sql->fetchAll() as $ds){
|
||||
echo '<input type="checkbox" name="SUB_VAR2[]" value="'.$ds['id_sub_var2'].'" ';
|
||||
//if($val_2[$i]==$ds['id_sub_var2']){echo "Checked"; $i++;}
|
||||
echo '> '.$ds['nama_sub_var2'].' <br>';
|
||||
}
|
||||
}else{
|
||||
echo 'Tidak ada daftar etiologi - faktor resiko di diagnosis tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('load_sub_var3', $_REQUEST) && $_REQUEST['load_sub_var3'] != ''){
|
||||
$id_diagnosis = $_REQUEST['id_diagnosis'];
|
||||
$sql = $db->query('select * from m_sub_var3_diagnosa_kep where id_diagnosis = "'.$id_diagnosis.'" order by id_sub_var3 ASC');
|
||||
if($sql->numRows() > 0){
|
||||
//$val_3 = split(",",$data['sub_var3']); $i = 0;
|
||||
foreach($sql->fetchAll() as $ds){
|
||||
echo '<input type="checkbox" name="SUB_VAR3[]" value="'.$ds['id_sub_var3'].'" ';
|
||||
//if($val_3[$i]==$ds['id_sub_var3']){echo "Checked"; $i++;}
|
||||
echo '> '.$ds['nama_sub_var3'].' <br>';
|
||||
}
|
||||
}else{
|
||||
echo 'Tidak ada daftar tujuan - outcome (NOC) di diagnosis tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('load_sub_var4', $_REQUEST) && $_REQUEST['load_sub_var4'] != ''){
|
||||
$id_diagnosis = $_REQUEST['id_diagnosis'];
|
||||
$sql = $db->query('select * from m_sub_var4_diagnosa_kep where id_diagnosis = "'.$id_diagnosis.'" order by id_sub_var4 ASC');
|
||||
if($sql->numRows() > 0){
|
||||
//$val_4 = split(",",$data['sub_var4']); $i = 0;
|
||||
foreach($sql->fetchAll() as $ds){
|
||||
echo '<input type="checkbox" name="SUB_VAR4[]" value="'.$ds['id_sub_var4'].'" ';
|
||||
//if($val_4[$i]==$ds['id_sub_var4']){echo "Checked"; $i++;}
|
||||
echo '> '.$ds['nama_sub_var4'].' <br>';
|
||||
}
|
||||
}else{
|
||||
echo 'Tidak ada daftar intervensi (NIC) di diagnosis tersebut';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
// start ajaxrequest.js
|
||||
|
||||
|
||||
// Following is a javascript function that makes a httprequest - AJAX. This is the AJAX bit and all that is needed in that manner.
|
||||
// Only in this one we won't be using XML in our response, we will accept and handle
|
||||
// pure text and html and display this response directly to the user within the
|
||||
// desired <div id> tags. It can even be used to include pure html files as a substitute
|
||||
// solution to the "old" frames method where as no php or other scripting language is nessesary on the server.
|
||||
// but use it with care - it is not a search engine supported method and indexing will fail. Workaround for this is not included here
|
||||
|
||||
function MyAjaxRequest(target_div,file,check_div)
|
||||
{
|
||||
var MyHttpRequest = false;
|
||||
var MyHttpLoading = '<img src="include/loading.gif" border="0" alt="loading.." />'; // or use an animated gif instead: var MyHttpLoading = '<img src="loading.gif" border="0" alt="running" />';
|
||||
var ErrorMSG = 'Sorry - No XMLHTTP support in your browser, buy a newspaper instead';
|
||||
|
||||
if(check_div)
|
||||
{
|
||||
var check_value = document.getElementById(check_div).value;
|
||||
}
|
||||
else
|
||||
{
|
||||
var check_value = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(window.XMLHttpRequest) // client use Firefox, Opera etc - Non Microsoft product
|
||||
{
|
||||
try
|
||||
{
|
||||
MyHttpRequest = new XMLHttpRequest();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
MyHttpRequest = false;
|
||||
}
|
||||
}
|
||||
else if(window.ActiveXObject) // client use Internet Explorer
|
||||
{
|
||||
try
|
||||
{
|
||||
MyHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
try
|
||||
{
|
||||
MyHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
MyHttpRequest = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MyHttpRequest = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(MyHttpRequest) // browser supports httprequest
|
||||
{
|
||||
var random = Math.random() * Date.parse(new Date()); // make a random string to prevent caching
|
||||
|
||||
var file_array = file.split('.'); // prepare to check if we have a query string or a html/htm file
|
||||
if(file_array[1] == 'php') // no query string, just calling a php file
|
||||
{
|
||||
var query_string = '?rand=' + random;
|
||||
}
|
||||
else if(file_array[1] == 'htm' || file_array[1] == 'html') // calling a htm or html file
|
||||
{
|
||||
var query_string = '';
|
||||
}
|
||||
else // we have presumable a php file with a query string attached
|
||||
{
|
||||
var query_string = check_value + '&rand=' + random;
|
||||
}
|
||||
|
||||
|
||||
MyHttpRequest.open("get", url_encode(file + query_string), true); // <-- run the httprequest using GET
|
||||
|
||||
|
||||
// handle the httprequest
|
||||
MyHttpRequest.onreadystatechange = function ()
|
||||
{
|
||||
if(MyHttpRequest.readyState == 4) // done and responded
|
||||
{
|
||||
document.getElementById(target_div).innerHTML = MyHttpRequest.responseText; // display result
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById(target_div).innerHTML = MyHttpLoading; // still working
|
||||
}
|
||||
}
|
||||
MyHttpRequest.send(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById(target_div).innerHTML = ErrorMSG; // the browser was unable to create a httprequest
|
||||
}
|
||||
}
|
||||
// end of "AJAX" function
|
||||
|
||||
|
||||
// Here follows a function to urlencode the string we run through our httprequest, it has nothing to do with AJAX itself
|
||||
// If you look carefully in the above httprequest you se that we use this url_encode function around the file and query_string
|
||||
// This is very handy since we are using GET in our httprequest and for instance
|
||||
// any occurrance of the char # (from textboxes etc) will brake the string we are sending to our file - we don't want that to brake!
|
||||
// It will also convert spaces to +
|
||||
|
||||
function url_encode(string){
|
||||
var string;
|
||||
var safechars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/-_.&?=";
|
||||
var hex = "0123456789ABCDEF";
|
||||
var encoded_string = "";
|
||||
for(var i = 0; i < string.length; i++)
|
||||
{
|
||||
var character = string.charAt(i);
|
||||
if(character == " ")
|
||||
{
|
||||
encoded_string += "+";
|
||||
}
|
||||
else if(safechars.indexOf(character) != -1)
|
||||
{
|
||||
encoded_string += character;
|
||||
}
|
||||
else
|
||||
{
|
||||
var hexchar = character.charCodeAt(0);
|
||||
if(hexchar > 255)
|
||||
{
|
||||
encoded_string += "+";
|
||||
}
|
||||
else
|
||||
{
|
||||
encoded_string += "%";
|
||||
encoded_string += hex.charAt((hexchar >> 4) & 0xF);
|
||||
encoded_string += hex.charAt(hexchar & 0xF);
|
||||
}
|
||||
}
|
||||
}
|
||||
return encoded_string;
|
||||
}
|
||||
|
||||
// end .js file
|
||||
@@ -0,0 +1,136 @@
|
||||
// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
var Builder = {
|
||||
NODEMAP: {
|
||||
AREA: 'map',
|
||||
CAPTION: 'table',
|
||||
COL: 'table',
|
||||
COLGROUP: 'table',
|
||||
LEGEND: 'fieldset',
|
||||
OPTGROUP: 'select',
|
||||
OPTION: 'select',
|
||||
PARAM: 'object',
|
||||
TBODY: 'table',
|
||||
TD: 'table',
|
||||
TFOOT: 'table',
|
||||
TH: 'table',
|
||||
THEAD: 'table',
|
||||
TR: 'table'
|
||||
},
|
||||
// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
|
||||
// due to a Firefox bug
|
||||
node: function(elementName) {
|
||||
elementName = elementName.toUpperCase();
|
||||
|
||||
// try innerHTML approach
|
||||
var parentTag = this.NODEMAP[elementName] || 'div';
|
||||
var parentElement = document.createElement(parentTag);
|
||||
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
||||
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
|
||||
} catch(e) {}
|
||||
var element = parentElement.firstChild || null;
|
||||
|
||||
// see if browser added wrapping tags
|
||||
if(element && (element.tagName.toUpperCase() != elementName))
|
||||
element = element.getElementsByTagName(elementName)[0];
|
||||
|
||||
// fallback to createElement approach
|
||||
if(!element) element = document.createElement(elementName);
|
||||
|
||||
// abort if nothing could be created
|
||||
if(!element) return;
|
||||
|
||||
// attributes (or text)
|
||||
if(arguments[1])
|
||||
if(this._isStringOrNumber(arguments[1]) ||
|
||||
(arguments[1] instanceof Array) ||
|
||||
arguments[1].tagName) {
|
||||
this._children(element, arguments[1]);
|
||||
} else {
|
||||
var attrs = this._attributes(arguments[1]);
|
||||
if(attrs.length) {
|
||||
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
||||
parentElement.innerHTML = "<" +elementName + " " +
|
||||
attrs + "></" + elementName + ">";
|
||||
} catch(e) {}
|
||||
element = parentElement.firstChild || null;
|
||||
// workaround firefox 1.0.X bug
|
||||
if(!element) {
|
||||
element = document.createElement(elementName);
|
||||
for(attr in arguments[1])
|
||||
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
||||
}
|
||||
if(element.tagName.toUpperCase() != elementName)
|
||||
element = parentElement.getElementsByTagName(elementName)[0];
|
||||
}
|
||||
}
|
||||
|
||||
// text, or array of children
|
||||
if(arguments[2])
|
||||
this._children(element, arguments[2]);
|
||||
|
||||
return $(element);
|
||||
},
|
||||
_text: function(text) {
|
||||
return document.createTextNode(text);
|
||||
},
|
||||
|
||||
ATTR_MAP: {
|
||||
'className': 'class',
|
||||
'htmlFor': 'for'
|
||||
},
|
||||
|
||||
_attributes: function(attributes) {
|
||||
var attrs = [];
|
||||
for(attribute in attributes)
|
||||
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
|
||||
'="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"');
|
||||
return attrs.join(" ");
|
||||
},
|
||||
_children: function(element, children) {
|
||||
if(children.tagName) {
|
||||
element.appendChild(children);
|
||||
return;
|
||||
}
|
||||
if(typeof children=='object') { // array can hold nodes and text
|
||||
children.flatten().each( function(e) {
|
||||
if(typeof e=='object')
|
||||
element.appendChild(e);
|
||||
else
|
||||
if(Builder._isStringOrNumber(e))
|
||||
element.appendChild(Builder._text(e));
|
||||
});
|
||||
} else
|
||||
if(Builder._isStringOrNumber(children))
|
||||
element.appendChild(Builder._text(children));
|
||||
},
|
||||
_isStringOrNumber: function(param) {
|
||||
return(typeof param=='string' || typeof param=='number');
|
||||
},
|
||||
build: function(html) {
|
||||
var element = this.node('div');
|
||||
$(element).update(html.strip());
|
||||
return element.down();
|
||||
},
|
||||
dump: function(scope) {
|
||||
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
||||
|
||||
var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
|
||||
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
|
||||
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
|
||||
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
|
||||
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
|
||||
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
|
||||
|
||||
tags.each( function(tag){
|
||||
scope[tag] = function() {
|
||||
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
||||
+716
@@ -0,0 +1,716 @@
|
||||
// +------------------------------------------------------------+
|
||||
// | Popup Calendar(Window) |
|
||||
// +------------------------------------------------------------+
|
||||
// | Last Modified: 22-Dec-2005 |
|
||||
// | Web Site: http://www.yxscripts.com |
|
||||
// | EMail: m_yangxin@hotmail.com |
|
||||
// +------------------------------------------------------------+
|
||||
// | Copyright 2002 Xin Yang All Rights Reserved. |
|
||||
// | This version featured on Dynamic Drive |
|
||||
// | (http://www.dynamicdrive.com) |
|
||||
// +------------------------------------------------------------+
|
||||
|
||||
// default settings
|
||||
var fontFace="verdana";
|
||||
var fontSize=9;
|
||||
|
||||
var titleWidth=90;
|
||||
var titleMode=1;
|
||||
var dayWidth=12;
|
||||
var dayDigits=1;
|
||||
|
||||
var titleColor="#cccccc";
|
||||
var daysColor="#cccccc";
|
||||
var bodyColor="#ffffff";
|
||||
var dayColor="#ffffff";
|
||||
var currentDayColor="#333333";
|
||||
var footColor="#cccccc";
|
||||
var borderColor="#333333";
|
||||
|
||||
var titleFontColor = "#333333";
|
||||
var daysFontColor = "#333333";
|
||||
var dayFontColor = "#333333";
|
||||
var currentDayFontColor = "#ffffff";
|
||||
var footFontColor = "#333333";
|
||||
|
||||
var calFormat = "yyyy/mm/dd";
|
||||
//var calFormat = "dd/mm/yyyy";
|
||||
|
||||
var weekDay = 0;
|
||||
// ------
|
||||
|
||||
// codes
|
||||
var calWidth=200, calHeight=200, calOffsetX=-200, calOffsetY=16;
|
||||
var calWin=null;
|
||||
var winX=0, winY=0;
|
||||
var cal="cal";
|
||||
var cals=new Array();
|
||||
var currentCal=null;
|
||||
|
||||
var yxMonths=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
|
||||
var yxDays=new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
|
||||
var yxLinks=new Array("[close]", "[clear]");
|
||||
|
||||
var nav=navigator.userAgent.toLowerCase();;
|
||||
var isOpera=(nav.indexOf("opera")!=-1)?true:false;
|
||||
var isOpera5=(nav.indexOf("opera 5")!=-1 || nav.indexOf("opera/5")!=-1)?true:false;
|
||||
var isOpera6=(isOpera && parseInt(navigator.appVersion)>=6)?true:false;
|
||||
var isN6=(nav.indexOf("gecko")!=-1);
|
||||
var isN4=(document.layers)?true:false;
|
||||
var isMac=(nav.indexOf("mac")!=-1);
|
||||
var isIE=(document.all && !isOpera && (!isMac || navigator.appVersion.indexOf("MSIE 4")==-1))?true:false;
|
||||
|
||||
if (isN4) {
|
||||
fontSize+=2;
|
||||
}
|
||||
|
||||
var span2="</span>";
|
||||
|
||||
function span1(tag) {
|
||||
return "<span class='"+tag+"'>";
|
||||
}
|
||||
function spanx(tag, color) {
|
||||
return "."+tag+" { font-family:"+fontFace+"; font-size:"+fontSize+"px; color:"+color+"; }\n";
|
||||
}
|
||||
|
||||
function a1(tag) {
|
||||
return "<a class='"+tag+"' href=";
|
||||
}
|
||||
|
||||
function ax(tag, color) {
|
||||
return "."+tag+" { text-decoration:none; color:"+color+"; }\n";
|
||||
}
|
||||
|
||||
function calOBJ(name, title, field, form) {
|
||||
this.name = name;
|
||||
this.title = title;
|
||||
this.field = field;
|
||||
this.formName = form;
|
||||
this.form = null
|
||||
}
|
||||
|
||||
function setFont(font, size) {
|
||||
if (font != "") {
|
||||
fontFace=font;
|
||||
}
|
||||
if (size > 0) {
|
||||
fontSize=size;
|
||||
|
||||
if (isN4) {
|
||||
fontSize+=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setWidth(tWidth, tMode, dWidth, dDigits) {
|
||||
if (tWidth > 0) {
|
||||
titleWidth=tWidth;
|
||||
}
|
||||
if (tMode == 1 || tMode == 2) {
|
||||
titleMode=tMode;
|
||||
}
|
||||
if (dWidth > 0) {
|
||||
dayWidth=dWidth;
|
||||
}
|
||||
if (dDigits > 0) {
|
||||
dayDigits=dDigits;
|
||||
}
|
||||
}
|
||||
|
||||
function setColor(tColor, dsColor, bColor, dColor, cdColor, fColor, bdColor) {
|
||||
if (tColor != "") {
|
||||
titleColor=tColor;
|
||||
}
|
||||
if (dsColor != "") {
|
||||
daysColor=dsColor;
|
||||
}
|
||||
if (bColor != "") {
|
||||
bodyColor=bColor;
|
||||
}
|
||||
if (dColor != "") {
|
||||
dayColor=dColor;
|
||||
}
|
||||
if (cdColor != "") {
|
||||
currentDayColor=cdColor;
|
||||
}
|
||||
if (fColor != "") {
|
||||
footColor=fColor;
|
||||
}
|
||||
if (bdColor != "") {
|
||||
borderColor=bdColor;
|
||||
}
|
||||
}
|
||||
|
||||
function setFontColor(tColorFont, dsColorFont, dColorFont, cdColorFont, fColorFont) {
|
||||
if (tColorFont != "") {
|
||||
titleFontColor=tColorFont;
|
||||
}
|
||||
if (dsColorFont != "") {
|
||||
daysFontColor=dsColorFont;
|
||||
}
|
||||
if (dColorFont != "") {
|
||||
dayFontColor=dColorFont;
|
||||
}
|
||||
if (cdColorFont != "") {
|
||||
currentDayFontColor=cdColorFont;
|
||||
}
|
||||
if (fColorFont != "") {
|
||||
footFontColor=fColorFont;
|
||||
}
|
||||
}
|
||||
|
||||
function setFormat(format) {
|
||||
calFormat = format;
|
||||
}
|
||||
|
||||
function setSize(width, height, ox, oy) {
|
||||
if (width > 0) {
|
||||
calWidth=width;
|
||||
}
|
||||
if (height > 0) {
|
||||
calHeight=height;
|
||||
}
|
||||
|
||||
calOffsetX=ox;
|
||||
calOffsetY=oy;
|
||||
}
|
||||
|
||||
function setWeekDay(wDay) {
|
||||
if (wDay == 0 || wDay == 1) {
|
||||
weekDay = wDay;
|
||||
}
|
||||
}
|
||||
|
||||
function setMonthNames(janName, febName, marName, aprName, mayName, junName, julName, augName, sepName, octName, novName, decName) {
|
||||
if (janName != "") {
|
||||
yxMonths[0] = janName;
|
||||
}
|
||||
if (febName != "") {
|
||||
yxMonths[1] = febName;
|
||||
}
|
||||
if (marName != "") {
|
||||
yxMonths[2] = marName;
|
||||
}
|
||||
if (aprName != "") {
|
||||
yxMonths[3] = aprName;
|
||||
}
|
||||
if (mayName != "") {
|
||||
yxMonths[4] = mayName;
|
||||
}
|
||||
if (junName != "") {
|
||||
yxMonths[5] = junName;
|
||||
}
|
||||
if (julName != "") {
|
||||
yxMonths[6] = julName;
|
||||
}
|
||||
if (augName != "") {
|
||||
yxMonths[7] = augName;
|
||||
}
|
||||
if (sepName != "") {
|
||||
yxMonths[8] = sepName;
|
||||
}
|
||||
if (octName != "") {
|
||||
yxMonths[9] = octName;
|
||||
}
|
||||
if (novName != "") {
|
||||
yxMonths[10] = novName;
|
||||
}
|
||||
if (decName != "") {
|
||||
yxMonths[11] = decName;
|
||||
}
|
||||
}
|
||||
|
||||
function setDayNames(sunName, monName, tueName, wedName, thuName, friName, satName) {
|
||||
if (sunName != "") {
|
||||
yxDays[0] = sunName;
|
||||
yxDays[7] = sunName;
|
||||
}
|
||||
if (monName != "") {
|
||||
yxDays[1] = monName;
|
||||
}
|
||||
if (tueName != "") {
|
||||
yxDays[2] = tueName;
|
||||
}
|
||||
if (wedName != "") {
|
||||
yxDays[3] = wedName;
|
||||
}
|
||||
if (thuName != "") {
|
||||
yxDays[4] = thuName;
|
||||
}
|
||||
if (friName != "") {
|
||||
yxDays[5] = friName;
|
||||
}
|
||||
if (satName != "") {
|
||||
yxDays[6] = satName;
|
||||
}
|
||||
}
|
||||
|
||||
function setLinkNames(closeLink, clearLink) {
|
||||
if (closeLink != "") {
|
||||
yxLinks[0] = closeLink;
|
||||
}
|
||||
if (clearLink != "") {
|
||||
yxLinks[1] = clearLink;
|
||||
}
|
||||
}
|
||||
|
||||
function addCalendar(name, title, field, form) {
|
||||
cals[cals.length] = new calOBJ(name, title, field, form);
|
||||
}
|
||||
|
||||
function findCalendar(name) {
|
||||
for (var i = 0; i < cals.length; i++) {
|
||||
if (cals[i].name == name) {
|
||||
if (cals[i].form == null) {
|
||||
if (cals[i].formName == "") {
|
||||
if (document.forms[0]) {
|
||||
cals[i].form = document.forms[0];
|
||||
}
|
||||
}
|
||||
else if (document.forms[cals[i].formName]) {
|
||||
cals[i].form = document.forms[cals[i].formName];
|
||||
}
|
||||
}
|
||||
|
||||
return cals[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getDayName(y,m,d) {
|
||||
var wd=new Date(y,m,d);
|
||||
return yxDays[wd.getDay()].substring(0,3);
|
||||
}
|
||||
|
||||
function getMonthFromName(m3) {
|
||||
for (var i = 0; i < yxMonths.length; i++) {
|
||||
if (yxMonths[i].toLowerCase().substring(0,3) == m3.toLowerCase()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getFormat() {
|
||||
var calF = calFormat;
|
||||
|
||||
calF = calF.replace(/\\/g, '\\\\');
|
||||
calF = calF.replace(/\//g, '\\\/');
|
||||
calF = calF.replace(/\[/g, '\\\[');
|
||||
calF = calF.replace(/\]/g, '\\\]');
|
||||
calF = calF.replace(/\(/g, '\\\(');
|
||||
calF = calF.replace(/\)/g, '\\\)');
|
||||
calF = calF.replace(/\{/g, '\\\{');
|
||||
calF = calF.replace(/\}/g, '\\\}');
|
||||
calF = calF.replace(/\</g, '\\\<');
|
||||
calF = calF.replace(/\>/g, '\\\>');
|
||||
calF = calF.replace(/\|/g, '\\\|');
|
||||
calF = calF.replace(/\*/g, '\\\*');
|
||||
calF = calF.replace(/\?/g, '\\\?');
|
||||
calF = calF.replace(/\+/g, '\\\+');
|
||||
calF = calF.replace(/\^/g, '\\\^');
|
||||
calF = calF.replace(/\$/g, '\\\$');
|
||||
|
||||
calF = calF.replace(/dd/i, '\\d\\d');
|
||||
calF = calF.replace(/mm/i, '\\d\\d');
|
||||
calF = calF.replace(/yyyy/i, '\\d\\d\\d\\d');
|
||||
calF = calF.replace(/day/i, '\\w\\w\\w');
|
||||
calF = calF.replace(/mon/i, '\\w\\w\\w');
|
||||
|
||||
return new RegExp(calF);
|
||||
}
|
||||
|
||||
function getDateNumbers(date) {
|
||||
var y, m, d;
|
||||
|
||||
var yIdx = calFormat.search(/yyyy/i);
|
||||
var mIdx = calFormat.search(/mm/i);
|
||||
var m3Idx = calFormat.search(/mon/i);
|
||||
var dIdx = calFormat.search(/dd/i);
|
||||
|
||||
y=date.substring(yIdx,yIdx+4)-0;
|
||||
if (mIdx != -1) {
|
||||
m=date.substring(mIdx,mIdx+2)-1;
|
||||
}
|
||||
else {
|
||||
var m = getMonthFromName(date.substring(m3Idx,m3Idx+3));
|
||||
}
|
||||
d=date.substring(dIdx,dIdx+2)-0;
|
||||
|
||||
return new Array(y,m,d);
|
||||
}
|
||||
|
||||
function hideCal() {
|
||||
calWin.close();
|
||||
calWin = null;
|
||||
window.status = "";
|
||||
}
|
||||
|
||||
function getLeftIE(x,m) {
|
||||
var dx=0;
|
||||
if (x.tagName=="TD"){
|
||||
dx=x.offsetLeft;
|
||||
}
|
||||
else if (x.tagName=="TABLE") {
|
||||
dx=x.offsetLeft;
|
||||
if (m) { dx+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
|
||||
}
|
||||
return dx+(x.parentElement.tagName=="BODY"?0:getLeftIE(x.parentElement,m));
|
||||
}
|
||||
function getTopIE(x,m) {
|
||||
var dy=0;
|
||||
if (x.tagName=="TR"){
|
||||
dy=x.offsetTop;
|
||||
}
|
||||
else if (x.tagName=="TABLE") {
|
||||
dy=x.offsetTop;
|
||||
if (m) { dy+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
|
||||
}
|
||||
return dy+(x.parentElement.tagName=="BODY"?0:getTopIE(x.parentElement,m));
|
||||
}
|
||||
|
||||
function getLeftN4(l) { return l.pageX; }
|
||||
function getTopN4(l) { return l.pageY; }
|
||||
|
||||
function getLeftN6(l) { return l.offsetLeft; }
|
||||
function getTopN6(l) { return l.offsetTop; }
|
||||
|
||||
function lastDay(d) {
|
||||
var yy=d.getFullYear(), mm=d.getMonth();
|
||||
for (var i=31; i>=28; i--) {
|
||||
var nd=new Date(yy,mm,i);
|
||||
if (mm == nd.getMonth()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function firstDay(d) {
|
||||
var yy=d.getFullYear(), mm=d.getMonth();
|
||||
var fd=new Date(yy,mm,1);
|
||||
return fd.getDay();
|
||||
}
|
||||
|
||||
function dayDisplay(i) {
|
||||
if (dayDigits == 0) {
|
||||
return yxDays[i];
|
||||
}
|
||||
else {
|
||||
return yxDays[i].substring(0,dayDigits);
|
||||
}
|
||||
}
|
||||
|
||||
function calTitle(d) {
|
||||
var yy=d.getFullYear(), mm=yxMonths[d.getMonth()];
|
||||
var s;
|
||||
|
||||
if (titleMode == 2) {
|
||||
s="<tr align='center' bgcolor='"+titleColor+"'><td colspan='7'>\n<table cellpadding='0' cellspacing='0' border='0'><tr align='center' valign='middle'><td align='right'>"+span1("title")+"<b>"+a1("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear) window.opener.moveYear(-10)'> «</a> "+a1("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear) window.opener.moveYear(-1)'>‹ </a></b>"+span2+"</td><td width='"+titleWidth+"'><b>"+span1("title")+yy+span2+"</b></td><td align='left'>"+span1("title")+"<b>"+a1("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.moveYear) window.opener.moveYear(1)'> ›</a> "+a1("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.moveYear) window.opener.moveYear(10)'>» </a></b>"+span2+"</td></tr><tr align='center' valign='middle'><td align='right'>"+span1("title")+"<b>"+a1("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.prepMonth) window.opener.prepMonth("+d.getMonth()+")'> ‹ </a></b>"+span2+"</td><td width='"+titleWidth+"'><b>"+span1("title")+mm+span2+"</b></td><td align='left'>"+span1("title")+"<b>"+a1("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.nextMonth) window.opener.nextMonth("+d.getMonth()+")'> › </a></b>"+span2+"</td></tr></table>\n</td></tr><tr align='center' bgcolor='"+daysColor+"'>";
|
||||
}
|
||||
else {
|
||||
s="<tr align='center' bgcolor='"+titleColor+"'><td colspan='7'>\n<table cellpadding='0' cellspacing='0' border='0'><tr align='center' valign='middle'><td>"+span1("title")+"<b>"+a1("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear) window.opener.moveYear(-1)'> «</a> "+a1("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.prepMonth) window.opener.prepMonth("+d.getMonth()+")'>‹ </a></b>"+span2+"</td><td width='"+titleWidth+"'><nobr><b>"+span1("title")+mm+" "+yy+span2+"</b></nobr></td><td>"+span1("title")+"<b>"+a1("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.nextMonth) window.opener.nextMonth("+d.getMonth()+")'> ›</a> "+a1("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear) window.opener.moveYear(1)'>» </a></b>"+span2+"</td></tr></table>\n</td></tr><tr align='center' bgcolor='"+daysColor+"'>";
|
||||
}
|
||||
|
||||
for (var i=weekDay; i<weekDay+7; i++) {
|
||||
s+="<td width='"+dayWidth+"'>"+span1("days")+dayDisplay(i)+span2+"</td>";
|
||||
}
|
||||
|
||||
s+="</tr>";
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function calHeader() {
|
||||
return "<head>\n<title>"+currentCal.title+"</title>\n<style type='text/css'>\n"+spanx("title",titleFontColor)+spanx("days",daysFontColor)+spanx("foot",footColor)+spanx("day",dayFontColor)+spanx("currentDay",currentDayFontColor)+ax("titlea",titleFontColor)+ax("daya",dayFontColor)+ax("currenta",currentDayFontColor)+ax("foota",footFontColor)+"</style>\n</head>\n<body>\n<table align='center' border='0' bgcolor='"+borderColor+"' cellspacing='0' cellpadding='1'><tr><td>\n<table cellspacing='1' cellpadding='3' border='0'>";
|
||||
}
|
||||
|
||||
function calFooter() {
|
||||
return "<tr bgcolor='"+footColor+"'><td colspan='7' align='center'>"+span1("foot")+"<b>"+a1("foota")+"'javascript:if (window.opener && !window.opener.closed && window.opener.hideCal) window.opener.hideCal()'>"+yxLinks[0]+"</a> "+a1("foota")+"'javascript:if (window.opener && !window.opener.closed && window.opener.clearDate) window.opener.clearDate()'>"+yxLinks[1]+"</a></b>"+span2+"</td></tr></table>\n</td></tr></table>\n</body>";
|
||||
}
|
||||
|
||||
function calBody(d,day) {
|
||||
var s="", dayCount=1, fd=firstDay(d), ld=lastDay(d);
|
||||
|
||||
if (weekDay > 0 && fd == 0) {
|
||||
fd = 7;
|
||||
}
|
||||
|
||||
for (var i=0; i<6; i++) {
|
||||
s+="<tr align='center' bgcolor='"+bodyColor+"'>";
|
||||
for (var j=weekDay; j<weekDay+7; j++) {
|
||||
if (i*7+j<fd || dayCount>ld) {
|
||||
s+="<td>"+span1("day")+" "+span2+"</td>";
|
||||
}
|
||||
else {
|
||||
var bgColor=dayColor;
|
||||
var fgTag="day";
|
||||
var fgTagA="daya";
|
||||
if (dayCount==day) {
|
||||
bgColor=currentDayColor;
|
||||
fgTag="currentDay";
|
||||
fgTagA="currenta";
|
||||
}
|
||||
|
||||
s+="<td bgcolor='"+bgColor+"'>"+span1(fgTag)+a1(fgTagA)+"'javascript: if (window.opener && !window.opener.closed && window.opener.pickDate) window.opener.pickDate("+dayCount+")'>"+(dayCount++)+"</a>"+span2+"</td>";
|
||||
}
|
||||
}
|
||||
s+="</tr>";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function moveYear(dy) {
|
||||
cY+=dy;
|
||||
var nd=new Date(cY,cM,1);
|
||||
changeCal(nd);
|
||||
}
|
||||
|
||||
function prepMonth(m) {
|
||||
cM=m-1;
|
||||
if (cM<0) { cM=11; cY--; }
|
||||
var nd=new Date(cY,cM,1);
|
||||
changeCal(nd);
|
||||
}
|
||||
|
||||
function nextMonth(m) {
|
||||
cM=m+1;
|
||||
if (cM>11) { cM=0; cY++;}
|
||||
var nd=new Date(cY,cM,1);
|
||||
changeCal(nd);
|
||||
}
|
||||
|
||||
function changeCal(d) {
|
||||
var dd = 0;
|
||||
|
||||
if (currentCal != null) {
|
||||
var calRE = getFormat();
|
||||
|
||||
if (currentCal.form[currentCal.field].value!="" && calRE.test(currentCal.form[currentCal.field].value)) {
|
||||
var cd = getDateNumbers(currentCal.form[currentCal.field].value);
|
||||
if (cd[0] == d.getFullYear() && cd[1] == d.getMonth()) {
|
||||
dd=cd[2];
|
||||
}
|
||||
}
|
||||
else {
|
||||
var cd = new Date();
|
||||
if (cd.getFullYear() == d.getFullYear() && cd.getMonth() == d.getMonth()) {
|
||||
dd=cd.getDate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var calendar=calHeader()+calTitle(d)+calBody(d,dd)+calFooter();
|
||||
|
||||
calWin.document.open();
|
||||
calWin.document.write(calendar);
|
||||
calWin.document.close();
|
||||
}
|
||||
|
||||
function markClick(e) {
|
||||
if (isIE || isOpera6) {
|
||||
winX=event.screenX;
|
||||
winY=event.screenY;
|
||||
}
|
||||
else if (isN4 || isN6) {
|
||||
winX=e.screenX;
|
||||
winY=e.screenY;
|
||||
|
||||
document.routeEvent(e);
|
||||
}
|
||||
|
||||
if (isN4 || isN6) {
|
||||
document.routeEvent(e);
|
||||
}
|
||||
else {
|
||||
event.cancelBubble=false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function showCal(name) {
|
||||
var lastCal=currentCal;
|
||||
var d=new Date(), hasCal=false;
|
||||
|
||||
currentCal = findCalendar(name);
|
||||
|
||||
if (currentCal != null && currentCal.form != null && currentCal.form[currentCal.field]) {
|
||||
var calRE = getFormat();
|
||||
|
||||
if (currentCal.form[currentCal.field].value!="" && calRE.test(currentCal.form[currentCal.field].value)) {
|
||||
var cd = getDateNumbers(currentCal.form[currentCal.field].value);
|
||||
d=new Date(cd[0],cd[1],cd[2]);
|
||||
|
||||
cY=cd[0];
|
||||
cM=cd[1];
|
||||
dd=cd[2];
|
||||
}
|
||||
else {
|
||||
cY=d.getFullYear();
|
||||
cM=d.getMonth();
|
||||
dd=d.getDate();
|
||||
}
|
||||
|
||||
var calendar=calHeader()+calTitle(d)+calBody(d,dd)+calFooter();
|
||||
|
||||
if (calWin != null && typeof(calWin.closed)!="undefined" && !calWin.closed) {
|
||||
hasCal=true;
|
||||
calWin.moveTo(winX+calOffsetX,winY+calOffsetY);
|
||||
}
|
||||
|
||||
if (!hasCal) {
|
||||
if (isIE || isOpera6) {
|
||||
calWin=window.open("","cal","toolbar=0,width="+calWidth+",height="+calHeight+",left="+(winX+calOffsetX)+",top="+(winY+calOffsetY));
|
||||
}
|
||||
else {
|
||||
calWin=window.open("","cal","toolbar=0,width="+calWidth+",height="+calHeight+",screenx="+(winX+calOffsetX)+",screeny="+(winY+calOffsetY));
|
||||
}
|
||||
}
|
||||
|
||||
calWin.document.open();
|
||||
calWin.document.write(calendar);
|
||||
calWin.document.close();
|
||||
|
||||
calWin.focus();
|
||||
}
|
||||
else {
|
||||
if (currentCal == null) {
|
||||
window.status = "Calendar ["+name+"] not found.";
|
||||
}
|
||||
else if (!currentCal.form) {
|
||||
window.status = "Form ["+currentCal.formName+"] not found.";
|
||||
}
|
||||
else if (!currentCal.form[currentCal.field]) {
|
||||
window.status = "Form Field ["+currentCal.formName+"."+currentCal.field+"] not found.";
|
||||
}
|
||||
|
||||
if (lastCal != null) {
|
||||
currentCal = lastCal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get2Digits(n) {
|
||||
return ((n<10)?"0":"")+n;
|
||||
}
|
||||
|
||||
function clearDate() {
|
||||
currentCal.form[currentCal.field].value="";
|
||||
hideCal();
|
||||
}
|
||||
|
||||
function pickDate(d) {
|
||||
hideCal();
|
||||
window.focus();
|
||||
|
||||
var date=calFormat;
|
||||
date = date.replace(/yyyy/i, cY);
|
||||
date = date.replace(/mm/i, get2Digits(cM+1));
|
||||
date = date.replace(/MON/, yxMonths[cM].substring(0,3).toUpperCase());
|
||||
date = date.replace(/Mon/i, yxMonths[cM].substring(0,3));
|
||||
date = date.replace(/dd/i, get2Digits(d));
|
||||
date = date.replace(/DAY/, getDayName(cY,cM,d).toUpperCase());
|
||||
date = date.replace(/day/i, getDayName(cY,cM,d));
|
||||
|
||||
currentCal.form[currentCal.field].value=date;
|
||||
// IE5/Mac needs focus to show the value, weird.
|
||||
currentCal.form[currentCal.field].focus();
|
||||
}
|
||||
// ------
|
||||
|
||||
// user functions
|
||||
function checkDate(name) {
|
||||
var thisCal = findCalendar(name);
|
||||
|
||||
if (thisCal != null && thisCal.form != null && thisCal.form[thisCal.field]) {
|
||||
var calRE = getFormat();
|
||||
|
||||
if (calRE.test(thisCal.form[thisCal.field].value)) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentDate() {
|
||||
var date=calFormat, d = new Date();
|
||||
date = date.replace(/dd/i, get2Digits(d.getDate()));
|
||||
date = date.replace(/mm/i, get2Digits(d.getMonth()+1));
|
||||
date = date.replace(/yyyy/i, d.getFullYear());
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
function compareDates(date1, date2) {
|
||||
var calRE = getFormat();
|
||||
var d1, d2;
|
||||
|
||||
if (calRE.test(date1)) {
|
||||
d1 = getNumbers(date1);
|
||||
}
|
||||
else {
|
||||
d1 = getNumbers(getCurrentDate());
|
||||
}
|
||||
|
||||
if (calRE.test(date2)) {
|
||||
d2 = getNumbers(date2);
|
||||
}
|
||||
else {
|
||||
d2 = getNumbers(getCurrentDate());
|
||||
}
|
||||
|
||||
var dStr1 = d1[0] + "" + d1[1] + "" + d1[2];
|
||||
var dStr2 = d2[0] + "" + d2[1] + "" + d2[2];
|
||||
|
||||
if (dStr1 == dStr2) {
|
||||
return 0;
|
||||
}
|
||||
else if (dStr1 > dStr2) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
function getNumbers(date) {
|
||||
var calRE = getFormat();
|
||||
var y, m, d;
|
||||
|
||||
if (calRE.test(date)) {
|
||||
var yIdx = calFormat.search(/yyyy/i);
|
||||
var mIdx = calFormat.search(/mm/i);
|
||||
var m3Idx = calFormat.search(/mon/i);
|
||||
var dIdx = calFormat.search(/dd/i);
|
||||
|
||||
y=date.substring(yIdx,yIdx+4);
|
||||
if (mIdx != -1) {
|
||||
m=date.substring(mIdx,mIdx+2);
|
||||
}
|
||||
else {
|
||||
var mm=getMonthFromName(date.substring(m3Idx,m3Idx+3))+1;
|
||||
m=(mm<10)?("0"+mm):(""+mm);
|
||||
}
|
||||
d=date.substring(dIdx,dIdx+2);
|
||||
|
||||
return new Array(y,m,d);
|
||||
}
|
||||
else {
|
||||
return new Array("", "", "");
|
||||
}
|
||||
}
|
||||
// ------
|
||||
|
||||
if (isN4 || isN6) {
|
||||
document.captureEvents(Event.CLICK);
|
||||
}
|
||||
document.onclick=markClick;
|
||||
+739
@@ -0,0 +1,739 @@
|
||||
// +------------------------------------------------------------+
|
||||
// | Popup Calendar(Window) |
|
||||
// +------------------------------------------------------------+
|
||||
// | Last Modified: 22-Dec-2005 |
|
||||
// | Web Site: http://www.yxscripts.com |
|
||||
// | EMail: m_yangxin@hotmail.com |
|
||||
// +------------------------------------------------------------+
|
||||
// | Copyright 2002 Xin Yang All Rights Reserved. |
|
||||
// | This version featured on Dynamic Drive |
|
||||
// | (http://www.dynamicdrive.com) |
|
||||
// +------------------------------------------------------------+
|
||||
|
||||
// default settings
|
||||
var fontFace1="verdana";
|
||||
var fontSize1=9;
|
||||
|
||||
var titleWidth1=90;
|
||||
var titleMode1=1;
|
||||
var dayWidth1=12;
|
||||
var dayDigits1=1;
|
||||
|
||||
var titleColor1="#cccccc";
|
||||
var daysColor1="#cccccc";
|
||||
var bodyColor1="#ffffff";
|
||||
var dayColor1="#ffffff";
|
||||
var currentdayColor1="#333333";
|
||||
var footColor1="#cccccc";
|
||||
var borderColor1="#333333";
|
||||
|
||||
var titleFontColor1 = "#333333";
|
||||
var daysFontColor1 = "#333333";
|
||||
var dayFontColor1 = "#333333";
|
||||
var currentdayFontColor1 = "#ffffff";
|
||||
var footFontColor1 = "#333333";
|
||||
|
||||
var calFormat1 = "dd/mm/yyyy";
|
||||
|
||||
var weekDay1 = 0;
|
||||
// ------
|
||||
|
||||
// codes
|
||||
var calWidth1=200, calHeight1=200, calOffsetX1=-200, calOffsetY1=16;
|
||||
var calWin1=null;
|
||||
var winX1=0, winY1=0;
|
||||
var cal1="cal";
|
||||
var cals1=new Array();
|
||||
var currentCal1=null;
|
||||
|
||||
var yxMonths1=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
|
||||
var yxDays1=new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
|
||||
var yxLinks1=new Array("[close]", "[clear]");
|
||||
|
||||
var nav1=navigator.userAgent.toLowerCase();;
|
||||
var isOpera1=(nav1.indexOf("opera")!=-1)?true:false;
|
||||
var isOpera51=(nav1.indexOf("opera 5")!=-1 || nav1.indexOf("opera/5")!=-1)?true:false;
|
||||
var isOpera61=(isOpera1 && parseInt(navigator.appVersion)>=6)?true:false;
|
||||
var isN61=(nav1.indexOf("gecko")!=-1);
|
||||
var isN41=(document.layers)?true:false;
|
||||
var isMac1=(nav1.indexOf("mac")!=-1);
|
||||
var isIE1=(document.all && !isOpera1 && (!isMac1 || navigator.appVersion.indexOf("MSIE 4")==-1))?true:false;
|
||||
|
||||
if (isN41) {
|
||||
fontSize1+=2;
|
||||
}
|
||||
|
||||
var span21="</span>";
|
||||
|
||||
function span1(tag) {
|
||||
return "<span class='"+tag+"'>";
|
||||
}
|
||||
function spanx1(tag, color) {
|
||||
return "."+tag+" { font-family:"+fontFace1+"; font-size:"+fontSize1+"px; color:"+color+"; }\n";
|
||||
}
|
||||
|
||||
function a11(tag) {
|
||||
return "<a class='"+tag+"' href=";
|
||||
}
|
||||
|
||||
function ax1(tag, color) {
|
||||
return "."+tag+" { text-decoration:none; color:"+color+"; }\n";
|
||||
}
|
||||
|
||||
function calOBJ1(name, title, field, form) {
|
||||
this.name = name;
|
||||
this.title = title;
|
||||
this.field = field;
|
||||
this.formName = form;
|
||||
this.form = null
|
||||
}
|
||||
|
||||
function setFont1(font, size) {
|
||||
if (font != "") {
|
||||
fontFace1=font;
|
||||
}
|
||||
if (size > 0) {
|
||||
fontSize1=size;
|
||||
|
||||
if (isN41) {
|
||||
fontSize1+=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setWidth1(tWidth, tMode, dWidth, dDigits) {
|
||||
if (tWidth > 0) {
|
||||
titleWidth1=tWidth;
|
||||
}
|
||||
if (tMode == 1 || tMode == 2) {
|
||||
titleMode1=tMode;
|
||||
}
|
||||
if (dWidth > 0) {
|
||||
dayWidth1=dWidth;
|
||||
}
|
||||
if (dDigits > 0) {
|
||||
dayDigits1=dDigits;
|
||||
}
|
||||
}
|
||||
|
||||
function setColor1(tColor, dsColor, bColor, dColor, cdColor, fColor, bdColor) {
|
||||
if (tColor != "") {
|
||||
titleColor1=tColor;
|
||||
}
|
||||
if (dsColor != "") {
|
||||
daysColor1=dsColor;
|
||||
}
|
||||
if (bColor != "") {
|
||||
bodyColor1=bColor;
|
||||
}
|
||||
if (dColor != "") {
|
||||
dayColor1=dColor;
|
||||
}
|
||||
if (cdColor != "") {
|
||||
currentdayColor1=cdColor;
|
||||
}
|
||||
if (fColor != "") {
|
||||
footColor1=fColor;
|
||||
}
|
||||
if (bdColor != "") {
|
||||
borderColor1=bdColor;
|
||||
}
|
||||
}
|
||||
|
||||
function setFontColor1(tColorFont, dsColorFont, dColorFont, cdColorFont, fColorFont) {
|
||||
if (tColorFont != "") {
|
||||
titleFontColor1=tColorFont;
|
||||
}
|
||||
if (dsColorFont != "") {
|
||||
daysFontColor1=dsColorFont;
|
||||
}
|
||||
if (dColorFont != "") {
|
||||
dayFontColor1=dColorFont;
|
||||
}
|
||||
if (cdColorFont != "") {
|
||||
currentdayFontColor1=cdColorFont;
|
||||
}
|
||||
if (fColorFont != "") {
|
||||
footFontColor1=fColorFont;
|
||||
}
|
||||
}
|
||||
|
||||
function setFormat1(format) {
|
||||
calFormat1 = format;
|
||||
}
|
||||
|
||||
function setSize1(width, height, ox, oy) {
|
||||
if (width > 0) {
|
||||
calWidth1=width;
|
||||
}
|
||||
if (height > 0) {
|
||||
calHeight1=height;
|
||||
}
|
||||
|
||||
calOffsetX1=ox;
|
||||
calOffsetY1=oy;
|
||||
}
|
||||
|
||||
function setweekDay1(wDay) {
|
||||
if (wDay == 0 || wDay == 1) {
|
||||
weekDay1 = wDay;
|
||||
}
|
||||
}
|
||||
|
||||
function setMonthNames1(janName, febName, marName, aprName, mayName, junName, julName, augName, sepName, octName, novName, decName) {
|
||||
if (janName != "") {
|
||||
yxMonths1[0] = janName;
|
||||
}
|
||||
if (febName != "") {
|
||||
yxMonths1[1] = febName;
|
||||
}
|
||||
if (marName != "") {
|
||||
yxMonths1[2] = marName;
|
||||
}
|
||||
if (aprName != "") {
|
||||
yxMonths1[3] = aprName;
|
||||
}
|
||||
if (mayName != "") {
|
||||
yxMonths1[4] = mayName;
|
||||
}
|
||||
if (junName != "") {
|
||||
yxMonths1[5] = junName;
|
||||
}
|
||||
if (julName != "") {
|
||||
yxMonths1[6] = julName;
|
||||
}
|
||||
if (augName != "") {
|
||||
yxMonths1[7] = augName;
|
||||
}
|
||||
if (sepName != "") {
|
||||
yxMonths1[8] = sepName;
|
||||
}
|
||||
if (octName != "") {
|
||||
yxMonths1[9] = octName;
|
||||
}
|
||||
if (novName != "") {
|
||||
yxMonths1[10] = novName;
|
||||
}
|
||||
if (decName != "") {
|
||||
yxMonths1[11] = decName;
|
||||
}
|
||||
}
|
||||
|
||||
function setDayNames1(sunName, monName, tueName, wedName, thuName, friName, satName) {
|
||||
if (sunName != "") {
|
||||
yxDays1[0] = sunName;
|
||||
yxDays1[7] = sunName;
|
||||
}
|
||||
if (monName != "") {
|
||||
yxDays1[1] = monName;
|
||||
}
|
||||
if (tueName != "") {
|
||||
yxDays1[2] = tueName;
|
||||
}
|
||||
if (wedName != "") {
|
||||
yxDays1[3] = wedName;
|
||||
}
|
||||
if (thuName != "") {
|
||||
yxDays1[4] = thuName;
|
||||
}
|
||||
if (friName != "") {
|
||||
yxDays1[5] = friName;
|
||||
}
|
||||
if (satName != "") {
|
||||
yxDays1[6] = satName;
|
||||
}
|
||||
}
|
||||
|
||||
function setLinkNames1(closeLink, clearLink) {
|
||||
if (closeLink != "") {
|
||||
yxLinks1[0] = closeLink;
|
||||
}
|
||||
if (clearLink != "") {
|
||||
yxLinks1[1] = clearLink;
|
||||
}
|
||||
}
|
||||
|
||||
function addCalendar1(name, title, field, form) {
|
||||
cals1[cals1.length] = new calOBJ1(name, title, field, form);
|
||||
}
|
||||
|
||||
function findCalendar1(name) {
|
||||
for (var i = 0; i < cals1.length; i++) {
|
||||
if (cals1[i].name == name) {
|
||||
if (cals1[i].form == null) {
|
||||
if (cals1[i].formName == "") {
|
||||
if (document.forms[0]) {
|
||||
cals1[i].form = document.forms[0];
|
||||
}
|
||||
}
|
||||
else if (document.forms[cals1[i].formName]) {
|
||||
cals1[i].form = document.forms[cals1[i].formName];
|
||||
}
|
||||
}
|
||||
|
||||
return cals1[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getDayName1(y,m,d) {
|
||||
var wd=new Date(y,m,d);
|
||||
return yxDays1[wd.getDay()].substring(0,3);
|
||||
}
|
||||
|
||||
function getMonthFromName1(m3) {
|
||||
for (var i = 0; i < yxMonths1.length; i++) {
|
||||
if (yxMonths1[i].toLowerCase().substring(0,3) == m3.toLowerCase()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getFormat1() {
|
||||
var calF = calFormat1;
|
||||
|
||||
calF = calF.replace(/\\/g, '\\\\');
|
||||
calF = calF.replace(/\//g, '\\\/');
|
||||
calF = calF.replace(/\[/g, '\\\[');
|
||||
calF = calF.replace(/\]/g, '\\\]');
|
||||
calF = calF.replace(/\(/g, '\\\(');
|
||||
calF = calF.replace(/\)/g, '\\\)');
|
||||
calF = calF.replace(/\{/g, '\\\{');
|
||||
calF = calF.replace(/\}/g, '\\\}');
|
||||
calF = calF.replace(/\</g, '\\\<');
|
||||
calF = calF.replace(/\>/g, '\\\>');
|
||||
calF = calF.replace(/\|/g, '\\\|');
|
||||
calF = calF.replace(/\*/g, '\\\*');
|
||||
calF = calF.replace(/\?/g, '\\\?');
|
||||
calF = calF.replace(/\+/g, '\\\+');
|
||||
calF = calF.replace(/\^/g, '\\\^');
|
||||
calF = calF.replace(/\$/g, '\\\$');
|
||||
|
||||
calF = calF.replace(/dd/i, '\\d\\d');
|
||||
calF = calF.replace(/mm/i, '\\d\\d');
|
||||
calF = calF.replace(/yyyy/i, '\\d\\d\\d\\d');
|
||||
calF = calF.replace(/day/i, '\\w\\w\\w');
|
||||
calF = calF.replace(/mon/i, '\\w\\w\\w');
|
||||
|
||||
return new RegExp(calF);
|
||||
}
|
||||
|
||||
function getDateNumbers1(date) {
|
||||
var y, m, d;
|
||||
|
||||
var yIdx = calFormat1.search(/yyyy/i);
|
||||
var mIdx = calFormat1.search(/mm/i);
|
||||
var m3Idx = calFormat1.search(/mon/i);
|
||||
var dIdx = calFormat1.search(/dd/i);
|
||||
|
||||
y=date.substring(yIdx,yIdx+4)-0;
|
||||
if (mIdx != -1) {
|
||||
m=date.substring(mIdx,mIdx+2)-1;
|
||||
}
|
||||
else {
|
||||
var m = getMonthFromName1(date.substring(m3Idx,m3Idx+3));
|
||||
}
|
||||
d=date.substring(dIdx,dIdx+2)-0;
|
||||
|
||||
return new Array(y,m,d);
|
||||
}
|
||||
|
||||
function hideCal1() {
|
||||
calWin1.close();
|
||||
calWin1 = null;
|
||||
window.status = "";
|
||||
}
|
||||
|
||||
function getLeftIE1(x,m) {
|
||||
var dx=0;
|
||||
if (x.tagName=="TD"){
|
||||
dx=x.offsetLeft;
|
||||
}
|
||||
else if (x.tagName=="TABLE") {
|
||||
dx=x.offsetLeft;
|
||||
if (m) { dx+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
|
||||
}
|
||||
return dx+(x.parentElement.tagName=="BODY"?0:getLeftIE1(x.parentElement,m));
|
||||
}
|
||||
function getTopIE1(x,m) {
|
||||
var dy=0;
|
||||
if (x.tagName=="TR"){
|
||||
dy=x.offsetTop;
|
||||
}
|
||||
else if (x.tagName=="TABLE") {
|
||||
dy=x.offsetTop;
|
||||
if (m) { dy+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
|
||||
}
|
||||
return dy+(x.parentElement.tagName=="BODY"?0:getTopIE1(x.parentElement,m));
|
||||
}
|
||||
|
||||
function getLeftN41(l) { return l.pageX; }
|
||||
function getTopN41(l) { return l.pageY; }
|
||||
|
||||
function getLeftN61(l) { return l.offsetLeft; }
|
||||
function getTopN61(l) { return l.offsetTop; }
|
||||
|
||||
function lastDay1(d) {
|
||||
var yy=d.getFullYear(), mm=d.getMonth();
|
||||
for (var i=31; i>=28; i--) {
|
||||
var nd=new Date(yy,mm,i);
|
||||
if (mm == nd.getMonth()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function firstDay1(d) {
|
||||
var yy=d.getFullYear(), mm=d.getMonth();
|
||||
var fd=new Date(yy,mm,1);
|
||||
return fd.getDay();
|
||||
}
|
||||
|
||||
function dayDisplay1(i) {
|
||||
if (dayDigits1 == 0) {
|
||||
return yxDays1[i];
|
||||
}
|
||||
else {
|
||||
return yxDays1[i].substring(0,dayDigits1);
|
||||
}
|
||||
}
|
||||
|
||||
function calTitle1(d) {
|
||||
var yy=d.getFullYear(), mm=yxMonths1[d.getMonth()];
|
||||
var s;
|
||||
|
||||
if (titleMode1 == 2) {
|
||||
s="<tr align='center' bgcolor='"+titleColor1+"'><td colspan='7'>\n<table cellpadding='0' cellspacing='0' border='0'><tr align='center' valign='middle'><td align='right'>"+span1("title")+"<b>"+a11("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear1) window.opener.moveYear1(-10)'> «</a> "+a11("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear1) window.opener.moveYear1(-1)'>‹ </a></b>"+span21+"</td><td width='"+titleWidth1+"'><b>"+span1("title")+yy+span21+"</b></td><td align='left'>"+span1("title")+"<b>"+a11("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.moveYear1) window.opener.moveYear1(1)'> ›</a> "+a11("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.moveYear1) window.opener.moveYear1(10)'>» </a></b>"+span21+"</td></tr><tr align='center' valign='middle'><td align='right'>"+span1("title")+"<b>"+a11("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.prepMonth1) window.opener.prepMonth1("+d.getMonth()+")'> ‹ </a></b>"+span21+"</td><td width='"+titleWidth1+"'><b>"+span1("title")+mm+span21+"</b></td><td align='left'>"+span1("title")+"<b>"+a11("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.nextMonth1) window.opener.nextMonth1("+d.getMonth()+")'> › </a></b>"+span21+"</td></tr></table>\n</td></tr><tr align='center' bgcolor='"+daysColor1+"'>";
|
||||
}
|
||||
else {
|
||||
s="<tr align='center' bgcolor='"+titleColor1+"'><td colspan='7'>\n<table cellpadding='0' cellspacing='0' border='0'><tr align='center' valign='middle'><td>"+span1("title")+"<b>"+a11("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear1) window.opener.moveYear1(-1)'> «</a> "+a11("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.prepMonth1) window.opener.prepMonth1("+d.getMonth()+")'>‹ </a></b>"+span21+"</td><td width='"+titleWidth1+"'><nobr><b>"+span1("title")+mm+" "+yy+span21+"</b></nobr></td><td>"+span1("title")+"<b>"+a11("titlea")+"'javascript:if (window.opener && !window.opener.closed && window.opener.nextMonth1) window.opener.nextMonth1("+d.getMonth()+")'> ›</a> "+a11("titlea")+"'javascript:if(window.opener && !window.opener.closed && window.opener.moveYear1) window.opener.moveYear1(1)'>» </a></b>"+span21+"</td></tr></table>\n</td></tr><tr align='center' bgcolor='"+daysColor1+"'>";
|
||||
}
|
||||
|
||||
for (var i=weekDay1; i<weekDay1+7; i++) {
|
||||
s+="<td width='"+dayWidth1+"'>"+span1("days")+dayDisplay1(i)+span21+"</td>";
|
||||
}
|
||||
|
||||
s+="</tr>";
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function calHeader1() {
|
||||
return "<head>\n<title>"+currentCal1.title+"</title>\n<style type='text/css'>\n"+spanx1("title",titleFontColor1)+spanx1("days",daysFontColor1)+spanx1("foot",footColor1)+spanx1("day",dayFontColor1)+spanx1("currentDay",currentdayFontColor1)+ax1("titlea",titleFontColor1)+ax1("daya",dayFontColor1)+ax1("currenta",currentdayFontColor1)+ax1("foota",footFontColor1)+"</style>\n</head>\n<body>\n<table align='center' border='0' bgcolor='"+borderColor1+"' cellspacing='0' cellpadding='1'><tr><td>\n<table cellspacing='1' cellpadding='3' border='0'>";
|
||||
}
|
||||
|
||||
function calFooter1() {
|
||||
return "<tr bgcolor='"+footColor1+"'><td colspan='7' align='center'>"+span1("foot")+"<b>"+a11("foota")+"'javascript:if (window.opener && !window.opener.closed && window.opener.hideCal1) window.opener.hideCal1()'>"+yxLinks1[0]+"</a> "+a11("foota")+"'javascript:if (window.opener && !window.opener.closed && window.opener.clearDate1) window.opener.clearDate1()'>"+yxLinks1[1]+"</a></b>"+span21+"</td></tr></table>\n</td></tr></table>\n</body>";
|
||||
}
|
||||
|
||||
function calBody1(d,day) {
|
||||
var s="", dayCount=1, fd=firstDay1(d), ld=lastDay1(d);
|
||||
|
||||
if (weekDay1 > 0 && fd == 0) {
|
||||
fd = 7;
|
||||
}
|
||||
|
||||
for (var i=0; i<6; i++) {
|
||||
s+="<tr align='center' bgcolor='"+bodyColor1+"'>";
|
||||
for (var j=weekDay1; j<weekDay1+7; j++) {
|
||||
if (i*7+j<fd || dayCount>ld) {
|
||||
s+="<td>"+span1("day")+" "+span21+"</td>";
|
||||
}
|
||||
else {
|
||||
var bgColor=dayColor1;
|
||||
var fgTag="day";
|
||||
var fgTagA="daya";
|
||||
if (dayCount==day) {
|
||||
bgColor=currentdayColor1;
|
||||
fgTag="currentDay";
|
||||
fgTagA="currenta";
|
||||
}
|
||||
|
||||
s+="<td bgcolor='"+bgColor+"'>"+span1(fgTag)+a11(fgTagA)+"'javascript: if (window.opener && !window.opener.closed && window.opener.pickDate1) window.opener.pickDate1("+dayCount+")'>"+(dayCount++)+"</a>"+span21+"</td>";
|
||||
}
|
||||
}
|
||||
s+="</tr>";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function moveYear1(dy) {
|
||||
cY+=dy;
|
||||
var nd=new Date(cY,cM,1);
|
||||
changeCal1(nd);
|
||||
}
|
||||
|
||||
function prepMonth1(m) {
|
||||
cM=m-1;
|
||||
if (cM<0) { cM=11; cY--; }
|
||||
var nd=new Date(cY,cM,1);
|
||||
changeCal1(nd);
|
||||
}
|
||||
|
||||
function nextMonth1(m) {
|
||||
cM=m+1;
|
||||
if (cM>11) { cM=0; cY++;}
|
||||
var nd=new Date(cY,cM,1);
|
||||
changeCal1(nd);
|
||||
}
|
||||
|
||||
function changeCal1(d) {
|
||||
var dd = 0;
|
||||
|
||||
if (currentCal1 != null) {
|
||||
var calRE = getFormat1();
|
||||
|
||||
if (currentCal1.form[currentCal1.field].value!="" && calRE.test(currentCal1.form[currentCal1.field].value)) {
|
||||
var cd = getDateNumbers1(currentCal1.form[currentCal1.field].value);
|
||||
if (cd[0] == d.getFullYear() && cd[1] == d.getMonth()) {
|
||||
dd=cd[2];
|
||||
}
|
||||
}
|
||||
else {
|
||||
var cd = new Date();
|
||||
if (cd.getFullYear() == d.getFullYear() && cd.getMonth() == d.getMonth()) {
|
||||
dd=cd.getDate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var calendar=calHeader1()+calTitle1(d)+calBody1(d,dd)+calFooter1();
|
||||
|
||||
calWin1.document.open();
|
||||
calWin1.document.write(calendar);
|
||||
calWin1.document.close();
|
||||
}
|
||||
|
||||
function markClick1(e) {
|
||||
if (isIE1 || isOpera61) {
|
||||
winX1=event.screenX;
|
||||
winY1=event.screenY;
|
||||
}
|
||||
else if (isN41 || isN61) {
|
||||
winX1=e.screenX;
|
||||
winY1=e.screenY;
|
||||
|
||||
document.routeEvent(e);
|
||||
}
|
||||
|
||||
if (isN41 || isN61) {
|
||||
document.routeEvent(e);
|
||||
}
|
||||
else {
|
||||
event.cancelBubble=false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function showCal1(name) {
|
||||
var lastCal=currentCal1;
|
||||
var d=new Date(), hasCal=false;
|
||||
|
||||
currentCal1 = findCalendar1(name);
|
||||
|
||||
if (currentCal1 != null && currentCal1.form != null && currentCal1.form[currentCal1.field]) {
|
||||
var calRE = getFormat1();
|
||||
|
||||
if (currentCal1.form[currentCal1.field].value!="" && calRE.test(currentCal1.form[currentCal1.field].value)) {
|
||||
var cd = getDateNumbers1(currentCal1.form[currentCal1.field].value);
|
||||
d=new Date(cd[0],cd[1],cd[2]);
|
||||
|
||||
cY=cd[0];
|
||||
cM=cd[1];
|
||||
dd=cd[2];
|
||||
}
|
||||
else {
|
||||
cY=d.getFullYear();
|
||||
cM=d.getMonth();
|
||||
dd=d.getDate();
|
||||
}
|
||||
|
||||
var calendar=calHeader1()+calTitle1(d)+calBody1(d,dd)+calFooter1();
|
||||
|
||||
if (calWin1 != null && typeof(calWin1.closed)!="undefined" && !calWin1.closed) {
|
||||
hasCal=true;
|
||||
calWin1.moveTo(winX1+calOffsetX1,winY1+calOffsetY1);
|
||||
}
|
||||
|
||||
if (!hasCal) {
|
||||
if (isIE1 || isOpera61) {
|
||||
calWin1=window.open("","cal","toolbar=0,width="+calWidth1+",height="+calHeight1+",left="+(winX1+calOffsetX1)+",top="+(winY1+calOffsetY1));
|
||||
}
|
||||
else {
|
||||
calWin1=window.open("","cal","toolbar=0,width="+calWidth1+",height="+calHeight1+",screenx="+(winX1+calOffsetX1)+",screeny="+(winY1+calOffsetY1));
|
||||
}
|
||||
}
|
||||
|
||||
calWin1.document.open();
|
||||
calWin1.document.write(calendar);
|
||||
calWin1.document.close();
|
||||
|
||||
calWin1.focus();
|
||||
}
|
||||
else {
|
||||
if (currentCal1 == null) {
|
||||
window.status = "Calendar ["+name+"] not found.";
|
||||
}
|
||||
else if (!currentCal1.form) {
|
||||
window.status = "Form ["+currentCal1.formName+"] not found.";
|
||||
}
|
||||
else if (!currentCal1.form[currentCal1.field]) {
|
||||
window.status = "Form Field ["+currentCal1.formName+"."+currentCal1.field+"] not found.";
|
||||
}
|
||||
|
||||
if (lastCal != null) {
|
||||
currentCal1 = lastCal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get2Digits1(n) {
|
||||
return ((n<10)?"0":"")+n;
|
||||
}
|
||||
|
||||
function clearDate1() {
|
||||
currentCal1.form[currentCal1.field].value="";
|
||||
hideCal1();
|
||||
}
|
||||
|
||||
function pickDate1(d) {
|
||||
hideCal1();
|
||||
window.focus();
|
||||
|
||||
var date=calFormat1;
|
||||
date = date.replace(/yyyy/i, cY);
|
||||
date = date.replace(/mm/i, get2Digits1(cM+1));
|
||||
date = date.replace(/MON/, yxMonths1[cM].substring(0,3).toUpperCase());
|
||||
date = date.replace(/Mon/i, yxMonths1[cM].substring(0,3));
|
||||
date = date.replace(/dd/i, get2Digits1(d));
|
||||
date = date.replace(/DAY/, getDayName1(cY,cM,d).toUpperCase());
|
||||
date = date.replace(/day/i, getDayName1(cY,cM,d));
|
||||
|
||||
currentCal1.form[currentCal1.field].value=date;
|
||||
// IE5/Mac needs focus to show the value, weird.
|
||||
currentCal1.form[currentCal1.field].focus();
|
||||
}
|
||||
// ------
|
||||
|
||||
// user functions
|
||||
function checkDate1(name) {
|
||||
var thisCal = findCalendar1(name);
|
||||
|
||||
if (thisCal != null && thisCal.form != null && thisCal.form[thisCal.field]) {
|
||||
var calRE = getFormat1();
|
||||
|
||||
if (calRE.test(thisCal.form[thisCal.field].value)) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentDate1() {
|
||||
var date=calFormat1, d = new Date();
|
||||
date = date.replace(/dd/i, get2Digits1(d.getDate()));
|
||||
date = date.replace(/mm/i, get2Digits1(d.getMonth()+1));
|
||||
date = date.replace(/yyyy/i, d.getFullYear());
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
function compareDates1(date1, date2) {
|
||||
var calRE = getFormat1();
|
||||
var d1, d2;
|
||||
|
||||
if (calRE.test(date1)) {
|
||||
d1 = getNumbers1(date1);
|
||||
}
|
||||
else {
|
||||
d1 = getNumbers1(getCurrentDate1());
|
||||
}
|
||||
|
||||
if (calRE.test(date2)) {
|
||||
d2 = getNumbers1(date2);
|
||||
}
|
||||
else {
|
||||
d2 = getNumbers1(getCurrentDate1());
|
||||
}
|
||||
|
||||
var dStr1 = d1[0] + "" + d1[1] + "" + d1[2];
|
||||
var dStr2 = d2[0] + "" + d2[1] + "" + d2[2];
|
||||
|
||||
if (dStr1 == dStr2) {
|
||||
return 0;
|
||||
}
|
||||
else if (dStr1 > dStr2) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
function getNumbers1(date) {
|
||||
var calRE = getFormat1();
|
||||
var y, m, d;
|
||||
|
||||
if (calRE.test(date)) {
|
||||
var yIdx = calFormat1.search(/yyyy/i);
|
||||
var mIdx = calFormat1.search(/mm/i);
|
||||
var m3Idx = calFormat1.search(/mon/i);
|
||||
var dIdx = calFormat1.search(/dd/i);
|
||||
|
||||
y=date.substring(yIdx,yIdx+4);
|
||||
if (mIdx != -1) {
|
||||
m=date.substring(mIdx,mIdx+2);
|
||||
}
|
||||
else {
|
||||
var mm=getMonthFromName1(date.substring(m3Idx,m3Idx+3))+1;
|
||||
m=(mm<10)?("0"+mm):(""+mm);
|
||||
}
|
||||
d=date.substring(dIdx,dIdx+2);
|
||||
|
||||
return new Array(y,m,d);
|
||||
}
|
||||
else {
|
||||
return new Array("", "", "");
|
||||
}
|
||||
}
|
||||
// ------
|
||||
|
||||
if (isN41 || isN61) {
|
||||
document.captureEvents(Event.CLICK);
|
||||
}
|
||||
document.onclick=markClick1;
|
||||
|
||||
function calage1(ctgl, objID)
|
||||
{
|
||||
|
||||
var calday = ctgl.substr(0,2);
|
||||
var calmon = ctgl.substr(3,2);
|
||||
var calyear = ctgl.substr(6,4);
|
||||
|
||||
if(curday == "" || curmon=="" || curyear=="" || calday=="" || calmon=="" || calyear=="")
|
||||
{
|
||||
//alert("please fill all the values and click go -");
|
||||
}
|
||||
else
|
||||
{
|
||||
var curd = new Date(curyear,curmon-1,curday);
|
||||
var cald = new Date(calyear,calmon-1,calday);
|
||||
|
||||
var diff = Date.UTC(curyear,curmon,curday,0,0,0) - Date.UTC(calyear,calmon,calday,0,0,0);
|
||||
|
||||
var dife = datediff(curd,cald);
|
||||
vobj = document.getElementById(objID);
|
||||
vobj.value = dife[0]+" tahun "+dife[1]+" bulan "+dife[2]+" hari";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//Define calendar(s): addCalendar ("Unique Calendar Name", "Window title", "Form element's name", Form name")
|
||||
addCalendar("Calendar1", "Select Date", "TGLLAHIR", "myform");
|
||||
addCalendar("theDate", "Select Date", "theDate", "myform");
|
||||
addCalendar("Calendar2", "Select Date", "TGLREG", "cari");
|
||||
addCalendar("Calendar15", "Select Date", "TGLREG2", "cari");
|
||||
addCalendar("Calendar3", "Select Date", "tgl_pesan", "formsearch");
|
||||
addCalendar("Calendar11", "Select Date", "tgl_pesan2", "formsearch");
|
||||
addCalendar("Calendar4", "Select Date", "theDate", "tglkalender");
|
||||
addCalendar("Calendar5", "Select Date", "tgl_keluar", "resume_medis");
|
||||
addCalendar("Calendar6", "Select Date", "tgl_keluar", "rekam_asuhan_keperawatan");
|
||||
addCalendar("Calendar7", "Select Date", "tgl_kembali", "rekam_asuhan_keperawatan");
|
||||
addCalendar("Calendar9", "Select Date", "tgl_operasi", "daftar");
|
||||
addCalendar("Calendar10", "Select Date", "tglsampai", "tglkalender");
|
||||
addCalendar("tgl_kel", "Select Date", "tanggal", "catatan_keperawatan");
|
||||
addCalendar("daricariadmission", "Select Date", "daricariadmission", "formcariadmission");
|
||||
addCalendar("sampaicariadmission", "Select Date", "sampaicariadmission", "formcariadmission");
|
||||
addCalendar("Calendar11", "Select Date", "TGLKELUAR", "resume_pulang");
|
||||
addCalendar("tgl_pindah", "Select Date", "tgl_pindah", "form1");
|
||||
addCalendar("darijamkesmas", "Select Date", "darijamkesmas", "formcarijamkesmas");
|
||||
addCalendar("sampaijamkesmas", "Select Date", "sampaijamkesmas", "formcarijamkesmas");
|
||||
addCalendar("caldpmp", "Select Date", "caldpmp", "cari");
|
||||
addCalendar("caldpmp", "Select Date", "caldpmp", "cari");
|
||||
addCalendar("TGLKELUAR", "Select Date", "TGLKELUAR", "resume_pulang");
|
||||
addCalendar("Calendarx", "Select Date", "tgl_masuk", "form_admission");
|
||||
addCalendar("Calendary", "Select Date", "tgl_masuk", "form1");
|
||||
//addCalendar("Calendar2", "Select Date", "secondinput", "myform");
|
||||
|
||||
// default settings for English
|
||||
// Uncomment desired lines and modify its values
|
||||
// setFont("verdana", 9);
|
||||
setWidth(90, 1, 15, 1);
|
||||
// setColor("#cccccc", "#cccccc", "#ffffff", "#ffffff", "#333333", "#cccccc", "#333333");
|
||||
// setFontColor("#333333", "#333333", "#333333", "#ffffff", "#333333");
|
||||
// setFormat("yyyy/mm/dd");
|
||||
// setSize(200, 200, -200, 16);
|
||||
|
||||
// setWeekDay(0);
|
||||
// setMonthNames("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
|
||||
// setDayNames("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
||||
// setLinkNames("[Close]", "[Clear]");
|
||||
@@ -0,0 +1,16 @@
|
||||
//Define calendar(s): addCalendar ("Unique Calendar Name", "Window title", "Form element's name", Form name")
|
||||
addCalendar1("Calendar1", "Select Date", "TGLLAHIR", "myform");
|
||||
|
||||
// default settings for English
|
||||
// Uncomment desired lines and modify its values
|
||||
// setFont("verdana", 9);
|
||||
setWidth1(90, 1, 15, 1);
|
||||
// setColor("#cccccc", "#cccccc", "#ffffff", "#ffffff", "#333333", "#cccccc", "#333333");
|
||||
// setFontColor("#333333", "#333333", "#333333", "#ffffff", "#333333");
|
||||
// setFormat("yyyy/mm/dd");
|
||||
// setSize(200, 200, -200, 16);
|
||||
|
||||
// setWeekDay(0);
|
||||
// setMonthNames("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
|
||||
// setDayNames("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
||||
// setLinkNames("[Close]", "[Clear]");
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
include("core/main.php");
|
||||
if($_GET[checkNum]){ // if your load with ?checkNum=1 you just want to check if there is anything new (this is for optimization)
|
||||
$q = $db->query("select count(*) as nb from notification where status = 9 and roles='".$_POST['ROLES']."'");
|
||||
$r = $q->fetchAll()[0];
|
||||
echo $r[nb];
|
||||
} else { // otherwhise you want to load the info about the newest notification to display and set the status to 1 so it wont be displayed again
|
||||
$q = $db->query("select * from notification where status = 9 and roles='".$_POST['ROLES']."' order by id limit 1");
|
||||
$r = $q->fetchAll()[0];
|
||||
$db->query("update notification set status = 1 where id = $r[id]");
|
||||
echo $r[info];
|
||||
}
|
||||
|
||||
|
||||
$filename="include/ArielBubur.mp3";
|
||||
|
||||
print '
|
||||
<script>
|
||||
function EvalSound(soundobj) {
|
||||
var thissound=document.getElementById(soundobj);
|
||||
thissound.Play();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class=Section1>
|
||||
|
||||
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width=0
|
||||
height=0>
|
||||
<param name="src" value="'.$filename.'">
|
||||
<param name="scale" value="tofit">
|
||||
<param name="controller" value="true">
|
||||
<param name="autoplay" value="true">
|
||||
<param name="loop" value="false">
|
||||
<embed src="'.$filename.'" id="s001" scale=tofit width=1 height=1 align=center controller=false autoplay=true
|
||||
loop=false enablejavascript=true
|
||||
pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime"></EMBED></OBJECT>
|
||||
|
||||
</div>
|
||||
|
||||
';
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
require_once _DOCROOT_.'vendor/autoload.php';
|
||||
|
||||
$dotenv = new Dotenv\Dotenv(_DOCROOT_);
|
||||
$dotenv->load();
|
||||
|
||||
$connect = mysqli_connect('p:'.$_ENV['DATABASE_HOST'], $_ENV['DATABASE_USER'], $_ENV['DATABASE_PASS'], $_ENV['DATABASE_NAME']);
|
||||
|
||||
try{
|
||||
$tmp_profil = mysqli_query($connect,"SELECT * FROM profil");
|
||||
if(!$tmp_profil)
|
||||
{
|
||||
$connect = mysqli_connect($_ENV['DATABASE_HOST'], $_ENV['DATABASE_USER'], $_ENV['DATABASE_PASS'], $_ENV['DATABASE_NAME']);
|
||||
$rstitle = $_SESSION['rstitle'];
|
||||
$singrstitl = $_SESSION['singrstitl'];
|
||||
$singhead1 = $_SESSION['singhead1'];
|
||||
$singsurat = $_SESSION['singsurat'];
|
||||
$header1 = $_SESSION['header1'];
|
||||
$header2 = $_SESSION['header2'];
|
||||
$header3 = $_SESSION['header3'];
|
||||
$header4 = $_SESSION['header4'];
|
||||
$KDRS = $_SESSION['kdrs'];
|
||||
$KelasRS = $_SESSION['kelasrs'];
|
||||
$NamaRS = $_SESSION['namars'];
|
||||
$KDTarifINACBG = $_SESSION['kdtarifnacbg'];
|
||||
// throw new Exception("Error Processing Request", 1);
|
||||
}
|
||||
else {
|
||||
$data = mysqli_fetch_array($tmp_profil);
|
||||
|
||||
$rstitle = $data['rstitle'];
|
||||
$singrstitl = $data['singrstitl'];
|
||||
$singhead1 = $data['singhead1'];
|
||||
$singsurat = $data['singsurat'];
|
||||
$header1 = $data['header1'];
|
||||
$header2 = $data['header2'];
|
||||
$header3 = $data['header3'];
|
||||
$header4 = $data['header4'];
|
||||
$KDRS = $data['kdrs'];
|
||||
$KelasRS = $data['kelasrs'];
|
||||
$NamaRS = $data['namars'];
|
||||
$KDTarifINACBG = $data['kdtarifnacbg'];
|
||||
|
||||
$_SESSION['rstitle'] = $data['rstitle'];
|
||||
$_SESSION['singrstitl'] = $data['singrstitl'];
|
||||
$_SESSION['singhead1'] = $data['singhead1'];
|
||||
$_SESSION['singsurat'] = $data['singsurat'];
|
||||
$_SESSION['header1'] = $data['header1'];
|
||||
$_SESSION['header2'] = $data['header2'];
|
||||
$_SESSION['header3'] = $data['header3'];
|
||||
$_SESSION['header4'] = $data['header4'];
|
||||
$_SESSION['kdrs'] = $data['kdrs'];
|
||||
$_SESSION['kelasrs'] = $data['kelasrs'];
|
||||
$_SESSION['namars'] = $data['namars'];
|
||||
$_SESSION['kdtarifnacbg'] = $data['kdtarifnacbg'];
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
}
|
||||
Vendored
+965
@@ -0,0 +1,965 @@
|
||||
// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
||||
// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
|
||||
// Contributors:
|
||||
// Richard Livsey
|
||||
// Rahul Bhargava
|
||||
// Rob Wills
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
// Autocompleter.Base handles all the autocompletion functionality
|
||||
// that's independent of the data source for autocompletion. This
|
||||
// includes drawing the autocompletion menu, observing keyboard
|
||||
// and mouse events, and similar.
|
||||
//
|
||||
// Specific autocompleters need to provide, at the very least,
|
||||
// a getUpdatedChoices function that will be invoked every time
|
||||
// the text inside the monitored textbox changes. This method
|
||||
// should get the text for which to provide autocompletion by
|
||||
// invoking this.getToken(), NOT by directly accessing
|
||||
// this.element.value. This is to allow incremental tokenized
|
||||
// autocompletion. Specific auto-completion logic (AJAX, etc)
|
||||
// belongs in getUpdatedChoices.
|
||||
//
|
||||
// Tokenized incremental autocompletion is enabled automatically
|
||||
// when an autocompleter is instantiated with the 'tokens' option
|
||||
// in the options parameter, e.g.:
|
||||
// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
|
||||
// will incrementally autocomplete with a comma as the token.
|
||||
// Additionally, ',' in the above example can be replaced with
|
||||
// a token array, e.g. { tokens: [',', '\n'] } which
|
||||
// enables autocompletion on multiple tokens. This is most
|
||||
// useful when one of the tokens is \n (a newline), as it
|
||||
// allows smart autocompletion after linebreaks.
|
||||
|
||||
if(typeof Effect == 'undefined')
|
||||
throw("controls.js requires including script.aculo.us' effects.js library");
|
||||
|
||||
var Autocompleter = { };
|
||||
Autocompleter.Base = Class.create({
|
||||
baseInitialize: function(element, update, options) {
|
||||
element = $(element);
|
||||
this.element = element;
|
||||
this.update = $(update);
|
||||
this.hasFocus = false;
|
||||
this.changed = false;
|
||||
this.active = false;
|
||||
this.index = 0;
|
||||
this.entryCount = 0;
|
||||
this.oldElementValue = this.element.value;
|
||||
|
||||
if(this.setOptions)
|
||||
this.setOptions(options);
|
||||
else
|
||||
this.options = options || { };
|
||||
|
||||
this.options.paramName = this.options.paramName || this.element.name;
|
||||
this.options.tokens = this.options.tokens || [];
|
||||
this.options.frequency = this.options.frequency || 0.4;
|
||||
this.options.minChars = this.options.minChars || 1;
|
||||
this.options.onShow = this.options.onShow ||
|
||||
function(element, update){
|
||||
if(!update.style.position || update.style.position=='absolute') {
|
||||
update.style.position = 'absolute';
|
||||
Position.clone(element, update, {
|
||||
setHeight: false,
|
||||
offsetTop: element.offsetHeight
|
||||
});
|
||||
}
|
||||
Effect.Appear(update,{duration:0.15});
|
||||
};
|
||||
this.options.onHide = this.options.onHide ||
|
||||
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
|
||||
|
||||
if(typeof(this.options.tokens) == 'string')
|
||||
this.options.tokens = new Array(this.options.tokens);
|
||||
// Force carriage returns as token delimiters anyway
|
||||
if (!this.options.tokens.include('\n'))
|
||||
this.options.tokens.push('\n');
|
||||
|
||||
this.observer = null;
|
||||
|
||||
this.element.setAttribute('autocomplete','off');
|
||||
|
||||
Element.hide(this.update);
|
||||
|
||||
Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
|
||||
Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
|
||||
if(!this.iefix &&
|
||||
(Prototype.Browser.IE) &&
|
||||
(Element.getStyle(this.update, 'position')=='absolute')) {
|
||||
new Insertion.After(this.update,
|
||||
'<iframe id="' + this.update.id + '_iefix" '+
|
||||
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
|
||||
'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
|
||||
this.iefix = $(this.update.id+'_iefix');
|
||||
}
|
||||
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
|
||||
},
|
||||
|
||||
fixIEOverlapping: function() {
|
||||
Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
|
||||
this.iefix.style.zIndex = 1;
|
||||
this.update.style.zIndex = 2;
|
||||
Element.show(this.iefix);
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.stopIndicator();
|
||||
if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
|
||||
if(this.iefix) Element.hide(this.iefix);
|
||||
},
|
||||
|
||||
startIndicator: function() {
|
||||
if(this.options.indicator) Element.show(this.options.indicator);
|
||||
},
|
||||
|
||||
stopIndicator: function() {
|
||||
if(this.options.indicator) Element.hide(this.options.indicator);
|
||||
},
|
||||
|
||||
onKeyPress: function(event) {
|
||||
if(this.active)
|
||||
switch(event.keyCode) {
|
||||
case Event.KEY_TAB:
|
||||
case Event.KEY_RETURN:
|
||||
this.selectEntry();
|
||||
Event.stop(event);
|
||||
case Event.KEY_ESC:
|
||||
this.hide();
|
||||
this.active = false;
|
||||
Event.stop(event);
|
||||
return;
|
||||
case Event.KEY_LEFT:
|
||||
case Event.KEY_RIGHT:
|
||||
return;
|
||||
case Event.KEY_UP:
|
||||
this.markPrevious();
|
||||
this.render();
|
||||
Event.stop(event);
|
||||
return;
|
||||
case Event.KEY_DOWN:
|
||||
this.markNext();
|
||||
this.render();
|
||||
Event.stop(event);
|
||||
return;
|
||||
}
|
||||
else
|
||||
if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
|
||||
(Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
|
||||
|
||||
this.changed = true;
|
||||
this.hasFocus = true;
|
||||
|
||||
if(this.observer) clearTimeout(this.observer);
|
||||
this.observer =
|
||||
setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
this.changed = false;
|
||||
this.hasFocus = true;
|
||||
this.getUpdatedChoices();
|
||||
},
|
||||
|
||||
onHover: function(event) {
|
||||
var element = Event.findElement(event, 'LI');
|
||||
if(this.index != element.autocompleteIndex)
|
||||
{
|
||||
this.index = element.autocompleteIndex;
|
||||
this.render();
|
||||
}
|
||||
Event.stop(event);
|
||||
},
|
||||
|
||||
onClick: function(event) {
|
||||
var element = Event.findElement(event, 'LI');
|
||||
this.index = element.autocompleteIndex;
|
||||
this.selectEntry();
|
||||
this.hide();
|
||||
},
|
||||
|
||||
onBlur: function(event) {
|
||||
// needed to make click events working
|
||||
setTimeout(this.hide.bind(this), 250);
|
||||
this.hasFocus = false;
|
||||
this.active = false;
|
||||
},
|
||||
|
||||
render: function() {
|
||||
if(this.entryCount > 0) {
|
||||
for (var i = 0; i < this.entryCount; i++)
|
||||
this.index==i ?
|
||||
Element.addClassName(this.getEntry(i),"selected") :
|
||||
Element.removeClassName(this.getEntry(i),"selected");
|
||||
if(this.hasFocus) {
|
||||
this.show();
|
||||
this.active = true;
|
||||
}
|
||||
} else {
|
||||
this.active = false;
|
||||
this.hide();
|
||||
}
|
||||
},
|
||||
|
||||
markPrevious: function() {
|
||||
if(this.index > 0) this.index--;
|
||||
else this.index = this.entryCount-1;
|
||||
this.getEntry(this.index).scrollIntoView(true);
|
||||
},
|
||||
|
||||
markNext: function() {
|
||||
if(this.index < this.entryCount-1) this.index++;
|
||||
else this.index = 0;
|
||||
this.getEntry(this.index).scrollIntoView(false);
|
||||
},
|
||||
|
||||
getEntry: function(index) {
|
||||
return this.update.firstChild.childNodes[index];
|
||||
},
|
||||
|
||||
getCurrentEntry: function() {
|
||||
return this.getEntry(this.index);
|
||||
},
|
||||
|
||||
selectEntry: function() {
|
||||
this.active = false;
|
||||
this.updateElement(this.getCurrentEntry());
|
||||
},
|
||||
|
||||
updateElement: function(selectedElement) {
|
||||
if (this.options.updateElement) {
|
||||
this.options.updateElement(selectedElement);
|
||||
return;
|
||||
}
|
||||
var value = '';
|
||||
if (this.options.select) {
|
||||
var nodes = $(selectedElement).select('.' + this.options.select) || [];
|
||||
if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
|
||||
} else
|
||||
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
|
||||
|
||||
var bounds = this.getTokenBounds();
|
||||
if (bounds[0] != -1) {
|
||||
var newValue = this.element.value.substr(0, bounds[0]);
|
||||
var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
|
||||
if (whitespace)
|
||||
newValue += whitespace[0];
|
||||
this.element.value = newValue + value + this.element.value.substr(bounds[1]);
|
||||
} else {
|
||||
this.element.value = value;
|
||||
}
|
||||
this.oldElementValue = this.element.value;
|
||||
this.element.focus();
|
||||
|
||||
if (this.options.afterUpdateElement)
|
||||
this.options.afterUpdateElement(this.element, selectedElement);
|
||||
},
|
||||
|
||||
updateChoices: function(choices) {
|
||||
if(!this.changed && this.hasFocus) {
|
||||
this.update.innerHTML = choices;
|
||||
Element.cleanWhitespace(this.update);
|
||||
Element.cleanWhitespace(this.update.down());
|
||||
|
||||
if(this.update.firstChild && this.update.down().childNodes) {
|
||||
this.entryCount =
|
||||
this.update.down().childNodes.length;
|
||||
for (var i = 0; i < this.entryCount; i++) {
|
||||
var entry = this.getEntry(i);
|
||||
entry.autocompleteIndex = i;
|
||||
this.addObservers(entry);
|
||||
}
|
||||
} else {
|
||||
this.entryCount = 0;
|
||||
}
|
||||
|
||||
this.stopIndicator();
|
||||
this.index = 0;
|
||||
|
||||
if(this.entryCount==1 && this.options.autoSelect) {
|
||||
this.selectEntry();
|
||||
this.hide();
|
||||
} else {
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addObservers: function(element) {
|
||||
Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
|
||||
Event.observe(element, "click", this.onClick.bindAsEventListener(this));
|
||||
},
|
||||
|
||||
onObserverEvent: function() {
|
||||
this.changed = false;
|
||||
this.tokenBounds = null;
|
||||
if(this.getToken().length>=this.options.minChars) {
|
||||
this.getUpdatedChoices();
|
||||
} else {
|
||||
this.active = false;
|
||||
this.hide();
|
||||
}
|
||||
this.oldElementValue = this.element.value;
|
||||
},
|
||||
|
||||
getToken: function() {
|
||||
var bounds = this.getTokenBounds();
|
||||
return this.element.value.substring(bounds[0], bounds[1]).strip();
|
||||
},
|
||||
|
||||
getTokenBounds: function() {
|
||||
if (null != this.tokenBounds) return this.tokenBounds;
|
||||
var value = this.element.value;
|
||||
if (value.strip().empty()) return [-1, 0];
|
||||
var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
|
||||
var offset = (diff == this.oldElementValue.length ? 1 : 0);
|
||||
var prevTokenPos = -1, nextTokenPos = value.length;
|
||||
var tp;
|
||||
for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
|
||||
tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
|
||||
if (tp > prevTokenPos) prevTokenPos = tp;
|
||||
tp = value.indexOf(this.options.tokens[index], diff + offset);
|
||||
if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
|
||||
}
|
||||
return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
|
||||
}
|
||||
});
|
||||
|
||||
Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
|
||||
var boundary = Math.min(newS.length, oldS.length);
|
||||
for (var index = 0; index < boundary; ++index)
|
||||
if (newS[index] != oldS[index])
|
||||
return index;
|
||||
return boundary;
|
||||
};
|
||||
|
||||
Ajax.Autocompleter = Class.create(Autocompleter.Base, {
|
||||
initialize: function(element, update, url, options) {
|
||||
this.baseInitialize(element, update, options);
|
||||
this.options.asynchronous = true;
|
||||
this.options.onComplete = this.onComplete.bind(this);
|
||||
this.options.defaultParams = this.options.parameters || null;
|
||||
this.url = url;
|
||||
},
|
||||
|
||||
getUpdatedChoices: function() {
|
||||
this.startIndicator();
|
||||
|
||||
var entry = encodeURIComponent(this.options.paramName) + '=' +
|
||||
encodeURIComponent(this.getToken());
|
||||
|
||||
this.options.parameters = this.options.callback ?
|
||||
this.options.callback(this.element, entry) : entry;
|
||||
|
||||
if(this.options.defaultParams)
|
||||
this.options.parameters += '&' + this.options.defaultParams;
|
||||
|
||||
new Ajax.Request(this.url, this.options);
|
||||
},
|
||||
|
||||
onComplete: function(request) {
|
||||
this.updateChoices(request.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
// The local array autocompleter. Used when you'd prefer to
|
||||
// inject an array of autocompletion options into the page, rather
|
||||
// than sending out Ajax queries, which can be quite slow sometimes.
|
||||
//
|
||||
// The constructor takes four parameters. The first two are, as usual,
|
||||
// the id of the monitored textbox, and id of the autocompletion menu.
|
||||
// The third is the array you want to autocomplete from, and the fourth
|
||||
// is the options block.
|
||||
//
|
||||
// Extra local autocompletion options:
|
||||
// - choices - How many autocompletion choices to offer
|
||||
//
|
||||
// - partialSearch - If false, the autocompleter will match entered
|
||||
// text only at the beginning of strings in the
|
||||
// autocomplete array. Defaults to true, which will
|
||||
// match text at the beginning of any *word* in the
|
||||
// strings in the autocomplete array. If you want to
|
||||
// search anywhere in the string, additionally set
|
||||
// the option fullSearch to true (default: off).
|
||||
//
|
||||
// - fullSsearch - Search anywhere in autocomplete array strings.
|
||||
//
|
||||
// - partialChars - How many characters to enter before triggering
|
||||
// a partial match (unlike minChars, which defines
|
||||
// how many characters are required to do any match
|
||||
// at all). Defaults to 2.
|
||||
//
|
||||
// - ignoreCase - Whether to ignore case when autocompleting.
|
||||
// Defaults to true.
|
||||
//
|
||||
// It's possible to pass in a custom function as the 'selector'
|
||||
// option, if you prefer to write your own autocompletion logic.
|
||||
// In that case, the other options above will not apply unless
|
||||
// you support them.
|
||||
|
||||
Autocompleter.Local = Class.create(Autocompleter.Base, {
|
||||
initialize: function(element, update, array, options) {
|
||||
this.baseInitialize(element, update, options);
|
||||
this.options.array = array;
|
||||
},
|
||||
|
||||
getUpdatedChoices: function() {
|
||||
this.updateChoices(this.options.selector(this));
|
||||
},
|
||||
|
||||
setOptions: function(options) {
|
||||
this.options = Object.extend({
|
||||
choices: 10,
|
||||
partialSearch: true,
|
||||
partialChars: 2,
|
||||
ignoreCase: true,
|
||||
fullSearch: false,
|
||||
selector: function(instance) {
|
||||
var ret = []; // Beginning matches
|
||||
var partial = []; // Inside matches
|
||||
var entry = instance.getToken();
|
||||
var count = 0;
|
||||
|
||||
for (var i = 0; i < instance.options.array.length &&
|
||||
ret.length < instance.options.choices ; i++) {
|
||||
|
||||
var elem = instance.options.array[i];
|
||||
var foundPos = instance.options.ignoreCase ?
|
||||
elem.toLowerCase().indexOf(entry.toLowerCase()) :
|
||||
elem.indexOf(entry);
|
||||
|
||||
while (foundPos != -1) {
|
||||
if (foundPos == 0 && elem.length != entry.length) {
|
||||
ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
|
||||
elem.substr(entry.length) + "</li>");
|
||||
break;
|
||||
} else if (entry.length >= instance.options.partialChars &&
|
||||
instance.options.partialSearch && foundPos != -1) {
|
||||
if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
|
||||
partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
|
||||
elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
|
||||
foundPos + entry.length) + "</li>");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foundPos = instance.options.ignoreCase ?
|
||||
elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
|
||||
elem.indexOf(entry, foundPos + 1);
|
||||
|
||||
}
|
||||
}
|
||||
if (partial.length)
|
||||
ret = ret.concat(partial.slice(0, instance.options.choices - ret.length));
|
||||
return "<ul>" + ret.join('') + "</ul>";
|
||||
}
|
||||
}, options || { });
|
||||
}
|
||||
});
|
||||
|
||||
// AJAX in-place editor and collection editor
|
||||
// Full rewrite by Christophe Porteneuve <tdd@tddsworld.com> (April 2007).
|
||||
|
||||
// Use this if you notice weird scrolling problems on some browsers,
|
||||
// the DOM might be a bit confused when this gets called so do this
|
||||
// waits 1 ms (with setTimeout) until it does the activation
|
||||
Field.scrollFreeActivate = function(field) {
|
||||
setTimeout(function() {
|
||||
Field.activate(field);
|
||||
}, 1);
|
||||
};
|
||||
|
||||
Ajax.InPlaceEditor = Class.create({
|
||||
initialize: function(element, url, options) {
|
||||
this.url = url;
|
||||
this.element = element = $(element);
|
||||
this.prepareOptions();
|
||||
this._controls = { };
|
||||
arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!!
|
||||
Object.extend(this.options, options || { });
|
||||
if (!this.options.formId && this.element.id) {
|
||||
this.options.formId = this.element.id + '-inplaceeditor';
|
||||
if ($(this.options.formId))
|
||||
this.options.formId = '';
|
||||
}
|
||||
if (this.options.externalControl)
|
||||
this.options.externalControl = $(this.options.externalControl);
|
||||
if (!this.options.externalControl)
|
||||
this.options.externalControlOnly = false;
|
||||
this._originalBackground = this.element.getStyle('background-color') || 'transparent';
|
||||
this.element.title = this.options.clickToEditText;
|
||||
this._boundCancelHandler = this.handleFormCancellation.bind(this);
|
||||
this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this);
|
||||
this._boundFailureHandler = this.handleAJAXFailure.bind(this);
|
||||
this._boundSubmitHandler = this.handleFormSubmission.bind(this);
|
||||
this._boundWrapperHandler = this.wrapUp.bind(this);
|
||||
this.registerListeners();
|
||||
},
|
||||
checkForEscapeOrReturn: function(e) {
|
||||
if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return;
|
||||
if (Event.KEY_ESC == e.keyCode)
|
||||
this.handleFormCancellation(e);
|
||||
else if (Event.KEY_RETURN == e.keyCode)
|
||||
this.handleFormSubmission(e);
|
||||
},
|
||||
createControl: function(mode, handler, extraClasses) {
|
||||
var control = this.options[mode + 'Control'];
|
||||
var text = this.options[mode + 'Text'];
|
||||
if ('button' == control) {
|
||||
var btn = document.createElement('input');
|
||||
btn.type = 'submit';
|
||||
btn.value = text;
|
||||
btn.className = 'editor_' + mode + '_button';
|
||||
if ('cancel' == mode)
|
||||
btn.onclick = this._boundCancelHandler;
|
||||
this._form.appendChild(btn);
|
||||
this._controls[mode] = btn;
|
||||
} else if ('link' == control) {
|
||||
var link = document.createElement('a');
|
||||
link.href = '#';
|
||||
link.appendChild(document.createTextNode(text));
|
||||
link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler;
|
||||
link.className = 'editor_' + mode + '_link';
|
||||
if (extraClasses)
|
||||
link.className += ' ' + extraClasses;
|
||||
this._form.appendChild(link);
|
||||
this._controls[mode] = link;
|
||||
}
|
||||
},
|
||||
createEditField: function() {
|
||||
var text = (this.options.loadTextURL ? this.options.loadingText : this.getText());
|
||||
var fld;
|
||||
if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) {
|
||||
fld = document.createElement('input');
|
||||
fld.type = 'text';
|
||||
var size = this.options.size || this.options.cols || 0;
|
||||
if (0 < size) fld.size = size;
|
||||
} else {
|
||||
fld = document.createElement('textarea');
|
||||
fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows);
|
||||
fld.cols = this.options.cols || 40;
|
||||
}
|
||||
fld.name = this.options.paramName;
|
||||
fld.value = text; // No HTML breaks conversion anymore
|
||||
fld.className = 'editor_field';
|
||||
if (this.options.submitOnBlur)
|
||||
fld.onblur = this._boundSubmitHandler;
|
||||
this._controls.editor = fld;
|
||||
if (this.options.loadTextURL)
|
||||
this.loadExternalText();
|
||||
this._form.appendChild(this._controls.editor);
|
||||
},
|
||||
createForm: function() {
|
||||
var ipe = this;
|
||||
function addText(mode, condition) {
|
||||
var text = ipe.options['text' + mode + 'Controls'];
|
||||
if (!text || condition === false) return;
|
||||
ipe._form.appendChild(document.createTextNode(text));
|
||||
};
|
||||
this._form = $(document.createElement('form'));
|
||||
this._form.id = this.options.formId;
|
||||
this._form.addClassName(this.options.formClassName);
|
||||
this._form.onsubmit = this._boundSubmitHandler;
|
||||
this.createEditField();
|
||||
if ('textarea' == this._controls.editor.tagName.toLowerCase())
|
||||
this._form.appendChild(document.createElement('br'));
|
||||
if (this.options.onFormCustomization)
|
||||
this.options.onFormCustomization(this, this._form);
|
||||
addText('Before', this.options.okControl || this.options.cancelControl);
|
||||
this.createControl('ok', this._boundSubmitHandler);
|
||||
addText('Between', this.options.okControl && this.options.cancelControl);
|
||||
this.createControl('cancel', this._boundCancelHandler, 'editor_cancel');
|
||||
addText('After', this.options.okControl || this.options.cancelControl);
|
||||
},
|
||||
destroy: function() {
|
||||
if (this._oldInnerHTML)
|
||||
this.element.innerHTML = this._oldInnerHTML;
|
||||
this.leaveEditMode();
|
||||
this.unregisterListeners();
|
||||
},
|
||||
enterEditMode: function(e) {
|
||||
if (this._saving || this._editing) return;
|
||||
this._editing = true;
|
||||
this.triggerCallback('onEnterEditMode');
|
||||
if (this.options.externalControl)
|
||||
this.options.externalControl.hide();
|
||||
this.element.hide();
|
||||
this.createForm();
|
||||
this.element.parentNode.insertBefore(this._form, this.element);
|
||||
if (!this.options.loadTextURL)
|
||||
this.postProcessEditField();
|
||||
if (e) Event.stop(e);
|
||||
},
|
||||
enterHover: function(e) {
|
||||
if (this.options.hoverClassName)
|
||||
this.element.addClassName(this.options.hoverClassName);
|
||||
if (this._saving) return;
|
||||
this.triggerCallback('onEnterHover');
|
||||
},
|
||||
getText: function() {
|
||||
return this.element.innerHTML.unescapeHTML();
|
||||
},
|
||||
handleAJAXFailure: function(transport) {
|
||||
this.triggerCallback('onFailure', transport);
|
||||
if (this._oldInnerHTML) {
|
||||
this.element.innerHTML = this._oldInnerHTML;
|
||||
this._oldInnerHTML = null;
|
||||
}
|
||||
},
|
||||
handleFormCancellation: function(e) {
|
||||
this.wrapUp();
|
||||
if (e) Event.stop(e);
|
||||
},
|
||||
handleFormSubmission: function(e) {
|
||||
var form = this._form;
|
||||
var value = $F(this._controls.editor);
|
||||
this.prepareSubmission();
|
||||
var params = this.options.callback(form, value) || '';
|
||||
if (Object.isString(params))
|
||||
params = params.toQueryParams();
|
||||
params.editorId = this.element.id;
|
||||
if (this.options.htmlResponse) {
|
||||
var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions);
|
||||
Object.extend(options, {
|
||||
parameters: params,
|
||||
onComplete: this._boundWrapperHandler,
|
||||
onFailure: this._boundFailureHandler
|
||||
});
|
||||
new Ajax.Updater({ success: this.element }, this.url, options);
|
||||
} else {
|
||||
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
||||
Object.extend(options, {
|
||||
parameters: params,
|
||||
onComplete: this._boundWrapperHandler,
|
||||
onFailure: this._boundFailureHandler
|
||||
});
|
||||
new Ajax.Request(this.url, options);
|
||||
}
|
||||
if (e) Event.stop(e);
|
||||
},
|
||||
leaveEditMode: function() {
|
||||
this.element.removeClassName(this.options.savingClassName);
|
||||
this.removeForm();
|
||||
this.leaveHover();
|
||||
this.element.style.backgroundColor = this._originalBackground;
|
||||
this.element.show();
|
||||
if (this.options.externalControl)
|
||||
this.options.externalControl.show();
|
||||
this._saving = false;
|
||||
this._editing = false;
|
||||
this._oldInnerHTML = null;
|
||||
this.triggerCallback('onLeaveEditMode');
|
||||
},
|
||||
leaveHover: function(e) {
|
||||
if (this.options.hoverClassName)
|
||||
this.element.removeClassName(this.options.hoverClassName);
|
||||
if (this._saving) return;
|
||||
this.triggerCallback('onLeaveHover');
|
||||
},
|
||||
loadExternalText: function() {
|
||||
this._form.addClassName(this.options.loadingClassName);
|
||||
this._controls.editor.disabled = true;
|
||||
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
||||
Object.extend(options, {
|
||||
parameters: 'editorId=' + encodeURIComponent(this.element.id),
|
||||
onComplete: Prototype.emptyFunction,
|
||||
onSuccess: function(transport) {
|
||||
this._form.removeClassName(this.options.loadingClassName);
|
||||
var text = transport.responseText;
|
||||
if (this.options.stripLoadedTextTags)
|
||||
text = text.stripTags();
|
||||
this._controls.editor.value = text;
|
||||
this._controls.editor.disabled = false;
|
||||
this.postProcessEditField();
|
||||
}.bind(this),
|
||||
onFailure: this._boundFailureHandler
|
||||
});
|
||||
new Ajax.Request(this.options.loadTextURL, options);
|
||||
},
|
||||
postProcessEditField: function() {
|
||||
var fpc = this.options.fieldPostCreation;
|
||||
if (fpc)
|
||||
$(this._controls.editor)['focus' == fpc ? 'focus' : 'activate']();
|
||||
},
|
||||
prepareOptions: function() {
|
||||
this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions);
|
||||
Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks);
|
||||
[this._extraDefaultOptions].flatten().compact().each(function(defs) {
|
||||
Object.extend(this.options, defs);
|
||||
}.bind(this));
|
||||
},
|
||||
prepareSubmission: function() {
|
||||
this._saving = true;
|
||||
this.removeForm();
|
||||
this.leaveHover();
|
||||
this.showSaving();
|
||||
},
|
||||
registerListeners: function() {
|
||||
this._listeners = { };
|
||||
var listener;
|
||||
$H(Ajax.InPlaceEditor.Listeners).each(function(pair) {
|
||||
listener = this[pair.value].bind(this);
|
||||
this._listeners[pair.key] = listener;
|
||||
if (!this.options.externalControlOnly)
|
||||
this.element.observe(pair.key, listener);
|
||||
if (this.options.externalControl)
|
||||
this.options.externalControl.observe(pair.key, listener);
|
||||
}.bind(this));
|
||||
},
|
||||
removeForm: function() {
|
||||
if (!this._form) return;
|
||||
this._form.remove();
|
||||
this._form = null;
|
||||
this._controls = { };
|
||||
},
|
||||
showSaving: function() {
|
||||
this._oldInnerHTML = this.element.innerHTML;
|
||||
this.element.innerHTML = this.options.savingText;
|
||||
this.element.addClassName(this.options.savingClassName);
|
||||
this.element.style.backgroundColor = this._originalBackground;
|
||||
this.element.show();
|
||||
},
|
||||
triggerCallback: function(cbName, arg) {
|
||||
if ('function' == typeof this.options[cbName]) {
|
||||
this.options[cbName](this, arg);
|
||||
}
|
||||
},
|
||||
unregisterListeners: function() {
|
||||
$H(this._listeners).each(function(pair) {
|
||||
if (!this.options.externalControlOnly)
|
||||
this.element.stopObserving(pair.key, pair.value);
|
||||
if (this.options.externalControl)
|
||||
this.options.externalControl.stopObserving(pair.key, pair.value);
|
||||
}.bind(this));
|
||||
},
|
||||
wrapUp: function(transport) {
|
||||
this.leaveEditMode();
|
||||
// Can't use triggerCallback due to backward compatibility: requires
|
||||
// binding + direct element
|
||||
this._boundComplete(transport, this.element);
|
||||
}
|
||||
});
|
||||
|
||||
Object.extend(Ajax.InPlaceEditor.prototype, {
|
||||
dispose: Ajax.InPlaceEditor.prototype.destroy
|
||||
});
|
||||
|
||||
Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, {
|
||||
initialize: function($super, element, url, options) {
|
||||
this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions;
|
||||
$super(element, url, options);
|
||||
},
|
||||
|
||||
createEditField: function() {
|
||||
var list = document.createElement('select');
|
||||
list.name = this.options.paramName;
|
||||
list.size = 1;
|
||||
this._controls.editor = list;
|
||||
this._collection = this.options.collection || [];
|
||||
if (this.options.loadCollectionURL)
|
||||
this.loadCollection();
|
||||
else
|
||||
this.checkForExternalText();
|
||||
this._form.appendChild(this._controls.editor);
|
||||
},
|
||||
|
||||
loadCollection: function() {
|
||||
this._form.addClassName(this.options.loadingClassName);
|
||||
this.showLoadingText(this.options.loadingCollectionText);
|
||||
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
||||
Object.extend(options, {
|
||||
parameters: 'editorId=' + encodeURIComponent(this.element.id),
|
||||
onComplete: Prototype.emptyFunction,
|
||||
onSuccess: function(transport) {
|
||||
var js = transport.responseText.strip();
|
||||
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
|
||||
throw('Server returned an invalid collection representation.');
|
||||
this._collection = eval(js);
|
||||
this.checkForExternalText();
|
||||
}.bind(this),
|
||||
onFailure: this.onFailure
|
||||
});
|
||||
new Ajax.Request(this.options.loadCollectionURL, options);
|
||||
},
|
||||
|
||||
showLoadingText: function(text) {
|
||||
this._controls.editor.disabled = true;
|
||||
var tempOption = this._controls.editor.firstChild;
|
||||
if (!tempOption) {
|
||||
tempOption = document.createElement('option');
|
||||
tempOption.value = '';
|
||||
this._controls.editor.appendChild(tempOption);
|
||||
tempOption.selected = true;
|
||||
}
|
||||
tempOption.update((text || '').stripScripts().stripTags());
|
||||
},
|
||||
|
||||
checkForExternalText: function() {
|
||||
this._text = this.getText();
|
||||
if (this.options.loadTextURL)
|
||||
this.loadExternalText();
|
||||
else
|
||||
this.buildOptionList();
|
||||
},
|
||||
|
||||
loadExternalText: function() {
|
||||
this.showLoadingText(this.options.loadingText);
|
||||
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
|
||||
Object.extend(options, {
|
||||
parameters: 'editorId=' + encodeURIComponent(this.element.id),
|
||||
onComplete: Prototype.emptyFunction,
|
||||
onSuccess: function(transport) {
|
||||
this._text = transport.responseText.strip();
|
||||
this.buildOptionList();
|
||||
}.bind(this),
|
||||
onFailure: this.onFailure
|
||||
});
|
||||
new Ajax.Request(this.options.loadTextURL, options);
|
||||
},
|
||||
|
||||
buildOptionList: function() {
|
||||
this._form.removeClassName(this.options.loadingClassName);
|
||||
this._collection = this._collection.map(function(entry) {
|
||||
return 2 === entry.length ? entry : [entry, entry].flatten();
|
||||
});
|
||||
var marker = ('value' in this.options) ? this.options.value : this._text;
|
||||
var textFound = this._collection.any(function(entry) {
|
||||
return entry[0] == marker;
|
||||
}.bind(this));
|
||||
this._controls.editor.update('');
|
||||
var option;
|
||||
this._collection.each(function(entry, index) {
|
||||
option = document.createElement('option');
|
||||
option.value = entry[0];
|
||||
option.selected = textFound ? entry[0] == marker : 0 == index;
|
||||
option.appendChild(document.createTextNode(entry[1]));
|
||||
this._controls.editor.appendChild(option);
|
||||
}.bind(this));
|
||||
this._controls.editor.disabled = false;
|
||||
Field.scrollFreeActivate(this._controls.editor);
|
||||
}
|
||||
});
|
||||
|
||||
//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! ****
|
||||
//**** This only exists for a while, in order to let ****
|
||||
//**** users adapt to the new API. Read up on the new ****
|
||||
//**** API and convert your code to it ASAP! ****
|
||||
|
||||
Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) {
|
||||
if (!options) return;
|
||||
function fallback(name, expr) {
|
||||
if (name in options || expr === undefined) return;
|
||||
options[name] = expr;
|
||||
};
|
||||
fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' :
|
||||
options.cancelLink == options.cancelButton == false ? false : undefined)));
|
||||
fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' :
|
||||
options.okLink == options.okButton == false ? false : undefined)));
|
||||
fallback('highlightColor', options.highlightcolor);
|
||||
fallback('highlightEndColor', options.highlightendcolor);
|
||||
};
|
||||
|
||||
Object.extend(Ajax.InPlaceEditor, {
|
||||
DefaultOptions: {
|
||||
ajaxOptions: { },
|
||||
autoRows: 3, // Use when multi-line w/ rows == 1
|
||||
cancelControl: 'link', // 'link'|'button'|false
|
||||
cancelText: 'cancel',
|
||||
clickToEditText: 'Click to edit',
|
||||
externalControl: null, // id|elt
|
||||
externalControlOnly: false,
|
||||
fieldPostCreation: 'activate', // 'activate'|'focus'|false
|
||||
formClassName: 'inplaceeditor-form',
|
||||
formId: null, // id|elt
|
||||
highlightColor: '#ffff99',
|
||||
highlightEndColor: '#ffffff',
|
||||
hoverClassName: '',
|
||||
htmlResponse: true,
|
||||
loadingClassName: 'inplaceeditor-loading',
|
||||
loadingText: 'Loading...',
|
||||
okControl: 'button', // 'link'|'button'|false
|
||||
okText: 'ok',
|
||||
paramName: 'value',
|
||||
rows: 1, // If 1 and multi-line, uses autoRows
|
||||
savingClassName: 'inplaceeditor-saving',
|
||||
savingText: 'Saving...',
|
||||
size: 0,
|
||||
stripLoadedTextTags: false,
|
||||
submitOnBlur: false,
|
||||
textAfterControls: '',
|
||||
textBeforeControls: '',
|
||||
textBetweenControls: ''
|
||||
},
|
||||
DefaultCallbacks: {
|
||||
callback: function(form) {
|
||||
return Form.serialize(form);
|
||||
},
|
||||
onComplete: function(transport, element) {
|
||||
// For backward compatibility, this one is bound to the IPE, and passes
|
||||
// the element directly. It was too often customized, so we don't break it.
|
||||
new Effect.Highlight(element, {
|
||||
startcolor: this.options.highlightColor, keepBackgroundImage: true });
|
||||
},
|
||||
onEnterEditMode: null,
|
||||
onEnterHover: function(ipe) {
|
||||
ipe.element.style.backgroundColor = ipe.options.highlightColor;
|
||||
if (ipe._effect)
|
||||
ipe._effect.cancel();
|
||||
},
|
||||
onFailure: function(transport, ipe) {
|
||||
alert('Error communication with the server: ' + transport.responseText.stripTags());
|
||||
},
|
||||
onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls.
|
||||
onLeaveEditMode: null,
|
||||
onLeaveHover: function(ipe) {
|
||||
ipe._effect = new Effect.Highlight(ipe.element, {
|
||||
startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor,
|
||||
restorecolor: ipe._originalBackground, keepBackgroundImage: true
|
||||
});
|
||||
}
|
||||
},
|
||||
Listeners: {
|
||||
click: 'enterEditMode',
|
||||
keydown: 'checkForEscapeOrReturn',
|
||||
mouseover: 'enterHover',
|
||||
mouseout: 'leaveHover'
|
||||
}
|
||||
});
|
||||
|
||||
Ajax.InPlaceCollectionEditor.DefaultOptions = {
|
||||
loadingCollectionText: 'Loading options...'
|
||||
};
|
||||
|
||||
// Delayed observer, like Form.Element.Observer,
|
||||
// but waits for delay after last key input
|
||||
// Ideal for live-search fields
|
||||
|
||||
Form.Element.DelayedObserver = Class.create({
|
||||
initialize: function(element, delay, callback) {
|
||||
this.delay = delay || 0.5;
|
||||
this.element = $(element);
|
||||
this.callback = callback;
|
||||
this.timer = null;
|
||||
this.lastValue = $F(this.element);
|
||||
Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
|
||||
},
|
||||
delayedListener: function(event) {
|
||||
if(this.lastValue == $F(this.element)) return;
|
||||
if(this.timer) clearTimeout(this.timer);
|
||||
this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
|
||||
this.lastValue = $F(this.element);
|
||||
},
|
||||
onTimerEvent: function() {
|
||||
this.timer = null;
|
||||
this.callback(this.element, $F(this.element));
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,143 @@
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function stopjam(){
|
||||
var d = new Date();
|
||||
var curr_hour = d.getHours();
|
||||
var curr_min = d.getMinutes();
|
||||
var curr_sec = d.getSeconds();
|
||||
document.getElementById('stop_daftar').value=(curr_hour + ":" + curr_min+ ":" + curr_sec);
|
||||
}
|
||||
</SCRIPT>
|
||||
|
||||
|
||||
<?php /*
|
||||
function datediff($d1, $d2){
|
||||
$d1 = (is_string($d1) ? strtotime($d1) : $d1);
|
||||
$d2 = (is_string($d2) ? strtotime($d2) : $d2);
|
||||
$diff_secs = abs($d1 - $d2);
|
||||
$base_year = min(date("Y", $d1), date("Y", $d2));
|
||||
$diff = mktime(0, 0, $diff_secs, 1, 1, $base_year);
|
||||
return array( "years" => date("Y", $diff) - $base_year, "months_total" => (date("Y", $diff) - $base_year) * 12 + date("n", $diff) - 1, "months" => date("n", $diff) - 1, "days_total" => floor($diff_secs / (3600 * 24)), "days" => date("j", $diff) - 1, "hours_total" => floor($diff_secs / 3600), "hours" => date("G", $diff), "minutes_total" => floor($diff_secs / 60), "minutes" => (int) date("i", $diff), "seconds_total" => $diff_secs, "seconds" => (int) date("s", $diff) );
|
||||
} //$a = datediff("1979-02-07", "2009-08-24");
|
||||
//echo 'umur '.$a['years'].' tahun '.$a['months'].' bulan'; */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id='msg'></div>
|
||||
<div id="list_data"></div>
|
||||
<fieldset class="fieldset"><legend>Identitas Pasien</legend>
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" title=" From Ini Berfungsi Sebagai Form Entry Data Pasien Baru.">
|
||||
<tr>
|
||||
<td width="20%">Nama Lengkap Pasien</td>
|
||||
<td width="56%"><input title="NAMA" class="text" type="text" <?php if($_POST['nama_lgkp']){ echo"value='".$_POST['nama_lgkp']."'";} ?> name="NAMA" size="30" value="<?=$m_pasien->NAMA?>" id="AWAL" /></td>
|
||||
<td width="24%" rowspan="11" valign="top"> Jenis Kelamin :<br />
|
||||
<input type="radio" name="JENISKELAMIN" value="L" <?php if($m_pasien->JENISKELAMIN=="L" || $m_pasien->JENISKELAMIN=="l" || $_POST['JENISKELAMIN'] =="1")echo "Checked";?>/>
|
||||
Laki-laki<br />
|
||||
<input type="radio" name="JENISKELAMIN" value="P" <?php if($m_pasien->JENISKELAMIN=="P" || $_POST['JENISKELAMIN'] =="2")echo "Checked";?>/>
|
||||
Perempuan<br />
|
||||
<br />
|
||||
Status Perkawinan :<br />
|
||||
|
||||
<input type="radio" name="STATUS" value="1" <?php if($m_pasien->STATUS=="1" || $_POST['KAWIN']=="1")echo "Checked";?>/>
|
||||
Belum Kawin<br />
|
||||
<input type="radio" name="STATUS" value="2" <?php if($m_pasien->STATUS=="2" || $_POST['KAWIN']=="2")echo "Checked";?> />
|
||||
Kawin<br />
|
||||
<input type="radio" name="STATUS" value="3" <?php if($m_pasien->STATUS=="3" || $_POST['KAWIN']=="3")echo "Checked";?>/>
|
||||
Janda / Duda<br /><br />
|
||||
|
||||
Pendidikan Terakhir :<br />
|
||||
<input type="radio" name="PENDIDIKAN" value="1" <?php if($m_pasien->PENDIDIKAN=="1" || $_POST['PENDIDIKAN']=="1" )echo "Checked";?> />
|
||||
SD<br />
|
||||
<input type="radio" name="PENDIDIKAN" value="2" <?php if($m_pasien->PENDIDIKAN=="2" || $_POST['PENDIDIKAN']=="2" )echo "Checked";?> />
|
||||
SLTP<br />
|
||||
<input type="radio" name="PENDIDIKAN" value="3" <?php if($m_pasien->PENDIDIKAN=="3" || $_POST['PENDIDIKAN']=="3" )echo "Checked";?> />
|
||||
SMU<br />
|
||||
<input type="radio" name="PENDIDIKAN" value="4" <?php if($m_pasien->PENDIDIKAN=="4" || $_POST['PENDIDIKAN']=="4" )echo "Checked";?> />
|
||||
D3/Akademik<br />
|
||||
<input type="radio" name="PENDIDIKAN" value="5" <?php if($m_pasien->PENDIDIKAN=="5" || $_POST['PENDIDIKAN']=="5" )echo "Checked";?> />
|
||||
Universitas<br /><br />
|
||||
|
||||
Agama :<br />
|
||||
<input type="radio" name="AGAMA" value="1" <?php if($m_pasien->AGAMA=="1" || $_POST['AGAMA']=="1" )echo "Checked";?> />
|
||||
Islam<br />
|
||||
|
||||
<input type="radio" name="AGAMA" value="2" <?php if($m_pasien->AGAMA=="2" || $_POST['AGAMA']=="2" )echo "Checked";?>/>
|
||||
Kristen Protestan<br />
|
||||
|
||||
<input type="radio" name="AGAMA" value="3" <?php if($m_pasien->AGAMA=="3" || $_POST['AGAMA']=="3" )echo "Checked";?>/>
|
||||
Katholik<br />
|
||||
|
||||
<input type="radio" name="AGAMA" value="4" <?php if($m_pasien->AGAMA=="4" || $_POST['AGAMA']=="4" )echo "Checked";?>/>
|
||||
Hindu<br />
|
||||
|
||||
<input type="radio" name="AGAMA" value="5" <?php if($m_pasien->AGAMA=="5" || $_POST['AGAMA']=="5" )echo "Checked";?>/>
|
||||
Budha<br />
|
||||
|
||||
<input type="radio" name="AGAMA" value="6" <?php if($m_pasien->AGAMA=="6" || $_POST['AGAMA']=="6" || $_POST['AGAMA']=="7" )echo "Checked";?>/>
|
||||
Lain - lain </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tempat Tanggal Lahir</td>
|
||||
<td>Tempat
|
||||
<input type="text" value="<?php if($m_pasien->TEMPAT || $_POST['tmpt_lhr']){ echo $_POST['tmpt_lhr'].$m_pasien->TEMPAT; }?>" class="text" name="TEMPAT" size="15" />
|
||||
<input onblur="calage(this.value,'umur');" type="text" class="text" value="<?php if($m_pasien->TGLLAHIR || $_POST['tgl_lhr']){ echo $_POST['tgl_lhr'].$m_pasien->TGLLAHIR; }?>" name="TGLLAHIR" id="TGLLAHIR" size="20" /> ex : 1999/09/29</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Umur Pasien</td>
|
||||
<td>
|
||||
<?php
|
||||
$a = datediff($_POST['tgl_lhr'], date("Y/m/d"));
|
||||
?><span id="umurc">
|
||||
<input class="text" type="text" value="<?php echo $a['years'].' tahun '.$a['months'].' bulan '.$a['days'].' hari'; ?>" name="umur" id="umur" size="45" />
|
||||
</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Alamat Pasien</td>
|
||||
<td colspan="1"><input name="ALAMAT" class="text" type="text" value="<?php if($m_pasien->ALAMAT || $_POST['ALAMAT']){echo $_POST['ALAMAT'].$m_pasien->ALAMAT;} ?>" size="45" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kelurahan</td>
|
||||
<td><input class="text" type="text" value="<?php if($m_pasien->KELURAHAN || $_POST['KELURAHAN']){ echo $_POST['KELURAHAN'].$m_pasien->KELURAHAN;}?>" name="KELURAHAN" size="25" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kecamatan</td>
|
||||
<td><input class="text" type="text" value="<?php if($m_pasien->KECAMATAN || $_POST['KECAMATAN']){ echo $_POST['KECAMATAN'].$m_pasien->KECAMATAN;}?>" name="KECAMATAN" size="25" /><input type="hidden" value="<?=$_POST['KDKECAMATAN']?>" name="KDKECAMATAN" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kota</td>
|
||||
<td><input class="text" value="<?php if($m_pasien->KOTA || $_POST['KOTA']){echo $_POST['KOTA'].$m_pasien->KOTA;}?>" type="text" name="KOTA" size="25" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>No Telepon / HP Pasien</td>
|
||||
<td><input class="text" value="<?php if($m_pasien->NOTELP || $_POST['NOTELP']){echo $_POST['NOTELP'].$m_pasien->NOTELP;}?>" type="text" name="NOTELP" size="25" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>No KTP </td>
|
||||
<td><input class="text" value="<?php if($m_pasien->NOKTP || $_POST['nik']){echo $_POST['nik'].$m_pasien->NOKTP;}?>" type="text" name="NOKTP" size="25" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nama Suami / Orang Tua Pasien</td>
|
||||
<td><input class="text" type="text" value="<?php if($m_pasien->SUAMI_ORTU || $_POST['SUAMI_ORTU']){echo $_POST['SUAMI_ORTU'].$m_pasien->SUAMI_ORTU;}?>" name="SUAMI_ORTU" id="SUAMI_ORTU" size="25" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td valign="top">Pekerjaan Pasien / Orang Tua</td>
|
||||
<td><input class="text" type="text" value="<?php if($m_pasien->PEKERJAAN || $_POST['pkrjn']){echo $_POST['pkrjn'].$m_pasien->SUAMI_ORTU;}?>" name="PEKERJAAN" size="25" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td colspan="2"><input type='hidden' name='stop_daftar' id='stop_daftar' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="right"><input type="submit" name="daftar" class="text" value=" S a v e "
|
||||
onclick="stopjam();submitformpendaftaran(document.getElementById('myform'),'models/pendaftaran.php','msg',validatetask);
|
||||
document.getElementById('msgid').value=document.getElementById('msg').innerHTML;
|
||||
if (document.getElementById('msgid').value=='.'){alert('Simpan Data Sukses');window.location='<?php echo _BASE_;?>index.php?link=2';return false;} else {return false;}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="text" id="msgid" name="msgid" style="border:1px #FFF solid; width:0px; height:0px;">
|
||||
<br>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
class database{
|
||||
function connect($host, $db_user, $db_pass, $db_name) {
|
||||
global $conf,$main;
|
||||
mysql_connect("$host","$db_user","$db_pass") ;
|
||||
mysql_select_db("$db_name") or die($main->redirect('http://'.$conf[main_url].'/template/nodb.php',''));
|
||||
}
|
||||
function closedb(){
|
||||
mysqli_close($this->connect);
|
||||
}
|
||||
function Query($table){
|
||||
$query = $db->query("select * from '".$table."'");
|
||||
echo $query;
|
||||
return $query;
|
||||
}
|
||||
function saveQuery($sql){
|
||||
$query = $db->query($sql) ;
|
||||
return $query;
|
||||
|
||||
}
|
||||
function loadQuery($query){
|
||||
$sql = $this->saveQuery($query);
|
||||
$array = array();
|
||||
while ($rows = mysqli_fetch_array( $sql )){
|
||||
$array[] = $rows;
|
||||
}
|
||||
mysqli_free_result( $sql );
|
||||
return $array;
|
||||
}
|
||||
function insert($var,$table,$where,$id){
|
||||
foreach($var as $key=>$val){
|
||||
$txts[] = " $key = '".$val."'";
|
||||
}
|
||||
$val = join(",\n",$txts);
|
||||
if($id == ''){
|
||||
$sql = 'insert into '.$table.' set '.$val.'';
|
||||
}else{
|
||||
$sql = "update ".$table." set ".$val." where ".$where." = '".$id."'";
|
||||
}
|
||||
$db->query($sql) or die ('error');
|
||||
}
|
||||
function delete($var,$table,$where,$id){
|
||||
$sql = 'delete from '.$table.' where '.$where.' = "'.$id.'"';
|
||||
$this->saveQuery($sql);
|
||||
}
|
||||
function bindparam($_param, $fldlist,$ret = 1) {
|
||||
if(!trim($fldlist)) return;
|
||||
if(!is_array($fldlist))
|
||||
$fldlist = split(',',str_replace(' ','',$fldlist));
|
||||
$par = array();
|
||||
foreach($fldlist as $fld) {
|
||||
global ${$fld};
|
||||
${$fld} = $_param[$fld];
|
||||
|
||||
$par[$fld] = $_param[$fld];
|
||||
}
|
||||
|
||||
if($ret) return $par;
|
||||
}
|
||||
function bindrequest($fldlist) {
|
||||
return bindparam($_REQUEST,$fldlist);
|
||||
}
|
||||
function publish($table,$where,$id,$default){
|
||||
if($default == '1'){ $val = '0'; }else{ $val = '1' ; }
|
||||
$sql = "update ".$table." set published =".$val." where ".$where." = '".$id."'";
|
||||
$this->saveQuery($sql);
|
||||
}
|
||||
function Fpage($table,$where,$id,$default){
|
||||
if($default == '1'){ $val = '0'; }else{ $val = '1' ; }
|
||||
$sql = "update ".$table." set fp=".$val." where ".$where." = '".$id."'";
|
||||
$this->saveQuery($sql);
|
||||
}
|
||||
function getTotal($query){
|
||||
$sql = $this->saveQuery($query);
|
||||
$rows = mysqli_num_rows( $sql );
|
||||
mysqli_free_result( $sql );
|
||||
return $rows;
|
||||
}
|
||||
function getOrder($query){
|
||||
$sql = $this->saveQuery($query);
|
||||
$rows = mysqli_fetch_array( $sql );
|
||||
$row = $rows[0] + 1;
|
||||
mysqli_free_result( $sql );
|
||||
return $row;
|
||||
}
|
||||
function getPublish($query){
|
||||
$sql = $this->saveQuery($query);
|
||||
$rows = mysqli_fetch_array( $sql );
|
||||
$row = $rows[0];
|
||||
mysqli_free_result( $sql );
|
||||
return $row;
|
||||
}
|
||||
function getFpage($query){
|
||||
$sql = $this->saveQuery($query);
|
||||
$rows = mysqli_fetch_array( $sql );
|
||||
$row = $rows[0];
|
||||
mysqli_free_result( $sql );
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
/*
|
||||
* Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, version 2.1.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* $Revision: 1.2 $
|
||||
*/
|
||||
|
||||
Date.parseFunctions = {count:0};
|
||||
Date.parseRegexes = [];
|
||||
Date.formatFunctions = {count:0};
|
||||
|
||||
Date.prototype.dateFormat = function(format) {
|
||||
if (Date.formatFunctions[format] == null) {
|
||||
Date.createNewFormat(format);
|
||||
}
|
||||
var func = Date.formatFunctions[format];
|
||||
return this[func]();
|
||||
}
|
||||
|
||||
Date.createNewFormat = function(format) {
|
||||
var funcName = "format" + Date.formatFunctions.count++;
|
||||
Date.formatFunctions[format] = funcName;
|
||||
var code = "Date.prototype." + funcName + " = function(){return ";
|
||||
var special = false;
|
||||
var ch = '';
|
||||
for (var i = 0; i < format.length; ++i) {
|
||||
ch = format.charAt(i);
|
||||
if (!special && ch == "\\") {
|
||||
special = true;
|
||||
}
|
||||
else if (special) {
|
||||
special = false;
|
||||
code += "'" + String.escape(ch) + "' + ";
|
||||
}
|
||||
else {
|
||||
code += Date.getFormatCode(ch);
|
||||
}
|
||||
}
|
||||
eval(code.substring(0, code.length - 3) + ";}");
|
||||
}
|
||||
|
||||
Date.getFormatCode = function(character) {
|
||||
switch (character) {
|
||||
case "d":
|
||||
return "String.leftPad(this.getDate(), 2, '0') + ";
|
||||
case "D":
|
||||
return "Date.dayNames[this.getDay()].substring(0, 3) + ";
|
||||
case "j":
|
||||
return "this.getDate() + ";
|
||||
case "l":
|
||||
return "Date.dayNames[this.getDay()] + ";
|
||||
case "S":
|
||||
return "this.getSuffix() + ";
|
||||
case "w":
|
||||
return "this.getDay() + ";
|
||||
case "z":
|
||||
return "this.getDayOfYear() + ";
|
||||
case "W":
|
||||
return "this.getWeekOfYear() + ";
|
||||
case "F":
|
||||
return "Date.monthNames[this.getMonth()] + ";
|
||||
case "m":
|
||||
return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
|
||||
case "M":
|
||||
return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
|
||||
case "n":
|
||||
return "(this.getMonth() + 1) + ";
|
||||
case "t":
|
||||
return "this.getDaysInMonth() + ";
|
||||
case "L":
|
||||
return "(this.isLeapYear() ? 1 : 0) + ";
|
||||
case "Y":
|
||||
return "this.getFullYear() + ";
|
||||
case "y":
|
||||
return "('' + this.getFullYear()).substring(2, 4) + ";
|
||||
case "a":
|
||||
return "(this.getHours() < 12 ? 'am' : 'pm') + ";
|
||||
case "A":
|
||||
return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
|
||||
case "g":
|
||||
return "((this.getHours() %12) ? this.getHours() % 12 : 12) + ";
|
||||
case "G":
|
||||
return "this.getHours() + ";
|
||||
case "h":
|
||||
return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
|
||||
case "H":
|
||||
return "String.leftPad(this.getHours(), 2, '0') + ";
|
||||
case "i":
|
||||
return "String.leftPad(this.getMinutes(), 2, '0') + ";
|
||||
case "s":
|
||||
return "String.leftPad(this.getSeconds(), 2, '0') + ";
|
||||
case "O":
|
||||
return "this.getGMTOffset() + ";
|
||||
case "T":
|
||||
return "this.getTimezone() + ";
|
||||
case "Z":
|
||||
return "(this.getTimezoneOffset() * -60) + ";
|
||||
default:
|
||||
return "'" + String.escape(character) + "' + ";
|
||||
}
|
||||
}
|
||||
|
||||
Date.parseDate = function(input, format) {
|
||||
if (Date.parseFunctions[format] == null) {
|
||||
Date.createParser(format);
|
||||
}
|
||||
var func = Date.parseFunctions[format];
|
||||
return Date[func](input);
|
||||
}
|
||||
|
||||
Date.createParser = function(format) {
|
||||
var funcName = "parse" + Date.parseFunctions.count++;
|
||||
var regexNum = Date.parseRegexes.length;
|
||||
var currentGroup = 1;
|
||||
Date.parseFunctions[format] = funcName;
|
||||
|
||||
var code = "Date." + funcName + " = function(input){\n"
|
||||
+ "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1;\n"
|
||||
+ "var d = new Date();\n"
|
||||
+ "y = d.getFullYear();\n"
|
||||
+ "m = d.getMonth();\n"
|
||||
+ "d = d.getDate();\n"
|
||||
+ "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
|
||||
+ "if (results && results.length > 0) {"
|
||||
var regex = "";
|
||||
|
||||
var special = false;
|
||||
var ch = '';
|
||||
for (var i = 0; i < format.length; ++i) {
|
||||
ch = format.charAt(i);
|
||||
if (!special && ch == "\\") {
|
||||
special = true;
|
||||
}
|
||||
else if (special) {
|
||||
special = false;
|
||||
regex += String.escape(ch);
|
||||
}
|
||||
else {
|
||||
obj = Date.formatCodeToRegex(ch, currentGroup);
|
||||
currentGroup += obj.g;
|
||||
regex += obj.s;
|
||||
if (obj.g && obj.c) {
|
||||
code += obj.c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
code += "if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
|
||||
+ "{return new Date(y, m, d, h, i, s);}\n"
|
||||
+ "else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
|
||||
+ "{return new Date(y, m, d, h, i);}\n"
|
||||
+ "else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n"
|
||||
+ "{return new Date(y, m, d, h);}\n"
|
||||
+ "else if (y > 0 && m >= 0 && d > 0)\n"
|
||||
+ "{return new Date(y, m, d);}\n"
|
||||
+ "else if (y > 0 && m >= 0)\n"
|
||||
+ "{return new Date(y, m);}\n"
|
||||
+ "else if (y > 0)\n"
|
||||
+ "{return new Date(y);}\n"
|
||||
+ "}return null;}";
|
||||
|
||||
Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
|
||||
eval(code);
|
||||
}
|
||||
|
||||
Date.formatCodeToRegex = function(character, currentGroup) {
|
||||
switch (character) {
|
||||
case "D":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
|
||||
case "j":
|
||||
case "d":
|
||||
return {g:1,
|
||||
c:"d = parseInt(results[" + currentGroup + "], 10);\n",
|
||||
s:"(\\d{1,2})"};
|
||||
case "l":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"(?:" + Date.dayNames.join("|") + ")"};
|
||||
case "S":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"(?:st|nd|rd|th)"};
|
||||
case "w":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"\\d"};
|
||||
case "z":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"(?:\\d{1,3})"};
|
||||
case "W":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"(?:\\d{2})"};
|
||||
case "F":
|
||||
return {g:1,
|
||||
c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
|
||||
s:"(" + Date.monthNames.join("|") + ")"};
|
||||
case "M":
|
||||
return {g:1,
|
||||
c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
|
||||
s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
|
||||
case "n":
|
||||
case "m":
|
||||
return {g:1,
|
||||
c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
|
||||
s:"(\\d{1,2})"};
|
||||
case "t":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"\\d{1,2}"};
|
||||
case "L":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"(?:1|0)"};
|
||||
case "Y":
|
||||
return {g:1,
|
||||
c:"y = parseInt(results[" + currentGroup + "], 10);\n",
|
||||
s:"(\\d{4})"};
|
||||
case "y":
|
||||
return {g:1,
|
||||
c:"var ty = parseInt(results[" + currentGroup + "], 10);\n"
|
||||
+ "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
|
||||
s:"(\\d{1,2})"};
|
||||
case "a":
|
||||
return {g:1,
|
||||
c:"if (results[" + currentGroup + "] == 'am') {\n"
|
||||
+ "if (h == 12) { h = 0; }\n"
|
||||
+ "} else { if (h < 12) { h += 12; }}",
|
||||
s:"(am|pm)"};
|
||||
case "A":
|
||||
return {g:1,
|
||||
c:"if (results[" + currentGroup + "] == 'AM') {\n"
|
||||
+ "if (h == 12) { h = 0; }\n"
|
||||
+ "} else { if (h < 12) { h += 12; }}",
|
||||
s:"(AM|PM)"};
|
||||
case "g":
|
||||
case "G":
|
||||
case "h":
|
||||
case "H":
|
||||
return {g:1,
|
||||
c:"h = parseInt(results[" + currentGroup + "], 10);\n",
|
||||
s:"(\\d{1,2})"};
|
||||
case "i":
|
||||
return {g:1,
|
||||
c:"i = parseInt(results[" + currentGroup + "], 10);\n",
|
||||
s:"(\\d{2})"};
|
||||
case "s":
|
||||
return {g:1,
|
||||
c:"s = parseInt(results[" + currentGroup + "], 10);\n",
|
||||
s:"(\\d{2})"};
|
||||
case "O":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"[+-]\\d{4}"};
|
||||
case "T":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"[A-Z]{3}"};
|
||||
case "Z":
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:"[+-]\\d{1,5}"};
|
||||
default:
|
||||
return {g:0,
|
||||
c:null,
|
||||
s:String.escape(character)};
|
||||
}
|
||||
}
|
||||
|
||||
Date.prototype.getTimezone = function() {
|
||||
return this.toString().replace(
|
||||
/^.*? ([A-Z]{3}) [0-9]{4}.*$/, "$1").replace(
|
||||
/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3");
|
||||
}
|
||||
|
||||
Date.prototype.getGMTOffset = function() {
|
||||
return (this.getTimezoneOffset() > 0 ? "-" : "+")
|
||||
+ String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, "0")
|
||||
+ String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
|
||||
}
|
||||
|
||||
Date.prototype.getDayOfYear = function() {
|
||||
var num = 0;
|
||||
Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
|
||||
for (var i = 0; i < this.getMonth(); ++i) {
|
||||
num += Date.daysInMonth[i];
|
||||
}
|
||||
return num + this.getDate() - 1;
|
||||
}
|
||||
|
||||
Date.prototype.getWeekOfYear = function() {
|
||||
// Skip to Thursday of this week
|
||||
var now = this.getDayOfYear() + (4 - this.getDay());
|
||||
// Find the first Thursday of the year
|
||||
var jan1 = new Date(this.getFullYear(), 0, 1);
|
||||
var then = (7 - jan1.getDay() + 4);
|
||||
document.write(then);
|
||||
return String.leftPad(((now - then) / 7) + 1, 2, "0");
|
||||
}
|
||||
|
||||
Date.prototype.isLeapYear = function() {
|
||||
var year = this.getFullYear();
|
||||
return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
|
||||
}
|
||||
|
||||
Date.prototype.getFirstDayOfMonth = function() {
|
||||
var day = (this.getDay() - (this.getDate() - 1)) % 7;
|
||||
return (day < 0) ? (day + 7) : day;
|
||||
}
|
||||
|
||||
Date.prototype.getLastDayOfMonth = function() {
|
||||
var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
|
||||
return (day < 0) ? (day + 7) : day;
|
||||
}
|
||||
|
||||
Date.prototype.getDaysInMonth = function() {
|
||||
Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
|
||||
return Date.daysInMonth[this.getMonth()];
|
||||
}
|
||||
|
||||
Date.prototype.getSuffix = function() {
|
||||
switch (this.getDate()) {
|
||||
case 1:
|
||||
case 21:
|
||||
case 31:
|
||||
return "st";
|
||||
case 2:
|
||||
case 22:
|
||||
return "nd";
|
||||
case 3:
|
||||
case 23:
|
||||
return "rd";
|
||||
default:
|
||||
return "th";
|
||||
}
|
||||
}
|
||||
|
||||
String.escape = function(string) {
|
||||
return string.replace(/('|\\)/g, "\\$1");
|
||||
}
|
||||
|
||||
String.leftPad = function (val, size, ch) {
|
||||
var result = new String(val);
|
||||
if (ch == null) {
|
||||
ch = " ";
|
||||
}
|
||||
while (result.length < size) {
|
||||
result = ch + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
|
||||
Date.monthNames =
|
||||
["January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December"];
|
||||
Date.dayNames =
|
||||
["Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday"];
|
||||
Date.y2kYear = 50;
|
||||
Date.monthNumbers = {
|
||||
Jan:0,
|
||||
Feb:1,
|
||||
Mar:2,
|
||||
Apr:3,
|
||||
May:4,
|
||||
Jun:5,
|
||||
Jul:6,
|
||||
Aug:7,
|
||||
Sep:8,
|
||||
Oct:9,
|
||||
Nov:10,
|
||||
Dec:11};
|
||||
Date.patterns = {
|
||||
ISO8601LongPattern:"Y-m-d H:i:s",
|
||||
ISO8601ShortPattern:"Y-m-d",
|
||||
ShortDatePattern: "n/j/Y",
|
||||
LongDatePattern: "l, F d, Y",
|
||||
FullDateTimePattern: "l, F d, Y g:i:s A",
|
||||
MonthDayPattern: "F d",
|
||||
ShortTimePattern: "g:i A",
|
||||
LongTimePattern: "g:i:s A",
|
||||
SortableDateTimePattern: "Y-m-d\\TH:i:s",
|
||||
UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
|
||||
YearMonthPattern: "F, Y"};
|
||||
@@ -0,0 +1,34 @@
|
||||
.dateChooser td {
|
||||
cursor: default;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dateChooser td.dateChooserActive:hover {
|
||||
color: white;
|
||||
background: #0A246A;
|
||||
}
|
||||
|
||||
.dateChooser td.dateChooserActiveToday {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.dateChooser th {
|
||||
background: #aaa;
|
||||
color: white;
|
||||
width: 18px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dateChooser option,.dateChooser select {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.dateChooser {
|
||||
border: 2px outset #aaa;
|
||||
background: white;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dateChooser table {
|
||||
width: 160px;
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
* Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, version 2.1.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
*/
|
||||
|
||||
// Shows or hides the date chooser on the page
|
||||
function showChooser(obj, inputId, divId, start, end, format, isTimeChooser) {
|
||||
if (document.getElementById) {
|
||||
var input = document.getElementById(inputId);
|
||||
var div = document.getElementById(divId);
|
||||
if (input !== undefined && div !== undefined) {
|
||||
if (input.DateChooser === undefined) {
|
||||
input.DateChooser = new DateChooser(input, div, start, end, format, isTimeChooser);
|
||||
}
|
||||
input.DateChooser.setDate(Date.parseDate(input.value, format));
|
||||
if (input.DateChooser.isVisible()) {
|
||||
input.DateChooser.hide();
|
||||
}
|
||||
else {
|
||||
input.DateChooser.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sets a date on the object attached to 'inputId'
|
||||
function dateChooserSetDate(inputId, value) {
|
||||
var input = document.getElementById(inputId);
|
||||
if (input !== undefined && input.DateChooser !== undefined) {
|
||||
input.DateChooser.setDate(Date.parseDate(value, input.DateChooser._format));
|
||||
if (input.DateChooser.isTimeChooser()) {
|
||||
var theForm = input.form;
|
||||
var prefix = input.DateChooser._prefix;
|
||||
input.DateChooser.setTime(
|
||||
parseInt(theForm.elements[prefix + 'hour'].options[
|
||||
theForm.elements[prefix + 'hour'].selectedIndex].value)
|
||||
+ parseInt(theForm.elements[prefix + 'ampm'].options[
|
||||
theForm.elements[prefix + 'ampm'].selectedIndex].value),
|
||||
parseInt(theForm.elements[prefix + 'min'].options[
|
||||
theForm.elements[prefix + 'min'].selectedIndex].value));
|
||||
}
|
||||
input.value = input.DateChooser.getValue();
|
||||
input.DateChooser.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// The callback function for when someone changes the pulldown menus on the date
|
||||
// chooser
|
||||
function dateChooserDateChange(theForm, prefix) {
|
||||
var input = document.getElementById(
|
||||
theForm.elements[prefix + 'inputId'].value);
|
||||
var newDate = new Date(
|
||||
theForm.elements[prefix + 'year'].options[
|
||||
theForm.elements[prefix + 'year'].selectedIndex].value,
|
||||
theForm.elements[prefix + 'month'].options[
|
||||
theForm.elements[prefix + 'month'].selectedIndex].value,
|
||||
1);
|
||||
// Try to preserve the day of month (watch out for months with 31 days)
|
||||
newDate.setDate(Math.max(1, Math.min(newDate.getDaysInMonth(),
|
||||
input.DateChooser._date.getDate())));
|
||||
input.DateChooser.setDate(newDate);
|
||||
if (input.DateChooser.isTimeChooser()) {
|
||||
input.DateChooser.setTime(
|
||||
parseInt(theForm.elements[prefix + 'hour'].options[
|
||||
theForm.elements[prefix + 'hour'].selectedIndex].value)
|
||||
+ parseInt(theForm.elements[prefix + 'ampm'].options[
|
||||
theForm.elements[prefix + 'ampm'].selectedIndex].value),
|
||||
parseInt(theForm.elements[prefix + 'min'].options[
|
||||
theForm.elements[prefix + 'min'].selectedIndex].value));
|
||||
}
|
||||
input.DateChooser.show();
|
||||
}
|
||||
|
||||
// Gets the absolute position on the page of the element passed in
|
||||
function getAbsolutePosition(obj) {
|
||||
var result = [0, 0];
|
||||
while (obj != null) {
|
||||
result[0] += obj.offsetTop;
|
||||
result[1] += obj.offsetLeft;
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// DateChooser constructor
|
||||
function DateChooser(input, div, start, end, format, isTimeChooser) {
|
||||
this._input = input;
|
||||
this._div = div;
|
||||
this._start = start;
|
||||
this._end = end;
|
||||
this._format = format;
|
||||
this._date = new Date();
|
||||
this._isTimeChooser = isTimeChooser;
|
||||
// Choose a random prefix for all pulldown menus
|
||||
this._prefix = "";
|
||||
var letters = ["a", "b", "c", "d", "e", "f", "h", "i", "j", "k", "l",
|
||||
"m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
||||
for (var i = 0; i < 10; ++i) {
|
||||
this._prefix += letters[Math.floor(Math.random() * letters.length)];
|
||||
}
|
||||
}
|
||||
|
||||
// DateChooser prototype variables
|
||||
DateChooser.prototype._isVisible = false;
|
||||
|
||||
// Returns true if the chooser is currently visible
|
||||
DateChooser.prototype.isVisible = function() {
|
||||
return this._isVisible;
|
||||
}
|
||||
|
||||
// Returns true if the chooser is to allow choosing the time as well as the date
|
||||
DateChooser.prototype.isTimeChooser = function() {
|
||||
return this._isTimeChooser;
|
||||
}
|
||||
|
||||
// Gets the value, as a formatted string, of the date attached to the chooser
|
||||
DateChooser.prototype.getValue = function() {
|
||||
return this._date.dateFormat(this._format);
|
||||
}
|
||||
|
||||
// Hides the chooser
|
||||
DateChooser.prototype.hide = function() {
|
||||
this._div.style.visibility = "hidden";
|
||||
this._div.style.display = "none";
|
||||
this._div.innerHTML = "";
|
||||
this._isVisible = false;
|
||||
}
|
||||
|
||||
// Shows the chooser on the page
|
||||
DateChooser.prototype.show = function() {
|
||||
// calculate the position before making it visible
|
||||
var inputPos = getAbsolutePosition(this._input);
|
||||
this._div.style.top = (inputPos[0] + this._input.offsetHeight) + "px";
|
||||
this._div.style.left = (inputPos[1] + this._input.offsetWidth) + "px";
|
||||
this._div.innerHTML = this.createChooserHtml();
|
||||
this._div.style.display = "block";
|
||||
this._div.style.visibility = "visible";
|
||||
this._div.style.position = "absolute";
|
||||
this._isVisible = true;
|
||||
}
|
||||
|
||||
// Sets the date to what is in the input box
|
||||
DateChooser.prototype.initializeDate = function() {
|
||||
if (this._input.value != null && this._input.value != "") {
|
||||
this._date = Date.parseDate(this._input.value, this._format);
|
||||
}
|
||||
else {
|
||||
this._date = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the date attached to the chooser
|
||||
DateChooser.prototype.setDate = function(date) {
|
||||
this._date = date ? date : new Date();
|
||||
}
|
||||
|
||||
// Sets the time portion of the date attached to the chooser
|
||||
DateChooser.prototype.setTime = function(hour, minute) {
|
||||
this._date.setHours(hour);
|
||||
this._date.setMinutes(minute);
|
||||
}
|
||||
|
||||
// Creates the HTML for the whole chooser
|
||||
DateChooser.prototype.createChooserHtml = function() {
|
||||
var formHtml = "<input type=\"hidden\" name=\""
|
||||
+ this._prefix + "inputId\" value=\""
|
||||
+ this._input.getAttribute('id') + "\">"
|
||||
+ "\r\n <select name=\"" + this._prefix
|
||||
+ "month\" onChange=\"dateChooserDateChange(this.form, '"
|
||||
+ this._prefix + "');\">";
|
||||
for (var monIndex = 0; monIndex <= 11; monIndex++) {
|
||||
formHtml += "\r\n <option value=\"" + monIndex + "\""
|
||||
+ (monIndex == this._date.getMonth() ? " selected=\"1\"" : "")
|
||||
+ ">" + Date.monthNames[monIndex] + "</option>";
|
||||
}
|
||||
formHtml += "\r\n </select>\r\n <select name=\""
|
||||
+ this._prefix + "year\" onChange=\"dateChooserDateChange(this.form, '"
|
||||
+ this._prefix + "');\">";
|
||||
for (var i = this._start; i <= this._end; ++i) {
|
||||
formHtml += "\r\n <option value=\"" + i + "\""
|
||||
+ (i == this._date.getFullYear() ? " selected=\"1\"" : "")
|
||||
+ ">" + i + "</option>";
|
||||
}
|
||||
formHtml += "\r\n </select>";
|
||||
formHtml += this.createCalendarHtml();
|
||||
if (this._isTimeChooser) {
|
||||
formHtml += this.createTimeChooserHtml();
|
||||
}
|
||||
return formHtml;
|
||||
}
|
||||
|
||||
// Creates the extra HTML needed for choosing the time
|
||||
DateChooser.prototype.createTimeChooserHtml = function() {
|
||||
// Add hours
|
||||
var result = "\r\n <select name=\"" + this._prefix + "hour\">";
|
||||
for (var i = 0; i < 12; ++i) {
|
||||
result += "\r\n <option value=\"" + i + "\""
|
||||
+ (((this._date.getHours() % 12) == i) ? " selected=\"1\">" : ">")
|
||||
+ i + "</option>";
|
||||
}
|
||||
// Add extra entry for 12:00
|
||||
result += "\r\n <option value=\"0\">12</option>";
|
||||
result += "\r\n </select>";
|
||||
// Add minutes
|
||||
result += "\r\n <select name=\"" + this._prefix + "min\">";
|
||||
for (var i = 0; i < 60; i += 15) {
|
||||
result += "\r\n <option value=\"" + i + "\""
|
||||
+ ((this._date.getMinutes() == i) ? " selected=\"1\">" : ">")
|
||||
+ String.leftPad(i, 2, '0') + "</option>";
|
||||
}
|
||||
result += "\r\n </select>";
|
||||
// Add AM/PM
|
||||
result += "\r\n <select name=\"" + this._prefix + "ampm\">";
|
||||
result += "\r\n <option value=\"0\""
|
||||
+ (this._date.getHours() < 12 ? " selected=\"1\">" : ">")
|
||||
+ "AM</option>";
|
||||
result += "\r\n <option value=\"12\""
|
||||
+ (this._date.getHours() >= 12 ? " selected=\"1\">" : ">")
|
||||
+ "PM</option>";
|
||||
result += "\r\n </select>";
|
||||
return result;
|
||||
}
|
||||
|
||||
// Creates the HTML for the actual calendar part of the chooser
|
||||
DateChooser.prototype.createCalendarHtml = function() {
|
||||
var result = "\r\n<table cellspacing=\"0\" class=\"dateChooser\">"
|
||||
+ "\r\n <tr><th>S</th><th>M</th><th>T</th>"
|
||||
+ "<th>W</th><th>T</th><th>F</th><th>S</th></tr>\r\n <tr>";
|
||||
// Fill up the days of the week until we get to the first day of the month
|
||||
var firstDay = this._date.getFirstDayOfMonth();
|
||||
var lastDay = this._date.getLastDayOfMonth();
|
||||
if (firstDay != 0) {
|
||||
result += "<td colspan=\"" + firstDay + "\"> </td>";
|
||||
}
|
||||
// Fill in the days of the month
|
||||
var i = 0;
|
||||
while (i < this._date.getDaysInMonth()) {
|
||||
if (((i++ + firstDay) % 7) == 0) {
|
||||
result += "</tr>\r\n <tr>";
|
||||
}
|
||||
var thisDay = new Date(
|
||||
this._date.getFullYear(),
|
||||
this._date.getMonth(), i);
|
||||
var js = '"dateChooserSetDate(\''
|
||||
+ this._input.getAttribute('id') + "', '"
|
||||
+ thisDay.dateFormat(this._format) + '\');"'
|
||||
result += "\r\n <td class=\"dateChooserActive"
|
||||
// If the date is the currently chosen date, highlight it
|
||||
+ (i == this._date.getDate() ? " dateChooserActiveToday" : "")
|
||||
+ "\" onClick=" + js + ">" + i + "</td>";
|
||||
}
|
||||
// Fill in any days after the end of the month
|
||||
if (lastDay != 6) {
|
||||
result += "<td colspan=\"" + (6 - lastDay) + "\"> </td>";
|
||||
}
|
||||
return result + "\r\n </tr>\r\n</table><!--[if lte IE 6.5]><iframe></iframe><![endif]-->";
|
||||
}
|
||||
Vendored
+975
@@ -0,0 +1,975 @@
|
||||
// script.aculo.us dragdrop.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
if(Object.isUndefined(Effect))
|
||||
throw("dragdrop.js requires including script.aculo.us' effects.js library");
|
||||
|
||||
var Droppables = {
|
||||
drops: [],
|
||||
|
||||
remove: function(element) {
|
||||
this.drops = this.drops.reject(function(d) { return d.element==$(element) });
|
||||
},
|
||||
|
||||
add: function(element) {
|
||||
element = $(element);
|
||||
var options = Object.extend({
|
||||
greedy: true,
|
||||
hoverclass: null,
|
||||
tree: false
|
||||
}, arguments[1] || { });
|
||||
|
||||
// cache containers
|
||||
if(options.containment) {
|
||||
options._containers = [];
|
||||
var containment = options.containment;
|
||||
if(Object.isArray(containment)) {
|
||||
containment.each( function(c) { options._containers.push($(c)) });
|
||||
} else {
|
||||
options._containers.push($(containment));
|
||||
}
|
||||
}
|
||||
|
||||
if(options.accept) options.accept = [options.accept].flatten();
|
||||
|
||||
Element.makePositioned(element); // fix IE
|
||||
options.element = element;
|
||||
|
||||
this.drops.push(options);
|
||||
},
|
||||
|
||||
findDeepestChild: function(drops) {
|
||||
deepest = drops[0];
|
||||
|
||||
for (i = 1; i < drops.length; ++i)
|
||||
if (Element.isParent(drops[i].element, deepest.element))
|
||||
deepest = drops[i];
|
||||
|
||||
return deepest;
|
||||
},
|
||||
|
||||
isContained: function(element, drop) {
|
||||
var containmentNode;
|
||||
if(drop.tree) {
|
||||
containmentNode = element.treeNode;
|
||||
} else {
|
||||
containmentNode = element.parentNode;
|
||||
}
|
||||
return drop._containers.detect(function(c) { return containmentNode == c });
|
||||
},
|
||||
|
||||
isAffected: function(point, element, drop) {
|
||||
return (
|
||||
(drop.element!=element) &&
|
||||
((!drop._containers) ||
|
||||
this.isContained(element, drop)) &&
|
||||
((!drop.accept) ||
|
||||
(Element.classNames(element).detect(
|
||||
function(v) { return drop.accept.include(v) } ) )) &&
|
||||
Position.within(drop.element, point[0], point[1]) );
|
||||
},
|
||||
|
||||
deactivate: function(drop) {
|
||||
if(drop.hoverclass)
|
||||
Element.removeClassName(drop.element, drop.hoverclass);
|
||||
this.last_active = null;
|
||||
},
|
||||
|
||||
activate: function(drop) {
|
||||
if(drop.hoverclass)
|
||||
Element.addClassName(drop.element, drop.hoverclass);
|
||||
this.last_active = drop;
|
||||
},
|
||||
|
||||
show: function(point, element) {
|
||||
if(!this.drops.length) return;
|
||||
var drop, affected = [];
|
||||
|
||||
this.drops.each( function(drop) {
|
||||
if(Droppables.isAffected(point, element, drop))
|
||||
affected.push(drop);
|
||||
});
|
||||
|
||||
if(affected.length>0)
|
||||
drop = Droppables.findDeepestChild(affected);
|
||||
|
||||
if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
|
||||
if (drop) {
|
||||
Position.within(drop.element, point[0], point[1]);
|
||||
if(drop.onHover)
|
||||
drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
|
||||
|
||||
if (drop != this.last_active) Droppables.activate(drop);
|
||||
}
|
||||
},
|
||||
|
||||
fire: function(event, element) {
|
||||
if(!this.last_active) return;
|
||||
Position.prepare();
|
||||
|
||||
if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
|
||||
if (this.last_active.onDrop) {
|
||||
this.last_active.onDrop(element, this.last_active.element, event);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
if(this.last_active)
|
||||
this.deactivate(this.last_active);
|
||||
}
|
||||
};
|
||||
|
||||
var Draggables = {
|
||||
drags: [],
|
||||
observers: [],
|
||||
|
||||
register: function(draggable) {
|
||||
if(this.drags.length == 0) {
|
||||
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
||||
this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
|
||||
this.eventKeypress = this.keyPress.bindAsEventListener(this);
|
||||
|
||||
Event.observe(document, "mouseup", this.eventMouseUp);
|
||||
Event.observe(document, "mousemove", this.eventMouseMove);
|
||||
Event.observe(document, "keypress", this.eventKeypress);
|
||||
}
|
||||
this.drags.push(draggable);
|
||||
},
|
||||
|
||||
unregister: function(draggable) {
|
||||
this.drags = this.drags.reject(function(d) { return d==draggable });
|
||||
if(this.drags.length == 0) {
|
||||
Event.stopObserving(document, "mouseup", this.eventMouseUp);
|
||||
Event.stopObserving(document, "mousemove", this.eventMouseMove);
|
||||
Event.stopObserving(document, "keypress", this.eventKeypress);
|
||||
}
|
||||
},
|
||||
|
||||
activate: function(draggable) {
|
||||
if(draggable.options.delay) {
|
||||
this._timeout = setTimeout(function() {
|
||||
Draggables._timeout = null;
|
||||
window.focus();
|
||||
Draggables.activeDraggable = draggable;
|
||||
}.bind(this), draggable.options.delay);
|
||||
} else {
|
||||
window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
|
||||
this.activeDraggable = draggable;
|
||||
}
|
||||
},
|
||||
|
||||
deactivate: function() {
|
||||
this.activeDraggable = null;
|
||||
},
|
||||
|
||||
updateDrag: function(event) {
|
||||
if(!this.activeDraggable) return;
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
// Mozilla-based browsers fire successive mousemove events with
|
||||
// the same coordinates, prevent needless redrawing (moz bug?)
|
||||
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
|
||||
this._lastPointer = pointer;
|
||||
|
||||
this.activeDraggable.updateDrag(event, pointer);
|
||||
},
|
||||
|
||||
endDrag: function(event) {
|
||||
if(this._timeout) {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
}
|
||||
if(!this.activeDraggable) return;
|
||||
this._lastPointer = null;
|
||||
this.activeDraggable.endDrag(event);
|
||||
this.activeDraggable = null;
|
||||
},
|
||||
|
||||
keyPress: function(event) {
|
||||
if(this.activeDraggable)
|
||||
this.activeDraggable.keyPress(event);
|
||||
},
|
||||
|
||||
addObserver: function(observer) {
|
||||
this.observers.push(observer);
|
||||
this._cacheObserverCallbacks();
|
||||
},
|
||||
|
||||
removeObserver: function(element) { // element instead of observer fixes mem leaks
|
||||
this.observers = this.observers.reject( function(o) { return o.element==element });
|
||||
this._cacheObserverCallbacks();
|
||||
},
|
||||
|
||||
notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
|
||||
if(this[eventName+'Count'] > 0)
|
||||
this.observers.each( function(o) {
|
||||
if(o[eventName]) o[eventName](eventName, draggable, event);
|
||||
});
|
||||
if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
|
||||
},
|
||||
|
||||
_cacheObserverCallbacks: function() {
|
||||
['onStart','onEnd','onDrag'].each( function(eventName) {
|
||||
Draggables[eventName+'Count'] = Draggables.observers.select(
|
||||
function(o) { return o[eventName]; }
|
||||
).length;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var Draggable = Class.create({
|
||||
initialize: function(element) {
|
||||
var defaults = {
|
||||
handle: false,
|
||||
reverteffect: function(element, top_offset, left_offset) {
|
||||
var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
|
||||
new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur,
|
||||
queue: {scope:'_draggable', position:'end'}
|
||||
});
|
||||
},
|
||||
endeffect: function(element) {
|
||||
var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
|
||||
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
|
||||
queue: {scope:'_draggable', position:'end'},
|
||||
afterFinish: function(){
|
||||
Draggable._dragging[element] = false
|
||||
}
|
||||
});
|
||||
},
|
||||
zindex: 1000,
|
||||
revert: false,
|
||||
quiet: false,
|
||||
scroll: false,
|
||||
scrollSensitivity: 20,
|
||||
scrollSpeed: 15,
|
||||
snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] }
|
||||
delay: 0
|
||||
};
|
||||
|
||||
if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
|
||||
Object.extend(defaults, {
|
||||
starteffect: function(element) {
|
||||
element._opacity = Element.getOpacity(element);
|
||||
Draggable._dragging[element] = true;
|
||||
new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
|
||||
}
|
||||
});
|
||||
|
||||
var options = Object.extend(defaults, arguments[1] || { });
|
||||
|
||||
this.element = $(element);
|
||||
|
||||
if(options.handle && Object.isString(options.handle))
|
||||
this.handle = this.element.down('.'+options.handle, 0);
|
||||
|
||||
if(!this.handle) this.handle = $(options.handle);
|
||||
if(!this.handle) this.handle = this.element;
|
||||
|
||||
if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
|
||||
options.scroll = $(options.scroll);
|
||||
this._isScrollChild = Element.childOf(this.element, options.scroll);
|
||||
}
|
||||
|
||||
Element.makePositioned(this.element); // fix IE
|
||||
|
||||
this.options = options;
|
||||
this.dragging = false;
|
||||
|
||||
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
|
||||
Event.observe(this.handle, "mousedown", this.eventMouseDown);
|
||||
|
||||
Draggables.register(this);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
|
||||
Draggables.unregister(this);
|
||||
},
|
||||
|
||||
currentDelta: function() {
|
||||
return([
|
||||
parseInt(Element.getStyle(this.element,'left') || '0'),
|
||||
parseInt(Element.getStyle(this.element,'top') || '0')]);
|
||||
},
|
||||
|
||||
initDrag: function(event) {
|
||||
if(!Object.isUndefined(Draggable._dragging[this.element]) &&
|
||||
Draggable._dragging[this.element]) return;
|
||||
if(Event.isLeftClick(event)) {
|
||||
// abort on form elements, fixes a Firefox issue
|
||||
var src = Event.element(event);
|
||||
if((tag_name = src.tagName.toUpperCase()) && (
|
||||
tag_name=='INPUT' ||
|
||||
tag_name=='SELECT' ||
|
||||
tag_name=='OPTION' ||
|
||||
tag_name=='BUTTON' ||
|
||||
tag_name=='TEXTAREA')) return;
|
||||
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
var pos = Position.cumulativeOffset(this.element);
|
||||
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
|
||||
|
||||
Draggables.activate(this);
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
|
||||
startDrag: function(event) {
|
||||
this.dragging = true;
|
||||
if(!this.delta)
|
||||
this.delta = this.currentDelta();
|
||||
|
||||
if(this.options.zindex) {
|
||||
this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
|
||||
this.element.style.zIndex = this.options.zindex;
|
||||
}
|
||||
|
||||
if(this.options.ghosting) {
|
||||
this._clone = this.element.cloneNode(true);
|
||||
this._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
|
||||
if (!this._originallyAbsolute)
|
||||
Position.absolutize(this.element);
|
||||
this.element.parentNode.insertBefore(this._clone, this.element);
|
||||
}
|
||||
|
||||
if(this.options.scroll) {
|
||||
if (this.options.scroll == window) {
|
||||
var where = this._getWindowScroll(this.options.scroll);
|
||||
this.originalScrollLeft = where.left;
|
||||
this.originalScrollTop = where.top;
|
||||
} else {
|
||||
this.originalScrollLeft = this.options.scroll.scrollLeft;
|
||||
this.originalScrollTop = this.options.scroll.scrollTop;
|
||||
}
|
||||
}
|
||||
|
||||
Draggables.notify('onStart', this, event);
|
||||
|
||||
if(this.options.starteffect) this.options.starteffect(this.element);
|
||||
},
|
||||
|
||||
updateDrag: function(event, pointer) {
|
||||
if(!this.dragging) this.startDrag(event);
|
||||
|
||||
if(!this.options.quiet){
|
||||
Position.prepare();
|
||||
Droppables.show(pointer, this.element);
|
||||
}
|
||||
|
||||
Draggables.notify('onDrag', this, event);
|
||||
|
||||
this.draw(pointer);
|
||||
if(this.options.change) this.options.change(this);
|
||||
|
||||
if(this.options.scroll) {
|
||||
this.stopScrolling();
|
||||
|
||||
var p;
|
||||
if (this.options.scroll == window) {
|
||||
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
|
||||
} else {
|
||||
p = Position.page(this.options.scroll);
|
||||
p[0] += this.options.scroll.scrollLeft + Position.deltaX;
|
||||
p[1] += this.options.scroll.scrollTop + Position.deltaY;
|
||||
p.push(p[0]+this.options.scroll.offsetWidth);
|
||||
p.push(p[1]+this.options.scroll.offsetHeight);
|
||||
}
|
||||
var speed = [0,0];
|
||||
if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
|
||||
if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
|
||||
if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
|
||||
if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
|
||||
this.startScrolling(speed);
|
||||
}
|
||||
|
||||
// fix AppleWebKit rendering
|
||||
if(Prototype.Browser.WebKit) window.scrollBy(0,0);
|
||||
|
||||
Event.stop(event);
|
||||
},
|
||||
|
||||
finishDrag: function(event, success) {
|
||||
this.dragging = false;
|
||||
|
||||
if(this.options.quiet){
|
||||
Position.prepare();
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
Droppables.show(pointer, this.element);
|
||||
}
|
||||
|
||||
if(this.options.ghosting) {
|
||||
if (!this._originallyAbsolute)
|
||||
Position.relativize(this.element);
|
||||
delete this._originallyAbsolute;
|
||||
Element.remove(this._clone);
|
||||
this._clone = null;
|
||||
}
|
||||
|
||||
var dropped = false;
|
||||
if(success) {
|
||||
dropped = Droppables.fire(event, this.element);
|
||||
if (!dropped) dropped = false;
|
||||
}
|
||||
if(dropped && this.options.onDropped) this.options.onDropped(this.element);
|
||||
Draggables.notify('onEnd', this, event);
|
||||
|
||||
var revert = this.options.revert;
|
||||
if(revert && Object.isFunction(revert)) revert = revert(this.element);
|
||||
|
||||
var d = this.currentDelta();
|
||||
if(revert && this.options.reverteffect) {
|
||||
if (dropped == 0 || revert != 'failure')
|
||||
this.options.reverteffect(this.element,
|
||||
d[1]-this.delta[1], d[0]-this.delta[0]);
|
||||
} else {
|
||||
this.delta = d;
|
||||
}
|
||||
|
||||
if(this.options.zindex)
|
||||
this.element.style.zIndex = this.originalZ;
|
||||
|
||||
if(this.options.endeffect)
|
||||
this.options.endeffect(this.element);
|
||||
|
||||
Draggables.deactivate(this);
|
||||
Droppables.reset();
|
||||
},
|
||||
|
||||
keyPress: function(event) {
|
||||
if(event.keyCode!=Event.KEY_ESC) return;
|
||||
this.finishDrag(event, false);
|
||||
Event.stop(event);
|
||||
},
|
||||
|
||||
endDrag: function(event) {
|
||||
if(!this.dragging) return;
|
||||
this.stopScrolling();
|
||||
this.finishDrag(event, true);
|
||||
Event.stop(event);
|
||||
},
|
||||
|
||||
draw: function(point) {
|
||||
var pos = Position.cumulativeOffset(this.element);
|
||||
if(this.options.ghosting) {
|
||||
var r = Position.realOffset(this.element);
|
||||
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
|
||||
}
|
||||
|
||||
var d = this.currentDelta();
|
||||
pos[0] -= d[0]; pos[1] -= d[1];
|
||||
|
||||
if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
|
||||
pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
|
||||
pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
|
||||
}
|
||||
|
||||
var p = [0,1].map(function(i){
|
||||
return (point[i]-pos[i]-this.offset[i])
|
||||
}.bind(this));
|
||||
|
||||
if(this.options.snap) {
|
||||
if(Object.isFunction(this.options.snap)) {
|
||||
p = this.options.snap(p[0],p[1],this);
|
||||
} else {
|
||||
if(Object.isArray(this.options.snap)) {
|
||||
p = p.map( function(v, i) {
|
||||
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this));
|
||||
} else {
|
||||
p = p.map( function(v) {
|
||||
return (v/this.options.snap).round()*this.options.snap }.bind(this));
|
||||
}
|
||||
}}
|
||||
|
||||
var style = this.element.style;
|
||||
if((!this.options.constraint) || (this.options.constraint=='horizontal'))
|
||||
style.left = p[0] + "px";
|
||||
if((!this.options.constraint) || (this.options.constraint=='vertical'))
|
||||
style.top = p[1] + "px";
|
||||
|
||||
if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
|
||||
},
|
||||
|
||||
stopScrolling: function() {
|
||||
if(this.scrollInterval) {
|
||||
clearInterval(this.scrollInterval);
|
||||
this.scrollInterval = null;
|
||||
Draggables._lastScrollPointer = null;
|
||||
}
|
||||
},
|
||||
|
||||
startScrolling: function(speed) {
|
||||
if(!(speed[0] || speed[1])) return;
|
||||
this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
|
||||
this.lastScrolled = new Date();
|
||||
this.scrollInterval = setInterval(this.scroll.bind(this), 10);
|
||||
},
|
||||
|
||||
scroll: function() {
|
||||
var current = new Date();
|
||||
var delta = current - this.lastScrolled;
|
||||
this.lastScrolled = current;
|
||||
if(this.options.scroll == window) {
|
||||
with (this._getWindowScroll(this.options.scroll)) {
|
||||
if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
|
||||
var d = delta / 1000;
|
||||
this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
|
||||
this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
|
||||
}
|
||||
|
||||
Position.prepare();
|
||||
Droppables.show(Draggables._lastPointer, this.element);
|
||||
Draggables.notify('onDrag', this);
|
||||
if (this._isScrollChild) {
|
||||
Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
|
||||
Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
|
||||
Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
|
||||
if (Draggables._lastScrollPointer[0] < 0)
|
||||
Draggables._lastScrollPointer[0] = 0;
|
||||
if (Draggables._lastScrollPointer[1] < 0)
|
||||
Draggables._lastScrollPointer[1] = 0;
|
||||
this.draw(Draggables._lastScrollPointer);
|
||||
}
|
||||
|
||||
if(this.options.change) this.options.change(this);
|
||||
},
|
||||
|
||||
_getWindowScroll: function(w) {
|
||||
var T, L, W, H;
|
||||
with (w.document) {
|
||||
if (w.document.documentElement && documentElement.scrollTop) {
|
||||
T = documentElement.scrollTop;
|
||||
L = documentElement.scrollLeft;
|
||||
} else if (w.document.body) {
|
||||
T = body.scrollTop;
|
||||
L = body.scrollLeft;
|
||||
}
|
||||
if (w.innerWidth) {
|
||||
W = w.innerWidth;
|
||||
H = w.innerHeight;
|
||||
} else if (w.document.documentElement && documentElement.clientWidth) {
|
||||
W = documentElement.clientWidth;
|
||||
H = documentElement.clientHeight;
|
||||
} else {
|
||||
W = body.offsetWidth;
|
||||
H = body.offsetHeight;
|
||||
}
|
||||
}
|
||||
return { top: T, left: L, width: W, height: H };
|
||||
}
|
||||
});
|
||||
|
||||
Draggable._dragging = { };
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var SortableObserver = Class.create({
|
||||
initialize: function(element, observer) {
|
||||
this.element = $(element);
|
||||
this.observer = observer;
|
||||
this.lastValue = Sortable.serialize(this.element);
|
||||
},
|
||||
|
||||
onStart: function() {
|
||||
this.lastValue = Sortable.serialize(this.element);
|
||||
},
|
||||
|
||||
onEnd: function() {
|
||||
Sortable.unmark();
|
||||
if(this.lastValue != Sortable.serialize(this.element))
|
||||
this.observer(this.element)
|
||||
}
|
||||
});
|
||||
|
||||
var Sortable = {
|
||||
SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
|
||||
|
||||
sortables: { },
|
||||
|
||||
_findRootElement: function(element) {
|
||||
while (element.tagName.toUpperCase() != "BODY") {
|
||||
if(element.id && Sortable.sortables[element.id]) return element;
|
||||
element = element.parentNode;
|
||||
}
|
||||
},
|
||||
|
||||
options: function(element) {
|
||||
element = Sortable._findRootElement($(element));
|
||||
if(!element) return;
|
||||
return Sortable.sortables[element.id];
|
||||
},
|
||||
|
||||
destroy: function(element){
|
||||
element = $(element);
|
||||
var s = Sortable.sortables[element.id];
|
||||
|
||||
if(s) {
|
||||
Draggables.removeObserver(s.element);
|
||||
s.droppables.each(function(d){ Droppables.remove(d) });
|
||||
s.draggables.invoke('destroy');
|
||||
|
||||
delete Sortable.sortables[s.element.id];
|
||||
}
|
||||
},
|
||||
|
||||
create: function(element) {
|
||||
element = $(element);
|
||||
var options = Object.extend({
|
||||
element: element,
|
||||
tag: 'li', // assumes li children, override with tag: 'tagname'
|
||||
dropOnEmpty: false,
|
||||
tree: false,
|
||||
treeTag: 'ul',
|
||||
overlap: 'vertical', // one of 'vertical', 'horizontal'
|
||||
constraint: 'vertical', // one of 'vertical', 'horizontal', false
|
||||
containment: element, // also takes array of elements (or id's); or false
|
||||
handle: false, // or a CSS class
|
||||
only: false,
|
||||
delay: 0,
|
||||
hoverclass: null,
|
||||
ghosting: false,
|
||||
quiet: false,
|
||||
scroll: false,
|
||||
scrollSensitivity: 20,
|
||||
scrollSpeed: 15,
|
||||
format: this.SERIALIZE_RULE,
|
||||
|
||||
// these take arrays of elements or ids and can be
|
||||
// used for better initialization performance
|
||||
elements: false,
|
||||
handles: false,
|
||||
|
||||
onChange: Prototype.emptyFunction,
|
||||
onUpdate: Prototype.emptyFunction
|
||||
}, arguments[1] || { });
|
||||
|
||||
// clear any old sortable with same element
|
||||
this.destroy(element);
|
||||
|
||||
// build options for the draggables
|
||||
var options_for_draggable = {
|
||||
revert: true,
|
||||
quiet: options.quiet,
|
||||
scroll: options.scroll,
|
||||
scrollSpeed: options.scrollSpeed,
|
||||
scrollSensitivity: options.scrollSensitivity,
|
||||
delay: options.delay,
|
||||
ghosting: options.ghosting,
|
||||
constraint: options.constraint,
|
||||
handle: options.handle };
|
||||
|
||||
if(options.starteffect)
|
||||
options_for_draggable.starteffect = options.starteffect;
|
||||
|
||||
if(options.reverteffect)
|
||||
options_for_draggable.reverteffect = options.reverteffect;
|
||||
else
|
||||
if(options.ghosting) options_for_draggable.reverteffect = function(element) {
|
||||
element.style.top = 0;
|
||||
element.style.left = 0;
|
||||
};
|
||||
|
||||
if(options.endeffect)
|
||||
options_for_draggable.endeffect = options.endeffect;
|
||||
|
||||
if(options.zindex)
|
||||
options_for_draggable.zindex = options.zindex;
|
||||
|
||||
// build options for the droppables
|
||||
var options_for_droppable = {
|
||||
overlap: options.overlap,
|
||||
containment: options.containment,
|
||||
tree: options.tree,
|
||||
hoverclass: options.hoverclass,
|
||||
onHover: Sortable.onHover
|
||||
};
|
||||
|
||||
var options_for_tree = {
|
||||
onHover: Sortable.onEmptyHover,
|
||||
overlap: options.overlap,
|
||||
containment: options.containment,
|
||||
hoverclass: options.hoverclass
|
||||
};
|
||||
|
||||
// fix for gecko engine
|
||||
Element.cleanWhitespace(element);
|
||||
|
||||
options.draggables = [];
|
||||
options.droppables = [];
|
||||
|
||||
// drop on empty handling
|
||||
if(options.dropOnEmpty || options.tree) {
|
||||
Droppables.add(element, options_for_tree);
|
||||
options.droppables.push(element);
|
||||
}
|
||||
|
||||
(options.elements || this.findElements(element, options) || []).each( function(e,i) {
|
||||
var handle = options.handles ? $(options.handles[i]) :
|
||||
(options.handle ? $(e).select('.' + options.handle)[0] : e);
|
||||
options.draggables.push(
|
||||
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
|
||||
Droppables.add(e, options_for_droppable);
|
||||
if(options.tree) e.treeNode = element;
|
||||
options.droppables.push(e);
|
||||
});
|
||||
|
||||
if(options.tree) {
|
||||
(Sortable.findTreeElements(element, options) || []).each( function(e) {
|
||||
Droppables.add(e, options_for_tree);
|
||||
e.treeNode = element;
|
||||
options.droppables.push(e);
|
||||
});
|
||||
}
|
||||
|
||||
// keep reference
|
||||
this.sortables[element.id] = options;
|
||||
|
||||
// for onupdate
|
||||
Draggables.addObserver(new SortableObserver(element, options.onUpdate));
|
||||
|
||||
},
|
||||
|
||||
// return all suitable-for-sortable elements in a guaranteed order
|
||||
findElements: function(element, options) {
|
||||
return Element.findChildren(
|
||||
element, options.only, options.tree ? true : false, options.tag);
|
||||
},
|
||||
|
||||
findTreeElements: function(element, options) {
|
||||
return Element.findChildren(
|
||||
element, options.only, options.tree ? true : false, options.treeTag);
|
||||
},
|
||||
|
||||
onHover: function(element, dropon, overlap) {
|
||||
if(Element.isParent(dropon, element)) return;
|
||||
|
||||
if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
|
||||
return;
|
||||
} else if(overlap>0.5) {
|
||||
Sortable.mark(dropon, 'before');
|
||||
if(dropon.previousSibling != element) {
|
||||
var oldParentNode = element.parentNode;
|
||||
element.style.visibility = "hidden"; // fix gecko rendering
|
||||
dropon.parentNode.insertBefore(element, dropon);
|
||||
if(dropon.parentNode!=oldParentNode)
|
||||
Sortable.options(oldParentNode).onChange(element);
|
||||
Sortable.options(dropon.parentNode).onChange(element);
|
||||
}
|
||||
} else {
|
||||
Sortable.mark(dropon, 'after');
|
||||
var nextElement = dropon.nextSibling || null;
|
||||
if(nextElement != element) {
|
||||
var oldParentNode = element.parentNode;
|
||||
element.style.visibility = "hidden"; // fix gecko rendering
|
||||
dropon.parentNode.insertBefore(element, nextElement);
|
||||
if(dropon.parentNode!=oldParentNode)
|
||||
Sortable.options(oldParentNode).onChange(element);
|
||||
Sortable.options(dropon.parentNode).onChange(element);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onEmptyHover: function(element, dropon, overlap) {
|
||||
var oldParentNode = element.parentNode;
|
||||
var droponOptions = Sortable.options(dropon);
|
||||
|
||||
if(!Element.isParent(dropon, element)) {
|
||||
var index;
|
||||
|
||||
var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
|
||||
var child = null;
|
||||
|
||||
if(children) {
|
||||
var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
|
||||
|
||||
for (index = 0; index < children.length; index += 1) {
|
||||
if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
|
||||
offset -= Element.offsetSize (children[index], droponOptions.overlap);
|
||||
} else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
|
||||
child = index + 1 < children.length ? children[index + 1] : null;
|
||||
break;
|
||||
} else {
|
||||
child = children[index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dropon.insertBefore(element, child);
|
||||
|
||||
Sortable.options(oldParentNode).onChange(element);
|
||||
droponOptions.onChange(element);
|
||||
}
|
||||
},
|
||||
|
||||
unmark: function() {
|
||||
if(Sortable._marker) Sortable._marker.hide();
|
||||
},
|
||||
|
||||
mark: function(dropon, position) {
|
||||
// mark on ghosting only
|
||||
var sortable = Sortable.options(dropon.parentNode);
|
||||
if(sortable && !sortable.ghosting) return;
|
||||
|
||||
if(!Sortable._marker) {
|
||||
Sortable._marker =
|
||||
($('dropmarker') || Element.extend(document.createElement('DIV'))).
|
||||
hide().addClassName('dropmarker').setStyle({position:'absolute'});
|
||||
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
|
||||
}
|
||||
var offsets = Position.cumulativeOffset(dropon);
|
||||
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
|
||||
|
||||
if(position=='after')
|
||||
if(sortable.overlap == 'horizontal')
|
||||
Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
|
||||
else
|
||||
Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
|
||||
|
||||
Sortable._marker.show();
|
||||
},
|
||||
|
||||
_tree: function(element, options, parent) {
|
||||
var children = Sortable.findElements(element, options) || [];
|
||||
|
||||
for (var i = 0; i < children.length; ++i) {
|
||||
var match = children[i].id.match(options.format);
|
||||
|
||||
if (!match) continue;
|
||||
|
||||
var child = {
|
||||
id: encodeURIComponent(match ? match[1] : null),
|
||||
element: element,
|
||||
parent: parent,
|
||||
children: [],
|
||||
position: parent.children.length,
|
||||
container: $(children[i]).down(options.treeTag)
|
||||
};
|
||||
|
||||
/* Get the element containing the children and recurse over it */
|
||||
if (child.container)
|
||||
this._tree(child.container, options, child);
|
||||
|
||||
parent.children.push (child);
|
||||
}
|
||||
|
||||
return parent;
|
||||
},
|
||||
|
||||
tree: function(element) {
|
||||
element = $(element);
|
||||
var sortableOptions = this.options(element);
|
||||
var options = Object.extend({
|
||||
tag: sortableOptions.tag,
|
||||
treeTag: sortableOptions.treeTag,
|
||||
only: sortableOptions.only,
|
||||
name: element.id,
|
||||
format: sortableOptions.format
|
||||
}, arguments[1] || { });
|
||||
|
||||
var root = {
|
||||
id: null,
|
||||
parent: null,
|
||||
children: [],
|
||||
container: element,
|
||||
position: 0
|
||||
};
|
||||
|
||||
return Sortable._tree(element, options, root);
|
||||
},
|
||||
|
||||
/* Construct a [i] index for a particular node */
|
||||
_constructIndex: function(node) {
|
||||
var index = '';
|
||||
do {
|
||||
if (node.id) index = '[' + node.position + ']' + index;
|
||||
} while ((node = node.parent) != null);
|
||||
return index;
|
||||
},
|
||||
|
||||
sequence: function(element) {
|
||||
element = $(element);
|
||||
var options = Object.extend(this.options(element), arguments[1] || { });
|
||||
|
||||
return $(this.findElements(element, options) || []).map( function(item) {
|
||||
return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
|
||||
});
|
||||
},
|
||||
|
||||
setSequence: function(element, new_sequence) {
|
||||
element = $(element);
|
||||
var options = Object.extend(this.options(element), arguments[2] || { });
|
||||
|
||||
var nodeMap = { };
|
||||
this.findElements(element, options).each( function(n) {
|
||||
if (n.id.match(options.format))
|
||||
nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
|
||||
n.parentNode.removeChild(n);
|
||||
});
|
||||
|
||||
new_sequence.each(function(ident) {
|
||||
var n = nodeMap[ident];
|
||||
if (n) {
|
||||
n[1].appendChild(n[0]);
|
||||
delete nodeMap[ident];
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
serialize: function(element) {
|
||||
element = $(element);
|
||||
var options = Object.extend(Sortable.options(element), arguments[1] || { });
|
||||
var name = encodeURIComponent(
|
||||
(arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
|
||||
|
||||
if (options.tree) {
|
||||
return Sortable.tree(element, arguments[1]).children.map( function (item) {
|
||||
return [name + Sortable._constructIndex(item) + "[id]=" +
|
||||
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
|
||||
}).flatten().join('&');
|
||||
} else {
|
||||
return Sortable.sequence(element, arguments[1]).map( function(item) {
|
||||
return name + "[]=" + encodeURIComponent(item);
|
||||
}).join('&');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Returns true if child is contained within element
|
||||
Element.isParent = function(child, element) {
|
||||
if (!child.parentNode || child == element) return false;
|
||||
if (child.parentNode == element) return true;
|
||||
return Element.isParent(child.parentNode, element);
|
||||
};
|
||||
|
||||
Element.findChildren = function(element, only, recursive, tagName) {
|
||||
if(!element.hasChildNodes()) return null;
|
||||
tagName = tagName.toUpperCase();
|
||||
if(only) only = [only].flatten();
|
||||
var elements = [];
|
||||
$A(element.childNodes).each( function(e) {
|
||||
if(e.tagName && e.tagName.toUpperCase()==tagName &&
|
||||
(!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
|
||||
elements.push(e);
|
||||
if(recursive) {
|
||||
var grandchildren = Element.findChildren(e, only, recursive, tagName);
|
||||
if(grandchildren) elements.push(grandchildren);
|
||||
}
|
||||
});
|
||||
|
||||
return (elements.length>0 ? elements.flatten() : []);
|
||||
};
|
||||
|
||||
Element.offsetSize = function (element, type) {
|
||||
return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
|
||||
};
|
||||
Vendored
+1130
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,308 @@
|
||||
|
||||
//functions.js
|
||||
|
||||
//A variable used to distinguish whether to open or close the calendar.
|
||||
var showOrHide = true;
|
||||
|
||||
function showHideCalendar() {
|
||||
|
||||
//The location we are loading the page into.
|
||||
var objID = "calendar";
|
||||
|
||||
//Change the current image of the minus or plus.
|
||||
if (showOrHide == true){
|
||||
//Show the calendar.
|
||||
document.getElementById("opencloseimg").src = "images/mins.gif";
|
||||
//The page we are loading.
|
||||
var serverPage = "calendar.php";
|
||||
//Set the open close tracker variable.
|
||||
showOrHide = false;
|
||||
var obj = document.getElementById(objID);
|
||||
processajax (serverPage, obj, "get", "");
|
||||
} else {
|
||||
//Hide the calendar.
|
||||
document.getElementById("opencloseimg").src = "images/plus.gif";
|
||||
showOrHide = true;
|
||||
//Reset the content.
|
||||
document.getElementById(objID).innerHTML = "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function createform (e, thedate){
|
||||
|
||||
theObject = document.getElementById("createtask");
|
||||
|
||||
theObject.style.visibility = "visible";
|
||||
theObject.style.height = "200px";
|
||||
theObject.style.width = "200px";
|
||||
|
||||
var posx = 0;
|
||||
var posy = 0;
|
||||
|
||||
posx = e.clientX + document.body.scrollLeft;
|
||||
posy = e.clientY + document.body.scrollTop;
|
||||
|
||||
theObject.style.left = posx + "px";
|
||||
theObject.style.top = posy + "px";
|
||||
|
||||
//The location we are loading the page into.
|
||||
var objID = "createtask";
|
||||
var serverPage = "theform.php?thedate=" + thedate;
|
||||
|
||||
var obj = document.getElementById(objID);
|
||||
processajax (serverPage, obj, "get", "");
|
||||
|
||||
}
|
||||
|
||||
function closetask (){
|
||||
|
||||
theObject = document.getElementById("createtask");
|
||||
|
||||
theObject.style.visibility = "hidden";
|
||||
theObject.style.height = "0px";
|
||||
theObject.style.width = "0px";
|
||||
|
||||
acObject = document.getElementById("autocompletediv");
|
||||
|
||||
acObject.style.visibility = "hidden";
|
||||
acObject.style.height = "0px";
|
||||
acObject.style.width = "0px";
|
||||
}
|
||||
|
||||
function findPosX(obj){
|
||||
var curleft = 0;
|
||||
if (obj.offsetParent){
|
||||
while (obj.offsetParent){
|
||||
curleft += obj.offsetLeft
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
} else if (obj.x){
|
||||
curleft += obj.x;
|
||||
}
|
||||
return curleft;
|
||||
}
|
||||
|
||||
function findPosY(obj){
|
||||
var curtop = 0;
|
||||
if (obj.offsetParent){
|
||||
while (obj.offsetParent){
|
||||
curtop += obj.offsetTop
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
} else if (obj.y){
|
||||
curtop += obj.y;
|
||||
}
|
||||
return curtop;
|
||||
}
|
||||
|
||||
function autocomplete (thevalue, e){
|
||||
|
||||
theObject = document.getElementById("autocompletediv");
|
||||
|
||||
theObject.style.visibility = "visible";
|
||||
theObject.style.width = "300px";
|
||||
|
||||
var posx = 0;
|
||||
var posy = 0;
|
||||
|
||||
posx = (findPosX (document.getElementById("namabarang")) + 1);
|
||||
posy = (findPosY (document.getElementById("namabarang")) + -125);
|
||||
|
||||
theObject.style.left = posx + "px";
|
||||
theObject.style.top = posy + "px";
|
||||
|
||||
var theextrachar = e.which;
|
||||
|
||||
if (theextrachar == undefined){
|
||||
theextrachar = e.keyCode;
|
||||
}
|
||||
|
||||
//The location we are loading the page into.
|
||||
var objID = "autocompletediv";
|
||||
|
||||
//Take into account the backspace.
|
||||
if (theextrachar == 8){
|
||||
if (thevalue.length == 1){
|
||||
var serverPage = "RAJAL/autocomp.php";
|
||||
} else {
|
||||
var serverPage = "RAJAL/autocomp.php" + "?sstring=" + thevalue.substr (0, (thevalue.length -1));
|
||||
}
|
||||
} else {
|
||||
var serverPage = "autocomp.php" + "?sstring=" + thevalue + String.fromCharCode (theextrachar);
|
||||
}
|
||||
|
||||
var obj = document.getElementById(objID);
|
||||
|
||||
processajax (serverPage, obj, "get", "");
|
||||
}
|
||||
|
||||
function setvalue (thevalue,kode){
|
||||
acObject = document.getElementById("autocompletediv");
|
||||
|
||||
acObject.style.visibility = "hidden";
|
||||
acObject.style.height = "0px";
|
||||
acObject.style.width = "0px";
|
||||
|
||||
document.getElementById("namabarang").value = thevalue;
|
||||
document.getElementById("kode").value = kode;
|
||||
document.getElementById("namabarang").focus();
|
||||
|
||||
}
|
||||
|
||||
function validateform (thevalue){
|
||||
|
||||
serverPage = "validator.php?sstring=" + thevalue;
|
||||
objID = "messagebox";
|
||||
|
||||
var obj = document.getElementById(objID);
|
||||
processajax (serverPage, obj, "get", "");
|
||||
}
|
||||
|
||||
function checkfortasks (thedate, e){
|
||||
|
||||
theObject = document.getElementById("taskbox");
|
||||
|
||||
theObject.style.visibility = "visible";
|
||||
|
||||
var posx = 0;
|
||||
var posy = 0;
|
||||
|
||||
posx = e.clientX + document.body.scrollLeft;
|
||||
posy = e.clientY + document.body.scrollTop;
|
||||
|
||||
theObject.style.left = posx + "px";
|
||||
theObject.style.top = posy + "px";
|
||||
|
||||
serverPage = "taskchecker.php?thedate=" + thedate;
|
||||
objID = "taskbox";
|
||||
|
||||
var obj = document.getElementById(objID);
|
||||
processajax (serverPage, obj, "get", "")
|
||||
}
|
||||
|
||||
function hidetask (){
|
||||
tObject = document.getElementById("taskbox");
|
||||
|
||||
tObject.style.visibility = "hidden";
|
||||
tObject.style.height = "0px";
|
||||
tObject.style.width = "0px";
|
||||
}
|
||||
|
||||
function trim(inputString) {
|
||||
// Removes leading and trailing spaces from the passed string. Also removes
|
||||
// consecutive spaces and replaces it with one space. If something besides
|
||||
// a string is passed in (null, custom object, etc.) then return the input.
|
||||
if (typeof inputString != "string") { return inputString; }
|
||||
var retValue = inputString;
|
||||
var ch = retValue.substring(0, 1);
|
||||
while (ch == " ") { // Check for spaces at the beginning of the string
|
||||
retValue = retValue.substring(1, retValue.length);
|
||||
ch = retValue.substring(0, 1);
|
||||
}
|
||||
ch = retValue.substring(retValue.length-1, retValue.length);
|
||||
while (ch == " ") { // Check for spaces at the end of the string
|
||||
retValue = retValue.substring(0, retValue.length-1);
|
||||
ch = retValue.substring(retValue.length-1, retValue.length);
|
||||
}
|
||||
while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
|
||||
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
|
||||
}
|
||||
return retValue; // Return the trimmed string back to the user
|
||||
} // Ends the "trim" function
|
||||
|
||||
//Function to validate the addtask form.
|
||||
function validatetask (thevalue, thename){
|
||||
|
||||
var nowcont = true;
|
||||
|
||||
if (thename == "yourname"){
|
||||
if (trim (thevalue) == ""){
|
||||
document.getElementById("themessage").innerHTML = "You must enter your name.";
|
||||
document.getElementById("newtask").yourname.focus();
|
||||
nowcont = false;
|
||||
}
|
||||
}
|
||||
if (nowcont == true){
|
||||
if (thename == "yourtask"){
|
||||
if (trim (thevalue) == ""){
|
||||
document.getElementById("themessage").innerHTML = "You must enter a task.";
|
||||
document.getElementById("newtask").yourtask.focus();
|
||||
nowcont = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nowcont;
|
||||
}
|
||||
|
||||
var aok;
|
||||
|
||||
//Functions to submit a form.
|
||||
function getformvalues (fobj, valfunc){
|
||||
|
||||
var str = "";
|
||||
aok = true;
|
||||
var val;
|
||||
//Run through a list of all objects contained within the form.
|
||||
for(var i = 0; i < fobj.elements.length; i++){
|
||||
if(valfunc) {
|
||||
if (aok == true){
|
||||
val = valfunc (fobj.elements[i].value,fobj.elements[i].name);
|
||||
if (val == false){
|
||||
aok = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&";
|
||||
}
|
||||
//Then return the string values.
|
||||
return str;
|
||||
}
|
||||
|
||||
function submitform (theform, serverPage, objID, valfunc){
|
||||
|
||||
var file = serverPage;
|
||||
var str = getformvalues(theform,valfunc);
|
||||
|
||||
//If the validation is ok.
|
||||
if (aok == true){
|
||||
obj = document.getElementById(objID);
|
||||
processajax (serverPage, obj, "post", str);
|
||||
}
|
||||
}
|
||||
|
||||
function saveresep(s){
|
||||
|
||||
var objID = "cart_resep";
|
||||
var obj = document.getElementById(objID);
|
||||
|
||||
processajax ("rajal/saveresep.php", obj, "post", "idxnya="+s+"&");
|
||||
|
||||
}
|
||||
|
||||
|
||||
function deleteResep(s,s1){
|
||||
|
||||
var objID = "cart_resep";
|
||||
var obj = document.getElementById(objID);
|
||||
|
||||
processajax ("rajal/delresep.php", obj, "post", "idxresep="+s+"&"+"idxdaftar="+s1+"&");
|
||||
}
|
||||
|
||||
function addbayar(s){
|
||||
|
||||
var objID = "cart_bayar";
|
||||
var obj = document.getElementById(objID);
|
||||
|
||||
processajax ("addbayar.php", obj, "post", "kode="+s+"&");
|
||||
}
|
||||
|
||||
function delcart(s,s1){
|
||||
|
||||
var objID = "cart_bayar";
|
||||
var obj = document.getElementById(objID);
|
||||
|
||||
processajax ("delbayar.php", obj, "post", "kodetarif="+s+"&");
|
||||
}
|
||||
@@ -0,0 +1,416 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page not found</title>
|
||||
<style>
|
||||
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
|
||||
body {margin:0}
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {display:block}
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {display:inline-block;vertical-align:baseline}
|
||||
audio:not([controls]) {display:none;height:0}
|
||||
[hidden],
|
||||
template {display:none}
|
||||
a {background:transparent}
|
||||
a:active,
|
||||
a:hover {outline:0}
|
||||
abbr[title] {border-bottom:1px dotted}
|
||||
b,
|
||||
strong {font-weight:bold}
|
||||
dfn {font-style:italic}
|
||||
h1 {font-size:2em;margin:0.67em 0}
|
||||
mark {background:#ff0;color:#000}
|
||||
small {font-size:80%}
|
||||
sub,
|
||||
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
|
||||
sup {top:-0.5em}
|
||||
sub {bottom:-0.25em}
|
||||
img {border:0}
|
||||
svg:not(:root) {overflow:hidden}
|
||||
figure {margin:1em 40px}
|
||||
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
|
||||
pre {overflow:auto}
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {font-family:monospace,monospace;font-size:1em}
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {color:inherit;font:inherit;margin:0}
|
||||
button {overflow:visible}
|
||||
button,
|
||||
select {text-transform:none}
|
||||
button,
|
||||
html input[type="button"],
|
||||
input[type="reset"],
|
||||
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
|
||||
button[disabled],
|
||||
html input[disabled] {cursor:default}
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {border:0;padding:0}
|
||||
input {line-height:normal}
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {box-sizing:border-box;padding:0}
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {height:auto}
|
||||
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
|
||||
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
|
||||
legend {border:0;padding:0}
|
||||
textarea {overflow:auto}
|
||||
optgroup {font-weight:bold}
|
||||
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
|
||||
td,
|
||||
th {padding:0}
|
||||
*,
|
||||
*:before,
|
||||
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
|
||||
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
|
||||
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
|
||||
button,
|
||||
input,
|
||||
select[multiple],
|
||||
textarea {background-image:none}
|
||||
a {color:#0181b9;text-decoration:none}
|
||||
a:hover,
|
||||
a:focus {color:#001721;text-decoration:underline}
|
||||
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
|
||||
img {vertical-align:middle}
|
||||
.img-responsive {display:block;max-width:100%;height:auto}
|
||||
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
|
||||
.img-circle {border-radius:50%}
|
||||
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
|
||||
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
|
||||
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
|
||||
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
|
||||
@media (min-width:768px) {.container {width:750px }}
|
||||
@media (min-width:992px) {.container {width:970px }}
|
||||
@media (min-width:1200px) {.container {width:1170px }}
|
||||
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
|
||||
.row {margin-left:-15px;margin-right:-15px}
|
||||
.row-flush {margin-left:0;margin-right:0}
|
||||
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
|
||||
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
|
||||
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
|
||||
.col-xs-12 {width:100%}
|
||||
.col-xs-11 {width:91.66666667%}
|
||||
.col-xs-10 {width:83.33333333%}
|
||||
.col-xs-9 {width:75%}
|
||||
.col-xs-8 {width:66.66666667%}
|
||||
.col-xs-7 {width:58.33333333%}
|
||||
.col-xs-6 {width:50%}
|
||||
.col-xs-5 {width:41.66666667%}
|
||||
.col-xs-4 {width:33.33333333%}
|
||||
.col-xs-3 {width:25%}
|
||||
.col-xs-2 {width:16.66666667%}
|
||||
.col-xs-1 {width:8.33333333%}
|
||||
.col-xs-pull-12 {right:100%}
|
||||
.col-xs-pull-11 {right:91.66666667%}
|
||||
.col-xs-pull-10 {right:83.33333333%}
|
||||
.col-xs-pull-9 {right:75%}
|
||||
.col-xs-pull-8 {right:66.66666667%}
|
||||
.col-xs-pull-7 {right:58.33333333%}
|
||||
.col-xs-pull-6 {right:50%}
|
||||
.col-xs-pull-5 {right:41.66666667%}
|
||||
.col-xs-pull-4 {right:33.33333333%}
|
||||
.col-xs-pull-3 {right:25%}
|
||||
.col-xs-pull-2 {right:16.66666667%}
|
||||
.col-xs-pull-1 {right:8.33333333%}
|
||||
.col-xs-pull-0 {right:0%}
|
||||
.col-xs-push-12 {left:100%}
|
||||
.col-xs-push-11 {left:91.66666667%}
|
||||
.col-xs-push-10 {left:83.33333333%}
|
||||
.col-xs-push-9 {left:75%}
|
||||
.col-xs-push-8 {left:66.66666667%}
|
||||
.col-xs-push-7 {left:58.33333333%}
|
||||
.col-xs-push-6 {left:50%}
|
||||
.col-xs-push-5 {left:41.66666667%}
|
||||
.col-xs-push-4 {left:33.33333333%}
|
||||
.col-xs-push-3 {left:25%}
|
||||
.col-xs-push-2 {left:16.66666667%}
|
||||
.col-xs-push-1 {left:8.33333333%}
|
||||
.col-xs-push-0 {left:0%}
|
||||
.col-xs-offset-12 {margin-left:100%}
|
||||
.col-xs-offset-11 {margin-left:91.66666667%}
|
||||
.col-xs-offset-10 {margin-left:83.33333333%}
|
||||
.col-xs-offset-9 {margin-left:75%}
|
||||
.col-xs-offset-8 {margin-left:66.66666667%}
|
||||
.col-xs-offset-7 {margin-left:58.33333333%}
|
||||
.col-xs-offset-6 {margin-left:50%}
|
||||
.col-xs-offset-5 {margin-left:41.66666667%}
|
||||
.col-xs-offset-4 {margin-left:33.33333333%}
|
||||
.col-xs-offset-3 {margin-left:25%}
|
||||
.col-xs-offset-2 {margin-left:16.66666667%}
|
||||
.col-xs-offset-1 {margin-left:8.33333333%}
|
||||
.col-xs-offset-0 {margin-left:0%}
|
||||
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
|
||||
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
|
||||
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
|
||||
.clearfix:before,
|
||||
.clearfix:after,
|
||||
.container:before,
|
||||
.container:after,
|
||||
.container-fluid:before,
|
||||
.container-fluid:after,
|
||||
.row:before,
|
||||
.row:after {content:" ";display:table}
|
||||
.clearfix:after,
|
||||
.container:after,
|
||||
.container-fluid:after,
|
||||
.row:after {clear:both}
|
||||
.center-block {display:block;margin-left:auto;margin-right:auto}
|
||||
.pull-right {float:right !important}
|
||||
.pull-left {float:left !important}
|
||||
.hide {display:none !important}
|
||||
.show {display:block !important}
|
||||
.invisible {visibility:hidden}
|
||||
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
|
||||
.hidden {display:none !important;visibility:hidden !important}
|
||||
.affix {position:fixed}
|
||||
@-ms-viewport {width:device-width}
|
||||
.visible-xs,
|
||||
.visible-sm,
|
||||
.visible-md,
|
||||
.visible-lg {display:none !important}
|
||||
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
|
||||
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
|
||||
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
|
||||
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
|
||||
@media (max-width:767px) {.hidden-xs {display:none !important }}
|
||||
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
|
||||
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
|
||||
@media (min-width:1200px) {.hidden-lg {display:none !important }}
|
||||
.visible-print {display:none !important}
|
||||
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
|
||||
@media print {.hidden-print {display:none !important }}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
|
||||
h1 small,
|
||||
h2 small,
|
||||
h3 small,
|
||||
h4 small,
|
||||
h5 small,
|
||||
h6 small,
|
||||
.h1 small,
|
||||
.h2 small,
|
||||
.h3 small,
|
||||
.h4 small,
|
||||
.h5 small,
|
||||
.h6 small,
|
||||
h1 .small,
|
||||
h2 .small,
|
||||
h3 .small,
|
||||
h4 .small,
|
||||
h5 .small,
|
||||
h6 .small,
|
||||
.h1 .small,
|
||||
.h2 .small,
|
||||
.h3 .small,
|
||||
.h4 .small,
|
||||
.h5 .small,
|
||||
.h6 .small {font-weight:normal;line-height:1;color:#999}
|
||||
h1,
|
||||
.h1,
|
||||
h2,
|
||||
.h2,
|
||||
h3,
|
||||
.h3 {margin-top:20px;margin-bottom:10px}
|
||||
h1 small,
|
||||
.h1 small,
|
||||
h2 small,
|
||||
.h2 small,
|
||||
h3 small,
|
||||
.h3 small,
|
||||
h1 .small,
|
||||
.h1 .small,
|
||||
h2 .small,
|
||||
.h2 .small,
|
||||
h3 .small,
|
||||
.h3 .small {font-size:65%}
|
||||
h4,
|
||||
.h4,
|
||||
h5,
|
||||
.h5,
|
||||
h6,
|
||||
.h6 {margin-top:10px;margin-bottom:10px}
|
||||
h4 small,
|
||||
.h4 small,
|
||||
h5 small,
|
||||
.h5 small,
|
||||
h6 small,
|
||||
.h6 small,
|
||||
h4 .small,
|
||||
.h4 .small,
|
||||
h5 .small,
|
||||
.h5 .small,
|
||||
h6 .small,
|
||||
.h6 .small {font-size:75%}
|
||||
h1,
|
||||
.h1 {font-size:36px}
|
||||
h2,
|
||||
.h2 {font-size:30px}
|
||||
h3,
|
||||
.h3 {font-size:24px}
|
||||
h4,
|
||||
.h4 {font-size:18px}
|
||||
h5,
|
||||
.h5 {font-size:14px}
|
||||
h6,
|
||||
.h6 {font-size:12px}
|
||||
p {margin:0 0 10px}
|
||||
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
|
||||
@media (min-width:768px) {.lead {font-size:21px }}
|
||||
small,
|
||||
.small {font-size:85%}
|
||||
cite {font-style:normal}
|
||||
.text-left {text-align:left}
|
||||
.text-right {text-align:right}
|
||||
.text-center {text-align:center}
|
||||
.text-justify {text-align:justify}
|
||||
.text-muted {color:#999}
|
||||
.text-primary {color:#34495e}
|
||||
a.text-primary:hover {color:#222f3d}
|
||||
.text-success {color:#3c763d}
|
||||
a.text-success:hover {color:#2b542c}
|
||||
.text-info {color:#31708f}
|
||||
a.text-info:hover {color:#245269}
|
||||
.text-warning {color:#8a6d3b}
|
||||
a.text-warning:hover {color:#66512c}
|
||||
.text-danger {color:#a94442}
|
||||
a.text-danger:hover {color:#843534}
|
||||
.bg-primary {color:#fff;background-color:#34495e}
|
||||
a.bg-primary:hover {background-color:#222f3d}
|
||||
.bg-success {background-color:#dff0d8}
|
||||
a.bg-success:hover {background-color:#c1e2b3}
|
||||
.bg-info {background-color:#d9edf7}
|
||||
a.bg-info:hover {background-color:#afd9ee}
|
||||
.bg-warning {background-color:#fcf8e3}
|
||||
a.bg-warning:hover {background-color:#f7ecb5}
|
||||
.bg-danger {background-color:#f2dede}
|
||||
a.bg-danger:hover {background-color:#e4b9b9}
|
||||
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
|
||||
ul,
|
||||
ol {margin-top:0;margin-bottom:10px}
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol,
|
||||
ol ol {margin-bottom:0}
|
||||
.list-unstyled {padding-left:0;list-style:none}
|
||||
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
|
||||
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
|
||||
dl {margin-top:0;margin-bottom:20px}
|
||||
dt,
|
||||
dd {line-height:1.42857143}
|
||||
dt {font-weight:bold}
|
||||
dd {margin-left:0}
|
||||
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
|
||||
abbr[title],
|
||||
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
|
||||
.initialism {font-size:90%;text-transform:uppercase}
|
||||
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
|
||||
blockquote p:last-child,
|
||||
blockquote ul:last-child,
|
||||
blockquote ol:last-child {margin-bottom:0}
|
||||
blockquote footer,
|
||||
blockquote small,
|
||||
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
|
||||
blockquote footer:before,
|
||||
blockquote small:before,
|
||||
blockquote .small:before {content:'\2014 \00A0'}
|
||||
.blockquote-reverse,
|
||||
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
|
||||
.blockquote-reverse footer:before,
|
||||
blockquote.pull-right footer:before,
|
||||
.blockquote-reverse small:before,
|
||||
blockquote.pull-right small:before,
|
||||
.blockquote-reverse .small:before,
|
||||
blockquote.pull-right .small:before {content:''}
|
||||
.blockquote-reverse footer:after,
|
||||
blockquote.pull-right footer:after,
|
||||
.blockquote-reverse small:after,
|
||||
blockquote.pull-right small:after,
|
||||
.blockquote-reverse .small:after,
|
||||
blockquote.pull-right .small:after {content:'\00A0 \2014'}
|
||||
blockquote:before,
|
||||
blockquote:after {content:""}
|
||||
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
|
||||
|
||||
.oc-icon-chain:before,
|
||||
.icon-chain:before,
|
||||
|
||||
.oc-icon-chain-broken:before,
|
||||
.icon-chain-broken:before {content:"\f127"}
|
||||
|
||||
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
|
||||
.close:hover,
|
||||
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
|
||||
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
|
||||
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
|
||||
[class^="icon-"],
|
||||
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
|
||||
[class^="icon-"]:before,
|
||||
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
|
||||
[class^="icon-"].pull-left,
|
||||
[class*=" icon-"].pull-left {margin-right:.3em}
|
||||
[class^="icon-"].pull-right,
|
||||
[class*=" icon-"].pull-right {margin-left:.3em}
|
||||
[class^="oc-icon-"]:before,
|
||||
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
|
||||
[class^="oc-icon-"].empty:before,
|
||||
[class*=" oc-icon-"].empty:before {margin-right:0}
|
||||
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
|
||||
.icon-2x {font-size:2em}
|
||||
.icon-3x {font-size:3em}
|
||||
.icon-4x {font-size:4em}
|
||||
.icon-5x {font-size:5em}
|
||||
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
|
||||
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
|
||||
h1 i[class^="icon-"]:before {font-size:46px}
|
||||
i[class^="icon-"].warning {color:#c84530}
|
||||
h3 {font-size:24px;font-weight:300}
|
||||
p.lead {font-size:16px;font-weight:300}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
|
||||
<p class="lead">The requested page cannot be found.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,123 @@
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#GRUP").change(function(){
|
||||
var selectValues = jQuery("#GRUP").val();
|
||||
var tindakanHidden = jQuery("#TINDAKANHIDDEN").val();
|
||||
jQuery.post('./include/jaspel_tarif_load.php',{kdgrup:selectValues,load_tindakan:'true'},function(data){
|
||||
jQuery('#tindakanpilih').html(data);
|
||||
jQuery('#KDTINDAKAN').val(tindakanHidden).change();
|
||||
jQuery('#subtindakanpilih').html("<select name=\"subtindakan\" class=\"text required\" title=\"*\" id=\"subtindakan\"><option value=\"0\"> --pilih-- </option></select>");
|
||||
});
|
||||
});
|
||||
|
||||
jQuery("#KDTINDAKAN").change(function(){
|
||||
var selectValues = jQuery("#KDTINDAKAN").val();
|
||||
var subtindakanHidden = jQuery("#SUBTINDAKANHIDDEN").val();
|
||||
jQuery.post('./include/jaspel_tarif_load.php',{kdtindakan:selectValues,load_subtindakan:'true'},function(data){
|
||||
jQuery('#subtindakanpilih').html(data);
|
||||
jQuery('#TINDAKAN').val(subtindakanHidden);
|
||||
});
|
||||
alert ();
|
||||
});
|
||||
jQuery("#SUBTINDAKAN").change(function(){
|
||||
var selectValues = jQuery("#SUBTINDAKAN").val();
|
||||
var sub2tindakanHidden = jQuery("#SUB2TINDAKANHIDDEN").val();
|
||||
jQuery.post('./include/jaspel_tarif_load.php',{kdsubtindakan:selectValues,load_sub2tindakan:'true'},function(data){
|
||||
jQuery('#sub2tindakanpilih').html(data);
|
||||
jQuery('#SUBTINDAKAN').val(sub2tindakanHidden);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</SCRIPT>
|
||||
<?php session_start();
|
||||
include("connect.php");
|
||||
|
||||
|
||||
if($_REQUEST['load_grup'] != ''){
|
||||
$kolamp = $_REQUEST['kolamp'];
|
||||
if ($kolamp == "08"){
|
||||
$sql = $db->query('SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "8" and kode_lampiran = "'.$kolamp.'"
|
||||
and CHAR_LENGTH( kode_gruptindakan ) != "5"
|
||||
UNION ALL
|
||||
SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "5" and kode_lampiran = "'.$kolamp.'"
|
||||
and CHAR_LENGTH( kode_gruptindakan ) != "8"
|
||||
');
|
||||
}else{
|
||||
$sql = $db->query('SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "5" and kode_lampiran = "'.$kolamp.'"');
|
||||
|
||||
}
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="GRUP" class="text required" title="*" id="GRUP" style = "width:25;"><option value="0"> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
if($_REQUEST['GRUP'] == $data['kode_tindakan']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
echo '<option value="'.$data['kode_tindakan'].'" '.$sel.' > '.$data['kode_tindakan'].' | '.$data['nama_tindakan'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada kode grup di kode lampiran tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['load_tindakan'] != ''){
|
||||
$kdgrup = $_REQUEST['kdgrup'];
|
||||
if (substr($kdgrup,0,2) == "05"){
|
||||
$sql = $db->query('SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "9" and kode_gruptindakan = "'.$kdgrup.'"');
|
||||
|
||||
}else {
|
||||
$sql = $db->query('SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "8" and kode_gruptindakan = "'.$kdgrup.'"');
|
||||
}
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="KDTINDAKAN" class="text required" title="*" id="KDTINDAKAN"><option value="0"> --pilihmmm-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo'<option value="'.$data['kode_tindakan'].'">'.$data['kode_tindakan'].' | '.$data['nama_tindakan'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada data di kode tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['load_subtindakan'] != ''){
|
||||
$kdtindakan = $_REQUEST['kdtindakan'];
|
||||
|
||||
$sql = $db->query('SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "11" and kode_gruptindakan = "'.$kdtindakan.'"');
|
||||
if($sql->numRows() > 0){
|
||||
|
||||
echo '<select name="SUBTINDAKAN" class="text required" title="*" id="SUBTINDAKAN"><option value="0"> --pilih32-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo'<option value="'.$data['kode_tindakan'].'">'.$data['kode_tindakan'].' | '.$data['nama_tindakan'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada data di kode tersebut';
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['load_sub2tindakan'] != ''){
|
||||
$kdsubtindakan = $_REQUEST['kdtindakan'];
|
||||
$sql = $db->query('SELECT distinct kode_tindakan, nama_tindakan
|
||||
FROM m_tarif2012
|
||||
where CHAR_LENGTH( kode_tindakan ) = "11" and kode_gruptindakan = "'.$kdtindakan.'"');
|
||||
if($sql->numRows() > 0){
|
||||
echo '<select name="SUB2TINDAKAN" class="text required" title="*" id="SUB2TINDAKAN"><option value="0"> --pilih-- </option>';
|
||||
foreach($sql->fetchAll() as $data){
|
||||
echo'<option value="'.$data['kode_tindakan'].'">'.$data['nama_tindakan'].'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}else{
|
||||
echo 'Tidak ada data di kode tersebut';
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Vendored
+4376
File diff suppressed because it is too large
Load Diff
Vendored
+19
File diff suppressed because one or more lines are too long
Vendored
+5999
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,48 @@
|
||||
.ac_results {
|
||||
padding: 0px;
|
||||
border: 1px solid black;
|
||||
background-color: white;
|
||||
overflow: hidden;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.ac_results ul {
|
||||
width: 100%;
|
||||
list-style-position: outside;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ac_results li {
|
||||
margin: 0px;
|
||||
padding: 2px 5px;
|
||||
cursor: default;
|
||||
display: block;
|
||||
/*
|
||||
if width will be 100% horizontal scrollbar will apear
|
||||
when scroll mode will be used
|
||||
*/
|
||||
/*width: 100%;*/
|
||||
font: menu;
|
||||
font-size: 12px;
|
||||
/*
|
||||
it is very important, if line-height not setted or setted
|
||||
in relative units scroll will be broken in firefox
|
||||
*/
|
||||
line-height: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ac_loading {
|
||||
background: white url('indicator.gif') right center no-repeat;
|
||||
}
|
||||
|
||||
.ac_odd {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.ac_over {
|
||||
background-color: #0A246A;
|
||||
color: white;
|
||||
}
|
||||
@@ -0,0 +1,808 @@
|
||||
/*
|
||||
* jQuery Autocomplete plugin 1.1
|
||||
*
|
||||
* Copyright (c) 2009 Jörn Zaefferer
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
$.fn.extend({
|
||||
autocomplete: function(urlOrData, options) {
|
||||
var isUrl = typeof urlOrData == "string";
|
||||
options = $.extend({}, $.Autocompleter.defaults, {
|
||||
url: isUrl ? urlOrData : null,
|
||||
data: isUrl ? null : urlOrData,
|
||||
delay: isUrl ? $.Autocompleter.defaults.delay : 10,
|
||||
max: options && !options.scroll ? 10 : 150
|
||||
}, options);
|
||||
|
||||
// if highlight is set to false, replace it with a do-nothing function
|
||||
options.highlight = options.highlight || function(value) { return value; };
|
||||
|
||||
// if the formatMatch option is not specified, then use formatItem for backwards compatibility
|
||||
options.formatMatch = options.formatMatch || options.formatItem;
|
||||
|
||||
return this.each(function() {
|
||||
new $.Autocompleter(this, options);
|
||||
});
|
||||
},
|
||||
result: function(handler) {
|
||||
return this.bind("result", handler);
|
||||
},
|
||||
search: function(handler) {
|
||||
return this.trigger("search", [handler]);
|
||||
},
|
||||
flushCache: function() {
|
||||
return this.trigger("flushCache");
|
||||
},
|
||||
setOptions: function(options){
|
||||
return this.trigger("setOptions", [options]);
|
||||
},
|
||||
unautocomplete: function() {
|
||||
return this.trigger("unautocomplete");
|
||||
}
|
||||
});
|
||||
|
||||
$.Autocompleter = function(input, options) {
|
||||
|
||||
var KEY = {
|
||||
UP: 38,
|
||||
DOWN: 40,
|
||||
DEL: 46,
|
||||
TAB: 9,
|
||||
RETURN: 13,
|
||||
ESC: 27,
|
||||
COMMA: 188,
|
||||
PAGEUP: 33,
|
||||
PAGEDOWN: 34,
|
||||
BACKSPACE: 8
|
||||
};
|
||||
|
||||
// Create $ object for input element
|
||||
var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
|
||||
|
||||
var timeout;
|
||||
var previousValue = "";
|
||||
var cache = $.Autocompleter.Cache(options);
|
||||
var hasFocus = 0;
|
||||
var lastKeyPressCode;
|
||||
var config = {
|
||||
mouseDownOnSelect: false
|
||||
};
|
||||
var select = $.Autocompleter.Select(options, input, selectCurrent, config);
|
||||
|
||||
var blockSubmit;
|
||||
|
||||
// prevent form submit in opera when selecting with return key
|
||||
// $.browser.opera && $(input.form).bind("submit.autocomplete", function() {
|
||||
// if (blockSubmit) {
|
||||
// blockSubmit = false;
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
|
||||
/*$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
|
||||
// a keypress means the input has focus
|
||||
// avoids issue where input had focus before the autocomplete was applied
|
||||
hasFocus = 1;
|
||||
// track last key pressed
|
||||
lastKeyPressCode = event.keyCode;
|
||||
switch(event.keyCode) {
|
||||
|
||||
case KEY.UP:
|
||||
event.preventDefault();
|
||||
if ( select.visible() ) {
|
||||
select.prev();
|
||||
} else {
|
||||
onChange(0, true);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY.DOWN:
|
||||
event.preventDefault();
|
||||
if ( select.visible() ) {
|
||||
select.next();
|
||||
} else {
|
||||
onChange(0, true);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY.PAGEUP:
|
||||
event.preventDefault();
|
||||
if ( select.visible() ) {
|
||||
select.pageUp();
|
||||
} else {
|
||||
onChange(0, true);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY.PAGEDOWN:
|
||||
event.preventDefault();
|
||||
if ( select.visible() ) {
|
||||
select.pageDown();
|
||||
} else {
|
||||
onChange(0, true);
|
||||
}
|
||||
break;
|
||||
|
||||
// matches also semicolon
|
||||
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
|
||||
case KEY.TAB:
|
||||
case KEY.RETURN:
|
||||
if( selectCurrent() ) {
|
||||
// stop default to prevent a form submit, Opera needs special handling
|
||||
event.preventDefault();
|
||||
blockSubmit = true;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY.ESC:
|
||||
select.hide();
|
||||
break;
|
||||
|
||||
default:
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(onChange, options.delay);
|
||||
break;
|
||||
}
|
||||
}).focus(function(){
|
||||
// track whether the field has focus, we shouldn't process any
|
||||
// results if the field no longer has focus
|
||||
hasFocus++;
|
||||
}).blur(function() {
|
||||
hasFocus = 0;
|
||||
if (!config.mouseDownOnSelect) {
|
||||
hideResults();
|
||||
}
|
||||
}).click(function() {
|
||||
// show select when clicking in a focused field
|
||||
if ( hasFocus++ > 1 && !select.visible() ) {
|
||||
onChange(0, true);
|
||||
}
|
||||
}).bind("search", function() {
|
||||
// TODO why not just specifying both arguments?
|
||||
var fn = (arguments.length > 1) ? arguments[1] : null;
|
||||
function findValueCallback(q, data) {
|
||||
var result;
|
||||
if( data && data.length ) {
|
||||
for (var i=0; i < data.length; i++) {
|
||||
if( data[i].result.toLowerCase() == q.toLowerCase() ) {
|
||||
result = data[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( typeof fn == "function" ) fn(result);
|
||||
else $input.trigger("result", result && [result.data, result.value]);
|
||||
}
|
||||
$.each(trimWords($input.val()), function(i, value) {
|
||||
request(value, findValueCallback, findValueCallback);
|
||||
});
|
||||
}).bind("flushCache", function() {
|
||||
cache.flush();
|
||||
}).bind("setOptions", function() {
|
||||
$.extend(options, arguments[1]);
|
||||
// if we've updated the data, repopulate
|
||||
if ( "data" in arguments[1] )
|
||||
cache.populate();
|
||||
}).bind("unautocomplete", function() {
|
||||
select.unbind();
|
||||
$input.unbind();
|
||||
$(input.form).unbind(".autocomplete");
|
||||
});*/
|
||||
|
||||
|
||||
function selectCurrent() {
|
||||
var selected = select.selected();
|
||||
if( !selected )
|
||||
return false;
|
||||
|
||||
var v = selected.result;
|
||||
previousValue = v;
|
||||
|
||||
if ( options.multiple ) {
|
||||
var words = trimWords($input.val());
|
||||
if ( words.length > 1 ) {
|
||||
var seperator = options.multipleSeparator.length;
|
||||
var cursorAt = $(input).selection().start;
|
||||
var wordAt, progress = 0;
|
||||
$.each(words, function(i, word) {
|
||||
progress += word.length;
|
||||
if (cursorAt <= progress) {
|
||||
wordAt = i;
|
||||
return false;
|
||||
}
|
||||
progress += seperator;
|
||||
});
|
||||
words[wordAt] = v;
|
||||
// TODO this should set the cursor to the right position, but it gets overriden somewhere
|
||||
//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
|
||||
v = words.join( options.multipleSeparator );
|
||||
}
|
||||
v += options.multipleSeparator;
|
||||
}
|
||||
|
||||
$input.val(v);
|
||||
hideResultsNow();
|
||||
$input.trigger("result", [selected.data, selected.value]);
|
||||
return true;
|
||||
}
|
||||
|
||||
function onChange(crap, skipPrevCheck) {
|
||||
if( lastKeyPressCode == KEY.DEL ) {
|
||||
select.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var currentValue = $input.val();
|
||||
|
||||
if ( !skipPrevCheck && currentValue == previousValue )
|
||||
return;
|
||||
|
||||
previousValue = currentValue;
|
||||
|
||||
currentValue = lastWord(currentValue);
|
||||
if ( currentValue.length >= options.minChars) {
|
||||
$input.addClass(options.loadingClass);
|
||||
if (!options.matchCase)
|
||||
currentValue = currentValue.toLowerCase();
|
||||
request(currentValue, receiveData, hideResultsNow);
|
||||
} else {
|
||||
stopLoading();
|
||||
select.hide();
|
||||
}
|
||||
};
|
||||
|
||||
function trimWords(value) {
|
||||
if (!value)
|
||||
return [""];
|
||||
if (!options.multiple)
|
||||
return [$.trim(value)];
|
||||
return $.map(value.split(options.multipleSeparator), function(word) {
|
||||
return $.trim(value).length ? $.trim(word) : null;
|
||||
});
|
||||
}
|
||||
|
||||
function lastWord(value) {
|
||||
if ( !options.multiple )
|
||||
return value;
|
||||
var words = trimWords(value);
|
||||
if (words.length == 1)
|
||||
return words[0];
|
||||
var cursorAt = $(input).selection().start;
|
||||
if (cursorAt == value.length) {
|
||||
words = trimWords(value)
|
||||
} else {
|
||||
words = trimWords(value.replace(value.substring(cursorAt), ""));
|
||||
}
|
||||
return words[words.length - 1];
|
||||
}
|
||||
|
||||
// fills in the input box w/the first match (assumed to be the best match)
|
||||
// q: the term entered
|
||||
// sValue: the first matching result
|
||||
function autoFill(q, sValue){
|
||||
// autofill in the complete box w/the first match as long as the user hasn't entered in more data
|
||||
// if the last user key pressed was backspace, don't autofill
|
||||
if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
|
||||
// fill in the value (keep the case the user has typed)
|
||||
$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
|
||||
// select the portion of the value not typed by the user (so the next character will erase)
|
||||
$(input).selection(previousValue.length, previousValue.length + sValue.length);
|
||||
}
|
||||
};
|
||||
|
||||
function hideResults() {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(hideResultsNow, 200);
|
||||
};
|
||||
|
||||
function hideResultsNow() {
|
||||
var wasVisible = select.visible();
|
||||
select.hide();
|
||||
clearTimeout(timeout);
|
||||
stopLoading();
|
||||
if (options.mustMatch) {
|
||||
// call search and run callback
|
||||
$input.search(
|
||||
function (result){
|
||||
// if no value found, clear the input box
|
||||
if( !result ) {
|
||||
if (options.multiple) {
|
||||
var words = trimWords($input.val()).slice(0, -1);
|
||||
$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
|
||||
}
|
||||
else {
|
||||
$input.val( "" );
|
||||
$input.trigger("result", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
function receiveData(q, data) {
|
||||
if ( data && data.length && hasFocus ) {
|
||||
stopLoading();
|
||||
select.display(data, q);
|
||||
autoFill(q, data[0].value);
|
||||
select.show();
|
||||
} else {
|
||||
hideResultsNow();
|
||||
}
|
||||
};
|
||||
|
||||
function request(term, success, failure) {
|
||||
if (!options.matchCase)
|
||||
term = term.toLowerCase();
|
||||
var data = cache.load(term);
|
||||
// recieve the cached data
|
||||
if (data && data.length) {
|
||||
success(term, data);
|
||||
// if an AJAX url has been supplied, try loading the data now
|
||||
} else if( (typeof options.url == "string") && (options.url.length > 0) ){
|
||||
|
||||
var extraParams = {
|
||||
timestamp: +new Date()
|
||||
};
|
||||
$.each(options.extraParams, function(key, param) {
|
||||
extraParams[key] = typeof param == "function" ? param() : param;
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
// try to leverage ajaxQueue plugin to abort previous requests
|
||||
mode: "abort",
|
||||
// limit abortion to this input
|
||||
port: "autocomplete" + input.name,
|
||||
dataType: options.dataType,
|
||||
url: options.url,
|
||||
data: $.extend({
|
||||
q: lastWord(term),
|
||||
limit: options.max
|
||||
}, extraParams),
|
||||
success: function(data) {
|
||||
var parsed = options.parse && options.parse(data) || parse(data);
|
||||
cache.add(term, parsed);
|
||||
success(term, parsed);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
|
||||
select.emptyList();
|
||||
failure(term);
|
||||
}
|
||||
};
|
||||
|
||||
function parse(data) {
|
||||
var parsed = [];
|
||||
var rows = data.split("\n");
|
||||
for (var i=0; i < rows.length; i++) {
|
||||
var row = $.trim(rows[i]);
|
||||
if (row) {
|
||||
row = row.split("|");
|
||||
parsed[parsed.length] = {
|
||||
data: row,
|
||||
value: row[0],
|
||||
result: options.formatResult && options.formatResult(row, row[0]) || row[0]
|
||||
};
|
||||
}
|
||||
}
|
||||
return parsed;
|
||||
};
|
||||
|
||||
function stopLoading() {
|
||||
$input.removeClass(options.loadingClass);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
$.Autocompleter.defaults = {
|
||||
inputClass: "ac_input",
|
||||
resultsClass: "ac_results",
|
||||
loadingClass: "ac_loading",
|
||||
minChars: 1,
|
||||
delay: 400,
|
||||
matchCase: false,
|
||||
matchSubset: true,
|
||||
matchContains: false,
|
||||
cacheLength: 10,
|
||||
max: 100,
|
||||
mustMatch: false,
|
||||
extraParams: {},
|
||||
selectFirst: true,
|
||||
formatItem: function(row) { return row[0]; },
|
||||
formatMatch: null,
|
||||
autoFill: false,
|
||||
width: 0,
|
||||
multiple: false,
|
||||
multipleSeparator: ", ",
|
||||
highlight: function(value, term) {
|
||||
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
|
||||
},
|
||||
scroll: true,
|
||||
scrollHeight: 180
|
||||
};
|
||||
|
||||
$.Autocompleter.Cache = function(options) {
|
||||
|
||||
var data = {};
|
||||
var length = 0;
|
||||
|
||||
function matchSubset(s, sub) {
|
||||
if (!options.matchCase)
|
||||
s = s.toLowerCase();
|
||||
var i = s.indexOf(sub);
|
||||
if (options.matchContains == "word"){
|
||||
i = s.toLowerCase().search("\\b" + sub.toLowerCase());
|
||||
}
|
||||
if (i == -1) return false;
|
||||
return i == 0 || options.matchContains;
|
||||
};
|
||||
|
||||
function add(q, value) {
|
||||
if (length > options.cacheLength){
|
||||
flush();
|
||||
}
|
||||
if (!data[q]){
|
||||
length++;
|
||||
}
|
||||
data[q] = value;
|
||||
}
|
||||
|
||||
function populate(){
|
||||
if( !options.data ) return false;
|
||||
// track the matches
|
||||
var stMatchSets = {},
|
||||
nullData = 0;
|
||||
|
||||
// no url was specified, we need to adjust the cache length to make sure it fits the local data store
|
||||
if( !options.url ) options.cacheLength = 1;
|
||||
|
||||
// track all options for minChars = 0
|
||||
stMatchSets[""] = [];
|
||||
|
||||
// loop through the array and create a lookup structure
|
||||
for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
|
||||
var rawValue = options.data[i];
|
||||
// if rawValue is a string, make an array otherwise just reference the array
|
||||
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
|
||||
|
||||
var value = options.formatMatch(rawValue, i+1, options.data.length);
|
||||
if ( value === false )
|
||||
continue;
|
||||
|
||||
var firstChar = value.charAt(0).toLowerCase();
|
||||
// if no lookup array for this character exists, look it up now
|
||||
if( !stMatchSets[firstChar] )
|
||||
stMatchSets[firstChar] = [];
|
||||
|
||||
// if the match is a string
|
||||
var row = {
|
||||
value: value,
|
||||
data: rawValue,
|
||||
result: options.formatResult && options.formatResult(rawValue) || value
|
||||
};
|
||||
|
||||
// push the current match into the set list
|
||||
stMatchSets[firstChar].push(row);
|
||||
|
||||
// keep track of minChars zero items
|
||||
if ( nullData++ < options.max ) {
|
||||
stMatchSets[""].push(row);
|
||||
}
|
||||
};
|
||||
|
||||
// add the data items to the cache
|
||||
$.each(stMatchSets, function(i, value) {
|
||||
// increase the cache size
|
||||
options.cacheLength++;
|
||||
// add to the cache
|
||||
add(i, value);
|
||||
});
|
||||
}
|
||||
|
||||
// populate any existing data
|
||||
setTimeout(populate, 25);
|
||||
|
||||
function flush(){
|
||||
data = {};
|
||||
length = 0;
|
||||
}
|
||||
|
||||
return {
|
||||
flush: flush,
|
||||
add: add,
|
||||
populate: populate,
|
||||
load: function(q) {
|
||||
if (!options.cacheLength || !length)
|
||||
return null;
|
||||
/*
|
||||
* if dealing w/local data and matchContains than we must make sure
|
||||
* to loop through all the data collections looking for matches
|
||||
*/
|
||||
if( !options.url && options.matchContains ){
|
||||
// track all matches
|
||||
var csub = [];
|
||||
// loop through all the data grids for matches
|
||||
for( var k in data ){
|
||||
// don't search through the stMatchSets[""] (minChars: 0) cache
|
||||
// this prevents duplicates
|
||||
if( k.length > 0 ){
|
||||
var c = data[k];
|
||||
$.each(c, function(i, x) {
|
||||
// if we've got a match, add it to the array
|
||||
if (matchSubset(x.value, q)) {
|
||||
csub.push(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return csub;
|
||||
} else
|
||||
// if the exact item exists, use it
|
||||
if (data[q]){
|
||||
return data[q];
|
||||
} else
|
||||
if (options.matchSubset) {
|
||||
for (var i = q.length - 1; i >= options.minChars; i--) {
|
||||
var c = data[q.substr(0, i)];
|
||||
if (c) {
|
||||
var csub = [];
|
||||
$.each(c, function(i, x) {
|
||||
if (matchSubset(x.value, q)) {
|
||||
csub[csub.length] = x;
|
||||
}
|
||||
});
|
||||
return csub;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$.Autocompleter.Select = function (options, input, select, config) {
|
||||
var CLASSES = {
|
||||
ACTIVE: "ac_over"
|
||||
};
|
||||
|
||||
var listItems,
|
||||
active = -1,
|
||||
data,
|
||||
term = "",
|
||||
needsInit = true,
|
||||
element,
|
||||
list;
|
||||
|
||||
// Create results
|
||||
function init() {
|
||||
if (!needsInit)
|
||||
return;
|
||||
element = $("<div/>")
|
||||
.hide()
|
||||
.addClass(options.resultsClass)
|
||||
.css("position", "absolute")
|
||||
.appendTo(document.body);
|
||||
|
||||
list = $("<ul/>").appendTo(element).mouseover( function(event) {
|
||||
if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
|
||||
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
|
||||
$(target(event)).addClass(CLASSES.ACTIVE);
|
||||
}
|
||||
}).click(function(event) {
|
||||
$(target(event)).addClass(CLASSES.ACTIVE);
|
||||
select();
|
||||
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
|
||||
input.focus();
|
||||
return false;
|
||||
}).mousedown(function() {
|
||||
config.mouseDownOnSelect = true;
|
||||
}).mouseup(function() {
|
||||
config.mouseDownOnSelect = false;
|
||||
});
|
||||
|
||||
if( options.width > 0 )
|
||||
element.css("width", options.width);
|
||||
|
||||
needsInit = false;
|
||||
}
|
||||
|
||||
function target(event) {
|
||||
var element = event.target;
|
||||
while(element && element.tagName != "LI")
|
||||
element = element.parentNode;
|
||||
// more fun with IE, sometimes event.target is empty, just ignore it then
|
||||
if(!element)
|
||||
return [];
|
||||
return element;
|
||||
}
|
||||
|
||||
function moveSelect(step) {
|
||||
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
|
||||
movePosition(step);
|
||||
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
|
||||
if(options.scroll) {
|
||||
var offset = 0;
|
||||
listItems.slice(0, active).each(function() {
|
||||
offset += this.offsetHeight;
|
||||
});
|
||||
if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
|
||||
list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
|
||||
} else if(offset < list.scrollTop()) {
|
||||
list.scrollTop(offset);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function movePosition(step) {
|
||||
active += step;
|
||||
if (active < 0) {
|
||||
active = listItems.size() - 1;
|
||||
} else if (active >= listItems.size()) {
|
||||
active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function limitNumberOfItems(available) {
|
||||
return options.max && options.max < available
|
||||
? options.max
|
||||
: available;
|
||||
}
|
||||
|
||||
function fillList() {
|
||||
list.empty();
|
||||
var max = limitNumberOfItems(data.length);
|
||||
for (var i=0; i < max; i++) {
|
||||
if (!data[i])
|
||||
continue;
|
||||
var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
|
||||
if ( formatted === false )
|
||||
continue;
|
||||
var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
|
||||
$.data(li, "ac_data", data[i]);
|
||||
}
|
||||
listItems = list.find("li");
|
||||
if ( options.selectFirst ) {
|
||||
listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
|
||||
active = 0;
|
||||
}
|
||||
// apply bgiframe if available
|
||||
if ( $.fn.bgiframe )
|
||||
list.bgiframe();
|
||||
}
|
||||
|
||||
return {
|
||||
display: function(d, q) {
|
||||
init();
|
||||
data = d;
|
||||
term = q;
|
||||
fillList();
|
||||
},
|
||||
next: function() {
|
||||
moveSelect(1);
|
||||
},
|
||||
prev: function() {
|
||||
moveSelect(-1);
|
||||
},
|
||||
pageUp: function() {
|
||||
if (active != 0 && active - 8 < 0) {
|
||||
moveSelect( -active );
|
||||
} else {
|
||||
moveSelect(-8);
|
||||
}
|
||||
},
|
||||
pageDown: function() {
|
||||
if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
|
||||
moveSelect( listItems.size() - 1 - active );
|
||||
} else {
|
||||
moveSelect(8);
|
||||
}
|
||||
},
|
||||
hide: function() {
|
||||
element && element.hide();
|
||||
listItems && listItems.removeClass(CLASSES.ACTIVE);
|
||||
active = -1;
|
||||
},
|
||||
visible : function() {
|
||||
return element && element.is(":visible");
|
||||
},
|
||||
current: function() {
|
||||
return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
|
||||
},
|
||||
show: function() {
|
||||
var offset = $(input).offset();
|
||||
element.css({
|
||||
width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
|
||||
top: offset.top + input.offsetHeight,
|
||||
left: offset.left
|
||||
}).show();
|
||||
if(options.scroll) {
|
||||
list.scrollTop(0);
|
||||
list.css({
|
||||
maxHeight: options.scrollHeight,
|
||||
overflow: 'auto'
|
||||
});
|
||||
|
||||
if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
|
||||
var listHeight = 0;
|
||||
listItems.each(function() {
|
||||
listHeight += this.offsetHeight;
|
||||
});
|
||||
var scrollbarsVisible = listHeight > options.scrollHeight;
|
||||
list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
|
||||
if (!scrollbarsVisible) {
|
||||
// IE doesn't recalculate width when scrollbar disappears
|
||||
listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
selected: function() {
|
||||
var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
|
||||
return selected && selected.length && $.data(selected[0], "ac_data");
|
||||
},
|
||||
emptyList: function (){
|
||||
list && list.empty();
|
||||
},
|
||||
unbind: function() {
|
||||
element && element.remove();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$.fn.selection = function(start, end) {
|
||||
if (start !== undefined) {
|
||||
return this.each(function() {
|
||||
if( this.createTextRange ){
|
||||
var selRange = this.createTextRange();
|
||||
if (end === undefined || start == end) {
|
||||
selRange.move("character", start);
|
||||
selRange.select();
|
||||
} else {
|
||||
selRange.collapse(true);
|
||||
selRange.moveStart("character", start);
|
||||
selRange.moveEnd("character", end);
|
||||
selRange.select();
|
||||
}
|
||||
} else if( this.setSelectionRange ){
|
||||
this.setSelectionRange(start, end);
|
||||
} else if( this.selectionStart ){
|
||||
this.selectionStart = start;
|
||||
this.selectionEnd = end;
|
||||
}
|
||||
});
|
||||
}
|
||||
var field = this[0];
|
||||
if ( field.createTextRange ) {
|
||||
var range = document.selection.createRange(),
|
||||
orig = field.value,
|
||||
teststring = "<->",
|
||||
textLength = range.text.length;
|
||||
range.text = teststring;
|
||||
var caretAt = field.value.indexOf(teststring);
|
||||
field.value = orig;
|
||||
this.selection(caretAt, caretAt + textLength);
|
||||
return {
|
||||
start: caretAt,
|
||||
end: caretAt + textLength
|
||||
}
|
||||
} else if( field.selectionStart !== undefined ){
|
||||
return {
|
||||
start: field.selectionStart,
|
||||
end: field.selectionEnd
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
Vendored
+15
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+8
File diff suppressed because one or more lines are too long
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
cbb function by Roger Johansson, http://www.456bereastreet.com/
|
||||
*/
|
||||
var cbb = {
|
||||
init : function() {
|
||||
// Check that the browser supports the DOM methods used
|
||||
if (!document.getElementById || !document.createElement || !document.appendChild) return false;
|
||||
var oElement, oOuter, oI1, oI2, tempId;
|
||||
// Find all elements with a class name of cbb
|
||||
var arrElements = document.getElementsByTagName('*');
|
||||
var oRegExp = new RegExp("(^|\\s)cbb(\\s|$)");
|
||||
for (var i=0; i<arrElements.length; i++) {
|
||||
// Save the original outer element for later
|
||||
oElement = arrElements[i];
|
||||
if (oRegExp.test(oElement.className)) {
|
||||
// Create a new element and give it the original element's class name(s) while replacing 'cbb' with 'cb'
|
||||
oOuter = document.createElement('div');
|
||||
oOuter.className = oElement.className.replace(oRegExp, '$1cb$2');
|
||||
// Give the new div the original element's id if it has one
|
||||
if (oElement.getAttribute("id")) {
|
||||
tempId = oElement.id;
|
||||
oElement.removeAttribute('id');
|
||||
oOuter.setAttribute('id', '');
|
||||
oOuter.id = tempId;
|
||||
}
|
||||
// Change the original element's class name and replace it with the new div
|
||||
oElement.className = 'i3';
|
||||
oElement.parentNode.replaceChild(oOuter, oElement);
|
||||
// Create two new div elements and insert them into the outermost div
|
||||
oI1 = document.createElement('div');
|
||||
oI1.className = 'i1';
|
||||
oOuter.appendChild(oI1);
|
||||
oI2 = document.createElement('div');
|
||||
oI2.className = 'i2';
|
||||
oI1.appendChild(oI2);
|
||||
// Insert the original element
|
||||
oI2.appendChild(oElement);
|
||||
// Insert the top and bottom divs
|
||||
cbb.insertTop(oOuter);
|
||||
cbb.insertBottom(oOuter);
|
||||
}
|
||||
}
|
||||
},
|
||||
insertTop : function(obj) {
|
||||
var oOuter, oInner;
|
||||
// Create the two div elements needed for the top of the box
|
||||
oOuter=document.createElement("div");
|
||||
oOuter.className="bt"; // The outer div needs a class name
|
||||
oInner=document.createElement("div");
|
||||
oOuter.appendChild(oInner);
|
||||
obj.insertBefore(oOuter,obj.firstChild);
|
||||
},
|
||||
insertBottom : function(obj) {
|
||||
var oOuter, oInner;
|
||||
// Create the two div elements needed for the bottom of the box
|
||||
oOuter=document.createElement("div");
|
||||
oOuter.className="bb"; // The outer div needs a class name
|
||||
oInner=document.createElement("div");
|
||||
oOuter.appendChild(oInner);
|
||||
obj.appendChild(oOuter);
|
||||
},
|
||||
// addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
|
||||
addEvent : function(obj, type, fn) {
|
||||
if (obj.addEventListener)
|
||||
obj.addEventListener(type, fn, false);
|
||||
else if (obj.attachEvent) {
|
||||
obj["e"+type+fn] = fn;
|
||||
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
|
||||
obj.attachEvent("on"+type, obj[type+fn]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
cbb.addEvent(window, 'load', cbb.init);
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$con = mysql_pconnect("localhost","root","");
|
||||
if (!$con){
|
||||
die('Could not connect: ' . mysqli_error($connect));
|
||||
}
|
||||
|
||||
mysql_select_db("siakdb", $con);
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$con = mysql_pconnect("localhost","root","");
|
||||
if (!$con){
|
||||
die('Could not connect: ' . mysqli_error($connect));
|
||||
}
|
||||
|
||||
mysql_select_db("siakoff", $con);
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>{{title}}</title>
|
||||
{{style}}
|
||||
<style type="text/css">
|
||||
body {
|
||||
width : 100%;
|
||||
margin : 0 auto;
|
||||
font-family: 'Arial';
|
||||
}
|
||||
table#lap_body {
|
||||
border-collapse: collapse;
|
||||
margin : 0 auto;
|
||||
}
|
||||
table#lap_body td { padding : 0.5pt 2.5pt;}
|
||||
table#lap_body th { padding : 3px; background: #AECDF0; border-top:3px solid #000; }
|
||||
table#lap_body thead {display: table-header-group;}
|
||||
table#lap_body .row_group { background: #cccccc; font-weight: bold}
|
||||
.header {
|
||||
font-family: 'Arial bold';
|
||||
font-size: 14pt;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.sub-header {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
}
|
||||
.subheader-left { display: inline-block; width: 80px; font-weight: bold;}
|
||||
.text-right { text-align: right; }
|
||||
.report-subheader { width: 80px; display: inline-block; font-weight: bold }
|
||||
</style>
|
||||
<style type="text/css" media="screen">
|
||||
table#lap_body td { padding : 0.5pt 2.5pt; font-size: 10pt;}
|
||||
table#lap_body th { padding : 3px; font-size: 10pt; background: #AECDF0; border-top:1px solid #000; }
|
||||
.header { font-size: 14pt;}
|
||||
</style>
|
||||
<style type="text/css" media="print">table#lap_body thead {display: table-header-group;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="98%" id="lap_header">
|
||||
<tr>
|
||||
<td colspan="">
|
||||
<div class="header">
|
||||
{{header}}
|
||||
</div>
|
||||
<div class="sub-header">
|
||||
{{subheader}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{headertambahan}}
|
||||
</table>
|
||||
{{table_list1}}
|
||||
<table border="1" cellpadding="5" cellspacing="0" id="lap_body" style="margin-left:3pt">
|
||||
<thead>
|
||||
{{table_header}}
|
||||
</thead>
|
||||
<tbody>
|
||||
{{table_body}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{table_list2}}
|
||||
{{html_list}}
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 771 B |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
+10912
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
function check(){
|
||||
if (jQuery("#notification").is(":hidden")){
|
||||
jQuery.get("checkNotification.php?checkNum=1", function(data){
|
||||
if(data!="0"){
|
||||
jQuery("#notificationIn").load("checkNotification.php");
|
||||
jQuery("#notification").slideDown("slow");
|
||||
}
|
||||
});
|
||||
}
|
||||
window.setTimeout(function() {check();}, 10000);
|
||||
}
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
jQuery("#notification").hide();
|
||||
|
||||
|
||||
jQuery("#notificationClose").click(function () {
|
||||
jQuery("#notification").hide();
|
||||
});
|
||||
|
||||
window.setTimeout(function() {
|
||||
check();
|
||||
}, 1000);
|
||||
|
||||
|
||||
});
|
||||
@@ -0,0 +1,211 @@
|
||||
<?php
|
||||
/**
|
||||
* A Compatibility library with PHP 5.5's simplified password hashing API.
|
||||
*
|
||||
* @author Anthony Ferrara <ircmaxell@php.net>
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
* @copyright 2012 The Authors
|
||||
*/
|
||||
if (!defined('PASSWORD_BCRYPT')) {
|
||||
define('PASSWORD_BCRYPT', 1);
|
||||
define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
|
||||
if (version_compare(PHP_VERSION, '5.3.7', '<')) {
|
||||
define('PASSWORD_PREFIX', '$2a$');
|
||||
}
|
||||
else {
|
||||
define('PASSWORD_PREFIX', '$2y$');
|
||||
}
|
||||
/**
|
||||
* Hash the password using the specified algorithm
|
||||
*
|
||||
* @param string $password The password to hash
|
||||
* @param int $algo The algorithm to use (Defined by PASSWORD_* constants)
|
||||
* @param array $options The options for the algorithm to use
|
||||
*
|
||||
* @return string|false The hashed password, or false on error.
|
||||
*/
|
||||
function password_hash($password, $algo, array $options = array()) {
|
||||
if (!function_exists('crypt')) {
|
||||
trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (!is_string($password)) {
|
||||
trigger_error("password_hash(): Password must be a string", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (!is_int($algo)) {
|
||||
trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
switch ($algo) {
|
||||
case PASSWORD_BCRYPT:
|
||||
// Note that this is a C constant, but not exposed to PHP, so we don't define it here.
|
||||
$cost = 10;
|
||||
if (isset($options['cost'])) {
|
||||
$cost = $options['cost'];
|
||||
if ($cost < 4 || $cost > 31) {
|
||||
trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
$required_salt_len = 22;
|
||||
$hash_format = sprintf("%s%02d$", PASSWORD_PREFIX, $cost);
|
||||
break;
|
||||
default:
|
||||
trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (isset($options['salt'])) {
|
||||
switch (gettype($options['salt'])) {
|
||||
case 'NULL':
|
||||
case 'boolean':
|
||||
case 'integer':
|
||||
case 'double':
|
||||
case 'string':
|
||||
$salt = (string) $options['salt'];
|
||||
break;
|
||||
case 'object':
|
||||
if (method_exists($options['salt'], '__tostring')) {
|
||||
$salt = (string) $options['salt'];
|
||||
break;
|
||||
}
|
||||
case 'array':
|
||||
case 'resource':
|
||||
default:
|
||||
trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (strlen($salt) < $required_salt_len) {
|
||||
trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", strlen($salt), $required_salt_len), E_USER_WARNING);
|
||||
return null;
|
||||
} elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {
|
||||
$salt = str_replace('+', '.', base64_encode($salt));
|
||||
}
|
||||
} else {
|
||||
$buffer = '';
|
||||
$raw_length = (int) ($required_salt_len * 3 / 4 + 1);
|
||||
$buffer_valid = false;
|
||||
if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {
|
||||
$buffer = mcrypt_create_iv($raw_length, MCRYPT_DEV_URANDOM);
|
||||
if ($buffer) {
|
||||
$buffer_valid = true;
|
||||
}
|
||||
}
|
||||
if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {
|
||||
$buffer = openssl_random_pseudo_bytes($raw_length);
|
||||
if ($buffer) {
|
||||
$buffer_valid = true;
|
||||
}
|
||||
}
|
||||
if (!$buffer_valid && is_readable('/dev/urandom')) {
|
||||
$f = fopen('/dev/urandom', 'r');
|
||||
$read = strlen($buffer);
|
||||
while ($read < $raw_length) {
|
||||
$buffer .= fread($f, $raw_length - $read);
|
||||
$read = strlen($buffer);
|
||||
}
|
||||
fclose($f);
|
||||
if ($read >= $raw_length) {
|
||||
$buffer_valid = true;
|
||||
}
|
||||
}
|
||||
if (!$buffer_valid || strlen($buffer) < $raw_length) {
|
||||
$bl = strlen($buffer);
|
||||
for ($i = 0; $i < $raw_length; $i++) {
|
||||
if ($i < $bl) {
|
||||
$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
|
||||
} else {
|
||||
$buffer .= chr(mt_rand(0, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
$salt = str_replace('+', '.', base64_encode($buffer));
|
||||
}
|
||||
$salt = substr($salt, 0, $required_salt_len);
|
||||
$hash = $hash_format . $salt;
|
||||
$ret = crypt($password, $hash);
|
||||
if (!is_string($ret) || strlen($ret) <= 13) {
|
||||
return false;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Get information about the password hash. Returns an array of the information
|
||||
* that was used to generate the password hash.
|
||||
*
|
||||
* array(
|
||||
* 'algo' => 1,
|
||||
* 'algoName' => 'bcrypt',
|
||||
* 'options' => array(
|
||||
* 'cost' => 10,
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @param string $hash The password hash to extract info from
|
||||
*
|
||||
* @return array The array of information about the hash.
|
||||
*/
|
||||
function password_get_info($hash) {
|
||||
$return = array(
|
||||
'algo' => 0,
|
||||
'algoName' => 'unknown',
|
||||
'options' => array(),
|
||||
);
|
||||
if (substr($hash, 0, 4) == PASSWORD_PREFIX && strlen($hash) == 60) {
|
||||
$return['algo'] = PASSWORD_BCRYPT;
|
||||
$return['algoName'] = 'bcrypt';
|
||||
list($cost) = sscanf($hash, PASSWORD_PREFIX."%d$");
|
||||
$return['options']['cost'] = $cost;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
/**
|
||||
* Determine if the password hash needs to be rehashed according to the options provided
|
||||
*
|
||||
* If the answer is true, after validating the password using password_verify, rehash it.
|
||||
*
|
||||
* @param string $hash The hash to test
|
||||
* @param int $algo The algorithm used for new password hashes
|
||||
* @param array $options The options array passed to password_hash
|
||||
*
|
||||
* @return boolean True if the password needs to be rehashed.
|
||||
*/
|
||||
function password_needs_rehash($hash, $algo, array $options = array()) {
|
||||
$info = password_get_info($hash);
|
||||
if ($info['algo'] != $algo) {
|
||||
return true;
|
||||
}
|
||||
switch ($algo) {
|
||||
case PASSWORD_BCRYPT:
|
||||
$cost = isset($options['cost']) ? $options['cost'] : 10;
|
||||
if ($cost != $info['options']['cost']) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Verify a password against a hash using a timing attack resistant approach
|
||||
*
|
||||
* @param string $password The password to verify
|
||||
* @param string $hash The hash to verify against
|
||||
*
|
||||
* @return boolean If the password matches the hash
|
||||
*/
|
||||
function password_verify($password, $hash) {
|
||||
if (!function_exists('crypt')) {
|
||||
trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
$ret = crypt($password, $hash);
|
||||
if (!is_string($ret) || strlen($ret) != strlen($hash) || strlen($ret) <= 13) {
|
||||
return false;
|
||||
}
|
||||
$status = 0;
|
||||
for ($i = 0; $i < strlen($ret); $i++) {
|
||||
$status |= (ord($ret[$i]) ^ ord($hash[$i]));
|
||||
}
|
||||
return $status === 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,508 @@
|
||||
<?php
|
||||
define("PATH_PHPMYBORDER", "/phpMyBorder/"); // path from doc_root
|
||||
// e.g if this script is accessable via
|
||||
// www.domain.com/scripts/phpMyborder.php
|
||||
// PATH_PHPMYBORDER = "/scripts/"
|
||||
/*
|
||||
|
||||
|
||||
___[ PhpMyBorder v0.1 beta ]____
|
||||
/ \
|
||||
| Created by |
|
||||
| Vidar Vestnes |
|
||||
| (c)2005 |
|
||||
| |
|
||||
\___[ Norway ]___________________/
|
||||
|
||||
Licence: Freely distributed
|
||||
|
||||
|
||||
Check for new version
|
||||
|
||||
http://www.phpmyborder.com
|
||||
|
||||
|
||||
|
||||
HOW TO USE:
|
||||
|
||||
include this file in your script
|
||||
|
||||
include_once("phpMyBorder/phpMyBorder1.class.php");
|
||||
|
||||
add a bordergenerator
|
||||
|
||||
$pmb = new PhpMyBorder();
|
||||
|
||||
|
||||
Now you are ready to output borders.
|
||||
Use the function border_start to begin the border
|
||||
|
||||
echo $pmb->border_start(); // using the defaults
|
||||
echo "Your content here..."";
|
||||
echo $pmb->border_end();
|
||||
|
||||
border_start have these attributes to help you customize your border.
|
||||
|
||||
border_start(
|
||||
$width = false, // pixel e.g. "250px"
|
||||
$color = false, // hex e.g "DDEEFF"
|
||||
$cornersize = false, // 5-50
|
||||
$borderthickness = false, // 1-3
|
||||
$style = false // 1 or 2 (1=filled, 2=outline)
|
||||
)
|
||||
|
||||
|
||||
always remember to close your border by calling border_end()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Example: test.php
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>PhpMyBorder Demo</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
require_once('phpMyBorder/phpMyBorder1.class.php');
|
||||
$pmb = new PhpMyBorder();
|
||||
|
||||
echo $pmb->border_start();
|
||||
echo "Test1 - Default border";
|
||||
echo $pmb->border_end();
|
||||
|
||||
echo "<br>";
|
||||
|
||||
echo $pmb->border_start("300px","FF0000",20);
|
||||
echo "Test2 - width: 300px, fillcolor: FF0000 (red), cornersize : 20px (radius);";
|
||||
echo $pmb->border_end();
|
||||
|
||||
echo "<br>";
|
||||
|
||||
echo $pmb->border_start("250px","FF5500",7,2,2);
|
||||
echo "Test2 - width: 250px, fillcolor: FF5500 (orange), cornersize : 7px (radius), borderthickness: 2px, style : 2 (outlined);";
|
||||
echo $pmb->border_end();
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class PhpMyBorder{
|
||||
|
||||
//part of the border to painted
|
||||
var $paint;
|
||||
|
||||
//properies of the border
|
||||
var $property;
|
||||
|
||||
//gif which is rendered, a part of the border.
|
||||
var $image;
|
||||
|
||||
//width of the complete border
|
||||
var $width;
|
||||
|
||||
// constructor of the class
|
||||
function PhpMyBorder(){
|
||||
|
||||
$this->checkFunctions();
|
||||
|
||||
$this->checkCacheDir();
|
||||
|
||||
//creates a dummy picutre
|
||||
$this->image = imagecreatetruecolor(1, 1);
|
||||
|
||||
//set defaults
|
||||
$this->setStyle (1); // 1 = FILLED, 2 = OUTLINE
|
||||
$this->setColor ('DDEEFF'); // fill and outlined border color
|
||||
$this->setCornerSize (5); // integer 5-50
|
||||
$this->setBorderThickness (2); // integer 1-3
|
||||
}
|
||||
|
||||
function checkFunctions(){
|
||||
$functions = array(
|
||||
"imagegif",
|
||||
"sscanf",
|
||||
"imagecopymerge",
|
||||
"imagerotate",
|
||||
"imagecreatetruecolor",
|
||||
"ob_start",
|
||||
"imagefill"
|
||||
);
|
||||
|
||||
for($i=0;$i<count($functions);$i++){
|
||||
$func = $functions[$i];
|
||||
if(!function_exists($func)) {
|
||||
$msg = "
|
||||
PHP function <B>$func</B> is missing.<BR>
|
||||
<BR>
|
||||
<i>
|
||||
This function is requiered by phpMyBorder. This version of PHP does not support phpMyBorder.<BR>
|
||||
Try uppgrading you PHP installation.
|
||||
</i>
|
||||
";
|
||||
$this->fatal_error($msg,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
//sets the border color
|
||||
function setColor($color){
|
||||
$this->setProp('color', $color."000000");
|
||||
}
|
||||
|
||||
//gets the color (HTML hex format)
|
||||
function getColor(){
|
||||
return substr($this->getProp('color'),0,6);
|
||||
}
|
||||
|
||||
function getColorAllocate(){
|
||||
sscanf($this->getColor(), "%2x%2x%2x", $red, $green, $blue);
|
||||
return imagecolorallocate($this->image, $red, $green, $blue );
|
||||
}
|
||||
|
||||
//gets the color which to be transparent
|
||||
function getTransparentAllocate(){
|
||||
sscanf("FF0000", "%2x%2x%2x", $red, $green, $blue);
|
||||
|
||||
$transparent = imagecolorallocate($this->image, $red, $green, $blue );
|
||||
|
||||
if($this->getColorAllocate() == $transparent){
|
||||
sscanf("0000FF", "%2x%2x%2x", $red, $green, $blue);
|
||||
$transparent =imagecolorallocate($this->image, $red, $green, $blue );
|
||||
}
|
||||
return $transparent;
|
||||
}
|
||||
|
||||
function checkCacheDir(){
|
||||
|
||||
$dir_script = dirname(__FILE__);
|
||||
$dir_cache = $this -> getPathCache();
|
||||
|
||||
$dir_abs = $dir_script."/".$this -> getPathCache();
|
||||
|
||||
if(is_writable($dir_abs)) return true;
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if(!is_writeable($dir_script)){
|
||||
$error = "
|
||||
Directory <B>$dir_script</b> is not writable. <BR>
|
||||
<BR>
|
||||
<i>
|
||||
The directory which you have put the phpMyBorder script is not writable.<BR>
|
||||
Make sure that PHP has write permission to this path to be able to cache borders (gifs images)<BR>
|
||||
Use chmod to solve the problem ( Unix and Linux ).
|
||||
</i>
|
||||
";
|
||||
$this->fatal_error($error, 2);
|
||||
}
|
||||
|
||||
|
||||
if(is_dir($dir_abs) && !is_writeable($dir_abs) ) {
|
||||
$error = "
|
||||
Directory <B>$dir_abs</b> is not writable. <BR>
|
||||
<BR>
|
||||
<i>
|
||||
The cachedir is not writable.<BR>
|
||||
Make sure that PHP has write permission to this path to be able to cache borders (gifs images)<BR>
|
||||
Use chmod to solve the problem ( Unix and Linux ).
|
||||
</i>
|
||||
";
|
||||
$this->fatal_error($error, 2);
|
||||
}
|
||||
|
||||
if(!@mkdir($dir_abs)){
|
||||
$error = "
|
||||
Failed to create directory <B>$dir_abs</b>. <BR>
|
||||
<BR>
|
||||
<i>
|
||||
This directory is needed to cache borders (gifs images)<BR>
|
||||
</i>
|
||||
";
|
||||
$this->fatal_error($error,3);
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if(!is_writeable($dir_abs)){
|
||||
$error = "
|
||||
Cache directory does not exist : <B>$dir_abs</b>. <BR>
|
||||
<BR>
|
||||
<i>
|
||||
This directory is needed to cache borders (gifs images)<BR>
|
||||
</i>
|
||||
";
|
||||
$this->fatal_error($error , 4);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function fatal_error($error,$nr = false){
|
||||
$msg =
|
||||
"
|
||||
<HTML>
|
||||
<BODY style=\"font-family: Microsoft Sans Serif,helvetica, arial; font-size:14; \">
|
||||
<H1 style=\"color:#FF0000; font-size:15px;margin:0px;\">PhpMyBorder failure :</H1><BR>
|
||||
<BR>
|
||||
ErrorMessage [ $nr ] : <BR>
|
||||
<BR>
|
||||
$error
|
||||
<BR>
|
||||
<BR>
|
||||
- phpMyBorder
|
||||
</BODY>
|
||||
</HTML>
|
||||
";
|
||||
die($msg);
|
||||
}
|
||||
|
||||
|
||||
//gets scriptpath
|
||||
function getPathScript(){
|
||||
$path = str_replace("\\","/",PATH_PHPMYBORDER);
|
||||
$path = substr($path,-1 )!= "/" ? $path."/" : $path;
|
||||
return $path;
|
||||
}
|
||||
|
||||
function getPathCache(){
|
||||
return "cache";
|
||||
}
|
||||
|
||||
function getAbsolutePathCache(){
|
||||
$path = dirname(__FILE__)."/".$this->getPathCache();
|
||||
$path = str_replace("\\","/",$path);
|
||||
$path = str_replace("//","/",$path);
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
//checks if a part (gif) is cached
|
||||
function isCached(){
|
||||
$path = $this->getAbsolutePathCache()."/".$this->getFileName();
|
||||
return is_file($path);
|
||||
}
|
||||
|
||||
//sets which part of the table to be paintet 1-9 (1 is upper left, 9 is bottom right)
|
||||
function paint($paint){
|
||||
$this->paint = $paint;
|
||||
}
|
||||
|
||||
//setting style, (outlined or filled)
|
||||
function setStyle($style = 1){
|
||||
$this->setProp('style',$style);
|
||||
}
|
||||
|
||||
//return choosen style
|
||||
function getStyle(){
|
||||
return $this->getProp('style');
|
||||
}
|
||||
|
||||
function setBorderWidth($width){
|
||||
$this->width = $width;
|
||||
}
|
||||
|
||||
function getBorderWidth(){
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
//sets the corersize (pixel)
|
||||
function setCornerSize($size){
|
||||
$size = $size<5 ? 5 : $size;
|
||||
$size = $size>50 ? 50 : $size;
|
||||
$this->setProp('cornersize',$size);
|
||||
}
|
||||
|
||||
//gets the cornersize
|
||||
function getCornerSize(){
|
||||
return $this->getProp('cornersize');
|
||||
}
|
||||
|
||||
//sets the boderthickness
|
||||
function setBorderThickness($thick) {
|
||||
$thick = $thick<1 ? 1 : $thick;
|
||||
$thick = $thick>3 ? 3 : $thick;
|
||||
|
||||
$this->setProp('thick',$thick);
|
||||
}
|
||||
|
||||
// gets the borderthickness
|
||||
function getThick(){
|
||||
return $this->getProp('thick');
|
||||
}
|
||||
|
||||
// checks if the current part is a tablecorner or an edge
|
||||
function isCorner(){
|
||||
return $this->paint % 2 == 1;
|
||||
}
|
||||
|
||||
//store a property about the gif
|
||||
function setProp($prop,$value){
|
||||
return $this->property[$prop] = $value;
|
||||
}
|
||||
|
||||
//returns a property
|
||||
function getProp($prop){
|
||||
return $this->property[$prop];
|
||||
}
|
||||
|
||||
// flips a image
|
||||
function ImageFlip($type){
|
||||
$imgsrc = $this->image;
|
||||
|
||||
$width = imagesx($imgsrc);
|
||||
$height = imagesy($imgsrc);
|
||||
|
||||
$imgdest = imagecreatetruecolor($width, $height);
|
||||
ImageAlphaBlending($imgdest, false);
|
||||
|
||||
switch( $type ) {
|
||||
case 1:
|
||||
for( $y=0 ; $y<$height ; $y++ )
|
||||
imagecopymerge($imgdest, $imgsrc, 0, $height-$y-1, 0, $y, $width, 1,100);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for( $x=0 ; $x<$width ; $x++ )
|
||||
imagecopymerge($imgdest, $imgsrc, $width-$x-1, 0, $x, 0, 1, $height,100);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
for( $x=0 ; $x<$width ; $x++ )
|
||||
imagecopymerge($imgdest, $imgsrc, $width-$x-1, 0, $x, 0, 1, $height,100);
|
||||
|
||||
$rowBuffer = imagecreatetruecolor($width, 1);
|
||||
for( $y=0 ; $y<($height/2) ; $y++ )
|
||||
{
|
||||
imagecopymerge($rowBuffer, $imgdest , 0, 0, 0, $height-$y-1, $width, 1,100);
|
||||
imagecopymerge($imgdest , $imgdest , 0, $height-$y-1, 0, $y, $width, 1,100);
|
||||
imagecopymerge($imgdest , $rowBuffer, 0, $y, 0, 0, $width, 1,100);
|
||||
}
|
||||
|
||||
imagedestroy( $rowBuffer );
|
||||
break;
|
||||
}
|
||||
$this->image = $imgdest;
|
||||
}
|
||||
|
||||
// caches the image
|
||||
function save(){
|
||||
imagegif($this->image, $this->getAbsolutePathCache()."/".$this->getFilename());
|
||||
}
|
||||
|
||||
//render the actual gif with assigned setting
|
||||
function render(){
|
||||
|
||||
$line = $this->getThick();
|
||||
|
||||
//creates the real imagesize
|
||||
$this->image = imagecreatetruecolor($this->getCornerSize(), $this->getCornerSize());
|
||||
|
||||
//fill the complete image with a transparent color
|
||||
imagefill($this->image, 0, 0, $this->getTransparentAllocate());
|
||||
|
||||
//paints
|
||||
if($this->isCorner()){
|
||||
imagefilledellipse($this->image, $this->getCornerSize(), $this->getCornerSize(), $this->getCornerSize()*2, $this->getCornerSize()*2, $this->getColorAllocate());
|
||||
if($this->getStyle() == 2){
|
||||
//paints another ellipse with transparent-color to make it look like outlined
|
||||
imagefilledellipse($this->image, $this->getCornerSize(), $this->getCornerSize(), ($this->getCornerSize()-$line)*2, ($this->getCornerSize()-$line)*2, $this->getTransparentAllocate());
|
||||
}
|
||||
}else{
|
||||
imagefilledrectangle( $this->image, 0, 0, $this->getCornerSize() ,$this->getCornerSize(), $this->getColorAllocate() );
|
||||
if($this->getStyle() == 2){
|
||||
imagefilledrectangle( $this->image, 0, $line, $this->getCornerSize() ,$this->getCornerSize(), $this->getTransparentAllocate() );
|
||||
}
|
||||
}
|
||||
|
||||
//rotates or flips the image to fit part
|
||||
switch($this->paint){
|
||||
|
||||
CASE 6 : $this->rotate(90) ; break;
|
||||
CASE 4 : $this->rotate(270) ; break;
|
||||
CASE 8 : $this->rotate(180) ; break;
|
||||
CASE 3 : $this->imageFlip(2) ; break;
|
||||
CASE 7 : $this->imageFlip(1) ; break;
|
||||
CASE 9 : $this->imageFlip(3) ; break;
|
||||
}
|
||||
|
||||
imagecolortransparent($this->image, $this->getTransparentAllocate());
|
||||
|
||||
ImageTrueColorToPalette( $this->image, TRUE, 256 );
|
||||
}
|
||||
|
||||
//rotate the gif
|
||||
function rotate($degree){
|
||||
$this->image = imagerotate($this->image,360-$degree,0);
|
||||
}
|
||||
|
||||
//get filename based on properties
|
||||
function getFilename(){
|
||||
return implode("_", $this->property)."_".$this->paint.".gif";
|
||||
}
|
||||
|
||||
//generate the url to be set as (tablecell) background
|
||||
function getUrl($paint){
|
||||
$this->paint($paint);
|
||||
|
||||
if(!$this->isCached()){
|
||||
$this->render();
|
||||
$this->save();
|
||||
}
|
||||
|
||||
return PATH_PHPMYBORDER.$this->getPathCache()."/".$this->getFilename();
|
||||
}
|
||||
|
||||
//starts printing the border
|
||||
function border_start($width = false,$color = false, $cornersize = false, $borderthickness = false,$style = false){
|
||||
if($color) $this->setColor ($color);
|
||||
if($cornersize) $this->setCornerSize ($cornersize);
|
||||
if($borderthickness) $this->setBorderThickness ($borderthickness);
|
||||
if($style) $this->setStyle ($style);
|
||||
|
||||
$style = "";
|
||||
if($width) $style.="width : $width ;";
|
||||
if($style != "") $style = "style=\"$style\"";
|
||||
?>
|
||||
|
||||
<TABLE cellSpacing=0 cellPadding=0 <?=$style?> >
|
||||
<TR>
|
||||
<TD style="width:<?=$this->getCornerSize()?>px; height:<?=$this->getCornerSize()?>px; background : url(<?=$this->getUrl(1)?>);"></TD>
|
||||
<TD style="background-image:url(<?=$this->getUrl(2)?>); background-repeat:repeat-x;"></TD>
|
||||
<TD style="width:<?=$this->getCornerSize()?>px; height:<?=$this->getCornerSize()?>px; background-image: url(<?=$this->getUrl(3)?>);"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD style="background-image:url(<?=$this->getUrl(4)?>); background-repeat:repeat-y ;"></TD>
|
||||
<TD style="background: <?= $this->getStyle() == 1 ? "#".$this->getColor() : "transparent";?>;">
|
||||
<?php
|
||||
}
|
||||
|
||||
//end the border...
|
||||
function border_end(){
|
||||
?>
|
||||
</TD>
|
||||
<TD style="background-image:url(<?=$this->getUrl(6)?>); background-repeat:repeat-y;"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD style="width:<?=$this->getCornerSize()?>px; height:<?=$this->getCornerSize()?>px; background-image: url(<?=$this->getUrl(7)?>);"></TD>
|
||||
<TD style="background-image:url(<?=$this->getUrl(8)?>); background-repeat:repeat-x;"></TD>
|
||||
<TD style="width:<?=$this->getCornerSize()?>px; height:<?=$this->getCornerSize()?>px; background-image: url(<?=$this->getUrl(9)?>);"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
$phpMyBorder = new PhpMyBorder();
|
||||
?>
|
||||
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
/*
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
| |
|
||||
| DISCLAIMER |
|
||||
| |
|
||||
| PhpMyBorder is provided "as is", |
|
||||
| without warranty of any kind, |
|
||||
| either express or implied. |
|
||||
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
|
||||
|
||||
|
||||
*************************************************************
|
||||
|| PhpMyBorder v2.0 http://www.phpmyborder.com ||
|
||||
*************************************************************
|
||||
|| ||
|
||||
|| This class is able to generates 3 types of borders. ||
|
||||
|| ||
|
||||
|| - ROUND (rounded corners) ||
|
||||
|| - RAISED (rounded corners with 3D effect) ||
|
||||
|| - SHADOW (square corners) ||
|
||||
|| ||
|
||||
|| ||
|
||||
|| Enjoy! ||
|
||||
||_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _||
|
||||
||_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_||
|
||||
Author : Vidar Vestnes
|
||||
|
||||
|
||||
-- changelog --
|
||||
|
||||
1. dec 2005 added raised (3D) and shadowed border support.
|
||||
25. nov 2005 first version.
|
||||
|
||||
|
||||
About PhpMyBorder :
|
||||
|
||||
At the moment PhpMyBorder supports 3 shapes (round, raised and shadow).
|
||||
The bordereffects are achived by using plain HTML / XHTML and CSS styling.
|
||||
No images or tables are used in the output code. This results in faster
|
||||
downloading and rendering of your page compared to other techniques.
|
||||
The code is freely distributed and may be changed and copied.
|
||||
|
||||
Please give feedback if you have any suggestions to make the code better.
|
||||
|
||||
phpmyborder@gmail.com
|
||||
|
||||
|
||||
HOW TO USE:
|
||||
|
||||
First include phpMyBorder2.class.php to your script:
|
||||
|
||||
include_once('phpMyBorder2.class.php');
|
||||
|
||||
// Create a bordergenerator:
|
||||
$pmb = new PhpMyBorder(); // or new PhpMyBorder(true), read about stylesheet-support below
|
||||
|
||||
|
||||
Add a ROUND border (round corners):
|
||||
|
||||
$pmb->begin_round("250px", "DDEEFF", "005555"); // width, fillcolor, edgecolor
|
||||
echo "Content...";
|
||||
$pmb->end_round(); //
|
||||
|
||||
|
||||
Add a RAISED border (round corners):
|
||||
|
||||
$pmb->begin_raised("100%", "DDEEFF"); // width, fillcolor
|
||||
echo "Content...";
|
||||
$pmb->end_raised();
|
||||
|
||||
|
||||
Add a SHADOW border (square corners):
|
||||
|
||||
$pmb->begin_shadow("250px", "DDEEFF","000000","555577"); // width, fillcolor, edgecolor, shadowcolor
|
||||
echo "Content...";
|
||||
$pmb->end_shadow();
|
||||
|
||||
|
||||
|
||||
|
||||
USING STYLESHEET:
|
||||
|
||||
To save styling-overhead you may use PhpMyBorder with stylesheet.
|
||||
|
||||
Tell PhpMyBorder to generate code depending on stylesheet by using argument true in the constructor.
|
||||
|
||||
$pmb = new PhpMyBorder(true);
|
||||
|
||||
|
||||
And simply add these lines to your existing stylesheet.
|
||||
|
||||
Round border (add following 8 lines):
|
||||
|
||||
.pmb1_b, .pmb1_s {font-size:1px; }
|
||||
.pmb1_1, .pmb1_2, .pmb1_3, .pmb1_4, .pmb1_b, .pmb1_s {display:block; overflow:hidden;}
|
||||
.pmb1_1, .pmb1_2, .pmb1_3, .pmb1_s {height:1px;}
|
||||
.pmb1_2, .pmb1_3, .pmb1_4 {border-style: solid; border-width: 0 1px; }
|
||||
.pmb1_1 {margin:0 5px; }
|
||||
.pmb1_2 {margin:0 3px; border-width:0 2px;}
|
||||
.pmb1_3 {margin:0 2px;}
|
||||
.pmb1_4 {height:2px; margin:0 1px;}
|
||||
.pmb1_c {display:block; border-style: solid ; border-width: 0 1px;}
|
||||
|
||||
|
||||
Raised border (add following 17 lines) :
|
||||
|
||||
.pmb2_1, .pmb2_2, .pmb2_3, .pmb2_4, .pmb2_5, .pmb2_6, .pmb2_7, .pmb2_8 { overflow:hidden; font-size:1px; display:block; }
|
||||
.pmb2_1, .pmb2_2, .pmb2_3, .pmb2_6, .pmb2_7, .pmb2_8, .pmb2_s { height:1px; }
|
||||
.pmb2_2, .pmb2_3, .pmb2_4, .pmb2_5, .pmb2_6, .pmb2_7, .pmb2_c { border-style: solid; border-width: 0 1px; }
|
||||
.pmb2_2, .pmb2_3, .pmb2_4, .pmb2_c { border-left-color: #fff; }
|
||||
.pmb2_7, .pmb2_6, .pmb2_5, .pmb2_c { border-right-color: #999; }
|
||||
.pmb2_1 { margin:0 5px; background: #fff;}
|
||||
.pmb2_2 { border-right:1px solid #eee; }
|
||||
.pmb2_3 { border-right:1px solid #ddd; }
|
||||
.pmb2_4 { border-right:1px solid #aaa; }
|
||||
.pmb2_5 { border-left:1px solid #eee; }
|
||||
.pmb2_6 { border-left:1px solid #ddd; }
|
||||
.pmb2_7 { border-left:1px solid #aaa; }
|
||||
.pmb2_8 { margin:0 5px; background:#999; }
|
||||
.pmb2_2, .pmb2_7 { margin:0 3px; border-width:0 2px; }
|
||||
.pmb2_3, .pmb2_6 { margin:0 2px; }
|
||||
.pmb2_4, .pmb2_5 { margin:0 1px; height:2px; }
|
||||
.pmb2_c { padding: 0 4px; display:block; }
|
||||
.pmb2_s {display : block; font-size:1px;}
|
||||
|
||||
|
||||
Shadow border (add following 2 lines):
|
||||
|
||||
.pmb3_1 { border-width: 1px; border-style: solid; position: relative; left:-3px; top:-3px; }
|
||||
.pmb3_2 { overflow:hidden; width:100%; padding:0 3px; }
|
||||
.pmb3_s { height: 1px; font-size: 1px; display: block; }
|
||||
|
||||
|
||||
|
||||
|
||||
More examples:
|
||||
|
||||
------ example yourpage1.php -----------
|
||||
<?php
|
||||
include_once('phpMyBorder2.class.php');
|
||||
$pmb = new PhpMyBorder(true); // using stylesheet
|
||||
|
||||
//echo $pmb -> begin_round("300px","DDEEFF","000000"); // (width, fillcolor, edgecolor)
|
||||
echo "content...";
|
||||
//echo $pmb -> end_round();
|
||||
?>
|
||||
------------------------------
|
||||
|
||||
|
||||
------ example yourpage2.php -----------
|
||||
<?php
|
||||
include_once('phpMyBorder2.class.php');
|
||||
$pmb = new PhpMyBorder();
|
||||
|
||||
echo $pmb -> begin_raised("300px","DDEEFF"); // (width, fillcolor)
|
||||
echo "content...";
|
||||
echo $pmb -> end_raised();
|
||||
?>
|
||||
------------------------------
|
||||
|
||||
|
||||
------ example yourpage3.php -----------
|
||||
<?php
|
||||
include_once('phpMyBorder2.class.php');
|
||||
$pmb = new PhpMyBorder(true); // using stylesheet
|
||||
|
||||
echo $pmb -> begin_shadow("300px","DDEEFF","000000","555555"); // (width, fillcolor, edgecolor, shadowcolor)
|
||||
echo "content...";
|
||||
echo $pmb -> end_shadow();
|
||||
?>
|
||||
------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
Allways check for the newest version at :
|
||||
|
||||
http://www.phpmyborder.com
|
||||
|
||||
*/
|
||||
|
||||
class PhpMyBorder{
|
||||
|
||||
var $width; // width of the border
|
||||
var $fill; // fillcolor
|
||||
var $edge; // edgecolor
|
||||
var $shadow; // shadowcolor
|
||||
var $stylesheet; // using stylesheet or not
|
||||
|
||||
function PhpMyBorder($stylesheet = false){
|
||||
$this->setWidth("100%"); // default width
|
||||
$this->setFill("DDEEFF"); // default fillcolor
|
||||
$this->setEdge("4444AA"); // default edgecolor
|
||||
$this->setShadow("888888"); // default shadowcolor
|
||||
$this->stylesheet = $stylesheet; // using stylesheet (default = false)
|
||||
}
|
||||
|
||||
function setWidth($value){
|
||||
$this->width = trim($value);
|
||||
}
|
||||
|
||||
function getWidth(){
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
function setFill($value){
|
||||
$this->fill = trim($value);
|
||||
}
|
||||
|
||||
function getFill($prefix = false) {
|
||||
if(!$prefix) return $this->fill;
|
||||
if(strlen($this->fill)<3) return "transparent";
|
||||
return strtolower($this->fill) == "transparent" ? "transparent" : "#".$this->fill;
|
||||
}
|
||||
|
||||
function setEdge($value) {
|
||||
$this->edge = trim($value);
|
||||
}
|
||||
|
||||
function getEdge($prefix = false) {
|
||||
if(!$prefix) return $this->edge;
|
||||
|
||||
if( $this->edge===false
|
||||
||
|
||||
strlen($this->edge)<3
|
||||
||
|
||||
strtolower($this->edge) == "transparent"
|
||||
) return "transparent";
|
||||
|
||||
return "#".$this->edge;
|
||||
}
|
||||
|
||||
function setShadow($value) {
|
||||
$this->shadow = trim($value);
|
||||
}
|
||||
|
||||
function getShadow($prefix = false) {
|
||||
if(!$prefix) return $this->shadow;
|
||||
if(strlen($this->shadow)<3) return "transparent";
|
||||
return strtolower($this->shadow) == "transparent" ? "transparent" : "#".$this->shadow;
|
||||
}
|
||||
|
||||
|
||||
function stylesheet_round(){
|
||||
?>
|
||||
|
||||
.pmb1_b, .pmb1_s {font-size:1px; }
|
||||
.pmb1_1, .pmb1_2, .pmb1_3, .pmb1_4, .pmb1_b, .pmb1_s {display:block; overflow:hidden;}
|
||||
.pmb1_1, .pmb1_2, .pmb1_3, .pmb1_s {height:1px;}
|
||||
.pmb1_2, .pmb1_3, .pmb1_4 {border-style: solid; border-width: 0 1px; }
|
||||
.pmb1_1 {margin:0 5px; }
|
||||
.pmb1_2 {margin:0 3px; border-width:0 2px;}
|
||||
.pmb1_3 {margin:0 2px;}
|
||||
.pmb1_4 {height:2px; margin:0 1px;}
|
||||
.pmb1_c {display:block; border-style: solid ; border-width: 0 1px;}
|
||||
<?php
|
||||
}
|
||||
|
||||
function begin_round($width = false, $fill = false, $edge = false){
|
||||
if($width) $this->setWidth ($width );
|
||||
if($fill) $this->setFill ($fill);
|
||||
if($edge) $this->setEdge ($edge);
|
||||
ob_start();
|
||||
if($this->stylesheet){
|
||||
?>
|
||||
|
||||
<!-- begin PhpMyBorder -->
|
||||
<div style="width:<?=$this->getWidth(true)?>;">
|
||||
<b class="pmb1_b">
|
||||
<b class="pmb1_1" style="background:<?=$this->getEdge(true)?>; color: inherit;"></b>
|
||||
<b class="pmb1_2" style="background:<?=$this->getFill(true)?>; color: inherit; border-color: <?=$this->getEdge(true)?>;"></b>
|
||||
<b class="pmb1_3" style="background:<?=$this->getFill(true)?>; color: inherit; border-color: <?=$this->getEdge(true)?>;"></b>
|
||||
<b class="pmb1_4" style="background:<?=$this->getFill(true)?>; color: inherit; border-color: <?=$this->getEdge(true)?>;"></b>
|
||||
</b>
|
||||
<div class="pmb1_c" style="background:<?=$this->getFill(true)?>; color: inherit; border-color: <?=$this->getEdge(true)?>;">
|
||||
<b class="pmb1_s"></b>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
|
||||
<!-- begin PhpMyBorder -->
|
||||
<div style="width: <?=$this->getWidth(true)?>;">
|
||||
<b style="font-size:1px;display:block; overflow:hidden;">
|
||||
<b style="background:<?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;height:1px;margin:0 5px;"></b>
|
||||
<b style="background:<?=$this->getFill(true)?>; border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;height:1px;border-style: solid; border-width: 0 1px;margin:0 3px; border-width:0 2px;"></b>
|
||||
<b style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;height:1px;border-style: solid; border-width: 0 1px;margin:0 2px;"></b>
|
||||
<b style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;border-style: solid; border-width: 0 1px;height:2px; margin:0 1px;"></b>
|
||||
</b>
|
||||
<div style="background:<?=$this->getFill(true)?>; border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; border-style: solid ; border-width: 0 1px;">
|
||||
<b style="font-size:1px;display:block; overflow:hidden;height:1px;"></b>
|
||||
<?php
|
||||
}
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
function end_round(){
|
||||
ob_start();
|
||||
|
||||
if($this->stylesheet){
|
||||
?>
|
||||
|
||||
<b class="pmb1_s"></b>
|
||||
</div>
|
||||
<b class="pmb1_b">
|
||||
<b class="pmb1_4" style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit;"></b>
|
||||
<b class="pmb1_3" style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit;"></b>
|
||||
<b class="pmb1_2" style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit;"></b>
|
||||
<b class="pmb1_1" style="background:<?=$this->getEdge(true)?>; color: inherit;"></b>
|
||||
</b>
|
||||
</div>
|
||||
<!-- end PhpMyBorder -->
|
||||
|
||||
<?php }else{?>
|
||||
|
||||
<b style="font-size:1px;display:block; overflow:hidden;height:1px;"></b>
|
||||
</div>
|
||||
<b style="font-size:1px;display:block; overflow:hidden;">
|
||||
<b style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;border-style: solid; border-width: 0 1px;height:2px; margin:0 1px;"></b>
|
||||
<b style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;height:1px;border-style: solid; border-width: 0 1px;margin:0 2px;"></b>
|
||||
<b style="background:<?=$this->getFill(true)?>;border-color: <?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;height:1px;border-style: solid; border-width: 0 1px;margin:0 3px; border-width:0 2px;"></b>
|
||||
<b style="background:<?=$this->getEdge(true)?>; color: inherit; display:block; overflow:hidden;height:1px;margin:0 5px;"></b>
|
||||
</b>
|
||||
</div>
|
||||
<!-- end PhpMyBorder -->
|
||||
|
||||
<?php
|
||||
}
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
function stylesheet_raised(){
|
||||
?>
|
||||
|
||||
.pmb2_1, .pmb2_2, .pmb2_3, .pmb2_4, .pmb2_5, .pmb2_6, .pmb2_7, .pmb2_8 { overflow:hidden; font-size:1px; display:block; }
|
||||
.pmb2_1, .pmb2_2, .pmb2_3, .pmb2_6, .pmb2_7, .pmb2_8, .pmb2_s { height:1px; }
|
||||
.pmb2_2, .pmb2_3, .pmb2_4, .pmb2_5, .pmb2_6, .pmb2_7, .pmb2_c { border-style: solid; border-width: 0 1px; }
|
||||
.pmb2_2, .pmb2_3, .pmb2_4, .pmb2_c { border-left-color: #fff; }
|
||||
.pmb2_7, .pmb2_6, .pmb2_5, .pmb2_c { border-right-color: #999; }
|
||||
.pmb2_1 { margin:0 5px; background-color: #fff; color: inherit;}
|
||||
.pmb2_2 { border-right:1px solid #eee; }
|
||||
.pmb2_3 { border-right:1px solid #ddd; }
|
||||
.pmb2_4 { border-right:1px solid #aaa; }
|
||||
.pmb2_5 { border-left:1px solid #eee; }
|
||||
.pmb2_6 { border-left:1px solid #ddd; }
|
||||
.pmb2_7 { border-left:1px solid #aaa; }
|
||||
.pmb2_8 { margin:0 5px; background-color:#999; color: inherit;}
|
||||
.pmb2_2, .pmb2_7 { margin:0 3px; border-width:0 2px; }
|
||||
.pmb2_3, .pmb2_6 { margin:0 2px; }
|
||||
.pmb2_4, .pmb2_5 { margin:0 1px; height:2px; }
|
||||
.pmb2_c { padding: 0 4px; display:block; }
|
||||
.pmb2_s {display : block; font-size:1px;}
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
function begin_raised($width = false, $fill = false){
|
||||
if($width) $this->setWidth ($width );
|
||||
if($fill) $this->setFill ($fill);
|
||||
ob_start();
|
||||
if($this->stylesheet){
|
||||
?>
|
||||
|
||||
<!-- begin PhpMyBorder -->
|
||||
<div style="width: <?=$this->getWidth(true)?>;">
|
||||
<b class="pmb2_1"></b>
|
||||
<b class="pmb2_2" style="background: <?=$this->getFill(true)?>; color: inherit;"></b>
|
||||
<b class="pmb2_3" style="background: <?=$this->getFill(true)?>; color: inherit;"></b>
|
||||
<b class="pmb2_4" style="background: <?=$this->getFill(true)?>; color: inherit;"></b>
|
||||
<div class="pmb2_c" style="background: <?=$this->getFill(true)?>; color: inherit;">
|
||||
<b class="pmb2_s"></b>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
|
||||
<!-- begin PhpMyBorder -->
|
||||
<div style="width: <?=$this->getWidth(true)?>;">
|
||||
<b style="overflow:hidden; font-size:1px; display:block;height:1px; margin:0 5px; background:#fff; color: inherit;"></b>
|
||||
<b style="background: <?=$this->getFill(true)?>; color: inherit; overflow:hidden; font-size:1px; display:block;height:1px; border-style: solid; border-width: 0 1px; border-left-color: #fff; border-right:1px solid #eee; margin:0 3px; border-width:0 2px;"></b>
|
||||
<b style="background: <?=$this->getFill(true)?>; color: inherit; overflow:hidden; font-size:1px; display:block;height:1px;border-style: solid; border-width: 0 1px;border-left-color: #fff;border-right:1px solid #ddd;margin:0 2px;"></b>
|
||||
<b style="background: <?=$this->getFill(true)?>; color: inherit; overflow:hidden; font-size:1px; display:block;border-style: solid; border-width: 0 1px; border-left-color: #fff; border-right:1px solid #aaa;margin:0 1px; height:2px;"></b>
|
||||
<div style="background: <?=$this->getFill(true)?>; color: inherit; padding: 0 4px; display:block;border-style: solid; border-width: 0 1px;border-left-color: #fff;border-right-color: #999;">
|
||||
<b style="height:1px; display:block; font-size:1px;"></b>
|
||||
<?php
|
||||
}
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
function end_raised(){
|
||||
ob_start();
|
||||
|
||||
if($this->stylesheet){
|
||||
?>
|
||||
|
||||
<b class="pmb2_s"></b>
|
||||
</div>
|
||||
<b class="pmb2_5" style="background: <?=$this->getFill(true)?>; color: inherit;"></b>
|
||||
<b class="pmb2_6" style="background: <?=$this->getFill(true)?>; color: inherit;"></b>
|
||||
<b class="pmb2_7" style="background: <?=$this->getFill(true)?>; color: inherit;"></b>
|
||||
<b class="pmb2_8"></b>
|
||||
</div>
|
||||
<!-- end PhpMyBorder -->
|
||||
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
|
||||
<b style="height:1px; display:block; font-size:1px;"></b>
|
||||
</div>
|
||||
<b style="background: <?=$this->getFill(true)?>; color: inherit; overflow:hidden; font-size:1px; display:block;border-style: solid; border-width: 0 1px;border-right-color: #999;border-left:1px solid #eee; margin:0 1px; height:2px;"></b>
|
||||
<b style="background: <?=$this->getFill(true)?>; color: inherit; overflow:hidden; font-size:1px; display:block;height:1px;border-style: solid; border-width: 0 1px;border-right-color: #999;border-left:1px solid #ddd; margin:0 2px;"></b>
|
||||
<b style="background: <?=$this->getFill(true)?>; color: inherit; overflow:hidden; font-size:1px; display:block;height:1px;border-style: solid; border-width: 0 1px;border-right-color: #999;border-left:1px solid #aaa;margin:0 3px; border-width:0 2px;"></b>
|
||||
<b style="overflow:hidden; font-size:1px; display:block;height:1px;margin:0 5px; background:#999; color: inherit;"></b>
|
||||
</div>
|
||||
<!-- end PhpMyBorder -->
|
||||
|
||||
<?php
|
||||
}
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
|
||||
function stylesheet_shadow(){
|
||||
?>
|
||||
|
||||
.pmb3_1 { border-width: 1px; border-style: solid; position: relative; left:-3px; top:-3px; }
|
||||
.pmb3_2 { overflow:hidden; width:100%; padding:0 3px; }
|
||||
.pmb3_s { height: 1px; font-size: 1px; display: block; }
|
||||
<?php
|
||||
}
|
||||
|
||||
function begin_shadow($width = false, $fill = false, $edge = false, $shadow = false){
|
||||
if($width) $this->setWidth ($width );
|
||||
if($fill) $this->setFill ($fill);
|
||||
if($edge) $this->setEdge ($edge);
|
||||
if($shadow) $this->setShadow($shadow);
|
||||
ob_start();
|
||||
if($this->stylesheet){
|
||||
?>
|
||||
|
||||
<!-- begin PhpMyBorder -->
|
||||
<div style="width: <?=$this->getWidth(true)?>; background: <?=$this->getShadow(true)?>;">
|
||||
<div class="pmb3_1" style="background: <?=$this->getFill(true)?>; border-color: <?=$this->getEdge(true)?>; color: inherit;">
|
||||
<div class="pmb3_2">
|
||||
<b class="pmb3_s"></b>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
|
||||
<!-- begin PhpMyBorder -->
|
||||
<div style="width: <?=$this->getWidth(true)?>; background: <?=$this->getShadow(true)?>; color: inherit;">
|
||||
<div style="background: <?=$this->getFill(true)?>; border-color: <?=$this->getEdge(true)?>; color: inherit; border-width: 1px; border-style: solid; position: relative; left:-3px; top:-3px;">
|
||||
<div style="overflow:hidden; width:100%; padding:0 3px; ">
|
||||
<b style="height:1px; display:block; font-size:1px;"></b>
|
||||
<?php
|
||||
}
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
function end_shadow(){
|
||||
ob_start();
|
||||
|
||||
if($this->stylesheet){
|
||||
?>
|
||||
|
||||
<b class="pmb3_s"></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end PhpMyBorder -->
|
||||
|
||||
<?php }else{?>
|
||||
|
||||
<b style="height:1px; display:block; font-size:1px;"></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end PhpMyBorder -->
|
||||
|
||||
<?php
|
||||
}
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,451 @@
|
||||
<?php
|
||||
include '../core/main.php';
|
||||
header("Content-Type: text/html; charset=ISO-8859-15");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
|
||||
//login validasi
|
||||
if(!empty($_GET['NIP'])){
|
||||
$ip = getRealIpAddr();
|
||||
$db->query('delete from tmp_cartbayar where IP = \''.$ip.'\'');
|
||||
$db->query('delete from tmp_orderpenunjang where ip = \''.$ip.'\'');
|
||||
$db->query('delete from tmp_cartresep where IP = \''.$ip.'\'');
|
||||
|
||||
$sql = "SELECT * FROM m_login WHERE NIP = '".$_GET['NIP']."'";
|
||||
$query = $db->query($sql);
|
||||
$data = $query->fetchAll()[0];
|
||||
$NIP = $data['NIP'];
|
||||
$KDUNIT = $data['KDUNIT'];
|
||||
if($_GET['NIP'] == $NIP){
|
||||
$_SESSION['NIP'] = $NIP;
|
||||
$_SESSION['KDUNIT'] = $KDUNIT;
|
||||
$status_login = ($data['KDDOKTER'] != 0 && $data['ROLES'] == 4) ? 'dokter' : (($data['KDPERAWAT'] != 0) ? 'perawat' : 'umum');
|
||||
$hidden_form = '<input type="hidden" id="status_login" name="status_login" value="'.$status_login.'">';
|
||||
echo "<font color='green'> USERNAME Valid</font>".$hidden_form;
|
||||
}else{
|
||||
echo "<font color='red'> USERNAME Tidak Valid</font>";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_GET['PWD'])){
|
||||
$NIP1 = $_SESSION['NIP'];
|
||||
$sql = "SELECT * FROM m_login WHERE NIP = '".$NIP1."' AND PWD = '".$_GET['PWD']."'";
|
||||
$query = $db->query($sql);
|
||||
$data = $query->fetchAll()[0];
|
||||
$PWD2 = $_GET['PWD'];
|
||||
$PWD = $data['PWD'];
|
||||
$SES_REG = $data['SES_REG'];
|
||||
if($_GET['PWD'] == $PWD){
|
||||
$_SESSION['SES_REG'] = $SES_REG;
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function(event){
|
||||
jQuery("#PWD").keyup(function(event){
|
||||
if(event.keyCode == 13){
|
||||
jQuery("#LOGIN").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<input type="button" onclick="window.location='user_level.php';" value=" LOGIN " class=" text " name="LOGIN" id="LOGIN"/>
|
||||
<?php
|
||||
}else{
|
||||
echo"<font color='red'>PASSWORD Tidak Valid</font>";
|
||||
}
|
||||
}
|
||||
|
||||
//kondisi total list-----------------------------------------------------------------------------------
|
||||
if(!empty($_GET['code'])){
|
||||
if($_GET['code']){
|
||||
$sql = "SELECT * FROM m_tarif WHERE kode = '".htmlspecialchars($_GET['code'])."'";
|
||||
$query = $db->query($sql);
|
||||
$data = $query->fetchAll()[0];
|
||||
$_SESSION['cart'][$data['tarif']];
|
||||
echo "<br /><strong>TOTAL : Rp. ".number_format($_SESSION['cart'], 0)." <input type='submit' value=' chex ' class=' text '></strong>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_GET['edit_pasien'])){
|
||||
echo"data pasien di edit ";
|
||||
}
|
||||
|
||||
//kondisi cek no rm PENDAFTARAN-----------------------------------------------------------------------------
|
||||
if(!empty($_GET['NOMR'])){
|
||||
$sql = "SELECT * FROM m_pasien WHERE NOMR='".htmlspecialchars($_GET['NOMR'])."'";
|
||||
$qry = $db->query($sql);
|
||||
$data = $qry->fetchAll()[0];
|
||||
$lihat = str_pad($_GET['NOMR'],8,"0",STR_PAD_LEFT);
|
||||
if($lihat == $data['NOMR']){
|
||||
$_SESSION['kosong'] = "";
|
||||
$_SESSION['new_nomr'] ="";
|
||||
include("function.php");
|
||||
include("view_prosess.php");
|
||||
}else{
|
||||
//$_SESSION['new_nomr'] = str_pad($_GET['NOMR'],6,"0",STR_PAD_LEFT);
|
||||
$_SESSION['new_nomr'] = $_GET['NOMR'];
|
||||
$_SESSION['kosong'] = "Data No MR tidak Ditemukan";
|
||||
include("function.php");
|
||||
include("view_prosess.php");
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_GET['psn'])){
|
||||
$sql = "SELECT *
|
||||
FROM m_pasien
|
||||
WHERE NOMR='".$_GET['psn']."'";
|
||||
// var_dump($sql);exit;
|
||||
$qry = $db->query($sql);
|
||||
if($qry->numRows() > 0) {
|
||||
$data = $qry->fetchAll()[0];
|
||||
$lihat = $_GET['psn'];
|
||||
#print_r($lihat);
|
||||
if($lihat == $data['nomr']){
|
||||
#if($qry->numRows() > 0){
|
||||
$r = 0;
|
||||
$a = datediff($data['tgllahir'],date("Y-m-d"));
|
||||
$umur = $a['years']." tahun ".$a['months']." bulan ".$a['days']." hari";
|
||||
$nama = explode(',',str_replace('.',' ',$data['nama']));
|
||||
$CleanArray = TrimArray($nama);
|
||||
|
||||
//$a = array('Tn.','Ny.','Nn.','An.');
|
||||
|
||||
if(array_search('Tn',$CleanArray)){
|
||||
$title = 'Tn';
|
||||
}elseif(array_search('Nn',$CleanArray)){
|
||||
$title = 'Nn';
|
||||
}elseif(array_search('Ny',$CleanArray)){
|
||||
$title = 'Ny';
|
||||
}elseif(array_search('An',$CleanArray)){
|
||||
$title = 'An';
|
||||
}
|
||||
echo $r.'|'.
|
||||
$data['nomr'].'|'.
|
||||
$nama[0].'|'.
|
||||
$data['tempat'].'|'.
|
||||
$data['tgllahir'].'|'.
|
||||
strtoupper($data['jeniskelamin']).'|'.
|
||||
$data['alamat'].'|'.
|
||||
$data['kelurahan'].'|'.
|
||||
$data['kdkecamatan'].'|'.
|
||||
$data['kota'].'|'.
|
||||
$data['kdprovinsi'].'|'.
|
||||
$data['notelp'].'|'.
|
||||
$data['noktp'].'|'.
|
||||
$data['suami_ortu'].'|'.$data['pekerjaan'].'|'.$data['status'].'|'.$data['agama'].'|'.$data['pendidikan'].'|'.$data['kdcarabayar'].'|'.$data['alamat_ktp'].'|'.$umur.'|'.$title.'|'.$data['penanggungjawab_nama'].'|'.$data['penanggungjawab_hubungan'].'|'.$data['penanggungjawab_alamat'].'|'.$data['penanggungjawab_phone'].'|'.$data['no_kartu'].'|'.$data['jns_pasien'].'|'.$data['kdprovider'].'|'.$data['nmprovider'].'|'.$data['kelas'].'|'.$data['bahasa'].'|'.$data['kebangsaan'].'|'.$data['notelprumah1'].'|'.$data['notelprumah2'].'|'.$data['notelpkantor'].'|'.$data['no_hp'].'|'.$data['asal_masuk'].'|'.strtolower($data['buta_huruf']).'|'.strtolower($data['hambatan_komunikasi']).'|'.$data['sim'].'|'.$data['paspor'].'|'.$data['st_disabilitas'].'|'.$data['disabilitas'].'|'.$data['st_identitas_ortu'].'|'.$data['nama_ayah'].'|'.$data['nama_ibu'].'|'.$data['pendidikan_ayah'].'|'.$data['pendidikan_ibu'].'|'.(($data['ktp_file'] != '') ? base64_encode($data['ktp_file']) : '').'|'.(($data['kk_file'] != '') ? base64_encode($data['kk_file']) : '');
|
||||
}else{
|
||||
$r = 1;
|
||||
echo $r.'|'.$data['nomr'].'|'.$data['nama'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$r = 1;
|
||||
echo $r.'|-|';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#echo '<input type="hidden" name="PASIENBARU" id="PASIENBARU" value="'.$r.'">';
|
||||
#echo '<input type="radio" name="STATUSPASIEN" id="STATUSPASIEN" class="statuspasien" value="1" '.if($r != '0'): echo'checked="checked"'; endif;.'> Pasien Baru';
|
||||
#echo '<input type="radio" name="STATUSPASIEN" id="STATUSPASIEN" class="statuspasien" value="0" '.if($r == '0'): echo'checked="checked"'; endif;.'> Pasien Lama';
|
||||
|
||||
|
||||
//kondisi get no mr untuk pembayaran
|
||||
|
||||
//kondisi cek no rm----------------------------------------------------------------------------------
|
||||
if(!empty($_GET['cek_rm'])){
|
||||
$sql = "SELECT a.NOMR,b.NAMA
|
||||
FROM t_pendaftaran a, m_pasien b
|
||||
where tglreg=current_date() and a.nomr=b.nomr and a.nomr='".htmlspecialchars($_GET['cek_rm'])."'";
|
||||
$qry = $db->query($sql);
|
||||
$data = $qry->fetchAll()[0];
|
||||
if($_GET['cek_rm'] == $data['NOMR']){
|
||||
echo "<input type='text' class='text' name='NAMA' value='". $data['NAMA'] ."'> No Rm
|
||||
<input type='text' class='text' name='NAMA' value='". $data['NOMR'] ."'> ";
|
||||
}else{
|
||||
//echo "<input type='text' class='text' name='NAMA'> Data No MR tidak Ditemukan";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//kondisi cek poli -------------------------------------------------------------------------------------------------
|
||||
if(!empty($_GET['jadwal_dokter'])){
|
||||
if($_GET['jadwal_dokter']){
|
||||
$sql = "SELECT * FROM m_dokter WHERE KDPOLY='".htmlspecialchars($_GET['jadwal_dokter'])."'";
|
||||
$qry = $db->query($sql);
|
||||
echo "<select name=\"KDDOKTER\" class='text'>";
|
||||
foreach($qry->fetchAll() as $data){
|
||||
echo "<option nama='".$data['KDDOKTER']."' value='".$data['KDDOKTER']."'>".$data['NAMADOKTER']."</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//searching pasien---------------------------------------------------------------------------------
|
||||
|
||||
if(!empty($_GET['search'])){
|
||||
if($_GET['search']){
|
||||
|
||||
echo $pos = strpos($_GET['search'],'.');
|
||||
|
||||
?>
|
||||
|
||||
<table width="95%" style="margin:10px;" border="0" cellspacing="0" cellspading="0">
|
||||
<tr align="center">
|
||||
<th>NO RM</th>
|
||||
<th>Nama Pasien</th>
|
||||
<th>Tempat Tanggal lahir</th>
|
||||
<th>Alamat</th>
|
||||
<th>Jenis Kelamin</th>
|
||||
<th>No telepon</th>
|
||||
<th>Edit</th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
if (substr($_GET['search'],0,$pos)=='nomr' ){
|
||||
$sql="SELECT *
|
||||
FROM m_pasien
|
||||
WHERE NOMR like '".substr($_GET['search'],$pos+1,strlen($_GET['search'])-$pos)."%'";
|
||||
}
|
||||
if (substr($_GET['search'],0,$pos)=='nama' ){
|
||||
$sql="SELECT *
|
||||
FROM m_pasien
|
||||
WHERE NAMA like '".substr($_GET['search'],$pos+1,strlen($_GET['search'])-$pos)."%'";
|
||||
}
|
||||
if (substr($_GET['search'],0,$pos)=='alamat' ){
|
||||
$sql="SELECT *
|
||||
FROM m_pasien
|
||||
WHERE ALAMAT like '".substr($_GET['search'],$pos+1,strlen($_GET['search'])-$pos)."%'";
|
||||
}
|
||||
if (substr($_GET['search'],0,$pos)=='telepon' ){
|
||||
$sql="SELECT *
|
||||
FROM m_pasien
|
||||
WHERE NOTELP like '".substr($_GET['search'],$pos+1,strlen($_GET['search'])-$pos)."%'";
|
||||
}
|
||||
|
||||
$pager = paginate( $sql, 15, 5, "param1=valu1¶m2=value2");
|
||||
|
||||
//The paginate() function returns a mysql result set
|
||||
|
||||
|
||||
foreach($pager['list'] as $data) {?>
|
||||
<tr <?php echo "class =";
|
||||
$count++;
|
||||
if ($count % 2) {
|
||||
echo "tr1"; }
|
||||
else {
|
||||
echo "tr2";
|
||||
}
|
||||
?>
|
||||
<td><?php echo $data['NOMR'];?></td>
|
||||
<td><?php echo $data['NAMA']; ?></td>
|
||||
<td><?php echo $data['TGLLAHIR']; ?></td>
|
||||
<td><?php echo $data['ALAMAT']; ?></td>
|
||||
<td><?php if($data['JENISKELAMIN']=="l" || $data['JENISKELAMIN']=="L"){echo"Laki-Laki";}else{echo"Perempuan";} ?></td>
|
||||
<td><?php echo $data['NOTELP'] ?></td>
|
||||
<td align="center"><a href="?link=24&NOMR=<?=$data['NOMR'];?>">edit pasien</a></td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
//Display the full navigation in one go
|
||||
echo $pager['nav'];
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
//cari_poly----------------------------------------------------------------------------------
|
||||
|
||||
if(!empty($_POST['poly']) && !empty($_POST['TGLREG'])){
|
||||
if(!empty($_POST['TGLREG'])){
|
||||
$tgl_reg = $_POST['TGLREG'];
|
||||
}else{
|
||||
$tgl_reg =date('Y/m/d');
|
||||
}
|
||||
?>
|
||||
<table width="95%" style="margin:10px;" border="0" cellspacing="0" cellspading="0" title="List Kunjungan Data Pasien Per Hari Ini">
|
||||
<tr align="center">
|
||||
<th>NO RM</th>
|
||||
<th>Nama Pasien</th>
|
||||
<th>Alamat</th>
|
||||
<th>Poly</th>
|
||||
<th>Cara Bayar</th>
|
||||
<th>Rujukan</th>
|
||||
</tr>
|
||||
<?php
|
||||
$sql="SELECT A.NOMR,A.NAMA,A.ALAMAT,B.NAMA AS POLY1,C.NAMA AS CARABAYAR1,D.NAMA AS RUJUKAN1
|
||||
FROM m_pasien A, m_poly B, m_carabayar C, m_rujukan D, t_pendaftaran E
|
||||
WHERE A.NOMR=E.NOMR AND E.KDPOLY=".$_POST['poly']." AND E.KDRUJUK=D.KODE AND E.KDCARABAYAR=C.KODE AND E.KDPOLY=B.KODE AND E.TGLREG='$tgl_reg'";
|
||||
$pager = paginate( $sql, 15, 5, "param1=valu1¶m2=value2");
|
||||
|
||||
//The paginate() function returns a mysql result set
|
||||
|
||||
if(!$rs){ echo"<div class='tb'>anda belum memilih poly</div>";
|
||||
}else{
|
||||
foreach($pager['list'] as $data) {?>
|
||||
<tr <?php echo "class =";
|
||||
$count++;
|
||||
if ($count % 2) {
|
||||
echo "tr1"; }
|
||||
else {
|
||||
echo "tr2";
|
||||
}
|
||||
?>>
|
||||
<td><?php echo $data['NOMR'];?></td>
|
||||
<td><?php echo $data['NAMA']; ?></td>
|
||||
<td><?php echo $data['ALAMAT']; ?></td>
|
||||
<td><?php echo $data['POLY1']; ?></td>
|
||||
<td><?php echo $data['CARABAYAR1'];?></td>
|
||||
<td><?php echo $data['RUJUKAN1'];?></td>
|
||||
</tr>
|
||||
<?php }
|
||||
|
||||
//Display the full navigation in one go
|
||||
echo $pager['nav'];
|
||||
?>
|
||||
|
||||
</table>
|
||||
<?php }
|
||||
}
|
||||
|
||||
// cek nama pasien
|
||||
if(!empty($_GET['NAMA'])){
|
||||
if($_GET['NAMA']){
|
||||
$sql_nama = "SELECT NAMA FROM m_pasien WHERE NAMA = '".$_GET['NAMA']."'";
|
||||
$qry_nama = $db->query($sql_nama);
|
||||
$data_nama = $qry_nama->fetchAll()[0];
|
||||
if($data_nama['NAMA'] == $_GET['NAMA']){
|
||||
?>
|
||||
<input title="NAMA" disabled="disabled" class="text" type="text" <?php if($_GET['NAMA']){ echo"value='".$data_nama['NAMA']."'";} ?> name="NAMA" size="30" value="<?=$m_pasien->NAMA?>" id="NAMA" onblur="javascript: MyAjaxRequest('nam','include/process.php?NAMA=','NAMA');" /> <span style="color:#F00; font:bold;">Nama Pasien Telah Terdaftar</span>
|
||||
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
// switch case ----------------------------------------------------------------------------------------------
|
||||
|
||||
switch (array_key_exists('state', $_GET) && $_GET['state'])
|
||||
{
|
||||
case 'info':
|
||||
echo "<p>Klik tarif Pilih untuk melihat Hasil / Total.<br> ".$_SESSION['total2']."</p>";
|
||||
break;
|
||||
|
||||
case 'pendaftaran_val':
|
||||
echo "test";
|
||||
break;
|
||||
|
||||
case 'puskesmas':
|
||||
echo " ket. <input name='KETRUJUK' id='KETRUJUK' type='text' size='20' class='text'>";
|
||||
break;
|
||||
|
||||
case 'rs_lain':
|
||||
echo " ket. <input type='text' name='KETRUJUK' id='KETRUJUK' size='20' class='text'>";
|
||||
break;
|
||||
|
||||
case 'lain_lain':
|
||||
echo " ket. <input type='text' name='KETRUJUK' id='KETRUJUK' size='20' class='text'>";
|
||||
break;
|
||||
|
||||
case 'cetak':
|
||||
$db->query("INSERT INTO t_cetak_data (IDXBILL,JUMLAH) VALUES('".$_GET['idxb']."','1')");
|
||||
$sql_cetak = "SELECT sum(JUMLAH) AS JUMLAH FROM t_cetak_data WHERE IDXBILL='".$_GET['idxb']."'";
|
||||
$qry_cetak = $db->query($sql_cetak);
|
||||
$cetak = $qry_cetak->fetchAll()[0];
|
||||
$_SESSION['cetak']=$cetak['JUMLAH'];
|
||||
echo $cetak['JUMLAH'];
|
||||
|
||||
break;
|
||||
|
||||
case 'tgl_lahir':
|
||||
$a = datediff($m_pasien->TGLLAHIR, date("Y-m-d"));
|
||||
echo "<input type='text' value='umur ".$a['years']." tahun ".$a['months']." bulan ".$a['days']." hari' size='45' class='text'>";
|
||||
break;
|
||||
|
||||
case 'list':
|
||||
include("../list_data_pasien.php");
|
||||
break;
|
||||
|
||||
case 'reset':
|
||||
unset($_SESSION['total']);
|
||||
unset($_SESSION['total2']);
|
||||
echo "Record telah terhapus!";
|
||||
break;
|
||||
}
|
||||
|
||||
//update t_bayarrajal dari form keringanan
|
||||
if(array_key_exists('idxb', $_REQUEST) && $_REQUEST['idxb']){
|
||||
$tcount = $db->query('SELECT *, TARIFRS * QTY AS TOTAL FROM t_billrajal WHERE IDXBILL = "'.$_REQUEST['idxb'].'"');
|
||||
$sisa = $_REQUEST['keringanan']; #10.000
|
||||
$carabayar = $_REQUEST['carabayar'];
|
||||
$arr_bill = array();
|
||||
foreach($tcount->fetchAll() as $dt){
|
||||
$arr_bill[] = $dt;
|
||||
if($sisa > 0): # Jika keringanan > 0
|
||||
$sisa_s = $sisa - $dt['TOTAL']; #10.000 - 100.000 = 0;
|
||||
if($sisa_s > 0):
|
||||
$t_billrajal = "UPDATE t_billrajal SET SHIFT='".$_POST['SHIFT']."', COSTSHARING = '".$dt['TOTAL']."', CARABAYAR = '".$carabayar."' WHERE IDXBILL='".$dt['IDXBILL']."'";
|
||||
elseif($sisa_s < 0):
|
||||
$t_billrajal = "UPDATE t_billrajal SET SHIFT='".$_POST['SHIFT']."', COSTSHARING = '".$sisa."', CARABAYAR = '".$carabayar."' WHERE IDXBILL='".$dt['IDXBILL']."'";
|
||||
else:
|
||||
$t_billrajal = "UPDATE t_billrajal SET SHIFT='".$_POST['SHIFT']."', COSTSHARING = '".$dt['TOTAL']."', CARABAYAR = '".$carabayar."' WHERE IDXBILL='".$dt['IDXBILL']."'";
|
||||
endif;
|
||||
execute($t_billrajal);
|
||||
$sisa = $sisa_s;
|
||||
endif;
|
||||
}
|
||||
$tbp = (array_key_exists('tbp', $_REQUEST)) ? $_REQUEST['tbp'] : NULL;
|
||||
$t_bayarrajal = "UPDATE t_bayarrajal SET
|
||||
TGLBAYAR='".date('Y-m-d')."',
|
||||
JAMBAYAR='".date('H:i:s')."',
|
||||
JMBAYAR='".$_REQUEST['total']."',
|
||||
NIP = '".$_SESSION['NIP']."',
|
||||
SHIFT='".$_REQUEST['SHIFT']."',
|
||||
TBP='".$tbp."',
|
||||
LUNAS = '1',
|
||||
STATUS = 'LUNAS',
|
||||
TOTCOSTSHARING = '".$_REQUEST['keringanan']."',
|
||||
ALASAN_KERINGANAN = '".$_REQUEST['alasan']."',
|
||||
CARABAYAR = '".$carabayar."',
|
||||
st_carabayar = '".$_REQUEST['st_carabayar']."',
|
||||
kd_penjamin = '".$_REQUEST['kd_penjamin']."'
|
||||
WHERE IDXBILL='".$_REQUEST['idxb']."'";
|
||||
execute($t_bayarrajal);
|
||||
|
||||
// jika piutang
|
||||
if($_REQUEST['st_carabayar'] == 2){
|
||||
$sql_piutang = "INSERT INTO t_piutang SET idxbill = ".$_REQUEST['idxb'].", nomr = '".$arr_bill[0]['NOMR']."', tanggal = '".date('Y-m-d')."', pukul = '".date('H:i:s')."', idxdaftar = ".$arr_bill[0]['IDXDAFTAR'].", nobilling = ".$arr_bill[0]['NOBILL'].", nip = '".$_SESSION['NIP']."', shift = ".$_REQUEST['SHIFT'].", idxtarif = '".$arr_bill[0]['KODETARIF']."', idxpoly = ".$arr_bill[0]['KDPOLY'].", kddokter = ".$arr_bill[0]['KDDOKTER'].", jumlah_bayar = ".$_REQUEST['total'].", jasa_sarana = ".($arr_bill[0]['JASA_SARANA']).", jasa_pelayanan = ".($arr_bill[0]['JASA_PELAYANAN']).", kode_penjamin= ".$_REQUEST['kd_penjamin'].", st_billing = 'IRJA'";
|
||||
execute($sql_piutang);
|
||||
}
|
||||
|
||||
$lunas = $db->query('select * from t_bayarrajal where IDXBILL = "'.$_REQUEST['idxb'].'"');
|
||||
$rlunas= $lunas->fetchAll()[0];
|
||||
if($rlunas['STATUS'] == 'LUNAS'){
|
||||
echo 'ok';
|
||||
}else{
|
||||
echo 'error';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(array_key_exists('bayardeporanap', $_REQUEST) && $_REQUEST['bayardeporanap']=="true"){
|
||||
$nobill = $_REQUEST['nobill'];
|
||||
$tbp = $_REQUEST['tbp'];
|
||||
$shift = $_REQUEST['shift'];
|
||||
$total = $_REQUEST['total'];
|
||||
$sql = $db->query('CALL pr_bayar_obat_ranap("'.$nobill.'","'.$tbp.'","'.$shift.'","'.$total.'")');
|
||||
if($sql){
|
||||
echo 'ok';
|
||||
}
|
||||
}
|
||||
?>
|
||||
Vendored
+4875
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// FILTER ALL REQUEST
|
||||
if(!function_exists('strip_slash')) {
|
||||
function strip_slash(&$value) {
|
||||
if(is_array($value))
|
||||
{
|
||||
strip($value);
|
||||
}
|
||||
else {
|
||||
$value = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!function_exists('strip')) {
|
||||
function strip(&$request)
|
||||
{
|
||||
if(!is_array($request))
|
||||
{
|
||||
die("Inputan Bukan Array");
|
||||
}
|
||||
array_walk($request, "strip_slash");
|
||||
return $request;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_REQUEST))
|
||||
{
|
||||
strip($_REQUEST);
|
||||
}
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
strip($_POST);
|
||||
}
|
||||
|
||||
if(!empty($_GET))
|
||||
{
|
||||
strip($_GET);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,60 @@
|
||||
// script.aculo.us scriptaculous.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
var Scriptaculous = {
|
||||
Version: '1.8.2',
|
||||
require: function(libraryName) {
|
||||
// inserting via DOM fails in Safari 2.0, so brute force approach
|
||||
document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
|
||||
},
|
||||
REQUIRED_PROTOTYPE: '1.6.0.3',
|
||||
load: function() {
|
||||
function convertVersionString(versionString) {
|
||||
var v = versionString.replace(/_.*|\./g, '');
|
||||
v = parseInt(v + '0'.times(4-v.length));
|
||||
return versionString.indexOf('_') > -1 ? v-1 : v;
|
||||
}
|
||||
|
||||
if((typeof Prototype=='undefined') ||
|
||||
(typeof Element == 'undefined') ||
|
||||
(typeof Element.Methods=='undefined') ||
|
||||
(convertVersionString(Prototype.Version) <
|
||||
convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
|
||||
throw("script.aculo.us requires the Prototype JavaScript framework >= " +
|
||||
Scriptaculous.REQUIRED_PROTOTYPE);
|
||||
|
||||
var js = /scriptaculous\.js(\?.*)?$/;
|
||||
$$('head script[src]').findAll(function(s) {
|
||||
return s.src.match(js);
|
||||
}).each(function(s) {
|
||||
var path = s.src.replace(js, ''),
|
||||
includes = s.src.match(/\?.*load=([a-z,]*)/);
|
||||
(includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
|
||||
function(include) { Scriptaculous.require(path+include+'.js') });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Scriptaculous.load();
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
$q = strtolower( $_GET["q"] );
|
||||
if (!$q) return;
|
||||
|
||||
include("../connect.php");
|
||||
|
||||
// Replace "TABLE_NAME" below with the table you'd like to extract data from
|
||||
$data = $db->query( "SELECT NAMA FROM m_pasien" )
|
||||
or die( mysqli_error($connect) );
|
||||
|
||||
// Replace "COLUMN_ONE" below with the column you'd like to search through
|
||||
// In between the if/then statement, you may present a string of text
|
||||
// you'd like to appear in the textbox.
|
||||
while( $row = mysqli_fetch_array( $data )){
|
||||
if ( strpos( strtolower( $row['NAMA'] ), $q ) !== false ) {
|
||||
echo $row['NAMA']."\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Binary file not shown.
@@ -0,0 +1,416 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page not found</title>
|
||||
<style>
|
||||
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
|
||||
body {margin:0}
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {display:block}
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {display:inline-block;vertical-align:baseline}
|
||||
audio:not([controls]) {display:none;height:0}
|
||||
[hidden],
|
||||
template {display:none}
|
||||
a {background:transparent}
|
||||
a:active,
|
||||
a:hover {outline:0}
|
||||
abbr[title] {border-bottom:1px dotted}
|
||||
b,
|
||||
strong {font-weight:bold}
|
||||
dfn {font-style:italic}
|
||||
h1 {font-size:2em;margin:0.67em 0}
|
||||
mark {background:#ff0;color:#000}
|
||||
small {font-size:80%}
|
||||
sub,
|
||||
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
|
||||
sup {top:-0.5em}
|
||||
sub {bottom:-0.25em}
|
||||
img {border:0}
|
||||
svg:not(:root) {overflow:hidden}
|
||||
figure {margin:1em 40px}
|
||||
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
|
||||
pre {overflow:auto}
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {font-family:monospace,monospace;font-size:1em}
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {color:inherit;font:inherit;margin:0}
|
||||
button {overflow:visible}
|
||||
button,
|
||||
select {text-transform:none}
|
||||
button,
|
||||
html input[type="button"],
|
||||
input[type="reset"],
|
||||
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
|
||||
button[disabled],
|
||||
html input[disabled] {cursor:default}
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {border:0;padding:0}
|
||||
input {line-height:normal}
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {box-sizing:border-box;padding:0}
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {height:auto}
|
||||
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
|
||||
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
|
||||
legend {border:0;padding:0}
|
||||
textarea {overflow:auto}
|
||||
optgroup {font-weight:bold}
|
||||
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
|
||||
td,
|
||||
th {padding:0}
|
||||
*,
|
||||
*:before,
|
||||
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
|
||||
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
|
||||
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
|
||||
button,
|
||||
input,
|
||||
select[multiple],
|
||||
textarea {background-image:none}
|
||||
a {color:#0181b9;text-decoration:none}
|
||||
a:hover,
|
||||
a:focus {color:#001721;text-decoration:underline}
|
||||
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
|
||||
img {vertical-align:middle}
|
||||
.img-responsive {display:block;max-width:100%;height:auto}
|
||||
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
|
||||
.img-circle {border-radius:50%}
|
||||
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
|
||||
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
|
||||
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
|
||||
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
|
||||
@media (min-width:768px) {.container {width:750px }}
|
||||
@media (min-width:992px) {.container {width:970px }}
|
||||
@media (min-width:1200px) {.container {width:1170px }}
|
||||
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
|
||||
.row {margin-left:-15px;margin-right:-15px}
|
||||
.row-flush {margin-left:0;margin-right:0}
|
||||
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
|
||||
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
|
||||
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
|
||||
.col-xs-12 {width:100%}
|
||||
.col-xs-11 {width:91.66666667%}
|
||||
.col-xs-10 {width:83.33333333%}
|
||||
.col-xs-9 {width:75%}
|
||||
.col-xs-8 {width:66.66666667%}
|
||||
.col-xs-7 {width:58.33333333%}
|
||||
.col-xs-6 {width:50%}
|
||||
.col-xs-5 {width:41.66666667%}
|
||||
.col-xs-4 {width:33.33333333%}
|
||||
.col-xs-3 {width:25%}
|
||||
.col-xs-2 {width:16.66666667%}
|
||||
.col-xs-1 {width:8.33333333%}
|
||||
.col-xs-pull-12 {right:100%}
|
||||
.col-xs-pull-11 {right:91.66666667%}
|
||||
.col-xs-pull-10 {right:83.33333333%}
|
||||
.col-xs-pull-9 {right:75%}
|
||||
.col-xs-pull-8 {right:66.66666667%}
|
||||
.col-xs-pull-7 {right:58.33333333%}
|
||||
.col-xs-pull-6 {right:50%}
|
||||
.col-xs-pull-5 {right:41.66666667%}
|
||||
.col-xs-pull-4 {right:33.33333333%}
|
||||
.col-xs-pull-3 {right:25%}
|
||||
.col-xs-pull-2 {right:16.66666667%}
|
||||
.col-xs-pull-1 {right:8.33333333%}
|
||||
.col-xs-pull-0 {right:0%}
|
||||
.col-xs-push-12 {left:100%}
|
||||
.col-xs-push-11 {left:91.66666667%}
|
||||
.col-xs-push-10 {left:83.33333333%}
|
||||
.col-xs-push-9 {left:75%}
|
||||
.col-xs-push-8 {left:66.66666667%}
|
||||
.col-xs-push-7 {left:58.33333333%}
|
||||
.col-xs-push-6 {left:50%}
|
||||
.col-xs-push-5 {left:41.66666667%}
|
||||
.col-xs-push-4 {left:33.33333333%}
|
||||
.col-xs-push-3 {left:25%}
|
||||
.col-xs-push-2 {left:16.66666667%}
|
||||
.col-xs-push-1 {left:8.33333333%}
|
||||
.col-xs-push-0 {left:0%}
|
||||
.col-xs-offset-12 {margin-left:100%}
|
||||
.col-xs-offset-11 {margin-left:91.66666667%}
|
||||
.col-xs-offset-10 {margin-left:83.33333333%}
|
||||
.col-xs-offset-9 {margin-left:75%}
|
||||
.col-xs-offset-8 {margin-left:66.66666667%}
|
||||
.col-xs-offset-7 {margin-left:58.33333333%}
|
||||
.col-xs-offset-6 {margin-left:50%}
|
||||
.col-xs-offset-5 {margin-left:41.66666667%}
|
||||
.col-xs-offset-4 {margin-left:33.33333333%}
|
||||
.col-xs-offset-3 {margin-left:25%}
|
||||
.col-xs-offset-2 {margin-left:16.66666667%}
|
||||
.col-xs-offset-1 {margin-left:8.33333333%}
|
||||
.col-xs-offset-0 {margin-left:0%}
|
||||
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
|
||||
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
|
||||
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
|
||||
.clearfix:before,
|
||||
.clearfix:after,
|
||||
.container:before,
|
||||
.container:after,
|
||||
.container-fluid:before,
|
||||
.container-fluid:after,
|
||||
.row:before,
|
||||
.row:after {content:" ";display:table}
|
||||
.clearfix:after,
|
||||
.container:after,
|
||||
.container-fluid:after,
|
||||
.row:after {clear:both}
|
||||
.center-block {display:block;margin-left:auto;margin-right:auto}
|
||||
.pull-right {float:right !important}
|
||||
.pull-left {float:left !important}
|
||||
.hide {display:none !important}
|
||||
.show {display:block !important}
|
||||
.invisible {visibility:hidden}
|
||||
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
|
||||
.hidden {display:none !important;visibility:hidden !important}
|
||||
.affix {position:fixed}
|
||||
@-ms-viewport {width:device-width}
|
||||
.visible-xs,
|
||||
.visible-sm,
|
||||
.visible-md,
|
||||
.visible-lg {display:none !important}
|
||||
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
|
||||
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
|
||||
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
|
||||
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
|
||||
@media (max-width:767px) {.hidden-xs {display:none !important }}
|
||||
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
|
||||
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
|
||||
@media (min-width:1200px) {.hidden-lg {display:none !important }}
|
||||
.visible-print {display:none !important}
|
||||
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
|
||||
@media print {.hidden-print {display:none !important }}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
|
||||
h1 small,
|
||||
h2 small,
|
||||
h3 small,
|
||||
h4 small,
|
||||
h5 small,
|
||||
h6 small,
|
||||
.h1 small,
|
||||
.h2 small,
|
||||
.h3 small,
|
||||
.h4 small,
|
||||
.h5 small,
|
||||
.h6 small,
|
||||
h1 .small,
|
||||
h2 .small,
|
||||
h3 .small,
|
||||
h4 .small,
|
||||
h5 .small,
|
||||
h6 .small,
|
||||
.h1 .small,
|
||||
.h2 .small,
|
||||
.h3 .small,
|
||||
.h4 .small,
|
||||
.h5 .small,
|
||||
.h6 .small {font-weight:normal;line-height:1;color:#999}
|
||||
h1,
|
||||
.h1,
|
||||
h2,
|
||||
.h2,
|
||||
h3,
|
||||
.h3 {margin-top:20px;margin-bottom:10px}
|
||||
h1 small,
|
||||
.h1 small,
|
||||
h2 small,
|
||||
.h2 small,
|
||||
h3 small,
|
||||
.h3 small,
|
||||
h1 .small,
|
||||
.h1 .small,
|
||||
h2 .small,
|
||||
.h2 .small,
|
||||
h3 .small,
|
||||
.h3 .small {font-size:65%}
|
||||
h4,
|
||||
.h4,
|
||||
h5,
|
||||
.h5,
|
||||
h6,
|
||||
.h6 {margin-top:10px;margin-bottom:10px}
|
||||
h4 small,
|
||||
.h4 small,
|
||||
h5 small,
|
||||
.h5 small,
|
||||
h6 small,
|
||||
.h6 small,
|
||||
h4 .small,
|
||||
.h4 .small,
|
||||
h5 .small,
|
||||
.h5 .small,
|
||||
h6 .small,
|
||||
.h6 .small {font-size:75%}
|
||||
h1,
|
||||
.h1 {font-size:36px}
|
||||
h2,
|
||||
.h2 {font-size:30px}
|
||||
h3,
|
||||
.h3 {font-size:24px}
|
||||
h4,
|
||||
.h4 {font-size:18px}
|
||||
h5,
|
||||
.h5 {font-size:14px}
|
||||
h6,
|
||||
.h6 {font-size:12px}
|
||||
p {margin:0 0 10px}
|
||||
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
|
||||
@media (min-width:768px) {.lead {font-size:21px }}
|
||||
small,
|
||||
.small {font-size:85%}
|
||||
cite {font-style:normal}
|
||||
.text-left {text-align:left}
|
||||
.text-right {text-align:right}
|
||||
.text-center {text-align:center}
|
||||
.text-justify {text-align:justify}
|
||||
.text-muted {color:#999}
|
||||
.text-primary {color:#34495e}
|
||||
a.text-primary:hover {color:#222f3d}
|
||||
.text-success {color:#3c763d}
|
||||
a.text-success:hover {color:#2b542c}
|
||||
.text-info {color:#31708f}
|
||||
a.text-info:hover {color:#245269}
|
||||
.text-warning {color:#8a6d3b}
|
||||
a.text-warning:hover {color:#66512c}
|
||||
.text-danger {color:#a94442}
|
||||
a.text-danger:hover {color:#843534}
|
||||
.bg-primary {color:#fff;background-color:#34495e}
|
||||
a.bg-primary:hover {background-color:#222f3d}
|
||||
.bg-success {background-color:#dff0d8}
|
||||
a.bg-success:hover {background-color:#c1e2b3}
|
||||
.bg-info {background-color:#d9edf7}
|
||||
a.bg-info:hover {background-color:#afd9ee}
|
||||
.bg-warning {background-color:#fcf8e3}
|
||||
a.bg-warning:hover {background-color:#f7ecb5}
|
||||
.bg-danger {background-color:#f2dede}
|
||||
a.bg-danger:hover {background-color:#e4b9b9}
|
||||
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
|
||||
ul,
|
||||
ol {margin-top:0;margin-bottom:10px}
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol,
|
||||
ol ol {margin-bottom:0}
|
||||
.list-unstyled {padding-left:0;list-style:none}
|
||||
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
|
||||
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
|
||||
dl {margin-top:0;margin-bottom:20px}
|
||||
dt,
|
||||
dd {line-height:1.42857143}
|
||||
dt {font-weight:bold}
|
||||
dd {margin-left:0}
|
||||
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
|
||||
abbr[title],
|
||||
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
|
||||
.initialism {font-size:90%;text-transform:uppercase}
|
||||
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
|
||||
blockquote p:last-child,
|
||||
blockquote ul:last-child,
|
||||
blockquote ol:last-child {margin-bottom:0}
|
||||
blockquote footer,
|
||||
blockquote small,
|
||||
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
|
||||
blockquote footer:before,
|
||||
blockquote small:before,
|
||||
blockquote .small:before {content:'\2014 \00A0'}
|
||||
.blockquote-reverse,
|
||||
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
|
||||
.blockquote-reverse footer:before,
|
||||
blockquote.pull-right footer:before,
|
||||
.blockquote-reverse small:before,
|
||||
blockquote.pull-right small:before,
|
||||
.blockquote-reverse .small:before,
|
||||
blockquote.pull-right .small:before {content:''}
|
||||
.blockquote-reverse footer:after,
|
||||
blockquote.pull-right footer:after,
|
||||
.blockquote-reverse small:after,
|
||||
blockquote.pull-right small:after,
|
||||
.blockquote-reverse .small:after,
|
||||
blockquote.pull-right .small:after {content:'\00A0 \2014'}
|
||||
blockquote:before,
|
||||
blockquote:after {content:""}
|
||||
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
|
||||
|
||||
.oc-icon-chain:before,
|
||||
.icon-chain:before,
|
||||
|
||||
.oc-icon-chain-broken:before,
|
||||
.icon-chain-broken:before {content:"\f127"}
|
||||
|
||||
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
|
||||
.close:hover,
|
||||
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
|
||||
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
|
||||
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
|
||||
[class^="icon-"],
|
||||
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
|
||||
[class^="icon-"]:before,
|
||||
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
|
||||
[class^="icon-"].pull-left,
|
||||
[class*=" icon-"].pull-left {margin-right:.3em}
|
||||
[class^="icon-"].pull-right,
|
||||
[class*=" icon-"].pull-right {margin-left:.3em}
|
||||
[class^="oc-icon-"]:before,
|
||||
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
|
||||
[class^="oc-icon-"].empty:before,
|
||||
[class*=" oc-icon-"].empty:before {margin-right:0}
|
||||
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
|
||||
.icon-2x {font-size:2em}
|
||||
.icon-3x {font-size:3em}
|
||||
.icon-4x {font-size:4em}
|
||||
.icon-5x {font-size:5em}
|
||||
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
|
||||
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
|
||||
h1 i[class^="icon-"]:before {font-size:46px}
|
||||
i[class^="icon-"].warning {color:#c84530}
|
||||
h3 {font-size:24px;font-weight:300}
|
||||
p.lead {font-size:16px;font-weight:300}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
|
||||
<p class="lead">The requested page cannot be found.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
moo.fx, simple effects library built with prototype.js (http://prototype.conio.net).
|
||||
by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE.
|
||||
for more info (http://moofx.mad4milk.net).
|
||||
Friday, February 24, 2006
|
||||
v 1.2.2
|
||||
*/
|
||||
|
||||
var fx = new Object();
|
||||
//base
|
||||
fx.Base = function(){};
|
||||
fx.Base.prototype = {
|
||||
setOptions: function(options) {
|
||||
this.options = {
|
||||
duration: 500,
|
||||
onComplete: '',
|
||||
transition: fx.sinoidal
|
||||
}
|
||||
Object.extend(this.options, options || {});
|
||||
},
|
||||
|
||||
go: function() {
|
||||
this.startTime = (new Date).getTime();
|
||||
this.timer = setInterval (this.step.bind(this), 13);
|
||||
},
|
||||
|
||||
step: function() {
|
||||
var time = (new Date).getTime();
|
||||
if (time >= this.options.duration+this.startTime) {
|
||||
this.now = this.to;
|
||||
clearInterval (this.timer);
|
||||
this.timer = null;
|
||||
if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10);
|
||||
}
|
||||
else {
|
||||
var Tpos = (time - this.startTime) / (this.options.duration);
|
||||
this.now = this.options.transition(Tpos) * (this.to-this.from) + this.from;
|
||||
}
|
||||
this.increase();
|
||||
},
|
||||
|
||||
custom: function(from, to) {
|
||||
if (this.timer != null) return;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.go();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.now = 0;
|
||||
this.increase();
|
||||
},
|
||||
|
||||
clearTimer: function() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
//stretchers
|
||||
fx.Layout = Class.create();
|
||||
fx.Layout.prototype = Object.extend(new fx.Base(), {
|
||||
initialize: function(el, options) {
|
||||
this.el = $(el);
|
||||
this.el.style.overflow = "hidden";
|
||||
this.el.iniWidth = this.el.offsetWidth;
|
||||
this.el.iniHeight = this.el.offsetHeight;
|
||||
this.setOptions(options);
|
||||
}
|
||||
});
|
||||
|
||||
fx.Height = Class.create();
|
||||
Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), {
|
||||
increase: function() {
|
||||
this.el.style.height = this.now + "px";
|
||||
},
|
||||
|
||||
toggle: function() {
|
||||
if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0);
|
||||
else this.custom(0, this.el.scrollHeight);
|
||||
}
|
||||
});
|
||||
|
||||
fx.Width = Class.create();
|
||||
Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), {
|
||||
increase: function() {
|
||||
this.el.style.width = this.now + "px";
|
||||
},
|
||||
|
||||
toggle: function(){
|
||||
if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0);
|
||||
else this.custom(0, this.el.iniWidth);
|
||||
}
|
||||
});
|
||||
|
||||
//fader
|
||||
fx.Opacity = Class.create();
|
||||
fx.Opacity.prototype = Object.extend(new fx.Base(), {
|
||||
initialize: function(el, options) {
|
||||
this.el = $(el);
|
||||
this.now = 1;
|
||||
this.increase();
|
||||
this.setOptions(options);
|
||||
},
|
||||
|
||||
increase: function() {
|
||||
if (this.now == 1 && (/Firefox/.test(navigator.userAgent))) this.now = 0.9999;
|
||||
this.setOpacity(this.now);
|
||||
},
|
||||
|
||||
setOpacity: function(opacity) {
|
||||
if (opacity == 0) this.el.style.visibility = "hidden";
|
||||
else this.el.style.visibility = "visible";
|
||||
if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + opacity*100 + ")";
|
||||
this.el.style.opacity = opacity;
|
||||
},
|
||||
|
||||
toggle: function() {
|
||||
if (this.now > 0) this.custom(1, 0);
|
||||
else this.custom(0, 1);
|
||||
}
|
||||
});
|
||||
|
||||
//transitions
|
||||
fx.sinoidal = function(pos){
|
||||
return ((-Math.cos(pos*Math.PI)/2) + 0.5);
|
||||
//this transition is from script.aculo.us
|
||||
}
|
||||
fx.linear = function(pos){
|
||||
return pos;
|
||||
}
|
||||
fx.cubic = function(pos){
|
||||
return Math.pow(pos, 3);
|
||||
}
|
||||
fx.circ = function(pos){
|
||||
return Math.sqrt(pos);
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
moo.fx pack, effects extensions for moo.fx.
|
||||
by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE
|
||||
for more info visit (http://moofx.mad4milk.net).
|
||||
Friday, February 24, 2006
|
||||
v 1.2.2
|
||||
*/
|
||||
|
||||
//smooth scroll
|
||||
fx.Scroll = Class.create();
|
||||
fx.Scroll.prototype = Object.extend(new fx.Base(), {
|
||||
initialize: function(options) {
|
||||
this.setOptions(options);
|
||||
},
|
||||
|
||||
scrollTo: function(el){
|
||||
var dest = Position.cumulativeOffset($(el))[1];
|
||||
var client = window.innerHeight || document.documentElement.clientHeight;
|
||||
var full = document.documentElement.scrollHeight;
|
||||
var top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
||||
if (dest+client > full) this.custom(top, dest - client + (full-dest));
|
||||
else this.custom(top, dest);
|
||||
},
|
||||
|
||||
increase: function(){
|
||||
window.scrollTo(0, this.now);
|
||||
}
|
||||
});
|
||||
|
||||
//text size modify, now works with pixels too.
|
||||
fx.Text = Class.create();
|
||||
fx.Text.prototype = Object.extend(new fx.Base(), {
|
||||
initialize: function(el, options) {
|
||||
this.el = $(el);
|
||||
this.setOptions(options);
|
||||
if (!this.options.unit) this.options.unit = "em";
|
||||
},
|
||||
|
||||
increase: function() {
|
||||
this.el.style.fontSize = this.now + this.options.unit;
|
||||
}
|
||||
});
|
||||
|
||||
//composition effect: widht/height/opacity
|
||||
fx.Combo = Class.create();
|
||||
fx.Combo.prototype = {
|
||||
setOptions: function(options) {
|
||||
this.options = {
|
||||
opacity: true,
|
||||
height: true,
|
||||
width: false
|
||||
}
|
||||
Object.extend(this.options, options || {});
|
||||
},
|
||||
|
||||
initialize: function(el, options) {
|
||||
this.el = $(el);
|
||||
this.setOptions(options);
|
||||
if (this.options.opacity) {
|
||||
this.el.o = new fx.Opacity(el, options);
|
||||
options.onComplete = null;
|
||||
}
|
||||
if (this.options.height) {
|
||||
this.el.h = new fx.Height(el, options);
|
||||
options.onComplete = null;
|
||||
}
|
||||
if (this.options.width) this.el.w = new fx.Width(el, options);
|
||||
},
|
||||
|
||||
toggle: function() { this.checkExec('toggle'); },
|
||||
|
||||
hide: function(){ this.checkExec('hide'); },
|
||||
|
||||
clearTimer: function(){ this.checkExec('clearTimer'); },
|
||||
|
||||
checkExec: function(func){
|
||||
if (this.el.o) this.el.o[func]();
|
||||
if (this.el.h) this.el.h[func]();
|
||||
if (this.el.w) this.el.w[func]();
|
||||
},
|
||||
|
||||
//only if width+height
|
||||
resizeTo: function(hto, wto) {
|
||||
if (this.el.h && this.el.w) {
|
||||
this.el.h.custom(this.el.offsetHeight, this.el.offsetHeight + hto);
|
||||
this.el.w.custom(this.el.offsetWidth, this.el.offsetWidth + wto);
|
||||
}
|
||||
},
|
||||
|
||||
customSize: function(hto, wto) {
|
||||
if (this.el.h && this.el.w) {
|
||||
this.el.h.custom(this.el.offsetHeight, hto);
|
||||
this.el.w.custom(this.el.offsetWidth, wto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fx.Accordion = Class.create();
|
||||
fx.Accordion.prototype = {
|
||||
setOptions: function(options) {
|
||||
this.options = {
|
||||
delay: 100,
|
||||
opacity: false
|
||||
}
|
||||
Object.extend(this.options, options || {});
|
||||
},
|
||||
|
||||
initialize: function(togglers, elements, options) {
|
||||
this.elements = elements;
|
||||
this.setOptions(options);
|
||||
var options = options || '';
|
||||
elements.each(function(el, i){
|
||||
options.onComplete = function(){
|
||||
if (el.offsetHeight > 0) el.style.height = '1%';
|
||||
}
|
||||
el.fx = new fx.Combo(el, options);
|
||||
el.fx.hide();
|
||||
});
|
||||
|
||||
togglers.each(function(tog, i){
|
||||
tog.onclick = function(){
|
||||
this.showThisHideOpen(elements[i]);
|
||||
}.bind(this);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
showThisHideOpen: function(toShow){
|
||||
if (toShow.offsetHeight == 0) setTimeout(function(){this.clearAndToggle(toShow);}.bind(this), this.options.delay);
|
||||
this.elements.each(function(el, i){
|
||||
if (el.offsetHeight > 0 && el != toShow) this.clearAndToggle(el);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
clearAndToggle: function(el){
|
||||
el.fx.clearTimer();
|
||||
el.fx.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
var Remember = new Object();
|
||||
Remember = function(){};
|
||||
Remember.prototype = {
|
||||
initialize: function(el, options){
|
||||
this.el = $(el);
|
||||
this.days = 365;
|
||||
this.options = options;
|
||||
this.effect();
|
||||
var cookie = this.readCookie();
|
||||
if (cookie) {
|
||||
this.fx.now = cookie;
|
||||
this.fx.increase();
|
||||
}
|
||||
},
|
||||
|
||||
//cookie functions based on code by Peter-Paul Koch
|
||||
setCookie: function(value) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(this.days*24*60*60*1000));
|
||||
var expires = "; expires="+date.toGMTString();
|
||||
document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/";
|
||||
},
|
||||
|
||||
readCookie: function() {
|
||||
var nameEQ = this.el+this.el.id+this.prefix + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;c=ca[i];i++) {
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
custom: function(from, to){
|
||||
if (this.fx.now != to) {
|
||||
this.setCookie(to);
|
||||
this.fx.custom(from, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fx.RememberHeight = Class.create();
|
||||
fx.RememberHeight.prototype = Object.extend(new Remember(), {
|
||||
effect: function(){
|
||||
this.fx = new fx.Height(this.el, this.options);
|
||||
this.prefix = 'height';
|
||||
},
|
||||
|
||||
toggle: function(){
|
||||
if (this.el.offsetHeight == 0) this.setCookie(this.el.scrollHeight);
|
||||
else this.setCookie(0);
|
||||
this.fx.toggle();
|
||||
},
|
||||
|
||||
resize: function(to){
|
||||
this.setCookie(this.el.offsetHeight+to);
|
||||
this.fx.custom(this.el.offsetHeight,this.el.offsetHeight+to);
|
||||
},
|
||||
|
||||
hide: function(){
|
||||
if (!this.readCookie()) {
|
||||
this.fx.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
fx.RememberText = Class.create();
|
||||
fx.RememberText.prototype = Object.extend(new Remember(), {
|
||||
effect: function(){
|
||||
this.fx = new fx.Text(this.el, this.options);
|
||||
this.prefix = 'text';
|
||||
}
|
||||
});
|
||||
|
||||
//useful for-replacement
|
||||
Array.prototype.each = function(func){
|
||||
for(var i=0;ob=this[i];i++) func(ob, i);
|
||||
}
|
||||
|
||||
//Easing Equations (c) 2003 Robert Penner, all rights reserved.
|
||||
//This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html.
|
||||
|
||||
//expo
|
||||
fx.expoIn = function(pos){
|
||||
return Math.pow(2, 10 * (pos - 1));
|
||||
}
|
||||
fx.expoOut = function(pos){
|
||||
return (-Math.pow(2, -10 * pos) + 1);
|
||||
}
|
||||
|
||||
//quad
|
||||
fx.quadIn = function(pos){
|
||||
return Math.pow(pos, 2);
|
||||
}
|
||||
fx.quadOut = function(pos){
|
||||
return -(pos)*(pos-2);
|
||||
}
|
||||
|
||||
//circ
|
||||
fx.circOut = function(pos){
|
||||
return Math.sqrt(1 - Math.pow(pos-1,2));
|
||||
}
|
||||
fx.circIn = function(pos){
|
||||
return -(Math.sqrt(1 - Math.pow(pos, 2)) - 1);
|
||||
}
|
||||
|
||||
//back
|
||||
fx.backIn = function(pos){
|
||||
return (pos)*pos*((2.7)*pos - 1.7);
|
||||
}
|
||||
fx.backOut = function(pos){
|
||||
return ((pos-1)*(pos-1)*((2.7)*(pos-1) + 1.7) + 1);
|
||||
}
|
||||
|
||||
//sine
|
||||
fx.sineOut = function(pos){
|
||||
return Math.sin(pos * (Math.PI/2));
|
||||
}
|
||||
fx.sineIn = function(pos){
|
||||
return -Math.cos(pos * (Math.PI/2)) + 1;
|
||||
}
|
||||
fx.sineInOut = function(pos){
|
||||
return -(Math.cos(Math.PI*pos) - 1)/2;
|
||||
}
|
||||
Vendored
+131
@@ -0,0 +1,131 @@
|
||||
/* Prototype JavaScript framework
|
||||
* (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
* Prototype is freely distributable under the terms of an MIT-style license.
|
||||
* For details, see the Prototype web site: http://prototype.conio.net/
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
//note: modified & stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net).
|
||||
|
||||
var Class = {
|
||||
create: function() {
|
||||
return function() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object.extend = function(destination, source) {
|
||||
for (property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
Function.prototype.bind = function(object) {
|
||||
var __method = this;
|
||||
return function() {
|
||||
return __method.apply(object, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
Function.prototype.bindAsEventListener = function(object) {
|
||||
var __method = this;
|
||||
return function(event) {
|
||||
__method.call(object, event || window.event);
|
||||
}
|
||||
}
|
||||
|
||||
function $() {
|
||||
if (arguments.length == 1) return get$(arguments[0]);
|
||||
var elements = [];
|
||||
$c(arguments).each(function(el){
|
||||
elements.push(get$(el));
|
||||
});
|
||||
return elements;
|
||||
|
||||
function get$(el){
|
||||
if (typeof el == 'string') el = document.getElementById(el);
|
||||
return el;
|
||||
}
|
||||
}
|
||||
|
||||
if (!window.Element) var Element = new Object();
|
||||
|
||||
Object.extend(Element, {
|
||||
remove: function(element) {
|
||||
element = $(element);
|
||||
element.parentNode.removeChild(element);
|
||||
},
|
||||
|
||||
hasClassName: function(element, className) {
|
||||
element = $(element);
|
||||
if (!element) return;
|
||||
var hasClass = false;
|
||||
element.className.split(' ').each(function(cn){
|
||||
if (cn == className) hasClass = true;
|
||||
});
|
||||
return hasClass;
|
||||
},
|
||||
|
||||
addClassName: function(element, className) {
|
||||
element = $(element);
|
||||
Element.removeClassName(element, className);
|
||||
element.className += ' ' + className;
|
||||
},
|
||||
|
||||
removeClassName: function(element, className) {
|
||||
element = $(element);
|
||||
if (!element) return;
|
||||
var newClassName = '';
|
||||
element.className.split(' ').each(function(cn, i){
|
||||
if (cn != className){
|
||||
if (i > 0) newClassName += ' ';
|
||||
newClassName += cn;
|
||||
}
|
||||
});
|
||||
element.className = newClassName;
|
||||
},
|
||||
|
||||
cleanWhitespace: function(element) {
|
||||
element = $(element);
|
||||
$c(element.childNodes).each(function(node){
|
||||
if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) Element.remove(node);
|
||||
});
|
||||
},
|
||||
|
||||
find: function(element, what) {
|
||||
element = $(element)[what];
|
||||
while (element.nodeType != 1) element = element[what];
|
||||
return element;
|
||||
}
|
||||
});
|
||||
|
||||
var Position = {
|
||||
cumulativeOffset: function(element) {
|
||||
var valueT = 0, valueL = 0;
|
||||
do {
|
||||
valueT += element.offsetTop || 0;
|
||||
valueL += element.offsetLeft || 0;
|
||||
element = element.offsetParent;
|
||||
} while (element);
|
||||
return [valueL, valueT];
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementsByClassName = function(className) {
|
||||
var children = document.getElementsByTagName('*') || document.all;
|
||||
var elements = [];
|
||||
$c(children).each(function(child){
|
||||
if (Element.hasClassName(child, className)) elements.push(child);
|
||||
});
|
||||
return elements;
|
||||
}
|
||||
|
||||
//useful array functions
|
||||
Array.prototype.each = function(func){
|
||||
for(var i=0;ob=this[i];i++) func(ob, i);
|
||||
}
|
||||
|
||||
function $c(array){
|
||||
var nArray = [];
|
||||
for (i=0;el=array[i];i++) nArray.push(el);
|
||||
return nArray;
|
||||
}
|
||||
@@ -0,0 +1,669 @@
|
||||
/*! SWFObject v2.0 <http://code.google.com/p/swfobject/>
|
||||
Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
||||
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
var swfobject = function() {
|
||||
|
||||
var UNDEF = "undefined",
|
||||
OBJECT = "object",
|
||||
SHOCKWAVE_FLASH = "Shockwave Flash",
|
||||
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
|
||||
FLASH_MIME_TYPE = "application/x-shockwave-flash",
|
||||
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
|
||||
|
||||
win = window,
|
||||
doc = document,
|
||||
nav = navigator,
|
||||
|
||||
domLoadFnArr = [],
|
||||
regObjArr = [],
|
||||
timer = null,
|
||||
storedAltContent = null,
|
||||
storedAltContentId = null,
|
||||
isDomLoaded = false,
|
||||
isExpressInstallActive = false;
|
||||
|
||||
/* Centralized function for browser feature detection
|
||||
- Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
|
||||
- User agent string detection is only used when no alternative is possible
|
||||
- Is executed directly for optimal performance
|
||||
*/
|
||||
var ua = function() {
|
||||
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
|
||||
playerVersion = [0,0,0],
|
||||
d = null;
|
||||
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
||||
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
||||
if (d) {
|
||||
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
||||
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
||||
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
||||
playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
|
||||
}
|
||||
}
|
||||
else if (typeof win.ActiveXObject != UNDEF) {
|
||||
var a = null, fp6Crash = false;
|
||||
try {
|
||||
a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
|
||||
}
|
||||
catch(e) {
|
||||
try {
|
||||
a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
|
||||
playerVersion = [6,0,21];
|
||||
a.AllowScriptAccess = "always"; // Introduced in fp6.0.47
|
||||
}
|
||||
catch(e) {
|
||||
if (playerVersion[0] == 6) {
|
||||
fp6Crash = true;
|
||||
}
|
||||
}
|
||||
if (!fp6Crash) {
|
||||
try {
|
||||
a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
}
|
||||
if (!fp6Crash && a) { // a will return null when ActiveX is disabled
|
||||
try {
|
||||
d = a.GetVariable("$version"); // Will crash fp6.0.21/23/29
|
||||
if (d) {
|
||||
d = d.split(" ")[1].split(",");
|
||||
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
}
|
||||
var u = nav.userAgent.toLowerCase(),
|
||||
p = nav.platform.toLowerCase(),
|
||||
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
||||
ie = false,
|
||||
windows = p ? /win/.test(p) : /win/.test(u),
|
||||
mac = p ? /mac/.test(p) : /mac/.test(u);
|
||||
/*@cc_on
|
||||
ie = true;
|
||||
@if (@_win32)
|
||||
windows = true;
|
||||
@elif (@_mac)
|
||||
mac = true;
|
||||
@end
|
||||
@*/
|
||||
return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
|
||||
}();
|
||||
|
||||
/* Cross-browser onDomLoad
|
||||
- Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
|
||||
- Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
|
||||
*/
|
||||
var onDomLoad = function() {
|
||||
if (!ua.w3cdom) {
|
||||
return;
|
||||
}
|
||||
addDomLoadEvent(main);
|
||||
if (ua.ie && ua.win) {
|
||||
try { // Avoid a possible Operation Aborted error
|
||||
doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors
|
||||
var s = getElementById("__ie_ondomload");
|
||||
if (s) {
|
||||
s.onreadystatechange = function() {
|
||||
if (this.readyState == "complete") {
|
||||
this.parentNode.removeChild(this);
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
if (ua.webkit && typeof doc.readyState != UNDEF) {
|
||||
timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
|
||||
}
|
||||
if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
|
||||
}
|
||||
addLoadEvent(callDomLoadFunctions);
|
||||
}();
|
||||
|
||||
function callDomLoadFunctions() {
|
||||
if (isDomLoaded) {
|
||||
return;
|
||||
}
|
||||
if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
|
||||
var s = createElement("span");
|
||||
try { // Avoid a possible Operation Aborted error
|
||||
var t = doc.getElementsByTagName("body")[0].appendChild(s);
|
||||
t.parentNode.removeChild(t);
|
||||
}
|
||||
catch (e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
isDomLoaded = true;
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
var dl = domLoadFnArr.length;
|
||||
for (var i = 0; i < dl; i++) {
|
||||
domLoadFnArr[i]();
|
||||
}
|
||||
}
|
||||
|
||||
function addDomLoadEvent(fn) {
|
||||
if (isDomLoaded) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
|
||||
}
|
||||
}
|
||||
|
||||
/* Cross-browser onload
|
||||
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
||||
- Will fire an event as soon as a web page including all of its assets are loaded
|
||||
*/
|
||||
function addLoadEvent(fn) {
|
||||
if (typeof win.addEventListener != UNDEF) {
|
||||
win.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof win.attachEvent != UNDEF) {
|
||||
win.attachEvent("onload", fn);
|
||||
}
|
||||
else if (typeof win.onload == "function") {
|
||||
var fnOld = win.onload;
|
||||
win.onload = function() {
|
||||
fnOld();
|
||||
fn();
|
||||
};
|
||||
}
|
||||
else {
|
||||
win.onload = fn;
|
||||
}
|
||||
}
|
||||
|
||||
/* Main function
|
||||
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
||||
*/
|
||||
function main() { // Static publishing only
|
||||
var rl = regObjArr.length;
|
||||
for (var i = 0; i < rl; i++) { // For each registered object element
|
||||
var id = regObjArr[i].id;
|
||||
if (ua.pv[0] > 0) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
|
||||
regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
|
||||
if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
|
||||
if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
|
||||
fixParams(obj);
|
||||
}
|
||||
setVisibility(id, true);
|
||||
}
|
||||
else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
|
||||
showExpressInstall(regObjArr[i]);
|
||||
}
|
||||
else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
|
||||
displayAltContent(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // If no fp is installed, we let the object element do its job (show alternative content)
|
||||
setVisibility(id, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix nested param elements, which are ignored by older webkit engines
|
||||
- This includes Safari up to and including version 1.2.2 on Mac OS 10.3
|
||||
- Fall back to the proprietary embed element
|
||||
*/
|
||||
function fixParams(obj) {
|
||||
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
||||
if (nestedObj) {
|
||||
var e = createElement("embed"), a = nestedObj.attributes;
|
||||
if (a) {
|
||||
var al = a.length;
|
||||
for (var i = 0; i < al; i++) {
|
||||
if (a[i].nodeName.toLowerCase() == "data") {
|
||||
e.setAttribute("src", a[i].nodeValue);
|
||||
}
|
||||
else {
|
||||
e.setAttribute(a[i].nodeName, a[i].nodeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
var c = nestedObj.childNodes;
|
||||
if (c) {
|
||||
var cl = c.length;
|
||||
for (var j = 0; j < cl; j++) {
|
||||
if (c[j].nodeType == 1 && c[j].nodeName.toLowerCase() == "param") {
|
||||
e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
|
||||
}
|
||||
}
|
||||
}
|
||||
obj.parentNode.replaceChild(e, obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect
|
||||
- Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML
|
||||
- Dynamic publishing only
|
||||
*/
|
||||
function fixObjectLeaks(id) {
|
||||
if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) {
|
||||
win.attachEvent("onunload", function () {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
for (var i in obj) {
|
||||
if (typeof obj[i] == "function") {
|
||||
obj[i] = function() {};
|
||||
}
|
||||
}
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* Show the Adobe Express Install dialog
|
||||
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
||||
*/
|
||||
function showExpressInstall(regObj) {
|
||||
isExpressInstallActive = true;
|
||||
var obj = getElementById(regObj.id);
|
||||
if (obj) {
|
||||
if (regObj.altContentId) {
|
||||
var ac = getElementById(regObj.altContentId);
|
||||
if (ac) {
|
||||
storedAltContent = ac;
|
||||
storedAltContentId = regObj.altContentId;
|
||||
}
|
||||
}
|
||||
else {
|
||||
storedAltContent = abstractAltContent(obj);
|
||||
}
|
||||
if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
|
||||
regObj.width = "310";
|
||||
}
|
||||
if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
|
||||
regObj.height = "137";
|
||||
}
|
||||
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
||||
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
|
||||
dt = doc.title,
|
||||
fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
|
||||
replaceId = regObj.id;
|
||||
// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
|
||||
// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
var newObj = createElement("div");
|
||||
replaceId += "SWFObjectNew";
|
||||
newObj.setAttribute("id", replaceId);
|
||||
obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
||||
obj.style.display = "none";
|
||||
win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
|
||||
}
|
||||
createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to abstract and display alternative content
|
||||
*/
|
||||
function displayAltContent(obj) {
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
|
||||
// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
var el = createElement("div");
|
||||
obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
|
||||
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
||||
obj.style.display = "none";
|
||||
win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
|
||||
}
|
||||
else {
|
||||
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
||||
}
|
||||
}
|
||||
|
||||
function abstractAltContent(obj) {
|
||||
var ac = createElement("div");
|
||||
if (ua.win && ua.ie) {
|
||||
ac.innerHTML = obj.innerHTML;
|
||||
}
|
||||
else {
|
||||
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
||||
if (nestedObj) {
|
||||
var c = nestedObj.childNodes;
|
||||
if (c) {
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
|
||||
ac.appendChild(c[i].cloneNode(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic SWF creation
|
||||
*/
|
||||
function createSWF(attObj, parObj, id) {
|
||||
var r, el = getElementById(id);
|
||||
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
||||
attObj.id = id;
|
||||
}
|
||||
if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
|
||||
var att = "";
|
||||
for (var i in attObj) {
|
||||
if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
|
||||
if (i == "data") {
|
||||
parObj.movie = attObj[i];
|
||||
}
|
||||
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
att += ' class="' + attObj[i] + '"';
|
||||
}
|
||||
else if (i != "classid") {
|
||||
att += ' ' + i + '="' + attObj[i] + '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var par = "";
|
||||
for (var j in parObj) {
|
||||
if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
|
||||
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
||||
}
|
||||
}
|
||||
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
|
||||
fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only
|
||||
r = getElementById(attObj.id);
|
||||
}
|
||||
else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
|
||||
var e = createElement("embed");
|
||||
e.setAttribute("type", FLASH_MIME_TYPE);
|
||||
for (var k in attObj) {
|
||||
if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
|
||||
if (k == "data") {
|
||||
e.setAttribute("src", attObj[k]);
|
||||
}
|
||||
else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
e.setAttribute("class", attObj[k]);
|
||||
}
|
||||
else if (k != "classid") { // Filter out IE specific attribute
|
||||
e.setAttribute(k, attObj[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var l in parObj) {
|
||||
if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
|
||||
if (l != "movie") { // Filter out IE specific param element
|
||||
e.setAttribute(l, parObj[l]);
|
||||
}
|
||||
}
|
||||
}
|
||||
el.parentNode.replaceChild(e, el);
|
||||
r = e;
|
||||
}
|
||||
else { // Well-behaving browsers
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
for (var m in attObj) {
|
||||
if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
|
||||
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
o.setAttribute("class", attObj[m]);
|
||||
}
|
||||
else if (m != "classid") { // Filter out IE specific attribute
|
||||
o.setAttribute(m, attObj[m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var n in parObj) {
|
||||
if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
|
||||
createObjParam(o, n, parObj[n]);
|
||||
}
|
||||
}
|
||||
el.parentNode.replaceChild(o, el);
|
||||
r = o;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function createObjParam(el, pName, pValue) {
|
||||
var p = createElement("param");
|
||||
p.setAttribute("name", pName);
|
||||
p.setAttribute("value", pValue);
|
||||
el.appendChild(p);
|
||||
}
|
||||
|
||||
function getElementById(id) {
|
||||
return doc.getElementById(id);
|
||||
}
|
||||
|
||||
function createElement(el) {
|
||||
return doc.createElement(el);
|
||||
}
|
||||
|
||||
function hasPlayerVersion(rv) {
|
||||
var pv = ua.pv, v = rv.split(".");
|
||||
v[0] = parseInt(v[0], 10);
|
||||
v[1] = parseInt(v[1], 10);
|
||||
v[2] = parseInt(v[2], 10);
|
||||
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic CSS creation
|
||||
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
||||
*/
|
||||
function createCSS(sel, decl) {
|
||||
if (ua.ie && ua.mac) {
|
||||
return;
|
||||
}
|
||||
var h = doc.getElementsByTagName("head")[0], s = createElement("style");
|
||||
s.setAttribute("type", "text/css");
|
||||
s.setAttribute("media", "screen");
|
||||
if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
|
||||
s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
||||
}
|
||||
h.appendChild(s);
|
||||
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
||||
var ls = doc.styleSheets[doc.styleSheets.length - 1];
|
||||
if (typeof ls.addRule == OBJECT) {
|
||||
ls.addRule(sel, decl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibility(id, isVisible) {
|
||||
var v = isVisible ? "visible" : "hidden";
|
||||
if (isDomLoaded) {
|
||||
getElementById(id).style.visibility = v;
|
||||
}
|
||||
else {
|
||||
createCSS("#" + id, "visibility:" + v);
|
||||
}
|
||||
}
|
||||
|
||||
function getTargetVersion(obj) {
|
||||
if (!obj)
|
||||
return 0;
|
||||
var c = obj.childNodes;
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "object") {
|
||||
c = c[i].childNodes;
|
||||
cl = c.length;
|
||||
i = 0;
|
||||
}
|
||||
if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param" && c[i].getAttribute("name") == "swfversion") {
|
||||
return c[i].getAttribute("value");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getExpressInstall(obj) {
|
||||
if (!obj)
|
||||
return "";
|
||||
var c = obj.childNodes;
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "object") {
|
||||
c = c[i].childNodes;
|
||||
cl = c.length;
|
||||
i = 0;
|
||||
}
|
||||
if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param" && c[i].getAttribute("name") == "expressinstall") {
|
||||
return c[i].getAttribute("value");
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
return {
|
||||
/* Public API
|
||||
- Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
|
||||
*/
|
||||
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
|
||||
if (!ua.w3cdom || !objectIdStr) {
|
||||
return;
|
||||
}
|
||||
var obj = document.getElementById(objectIdStr);
|
||||
var xi = getExpressInstall(obj);
|
||||
var regObj = {};
|
||||
regObj.id = objectIdStr;
|
||||
regObj.swfVersion = swfVersionStr ? swfVersionStr : getTargetVersion(obj);
|
||||
regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : ((xi != "") ? xi : false);
|
||||
regObjArr[regObjArr.length] = regObj;
|
||||
setVisibility(objectIdStr, false);
|
||||
},
|
||||
|
||||
getObjectById: function(objectIdStr) {
|
||||
var r = null;
|
||||
if (ua.w3cdom && isDomLoaded) {
|
||||
var o = getElementById(objectIdStr);
|
||||
if (o) {
|
||||
var n = o.getElementsByTagName(OBJECT)[0];
|
||||
if (!n || (n && typeof o.SetVariable != UNDEF)) {
|
||||
r = o;
|
||||
}
|
||||
else if (typeof n.SetVariable != UNDEF) {
|
||||
r = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
},
|
||||
|
||||
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
|
||||
if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
|
||||
return;
|
||||
}
|
||||
widthStr += ""; // Auto-convert to string to make it idiot proof
|
||||
heightStr += "";
|
||||
if (hasPlayerVersion(swfVersionStr)) {
|
||||
setVisibility(replaceElemIdStr, false);
|
||||
var att = (typeof attObj == OBJECT) ? attObj : {};
|
||||
att.data = swfUrlStr;
|
||||
att.width = widthStr;
|
||||
att.height = heightStr;
|
||||
var par = (typeof parObj == OBJECT) ? parObj : {};
|
||||
if (typeof flashvarsObj == OBJECT) {
|
||||
for (var i in flashvarsObj) {
|
||||
if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + i + "=" + flashvarsObj[i];
|
||||
}
|
||||
else {
|
||||
par.flashvars = i + "=" + flashvarsObj[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
addDomLoadEvent(function() {
|
||||
createSWF(att, par, replaceElemIdStr);
|
||||
if (att.id == replaceElemIdStr) {
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
|
||||
setVisibility(replaceElemIdStr, false);
|
||||
addDomLoadEvent(function() {
|
||||
var regObj = {};
|
||||
regObj.id = regObj.altContentId = replaceElemIdStr;
|
||||
regObj.width = widthStr;
|
||||
regObj.height = heightStr;
|
||||
regObj.expressInstall = xiSwfUrlStr;
|
||||
showExpressInstall(regObj);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getFlashPlayerVersion: function() {
|
||||
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
|
||||
},
|
||||
|
||||
hasFlashPlayerVersion:hasPlayerVersion,
|
||||
|
||||
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
||||
if (ua.w3cdom && isDomLoaded) {
|
||||
return createSWF(attObj, parObj, replaceElemIdStr);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
createCSS: function(sel, decl) {
|
||||
if (ua.w3cdom) {
|
||||
createCSS(sel, decl);
|
||||
}
|
||||
},
|
||||
|
||||
addDomLoadEvent:addDomLoadEvent,
|
||||
|
||||
addLoadEvent:addLoadEvent,
|
||||
|
||||
getQueryParamValue: function(param) {
|
||||
var q = doc.location.search || doc.location.hash;
|
||||
if (param == null) {
|
||||
return q;
|
||||
}
|
||||
if(q) {
|
||||
var pairs = q.substring(1).split("&");
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return pairs[i].substring((pairs[i].indexOf("=") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
// For internal usage only
|
||||
expressInstallCallback: function() {
|
||||
if (isExpressInstallActive && storedAltContent) {
|
||||
var obj = getElementById(EXPRESS_INSTALL_ID);
|
||||
if (obj) {
|
||||
obj.parentNode.replaceChild(storedAltContent, obj);
|
||||
if (storedAltContentId) {
|
||||
setVisibility(storedAltContentId, true);
|
||||
if (ua.ie && ua.win) {
|
||||
storedAltContent.style.display = "block";
|
||||
}
|
||||
}
|
||||
storedAltContent = null;
|
||||
storedAltContentId = null;
|
||||
isExpressInstallActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}();
|
||||
@@ -0,0 +1,275 @@
|
||||
// script.aculo.us slider.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Marty Haught, Thomas Fuchs
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
if (!Control) var Control = { };
|
||||
|
||||
// options:
|
||||
// axis: 'vertical', or 'horizontal' (default)
|
||||
//
|
||||
// callbacks:
|
||||
// onChange(value)
|
||||
// onSlide(value)
|
||||
Control.Slider = Class.create({
|
||||
initialize: function(handle, track, options) {
|
||||
var slider = this;
|
||||
|
||||
if (Object.isArray(handle)) {
|
||||
this.handles = handle.collect( function(e) { return $(e) });
|
||||
} else {
|
||||
this.handles = [$(handle)];
|
||||
}
|
||||
|
||||
this.track = $(track);
|
||||
this.options = options || { };
|
||||
|
||||
this.axis = this.options.axis || 'horizontal';
|
||||
this.increment = this.options.increment || 1;
|
||||
this.step = parseInt(this.options.step || '1');
|
||||
this.range = this.options.range || $R(0,1);
|
||||
|
||||
this.value = 0; // assure backwards compat
|
||||
this.values = this.handles.map( function() { return 0 });
|
||||
this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
|
||||
this.options.startSpan = $(this.options.startSpan || null);
|
||||
this.options.endSpan = $(this.options.endSpan || null);
|
||||
|
||||
this.restricted = this.options.restricted || false;
|
||||
|
||||
this.maximum = this.options.maximum || this.range.end;
|
||||
this.minimum = this.options.minimum || this.range.start;
|
||||
|
||||
// Will be used to align the handle onto the track, if necessary
|
||||
this.alignX = parseInt(this.options.alignX || '0');
|
||||
this.alignY = parseInt(this.options.alignY || '0');
|
||||
|
||||
this.trackLength = this.maximumOffset() - this.minimumOffset();
|
||||
|
||||
this.handleLength = this.isVertical() ?
|
||||
(this.handles[0].offsetHeight != 0 ?
|
||||
this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) :
|
||||
(this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth :
|
||||
this.handles[0].style.width.replace(/px$/,""));
|
||||
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
this.disabled = false;
|
||||
|
||||
if (this.options.disabled) this.setDisabled();
|
||||
|
||||
// Allowed values array
|
||||
this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
|
||||
if (this.allowedValues) {
|
||||
this.minimum = this.allowedValues.min();
|
||||
this.maximum = this.allowedValues.max();
|
||||
}
|
||||
|
||||
this.eventMouseDown = this.startDrag.bindAsEventListener(this);
|
||||
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
||||
this.eventMouseMove = this.update.bindAsEventListener(this);
|
||||
|
||||
// Initialize handles in reverse (make sure first handle is active)
|
||||
this.handles.each( function(h,i) {
|
||||
i = slider.handles.length-1-i;
|
||||
slider.setValue(parseFloat(
|
||||
(Object.isArray(slider.options.sliderValue) ?
|
||||
slider.options.sliderValue[i] : slider.options.sliderValue) ||
|
||||
slider.range.start), i);
|
||||
h.makePositioned().observe("mousedown", slider.eventMouseDown);
|
||||
});
|
||||
|
||||
this.track.observe("mousedown", this.eventMouseDown);
|
||||
document.observe("mouseup", this.eventMouseUp);
|
||||
document.observe("mousemove", this.eventMouseMove);
|
||||
|
||||
this.initialized = true;
|
||||
},
|
||||
dispose: function() {
|
||||
var slider = this;
|
||||
Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
|
||||
Event.stopObserving(document, "mouseup", this.eventMouseUp);
|
||||
Event.stopObserving(document, "mousemove", this.eventMouseMove);
|
||||
this.handles.each( function(h) {
|
||||
Event.stopObserving(h, "mousedown", slider.eventMouseDown);
|
||||
});
|
||||
},
|
||||
setDisabled: function(){
|
||||
this.disabled = true;
|
||||
},
|
||||
setEnabled: function(){
|
||||
this.disabled = false;
|
||||
},
|
||||
getNearestValue: function(value){
|
||||
if (this.allowedValues){
|
||||
if (value >= this.allowedValues.max()) return(this.allowedValues.max());
|
||||
if (value <= this.allowedValues.min()) return(this.allowedValues.min());
|
||||
|
||||
var offset = Math.abs(this.allowedValues[0] - value);
|
||||
var newValue = this.allowedValues[0];
|
||||
this.allowedValues.each( function(v) {
|
||||
var currentOffset = Math.abs(v - value);
|
||||
if (currentOffset <= offset){
|
||||
newValue = v;
|
||||
offset = currentOffset;
|
||||
}
|
||||
});
|
||||
return newValue;
|
||||
}
|
||||
if (value > this.range.end) return this.range.end;
|
||||
if (value < this.range.start) return this.range.start;
|
||||
return value;
|
||||
},
|
||||
setValue: function(sliderValue, handleIdx){
|
||||
if (!this.active) {
|
||||
this.activeHandleIdx = handleIdx || 0;
|
||||
this.activeHandle = this.handles[this.activeHandleIdx];
|
||||
this.updateStyles();
|
||||
}
|
||||
handleIdx = handleIdx || this.activeHandleIdx || 0;
|
||||
if (this.initialized && this.restricted) {
|
||||
if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
|
||||
sliderValue = this.values[handleIdx-1];
|
||||
if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
|
||||
sliderValue = this.values[handleIdx+1];
|
||||
}
|
||||
sliderValue = this.getNearestValue(sliderValue);
|
||||
this.values[handleIdx] = sliderValue;
|
||||
this.value = this.values[0]; // assure backwards compat
|
||||
|
||||
this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] =
|
||||
this.translateToPx(sliderValue);
|
||||
|
||||
this.drawSpans();
|
||||
if (!this.dragging || !this.event) this.updateFinished();
|
||||
},
|
||||
setValueBy: function(delta, handleIdx) {
|
||||
this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta,
|
||||
handleIdx || this.activeHandleIdx || 0);
|
||||
},
|
||||
translateToPx: function(value) {
|
||||
return Math.round(
|
||||
((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) *
|
||||
(value - this.range.start)) + "px";
|
||||
},
|
||||
translateToValue: function(offset) {
|
||||
return ((offset/(this.trackLength-this.handleLength) *
|
||||
(this.range.end-this.range.start)) + this.range.start);
|
||||
},
|
||||
getRange: function(range) {
|
||||
var v = this.values.sortBy(Prototype.K);
|
||||
range = range || 0;
|
||||
return $R(v[range],v[range+1]);
|
||||
},
|
||||
minimumOffset: function(){
|
||||
return(this.isVertical() ? this.alignY : this.alignX);
|
||||
},
|
||||
maximumOffset: function(){
|
||||
return(this.isVertical() ?
|
||||
(this.track.offsetHeight != 0 ? this.track.offsetHeight :
|
||||
this.track.style.height.replace(/px$/,"")) - this.alignY :
|
||||
(this.track.offsetWidth != 0 ? this.track.offsetWidth :
|
||||
this.track.style.width.replace(/px$/,"")) - this.alignX);
|
||||
},
|
||||
isVertical: function(){
|
||||
return (this.axis == 'vertical');
|
||||
},
|
||||
drawSpans: function() {
|
||||
var slider = this;
|
||||
if (this.spans)
|
||||
$R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
|
||||
if (this.options.startSpan)
|
||||
this.setSpan(this.options.startSpan,
|
||||
$R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
|
||||
if (this.options.endSpan)
|
||||
this.setSpan(this.options.endSpan,
|
||||
$R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
|
||||
},
|
||||
setSpan: function(span, range) {
|
||||
if (this.isVertical()) {
|
||||
span.style.top = this.translateToPx(range.start);
|
||||
span.style.height = this.translateToPx(range.end - range.start + this.range.start);
|
||||
} else {
|
||||
span.style.left = this.translateToPx(range.start);
|
||||
span.style.width = this.translateToPx(range.end - range.start + this.range.start);
|
||||
}
|
||||
},
|
||||
updateStyles: function() {
|
||||
this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
|
||||
Element.addClassName(this.activeHandle, 'selected');
|
||||
},
|
||||
startDrag: function(event) {
|
||||
if (Event.isLeftClick(event)) {
|
||||
if (!this.disabled){
|
||||
this.active = true;
|
||||
|
||||
var handle = Event.element(event);
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
var track = handle;
|
||||
if (track==this.track) {
|
||||
var offsets = Position.cumulativeOffset(this.track);
|
||||
this.event = event;
|
||||
this.setValue(this.translateToValue(
|
||||
(this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
|
||||
));
|
||||
var offsets = Position.cumulativeOffset(this.activeHandle);
|
||||
this.offsetX = (pointer[0] - offsets[0]);
|
||||
this.offsetY = (pointer[1] - offsets[1]);
|
||||
} else {
|
||||
// find the handle (prevents issues with Safari)
|
||||
while((this.handles.indexOf(handle) == -1) && handle.parentNode)
|
||||
handle = handle.parentNode;
|
||||
|
||||
if (this.handles.indexOf(handle)!=-1) {
|
||||
this.activeHandle = handle;
|
||||
this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
|
||||
this.updateStyles();
|
||||
|
||||
var offsets = Position.cumulativeOffset(this.activeHandle);
|
||||
this.offsetX = (pointer[0] - offsets[0]);
|
||||
this.offsetY = (pointer[1] - offsets[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
update: function(event) {
|
||||
if (this.active) {
|
||||
if (!this.dragging) this.dragging = true;
|
||||
this.draw(event);
|
||||
if (Prototype.Browser.WebKit) window.scrollBy(0,0);
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
draw: function(event) {
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
var offsets = Position.cumulativeOffset(this.track);
|
||||
pointer[0] -= this.offsetX + offsets[0];
|
||||
pointer[1] -= this.offsetY + offsets[1];
|
||||
this.event = event;
|
||||
this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
|
||||
if (this.initialized && this.options.onSlide)
|
||||
this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
|
||||
},
|
||||
endDrag: function(event) {
|
||||
if (this.active && this.dragging) {
|
||||
this.finishDrag(event, true);
|
||||
Event.stop(event);
|
||||
}
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
},
|
||||
finishDrag: function(event, success) {
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
this.updateFinished();
|
||||
},
|
||||
updateFinished: function() {
|
||||
if (this.initialized && this.options.onChange)
|
||||
this.options.onChange(this.values.length>1 ? this.values : this.value, this);
|
||||
this.event = null;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,55 @@
|
||||
// script.aculo.us sound.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
//
|
||||
// Based on code created by Jules Gravinese (http://www.webveteran.com/)
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
Sound = {
|
||||
tracks: {},
|
||||
_enabled: true,
|
||||
template:
|
||||
new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),
|
||||
enable: function(){
|
||||
Sound._enabled = true;
|
||||
},
|
||||
disable: function(){
|
||||
Sound._enabled = false;
|
||||
},
|
||||
play: function(url){
|
||||
if(!Sound._enabled) return;
|
||||
var options = Object.extend({
|
||||
track: 'global', url: url, replace: false
|
||||
}, arguments[1] || {});
|
||||
|
||||
if(options.replace && this.tracks[options.track]) {
|
||||
$R(0, this.tracks[options.track].id).each(function(id){
|
||||
var sound = $('sound_'+options.track+'_'+id);
|
||||
sound.Stop && sound.Stop();
|
||||
sound.remove();
|
||||
});
|
||||
this.tracks[options.track] = null;
|
||||
}
|
||||
|
||||
if(!this.tracks[options.track])
|
||||
this.tracks[options.track] = { id: 0 };
|
||||
else
|
||||
this.tracks[options.track].id++;
|
||||
|
||||
options.id = this.tracks[options.track].id;
|
||||
$$('body')[0].insert(
|
||||
Prototype.Browser.IE ? new Element('bgsound',{
|
||||
id: 'sound_'+options.track+'_'+options.id,
|
||||
src: options.url, loop: 1, autostart: true
|
||||
}) : Sound.template.evaluate(options));
|
||||
}
|
||||
};
|
||||
|
||||
if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
|
||||
if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
|
||||
Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');
|
||||
else
|
||||
Sound.play = function(){};
|
||||
}
|
||||
@@ -0,0 +1,568 @@
|
||||
// script.aculo.us unittest.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
|
||||
|
||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
|
||||
// (c) 2005-2008 Michael Schuerig (http://www.schuerig.de/michael/)
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
// experimental, Firefox-only
|
||||
Event.simulateMouse = function(element, eventName) {
|
||||
var options = Object.extend({
|
||||
pointerX: 0,
|
||||
pointerY: 0,
|
||||
buttons: 0,
|
||||
ctrlKey: false,
|
||||
altKey: false,
|
||||
shiftKey: false,
|
||||
metaKey: false
|
||||
}, arguments[2] || {});
|
||||
var oEvent = document.createEvent("MouseEvents");
|
||||
oEvent.initMouseEvent(eventName, true, true, document.defaultView,
|
||||
options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
|
||||
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element));
|
||||
|
||||
if(this.mark) Element.remove(this.mark);
|
||||
this.mark = document.createElement('div');
|
||||
this.mark.appendChild(document.createTextNode(" "));
|
||||
document.body.appendChild(this.mark);
|
||||
this.mark.style.position = 'absolute';
|
||||
this.mark.style.top = options.pointerY + "px";
|
||||
this.mark.style.left = options.pointerX + "px";
|
||||
this.mark.style.width = "5px";
|
||||
this.mark.style.height = "5px;";
|
||||
this.mark.style.borderTop = "1px solid red;";
|
||||
this.mark.style.borderLeft = "1px solid red;";
|
||||
|
||||
if(this.step)
|
||||
alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
|
||||
|
||||
$(element).dispatchEvent(oEvent);
|
||||
};
|
||||
|
||||
// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2.
|
||||
// You need to downgrade to 1.0.4 for now to get this working
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much
|
||||
Event.simulateKey = function(element, eventName) {
|
||||
var options = Object.extend({
|
||||
ctrlKey: false,
|
||||
altKey: false,
|
||||
shiftKey: false,
|
||||
metaKey: false,
|
||||
keyCode: 0,
|
||||
charCode: 0
|
||||
}, arguments[2] || {});
|
||||
|
||||
var oEvent = document.createEvent("KeyEvents");
|
||||
oEvent.initKeyEvent(eventName, true, true, window,
|
||||
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
|
||||
options.keyCode, options.charCode );
|
||||
$(element).dispatchEvent(oEvent);
|
||||
};
|
||||
|
||||
Event.simulateKeys = function(element, command) {
|
||||
for(var i=0; i<command.length; i++) {
|
||||
Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)});
|
||||
}
|
||||
};
|
||||
|
||||
var Test = {};
|
||||
Test.Unit = {};
|
||||
|
||||
// security exception workaround
|
||||
Test.Unit.inspect = Object.inspect;
|
||||
|
||||
Test.Unit.Logger = Class.create();
|
||||
Test.Unit.Logger.prototype = {
|
||||
initialize: function(log) {
|
||||
this.log = $(log);
|
||||
if (this.log) {
|
||||
this._createLogTable();
|
||||
}
|
||||
},
|
||||
start: function(testName) {
|
||||
if (!this.log) return;
|
||||
this.testName = testName;
|
||||
this.lastLogLine = document.createElement('tr');
|
||||
this.statusCell = document.createElement('td');
|
||||
this.nameCell = document.createElement('td');
|
||||
this.nameCell.className = "nameCell";
|
||||
this.nameCell.appendChild(document.createTextNode(testName));
|
||||
this.messageCell = document.createElement('td');
|
||||
this.lastLogLine.appendChild(this.statusCell);
|
||||
this.lastLogLine.appendChild(this.nameCell);
|
||||
this.lastLogLine.appendChild(this.messageCell);
|
||||
this.loglines.appendChild(this.lastLogLine);
|
||||
},
|
||||
finish: function(status, summary) {
|
||||
if (!this.log) return;
|
||||
this.lastLogLine.className = status;
|
||||
this.statusCell.innerHTML = status;
|
||||
this.messageCell.innerHTML = this._toHTML(summary);
|
||||
this.addLinksToResults();
|
||||
},
|
||||
message: function(message) {
|
||||
if (!this.log) return;
|
||||
this.messageCell.innerHTML = this._toHTML(message);
|
||||
},
|
||||
summary: function(summary) {
|
||||
if (!this.log) return;
|
||||
this.logsummary.innerHTML = this._toHTML(summary);
|
||||
},
|
||||
_createLogTable: function() {
|
||||
this.log.innerHTML =
|
||||
'<div id="logsummary"></div>' +
|
||||
'<table id="logtable">' +
|
||||
'<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
|
||||
'<tbody id="loglines"></tbody>' +
|
||||
'</table>';
|
||||
this.logsummary = $('logsummary');
|
||||
this.loglines = $('loglines');
|
||||
},
|
||||
_toHTML: function(txt) {
|
||||
return txt.escapeHTML().replace(/\n/g,"<br/>");
|
||||
},
|
||||
addLinksToResults: function(){
|
||||
$$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
|
||||
td.title = "Run only this test";
|
||||
Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
|
||||
});
|
||||
$$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
|
||||
td.title = "Run all tests";
|
||||
Event.observe(td, 'click', function(){ window.location.search = "";});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Test.Unit.Runner = Class.create();
|
||||
Test.Unit.Runner.prototype = {
|
||||
initialize: function(testcases) {
|
||||
this.options = Object.extend({
|
||||
testLog: 'testlog'
|
||||
}, arguments[1] || {});
|
||||
this.options.resultsURL = this.parseResultsURLQueryParameter();
|
||||
this.options.tests = this.parseTestsQueryParameter();
|
||||
if (this.options.testLog) {
|
||||
this.options.testLog = $(this.options.testLog) || null;
|
||||
}
|
||||
if(this.options.tests) {
|
||||
this.tests = [];
|
||||
for(var i = 0; i < this.options.tests.length; i++) {
|
||||
if(/^test/.test(this.options.tests[i])) {
|
||||
this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"]));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.options.test) {
|
||||
this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])];
|
||||
} else {
|
||||
this.tests = [];
|
||||
for(var testcase in testcases) {
|
||||
if(/^test/.test(testcase)) {
|
||||
this.tests.push(
|
||||
new Test.Unit.Testcase(
|
||||
this.options.context ? ' -> ' + this.options.titles[testcase] : testcase,
|
||||
testcases[testcase], testcases["setup"], testcases["teardown"]
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.currentTest = 0;
|
||||
this.logger = new Test.Unit.Logger(this.options.testLog);
|
||||
setTimeout(this.runTests.bind(this), 1000);
|
||||
},
|
||||
parseResultsURLQueryParameter: function() {
|
||||
return window.location.search.parseQuery()["resultsURL"];
|
||||
},
|
||||
parseTestsQueryParameter: function(){
|
||||
if (window.location.search.parseQuery()["tests"]){
|
||||
return window.location.search.parseQuery()["tests"].split(',');
|
||||
};
|
||||
},
|
||||
// Returns:
|
||||
// "ERROR" if there was an error,
|
||||
// "FAILURE" if there was a failure, or
|
||||
// "SUCCESS" if there was neither
|
||||
getResult: function() {
|
||||
var hasFailure = false;
|
||||
for(var i=0;i<this.tests.length;i++) {
|
||||
if (this.tests[i].errors > 0) {
|
||||
return "ERROR";
|
||||
}
|
||||
if (this.tests[i].failures > 0) {
|
||||
hasFailure = true;
|
||||
}
|
||||
}
|
||||
if (hasFailure) {
|
||||
return "FAILURE";
|
||||
} else {
|
||||
return "SUCCESS";
|
||||
}
|
||||
},
|
||||
postResults: function() {
|
||||
if (this.options.resultsURL) {
|
||||
new Ajax.Request(this.options.resultsURL,
|
||||
{ method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false });
|
||||
}
|
||||
},
|
||||
runTests: function() {
|
||||
var test = this.tests[this.currentTest];
|
||||
if (!test) {
|
||||
// finished!
|
||||
this.postResults();
|
||||
this.logger.summary(this.summary());
|
||||
return;
|
||||
}
|
||||
if(!test.isWaiting) {
|
||||
this.logger.start(test.name);
|
||||
}
|
||||
test.run();
|
||||
if(test.isWaiting) {
|
||||
this.logger.message("Waiting for " + test.timeToWait + "ms");
|
||||
setTimeout(this.runTests.bind(this), test.timeToWait || 1000);
|
||||
} else {
|
||||
this.logger.finish(test.status(), test.summary());
|
||||
this.currentTest++;
|
||||
// tail recursive, hopefully the browser will skip the stackframe
|
||||
this.runTests();
|
||||
}
|
||||
},
|
||||
summary: function() {
|
||||
var assertions = 0;
|
||||
var failures = 0;
|
||||
var errors = 0;
|
||||
var messages = [];
|
||||
for(var i=0;i<this.tests.length;i++) {
|
||||
assertions += this.tests[i].assertions;
|
||||
failures += this.tests[i].failures;
|
||||
errors += this.tests[i].errors;
|
||||
}
|
||||
return (
|
||||
(this.options.context ? this.options.context + ': ': '') +
|
||||
this.tests.length + " tests, " +
|
||||
assertions + " assertions, " +
|
||||
failures + " failures, " +
|
||||
errors + " errors");
|
||||
}
|
||||
};
|
||||
|
||||
Test.Unit.Assertions = Class.create();
|
||||
Test.Unit.Assertions.prototype = {
|
||||
initialize: function() {
|
||||
this.assertions = 0;
|
||||
this.failures = 0;
|
||||
this.errors = 0;
|
||||
this.messages = [];
|
||||
},
|
||||
summary: function() {
|
||||
return (
|
||||
this.assertions + " assertions, " +
|
||||
this.failures + " failures, " +
|
||||
this.errors + " errors" + "\n" +
|
||||
this.messages.join("\n"));
|
||||
},
|
||||
pass: function() {
|
||||
this.assertions++;
|
||||
},
|
||||
fail: function(message) {
|
||||
this.failures++;
|
||||
this.messages.push("Failure: " + message);
|
||||
},
|
||||
info: function(message) {
|
||||
this.messages.push("Info: " + message);
|
||||
},
|
||||
error: function(error) {
|
||||
this.errors++;
|
||||
this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")");
|
||||
},
|
||||
status: function() {
|
||||
if (this.failures > 0) return 'failed';
|
||||
if (this.errors > 0) return 'error';
|
||||
return 'passed';
|
||||
},
|
||||
assert: function(expression) {
|
||||
var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"';
|
||||
try { expression ? this.pass() :
|
||||
this.fail(message); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertEqual: function(expected, actual) {
|
||||
var message = arguments[2] || "assertEqual";
|
||||
try { (expected == actual) ? this.pass() :
|
||||
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertInspect: function(expected, actual) {
|
||||
var message = arguments[2] || "assertInspect";
|
||||
try { (expected == actual.inspect()) ? this.pass() :
|
||||
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertEnumEqual: function(expected, actual) {
|
||||
var message = arguments[2] || "assertEnumEqual";
|
||||
try { $A(expected).length == $A(actual).length &&
|
||||
expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
|
||||
this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) +
|
||||
', actual ' + Test.Unit.inspect(actual)); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertNotEqual: function(expected, actual) {
|
||||
var message = arguments[2] || "assertNotEqual";
|
||||
try { (expected != actual) ? this.pass() :
|
||||
this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertIdentical: function(expected, actual) {
|
||||
var message = arguments[2] || "assertIdentical";
|
||||
try { (expected === actual) ? this.pass() :
|
||||
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertNotIdentical: function(expected, actual) {
|
||||
var message = arguments[2] || "assertNotIdentical";
|
||||
try { !(expected === actual) ? this.pass() :
|
||||
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertNull: function(obj) {
|
||||
var message = arguments[1] || 'assertNull';
|
||||
try { (obj==null) ? this.pass() :
|
||||
this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertMatch: function(expected, actual) {
|
||||
var message = arguments[2] || 'assertMatch';
|
||||
var regex = new RegExp(expected);
|
||||
try { (regex.exec(actual)) ? this.pass() :
|
||||
this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertHidden: function(element) {
|
||||
var message = arguments[1] || 'assertHidden';
|
||||
this.assertEqual("none", element.style.display, message);
|
||||
},
|
||||
assertNotNull: function(object) {
|
||||
var message = arguments[1] || 'assertNotNull';
|
||||
this.assert(object != null, message);
|
||||
},
|
||||
assertType: function(expected, actual) {
|
||||
var message = arguments[2] || 'assertType';
|
||||
try {
|
||||
(actual.constructor == expected) ? this.pass() :
|
||||
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||
'", actual "' + (actual.constructor) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertNotOfType: function(expected, actual) {
|
||||
var message = arguments[2] || 'assertNotOfType';
|
||||
try {
|
||||
(actual.constructor != expected) ? this.pass() :
|
||||
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||
'", actual "' + (actual.constructor) + '"'); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertInstanceOf: function(expected, actual) {
|
||||
var message = arguments[2] || 'assertInstanceOf';
|
||||
try {
|
||||
(actual instanceof expected) ? this.pass() :
|
||||
this.fail(message + ": object was not an instance of the expected type"); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertNotInstanceOf: function(expected, actual) {
|
||||
var message = arguments[2] || 'assertNotInstanceOf';
|
||||
try {
|
||||
!(actual instanceof expected) ? this.pass() :
|
||||
this.fail(message + ": object was an instance of the not expected type"); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertRespondsTo: function(method, obj) {
|
||||
var message = arguments[2] || 'assertRespondsTo';
|
||||
try {
|
||||
(obj[method] && typeof obj[method] == 'function') ? this.pass() :
|
||||
this.fail(message + ": object doesn't respond to [" + method + "]"); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertReturnsTrue: function(method, obj) {
|
||||
var message = arguments[2] || 'assertReturnsTrue';
|
||||
try {
|
||||
var m = obj[method];
|
||||
if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
|
||||
m() ? this.pass() :
|
||||
this.fail(message + ": method returned false"); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertReturnsFalse: function(method, obj) {
|
||||
var message = arguments[2] || 'assertReturnsFalse';
|
||||
try {
|
||||
var m = obj[method];
|
||||
if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
|
||||
!m() ? this.pass() :
|
||||
this.fail(message + ": method returned true"); }
|
||||
catch(e) { this.error(e); }
|
||||
},
|
||||
assertRaise: function(exceptionName, method) {
|
||||
var message = arguments[2] || 'assertRaise';
|
||||
try {
|
||||
method();
|
||||
this.fail(message + ": exception expected but none was raised"); }
|
||||
catch(e) {
|
||||
((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e);
|
||||
}
|
||||
},
|
||||
assertElementsMatch: function() {
|
||||
var expressions = $A(arguments), elements = $A(expressions.shift());
|
||||
if (elements.length != expressions.length) {
|
||||
this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions');
|
||||
return false;
|
||||
}
|
||||
elements.zip(expressions).all(function(pair, index) {
|
||||
var element = $(pair.first()), expression = pair.last();
|
||||
if (element.match(expression)) return true;
|
||||
this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect());
|
||||
}.bind(this)) && this.pass();
|
||||
},
|
||||
assertElementMatches: function(element, expression) {
|
||||
this.assertElementsMatch([element], expression);
|
||||
},
|
||||
benchmark: function(operation, iterations) {
|
||||
var startAt = new Date();
|
||||
(iterations || 1).times(operation);
|
||||
var timeTaken = ((new Date())-startAt);
|
||||
this.info((arguments[2] || 'Operation') + ' finished ' +
|
||||
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
|
||||
return timeTaken;
|
||||
},
|
||||
_isVisible: function(element) {
|
||||
element = $(element);
|
||||
if(!element.parentNode) return true;
|
||||
this.assertNotNull(element);
|
||||
if(element.style && Element.getStyle(element, 'display') == 'none')
|
||||
return false;
|
||||
|
||||
return this._isVisible(element.parentNode);
|
||||
},
|
||||
assertNotVisible: function(element) {
|
||||
this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
|
||||
},
|
||||
assertVisible: function(element) {
|
||||
this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
|
||||
},
|
||||
benchmark: function(operation, iterations) {
|
||||
var startAt = new Date();
|
||||
(iterations || 1).times(operation);
|
||||
var timeTaken = ((new Date())-startAt);
|
||||
this.info((arguments[2] || 'Operation') + ' finished ' +
|
||||
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
|
||||
return timeTaken;
|
||||
}
|
||||
};
|
||||
|
||||
Test.Unit.Testcase = Class.create();
|
||||
Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
|
||||
initialize: function(name, test, setup, teardown) {
|
||||
Test.Unit.Assertions.prototype.initialize.bind(this)();
|
||||
this.name = name;
|
||||
|
||||
if(typeof test == 'string') {
|
||||
test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,');
|
||||
test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)');
|
||||
this.test = function() {
|
||||
eval('with(this){'+test+'}');
|
||||
}
|
||||
} else {
|
||||
this.test = test || function() {};
|
||||
}
|
||||
|
||||
this.setup = setup || function() {};
|
||||
this.teardown = teardown || function() {};
|
||||
this.isWaiting = false;
|
||||
this.timeToWait = 1000;
|
||||
},
|
||||
wait: function(time, nextPart) {
|
||||
this.isWaiting = true;
|
||||
this.test = nextPart;
|
||||
this.timeToWait = time;
|
||||
},
|
||||
run: function() {
|
||||
try {
|
||||
try {
|
||||
if (!this.isWaiting) this.setup.bind(this)();
|
||||
this.isWaiting = false;
|
||||
this.test.bind(this)();
|
||||
} finally {
|
||||
if(!this.isWaiting) {
|
||||
this.teardown.bind(this)();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) { this.error(e); }
|
||||
}
|
||||
});
|
||||
|
||||
// *EXPERIMENTAL* BDD-style testing to please non-technical folk
|
||||
// This draws many ideas from RSpec http://rspec.rubyforge.org/
|
||||
|
||||
Test.setupBDDExtensionMethods = function(){
|
||||
var METHODMAP = {
|
||||
shouldEqual: 'assertEqual',
|
||||
shouldNotEqual: 'assertNotEqual',
|
||||
shouldEqualEnum: 'assertEnumEqual',
|
||||
shouldBeA: 'assertType',
|
||||
shouldNotBeA: 'assertNotOfType',
|
||||
shouldBeAn: 'assertType',
|
||||
shouldNotBeAn: 'assertNotOfType',
|
||||
shouldBeNull: 'assertNull',
|
||||
shouldNotBeNull: 'assertNotNull',
|
||||
|
||||
shouldBe: 'assertReturnsTrue',
|
||||
shouldNotBe: 'assertReturnsFalse',
|
||||
shouldRespondTo: 'assertRespondsTo'
|
||||
};
|
||||
var makeAssertion = function(assertion, args, object) {
|
||||
this[assertion].apply(this,(args || []).concat([object]));
|
||||
};
|
||||
|
||||
Test.BDDMethods = {};
|
||||
$H(METHODMAP).each(function(pair) {
|
||||
Test.BDDMethods[pair.key] = function() {
|
||||
var args = $A(arguments);
|
||||
var scope = args.shift();
|
||||
makeAssertion.apply(scope, [pair.value, args, this]); };
|
||||
});
|
||||
|
||||
[Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
|
||||
function(p){ Object.extend(p, Test.BDDMethods) }
|
||||
);
|
||||
};
|
||||
|
||||
Test.context = function(name, spec, log){
|
||||
Test.setupBDDExtensionMethods();
|
||||
|
||||
var compiledSpec = {};
|
||||
var titles = {};
|
||||
for(specName in spec) {
|
||||
switch(specName){
|
||||
case "setup":
|
||||
case "teardown":
|
||||
compiledSpec[specName] = spec[specName];
|
||||
break;
|
||||
default:
|
||||
var testName = 'test'+specName.gsub(/\s+/,'-').camelize();
|
||||
var body = spec[specName].toString().split('\n').slice(1);
|
||||
if(/^\{/.test(body[0])) body = body.slice(1);
|
||||
body.pop();
|
||||
body = body.map(function(statement){
|
||||
return statement.strip()
|
||||
});
|
||||
compiledSpec[testName] = body.join('\n');
|
||||
titles[testName] = specName;
|
||||
}
|
||||
}
|
||||
new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name });
|
||||
};
|
||||
@@ -0,0 +1,672 @@
|
||||
<?php
|
||||
// GET PROVINSI
|
||||
$ss = $db->query('SELECT * from m_provinsi order by idprovinsi ASC');
|
||||
$opsi_provinsi = '<select name="KDPROVINSI" class="form-control text" style="width:100%" id="KDPROVINSI" onchange="propinsi_change()"> <option value=""> --pilih-- </option>';
|
||||
$KDPROVINSI = (array_key_exists('KDPROVINSI', $_GET)) ? $_GET['KDPROVINSI'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if($KDPROVINSI == $ds['idprovinsi']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
$opsi_provinsi .= '<option value="'.$ds['idprovinsi'].'"> '.$ds['namaprovinsi'].'</option>';
|
||||
}
|
||||
$opsi_provinsi .= '</select>';
|
||||
if($KDPROVINSI != null){
|
||||
$ss = $db->query('SELECT * from m_kota where idprovinsi = '.$KDPROVINSI.' order by idkota ASC');
|
||||
$KOTA = (array_key_exists('KOTA', $_GET)) ? $_GET['KOTA'] : null;
|
||||
$opsi_kota = '<select name="KOTA" class="form-control text" style="width:100%" id="KOTA" > <option value=""> --pilih-- </option>';
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if($_GET['KOTA'] == $ds['idkota']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
$opsi_kota .= '<option value="'.$ds['idkota'].'" '.$sel.' > '.$ds['namakota'].'</option>';
|
||||
}
|
||||
$opsi_kota .= '</select>';
|
||||
}
|
||||
if($KOTA != null){
|
||||
$ss = $db->query('SELECT * from m_kecamatan where idkota = '.$KOTA.' order by idkecamatan ASC');
|
||||
$opsi_kecamatan = '<select name="KDKECAMATAN" class="form-control text" style="width:100%" id="KDKECAMATAN" > <option value=""> --pilih-- </option>';
|
||||
$KDKECAMATAN = (array_key_exists('KDKECAMATAN', $_GET)) ? $_GET['KDKECAMATAN'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if($KDKECAMATAN == $ds['idkecamatan']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
$opsi_kecamatan .= '<option value="'.$ds['idkecamatan'].'" '.$sel.' /> '.$ds['namakecamatan'].'</option>';
|
||||
}
|
||||
$opsi_kecamatan .= '</select>';
|
||||
$js_opsi_kecamatan = preg_replace("/\"/","\\\"",$opsi_kecamatan);
|
||||
}
|
||||
if($KDKECAMATAN != null) {
|
||||
$ss = $db->query('SELECT * from m_kelurahan where idkecamatan = '.$KDKECAMATAN.' order by idkelurahan ASC');
|
||||
$opsi_kelurahan = '<select name="KELURAHAN" class="form-control text" style="width:100%" id="KELURAHAN" > <option value=""> --pilih-- </option>';
|
||||
$KELURAHAN = (array_key_exists('KELURAHAN', $_GET)) ? $_GET['KELURAHAN'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if($KELURAHAN == $ds['idkelurahan']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
$opsi_kelurahan .= '<option value="'.$ds['idkelurahan'].'" '.$sel.' /> '.$ds['namakelurahan'].'</option>';
|
||||
}
|
||||
$opsi_kelurahan .= '</select>';
|
||||
$js_opsi_kelurahan = preg_replace("/\"/","\\\"",$opsi_kelurahan);
|
||||
}
|
||||
// GET STATUS
|
||||
$ss = $db->query('SELECT * from m_status_pasien order by id_status ASC');
|
||||
$opsi_status = '';
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if((isset($m_pasien) && $m_pasien->STATUS == $ds['id_status']) || (array_key_exists('STATUS', $_GET) && $_GET['STATUS'] == $ds['id_status'])): $sel = "Checked"; else: $sel = ''; endif;
|
||||
$opsi_status .= '<div class="form-check form-check-inline">
|
||||
<input type="radio" name="STATUS" id="status_'.$ds['id_status'].'" title="*" class="form-check-input required" '.$sel.' value="'.$ds['id_status'].'">
|
||||
<label class="form-check-label" for="status_'.$ds['id_status'].'"> '.$ds['nama_status'].'</label>
|
||||
</div>';
|
||||
}
|
||||
|
||||
// GET AGAMA
|
||||
$ss = $db->query('SELECT * from m_agama_pasien order by id_agama ASC');
|
||||
$input_agama_lain = '<input type="text" name="agama_lain" id="agama_lain" class="form-control" placeholder="Isikan Agama lainnya" style="display:none">';
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if((isset($m_pasien) && $m_pasien->AGAMA == $ds['id_agama']) || (array_key_exists('AGAMA', $_GET) && $_GET['AGAMA'] == $ds['id_agama'])): $sel = "Checked"; else: $sel = ''; endif;
|
||||
$opsi_agama .= '<div class="form-check form-check-inline">
|
||||
<input type="radio" name="AGAMA" id="AGAMA_'.$ds['id_agama'].'" title="*" class="form-check-input required" '.$sel.' value="'.$ds['id_agama'].'">
|
||||
<label class="form-check-label" for="AGAMA_'.$ds['id_agama'].'"> '.$ds['nama_agama'].'</label>
|
||||
</div>';
|
||||
}
|
||||
|
||||
// GET PENDIDIKAN
|
||||
$ss = $db->query('SELECT * from m_pendidikan_pasien order by id_pendidikan ASC');
|
||||
$opsi_pendidikan = '';$arr_pendidikan = [];
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if((isset($m_pasien) && $m_pasien->PENDIDIKAN == $ds['id_pendidikan']) || (array_key_exists('PENDIDIKAN', $_GET) && $_GET['PENDIDIKAN'] == $ds['id_pendidikan'])): $sel = "Checked"; else: $sel = ''; endif;
|
||||
$arr_pendidikan[$ds['id_pendidikan']] = $ds['nama_pendidikan'];
|
||||
$opsi_pendidikan .= '<div class="form-check form-check-inline">
|
||||
<input type="radio" name="PENDIDIKAN" id="PENDIDIKAN_'.$ds['id_pendidikan'].'" title="*" class="form-check-input required" '.$sel.' value="'.$ds['id_pendidikan'].'">
|
||||
<label class="form-check-label" for="PENDIDIKAN_'.$ds['id_pendidikan'].'"> '.$ds['nama_pendidikan'].'</label>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$ss = $db->query('SELECT * from m_bahasa order by IDXBAHASA ASC');
|
||||
$opsi_bahasa = '<select name="bahasa" class="form-control text required" style="width:100%" id="bahasa" required> <option value=""> --pilih-- </option>';
|
||||
$arr_bahasa = array(''=>'--pilih--');
|
||||
$bahasa = (array_key_exists('bahasa', $_GET)) ? $_GET['bahasa'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if($bahasa == $ds['nmbahasa']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
$opsi_bahasa .= '<option value="'.$ds['nmbahasa'].'" '.$sel.' /> '.$ds['nmbahasa'].'</option>';
|
||||
$arr_bahasa[$ds['nmbahasa']] = $ds['nmbahasa'];
|
||||
}
|
||||
$opsi_bahasa .= '</select>';
|
||||
|
||||
$ss = $db->query('SELECT * from m_suku order by IDXSUKU ASC');
|
||||
$opsi_suku = '<select name="kebangsaan" class="form-control text required" style="width:100%" id="kebangsaan" required> <option value=""> --pilih-- </option>';
|
||||
$arr_suku = array(''=>'--pilih--');
|
||||
$kebangsaan = (array_key_exists('kebangsaan', $_GET)) ? $_GET['kebangsaan'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
if($kebangsaan == $ds['nmsuku']): $sel = "selected=Selected"; else: $sel = ''; endif;
|
||||
$opsi_suku .= '<option value="'.$ds['nmsuku'].'" '.$sel.' /> '.$ds['nmsuku'].'</option>';
|
||||
$arr_suku[$ds['nmsuku']] = $ds['nmsuku'];
|
||||
}
|
||||
$opsi_suku .= '</select>';
|
||||
|
||||
$ss = $db->query('SELECT * from m_pekerjaan order by IDXPEKERJAAN ASC');
|
||||
$arr_pekerjaan = array(''=>'--pilih--');
|
||||
$PEKERJAAN = (array_key_exists('PEKERJAAN', $_GET)) ? $_GET['PEKERJAAN'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
$arr_pekerjaan[$ds['nmpekerjaan']] = $ds['nmpekerjaan'];
|
||||
}
|
||||
|
||||
$ss = $db->query('SELECT * from m_disabilitas');
|
||||
$arr_disabilitas = array(''=>'--pilih--');
|
||||
$DISABILITAS = (array_key_exists('DISABILITAS', $_GET)) ? $_GET['DISABILITAS'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
$arr_disabilitas[$ds['kode_disabilitas']] = $ds['nama_disabilitas'];
|
||||
}
|
||||
|
||||
$ss = $db->query('SELECT * from m_hubunganpasien');
|
||||
$arr_hubungan = array(''=>'--pilih--');
|
||||
$hubungan_penanggungjawab = (array_key_exists('hubungan_penanggungjawab', $_GET)) ? $_GET['hubungan_penanggungjawab'] : null;
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
$arr_hubungan[$ds['nama_hubpasien']] = $ds['nama_hubpasien'];
|
||||
}
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function propinsi_change() {
|
||||
var selectValues = $("#KDPROVINSI").val();
|
||||
var kotaHidden = $("#KOTAHIDDEN").val();
|
||||
var kecHidden = $("#KECAMATANHIDDEN").val();
|
||||
$.post('<?php echo _BASE_;?>include/ajaxload.php',{kdprov:selectValues, kdkota:kotaHidden, kdkec:kecHidden, load_kota:'true'},function(data){
|
||||
$('#kotapilih').html(data);
|
||||
$("#kotapilih select").select2();
|
||||
$('#KOTA').val(kotaHidden).change();
|
||||
v_status = $(".statuspasien:checked").val();
|
||||
if(v_status == 0) {
|
||||
$("select#KOTA").prop("disabled",false);
|
||||
var kecHidden = $("#KECAMATANHIDDEN").val();
|
||||
$.post('./include/ajaxload.php',{kdkota:kotaHidden,load_kecamatan:'true'},function(data){
|
||||
$('#kecamatanpilih').html(data);
|
||||
$('#kecamatanpilih select').select2();
|
||||
$('#KDKECAMATAN').val(kecHidden).change();
|
||||
$("select#KDKECAMATAN").prop("disabled",false);
|
||||
var kelHidden = $("#KELURAHANHIDDEN").val();
|
||||
$.post('./include/ajaxload.php',{kdkecamatan:kecHidden,load_kelurahan:'true'},function(data){
|
||||
$('#kelurahanpilih').html(data);
|
||||
$('#kelurahanpilih select').select2();
|
||||
$('#KELURAHAN').val(kelHidden).change();
|
||||
$("select#KELURAHAN").prop("disabled",false);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('#kecamatanpilih').html("<?php echo $js_opsi_kecamatan; ?>");
|
||||
$('#kelurahanpilih').html("<?php echo $js_opsi_kelurahan; ?>");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("#KDPROVINSI").change(function(){
|
||||
propinsi_change();
|
||||
});
|
||||
|
||||
$('#CALLER').on('select2:select', function (e) {
|
||||
var data = e.params.data;
|
||||
if(data.id=="Tn") {
|
||||
$("#JENISKELAMIN_L").attr("checked","checked");
|
||||
$("#JENISKELAMIN_P").removeAttr("checked");
|
||||
}
|
||||
else if(data.id=="Ny" || data.id=="Nn") {
|
||||
$("#JENISKELAMIN_P").attr("checked","checked");
|
||||
$("#JENISKELAMIN_L").removeAttr("checked");
|
||||
}
|
||||
else {
|
||||
$("#JENISKELAMIN_L").removeAttr("checked");
|
||||
$("#JENISKELAMIN_P").removeAttr("checked");
|
||||
}
|
||||
});
|
||||
|
||||
$("#kebangsaan").on("change",function() {
|
||||
kebangsaan = $(this).find(":selected").val();
|
||||
if(kebangsaan == 'WNI') {
|
||||
$("#suku").val("").trigger("change").prop("disabled",false);
|
||||
}
|
||||
else {
|
||||
$("#suku").val("").trigger("change").prop("disabled",true);
|
||||
}
|
||||
});
|
||||
});
|
||||
</SCRIPT>
|
||||
<?php
|
||||
// recheck variable with notice
|
||||
$caller = (array_key_exists('CALLER', $_GET)) ? $_GET['CALLER'] : null;
|
||||
$tempat = (array_key_exists('TEMPAT', $_GET) && !empty($_GET['TEMPAT'])) ? $_GET['TEMPAT'] : ( (isset($m_pasien)) ? $m_pasien->TEMPAT : null) ;
|
||||
$tgl_lahir = (array_key_exists('TGLLAHIR', $_GET) && !empty($_GET['TGLLAHIR'])) ? $_GET['TGLLAHIR'] : ( (isset($m_pasien)) ? date('d/m/Y', strtotime($m_pasien->TGLLAHIR)) : null) ;
|
||||
$arr_kebangsaan = ['WNI'=>'WNI','WNA'=>'WNA'];
|
||||
?>
|
||||
<div id='msg'></div>
|
||||
<div id="list_data"></div>
|
||||
<fieldset class="fieldset">
|
||||
<div class="card" id="identitas_pasien">
|
||||
<div class="card-header"><h5>DATA PASIEN</h5></div>
|
||||
<div class="card-body">
|
||||
<div class="row text-left">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No KTP </label>
|
||||
<div class="col-sm-6">
|
||||
<input class="mask-noktp form-control text" value="<?php echo (array_key_exists('NOKTP', $_GET) && !empty($_GET['NOKTP'])) ? $_GET['NOKTP'] : (isset($m_pasien) ? $m_pasien->NOKTP : null); ?>" type="text" name="NOKTP" id="NOKTP" size="25">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<input type="button" id="btnCariPeserta2" data-jenis="nik" class="btn btn-outline-secondary btn-block" value="Cari">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" style="text-align:left">Dokumen KTP</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<div class="custom-file">
|
||||
<input type="file" name="ktp_file" class="custom-file-input" id="ktp_file">
|
||||
<label class="custom-file-label" for="ktp_file">Pilih File KTP</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4"> </div>
|
||||
<div class="col-sm-8" id="ktp_wrapper"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" style="text-align:left">Dokumen KK</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<div class="custom-file">
|
||||
<input type="file" name="kk_file" class="custom-file-input" id="kk_file">
|
||||
<label class="custom-file-label" for="kk_file">Pilih File KK</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4"> </div>
|
||||
<div class="col-sm-8" id="kk_wrapper"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Nama Lengkap Pasien</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<span id="nam"><input title="*" class="form-control text required" type="text" name="NAMA" size="30" value="<?php echo (array_key_exists('NAMA', $_GET)) ? $_GET['NAMA'] : ''; ?>" id="NAMA" oninput="this.value = this.value.toUpperCase()"></span>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<select name="CALLER" class="form-control text" id="CALLER"><option selected="selected" value="">- Alias -</option><option value="Tn" <?php if($caller=="Tn") echo "selected=selected"; ?>> Tn </option><option value="Ny" <?php if($caller=="Ny") echo "selected=selected"; ?>> Ny </option><option value="Nn" <?php if($caller=="Nn") echo "selected=selected"; ?>> Nn </option><option value="An" <?php if($caller=="An") echo "selected=selected"; ?>> An </option><option value="By.Ny" <?php if($caller=="By.Ny") echo "selected=selected"; ?>> By.Ny. </option></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Tempat, Tanggal Lahir</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<input type="text" value="<?php echo $tempat; ?>" class="form-control text" title="*" name="TEMPAT" size="15" id="TEMPAT" placeholder="Tempat Lahir" oninput="this.value = this.value.toUpperCase()" required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input onblur="calage1(this.value,'umur');$('#umur').prop('readonly','true');" type="text" class="datepicker-lahir mask-date-lahir form-control text required" title="*" value="<?php echo $tgl_lahir; ?>" name="TGLLAHIR" id="TGLLAHIR" size="20" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Umur </label>
|
||||
<div class="col-sm-8">
|
||||
<span id="umurc"><input class="form-control text" type="text" value="" name="umur" id="umur" size="45" readonly="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Alamat Sekarang</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="ALAMAT" id="ALAMAT" class="form-control text required" type="text" value="<?php echo (!empty($_GET['ALAMAT'])) ? $_GET['ALAMAT'] : null; ?>" title="*" size="45" oninput="this.value = this.value.toUpperCase()" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Alamat KTP</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="ALAMAT_KTP" class="form-control text" type="text" value="<?php echo (!empty($_GET['ALAMAT_KTP'])) ? $_GET['ALAMAT_KTP'] : null; ?>" size="45" id="ALAMAT_KTP" oninput="this.value = this.value.toUpperCase()" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Bahasa</label>
|
||||
<div class="col-sm-8" >
|
||||
<?php echo form_dropdown('bahasa',$arr_bahasa,$bahasa,'class="form-control" id="bahasa"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Kebangsaan</label>
|
||||
<div class="col-sm-8" >
|
||||
<?php echo form_dropdown('kebangsaan',$arr_kebangsaan,$kebangsaan,'class="form-control" id="kebangsaan"'); ?>
|
||||
<?php echo form_dropdown('suku',$arr_suku,'','class="form-control m-2" id="suku"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Provinsi</label>
|
||||
<div class="col-sm-8" >
|
||||
<div id="wrap_propinsi">
|
||||
<?php echo $opsi_provinsi; ?>
|
||||
</div>
|
||||
<input value="<?php echo (array_key_exists('KOTA', $_GET) && !empty($_GET['KOTA'])) ? $_GET['KOTA'] : null; ?>" type="hidden" name="KOTAHIDDEN" id="KOTAHIDDEN">
|
||||
<input value="<?php echo (array_key_exists('KECAMATAN', $_GET) && !empty($_GET['KECAMATAN'])) ? $_GET['KECAMATAN'] : null; ?>" type="hidden" name="KECAMATANHIDDEN" id="KECAMATANHIDDEN">
|
||||
<input value="<?php echo (array_key_exists('KELURAHAN', $_GET) && !empty($_GET['KELURAHAN'])) ? $_GET['KELURAHAN'] : null; ?>" type="hidden" name="KELURAHANHIDDEN" id="KELURAHANHIDDEN">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Kabupaten / Kota</label>
|
||||
<div class="col-sm-8" >
|
||||
<div id="kotapilih"> <?php echo $opsi_kota; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Kecamatan</label>
|
||||
<div class="col-sm-8" >
|
||||
<div id="kecamatanpilih"><?php echo $opsi_kecamatan; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Kelurahan</label>
|
||||
<div class="col-sm-8" >
|
||||
|
||||
<div id="kelurahanpilih"><?php echo $opsi_kelurahan; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No Telepon / HP </label>
|
||||
<div class="col-sm-8">
|
||||
<input class="mask-telepon form-control text" value="<?php echo (array_key_exists('NOTELP', $_GET) && !empty($_GET['NOTELP'])) ? $_GET['NOTELP'] : (isset($m_pasien) ? $m_pasien->NOTELP : null); ?>" type="text" name="NOTELP" size="25" id="notelp">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No Telepon Rumah </label>
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<input class="mask-telepon form-control text" value="<?php echo (array_key_exists('notelprumah1', $_GET) && !empty($_GET['notelprumah1'])) ? $_GET['notelprumah1'] : (isset($m_pasien) ? $m_pasien->notelprumah1 : null); ?>" type="text" name="notelprumah1" size="25" id="notelprumah1" placeholder="Telepon Rumah 1">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<input class="mask-telepon form-control text" value="<?php echo (array_key_exists('notelprumah2', $_GET) && !empty($_GET['notelprumah2'])) ? $_GET['notelprumah2'] : (isset($m_pasien) ? $m_pasien->notelprumah2 : null); ?>" type="text" name="notelprumah2" size="25" id="notelprumah2" placeholder="Telepon Rumah 2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No Telepon Kantor / HP </label>
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<input class="mask-telepon form-control text" value="<?php echo (array_key_exists('notelpkantor', $_GET) && !empty($_GET['notelpkantor'])) ? $_GET['notelpkantor'] : (isset($m_pasien) ? $m_pasien->notelpkantor : null); ?>" type="text" name="notelpkantor" size="25" id="notelpkantor" placeholder="Telepon Kantor">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<input class="mask-telepon form-control text" value="<?php echo (array_key_exists('no_hp', $_GET) && !empty($_GET['no_hp'])) ? $_GET['no_hp'] : (isset($m_pasien) ? $m_pasien->no_hp : null); ?>" type="text" name="no_hp" size="25" id="no_hp" placeholder="HP">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No SIM </label>
|
||||
<div class="col-sm-8">
|
||||
<input class="mask-noktp form-control text" value="<?php echo (array_key_exists('SIM', $_GET) && !empty($_GET['sim'])) ? $_GET['sim'] : (isset($m_pasien) ? $m_pasien->sim : null); ?>" type="text" name="sim" id="sim" size="25">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No PASPOR </label>
|
||||
<div class="col-sm-8">
|
||||
<input class="mask-paspor form-control text" value="<?php echo (array_key_exists('paspor', $_GET) && !empty($_GET['paspor'])) ? $_GET['paspor'] : (isset($m_pasien) ? $m_pasien->paspor : null); ?>" type="text" name="paspor" id="paspor" size="25">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-sm-4" >Isi Identitas Orangtua </label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="st_identitas_ortu" id="st_identitas_ortu_y" title="*" class="form-check-input st_identitas_ortu" value="1" checked="checked">
|
||||
<label class="form-check-label" for="st_identitas_ortu_y"> Ya </label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="st_identitas_ortu" id="st_identitas_ortu_t" title="*" class="form-check-input st_identitas_ortu" value="0">
|
||||
<label class="form-check-label" for="st_identitas_ortu_t"> Tidak </label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wrapper_identitas_orangtua">
|
||||
<div class="form-group row" >
|
||||
<label class="col-sm-4 col-form-label" >Nama Ayah Kandung </label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control text" type="text" value="<?php echo (array_key_exists('nama_ayah_kandung', $_GET) && !empty($_GET['nama_ayah_kandung'])) ? $_GET['nama_ayah_kandung'] : (isset($m_pasien) ? $m_pasien->nama_ayah_kandung : null); ?>" name="nama_ayah_kandung" id="nama_ayah_kandung" size="100" oninput="this.value = this.value.toUpperCase()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" >
|
||||
<label class="col-sm-4 col-form-label" >Nama Ibu Kandung </label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control text" type="text" value="<?php echo (array_key_exists('nama_ibu_kandung', $_GET) && !empty($_GET['nama_ibu_kandung'])) ? $_GET['nama_ibu_kandung'] : (isset($m_pasien) ? $m_pasien->nama_ibu_kandung : null); ?>" name="nama_ibu_kandung" id="nama_ibu_kandung" size="100" oninput="this.value = this.value.toUpperCase()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" >
|
||||
<label class="col-sm-4 col-form-label" >Pendidikan Ayah </label>
|
||||
<div class="col-sm-8">
|
||||
<?php echo form_dropdown('pendidikan_ayah',$arr_pendidikan,'','class="form-control" id="pendidikan_ayah"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" >
|
||||
<label class="col-sm-4 col-form-label" >Pendidikan Ibu </label>
|
||||
<div class="col-sm-8">
|
||||
<?php echo form_dropdown('pendidikan_ibu',$arr_pendidikan,'','class="form-control" id="pendidikan_ibu"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Pekerjaan Pasien / Orang Tua</label>
|
||||
<div class="col-sm-8 " >
|
||||
<?php echo form_dropdown('PEKERJAAN',$arr_pekerjaan,$PEKERJAAN,'class="form-control" id="PEKERJAAN"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Nama Penanggung Jawab</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control text" type="text" name="nama_penanggungjawab" size="30" value="<?php echo (!empty($_GET['nama_penanggungjawab'])) ? $_GET['nama_penanggungjawab'] : null; ?>" id="nama_penanggungjawab" oninput="this.value = this.value.toUpperCase()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Hubungan Dengan Pasien</label>
|
||||
<div class="col-sm-8">
|
||||
<?php echo form_dropdown('hubungan_penanggungjawab',$arr_hubungan,$hubungan_penanggungjawab,'class="form-control" id="hubungan_penanggungjawab"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >Alamat</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="alamat_penanggungjawab" class="form-control text" type="text" size="45" value="<?php echo (!empty($_GET['alamat_penanggungjawab'])) ? $_GET['alamat_penanggungjawab'] : null; ?>" id="alamat_penanggungjawab" oninput="this.value = this.value.toUpperCase()" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" >No Telepon / HP</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="mask-telepon form-control text" type="text" name="phone_penanggungjawab" size="25" value="<?php echo (!empty($_GET['phone_penanggungjawab'])) ? $_GET['phone_penanggungjawab'] : null; ?>" id="phone_penanggungjawab">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Jenis Kelamin </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="JENISKELAMIN" id="JENISKELAMIN_L" title="*" class="form-check-input required" value="L" <?php if(array_key_exists('JENISKELAMIN', $_GET) && $_GET['JENISKELAMIN']=="L") echo "checked"; ?>>
|
||||
<label class="form-check-label" for="JENISKELAMIN_L"> Laki-laki </label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="JENISKELAMIN" id="JENISKELAMIN_P" title="*" class="required" value="P" <?php if(array_key_exists('JENISKELAMIN', $_GET) && $_GET['JENISKELAMIN']=="P") echo "checked"; ?>>
|
||||
<label class="form-check-label" for="JENISKELAMIN_P"> Perempuan </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Status Perkawinan </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<?php echo $opsi_status; ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Pendidikan </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<?php echo $opsi_pendidikan; ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Agama </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<?php echo $opsi_agama; ?>
|
||||
<?php echo $input_agama_lain; ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Kepercayaan </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<input type="text" name="kepercayaan" class="form-control" id="kepercayaan" placeholder="Isian Kepecercayaan">
|
||||
<small class="form-text text-muted">Contoh: Tidak ingin diperiksa oleh dokter laki-laki</small>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Disabilitas </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="st_disabilitas" id="st_disabilitas_y" title="*" class="form-check-input st_disabilitas" value="1">
|
||||
<label class="form-check-label" for="st_disabilitas_y"> Ya </label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="st_disabilitas" id="st_disabilitas_t" title="*" class="form-check-input st_disabilitas" value="0" checked="checked">
|
||||
<label class="form-check-label" for="st_disabilitas_t"> Tidak </label>
|
||||
</div>
|
||||
|
||||
<?php echo form_dropdown('disabilitas',$arr_disabilitas,$DISABILITAS,'class="form-control" id="disabilitas" disabled'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-4 pt-0" >Hambatan Berkomunikasi </legend>
|
||||
<div class="col-sm-8" style="text-align:left;">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="hambatan_komunikasi" id="hambatan_komunikasiy" title="*" class="form-check-input required" value="Y"<?php if(array_key_exists('hambatan_komunikasi', $_GET) && $_GET['hambatan_komunikasi']=="Y") echo "checked"; ?>>
|
||||
<label class="form-check-label" for="hambatan_komunikasiy"> Ya </label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="radio" name="hambatan_komunikasi" id="hambatan_komunikasit" title="*" class="required" value="T"<?php if(array_key_exists('hambatan_komunikasi', $_GET) && $_GET['hambatan_komunikasi']=="T") echo "checked"; ?>>
|
||||
<label class="form-check-label" for="hambatan_komunikasit"> Tidak </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-muted">
|
||||
<div class="row">
|
||||
<div class="col-md-2 offset-md-8"><button type="button" name="daftar" id="simpan_daftar" class="btn btn-block btn-primary">S I M P A N</button></div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" name="print" class="btn btn-secondary btn-block text" onclick="cetak();">Print Kartu Pasien</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type='hidden' name='stop_daftar' id='stop_daftar' />
|
||||
<input type="text" id="msgid" name="msgid" style="border:1px #FFF solid; width:0px; height:0px;">
|
||||
<br>
|
||||
</fieldset>
|
||||
<?php
|
||||
if(!empty($tgl_lahir)){
|
||||
$js_init .= 'calage1(\''.$tgl_lahir.'\',\'umur\');';
|
||||
}
|
||||
$js_init .= 'var wrap_propinsi = \''.$opsi_provinsi.'\';';
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function cetak(){
|
||||
var nomr = document.getElementById('NOMR').value;
|
||||
var nama = document.getElementById('NAMA').value;
|
||||
var alamat = document.getElementById('ALAMAT').value;
|
||||
var TGLLAHIR = document.getElementById('TGLLAHIR').value;
|
||||
var JENISKELAMIN = document.getElementById('JENISKELAMIN_L').value;
|
||||
|
||||
window.open("pdfb/kartupasien.php?NOMR="+ nomr +"&NAMA="+ nama +"&ALAMAT="+ alamat+"&TGLLAHIR="+ TGLLAHIR+"&JENISKELAMIN="+ JENISKELAMIN,"mywindow");
|
||||
return false;
|
||||
|
||||
}
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: "top-end",
|
||||
showConfirmButton: false,
|
||||
timer: 3000
|
||||
});
|
||||
$("#btnCariPeserta2").click(function() {
|
||||
nik = $("#NOKTP").val();
|
||||
if(nik != "" && nik.length == 16) {
|
||||
reg_nik = /^(([1-9]{2})(0[1-9]|[1-9]\d)(0[1-9]|[1-9]\d)([04][1-9]|[1256][0-9]|[37][01])(0[1-9]|1[0-2])(\d{2})(\d{2})(0[1-9]|[1-9]\d)|\w{1,3}\d{6,8})$/g;
|
||||
tes_nik = nik.match(reg_nik);
|
||||
if(tes_nik) {
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "<?php echo _BASE_.'anjungan/anjungan.php'; ?>",
|
||||
data : {page:"get_nik_curl",nik},
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if(data.content != null) {
|
||||
if('RESPONSE_DESC' in data.content[0]) {
|
||||
$("#NAMA").val("");
|
||||
$("#TEMPAT").val("");
|
||||
$("#TGLLAHIR,#umur").val("");
|
||||
$("#ALAMAT").val("");
|
||||
$("#ALAMAT_KTP").val("");
|
||||
$("#PEKERJAAN").val("").trigger("change");
|
||||
$("#JENISKELAMIN_L,#JENISKELAMIN_P").removeAttr('checked');
|
||||
$("#status_1,#status_2").removeAttr('checked');
|
||||
$('#AGAMA_1,#AGAMA_2,#AGAMA_3,#AGAMA_4,#AGAMA_5,#AGAMA_6').removeAttr('checked');
|
||||
$("#KELURAHAN,#KDKECAMATAN,#KOTA,#PROVINSI").val("").trigger("change");
|
||||
Toast.fire({title:data.content[0].RESPONSE_DESC,type:'error'});
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
penduduk = data.content[0];
|
||||
|
||||
$("#NAMA").val(penduduk.NAMA_LGKP);
|
||||
$("#TEMPAT").val(penduduk.TMPT_LHR);
|
||||
// $("#TGLLAHIR").val(penduduk.TGL_LHR);
|
||||
sp_tgl = penduduk.TGL_LHR.split('-');
|
||||
$("#TGLLAHIR").val(sp_tgl[2]+"/"+sp_tgl[1]+"/"+sp_tgl[0]);
|
||||
|
||||
calage1(sp_tgl[2]+"/"+sp_tgl[1]+"/"+sp_tgl[0],'umur');
|
||||
|
||||
$("#ALAMAT").val(penduduk.ALAMAT);
|
||||
$("#ALAMAT_KTP").val(penduduk.ALAMAT+" "+penduduk.KEL_NAME+" RT."+penduduk.NO_RT+" RW."+penduduk.NO_RW+" Kec. "+penduduk.KEC_NAME+" "+penduduk.KAB_NAME+" "+penduduk.PROP_NAME);
|
||||
$.post("<?php echo _BASE_.'include/master.php'; ?>",{get_alamat_dispenduk:1,penduduk},function(data) {
|
||||
if('not_found' in data){
|
||||
|
||||
}
|
||||
else {
|
||||
$("#KOTAHIDDEN").val(data.id_kota);
|
||||
$("#KECAMATANHIDDEN").val(data.id_kecamatan);
|
||||
$("#KELURAHANHIDDEN").val(data.id_kelurahan);
|
||||
$("#KDPROVINSI").val(data.id_provinsi).trigger("change");
|
||||
setTimeout(function(){
|
||||
$("#KOTA").val(data.id_kota).trigger("change");
|
||||
},300);
|
||||
|
||||
setTimeout(function(){
|
||||
$("#KDKECAMATAN").val(data.id_kecamatan).trigger("change");
|
||||
},500);
|
||||
|
||||
setTimeout(function(){
|
||||
$("#KELURAHAN").val(data.id_kelurahan).trigger("change");
|
||||
},800);
|
||||
}
|
||||
},"json");
|
||||
$("#PEKERJAAN").val(penduduk.JENIS_PKRJN).trigger("change");
|
||||
if(penduduk.JENIS_KLMIN == 'Laki-Laki') {
|
||||
$("#JENISKELAMIN_L").attr('checked','checked');
|
||||
}
|
||||
else {
|
||||
$("#JENISKELAMIN_P").attr('checked','checked');
|
||||
}
|
||||
if(penduduk.STATUS_KAWIN == 'KAWIN') {
|
||||
$("#status_2").attr('checked','checked');
|
||||
}
|
||||
else {
|
||||
$("#status_1").attr('checked','checked');
|
||||
}
|
||||
if(penduduk.AGAMA == 'ISLAM') {
|
||||
$('#AGAMA_1').attr('checked','checked');
|
||||
}
|
||||
else if(penduduk.AGAMA == 'KRISTEN') {
|
||||
$('#AGAMA_2').attr('checked','checked');
|
||||
}
|
||||
else if(penduduk.AGAMA == 'KATOLIK') {
|
||||
$('#AGAMA_3').attr('checked','checked');
|
||||
}
|
||||
else if(penduduk.AGAMA == 'HINDU') {
|
||||
$('#AGAMA_4').attr('checked','checked');
|
||||
}
|
||||
else if(penduduk.AGAMA == 'BUDHA') {
|
||||
$('#AGAMA_5').attr('checked','checked');
|
||||
}
|
||||
else if(penduduk.AGAMA == 'KONGHUCU') {
|
||||
$('#AGAMA_6').attr('checked','checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
Toast.fire({title:"NIK tidak ditemukan!",type:"error"});
|
||||
change_page = false;
|
||||
}
|
||||
},
|
||||
error : function(xhr,status,error) {
|
||||
Toast.fire({title:"NIK tidak ditemukan!",type:"error"});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
Toast.fire({title:"NIK tidak valid!",type:"error"});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,59 @@
|
||||
//xmlhttp.js
|
||||
|
||||
//Function to create an XMLHttp Object.
|
||||
function getxmlhttp (){
|
||||
//Create a boolean variable to check for a valid microsoft active X instance.
|
||||
var xmlhttp = false;
|
||||
|
||||
//Check if we are using internet explorer.
|
||||
try {
|
||||
//If the javascript version is greater than 5.
|
||||
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
//If not, then use the older active x object.
|
||||
try {
|
||||
//If we are using internet explorer.
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) {
|
||||
//Else we must be using a non-internet explorer browser.
|
||||
xmlhttp = false;
|
||||
}
|
||||
}
|
||||
|
||||
//If we are using a non-internet explorer browser, create a javascript instance of the object.
|
||||
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
}
|
||||
|
||||
return xmlhttp;
|
||||
}
|
||||
|
||||
//Function to process an XMLHttpRequest.
|
||||
function processajax (serverPage, obj, getOrPost, str){
|
||||
//Get an XMLHttpRequest object for use.
|
||||
|
||||
xmlhttp = getxmlhttp ();
|
||||
if (getOrPost == "get"){
|
||||
|
||||
xmlhttp.open("GET", serverPage);
|
||||
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
|
||||
obj.innerHTML = xmlhttp.responseText;
|
||||
}
|
||||
|
||||
}
|
||||
xmlhttp.send(null);
|
||||
} else {
|
||||
xmlhttp.open("POST", serverPage, true);
|
||||
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
obj.innerHTML = xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
xmlhttp.send(str);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user