예제 #1
0
 public static function Module($area)
 {
     $database = new SyncDatabase();
     $req = new UrlRequest();
     $req->url($_SERVER['REQUEST_URI']);
     foreach ($database->query("SELECT * FROM dvg_module WHERE area_id=(SELECT area_id FROM dvg_area WHERE name='{$area}')") as $mod) {
         if ($database->query("SELECT COUNT(*) FROM dvg_panel WHERE mod_id={$mod['mod_id']}") == 0) {
             include_once "module/" . $mod['filename'];
         } else {
             foreach ($database->query("SELECT * FROM dvg_panel WHERE mod_id={$mod['mod_id']}") as $panel) {
                 $menu = $database->query("SELECT * FROM dvg_menu WHERE menu_id={$panel['menu_id']} LIMIT 1");
                 if (isset($menu['link']) && count(explode($menu['link'], $req->path())) > 1) {
                     include_once "module/" . $mod['filename'];
                 }
             }
         }
     }
 }
예제 #2
0
파일: config.php 프로젝트: dvgamer/dl-fs.v4
function ModuleLoad($panel)
{
    $database = new SyncDatabase();
    if ($panel = $database->Query("SELECT * FROM dl_panel WHERE panel='{$panel}' LIMIT 1;")) {
        foreach ($database->Query("SELECT * FROM dl_module WHERE panel_id={$panel['panel_id']} AND publisher=1 ORDER BY sorted ASC;") as $module) {
            if ($database->Query("SELECT COUNT(*) FROM dl_view WHERE menu_id={$GLOBALS['MENU']} AND module_id={$module['module_id']};") || !$database->Query("SELECT COUNT(*) FROM dl_view WHERE module_id={$module['module_id']};")) {
                if (file_exists('module/' . $module['name'] . '.php')) {
                    $config = array();
                    if (file_exists('module/' . $module['name'] . '.ini')) {
                        $loadConfig = parse_ini_file('module/' . $module['name'] . '.ini', true);
                        foreach ($loadConfig as $isGroupConfig) {
                            foreach ($isGroupConfig as $name => $value) {
                                $config[$name] = $value;
                            }
                        }
                    }
                    switch ($module['type']) {
                        case 1:
                            echo '<div id="module_' . $module['name'] . '"><div class="module_head">' . $module['title'] . '</div>';
                            echo '<div class="module_body">';
                            include_once 'module/' . $module['name'] . '.php';
                            echo '</div></div>';
                            break;
                        default:
                            include_once 'module/' . $module['name'] . '.php';
                            break;
                    }
                } else {
                    echo 'Not Found.';
                }
            } else {
            }
        }
    }
    return false;
}
예제 #3
0
          <td width="100" align="right"><strong><?php 
echo _PAYMENT_LIST_COST;
?>
</strong></td>
          <td width="100" align="right"><strong><?php 
echo _PAYMENT_LIST_CHARGE;
?>
</strong></td>
          <td width="100" align="right"><strong><?php 
echo _PAYMENT_LIST_TOTAL;
?>
</strong></td>
        </tr>
      </table>
      <?php 
