├── fuel ├── app │ ├── cache │ │ └── .gitkeep │ ├── logs │ │ └── .gitkeep │ ├── tmp │ │ └── .gitkeep │ ├── views │ │ ├── .gitkeep │ │ ├── 404.php │ │ ├── inquiries │ │ │ ├── sent.php │ │ │ ├── form.php │ │ │ └── confirm.php │ │ ├── topics │ │ │ ├── detail.php │ │ │ └── index.php │ │ ├── index.php │ │ ├── top.php │ │ ├── log.php │ │ ├── admin │ │ │ ├── topics │ │ │ │ ├── form.php │ │ │ │ └── index.php │ │ │ ├── signin.php │ │ │ ├── customers │ │ │ │ ├── index.php │ │ │ │ └── detail.php │ │ │ ├── index.php │ │ │ ├── template.php │ │ │ ├── inquiries │ │ │ │ └── index.php │ │ │ └── users │ │ │ │ ├── index.php │ │ │ │ └── form.php │ │ ├── signin.php │ │ ├── company.php │ │ ├── customers │ │ │ ├── index.php │ │ │ └── form.php │ │ ├── template.php │ │ ├── signup.php │ │ ├── setting.php │ │ ├── term.php │ │ └── policy.php │ ├── lang │ │ ├── en │ │ │ ├── .gitkeep │ │ │ └── main.php │ │ └── ja │ │ │ ├── .gitkeep │ │ │ └── main.php │ ├── migrations │ │ ├── .gitkeep │ │ ├── 005_add_logo_to_users.php │ │ ├── 007_add_user_id_to_customers.php │ │ ├── 008_add_deleted_at_to_customers.php │ │ ├── 003_create_logs.php │ │ ├── 002_create_topics.php │ │ ├── 004_create_inquiries.php │ │ ├── 006_create_customers.php │ │ └── 001_create_users.php │ ├── modules │ │ └── .gitkeep │ ├── tests │ │ ├── view │ │ │ └── .gitkeep │ │ ├── model │ │ │ └── .gitkeep │ │ └── controller │ │ │ └── .gitkeep │ ├── themes │ │ └── .gitkeep │ ├── vendor │ │ └── .gitkeep │ ├── classes │ │ ├── model │ │ │ ├── .gitkeep │ │ │ ├── log.php │ │ │ ├── inquiry.php │ │ │ ├── topic.php │ │ │ ├── customer.php │ │ │ └── user.php │ │ └── controller │ │ │ ├── .gitkeep │ │ │ ├── 404.php │ │ │ ├── index.php │ │ │ ├── term.php │ │ │ ├── policy.php │ │ │ ├── company.php │ │ │ ├── users.php │ │ │ ├── top.php │ │ │ ├── base.php │ │ │ ├── log.php │ │ │ ├── admin │ │ │ ├── inquiries.php │ │ │ ├── api.php │ │ │ ├── signin.php │ │ │ ├── topics.php │ │ │ ├── customers.php │ │ │ └── users.php │ │ │ ├── inquiry.php │ │ │ ├── admin.php │ │ │ ├── signup.php │ │ │ ├── signin.php │ │ │ ├── topics.php │ │ │ ├── setting.php │ │ │ └── customers.php │ ├── config │ │ ├── routes.php │ │ ├── prefectures.php │ │ ├── production │ │ │ └── db.php │ │ ├── staging │ │ │ └── db.php │ │ ├── db.php │ │ ├── test │ │ │ └── db.php │ │ ├── rest.php │ │ ├── asset.php │ │ ├── session.php │ │ └── config.php │ ├── tasks │ │ └── user.php │ └── bootstrap.php └── .htaccess ├── public ├── files │ └── index.html ├── assets │ ├── css │ │ ├── index.html │ │ └── style.css │ ├── img │ │ ├── index.html │ │ ├── ad.png │ │ └── s_ad.png │ ├── js │ │ ├── index.html │ │ ├── jquery.cookie.js │ │ └── jquery.min.js │ ├── fonts │ │ └── index.html │ └── sass │ │ ├── index.html │ │ └── style.scss ├── favicon.ico ├── .htaccess └── index.php ├── composer.phar ├── README.md ├── .gitignore ├── config.rb ├── oil └── composer.json /fuel/app/cache/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/logs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/tmp/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/views/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/files/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /fuel/app/lang/en/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/lang/ja/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/modules/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/tests/view/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/themes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/css/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/img/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/js/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/classes/model/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/tests/model/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/fonts/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/sass/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/tests/controller/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuel/app/views/404.php: -------------------------------------------------------------------------------- 1 |

-------------------------------------------------------------------------------- /composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkmru/a_and_d_web_nara/master/composer.phar -------------------------------------------------------------------------------- /fuel/app/views/inquiries/sent.php: -------------------------------------------------------------------------------- 1 |

2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkmru/a_and_d_web_nara/master/public/favicon.ico -------------------------------------------------------------------------------- /fuel/app/views/topics/detail.php: -------------------------------------------------------------------------------- 1 |
2 | body); ?> 3 |
-------------------------------------------------------------------------------- /public/assets/img/ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkmru/a_and_d_web_nara/master/public/assets/img/ad.png -------------------------------------------------------------------------------- /public/assets/img/s_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkmru/a_and_d_web_nara/master/public/assets/img/s_ad.png -------------------------------------------------------------------------------- /fuel/app/config/routes.php: -------------------------------------------------------------------------------- 1 | 'index', // The default route 4 | '_404_' => '404', // The main 404 route 5 | ); 6 | -------------------------------------------------------------------------------- /fuel/app/views/index.php: -------------------------------------------------------------------------------- 1 |

2 |

3 | 4 |

5 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/404.php: -------------------------------------------------------------------------------- 1 | template->title = '404'; 9 | $this->template->content = View::forge('404', $this->data); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/index.php: -------------------------------------------------------------------------------- 1 | template->title = __("top"); 9 | $this->template->content = View::forge('index', $this->data); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/term.php: -------------------------------------------------------------------------------- 1 | template->title = __("term"); 9 | $this->template->content = View::forge('term', $this->data); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/policy.php: -------------------------------------------------------------------------------- 1 | template->title = __("policy"); 9 | $this->template->content = View::forge('policy', $this->data); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/company.php: -------------------------------------------------------------------------------- 1 | template->title = __("company"); 9 | $this->template->content = View::forge('company', $this->data); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fuel/app/views/topics/index.php: -------------------------------------------------------------------------------- 1 |
2 | 9 | 10 |
-------------------------------------------------------------------------------- /fuel/app/views/top.php: -------------------------------------------------------------------------------- 1 |

2 |
3 | 10 |
-------------------------------------------------------------------------------- /fuel/app/tasks/user.php: -------------------------------------------------------------------------------- 1 | email = $email; 13 | $user->password = md5($password); 14 | $user->group_id = 100; 15 | $user->save(); 16 | } 17 | } -------------------------------------------------------------------------------- /fuel/app/config/prefectures.php: -------------------------------------------------------------------------------- 1 | ["---", "北海道", "青森県", "岩手県", "宮城県", "秋田県", "山形県", "福島県", "茨城県", "栃木県", "群馬県", "埼玉県", "千葉県", "東京都", "神奈川県", "新潟県", "富山県", "石川県", "福井県", "山梨県", "長野県", "岐阜県", "静岡県", "愛知県", "三重県", "滋賀県", "京都府", "大阪府", "兵庫県", "奈良県", "和歌山県", "鳥取県", "島根県", "岡山県", "広島県", "山口県", "徳島県", "香川県", "愛媛県", "高知県", "福岡県", "佐賀県", "長崎県", "熊本県", "大分県", "宮崎県", "鹿児島県", "沖縄県"]]; -------------------------------------------------------------------------------- /fuel/app/config/production/db.php: -------------------------------------------------------------------------------- 1 | array( 8 | 'connection' => array( 9 | 'dsn' => 'mysql:host=localhost;dbname=fuel_prod', 10 | 'username' => 'fuel_app', 11 | 'password' => 'super_secret_password', 12 | ), 13 | ), 14 | ); 15 | -------------------------------------------------------------------------------- /fuel/app/config/staging/db.php: -------------------------------------------------------------------------------- 1 | array( 8 | 'connection' => array( 9 | 'dsn' => 'mysql:host=localhost;dbname=fuel_staging', 10 | 'username' => 'fuel_app', 11 | 'password' => 'super_secret_password', 12 | ), 13 | ), 14 | ); 15 | -------------------------------------------------------------------------------- /fuel/app/config/db.php: -------------------------------------------------------------------------------- 1 | array( 10 | 'connection' => array( 11 | 'dsn' => "mysql:host=127.0.0.1;dbname=adweb2", 12 | 'username' => "adweb2", 13 | 'password' => "adweb2" 14 | ) 15 | ) 16 | ); 17 | -------------------------------------------------------------------------------- /fuel/app/migrations/005_add_logo_to_users.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 255, 'type' => 'varchar'), 11 | 12 | )); 13 | } 14 | 15 | public function down() 16 | { 17 | \DBUtil::drop_fields('users', array( 18 | 'logo' 19 | 20 | )); 21 | } 22 | } -------------------------------------------------------------------------------- /fuel/app/migrations/007_add_user_id_to_customers.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int'), 11 | 12 | )); 13 | } 14 | 15 | public function down() 16 | { 17 | \DBUtil::drop_fields('customers', array( 18 | 'user_id' 19 | 20 | )); 21 | } 22 | } -------------------------------------------------------------------------------- /fuel/app/classes/controller/users.php: -------------------------------------------------------------------------------- 1 | template->user == null) 10 | { 11 | Response::redirect('signin'); 12 | } 13 | } 14 | 15 | public function action_index() 16 | { 17 | $this->template->title = 'トップページ'; 18 | $this->template->content = View::forge('index', $this->data); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fuel/app/migrations/008_add_deleted_at_to_customers.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int'), 11 | 12 | )); 13 | } 14 | 15 | public function down() 16 | { 17 | \DBUtil::drop_fields('customers', array( 18 | 'deleted_at' 19 | 20 | )); 21 | } 22 | } -------------------------------------------------------------------------------- /fuel/app/config/test/db.php: -------------------------------------------------------------------------------- 1 | array( 10 | 'connection' => array( 11 | 'dsn' => 'mysql:host=localhost;dbname=fuel_test', 12 | 'username' => 'fuel_app', 13 | 'password' => 'super_secret_password', 14 | ), 15 | ), 16 | ); 17 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/top.php: -------------------------------------------------------------------------------- 1 | data["topics"] = Model_Topic::find("all", [ 9 | "where" => [ 10 | ["deleted_at", 0], 11 | ], 12 | "order_by" => [ 13 | ["id", "desc"] 14 | ], 15 | "limit" => 5 16 | ]); 17 | 18 | $this->template->title = __("top"); 19 | $this->template->content = View::forge('top', $this->data); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fuel/app/views/log.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
IDUAIP
id; ?>created_at); ?>ua; ?>ip; ?>
18 | 19 |
-------------------------------------------------------------------------------- /fuel/app/classes/controller/base.php: -------------------------------------------------------------------------------- 1 | template->user = Model_User::find("first", [ 19 | "where" => [ 20 | ["login_hash", Cookie::get("ad_user")], 21 | ["deleted_at", 0], 22 | ] 23 | ]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fuel/app/views/admin/topics/form.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 | 12 |
-------------------------------------------------------------------------------- /fuel/app/classes/model/log.php: -------------------------------------------------------------------------------- 1 | array( 16 | 'events' => array('before_insert'), 17 | 'mysql_timestamp' => false, 18 | ), 19 | 'Orm\Observer_UpdatedAt' => array( 20 | 'events' => array('before_update'), 21 | 'mysql_timestamp' => false, 22 | ), 23 | ); 24 | 25 | protected static $_table_name = 'logs'; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vulnerable Web App for Attack and Defense 2 | This web app was used at https://attack-and-defense.doorkeeper.jp/events/30847. 3 | 4 | ## Required 5 | 6 | - PHP 5.4 7 | - MySQL 8 | - composer 9 | - compass 10 | 11 | ## Setup 12 | 13 | create database user and database. default setting is adweb2/adweb2. 14 | then modify fuel/app/config/db.php. 15 | 16 | ``` shell 17 | $ git clone --recursive git@github.com:SECCON/a_and_d_web_nara.git 18 | $ composer install 19 | $ php oil r migrate 20 | ``` 21 | 22 | ## Create Admin User 23 | 24 | ``` shell 25 | $ php oil r user:createAdmin admin@example.com password 26 | ``` 27 | -------------------------------------------------------------------------------- /fuel/app/views/signin.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |
5 | 6 |
7 | 8 | "> 9 |
10 |
11 | 12 | 13 |
14 |

15 | 16 |
-------------------------------------------------------------------------------- /fuel/app/views/admin/signin.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |
5 | 6 |
7 | 8 | "> 9 |
10 |
11 | 12 | 13 |
14 |

