
LINEã§ã䜿ããã©ã³ãäºçŽéèš(webixã©ã€ãã©ãªã䜿ã£ãŠãç°¡åã«ãšã³ããªãšéçŽæ©èœãïŒNo.036
æ¬èšäºã¯ãæ©èœç޹ä»åŸã«ãäžéšãæ©èœè¿œå ãããŸãããNo.037ã®èšäºãåæã«é²èЧãã ããã
ã©ã³ãäºçŽéèšæ©èœãæ¹åïŒã¹ããæ©èœïŒNo.037ïœYamasan (note.com)
webixã©ã€ãã©ãªãšPHPã§äœãWebã¢ããªã®äºäŸç޹ä»ã§ããè€æ°äººã§ã©ã³ããããå Žåãäºåã«ã¡ãã¥ãŒãéçŽããŠãåºã«äºçŽãããå Žåãå¹¹äºã®äººã¯ãåå è
ã«é£çµ¡ãããªãããã¡ãã¥ãŒãèãå¿
èŠããããŸããããå
šå¡ãåãã¡ãã¥ãŒãªãåå 人æ°ã ãããã®ã§ãããåå¥ã®ã¡ãã¥ãŒããµã€ãã¡ãã¥ãŒéžæãããªã³ã¯éžæã倧çãæå®ãªã©ãå®éã«ã¯å²ãšè€éã§å€§å€ã§ãããã
ãŸããéäžã§å€æŽãšãªãå Žåãå€ããå¹¹äºã¯ãæ°ãä»ããŠç¢ºèªããªããšãåœæ¥ãå
容ãéã£ãŠããäºãæ°åãæªãããšããããŸãããã
ããã§ãä»åã¯ãLINEã§ã©ã³ããæ±ºããWebãµãŒãã¹ã®URLãé
åžããåèªã§ãšã³ããªããæ
å ±ãå¹¹äºã®äººã¯ãäžèŠ§è¡šã§ç¢ºèªãããããªãµãŒãã¹ã玹ä»ããŸããã©ã³ãã®ç»é²ã¯ãLINEã®ã¡ãã»ãŒãžããã®ãŸãŸã¯ãªãã¯ããŠã¹ããã§æäœããã€ã¡ãŒãžã§ãã
倿Žãããå Žåã¯ãå床ãç»é²ããŠããããã°ãäžæžãæŽæ°ã§å€æŽã§ããŸãã
LINEã§éç¥ããURLã«ã¢ã¯ã»ã¹ãããšä»¥äžã®ãããªãµã€ãã«ã¢ã¯ã»ã¹ã§ããŸãã

ãã®ç»é¢ã§ã¯ãåå è
ãšããŠç°äžãããéžæããç¶æ
ã®ç»é¢ã§ãã
ïŒåå ãã人ããèªåã§ååãéžæããŠãšã³ããªããæ¹æ³ã§ãïŒ
â»äºåã«åå äºå®ã®äººãããã£ãŠããåæã®ã¢ããªã«ããŠããŸãã
æ¬ åžã®äººã¯ãæ¬ åžãã¯ãªãã¯ããŸãããåå ã®äººã¯ããã¹ã¿ãã©ã³ãã»ããããã¶ããŸãã¯ãéžæãããã®æ¬¡ã®ç»é¢ã§è©³çްã¡ãã¥ãŒãéžæããæäœãšããŸããã
倧ããã«ããŽãªã決ããåå¥ã®ã¡ãã¥ãŒã§ãµã€ãã¡ãã¥ãŒãéžæããæåŸã«ããªã³ã¯ãéžæããæäœã§ãã
以äžããã¹ã¿ã»ãããã¯ãªãã¯ããäŸã§ãã

ãã¹ã¿ã¯6çš®é¡ããéžæããŸããã倧çãã«ãããå Žåã«ã¯ããã§ãã¯ãä»ããŠããããŸãã
ããŒããœãŒã¹ãéžæããããªã³ã¯ã¡ãã¥ãŒã«ç§»åãããšãã¯ä»¥äžã®ãããªç»é¢ã«ãªããŸãã

ããŒããœãŒã¹ã倧çãã§æå®ããŠããããšã1è¡ç®ã«è¡šç€ºãã
ããªã³ã¯ã¯ã7åã®äžããéžæããŸãã
ããªã³ã¯ãšããŠã³ãŒããŒãéžæãããšæçµç¢ºèªç»é¢ãšãªãã
ã»ããã¡ãã¥ãŒãšããªã³ã¯åã³ãåèšéé¡ã確èªããç»é²ãã¿ã³ãã¯ãªãã¯ããŸããããã倿Žãããå Žåã¯ãæ»ããã¿ã³ã§ãããªã³ã¯ãã»ããã¡ãã¥ãŒãšæåã«æ»ãããšãã§ããŸãã

ç»é²ããå Žåã¯ãç»é²ããŸããããšã¡ãã»ãŒãžãã§ãã®ã§ãæåŸã«éãããã¯ãªãã¯ããŠæäœã¯å®äºã§ãã
ãã³ããŒã°ãªã©ã®ã»ããã¡ãã¥ãŒã®å Žåã¯ã
ãµã€ãã¡ãã¥ãŒãšããŠã©ã€ã¹ããã³ãéžæããé
ç®ã远å ãã
ããã«ãã³ããŒã°ãéžæããããªã³ã¯éžæã«ç§»åããã

ããªã³ã¯éžæç»é¢ã®ãšãã1è¡ç®ã«ãã³ãéžæãããŠããããšã確èªã§ããŸãã

å¹¹äºã®äººã¯ãããœã³ã³ãªã©ã§ãåå è
ãéžæããã©ã³ãã®å
容ã確èªã§ããŸãã

å
šå¡ã®å
容ã確èªåŸã«ãEXCELåºåããŠãåºã«é£çµ¡ãããªã©ããã°ããã¹ãå°ãªããå¹ççã«äœæ¥ãã§ããŸãã
ä»åã®ãµãŒãã¹äºäŸã¯ãäž»ã«ïŒã€ã®æ©èœã§å®çŸããŠããŸãã
åå è
ãã¡ãã¥ãŒãéžæããç»é¢ãšDBãžç»é²ããPHPãµãŒãã¢ããª
å¹¹äºã®äººããç»é²ããæ
å ±ãäžèЧã§ç¢ºèªããïœç»é¢ãšæ€çŽ¢çšã®ïŒ°ïŒšïŒ°ãµãŒãã¢ããªã§ãã
å°ãããŒã¿ãä¿åããããã®ïŒ€ïŒ¢ããŒãã«ã¯å¿
èŠã§ãã
以äžã®URLæäœã§ãå®éã«åäœç¢ºèªã§ããŸãã
ç»é²ããã¡ã³ããŒã7åãªã®ã§ãä»ã®æ¹ãæäœãããšãäžæžãã§æ
å ±ã倿ŽãããŸãã®ã§ããèªèããŠç¢ºèªé¡ããŸãã
ãšã³ããªçšã®URLã¯ä»¥äžã®éãã§ããã¹ããããæäœå¯èœã§ãã
äžèŠ§è¡šã§ç¢ºèªããURLã¯ã以äžã®ãšããã§ãã
æ¬æ©èœãå®çŸããããã®ãœãŒã¹ã³ãŒãã§ãããäžéšã®ç°å¢èšå®æ
å ±ã¯å
¬éããŠããŸããã®ã§ãDBã¢ã¯ã»ã¹éšåã¯ãå®è£
ããŠãã ããã
ããŒãã«å®çŸ©meeting_lunchesã¯ã以äžã®ããã«å®çŸ©ããŸããã
CREATE TABLE `meeting_lunches` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id:èªåé£çª',
`subject` varchar(255) NOT NULL DEFAULT '' COMMENT 'äŒåå',
`dateinfo` date DEFAULT NULL COMMENT 'é嬿¥',
`username` varchar(255) NOT NULL DEFAULT '' COMMENT 'åå è
',
`main_type` varchar(255) NOT NULL DEFAULT '' COMMENT 'ã¡ãã¥ãŒçš®å¥',
`lunch_menu` varchar(255) NOT NULL DEFAULT '' COMMENT 'ã¡ãã¥ãŒ',
`drink_menu` varchar(255) NOT NULL DEFAULT '' COMMENT '飲ã¿ç©',
`main_plice` int(11) NOT NULL DEFAULT 0 COMMENT 'ã¡ã€ã³éé¡',
`option1_plice` int(11) NOT NULL DEFAULT 0 COMMENT '远å éé¡',
`total_plice` int(11) NOT NULL DEFAULT 0 COMMENT 'åèšéé¡',
`created_userid` varchar(16) NOT NULL DEFAULT 'admin' COMMENT 'äœæãŠãŒã¶',
`updated_userid` varchar(16) NOT NULL DEFAULT 'admin' COMMENT 'æŽæ°ãŠãŒã¶',
`created_on` datetime DEFAULT NULL COMMENT 'äœææ¥æ',
`updated_on` datetime DEFAULT NULL COMMENT 'æŽæ°æ¥æ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='äŒåã©ã³ã';ã©ã³ãéžæçšã®ç»é¢ãœãŒã¹ã§ããïŒJavascriptïŒ
LU0020_lunch_entry.php
<?php
//https://sunsun.sakura.ne.jp/webix01/view/LU0020/LU0020_lunch_entry.php?userid=admin
//======================================================================
//File Name : LU0020_lunch_entry.php
//Encoding : UTF-8
//Creation Date : 2024-06-10
//
//Copyright © 2024 sunsunfarm. All rights reserved.
//
//This source code or any portion thereof must not be
//reproduced or used in any manner whatsoever.
//======================================================================
$TITLE_INFO ="ã©ã³ãéžæ";
$VER_INFO ="V01L01";
define('ROOT_PATH','/home/sunsun/www/webix01'); //ãœãŒã¹ãä¿åããŠãããã¹ïŒåäœç°å¢ã«å¿ããŠèšè¿°ããå¿
èŠããïŒ
define('SUB_FOLDER','/webix01'); //ãµããã©ã«ããæå®ããURL
$myfilename = basename(__FILE__); //èªåèªèº«ã®ãã¡ã€ã«åååŸ
$userid = '';
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
if($_SERVER["REQUEST_METHOD"] != "GET"){
//GET以å€ã¯ã¯ãã
error_log($logheader.' REQUEST_METHOD no GET');
header("HTTP/1.0 404 Not Found");
return;
}
$error_flag = -1;
if(isset($_GET['userid'])){
$userid = $_GET['userid'];
$error_flag = 1;
}
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
include('../../commonlib/svr_common_lib_v3.php'); //
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<script src="/webix_GPL_1020/webix.js"></script>
<link href="/webix_GPL_1020/skins/compact.css?<?php echo date('Ymd-H'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo SUB_FOLDER; ?>/commonlib/webix_custom_css.css?<?php echo date('Ymd-H'); ?>" rel="stylesheet" type="text/css">
<link rel="icon" href="<?php echo SUB_FOLDER; ?>/image/webix_64.ico">
<script src="<?php echo SUB_FOLDER; ?>/commonlib/object-assign.js"></script>
<script src="<?php echo SUB_FOLDER; ?>/commonlib/moment-with-locales.js"></script>
<script src="<?php echo SUB_FOLDER; ?>/commonlib/webix_common_lib.js"></script>
<link rel="stylesheet" href="/webix_GPL_1020/css/materialdesignicons.min.css" type="text/css" charset="utf-8">
<style>
.mainLabel>.webix_el_box {
font-size: 16px;
font-weight:bold;
}
.subLabel>.webix_el_box {
font-size: 13px;
font-weight:bold;
background: #ffc0cb;
}
.bt_1 button.webix_button{
background: #396D9E;
color:#FFFFFF;
font-size: 18px;
}
.bt_2 button.webix_button{
background: #008080;
color:#FFFFFF;
border:1px solid #008080;;
font-size: 18px;
}
.bt_3 button.webix_button{
background: #ff7f50;
border:1px solid #ff7f50;
color:#FFFFFF;
font-size: 18px;
}
.bt_4 button.webix_button{
background: #808080;
border:1px solid #808080;
color:#FFFFFF;
font-size: 18px;
}
.bt_5 button.webix_button{
background: #c71585;
border:1px solid #c71585;
color:#FFFFFF;
font-size: 18px;
}
.bt_pasuta button.webix_button{
background: #396D9E;
color:#FFFFFF;
font-size: 12px;
}
.bt_drink button.webix_button{
background: #6495ed;
color:#FFFFFF;
font-size: 12px;
}
.bt_drinkh button.webix_button{
background: #800000;
color:#FFFFFF;
font-size: 12px;
}
.red .webix_el_box{
color: #ff0000;
}
.red .webix_control.webix_el_text{
color: #ff0000;
}
</style>
<title><?php echo $TITLE_INFO.' ('.$VER_INFO.')' ?></title>
</head>
<body>
<script type="text/javascript" charset="utf-8">
webix.i18n.setLocale("ja-JP");
<?php
include('../../commonlib/CM0030_sendprm_set_request.php'); //éä¿¡ãã©ã¡ãŒã¿æºå颿°(in:session_info,access_key out:send_prm)
?>
webix.ui.fullScreen();
var LU0020_meeting_date = "2024/06/30";
var LU0020_meeting_subject ="ã©ã³ãäŒ";
var LU0020_meeting_starttime = "12:00";
var LU0020_meeting_place = "ã€ã¿ãªã¢ã³ãããª";
var LU0020_username_array =[
"",
"ç°äž",
"é è€",
"æšæ",
"å±±æ¬",
"äŒè€",
"æ²³å",
"å±±ç°",
];
var LU0020_username = ""; //åå è
var LU0020_main_type = ""; //çš®å¥ã¡ãã¥ãŒ
var LU0020_lunch_menu = ""; //ã¡ã€ã³ã®ã»ããã¡ãã¥ãŒ
var LU0020_drink_menu = "";
var LU0020_back_view_id = "";
var LU0020_main_plice = 0;
var LU0020_option1_plice = 0;
var LU0020_total_plice = 0;
//ã©ã³ãã¡ãã¥ãŒãéããŠãããªã³ã¯ã¡ãã¥ãŒãéã
function set_lauch_and_next_drink(hide_view_id,show_view_id,lunch_menu){
LU0020_lunch_menu = lunch_menu+check_option1_chk();
$$("PastaView_menu_text").setValue(LU0020_lunch_menu);
$$("DrinkView_menu_text").setValue(LU0020_lunch_menu);
$$("tabbar").showOption(show_view_id);
$$("tabbar").hideOption(hide_view_id);
LU0020_back_view_id = hide_view_id;
}
function set_lauch_for_setmenu_and_next_drink(hide_view_id,show_view_id,lunch_menu){
LU0020_lunch_menu = lunch_menu+check_option2_chk();
$$("SetView_menu_text").setValue(LU0020_lunch_menu);
$$("DrinkView_menu_text").setValue(LU0020_lunch_menu);
$$("tabbar").showOption(show_view_id);
$$("tabbar").hideOption(hide_view_id);
LU0020_back_view_id = hide_view_id;
}
function set_lauch_for_piza_and_next_drink(hide_view_id,show_view_id,lunch_menu){
LU0020_lunch_menu = lunch_menu+check_option2_chk();
$$("PizaView_menu_text").setValue(LU0020_lunch_menu);
$$("DrinkView_menu_text").setValue(LU0020_lunch_menu);
$$("tabbar").showOption(show_view_id);
$$("tabbar").hideOption(hide_view_id);
LU0020_back_view_id = hide_view_id;
}
//ããªã³ã¯ã¡ãã¥ãŒãéããŠã確èªã¡ãã¥ãŒãéã
function set_drink_and_next_last_check(drink_menu){
LU0020_drink_menu = drink_menu;
$$("DrinkView_drink_text").setValue(LU0020_drink_menu);
$$("check_username").setValue(LU0020_username);
$$("check_main_text").setValue(LU0020_lunch_menu);
$$("check_drink_text").setValue(LU0020_drink_menu);
LU0020_total_plice=Number(LU0020_main_plice)+Number(LU0020_option1_plice);
$$("check_plice").setValue(LU0020_total_plice);
$$("tabbar").showOption("CheckView");
$$("tabbar").hideOption("DrinkView");
}
function check_username(){
LU0020_username = $$("username").getValue();
if(LU0020_username == ""){
webix.alert("åå è
ãã¯ãªãã¯<br>ããŠéžæããŠãã ããã");
return false;
}
else{
return true;
}
}
function check_option1_chk(){
if($$("option1").getValue()){
LU0020_option1_plice = 250;
return "+倧çã";
}
else{
LU0020_option1_plice = 0;
return "";
}
}
function check_option2_chk(){
if($$("option2").getValue() == 0){
LU0020_option1_plice = 0;
return "+ã©ã€ã¹";
}
else{
LU0020_option1_plice = 0;
return "+ãã³";
}
}
var LunchView_element =[
{ margin:5, cols:[
{ view:"label", label:"é嬿¥:"+LU0020_meeting_date+" "+LU0020_meeting_starttime+"ïœ ",width:300,css:"mainLabel"},
]},
{ margin:5, cols:[
{ view:"label", label:"å ŽæïŒ"+LU0020_meeting_place ,width:300,css:"mainLabel"},
]},
{ margin:5, cols:[
{ view:"select", label:"åå è
",options:LU0020_username_array,id:"username",name:"username",value:"",css:"mainLabel",width:200,labelWidth:80},
]},
{ cols:[
{ view:"label",value:"" ,width:350,id:"LunchView_menu_text",name:"LunchView_menu_text"},
]},
{ margin:5, cols:[
{ view:"label", label:"以äžã®ïŒã€ã®äžããéžæããŠãã ãã" ,width:300,css:"mainLabel"},
]},
{ margin:5, cols:[
{ view:"button", label:"ãã¹ã¿ã»ãã" , type:"form" ,width:150,css:"bt_1",height:50,
click:function(){
LU0020_main_type = "ãã¹ã¿ã»ãã";
$$("LunchView_menu_text").setValue(LU0020_main_type);
$$("SetView_menu_text").setValue("");
$$("PizaView_menu_text").setValue("");
if(!check_username()) return;
$$("tabbar").showOption("PastaView");
$$("tabbar").hideOption("LunchView");
}
},
]},
{ margin:5, cols:[
{view:"button", label:"ã©ã³ãã»ãã" , type:"form" ,width:150,css:"bt_2",height:50,
click:function(){
LU0020_main_type = "ã©ã³ãã»ãã";
$$("LunchView_menu_text").setValue(LU0020_main_type);
$$("PastaView_menu_text").setValue("");
$$("PizaView_menu_text").setValue("");
if(!check_username()) return;
$$("tabbar").showOption("SetView");
$$("tabbar").hideOption("LunchView");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ãã¶ã»ãã" , type:"form" ,width:150,css:"bt_3",height:50,
click:function(){
LU0020_main_type = "ãã¶ã»ãã";
$$("LunchView_menu_text").setValue(LU0020_main_type);
$$("PastaView_menu_text").setValue("");
$$("SetView_menu_text").setValue("");
if(!check_username()) return;
$$("tabbar").showOption("PizaView");
$$("tabbar").hideOption("LunchView");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"æ¬ åž" , type:"form" ,width:150,css:"bt_5",height:50,
click:function(){
LU0020_main_type = "æ¬ åž";
$$("LunchView_menu_text").setValue(LU0020_main_type);
$$("PastaView_menu_text").setValue("");
$$("SetView_menu_text").setValue("");
$$("PizaView_menu_text").setValue("");
$$("DrinkView_menu_text").setValue("");
$$("DrinkView_drink_text").setValue("");
LU0020_drink_menu = "";
$$("check_main_text").setValue("æ¬ åž");
$$("check_drink_text").setValue("");
LU0020_main_plice = 0;
LU0020_option1_plice = 0;
LU0020_total_plice = 0;
$$("check_plice").setValue(LU0020_total_plice);
if(!check_username()) return;
$$("check_username").setValue(LU0020_username);
$$("tabbar").showOption("CheckView");
$$("tabbar").hideOption("LunchView");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"éãã" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
location.href = 'https://www.google.com/?hl=ja';
}
},
{ view:"button", label:"次ãž" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
if(LU0020_main_type != ""){
if(LU0020_main_type == "ãã¹ã¿ã»ãã"){
$$("tabbar").showOption("PastaView");
}
else if(LU0020_main_type == "ã©ã³ãã»ãã"){
$("tabbar").showOption("SetView");
}
else if(LU0020_main_type == "ãã¶ã»ãã"){
$$("tabbar").showOption("PizaView");
}
else if(LU0020_main_type == "æ¬ åž"){
$$("tabbar").showOption("CheckView");
}
$$("tabbar").hideOption("LunchView");
}
else{
webix.alert("ã»ããã®æå®ãå
ã«ããŠãã ããã");
return;
}
}
}
]}
];
var PastaView_element =[
{ cols:[
{ view:"label",value:"" ,width:350,id:"PastaView_menu_text",name:"PastaView_menu_text"},
]},
{ margin:5, cols:[
{ view:"label", label:"以äžã®ïŒã€ã®äžããéžæããŠãã ãã" ,width:300,css:"mainLabel" },
]},
{ margin:5, cols:[
{ view:"checkbox", id:"option1", labelRight:"倧çãåžæ+250åãªããã§ãã¯ããŠãã ãã", value:0,css:"subLabel",labelWidth:20 }
]},
{ margin:5, cols:[
{ view:"button", label:"ããŒã³ã³ãšã¢ããã£ã¬ã©ã®ããããœãŒã¹" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1500;
set_lauch_and_next_drink("PastaView","DrinkView","ããŒã³ã³ãšã¢ããã£ã¬ã©ã®ããããœãŒã¹");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ããžã«ãœãŒã¹" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1500;
set_lauch_and_next_drink("PastaView","DrinkView","ããžã«ãœãŒã¹");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ãããªã¿ã³æž©çæ·»ã" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1460;
set_lauch_and_next_drink("PastaView","DrinkView","ãããªã¿ã³æž©çæ·»ã");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ããŒããœãŒã¹" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1560;
set_lauch_and_next_drink("PastaView","DrinkView","ããŒããœãŒã¹");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"æå€ªåã®ã¯ãªãŒã ãœãŒã¹" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1500;
set_lauch_and_next_drink("PastaView","DrinkView","æå€ªåã®ã¯ãªãŒã ãœãŒã¹");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ã«ã«ãããŒã©" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1600;
set_lauch_and_next_drink("PastaView","DrinkView","ã«ã«ãããŒã©");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"æ»ã" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
$$("tabbar").showOption("LunchView");
$$("tabbar").hideOption("PastaView");
}
},
{ view:"button", label:"次ãž" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
if(LU0020_lunch_menu != ""){
$$("tabbar").showOption("DrinkView");
$$("tabbar").hideOption("PastaView");
}
else{
webix.alert("ãã¹ã¿ã®æå®ãå
ã«ããŠãã ããã");
return;
}
}
},
]}
];
var SetView_element =[
{ cols:[
{ view:"label",value:"" ,width:350,id:"SetView_menu_text",name:"SetView_menu_text"},
]},
{ margin:5, cols:[
{ view:"label", label:"以äžã®ïŒã€ã®äžããéžæããŠãã ãã" ,width:300,css:"mainLabel" },
]},
{ margin:5, cols:[
{ view:"label", label:"ãã³ãã©ã€ã¹ãéžæããŠãã ãã" ,width:300,css:"red" },
]},
{ margin:5, cols:[
{ view: "switch", onLabel: "ãã³", offLabel:"ã©ã€ã¹", value: 0 ,id:"option2" , label:"ãã³/ã©ã€ã¹",labelWidth:80},
]},
{ margin:5, cols:[
{ view:"button", label:"ãã³ããŒã°ãããå颚ãœãŒã¹" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1450;
set_lauch_for_setmenu_and_next_drink("SetView","DrinkView","ãã³ããŒã°ãããå颚ãœãŒã¹");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ããã«ãã³ããŒã°" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1600;
set_lauch_for_setmenu_and_next_drink("SetView","DrinkView","ããã«ãã³ããŒã°");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ç¶²çŒããµãŒãã€ã³ã¹ããŒã90g" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 2000;
set_lauch_for_setmenu_and_next_drink("SetView","DrinkView","ãµãŒãã€ã³ã¹ããŒã90g");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"çèã®èµ€ã¯ã€ã³ç
®èŸŒã¿" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1800;
set_lauch_for_setmenu_and_next_drink("SetView","DrinkView","çèã®èµ€ã¯ã€ã³ç
®èŸŒã¿");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"æ»ã" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
$$("tabbar").showOption("LunchView");
$$("tabbar").hideOption("SetView");
}
},
{ view:"button", label:"次ãž" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
if(LU0020_lunch_menu != ""){
$$("tabbar").showOption("DrinkView");
$$("tabbar").hideOption("SetView");
}
else{
webix.alert("ã»ããã®æå®ãå
ã«ããŠãã ããã");
return;
}
}
},
]}
];
var PizaView_element =[
{ cols:[
{ view:"label",value:"" ,width:350,id:"PizaView_menu_text",name:"PizaView_menu_text"},
]},
{ margin:5, cols:[
{ view:"label", label:"以äžã®ïŒã€ã®äžããéžæããŠãã ãã" ,width:300,css:"mainLabel" },
]},
{ margin:5, cols:[
{ view:"button", label:"ãã«ã²ãªãŒã¿" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1300;
LU0020_option1_plice = 0;
set_lauch_for_piza_and_next_drink("PizaView","DrinkView","ãã«ã²ãªãŒã¿");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"3çš®ããŒãºãã¶" , type:"form" ,width:300,css:"bt_pasuta",height:50,
click:function(){
LU0020_main_plice = 1300;
LU0020_option1_plice = 0;
set_lauch_for_piza_and_next_drink("PizaView","DrinkView","3çš®ããŒãºãã¶");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"æ»ã" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
$$("tabbar").showOption("LunchView");
$$("tabbar").hideOption("PizaView");
}
},
{ view:"button", label:"次ãž" ,width:150,height:50,css:"bt_4",height:50,
click:function(){
if(LU0020_lunch_menu != ""){
$$("tabbar").showOption("DrinkView");
$$("tabbar").hideOption("PizaView");
}
else{
webix.alert("ãã¶ã®æå®ãå
ã«ããŠãã ããã");
return;
}
}
},
]}
];
var DrinkView_element =[
{ cols:[
{ view:"label",value:"" ,width:350,id:"DrinkView_menu_text",name:"DrinkView_menu_text"},
]},
{ cols:[
{ view:"label",value:"" ,width:350,id:"DrinkView_drink_text",name:"DrinkView_drink_text"},
]},
{ margin:5, cols:[
{ view:"label", label:"以äžã®ïŒåã®äžããéžæããŠãã ãã" ,width:300,css:"mainLabel" },
]},
{ margin:5, cols:[
{ view:"button", label:"ã³ãŒã" , type:"form" ,width:300,css:"bt_drinkh",height:30,
click:function(){
set_drink_and_next_last_check("ã³ãŒã");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ã¢ã€ã¹ã³ãŒã" , type:"form" ,width:300,css:"bt_drink",height:30,
click:function(){
set_drink_and_next_last_check("ã¢ã€ã¹ã³ãŒã");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"çŽ
è¶" , type:"form" ,width:300,css:"bt_drinkh",height:30,
click:function(){
set_drink_and_next_last_check("çŽ
è¶");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ã¢ã€ã¹ãã£ãŒ" , type:"form" ,width:300,css:"bt_drink",height:30,
click:function(){
set_drink_and_next_last_check("ã¢ã€ã¹ãã£ãŒ");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ãªã¬ã³ãžãžã¥ãŒã¹" , type:"form" ,width:300,css:"bt_drink",height:30,
click:function(){
set_drink_and_next_last_check("ãªã¬ã³ãžãžã¥ãŒã¹");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ãŠãŒãã³è¶" , type:"form" ,width:300,css:"bt_drink",height:30,
click:function(){
set_drink_and_next_last_check("ãŠãŒãã³è¶");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"ã¹ãŒã" , type:"form" ,width:300,css:"bt_drinkh",height:30,
click:function(){
set_drink_and_next_last_check("ã¹ãŒã");
}
},
]},
{ margin:5, cols:[
{ view:"button", label:"æ»ã" ,width:150,height:30,css:"bt_4",height:30,
click:function(){
$$("tabbar").showOption( LU0020_back_view_id);
$$("tabbar").hideOption("DrinkView");
}
},
{ view:"button", label:"次ãž" ,width:150,height:30,css:"bt_4",height:30,
click:function(){
if(LU0020_drink_menu != ""){
$$("tabbar").showOption("CheckView");
$$("tabbar").hideOption("DrinkView");
}
else{
webix.alert("ããªã³ã¯ã®æå®ãå
ã«ããŠãã ããã");
return;
}
}
},
]},
];
var CheckView_element =[
{ margin:5, cols:[
{ view:"label", label:"é嬿¥:"+LU0020_meeting_date+" "+LU0020_meeting_starttime+"ïœ å ŽæïŒ"+LU0020_meeting_place ,width:300,css:"mainLabel"},
]},
{ margin:5, cols:[
{ view:"select", label:"åå è
",options:LU0020_username_array,id:"username",name:"username",value:"",css:"mainLabel",width:200,labelWidth:80,id:"check_username",readonly:true},
]},
{ cols:[
{ view:"label",value:"" ,width:350,id:"check_main_text",name:"check_main_text"},
]},
{ cols:[
{ view:"label",value:"" ,width:350,id:"check_drink_text",name:"check_drink_text"},
]},
{ cols:[
{ view:"text",label:"éé¡ïŒçšèŸŒ)",value:"" ,width:200,labelWidth:80,id:"check_plice",name:"check_plice",inputAlign:"right"},
]},
{ margin:5, cols:[
{ view:"button", label:"ç»é²" ,width:100,height:30,css:"webix_danger",height:30,
click:function(){
var formData = new FormData();
var access_key = Get_AccessKey();
formData.append("userid","admin");
formData.append("job_info","LU0020");
formData.append("dateinfo",moment(LU0020_meeting_date).format("YYYY-MM-DD"));
formData.append("subject",LU0020_meeting_subject);
formData.append("username",LU0020_username);
formData.append("main_type",LU0020_main_type);
formData.append("lunch_menu",LU0020_lunch_menu);
formData.append("drink_menu",LU0020_drink_menu);
formData.append("main_plice",LU0020_main_plice);
formData.append("option1_plice",LU0020_option1_plice);
formData.append("total_plice",LU0020_total_plice);
var xhr =webix.ajax().sync().post("<?php echo SUB_FOLDER; ?>/rest_api/LU0020/LU0021_meeting_entry_action.php",formData);
var resp = JSON.parse(xhr.responseText);
if(resp.resp =="ok"){
webix.message({type:"success",text:"ç»é²ããŸããã"});
}
else{
webix.message({type:"error",text:"ç»é²åŠçã§ãšã©ãŒçºç error code ="+resp.error_code});
}
}
},
{ view:"button", label:"æ»ã" ,width:100,height:30,css:"bt_4",height:30,
click:function(){
if($$("check_main_text").getValue() == "æ¬ åž"){
//æ¬ åž
$$("tabbar").showOption("LunchView");
$$("tabbar").hideOption("CheckView");
}
else{
$$("tabbar").showOption("DrinkView");
$$("tabbar").hideOption("CheckView");
}
}
},
{ view:"button", label:"éãã" ,width:100,height:30,css:"webix_primary",height:30,
click:function(){
webix.confirm({
title:"確èª",
ok:"ã¯ã",
cancel:"ããã",
text: "ç»é²æäœãããŠããªããšã<br>éžæããæ
å ±ã¯ã<br>ä¿åãããŸããã<br>æäœãäžæããŠç»é¢ã<br>éããŸããïŒ",
})
.then(function(result){
location.href = 'https://www.google.com/?hl=ja';
})
.fail(function(){
webix.message({type:"debug",text:"æäœãç¶ç¶ã§ããŸãã"});
});
}
},
]},
];
webix.ui({
type:"space", width:380,
rows:[
{ type:"clean",
rows:[
{
borderless:true, view:"tabbar", id:"tabbar", value:"LunchView", multiview:true, options:[
{ value:'ã©ã³ã', id:'LunchView'},
{ value:'ãã¹ã¿', id:'PastaView'},
{ value:'ã»ãã', id:'SetView'},
{ value:'ãã¶' , id:'PizaView'},
{ value:'ããªã³ã¯', id:'DrinkView'},
{ value:'確èª' , id:'CheckView'},
]
},
{cells:[
{id:"LunchView",
view:"form",
width:380,
height:600,
elements:LunchView_element
},
{id:"PastaView",
view:"form",
width:380,
height:700,
elements:PastaView_element
},
{id:"SetView",
view:"form",
width:380,
height:600,
elements:SetView_element
},
{id:"PizaView",
view:"form",
width:380,
height:600,
elements:PizaView_element
},
{id:"DrinkView",
view:"form",
width:380,
height:700,
elements:DrinkView_element
},
{id:"CheckView",
view:"form",
width:380,
height:600,
elements:CheckView_element
},
]
}
]
}
]
});
//$$("PastaView").bind($$("MainView"));
$$("tabbar").hideOption("PastaView");
$$("tabbar").hideOption("SetView");
$$("tabbar").hideOption("PizaView");
$$("tabbar").hideOption("DrinkView");
$$("tabbar").hideOption("CheckView");
</script>
</body>
</html>ãããåä¿¡ãããµãŒãåŽã®PHPãœãŒã¹ã§ãã
LU0021_meeting_entry_action.php
<?php
//======================================================================
//File Name : LU0021_meeting_entry_action.php
//Encoding : UTF-8
//Creation Date : 2024-06-10
//
//Copyright © 2024 sunsunfarm. All rights reserved.
//
//This source code or any portion thereof must not be
//reproduced or used in any manner whatsoever.
//======================================================================
//header("Content-Type: text/javascript; charset=utf-8");
$myfilename = basename(__FILE__); //èªåèªèº«ã®ãã¡ã€ã«åååŸ
$userid = '';
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
if($_SERVER["REQUEST_METHOD"] != "POST"){
//POST以å€ã¯ã¯ãã
error_log($logheader.' not POST method');
header("HTTP/1.0 404 Not Found");
return;
}
if(isset($_POST['userid'])){
$userid = $_POST['userid'];
$error_flag = 1;
}
else{
$error_flag = -1;
error_log($logheader.' userid not found');
header("HTTP/1.0 404 Not Found");
exit;
}
$job_info = "LU0021";
if(isset($_POST['job_info'])){
$job_info = $_POST['job_info'];
}
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
include('../../commonlib/svr_common_lib_v3.php'); //
$config_obj = get_config_obj();
$dateinfo = "";
if(isset($_POST['dateinfo'])){
$dateinfo = $_POST['dateinfo'];
}
$subject = "";
if(isset($_POST['subject'])){
$subject = $_POST['subject'];
}
$username = "";
if(isset($_POST['username'])){
$username = $_POST['username'];
}
$main_type = "";
if(isset($_POST['main_type'])){
$main_type = $_POST['main_type'];
}
$lunch_menu = "";
if(isset($_POST['lunch_menu'])){
$lunch_menu = $_POST['lunch_menu'];
}
$drink_menu = "";
if(isset($_POST['drink_menu'])){
$drink_menu = $_POST['drink_menu'];
}
$main_plice = 0;
if(isset($_POST['main_plice'])){
$main_plice = intval($_POST['main_plice']);
}
$option1_plice = 0;
if(isset($_POST['option1_plice'])){
$option1_plice = intval($_POST['option1_plice']);
}
$total_plice = 0;
if(isset($_POST['total_plice'])){
$total_plice = intval($_POST['total_plice']);
}
error_log($logheader.'username='.$username.' date='.$dateinfo.' lunch_menu='.$lunch_menu.' total_plice='.$total_plice);
//
//ã¡ã€ã³ã«ãŒãã³
//
$config_obj = get_config_obj();
//ããŒã¿ããŒã¹æ¥ç¶ããïŒMariaDB)
$dbh = mysql_connect($config_obj,'app01','webix_webix');
if($dbh == false){
//ãšã©ãŒå¿ç
$resp = "ng";
$error_code = -2;
$json_data = json_encode(compact("resp","error_code"),JSON_UNESCAPED_UNICODE);
echo $json_data;
exit;
}
try{
$select_sql = "select id,dateinfo,subject,username,main_type,lunch_menu,drink_menu,total_plice from meeting_lunches where username = ? and dateinfo = ?";
$select_stmt = $dbh->prepare($select_sql);
$insert_sql1 = "INSERT INTO meeting_lunches(dateinfo,subject,username,main_type,lunch_menu,drink_menu,main_plice,option1_plice,";
$insert_sql1 = $insert_sql1." total_plice,created_userid,updated_userid,created_on,updated_on) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)";
$insert_stmt = $dbh->prepare($insert_sql1);
$update_sql1 = "UPDATE meeting_lunches SET main_type= ?,lunch_menu= ?,drink_menu= ?,main_plice= ?,option1_plice= ?, ";
$update_sql1 = $update_sql1."total_plice= ?,updated_userid= ?,updated_on= ? where id =?";
$update_stmt = $dbh->prepare($update_sql1);
// éçãã¬ãŒã¹ãã«ããæå®
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
// ãšã©ãŒçºçæã«äŸå€ãæãã
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//ãã©ã³ã¶ã¯ã·ã§ã³åŠçãéå§
$dbh->beginTransaction();
$resp = "ok";
$error_code = 0;
$updated_on = date("Y-m-d H:i:s");
$select_stmt->bindValue(1,$username);
$select_stmt->bindValue(2,$dateinfo);
$select_stmt->execute();
$select_var_lists = $select_stmt->fetchAll(PDO::FETCH_ASSOC); //ãã£ãŒã«ãåã ãã§ä¿åïŒindexæ
å ±ãªãïŒ
$select_count = count($select_var_lists);
error_log($logheader.' select_count ='.$select_count);
if($select_count == 0){
//insert
$insert_stmt->bindValue(1,$dateinfo);
$insert_stmt->bindValue(2,$subject);
$insert_stmt->bindValue(3,$username);
$insert_stmt->bindValue(4,$main_type);
$insert_stmt->bindValue(5,$lunch_menu);
$insert_stmt->bindValue(6,$drink_menu);
$insert_stmt->bindValue(7,$main_plice,PDO::PARAM_INT);
$insert_stmt->bindValue(8,$option1_plice,PDO::PARAM_INT);
$insert_stmt->bindValue(9,$total_plice,PDO::PARAM_INT);
$insert_stmt->bindValue(10,$userid); //created_userid
$insert_stmt->bindValue(11,$userid); //updated_userid
$insert_stmt->bindValue(12,$updated_on);
$insert_stmt->bindValue(13,$updated_on);
$insert_stmt->execute();
error_log($logheader.' insert username='.$username);
error_log($logheader.' insert date='.$dateinfo);
error_log($logheader.' insert lunch_menu='.$lunch_menu);
error_log($logheader.' insert total_plice='.$total_plice);
}
else{
$id_info = intval($select_var_lists[0]["id"]);
error_log($logheader.' update id='.$id_info );
//update
$update_stmt->bindValue(1,$main_type);
$update_stmt->bindValue(2,$lunch_menu);
$update_stmt->bindValue(3,$drink_menu);
$update_stmt->bindValue(4,intval($main_plice),PDO::PARAM_INT);
$update_stmt->bindValue(5,intval($option1_plice),PDO::PARAM_INT);
$update_stmt->bindValue(6,intval($total_plice),PDO::PARAM_INT);
$update_stmt->bindValue(7,$userid); //updated_userid
$update_stmt->bindValue(8,$updated_on);
$update_stmt->bindValue(9,$id_info,PDO::PARAM_INT);
$update_stmt->execute();
error_log($logheader.' update id='.$id_info.' username='.$username.' subject='.$subject.' dateinfo='.$dateinfo.' lunch_menu='.$lunch_menu.' main_plice='.$main_plice );
}
$dbh->commit();
error_log($logheader.' commit');
} catch(PDOException $e){
error_log($logheader.' ææããäŸå€: '.$e->getMessage()); //äŸå€çºçæã®åŠçïŒãšã©ãŒæ
å ±ããã°ã«æ ŒçŽããŠãšã©ãŒå¿çïŒ
$resp = "ng";
$error_code = -1;
}
$dbh = null;
$select_stmt = null;
$json_data = json_encode(compact("resp","error_code"),JSON_UNESCAPED_UNICODE);
error_log($logheader.' $json_data ='.$json_data);
echo $json_data;
?>ç¶ããŠãç»é²ããã©ã³ãã¡ãã¥ãŒæ
å ±ãäžèŠ§è¡šç€ºããJavascriptãœãŒã¹ã§ãã
LU0010_meeting_lists.php
<?php
//https://sunsun.sakura.ne.jp/webix01/view/LU0010/LU0010_meeting_lists.php?userid=admin
//======================================================================
//File Name : LU0010_meeting_lists.php
//Encoding : UTF-8
//Creation Date : 2024-06-10
//
//Copyright © 2024 sunsunfarm. All rights reserved.
//
//This source code or any portion thereof must not be
//reproduced or used in any manner whatsoever.
//======================================================================
$TITLE_INFO ="ã©ã³ãåºåžäžèЧ";
$VER_INFO ="V01L01";
define('ROOT_PATH','/home/sunsun/www/webix01'); //ãœãŒã¹ãä¿åããŠãããã¹ïŒåäœç°å¢ã«å¿ããŠèšè¿°ããå¿
èŠããïŒ
define('SUB_FOLDER','/webix01'); //ãµããã©ã«ããæå®ããURL
$myfilename = basename(__FILE__); //èªåèªèº«ã®ãã¡ã€ã«åååŸ
$userid = '';
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
if($_SERVER["REQUEST_METHOD"] != "GET"){
//GET以å€ã¯ã¯ãã
error_log($logheader.' REQUEST_METHOD no GET');
header("HTTP/1.0 404 Not Found");
return;
}
$userclient = 'pc';
if(isset($_GET['userid'])){
$userid = $_GET['userid'];
$error_flag = 1;
}
else{
$error_flag = -1;
error_log($logheader.' userid not found');
header("HTTP/1.0 404 Not Found");
exit;
}
if(isset($_GET['userclient'])){
$userclient = $_GET['userclient'];
}
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
include('../../commonlib/svr_common_lib_v3.php'); //
$config_obj = get_config_obj();
//ã¢ã¯ã»ã¹ããŒãã§ãã¯
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<script src="/webix_GPL_1020/webix.js"></script>
<link href="/webix_GPL_1020/skins/compact.css?<?php echo date('Ymd-H'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo SUB_FOLDER; ?>/commonlib/webix_custom_css.css?<?php echo date('Ymd-H'); ?>" rel="stylesheet" type="text/css">
<link rel="icon" href="<?php echo SUB_FOLDER; ?>/image/webix_64.ico">
<script src="<?php echo SUB_FOLDER; ?>/commonlib/object-assign.js"></script>
<script src="<?php echo SUB_FOLDER; ?>/commonlib/moment-with-locales.js"></script>
<script src="<?php echo SUB_FOLDER; ?>/commonlib/webix_common_lib.js"></script>
<link rel="stylesheet" href="/webix_GPL_1020/css/materialdesignicons.min.css" type="text/css" charset="utf-8">
<style>
.mainLabel>.webix_el_box {
font-size: 20px;
font-weight:bold;
}
.teal_bgcolor .webix_button {
background-color: #008080;
color: #FFFFFF;
}
.red .webix_label_right{
color: #FF0000;
}
</style>
<title><?php echo $TITLE_INFO.' ('.$VER_INFO.')' ?></title>
</head>
<body>
<script type="text/javascript" charset="utf-8">
webix.i18n.setLocale("ja-JP");
<?php
include_once('../../commonlib/CM0010_goto_menu_action.php');
include_once('../../commonlib/CM0030_sendprm_set_request.php');
include_once('../../commonlib/CM0050_open_menucmd.php');
include_once('../../commonlib/CM0060_common_validate_check.php');
include_once('../../commonlib/CM0080_screen_control.php');
?>
var LU0010_meeting_date = "2024/06/30";
var LU0010_meeting_subject ="ã©ã³ãäŒ";
var LU0010_meeting_starttime = "12:00";
var LU0010_meeting_place = "ã€ã¿ãªã¢ã³ãããª";
var my_local_session = {};
my_local_session.userid = "admin";
function LU0010_disp_meeting_lists(){
$$("LU0010_table").clearAll(); //äžèЧãäžåºŠã¯ãªã¢
var access_key = Get_AccessKey();
var send_prm = Prepare_send_prm(my_local_session,access_key);
send_prm.dateinfo = moment(LU0010_meeting_date).format("YYYY-MM-DD");
send_prm.subject = LU0010_meeting_subject;
var xhr =webix.ajax().sync().get("<?php echo SUB_FOLDER; ?>/rest_api/LU0010/LU0012_meeting_db_selectlists.php",send_prm);
var resp = JSON.parse(xhr.responseText);
if(resp.resp =="ok"){
$$("LU0010_table").parse(resp.var_lists);
}
else{
webix.message({type:"error",text:"æ€çŽ¢ã§ãšã©ãŒãçºçããŸãããcode="+resp.error_code});
}
}
//æ€çŽ¢æ¡ä»¶ãã©ãŒã æ§æãªã¹ã
var form_collection = [
{ margin:5, cols:[
{ view:"label", label:"é嬿¥:"+LU0010_meeting_date+" "+LU0010_meeting_starttime+"ïœ å ŽæïŒ"+LU0010_meeting_place ,width:550,css:"mainLabel"},
]
},
{ margin:5, cols:[
{ view:"button",id:"search_btn", value: "æ€çŽ¢", align:"center", width: 100,
click:function(){
LU0010_disp_meeting_lists();
}
},
{ view: "button",id:"excel_btn",name:"excel_btn", label: "EXCELåºå", width: 100, css:"teal_bgcolor",
click:function(){
webix.toExcel($$("LU0010_table"),{filename:"ã©ã³ã泚æäžèЧ_"+moment().format("YYYYMMDD")});
}
},
{ view:"button", value: "éãã", align:"center", width: 100, css:"menu",
click:function(){
location.href = 'https://www.google.com/?hl=ja';
}
},
]
}
];
//ç»é¢æç»
webix.ui({
view:"form",
resize:true,
elements:[
{rows:[
{ view:"form", //äœæããããšã¬ã¡ã³ãã®çš®é¡
id: "form1", //åç
§çšã®IDæ
å ±
elements:form_collection , //ãã©ãŒã ã®æ§æèŠçŽ ãæå®
}
]
},
{
id: "LU0010_table",
type:"clean",
view:"datatable",
columnWidth:400,
columns:[
{ id:"id" ,header:"No",width:80 , sort:"int", css:{"text-align":"right"},hidden:true},
{ id:"username" ,header:["åå" , { content:"textFilter"} ] ,width:120, sort:"string"},
{ id:"main_type" ,header:["çš®é¡" , { content:"selectFilter"}] ,width:150, sort:"string"},
{ id:"lunch_menu" ,header:["ã¡ãã¥ãŒ" , { content:"selectFilter"}] ,width:400, sort:"string"},
{ id:"drink_menu" ,header:["ããªã³ã¯" , { content:"selectFilter"}] ,width:150, sort:"string"},
{ id:"total_plice",header:["倿®µ" , { content:"selectFilter"}] ,width:120, sort:"int", css:{"text-align":"right"}},
],
select:"row",
datatype:"json",
data:[]
}
]
}
);
LU0010_disp_meeting_lists();
</script>
</body>
</html>
äžèŠ§è¡šã衚瀺ããããã®ãµãŒãåŽDBæ€çŽ¢çšãœãŒã¹ã§ãã
LU0012_meeting_db_selectlists.php
<?php
//======================================================================
//File Name : LU0012_meeting_db_selectlists.php
//Encoding : UTF-8
//Creation Date : 2024-06-10
//
//Copyright © 2024 sunsunfarm. All rights reserved.
//
//This source code or any portion thereof must not be
//reproduced or used in any manner whatsoever.
//======================================================================
//header("Content-Type: text/javascript; charset=utf-8");
$myfilename = basename(__FILE__); //èªåèªèº«ã®ãã¡ã€ã«åååŸ
$userid = '';
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
if($_SERVER["REQUEST_METHOD"] != "GET"){
//GET以å€ã¯ã¯ãã
error_log($logheader.' not GET method');
header("HTTP/1.0 404 Not Found");
return;
}
$userid = "admin";
if(isset($_GET['userid'])){
$userid = $_GET['userid'];
$error_flag = 1;
}
$job_info = "LU0012";
if(isset($_GET['job_info'])){
$job_info = $_GET['job_info'];
}
$logheader = 'userid='.$userid.', '.$myfilename.':';//ãã°åºåæã®ããããŒæ
å ±ïŒèªãã¡ã€ã«å,ãã°ã€ã³IDãä»äžïŒ
include('../../commonlib/svr_common_lib_v3.php'); //
$config_obj = get_config_obj();
$dateinfo = "";
if(isset($_GET['dateinfo'])){
$dateinfo = $_GET['dateinfo'];
}
$subject = "";
if(isset($_GET['subject'])){
$subject = $_GET['subject'];
}
error_log($logheader.'select date='.$dateinfo.' subject='.$subject);
//
//ã¡ã€ã³ã«ãŒãã³
//
$config_obj = get_config_obj();
//ããŒã¿ããŒã¹æ¥ç¶ããïŒMariaDB)
$dbh = mysql_connect($config_obj,'app01','webix_webix');
if($dbh == false){
//ãšã©ãŒå¿ç
$resp = "ng";
$error_code = -2;
$json_data = json_encode(compact("resp","error_code"),JSON_UNESCAPED_UNICODE);
echo $json_data;
exit;
}
try{
$select_sql = "select id,dateinfo,subject,username,main_type,lunch_menu,drink_menu,total_plice from meeting_lunches where subject = ? and dateinfo = ? order by username";
$select_stmt = $dbh->prepare($select_sql);
error_log($logheader.'$select_sql='.$select_sql);
$resp = "ok";
$error_code = 0;
$select_stmt->bindValue(1,$subject);
$select_stmt->bindValue(2,$dateinfo);
$select_stmt->execute();
$var_lists = $select_stmt->fetchAll(PDO::FETCH_ASSOC); //ãã£ãŒã«ãåã ãã§ä¿åïŒindexæ
å ±ãªãïŒ
} catch(PDOException $e){
error_log($logheader.' ææããäŸå€: '.$e->getMessage()); //äŸå€çºçæã®åŠçïŒãšã©ãŒæ
å ±ããã°ã«æ ŒçŽããŠãšã©ãŒå¿çïŒ
$var_lists = array();
$resp = "ng";
$error_code = -1;
}
$dbh = null;
$select_stmt = null;
$json_data = json_encode(compact("resp","error_code","var_lists"),JSON_UNESCAPED_UNICODE);
error_log($logheader.' $json_data ='.$json_data);
echo $json_data;
?>ã¡ãã¥ãŒã®çš®é¡ãå€ããªããšããœãŒã¹ãé·ããªãã®ã§ãå
šäœã®æ§é ãå°ããæ€èšããå¿
èŠããããŸãããååãå®çšçã«äœ¿ããŸãã
ãã²ã掻çšããŠã¿ãŠãã ãããLINEæ©èœã®æç¥šã§ãåããããªããšãå¯èœã§ãããä»åã®æ©èœã¯ãå¶éããªããURLãçºä¿¡ããã°ãLINEäžã§ãããããªãµãŒãã¹ãæäŸã§ããŸãã