This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("dsn.php"); | |
$id = filter_input(INPUT_POST,'id'); | |
$koumoku = filter_input(INPUT_POST,'koumoku'); | |
$date = strtotime(filter_input(INPUT_POST,'date')); | |
$link = new PDO($dsn['host'],$dsn['usr'],$dsn['pass']); | |
if($link==null){ | |
error_log("データベースに接続できませんでした。"); | |
} | |
$link->query('SET NAMES utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="form1"> | |
<select id="date"> | |
<option value="">選択して下さい</option> | |
<option value="1">one</option> | |
<option value="2">two</option> | |
<option value="3">three</option> | |
<option value="4">four</option> | |
</select> | |
<input type="image" src="submit.png"> | |
<img src="befor.png" id="bf" class="change"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// キモはNumber.toFixed() | |
// これは、Numberを()内で指定した固定小数点の数にしてくれる。 | |
// (0.6).toFixed(3) => 0.600 みたいな感じ。 | |
// formには0詰めされたフォーマットが入っている(0.000みたいな) | |
// (※何種類かフォーマットを使い分ける必要があったので… | |
var aaa = 0.6; | |
var tmp = form.split('\.'); //小数点前後で分割する。 | |
var num = tmp.length==1?0:tmp[1].length; //小数点以下の桁数を取得。小数点がなければ0。 | |
aaa.toFixed(num); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// option[selected]によって「ソース上の」選択状態を取得。 | |
var tmpSelect = $('select[name="selectName"] option[selected]').val(); | |
// option:selected (見かけ上の選択状態)を削除。 | |
$('select[name="selectName"] option:selected').removeAttr('selected'); | |
// 改めて選択を設定しなおす。 | |
$('select[name="selectName"]').val(tmpSelect); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select rank,base.shain_number,base.name_kanji,base.uriage FROM | |
(select uriage,sumrot, @rank as rank ,cnt,@rank := @rank + cnt | |
From (select @rank := 1) as dummy, | |
(select ur2.kingaku as uriage,ur2.rot as sumrot,count(*) as cnt | |
from uriage ur2 | |
where ur2.year = 2016 and ur2.term = 1 | |
and ur2.rot >= 10 | |
group by ur2.kingaku,rot order by ur2.kingaku desc,rot desc) as grpby | |
) as Ranking | |
join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Naviなんとかさんで経路を検索して教えてくれるSlackBOT | |
//Slack側で必要なこと | |
// スラックアプリを新規作成する | |
// Slash Commandsの設定。 | |
// アプリをワークスペースにインストールする | |
//GAS側の設定・注意するところ | |
// 公開するときは「ウェブアプリケーションとして公開 | |
// 自分が実行 | |
// アクセス可能な人:Anyone,even anonymous |