15 | 16 |
-------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # temp files from editors 2 | *~ 3 | *.bak 4 | .DS_Store 5 | .buildpath 6 | .project 7 | .settings 8 | *.tmproj 9 | build 10 | .idea 11 | nbproject/ 12 | 13 | # hidden files created by Windows 14 | Thumbs.db 15 | desktop.ini 16 | 17 | # the composer package lock file and install directory 18 | /composer.lock 19 | /fuel/vendor 20 | /fuel/packages 21 | !/fuel/packages/autoload.php 22 | 23 | # any of the fuel packages installed by default 24 | 25 | /fuel/core/ 26 | 27 | # dynamically generated files 28 | /fuel/app/logs/*/*/* 29 | /fuel/app/cache/*/* 30 | /fuel/app/config/crypt.php 31 | 32 | /.sass-cache 33 | 34 | /fuel/app/config/development/migrations.php 35 | 36 | /public/files/* 37 | !/public/files/index.html 38 | 39 | /docs/* -------------------------------------------------------------------------------- /fuel/app/migrations/003_create_logs.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true), 11 | 'user_id' => array('constraint' => 11, 'type' => 'int'), 12 | 'ua' => array('type' => 'text'), 13 | 'ip' => array('constraint' => 255, 'type' => 'varchar'), 14 | 'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 15 | 'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 16 | 17 | ), array('id')); 18 | } 19 | 20 | public function down() 21 | { 22 | \DBUtil::drop_table('logs'); 23 | } 24 | } -------------------------------------------------------------------------------- /fuel/app/migrations/002_create_topics.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true), 11 | 'title' => array('constraint' => 255, 'type' => 'varchar'), 12 | 'body' => array('type' => 'text'), 13 | 'deleted_at' => array('constraint' => 11, 'type' => 'int', 'default' => '0'), 14 | 'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 15 | 'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 16 | 17 | ), array('id')); 18 | } 19 | 20 | public function down() 21 | { 22 | \DBUtil::drop_table('topics'); 23 | } 24 | } -------------------------------------------------------------------------------- /fuel/app/classes/model/inquiry.php: -------------------------------------------------------------------------------- 1 | [ 12 | "default" => 0 13 | ], 14 | 'created_at', 15 | 'updated_at', 16 | ); 17 | 18 | protected static $_observers = array( 19 | 'Orm\Observer_CreatedAt' => array( 20 | 'events' => array('before_insert'), 21 | 'mysql_timestamp' => false, 22 | ), 23 | 'Orm\Observer_UpdatedAt' => array( 24 | 'events' => array('before_update'), 25 | 'mysql_timestamp' => false, 26 | ), 27 | ); 28 | 29 | protected static $_table_name = 'inquiries'; 30 | 31 | 32 | public function safeDelete() 33 | { 34 | $this->deleted_at = time(); 35 | $this->save(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/log.php: -------------------------------------------------------------------------------- 1 | "", 13 | 'uri_segment'=>"p", 14 | 'num_links'=>9, 15 | 'per_page'=>100, 16 | 'total_items'=>$count, 17 | ]; 18 | 19 | $this->data["pager"] = Pagination::forge('mypagination', $config); 20 | 21 | $logs = Model_Log::find("all", [ 22 | "order_by" => [ 23 | ["id", "desc"] 24 | ], 25 | "limit" => $this->data["pager"]->per_page, 26 | "offset" => $this->data["pager"]->offset 27 | 28 | ]); 29 | 30 | $this->template->title = __("access_log"); 31 | $view = View::forge('log', $this->data); 32 | $view->set_safe("logs", $logs); 33 | $this->template->content = $view; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /fuel/app/views/inquiries/form.php: -------------------------------------------------------------------------------- 1 |

2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | 18 |
19 | 20 |
-------------------------------------------------------------------------------- /fuel/app/views/admin/customers/index.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
ID

TEL
id; ?>user->name; ?>kana; ?>
name; ?>
email; ?>
tel; ?>
created_at); ?>
22 | 23 |
-------------------------------------------------------------------------------- /fuel/app/views/company.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
福岡県福岡市博多区博多駅西○ー●
 攻防 太郎
5
○○
怪物と闘う者は、その過程で自らが怪物と化さぬよう心せよ。おまえが長く深淵を覗くならば、深淵もまた等しくおまえを見返すのだ。
-------------------------------------------------------------------------------- /fuel/app/migrations/004_create_inquiries.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true), 11 | 'email' => array('constraint' => 255, 'type' => 'varchar'), 12 | 'name' => array('constraint' => 255, 'type' => 'varchar'), 13 | 'title' => array('constraint' => 255, 'type' => 'varchar'), 14 | 'body' => array('type' => 'text'), 15 | 'deleted_at' => array('constraint' => 11, 'type' => 'int', 'default' => '0'), 16 | 'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 17 | 'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 18 | 19 | ), array('id')); 20 | } 21 | 22 | public function down() 23 | { 24 | \DBUtil::drop_table('inquiries'); 25 | } 26 | } -------------------------------------------------------------------------------- /fuel/app/classes/controller/admin/inquiries.php: -------------------------------------------------------------------------------- 1 | [ 10 | ["deleted_at", 0] 11 | ] 12 | ]); 13 | 14 | $config= [ 15 | 'pagination_url'=>"", 16 | 'uri_segment'=>"p", 17 | 'num_links'=>9, 18 | 'per_page'=>20, 19 | 'total_items'=>$count, 20 | ]; 21 | 22 | $this->data["pager"] = Pagination::forge('mypagination', $config); 23 | 24 | $this->data["inquiries"] = Model_Inquiry::find("all", [ 25 | "where" => [ 26 | ["deleted_at", 0] 27 | ], 28 | "order_by" => [ 29 | ["id", "desc"] 30 | ], 31 | "limit" => $this->data["pager"]->per_page, 32 | "offset" => $this->data["pager"]->offset 33 | 34 | ]); 35 | 36 | $this->template->title = __("inquiry"); 37 | $this->template->content = View::forge('admin/inquiries/index', $this->data); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /fuel/app/views/admin/index.php: -------------------------------------------------------------------------------- 1 |

2 |
3 | 10 |
11 |

12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
ID
id; ?>title; ?>created_at); ?>
body; ?>
30 |
-------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | require 'compass/import-once/activate' 2 | # Require any additional compass plugins here. 3 | 4 | # Set this to the root of your project when deployed: 5 | http_path = "public" 6 | css_dir = "public/assets/css" 7 | sass_dir = "public/assets/sass" 8 | images_dir = "public/assets/img" 9 | javascripts_dir = "public/assets/js" 10 | 11 | # You can select your preferred output style here (can be overridden via the command line): 12 | output_style = :compressed 13 | 14 | # To enable relative paths to assets via compass helper functions. Uncomment: 15 | # relative_assets = true 16 | 17 | # To disable debugging comments that display the original location of your selectors. Uncomment: 18 | # line_comments = false 19 | 20 | 21 | # If you prefer the indented syntax, you might want to regenerate this 22 | # project again passing --syntax sass, or you can uncomment this: 23 | # preferred_syntax = :sass 24 | # and then run: 25 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 26 | -------------------------------------------------------------------------------- /fuel/app/classes/model/topic.php: -------------------------------------------------------------------------------- 1 | [ 10 | "default" => 0 11 | ], 12 | 'created_at', 13 | 'updated_at', 14 | ); 15 | 16 | protected static $_observers = array( 17 | 'Orm\Observer_CreatedAt' => array( 18 | 'events' => array('before_insert'), 19 | 'mysql_timestamp' => false, 20 | ), 21 | 'Orm\Observer_UpdatedAt' => array( 22 | 'events' => array('before_update'), 23 | 'mysql_timestamp' => false, 24 | ), 25 | ); 26 | 27 | protected static $_table_name = 'topics'; 28 | 29 | public static function validate() 30 | { 31 | $val = Validation::forge(); 32 | $val->add_field('title', 'Title', 'required|max_length[100]'); 33 | $val->add_field('body', 'Body', 'required'); 34 | return $val; 35 | } 36 | 37 | public function safeDelete() 38 | { 39 | $this->deleted_at = time(); 40 | $this->save(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /fuel/app/views/customers/index.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
ID

TEL
id; ?>kana; ?>
name; ?>
email; ?>
tel; ?>
created_at); ?>
23 | 24 |
-------------------------------------------------------------------------------- /fuel/app/bootstrap.php: -------------------------------------------------------------------------------- 1 | APPPATH.'classes/view.php', 8 | )); 9 | 10 | // Register the autoloader 11 | \Autoloader::register(); 12 | 13 | /** 14 | * Your environment. Can be set to any of the following: 15 | * 16 | * Fuel::DEVELOPMENT 17 | * Fuel::TEST 18 | * Fuel::STAGING 19 | * Fuel::PRODUCTION 20 | */ 21 | \Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : \Fuel::DEVELOPMENT); 22 | 23 | // Initialize the framework with the config file. 24 | \Fuel::init('config.php'); 25 | if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) 26 | { 27 | $languages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); 28 | if(isset($languages[0]) && preg_match('/^en/i', $languages[0])) 29 | { 30 | Config::set('language', 'en'); 31 | } 32 | else 33 | { 34 | Config::set('language', 'ja'); 35 | } 36 | } 37 | Lang::load('main'); 38 | -------------------------------------------------------------------------------- /fuel/app/migrations/006_create_customers.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true), 11 | 'name' => array('constraint' => 255, 'type' => 'varchar'), 12 | 'kana' => array('constraint' => 255, 'type' => 'varchar'), 13 | 'email' => array('constraint' => 255, 'type' => 'varchar'), 14 | 'tel' => array('constraint' => 255, 'type' => 'varchar'), 15 | 'zip_code' => array('constraint' => 255, 'type' => 'varchar'), 16 | 'prefecture_id' => array('constraint' => 255, 'type' => 'varchar'), 17 | 'address' => array('type' => 'text'), 18 | 'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 19 | 'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 20 | 21 | ), array('id')); 22 | } 23 | 24 | public function down() 25 | { 26 | \DBUtil::drop_table('customers'); 27 | } 28 | } -------------------------------------------------------------------------------- /fuel/app/classes/controller/inquiry.php: -------------------------------------------------------------------------------- 1 | template->title = __("inquiry"); 9 | 10 | if(Input::post("name") != null) 11 | { 12 | if(Input::post("kakunin", 0) == 1) 13 | { 14 | $time = time(); 15 | $name = DB::quote($_POST["name"]); //DB::quote()によりエスケープ 16 | $email = DB::quote($_POST["email"]); 17 | $title = DB::quote($_POST["title"]); 18 | $body = DB::quote($_POST["body"]); 19 | $sql = "INSERT INTO inquiries (`name`, `email`, `title`, `body`, `created_at`) VALUES ('{$name}','{$email}','{$title}','{$body}',{$time})"; 20 | $query = DB::query($sql)->execute(); 21 | 22 | $this->template->content = View::forge('inquiries/sent', $this->data); 23 | } 24 | else 25 | { 26 | $this->template->content = View::forge('inquiries/confirm', $this->data); 27 | } 28 | } 29 | else 30 | { 31 | $this->template->content = View::forge('inquiries/form', $this->data); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /fuel/app/views/admin/template.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?= $title; ?> | <?= __("com_name"); ?> 7 | 8 | 9 | 10 |
11 |
12 | 30, "height" => 30, "alt" => "a_and_d"]); ?> 13 | 14 | 23 |
24 |
25 |

26 | 27 |
28 | 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /fuel/app/views/admin/customers/detail.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | user->name; ?> 5 |
6 |
7 | 8 | email; ?> 9 |
10 |
11 | 12 | name; ?> 13 |
14 |
15 | 16 | kana; ?> 17 |
18 |
19 | 20 | zip_code; ?> 21 |
22 |
23 | 24 | prefecture_id]; ?> 25 |
26 |
27 | 28 | address; ?> 29 |
30 |
31 | 32 | tel; ?> 33 |
34 |
-------------------------------------------------------------------------------- /fuel/app/views/inquiries/confirm.php: -------------------------------------------------------------------------------- 1 |

