diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 27a1bd4..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/data/.DS_Store b/data/.DS_Store deleted file mode 100644 index 123e2e8..0000000 Binary files a/data/.DS_Store and /dev/null differ diff --git a/data/shift.dat b/data/shift.dat index 60b04fd..e19d0ab 100755 --- a/data/shift.dat +++ b/data/shift.dat @@ -1,4 +1 @@ -たかけん,6,10,0000111 -いのうえ,15,23,0111000 -ふじた,8,15,1001100 -おりまー,17,22,1011010 +たかけん,6,12,0001110 diff --git a/data/worker.dat b/data/worker.dat index 06305fd..334b689 100755 --- a/data/worker.dat +++ b/data/worker.dat @@ -2,3 +2,4 @@ いのうえ,inoue.jpeg ふじた,huzita.jpeg おりまー,olimer.jpeg +かすみ,kasumis.png diff --git a/host.php b/host.php index 94e0617..fae6004 100644 --- a/host.php +++ b/host.php @@ -1,27 +1,14 @@ "workerIcon"]; +for($i = 0; $i < $newWorkerMax; $i++) { + //$workerIcons[][0]登録した従業員の名前 + //$workerIcons[][1]登録した従業員の画像 + $workerIcon[] = explode(",", $workerData[$i]); + $workerIcons += [$workerIcon[$i][0] => $workerIcon[$i][1]]; +} ?> - + - + シフトが出来上がったよ -

完成したシフト表はこちら

"; - } elseif($i == 1){ - echo ""; - } + //週の曜日の7行+時間帯の表示の1行を表示させるため<=条件式とする + for($i = 0; $i <= $oneWeekDays; $i++): + //ここも3項演算子 + ($i == 0) ? print "" : print ""; ?> - - + + + - - - "; - } elseif ($i == $oneWeekDays) { - echo ""; - } - ?> + } + + if($i > 0 && $workerShifts[$k][3][$i-1] == 1 && $j - 1 >= $startTime && $j - 1 <= $endTime) { + echo "\n"; + } + } + ?> + + + + " : ""; + ?>
+ 0) { + echo $times[$j-1]; + } elseif ($i > 0 && $j == 0) { + echo $weekJpNames[$i-1]; + } else { + echo ' '; + } - - 0 && $i == 0) { - echo $times[$j-1]; - } elseif ($j == 0 && $i > 0) { - echo $weekJpNames[$i-1]; - } else { - echo ' '; + for($k = 0; $k < $workerMax; $k++) { + //表示するためにtime配列内のシフトの開始時間と終了時間の添え字を取り出す + for($l = 0; $l <= $hours; $l++) { + if($workerShifts[$k][1] == $times[$l]) { + $startTime = $l; } - - for($k = 0; $k < $workerMax; $k++) { - //表示するためにtime配列内のシフトの開始時間と終了時間の添え字を取り出す - for($l = 0; $l <= $hours; $l++) { - if($times[$l] == $workerShifts[$k][1]) { - $startTime = $l; - } - if($times[$l] == $workerShifts[$k][2]) { - $endTime = $l; - } - } - if($i > 0 && $j - 1 >= $startTime && $j - 1 <= $endTime && $workerShifts[$k][3][$i-1] == 1) { - for($m = 0; $m < $newWorkerMax; $m++) { - if($workerShifts[$k][0] == $workerIcons[$m][0]) { - echo "\n"; - } - } - } + if($workerShifts[$k][2] == $times[$l]) { + $endTime = $l; } - ?> -

- シフト登録はこちら - シフトを修正はこちら -
+ シフト登録はこちら + シフトを修正はこちら +


diff --git a/owner.php b/owner.php old mode 100644 new mode 100755 index a6e5802..10e83bb --- a/owner.php +++ b/owner.php @@ -1,34 +1,49 @@ "workerIcon"]; +for($i = 0; $i < $newWorkerMax; $i++) { + //$workerIcons[][0]登録した従業員の名前 + //$workerIcons[][1]登録した従業員の画像 + $workerIcon[] = explode(",", $workerData[$i]); + $workerIcons += [$workerIcon[$i][0] => $workerIcon[$i][1]]; +} //新規の従業員登録のための情報が入力されてるか判定 if(isset($_POST["newWorker"]) && !(empty($_POST["newWorker"])) && !(empty($_FILES["upfile"]["name"]))) { - $newWorker = $_POST["newWorker"]; //画像ファイルをアップロード if(is_uploaded_file($_FILES["upfile"]["tmp_name"])) { - if(move_uploaded_file($_FILES["upfile"]["tmp_name"],"./workericons/".$_FILES["upfile"]["name"])) { - chmod("./workericons/".$_FILES["upfile"]["name"],0750); + if(move_uploaded_file($_FILES["upfile"]["tmp_name"], "./pictures/".$_FILES["upfile"]["name"])) { + chmod("./pictures/".$_FILES["upfile"]["name"], 0750); echo $_FILES["upfile"]["name"]."をアップロードしました。"; - echo $_FILES["upfile"]["error"]; - echo""; } else { echo "ファイルをアップロードできません。"; + exit; } } else { echo "ファイルが選択されていません。"; + exit; } //登録した画像ファイルの変数を定義 - $upfile =$_FILES["upfile"]["name"]; + $upfile = $_FILES["upfile"]["name"]; //投稿された名前と画像ファイルを従業員管理ファイルに書き込むための指定 $workerIcon = $newWorker.",".$upfile; @@ -37,71 +52,64 @@ echo "not writable"; exit; } + $filePointer = fopen($workerDatPath, "a"); if($filePointer == false) { echo "could not open"; exit; } + if(fwrite($filePointer, $workerIcon."\n") === false) { echo "could not write"; exit; } + fclose($filePointer); } -//従業員管理ファイルを読み込む -$workerData = file($workerDatPath); -$newWorkerMax = count($workerData); -//従業員管理ファイルを配列化 -for($i = 0; $i < $newWorkerMax; $i++) { - //$workerIcons[][0]登録した従業員の名前 - //$workerIcons[][1]登録した従業員の画像 - $workerIcons[] = explode(",", $workerData[$i]); -} +if(isset($_POST["workerName"]) && !(empty($_POST["workerName"]))) { + $workerName = $_POST["workerName"]; -//従業員シフト情報ファイルを読み込む -$shiftTimes = file($shiftDatPath); -$workerMax = count($shiftTimes); -$workerName = $_POST["workerName"]; + //指定した従業員のシフト情報をファイルにから削除 + for($i = 0; $i < $workerMax; $i++) { + if(strpos($shiftTimes[$i], $workerName) !== false) { + unset($shiftTimes[$i]); + } + } -//指定した従業員のシフト情報をファイルにから削除 -for($i = 0; $i < $workerMax; $i++) { - if(strpos($shiftTimes[$i], $workerName) !== false) { - unset($shiftTimes[$i]); + //削除した配列を詰める + $shiftTimes = array_merge($shiftTimes); + + //変更された、従業員シフト情報ファイルを配列化 + $workerMax = count($shiftTimes); + for($i = 0; $i < $workerMax; $i++) { + //$workerShifts[][0]名前 + //$workerShifts[][1]開始時間 + //$workerShifts[][2]終了時間 + //$workerShifts[][3]曜日 + $workerShifts[] = explode(",", $shiftTimes[$i]); } -} -//削除した配列を詰める -$shiftTimes = array_merge($shiftTimes); -//変更された、従業員シフト情報ファイルを配列化 -$workerMax = count($shiftTimes); -for($i = 0; $i < $workerMax; $i++) { - //$workerShifts[][0]名前 - //$workerShifts[][1]開始時間 - //$workerShifts[][2]終了時間 - //$workerShifts[][3]曜日 - $workerShifts[] = explode(",", $shiftTimes[$i]); -} + //従業員情報を管理するファイルを、空にして書き直す + if(is_writable($shiftDatPath) === false) { + echo "not writable"; + exit; + } -//従業員情報を管理するファイルを、空にして書き直す -if(is_writable($shiftDatPath) === false) { - echo "not writable"; - exit; -} -$filePointer = fopen($shiftDatPath, "w"); -if($filePointer === false) { - echo "could not open"; - exit; -} -//配列を1行づつ書き込む -for($i = 0; $i < $workerMax; $i++ ) { - if(fwrite($filePointer, $shiftTimes[$i]) === false) { - echo "could not write"; + $filePointer = fopen($shiftDatPath, "w"); + if($filePointer === false) { + echo "could not open"; exit; } + //配列を1行づつ書き込む + for($i = 0; $i < $workerMax; $i++) { + if(fwrite($filePointer, $shiftTimes[$i]) === false) { + echo "could not write"; + exit; + } + } + fclose($filePointer); } -fclose($filePointer); - ?> @@ -116,94 +124,80 @@ "; - } elseif($i == 1){ - echo ""; - } - ?> + for($i = 0; $i <= $oneWeekDays; $i++): + //ここも3項演算子 + ($i == 0) ? print "" : print ""; + ?> + //1日24時間分の列+曜日の表示の1列を表示させるため<=条件式とする + for($j = 0; $j <= $hours; $j++): + ?> "; - } elseif ($i == $oneWeekDays) { - echo ""; - } + //閉じタグも3項演算子 + ($i == 0) ? print "" : ""; ?>
0 && $i == 0) { - echo $times[$j-1]; - } elseif ($j == 0 && $i > 0) { - echo $weekJpNames[$i-1]; - } else { - echo ' '; - } + //表に時間と曜日を表示 + if($i == 0 && $j > 0) { + echo $times[$j-1]; + } elseif ($i > 0 && $j == 0) { + echo $weekJpNames[$i-1]; + } else { + echo ' '; + } - //表示するためにtime配列内のシフトの開始時間と終了時間の添え字を取り出す - for($k = 0; $k < $workerMax; $k++) { - for($l = 0; $l < $hours; $l++) { - if($times[$l] == $workerShifts[$k][1]) { - $startTime = $l; - } - if($times[$l] == $workerShifts[$k][2]) { - $endTime = $l; - } + //表示するためにtime配列内のシフトの開始時間と終了時間の添え字を取り出す + for($k = 0; $k < $workerMax; $k++) { + for($l = 0; $l < $hours; $l++) { + if($workerShifts[$k][1] == $times[$l]) { + $startTime = $l; } - //時間表示の1行に書き込まれないようにする - if($i > 0 && $j - 1 >= $startTime && $j - 1 <= $endTime && $workerShifts[$k][3][$i-1] == 1) { - // echo "\n"; - for($m = 0; $m < $newWorkerMax; $m++) { - if($workerShifts[$k][0] == $workerIcons[$m][0]) { - echo "\n"; - //echo ""; - } - } + if($workerShifts[$k][2] == $times[$l]) { + $endTime = $l; } } + //時間表示の1行に書き込まれないようにする + if($i > 0 && $workerShifts[$k][3][$i-1] == 1 && $j - 1 >= $startTime && $j - 1 <= $endTime) { + echo "\n"; + } + } ?>
- シフトを変更したい従業員を選択してください -
-
- + + ".$workerIcons[$workerShifts[$i][0]].""; + // } + for($i = 0; $i < $newWorkerMax; $i++) { + echo ""; + } - -
- -
-
- 追加したい従業員を登録できます。 -
-
- 名前 - -
- - + ?> + +

+ + 追加したい従業員を登録できます。 +
+

+ 名前 + + +

+

+
+ 完成したシフトはこちら + シフト登録はこちら +
- 完成したシフトはこちら - シフト登録はこちら - -
- + diff --git a/workericons/blackboard.png b/pictures/blackboard.png similarity index 100% rename from workericons/blackboard.png rename to pictures/blackboard.png diff --git a/workericons/huzita.jpeg b/pictures/huzita.jpeg similarity index 100% rename from workericons/huzita.jpeg rename to pictures/huzita.jpeg diff --git a/workericons/inoue.jpeg b/pictures/inoue.jpeg similarity index 100% rename from workericons/inoue.jpeg rename to pictures/inoue.jpeg diff --git a/pictures/kasumis.png b/pictures/kasumis.png new file mode 100755 index 0000000..c54ca28 Binary files /dev/null and b/pictures/kasumis.png differ diff --git a/workericons/olimer.jpeg b/pictures/olimer.jpeg similarity index 100% rename from workericons/olimer.jpeg rename to pictures/olimer.jpeg diff --git a/workericons/takakura.png b/pictures/takakura.png similarity index 100% rename from workericons/takakura.png rename to pictures/takakura.png diff --git a/pure-release-0.6.0/.DS_Store b/pure-release-0.6.0/.DS_Store deleted file mode 100644 index ca8d05d..0000000 Binary files a/pure-release-0.6.0/.DS_Store and /dev/null differ diff --git a/pure-release-0.6.0/HISTORY.md b/pure-release-0.6.0/HISTORY.md deleted file mode 100755 index d01e4ae..0000000 --- a/pure-release-0.6.0/HISTORY.md +++ /dev/null @@ -1,439 +0,0 @@ -Pure Change History -=================== - -0.6.0 (2015-02-07) ------------------- - -* Upgraded Normalize.css to 3.0.2. -* Dropped IE7 support. -* Refactored Menus. -* Numerous minor bug fixes. - -### Menus - -* Implemented flatter, low-specificity selectors, not attached to HTML elements, - for easier customization. -* Removed pure-menu-open class. -* Added pure-menu-scrollable capability, to allow for scrollable menus when - restricted by width or height. -* Added pure-menu-allow-hover to reveal dropdowns on hover. -* Removed various default styling properties, making menus a bit more bare-bones, -a bit less opinionated, a bit easier to customize on top. -* Broke Menu up into files for core, horizontal, dropdowns, scrollable, and skin, - again for improved optimization and ease of customization: take only what you - need. -* Removed Paginator. -* While not part of the Pure repo itself, the accompanying Pure website now - features additional menu examples and an example script for enabling dropdowns - and improved accessiblity. - -0.5.0 (2014-05-27) ------------------- - -### Base - -* Added the `.pure-img` class name for make images scale with the viewport in - fluid layouts. - -### Grids - -* __[!]__ Removed `.pure-g-r` from core, in favor of a mobile-first responsive - grid system. ([#24][], [#267][]) - - To use the mobile-first grid system, you need to pull in `pure.css`, along - with `grids-responsive.css`. We also have `grids-responsive-old-ie.css` that - you can serve to IE < 9 users so that they can view a desktop-version of your - website: - - ```html - - - - - - - ``` - - Find out more about the new grid system at . - -### Tables - -* Switched cell padding in Tables from `px` to `em` units, and also increased - the amount of padding to `padding: 0.5em 1em`. - - -[#24]: https://github.com/yahoo/pure/issues/24 -[#267]: https://github.com/yahoo/pure/pull/267 - - -0.4.2 (2014-02-13) ------------------- - -* Added `main` to Pure's `bower.json` file to allow easier integration with - build processes and tooling. ([#286][] @stevenvachon) - -### Forms - -* Improved how `` elements look in Chrome by fixing - paddings. ([#283][] @jpetto) - -* Removed `font-size` rules from ``, ``, and `
` - elements within `.pure-form`. Font sizes are now inherited from the - application's CSS file. ([#265][]) - -* Invalid `` elements within a Pure Form no longer explicitly set a - `border-width`. ([#295][] @kwando) - - -[#265]: https://github.com/yahoo/pure/issues/265 -[#283]: https://github.com/yahoo/pure/issues/283 -[#286]: https://github.com/yahoo/pure/issues/286 -[#295]: https://github.com/yahoo/pure/issues/295 - - -0.4.1 (2014-02-06) ------------------- - -### Base - -* Elements that have Pure classnames which set a `display` declaration _and_ use - the `hidden` HTML attribute will now properly be hidden. With these changes, - the following button will be hidden from view: - - ```html - - ``` - - A new rule for the `[hidden]` selector has been added with the declaration: - `display: none !important;`. This is a time where it's appropriate for a - project like Pure to use `!important`. ([#177][]) - -### Buttons - -* Removed all the occurrences of `-ms-linear-gradient()` from Buttons since it - has never been in the final version of IE 10. ([#200][]: @AurelioDeRosa) - -* `` Buttons now have the same height as non-input buttons. - `font-family: inherit;` has been added to the `.pure-button` selector to - normalize the difference in height. ([#221][] @narcis-radu) - -* Buttons now have visually uniform default `padding` on all four sides. The - left/right padding is 2x the top/bottom padding. ([#191][] @achalv) - -### Forms - -* Added `vertical-align: top;` to `