$database = new SyncDatabase();
$colorRow = 1;
foreach ($database->Select('contract', array('canceled' => 0), 0) as $contract) {
    $object = $database->Value('object_rental', array('object_id' => $contract['object_id']), 0);
    $objectType = $database->Value('object_type', array('type_id' => $object['type_id']), 0);
    $listCustomer[$contract['cus_id']] = array();
    $listCustomer[$contract['cus_id']]['pay'] = 0;
    $listCustomer[$contract['cus_id']]['charge'] = 0;
    $listCustomer[$contract['cus_id']]['total'] = 0;
    $listCustomer[$contract['cus_id']]['list'] = 0;
    foreach ($database->Select('customer', array('cus_id' => $contract['cus_id']), 0) as $customer) {
        foreach ($database->Select('payment', array('contract_id' => $contract['contract_id'], 'paid' => 0), 0) as $payment) {
            $listCustomer[$customer['cus_id']]['list']++;
            $listCustomer[$customer['cus_id']]['pay'] += $payment['amount'];
            $listCustomer[$customer['cus_id']]['charge'] += $payment['charge'];
            $listCustomer[$customer['cus_id']]['total'] += $payment['amount'] + $payment['charge'];
예제 #4
0
<?php

include "../libs/SyncDatabase.php";
$base = new SyncDatabase();
$table = null;
$PAGE = 1;
if (isset($_POST['page'])) {
    $PAGE = $_POST['page'];
}
$MAX = 12;
$ROW = $PAGE * $MAX;
if ($_POST['category_id'] == 0) {
    $count = $base->Query("SELECT COUNT(*) FROM product WHERE visible = 1;");
    $table = $base->Query("SELECT product_id, name_en, name_th, price, size, image_path FROM product WHERE visible = 1 ORDER BY name_en ASC LIMIT {$ROW}, {$MAX};");
} else {
    $count = $base->Query("SELECT COUNT(*) FROM product WHERE visible = 1 AND category_id = " . $_POST['category_id'] . ";");
    $table = $base->Query("SELECT product_id, name_en, name_th, price, size, image_path FROM product WHERE visible = 1 AND category_id = " . $_POST['category_id'] . " ORDER BY name_en ASC LIMIT {$ROW}, {$MAX};");
}
?>

<table cellpadding="4" cellspacing="15" border="0" width="100%">
<?php 
$loop = 1;
foreach ($table as $dRow) {
    if ($loop % 2 !== 0) {
        echo '<tr>';
    }
    ?>
    <td style="padding-bottom:5px;">
      <table cellpadding="4" cellspacing="0" border="0" width="100%">
        <tr>
		success: function(data) {
			$('#pay_' + tid).html(data.text);
		},
	});
}
</script>
<table width="550" border="0" cellspacing="0" cellpadding="3" style="background-color:#E6E6E6;margin:5px 0 2px 0;">
  <tr>
    <td width="20" align="right">&nbsp;</td>
    <td width="170"><strong>ผู้จอง</strong></td>
    <td width="120" align="center"><strong>ธนาคารที่ชำระเงิน</strong></td>
    <td width="120" align="center"><strong>ข้อมูลการยืนยัน</strong></td>
    <td width="100" align="center"><strong>แก้ไขสถานะ</strong></td>
  </tr>
</table><?php 
$database = new SyncDatabase();
foreach ($database->Query("SELECT * FROM ticket ORDER BY pay,date ASC;") as $ticket) {
    $payBank = $database->Query("SELECT * FROM bank_pay WHERE ticket_id={$ticket['ticket_id']} LIMIT 1;");
    if ($payBank) {
        $accountBank = $database->Query("SELECT * FROM bank_account WHERE bank_id={$payBank['bank_id']} LIMIT 1;");
    }
    ?>
<table width="550" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td width="20" align="right"><strong><a onclick="genListTicket(<?php 
    echo $ticket['ticket_id'];
    ?>
);" style="color:#060">รายการ</a></strong></td>
    <td width="150"><strong><?php 
    $user = $database->Query("SELECT * FROM user WHERE user_id={$ticket['user_id']} LIMIT 1;");
    echo $user['fullname'];
예제 #6
0
<?php

$database = new SyncDatabase();
if (!isset($_GET['action'])) {
    $_GET['action'] = '';
}
if ($_GET['action'] == 'pay') {
    if (isset($_GET['id'])) {
        $database->Update('payment', array('paid' => 1), array('pay_id' => $_GET['id']));
        header("Location:?pay=ment");
        exit;
    } elseif (isset($_GET['customer'])) {
        foreach ($database->Select('contract', array('cus_id' => $_GET['customer']), 0) as $contract) {
            $database->Update('payment', array('paid' => 1), array('contract_id' => $contract['contract_id']));
        }
        header("Location:?pay=ment");
        exit;
    }
} else {
    if (isset($_GET['customer'])) {
        $customer = $database->Value('customer', array('cus_id' => $_GET['customer']), 0);
        $listCustomer['pay'] = 0;
        $listCustomer['charge'] = 0;
        $listCustomer['total'] = 0;
        foreach ($database->Select('contract', array('cus_id' => $customer['cus_id']), 0) as $contract) {
            foreach ($database->Select('payment', array('contract_id' => $contract['contract_id'], 'paid' => 0), 0) as $payment) {
                $listCustomer['pay'] += $payment['amount'];
                $listCustomer['charge'] += $payment['charge'];
                $listCustomer['total'] += $payment['amount'] + $payment['charge'];
            }
        }
예제 #7
0
<?php

$data = array('error' => true, 'message' => 'Save billing successful.', 'billing' => NULL, 'detail' => NULL);
try {
    include "../../libs/SyncDatabase.php";
    $base = new SyncDatabase();
    if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
        throw new Exception('HTTP_X_REQUESTED_WITH ');
    }
    switch ($_POST['action']) {
        case 'GET':
            $data['billing'] = $base->Query("SELECT * FROM billing WHERE billing_id = {$_POST['billing_id']}");
            $data['detail'] = $base->Query("SELECT * FROM billing_detail WHERE billing_id = {$_POST['billing_id']}");
            break;
        case 'SAVE':
            $bill = json_decode($_POST['bill']);
            $base->Query("UPDATE billing SET status = '{$_POST['status']}' WHERE billing_id = {$bill->billing_id} ");
            $base->Query("DELETE FROM billing_detail WHERE billing_id = {$bill->billing_id} ");
            $store = json_decode($_POST['store']);
            foreach ($store as $item) {
                $sqlquery = 'INSERT INTO billing_detail (billing_id,product_id,description,price,qty) VALUES ';
                $sqlquery .= "({$bill->billing_id}, {$item->id}, '{$item->name}', {$item->price}, {$item->qty});";
                $base->Query($sqlquery);
            }
            break;
    }
    $data['error'] = false;
} catch (Exception $e) {
    $data['message'] = $e->getMessage();
}
echo json_encode($data);
예제 #8
0
<?php

$database = new SyncDatabase();
$vaildLogin = 0;
$imageUser = '******';
if ($database->Select('employee', array('username' => $_POST['user_vaild']), 0)) {
    if ($database->Select('employee', array('username' => $_POST['user_vaild'], 'password' => $_POST['pass_vaild']), 0)) {
        $vaildLogin = 1;
        $error = '<strong>MD5: </strong>' . md5($_POST['user_vaild']);
    } else {
        $vaildLogin = 2;
        $error = _SUBMIT_FAIL_PASS;
    }
    foreach ($database->Select('employee', array('username' => $_POST['user_vaild']), 0) as $user) {
        if ($user['picture'] != NULL) {
            $imageUser = '******' . $user['picture'] . '" width="110" height="128" border="0" />';
        }
    }
} else {
    $vaildLogin = 0;
    $error = _SUBMIT_FAIL_USER;
}
echo json_encode(array('error' => $error, 'vaild' => $vaildLogin, 'image' => $imageUser));
<?php

$database = new SyncDatabase();
$database->Query("DELETE FROM ticket_list WHERE list_id={$_REQUEST['list_id']};");
if (!$database->Query("SELECT COUNT(*) FROM ticket_list WHERE ticket_id={$_REQUEST['ticket_id']};")) {
    $database->Query("DELETE FROM ticket WHERE ticket_id={$_REQUEST['ticket_id']};");
}
echo json_encode(array());
예제 #10
0
	$('#head_add').html('เพิ่มเส้นทาง');
	$.ajax({ url: 'index.php?ajax=path_view',
		data: ({ }),
		dataType: "html",
		error: function() {	alert("Error: path_path_editview"); },
		success: function(data) {
			$('#edit_listpath').html(data);
			$('#path_id').val('0');
			$('#travel_id').val('0');
		},
	});
}
</script>

<?php 
$database = new SyncDatabase();
?>
<table width="550" border="0" cellspacing="0" cellpadding="3" style="background-color:#E6E6E6;margin:5px 0 2px 0;">
  <tr>
    <td width="80" align="center"><strong>เลขทะเบียนรถ</strong></td>
    <td width="150"><strong>ต้นทาง</strong></td>
    <td width="150"><strong>ปลายทาง</strong></td>
    <td width="100" align="center"><strong>ราคา</strong></td>
    <td width="70" align="center">&nbsp;</td>
  </tr>
</table><?php 
foreach ($database->Query("SELECT * FROM travel;") as $travel) {
    $path = $database->Query("SELECT * FROM path WHERE path_id={$travel['path_id']} LIMIT 1");
    $beginPath = $database->Query("SELECT * FROM place WHERE place_id={$path['begin_id']} LIMIT 1");
    $endPath = $database->Query("SELECT * FROM place WHERE place_id={$path['finish_id']} LIMIT 1");
    $car = $database->Query("SELECT * FROM car WHERE car_id={$travel['car_id']} LIMIT 1");
예제 #11
0
<?php

$database = new SyncDatabase();
?>
<div align="right" id="event_main">
<input type="button" id="action_add" class="button" value=" " title="<?php 
echo _IMAGE_TAG_ADD;
?>
" />
<input type="button" id="action_remove" class="button" value=" " title="<?php 
echo _IMAGE_TAG_REMOVE;
?>
" />
</div>
<div align="right" id="event_del" style="display:none;">
<input type="button" id="action_del" class="button" value=" " title="<?php 
echo _IMAGE_TAG_DEL;
?>
" disabled="disabled" />
<input type="button" id="action_back" class="button" value=" " title="<?php 
echo _IMAGE_TAG_BACK;
?>
" />
</div>
<br /><div align="left"><h1><?php 
echo _HEAD_LIST_OBJECT;
?>
</h1></div>
<table align="left" width="100%" border="0" cellspacing="0" cellpadding="0" style="border-top:#999 dashed 1px;">
 <tr>
  <td valign="top" width="230" style="border-right:#666 solid 2px;">
예제 #12
0
<?php

$control = new Session();
$database = new SyncDatabase();
$monList = array(_January, _February, _March, _April, _Mays, _June, _July, _August, _September, _October, _November, _December);
foreach ($database->Select('object_type', 0, 0) as $type) {
    $listType[$type['type_id']] = array();
    $listSignup[$type['type_id']] = array();
    $listExpire[$type['type_id']] = array();
    foreach ($database->Select('object_rental', array('type_id' => $type['type_id']), 0) as $object) {
        foreach ($database->Select('contract', array('object_id' => $object['object_id']), 0) as $contract) {
            // signup_date
            if ($contract['canceled'] == 0) {
                $date = getdate($contract['signup_date']);
                $found = false;
                foreach ($listSignup[$type['type_id']] as $list) {
                    if ($list == $monList[$date['mon'] - 1] . ' ' . ($date['year'] + 543)) {
                        $found = true;
                    }
                }
                if (!$found) {
                    $listSignup[$type['type_id']][$date['mon'] . '-' . $date['year']] = $monList[$date['mon'] - 1] . ' ' . ($date['year'] + 543);
                }
            }
            // cancel_date
            if ($contract['canceled'] == 1) {
                $date = getdate($contract['cancel_date']);
                $found = false;
                foreach ($listExpire[$type['type_id']] as $list) {
                    if ($list == $monList[$date['mon'] - 1] . ' ' . ($date['year'] + 543)) {
                        $found = true;
예제 #13
0
<?php

$data = array('error' => true, 'message' => 'Save billing successful.');
try {
    include "../libs/SyncDatabase.php";
    $base = new SyncDatabase();
    if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
        throw new Exception('HTTP_X_REQUESTED_WITH ');
    }
    $title = $_POST['title'];
    $des = $_POST['des'];
    $base->Query("UPDATE contents SET description='{$des}' WHERE title_id = '{$title}';");
    $data['error'] = false;
} catch (Exception $e) {
    $data['message'] = $e->getMessage();
}
echo json_encode($data);
예제 #14
0
<?php

include "../libs/SyncDatabase.php";
$base = new SyncDatabase();
?>
<script>
$(function(){
	$.fn.extend({
		CATEGORY_CHANGE : function(id, page){
			if(page == undefined) {
				$('div.list-group-item').removeClass('active');
				$(this).addClass('active');
				Touno.Storage('SHOP', id);
				location.hash = 'shop-' + id;
			}
			$.ajax({
				url: 'action/product_by_cate.php',
				data: { category_id: id, page: (page == undefined ? 1 : page) },
				type: 'POST',
				dataType:"HTML",
				error: function(e,s,r){ alert(e); },
				success: function(data){ $('#product-list').html(data); },	
			});
			
			
		}
	});
	var shop = /#shop-(.*)/g.exec(location.hash) == null ? 0 : /#shop-(.*)/g.exec(location.hash)[1];
	$('div.cate-list[hash="' + shop + '"]').CATEGORY_CHANGE(shop);
	
	
예제 #15
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php 
require "cgi-bin/SyncMySQL.php";
require "cgi-bin/ConfigSite.php";
?>
<body>
<?php 
$database = new SyncDatabase();
foreach ($database->Query("SELECT * FROM ticket;") as $ticket) {
    echo 'User:'******'user_id'];
    echo '<br/>';
    foreach ($database->Query("SELECT * FROM ticket_list WHERE ticket_id={$ticket['ticket_id']};") as $list) {
        $date = ThaiDate::Full($list['traveldate']);
        echo '-' . $date;
        echo '<br/>';
    }
}
?>
</body>
</html>
예제 #16
0
<?php

if (isset($_GET['action']) && isset($_POST['register_apply'])) {
    $database = new SyncDatabase();
    if (!$database->Select('customer', array('idcard' => $_REQUEST['regis_idcard']), 0)) {
        $newCustomer = array('regis_date' => $_SERVER['REQUEST_TIME'], 'fullname' => $_REQUEST['regis_fullname'], 'address' => $_REQUEST['regis_address'], 'idcard' => $_REQUEST['regis_idcard'], 'telephone' => $_REQUEST['regis_telephone'], 'job' => $_REQUEST['regis_job']);
        $database->Insert('customer', $newCustomer);
    }
    ?>
<table width="100%" cellpadding="5" cellspacing="0" border="0">
    <tr>
      <td width="180" align="center" valign="top" style="border-right:#CCC dashed 1px;">
       <input type="button" name="register_edit" id="register_edit" value=" " title="<?php 
    echo _IMAGE_TAG_EDIT;
    ?>
"  />
       <input type="button" name="register_success" id="register_success" value=" " title="<?php 
    echo _IMAGE_TAG_SUBMIT;
    ?>
" />
      </td>
      <td align="left" valign="top">
       <h4><?php 
    echo _REGISTER_CUSTOMER_ADD;
    ?>
</h4>
        <table border="0" cellspacing="0" cellpadding="3">
          <tr>
            <td align="right" valign="top">&nbsp;</td>
            <td align="left" valign="top">&nbsp;</td>
          </tr>
예제 #17
0
echo _REGISTER_FULLNAME;
?>
</strong></td>
          <td width="350" align="left"><strong><?php 
echo _REGISTER_ADDRESS;
?>
</strong></td>
          <td width="85" align="left"><strong><?php 
echo _REGISTER_TELEPHONE;
?>
</strong></td>
          <td width="20" align="center">&nbsp;</td>
        </tr>
      </table>
      <?php 
$database = new SyncDatabase();
$colorRow = 1;
foreach ($database->Select('employee', 0, 0) as $user) {
    if ($colorRow % 2 == 0) {
        $style = 'style="background-color:#F7F7F7"';
    } else {
        $style = '';
    }
    echo '<a href="?employee=edit&username='******'username'] . '">';
    echo '<table align="left" width="100%" border="0" cellspacing="0" cellpadding="3" id="user_' . $user['emp_id'] . '" ' . $style . '>';
    echo '<tr style="height:30px" class="list-select">';
    echo '<td align="center"><div style="width:35px;" id="img_' . $user['emp_id'] . '">' . $colorRow . '</div></td>';
    echo '<td align="center"><div style="width:5px;" id="id' . $user['emp_id'] . '"></div></td>';
    echo '<td align="left"><div style="width:90px;">' . $user['username'] . '</div></td>';
    echo '<td align="left"><div style="width:120px;"><strong>' . $user['emp_name'] . '</strong></div></td>';
    echo '<td align="left"><div style="width:350px;word-wrap:break-word;">' . $user['address'] . '</div></td>';
예제 #18
0
<?php

session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AOT Extented - จัดการข้อสอบ</title>
<link rel="stylesheet" type="text/css" href="style_add.css"/>
<script src="plugins/jQuery.min.js" language="javascript"></script>
<?php 
require_once 'plugins/connect.mysql.php';
$database = new SyncDatabase();
$isTime = time() - 3600;
/////////////////////////////////////////////
/////////////////////////////////////////////
$idUser = 23;
// Vars User Login ID
/////////////////////////////////////////////
/////////////////////////////////////////////
?>
<script language="javascript">
var monthThai = ['<?php 
echo _January;
?>
', '<?php 
echo _February;
?>
', '<?php 
echo _March;
예제 #19
0
<?php

require_once 'plugins/connect.mysql.php';
$database = new SyncDatabase();
if ($_REQUEST['ans_show'] == 'change') {
    $database->Query("UPDATE exam SET show_ans={$_REQUEST['show']} WHERE exam_id={$_REQUEST['id']};");
}
if ($_REQUEST['update'] == 'exam') {
    sleep(1);
    $result = $database->Query("UPDATE exam SET unit_id={$_REQUEST['unitid']}, start_date={$_REQUEST['started']}, finish_date={$_REQUEST['finished']}, type='{$_REQUEST['type']}' WHERE exam_id={$_REQUEST['id']};");
    echo json_encode(array('success' => $result));
} elseif ($_REQUEST['update'] == 'quest') {
    $result = $database->Query("UPDATE exam_question SET question='{$_REQUEST['text']}' WHERE question_id={$_REQUEST['id']};");
    echo json_encode(array('success' => $result));
} elseif ($_REQUEST['update'] == 'radio') {
    $result = $database->Query("UPDATE exam_question SET answer_id={$_REQUEST['text']} WHERE question_id={$_REQUEST['id']};");
    echo json_encode(array('success' => $result));
} elseif ($_REQUEST['update'] == 'ans') {
    $result = $database->Query("UPDATE exam_answer SET ans_text='{$_REQUEST['text']}' WHERE answer_id={$_REQUEST['id']};");
    echo json_encode(array('success' => $result));
}
if ($_REQUEST['created'] == 'exam') {
    sleep(1);
    $showAnswer = 0;
    if ($_REQUEST['type'] == 'T') {
        $showAnswer = 1;
    }
    $exam_id = $database->Query("INSERT INTO exam (unit_id, start_date, finish_date, show_ans, type) VALUES ({$_REQUEST['unitid']}, {$_REQUEST['started']}, {$_REQUEST['finished']}, {$showAnswer}, '{$_REQUEST['type']}');");
    for ($qloop = 0; $qloop < 10; $qloop++) {
        $question_id = $database->Query("INSERT INTO exam_question (exam_id) VALUES ({$exam_id});");
        for ($aloop = 0; $aloop < 4; $aloop++) {
예제 #20
0
');
				} else {
					isRegister = 0;
					isUsername = 0;
					$('#login_welcome').html(data.text);
					$('#register_error').empty();
					navChangeModule(null, 'frontpage');
				}
			},
		});			
	});
});
</script>
<?php 
$session = new Session();
$database = new SyncDatabase();
$user = $database->Query("SELECT * FROM user WHERE user_id={$_COOKIE['USER']} LIMIT 1;");
?>
<h3>แก้ไขข้อมูลผู้ใช้</h3>
<div style="margin:5px 20px 10px 20px;">
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td align="left" width="25%">&nbsp;</td>
      <td align="left" width="40%">&nbsp;</td>
      <td align="left" width="35%">&nbsp;</td>
    </tr>
    <tr>
      <td align="right"><?php 
echo _REGISTER_USERNAME;
?>
:</td>
예제 #21
0
<?php

$database = new SyncDatabase();
$contract = $database->Value('contract', array('contract_id' => $_GET['id']), 0);
if (!isset($_GET['action'])) {
    $_GET['action'] = '';
}
if ($_GET['action'] == 'confirm') {
    $editContract = array('cancel_date' => $_REQUEST['timestamp']);
    $database->Update('contract', $editContract, array('contract_id' => $_GET['id']));
    ?>
<script>
$(document).ready(function() {
	$(this).href('contract=edit&id=<?php 
    echo $_GET['id'];
    ?>
');
});
</script><?php 
} elseif ($_GET['action'] == 'canceled') {
    $isToday = getdate(time());
    ?>
<form name="canceled" method="post" action="?contract=edit&id=<?php 
    echo $_GET['id'];
    ?>
&action=confirm">
<table width="100%" cellpadding="5" cellspacing="0" border="0">
    <tr>
      <td width="180" align="center" valign="top" style="border-right:#CCC dashed 1px;">
       <input type="submit" name="register_save" id="register_save" value=" " title="<?php 
    echo _IMAGE_TAG_SAVE;
예제 #22
0
		$(e).prop('disabled', true);
	}
	function Logout(){
		if(confirm("your want to logout?")){
			document.cookie = 'ACCESS=; expires=Thu, 01 Jan 1970 00:00:01 GM; path=/';
			location.href = "/";
		}
	}

</script>
</head>
<body>
<?php 
include "../libs/SyncDatabase.php";
include "../libs/Session.php";
$base = new SyncDatabase();
$cookie = new Session();
?>
<div class="panel-menu">
  <div class="container">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td><li item="home">HOME</li>
          <li item="shop">PRODUCT</li>
          <li item="about">ABOUT US</li>
          <li item="contact">CONTACT US</li></td>
        <td></td>
      </tr>
    </table>
  </div>
</div>
예제 #23
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style_add.css"/>
<link rel="stylesheet" type="text/css" href="calendar/calendar_css.css"/>
<script src="plugins/jquery.min.js" language="javascript"></script>
<script src="plugins/jquery.fn.js" language="javascript"></script>
<title><?php 
echo $_REQUEST['title'];
?>
</title>
</head>
<?php 
require_once 'plugins/connect.mysql.php';
$database = new SyncDatabase();
$choiceAnswer = array('ก', 'ข', 'ค', 'ง');
$user = $database->Query("SELECT * FROM member WHERE member_id={$_REQUEST['userid']} LIMIT 1;");
?>
<body>
<h3>ผู้ทำแบบทดสอบคือ 
<?php 
if ($user['sex'] == 'F') {
    echo 'นางสาว';
} else {
    echo 'นาย';
}
echo $user['firstname'] . ' ' . $user['lastname'];
?>
</h3>
<?php 
예제 #24
0
	$('#yes_order').click(function(){
		$.ajax({ url: '?ajax=ticket_verify',
			dataType: "html",
			error: function() {	alert("Error: Yes ticket_verify"); },
			success: function(data) {
				$('#verify_order').html(data);
			},
		});
	});
	$('#no_order').click(function(){
		$('#verify_order').html('');
	});
});	
</script>
<?php 
$database = new SyncDatabase();
if ($database->Query("SELECT * FROM old_list WHERE user_id={$_COOKIE['USER']} AND view=1;")) {
    $nowTime = time();
    $isFare = 0;
    foreach ($database->Query("SELECT * FROM old_list WHERE user_id={$_COOKIE['USER']} AND view=1;") as $list) {
        $travel = $database->Query("SELECT * FROM travel WHERE travel_id={$list['travel_id']} LIMIT 1;");
        $isFare += $travel['fare'];
    }
    ?>
<table align="center" width="510" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td width="255" align="center">&nbsp;</td>
    <td width="255" align="left"><strong>ยอดเงินที่คุณต้องชำระเงินทั้งสิ้น <?php 
    echo $isFare;
    ?>
 บาท</strong></td>
예제 #25
0
			type: 'POST',
			dataType:"HTML",
			error: function(){ alert('fail.'); },
			success: function(data){ alert(data); $('#btnSend').prop('disable', false); }	
		});
	}

</script>
<p>
<input id="btnEditor" onclick="toggleEditor();" class="btn btn-primary" type="button" value="Editor">
<input id="btnCancel" onclick="toggleEditor(true);" class="btn" type="button" value="Cancel" style="display:none;">
</p>

<?php 
include "../libs/SyncDatabase.php";
$base = new SyncDatabase();
$home = $base->Query("SELECT title, description FROM contents WHERE title_id='contact'");
?>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="50%" valign="top">
        <h2><?php 
echo $home[0]['title'];
?>
</h2>
		<div id="contents">
			<?php 
echo $home[0]['description'];
?>
		</div>
<script>
function delTicketlist(ticket_id, list_id) {
	if(confirm("ต้องหารลบรายการนี้ใช่หรือไม่")) {
		$.ajax({ url: 'index.php?ajax=list_ticket',
			data: ({ ticket_id:ticket_id, list_id:list_id }),
			error: function() {	alert("Error: Ajax User Login"); },
			success: function(data) {
				chkTicketList();
			},
		});
	}
}
</script>
<?php 
$database = new SyncDatabase();
$isTicket = array();
foreach ($database->Query("SELECT * FROM ticket WHERE user_id={$_COOKIE['USER']};") as $ticket) {
    foreach ($database->Query("SELECT * FROM ticket_list WHERE ticket_id={$ticket['ticket_id']} AND traveldate={$_REQUEST['time']} ORDER BY seat;") as $list) {
        $foundTicket = array();
        $payBank = $database->Query("SELECT * FROM bank_pay WHERE ticket_id={$ticket['ticket_id']};");
        $foundTicket['pay'] = '<span style="color:#06F">ได้รับเงินแล้ว</span>';
        if ($ticket['pay'] == 0 && $payBank) {
            $foundTicket['pay'] = '<span style="color:#900">กำลังตรวจสอบ</span>';
        }
        if (!$payBank) {
            $foundTicket['pay'] = 'ยังไม่ได้ยืนยัน';
        }
        $travel = $database->Query("SELECT * FROM travel WHERE travel_id={$list['travel_id']} LIMIT 1;");
        $path = $database->Query("SELECT * FROM path WHERE path_id={$travel['path_id']} LIMIT 1;");
        $begin = $database->Query("SELECT * FROM place WHERE place_id={$path['begin_id']} LIMIT 1;");
        $begin_p = $database->Query("SELECT * FROM province WHERE province_id={$begin['province_id']} LIMIT 1;");
예제 #27
0
파일: main.php 프로젝트: dvgamer/dl-fs.v4
        include 'component/com_error/com_null.php';
    } else {
        ?>
			  <table id="height_page" width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                 <td colspan="2"><div class="nav_panel"><?php 
        ModuleLoad('nav');
        ?>
</div></td>
                </tr>
                <tr>
                  <td valign="top"><div class="body_panel"><?php 
        ModuleLoad('body');
        ?>
</div></td><?php 
        $database = new SyncDatabase();
        if ($database->query("SELECT COUNT(*) FROM dl_module WHERE panel_id=5 AND publisher=1 LIMIT 1;")) {
            ?>
                  <td class="right_panel" width="210"><?php 
            ModuleLoad('right');
            ?>
</td><?php 
        }
        ?>
                </tr>
                <tr>
                 <td class="asd" colspan="2" valign="bottom"><div class="credit_panel"><?php 
        ModuleLoad('support');
        ?>
</div></td>
                </tr>
예제 #28
0
}

function editCar(id, regis, limit,mark) 
{
	$('#head_add').html('แก้ไขข้อมูลรถ');
	$('#car_id').val(id);
	$('#regis').val(regis);
	$('#limit').val(limit);
	$('#mark').val(mark);
	$('#ticket_form').popupClose();
	$('#ticket_form').popupOpen();
	
}
</script>
<?php 
$database = new SyncDatabase();
?>
<table width="390" align="center" border="0" cellspacing="0" cellpadding="3" style="background-color:#E6E6E6;margin-top:5px;">
  <tr>
    <td width="60" align="center"><strong>ลำดับ</strong></td>
    <td width="150"><strong>เลขทะเบียนรถ</strong></td>
    <td width="50" align="center"><strong>ที่นั่ง</strong></td>
    <td width="30">&nbsp;</td>
    <td width="100">&nbsp;</td>
  </tr>
</table><?php 
foreach ($database->Query("SELECT * FROM car;") as $car) {
    ?>
<table width="390" align="center" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td width="60" align="center"><?php 
<?php

$database = new SyncDatabase();
$list_id = $database->Query("INSERT INTO province (province) VALUES ('{$_REQUEST['province']}');");
echo json_encode(array('id' => $list_id));
예제 #30
0
<?php

$database = new SyncDatabase();
$database->Query("DELETE FROM old_list WHERE old_id={$_REQUEST['old_id']};");