2 |
3 | "> 4 | "> 5 | "> 6 | "> 7 | 8 |
9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 | 25 |
-------------------------------------------------------------------------------- /fuel/app/classes/model/customer.php: -------------------------------------------------------------------------------- 1 | [ 16 | "default" => 0 17 | ], 18 | 'created_at', 19 | 'updated_at', 20 | ); 21 | 22 | protected static $_observers = array( 23 | 'Orm\Observer_CreatedAt' => array( 24 | 'events' => array('before_insert'), 25 | 'mysql_timestamp' => false, 26 | ), 27 | 'Orm\Observer_UpdatedAt' => array( 28 | 'events' => array('before_update'), 29 | 'mysql_timestamp' => false, 30 | ), 31 | ); 32 | 33 | protected static $_belongs_to = array( 34 | 'user' => array( 35 | 'model_to' => 'Model_User', 36 | 'key_from' => 'user_id', 37 | 'key_to' => 'id', 38 | 'cascade_delete' => false, 39 | ), 40 | ); 41 | 42 | protected static $_table_name = 'customers'; 43 | 44 | public function safeDelete() 45 | { 46 | $this->deleted_at = time(); 47 | $this->save(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/admin.php: -------------------------------------------------------------------------------- 1 | template = View::forge("admin/template"); 9 | 10 | $this->template->user = Model_User::find("first", [ 11 | "where" => [ 12 | ["login_hash", Cookie::get("ad_user")], 13 | ["deleted_at", 0], 14 | ["group_id", 100] 15 | ] 16 | ]); 17 | 18 | if($this->template->user == null) 19 | { 20 | Response::redirect('/admin/signin'); 21 | } 22 | } 23 | 24 | public function action_index() 25 | { 26 | $this->data["topics"] = Model_Topic::find("all", [ 27 | "where" => [ 28 | ["deleted_at", 0], 29 | ], 30 | "order_by" => [ 31 | ["id", "desc"] 32 | ], 33 | "limit" => 5 34 | ]); 35 | 36 | $this->data["inquiries"] = Model_Inquiry::find("all", [ 37 | "where" => [ 38 | ["deleted_at", 0] 39 | ], 40 | "order_by" => [ 41 | ["id", "desc"] 42 | ], 43 | "limit" => 5 44 | 45 | ]); 46 | 47 | $this->template->title = __("dashboard"); 48 | $this->template->content = View::forge('admin/index', $this->data); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/signup.php: -------------------------------------------------------------------------------- 1 | data["errors"] = []; 9 | 10 | $this->data["prefectures"] = Config::get("prefectures.names"); 11 | 12 | if(Input::post("email", null) !== null && Security::check_token()) 13 | { 14 | if(count($this->data["errors"]) == 0) 15 | { 16 | $user = Model_User::forge(); 17 | $user->email = Input::post("email", null); 18 | $user->password = md5(Input::post("password", null)); 19 | $user->group_id = 1; 20 | $user->name = Input::post("name", null); 21 | $user->kana = Input::post("kana", null); 22 | $user->prefecture_id = (int)Input::post("prefecture_id", 0); 23 | $user->address = Input::post("address", null); 24 | $user->zip_code = Input::post("zip_code", null); 25 | $user->tel = Input::post("tel", null); 26 | $user->save(); 27 | 28 | Response::redirect("/signin"); 29 | } 30 | } 31 | 32 | $this->data = array_merge($this->data, Input::post()); 33 | 34 | $this->template->title = __("signup"); 35 | $this->template->content = View::forge('signup', $this->data); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/signin.php: -------------------------------------------------------------------------------- 1 | [ 17 | ["email", $email], 18 | ["password", $password] 19 | ] 20 | ]); 21 | 22 | if($user == null) 23 | { 24 | Response::redirect('/signin?error=1&email='. $email); 25 | } 26 | else 27 | { 28 | $user->login_hash = sha1($user->id . time()); 29 | $user->last_login = time(); 30 | $user->save(); 31 | 32 | $log = Model_Log::forge(); 33 | $log->user_id = $user->id; 34 | $log->ip = Input::ip(); 35 | $log->ua = Input::user_agent(); 36 | $log->save(); 37 | 38 | Cookie::set("ad_user", $user->login_hash); 39 | 40 | Response::redirect('/top'); 41 | } 42 | } 43 | } 44 | 45 | public function action_index() 46 | { 47 | $this->template->title = __("signin"); 48 | $this->template->content = View::forge('signin'); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/admin/api.php: -------------------------------------------------------------------------------- 1 | [ 16 | ["deleted_at", 0] 17 | ] 18 | ]); 19 | 20 | if($topic == null) 21 | { 22 | $this->response->set_status(400); 23 | } 24 | else 25 | { 26 | $topic->safeDelete(); 27 | } 28 | } 29 | 30 | public function post_deleteuser() 31 | { 32 | 33 | $user = Model_User::find((int)Input::post("id"), [ 34 | "where" => [ 35 | ["deleted_at", 0] 36 | ] 37 | ]); 38 | 39 | if($user == null) 40 | { 41 | $this->response->set_status(400); 42 | } 43 | else 44 | { 45 | $user->safeDelete(); 46 | } 47 | } 48 | 49 | public function post_deleteinquiry() 50 | { 51 | 52 | $inquiry = Model_Inquiry::find((int)Input::post("id"), [ 53 | "where" => [ 54 | ["deleted_at", 0] 55 | ] 56 | ]); 57 | 58 | if($inquiry == null) 59 | { 60 | $this->response->set_status(400); 61 | } 62 | else 63 | { 64 | $inquiry->safeDelete(); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /fuel/app/views/admin/topics/index.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
ID
id; ?>title; ?>created_at); ?>
21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/admin/signin.php: -------------------------------------------------------------------------------- 1 | [ 17 | ["email", $email], 18 | ["password", $password], 19 | ] 20 | ]); 21 | 22 | if($user != null) 23 | { 24 | $user = Model_User::find("first",[ 25 | "where" => [ 26 | ["email", $email], 27 | ["group_id", 100], 28 | ], 29 | "order_by" => [ 30 | ["id", "asc"] 31 | ] 32 | ]); 33 | } 34 | 35 | if($user == null) 36 | { 37 | Response::redirect('/admin/signin?error=1'); 38 | } 39 | else 40 | { 41 | $user->login_hash = sha1($user->id . time()); 42 | $user->last_login = time(); 43 | $user->save(); 44 | 45 | Cookie::set("ad_user", $user->login_hash); 46 | 47 | Response::redirect('/admin'); 48 | } 49 | } 50 | } 51 | 52 | public function action_index() 53 | { 54 | $this->template->title = __("signin"); 55 | $this->template->content = View::forge('admin/signin'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /fuel/app/migrations/001_create_users.php: -------------------------------------------------------------------------------- 1 | array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true), 11 | 'email' => array('constraint' => 255, 'type' => 'varchar'), 12 | 'password' => array('constraint' => 255, 'type' => 'varchar'), 13 | 'last_login' => array('constraint' => 11, 'type' => 'int'), 14 | 'login_hash' => array('constraint' => 255, 'type' => 'varchar'), 15 | 'deleted_at' => array('constraint' => 11, 'type' => 'int'), 16 | 'group_id' => array('constraint' => 11, 'type' => 'int'), 17 | 'name' => array('constraint' => 255, 'type' => 'varchar'), 18 | 'kana' => array('constraint' => 255, 'type' => 'varchar'), 19 | 'tel' => array('constraint' => 255, 'type' => 'varchar'), 20 | 'zip_code' => array('constraint' => 255, 'type' => 'varchar'), 21 | 'prefecture_id' => array('constraint' => 11, 'type' => 'int'), 22 | 'address' => array('type' => 'text'), 23 | 'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 24 | 'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true), 25 | 26 | ), array('id')); 27 | } 28 | 29 | public function down() 30 | { 31 | \DBUtil::drop_table('users'); 32 | } 33 | } -------------------------------------------------------------------------------- /fuel/app/views/admin/inquiries/index.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
ID
id; ?>title; ?>created_at); ?>
body; ?>
21 | 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/topics.php: -------------------------------------------------------------------------------- 1 | [ 11 | ["deleted_at", 0], 12 | ] 13 | ]); 14 | 15 | $config= [ 16 | 'pagination_url'=>"", 17 | 'uri_segment'=>"p", 18 | 'num_links'=>9, 19 | 'per_page'=>20, 20 | 'total_items'=>$count, 21 | ]; 22 | 23 | $this->data["pager"] = Pagination::forge('mypagination', $config); 24 | 25 | $this->data["topics"] = Model_Topic::find("all", [ 26 | "where" => [ 27 | ["deleted_at", 0], 28 | ], 29 | "order_by" => [ 30 | ["id", "desc"] 31 | ], 32 | "limit" => $this->data["pager"]->per_page, 33 | "offset" => $this->data["pager"]->offset 34 | 35 | ]); 36 | 37 | $this->template->title = __("topics"); 38 | $this->template->content = View::forge('topics/index', $this->data); 39 | } 40 | 41 | public function action_detail($id) 42 | { 43 | $this->data["topic"] = Model_Topic::find($id, [ 44 | "where" => [ 45 | ["deleted_at", 0], 46 | ], 47 | ]); 48 | 49 | if($this->data["topic"] == null) 50 | { 51 | Response::redirect(404); 52 | } 53 | 54 | $this->template->title = $this->data["topic"]->title . ' (' . date(__("date_style"), $this->data["topic"]->created_at) . ")"; 55 | $this->template->content = View::forge('topics/detail', $this->data); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /fuel/app/classes/model/user.php: -------------------------------------------------------------------------------- 1 | [ 10 | "default" => 0 11 | ], 12 | 'login_hash'=> [ 13 | "default" => "" 14 | ], 15 | 'deleted_at'=> [ 16 | "default" => 0 17 | ], 18 | 'group_id'=> [ 19 | "default" => 0 20 | ], 21 | 'name'=> [ 22 | "default" => "" 23 | ], 24 | 'kana'=> [ 25 | "default" => "" 26 | ], 27 | 'tel'=> [ 28 | "default" => "" 29 | ], 30 | 'zip_code' => [ 31 | "default" => "" 32 | ], 33 | 'prefecture_id'=> [ 34 | "default" => 0 35 | ], 36 | 'address'=> [ 37 | "default" => "" 38 | ], 39 | 'logo'=> [ 40 | "default" => "" 41 | ], 42 | 'created_at', 43 | 'updated_at', 44 | ); 45 | 46 | protected static $_observers = array( 47 | 'Orm\Observer_CreatedAt' => array( 48 | 'events' => array('before_insert'), 49 | 'mysql_timestamp' => false, 50 | ), 51 | 'Orm\Observer_UpdatedAt' => array( 52 | 'events' => array('before_update'), 53 | 'mysql_timestamp' => false, 54 | ), 55 | ); 56 | 57 | protected static $_table_name = 'users'; 58 | 59 | public function getGroup() 60 | { 61 | if((int)$this->group_id === 100) 62 | { 63 | return "Admin"; 64 | } 65 | else 66 | { 67 | return "User"; 68 | } 69 | } 70 | 71 | public function safeDelete() 72 | { 73 | $this->email = md5($this->email . time()); 74 | $this->deleted_at = time(); 75 | $this->save(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /fuel/app/views/template.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?= $title; ?> | <?= __("com_name"); ?> 7 | 8 | 9 | 10 |
11 |
12 | 13 | logo != ""): ?> 14 | 15 | 16 | 30, "height" => 30, "alt" => "a_and_d"]); ?> 17 | 18 | 19 | 20 | 37 |
38 |
39 |

40 | 41 |
42 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /fuel/app/views/admin/users/index.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
ID
id; ?>getGroup(); ?>name; ?>email; ?>created_at); ?>last_login); ?>
27 | 28 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /fuel/app/views/customers/form.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 | 36 |
-------------------------------------------------------------------------------- /fuel/app/config/rest.php: -------------------------------------------------------------------------------- 1 | 'json', 32 | 33 | /* 34 | | XML Basenode name 35 | | 36 | | Default: xml 37 | | 38 | */ 39 | 'xml_basenode' => 'xml', 40 | 41 | /* 42 | | Name for the password protected REST API displayed on login dialogs 43 | | 44 | | E.g: My Secret REST API 45 | | 46 | */ 47 | 'realm' => 'REST API', 48 | 49 | /* 50 | | Is login required and if so, which type of login? 51 | | 52 | | '' = no login required, 53 | | 'basic' = unsecure login, 54 | | 'digest' = more secure login 55 | | or define a method name in your REST controller that handles authorization 56 | | 57 | */ 58 | 'auth' => '', 59 | 60 | /* 61 | | array of usernames and passwords for login 62 | | 63 | | array('admin' => '1234') 64 | | 65 | */ 66 | 'valid_logins' => array('admin' => '1234'), 67 | 68 | /* 69 | | Ignore HTTP_ACCEPT 70 | | 71 | | A lot of work can go into detecting incoming data, 72 | | disabling this will speed up your requests if you do not use a ACCEPT header. 73 | | 74 | */ 75 | 'ignore_http_accept' => false, 76 | 77 | ); 78 | 79 | 80 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/admin/topics.php: -------------------------------------------------------------------------------- 1 | [ 10 | ["deleted_at", 0] 11 | ] 12 | ]); 13 | 14 | $config= [ 15 | 'pagination_url'=>"", 16 | 'uri_segment'=>"p", 17 | 'num_links'=>9, 18 | 'per_page'=>20, 19 | 'total_items'=>$count, 20 | ]; 21 | 22 | $this->data["pager"] = Pagination::forge('mypagination', $config); 23 | 24 | $this->data["topics"] = Model_Topic::find("all", [ 25 | "where" => [ 26 | ["deleted_at", 0] 27 | ], 28 | "order_by" => [ 29 | ["id", "desc"] 30 | ], 31 | "limit" => $this->data["pager"]->per_page, 32 | "offset" => $this->data["pager"]->offset 33 | 34 | ]); 35 | 36 | $this->template->title = __("topics"); 37 | $this->template->content = View::forge('admin/topics/index', $this->data); 38 | } 39 | 40 | public function action_edit($id = 0) 41 | { 42 | $topic = Model_Topic::find($id, [ 43 | "where" => [ 44 | ["deleted_at", 0] 45 | ] 46 | ]); 47 | 48 | if($topic == null) 49 | { 50 | $this->template->title = __("create"); 51 | $topic = Model_Topic::forge(); 52 | } 53 | else 54 | { 55 | $this->template->title = __("edit"); 56 | } 57 | 58 | if(Input::post("title", null) !== null && Security::check_token()) 59 | { 60 | $val = Model_Topic::validate(); 61 | if($val->run()) 62 | { 63 | $input = $val->input(); 64 | $topic->title = $input["title"]; 65 | $topic->body = $input["body"]; 66 | $topic->save(); 67 | } 68 | 69 | Response::redirect("admin/topics"); 70 | 71 | } 72 | 73 | $this->data["title"] = $topic["title"]; 74 | $this->data["body"] = $topic["body"]; 75 | 76 | $this->template->content = View::forge('admin/topics/form', $this->data); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /fuel/app/views/signup.php: -------------------------------------------------------------------------------- 1 |

2 |
3 | 4 |
5 | 6 | 7 |
8 |
9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 | 31 |
32 |
33 | 34 | 35 |
36 |
37 | 38 | 39 |
40 | 41 |
-------------------------------------------------------------------------------- /fuel/app/classes/controller/setting.php: -------------------------------------------------------------------------------- 1 | template->user == null) 9 | { 10 | Response::redirect(404); 11 | } 12 | 13 | $this->data["errors"] = []; 14 | 15 | $this->data["prefectures"] = Config::get("prefectures.names"); 16 | 17 | if(Input::post("email", null) !== null && Security::check_token()) 18 | { 19 | if(count($this->data["errors"]) == 0) 20 | { 21 | $this->template->user->email = Input::post("email", null); 22 | if(Input::post("password", null) != null)$this->template->user->password = md5(Input::post("password", null)); 23 | $this->template->user->name = Input::post("name", null); 24 | $this->template->user->kana = Input::post("kana", null); 25 | $this->template->user->prefecture_id = (int)Input::post("prefecture_id", 0); 26 | $this->template->user->address = Input::post("address", null); 27 | $this->template->user->zip_code = Input::post("zip_code", null); 28 | $this->template->user->tel = Input::post("tel", null); 29 | 30 | if(move_uploaded_file($_FILES['file']['tmp_name'], DOCROOT."/files/" . $_FILES['file']['name'])) 31 | { 32 | $this->template->user->logo = $_FILES['file']['name']; 33 | } 34 | 35 | $this->template->user->save(); 36 | } 37 | } 38 | 39 | $this->data["email"] = $this->template->user["email"]; 40 | $this->data["name"] = $this->template->user["name"]; 41 | $this->data["kana"] = $this->template->user["kana"]; 42 | $this->data["prefecture_id"] = $this->template->user["prefecture_id"]; 43 | $this->data["address"] = $this->template->user["address"]; 44 | $this->data["zip_code"] = $this->template->user["zip_code"]; 45 | $this->data["tel"] = $this->template->user["tel"]; 46 | $this->data["logo"] = $this->template->user["logo"]; 47 | 48 | $this->template->title = __("account_setting"); 49 | $this->template->content = View::forge('setting', $this->data); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /fuel/app/classes/controller/admin/customers.php: -------------------------------------------------------------------------------- 1 | template = View::forge("admin/template"); 9 | 10 | $this->template->user = Model_User::find("first", [ 11 | "where" => [ 12 | ["login_hash", Cookie::get("ad_user")], 13 | ["deleted_at", 0], 14 | ["group_id", 100] 15 | ] 16 | ]); 17 | 18 | } 19 | 20 | public function action_index() 21 | { 22 | if(Input::get("del_id", 0) != 0) 23 | { 24 | $del = Model_Customer::find(Input::get("del_id", 0)); 25 | if($del != null) 26 | { 27 | $del->delete(); 28 | } 29 | } 30 | 31 | $count = Model_Customer::count([ 32 | "where" => [ 33 | ["deleted_at", 0] 34 | ] 35 | ]); 36 | 37 | $config= [ 38 | 'pagination_url'=>"", 39 | 'uri_segment'=>"p", 40 | 'num_links'=>9, 41 | 'per_page'=>20, 42 | 'total_items'=>$count, 43 | ]; 44 | 45 | $this->data["pager"] = Pagination::forge('mypagination', $config); 46 | 47 | $this->data["customers"] = Model_Customer::find("all", [ 48 | "where" => [ 49 | ["deleted_at", 0] 50 | ], 51 | "order_by" => [ 52 | ["id", "desc"] 53 | ], 54 | "limit" => $this->data["pager"]->per_page, 55 | "offset" => $this->data["pager"]->offset 56 | 57 | ]); 58 | 59 | $this->template->title = __("customers"); 60 | $this->template->content = View::forge('admin/customers/index', $this->data); 61 | } 62 | 63 | public function action_detail($id = 0) 64 | { 65 | $this->data["prefectures"] = Config::get("prefectures.names"); 66 | 67 | $this->data["customer"] = Model_Customer::find($id, [ 68 | "where" => [ 69 | ["deleted_at", 0] 70 | ] 71 | ]); 72 | 73 | if($this->data["customer"] == null) 74 | { 75 | Response::redirect("admin/customers"); 76 | } 77 | else 78 | { 79 | 80 | } 81 | 82 | $this->template->title = __("customer"); 83 | $this->template->content = View::forge('admin/customers/detail', $this->data); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /oil: -------------------------------------------------------------------------------- 1 | 5 | 6 | RewriteEngine on 7 | 8 | # NOTICE: If you get a 404 play with combinations of the following commented out lines 9 | #AllowOverride All 10 | #RewriteBase /wherever/fuel/is 11 | 12 | # Make sure directory listing is disabled 13 | Options +FollowSymLinks -Indexes 14 | 15 | # Restrict your site to only one domain 16 | # !important USE ONLY ONE OPTION 17 | 18 | # Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines. 19 | #RewriteCond %{HTTPS} !=on 20 | #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] 21 | #RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 22 | 23 | # Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines. 24 | #RewriteCond %{HTTPS} !=on 25 | #RewriteCond %{HTTP_HOST} !^www\..+$ [NC] 26 | #RewriteCond %{HTTP_HOST} (.+)$ [NC] 27 | #RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] 28 | 29 | # Remove index.php from URL 30 | #RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$ 31 | #RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC] 32 | #RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L] 33 | 34 | # make HTTP Basic Authentication work on php5-fcgi installs 35 | 36 | RewriteCond %{HTTP:Authorization} . 37 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 38 | 39 | 40 | # Send request via index.php if not a real file or directory 41 | RewriteCond %{REQUEST_FILENAME} !-f 42 | RewriteCond %{REQUEST_FILENAME} !-d 43 | 44 | # deal with php5-cgi first 45 | 46 | RewriteRule ^(.*)$ index.php?/$1 [QSA,L] 47 | 48 | 49 | 50 | 51 | # for normal Apache installations 52 | 53 | RewriteRule ^(.*)$ index.php/$1 [L] 54 | 55 | 56 | # for Apache FGCI installations 57 | 58 | RewriteRule ^(.*)$ index.php?/$1 [QSA,L] 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /fuel/app/views/setting.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 37 |
38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 | 47 |
-------------------------------------------------------------------------------- /fuel/app/lang/ja/main.php: -------------------------------------------------------------------------------- 1 | "お知らせ一覧", 4 | "signup" => "ユーザ登録", 5 | "signin" => "ログイン", 6 | "com_name" => "エーアンドディー株式会社", 7 | "policy" => "プライバシーポリシー", 8 | "term" => "利用規約", 9 | "company" => "会社概要", 10 | "inquiry" => "お問い合わせ", 11 | "top" => "トップページ", 12 | "404" => "ページが見つかりません", 13 | "404_text" => "お探しのページが見つかりませんでした。", 14 | "最新のお知らせ", 15 | "new_inquiries" => "最新のお問い合わせ", 16 | "to_signup" => "ユーザ登録はこちら", 17 | "signin_failed" => "メールアドレスかパスワードが違います。", 18 | "signout" => "ログアウト", 19 | "date_style" => "Y/m/d", 20 | "datetime_style" => "Y/m/d H:i:s", 21 | "account_setting" => "アカウント情報変更", 22 | "email" => "メールアドレス", 23 | "password" => "パスワード", 24 | "name" => "名前", 25 | "kana" => "カナ", 26 | "zip_code" => "郵便番号", 27 | "prefecture" => "都道府県", 28 | "address" => "住所", 29 | "tel" => "TEL", 30 | "send" => "送信", 31 | "email_already_used" => "このメールアドレスは既に使われています", 32 | "image" => "画像", 33 | "delete" => "削除", 34 | "do_you_want_to_delete_it" => "消してよろしいですか?", 35 | "to_signin" => "ログイン画面へ", 36 | "signup_message" => "下記を入力してユーザ登録を完了してください。", 37 | "company_name" => "会社名", 38 | "company_address" => "所在地", 39 | "establishment" => "設立", 40 | "officer" => "役員", 41 | "guiding_precepts" => "社訓", 42 | "main_bank" => "取引銀行", 43 | "num_of_employees" => "従業員数", 44 | "business" => "事業内容", 45 | "bank" => "銀行", 46 | "establishment_date" => "2004年8月", 47 | "business_text" => "インターネットを使った顧客管理サービス", 48 | "CEO" => "代表取締役社長", 49 | "confirm" => "確認", 50 | "submit" => "確定する", 51 | "complete" => "完了", 52 | "title" => "タイトル", 53 | "body" => "本文", 54 | "inquiry_message" => "お問い合わせ内容をご記入ください。", 55 | "inquiry_message2" => "お問い合わせ内容をご確認ください。", 56 | "inquiry_thanks" => "お問い合わせ頂きありがとうございました。", 57 | "ダッシュボード", 58 | "users" => "ユーザ", 59 | "user" => "ユーザ", 60 | "edit" => "編集", 61 | "create" => "作成", 62 | "created_datetime" => "作成日", 63 | "last_login" => "最終ログイン", 64 | "group" => "グループ", 65 | "admin" => "管理者", 66 | "public" => "公開", 67 | "service" => "サービス内容", 68 | "service_text" => "本サービスは、お客様の顧客リストを
簡単に管理できる画期的なサービスです!
下の会員登録からぜひ使ってみて下さい!", 69 | "customers" => "顧客一覧", 70 | "customer" => "顧客", 71 | "access_log" => "アクセスログ", 72 | "logo" => "ロゴ", 73 | "login_date" => "ログイン日", 74 | "dashboard" => "ダッシュボード", 75 | "detail" => "詳細", 76 | ]; -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fuel/fuel", 3 | "type": "project", 4 | "description" : "FuelPHP is a simple, flexible, community driven PHP 5.3+ framework, based on the best ideas of other frameworks, with a fresh start!", 5 | "keywords": ["application", "website", "development", "framework", "PHP"], 6 | "license": "MIT", 7 | "repositories": [ 8 | { "type": "vcs", "url": "https://github.com/fuel/docs" }, 9 | { "type": "vcs", "url": "https://github.com/fuel/core" }, 10 | { "type": "vcs", "url": "https://github.com/fuel/auth" }, 11 | { "type": "vcs", "url": "https://github.com/fuel/email" }, 12 | { "type": "vcs", "url": "https://github.com/fuel/oil" }, 13 | { "type": "vcs", "url": "https://github.com/fuel/orm" }, 14 | { "type": "vcs", "url": "https://github.com/fuel/parser" } 15 | ], 16 | "require": { 17 | "php": ">=5.3.3", 18 | "composer/installers": "~1.0", 19 | "fuel/docs": "dev-1.7/master", 20 | "fuel/core": "dev-1.7/master", 21 | "fuel/auth": "dev-1.7/master", 22 | "fuel/email": "dev-1.7/master", 23 | "fuel/oil": "dev-1.7/master", 24 | "fuel/orm": "dev-1.7/master", 25 | "fuel/parser": "dev-1.7/master", 26 | "fuelphp/upload": "2.0.2", 27 | "monolog/monolog": "1.5.*", 28 | "michelf/php-markdown": "1.4.0" 29 | }, 30 | "suggest": { 31 | "dwoo/dwoo" : "Allow Dwoo templating with the Parser package", 32 | "mustache/mustache": "Allow Mustache templating with the Parser package", 33 | "smarty/smarty": "Allow Smarty templating with the Parser package", 34 | "twig/twig": "Allow Twig templating with the Parser package", 35 | "pyrocms/lex": "Allow Lex templating with the Parser package", 36 | "mthaml/mthaml": "Allow Haml templating with Twig supports with the Parser package" 37 | }, 38 | "config": { 39 | "vendor-dir": "fuel/vendor" 40 | }, 41 | "extra": { 42 | "installer-paths": { 43 | "fuel/{$name}": ["fuel/core"], 44 | "{$name}": ["fuel/docs"] 45 | } 46 | }, 47 | "scripts": { 48 | "post-install-cmd": [ 49 | "php oil r install" 50 | ] 51 | }, 52 | "minimum-stability": "stable" 53 | } 54 | -------------------------------------------------------------------------------- /fuel/app/views/admin/users/form.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 17 |
18 |
19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 | 36 |
37 |
38 | 39 | 44 |
45 |
46 | 47 | 48 |
49 |
50 | 51 | 52 |
53 | 54 |
-------------------------------------------------------------------------------- /fuel/app/lang/en/main.php: -------------------------------------------------------------------------------- 1 | "Topics", 4 | "signup" => "Sign up", 5 | "signin" => "Sign in", 6 | "com_name" => "A&D, Inc.", 7 | "policy" => "Privacy Policy", 8 | "term" => "Term", 9 | "company" => "Company", 10 | "inquiry" => "Inquiry", 11 | "top" => "Top", 12 | "404" => "Not found.", 13 | "404_text" => "Page not found.", 14 | "new_topics" => "New Topics", 15 | "new_inquiries" => "New Inquiries", 16 | "to_signup" => "Sign up is here", 17 | "signin_failed" => "Sign in failed.", 18 | "signout" => "Sign out", 19 | "date_style" => "m/d/Y", 20 | "datetime_style" => "m/d/Y H:i:s", 21 | "account_setting" => "Account Setting", 22 | "email" => "Email", 23 | "password" => "Password", 24 | "name" => "Name", 25 | "kana" => "Kana", 26 | "zip_code" => "Zip code", 27 | "prefecture" => "Prefecture", 28 | "address" => "Address", 29 | "tel" => "Phone", 30 | "send" => "Send", 31 | "email_already_used" => "This email is already used.", 32 | "image" => "Image", 33 | "delete" => "Delete", 34 | "do_you_want_to_delete_it" => "Do you want to delete it?", 35 | "to_signin" => "Sign in", 36 | "signup_message" => "Please fill below", 37 | "company_name" => "Company Name", 38 | "company_address" => "Address", 39 | "establishment" => "Establishment", 40 | "officer" => "Officer", 41 | "guiding_precepts" => "Guiding precepts", 42 | "main_bank" => "Main bank", 43 | "num_of_employees" => "Num of employees", 44 | "business" => "Business", 45 | "bank" => "Bank", 46 | "establishment_date" => "Oct, 2004.", 47 | "business_text" => "Customer management service", 48 | "CEO" => "CEO", 49 | "confirm" => "Confirm", 50 | "submit" => "Submit", 51 | "complete" => "Complete", 52 | "title" => "Title", 53 | "body" => "Body", 54 | "inquiry_message" => "Please fill bellow", 55 | "inquiry_message2" => "Please check bellow", 56 | "inquiry_thanks" => "Thank you!", 57 | "Dashboard", 58 | "users" => "Users", 59 | "user" => "User", 60 | "edit" => "Edit", 61 | "create" => "Create", 62 | "created_datetime" => "Created datetime", 63 | "last_login" => "Last Signin", 64 | "group" => "Group", 65 | "admin" => "Admin", 66 | "public" => "Public", 67 | "service" => "Our Service", 68 | "service_text" => "This service can management your customer infomation.
It's very easy!
Let's use our service!", 69 | "customers" => "Customers", 70 | "customer" => "Customer", 71 | "access_log" => "Access Log", 72 | "logo" => "Logo", 73 | "login_date" => "Datetime", 74 | "dashboard" => "Dashboard", 75 | "detail" => "Detail", 76 | ]; -------------------------------------------------------------------------------- /fuel/app/views/term.php: -------------------------------------------------------------------------------- 1 |
2 |

この利用規約(以下,「本規約」といいます。)は,エーアンドディー株式会社(以下,「当社」といいます。)がこのウェブサイト上で提供するサービス(以下,「本サービス」といいます。)の利用条件を定めるものです。登録ユーザーの皆さま(以下,「ユーザー」といいます。)には,本規約に従って,本サービスをご利用いただきます。

3 | 4 |

第1条(適用)

5 |

本規約は,ユーザーと当社との間の本サービスの利用に関わる一切の関係に適用されるものとします。

6 |

第2条(利用登録)

7 |

登録希望者が当社の定める方法によって利用登録を申請し,当社がこれを承認することによって,利用登録が完了するものとします。 8 | 当社は,利用登録の申請者に以下の事由があると判断した場合,利用登録の申請を承認しないことがあり,その理由については一切の開示義務を負わないものとします。
9 | (1)利用登録の申請に際して虚偽の事項を届け出た場合
10 | (2)本規約に違反したことがある者からの申請である場合
11 | (3)その他,当社が利用登録を相当でないと判断した場合

12 |

第3条(ユーザーIDおよびパスワードの管理)

13 |

ユーザーは,自己の責任において,本サービスのユーザーIDおよびパスワードを管理するものとします。 14 | ユーザーは,いかなる場合にも,ユーザーIDおよびパスワードを第三者に譲渡または貸与することはできません。当社は,ユーザーIDとパスワードの組み合わせが登録情報と一致してログインされた場合には,そのユーザーIDを登録しているユーザー自身による利用とみなします。

15 |

第4条(禁止事項)

16 |

ユーザーは,本サービスの利用にあたり,以下の行為をしてはなりません。
17 | (1)法令または公序良俗に違反する行為
18 | (2)犯罪行為に関連する行為
19 | (3)当社のサーバーまたはネットワークの機能を破壊したり,妨害したりする行為
20 | (4)当社のサービスの運営を妨害するおそれのある行為
21 | (5)他のユーザーに関する個人情報等を収集または蓄積する行為
22 | (6)他のユーザーに成りすます行為
23 | (7)当社のサービスに関連して,反社会的勢力に対して直接または間接に利益を供与する行為
24 | (8)その他,当社が不適切と判断する行為

25 |

第5条(本サービスの提供の停止等)

26 |

当社は,以下のいずれかの事由があると判断した場合,ユーザーに事前に通知することなく本サービスの全部または一部の提供を停止または中断することができるものとします。
27 | (1)本サービスにかかるコンピュータシステムの保守点検または更新を行う場合
28 | (2)地震,落雷,火災,停電または天災などの不可抗力により,本サービスの提供が困難となった場合
29 | (3)コンピュータまたは通信回線等が事故により停止した場合
30 | (4)その他,当社が本サービスの提供が困難と判断した場合
31 | 当社は,本サービスの提供の停止または中断により,ユーザーまたは第三者が被ったいかなる不利益または損害について,理由を問わず一切の責任を負わないものとします。

32 |

第6条(利用制限および登録抹消)

33 |

当社は,以下の場合には,事前の通知なく,ユーザーに対して,本サービスの全部もしくは一部の利用を制限し,またはユーザーとしての登録を抹消することができるものとします。
34 | (1)本規約のいずれかの条項に違反した場合
35 | (2)登録事項に虚偽の事実があることが判明した場合
36 | (3)その他,当社が本サービスの利用を適当でないと判断した場合
37 | 当社は,本条に基づき当社が行った行為によりユーザーに生じた損害について,
一切の責任を負いません。

38 |

第7条(免責事項)

39 |

当社の債務不履行責任は,当社の故意または重過失によらない場合には免責されるものとします。 40 | 当社は,何らかの理由によって責任を負う場合にも,通常生じうる損害の範囲内かつ有料サービスにおいては代金額(継続的サービスの場合には1か月分相当額)の範囲内においてのみ賠償の責任を負うものとします。 41 | 当社は,本サービスに関して,ユーザーと他のユーザーまたは第三者との間において生じた取引,連絡または紛争等について一切責任を負いません。

42 |

第8条(サービス内容の変更等)

43 |

当社は,ユーザーに通知することなく,本サービスの内容を変更しまたは本サービスの提供を中止することができるものとし,これによってユーザーに生じた損害について一切の責任を負いません。

44 |

第9条(利用規約の変更)

45 |

当社は,必要と判断した場合には,ユーザーに通知することなくいつでも本規約を変更することができるものとします。

46 |

第10条(通知または連絡)

47 |

ユーザーと当社との間の通知または連絡は,当社の定める方法によって行うものとします。

48 |

第11条(権利義務の譲渡の禁止)

49 |

ユーザーは,当社の書面による事前の承諾なく,利用契約上の地位または本規約に基づく権利もしくは義務を第三者に譲渡し,または担保に供することはできません。

50 | 51 |

第12条(準拠法・裁判管轄)

52 |

本規約の解釈にあたっては,日本法を準拠法とします。
53 | 本サービスに関して紛争が生じた場合には,当社の本店所在地を管轄する裁判所を専属的合意管轄とします。

54 |

以上

55 |
-------------------------------------------------------------------------------- /fuel/app/classes/controller/customers.php: -------------------------------------------------------------------------------- 1 | delete(); 14 | } 15 | } 16 | 17 | $count = Model_Customer::count([ 18 | "where" => [ 19 | ["deleted_at", 0], 20 | ["user_id", $this->template->user->id] 21 | ] 22 | ]); 23 | 24 | $config= [ 25 | 'pagination_url'=>"", 26 | 'uri_segment'=>"p", 27 | 'num_links'=>9, 28 | 'per_page'=>20, 29 | 'total_items'=>$count, 30 | ]; 31 | 32 | $this->data["pager"] = Pagination::forge('mypagination', $config); 33 | 34 | $this->data["customers"] = Model_Customer::find("all", [ 35 | "where" => [ 36 | ["deleted_at", 0], 37 | ["user_id", $this->template->user->id] 38 | ], 39 | "order_by" => [ 40 | ["id", "desc"] 41 | ], 42 | "limit" => $this->data["pager"]->per_page, 43 | "offset" => $this->data["pager"]->offset 44 | 45 | ]); 46 | 47 | $this->template->title = __("customers"); 48 | $this->template->content = View::forge('customers/index', $this->data); 49 | } 50 | 51 | public function action_edit($id = 0) 52 | { 53 | $this->data["prefectures"] = Config::get("prefectures.names"); 54 | 55 | $customer = Model_Customer::find($id, [ 56 | "where" => [ 57 | ["deleted_at", 0] 58 | ] 59 | ]); 60 | 61 | if($customer == null) 62 | { 63 | $customer = Model_Customer::forge(); 64 | $customer->user_id = $this->template->user->id; 65 | 66 | $this->template->title = __("create"); 67 | } 68 | else 69 | { 70 | $this->template->title = __("edit"); 71 | } 72 | 73 | if(Input::post("email", null) !== null && Security::check_token()) 74 | { 75 | 76 | $customer->email = Input::post("email", null); 77 | $customer->name = Input::post("name", null); 78 | $customer->kana = Input::post("kana", null); 79 | $customer->prefecture_id = (int)Input::post("prefecture_id", 0); 80 | $customer->tel = Input::post("tel", null); 81 | $customer->address = Input::post("address", null); 82 | $customer->zip_code = Input::post("zip_code", null); 83 | 84 | $customer->save(); 85 | 86 | Response::redirect("customers"); 87 | } 88 | 89 | $this->data["email"] = $customer["email"]; 90 | $this->data["name"] = $customer["name"]; 91 | $this->data["kana"] = $customer["kana"]; 92 | $this->data["tel"] = $customer["tel"]; 93 | $this->data["prefecture_id"] = $customer["prefecture_id"]; 94 | $this->data["address"] = $customer["address"]; 95 | $this->data["zip_code"] = $customer["zip_code"]; 96 | 97 | $this->template->content = View::forge('customers/form', $this->data); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /fuel/app/config/asset.php: -------------------------------------------------------------------------------- 1 | array('assets/'), 36 | 37 | /** 38 | * Asset Sub-folders 39 | * 40 | * Names for the img, js and css folders (inside the asset search path). 41 | * 42 | * Examples: 43 | * 44 | * img/ 45 | * js/ 46 | * css/ 47 | * 48 | * This MUST include the trailing slash ('/') 49 | */ 50 | 'img_dir' => 'img/', 51 | 'js_dir' => 'js/', 52 | 'css_dir' => 'css/', 53 | 54 | /** 55 | * You can also specify one or more per asset-type folders. You don't have 56 | * to specify all of them. * Each folder is a RELATIVE path from the url 57 | * speficied below: 58 | * 59 | * array('css' => 'assets/css/') 60 | * 61 | * These MUST include the trailing slash ('/') 62 | * 63 | * Paths specified here are expected to contain the assets they point to 64 | */ 65 | 'folders' => array( 66 | 'css' => array(), 67 | 'js' => array(), 68 | 'img' => array(), 69 | ), 70 | 71 | /** 72 | * URL to your Fuel root. Typically this will be your base URL: 73 | * 74 | * Config::get('base_url') 75 | * 76 | * These MUST include the trailing slash ('/') 77 | */ 78 | 'url' => Config::get('base_url'), 79 | 80 | /** 81 | * Whether to append the assets last modified timestamp to the url. 82 | * This will aid in asset caching, and is recommended. It will create 83 | * tags like this: 84 | * 85 | * 86 | */ 87 | 'add_mtime' => true, 88 | 89 | /** 90 | * The amount of indents to prefix to the generated asset tag(s). 91 | */ 92 | 'indent_level' => 1, 93 | 94 | /** 95 | * What to use for indenting. 96 | */ 97 | 'indent_with' => "\t", 98 | 99 | /** 100 | * What to do when an asset method is called without a group name. If true, it will 101 | * return the generated asset tag. If false, it will add it to the default group. 102 | */ 103 | 'auto_render' => true, 104 | 105 | /** 106 | * Set to true to prevent an exception from being throw when a file is not found. 107 | * The asset will then be skipped. 108 | */ 109 | 'fail_silently' => true, 110 | 111 | /** 112 | * When set to true, the Asset class will always true to resolve an asset URI 113 | * to a local asset, even if the asset URL is an absolute URL, for example 114 | * one that points to another hostname. 115 | */ 116 | 'always_resolve' => false, 117 | 118 | ); 119 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | translation : Config::get('routes.'.$route); 59 | 60 | if ($route instanceof Closure) 61 | { 62 | $response = $route(); 63 | 64 | if( ! $response instanceof Response) 65 | { 66 | $response = Response::forge($response); 67 | } 68 | } 69 | elseif ($e === false) 70 | { 71 | $response = Request::forge()->execute()->response(); 72 | } 73 | elseif ($route) 74 | { 75 | $response = Request::forge($route, false)->execute(array($e))->response(); 76 | } 77 | else 78 | { 79 | throw $e; 80 | } 81 | 82 | return $response; 83 | }; 84 | 85 | // Generate the request, execute it and send the output. 86 | try 87 | { 88 | // Boot the app... 89 | require APPPATH.'bootstrap.php'; 90 | 91 | // ... and execute the main request 92 | $response = $routerequest(); 93 | } 94 | catch (HttpNoAccessException $e) 95 | { 96 | $response = $routerequest('_403_', $e); 97 | } 98 | catch (HttpNotFoundException $e) 99 | { 100 | $response = $routerequest('_404_', $e); 101 | } 102 | catch (HttpServerErrorException $e) 103 | { 104 | $response = $routerequest('_500_', $e); 105 | } 106 | 107 | // This will add the execution time and memory usage to the output. 108 | // Comment this out if you don't use it. 109 | $response->body((string) $response); 110 | if (strpos($response->body(), '{exec_time}') !== false or strpos($response->body(), '{mem_usage}') !== false) 111 | { 112 | $bm = Profiler::app_total(); 113 | $response->body( 114 | str_replace( 115 | array('{exec_time}', '{mem_usage}'), 116 | array(round($bm[0], 4), round($bm[1] / pow(1024, 2), 3)), 117 | $response->body() 118 | ) 119 | ); 120 | } 121 | 122 | // Send the output to the client 123 | $response->send(true); 124 | -------------------------------------------------------------------------------- /public/assets/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2006, 2014 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD (Register as an anonymous module) 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // Node/CommonJS 14 | module.exports = factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (arguments.length > 1 && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setMilliseconds(t.getMilliseconds() + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}, 79 | // To prevent the for loop in the first place assign an empty array 80 | // in case there are no cookies at all. Also prevents odd result when 81 | // calling $.cookie(). 82 | cookies = document.cookie ? document.cookie.split('; ') : [], 83 | i = 0, 84 | l = cookies.length; 85 | 86 | for (; i < l; i++) { 87 | var parts = cookies[i].split('='), 88 | name = decode(parts.shift()), 89 | cookie = parts.join('='); 90 | 91 | if (key === name) { 92 | // If second argument (value) is a function it's a converter... 93 | result = read(cookie, value); 94 | break; 95 | } 96 | 97 | // Prevent storing a cookie that we couldn't decode. 98 | if (!key && (cookie = read(cookie)) !== undefined) { 99 | result[name] = cookie; 100 | } 101 | } 102 | 103 | return result; 104 | }; 105 | 106 | config.defaults = {}; 107 | 108 | $.removeCookie = function (key, options) { 109 | // Must not alter options, thus extending a fresh object... 110 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 111 | return !$.cookie(key); 112 | }; 113 | 114 | })); 115 | -------------------------------------------------------------------------------- /public/assets/css/style.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}html{height:100%;font-family:Meiryo , sans-serif}body{color:#666;font-size:14px;height:100%}a{text-decoration:none;color:#666}a:hover{opacity:0.6}header{overflow:hidden;*zoom:1;padding:1px 10%;background-color:#99F}header img{float:left;background-color:#fff;margin-right:10px}header li>a{float:left;width:150px;height:30px;font-size:12px;line-height:30px;text-align:center;background-color:#fff}.container{width:100%;height:100%;margin:0px auto}section{padding:20px 0px;min-height:70%}h1{font-size:26px;text-align:center;margin-bottom:20px;padding:5px}h2{font-size:18px;margin-bottom:10px;text-align:center}footer{margin-top:20px;text-align:center;color:#fff;background-color:#99F;padding:10px}footer div{padding-bottom:10px}footer a{color:#fff}button{cursor:pointer;display:block}button:hover{opacity:0.8}.normal-button{display:block;text-align:center;border:none;background-color:#99F;color:#fff;width:100px;height:30px;line-height:30px}.logout{float:right;margin-right:1px}label{display:block;float:left;width:150px;height:30px;line-height:20px;text-align:right;padding-right:10px}input{color:#666;width:300px;height:20px}select{color:#666}textarea{color:#666}.normal-form{width:600px;margin:20px auto}.normal-form fieldset{margin:10px}.center{margin:0 auto}.error{text-align:center;color:red;padding:10px}.create_button{display:block;text-align:center;font-size:14px;border:dotted #666 1px;width:150px;height:30px;margin:20px auto;line-height:30px}.normal-table{margin:20px auto}.normal-table th{border:solid #ccc 1px;width:200px;font-size:16px;padding:5px;background-color:#99F;color:#fff;text-align:center}.normal-table td{border:solid #ccc 1px;padding:10px}.normal-table .small{width:50px}.normal-table .middle{width:50px}.normal-textarea{width:300px;height:300px}.center{text-align:center}.topic{width:48%;float:right}.topic div{border:solid #99F 1px;padding:5px}section{overflow:hidden;*zoom:1}.content_box{border:solid #99F 1px;padding:20px;width:70%;margin:0 auto;text-align:center}.topic_list{text-align:center}.topic_list li{height:30px}.pagination{overflow:hidden;*zoom:1;margin:20px auto 0 auto;text-align:center;display:table}.pagination li{width:20px;display:block;float:left}.header_user>a{font-size:18px;float:right;width:300px;text-align:right;margin-right:50px;color:#fff;background-color:#99F}h3{text-align:center;margin:25px auto 10px auto;border-bottom:1px solid #99F;padding-bottom:5px}.policy{width:800px;margin:20px auto}.policy .over{margin-top:30px;text-align:right}.company{width:500px;margin:0 auto}.company tr{height:30px}.company td,.company th{padding:20px;border:solid 1px #ccc}.company th{background-color:#99F;color:#fff}.big-button{display:block;width:300px;margin:20px auto;font-size:20px;height:30px;line-height:30px;background-color:#99F;color:#fff;border:none;text-align:center}.prof_table{width:300px;margin:20px auto}.prof_table th{width:100px;background-color:#99F;color:#fff}.prof_table th,.prof_table td{padding:10px;border:solid 1px #ccc} 2 | -------------------------------------------------------------------------------- /fuel/app/views/policy.php: -------------------------------------------------------------------------------- 1 |
2 |

エーアンドディー株式会社(以下,「当社」といいます。)は,本ウェブサイト上で提供するサービス(以下,「本サービス」といいます。)におけるプライバシー情報の取扱いについて,以下のとおりプライバシーポリシー(以下,「本ポリシー」といいます。)を定めます。

3 |

第1条(プライバシー情報)

4 | 5 |

プライバシー情報のうち「個人情報」とは,個人情報保護法にいう「個人情報」を指すものとし,生存する個人に関する情報であって,当該情報に含まれる氏名,生年月日,住所,電話番号,連絡先その他の記述等により特定の個人を識別できる情報を指します。
6 | プライバシー情報のうち「履歴情報および特性情報」とは,上記に定める「個人情報」以外のものをいい,ご利用いただいたサービスやご購入いただいた商品,ご覧になったページや広告の履歴,ユーザーが検索された検索キーワード,ご利用日時,ご利用の方法,ご利用環境,郵便番号や性別,職業,年齢,ユーザーのIPアドレス,クッキー情報,位置情報,端末の個体識別情報などを指します。

7 |

第2条(プライバシー情報の収集方法)

8 |

当社は,ユーザーが利用登録をする際に氏名,生年月日,住所,電話番号,メールアドレス,銀行口座番号,クレジットカード番号,運転免許証番号などの個人情報をお尋ねすることがあります。また,ユーザーと提携先などとの間でなされたユーザーの個人情報を含む取引記録や,決済に関する情報を当社の提携先(情報提供元,広告主,広告配信先などを含みます。以下,「提携先」といいます。)などから収集することがあります。
9 | 当社は,ユーザーについて,利用したサービスやソフトウエア,購入した商品,閲覧したページや広告の履歴,検索した検索キーワード,利用日時,利用方法,利用環境(携帯端末を通じてご利用の場合の当該端末の通信状態,利用に際しての各種設定情報なども含みます),IPアドレス,クッキー情報,位置情報,端末の個体識別情報などの履歴情報および特性情報を,ユーザーが当社や提携先のサービスを利用しまたはページを閲覧する際に収集します。

10 |

第3条(個人情報を収集・利用する目的)

11 |

当社が個人情報を収集・利用する目的は,以下のとおりです。
12 | (1)ユーザーに自分の登録情報の閲覧や修正,利用状況の閲覧を行っていただくために,氏名,住所,連絡先,支払方法などの登録情報,利用されたサービスや購入された商品,およびそれらの代金などに関する情報を表示する目的
13 | (2)ユーザーにお知らせや連絡をするためにメールアドレスを利用する場合やユーザーに商品を送付したり必要に応じて連絡したりするため,氏名や住所などの連絡先情報を利用する目的
14 | (3)ユーザーの本人確認を行うために,氏名,生年月日,住所,電話番号,銀行口座番号,クレジットカード番号,運転免許証番号,配達証明付き郵便の到達結果などの情報を利用する目的
15 | (4)ユーザーに代金を請求するために,購入された商品名や数量,利用されたサービスの種類や期間,回数,請求金額,氏名,住所,銀行口座番号やクレジットカード番号などの支払に関する情報などを利用する目的
16 | (5)ユーザーが簡便にデータを入力できるようにするために,当社に登録されている情報を入力画面に表示させたり,ユーザーのご指示に基づいて他のサービスなど(提携先が提供するものも含みます)に転送したりする目的
17 | (6)代金の支払を遅滞したり第三者に損害を発生させたりするなど,本サービスの利用規約に違反したユーザーや,不正・不当な目的でサービスを利用しようとするユーザーの利用をお断りするために,利用態様,氏名や住所など個人を特定するための情報を利用する目的
18 | (7)ユーザーからのお問い合わせに対応するために,お問い合わせ内容や代金の請求に関する情報など当社がユーザーに対してサービスを提供するにあたって必要となる情報や,ユーザーのサービス利用状況,連絡先情報などを利用する目的
19 | (8)上記の利用目的に付随する目的

20 |

第4条(個人情報の第三者提供)

21 |

当社は,次に掲げる場合を除いて,あらかじめユーザーの同意を得ることなく,第三者に個人情報を提供することはありません。ただし,個人情報保護法その他の法令で認められる場合を除きます。
22 | (1)法令に基づく場合
23 | (2)人の生命,身体または財産の保護のために必要がある場合であって,本人の同意を得ることが困難であるとき
24 | (3)公衆衛生の向上または児童の健全な育成の推進のために特に必要がある場合であって,本人の同意を得ることが困難であるとき
25 | (4)国の機関もしくは地方公共団体またはその委託を受けた者が法令の定める事務を遂行することに対して協力する必要がある場合であって,本人の同意を得ることにより当該事務の遂行に支障を及ぼすおそれがあるとき
26 | (5)予め次の事項を告知あるいは公表をしている場合
27 | 1.利用目的に第三者への提供を含むこと
28 | 2.第三者に提供されるデータの項目
29 | 3.第三者への提供の手段または方法
30 | 4.本人の求めに応じて個人情報の第三者への提供を停止すること
31 | 前項の定めにかかわらず,次に掲げる場合は第三者には該当しないものとします。
32 | (1)当社が利用目的の達成に必要な範囲内において個人情報の取扱いの全部または一部を委託する場合
33 | (2)合併その他の事由による事業の承継に伴って個人情報が提供される場合
34 | (3)個人情報を特定の者との間で共同して利用する場合であって,その旨並びに共同して利用される個人情報の項目,共同して利用する者の範囲,利用する者の利用目的および当該個人情報の管理について責任を有する者の氏名または名称について,あらかじめ本人に通知し,または本人が容易に知り得る状態に置いているとき

35 |

第5条(個人情報の開示)

36 |

当社は,本人から個人情報の開示を求められたときは,本人に対し,遅滞なくこれを開示します。ただし,開示することにより次のいずれかに該当する場合は,その全部または一部を開示しないこともあり,開示しない決定をした場合には,その旨を遅滞なく通知します。なお,個人情報の開示に際しては,1件あたり1,000円の手数料を申し受けます。
37 | (1)本人または第三者の生命,身体,財産その他の権利利益を害するおそれがある場合
38 | (2)当社の業務の適正な実施に著しい支障を及ぼすおそれがある場合
39 | (3)その他法令に違反することとなる場合
40 | 前項の定めにかかわらず,履歴情報および特性情報などの個人情報以外の情報については,原則として開示いたしません。

41 |

第6条(個人情報の訂正および削除)

42 |

ユーザーは,当社の保有する自己の個人情報が誤った情報である場合には,当社が定める手続きにより,当社に対して個人情報の訂正または削除を請求することができます。
43 | 当社は,ユーザーから前項の請求を受けてその請求に応じる必要があると判断した場合には,遅滞なく,当該個人情報の訂正または削除を行い,これをユーザーに通知します。

44 |

第7条(個人情報の利用停止等)

45 |

当社は,本人から,個人情報が,利用目的の範囲を超えて取り扱われているという理由,または不正の手段により取得されたものであるという理由により,その利用の停止または消去(以下,「利用停止等」といいます。)を求められた場合には,遅滞なく必要な調査を行い,その結果に基づき,個人情報の利用停止等を行い,その旨本人に通知します。ただし,個人情報の利用停止等に多額の費用を有する場合その他利用停止等を行うことが困難な場合であって,本人の権利利益を保護するために必要なこれに代わるべき措置をとれる場合は,この代替策を講じます。

46 |

第8条(プライバシーポリシーの変更)

47 |

本ポリシーの内容は,ユーザーに通知することなく,変更することができるものとします。 48 | 当社が別途定める場合を除いて,変更後のプライバシーポリシーは,本ウェブサイトに掲載したときから効力を生じるものとします。

49 |

第9条(お問い合わせ窓口)

50 |

本ポリシーに関するお問い合わせは,下記の窓口までお願いいたします。
51 | 住所:福岡県福岡市博多区博多駅東のあたり
52 | 社名:エーアンドディー株式会社
53 | 担当部署:総務部 佐藤
54 | Eメールアドレス:satou@attack-and-defense.xxx

55 |

以上

56 |
-------------------------------------------------------------------------------- /fuel/app/classes/controller/admin/users.php: -------------------------------------------------------------------------------- 1 | [ 10 | ["deleted_at", 0] 11 | ] 12 | ]); 13 | 14 | $config= [ 15 | 'pagination_url'=>"", 16 | 'uri_segment'=>"p", 17 | 'num_links'=>9, 18 | 'per_page'=>20, 19 | 'total_items'=>$count, 20 | ]; 21 | 22 | $this->data["pager"] = Pagination::forge('mypagination', $config); 23 | 24 | $this->data["users"] = Model_User::find("all", [ 25 | "where" => [ 26 | ["deleted_at", 0] 27 | ], 28 | "order_by" => [ 29 | ["id", "desc"] 30 | ], 31 | "limit" => $this->data["pager"]->per_page, 32 | "offset" => $this->data["pager"]->offset 33 | 34 | ]); 35 | 36 | $this->template->title = __("users"); 37 | $this->template->content = View::forge('admin/users/index', $this->data); 38 | } 39 | 40 | public function action_create() 41 | { 42 | $this->data["errors"] = []; 43 | 44 | $this->data["prefectures"] = Config::get("prefectures.names"); 45 | 46 | if(Input::post("email", null) !== null && Security::check_token()) 47 | { 48 | if(!Model_User::checkEmail(Input::post("email", null))) 49 | { 50 | $this->data["errors"]["email"] = 1; 51 | } 52 | 53 | if(count($this->data["errors"]) == 0) 54 | { 55 | $user = Model_User::forge(); 56 | $user->email = Input::post("email", null); 57 | $user->password = md5(Input::post("password", null)); 58 | $user->group_id = (int)Input::post("group_id", 0); 59 | $user->name = Input::post("name", null); 60 | $user->kana = Input::post("kana", null); 61 | $user->prefecture_id = (int)Input::post("prefecture_id", 0); 62 | $user->tel = Input::post("tel", null); 63 | $user->address = Input::post("address", null); 64 | $user->zip_code = Input::post("zip_code", null); 65 | $user->save(); 66 | 67 | Response::redirect("admin/users"); 68 | } 69 | } 70 | 71 | $this->data = array_merge($this->data, Input::post()); 72 | 73 | $this->template->title = __("create"); 74 | $this->template->content = View::forge('admin/users/form', $this->data); 75 | } 76 | 77 | public function action_update($id = 0) 78 | { 79 | $this->data["errors"] = []; 80 | 81 | $this->data["prefectures"] = Config::get("prefectures.names"); 82 | 83 | $user = Model_User::find($id, [ 84 | "where" => [ 85 | ["deleted_at", 0] 86 | ] 87 | ]); 88 | 89 | if($user == null) 90 | { 91 | Response::redirect("admin/users"); 92 | } 93 | 94 | if(Input::post("email", null) !== null && Security::check_token()) 95 | { 96 | 97 | if(count($this->data["errors"]) == 0) 98 | { 99 | $user->email = Input::post("email", null); 100 | if(Input::post("password", null) != null) $user->password = md5(Input::post("password", null)); 101 | $user->group_id = (int)Input::post("group_id", 0); 102 | $user->name = Input::post("name", null); 103 | $user->kana = Input::post("kana", null); 104 | $user->prefecture_id = (int)Input::post("prefecture_id", 0); 105 | $user->tel = Input::post("tel", null); 106 | $user->address = Input::post("address", null); 107 | $user->zip_code = Input::post("zip_code", null); 108 | 109 | 110 | if(move_uploaded_file($_FILES['file']['tmp_name'], DOCROOT."/files/" . $_FILES['file']['name'])) 111 | { 112 | $user->logo = $_FILES['file']['name']; 113 | } 114 | 115 | $user->save(); 116 | 117 | Response::redirect("admin/users"); 118 | } 119 | } 120 | 121 | $this->data["email"] = $user["email"]; 122 | $this->data["group_id"] = $user["group_id"]; 123 | $this->data["name"] = $user["name"]; 124 | $this->data["kana"] = $user["kana"]; 125 | $this->data["tel"] = $user["tel"]; 126 | $this->data["prefecture_id"] = $user["prefecture_id"]; 127 | $this->data["address"] = $user["address"]; 128 | $this->data["zip_code"] = $user["zip_code"]; 129 | $this->data["logo"] = $user["logo"]; 130 | 131 | $this->template->title = __("edit"); 132 | $this->template->content = View::forge('admin/users/form', $this->data); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /fuel/app/config/session.php: -------------------------------------------------------------------------------- 1 | true, 31 | 32 | // if no session type is requested, use the default 33 | 'driver' => 'cookie', 34 | 35 | // check for an IP address match after loading the cookie (optional, default = false) 36 | 'match_ip' => false, 37 | 38 | // check for a user agent match after loading the cookie (optional, default = true) 39 | 'match_ua' => true, 40 | 41 | // cookie domain (optional, default = '') 42 | 'cookie_domain' => '', 43 | 44 | // cookie path (optional, default = '/') 45 | 'cookie_path' => '/', 46 | 47 | // cookie http_only flag (optional, default = use the cookie class default) 48 | 'cookie_http_only' => null, 49 | 50 | // whether or not to encrypt the session cookie (optional, default is true) 51 | 'encrypt_cookie' => true, 52 | 53 | // if true, the session expires when the browser is closed (optional, default = false) 54 | 'expire_on_close' => false, 55 | 56 | // session expiration time, <= 0 means 2 years! (optional, default = 2 hours) 57 | 'expiration_time' => 14400000, 58 | 59 | // session ID rotation time (optional, default = 300) 60 | 'rotation_time' => 300, 61 | 62 | // default ID for flash variables (optional, default = 'flash') 63 | 'flash_id' => 'flash', 64 | 65 | // if false, expire flash values only after it's used (optional, default = true) 66 | 'flash_auto_expire' => true, 67 | 68 | // if true, a get_flash() automatically expires the flash data 69 | 'flash_expire_after_get' => true, 70 | 71 | // for requests that don't support cookies (i.e. flash), use this POST variable to pass the cookie to the session driver 72 | 'post_cookie_name' => '', 73 | 74 | // for requests in which you don't want to use cookies, use an HTTP header by this name to pass the cookie to the session driver 75 | 'header_header_name' => 'Session-Id', 76 | 77 | // if false, no cookie will be added to the response send back to the client 78 | 'enable_cookie' => true, 79 | 80 | /** 81 | * specific driver configurations. to override a global setting, just add it to the driver config with a different value 82 | */ 83 | 84 | // special configuration settings for cookie based sessions 85 | 'cookie' => array( 86 | 'cookie_name' => 'fuelcid', // name of the session cookie for cookie based sessions 87 | ), 88 | 89 | // specific configuration settings for file based sessions 90 | 'file' => array( 91 | 'cookie_name' => 'fuelfid', // name of the session cookie for file based sessions 92 | 'path' => '/tmp', // path where the session files should be stored 93 | 'gc_probability' => 5 // probability % (between 0 and 100) for garbage collection 94 | ), 95 | 96 | // specific configuration settings for memcached based sessions 97 | 'memcached' => array( 98 | 'cookie_name' => 'fuelmid', // name of the session cookie for memcached based sessions 99 | 'servers' => array( // array of servers and portnumbers that run the memcached service 100 | 'default' => array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100) 101 | ), 102 | ), 103 | 104 | // specific configuration settings for database based sessions 105 | 'db' => array( 106 | 'cookie_name' => 'fueldid', // name of the session cookie for database based sessions 107 | 'database' => null, // name of the database name (as configured in config/db.php) 108 | 'table' => 'sessions', // name of the sessions table 109 | 'gc_probability' => 5 // probability % (between 0 and 100) for garbage collection 110 | ), 111 | 112 | // specific configuration settings for redis based sessions 113 | 'redis' => array( 114 | 'cookie_name' => 'fuelrid', // name of the session cookie for redis based sessions 115 | 'database' => 'default' // name of the redis database to use (as configured in config/db.php) 116 | ) 117 | ); 118 | 119 | 120 | -------------------------------------------------------------------------------- /public/assets/sass/style.scss: -------------------------------------------------------------------------------- 1 | @import "compass"; 2 | @import "compass/reset/"; 3 | 4 | $font-color: #666; 5 | $error-font-color: #f00; 6 | $bg-color: #99F; 7 | $main-font-size: 14px; 8 | $title-font-size: 26px; 9 | $main-width: 100%; 10 | 11 | html{ 12 | height: 100%; 13 | font-family: Meiryo , sans-serif; 14 | } 15 | 16 | body{ 17 | color: $font-color; 18 | font-size: $main-font-size; 19 | height: 100%; 20 | } 21 | 22 | a{ 23 | text-decoration: none; 24 | color: $font-color; 25 | } 26 | 27 | a:hover{ 28 | opacity: 0.6; 29 | } 30 | 31 | header{ 32 | @include clearfix; 33 | img{ 34 | float: left; 35 | background-color: #fff; 36 | margin-right: 10px; 37 | } 38 | 39 | li > a{ 40 | float: left; 41 | width: 150px; 42 | height: 30px; 43 | font-size: 12px; 44 | line-height: 30px; 45 | text-align: center; 46 | background-color: #fff; 47 | } 48 | padding: 1px 10%; 49 | background-color: $bg-color; 50 | } 51 | 52 | .container{ 53 | width: $main-width; 54 | height: 100%; 55 | margin: 0px auto; 56 | } 57 | 58 | section{ 59 | padding: 20px 0px; 60 | min-height: 70%; 61 | } 62 | 63 | h1{ 64 | font-size: $title-font-size; 65 | text-align: center; 66 | margin-bottom: 20px; 67 | padding: 5px; 68 | } 69 | 70 | h2{ 71 | font-size: 18px; 72 | margin-bottom: 10px; 73 | text-align: center; 74 | } 75 | 76 | footer{ 77 | margin-top: 20px; 78 | text-align: center; 79 | color: #fff; 80 | background-color: $bg-color; 81 | padding: 10px; 82 | div{ 83 | padding-bottom: 10px; 84 | } 85 | a{ 86 | color: #fff; 87 | } 88 | } 89 | 90 | button{ 91 | cursor: pointer; 92 | display: block; 93 | } 94 | 95 | button:hover{ 96 | opacity: 0.8; 97 | } 98 | 99 | .normal-button{ 100 | display: block; 101 | text-align: center; 102 | border: none; 103 | background-color: $bg-color; 104 | color: #fff; 105 | width: 100px; 106 | height: 30px; 107 | line-height: 30px; 108 | } 109 | 110 | .logout{ 111 | float: right; 112 | margin-right: 1px; 113 | } 114 | 115 | label{ 116 | display: block; 117 | float: left; 118 | width: 150px; 119 | height: 30px; 120 | line-height: 20px; 121 | text-align: right; 122 | padding-right: 10px; 123 | } 124 | 125 | input{ 126 | color: $font-color; 127 | width: 300px; 128 | height: 20px; 129 | } 130 | 131 | select{ 132 | color: $font-color; 133 | } 134 | 135 | textarea{ 136 | color: $font-color; 137 | } 138 | 139 | .normal-form{ 140 | width: 600px; 141 | margin: 20px auto; 142 | fieldset{ 143 | margin: 10px; 144 | } 145 | } 146 | 147 | .center{ 148 | margin: 0 auto; 149 | } 150 | 151 | .error{ 152 | text-align: center; 153 | color: $error-font-color; 154 | padding: 10px; 155 | } 156 | 157 | .create_button{ 158 | display: block; 159 | text-align: center; 160 | font-size: 14px; 161 | border: dotted $font-color 1px; 162 | width: 150px; 163 | height: 30px; 164 | margin: 20px auto; 165 | line-height: 30px; 166 | } 167 | 168 | .normal-table{ 169 | margin: 20px auto; 170 | th{ 171 | border: solid #ccc 1px; 172 | width: 200px; 173 | font-size: 16px; 174 | padding: 5px; 175 | background-color: $bg-color; 176 | color: #fff; 177 | text-align: center; 178 | } 179 | td{ 180 | border: solid #ccc 1px; 181 | padding: 10px; 182 | } 183 | .small{ 184 | width: 50px; 185 | } 186 | .middle{ 187 | width: 50px; 188 | } 189 | } 190 | 191 | .normal-textarea{ 192 | width: 300px; 193 | height: 300px; 194 | } 195 | 196 | .center{ 197 | text-align: center; 198 | } 199 | 200 | .topic{ 201 | div{ 202 | border: solid $bg-color 1px; 203 | padding: 5px; 204 | } 205 | width: 48%; 206 | float: right; 207 | } 208 | 209 | section{ 210 | @include clearfix; 211 | } 212 | 213 | .content_box{ 214 | border: solid $bg-color 1px; 215 | padding: 20px; 216 | width: 70%; 217 | margin: 0 auto; 218 | text-align: center; 219 | } 220 | 221 | .topic_list{ 222 | text-align: center; 223 | 224 | li{ 225 | height: 30px; 226 | } 227 | } 228 | 229 | .pagination{ 230 | @include clearfix; 231 | margin: 20px auto 0 auto; 232 | text-align: center; 233 | display: table; 234 | li{ 235 | width: 20px; 236 | display: block; 237 | float: left; 238 | } 239 | } 240 | 241 | .header_user > a{ 242 | font-size: 18px; 243 | float: right; 244 | width: 300px; 245 | text-align: right; 246 | margin-right: 50px; 247 | color: #fff; 248 | background-color: $bg-color; 249 | } 250 | 251 | h3{ 252 | text-align: center; 253 | margin: 25px auto 10px auto; 254 | border-bottom: 1px solid $bg-color; 255 | padding-bottom: 5px; 256 | } 257 | 258 | .policy{ 259 | width: 800px; 260 | margin: 20px auto; 261 | 262 | .over{ 263 | margin-top: 30px; 264 | text-align: right; 265 | } 266 | } 267 | 268 | .company{ 269 | width: 500px; 270 | margin: 0 auto; 271 | 272 | tr{ 273 | height: 30px; 274 | } 275 | 276 | td,th{ 277 | padding: 20px; 278 | border: solid 1px #ccc; 279 | } 280 | 281 | th{ 282 | background-color: $bg-color; 283 | color: #fff; 284 | } 285 | } 286 | 287 | .big-button{ 288 | display: block; 289 | width: 300px; 290 | margin: 20px auto; 291 | font-size: 20px; 292 | height: 30px; 293 | line-height: 30px; 294 | background-color: $bg-color; 295 | color: #fff; 296 | border: none; 297 | text-align: center; 298 | } 299 | 300 | .prof_table{ 301 | width: 300px; 302 | margin: 20px auto; 303 | th{ 304 | width: 100px; 305 | background-color: $bg-color; 306 | color: #fff; 307 | } 308 | 309 | th,td{ 310 | padding: 10px; 311 | border: solid 1px #ccc; 312 | } 313 | } -------------------------------------------------------------------------------- /fuel/app/config/config.php: -------------------------------------------------------------------------------- 1 | '/foo/', 22 | * 'base_url' => 'http://foo.com/' 23 | * 24 | * Set this to null to have it automatically detected. 25 | */ 26 | // 'base_url' => null, 27 | 28 | /** 29 | * url_suffix - Any suffix that needs to be added to 30 | * URL's generated by Fuel. If the suffix is an extension, 31 | * make sure to include the dot 32 | * 33 | * 'url_suffix' => '.html', 34 | * 35 | * Set this to an empty string if no suffix is used 36 | */ 37 | // 'url_suffix' => '', 38 | 39 | /** 40 | * index_file - The name of the main bootstrap file. 41 | * 42 | * Set this to 'index.php if you don't use URL rewriting 43 | */ 44 | // 'index_file' => false, 45 | 46 | // 'profiling' => false, 47 | 48 | /** 49 | * Default location for the file cache 50 | */ 51 | // 'cache_dir' => APPPATH.'cache/', 52 | 53 | /** 54 | * Settings for the file finder cache (the Cache class has it's own config!) 55 | */ 56 | // 'caching' => false, 57 | // 'cache_lifetime' => 3600, // In Seconds 58 | 59 | /** 60 | * Callback to use with ob_start(), set this to 'ob_gzhandler' for gzip encoding of output 61 | */ 62 | // 'ob_callback' => null, 63 | 64 | // 'errors' => array( 65 | // Which errors should we show, but continue execution? You can add the following: 66 | // E_NOTICE, E_WARNING, E_DEPRECATED, E_STRICT to mimic PHP's default behaviour 67 | // (which is to continue on non-fatal errors). We consider this bad practice. 68 | // 'continue_on' => array(), 69 | // How many errors should we show before we stop showing them? (prevents out-of-memory errors) 70 | // 'throttle' => 10, 71 | // Should notices from Error::notice() be shown? 72 | // 'notices' => true, 73 | // Render previous contents or show it as HTML? 74 | // 'render_prior' => false, 75 | // ), 76 | 77 | /** 78 | * Localization & internationalization settings 79 | */ 80 | 'language' => 'ja', // Default language 81 | 'language_fallback' => 'en', // Fallback language when file isn't available for default language 82 | 'locale' => 'ja_JP.UTF-8', // PHP set_locale() setting, null to not set 83 | 'locales' => array( 84 | 'en' => 'en_US', 85 | 'ja' => 'ja_JP' 86 | ), 87 | /** 88 | * Internal string encoding charset 89 | */ 90 | // 'encoding' => 'UTF-8', 91 | 92 | /** 93 | * DateTime settings 94 | * 95 | * server_gmt_offset in seconds the server offset from gmt timestamp when time() is used 96 | * default_timezone optional, if you want to change the server's default timezone 97 | */ 98 | // 'server_gmt_offset' => 0, 99 | 'default_timezone' => "Asia/Tokyo", 100 | 101 | /** 102 | * Logging Threshold. Can be set to any of the following: 103 | * 104 | * Fuel::L_NONE 105 | * Fuel::L_ERROR 106 | * Fuel::L_WARNING 107 | * Fuel::L_DEBUG 108 | * Fuel::L_INFO 109 | * Fuel::L_ALL 110 | */ 111 | // 'log_threshold' => Fuel::L_WARNING, 112 | // 'log_path' => APPPATH.'logs/', 113 | // 'log_date_format' => 'Y-m-d H:i:s', 114 | 115 | /** 116 | * Security settings 117 | */ 118 | 'security' => array( 119 | //'csrf_autoload' => true, //csrf対策を有効にするには、POST時にtokenを投げるように変更しないといけない 120 | //自由にユーザーを作れるA&DではあまりCSRFの対策をする意味は無い。外部公開するならちゃんとやる。 121 | 'csrf_token_key' => 'fuel_csrf_token', 122 | 'csrf_expiration' => 0, 123 | 124 | /** 125 | * A salt to make sure the generated security tokens are not predictable 126 | */ 127 | //'token_salt' => 'tekitounirandomni', 128 | 129 | /** 130 | * Allow the Input class to use X headers when present 131 | * 132 | * Examples of these are HTTP_X_FORWARDED_FOR and HTTP_X_FORWARDED_PROTO, which 133 | * can be faked which could have security implications 134 | */ 135 | 'allow_x_headers' => true, 136 | 137 | /** 138 | * This input filter can be any normal PHP function as well as 'xss_clean' 139 | * 140 | * WARNING: Using xss_clean will cause a performance hit. 141 | * How much is dependant on how much input data there is. 142 | */ 143 | 'uri_filter' => array(), // htmlentities_double_encodeを有効にするため 144 | 145 | /** 146 | * This input filter can be any normal PHP function as well as 'xss_clean' 147 | * 148 | * WARNING: Using xss_clean will cause a performance hit. 149 | * How much is dependant on how much input data there is. 150 | */ 151 | //'input_filter' => array(), 152 | 153 | /** 154 | * This output filter can be any normal PHP function as well as 'xss_clean' 155 | * 156 | * WARNING: Using xss_clean will cause a performance hit. 157 | * How much is dependant on how much input data there is. 158 | */ 159 | 'output_filter' => array('Security::htmlentities'), 160 | 161 | /** 162 | * Encoding mechanism to use on htmlentities() 163 | */ 164 | 'htmlentities_flags' => ENT_QUOTES, 165 | 166 | /** 167 | * Wether to encode HTML entities as well 168 | */ 169 | 'htmlentities_double_encode' => true, // http://blog.livedoor.jp/erscape/archives/6891635.html 170 | 171 | 172 | /** 173 | * Whether to automatically filter view data 174 | */ 175 | 'auto_filter_output' => true, 176 | 177 | /** 178 | * With output encoding switched on all objects passed will be converted to strings or 179 | * throw exceptions unless they are instances of the classes in this array. 180 | */ 181 | 'whitelisted_classes' => array( 182 | 'Fuel\\Core\\Presenter', 183 | 'Fuel\\Core\\Response', 184 | 'Fuel\\Core\\View', 185 | 'Fuel\\Core\\ViewModel', 186 | 'Closure', 187 | 'Pagination' 188 | ), 189 | ), 190 | 191 | /** 192 | * Cookie settings 193 | */ 194 | // 'cookie' => array( 195 | // Number of seconds before the cookie expires 196 | // 'expiration' => 0, 197 | // Restrict the path that the cookie is available to 198 | // 'path' => '/', 199 | // Restrict the domain that the cookie is available to 200 | // 'domain' => null, 201 | // Only transmit cookies over secure connections 202 | // 'secure' => false, 203 | // Only transmit cookies over HTTP, disabling Javascript access 204 | // 'http_only' => false, 205 | // ), 206 | 207 | /** 208 | * Validation settings 209 | */ 210 | // 'validation' => array( 211 | /** 212 | * Wether to fallback to global when a value is not found in the input array. 213 | */ 214 | // 'global_input_fallback' => true, 215 | // ), 216 | 217 | /** 218 | * Controller class prefix 219 | */ 220 | // 'controller_prefix' => 'Controller_', 221 | 222 | /** 223 | * Routing settings 224 | */ 225 | // 'routing' => array( 226 | /** 227 | * Whether URI routing is case sensitive or not 228 | */ 229 | // 'case_sensitive' => true, 230 | 231 | /** 232 | * Wether to strip the extension 233 | */ 234 | // 'strip_extension' => true, 235 | // ), 236 | 237 | /** 238 | * To enable you to split up your application into modules which can be 239 | * routed by the first uri segment you have to define their basepaths 240 | * here. By default empty, but to use them you can add something 241 | * like this: 242 | * array(APPPATH.'modules'.DS) 243 | * 244 | * Paths MUST end with a directory separator (the DS constant)! 245 | */ 246 | // 'module_paths' => array( 247 | // //APPPATH.'modules'.DS 248 | // ), 249 | 250 | /** 251 | * To enable you to split up your additions to the framework, packages are 252 | * used. You can define the basepaths for your packages here. By default 253 | * empty, but to use them you can add something like this: 254 | * array(APPPATH.'modules'.DS) 255 | * 256 | * Paths MUST end with a directory separator (the DS constant)! 257 | */ 258 | 'package_paths' => array( 259 | PKGPATH, 260 | ), 261 | 262 | /**************************************************************************/ 263 | /* Always Load */ 264 | /**************************************************************************/ 265 | 'always_load' => array( 266 | 267 | /** 268 | * These packages are loaded on Fuel's startup. 269 | * You can specify them in the following manner: 270 | * 271 | * array('auth'); // This will assume the packages are in PKGPATH 272 | * 273 | * // Use this format to specify the path to the package explicitly 274 | * array( 275 | * array('auth' => PKGPATH.'auth/') 276 | * ); 277 | */ 278 | 'packages' => array( 279 | 'orm', 280 | ), 281 | 282 | /** 283 | * These modules are always loaded on Fuel's startup. You can specify them 284 | * in the following manner: 285 | * 286 | * array('module_name'); 287 | * 288 | * A path must be set in module_paths for this to work. 289 | */ 290 | // 'modules' => array(), 291 | 292 | /** 293 | * Classes to autoload & initialize even when not used 294 | */ 295 | // 'classes' => array(), 296 | 297 | /** 298 | * Configs to autoload 299 | * 300 | * Examples: if you want to load 'session' config into a group 'session' you only have to 301 | * add 'session'. If you want to add it to another group (example: 'auth') you have to 302 | * add it like 'session' => 'auth'. 303 | * If you don't want the config in a group use null as groupname. 304 | */ 305 | 'config' => array( 306 | "prefectures" 307 | ), 308 | 309 | /** 310 | * Language files to autoload 311 | * 312 | * Examples: if you want to load 'validation' lang into a group 'validation' you only have to 313 | * add 'validation'. If you want to add it to another group (example: 'forms') you have to 314 | * add it like 'validation' => 'forms'. 315 | * If you don't want the lang in a group use null as groupname. 316 | */ 317 | // 'language' => array(), 318 | ), 319 | 320 | ); 321 | -------------------------------------------------------------------------------- /public/assets/js/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ 2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ 3 | return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("